Loading...
Searching...
No Matches
octree_base.hpp
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, Willow Garage, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/
#ifndef PCL_OCTREE_BASE_HPP
#define PCL_OCTREE_BASE_HPP
#include <vector>
namespace pcl {
namespace octree {
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
OctreeBase<LeafContainerT, BranchContainerT>::OctreeBase()
: root_node_(new BranchNode())
{}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
OctreeBase<LeafContainerT, BranchContainerT>::~OctreeBase()
{
// deallocate tree structure
deleteTree();
delete (root_node_);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::setMaxVoxelIndex(
uindex_t max_voxel_index_arg)
{
uindex_t tree_depth;
if (max_voxel_index_arg <= 0) {
PCL_ERROR("[pcl::octree::OctreeBase::setMaxVoxelIndex] Max voxel index (%lu) must "
"be > 0!\n",
max_voxel_index_arg);
return;
}
// tree depth == bitlength of maxVoxels
tree_depth =
std::min(static_cast<uindex_t>(OctreeKey::maxDepth),
static_cast<uindex_t>(std::ceil(std::log2(max_voxel_index_arg))));
setTreeDepth(tree_depth);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::setTreeDepth(uindex_t depth_arg)
{
if (depth_arg <= 0) {
PCL_ERROR("[pcl::octree::OctreeBase::setTreeDepth] Tree depth (%lu) must be > 0!\n",
depth_arg);
return;
}
if (depth_arg > OctreeKey::maxDepth) {
PCL_ERROR("[pcl::octree::OctreeBase::setTreeDepth] Tree depth (%lu) must be <= max "
"depth(%lu)!\n",
depth_arg,
OctreeKey::maxDepth);
return;
}
// set octree depth
octree_depth_ = depth_arg;
// define depth_mask_ by setting a single bit to 1 at bit position == tree depth
depth_mask_ = (1 << (depth_arg - 1));
// define max_key_
max_key_.x = max_key_.y = max_key_.z = (1 << depth_arg) - 1;
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
LeafContainerT*
OctreeBase<LeafContainerT, BranchContainerT>::findLeaf(uindex_t idx_x_arg,
uindex_t idx_y_arg,
uindex_t idx_z_arg) const
{
// generate key
OctreeKey key(idx_x_arg, idx_y_arg, idx_z_arg);
// find the leaf node addressed by key
return (findLeaf(key));
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
LeafContainerT*
OctreeBase<LeafContainerT, BranchContainerT>::createLeaf(uindex_t idx_x_arg,
uindex_t idx_y_arg,
uindex_t idx_z_arg)
{
// generate key
OctreeKey key(idx_x_arg, idx_y_arg, idx_z_arg);
// create a leaf node addressed by key
return (createLeaf(key));
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
bool
OctreeBase<LeafContainerT, BranchContainerT>::existLeaf(uindex_t idx_x_arg,
uindex_t idx_y_arg,
uindex_t idx_z_arg) const
{
// generate key
OctreeKey key(idx_x_arg, idx_y_arg, idx_z_arg);
// check if key exist in octree
return (existLeaf(key));
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::removeLeaf(uindex_t idx_x_arg,
uindex_t idx_y_arg,
uindex_t idx_z_arg)
{
// generate key
OctreeKey key(idx_x_arg, idx_y_arg, idx_z_arg);
// delete the leaf node addressed by key
deleteLeafRecursive(key, depth_mask_, root_node_);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::deleteTree()
{
if (root_node_) {
// reset octree
deleteBranch(*root_node_);
leaf_count_ = 0;
branch_count_ = 1;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::serializeTree(
std::vector<char>& binary_tree_out_arg) const
{
OctreeKey new_key;
// clear binary vector
binary_tree_out_arg.clear();
binary_tree_out_arg.reserve(this->branch_count_);
serializeTreeRecursive(root_node_, new_key, &binary_tree_out_arg, nullptr);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::serializeTree(
std::vector<char>& binary_tree_out_arg,
std::vector<LeafContainerT*>& leaf_container_vector_arg) const
{
OctreeKey new_key;
// clear output vectors
binary_tree_out_arg.clear();
leaf_container_vector_arg.clear();
binary_tree_out_arg.reserve(this->branch_count_);
leaf_container_vector_arg.reserve(this->leaf_count_);
serializeTreeRecursive(
root_node_, new_key, &binary_tree_out_arg, &leaf_container_vector_arg);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::serializeLeafs(
std::vector<LeafContainerT*>& leaf_container_vector_arg)
{
OctreeKey new_key;
// clear output vector
leaf_container_vector_arg.clear();
leaf_container_vector_arg.reserve(this->leaf_count_);
serializeTreeRecursive(root_node_, new_key, nullptr, &leaf_container_vector_arg);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::deserializeTree(
std::vector<char>& binary_tree_out_arg)
{
OctreeKey new_key;
// free existing tree before tree rebuild
deleteTree();
// iterator for binary tree structure vector
auto binary_tree_out_it = binary_tree_out_arg.cbegin();
auto binary_tree_out_it_end = binary_tree_out_arg.cend();
deserializeTreeRecursive(root_node_,
depth_mask_,
new_key,
binary_tree_out_it,
binary_tree_out_it_end,
nullptr,
nullptr);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::deserializeTree(
std::vector<char>& binary_tree_in_arg,
std::vector<LeafContainerT*>& leaf_container_vector_arg)
{
OctreeKey new_key;
// set data iterator to first element
auto leaf_vector_it = leaf_container_vector_arg.cbegin();
// set data iterator to last element
auto leaf_vector_it_end = leaf_container_vector_arg.cend();
// free existing tree before tree rebuild
deleteTree();
// iterator for binary tree structure vector
auto binary_tree_input_it = binary_tree_in_arg.cbegin();
auto binary_tree_input_it_end = binary_tree_in_arg.cend();
deserializeTreeRecursive(root_node_,
depth_mask_,
new_key,
binary_tree_input_it,
binary_tree_input_it_end,
&leaf_vector_it,
&leaf_vector_it_end);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
uindex_t
OctreeBase<LeafContainerT, BranchContainerT>::createLeafRecursive(
const OctreeKey& key_arg,
uindex_t depth_mask_arg,
BranchNode* branch_arg,
LeafNode*& return_leaf_arg,
BranchNode*& parent_of_leaf_arg)
{
// index to branch child
unsigned char child_idx;
// find branch child from key
child_idx = key_arg.getChildIdxWithDepthMask(depth_mask_arg);
OctreeNode* child_node = (*branch_arg)[child_idx];
if (!child_node) {
if ((!dynamic_depth_enabled_) && (depth_mask_arg > 1)) {
// if required branch does not exist -> create it
BranchNode* childBranch = createBranchChild(*branch_arg, child_idx);
branch_count_++;
// recursively proceed with indexed child branch
return createLeafRecursive(key_arg,
depth_mask_arg >> 1,
childBranch,
return_leaf_arg,
parent_of_leaf_arg);
}
// if leaf node at child_idx does not exist
LeafNode* leaf_node = createLeafChild(*branch_arg, child_idx);
return_leaf_arg = leaf_node;
parent_of_leaf_arg = branch_arg;
this->leaf_count_++;
}
else {
// Node exists already
switch (child_node->getNodeType()) {
case BRANCH_NODE:
// recursively proceed with indexed child branch
return createLeafRecursive(key_arg,
depth_mask_arg >> 1,
static_cast<BranchNode*>(child_node),
return_leaf_arg,
parent_of_leaf_arg);
break;
case LEAF_NODE:
return_leaf_arg = static_cast<LeafNode*>(child_node);
parent_of_leaf_arg = branch_arg;
break;
}
}
return (depth_mask_arg >> 1);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::findLeafRecursive(
const OctreeKey& key_arg,
uindex_t depth_mask_arg,
BranchNode* branch_arg,
LeafContainerT*& result_arg) const
{
// index to branch child
unsigned char child_idx;
// find branch child from key
child_idx = key_arg.getChildIdxWithDepthMask(depth_mask_arg);
OctreeNode* child_node = (*branch_arg)[child_idx];
if (child_node) {
switch (child_node->getNodeType()) {
case BRANCH_NODE:
// we have not reached maximum tree depth
BranchNode* child_branch;
child_branch = static_cast<BranchNode*>(child_node);
findLeafRecursive(key_arg, depth_mask_arg >> 1, child_branch, result_arg);
break;
case LEAF_NODE:
// return existing leaf node
LeafNode* child_leaf;
child_leaf = static_cast<LeafNode*>(child_node);
result_arg = child_leaf->getContainerPtr();
break;
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
bool
OctreeBase<LeafContainerT, BranchContainerT>::deleteLeafRecursive(
const OctreeKey& key_arg, uindex_t depth_mask_arg, BranchNode* branch_arg)
{
// index to branch child
unsigned char child_idx;
// indicates if branch has children, if so, it can't be removed
bool b_has_children;
// find branch child from key
child_idx = key_arg.getChildIdxWithDepthMask(depth_mask_arg);
OctreeNode* child_node = (*branch_arg)[child_idx];
if (child_node) {
switch (child_node->getNodeType()) {
case BRANCH_NODE:
BranchNode* child_branch;
child_branch = static_cast<BranchNode*>(child_node);
// recursively explore the indexed child branch
b_has_children = deleteLeafRecursive(key_arg, depth_mask_arg >> 1, child_branch);
if (!b_has_children) {
// child branch does not own any sub-child nodes anymore -> delete child branch
deleteBranchChild(*branch_arg, child_idx);
branch_count_--;
}
break;
case LEAF_NODE:
// return existing leaf node
// our child is a leaf node -> delete it
deleteBranchChild(*branch_arg, child_idx);
this->leaf_count_--;
break;
}
}
// check if current branch still owns children
b_has_children = false;
for (child_idx = 0; (!b_has_children) && (child_idx < 8); child_idx++) {
b_has_children = branch_arg->hasChild(child_idx);
}
// return false if current branch can be deleted
return (b_has_children);
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
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
{
char node_bit_pattern;
// branch occupancy bit pattern
node_bit_pattern = getBranchBitPattern(*branch_arg);
// write bit pattern to output vector
if (binary_tree_out_arg)
binary_tree_out_arg->push_back(node_bit_pattern);
// iterate over all children
for (unsigned char child_idx = 0; child_idx < 8; child_idx++) {
// if child exist
if (branch_arg->hasChild(child_idx)) {
// add current branch voxel to key
key_arg.pushBranch(child_idx);
OctreeNode* childNode = branch_arg->getChildPtr(child_idx);
switch (childNode->getNodeType()) {
case BRANCH_NODE: {
// recursively proceed with indexed child branch
serializeTreeRecursive(static_cast<const BranchNode*>(childNode),
key_arg,
binary_tree_out_arg,
leaf_container_vector_arg);
break;
}
case LEAF_NODE: {
auto* child_leaf = static_cast<LeafNode*>(childNode);
if (leaf_container_vector_arg)
leaf_container_vector_arg->push_back(child_leaf->getContainerPtr());
// we reached a leaf node -> execute serialization callback
serializeTreeCallback(**child_leaf, key_arg);
break;
}
default:
break;
}
// pop current branch voxel from key
key_arg.popBranch();
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
template <typename LeafContainerT, typename BranchContainerT>
void
OctreeBase<LeafContainerT, BranchContainerT>::deserializeTreeRecursive(
BranchNode* branch_arg,
uindex_t 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)
{
if (binary_tree_input_it_arg != binary_tree_input_it_end_arg) {
// read branch occupancy bit pattern from input vector
char node_bits = (*binary_tree_input_it_arg);
binary_tree_input_it_arg++;
// iterate over all children
for (unsigned char child_idx = 0; child_idx < 8; child_idx++) {
// if occupancy bit for child_idx is set..
if (node_bits & (1 << child_idx)) {
// add current branch voxel to key
key_arg.pushBranch(child_idx);
if (depth_mask_arg > 1) {
// we have not reached maximum tree depth
BranchNode* newBranch = createBranchChild(*branch_arg, child_idx);
branch_count_++;
// recursively proceed with new child branch
deserializeTreeRecursive(newBranch,
depth_mask_arg >> 1,
key_arg,
binary_tree_input_it_arg,
binary_tree_input_it_end_arg,
leaf_container_vector_it_arg,
leaf_container_vector_it_end_arg);
}
else {
// we reached leaf node level
LeafNode* child_leaf = createLeafChild(*branch_arg, child_idx);
if (leaf_container_vector_it_arg &&
(*leaf_container_vector_it_arg != *leaf_container_vector_it_end_arg)) {
LeafContainerT& container = **child_leaf;
LeafContainerT* src_container_ptr = **leaf_container_vector_it_arg;
container = *src_container_ptr;
++*leaf_container_vector_it_arg;
}
leaf_count_++;
// execute deserialization callback
deserializeTreeCallback(**child_leaf, key_arg);
}
// pop current branch voxel from key
key_arg.popBranch();
}
}
}
}
} // namespace octree
} // namespace pcl
#define PCL_INSTANTIATE_OctreeBase(T) \
template class PCL_EXPORTS pcl::octree::OctreeBase<T>;
#endif
pcl::octree::OctreeBase::findLeafRecursive
void findLeafRecursive(const OctreeKey &key_arg, uindex_t depth_mask_arg, BranchNode *branch_arg, LeafContainerT *&result_arg) const
Recursively search for a given leaf node and return a pointer.
Definition octree_base.hpp:353
pcl::octree::OctreeBase< OctreeContainerPointIndices, OctreeContainerEmpty >::serializeTreeCallback
virtual void serializeTreeCallback(OctreeContainerPointIndices &, const OctreeKey &) const
Definition octree_base.h:756
pcl::octree::OctreeBase::setTreeDepth
void setTreeDepth(uindex_t max_depth_arg)
Set the maximum depth of the octree.
Definition octree_base.hpp:87
pcl::octree::OctreeBase::deserializeTreeRecursive
void deserializeTreeRecursive(BranchNode *branch_arg, uindex_t 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.
Definition octree_base.hpp:500
pcl::octree::OctreeBase::serializeLeafs
void serializeLeafs(std::vector< LeafContainerT * > &leaf_container_vector_arg)
Outputs a vector of all LeafContainerT elements that are stored within the octree leaf nodes.
Definition octree_base.hpp:222
pcl::octree::OctreeBase::createLeaf
LeafContainerT * createLeaf(uindex_t idx_x_arg, uindex_t idx_y_arg, uindex_t idx_z_arg)
Create new leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
Definition octree_base.hpp:129
pcl::octree::OctreeBase::leaf_count_
std::size_t leaf_count_
Amount of leaf nodes.
Definition octree_base.h:78
pcl::octree::OctreeBase::root_node_
BranchNode * root_node_
Pointer to root branch node of octree.
Definition octree_base.h:84
pcl::octree::OctreeBase::~OctreeBase
virtual ~OctreeBase()
Empty deconstructor.
Definition octree_base.hpp:54
pcl::octree::OctreeBase::depth_mask_
uindex_t depth_mask_
Depth mask based on octree depth.
Definition octree_base.h:87
pcl::octree::OctreeBase::deleteBranch
void deleteBranch(BranchNode &branch_arg)
Delete branch and all its subchilds from octree.
Definition octree_base.h:627
pcl::octree::OctreeBase::branch_count_
std::size_t branch_count_
Amount of branch nodes.
Definition octree_base.h:81
pcl::octree::OctreeBase::deleteLeafRecursive
bool deleteLeafRecursive(const OctreeKey &key_arg, uindex_t depth_mask_arg, BranchNode *branch_arg)
Recursively search and delete leaf node.
Definition octree_base.hpp:391
pcl::octree::OctreeBase::dynamic_depth_enabled_
bool dynamic_depth_enabled_
Enable dynamic_depth.
Definition octree_base.h:93
pcl::octree::OctreeBase::createLeafRecursive
uindex_t createLeafRecursive(const OctreeKey &key_arg, uindex_t depth_mask_arg, BranchNode *branch_arg, LeafNode *&return_leaf_arg, BranchNode *&parent_of_leaf_arg)
Create a leaf node at octree key.
Definition octree_base.hpp:293
pcl::octree::OctreeBase::deserializeTree
void deserializeTree(std::vector< char > &binary_tree_input_arg)
Deserialize a binary octree description vector and create a corresponding octree structure.
Definition octree_base.hpp:238
pcl::octree::OctreeBase< OctreeContainerPointIndices, OctreeContainerEmpty >::createBranchChild
BranchNode * createBranchChild(BranchNode &branch_arg, unsigned char child_idx_arg)
Definition octree_base.h:640
pcl::octree::OctreeBase::BranchNode
OctreeBranchNode< BranchContainerT > BranchNode
Definition octree_base.h:66
pcl::octree::OctreeBase::deleteTree
void deleteTree()
Delete the octree structure and its leaf nodes.
Definition octree_base.hpp:171
pcl::octree::OctreeBase::serializeTree
void serializeTree(std::vector< char > &binary_tree_out_arg) const
Serialize octree into a binary output vector describing its branch node structure.
Definition octree_base.hpp:185
pcl::octree::OctreeBase::octree_depth_
uindex_t octree_depth_
Octree depth.
Definition octree_base.h:90
pcl::octree::OctreeBase::existLeaf
bool existLeaf(uindex_t idx_x_arg, uindex_t idx_y_arg, uindex_t idx_z_arg) const
idx_x_arg for the existence of leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
Definition octree_base.hpp:143
pcl::octree::OctreeBase::serializeTreeRecursive
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 no...
Definition octree_base.hpp:443
pcl::octree::OctreeBase::findLeaf
LeafContainerT * findLeaf(uindex_t idx_x_arg, uindex_t idx_y_arg, uindex_t idx_z_arg) const
Find leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
Definition octree_base.hpp:115
pcl::octree::OctreeBase< OctreeContainerPointIndices, OctreeContainerEmpty >::getBranchBitPattern
char getBranchBitPattern(const BranchNode &branch_arg) const
Definition octree_base.h:577
pcl::octree::OctreeBase::removeLeaf
void removeLeaf(uindex_t idx_x_arg, uindex_t idx_y_arg, uindex_t idx_z_arg)
Remove leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
Definition octree_base.hpp:157
pcl::octree::OctreeBase::setMaxVoxelIndex
void setMaxVoxelIndex(uindex_t max_voxel_index_arg)
Set the maximum amount of voxels per dimension.
Definition octree_base.hpp:64
pcl::octree::OctreeBase::max_key_
OctreeKey max_key_
key range
Definition octree_base.h:96
pcl::octree::OctreeBase::createLeafChild
LeafNode * createLeafChild(BranchNode &branch_arg, unsigned char child_idx_arg)
Create and add a new leaf child to a branch class.
Definition octree_base.h:654
pcl::octree::OctreeBase::OctreeBase
OctreeBase()
Empty constructor.
Definition octree_base.hpp:48
pcl::octree::OctreeBase< OctreeContainerPointIndices, OctreeContainerEmpty >::deleteBranchChild
void deleteBranchChild(BranchNode &branch_arg, unsigned char child_idx_arg)
Definition octree_base.h:596
pcl::octree::OctreeBase::LeafNode
OctreeLeafNode< LeafContainerT > LeafNode
Definition octree_base.h:67
pcl::octree::OctreeBase::deserializeTreeCallback
virtual void deserializeTreeCallback(LeafContainerT &, const OctreeKey &)
Callback executed for every leaf node during deserialization.
Definition octree_base.h:762
pcl::octree::OctreeBranchNode::hasChild
bool hasChild(unsigned char child_idx_arg) const
Check if branch is pointing to a particular child node.
Definition octree_nodes.h:256
pcl::octree::OctreeBranchNode::getChildPtr
OctreeNode * getChildPtr(unsigned char child_idx_arg) const
Get pointer to child.
Definition octree_nodes.h:234
pcl::octree::OctreeKey
Octree key class
Definition octree_key.h:54
pcl::octree::OctreeKey::popBranch
void popBranch()
pop child node from octree key
Definition octree_key.h:122
pcl::octree::OctreeKey::maxDepth
static const unsigned char maxDepth
Definition octree_key.h:142
pcl::octree::OctreeKey::pushBranch
void pushBranch(unsigned char childIndex)
push a child node to the octree key
Definition octree_key.h:112
pcl::octree::OctreeKey::getChildIdxWithDepthMask
unsigned char getChildIdxWithDepthMask(uindex_t depthMask) const
get child node index using depthMask
Definition octree_key.h:134
pcl::octree::OctreeLeafNode::getContainerPtr
const ContainerT * getContainerPtr() const
Get const pointer to container.
Definition octree_nodes.h:153
pcl::octree::OctreeNode
Abstract octree node class
Definition octree_nodes.h:59
pcl::octree::OctreeNode::getNodeType
virtual node_type_t getNodeType() const =0
Pure virtual method for retrieving the type of octree node (branch or leaf).
pcl::octree
Definition color_coding.h:47
pcl::octree::BRANCH_NODE
@ BRANCH_NODE
Definition octree_nodes.h:52
pcl::octree::LEAF_NODE
@ LEAF_NODE
Definition octree_nodes.h:52
pcl
Definition convolution.h:46
pcl::uindex_t
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
Definition types.h:120