diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polygon_mesh.h index 2db15b7681a..043cad74baa 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polygon_mesh.h @@ -91,18 +91,19 @@ struct Tracer_polyhedron }; // This function is used in test cases (since it returns not just OutputIterator but also Weight) -template +template std::pair triangulate_hole_polygon_mesh(PolygonMesh& pmesh, typename boost::graph_traits::halfedge_descriptor border_halfedge, OutputIterator out, VertexPointMap vpmap, - bool use_delaunay_triangulation) + bool use_delaunay_triangulation, + const Kernel& k) { typedef Halfedge_around_face_circulator Hedge_around_face_circulator; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::property_traits::value_type Point_3; + typedef typename Kernel::Point_3 Point_3; typedef std::map Vertex_map; typedef typename Vertex_map::iterator Vertex_map_it; @@ -171,7 +172,8 @@ triangulate_hole_polygon_mesh(PolygonMesh& pmesh, Tracer_polyhedron tracer(out, pmesh, P_edges); CGAL::internal::Weight_min_max_dihedral_and_area weight = - triangulate_hole_polyline(P, Q, tracer, WC(is_valid), use_delaunay_triangulation) + triangulate_hole_polyline(P, Q, tracer, WC(is_valid), + use_delaunay_triangulation, k) #ifdef CGAL_USE_WEIGHT_INCOMPLETE .weight // get actual weight in Weight_incomplete #endif diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h index 26277c7e350..07177ef70e5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h @@ -1175,19 +1175,19 @@ public: template < typename PointRange, typename Tracer, - typename WeightCalculator + typename WeightCalculator, + typename Kernel > typename WeightCalculator::Weight triangulate_hole_polyline(const PointRange& points, const PointRange& third_points, Tracer& tracer, const WeightCalculator& WC, - bool use_delaunay_triangulation) + bool use_delaunay_triangulation, + const Kernel&) { - typedef typename PointRange::iterator InIterator; - typedef typename std::iterator_traits::value_type Point_3; - typedef typename CGAL::Kernel_traits::Kernel K; - + typedef Kernel K; + typedef K::Point_3 Point_3; typedef CGAL::internal::Triangulate_hole_polyline_DT Fill_DT; typedef CGAL::internal::Triangulate_hole_polyline Fill; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h index 20a2faa7a43..c31f2f6d2d2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h @@ -95,10 +95,10 @@ namespace CGAL{ //overload template - pmp_bgl_named_params + pmp_bgl_named_params vertex_point_map(const PointMap& p) const { - typedef pmp_bgl_named_params Params; + typedef pmp_bgl_named_params Params; return Params(p, *this); } @@ -209,10 +209,10 @@ namespace parameters{ //overload template - pmp_bgl_named_params + pmp_bgl_named_params vertex_point_map(const PointMap& p) { - typedef pmp_bgl_named_params Params; + typedef pmp_bgl_named_params Params; return Params(p); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h index 028ec3117d0..6ae2920da66 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h @@ -38,7 +38,7 @@ template class GetK { typedef typename property_map_value::type + boost::vertex_point_t>::type Point; public: typedef typename CGAL::Kernel_traits::Kernel Kernel; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index f902c5eac07..f16d05b10dc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -67,7 +67,7 @@ namespace internal{ * isolated connected component. * * @tparam PolygonMesh a model of `FaceListGraph` that has a property map -* for `CGAL::vertex_point_t` +* for `boost::vertex_point_t` * @tparam NamedParameters a sequence of \ref namedparameters * * @param pmesh the closed polygon mesh to be tested @@ -105,7 +105,7 @@ bool is_outward_oriented(const PolygonMesh& pmesh, boost::vertex_point); //Kernel typedef typename CGAL::Kernel_traits < - typename property_map_value::type + typename property_map_value::type > ::Kernel DefaultKernel; typedef typename boost::lookup_named_param_def < CGAL::geom_traits_t, diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h index 48ef7a0cfea..2d7bb465605 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h @@ -227,7 +227,7 @@ public: * \ingroup PkgPolygonMeshProcessing * triangulates faces of the polygon mesh `pmesh`. This function depends on the package \ref PkgTriangulation2Summary * @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` -* that has a property map for `CGAL::vertex_point_t` +* that has a property map for `boost::vertex_point_t` * @tparam NamedParameters a sequence of \ref namedparameters * * @param pmesh the polygon mesh to be triangulated diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h index 1b95cbe5728..b2ec4922ce0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h @@ -25,7 +25,7 @@ #include #include #include -#include + #include #include @@ -93,7 +93,9 @@ namespace Polygon_mesh_processing { border_halfedge, out, choose_param(get_param(np, vertex_point), get(CGAL::vertex_point, pmesh)), - use_dt3).first; + use_dt3, + choose_param(get_param(np, geom_traits), GetKernel::Kernel())) + .first; } template @@ -255,6 +257,9 @@ namespace Polygon_mesh_processing { Note that the ranges `points` and `third_points` may or may not contain duplicated first point at the end of sequence. + @tparam OutputIteratorValueType value type of `OutputIterator` + having a constructor `OutputIteratorValueType(int p0, int p1, int p2)` available. + It defaults to `value_type_traits::%type`, and can be omitted when the default is fine. @tparam PointRange range of points, model of `SinglePassRange` @tparam OutputIterator model of `OutputIterator` holding `boost::graph_traits::%face_descriptor` for patch faces @@ -273,7 +278,8 @@ namespace Polygon_mesh_processing { \todo handle islands */ - template OutputIterator @@ -303,7 +309,15 @@ namespace Polygon_mesh_processing { typedef typename value_type_traits::type OutputIteratorValueType; CGAL::internal::Tracer_polyline_incomplete tracer(out, Holes_out(holes)); - triangulate_hole_polyline(points, third_points, tracer, WC(), use_dt3); + + typedef typename PointRange::iterator InIterator; + typedef typename std::iterator_traits::value_type Point; + + triangulate_hole_polyline(points, third_points, tracer, WC(), + use_dt3, + choose_param(get_param(np, CGAL::geom_traits), + typename CGAL::Kernel_traits::Kernel())); + CGAL_assertion(holes.empty()); return tracer.out; } @@ -321,10 +335,9 @@ namespace Polygon_mesh_processing { /*! \ingroup PkgPolygonMeshProcessing - same as above but the range of third points is omitted. - They are not taken into account in the cost computation that leads the hole filling - combinatorial decisions. - */ + same as above but the range of third points is omitted. They are not + taken into account in the cost computation that leads the hole filling. +*/ template diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp index f65179e665a..c60bd79ea81 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp @@ -104,7 +104,7 @@ void test_triangulate_hole_weight(const char* file_name, bool use_DT) { for(std::vector::iterator it = border_reps.begin(); it != border_reps.end(); ++it) { std::vector patch; Weight w_algo = CGAL::Polygon_mesh_processing::internal::triangulate_hole_polygon_mesh( - poly, *it, back_inserter(patch), get(CGAL::vertex_point, poly), use_DT).second; + poly, *it, back_inserter(patch), get(CGAL::vertex_point, poly), use_DT, Kernel()).second; if(patch.empty()) { continue; } Weight w_test = calculate_weight_for_patch(poly, patch.begin(), patch.end()); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp index 33da449a064..a4b76c61645 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp @@ -103,7 +103,7 @@ void test_triangulate_hole_weight(const char* file_name, bool use_DT) { for(std::vector::iterator it = border_reps.begin(); it != border_reps.end(); ++it) { std::vector patch; Weight w_algo = CGAL::Polygon_mesh_processing::internal::triangulate_hole_polygon_mesh( - poly, *it, back_inserter(patch), get(CGAL::vertex_point, poly), use_DT).second; + poly, *it, back_inserter(patch), get(CGAL::vertex_point, poly), use_DT, Kernel()).second; if(patch.empty()) { continue; } Weight w_test = calculate_weight_for_patch(poly, patch.begin(), patch.end());