pcl::octree::OctreeBase< LeafContainerT, BranchContainerT > Class Template Reference
[Module octree]

Octree class. More...

#include <pcl/octree/octree_base.h>

Inheritance diagram for pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef OctreeBase
< LeafContainerT,
BranchContainerT > 
OctreeT
typedef OctreeBranchNode
< BranchContainerT > 
BranchNode
typedef OctreeLeafNode
< LeafContainerT > 
LeafNode
typedef BranchContainerT BranchContainer
typedef LeafContainerT LeafContainer
typedef
OctreeDepthFirstIterator
< OctreeT
Iterator
typedef const
OctreeDepthFirstIterator
< OctreeT
ConstIterator
typedef OctreeLeafNodeIterator
< OctreeT
LeafNodeIterator
typedef const
OctreeLeafNodeIterator
< OctreeT
ConstLeafNodeIterator
typedef
OctreeDepthFirstIterator
< OctreeT
DepthFirstIterator
typedef const
OctreeDepthFirstIterator
< OctreeT
ConstDepthFirstIterator
typedef
OctreeBreadthFirstIterator
< OctreeT
BreadthFirstIterator
typedef const
OctreeBreadthFirstIterator
< OctreeT
ConstBreadthFirstIterator

Public Member Functions

Iterator begin (unsigned int max_depth_arg=0)
const Iterator end ()
LeafNodeIterator leaf_begin (unsigned int max_depth_arg=0)
const LeafNodeIterator leaf_end ()
DepthFirstIterator depth_begin (unsigned int max_depth_arg=0)
const DepthFirstIterator depth_end ()
BreadthFirstIterator breadth_begin (unsigned int max_depth_arg=0)
const BreadthFirstIterator breadth_end ()
 OctreeBase ()
 Empty constructor.
virtual ~OctreeBase ()
 Empty deconstructor.
 OctreeBase (const OctreeBase &source)
 Copy constructor.
OctreeBaseoperator= (const OctreeBase &source)
 Copy operator.
void setMaxVoxelIndex (unsigned int max_voxel_index_arg)
 Set the maximum amount of voxels per dimension.
void setTreeDepth (unsigned int max_depth_arg)
 Set the maximum depth of the octree.
unsigned int getTreeDepth () const
 Get the maximum depth of the octree.
LeafContainerT * createLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg)
 Create new leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
LeafContainerT * findLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg)
 Find leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
bool existLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg) const
 idx_x_arg for the existence of leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
void removeLeaf (unsigned int idx_x_arg, unsigned int idx_y_arg, unsigned int idx_z_arg)
 Remove leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
std::size_t getLeafCount () const
 Return the amount of existing leafs in the octree.
std::size_t getBranchCount () const
 Return the amount of existing branch nodes in the octree.
void deleteTree ()
 Delete the octree structure and its leaf nodes.
void serializeTree (std::vector< char > &binary_tree_out_arg)
 Serialize octree into a binary output vector describing its branch node structure.
void serializeTree (std::vector< char > &binary_tree_out_arg, std::vector< LeafContainerT * > &leaf_container_vector_arg)
 Serialize octree into a binary output vector describing its branch node structure and push all LeafContainerT elements stored in the octree to a vector.
void serializeLeafs (std::vector< LeafContainerT * > &leaf_container_vector_arg)
 Outputs a vector of all LeafContainerT elements that are stored within the octree leaf nodes.
void deserializeTree (std::vector< char > &binary_tree_input_arg)
 Deserialize a binary octree description vector and create a corresponding octree structure.
void deserializeTree (std::vector< char > &binary_tree_input_arg, std::vector< LeafContainerT * > &leaf_container_vector_arg)
 Deserialize a binary octree description and create a corresponding octree structure.

Protected Member Functions

LeafContainerT * createLeaf (const OctreeKey &key_arg)
 Create a leaf node.
LeafContainerT * findLeaf (const OctreeKey &key_arg) const
 Find leaf node.
bool existLeaf (const OctreeKey &key_arg) const
 Check for existance of a leaf node in the octree.
void removeLeaf (const OctreeKey &key_arg)
 Remove leaf node from octree.
OctreeNodegetRootNode () const
 Retrieve root node.
bool branchHasChild (const BranchNode &branch_arg, unsigned char child_idx_arg) const
 Check if branch is pointing to a particular child node.
OctreeNodegetBranchChildPtr (const BranchNode &branch_arg, unsigned char child_idx_arg) const
 Retrieve a child node pointer for child node at child_idx.
void setBranchChildPtr (BranchNode &branch_arg, unsigned char child_idx_arg, OctreeNode *new_child_arg)
 Assign new child node to branch.
char getBranchBitPattern (const BranchNode &branch_arg) const
 Generate bit pattern reflecting the existence of child node pointers.
void deleteBranchChild (BranchNode &branch_arg, unsigned char child_idx_arg)
 Delete child node and all its subchilds from octree.
void deleteBranch (BranchNode &branch_arg)
 Delete branch and all its subchilds from octree.
BranchNodecreateBranchChild (BranchNode &branch_arg, unsigned char child_idx_arg)
 Create and add a new branch child to a branch class.
LeafNodecreateLeafChild (BranchNode &branch_arg, unsigned char child_idx_arg)
 Create and add a new leaf child to a branch class.
unsigned int createLeafRecursive (const OctreeKey &key_arg, unsigned int depth_mask_arg, BranchNode *branch_arg, LeafNode *&return_leaf_arg, BranchNode *&parent_of_leaf_arg)
 Create a leaf node at octree key.
void findLeafRecursive (const OctreeKey &key_arg, unsigned int depth_mask_arg, BranchNode *branch_arg, LeafContainerT *&result_arg) const
 Recursively search for a given leaf node and return a pointer.
bool deleteLeafRecursive (const OctreeKey &key_arg, unsigned int depth_mask_arg, BranchNode *branch_arg)
 Recursively search and delete leaf node.
void serializeTreeRecursive (const BranchNode *branch_arg, OctreeKey &key_arg, std::vector< char > *binary_tree_out_arg, typename std::vector< LeafContainerT * > *leaf_container_vector_arg) const
 Recursively explore the octree and output binary octree description together with a vector of leaf node LeafContainerTs.
void deserializeTreeRecursive (BranchNode *branch_arg, unsigned int depth_mask_arg, OctreeKey &key_arg, typename std::vector< char >::const_iterator &binary_tree_input_it_arg, typename std::vector< char >::const_iterator &binary_tree_input_it_end_arg, typename std::vector< LeafContainerT * >::const_iterator *leaf_container_vector_it_arg, typename std::vector< LeafContainerT * >::const_iterator *leaf_container_vector_it_end_arg)
 Recursive method for deserializing octree structure.
virtual void serializeTreeCallback (LeafContainerT &, const OctreeKey &) const
 Callback executed for every leaf node during serialization.
virtual void deserializeTreeCallback (LeafContainerT &, const OctreeKey &)
 Callback executed for every leaf node during deserialization.
double Log2 (double n_arg)
 Helper function to calculate the binary logarithm.
bool octreeCanResize ()
 Test if octree is able to dynamically change its depth.

Protected Attributes

std::size_t leaf_count_
 Amount of leaf nodes.
std::size_t branch_count_
 Amount of branch nodes.
BranchNoderoot_node_
 Pointer to root branch node of octree.
unsigned int depth_mask_
 Depth mask based on octree depth.
unsigned int octree_depth_
 Octree depth.
bool dynamic_depth_enabled_
 Enable dynamic_depth.
OctreeKey max_key_
 key range

Friends

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

Detailed Description

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
class pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >

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 (julius@kammerl.de)

Definition at line 63 of file octree_base.h.


Member Typedef Documentation

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef BranchContainerT pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::BranchContainer

Definition at line 73 of file octree_base.h.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeBranchNode<BranchContainerT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::BranchNode
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeBreadthFirstIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::BreadthFirstIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef const OctreeBreadthFirstIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::ConstBreadthFirstIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef const OctreeDepthFirstIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::ConstDepthFirstIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef const OctreeDepthFirstIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::ConstIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef const OctreeLeafNodeIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::ConstLeafNodeIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeDepthFirstIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::DepthFirstIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeDepthFirstIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::Iterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef LeafContainerT pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::LeafContainer

Definition at line 74 of file octree_base.h.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeLeafNode<LeafContainerT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::LeafNode
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeLeafNodeIterator<OctreeT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::LeafNodeIterator
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
typedef OctreeBase<LeafContainerT, BranchContainerT> pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::OctreeT

Constructor & Destructor Documentation

template<typename LeafContainerT , typename BranchContainerT >
pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::OctreeBase (  )  [inline]

Empty constructor.

Definition at line 54 of file octree_base.hpp.

template<typename LeafContainerT , typename BranchContainerT >
pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::~OctreeBase (  )  [inline, virtual]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::OctreeBase ( const OctreeBase< LeafContainerT, BranchContainerT > &  source  )  [inline]

Copy constructor.

Definition at line 115 of file octree_base.h.


Member Function Documentation

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
Iterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::begin ( unsigned int  max_depth_arg = 0  )  [inline]

Definition at line 85 of file octree_base.h.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
bool pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branchHasChild ( const BranchNode branch_arg,
unsigned char  child_idx_arg 
) const [inline, protected]

Check if branch is pointing to a particular child node.

Parameters:
branch_arg,: reference to octree branch class
child_idx_arg,: index to child node
Returns:
"true" if pointer to child node exists; "false" otherwise

Definition at line 325 of file octree_base.h.

References pcl::octree::OctreeBranchNode< ContainerT >::getChildPtr().

Referenced by pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::approxNearestSearchRecursive(), pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::getKNearestNeighborRecursive(), and pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::getNeighborsWithinRadiusRecursive().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
BreadthFirstIterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::breadth_begin ( unsigned int  max_depth_arg = 0  )  [inline]

Definition at line 103 of file octree_base.h.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
const BreadthFirstIterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::breadth_end (  )  [inline]

Definition at line 104 of file octree_base.h.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
BranchNode* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createBranchChild ( BranchNode branch_arg,
unsigned char  child_idx_arg 
) [inline, protected]

Create and add a new branch child to a branch class.

Parameters:
branch_arg,: reference to octree branch class
child_idx_arg,: index to child node
Returns:
pointer of new branch child to this reference

Definition at line 431 of file octree_base.h.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafRecursive(), and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeRecursive().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
LeafContainerT* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeaf ( const OctreeKey key_arg  )  [inline, protected]
template<typename LeafContainerT , typename BranchContainerT >
LeafContainerT * pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeaf ( unsigned int  idx_x_arg,
unsigned int  idx_y_arg,
unsigned int  idx_z_arg 
) [inline]

Create new leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).

Note:
If leaf node already exist, this method returns the existing node
Parameters:
idx_x_arg,: index of leaf node in the X axis.
idx_y_arg,: index of leaf node in the Y axis.
idx_z_arg,: index of leaf node in the Z axis.
Returns:
pointer to new leaf node container.

Definition at line 124 of file octree_base.hpp.

Referenced by pcl::octree::OctreePointCloudVoxelCentroid< PointT, LeafContainerT, BranchContainerT >::addPointIdx(), and pcl::octree::OctreePointCloudAdjacency< PointT, LeafContainerT, BranchContainerT >::addPointIdx().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
LeafNode* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafChild ( BranchNode branch_arg,
unsigned char  child_idx_arg 
) [inline, protected]

Create and add a new leaf child to a branch class.

Parameters:
branch_arg,: reference to octree branch class
child_idx_arg,: index to child node
Returns:
pointer of new leaf child to this reference

Definition at line 446 of file octree_base.h.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafRecursive(), and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeRecursive().

template<typename LeafContainerT , typename BranchContainerT >
unsigned int pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafRecursive ( const OctreeKey key_arg,
unsigned int  depth_mask_arg,
BranchNode branch_arg,
LeafNode *&  return_leaf_arg,
BranchNode *&  parent_of_leaf_arg 
) [inline, protected]

Create a leaf node at octree key.

If leaf node does already exist, it is returned.

Parameters:
key_arg,: reference to an octree key
depth_mask_arg,: depth mask used for octree key analysis and for branch depth indicator
branch_arg,: current branch node
return_leaf_arg,: return pointer to leaf node
parent_of_leaf_arg,: return pointer to parent of leaf node
Returns:
depth mask at which leaf node was created

Definition at line 286 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_, pcl::octree::BRANCH_NODE, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createBranchChild(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafChild(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::dynamic_depth_enabled_, pcl::octree::OctreeKey::getChildIdxWithDepthMask(), pcl::octree::OctreeNode::getNodeType(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_, and pcl::octree::LEAF_NODE.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeaf().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteBranch ( BranchNode branch_arg  )  [inline, protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteBranchChild ( BranchNode branch_arg,
unsigned char  child_idx_arg 
) [inline, protected]
template<typename LeafContainerT , typename BranchContainerT >
bool pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteLeafRecursive ( const OctreeKey key_arg,
unsigned int  depth_mask_arg,
BranchNode branch_arg 
) [inline, protected]

Recursively search and delete leaf node.

Parameters:
key_arg,: reference to an octree key
depth_mask_arg,: depth mask used for octree key analysis and branch depth indicator
branch_arg,: current branch node
Returns:
"true" if branch does not contain any childs; "false" otherwise. This indicates if current branch can be deleted, too.

Definition at line 386 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_, pcl::octree::BRANCH_NODE, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteBranchChild(), pcl::octree::OctreeKey::getChildIdxWithDepthMask(), pcl::octree::OctreeNode::getNodeType(), pcl::octree::OctreeBranchNode< ContainerT >::hasChild(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_, and pcl::octree::LEAF_NODE.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::removeLeaf().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteTree (  )  [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
DepthFirstIterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_begin ( unsigned int  max_depth_arg = 0  )  [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
const DepthFirstIterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_end (  )  [inline]
template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTree ( std::vector< char > &  binary_tree_input_arg,
std::vector< LeafContainerT * > &  leaf_container_vector_arg 
) [inline]

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

Leaf nodes are initialized with LeafContainerT elements from the dataVector.

Parameters:
binary_tree_input_arg,: reference to input vector for reading binary tree structure.
leaf_container_vector_arg,: pointer to container vector.

Definition at line 255 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteTree(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_mask_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeRecursive(), and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_.

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTree ( std::vector< char > &  binary_tree_input_arg  )  [inline]

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

Leaf nodes are initialized with getDataTByKey(..).

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

Definition at line 231 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteTree(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_mask_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeRecursive(), and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
virtual void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeCallback ( LeafContainerT &  ,
const OctreeKey  
) [inline, protected, virtual]

Callback executed for every leaf node during deserialization.

Definition at line 541 of file octree_base.h.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeRecursive().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeRecursive ( BranchNode branch_arg,
unsigned int  depth_mask_arg,
OctreeKey key_arg,
typename std::vector< char >::const_iterator &  binary_tree_input_it_arg,
typename std::vector< char >::const_iterator &  binary_tree_input_it_end_arg,
typename std::vector< LeafContainerT * >::const_iterator *  leaf_container_vector_it_arg,
typename std::vector< LeafContainerT * >::const_iterator *  leaf_container_vector_it_end_arg 
) [inline, protected]

Recursive method for deserializing octree structure.

Parameters:
branch_arg,: current branch node
depth_mask_arg,: depth mask used for octree key analysis and branch depth indicator
key_arg,: reference to an octree key
binary_tree_input_it_arg,: iterator to binary input vector
binary_tree_input_it_end_arg,: end iterator of binary input vector
leaf_container_vector_it_arg,: iterator pointing to current LeafContainerT object to be added to a leaf node
leaf_container_vector_it_end_arg,: iterator pointing to last object in LeafContainerT input vector.

Definition at line 505 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createBranchChild(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafChild(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTreeCallback(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_, pcl::octree::OctreeKey::popBranch(), and pcl::octree::OctreeKey::pushBranch().

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTree().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
const Iterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::end (  )  [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
bool pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::existLeaf ( const OctreeKey key_arg  )  const [inline, protected]

Check for existance of a leaf node in the octree.

Parameters:
key_arg,: octree key addressing a leaf node.
Returns:
"true" if leaf node is found; "false" otherwise

Definition at line 293 of file octree_base.h.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeaf().

template<typename LeafContainerT , typename BranchContainerT >
bool pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::existLeaf ( unsigned int  idx_x_arg,
unsigned int  idx_y_arg,
unsigned int  idx_z_arg 
) const [inline]

idx_x_arg for the existence of leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).

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

Definition at line 138 of file octree_base.hpp.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
LeafContainerT* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeaf ( const OctreeKey key_arg  )  const [inline, protected]

Find leaf node.

Parameters:
key_arg,: octree key addressing a leaf node.
Returns:
pointer to leaf node. If leaf node is not found, this pointer returns 0.

Definition at line 281 of file octree_base.h.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_mask_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeafRecursive(), and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_.

template<typename LeafContainerT , typename BranchContainerT >
LeafContainerT * pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeaf ( unsigned int  idx_x_arg,
unsigned int  idx_y_arg,
unsigned int  idx_z_arg 
) [inline]

Find leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).

Note:
If leaf node already exist, this method returns the existing node
Parameters:
idx_x_arg,: index of leaf node in the X axis.
idx_y_arg,: index of leaf node in the Y axis.
idx_z_arg,: index of leaf node in the Z axis.
Returns:
pointer to leaf node container if found, null pointer otherwise.

Definition at line 110 of file octree_base.hpp.

Referenced by pcl::octree::OctreePointCloudAdjacency< PointT, LeafContainerT, BranchContainerT >::computeNeighbors(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::existLeaf(), pcl::octree::OctreePointCloudAdjacency< PointT, LeafContainerT, BranchContainerT >::getLeafContainerAtPoint(), pcl::octree::OctreePointCloudVoxelCentroid< PointT, LeafContainerT, BranchContainerT >::getVoxelCentroidAtPoint(), pcl::octree::OctreePointCloudAdjacency< PointT, LeafContainerT, BranchContainerT >::testForOcclusion(), and pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::voxelSearch().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeafRecursive ( const OctreeKey key_arg,
unsigned int  depth_mask_arg,
BranchNode branch_arg,
LeafContainerT *&  result_arg 
) const [inline, protected]

Recursively search for a given leaf node and return a pointer.

Note:
If leaf node does not exist, a 0 pointer is returned.
Parameters:
key_arg,: reference to an octree key
depth_mask_arg,: depth mask used for octree key analysis and for branch depth indicator
branch_arg,: current branch node
result_arg,: pointer to leaf node class

Definition at line 347 of file octree_base.hpp.

References pcl::octree::BRANCH_NODE, pcl::octree::OctreeKey::getChildIdxWithDepthMask(), pcl::octree::OctreeLeafNode< ContainerT >::getContainerPtr(), pcl::octree::OctreeNode::getNodeType(), and pcl::octree::LEAF_NODE.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeaf().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
char pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getBranchBitPattern ( const BranchNode branch_arg  )  const [inline, protected]

Generate bit pattern reflecting the existence of child node pointers.

Parameters:
branch_arg,: reference to octree branch class
Returns:
a single byte with 8 bits of child node information

Definition at line 361 of file octree_base.h.

References pcl::octree::OctreeBranchNode< ContainerT >::getChildPtr().

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeRecursive().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
OctreeNode* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getBranchChildPtr ( const BranchNode branch_arg,
unsigned char  child_idx_arg 
) const [inline, protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
std::size_t pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getBranchCount (  )  const [inline]

Return the amount of existing branch nodes in the octree.

Returns:
amount of branch nodes.

Definition at line 210 of file octree_base.h.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
std::size_t pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getLeafCount (  )  const [inline]

Return the amount of existing leafs in the octree.

Returns:
amount of registered leaf nodes.

Definition at line 201 of file octree_base.h.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_.

Referenced by pcl::octree::OctreePointCloudAdjacency< PointT, LeafContainerT, BranchContainerT >::addPointsFromInputCloud().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
OctreeNode* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getRootNode (  )  const [inline, protected]

Retrieve root node.

Definition at line 314 of file octree_base.h.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
unsigned int pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getTreeDepth (  )  const [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
LeafNodeIterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_begin ( unsigned int  max_depth_arg = 0  )  [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
const LeafNodeIterator pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_end (  )  [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
double pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::Log2 ( double  n_arg  )  [inline, protected]

Helper function to calculate the binary logarithm.

Parameters:
n_arg,: some value
Returns:
binary logarithm (log2) of argument n_arg

Definition at line 555 of file octree_base.h.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::setMaxVoxelIndex().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
bool pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::octreeCanResize (  )  [inline, protected]

Test if octree is able to dynamically change its depth.

This is required for adaptive bounding box adjustment.

Returns:
"true"

Definition at line 564 of file octree_base.h.

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
OctreeBase& pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::operator= ( const OctreeBase< LeafContainerT, BranchContainerT > &  source  )  [inline]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::removeLeaf ( const OctreeKey key_arg  )  [inline, protected]
template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::removeLeaf ( unsigned int  idx_x_arg,
unsigned int  idx_y_arg,
unsigned int  idx_z_arg 
) [inline]

Remove leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).

Parameters:
idx_x_arg,: index of leaf node in the X axis.
idx_y_arg,: index of leaf node in the Y axis.
idx_z_arg,: index of leaf node in the Z axis.

Definition at line 152 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteLeafRecursive(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_mask_, and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_.

Referenced by pcl::octree::OctreePointCloudAdjacency< PointT, LeafContainerT, BranchContainerT >::addPointsFromInputCloud().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeLeafs ( std::vector< LeafContainerT * > &  leaf_container_vector_arg  )  [inline]

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

Parameters:
leaf_container_vector_arg,: pointers to LeafContainerT vector that receives a copy of all LeafContainerT objects in the octree.

Definition at line 216 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_, and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeRecursive().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTree ( std::vector< char > &  binary_tree_out_arg,
std::vector< LeafContainerT * > &  leaf_container_vector_arg 
) [inline]

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

Parameters:
binary_tree_out_arg,: reference to output vector for writing binary tree structure.
leaf_container_vector_arg,: pointer to all LeafContainerT objects in the octree

Definition at line 197 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_, and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeRecursive().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTree ( std::vector< char > &  binary_tree_out_arg  )  [inline]

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

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

Definition at line 182 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_, and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeRecursive().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
virtual void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeCallback ( LeafContainerT &  ,
const OctreeKey  
) const [inline, protected, virtual]

Callback executed for every leaf node during serialization.

Definition at line 533 of file octree_base.h.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeRecursive().

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTreeRecursive ( const BranchNode branch_arg,
OctreeKey key_arg,
std::vector< char > *  binary_tree_out_arg,
typename std::vector< LeafContainerT * > *  leaf_container_vector_arg 
) const [inline, protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::setBranchChildPtr ( BranchNode branch_arg,
unsigned char  child_idx_arg,
OctreeNode new_child_arg 
) [inline, protected]

Assign new child node to branch.

Parameters:
branch_arg,: reference to octree branch class
child_idx_arg,: index to child node
new_child_arg,: pointer to new child node

Definition at line 349 of file octree_base.h.

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::setMaxVoxelIndex ( unsigned int  max_voxel_index_arg  )  [inline]

Set the maximum amount of voxels per dimension.

Parameters:
[in] max_voxel_index_arg maximum amount of voxels per dimension

Definition at line 77 of file octree_base.hpp.

References pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_mask_, pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::Log2(), and pcl::octree::OctreeKey::maxDepth.

template<typename LeafContainerT , typename BranchContainerT >
void pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::setTreeDepth ( unsigned int  max_depth_arg  )  [inline]

Friends And Related Function Documentation

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
friend class OctreeBreadthFirstIterator< OctreeT > [friend]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
friend class OctreeDepthFirstIterator< OctreeT > [friend]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
friend class OctreeIteratorBase< OctreeT > [friend]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
friend class OctreeLeafNodeIterator< OctreeT > [friend]

Member Data Documentation

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
std::size_t pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::branch_count_ [protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
unsigned int pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::depth_mask_ [protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
bool pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::dynamic_depth_enabled_ [protected]

Enable dynamic_depth.

Definition at line 589 of file octree_base.h.

Referenced by pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeafRecursive().

template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
std::size_t pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::leaf_count_ [protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
OctreeKey pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::max_key_ [protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
unsigned int pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::octree_depth_ [protected]
template<typename LeafContainerT = int, typename BranchContainerT = OctreeContainerEmpty>
BranchNode* pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::root_node_ [protected]

Pointer to root branch node of octree.

Definition at line 580 of file octree_base.h.

Referenced by pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::approxNearestSearch(), pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::boxSearch(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::createLeaf(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deleteTree(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::deserializeTree(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::findLeaf(), pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::getIntersectedVoxelCenters(), pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::getIntersectedVoxelIndices(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::getRootNode(), pcl::octree::OctreePointCloudVoxelCentroid< PointT, LeafContainerT, BranchContainerT >::getVoxelCentroids(), pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::nearestKSearch(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::operator=(), pcl::octree::OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT >::radiusSearch(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::removeLeaf(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeLeafs(), pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::serializeTree(), and pcl::octree::OctreeBase< LeafContainerT, BranchContainerT >::~OctreeBase().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends