![]() |
VR-Forces 4.8 Class Documentation
|

Public Types | |
| typedef std::map< T *, DtOctreeMember< T > * > | MemberContainer |
| Container and iterator typedefs for the STL structures used. More... | |
| typedef std::map< T *, DtOctreeMember< T > * >::iterator | MemberIterator |
| typedef std::list< T * > | OutsideAreaContainer |
| typedef std::list< T * >::iterator | OutsideAreaIterator |
| typedef DtSpatialSelectionFunctorTemplate < T > | SpatialSelectionFunctor |
Public Member Functions | |
| DtOctree (const DtExtent ®ion) | |
| Constructor. The extent covered by an octree may not be changed once the octree is created. More... | |
| virtual | ~DtOctree () |
| Destructor. Deletes the octree and any members in it (though not the corresponding objects). More... | |
| virtual void | visitObjects (const DtExtent &extent, DtSpatialSelectionFunctorTemplate< T > &callback) |
| Call the given functor for every member that shares a node with the specified extent. More... | |
| virtual void | addObject (T *object, const DtExtent &extent) |
| TODO: Add search key to outside octree list so that objects which fall completely outside the octree region can be filtered out of searches completely within. More... | |
| virtual void | removeObject (T *object) |
| Remove a member from the octree. More... | |
| virtual void | updatePositions () |
| Process any updates to the objects' positions that have happened since they were added to the octree. More... | |
| bool | containsObject (T *object) |
| int | numObjects () |
| int | numObjectsOutside () |
Protected Member Functions | |
| bool | removeObjectOutsideArea (T *object) |
Protected Attributes | |
| DtOctreeNode< T > * | myRootNode |
| Root node of the octree. More... | |
| OutsideAreaContainer | myObjectsOutsideArea |
| List of objects which are at least partially outside the octree's root extent. More... | |
| MemberContainer | myMemberMap |
| Mapping of T* pointers to DtOctreeMember objects in the tree. More... | |
| unsigned int | mySearchKey |
DtOctree class.
DtOctree implements an octree, for storing arbitary objects with extents in a way that makes it fast to enumerate objects that intersect a specified extent.
Currently there's some sloppiness in the implementation which will make it difficult to specialize this template to objects other than DtVrfObjects, but it's good to keep that sloppiness to a minimum, as this class would be useful for other things (notably terrain triangles).
The outer octree class does attempt to deal with objects which are outside the octree's defined region, but it does not do so efficiently.
| typedef std::map<T*, DtOctreeMember<T>*> DtOctree< T >::MemberContainer |
Container and iterator typedefs for the STL structures used.
| typedef std::map<T*, DtOctreeMember<T>*>::iterator DtOctree< T >::MemberIterator |
| typedef std::list<T*> DtOctree< T >::OutsideAreaContainer |
| typedef std::list<T*>::iterator DtOctree< T >::OutsideAreaIterator |
| typedef DtSpatialSelectionFunctorTemplate<T> DtOctree< T >::SpatialSelectionFunctor |
Constructor. The extent covered by an octree may not be changed once the octree is created.
Destructor. Deletes the octree and any members in it (though not the corresponding objects).
|
inlinevirtual |
Call the given functor for every member that shares a node with the specified extent.
This does not test for exact intersection; it only iterates over any objects that might intersect the given extent (i.e. there may be extras).
|
inlinevirtual |
TODO: Add search key to outside octree list so that objects which fall completely outside the octree region can be filtered out of searches completely within.
Add a member to the octree.
|
inlinevirtual |
Remove a member from the octree.
Referenced by DtOctree< const DtVrfObject >::updatePositions().
|
inlinevirtual |
Process any updates to the objects' positions that have happened since they were added to the octree.
If members' extents change, they will still be returned from visitMembers() as if they held the old position until this function is called. Once this function is called, objects will intersect using the newly-specified positions (until the function is called again, obviously).
Referenced by DtOctree< const DtVrfObject >::removeObject().
|
protected |
|
protected |
List of objects which are at least partially outside the octree's root extent.
Referenced by DtOctree< const DtVrfObject >::addObject(), DtOctree< const DtVrfObject >::containsObject(), DtOctree< const DtVrfObject >::numObjects(), DtOctree< const DtVrfObject >::numObjectsOutside(), DtOctree< const DtVrfObject >::removeObjectOutsideArea(), DtOctree< const DtVrfObject >::updatePositions(), and DtOctree< const DtVrfObject >::visitObjects().
|
protected |
Mapping of T* pointers to DtOctreeMember objects in the tree.
Referenced by DtOctree< const DtVrfObject >::addObject(), DtOctree< const DtVrfObject >::containsObject(), DtOctree< const DtVrfObject >::numObjects(), DtOctree< const DtVrfObject >::removeObject(), DtOctree< const DtVrfObject >::updatePositions(), and DtOctree< const DtVrfObject >::~DtOctree().
Referenced by DtOctree< const DtVrfObject >::visitObjects().