source: GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGClusterList.cpp @ 731

Revision 731, 770 bytes checked in by igarcia, 18 years ago (diff)
RevLine 
[699]1
[721]2#include <IMGClusterList.h>
[699]3
4namespace IMG {
5
[721]6ClusterList::~ClusterList()
7{
8        list.clear();
9}
[699]10
[731]11bool ClusterList::insert(Cluster * p)
[721]12{
13        if (!p)
14        {
15                return false;
16        }
17
[699]18        list.push_back(*p);
[721]19       
[699]20        return true;
21}
22
[731]23void ClusterList::print()
[721]24{
25        Ogre::LogManager::getSingleton().logMessage("nNombre de  cluster a la llista: " + Ogre::StringConverter::toString(list.size()));
[731]26
[699]27        for (register int i = 0; i < list.size(); i ++)
28        {
[731]29                this->get(i)->print();
[721]30        }       
[699]31}
32
[721]33ClusterList::ClusterList()
[709]34{
[721]35    list.reserve(100);
[699]36}
37
[731]38std::vector<Cluster> * ClusterList::getList()
[721]39{
40        return &list;
41}
[699]42
[731]43unsigned int ClusterList::getSize() const
[721]44{
45        return list.size();
[699]46}
[721]47
[731]48Cluster * ClusterList::get(unsigned int i)
[721]49{
50    if (i <= list.size())
51        {
52                return &list[i];
53        }
54   
55    return NULL;
56}
57
58}
Note: See TracBrowser for help on using the repository browser.