Default Octree Implementation. More...
#include <decDefaultDOctree.h>
Public Member Functions | |
Constructors and Destructors | |
| decDefaultDOctree (const decDVector ¢er, const decDVector &halfSize) | |
| Creates a new generic octree object. | |
| virtual | ~decDefaultDOctree () |
| Cleans up the generic octree object. | |
Management | |
| virtual decDOctree * | CreateOctree (int octant) const |
| Creates new octree for the specified octant. | |
| virtual void | ClearNodeContent () |
| Clears the content of this node. | |
| decDefaultDOctree * | InsertIntoTree (void *element, const decDVector &boxCenter, const decDVector &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.
| decDefaultDOctree::decDefaultDOctree | ( | const decDVector & | center, |
| const decDVector & | halfSize | ||
| ) |
Creates a new generic octree object.
| virtual decDefaultDOctree::~decDefaultDOctree | ( | ) | [virtual] |
Cleans up the generic octree object.
| void decDefaultDOctree::AddElement | ( | void * | element ) |
Adds a element.
| virtual void decDefaultDOctree::ClearNodeContent | ( | ) | [virtual] |
Clears the content of this node.
Implements decDOctree.
| virtual decDOctree* decDefaultDOctree::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 decDOctree.
| void* decDefaultDOctree::GetElementAt | ( | int | index ) | const |
Retrieves the element at the given index.
| int decDefaultDOctree::GetElementCount | ( | ) | const [inline] |
Retrieves the number of elements.
| int decDefaultDOctree::IndexOfElement | ( | void * | element ) | const |
Retrieves the index of the given element or -1 if not found.
| decDefaultDOctree* decDefaultDOctree::InsertIntoTree | ( | void * | element, |
| const decDVector & | boxCenter, | ||
| const decDVector & | 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 decDefaultDOctree::RemoveAllElements | ( | ) |
Removes all elements.
| void decDefaultDOctree::RemoveElement | ( | void * | element ) |
Removes a element.
1.7.2