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;
175 addPointIdx (
const int pointIdx_arg)
179 assert (pointIdx_arg < static_cast<int> (this->input_->points.size ()));
181 const PointT& point = this->input_->points[pointIdx_arg];
184 this->adoptBoundingBoxToPoint (point);
187 this->genOctreeKeyforPoint (point, key);
190 LeafContainerT* container = this->createLeaf(key);
191 container->addPoint (point);
201 getVoxelCentroidAtPoint (
const PointT& point_arg,
PointT& voxel_centroid_arg)
const;
209 getVoxelCentroidAtPoint (
const int& point_idx_arg,
PointT& voxel_centroid_arg)
const
212 return (this->getVoxelCentroidAtPoint (this->input_->points[point_idx_arg], voxel_centroid_arg));
228 getVoxelCentroidsRecursive (
const BranchNode* branch_arg,
236 #include <pcl/octree/impl/octree_pointcloud_voxelcentroid.hpp>