39 #ifndef PCL_OCTREE_TREE_BASE_H
40 #define PCL_OCTREE_TREE_BASE_H
45 #include "octree_nodes.h"
46 #include "octree_container.h"
47 #include "octree_key.h"
48 #include "octree_iterator.h"
61 template<
typename LeafContainerT = int,
62 typename BranchContainerT = OctreeContainerEmpty >
168 createLeaf (
unsigned int idx_x_arg,
unsigned int idx_y_arg,
unsigned int idx_z_arg);
178 findLeaf (
unsigned int idx_x_arg,
unsigned int idx_y_arg,
unsigned int idx_z_arg);
187 existLeaf (
unsigned int idx_x_arg,
unsigned int idx_y_arg,
unsigned int idx_z_arg)
const ;
195 removeLeaf (
unsigned int idx_x_arg,
unsigned int idx_y_arg,
unsigned int idx_z_arg);
231 serializeTree (std::vector<char>& binary_tree_out_arg, std::vector<LeafContainerT*>& leaf_container_vector_arg);
237 serializeLeafs (std::vector<LeafContainerT*>& leaf_container_vector_arg);
250 deserializeTree (std::vector<char>& binary_tree_input_arg, std::vector<LeafContainerT*>& leaf_container_vector_arg);
283 LeafContainerT* result = 0;
326 unsigned char child_idx_arg)
const
329 return (branch_arg.
getChildPtr(child_idx_arg) != 0);
339 unsigned char child_idx_arg)
const
350 unsigned char child_idx_arg,
353 branch_arg[child_idx_arg] = new_child_arg;
368 for (i = 0; i < 8; i++) {
370 node_bits |=
static_cast<char> ((!!child) << i);
383 if (branch_arg.
hasChild(child_idx_arg))
385 OctreeNode* branch_child = branch_arg[child_idx_arg];
392 deleteBranch (*static_cast<BranchNode*> (branch_child));
409 branch_arg[child_idx_arg] = 0;
422 for (i = 0; i < 8; i++)
432 unsigned char child_idx_arg)
435 branch_arg[child_idx_arg] =
static_cast<OctreeNode*
> (new_branch_child);
437 return new_branch_child;
449 branch_arg[child_idx_arg] =
static_cast<OctreeNode*
> (new_leaf_child);
451 return new_leaf_child;
468 unsigned int depth_mask_arg,
482 unsigned int depth_mask_arg,
484 LeafContainerT*& result_arg)
const;
494 unsigned int depth_mask_arg,
506 std::vector<char>* binary_tree_out_arg,
507 typename std::vector<LeafContainerT*>* leaf_container_vector_arg)
const;
520 typename std::vector<char>::const_iterator& binary_tree_input_it_arg,
521 typename std::vector<char>::const_iterator& binary_tree_input_it_end_arg,
522 typename std::vector<LeafContainerT*>::const_iterator* leaf_container_vector_it_arg,
523 typename std::vector<LeafContainerT*>::const_iterator* leaf_container_vector_it_end_arg);
557 return log( n_arg ) / log( 2.0 );