Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Friends
pcl::octree::Octree2BufBase< DataT, LeafT, BranchT > Class Template Reference

Octree double buffer class More...

#include <pcl/octree/octree2buf_base.h>

Public Types

typedef Octree2BufBase< DataT,
LeafT, BranchT > 
OctreeT
 
typedef BufferedBranchNode
< BranchT > 
BranchNode
 
typedef OctreeLeafNode< LeafT > LeafNode
 
typedef
OctreeDepthFirstIterator
< DataT, OctreeT
Iterator
 
typedef const
OctreeDepthFirstIterator
< DataT, OctreeT
ConstIterator
 
typedef OctreeLeafNodeIterator
< DataT, OctreeT
LeafNodeIterator
 
typedef const
OctreeLeafNodeIterator< DataT,
OctreeT
ConstLeafNodeIterator
 
typedef
OctreeDepthFirstIterator
< DataT, OctreeT
DepthFirstIterator
 
typedef const
OctreeDepthFirstIterator
< DataT, OctreeT
ConstDepthFirstIterator
 
typedef
OctreeBreadthFirstIterator
< DataT, OctreeT
BreadthFirstIterator
 
typedef const
OctreeBreadthFirstIterator
< DataT, OctreeT
ConstBreadthFirstIterator
 

Public Member Functions

 Octree2BufBase ()
 Empty constructor. More...
 
virtual ~Octree2BufBase ()
 Empty deconstructor. More...
 
 Octree2BufBase (const Octree2BufBase &source)
 Copy constructor. More...
 
Octree2BufBaseoperator= (const Octree2BufBase &source)
 Copy constructor. More...
 
void setMaxVoxelIndex (unsigned int maxVoxelIndex_arg)
 Set the maximum amount of voxels per dimension. More...
 
void setTreeDepth (unsigned int depth_arg)
 Set the maximum depth of the octree. More...
 
unsigned int getTreeDepth () const
 Get the maximum depth of the octree. More...
 
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). More...
 
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). More...
 
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). More...
 
void removeLeaf (unsigned int idxX_arg, unsigned int idxY_arg, unsigned int idxZ_arg)
 Remove leaf node at (idxX_arg, idxY_arg, idxZ_arg). More...
 
unsigned int getLeafCount () const
 Return the amount of existing leafs in the octree. More...
 
unsigned int getBranchCount () const
 Return the amount of existing branches in the octree. More...
 
void deleteTree (bool freeMemory_arg=false)
 Delete the octree structure and its leaf nodes. More...
 
void deletePreviousBuffer ()
 Delete octree structure of previous buffer. More...
 
void deleteCurrentBuffer ()
 Delete the octree structure in the current buffer. More...
 
void switchBuffers ()
 Switch buffers and reset current octree structure. More...
 
void serializeTree (std::vector< char > &binaryTreeOut_arg, bool doXOREncoding_arg=false)
 Serialize octree into a binary output vector describing its branch node structure. More...
 
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. More...
 
void serializeLeafs (std::vector< DataT > &dataVector_arg)
 Outputs a vector of all DataT elements that are stored within the octree leaf nodes. More...
 
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. More...
 
void deserializeTree (std::vector< char > &binaryTreeIn_arg, bool doXORDecoding_arg=false)
 Deserialize a binary octree description vector and create a corresponding octree structure. More...
 
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. More...
 

Friends

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

Detailed Description

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.
Author
Julius Kammerl (juliu.nosp@m.s@ka.nosp@m.mmerl.nosp@m..de)

Definition at line 178 of file octree2buf_base.h.

Member Typedef Documentation

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef BufferedBranchNode<BranchT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::BranchNode

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

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

Definition at line 204 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstDepthFirstIterator

Definition at line 202 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstIterator

Definition at line 196 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef const OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::ConstLeafNodeIterator

Definition at line 199 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::DepthFirstIterator

Definition at line 201 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeDepthFirstIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::Iterator

Definition at line 195 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeLeafNode<LeafT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::LeafNode

Definition at line 192 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
typedef OctreeLeafNodeIterator<DataT, OctreeT> pcl::octree::Octree2BufBase< DataT, LeafT, BranchT >::LeafNodeIterator

Definition at line 198 of file octree2buf_base.h.

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

Definition at line 183 of file octree2buf_base.h.

Constructor & Destructor Documentation

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.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.

Member Function Documentation

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.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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 = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.

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.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.

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.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.

template<typename DataT, typename LeafT = OctreeContainerDataT<DataT>, typename BranchT = OctreeContainerEmpty<DataT>>
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.

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.

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.

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.

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

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

Definition at line 187 of file octree2buf_base.h.

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

Definition at line 186 of file octree2buf_base.h.

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

Definition at line 189 of file octree2buf_base.h.


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