40 #ifndef PCL_FILTERS_CROP_BOX_H_
41 #define PCL_FILTERS_CROP_BOX_H_
43 #include <pcl/point_types.h>
44 #include <pcl/filters/filter_indices.h>
45 #include <pcl/common/transforms.h>
46 #include <pcl/common/eigen.h>
56 template<
typename Po
intT>
67 typedef boost::shared_ptr< CropBox<PointT> >
Ptr;
68 typedef boost::shared_ptr< const CropBox<PointT> >
ConstPtr;
73 CropBox (
bool extract_removed_indices =
false) :
75 min_pt_ (Eigen::Vector4f (-1, -1, -1, 1)),
76 max_pt_ (Eigen::Vector4f (1, 1, 1, 1)),
77 rotation_ (Eigen::Vector3f::Zero ()),
78 translation_ (Eigen::Vector3f::Zero ()),
79 transform_ (Eigen::Affine3f::Identity ())
88 setMin (
const Eigen::Vector4f &min_pt)
96 inline Eigen::Vector4f
114 inline Eigen::Vector4f
126 translation_ = translation;
133 return (translation_);
142 rotation_ = rotation;
146 inline Eigen::Vector3f
158 transform_ = transform;
162 inline Eigen::Affine3f
192 Eigen::Vector4f min_pt_;
194 Eigen::Vector4f max_pt_;
196 Eigen::Vector3f rotation_;
198 Eigen::Vector3f translation_;
200 Eigen::Affine3f transform_;
224 CropBox (
bool extract_removed_indices =
false) :
226 min_pt_(Eigen::Vector4f (-1, -1, -1, 1)),
227 max_pt_(Eigen::Vector4f (1, 1, 1, 1)),
228 translation_ (Eigen::Vector3f::Zero ()),
229 rotation_ (Eigen::Vector3f::Zero ()),
230 transform_(Eigen::Affine3f::Identity ())
232 filter_name_ =
"CropBox";
247 inline Eigen::Vector4f
265 inline Eigen::Vector4f
277 translation_ = translation;
281 inline Eigen::Vector3f
284 return (translation_);
293 rotation_ = rotation;
297 inline Eigen::Vector3f
309 transform_ = transform;
313 inline Eigen::Affine3f
330 applyFilter (std::vector<int> &indices);
345 #ifdef PCL_NO_PRECOMPILE
346 #include <pcl/filters/impl/crop_box.hpp>
349 #endif // PCL_FILTERS_CROP_BOX_H_
void setRotation(const Eigen::Vector3f &rotation)
Set a rotation value for the box.
Eigen::Vector3f getTranslation() const
Get the value of the box translation parameter as set by the user.
Eigen::Vector4f getMin() const
Get the value of the minimum point of the box, as set by the user.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const CropBox< PointT > > ConstPtr
boost::shared_ptr< PointCloud< PointT > > Ptr
void setMin(const Eigen::Vector4f &min_pt)
Set the minimum point of the box.
Eigen::Vector4f min_pt_
The minimum point of the box.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > PCLPointCloud2ConstPtr
Eigen::Vector3f getTranslation() const
Get the value of the box translation parameter as set by the user.
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
Eigen::Affine3f getTransform() const
Get the value of the transformation parameter, as set by the user.
Eigen::Affine3f getTransform() const
Get the value of the transformation parameter, as set by the user.
void setTransform(const Eigen::Affine3f &transform)
Set a transformation that should be applied to the cloud before filtering.
FilterIndices represents the base class for filters that are about binary point removal.
PointCloud::Ptr PointCloudPtr
Eigen::Vector4f getMax() const
Get the value of the maxiomum point of the box, as set by the user.
Filter represents the base filter class.
boost::shared_ptr< CropBox< PointT > > Ptr
CropBox is a filter that allows the user to filter all the data inside of a given box...
Eigen::Vector4f getMin() const
Get the value of the minimum point of the box, as set by the user.
Eigen::Vector4f getMax() const
Get the value of the maxiomum point of the box, as set by the user.
Eigen::Vector3f rotation_
The 3D rotation for the box.
Eigen::Vector3f getRotation() const
Get the value of the box rotatation parameter, as set by the user.
void setTransform(const Eigen::Affine3f &transform)
Set a transformation that should be applied to the cloud before filtering.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
CropBox(bool extract_removed_indices=false)
Constructor.
Eigen::Vector3f translation_
The 3D translation for the box.
void setRotation(const Eigen::Vector3f &rotation)
Set a rotation value for the box.
boost::shared_ptr< ::pcl::PCLPointCloud2 > PCLPointCloud2Ptr
Eigen::Affine3f transform_
The affine transform applied to the cloud.
Eigen::Vector3f getRotation() const
Get the value of the box rotatation parameter, as set by the user.
Eigen::Vector4f max_pt_
The maximum point of the box.
void setMax(const Eigen::Vector4f &max_pt)
Set the maximum point of the box.
CropBox(bool extract_removed_indices=false)
Constructor.
void setTranslation(const Eigen::Vector3f &translation)
Set a translation value for the box.
std::string filter_name_
The filter name.
A point structure representing Euclidean xyz coordinates, and the RGB color.
void setMax(const Eigen::Vector4f &max_pt)
Set the maximum point of the box.
void setTranslation(const Eigen::Vector3f &translation)
Set a translation value for the box.
void setMin(const Eigen::Vector4f &min_pt)
Set the minimum point of the box.
void applyFilter(PointCloud &output)
Sample of point indices into a separate PointCloud.