40 #ifndef PCL_OCTREE_VOXELCENTROID_HPP
41 #define PCL_OCTREE_VOXELCENTROID_HPP
43 #include <pcl/octree/octree_pointcloud_voxelcentroid.h>
46 template<
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
bool
48 const PointT& point_arg,
PointT& voxel_centroid_arg)
const
54 genOctreeKeyforPoint (point_arg, key);
56 leaf = this->findLeaf (key);
60 LeafContainerT* container = leaf;
61 container->getCentroid (voxel_centroid_arg);
68 template<
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
size_t
75 voxel_centroid_list_arg.clear ();
76 voxel_centroid_list_arg.reserve (this->leaf_count_);
78 getVoxelCentroidsRecursive (this->root_node_, new_key, voxel_centroid_list_arg );
81 return (voxel_centroid_list_arg.size ());
85 template<
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
void
91 unsigned char child_idx;
94 for (child_idx = 0; child_idx < 8; child_idx++)
97 if (branch_arg->
hasChild (child_idx))
109 getVoxelCentroidsRecursive (static_cast<const BranchNode*> (child_node), key_arg, voxel_centroid_list_arg);
120 voxel_centroid_list_arg.push_back (new_centroid);
134 #define PCL_INSTANTIATE_OctreePointCloudVoxelCentroid(T) template class PCL_EXPORTS pcl::octree::OctreePointCloudVoxelCentroid<T>;