Line | |
---|
1 | |
---|
2 | #include <IMGClusterList.h> |
---|
3 | |
---|
4 | namespace IMG { |
---|
5 | |
---|
6 | ClusterList::~ClusterList() |
---|
7 | { |
---|
8 | list.clear(); |
---|
9 | } |
---|
10 | |
---|
11 | bool 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 | |
---|
23 | void 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 | |
---|
33 | ClusterList::ClusterList() |
---|
34 | { |
---|
35 | list.reserve(100); |
---|
36 | } |
---|
37 | |
---|
38 | std::vector<Cluster> * ClusterList::getList() |
---|
39 | { |
---|
40 | return &list; |
---|
41 | } |
---|
42 | |
---|
43 | unsigned int ClusterList::getSize() const |
---|
44 | { |
---|
45 | return list.size(); |
---|
46 | } |
---|
47 | |
---|
48 | Cluster * 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.