From baca4ca5b73fce689b87485bd637c4d861015dcc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 20 Jan 2015 18:42:54 +0100 Subject: [PATCH] Add Euler::fill_hole() --- .../CGAL/boost/graph/Euler_operations.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index e1b6d8073a4..101ef4a07ba 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -536,7 +536,6 @@ void remove_face(typename boost::graph_traits::halfedge_descriptor h, /** * removes the incident face of `h` and changes all halfedges incident to the face into border halfedges. See `remove_face(g,h)` for a more generalized variant. - * \returns `h`. * * \pre None of the incident halfedges of the face is a border halfedge. */ @@ -561,6 +560,24 @@ void make_hole(typename boost::graph_traits::halfedge_descriptor h, } + /** fills the hole incident to `h`. + * \pre `h`must be a border halfedge + */ +template< typename Graph> +void fill_hole(typename boost::graph_traits::halfedge_descriptor h, + Graph& g) +{ + typedef typename boost::graph_traits Traits; + typedef typename Traits::face_descriptor face_descriptor; + typedef typename Traits::halfedge_descriptor halfedge_descriptor; + + face_descriptor f = add_face(g); + BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(h,g)){ + set_face(hd, f,g); + } + set_halfedge(f,h,g); +} + /** * creates a barycentric triangulation of the face incident to `h`. Creates a new