Point Cloud Library (PCL)  1.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Friends
pcl::octree::Octree2BufBase< DataT, LeafT > Class Template Reference

Octree double buffer class More...

#include <pcl/octree/octree2buf_base.h>

List of all members.

Classes

class  OctreeBranch
 Octree branch class.
class  OctreeKey
 Octree key class

Public Types

typedef
OctreeDepthFirstIterator
< DataT, LeafT, Octree2BufBase
Iterator
typedef const
OctreeDepthFirstIterator
< DataT, LeafT, Octree2BufBase
ConstIterator
typedef OctreeLeafNodeIterator
< DataT, LeafT, Octree2BufBase
LeafNodeIterator
typedef const
OctreeLeafNodeIterator< DataT,
LeafT, Octree2BufBase
ConstLeafNodeIterator
typedef
OctreeDepthFirstIterator
< DataT, LeafT, Octree2BufBase
DepthFirstIterator
typedef const
OctreeDepthFirstIterator
< DataT, LeafT, Octree2BufBase
ConstDepthFirstIterator
typedef
OctreeBreadthFirstIterator
< DataT, LeafT, Octree2BufBase
BreadthFirstIterator
typedef const
OctreeBreadthFirstIterator
< DataT, LeafT, Octree2BufBase
ConstBreadthFirstIterator

Public Member Functions

 Octree2BufBase ()
 Empty constructor.
virtual ~Octree2BufBase ()
 Empty deconstructor.
 Octree2BufBase (const Octree2BufBase &source)
 Copy constructor.
void setMaxVoxelIndex (unsigned int maxVoxelIndex_arg)
 Set the maximum amount of voxels per dimension.
void setTreeDepth (unsigned int depth_arg)
 Set the maximum depth of the octree.
unsigned int getTreeDepth () const
 Get the maximum depth of the octree.
void add (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg, const DataT &data_arg)
 Add a const DataT element to leaf node at (idxX, idxY, idxZ).
bool get (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg, DataT &data_arg) const
 Retrieve a DataT element from leaf node at (idxX, idxY, idxZ).
bool existLeaf (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg) const
 Check for the existence of leaf node at (idxX, idxY, idxZ).
void removeLeaf (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg)
 Remove leaf node at (idxX_arg, idxY_arg, idxZ_arg).
unsigned int getLeafCount () const
 Return the amount of existing leafs in the octree.
unsigned int getBranchCount () const
 Return the amount of existing branches in the octree.
void deleteTree (bool freeMemory_arg=false)
 Delete the octree structure and its leaf nodes.
void deletePreviousBuffer ()
 Delete octree structure of previous buffer.
void deleteCurrentBuffer ()
 Delete the octree structure in the current buffer.
void switchBuffers ()
 Switch buffers and reset current octree structure.
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 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 deserializeTree (std::vector< char > &binaryTreeIn_arg, bool doXORDecoding_arg=false)
 Deserialize a binary octree description vector and create a corresponding octree structure.
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.
void deserializeTreeAndOutputLeafData (std::vector< char > &binaryTreeIn_arg, std::vector< DataT > &dataVector_arg, bool doXORDecoding_arg=false)
 Deserialize a binary octree description vector and create a corresponding octree structure.

Friends

class OctreeIteratorBase< DataT, LeafT, Octree2BufBase >
class OctreeDepthFirstIterator< DataT, LeafT, Octree2BufBase >
class OctreeBreadthFirstIterator< DataT, LeafT, Octree2BufBase >
class OctreeLeafNodeIterator< DataT, LeafT, Octree2BufBase >

Detailed Description

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
class pcl::octree::Octree2BufBase< DataT, LeafT >

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


Member Typedef Documentation

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef OctreeBreadthFirstIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::BreadthFirstIterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef const OctreeBreadthFirstIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::ConstBreadthFirstIterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef const OctreeDepthFirstIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::ConstDepthFirstIterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef const OctreeDepthFirstIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::ConstIterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef const OctreeLeafNodeIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::ConstLeafNodeIterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef OctreeDepthFirstIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::DepthFirstIterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef OctreeDepthFirstIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::Iterator
template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
typedef OctreeLeafNodeIterator<DataT, LeafT, Octree2BufBase> pcl::octree::Octree2BufBase< DataT, LeafT >::LeafNodeIterator

Constructor & Destructor Documentation

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

Empty constructor.

Definition at line 51 of file octree2buf_base.hpp.

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

Empty deconstructor.

Definition at line 67 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
pcl::octree::Octree2BufBase< DataT, LeafT >::Octree2BufBase ( const Octree2BufBase< DataT, LeafT > &  source) [inline]

Copy constructor.

Definition at line 97 of file octree2buf_base.h.


Member Function Documentation

template<typename DataT, typename LeafT >
void pcl::octree::Octree2BufBase< DataT, LeafT >::add ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg,
const DataT &  data_arg 
)

Add a const DataT element to leaf node at (idxX, idxY, idxZ).

If leaf node does not exist, it is 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 110 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::Octree2BufBase< DataT, LeafT >::deleteCurrentBuffer ( ) [inline]

Delete the octree structure in the current buffer.

Definition at line 201 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
void pcl::octree::Octree2BufBase< DataT, LeafT >::deletePreviousBuffer ( ) [inline]

Delete octree structure of previous buffer.

Definition at line 194 of file octree2buf_base.h.

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

Delete the octree structure and its leaf nodes.

Parameters:
freeMemory_arg,:if "true", allocated octree nodes are deleted, otherwise they are pushed to the octree node pool

Definition at line 182 of file octree2buf_base.hpp.

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

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

template<typename DataT, typename LeafT >
void pcl::octree::Octree2BufBase< DataT, LeafT >::deserializeTreeAndOutputLeafData ( std::vector< char > &  binaryTreeIn_arg,
std::vector< DataT > &  dataVector_arg,
bool  doXORDecoding_arg = false 
)

Deserialize a binary octree description vector and create a corresponding octree structure.

Leaf nodes are initialized with getDataTByKey(..). Generated DataT objects are copied to output vector.

Parameters:
binaryTreeIn_arg,:reference to input vector for reading binary tree structure.
dataVector_arg,:reference to DataT vector that receives a copy of generated DataT objects.
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 342 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT >
bool pcl::octree::Octree2BufBase< DataT, LeafT >::existLeaf ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg 
) const

Check for the existence of leaf node at (idxX, idxY, idxZ).

Parameters:
idxX_arg,:index of leaf node in the X axis.
idxY_arg,:index of leaf node in the Y axis.
idxZ_arg,:index of leaf node in the Z axis.
Returns:
"true" if leaf node search is successful, otherwise it returns "false".

Definition at line 152 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT >
bool pcl::octree::Octree2BufBase< DataT, LeafT >::get ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg,
DataT &  data_arg 
) const

Retrieve a DataT element from leaf node at (idxX, idxY, idxZ).

It returns false if leaf node does not exist.

Parameters:
idxX_arg,:index of leaf node in the X axis.
idxY_arg,:index of leaf node in the Y axis.
idxZ_arg,:index of leaf node in the Z axis.
data_arg,:reference to DataT object that contains content of leaf node if search was successful.
Returns:
"true" if leaf node search is successful, otherwise it returns "false".

Definition at line 127 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::Octree2BufBase< DataT, LeafT >::getBranchCount ( ) const [inline]

Return the amount of existing branches in the octree.

Returns:
amount of branch nodes.

Definition at line 181 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::Octree2BufBase< DataT, LeafT >::getLeafCount ( ) const [inline]

Return the amount of existing leafs in the octree.

Returns:
amount of registered leaf nodes.

Definition at line 172 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
unsigned int pcl::octree::Octree2BufBase< DataT, LeafT >::getTreeDepth ( ) const [inline]

Get the maximum depth of the octree.

Returns:
depth_arg: maximum depth of octree

Reimplemented in pcl::octree::OctreePointCloud< PointT, LeafT, Octree2BufBase< int, LeafT > >.

Definition at line 126 of file octree2buf_base.h.

template<typename DataT , typename LeafT >
void pcl::octree::Octree2BufBase< DataT, LeafT >::removeLeaf ( const unsigned int  idxX_arg,
const unsigned int  idxY_arg,
const unsigned int  idxZ_arg 
)

Remove leaf node at (idxX_arg, idxY_arg, idxZ_arg).

Parameters:
idxX_arg,:index of leaf node in the X axis.
idxY_arg,:index of leaf node in the Y axis.
idxZ_arg,:index of leaf node in the Z axis.

Definition at line 167 of file octree2buf_base.hpp.

template<typename DataT, typename LeafT >
void pcl::octree::Octree2BufBase< DataT, LeafT >::serializeLeafs ( std::vector< DataT > &  dataVector_arg)

Outputs a vector of all DataT elements that are stored within the octree leaf nodes.

Parameters:
dataVector_arg,:reference to DataT vector that receives a copy of all DataT objects in the octree.

Definition at line 269 of file octree2buf_base.hpp.

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

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

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

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

Set the maximum amount of voxels per dimension.

Parameters:
maxVoxelIndex_arg,:maximum amount of voxels per dimension

Definition at line 78 of file octree2buf_base.hpp.

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

Set the maximum depth of the octree.

Parameters:
depth_arg,:maximum depth of octree

Definition at line 96 of file octree2buf_base.hpp.

template<typename DataT , typename LeafT >
void pcl::octree::Octree2BufBase< DataT, LeafT >::switchBuffers ( )

Switch buffers and reset current octree structure.

Definition at line 206 of file octree2buf_base.hpp.


Friends And Related Function Documentation

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
friend class OctreeBreadthFirstIterator< DataT, LeafT, Octree2BufBase > [friend]

Definition at line 72 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
friend class OctreeDepthFirstIterator< DataT, LeafT, Octree2BufBase > [friend]

Definition at line 71 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
friend class OctreeIteratorBase< DataT, LeafT, Octree2BufBase > [friend]

Definition at line 70 of file octree2buf_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>>
friend class OctreeLeafNodeIterator< DataT, LeafT, Octree2BufBase > [friend]

Definition at line 73 of file octree2buf_base.h.


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