39#ifndef PCL_OCTREE_BASE_HPP
40#define PCL_OCTREE_BASE_HPP
47template <
typename LeafContainerT,
typename BranchContainerT>
54, dynamic_depth_enabled_(
false)
58template <
typename LeafContainerT,
typename BranchContainerT>
67template <
typename LeafContainerT,
typename BranchContainerT>
86template <
typename LeafContainerT,
typename BranchContainerT>
99 max_key_.x = max_key_.y = max_key_.z = (1 <<
depth_arg) - 1;
103template <
typename LeafContainerT,
typename BranchContainerT>
113 return (findLeaf(key));
117template <
typename LeafContainerT,
typename BranchContainerT>
127 return (createLeaf(key));
131template <
typename LeafContainerT,
typename BranchContainerT>
141 return (existLeaf(key));
145template <
typename LeafContainerT,
typename BranchContainerT>
155 deleteLeafRecursive(key, depth_mask_, root_node_);
159template <
typename LeafContainerT,
typename BranchContainerT>
166 deleteBranch(*root_node_);
173template <
typename LeafContainerT,
typename BranchContainerT>
189template <
typename LeafContainerT,
typename BranchContainerT>
205 serializeTreeRecursive(
210template <
typename LeafContainerT,
typename BranchContainerT>
226template <
typename LeafContainerT,
typename BranchContainerT>
240 deserializeTreeRecursive(root_node_,
250template <
typename LeafContainerT,
typename BranchContainerT>
259 typename std::vector<LeafContainerT*>::const_iterator
leaf_vector_it =
273 deserializeTreeRecursive(root_node_,
283template <
typename LeafContainerT,
typename BranchContainerT>
308 return createLeafRecursive(
key_arg,
325 return createLeafRecursive(
key_arg,
343template <
typename LeafContainerT,
typename BranchContainerT>
381template <
typename LeafContainerT,
typename BranchContainerT>
433template <
typename LeafContainerT,
typename BranchContainerT>
490template <
typename LeafContainerT,
typename BranchContainerT>
499 typename std::vector<LeafContainerT*>::const_iterator*
505 char node_bits = (*binary_tree_input_it_arg);
558#define PCL_INSTANTIATE_OctreeBase(T) \
559 template class PCL_EXPORTS pcl::octree::OctreeBase<T>;
Iterator class for point clouds with or without given indices.
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.
void setTreeDepth(uindex_t max_depth_arg)
Set the maximum depth of the octree.
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.
void serializeLeafs(std::vector< LeafContainerT * > &leaf_container_vector_arg)
Outputs a vector of all LeafContainerT elements that are stored within the octree leaf nodes.
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).
virtual ~OctreeBase()
Empty deconstructor.
LeafContainerT * findLeaf(uindex_t idx_x_arg, uindex_t idx_y_arg, uindex_t idx_z_arg)
Find leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
bool deleteLeafRecursive(const OctreeKey &key_arg, uindex_t depth_mask_arg, BranchNode *branch_arg)
Recursively search and delete leaf node.
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.
void deserializeTree(std::vector< char > &binary_tree_input_arg)
Deserialize a binary octree description vector and create a corresponding octree structure.
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.
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).
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...
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).
void setMaxVoxelIndex(uindex_t max_voxel_index_arg)
Set the maximum amount of voxels per dimension.
OctreeBase()
Empty constructor.
Abstract octree branch class
static const unsigned char maxDepth
Abstract octree leaf class
Abstract octree node class
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.