40 #ifndef PCL_OCTREE_VOXELCENTROID_H 41 #define PCL_OCTREE_VOXELCENTROID_H 43 #include <pcl/octree/octree_pointcloud.h> 53 template<
typename Po
intT>
93 point_sum_ += new_point;
106 centroid_arg = point_sum_;
107 centroid_arg /=
static_cast<float> (point_counter_);
111 centroid_arg *= 0.0f;
126 unsigned int point_counter_;
145 typedef boost::shared_ptr<OctreePointCloudVoxelCentroid<PointT, LeafContainerT> >
Ptr;
146 typedef boost::shared_ptr<const OctreePointCloudVoxelCentroid<PointT, LeafContainerT> >
ConstPtr;
174 assert (pointIdx_arg < static_cast<int> (this->input_->points.size ()));
176 const PointT& point = this->input_->points[pointIdx_arg];
179 this->adoptBoundingBoxToPoint (point);
182 this->genOctreeKeyforPoint (point, key);
185 LeafContainerT* container = this->createLeaf(key);
186 container->addPoint (point);
196 getVoxelCentroidAtPoint (
const PointT& point_arg,
PointT& voxel_centroid_arg)
const;
207 return (this->getVoxelCentroidAtPoint (this->input_->points[point_idx_arg], voxel_centroid_arg));
223 getVoxelCentroidsRecursive (
const BranchNode* branch_arg,
232 #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.
virtual bool operator==(const OctreeContainerBase &) const
Equal comparison operator - set to false.
OctreePointCloudVoxelCentroidContainer()
Class initialization.
void getCentroid(PointT ¢roid_arg) const
Calculate centroid of voxel.
Octree pointcloud voxel centroid leaf node class
OctreeT::LeafNode LeafNode
boost::shared_ptr< OctreePointCloudVoxelCentroid< PointT, LeafContainerT > > Ptr
OctreeT::BranchNode BranchNode
virtual void reset()
Reset leaf container.
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.
virtual ~OctreePointCloudVoxelCentroid()
Empty class deconstructor.
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
Octree pointcloud voxel centroid class
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.
virtual OctreePointCloudVoxelCentroidContainer * deepCopy() const
deep copy function