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>;
void getVoxelCentroidsRecursive(const BranchNode *branch_arg, OctreeKey &key_arg, typename OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::AlignedPointTVector &voxel_centroid_list_arg) const
Recursively explore the octree and output a PointT vector of centroids for all occupied voxels...
size_t getVoxelCentroids(typename OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::AlignedPointTVector &voxel_centroid_list_arg) const
Get PointT vector of centroids for all occupied voxels.
virtual node_type_t getNodeType() const =0
Pure virtual method for receiving the type of octree node (branch or leaf)
OctreeNode * getChildPtr(unsigned char child_idx_arg) const
Get pointer to child.
bool getVoxelCentroidAtPoint(const PointT &point_arg, PointT &voxel_centroid_arg) const
Get centroid for a single voxel addressed by a PointT point.
void popBranch()
pop child node from octree key
bool hasChild(unsigned char child_idx_arg) const
Check if branch is pointing to a particular child node.
Abstract octree leaf class
A point structure representing Euclidean xyz coordinates, and the RGB color.
Abstract octree branch class
void pushBranch(unsigned char childIndex)
push a child node to the octree key
const ContainerT & getContainer() const
Get const reference to container.
Abstract octree node class