42 #include <pcl/point_types.h>
43 #include <pcl/filters/filter_indices.h>
44 #include <pcl/common/transforms.h>
45 #include <pcl/common/eigen.h>
55 template<
typename Po
intT>
66 using Ptr = shared_ptr<CropBox<PointT> >;
67 using ConstPtr = shared_ptr<const CropBox<PointT> >;
72 CropBox (
bool extract_removed_indices =
false) :
74 min_pt_ (
Eigen::Vector4f (-1, -1, -1, 1)),
75 max_pt_ (
Eigen::Vector4f (1, 1, 1, 1)),
76 rotation_ (
Eigen::Vector3f::Zero ()),
77 translation_ (
Eigen::Vector3f::Zero ()),
78 transform_ (
Eigen::Affine3f::Identity ())
87 setMin (
const Eigen::Vector4f &min_pt)
95 inline Eigen::Vector4f
113 inline Eigen::Vector4f
125 translation_ = translation;
132 return (translation_);
141 rotation_ = rotation;
145 inline Eigen::Vector3f
157 transform_ = transform;
161 inline Eigen::Affine3f
184 Eigen::Vector4f min_pt_;
186 Eigen::Vector4f max_pt_;
188 Eigen::Vector3f rotation_;
190 Eigen::Vector3f translation_;
192 Eigen::Affine3f transform_;
216 CropBox (
bool extract_removed_indices =
false) :
218 min_pt_(
Eigen::Vector4f (-1, -1, -1, 1)),
219 max_pt_(
Eigen::Vector4f (1, 1, 1, 1)),
220 translation_ (
Eigen::Vector3f::Zero ()),
221 rotation_ (
Eigen::Vector3f::Zero ()),
222 transform_(
Eigen::Affine3f::Identity ())
224 filter_name_ =
"CropBox";
239 inline Eigen::Vector4f
257 inline Eigen::Vector4f
269 translation_ = translation;
273 inline Eigen::Vector3f
276 return (translation_);
285 rotation_ = rotation;
289 inline Eigen::Vector3f
301 transform_ = transform;
305 inline Eigen::Affine3f
322 applyFilter (std::vector<int> &indices)
override;
337 #ifdef PCL_NO_PRECOMPILE
338 #include <pcl/filters/impl/crop_box.hpp>
shared_ptr< ::pcl::PCLPointCloud2 > Ptr
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.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const CropBox< PointT > > ConstPtr
void applyFilter(std::vector< int > &indices) override
Sample of point indices.
void setMin(const Eigen::Vector4f &min_pt)
Set the minimum point of the box.
shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr
Eigen::Vector4f min_pt_
The minimum point of the box.
Eigen::Vector3f getTranslation() const
Get the value of the box translation parameter as set by the user.
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.
Eigen::Vector4f getMax() const
Get the value of the maximum point of the box, as set by the user.
Filter represents the base filter class.
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.
typename PointCloud::Ptr PointCloudPtr
void setTransform(const Eigen::Affine3f &transform)
Set a transformation that should be applied to the cloud before filtering.
CropBox(bool extract_removed_indices=false)
Constructor.
Eigen::Vector3f translation_
The 3D translation for the box.
shared_ptr< CropBox< PointT > > Ptr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setRotation(const Eigen::Vector3f &rotation)
Set a rotation value for the box.
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.
PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
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.
PCLPointCloud2::Ptr PCLPointCloud2Ptr
typename PointCloud::ConstPtr PointCloudConstPtr