40 #ifndef PCL_OCTREE_VOXELCENTROID_H
41 #define PCL_OCTREE_VOXELCENTROID_H
43 #include "octree_pointcloud.h"
45 #include <pcl/common/point_operators.h>
46 #include <pcl/point_types.h>
47 #include <pcl/register_point_struct.h>
57 template<
typename Po
intT>
93 using namespace pcl::common;
97 point_sum_ += new_point;
106 using namespace pcl::common;
110 centroid_arg = point_sum_;
111 centroid_arg /=
static_cast<float> (point_counter_);
115 centroid_arg *= 0.0f;
123 using namespace pcl::common;
130 unsigned int point_counter_;
144 typename LeafContainerT = OctreePointCloudVoxelCentroidContainer<PointT> ,
145 typename BranchContainerT = OctreeContainerEmpty >
149 typedef boost::shared_ptr<OctreePointCloudVoxelCentroid<PointT, LeafContainerT> >
Ptr;
150 typedef boost::shared_ptr<const OctreePointCloudVoxelCentroid<PointT, LeafContainerT> >
ConstPtr;
174 addPointIdx (
const int pointIdx_arg)
178 assert (pointIdx_arg < static_cast<int> (this->input_->points.size ()));
180 const PointT& point = this->input_->points[pointIdx_arg];
183 this->adoptBoundingBoxToPoint (point);
186 this->genOctreeKeyforPoint (point, key);
189 LeafContainerT* container = this->createLeaf(key);
190 container->addPoint (point);
200 getVoxelCentroidAtPoint (
const PointT& point_arg,
PointT& voxel_centroid_arg)
const;
208 getVoxelCentroidAtPoint (
const int& point_idx_arg,
PointT& voxel_centroid_arg)
const
211 return (this->getVoxelCentroidAtPoint (this->input_->points[point_idx_arg], voxel_centroid_arg));
227 getVoxelCentroidsRecursive (
const BranchNode* branch_arg,
235 #include <pcl/octree/impl/octree_pointcloud_voxelcentroid.hpp>