42 #include <pcl/memory.h>
43 #include <pcl/pcl_macros.h>
44 #include <pcl/pcl_config.h>
48 #include <pcl/surface/reconstruction.h>
49 #include <pcl/ModelCoefficients.h>
50 #include <pcl/PolygonMesh.h>
60 comparePoints2D (
const std::pair<int, Eigen::Vector4f> & p1,
const std::pair<int, Eigen::Vector4f> & p2)
62 double angle1 = std::atan2 (p1.second[1], p1.second[0]) + M_PI;
63 double angle2 = std::atan2 (p2.second[1], p2.second[0]) + M_PI;
64 return (angle1 > angle2);
72 template<
typename Po
intInT>
82 using Ptr = shared_ptr<ConvexHull<PointInT> >;
83 using ConstPtr = shared_ptr<const ConvexHull<PointInT> >;
113 std::vector<pcl::Vertices> &polygons);
157 if ((dimension == 2) || (dimension == 3))
160 PCL_ERROR (
"[pcl::%s::setDimension] Invalid input dimension specified!\n",
getClassName ().c_str ());
188 std::vector<pcl::Vertices> &polygons,
189 bool fill_polygon_data =
false);
200 std::vector<pcl::Vertices> &polygons,
201 bool fill_polygon_data =
false);
212 std::vector<pcl::Vertices> &polygons,
213 bool fill_polygon_data =
false);
237 return (
"ConvexHull");
275 #ifdef PCL_NO_PRECOMPILE
276 #include <pcl/surface/impl/convex_hull.hpp>
int dimension_
The dimensionality of the concave hull (2D or 3D).
pcl::PointIndices hull_indices_
ConvexHull using libqhull library.
std::string qhull_flags
Option flag string to be used calling qhull.
void performReconstruction(PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
The actual reconstruction method.
typename PointCloud::ConstPtr PointCloudConstPtr
~ConvexHull()
Empty destructor.
double getTotalVolume() const
Returns the total volume of the convex hull.
const Eigen::Vector3d z_axis_
std::string getClassName() const override
Class get name method.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
ConvexHull()
Empty constructor.
void calculateInputDimension()
Automatically determines the dimension of input data - 2D or 3D.
shared_ptr< ConvexHull< PointInT > > Ptr
int getDimension() const
Returns the dimensionality (2 or 3) of the calculated hull.
shared_ptr< PointCloud< PointInT > > Ptr
void performReconstruction3D(PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
The reconstruction method for 3D data.
void performReconstruction2D(PointCloud &points, std::vector< pcl::Vertices > &polygons, bool fill_polygon_data=false)
The reconstruction method for 2D data.
void getHullPointIndices(pcl::PointIndices &hull_point_indices) const
Retrieve the indices of the input point cloud that for the convex hull.
MeshConstruction represents a base surface reconstruction class.
shared_ptr< const PointCloud< PointInT > > ConstPtr
void reconstruct(PointCloud &points, std::vector< pcl::Vertices > &polygons)
Compute a convex hull for all points given.
typename PointCloud::Ptr PointCloudPtr
void setComputeAreaVolume(bool value)
If set to true, the qhull library is called to compute the total area and volume of the convex hull...
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_
void setDimension(int dimension)
Sets the dimension on the input data, 2D or 3D.
double getTotalArea() const
Returns the total area of the convex hull.
shared_ptr< const ConvexHull< PointInT > > ConstPtr
const Eigen::Vector3d y_axis_
bool comparePoints2D(const std::pair< int, Eigen::Vector4f > &p1, const std::pair< int, Eigen::Vector4f > &p2)
Sort 2D points in a vector structure.