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 > |
Octree double buffer class
Definition at line 178 of file octree2buf_base.h.
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.
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.
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 |
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 196 of file octree2buf_base.h.
typedef const OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstLeafNodeIterator |
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 199 of file octree2buf_base.h.
typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::DepthFirstIterator |
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 201 of file octree2buf_base.h.
typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::Iterator |
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 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 |
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 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.
pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::Octree2BufBase | ( | ) |
Empty constructor.
Definition at line 48 of file octree2buf_base.hpp.
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.
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.
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.
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.
branch_arg,: | reference to octree branch class |
childIdx_arg,: | index to child node |
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.
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.
key_arg,: | octree key addressing a 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.
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.
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.
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 |
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)
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.
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.
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.
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 |
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.
void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::deleteTree | ( | bool | freeMemory_arg = false | ) |
Delete the octree structure and its leaf nodes.
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, Octree2BufBase< int, LeafT, BranchT > >, and pcl::octree::OctreePointCloud< pcl::PointXYZRGBA, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int >, Octree2BufBase< int, OctreeContainerDataTVector< int >, OctreeContainerEmpty< int > > >.
Definition at line 163 of file octree2buf_base.hpp.
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(..).
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.
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.
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.
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.
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.
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).
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 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.
key_arg,: | octree key addressing a leaf node. |
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.
key_arg,: | octree key addressing a leaf node. |
Definition at line 445 of file octree2buf_base.h.
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.
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 |
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)
[in] | key_arg | write generated octree key to this octree key reference |
[in] | data_arg | generated DataT object |
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.
[in] | data_arg | reference to DataT object |
[in] | key_arg | write generated octree key to this octree key reference |
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 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.
branch_arg,: | reference to octree branch class |
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.
branch_arg,: | reference to octree branch class |
bufferSelector_arg,: | buffer selector |
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.
branch_arg,: | reference to octree branch class |
childIdx_arg,: | index to child node |
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.
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.
branch_arg,: | reference to octree branch class |
Definition at line 638 of file octree2buf_base.h.
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.
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. |
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.
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.
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.
node_arg,: | node in octree |
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.
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.
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 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.
branch_arg,: | reference to octree branch class |
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.
n_arg,: | some value |
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.
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.
data_arg | - byte to be printed to stdout |
Definition at line 893 of file octree2buf_base.h.
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).
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.
key_arg,: | octree key addressing a leaf node. |
Definition at line 481 of file octree2buf_base.h.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::setMaxVoxelIndex | ( | unsigned int | maxVoxelIndex_arg | ) |
Set the maximum amount of voxels per dimension.
maxVoxelIndex_arg,: | maximum amount of voxels per dimension |
Definition at line 75 of file octree2buf_base.hpp.
void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::setTreeDepth | ( | unsigned int | depth_arg | ) |
Set the maximum depth of the octree.
depth_arg,: | maximum depth of octree |
Definition at line 92 of file octree2buf_base.hpp.
void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::switchBuffers | ( | ) |
Switch buffers and reset current octree structure.
Definition at line 185 of file octree2buf_base.hpp.
void pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::treeCleanUpRecursive | ( | BranchNode * | branch_arg | ) | [protected] |
Recursively explore the octree and remove unused branch and leaf nodes.
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.