| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/container/spacetree.h>

Public Types | |
| typedef SpaceTree< DynamicNode < CONTENT, DIM >, DIM > | BaseClass |
| typedef SpaceTree< DynamicNode < CONTENT, DIM >, DIM > ::NodePointer | NodePointer |
| typedef SpaceTreePath< DIM > | Path |
| typedef DynamicNode< CONTENT, DIM > | Node |
Public Member Functions | |
| VRS_TYPEINFO (DynamicSpaceTree, BaseClass) | |
| VRS_SERIALIZABLE (DynamicSpaceTree) | |
| DynamicSpaceTree (const Cell< DIM > &mainCell) | |
| virtual | ~DynamicSpaceTree () |
| bool | createChild (const NodePointer &node, ChildNumber childNumber) |
| NodePointer | createNode (const SpaceTreePath< DIM > &path) |
| Returns a pointer to the new node. | |
| void | deleteNode (const NodePointer &node) |
| UINT | getSize () const |
| Note: The depth computation is rather inefficient for the dynamic case. | |
| int | getDepth () const |
| child, parent and path access | |
| virtual NodePointer | getRoot () |
| virtual NodePointer | getParent (const NodePointer &node) |
| virtual NodePointer | getChild (const NodePointer &node, ChildNumber childNumber) |
| virtual ChildNumber | getChildNumber (const NodePointer &node) const |
| Iterator< NodePointer > * | leafIterator (Path path=Path()) const |
Protected Member Functions | |
| DynamicSpaceTree () | |
| typedef SpaceTree<DynamicNode<CONTENT, DIM>, DIM> VRS::DynamicSpaceTree< CONTENT, DIM >::BaseClass |
| typedef SpaceTree<DynamicNode<CONTENT, DIM>, DIM>::NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::NodePointer |
Reimplemented in VRS::DynamicOctree< CONTENT >, and VRS::DynamicQuadtree< CONTENT >.
| typedef SpaceTreePath<DIM> VRS::DynamicSpaceTree< CONTENT, DIM >::Path |
The original declaration of the following methods are part of a quite unreadable code section that need not to be read to understand how to use a SpaceTree. Therefore their declarations are repeated here: template<typename POINTSET,typename INCLUSIONTEST> SpaceTreePath<DIM> findSmallestEnclosingNode( const POINTSET& pointSet, UINT maxLevel = Path::MaxPathLength(), bool mustExist = true, INCLUSIONTEST test = DefaultInclusionTest<POINTSET>()); Returns the longest path that leads to a node whose cell completely encloses a given point set. If the path length attains "maxLevel", the search is aborted and the path of length maxLevel is returned. Not that the length of a path cannot exceed Path::MaxPathLength(). If "mustExist" is true, only existing nodes are considered. Otherwise the result can be a path leading to a still not existing node, whose cell would enclose the point set. The parameter "test" is a function object that provides an operator() with two parameters pointSet and cell, that returns true if the pointSet is contained in the cell. You can see how to realize the function object on the example of the DefaultIntersectionTest class (see below). If POINTSET provides a method isContainedIn(Cell), the test parameter can be left out. template<typename POINTSET, typename INTERSECTIONTEST> Iterator<SpaceTreePath<DIM> >* findIntersectingNodes( const POINTSET& pointSet, UINT level, bool mustExist = true, INTERSECTIONTEST test = DefaultIntersectionTest<POINTSET>()); Returns an iterator of paths to all nodes on a specified tree level that intersect a given point set. For the "mustExist" parameter see above. The intersection test of a point set and a cell is performed similar to the inclusion test above. The parameter "test" can be left out if POINTSET provides a method intersects(Cell). template<typename POINTSET, typename INCLUSIONTEST> Iterator<SpaceTreePath<DIM> >* findEnclosingNodes( const POINTSET& pointSet, UINT level, bool mustExist, INCLUSIONTEST test) { This method is only useful for derivates of SpaceTree that enable overlapping cells. Otherwise the result is empty or contains exactly one element,
Reimplemented from VRS::SpaceTree< NODE, DIM >.
Reimplemented in VRS::DynamicOctree< CONTENT >, and VRS::DynamicQuadtree< CONTENT >.
| typedef DynamicNode<CONTENT, DIM> VRS::DynamicSpaceTree< CONTENT, DIM >::Node |
| VRS::DynamicSpaceTree< CONTENT, DIM >::DynamicSpaceTree | ( | const Cell< DIM > & | mainCell | ) |
| virtual VRS::DynamicSpaceTree< CONTENT, DIM >::~DynamicSpaceTree | ( | ) | [virtual] |
| VRS::DynamicSpaceTree< CONTENT, DIM >::DynamicSpaceTree | ( | ) | [protected] |
| VRS::DynamicSpaceTree< CONTENT, DIM >::VRS_TYPEINFO | ( | DynamicSpaceTree< CONTENT, DIM > | , | |
| BaseClass | ||||
| ) |
| VRS::DynamicSpaceTree< CONTENT, DIM >::VRS_SERIALIZABLE | ( | DynamicSpaceTree< CONTENT, DIM > | ) |
| bool VRS::DynamicSpaceTree< CONTENT, DIM >::createChild | ( | const NodePointer & | node, | |
| ChildNumber | childNumber | |||
| ) |
| NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::createNode | ( | const SpaceTreePath< DIM > & | path | ) |
Returns a pointer to the new node.
If the referred node has been existent before, this method behaves equal to getNode().
| void VRS::DynamicSpaceTree< CONTENT, DIM >::deleteNode | ( | const NodePointer & | node | ) |
| UINT VRS::DynamicSpaceTree< CONTENT, DIM >::getSize | ( | ) | const |
Note: The depth computation is rather inefficient for the dynamic case.
For an empty tree, the depth -1 is returned.
| int VRS::DynamicSpaceTree< CONTENT, DIM >::getDepth | ( | ) | const |
child, parent and path access
| virtual NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::getRoot | ( | ) | [virtual] |
Each node access is done by an via NodePointers. A NodePointer provides access to a specific node of a specific tree similar to a usual pointer by * and -> operator. Using invalid NodePointers causes an assertion. Invalid pointers are return for example if a requested node does not exist. The NodePointer provides a validity check method valid(). Note: If a node of a tree is deleted, all existing NodePointers pointing to any nodes of the tree become invalid. Basic SpaceTree access methods. If you want to derive a class from SpaceTree, please note: It is assumed that the first three of the methods below return an invalid NodePointer if the requested Node does not exist.
Implements VRS::SpaceTree< NODE, DIM >.
| virtual NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::getParent | ( | const NodePointer & | node | ) | [virtual] |
Implements VRS::SpaceTree< NODE, DIM >.
| virtual NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::getChild | ( | const NodePointer & | node, | |
| ChildNumber | childNumber | |||
| ) | [virtual] |
Implements VRS::SpaceTree< NODE, DIM >.
| virtual ChildNumber VRS::DynamicSpaceTree< CONTENT, DIM >::getChildNumber | ( | const NodePointer & | node | ) | const [virtual] |
Converting between Paths and NodePointers. Each valid NodePointer corresponds to a valid SpaceTreePath, but not vice versa, because a node specified by a path may not exist.
Implements VRS::SpaceTree< NODE, DIM >.
| Iterator<NodePointer>* VRS::DynamicSpaceTree< CONTENT, DIM >::leafIterator | ( | Path | path = Path() |
) | const |
creates an iterator containing node pointers to all (existing) leafes of the subtree defined by path. If path does refer to an existing node, the result is empty.