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>
bool
55 const PointT& point_arg,
PointT& voxel_centroid_arg)
const
58 LeafContainerT* leaf = NULL;
61 genOctreeKeyforPoint (point_arg, key);
63 leaf = this->findLeaf (key);
65 leaf->getCentroid (voxel_centroid_arg);
67 return (leaf != NULL);
71 template<
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT> std::size_t
78 voxel_centroid_list_arg.clear ();
79 voxel_centroid_list_arg.reserve (this->leaf_count_);
81 getVoxelCentroidsRecursive (this->root_node_, new_key, voxel_centroid_list_arg );
84 return (voxel_centroid_list_arg.size ());
88 template<
typename Po
intT,
typename LeafContainerT,
typename BranchContainerT>
void
94 for (
unsigned char 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);
116 LeafNode* container = static_cast<LeafNode*> (child_node);
120 voxel_centroid_list_arg.push_back (new_centroid);
134 #define PCL_INSTANTIATE_OctreePointCloudVoxelCentroid(T) template class PCL_EXPORTS pcl::octree::OctreePointCloudVoxelCentroid<T>;