diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 9b278e252c3..909be8c050a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -285,10 +285,11 @@ clip_to_bbox(const Plane_3& plane, return ON_ORIENTED_BOUNDARY; } -template +template void split_along_edges(TriangleMesh& tm, Ecm ecm, - VPM vpm) + VPM vpm, + UserVisitor& user_visitor) { typedef boost::graph_traits GT; typedef typename GT::face_descriptor face_descriptor; @@ -337,8 +338,10 @@ void split_along_edges(TriangleMesh& tm, halfedge_descriptor h = halfedge(shared_edges[k], tm); face_descriptor fh = face(h, tm); //add edge + user_visitor.before_edge_duplicated(h, tm); halfedge_descriptor new_hedge = halfedge(add_edge(tm), tm), new_opp = opposite(new_hedge,tm); + user_visitor.after_edge_duplicated(h, new_hedge, tm); vertex_descriptor vt = target(h, tm); vertex_descriptor vs = source(h, tm); @@ -395,8 +398,11 @@ void split_along_edges(TriangleMesh& tm, for(const std::pair& p : vertices_to_duplicate) { + user_visitor.before_vertex_copy(p.second, tm, tm); vertex_descriptor nv = add_vertex(tm); put(vpm, nv, get(vpm, p.second)); + user_visitor.after_vertex_copy(p.second, tm, nv, tm); + for(halfedge_descriptor h : halfedges_around_target(p.first, tm)) set_target(h, nv, tm); set_halfedge(nv, p.first, tm); @@ -900,6 +906,14 @@ void split(TriangleMesh& tm, Ecm ecm = get(CGAL::dynamic_edge_property_t(), tm); + typedef typename internal_np::Lookup_named_param_def < + internal_np::visitor_t, + NamedParameters1, + Corefinement::Default_visitor//default + > ::type User_visitor; + User_visitor uv(choose_parameter(get_parameter(np_tm, internal_np::visitor))); + + // create a constrained edge map and corefine input mesh with the splitter, // and mark edges @@ -910,7 +924,7 @@ void split(TriangleMesh& tm, CGAL::parameters::vertex_point_map(vpm_s).do_not_modify(do_not_modify_splitter)); //split mesh along marked edges - internal::split_along_edges(tm, ecm, vpm_tm); + internal::split_along_edges(tm, ecm, vpm_tm, uv); } /**