Simox  2.3.74.0
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

◆ VoxelTreeNDElement()

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.

◆ ~VoxelTreeNDElement()

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

Member Function Documentation

◆ accumulateMemoryConsumtion()

template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::accumulateMemoryConsumtion ( long &  storeMemStructure,
long &  storeMemData 
)
inlineprotected

◆ collectElements()

template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::collectElements ( std::vector< VoxelTreeNDElement< T, N > *> &  elements)
inlineprotected

◆ countNodesRecursive()

template<typename T, unsigned int N>
long VirtualRobot::VoxelTreeNDElement< T, N >::countNodesRecursive ( )
inline

◆ covers()

template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::covers ( float  p[N])
inlineprotected

◆ createChild()

template<typename T, unsigned int N>
VoxelTreeNDElement<T, N>* VirtualRobot::VoxelTreeNDElement< T, N >::createChild ( float  p[N])
inlineprotected

◆ deleteData()

template<typename T, unsigned int N>
void VirtualRobot::VoxelTreeNDElement< T, N >::deleteData ( )
inlineprotected

◆ getAllChildrenIndx()

template<typename T, unsigned int N>
std::vector<int> VirtualRobot::VoxelTreeNDElement< T, N >::getAllChildrenIndx ( const Eigen::VectorXf &  p)
inlineprotected

◆ getAllLeafs()

template<typename T, unsigned int N>
std::vector<VoxelTreeNDElement*> VirtualRobot::VoxelTreeNDElement< T, N >::getAllLeafs ( const Eigen::VectorXf &  pos)
inline

◆ getChildIndx()

template<typename T, unsigned int N>
int VirtualRobot::VoxelTreeNDElement< T, N >::getChildIndx ( float  p[N])
inlineprotected

◆ getEntry() [1/2]

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.

◆ getEntry() [2/2]

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

if isLeaf the corresponding entry is returned

◆ getExtend()

template<typename T, unsigned int N>
float VirtualRobot::VoxelTreeNDElement< T, N >::getExtend ( unsigned int  d)
inline

◆ getLeaf()

template<typename T, unsigned int N>
VoxelTreeNDElement* VirtualRobot::VoxelTreeNDElement< T, N >::getLeaf ( float  pos[N])
inline

◆ getLevel()

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

◆ getNextChild()

template<typename T, unsigned int N>
VoxelTreeNDElement<T, N>* VirtualRobot::VoxelTreeNDElement< T, N >::getNextChild ( int  startIndex,
int &  storeElementNr 
)
inlineprotected

◆ getVoxelCenter()

template<typename T, unsigned int N>
Eigen::VectorXf VirtualRobot::VoxelTreeNDElement< T, N >::getVoxelCenter ( )
inline

◆ hasEntry()

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

◆ isLeaf()

template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::isLeaf ( )
inline

◆ maxLeaf()

template<typename T, unsigned int N>
VoxelTreeNDElement* VirtualRobot::VoxelTreeNDElement< T, N >::maxLeaf ( const Eigen::VectorXf &  pos)
inline

◆ propagateData()

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

◆ read()

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

◆ setEntry()

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.

◆ write()

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

Friends And Related Function Documentation

◆ VoxelTreeND< T, N >

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

Field Documentation

◆ children

template<typename T, unsigned int N>
VoxelTreeNDElement** VirtualRobot::VoxelTreeNDElement< T, N >::children
protected

◆ entry

template<typename T, unsigned int N>
T* VirtualRobot::VoxelTreeNDElement< T, N >::entry
protected

◆ id

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

◆ leaf

template<typename T, unsigned int N>
bool VirtualRobot::VoxelTreeNDElement< T, N >::leaf
protected

◆ level

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

◆ pos

template<typename T, unsigned int N>
float VirtualRobot::VoxelTreeNDElement< T, N >::pos[N]
protected

◆ tree

template<typename T, unsigned int N>
VoxelTreeND<T, N>* VirtualRobot::VoxelTreeNDElement< T, N >::tree
protected