38 #ifndef PCL_FILTERS_APPROXIMATE_VOXEL_GRID_MAP_H_
39 #define PCL_FILTERS_APPROXIMATE_VOXEL_GRID_MAP_H_
41 #include <pcl/filters/boost.h>
42 #include <pcl/filters/filter.h>
47 template <
typename Po
intT>
54 p2_ (reinterpret_cast<
Pod&>(p2)),
62 *
reinterpret_cast<T*
>(data_ptr) = static_cast<T> (p1_[f_idx_++]);
66 const Eigen::VectorXf &p1_;
72 template <
typename Po
intT>
78 : p1_ (reinterpret_cast<const
Pod&>(p1)), p2_ (p2), f_idx_ (0) { }
85 p2_[f_idx_++] =
static_cast<float> (*
reinterpret_cast<const T*
>(data_ptr));
99 template <
typename Po
intT>
114 he () : ix (), iy (), iz (), count (0), centroid () {}
117 Eigen::VectorXf centroid;
122 typedef boost::shared_ptr< ApproximateVoxelGrid<PointT> >
Ptr;
123 typedef boost::shared_ptr< const ApproximateVoxelGrid<PointT> >
ConstPtr;
200 inline Eigen::Vector3f
242 flush (
PointCloud &output,
size_t op, he *hhe,
int rgba_index,
int centroid_size);
246 #ifdef PCL_NO_PRECOMPILE
247 #include <pcl/filters/impl/approximate_voxel_grid.hpp>
250 #endif //#ifndef PCL_FILTERS_VOXEL_GRID_MAP_H_
std::string filter_name_
The filter name.
void setLeafSize(const Eigen::Vector3f &leaf_size)
Set the voxel grid leaf size.
ApproximateVoxelGrid()
Empty constructor.
PointCloud::ConstPtr PointCloudConstPtr
void flush(PointCloud &output, size_t op, he *hhe, int rgba_index, int centroid_size)
Write a single point from the hash to the output cloud.
void setDownsampleAllData(bool downsample)
Set to true if all fields need to be downsampled, or false if just XYZ.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::shared_ptr< const ApproximateVoxelGrid< PointT > > ConstPtr
ApproximateVoxelGrid & operator=(const ApproximateVoxelGrid &src)
Copy operator.
boost::shared_ptr< PointCloud< PointT > > Ptr
ApproximateVoxelGrid(const ApproximateVoxelGrid &src)
Copy constructor.
Eigen::Vector3f leaf_size_
The size of a leaf.
traits::POD< PointT >::type Pod
void applyFilter(PointCloud &output)
Downsample a Point Cloud using a voxelized grid approach.
ApproximateVoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the...
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
xNdCopyPointEigenFunctor(const PointT &p1, Eigen::VectorXf &p2)
PointCloud::Ptr PointCloudPtr
bool downsample_all_data_
Set to true if all fields need to be downsampled, or false if just XYZ.
bool getDownsampleAllData() const
Get the state of the internal downsampling parameter (true if all fields need to be downsampled...
Eigen::Array3f inverse_leaf_size_
Compute 1/leaf_size_ to avoid division later.
traits::POD< PointT >::type Pod
struct he * history_
history buffer
pcl::traits::fieldList< PointT >::type FieldList
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
A point structure representing Euclidean xyz coordinates, and the RGB color.
xNdCopyEigenPointFunctor(const Eigen::VectorXf &p1, PointT &p2)
Filter represents the base filter class.
~ApproximateVoxelGrid()
Destructor.
void setLeafSize(float lx, float ly, float lz)
Set the voxel grid leaf size.
size_t histsize_
history buffer size, power of 2
boost::shared_ptr< ApproximateVoxelGrid< PointT > > Ptr
Eigen::Vector3f getLeafSize() const
Get the voxel grid leaf size.