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

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

Octree class More...

#include <pcl/octree/octree_base.h>

Collaboration diagram for pcl::octree::OctreeBase< 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

 OctreeBase ()
 Empty constructor.
virtual ~OctreeBase ()
 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 (bool freeMemory_arg=false)
 Delete the octree structure and its leaf nodes.
void serializeTree (std::vector< char > &binaryTreeOut_arg)
 Serialize octree into a binary output vector describing its branch node structure.
void serializeTree (std::vector< char > &binaryTreeOut_arg, std::vector< DataT > &dataVector_arg)
 Serialize octree into a binary output vector describing its branch node structure 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)
 Deserialize a binary octree description vector and create a corresponding octree structure.
void deserializeTree (std::vector< char > &binaryTreeIn_arg, std::vector< DataT > &dataVector_arg)
 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.

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, const 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.
void poolCleanUp ()
 Delete all branch nodes and leaf nodes from octree node pools.
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::OctreeBase< 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_base.h.


Member Typedef Documentation

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

Definition at line 259 of file octree_base.h.


Constructor & Destructor Documentation

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

Empty constructor.

Definition at line 55 of file octree_base.hpp.

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

Empty deconstructor.

Definition at line 70 of file octree_base.hpp.


Member Function Documentation

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 116 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 311 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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::OctreeBase< 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 392 of file octree_base.h.

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

Reset branch class.

Parameters:
branch_arg,: reference to octree branch class

Definition at line 544 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 481 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 504 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 518 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 466 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 433 of file octree_base.h.

template<typename DataT , typename LeafT >
bool pcl::octree::OctreeBase< 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 449 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< DataT, LeafT >::deleteTree ( bool  freeMemory_arg = false  ) 

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 193 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 904 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 875 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< DataT, LeafT >::deserializeTree ( std::vector< char > &  binaryTreeIn_arg  ) 

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.

Definition at line 265 of file octree_base.hpp.

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

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 input vector for reading binary tree structure.
dataVector_arg,: reference to DataT vector that provides DataT objects for initializing leaf nodes.

Definition at line 285 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 312 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 794 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 920 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 670 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 730 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
bool pcl::octree::OctreeBase< 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 357 of file octree_base.h.

template<typename DataT , typename LeafT >
bool pcl::octree::OctreeBase< 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 163 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
LeafT* pcl::octree::OctreeBase< 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 336 of file octree_base.h.

template<typename DataT , typename LeafT >
LeafT * pcl::octree::OctreeBase< 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 407 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
virtual bool pcl::octree::OctreeBase< 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 284 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 297 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
virtual bool pcl::octree::OctreeBase< 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 272 of file octree_base.h.

template<typename DataT , typename LeafT >
bool pcl::octree::OctreeBase< 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 137 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
char pcl::octree::OctreeBase< 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 402 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
const OctreeNode* pcl::octree::OctreeBase< 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 381 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeBase< 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_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
LeafT* pcl::octree::OctreeBase< 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 347 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeBase< 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_base.h.

template<typename DataT , typename LeafT >
LeafT * pcl::octree::OctreeBase< 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 334 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::OctreeBase< 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_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
double pcl::octree::OctreeBase< 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 721 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
bool pcl::octree::OctreeBase< 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 730 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT >::poolCleanUp (  )  [inline, protected]

Delete all branch nodes and leaf nodes from octree node pools.

Definition at line 552 of file octree_base.h.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< 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 366 of file octree_base.h.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 178 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 857 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 866 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 248 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 624 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< DataT, LeafT >::serializeTree ( std::vector< char > &  binaryTreeOut_arg,
std::vector< DataT > &  dataVector_arg 
)

Serialize octree into a binary output vector describing its branch node structure 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

Definition at line 230 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< DataT, LeafT >::serializeTree ( std::vector< char > &  binaryTreeOut_arg  ) 

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

Parameters:
binaryTreeOut_arg,: reference to output vector for writing binary tree structure.

Definition at line 215 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 567 of file octree_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 511 of file octree_base.hpp.

template<typename DataT , typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT >::setBranchChild ( OctreeBranch branch_arg,
const unsigned char  childIdx_arg,
const 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 423 of file octree_base.h.

template<typename DataT , typename LeafT >
void pcl::octree::OctreeBase< 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 82 of file octree_base.hpp.

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

Set the maximum depth of the octree.

Parameters:
depth_arg,: maximum depth of octree

Definition at line 100 of file octree_base.hpp.


Member Data Documentation

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

Amount of branch nodes.

Definition at line 743 of file octree_base.h.

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

Depth mask based on octree depth.

Definition at line 752 of file octree_base.h.

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

Amount of leaf nodes.

Definition at line 740 of file octree_base.h.

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

Amount of objects assigned to leaf nodes.

Definition at line 746 of file octree_base.h.

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

Octree depth.

Definition at line 755 of file octree_base.h.

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

Pointer to root branch node of octree.

Definition at line 749 of file octree_base.h.

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

Vector pools of unused branch nodes.

Definition at line 758 of file octree_base.h.

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

Vector pools of unused leaf nodes.

Definition at line 761 of file octree_base.h.


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