Default Octree Implementation. More...
#include <decDefaultOctree.h>
Public Member Functions | |
Constructors and Destructors | |
| decDefaultOctree (const decVector ¢er, const decVector &halfSize) | |
| Creates a new generic octree object. | |
| virtual | ~decDefaultOctree () |
| Cleans up the generic octree object. | |
Management | |
| virtual decOctree * | CreateOctree (int octant) const |
| Creates new octree for the specified octant. | |
| virtual void | ClearNodeContent () |
| Clears the content of this node. | |
| decDefaultOctree * | InsertIntoTree (void *element, const decVector &boxCenter, const decVector &boxHalfSize, int maxDepth=DECDO_MAX_DEPTH) |
| Adds a new object to the octree. | |
Elements | |
| int | GetElementCount () const |
| Retrieves the number of elements. | |
| void * | GetElementAt (int index) const |
| Retrieves the element at the given index. | |
| int | IndexOfElement (void *element) const |
| Retrieves the index of the given element or -1 if not found. | |
| void | AddElement (void *element) |
| Adds a element. | |
| void | RemoveElement (void *element) |
| Removes a element. | |
| void | RemoveAllElements () |
| Removes all elements. | |
Default Octree Implementation.
Default implementation of the octree storing a list of objects.
Creates a new generic octree object.
| virtual decDefaultOctree::~decDefaultOctree | ( | ) | [virtual] |
Cleans up the generic octree object.
| void decDefaultOctree::AddElement | ( | void * | element ) |
Adds a element.
| virtual void decDefaultOctree::ClearNodeContent | ( | ) | [virtual] |
Clears the content of this node.
Implements decOctree.
| virtual decOctree* decDefaultOctree::CreateOctree | ( | int | octant ) | const [virtual] |
Creates new octree for the specified octant.
Implement this function to create a new octree of your own type. Do not set the parent of octree. The caller is responsible for this action if applicable.
Implements decOctree.
| void* decDefaultOctree::GetElementAt | ( | int | index ) | const |
Retrieves the element at the given index.
| int decDefaultOctree::GetElementCount | ( | ) | const [inline] |
Retrieves the number of elements.
| int decDefaultOctree::IndexOfElement | ( | void * | element ) | const |
Retrieves the index of the given element or -1 if not found.
| decDefaultOctree* decDefaultOctree::InsertIntoTree | ( | void * | element, |
| const decVector & | boxCenter, | ||
| const decVector & | boxHalfSize, | ||
| int | maxDepth = DECDO_MAX_DEPTH |
||
| ) |
Adds a new object to the octree.
The object is placed in the node which hosts the specified box. Returns the node where the element has been placed into.
| void decDefaultOctree::RemoveAllElements | ( | ) |
Removes all elements.
| void decDefaultOctree::RemoveElement | ( | void * | element ) |
Removes a element.
1.7.2