40 #include <pcl/filters/boost.h>
41 #include <pcl/filters/filter.h>
46 template <
typename Po
intT>
53 p2_ (reinterpret_cast<
Pod&>(p2)),
61 *
reinterpret_cast<T*
>(data_ptr) = static_cast<T> (p1_[f_idx_++]);
65 const Eigen::VectorXf &p1_;
71 template <
typename Po
intT>
77 : p1_ (reinterpret_cast<const
Pod&>(p1)), p2_ (p2), f_idx_ (0) { }
84 p2_[f_idx_++] =
static_cast<float> (*
reinterpret_cast<const T*
>(data_ptr));
98 template <
typename Po
intT>
113 he () : ix (), iy (), iz (), count (0) {}
116 Eigen::VectorXf centroid;
121 using Ptr = shared_ptr<ApproximateVoxelGrid<PointT> >;
122 using ConstPtr = shared_ptr<const ApproximateVoxelGrid<PointT> >;
148 for (std::size_t i = 0; i <
histsize_; i++)
172 for (std::size_t i = 0; i <
histsize_; i++)
199 inline Eigen::Vector3f
241 flush (
PointCloud &output, std::size_t op, he *hhe,
int rgba_index,
int centroid_size);
245 #ifdef PCL_NO_PRECOMPILE
246 #include <pcl/filters/impl/approximate_voxel_grid.hpp>
~ApproximateVoxelGrid()
Destructor.
shared_ptr< const ApproximateVoxelGrid< PointT > > ConstPtr
ApproximateVoxelGrid & operator=(const ApproximateVoxelGrid &src)
Copy operator.
bool getDownsampleAllData() const
Get the state of the internal downsampling parameter (true if all fields need to be downsampled...
typename traits::POD< PointT >::type Pod
xNdCopyEigenPointFunctor(const Eigen::VectorXf &p1, PointT &p2)
void flush(PointCloud &output, std::size_t op, he *hhe, int rgba_index, int centroid_size)
Write a single point from the hash to the output cloud.
ApproximateVoxelGrid()
Empty constructor.
shared_ptr< ApproximateVoxelGrid< PointT > > Ptr
ApproximateVoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the...
std::size_t histsize_
history buffer size, power of 2
shared_ptr< PointCloud< PointT > > Ptr
Filter represents the base filter class.
typename pcl::traits::fieldList< PointT >::type FieldList
Eigen::Array3f inverse_leaf_size_
Compute 1/leaf_size_ to avoid division later.
typename PointCloud::Ptr PointCloudPtr
void setLeafSize(float lx, float ly, float lz)
Set the voxel grid leaf size.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void applyFilter(PointCloud &output) override
Downsample a Point Cloud using a voxelized grid approach.
xNdCopyPointEigenFunctor(const PointT &p1, Eigen::VectorXf &p2)
Eigen::Vector3f leaf_size_
The size of a leaf.
shared_ptr< const PointCloud< PointT > > ConstPtr
void setDownsampleAllData(bool downsample)
Set to true if all fields need to be downsampled, or false if just XYZ.
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
bool downsample_all_data_
Set to true if all fields need to be downsampled, or false if just XYZ.
Eigen::Vector3f getLeafSize() const
Get the voxel grid leaf size.
struct he * history_
history buffer
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
std::string filter_name_
The filter name.
A point structure representing Euclidean xyz coordinates, and the RGB color.
void setLeafSize(const Eigen::Vector3f &leaf_size)
Set the voxel grid leaf size.
ApproximateVoxelGrid(const ApproximateVoxelGrid &src)
Copy constructor.
typename PointCloud::ConstPtr PointCloudConstPtr
typename traits::POD< PointT >::type Pod