diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index ee0247330bd..6b87731ad9b 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -945,6 +945,9 @@ void swap_edges(const typename boost::graph_traits::halfedge_descript * \link MutableHalfedgeGraph `remove_edge()`\endlink, and * \link MutableFaceGraph `remove_face()`\endlink, for each vertex, edge, and face. * + * Note that some graphs have a specialized version of this function to improve + * complexity. + * * @warning This function does not perform anything more than what is advertised above. It is * up to the user to e.g. clean garbage or remove internal property maps (if relevant, and desired). * diff --git a/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h index 8cff560f0a6..33a45710ab1 100644 --- a/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h @@ -310,6 +310,12 @@ set_halfedge(typename boost::graph_traits< CGAL::Polyhedron_3 >::ver static_cast(*v).set_halfedge(h); } +template +void +remove_all_elements(CGAL::Polyhedron_3& g) +{ + g.clear(); +} // // HalfedgeGraph diff --git a/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h index d044c38a557..1a05f71bb9c 100644 --- a/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h +++ b/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h @@ -472,7 +472,6 @@ remove_vertex(typename boost::graph_traits >::vertex_descr sm.remove_vertex(v); } - template void remove_edge(typename boost::graph_traits >::vertex_descriptor u, @@ -491,7 +490,6 @@ remove_edge(typename boost::graph_traits >::edge_descripto sm.remove_edge(e); } - template void remove_edge(typename boost::graph_traits >::edge_iterator eiter, @@ -508,6 +506,13 @@ remove_face(typename boost::graph_traits >::face_descripto sm.remove_face(f); } +template +void +remove_all_elements(CGAL::Surface_mesh

& sm) +{ + sm.clear_without_removing_property_maps(); +} + template typename boost::graph_traits >::face_descriptor add_face(CGAL::Surface_mesh

& sm)