decDefaultDOctree Class Reference

Default Octree Implementation. More...

#include <decDefaultDOctree.h>

Inheritance diagram for decDefaultDOctree:
decDOctree

List of all members.

Public Member Functions

Constructors and Destructors
 decDefaultDOctree (const decDVector &center, const decDVector &halfSize)
 Creates a new generic octree object.
virtual ~decDefaultDOctree ()
 Cleans up the generic octree object.
Management
virtual decDOctreeCreateOctree (int octant) const
 Creates new octree for the specified octant.
virtual void ClearNodeContent ()
 Clears the content of this node.
decDefaultDOctreeInsertIntoTree (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.

Detailed Description

Default Octree Implementation.

Default implementation of the octree storing a list of objects.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

decDefaultDOctree::decDefaultDOctree ( const decDVector center,
const decDVector halfSize 
)

Creates a new generic octree object.

virtual decDefaultDOctree::~decDefaultDOctree (  ) [virtual]

Cleans up the generic octree object.


Member Function Documentation

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.


The documentation for this class was generated from the following file: