Point Cloud Library (PCL)
1.11.1-dev
|
40 #include <pcl/filters/filter.h>
45 template <
typename Po
intT>
48 using Pod =
typename traits::POD<PointT>::type;
52 p2_ (reinterpret_cast<
Pod&>(p2)),
58 using T =
typename pcl::traits::datatype<PointT, Key>::type;
59 std::uint8_t* data_ptr =
reinterpret_cast<std::uint8_t*
>(&p2_) + pcl::traits::offset<PointT, Key>::value;
60 *
reinterpret_cast<T*
>(data_ptr) =
static_cast<T
> (p1_[f_idx_++]);
64 const Eigen::VectorXf &p1_;
70 template <
typename Po
intT>
73 using Pod =
typename traits::POD<PointT>::type;
76 : p1_ (reinterpret_cast<const
Pod&>(p1)), p2_ (p2), f_idx_ (0) { }
81 using T =
typename pcl::traits::datatype<PointT, Key>::type;
82 const std::uint8_t* data_ptr =
reinterpret_cast<const std::uint8_t*
>(&p1_) + pcl::traits::offset<PointT, Key>::value;
83 p2_[f_idx_++] =
static_cast<float> (*
reinterpret_cast<const T*
>(data_ptr));
97 template <
typename Po
intT>
112 he () : ix (), iy (), iz (), count (0) {}
115 Eigen::VectorXf centroid;
120 using Ptr = shared_ptr<ApproximateVoxelGrid<PointT> >;
121 using ConstPtr = shared_ptr<const ApproximateVoxelGrid<PointT> >;
147 for (std::size_t i = 0; i <
histsize_; i++)
171 for (std::size_t i = 0; i <
histsize_; i++)
198 inline Eigen::Vector3f
229 using FieldList =
typename pcl::traits::fieldList<PointT>::type;
240 flush (
PointCloud &output, std::size_t op, he *hhe,
int rgba_index,
int centroid_size);
244 #ifdef PCL_NO_PRECOMPILE
245 #include <pcl/filters/impl/approximate_voxel_grid.hpp>
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
void setDownsampleAllData(bool downsample)
Set to true if all fields need to be downsampled, or false if just XYZ.
typename PointCloud::ConstPtr PointCloudConstPtr
typename PointCloud::Ptr PointCloudPtr
Eigen::Vector3f getLeafSize() const
Get the voxel grid leaf size.
typename pcl::traits::fieldList< PointT >::type FieldList
bool downsample_all_data_
Set to true if all fields need to be downsampled, or false if just XYZ.
struct he * history_
history buffer
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< const ApproximateVoxelGrid< PointT > > ConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
xNdCopyEigenPointFunctor(const Eigen::VectorXf &p1, PointT &p2)
typename traits::POD< PointT >::type Pod
ApproximateVoxelGrid & operator=(const ApproximateVoxelGrid &src)
Copy operator.
ApproximateVoxelGrid(const ApproximateVoxelGrid &src)
Copy constructor.
~ApproximateVoxelGrid()
Destructor.
xNdCopyPointEigenFunctor(const PointT &p1, Eigen::VectorXf &p2)
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
std::size_t histsize_
history buffer size, power of 2
shared_ptr< ApproximateVoxelGrid< PointT > > Ptr
ApproximateVoxelGrid()
Empty constructor.
Filter represents the base filter class.
void setLeafSize(float lx, float ly, float lz)
Set the voxel grid leaf size.
std::string filter_name_
The filter name.
shared_ptr< PointCloud< PointT > > Ptr
bool getDownsampleAllData() const
Get the state of the internal downsampling parameter (true if all fields need to be downsampled,...
Eigen::Vector3f leaf_size_
The size of a leaf.
void setLeafSize(const Eigen::Vector3f &leaf_size)
Set the voxel grid leaf size.
shared_ptr< const PointCloud< PointT > > ConstPtr
typename traits::POD< PointT >::type Pod
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.
Eigen::Array3f inverse_leaf_size_
Compute 1/leaf_size_ to avoid division later.
void applyFilter(PointCloud &output) override
Downsample a Point Cloud using a voxelized grid approach.
ApproximateVoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the...