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::OctreeBase< DataT, LeafT, OctreeBranchT > Class Template Reference

Octree class More...

#include <pcl/octree/octree_base.h>

List of all members.

Classes

class  OctreeKey
 Octree key class

Public Types

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

Public Member Functions

 OctreeBase ()
 Empty constructor.
virtual ~OctreeBase ()
 Empty deconstructor.
 OctreeBase (const OctreeBase &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 serializeTree (std::vector< char > &binaryTreeOut_arg)
 Serialize octree into a binary output vector describing its branch node structure.
void serializeTree (std::vector< char > &binaryTreeOut_arg, std::vector< DataT > &dataVector_arg)
 Serialize octree into a binary output vector describing its branch node structure and push all DataT elements stored in the octree to a vector.
void serializeLeafs (std::vector< DataT > &dataVector_arg)
 Outputs a vector of all DataT elements that are stored within the octree leaf nodes.
void deserializeTree (std::vector< char > &binaryTreeIn_arg)
 Deserialize a binary octree description vector and create a corresponding octree structure.
void deserializeTree (std::vector< char > &binaryTreeIn_arg, std::vector< DataT > &dataVector_arg)
 Deserialize a binary octree description and create a corresponding octree structure.
void deserializeTreeAndOutputLeafData (std::vector< char > &binaryTreeIn_arg, std::vector< DataT > &dataVector_arg)
 Deserialize a binary octree description vector and create a corresponding octree structure.

Friends

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

Detailed Description

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
class pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >

Octree class

Note:
The tree depth defines the maximum amount of octree voxels / leaf nodes (should be initially defined).
All leaf nodes are addressed by integer indices.
Note: The tree depth equates to the bit length of the voxel indices.
Author:
Julius Kammerl (juliu.nosp@m.s@ka.nosp@m.mmerl.nosp@m..de)

Definition at line 65 of file octree_base.h.


Member Typedef Documentation

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef OctreeBreadthFirstIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::BreadthFirstIterator

Definition at line 86 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef const OctreeBreadthFirstIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::ConstBreadthFirstIterator

Definition at line 87 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef const OctreeDepthFirstIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::ConstDepthFirstIterator

Definition at line 85 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef const OctreeDepthFirstIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::ConstIterator

Definition at line 79 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef const OctreeLeafNodeIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::ConstLeafNodeIterator

Definition at line 82 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef OctreeDepthFirstIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::DepthFirstIterator

Definition at line 84 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef OctreeDepthFirstIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::Iterator

Definition at line 78 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef OctreeLeafNodeIterator<DataT, LeafT, OctreeBase> pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::LeafNodeIterator

Definition at line 81 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
typedef OctreeBranchT pcl::octree::OctreeBase< DataT, LeafT, OctreeBranchT >::OctreeBranch

Reimplemented in pcl::octree::OctreeBaseWithState< DataT, LeafT >.

Definition at line 75 of file octree_base.h.


Constructor & Destructor Documentation

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

Empty constructor.

Definition at line 57 of file octree_base.hpp.

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

Empty deconstructor.

Definition at line 72 of file octree_base.hpp.

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

Copy constructor.

Definition at line 97 of file octree_base.h.


Member Function Documentation

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::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 created and added to the octree.

Parameters:
idxX_arg,:index of leaf node in the X axis.
idxY_arg,:index of leaf node in the Y axis.
idxZ_arg,:index of leaf node in the Z axis.
data_arg,:const reference to DataT object to be added.

Definition at line 118 of file octree_base.hpp.

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

template<typename DataT , typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deserializeTree ( std::vector< char > &  binaryTreeIn_arg)

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

Leaf nodes are initialized with getDataTByKey(..).

Parameters:
binaryTreeIn_arg,:reference to input vector for reading binary tree structure.

Definition at line 267 of file octree_base.hpp.

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deserializeTree ( std::vector< char > &  binaryTreeIn_arg,
std::vector< DataT > &  dataVector_arg 
)

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

Leaf nodes are initialized with DataT elements from the dataVector.

Parameters:
binaryTreeIn_arg,:reference to input vector for reading binary tree structure.
dataVector_arg,:reference to DataT vector that provides DataT objects for initializing leaf nodes.

Definition at line 287 of file octree_base.hpp.

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::deserializeTreeAndOutputLeafData ( std::vector< char > &  binaryTreeIn_arg,
std::vector< DataT > &  dataVector_arg 
)

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.

Definition at line 314 of file octree_base.hpp.

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

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

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

Return the amount of existing branches in the octree.

Returns:
amount of branch nodes.

Definition at line 178 of file octree_base.h.

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

Return the amount of existing leafs in the octree.

Returns:
amount of registered leaf nodes.

Definition at line 169 of file octree_base.h.

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

Get the maximum depth of the octree.

Returns:
depth_arg: maximum depth of octree

Definition at line 123 of file octree_base.h.

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

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

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

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

Definition at line 250 of file octree_base.hpp.

template<typename DataT , typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::serializeTree ( std::vector< char > &  binaryTreeOut_arg)

Serialize octree into a binary output vector describing its branch node structure.

Parameters:
binaryTreeOut_arg,:reference to output vector for writing binary tree structure.

Definition at line 217 of file octree_base.hpp.

template<typename DataT, typename LeafT , typename BranchT >
void pcl::octree::OctreeBase< DataT, LeafT, BranchT >::serializeTree ( std::vector< char > &  binaryTreeOut_arg,
std::vector< DataT > &  dataVector_arg 
)

Serialize octree into a binary output vector describing its branch node structure and push all DataT elements stored in the octree to a vector.

Parameters:
binaryTreeOut_arg,:reference to output vector for writing binary tree structure.
dataVector_arg,:reference of DataT vector that receives a copy of all DataT objects in the octree

Definition at line 232 of file octree_base.hpp.

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

Set the maximum amount of voxels per dimension.

Parameters:
maxVoxelIndex_arg,:maximum amount of voxels per dimension

Definition at line 84 of file octree_base.hpp.

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

Set the maximum depth of the octree.

Parameters:
depth_arg,:maximum depth of octree

Definition at line 102 of file octree_base.hpp.


Friends And Related Function Documentation

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
friend class OctreeBreadthFirstIterator< DataT, LeafT, OctreeBase > [friend]

Definition at line 71 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
friend class OctreeDepthFirstIterator< DataT, LeafT, OctreeBase > [friend]

Definition at line 70 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
friend class OctreeIteratorBase< DataT, LeafT, OctreeBase > [friend]

Definition at line 69 of file octree_base.h.

template<typename DataT, typename LeafT = OctreeLeafDataT<DataT>, typename OctreeBranchT = OctreeBranch>
friend class OctreeLeafNodeIterator< DataT, LeafT, OctreeBase > [friend]

Definition at line 72 of file octree_base.h.


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