42 #include <pcl/octree/octree_pointcloud.h>
51 template <
typename Po
intT>
86 point_sum_ += new_point;
98 centroid_arg = point_sum_;
99 centroid_arg /=
static_cast<float>(point_counter_);
102 centroid_arg *= 0.0f;
130 template <
typename PointT,
131 typename LeafContainerT = OctreePointCloudVoxelCentroidContainer<PointT>,
132 typename BranchContainerT = OctreeContainerEmpty>
136 using Ptr = shared_ptr<OctreePointCloudVoxelCentroid<PointT, LeafContainerT>>;
138 shared_ptr<const OctreePointCloudVoxelCentroid<PointT, LeafContainerT>>;
163 assert(pointIdx_arg < this->input_->size());
165 const PointT& point = (*this->input_)[pointIdx_arg];
168 this->adoptBoundingBoxToPoint(point);
171 this->genOctreeKeyforPoint(point, key);
174 LeafContainerT* container = this->createLeaf(key);
175 container->addPoint(point);
184 getVoxelCentroidAtPoint(
const PointT& point_arg,
PointT& voxel_centroid_arg)
const;
194 PointT& voxel_centroid_arg)
const
197 return (this->getVoxelCentroidAtPoint((*this->input_)[point_idx_arg],
198 voxel_centroid_arg));
209 AlignedPointTVector& voxel_centroid_list_arg)
const;
219 getVoxelCentroidsRecursive(
220 const BranchNode* branch_arg,
223 AlignedPointTVector& voxel_centroid_list_arg)
const;
230 #include <pcl/octree/impl/octree_pointcloud_voxelcentroid.hpp>
Abstract octree branch class
Octree container class that can serve as a base to construct own leaf node container classes.
Abstract octree leaf class
Octree pointcloud voxel centroid leaf node class
OctreePointCloudVoxelCentroidContainer()
Class initialization.
void addPoint(const PointT &new_point)
Add new point to voxel.
void getCentroid(PointT ¢roid_arg) const
Calculate centroid of voxel.
~OctreePointCloudVoxelCentroidContainer() override=default
Empty class deconstructor.
virtual OctreePointCloudVoxelCentroidContainer * deepCopy() const
deep copy function
bool operator==(const OctreeContainerBase &) const override
Equal comparison operator - set to false.
void reset() override
Reset leaf container.
Octree pointcloud voxel centroid class
OctreePointCloudVoxelCentroid(const double resolution_arg)
OctreePointCloudVoxelCentroids class constructor.
shared_ptr< const OctreePointCloudVoxelCentroid< PointT, LeafContainerT > > ConstPtr
void addPointIdx(const uindex_t pointIdx_arg) override
Add DataT object to leaf node at octree key.
shared_ptr< OctreePointCloudVoxelCentroid< PointT, LeafContainerT > > Ptr
bool getVoxelCentroidAtPoint(const index_t &point_idx_arg, PointT &voxel_centroid_arg) const
Get centroid for a single voxel addressed by a PointT point from input cloud.
~OctreePointCloudVoxelCentroid() override=default
Empty class deconstructor.
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.