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>
97 point_sum_ += new_point;
110 centroid_arg = point_sum_;
111 centroid_arg /=
static_cast<float> (point_counter_);
115 centroid_arg *= 0.0f;
130 unsigned int point_counter_;
149 typedef boost::shared_ptr<OctreePointCloudVoxelCentroid<PointT, LeafContainerT> >
Ptr;
150 typedef boost::shared_ptr<const OctreePointCloudVoxelCentroid<PointT, LeafContainerT> >
ConstPtr;
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;
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> Octree container class that can serve as a base to construct own leaf node container classes...
virtual void addPointIdx(const int pointIdx_arg)
Add DataT object to leaf node at octree key.
OctreePointCloudVoxelCentroidContainer()
Class initialization.
Octree pointcloud voxel centroid leaf node class
OctreeT::LeafNode LeafNode
virtual bool operator==(const OctreeContainerBase &) const
Equal comparison operator - set to false.
boost::shared_ptr< OctreePointCloudVoxelCentroid< PointT, LeafContainerT > > Ptr
OctreeT::BranchNode BranchNode
virtual void reset()
Reset leaf container.
virtual ~OctreePointCloudVoxelCentroid()
Empty class deconstructor.
void getCentroid(PointT ¢roid_arg) const
Calculate centroid of voxel.
virtual ~OctreePointCloudVoxelCentroidContainer()
Empty class deconstructor.
boost::shared_ptr< const OctreePointCloudVoxelCentroid< PointT, LeafContainerT > > ConstPtr
OctreePointCloud< PointT, LeafContainerT, BranchContainerT > OctreeT
void addPoint(const PointT &new_point)
Add new point to voxel.
Abstract octree leaf class
virtual OctreePointCloudVoxelCentroidContainer * deepCopy() const
deep copy function
Octree pointcloud voxel centroid class
bool getVoxelCentroidAtPoint(const int &point_idx_arg, PointT &voxel_centroid_arg) const
Get centroid for a single voxel addressed by a PointT point from input cloud.
A point structure representing Euclidean xyz coordinates, and the RGB color.
Abstract octree branch class
OctreePointCloudVoxelCentroid(const double resolution_arg)
OctreePointCloudVoxelCentroids class constructor.
Octree container class that does not store any information.