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

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