40 #include <pcl/pcl_config.h>
43 #ifndef PCL_CONVEX_HULL_2D_H_
44 #define PCL_CONVEX_HULL_2D_H_
47 #include <pcl/surface/reconstruction.h>
48 #include <pcl/ModelCoefficients.h>
49 #include <pcl/PolygonMesh.h>
59 comparePoints2D (
const std::pair<int, Eigen::Vector4f> & p1,
const std::pair<int, Eigen::Vector4f> & p2)
61 double angle1 = atan2 (p1.second[1], p1.second[0]) + M_PI;
62 double angle2 = atan2 (p2.second[1], p2.second[0]) + M_PI;
63 return (angle1 > angle2);
71 template<
typename Po
intInT>
81 typedef boost::shared_ptr<ConvexHull<PointInT> >
Ptr;
82 typedef boost::shared_ptr<const ConvexHull<PointInT> >
ConstPtr;
112 std::vector<pcl::Vertices> &polygons);
156 if ((dimension == 2) || (dimension == 3))
159 PCL_ERROR (
"[pcl::%s::setDimension] Invalid input dimension specified!\n",
getClassName ().c_str ());
179 std::vector<pcl::Vertices> &polygons,
180 bool fill_polygon_data =
false);
191 std::vector<pcl::Vertices> &polygons,
192 bool fill_polygon_data =
false);
203 std::vector<pcl::Vertices> &polygons,
204 bool fill_polygon_data =
false);
228 return (
"ConvexHull");
259 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
263 #ifdef PCL_NO_PRECOMPILE
264 #include <pcl/surface/impl/convex_hull.hpp>
267 #endif //#ifndef PCL_CONVEX_HULL_2D_H_
bool comparePoints2D(const std::pair< int, Eigen::Vector4f > &p1, const std::pair< int, Eigen::Vector4f > &p2)
Sort 2D points in a vector structure.
PointCloud::Ptr PointCloudPtr
void setDimension(int dimension)
Sets the dimension on the input data, 2D or 3D.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
ConvexHull using libqhull library.
const Eigen::Vector3d z_axis_
boost::shared_ptr< PointCloud< PointT > > Ptr
std::string getClassName() const
Class get name method.
void calculateInputDimension()
Automatically determines the dimension of input data - 2D or 3D.
double projection_angle_thresh_
How close can a 2D plane's normal be to an axis to make projection problematic.
const Eigen::Vector3d x_axis_
boost::shared_ptr< ConvexHull< PointInT > > Ptr
pcl::PointCloud< PointInT > PointCloud
int dimension_
The dimensionality of the concave hull (2D or 3D).
virtual ~ConvexHull()
Empty destructor.
void setComputeAreaVolume(bool value)
If set to true, the qhull library is called to compute the total area and volume of the convex hull...
ConvexHull()
Empty constructor.
void reconstruct(PointCloud &points, std::vector< pcl::Vertices > &polygons)
Compute a convex hull for all points given.
const Eigen::Vector3d y_axis_
void performReconstruction3D(PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
The reconstruction method for 3D data.
MeshConstruction represents a base surface reconstruction class.
double getTotalVolume() const
Returns the total volume of the convex hull.
std::string qhull_flags
Option flag string to be used calling qhull.
int getDimension() const
Returns the dimensionality (2 or 3) of the calculated hull.
boost::shared_ptr< const ConvexHull< PointInT > > ConstPtr
void performReconstruction(PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
The actual reconstruction method.
double getTotalArea() const
Returns the total area of the convex hull.
void performReconstruction2D(PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
The reconstruction method for 2D data.
PointCloud::ConstPtr PointCloudConstPtr