35 #ifndef PCL_FILTERS_IMPL_BOX_CLIPPER3D_HPP
36 #define PCL_FILTERS_IMPL_BOX_CLIPPER3D_HPP
38 #include <pcl/filters/box_clipper3D.h>
40 template<
typename Po
intT>
42 : transformation_ (transformation)
48 template<
typename Po
intT>
51 setTransformation (rodrigues, translation, box_size);
55 template<
typename Po
intT>
61 template<
typename Po
intT>
void
64 transformation_ = transformation;
69 template<
typename Po
intT>
void
72 transformation_ = Eigen::Translation3f (translation) * Eigen::AngleAxisf(rodrigues.norm (), rodrigues.normalized ()) * Eigen::Scaling (box_size);
84 template<
typename Po
intT>
void
87 const Eigen::Vector4f& point = pointIn.getVector4fMap ();
88 pointOut.getVector4fMap () = transformation_ * point;
96 pointOut.x += (1 - point [3]) * transformation_.data () [ 9];
97 pointOut.y += (1 - point [3]) * transformation_.data () [10];
98 pointOut.z += (1 - point [3]) * transformation_.data () [11];
102 pointOut.x += transformation_.data () [ 9];
103 pointOut.y += transformation_.data () [10];
104 pointOut.z += transformation_.data () [11];
110 template<
typename Po
intT>
bool
113 Eigen::Vector4f point_coordinates (transformation_.matrix ()
114 * point.getVector4fMap ());
115 return (point_coordinates.array ().abs () <= 1).all ();
122 template<
typename Po
intT>
bool
168 throw std::logic_error (
"Not implemented");
176 template<
typename Po
intT>
void
180 clipped_polygon.clear ();
181 throw std::logic_error (
"Not implemented");
188 template<
typename Po
intT>
void
193 throw std::logic_error (
"Not implemented");
198 template<
typename Po
intT>
void
202 if (indices.empty ())
204 clipped.reserve (cloud_in.
size ());
205 for (std::size_t pIdx = 0; pIdx < cloud_in.
size (); ++pIdx)
206 if (clipPoint3D (cloud_in[pIdx]))
207 clipped.push_back (pIdx);
211 for (
const auto &index : indices)
212 if (clipPoint3D (cloud_in[index]))
213 clipped.push_back (index);
216 #endif //PCL_FILTERS_IMPL_BOX_CLIPPER3D_HPP