version 3.3

VRS::DynamicSpaceTree< CONTENT, DIM > Class Template Reference

#include <vrs/container/spacetree.h>

Inheritance diagram for VRS::DynamicSpaceTree< CONTENT, DIM >:

VRS::SpaceTree< NODE, DIM > VRS::SharedObj VRS::Visitable

List of all members.

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 ()


Detailed Description

template<typename CONTENT, UINT DIM>
class VRS::DynamicSpaceTree< CONTENT, DIM >

A DynamicSpaceTree is a specialisation of a SpaceTree that enables to delete existing nodes or to create new nodes. The template parameter content specifies the type of data that is stored in each node. For a given NodePointer np the content of the node can be accessed by typing "np->content".

Member Typedef Documentation

template<typename CONTENT, UINT DIM>
typedef SpaceTree<DynamicNode<CONTENT, DIM>, DIM> VRS::DynamicSpaceTree< CONTENT, DIM >::BaseClass

template<typename CONTENT, UINT DIM>
typedef SpaceTree<DynamicNode<CONTENT, DIM>, DIM>::NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::NodePointer

template<typename CONTENT, UINT DIM>
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 >.

template<typename CONTENT, UINT DIM>
typedef DynamicNode<CONTENT, DIM> VRS::DynamicSpaceTree< CONTENT, DIM >::Node


Constructor & Destructor Documentation

template<typename CONTENT, UINT DIM>
VRS::DynamicSpaceTree< CONTENT, DIM >::DynamicSpaceTree ( const Cell< DIM > &  mainCell  ) 

template<typename CONTENT, UINT DIM>
virtual VRS::DynamicSpaceTree< CONTENT, DIM >::~DynamicSpaceTree (  )  [virtual]

template<typename CONTENT, UINT DIM>
VRS::DynamicSpaceTree< CONTENT, DIM >::DynamicSpaceTree (  )  [protected]


Member Function Documentation

template<typename CONTENT, UINT DIM>
VRS::DynamicSpaceTree< CONTENT, DIM >::VRS_TYPEINFO ( DynamicSpaceTree< CONTENT, DIM >  ,
BaseClass   
)

template<typename CONTENT, UINT DIM>
VRS::DynamicSpaceTree< CONTENT, DIM >::VRS_SERIALIZABLE ( DynamicSpaceTree< CONTENT, DIM >   ) 

template<typename CONTENT, UINT DIM>
bool VRS::DynamicSpaceTree< CONTENT, DIM >::createChild ( const NodePointer node,
ChildNumber  childNumber 
)

template<typename CONTENT, UINT DIM>
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().

template<typename CONTENT, UINT DIM>
void VRS::DynamicSpaceTree< CONTENT, DIM >::deleteNode ( const NodePointer node  ) 

template<typename CONTENT, UINT DIM>
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.

template<typename CONTENT, UINT DIM>
int VRS::DynamicSpaceTree< CONTENT, DIM >::getDepth (  )  const

child, parent and path access

template<typename CONTENT, UINT DIM>
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 >.

template<typename CONTENT, UINT DIM>
virtual NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::getParent ( const NodePointer node  )  [virtual]

template<typename CONTENT, UINT DIM>
virtual NodePointer VRS::DynamicSpaceTree< CONTENT, DIM >::getChild ( const NodePointer node,
ChildNumber  childNumber 
) [virtual]

template<typename CONTENT, UINT 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 >.

template<typename CONTENT, UINT 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.


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

Generated on Mon May 21 06:00:17 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact