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

Public Types | |
| typedef std::map< T *, DtOctreeMember< T > * > | MemberContainer |
| Container and iterator typedefs for the STL structures used. | |
| typedef std::map< T *, DtOctreeMember< T > * >::iterator | MemberIterator |
| typedef std::list< T * > | OutsideAreaContainer |
| typedef std::list< T * >::iterator | OutsideAreaIterator |
Public Member Functions | |
| DtOctree (const DtExtent ®ion) | |
| Constructor. The extent covered by an octree may not be changed once the octree is created. | |
| virtual | ~DtOctree () |
| Destructor. Deletes the octree and any members in it (though not the corresponding objects). | |
| virtual void | visitObjects (const DtExtent &extent, DtSpatialSelectionFunctor &callback) |
| Call the given functor for every member that shares a node with the specified extent. | |
| 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. | |
| virtual void | removeObject (T *object) |
| Remove a member from the octree. | |
| virtual void | updatePositions () |
| Process any updates to the objects' positions that have happened since they were added to the octree. | |
| 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. | |
| OutsideAreaContainer | myObjectsOutsideArea |
| List of objects which are at least partially outside the octree's root extent. | |
| MemberContainer | myMemberMap |
| Mapping of T* pointers to DtOctreeMember objects in the tree. | |
| 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 |
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< 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< DtVrfObject >::removeObject().
|
protected |
Root node of the octree.
Referenced by DtOctree< DtVrfObject >::addObject(), DtOctree< DtVrfObject >::DtOctree(), DtOctree< DtVrfObject >::updatePositions(), DtOctree< DtVrfObject >::visitObjects(), and DtOctree< DtVrfObject >::~DtOctree().
|
protected |
List of objects which are at least partially outside the octree's root extent.
Referenced by DtOctree< DtVrfObject >::addObject(), DtOctree< DtVrfObject >::containsObject(), DtOctree< DtVrfObject >::numObjects(), DtOctree< DtVrfObject >::numObjectsOutside(), DtOctree< DtVrfObject >::removeObjectOutsideArea(), DtOctree< DtVrfObject >::updatePositions(), and DtOctree< DtVrfObject >::visitObjects().
|
protected |
Mapping of T* pointers to DtOctreeMember objects in the tree.
Referenced by DtOctree< DtVrfObject >::addObject(), DtOctree< DtVrfObject >::containsObject(), DtOctree< DtVrfObject >::numObjects(), DtOctree< DtVrfObject >::removeObject(), DtOctree< DtVrfObject >::updatePositions(), and DtOctree< DtVrfObject >::~DtOctree().
Referenced by DtOctree< DtVrfObject >::visitObjects().