31 #if !defined WindingNumbersShape_h
33 #define WindingNumbersShape_h
36 #error You need to have activated LIBIGL (WITH_LIBIGL flag) to include this file.
41 #include <DGtal/base/Common.h>
42 #include <DGtal/base/CountedConstPtrOrConstPtr.h>
43 #include <DGtal/base/ConstAlias.h>
44 #include <DGtal/shapes/CEuclideanOrientedShape.h>
48 #pragma GCC system_header
49 #pragma clang system_header
51 #include <igl/fast_winding_number.h>
52 #include <igl/octree.h>
54 #include <igl/copyleft/cgal/point_areas.h>
56 #pragma GCC diagnostic pop
57 #pragma clang diagnostic pop
76 template<
typename TSpace>
99 bool skipPointAreas =
false)
107 trace.
warning()<<
"[WindingNumberShape] Skipping the CGAL point area estimation. By default, point areas are set to 1.0"<<std::endl;
109 if (points->rows()> 20)
119 trace.
warning()<<
"[WindingNumberShape] Too few points to use CGAL point_areas. Using the constant area setting."<<std::endl;
131 const Eigen::VectorXd &areas)
156 const double threshold = 0.3)
const
158 Eigen::MatrixXd queries(1,3);
161 return singlePoint[0];
171 const double threshold = 0.3)
const
174 std::vector<Orientation> results( queries.rows(),
DGtal::OUTSIDE );
179 for(
auto i=0u; i < queries.rows(); ++i)
181 if (std::abs(W(i)) < threshold )
184 if (std::abs(W(i)) > threshold)
198 Eigen::VectorXd &W)
const
200 Eigen::MatrixXd O_CM;
202 Eigen::MatrixXd O_EC;
206 igl::fast_winding_number(*
myPoints,*
myNormals,
myPointAreas,
myO_PI,
myO_CH,O_CM,O_R,O_EC,queries,2,W);
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Space::RealVector RealVector
DGtal is the top-level namespace which contains all DGtal functions and types.
PointVector< 3, double > RealPoint