43 #ifndef PCL_CONVEX_HULL_2D_H_
44 #define PCL_CONVEX_HULL_2D_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>
72 class ConvexHull :
public MeshConstruction<PointInT>
75 using PCLBase<PointInT>::input_;
76 using PCLBase<PointInT>::indices_;
77 using PCLBase<PointInT>::initCompute;
78 using PCLBase<PointInT>::deinitCompute;
81 using MeshConstruction<PointInT>::reconstruct;
88 ConvexHull () : compute_area_ (false), total_area_ (0), total_volume_ (0), dimension_ (0),
89 projection_angle_thresh_ (cos (0.174532925) ), qhull_flags (
"qhull "),
90 x_axis_ (1.0, 0.0, 0.0), y_axis_ (0.0, 1.0, 0.0), z_axis_ (0.0, 0.0, 1.0)
102 std::vector<pcl::Vertices> &polygons);
115 setComputeAreaVolume (
bool value)
117 compute_area_ = value;
119 qhull_flags = std::string (
"qhull FA");
121 qhull_flags = std::string (
"qhull ");
126 getTotalArea ()
const
128 return (total_area_);
135 getTotalVolume ()
const
137 return (total_volume_);
144 setDimension (
int dimension)
146 if ((dimension == 2) || (dimension == 3))
147 dimension_ = dimension;
149 PCL_ERROR (
"[pcl::%s::setDimension] Invalid input dimension specified!\n", getClassName ().c_str ());
154 getDimension ()
const
169 std::vector<pcl::Vertices> &polygons,
170 bool fill_polygon_data =
false);
181 std::vector<pcl::Vertices> &polygons,
182 bool fill_polygon_data =
false);
193 std::vector<pcl::Vertices> &polygons,
194 bool fill_polygon_data =
false);
201 performReconstruction (PolygonMesh &output);
208 performReconstruction (std::vector<pcl::Vertices> &polygons);
212 calculateInputDimension ();
216 getClassName ()
const
218 return (
"ConvexHull");
228 double total_volume_;
234 double projection_angle_thresh_;
237 std::string qhull_flags;
240 const Eigen::Vector3f x_axis_;
243 const Eigen::Vector3f y_axis_;
246 const Eigen::Vector3f z_axis_;
249 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
253 #endif //#ifndef PCL_CONVEX_HULL_2D_H_