Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

pcl::octree::OctreeLowMemBase< DataT, LeafT > Class Template Reference
[Module octree]

Octree class More...

#include <pcl/octree/octree_lowmemory_base.h>

Collaboration diagram for pcl::octree::OctreeLowMemBase< DataT, LeafT >:
Collaboration graph
[legend]

List of all members.

Classes

class  OctreeBranch
 Octree branch class. More...
class  OctreeKey
 Octree key class More...

Public Member Functions

 OctreeLowMemBase ()
 Empty constructor.
virtual ~OctreeLowMemBase ()
 Empty deconstructor.
void setMaxVoxelIndex (unsigned int maxVoxelIndex_arg)
 Set the maximum amount of voxels per dimension.
void setTreeDepth (unsigned int depth_arg)
 Set the maximum depth of the octree.
unsigned int getTreeDepth ()
 Get the maximum depth of the octree.
void add (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg, const DataT &data_arg)
 Add a const DataT element to leaf node at (idxX, idxY, idxZ).
bool get (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg, DataT &data_arg) const
 Retrieve a DataT element from leaf node at (idxX, idxY, idxZ).
bool existLeaf (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg) const
 Check for the existence of leaf node at (idxX, idxY, idxZ).
void removeLeaf (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg)
 Remove leaf node at (idxX_arg, idxY_arg, idxZ_arg).
unsigned int getLeafCount () const
 Return the amount of existing leafs in the octree.
unsigned int getBranchCount () const
 Return the amount of existing branches in the octree.
void deleteTree ()
 Delete the octree structure and its leaf nodes.
void serializeTree (std::vector< char > &binaryTreeOut_arg, bool doXOREncoding_arg=false)
 Serialize octree into a binary output vector describing its branch node structure.
void serializeTree (std::vector< char > &binaryTreeOut_arg, std::vector< DataT > &dataVector_arg, bool doXOREncoding_arg=false)
 Serialize octree into a binary output vector describing its branch node structure and and push all DataT elements stored in the octree to a vector.
void serializeLeafs (std::vector< DataT > &dataVector_arg)
 Outputs a vector of all DataT elements that are stored within the octree leaf nodes.
void deserializeTree (std::vector< char > &binaryTreeIn_arg, bool doXORDecoding_arg=false)
 Deserialize a binary octree description vector and create a corresponding octree structure.
void deserializeTree (std::vector< char > &binaryTreeIn_arg, std::vector< DataT > &dataVector_arg, bool doXORDecoding_arg=false)
 Deserialize a binary octree description and create a corresponding octree structure.
void deserializeTreeAndOutputLeafData (std::vector< char > &binaryTreeIn_arg, std::vector< DataT > &dataVector_arg)
 Deserialize a binary octree description vector and create a corresponding octree structure.
void switchBuffers ()
 Switch buffers interface for compression.

Protected Types

typedef LeafT OctreeLeaf

Protected Member Functions

virtual bool genOctreeKeyForDataT (const DataT &data_arg, OctreeKey &key_arg) const
 Virtual method for generating an octree key for a given DataT object.
virtual bool genDataTByOctreeKey (const OctreeKey &key_arg, DataT &data_arg) const
 Virtual method for initializing new leaf node during deserialization (in case no DataT information is provided).
void genOctreeKeyByIntIdx (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg, OctreeKey &key_arg) const
 Generate an octree key.
void add (const OctreeKey &key_arg, const DataT &data_arg)
 Add DataT object to leaf node at octree key.
void add (const std::vector< OctreeKey > &key_vector_arg, const std::vector< DataT > &data_vector_arg)
 Add vector of DataT objects to vector of octree keys.
LeafT * findLeaf (const OctreeKey &key_arg) const
 Find leaf node.
LeafT * getLeaf (const OctreeKey &key_arg)
 Get a leaf node from octree.
bool existLeaf (const OctreeKey &key_arg) const
 Check for existance of a leaf node in the octree.
void removeLeaf (const OctreeKey &key_arg)
 Remove leaf node from octree.
const OctreeNodegetBranchChild (const OctreeBranch &branch_arg, const unsigned char childIdx_arg) const
 Retrieve a child node pointer for child node at childIdx.
bool branchHasChild (const OctreeBranch &branch_arg, const unsigned char childIdx_arg) const
 Check if branch is pointing to a particular child node.
char getBranchBitPattern (const OctreeBranch &branch_arg) const
 Generate bit pattern reflecting the existence of child node pointers.
void setBranchChild (OctreeBranch &branch_arg, const unsigned char childIdx_arg, OctreeNode *newChild_arg)
 Assign new child node to branch.
void deleteBranchChild (OctreeBranch &branch_arg, const unsigned char childIdx_arg)
 Delete child node and all its subchilds from octree.
void deleteBranch (OctreeBranch &branch_arg)
 Delete branch and all its subchilds from octree.
void createBranch (OctreeBranch *&newBranchChild_arg)
 Create a new branch class and receive a pointer to it.
void createBranchChild (OctreeBranch &branch_arg, const unsigned char childIdx_arg, OctreeBranch *&newBranchChild_arg)
 Create and add a new branch child to a branch class.
void createLeafChild (OctreeBranch &branch_arg, const unsigned char childIdx_arg, OctreeLeaf *&newLeafChild_arg)
 Create and add a new leaf child to a branch class.
void branchReset (OctreeBranch &branch_arg)
 Reset branch class.
LeafT * getLeafRecursive (const OctreeKey &key_arg, const unsigned int depthMask_arg, OctreeBranch *branch_arg)
 Recursively search for a leaf node at octree key.
LeafT * findLeafRecursive (const OctreeKey &key_arg, const unsigned int depthMask_arg, OctreeBranch *branch_arg) const
 Recursively search for a given leaf node and return a pointer.
bool deleteLeafRecursive (const OctreeKey &key_arg, const unsigned int depthMask_arg, OctreeBranch *branch_arg)
 Recursively search and delete leaf node.
void serializeTreeRecursive (std::vector< char > &binaryTreeOut_arg, const OctreeBranch *branch_arg, const OctreeKey &key_arg)
 Recursively explore the octree and output binary octree description.
void serializeTreeRecursive (std::vector< char > &binaryTreeOut_arg, const OctreeBranch *branch_arg, const OctreeKey &key_arg, typename std::vector< DataT > &dataVector_arg)
 Recursively explore the octree and output binary octree description together with a vector of leaf node DataT content.
void serializeLeafsRecursive (const OctreeBranch *branch_arg, const OctreeKey &key_arg, typename std::vector< DataT > &dataVector_arg)
 Recursively explore the octree and output DataT objects to DataT vector.
void deserializeTreeRecursive (typename std::vector< char >::const_iterator &binaryTreeIn_arg, OctreeBranch *branch_arg, const unsigned int depthMask_arg, const OctreeKey &key_arg)
 Rebuild an octree based on binary octree description.
void deserializeTreeRecursive (typename std::vector< char >::const_iterator &binaryTreeIn_arg, OctreeBranch *branch_arg, const unsigned int depthMask_arg, const OctreeKey &key_arg, typename std::vector< DataT >::const_iterator &dataVectorIterator_arg, typename std::vector< DataT >::const_iterator &dataVectorEndIterator_arg)
 Rebuild an octree based on binary octree description and DataT objects for leaf node initialization.
void deserializeTreeAndOutputLeafDataRecursive (typename std::vector< char >::const_iterator &binaryTreeIn_arg, OctreeBranch *branch_arg, const unsigned int depthMask_arg, const OctreeKey &key_arg, typename std::vector< DataT > &dataVector_arg)
 Rebuild an octree based on binary octree description and output generated DataT objects.
virtual void serializeLeafCallback (OctreeLeaf &leaf_arg, const OctreeKey &key_arg)
 Decode leaf node data during serialization.
virtual void serializeLeafCallback (OctreeLeaf &leaf_arg, const OctreeKey &key_arg, std::vector< DataT > &dataVector_arg)
 Decode leaf node data during serialization.
virtual void deserializeLeafCallback (OctreeLeaf &leaf_arg, const OctreeKey &key_arg)
 Initialize leaf nodes during deserialization.
virtual void deserializeLeafCallback (OctreeLeaf &leaf_arg, const OctreeKey &key_arg, typename std::vector< DataT >::const_iterator &dataVectorIterator_arg, typename std::vector< DataT >::const_iterator &dataVectorEndIterator_arg)
 Initialize leaf nodes during deserialization.
virtual void deserializeTreeAndSerializeLeafCallback (OctreeLeaf &leaf_arg, const OctreeKey &key_arg, std::vector< DataT > &dataVector_arg)
 Initialize leaf nodes during deserialization.
double Log2 (double n_arg)
 Helper function to calculate the binary logarithm.
bool octreeCanResize ()
 Test if octree is able to dynamically change its depth.

Protected Attributes

unsigned int leafCount_
 Amount of leaf nodes.
unsigned int branchCount_
 Amount of branch nodes.
unsigned int objectCount_
 Amount of objects assigned to leaf nodes.
OctreeBranchrootNode_
 Pointer to root branch node of octree.
unsigned int depthMask_
 Depth mask based on octree depth.
unsigned int octreeDepth_
 Octree depth.
std::vector< OctreeBranch * > unusedBranchesPool_
 Vector pools of unused branch nodes.
std::vector< LeafT * > unusedLeafsPool_
 Vector pools of unused leaf nodes.

Detailed Description

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
class pcl::octree::OctreeLowMemBase< DataT, LeafT >

Octree class

Note:
The tree depth defines the maximum amount of octree voxels / leaf nodes (should be initially defined).
All leaf nodes are addressed by integer indices.
Note: The tree depth equates to the bit length of the voxel indices.
Author:
Julius Kammerl (julius@kammerl.de)

Definition at line 60 of file octree_lowmemory_base.h.


Member Typedef Documentation

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
typedef LeafT pcl::octree::OctreeLowMemBase< DataT, LeafT >::OctreeLeaf [protected]

Definition at line 288 of file octree_lowmemory_base.h.


Constructor & Destructor Documentation

template<typename DataT , typename LeafT >
pcl::octree::OctreeLowMemBase< DataT, LeafT >::OctreeLowMemBase (  ) 

Empty constructor.

Definition at line 55 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
pcl::octree::OctreeLowMemBase< DataT, LeafT >::~OctreeLowMemBase (  )  [virtual]

Empty deconstructor.

Definition at line 70 of file octree_lowmemory_base.hpp.


Member Function Documentation

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::add ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg,
const DataT &  data_arg 
)

Add a const DataT element to leaf node at (idxX, idxY, idxZ).

If leaf node does not exist, it is created and added to the octree.

Parameters:
idxX_arg,: index of leaf node in the X axis.
idxY_arg,: index of leaf node in the Y axis.
idxZ_arg,: index of leaf node in the Z axis.
data_arg,: const reference to DataT object to be added.

Definition at line 115 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::add ( const OctreeKey key_arg,
const DataT &  data_arg 
) [inline, protected]

Add DataT object to leaf node at octree key.

Parameters:
key_arg,: octree key addressing a leaf node.
data_arg,: DataT object to be added.

Definition at line 340 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::add ( const std::vector< OctreeKey > &  key_vector_arg,
const std::vector< DataT > &  data_vector_arg 
) [protected]

Add vector of DataT objects to vector of octree keys.

Parameters:
key_vector_arg,: vector of octree keys addressing leaf nodes.
data_vector_arg,: DataT objects to be added.
template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::branchHasChild ( const OctreeBranch branch_arg,
const unsigned char  childIdx_arg 
) const [inline, protected]

Check if branch is pointing to a particular child node.

Parameters:
branch_arg,: reference to octree branch class
childIdx_arg,: index to child node
Returns:
"true" if pointer to child node exists; "false" otherwise

Definition at line 438 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::branchReset ( OctreeBranch branch_arg  )  [inline, protected]

Reset branch class.

Parameters:
branch_arg,: reference to octree branch class

Definition at line 672 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::createBranch ( OctreeBranch *&  newBranchChild_arg  )  [inline, protected]

Create a new branch class and receive a pointer to it.

Parameters:
newBranchChild_arg,: writes a pointer of new branch child to this reference

Definition at line 630 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::createBranchChild ( OctreeBranch branch_arg,
const unsigned char  childIdx_arg,
OctreeBranch *&  newBranchChild_arg 
) [inline, protected]

Create and add a new branch child to a branch class.

Parameters:
branch_arg,: reference to octree branch class
childIdx_arg,: index to child node
newBranchChild_arg,: write a pointer of new branch child to this reference

Definition at line 644 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::createLeafChild ( OctreeBranch branch_arg,
const unsigned char  childIdx_arg,
OctreeLeaf *&  newLeafChild_arg 
) [inline, protected]

Create and add a new leaf child to a branch class.

Parameters:
branch_arg,: reference to octree branch class
childIdx_arg,: index to child node
newLeafChild_arg,: writes a pointer of new leaf child to this reference

Definition at line 657 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deleteBranch ( OctreeBranch branch_arg  )  [inline, protected]

Delete branch and all its subchilds from octree.

Parameters:
branch_arg,: reference to octree branch class

Definition at line 615 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deleteBranchChild ( OctreeBranch branch_arg,
const unsigned char  childIdx_arg 
) [inline, protected]

Delete child node and all its subchilds from octree.

Parameters:
branch_arg,: reference to octree branch class
childIdx_arg,: index to child node

Definition at line 583 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::deleteLeafRecursive ( const OctreeKey key_arg,
const unsigned int  depthMask_arg,
OctreeBranch branch_arg 
) [protected]

Recursively search and delete leaf node.

Parameters:
key_arg,: reference to an octree key
depthMask_arg,: depth mask used for octree key analysis and branch depth indicator
branch_arg,: current branch node
Returns:
"true" if branch does not contain any childs; "false" otherwise. This indicates if current branch can be deleted, too.

Definition at line 448 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deleteTree (  ) 

Delete the octree structure and its leaf nodes.

Parameters:
freeMemory_arg,: if "true", allocated octree nodes are deleted, otherwise they are pushed to the octree node pool

Definition at line 192 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeLeafCallback ( OctreeLeaf leaf_arg,
const OctreeKey key_arg 
) [protected, virtual]

Initialize leaf nodes during deserialization.

Parameters:
leaf_arg,: reference to new leaf node
key_arg,: octree key of new leaf node

Definition at line 903 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeLeafCallback ( OctreeLeaf leaf_arg,
const OctreeKey key_arg,
typename std::vector< DataT >::const_iterator &  dataVectorIterator_arg,
typename std::vector< DataT >::const_iterator &  dataVectorEndIterator_arg 
) [protected, virtual]

Initialize leaf nodes during deserialization.

Parameters:
leaf_arg,: reference to new leaf node
key_arg,: octree key of new leaf node
dataVectorIterator_arg,: iterator pointing to current DataT object to be added to the new leaf node
dataVectorEndIterator_arg,: iterator pointing to last object in DataT input vector.

Definition at line 874 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTree ( std::vector< char > &  binaryTreeIn_arg,
std::vector< DataT > &  dataVector_arg,
bool  doXORDecoding_arg = false 
)

Deserialize a binary octree description and create a corresponding octree structure.

Leaf nodes are initialized with DataT elements from the dataVector.

Parameters:
binaryTreeIn_arg,: reference to inpvectoream for reading binary tree structure.
dataVector_arg,: reference to DataT vector that provides DataT objects for initializing leaf nodes.
doXORDecoding_arg,: dummy argument to be consistent with the octree compression interface. As only a single octree is managed in memory, no XOR encoding is performed.

Definition at line 283 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTree ( std::vector< char > &  binaryTreeIn_arg,
bool  doXORDecoding_arg = false 
)

Deserialize a binary octree description vector and create a corresponding octree structure.

Leaf nodes are initialized with getDataTByKey(..).

Parameters:
binaryTreeIn_arg,: reference to input vector for reading binary tree structure.
doXORDecoding_arg,: dummy argument to be consistent with the octree compression interface. As only a single octree is managed in memory, no XOR encoding is performed.

Definition at line 262 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTreeAndOutputLeafData ( std::vector< char > &  binaryTreeIn_arg,
std::vector< DataT > &  dataVector_arg 
)

Deserialize a binary octree description vector and create a corresponding octree structure.

Leaf nodes are initialized with getDataTByKey(..). Generated DataT objects are copied to output vector.

Parameters:
binaryTreeIn_arg,: reference to input vector for reading binary tree structure.
dataVector_arg,: reference to DataT vector that receives a copy of generated DataT objects.

Definition at line 311 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTreeAndOutputLeafDataRecursive ( typename std::vector< char >::const_iterator &  binaryTreeIn_arg,
OctreeBranch branch_arg,
const unsigned int  depthMask_arg,
const OctreeKey key_arg,
typename std::vector< DataT > &  dataVector_arg 
) [protected]

Rebuild an octree based on binary octree description and output generated DataT objects.

Parameters:
binaryTreeIn_arg,: iterator to input vector
branch_arg,: current branch node
depthMask_arg,: depth mask used for octree key analysis and branch depth indicator
key_arg,: reference to an octree key
dataVector_arg,: iterator of DataT vector that receives a copy of generated DataT objects.

Definition at line 793 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTreeAndSerializeLeafCallback ( OctreeLeaf leaf_arg,
const OctreeKey key_arg,
std::vector< DataT > &  dataVector_arg 
) [protected, virtual]

Initialize leaf nodes during deserialization.

Parameters:
leaf_arg,: reference to new leaf node
key_arg,: octree key of new leaf node
dataVector_arg,: generated DataT objects are pushed to this DataT vector

Definition at line 919 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTreeRecursive ( typename std::vector< char >::const_iterator &  binaryTreeIn_arg,
OctreeBranch branch_arg,
const unsigned int  depthMask_arg,
const OctreeKey key_arg 
) [protected]

Rebuild an octree based on binary octree description.

Parameters:
binaryTreeIn_arg,: iterator to input vector
branch_arg,: current branch node
depthMask_arg,: depth mask used for octree key analysis and branch depth indicator
key_arg,: reference to an octree key

Definition at line 669 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::deserializeTreeRecursive ( typename std::vector< char >::const_iterator &  binaryTreeIn_arg,
OctreeBranch branch_arg,
const unsigned int  depthMask_arg,
const OctreeKey key_arg,
typename std::vector< DataT >::const_iterator &  dataVectorIterator_arg,
typename std::vector< DataT >::const_iterator &  dataVectorEndIterator_arg 
) [protected]

Rebuild an octree based on binary octree description and DataT objects for leaf node initialization.

Parameters:
binaryTreeIn_arg,: iterator to input vector
branch_arg,: current branch node
depthMask_arg,: depth mask used for octree key analysis and branch depth indicator
key_arg,: reference to an octree key
dataVectorIterator_arg,: iterator pointing to current DataT object to be added to a leaf node
dataVectorEndIterator_arg,: iterator pointing to last object in DataT input vector.

Definition at line 729 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::existLeaf ( const OctreeKey key_arg  )  const [inline, protected]

Check for existance of a leaf node in the octree.

Parameters:
key_arg,: octree key addressing a leaf node.
Returns:
"true" if leaf node is found; "false" otherwise

Definition at line 386 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::existLeaf ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg 
) const

Check for the existence of leaf node at (idxX, idxY, idxZ).

Parameters:
idxX_arg,: index of leaf node in the X axis.
idxY_arg,: index of leaf node in the Y axis.
idxZ_arg,: index of leaf node in the Z axis.
Returns:
"true" if leaf node search is successful, otherwise it returns "false".

Definition at line 162 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
LeafT* pcl::octree::OctreeLowMemBase< DataT, LeafT >::findLeaf ( const OctreeKey key_arg  )  const [inline, protected]

Find leaf node.

Parameters:
key_arg,: octree key addressing a leaf node.
Returns:
pointer to leaf node. If leaf node is not found, this pointer returns 0.

Definition at line 365 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
LeafT * pcl::octree::OctreeLowMemBase< DataT, LeafT >::findLeafRecursive ( const OctreeKey key_arg,
const unsigned int  depthMask_arg,
OctreeBranch branch_arg 
) const [protected]

Recursively search for a given leaf node and return a pointer.

Note:
If leaf node does not exist, a 0 pointer is returned.
Parameters:
key_arg,: reference to an octree key
depthMask_arg,: depth mask used for octree key analysis and for branch depth indicator
branch_arg,: current branch node
Returns:
pointer to leaf node class. Returns 0 if leaf node is not found.

Definition at line 406 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
virtual bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::genDataTByOctreeKey ( const OctreeKey key_arg,
DataT &  data_arg 
) const [inline, protected, virtual]

Virtual method for initializing new leaf node during deserialization (in case no DataT information is provided).

Parameters:
key_arg,: write generated octree key to this octree key reference
data_arg,: generated DataT object
Returns:
"true" if DataT object could be generated; "false" otherwise

Definition at line 313 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::genOctreeKeyByIntIdx ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg,
OctreeKey key_arg 
) const [inline, protected]

Generate an octree key.

Parameters:
idxX_arg,: index of leaf node in the X axis.
idxY_arg,: index of leaf node in the Y axis.
idxZ_arg,: index of leaf node in the Z axis.
key_arg,: write new octree key to this reference.

Definition at line 326 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
virtual bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::genOctreeKeyForDataT ( const DataT &  data_arg,
OctreeKey key_arg 
) const [inline, protected, virtual]

Virtual method for generating an octree key for a given DataT object.

Parameters:
data_arg,: reference to DataT object
key_arg,: write generated octree key to this octree key reference
Returns:
"true" if octree could be generated based on DataT object; "false" otherwise

Definition at line 301 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::get ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg,
DataT &  data_arg 
) const

Retrieve a DataT element from leaf node at (idxX, idxY, idxZ).

It returns false if leaf node does not exist.

Parameters:
idxX_arg,: index of leaf node in the X axis.
idxY_arg,: index of leaf node in the Y axis.
idxZ_arg,: index of leaf node in the Z axis.
data_arg,: reference to DataT object that contains content of leaf node if search was successful.
Returns:
"true" if leaf node search is successful, otherwise it returns "false".

Definition at line 136 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
char pcl::octree::OctreeLowMemBase< DataT, LeafT >::getBranchBitPattern ( const OctreeBranch branch_arg  )  const [inline, protected]

Generate bit pattern reflecting the existence of child node pointers.

Parameters:
branch_arg,: reference to octree branch class
Returns:
a single byte with 8 bits of child node information

Definition at line 449 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
const OctreeNode* pcl::octree::OctreeLowMemBase< DataT, LeafT >::getBranchChild ( const OctreeBranch branch_arg,
const unsigned char  childIdx_arg 
) const [inline, protected]

Retrieve a child node pointer for child node at childIdx.

Parameters:
branch_arg,: reference to octree branch class
childIdx_arg,: index to child node
Returns:
pointer to octree child node class

Definition at line 410 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::getBranchCount (  )  const [inline]

Return the amount of existing branches in the octree.

Returns:
amount of branch nodes.

Definition at line 143 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
LeafT* pcl::octree::OctreeLowMemBase< DataT, LeafT >::getLeaf ( const OctreeKey key_arg  )  [inline, protected]

Get a leaf node from octree.

Note:
If the leaf node at the given octree node does not exist, it will be created and added to the tree.
Parameters:
key_arg,: octree key addressing a leaf node.
Returns:
pointer to an existing or created leaf node.

Definition at line 376 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::getLeafCount (  )  const [inline]

Return the amount of existing leafs in the octree.

Returns:
amount of registered leaf nodes.

Definition at line 134 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
LeafT * pcl::octree::OctreeLowMemBase< DataT, LeafT >::getLeafRecursive ( const OctreeKey key_arg,
const unsigned int  depthMask_arg,
OctreeBranch branch_arg 
) [protected]

Recursively search for a leaf node at octree key.

If leaf node does not exist, it will be created.

Parameters:
key_arg,: reference to an octree key
depthMask_arg,: depth mask used for octree key analysis and for branch depth indicator
branch_arg,: current branch node
Returns:
pointer to leaf node class

Definition at line 333 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::getTreeDepth (  )  [inline]

Get the maximum depth of the octree.

Returns:
depth_arg: maximum depth of octree

Definition at line 88 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
double pcl::octree::OctreeLowMemBase< DataT, LeafT >::Log2 ( double  n_arg  )  [inline, protected]

Helper function to calculate the binary logarithm.

Parameters:
n_arg,: some value
Returns:
binary logarithm (log2) of argument n_arg

Definition at line 830 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
bool pcl::octree::OctreeLowMemBase< DataT, LeafT >::octreeCanResize (  )  [inline, protected]

Test if octree is able to dynamically change its depth.

This is required for adaptive bounding box adjustment.

Returns:
"true"

Definition at line 839 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::removeLeaf ( const OctreeKey key_arg  )  [inline, protected]

Remove leaf node from octree.

Parameters:
key_arg,: octree key addressing a leaf node.

Definition at line 395 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::removeLeaf ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg 
)

Remove leaf node at (idxX_arg, idxY_arg, idxZ_arg).

Parameters:
idxX_arg,: index of leaf node in the X axis.
idxY_arg,: index of leaf node in the Y axis.
idxZ_arg,: index of leaf node in the Z axis.

Definition at line 177 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeLeafCallback ( OctreeLeaf leaf_arg,
const OctreeKey key_arg,
std::vector< DataT > &  dataVector_arg 
) [protected, virtual]

Decode leaf node data during serialization.

Parameters:
leaf_arg,: reference to new leaf node
key_arg,: octree key of new leaf node
dataVector_arg,: DataT objects from leaf are pushed to this DataT vector

Definition at line 865 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeLeafCallback ( OctreeLeaf leaf_arg,
const OctreeKey key_arg 
) [protected, virtual]

Decode leaf node data during serialization.

Parameters:
leaf_arg,: reference to new leaf node
key_arg,: octree key of new leaf node

Definition at line 856 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeLeafs ( std::vector< DataT > &  dataVector_arg  ) 

Outputs a vector of all DataT elements that are stored within the octree leaf nodes.

Parameters:
dataVector_arg,: reference to DataT vector that receives a copy of all DataT objects in the octree.

Definition at line 245 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeLeafsRecursive ( const OctreeBranch branch_arg,
const OctreeKey key_arg,
typename std::vector< DataT > &  dataVector_arg 
) [protected]

Recursively explore the octree and output DataT objects to DataT vector.

Parameters:
branch_arg,: current branch node
key_arg,: reference to an octree key
dataVector_arg,: DataT objects from leaf nodes are written to this DataT vector .

Definition at line 623 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeTree ( std::vector< char > &  binaryTreeOut_arg,
std::vector< DataT > &  dataVector_arg,
bool  doXOREncoding_arg = false 
)

Serialize octree into a binary output vector describing its branch node structure and and push all DataT elements stored in the octree to a vector.

Parameters:
binaryTreeOut_arg,: reference to output vector for writing binary tree structure.
dataVector_arg,: reference of DataT vector that receives a copy of all DataT objects in the octree
doXOREncoding_arg,: dummy argument to be consistent with the octree compression interface. As only a single octree is managed in memory, no XOR encoding is performed.

Definition at line 226 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeTree ( std::vector< char > &  binaryTreeOut_arg,
bool  doXOREncoding_arg = false 
)

Serialize octree into a binary output vector describing its branch node structure.

Parameters:
binaryTreeOut_arg,: reference to output vector for writing binary tree structure.
doXOREncoding_arg,: dummy argument to be consistent with the octree compression interface. As only a single octree is managed in memory, no XOR encoding is performed.

Definition at line 210 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeTreeRecursive ( std::vector< char > &  binaryTreeOut_arg,
const OctreeBranch branch_arg,
const OctreeKey key_arg,
typename std::vector< DataT > &  dataVector_arg 
) [protected]

Recursively explore the octree and output binary octree description together with a vector of leaf node DataT content.

Parameters:
binaryTreeOut_arg,: binary output vector
branch_arg,: current branch node
key_arg,: reference to an octree key
dataVector_arg,: writes DataT content to this DataT vector iterator.

Definition at line 566 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::serializeTreeRecursive ( std::vector< char > &  binaryTreeOut_arg,
const OctreeBranch branch_arg,
const OctreeKey key_arg 
) [protected]

Recursively explore the octree and output binary octree description.

Parameters:
binaryTreeOut_arg,: binary output vector
branch_arg,: current branch node
key_arg,: reference to an octree key

Definition at line 510 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::setBranchChild ( OctreeBranch branch_arg,
const unsigned char  childIdx_arg,
OctreeNode newChild_arg 
) [inline, protected]

Assign new child node to branch.

Parameters:
branch_arg,: reference to octree branch class
childIdx_arg,: index to child node
newChild_arg,: pointer to new child node

Definition at line 460 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::setMaxVoxelIndex ( unsigned int  maxVoxelIndex_arg  ) 

Set the maximum amount of voxels per dimension.

Parameters:
maxVoxelIndex_arg,: maximum amount of voxels per dimension

Definition at line 81 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::setTreeDepth ( unsigned int  depth_arg  ) 

Set the maximum depth of the octree.

Parameters:
depth_arg,: maximum depth of octree

Definition at line 99 of file octree_lowmemory_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeLowMemBase< DataT, LeafT >::switchBuffers (  )  [inline]

Switch buffers interface for compression.

As this octree implementation manages only a single buffer, it just deletes the current octree.

Definition at line 201 of file octree_lowmemory_base.h.


Member Data Documentation

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::branchCount_ [protected]

Amount of branch nodes.

Definition at line 852 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::depthMask_ [protected]

Depth mask based on octree depth.

Definition at line 861 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::leafCount_ [protected]

Amount of leaf nodes.

Definition at line 849 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::objectCount_ [protected]

Amount of objects assigned to leaf nodes.

Definition at line 855 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeLowMemBase< DataT, LeafT >::octreeDepth_ [protected]

Octree depth.

Definition at line 864 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
OctreeBranch* pcl::octree::OctreeLowMemBase< DataT, LeafT >::rootNode_ [protected]

Pointer to root branch node of octree.

Definition at line 858 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
std::vector<OctreeBranch*> pcl::octree::OctreeLowMemBase< DataT, LeafT >::unusedBranchesPool_ [protected]

Vector pools of unused branch nodes.

Definition at line 867 of file octree_lowmemory_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
std::vector<LeafT*> pcl::octree::OctreeLowMemBase< DataT, LeafT >::unusedLeafsPool_ [protected]

Vector pools of unused leaf nodes.

Definition at line 870 of file octree_lowmemory_base.h.


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