source:
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGClusterList.cpp
@
731
Revision 731, 770 bytes checked in by igarcia, 19 years ago (diff) |
---|
Rev | Line | |
---|---|---|
[699] | 1 | |
[721] | 2 | #include <IMGClusterList.h> |
[699] | 3 | |
4 | namespace IMG { | |
5 | ||
[721] | 6 | ClusterList::~ClusterList() |
7 | { | |
8 | list.clear(); | |
9 | } | |
[699] | 10 | |
[731] | 11 | bool 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] | 23 | void 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] | 33 | ClusterList::ClusterList() |
[709] | 34 | { |
[721] | 35 | list.reserve(100); |
[699] | 36 | } |
37 | ||
[731] | 38 | std::vector<Cluster> * ClusterList::getList() |
[721] | 39 | { |
40 | return &list; | |
41 | } | |
[699] | 42 | |
[731] | 43 | unsigned int ClusterList::getSize() const |
[721] | 44 | { |
45 | return list.size(); | |
[699] | 46 | } |
[721] | 47 | |
[731] | 48 | Cluster * 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.