version 3.3

VRS::SpaceTreePath< DIM > Class Template Reference

#include <vrs/container/spacetree.h>

List of all members.

Public Member Functions

 SpaceTreePath ()
 SpaceTreePath (const SpaceTreePath< DIM > &other)
 SpaceTreePath (Iterator< ChildNumber > *childNumbers)
SpaceTreePath getChild (ChildNumber childNumber) const
SpaceTreePath getParent () const
ChildNumber getChildNumber () const
bool getNeighbor (UINT directionBitCode)
Iterator< SpaceTreePath > * getNeighbors () const
bool getMainAxisNeighbor (UINT direction)
bool isRoot () const
UINT getLength () const
bool valid () const
Iterator< ChildNumber > * newIterator () const
const SpaceTreePathoperator= (const SpaceTreePath &other)
bool operator== (const SpaceTreePath &other) const
bool operator< (const SpaceTreePath &other) const
bool operator!= (const SpaceTreePath &other) const
 SpaceTreePath (UINT pathCode)
UINT getPathCode () const
void setPathCode (UINT c)

Static Public Member Functions

static Iterator< SpaceTreePath > * newLevelIterator (UINT level)
static SO< Iterator
< SpaceTreePath > > 
newSubTreeLevelIterator (SpaceTreePath subTreeRoot, unsigned int level)
static UINT MaxPathLength ()

Static Public Attributes

static const UINT Left
 smaller x
static const UINT Right
 greater x
static const UINT Down
 smaller y
static const UINT Up
 greater y
static const UINT Front
 smaller z
static const UINT Back
 greater z
static const ChildNumber MaxChilds
static const ChildNumber InvalidChildNumber
static const SpaceTreePath InvalidPath


Detailed Description

template<UINT DIM>
class VRS::SpaceTreePath< DIM >

A SpaceTreePath encodes a path in a space tree. It is only applicable on SpaceTrees of the dimension dim, but independent of a specific tree. For a given SpaceTree a SpaceTreePath corresponds to an unique, but possibly not existing node.

Constructor & Destructor Documentation

template<UINT DIM>
VRS::SpaceTreePath< DIM >::SpaceTreePath (  ) 

template<UINT DIM>
VRS::SpaceTreePath< DIM >::SpaceTreePath ( const SpaceTreePath< DIM > &  other  ) 

template<UINT DIM>
VRS::SpaceTreePath< DIM >::SpaceTreePath ( Iterator< ChildNumber > *  childNumbers  ) 

template<UINT DIM>
VRS::SpaceTreePath< DIM >::SpaceTreePath ( UINT  pathCode  ) 


Member Function Documentation

template<UINT DIM>
SpaceTreePath VRS::SpaceTreePath< DIM >::getChild ( ChildNumber  childNumber  )  const

returns the path to the given child node.

template<UINT DIM>
SpaceTreePath VRS::SpaceTreePath< DIM >::getParent (  )  const

returns the parent node or an invalid Path, if the current path defines the root.

template<UINT DIM>
ChildNumber VRS::SpaceTreePath< DIM >::getChildNumber (  )  const

getChildNumber() returns k if the currently represented node n is the k-th child of another node. if n ist the root, InvalidChildNumber is returned.

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::getNeighbor ( UINT  directionBitCode  ) 

getNeighbor() changes the path, so that it leads to the neighbor in the specified direction. The return value is false only if such a neighbor cannot exist even in a complete tree. For example if you call getNeighbor(left) for a path, that leads to a leftmost node. For Dim<4 you do not need to calculate directionBitCodes, but can use the static constants left, right, etc. (see below) and combine them by bitwise or.

For DIM>4 the directionBitCode can be found as follows: To specify a direction of a neighbor in the "Dim"-dimensional space, you have to choose for each main axis if the position vector of the cell of the neighbor should have a smaller, equal or greater value in the corresponding component as the position vector of the currently represented node. Assign a 2-bit code to each case, namely 00 = equal, 01 = smaller, 10 = greater. Now connect the 2-bit values of each axis to a single number, where the first coordinate axis is represented by the 2 bits of lowest value. The system can be understood by first looking at a simpler case like Dim=2: If you want to find the directionBitCode for the upper right neighbor, the bitcodes for both main coordinate axes are 01 and 10.

bitvalue: 1 2 4 8 bit: 0 1 1 0

Therefore the bitcode is 6.

template<UINT DIM>
Iterator<SpaceTreePath>* VRS::SpaceTreePath< DIM >::getNeighbors (  )  const

Returns an Iterator of paths to all neighbors of the currently represented node. Normally the number of these neighbors is 3^DIM-1, but it can be less (for boundary nodes).

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::getMainAxisNeighbor ( UINT  direction  ) 

Simple neighbor access without the option of finding diagonal neighbors. The directions is specified as follows: 0 = left (lower x) 1 = right (greater x) 2 = up (lower y) 3 = down (greater y) ...

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::isRoot (  )  const

template<UINT DIM>
UINT VRS::SpaceTreePath< DIM >::getLength (  )  const

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::valid (  )  const

template<UINT DIM>
Iterator<ChildNumber>* VRS::SpaceTreePath< DIM >::newIterator (  )  const

template<UINT DIM>
const SpaceTreePath& VRS::SpaceTreePath< DIM >::operator= ( const SpaceTreePath< DIM > &  other  ) 

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::operator== ( const SpaceTreePath< DIM > &  other  )  const

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::operator< ( const SpaceTreePath< DIM > &  other  )  const

template<UINT DIM>
bool VRS::SpaceTreePath< DIM >::operator!= ( const SpaceTreePath< DIM > &  other  )  const

template<UINT DIM>
static Iterator<SpaceTreePath>* VRS::SpaceTreePath< DIM >::newLevelIterator ( UINT  level  )  [static]

template<UINT DIM>
static SO<Iterator<SpaceTreePath> > VRS::SpaceTreePath< DIM >::newSubTreeLevelIterator ( SpaceTreePath< DIM >  subTreeRoot,
unsigned int  level 
) [static]

Creates an iterator containing paths to all nodes on the given level of the subtree with root 'path'. Direction constants for the first three dimensions. Note that the definitions of Left/Right, Up/Down, or Forward/Backward can be inverted dependent on the used coordinate system. The comments on the right give unique definitions.

The direction constants are suited ONLY as parameters for getNeighbor(), but NOT appropriate for getMainAxisNeighbor().

template<UINT DIM>
static UINT VRS::SpaceTreePath< DIM >::MaxPathLength (  )  [inline, static]

The following methods provides direct access to the path code. Normally this methods should not be needed, but it can be used by static index-based trees to improve the performance.

template<UINT DIM>
UINT VRS::SpaceTreePath< DIM >::getPathCode (  )  const

template<UINT DIM>
void VRS::SpaceTreePath< DIM >::setPathCode ( UINT  c  ) 


Member Data Documentation

template<UINT DIM>
const UINT VRS::SpaceTreePath< DIM >::Left [static]

smaller x

template<UINT DIM>
const UINT VRS::SpaceTreePath< DIM >::Right [static]

greater x

template<UINT DIM>
const UINT VRS::SpaceTreePath< DIM >::Down [static]

smaller y

template<UINT DIM>
const UINT VRS::SpaceTreePath< DIM >::Up [static]

greater y

template<UINT DIM>
const UINT VRS::SpaceTreePath< DIM >::Front [static]

smaller z

template<UINT DIM>
const UINT VRS::SpaceTreePath< DIM >::Back [static]

greater z

template<UINT DIM>
const ChildNumber VRS::SpaceTreePath< DIM >::MaxChilds [static]

template<UINT DIM>
const ChildNumber VRS::SpaceTreePath< DIM >::InvalidChildNumber [static]

template<UINT DIM>
const SpaceTreePath VRS::SpaceTreePath< DIM >::InvalidPath [static]


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

Generated on Tue May 22 06:00:19 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact