decDefaultOctree Class Reference

Default Octree Implementation. More...

#include <decDefaultOctree.h>

Inheritance diagram for decDefaultOctree:
decOctree

List of all members.

Public Member Functions

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

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

decDefaultOctree::decDefaultOctree ( const decVector center,
const decVector halfSize 
)

Creates a new generic octree object.

virtual decDefaultOctree::~decDefaultOctree (  ) [virtual]

Cleans up the generic octree object.


Member Function Documentation

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.


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