40 #ifndef PCL_OCTREE_VOXELCENTROID_HPP
41 #define PCL_OCTREE_VOXELCENTROID_HPP
50 #include <pcl/octree/impl/octree_pointcloud.hpp>
53 template <
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
59 LeafContainerT* leaf = NULL;
62 genOctreeKeyforPoint(point_arg, key);
64 leaf = this->findLeaf(key);
66 leaf->getCentroid(voxel_centroid_arg);
68 return (leaf != NULL);
72 template <
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
77 AlignedPointTVector& voxel_centroid_list_arg)
const
82 voxel_centroid_list_arg.clear();
83 voxel_centroid_list_arg.reserve(this->leaf_count_);
85 getVoxelCentroidsRecursive(this->root_node_, new_key, voxel_centroid_list_arg);
88 return (voxel_centroid_list_arg.size());
92 template <
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
99 AlignedPointTVector& voxel_centroid_list_arg)
const
102 for (
unsigned char child_idx = 0; child_idx < 8; child_idx++) {
104 if (branch_arg->
hasChild(child_idx)) {
113 getVoxelCentroidsRecursive(static_cast<const BranchNode*>(child_node),
115 voxel_centroid_list_arg);
121 LeafNode* container = static_cast<LeafNode*>(child_node);
125 voxel_centroid_list_arg.push_back(new_centroid);
138 #define PCL_INSTANTIATE_OctreePointCloudVoxelCentroid(T) \
139 template class PCL_EXPORTS pcl::octree::OctreePointCloudVoxelCentroid<T>;