Public Types |
Public Member Functions |
Protected Member Functions |
Protected Attributes |
Friends

pcl::octree::Octree2BufBase< DataT, LeafT, BranchT > Class Template Reference

**Octree** double buffer class
More...

`#include <octree2buf_base.h>`

## Public Types | |

typedef BufferedBranchNode < 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 Octree2BufBase< DataT, LeafT, BranchT > | OctreeT |

## 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 added to the octree. | |

void | deleteCurrentBuffer () |

Delete the octree structure in the current buffer. | |

void | deletePreviousBuffer () |

Delete octree structure of previous buffer. | |

void | deleteTree (bool freeMemory_arg=false) |

Delete the octree structure and its 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. Leaf nodes are initialized with getDataTByKey(..). | |

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. Leaf nodes are initialized with DataT elements from the dataVector. | |

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

unsigned int | 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. | |

unsigned int | getLeafCount () const |

Return the amount of existing leafs in the octree. | |

unsigned int | getTreeDepth () const |

Get the maximum depth of the octree. | |

Octree2BufBase () | |

Empty constructor. | |

Octree2BufBase (const Octree2BufBase &source) | |

Copy constructor. | |

Octree2BufBase & | operator= (const Octree2BufBase &source) |

Copy constructor. | |

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 | serializeNewLeafs (std::vector< DataT > &dataVector_arg, const int minPointsPerLeaf_arg=0) |

Outputs a vector of all DataT elements from leaf nodes, that do not exist in the previous octree buffer. | |

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

void | switchBuffers () |

Switch buffers and reset current octree structure. | |

virtual | ~Octree2BufBase () |

Empty deconstructor. | |

## Protected Member Functions | |

void | addData (const OctreeKey &key_arg, const DataT &data_arg) |

Add DataT object to leaf node at octree key. | |

bool | branchHasChild (const BranchNode &branch_arg, unsigned char childIdx_arg) const |

Check if branch is pointing to a particular child node. | |

void | createBranchChild (BranchNode &branch_arg, unsigned char childIdx_arg, BranchNode *&newBranchChild_arg) |

Fetch and add a new branch child to a branch class in current buffer. | |

LeafT * | createLeaf (const OctreeKey &key_arg) |

Create a leaf node. | |

void | createLeafChild (BranchNode &branch_arg, unsigned char childIdx_arg, LeafNode *&newLeafChild_arg) |

Fetch and add a new leaf child to a branch class. | |

LeafT * | createLeafRecursive (const OctreeKey &key_arg, unsigned int depthMask_arg, BranchNode *branch_arg, bool branchReset_arg) |

Recursively search for a leaf node at octree key. If leaf node does not exist, it will be created. | |

void | deleteBranch (BranchNode &branch_arg) |

Delete branch and all its subchilds from octree (both buffers) | |

void | deleteBranchChild (BranchNode &branch_arg, unsigned char bufferSelector_arg, unsigned char childIdx_arg) |

Delete child node and all its subchilds from octree in specific buffer. | |

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 data 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, bool branchReset_arg=false, bool doXORDecoding_arg=false) |

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 leaf not existance in the octree. | |

LeafT * | findLeaf (const OctreeKey &key_arg) const |

Find leaf node. | |

LeafT * | findLeafRecursive (const OctreeKey &key_arg, unsigned int depthMask_arg, BranchNode *branch_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 for current buffer. | |

char | getBranchBitPattern (const BranchNode &branch_arg, unsigned char bufferSelector_arg) const |

Generate bit pattern reflecting the existence of child node pointers in specific buffer. | |

OctreeNode * | getBranchChildPtr (const BranchNode &branch_arg, unsigned char childIdx_arg) const |

Retrieve a child node pointer for child node at childIdx. | |

char | getBranchXORBitPattern (const BranchNode &branch_arg) const |

Generate XOR bit pattern reflecting differences between the two octree buffers. | |

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

OctreeNode * | getRootNode () const |

Retrieve root node. | |

bool | hasBranchChanges (const BranchNode &branch_arg) const |

Test if branch changed between previous and current buffer. | |

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 and leaf nodes from octree node pools. | |

void | printBinary (char data_arg) |

Prints binary representation of a byte - used for debugging. | |

void | removeLeaf (const OctreeKey &key_arg) |

Remove leaf node from octree. | |

virtual void | serializeTreeCallback (LeafNode &, const OctreeKey &) |

Callback executed for every leaf node data during serialization. | |

void | serializeTreeRecursive (BranchNode *branch_arg, OctreeKey &key_arg, std::vector< char > *binaryTreeOut_arg, typename std::vector< DataT > *dataVector_arg, bool doXOREncoding_arg=false, bool newLeafsFilter_arg=false, std::size_t minPointsPerLeaf_arg=0) |

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

void | treeCleanUpRecursive (BranchNode *branch_arg) |

Recursively explore the octree and remove unused branch and leaf nodes. | |

## Protected Attributes | |

std::size_t | branchCount_ |

Amount of branch nodes. | |

OctreeNodePool< BranchNode > | branchNodePool_ |

Pool of unused branch nodes. | |

unsigned char | bufferSelector_ |

Currently active octree buffer. | |

unsigned int | depthMask_ |

Depth mask based on octree depth. | |

std::size_t | leafCount_ |

Amount of leaf nodes. | |

OctreeNodePool< LeafNode > | leafNodePool_ |

Pool of unused branch nodes. | |

OctreeKey | maxKey_ |

key range | |

std::size_t | objectCount_ |

Amount of objects assigned to leaf nodes. | |

unsigned int | octreeDepth_ |

Octree depth. | |

BranchNode * | rootNode_ |

Pointer to root branch node of octree. | |

bool | treeDirtyFlag_ |

## Friends | |

class | OctreeBreadthFirstIterator< DataT, OctreeT > |

class | OctreeDepthFirstIterator< DataT, OctreeT > |

class | OctreeIteratorBase< DataT, OctreeT > |

class | OctreeLeafNodeIterator< DataT, OctreeT > |

class pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >

**Octree** double buffer class

**Note:**- This octree implementation keeps two separate octree structures in memory. This enables to create octree structures at high rate due to an advanced memory management.
- Furthermore, it allows for detecting and differentially compare the adjacent octree structures.
- 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.

Definition at line 178 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>

typedef BufferedBranchNode<BranchT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::BranchNode |

Reimplemented in pcl::octree::OctreePointCloud< PointT, LeafT, BranchT, Octree2BufBase< int, LeafT, BranchT > >, pcl::octree::OctreePointCloud< pcl::PointXYZRGBA, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int >, Octree2BufBase< int, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int > > >, and pcl::octree::PointCloudCompression< pcl::PointXYZRGBA >.

Definition at line 191 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>

typedef OctreeBreadthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::BreadthFirstIterator |

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

Definition at line 203 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>

typedef const OctreeBreadthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstBreadthFirstIterator |

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

Definition at line 204 of file octree2buf_base.h.

typedef const OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstDepthFirstIterator |

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

Definition at line 202 of file octree2buf_base.h.

typedef const OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstIterator |

Definition at line 196 of file octree2buf_base.h.

typedef const OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstLeafNodeIterator |

Definition at line 199 of file octree2buf_base.h.

typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::DepthFirstIterator |

Definition at line 201 of file octree2buf_base.h.

typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::Iterator |

Definition at line 195 of file octree2buf_base.h.

typedef OctreeLeafNode<LeafT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::LeafNode |

Reimplemented in pcl::octree::OctreePointCloud< PointT, LeafT, BranchT, Octree2BufBase< int, LeafT, BranchT > >, pcl::octree::OctreePointCloud< pcl::PointXYZRGBA, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int >, Octree2BufBase< int, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int > > >, and pcl::octree::PointCloudCompression< pcl::PointXYZRGBA >.

Definition at line 192 of file octree2buf_base.h.

typedef OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::LeafNodeIterator |

Definition at line 198 of file octree2buf_base.h.

typedef Octree2BufBase<DataT, LeafT, BranchT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::OctreeT |

Definition at line 183 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::Octree2BufBase | ( | ) |

Empty constructor.

Definition at line 48 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::~Octree2BufBase | ( | ) | ` [virtual]` |

Empty deconstructor.

Definition at line 65 of file octree2buf_base.hpp.

pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::Octree2BufBase | ( | const Octree2BufBase< DataT, LeafT, BranchT > & | source | ) | ` [inline]` |

Copy constructor.

Definition at line 214 of file octree2buf_base.h.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< 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 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 that is fed to the lead node.

Definition at line 108 of file octree2buf_base.hpp.

void pcl::octree::Octree2BufBase< 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 427 of file octree2buf_base.h.

bool pcl::octree::Octree2BufBase< 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 502 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::createBranchChild | ( | BranchNode & | branch_arg, |

unsigned char | childIdx_arg, |
||

BranchNode *& | newBranchChild_arg |
||

) | ` [inline, protected]` |

Fetch and add a new branch child to a branch class in current buffer.

**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 742 of file octree2buf_base.h.

LeafT* pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::createLeaf | ( | const OctreeKey & | key_arg | ) | ` [inline, protected]` |

Create a leaf node.

**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 456 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::createLeafChild | ( | BranchNode & | branch_arg, |

unsigned char | childIdx_arg, |
||

LeafNode *& | newLeafChild_arg |
||

) | ` [inline, protected]` |

Fetch 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 757 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

LeafT * pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::createLeafRecursive | ( | const OctreeKey & | key_arg, |

unsigned int | depthMask_arg, |
||

BranchNode * | branch_arg, |
||

bool | branchReset_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 branchReset_arg,: Reset pointer array of current branch

**Returns:**- pointer to leaf node class

Definition at line 336 of file octree2buf_base.hpp.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::deleteBranch | ( | BranchNode & | branch_arg | ) | ` [inline, protected]` |

Delete branch and all its subchilds from octree (both buffers)

**Parameters:**-
branch_arg,: reference to octree branch class

Definition at line 712 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::deleteBranchChild | ( | BranchNode & | branch_arg, |

unsigned char | bufferSelector_arg, |
||

unsigned char | childIdx_arg |
||

) | ` [inline, protected]` |

Delete child node and all its subchilds from octree in specific buffer.

**Parameters:**-
branch_arg,: reference to octree branch class bufferSelector_arg,: buffer selector childIdx_arg,: index to child node

Definition at line 672 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::deleteCurrentBuffer | ( | ) | ` [inline]` |

Delete the octree structure in the current buffer.

Definition at line 329 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

bool pcl::octree::Octree2BufBase< 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.

Definition at line 486 of file octree2buf_base.hpp.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::deletePreviousBuffer | ( | ) | ` [inline]` |

Delete octree structure of previous buffer.

Definition at line 323 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::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 163 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::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,: select if binary tree structure is based on current octree (false) of based on a XOR comparison between current and previous octree

Definition at line 266 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::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,: select if binary tree structure is based on current octree (false) of based on a XOR comparison between current and previous octree

Definition at line 289 of file octree2buf_base.hpp.

virtual void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::deserializeTreeCallback | ( | LeafNode & | , |

const OctreeKey & | |||

) | ` [inline, protected, virtual]` |

Callback executed for every leaf node data during deserialization.

Definition at line 858 of file octree2buf_base.h.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< 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, |
||

bool | branchReset_arg = `false` , |
||

bool | doXORDecoding_arg = `false` |
||

) | ` [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. branchReset_arg,: Reset pointer array of current branch doXORDecoding_arg,: select if binary tree structure is based on current octree (false) of based on a XOR comparison between current and previous octree

Definition at line 643 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

bool pcl::octree::Octree2BufBase< 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 139 of file octree2buf_base.hpp.

bool pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::existLeaf | ( | const OctreeKey & | key_arg | ) | const` [inline, protected]` |

Check for leaf not existance in the octree.

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

**Returns:**- "true" if leaf node is found; "false" otherwise

Definition at line 472 of file octree2buf_base.h.

LeafT* pcl::octree::Octree2BufBase< 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 445 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

LeafT * pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::findLeafRecursive | ( | const OctreeKey & | key_arg, |

unsigned int | depthMask_arg, |
||

BranchNode * | 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 451 of file octree2buf_base.hpp.

virtual bool pcl::octree::Octree2BufBase< 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_arg write generated octree key to this octree key reference [in] data_arg generated DataT object

**Returns:**- "true" if DataT object could be generated; "false" otherwise

Definition at line 417 of file octree2buf_base.h.

virtual bool pcl::octree::Octree2BufBase< 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_arg reference to DataT object [in] 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 406 of file octree2buf_base.h.

char pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getBranchBitPattern | ( | const BranchNode & | branch_arg | ) | const` [inline, protected]` |

Generate bit pattern reflecting the existence of child node pointers for current buffer.

**Parameters:**-
branch_arg,: reference to octree branch class

**Returns:**- a single byte with 8 bits of child node information

Definition at line 596 of file octree2buf_base.h.

char pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getBranchBitPattern | ( | const BranchNode & | branch_arg, |

unsigned char | bufferSelector_arg |
||

) | const` [inline, protected]` |

Generate bit pattern reflecting the existence of child node pointers in specific buffer.

**Parameters:**-
branch_arg,: reference to octree branch class bufferSelector_arg,: buffer selector

**Returns:**- a single byte with 8 bits of child node information

Definition at line 617 of file octree2buf_base.h.

OctreeNode* pcl::octree::Octree2BufBase< 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 514 of file octree2buf_base.h.

unsigned int pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getBranchCount | ( | ) | const` [inline]` |

Return the amount of existing branches in the octree.

**Returns:**- amount of branch nodes.

Definition at line 311 of file octree2buf_base.h.

char pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getBranchXORBitPattern | ( | const BranchNode & | branch_arg | ) | const` [inline, protected]` |

Generate XOR bit pattern reflecting differences between the two octree buffers.

**Parameters:**-
branch_arg,: reference to octree branch class

**Returns:**- a single byte with 8 bits of child node XOR difference information

Definition at line 638 of file octree2buf_base.h.

template<typename DataT, typename LeafT , typename BranchT >

bool pcl::octree::Octree2BufBase< 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 120 of file octree2buf_base.hpp.

void pcl::octree::Octree2BufBase< 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,: data from octree node

Definition at line 535 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< 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 555 of file octree2buf_base.h.

size_t pcl::octree::Octree2BufBase< 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: number of DataT objects stored in node container

Definition at line 575 of file octree2buf_base.h.

unsigned int pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getLeafCount | ( | ) | const` [inline]` |

Return the amount of existing leafs in the octree.

**Returns:**- amount of registered leaf nodes.

Definition at line 303 of file octree2buf_base.h.

OctreeNode* pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getRootNode | ( | ) | const` [inline, protected]` |

Retrieve root node.

Definition at line 396 of file octree2buf_base.h.

unsigned int pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::getTreeDepth | ( | ) | const` [inline]` |

Get the maximum depth of the octree.

**Returns:**- depth_arg: maximum depth of octree

Definition at line 255 of file octree2buf_base.h.

bool pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::hasBranchChanges | ( | const BranchNode & | branch_arg | ) | const` [inline, protected]` |

Test if branch changed between previous and current buffer.

**Parameters:**-
branch_arg,: reference to octree branch class

**Returns:**- "true", if child node information differs between current and previous octree buffer

Definition at line 662 of file octree2buf_base.h.

double pcl::octree::Octree2BufBase< 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 877 of file octree2buf_base.h.

bool pcl::octree::Octree2BufBase< 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:**- "false" - not resizeable due to XOR serialization

Definition at line 885 of file octree2buf_base.h.

Octree2BufBase& pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::operator= | ( | const Octree2BufBase< DataT, LeafT, BranchT > & | source | ) | ` [inline]` |

Copy constructor.

Definition at line 226 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::poolCleanUp | ( | ) | ` [inline, protected]` |

Delete all branch and leaf nodes from octree node pools.

Definition at line 767 of file octree2buf_base.h.

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::printBinary | ( | char | data_arg | ) | ` [inline, protected]` |

Prints binary representation of a byte - used for debugging.

**Parameters:**-
data_arg - byte to be printed to stdout

Definition at line 893 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< 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 151 of file octree2buf_base.hpp.

void pcl::octree::Octree2BufBase< 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 481 of file octree2buf_base.h.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< 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 249 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::serializeNewLeafs | ( | std::vector< DataT > & | dataVector_arg, |

const int | minPointsPerLeaf_arg = `0` |
||

) |

Outputs a vector of all DataT elements from leaf nodes, that do not exist in the previous octree buffer.

**Parameters:**-
dataVector_arg,: reference to DataT vector that receives a copy of all DataT objects in the octree. minPointsPerLeaf_arg,: minimum amount of points required within leaf node to become serialized.

Definition at line 318 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::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,: select if binary tree structure should be generated based on current octree (false) of based on a XOR comparison between current and previous octree

Definition at line 212 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::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,: select if binary tree structure should be generated based on current octree (false) of based on a XOR comparison between current and previous octree

Definition at line 229 of file octree2buf_base.hpp.

virtual void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::serializeTreeCallback | ( | LeafNode & | , |

const OctreeKey & | |||

) | ` [inline, protected, virtual]` |

Callback executed for every leaf node data during serialization.

Definition at line 851 of file octree2buf_base.h.

template<typename DataT, typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::serializeTreeRecursive | ( | BranchNode * | branch_arg, |

OctreeKey & | key_arg, |
||

std::vector< char > * | binaryTreeOut_arg, |
||

typename std::vector< DataT > * | dataVector_arg, |
||

bool | doXOREncoding_arg = `false` , |
||

bool | newLeafsFilter_arg = `false` , |
||

std::size_t | minPointsPerLeaf_arg = `0` |
||

) | ` [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. doXOREncoding_arg,: select if binary tree structure should be generated based on current octree (false) of based on a XOR comparison between current and previous octree newLeafsFilter_arg,: execute callback only for leaf nodes that did not exist in preceding buffer minPointsPerLeaf_arg,: execute callback only for leafs with more than N objects.

Definition at line 541 of file octree2buf_base.hpp.

void pcl::octree::Octree2BufBase< 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 525 of file octree2buf_base.h.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::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 75 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< 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 92 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::switchBuffers | ( | ) |

Switch buffers and reset current octree structure.

Definition at line 185 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >

void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::treeCleanUpRecursive | ( | BranchNode * | branch_arg | ) | ` [protected]` |

Recursively explore the octree and remove unused branch and leaf nodes.

**Parameters:**-
branch_arg,: current branch node

Definition at line 819 of file octree2buf_base.hpp.

friend class OctreeBreadthFirstIterator< DataT, OctreeT >` [friend]` |

Definition at line 188 of file octree2buf_base.h.

friend class OctreeDepthFirstIterator< DataT, OctreeT >` [friend]` |

Definition at line 187 of file octree2buf_base.h.

friend class OctreeIteratorBase< DataT, OctreeT >` [friend]` |

Definition at line 186 of file octree2buf_base.h.

friend class OctreeLeafNodeIterator< DataT, OctreeT >` [friend]` |

Definition at line 189 of file octree2buf_base.h.

std::size_t pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::branchCount_` [protected]` |

Amount of branch nodes.

Definition at line 914 of file octree2buf_base.h.

OctreeNodePool<BranchNode> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::branchNodePool_` [protected]` |

Pool of unused branch nodes.

Definition at line 929 of file octree2buf_base.h.

unsigned char pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::bufferSelector_` [protected]` |

Currently active octree buffer.

Definition at line 935 of file octree2buf_base.h.

unsigned int pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::depthMask_` [protected]` |

Depth mask based on octree depth.

Definition at line 923 of file octree2buf_base.h.

std::size_t pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::leafCount_` [protected]` |

Amount of leaf nodes.

Definition at line 911 of file octree2buf_base.h.

OctreeNodePool<LeafNode> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::leafNodePool_` [protected]` |

Pool of unused branch nodes.

Definition at line 932 of file octree2buf_base.h.

OctreeKey pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::maxKey_` [protected]` |

key range

Definition at line 926 of file octree2buf_base.h.

std::size_t pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::objectCount_` [protected]` |

Amount of objects assigned to leaf nodes.

Definition at line 917 of file octree2buf_base.h.

unsigned int pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::octreeDepth_` [protected]` |

Octree depth.

Definition at line 941 of file octree2buf_base.h.

BranchNode* pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::rootNode_` [protected]` |

Pointer to root branch node of octree.

Definition at line 920 of file octree2buf_base.h.

bool pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::treeDirtyFlag_` [protected]` |

Definition at line 938 of file octree2buf_base.h.

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