Simox  2.3.49
VirtualRobot::VoxelTreeNDElement< T, N > Class Template Reference

Data Structures

struct  datablock
 

Public Member Functions

 VoxelTreeNDElement (float p[N], int level, VoxelTreeND< T, N > *master)
 
virtual ~VoxelTreeNDElement ()
 
bool setEntry (float p[N], const T &e)
 
bool hasEntry (float p[N])
 
T * getEntry (float p[N])
 
VoxelTreeNDElementgetLeaf (float pos[N])
 
VoxelTreeNDElementmaxLeaf (const Eigen::VectorXf &pos)
 
std::vector< VoxelTreeNDElement * > getAllLeafs (const Eigen::VectorXf &pos)
 
bool isLeaf ()
 
T * getEntry ()
 if isLeaf the corresponding entry is returned More...
 
float getExtend (unsigned int d)
 
int getLevel ()
 
Eigen::VectorXf getVoxelCenter ()
 
long countNodesRecursive ()
 

Protected Member Functions

std::vector< int > getAllChildrenIndx (const Eigen::VectorXf &p)
 
bool write (datablock &storeData)
 
bool read (const datablock &data, const std::map< unsigned int, VoxelTreeNDElement * > &idElementMapping)
 
VoxelTreeNDElement< T, N > * createChild (float p[N])
 
int getChildIndx (float p[N])
 
bool covers (float p[N])
 
void accumulateMemoryConsumtion (long &storeMemStructure, long &storeMemData)
 
void collectElements (std::vector< VoxelTreeNDElement * > &elements)
 
void propagateData (float p[N], int level, VoxelTreeND< T, N > *master)
 
void deleteData ()
 
VoxelTreeNDElement< T, N > * getNextChild (int startIndex, int &storeElementNr)
 

Protected Attributes

VoxelTreeNDElement ** children
 
T * entry
 
bool leaf
 
float pos [N]
 
int level
 
unsigned int id
 
VoxelTreeND< T, N > * tree
 

Friends

class VoxelTreeND< T, N >
 

Detailed Description

template<typename T, unsigned int N>
class VirtualRobot::VoxelTreeNDElement< T, N >

A template definition for storing elements of a voxelized n-d grid. Internally the elements are copied!

Constructor & Destructor Documentation

template<typename T, unsigned int N>
VirtualRobot::VoxelTreeNDElement< T, N >::VoxelTreeNDElement ( float  p[N],
int  level,
VoxelTreeND< T, N > *  master 
)
inline

Construct an element at position p with given extends.

template<typename T, unsigned int N>
virtual VirtualRobot::VoxelTreeNDElement< T, N >::~VoxelTreeNDElement ( )
inlinevirtual

Member Function Documentation

template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::accumulateMemoryConsumtion ( long &  storeMemStructure,
long &  storeMemData 
)
inlineprotected
template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::collectElements ( std::vector< VoxelTreeNDElement< T, N > * > &  elements)
inlineprotected
template<typename T, unsigned int N>
long VirtualRobot::VoxelTreeNDElement< T, N >::countNodesRecursive ( )
inline
template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::covers ( float  p[N])
inlineprotected
template<typename T, unsigned int N>
VoxelTreeNDElement<T, N>* VirtualRobot::VoxelTreeNDElement< T, N >::createChild ( float  p[N])
inlineprotected
template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::deleteData ( )
inlineprotected
template<typename T, unsigned int N>
std::vector<int> VirtualRobot::VoxelTreeNDElement< T, N >::getAllChildrenIndx ( const Eigen::VectorXf &  p)
inlineprotected
template<typename T, unsigned int N>
std::vector<VoxelTreeNDElement*> VirtualRobot::VoxelTreeNDElement< T, N >::getAllLeafs ( const Eigen::VectorXf &  pos)
inline
template<typename T, unsigned int N>
int VirtualRobot::VoxelTreeNDElement< T, N >::getChildIndx ( float  p[N])
inlineprotected
template<typename T, unsigned int N>
T* VirtualRobot::VoxelTreeNDElement< T, N >::getEntry ( float  p[N])
inline

Returns pointer to element when existing. NULL if not.

template<typename T, unsigned int N>
T* VirtualRobot::VoxelTreeNDElement< T, N >::getEntry ( )
inline

if isLeaf the corresponding entry is returned

template<typename T, unsigned int N>
float VirtualRobot::VoxelTreeNDElement< T, N >::getExtend ( unsigned int  d)
inline
template<typename T, unsigned int N>
VoxelTreeNDElement* VirtualRobot::VoxelTreeNDElement< T, N >::getLeaf ( float  pos[N])
inline
template<typename T, unsigned int N>
int VirtualRobot::VoxelTreeNDElement< T, N >::getLevel ( )
inline
template<typename T, unsigned int N>
VoxelTreeNDElement<T, N>* VirtualRobot::VoxelTreeNDElement< T, N >::getNextChild ( int  startIndex,
int &  storeElementNr 
)
inlineprotected
template<typename T, unsigned int N>
Eigen::VectorXf VirtualRobot::VoxelTreeNDElement< T, N >::getVoxelCenter ( )
inline
template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::hasEntry ( float  p[N])
inline

Checks if there is an entry at the given position. True when this node is a leaf and the entry is set or the child at p exists and returns true on getChild(p)->hasEntry(p).

template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::isLeaf ( )
inline
template<typename T, unsigned int N>
VoxelTreeNDElement* VirtualRobot::VoxelTreeNDElement< T, N >::maxLeaf ( const Eigen::VectorXf &  pos)
inline
template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::propagateData ( float  p[N],
int  level,
VoxelTreeND< T, N > *  master 
)
inlineprotected
template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::read ( const datablock data,
const std::map< unsigned int, VoxelTreeNDElement< T, N > * > &  idElementMapping 
)
inlineprotected
template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::setEntry ( float  p[N],
const T &  e 
)
inline

Automatically checks if a new child element has to be created. A copy of e is stored.

template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::write ( datablock storeData)
inlineprotected

Friends And Related Function Documentation

template<typename T, unsigned int N>
friend class VoxelTreeND< T, N >
friend

Field Documentation

template<typename T, unsigned int N>
VoxelTreeNDElement** VirtualRobot::VoxelTreeNDElement< T, N >::children
protected
template<typename T, unsigned int N>
T* VirtualRobot::VoxelTreeNDElement< T, N >::entry
protected
template<typename T, unsigned int N>
unsigned int VirtualRobot::VoxelTreeNDElement< T, N >::id
protected
template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::leaf
protected
template<typename T, unsigned int N>
int VirtualRobot::VoxelTreeNDElement< T, N >::level
protected
template<typename T, unsigned int N>
float VirtualRobot::VoxelTreeNDElement< T, N >::pos[N]
protected
template<typename T, unsigned int N>
VoxelTreeND<T, N>* VirtualRobot::VoxelTreeNDElement< T, N >::tree
protected