42#include <pcl/octree/octree_pointcloud.h>
51template <
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;
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());
174 LeafContainerT* container = this->
createLeaf(key);
175 container->addPoint(point);
194 PointT& voxel_centroid_arg)
const
198 voxel_centroid_arg));
230#include <pcl/octree/impl/octree_pointcloud_voxelcentroid.hpp>
OctreePointCloudVoxelCentroidContainer< PointT > * createLeaf(uindex_t idx_x_arg, uindex_t idx_y_arg, uindex_t idx_z_arg)
Create new leaf node at (idx_x_arg, idx_y_arg, idx_z_arg).
Octree container class that can serve as a base to construct own leaf node container classes.
void adoptBoundingBoxToPoint(const PointT &point_idx_arg)
Grow the bounding box/octree until point fits.
PointCloudConstPtr input_
Pointer to input point cloud dataset.
typename OctreeT::LeafNode LeafNode
std::vector< PointT, Eigen::aligned_allocator< PointT > > AlignedPointTVector
typename OctreeT::BranchNode BranchNode
void genOctreeKeyforPoint(const PointT &point_arg, OctreeKey &key_arg) const
Generate octree key for voxel at a given point.
Octree pointcloud voxel centroid leaf node class
virtual OctreePointCloudVoxelCentroidContainer * deepCopy() const
deep copy function
OctreePointCloudVoxelCentroidContainer()
Class initialization.
void addPoint(const PointT &new_point)
Add new point to voxel.
void getCentroid(PointT ¢roid_arg) const
Calculate centroid of voxel.
bool operator==(const OctreeContainerBase &) const override
Equal comparison operator - set to false.
~OctreePointCloudVoxelCentroidContainer()
Empty class deconstructor.
void reset() override
Reset leaf container.
Octree pointcloud voxel centroid class
bool getVoxelCentroidAtPoint(const PointT &point_arg, PointT &voxel_centroid_arg) const
Get centroid for a single voxel addressed by a PointT point.
OctreePointCloudVoxelCentroid(const double resolution_arg)
OctreePointCloudVoxelCentroids class constructor.
shared_ptr< const OctreePointCloudVoxelCentroid< PointT, LeafContainerT > > ConstPtr
void getVoxelCentroidsRecursive(const BranchNode *branch_arg, OctreeKey &key_arg, typename OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::AlignedPointTVector &voxel_centroid_list_arg) const
Recursively explore the octree and output a PointT vector of centroids for all occupied voxels.
typename OctreeT::LeafNode LeafNode
typename OctreeT::BranchNode BranchNode
~OctreePointCloudVoxelCentroid()
Empty class deconstructor.
uindex_t getVoxelCentroids(typename OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::AlignedPointTVector &voxel_centroid_list_arg) const
Get PointT vector of centroids for all occupied voxels.
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.
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.