Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
pcl::octree::OctreeBase< DataT, LeafT, BranchT > Class Template Reference

Octree class. More...

#include <octree_base.h>

List of all members.

Public Types

typedef OctreeBranchNode< BranchT > BranchNode
typedef
OctreeBreadthFirstIterator
< DataT, OctreeT
BreadthFirstIterator
typedef const
OctreeBreadthFirstIterator
< DataT, OctreeT
ConstBreadthFirstIterator
typedef const
OctreeDepthFirstIterator
< DataT, OctreeT
ConstDepthFirstIterator
typedef const
OctreeDepthFirstIterator
< DataT, OctreeT
ConstIterator
typedef const
OctreeLeafNodeIterator< DataT,
OctreeT
ConstLeafNodeIterator
typedef
OctreeDepthFirstIterator
< DataT, OctreeT
DepthFirstIterator
typedef
OctreeDepthFirstIterator
< DataT, OctreeT
Iterator
typedef OctreeLeafNode< LeafT > LeafNode
typedef OctreeLeafNodeIterator
< DataT, OctreeT
LeafNodeIterator
typedef OctreeBase< DataT,
OctreeContainerDataTVector
< DataT >
, OctreeContainerEmpty< DataT > > 
MultipleObjsLeafContainer
typedef OctreeBase< DataT,
LeafT, BranchT > 
OctreeT
typedef OctreeBase< DataT,
OctreeContainerDataT< DataT >
, OctreeContainerEmpty< DataT > > 
SingleObjLeafContainer

Public Member Functions

void addData (unsigned int idxX_arg, unsigned int idxY_arg, 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.
void deleteTree (bool freeMemory_arg=true)
 Delete the octree structure and its leaf nodes.
void deserializeTree (std::vector< char > &binaryTreeIn_arg)
 Deserialize a binary octree description vector and create a corresponding octree structure. Leaf nodes are initialized with getDataTByKey(..).
void 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.
void enableDynamicDepth (size_t maxObjsPerLeaf)
 Enable dynamic octree structure.
bool existLeaf (unsigned int idxX_arg, unsigned int idxY_arg, unsigned int idxZ_arg) const
 Check for the existence of leaf node at (idxX, idxY, idxZ).
std::size_t getBranchCount () const
 Return the amount of existing branches in the octree.
bool getData (unsigned int idxX_arg, unsigned int idxY_arg, 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.
std::size_t getLeafCount () const
 Return the amount of existing leafs in the octree.
unsigned int getTreeDepth () const
 Get the maximum depth of the octree.
 OctreeBase ()
 Empty constructor.
 OctreeBase (const OctreeBase &source)
 Copy constructor.
OctreeBaseoperator= (const OctreeBase &source)
 Copy operator.
void removeLeaf (unsigned int idxX_arg, unsigned int idxY_arg, unsigned int idxZ_arg)
 Remove leaf node at (idxX_arg, idxY_arg, idxZ_arg).
void serializeLeafs (std::vector< DataT > &dataVector_arg)
 Outputs a vector of all DataT elements that are stored within the octree 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 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.
virtual ~OctreeBase ()
 Empty deconstructor.

Protected Member Functions

void addData (const OctreeKey &key_arg, const DataT &data_arg)
 Add DataT object to leaf node at octree key.
void addDataToLeafRecursive (const OctreeKey &key_arg, unsigned int depthMask_arg, const DataT &data_arg, BranchNode *branch_arg)
 Create a leaf node at octree key. If leaf node does already exist, it is returned.
bool branchHasChild (const BranchNode &branch_arg, unsigned char childIdx_arg) const
 Check if branch is pointing to a particular child node.
void branchReset (BranchNode &branch_arg)
 Reset branch class.
void createBranchChild (BranchNode &branch_arg, unsigned char childIdx_arg, BranchNode *&newBranchChild_arg)
 Create and add a new branch child to a branch class.
void createLeafChild (BranchNode &branch_arg, unsigned char childIdx_arg, LeafNode *&newLeafChild_arg)
 Create and add a new leaf child to a branch class.
void deleteBranch (BranchNode &branch_arg)
 Delete branch and all its subchilds from octree.
void deleteBranchChild (BranchNode &branch_arg, unsigned char childIdx_arg)
 Delete child node and all its subchilds from octree.
bool deleteLeafRecursive (const OctreeKey &key_arg, unsigned int depthMask_arg, BranchNode *branch_arg)
 Recursively search and delete leaf node.
virtual void deserializeTreeCallback (LeafNode &, const OctreeKey &)
 Callback executed for every leaf node during deserialization.
void deserializeTreeRecursive (BranchNode *branch_arg, unsigned int depthMask_arg, OctreeKey &key_arg, typename std::vector< char >::const_iterator &binaryTreeIT_arg, typename std::vector< char >::const_iterator &binaryTreeIT_End_arg, typename std::vector< DataT >::const_iterator *dataVectorIterator_arg, typename std::vector< DataT >::const_iterator *dataVectorEndIterator_arg)
 Rebuild an octree based on binary XOR octree description and DataT objects for leaf node initialization.
bool existLeaf (const OctreeKey &key_arg) const
 Check for existance of a leaf node in the octree.
LeafNodefindLeaf (const OctreeKey &key_arg) const
 Find leaf node.
void findLeafRecursive (const OctreeKey &key_arg, unsigned int depthMask_arg, BranchNode *branch_arg, LeafNode *&result_arg) const
 Recursively search for a given leaf node and return a pointer.
virtual bool genDataTByOctreeKey (const OctreeKey &, DataT &) const
 Virtual method for initializing new leaf node during deserialization (in case no DataT information is provided)
virtual bool genOctreeKeyForDataT (const DataT &, OctreeKey &) const
 Virtual method for generating an octree key for a given DataT object.
char getBranchBitPattern (const BranchNode &branch_arg) const
 Generate bit pattern reflecting the existence of child node pointers.
OctreeNodegetBranchChildPtr (const BranchNode &branch_arg, unsigned char childIdx_arg) const
 Retrieve a child node pointer for child node at childIdx.
void getDataFromOctreeNode (const OctreeNode *node_arg, DataT &data_arg)
 Get data from octree node.
void getDataFromOctreeNode (const OctreeNode *node_arg, std::vector< DataT > &data_arg)
 Get data from octree node.
size_t getDataSizeFromOctreeNode (const OctreeNode *node_arg)
 Get data size of octree node container.
OctreeNodegetRootNode () const
 Retrieve root node.
double Log2 (double n_arg)
 Helper function to calculate the binary logarithm.
bool octreeCanResize ()
 Test if octree is able to dynamically change its depth. This is required for adaptive bounding box adjustment.
void poolCleanUp ()
 Delete all branch nodes and leaf nodes from octree node pools.
void removeLeaf (const OctreeKey &key_arg)
 Remove leaf node from octree.
virtual void serializeTreeCallback (const LeafNode &, const OctreeKey &) const
 Callback executed for every leaf node during serialization.
void serializeTreeRecursive (const BranchNode *branch_arg, OctreeKey &key_arg, std::vector< char > *binaryTreeOut_arg, typename std::vector< DataT > *dataVector_arg) const
 Recursively explore the octree and output binary octree description together with a vector of leaf node DataT content.
void setBranchChildPtr (BranchNode &branch_arg, unsigned char childIdx_arg, OctreeNode *newChild_arg)
 Assign new child node to branch.

Protected Attributes

std::size_t branchCount_
 Amount of branch nodes.
OctreeNodePool< BranchNodebranchNodePool_
 Pool of unused branch nodes.
unsigned int depthMask_
 Depth mask based on octree depth.
std::size_t leafCount_
 Amount of leaf nodes.
OctreeNodePool< LeafNodeleafNodePool_
 Pool of unused branch nodes.
OctreeKey maxKey_
 key range
std::size_t maxObjsPerLeaf_
 Amount of DataT objects per leafNode before expanding branch.
std::size_t objectCount_
 Amount of objects assigned to leaf nodes.
unsigned int octreeDepth_
 Octree depth.
BranchNoderootNode_
 Pointer to root branch node of octree.

Friends

class OctreeBreadthFirstIterator< DataT, OctreeT >
class OctreeDepthFirstIterator< DataT, OctreeT >
class OctreeIteratorBase< DataT, OctreeT >
class OctreeLeafNodeIterator< DataT, OctreeT >

Detailed Description

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
class pcl::octree::OctreeBase< DataT, LeafT, BranchT >

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 64 of file octree_base.h.


Member Typedef Documentation

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeBranchNode<BranchT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::BranchNode
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeBreadthFirstIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::BreadthFirstIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeBreadthFirstIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::ConstBreadthFirstIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::ConstDepthFirstIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::ConstIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::ConstLeafNodeIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::DepthFirstIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::Iterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeLeafNode<LeafT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::LeafNode
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::LeafNodeIterator
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeBase<DataT, OctreeContainerDataTVector<DataT>, OctreeContainerEmpty<DataT> > pcl::octree::OctreeBase< DataT, LeafT, BranchT >::MultipleObjsLeafContainer

Definition at line 70 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeBase<DataT, LeafT, BranchT> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::OctreeT
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeBase<DataT, OctreeContainerDataT<DataT>, OctreeContainerEmpty<DataT> > pcl::octree::OctreeBase< DataT, LeafT, BranchT >::SingleObjLeafContainer

Definition at line 69 of file octree_base.h.


Constructor & Destructor Documentation

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

Empty constructor.

Definition at line 57 of file octree_base.hpp.

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

Empty deconstructor.

Definition at line 73 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
pcl::octree::OctreeBase< DataT, LeafT, BranchT >::OctreeBase ( const OctreeBase< DataT, LeafT, BranchT > &  source) [inline]

Copy constructor.

Definition at line 104 of file octree_base.h.


Member Function Documentation

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::addData ( unsigned int  idxX_arg,
unsigned int  idxY_arg,
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 117 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::addData ( 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 291 of file octree_base.h.

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::addDataToLeafRecursive ( const OctreeKey key_arg,
unsigned int  depthMask_arg,
const DataT &  data_arg,
BranchNode branch_arg 
) [protected]

Create a leaf node at octree key. If leaf node does already exist, it is returned.

Parameters:
key_arg,:reference to an octree key
depthMask_arg,:depth mask used for octree key analysis and for branch depth indicator
data_argdata to be added
branch_arg,:current branch node

Definition at line 300 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
bool pcl::octree::OctreeBase< DataT, LeafT, BranchT >::branchHasChild ( const BranchNode branch_arg,
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 348 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::branchReset ( BranchNode branch_arg) [inline, protected]

Reset branch class.

Parameters:
branch_arg,:reference to octree branch class

Definition at line 538 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::createBranchChild ( BranchNode branch_arg,
unsigned char  childIdx_arg,
BranchNode *&  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 513 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::createLeafChild ( BranchNode branch_arg,
unsigned char  childIdx_arg,
LeafNode *&  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 527 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deleteBranch ( BranchNode branch_arg) [inline, protected]

Delete branch and all its subchilds from octree.

Parameters:
branch_arg,:reference to octree branch class

Definition at line 499 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deleteBranchChild ( BranchNode branch_arg,
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 462 of file octree_base.h.

template<typename DataT , typename LeafT , typename BranchT >
bool pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deleteLeafRecursive ( const OctreeKey key_arg,
unsigned int  depthMask_arg,
BranchNode 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 442 of file octree_base.hpp.

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

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

Reimplemented in pcl::octree::OctreePointCloud< PointT, LeafT, BranchT, OctreeBase< int, LeafT, BranchT > >, pcl::octree::OctreePointCloud< PointT, LeafT, BranchT >, and pcl::octree::OctreePointCloud< pcl::PointXYZ, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int > >.

Definition at line 173 of file octree_base.hpp.

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

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

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
virtual void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deserializeTreeCallback ( LeafNode ,
const OctreeKey  
) [inline, protected, virtual]

Callback executed for every leaf node during deserialization.

Definition at line 627 of file octree_base.h.

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deserializeTreeRecursive ( BranchNode branch_arg,
unsigned int  depthMask_arg,
OctreeKey key_arg,
typename std::vector< char >::const_iterator &  binaryTreeIT_arg,
typename std::vector< char >::const_iterator &  binaryTreeIT_End_arg,
typename std::vector< DataT >::const_iterator *  dataVectorIterator_arg,
typename std::vector< DataT >::const_iterator *  dataVectorEndIterator_arg 
) [protected]

Rebuild an octree based on binary XOR 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 558 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::enableDynamicDepth ( size_t  maxObjsPerLeaf) [inline]

Enable dynamic octree structure.

Note:
Leaf nodes are kept as close to the root as possible and are only expanded if the number of DataT objects within a leaf node exceeds a fixed limit.
Returns:
maxObjsPerLeaf: maximum number of DataT objects per leaf

Definition at line 157 of file octree_base.h.

template<typename DataT , typename LeafT , typename BranchT >
bool pcl::octree::OctreeBase< DataT, LeafT, BranchT >::existLeaf ( unsigned int  idxX_arg,
unsigned int  idxY_arg,
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 149 of file octree_base.hpp.

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

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
LeafNode* pcl::octree::OctreeBase< DataT, LeafT, BranchT >::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 301 of file octree_base.h.

template<typename DataT , typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::findLeafRecursive ( const OctreeKey key_arg,
unsigned int  depthMask_arg,
BranchNode branch_arg,
LeafNode *&  result_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
result_arg,:pointer to leaf node class

Definition at line 409 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
virtual bool pcl::octree::OctreeBase< DataT, LeafT, BranchT >::genDataTByOctreeKey ( const OctreeKey ,
DataT &   
) const [inline, protected, virtual]

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

Parameters:
[in]key_argwrite generated octree key to this octree key reference
[in]data_arggenerated DataT object
Returns:
"true" if DataT object could be generated; "false" otherwise

Definition at line 280 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
virtual bool pcl::octree::OctreeBase< DataT, LeafT, BranchT >::genOctreeKeyForDataT ( const DataT &  ,
OctreeKey  
) const [inline, protected, virtual]

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

Parameters:
[in]data_argreference to DataT object
[in]key_argwrite generated octree key to this octree key reference
Returns:
"true" if octree could be generated based on DataT object; "false" otherwise

Reimplemented in pcl::octree::OctreePointCloud< PointT, LeafT, BranchT, OctreeBase< int, LeafT, BranchT > >, pcl::octree::OctreePointCloud< PointT, LeafT, BranchT >, and pcl::octree::OctreePointCloud< pcl::PointXYZ, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int > >.

Definition at line 268 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
char pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getBranchBitPattern ( const BranchNode 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 442 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
OctreeNode* pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getBranchChildPtr ( const BranchNode branch_arg,
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 360 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
std::size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getBranchCount ( ) const [inline]

Return the amount of existing branches in the octree.

Returns:
amount of branch nodes.

Definition at line 213 of file octree_base.h.

template<typename DataT, typename LeafT , typename BranchT >
bool pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getData ( unsigned int  idxX_arg,
unsigned int  idxY_arg,
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 129 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getDataFromOctreeNode ( const OctreeNode node_arg,
DataT &  data_arg 
) [inline, protected]

Get data from octree node.

Parameters:
node_arg,:node in octree
data_arg,:obtain single DataT object from octree node

Definition at line 381 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getDataFromOctreeNode ( const OctreeNode node_arg,
std::vector< DataT > &  data_arg 
) [inline, protected]

Get data from octree node.

Parameters:
node_arg,:node in octree
data_arg,:obtain vector of all DataT objects stored in octree node

Definition at line 401 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getDataSizeFromOctreeNode ( const OctreeNode node_arg) [inline, protected]

Get data size of octree node container.

Parameters:
node_arg,:node in octree
Returns:
data_arg: returns number of DataT objects stored in node container

Definition at line 421 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
std::size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getLeafCount ( ) const [inline]

Return the amount of existing leafs in the octree.

Returns:
amount of registered leaf nodes.

Definition at line 204 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
OctreeNode* pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getRootNode ( ) const [inline, protected]

Retrieve root node.

Definition at line 337 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
unsigned int pcl::octree::OctreeBase< DataT, LeafT, BranchT >::getTreeDepth ( ) const [inline]
template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
double pcl::octree::OctreeBase< DataT, LeafT, BranchT >::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 641 of file octree_base.h.

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

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
OctreeBase& pcl::octree::OctreeBase< DataT, LeafT, BranchT >::operator= ( const OctreeBase< DataT, LeafT, BranchT > &  source) [inline]

Copy operator.

Definition at line 119 of file octree_base.h.

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

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

Definition at line 546 of file octree_base.h.

template<typename DataT , typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::removeLeaf ( unsigned int  idxX_arg,
unsigned int  idxY_arg,
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 161 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::removeLeaf ( const OctreeKey key_arg) [inline, protected]

Remove leaf node from octree.

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

Definition at line 325 of file octree_base.h.

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

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

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

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
virtual void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::serializeTreeCallback ( const LeafNode ,
const OctreeKey  
) const [inline, protected, virtual]

Callback executed for every leaf node during serialization.

Definition at line 619 of file octree_base.h.

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::serializeTreeRecursive ( const BranchNode branch_arg,
OctreeKey key_arg,
std::vector< char > *  binaryTreeOut_arg,
typename std::vector< DataT > *  dataVector_arg 
) const [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.

Definition at line 495 of file octree_base.hpp.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::setBranchChildPtr ( BranchNode branch_arg,
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 371 of file octree_base.h.

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

Set the maximum amount of voxels per dimension.

Parameters:
[in]maxVoxelIndex_argmaximum amount of voxels per dimension

Definition at line 83 of file octree_base.hpp.

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

Set the maximum depth of the octree.

Parameters:
depth_arg,:maximum depth of octree

Definition at line 101 of file octree_base.hpp.


Friends And Related Function Documentation

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
friend class OctreeBreadthFirstIterator< DataT, OctreeT > [friend]

Definition at line 77 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
friend class OctreeDepthFirstIterator< DataT, OctreeT > [friend]

Definition at line 76 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
friend class OctreeIteratorBase< DataT, OctreeT > [friend]

Definition at line 75 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
friend class OctreeLeafNodeIterator< DataT, OctreeT > [friend]

Definition at line 78 of file octree_base.h.


Member Data Documentation

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
std::size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::branchCount_ [protected]

Amount of branch nodes.

Definition at line 663 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
OctreeNodePool<BranchNode> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::branchNodePool_ [protected]

Pool of unused branch nodes.

Definition at line 686 of file octree_base.h.

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

Depth mask based on octree depth.

Definition at line 677 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
std::size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::leafCount_ [protected]

Amount of leaf nodes.

Definition at line 660 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
OctreeNodePool<LeafNode> pcl::octree::OctreeBase< DataT, LeafT, BranchT >::leafNodePool_ [protected]

Pool of unused branch nodes.

Definition at line 689 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
OctreeKey pcl::octree::OctreeBase< DataT, LeafT, BranchT >::maxKey_ [protected]

key range

Definition at line 683 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
std::size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::maxObjsPerLeaf_ [protected]

Amount of DataT objects per leafNode before expanding branch.

Note:
zero indicates a fixed/maximum depth octree structure

Definition at line 674 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
std::size_t pcl::octree::OctreeBase< DataT, LeafT, BranchT >::objectCount_ [protected]

Amount of objects assigned to leaf nodes.

Definition at line 666 of file octree_base.h.

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

Octree depth.

Definition at line 680 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
BranchNode* pcl::octree::OctreeBase< DataT, LeafT, BranchT >::rootNode_ [protected]

Pointer to root branch node of octree.

Definition at line 669 of file octree_base.h.


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


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:20:18