diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 8d0a274a2a7..6647245fab7 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -437,7 +437,7 @@ struct Face_filtered_graph initialize_halfedge_indices(); } - /// changes the set of selected faces using a patch id + /// changes the set of selected faces using a patch id. template void set_selected_faces(typename boost::property_traits::value_type face_patch_id, FacePatchIndexMap face_patch_index_map) @@ -506,7 +506,7 @@ struct Face_filtered_graph reset_indices(); } - /// changes the set of selected faces using a range of face descriptors + /// changes the set of selected faces using a range of face descriptors. template void set_selected_faces(const FaceRange& selection) { @@ -570,7 +570,7 @@ struct Face_filtered_graph return selected_halfedges[get(himap, halfedge(e,_graph))]; } - /// returns the number of selected faces + /// returns the number of selected faces. size_type number_of_faces() const { return selected_faces.count(); @@ -661,6 +661,27 @@ struct Face_filtered_graph return true; } + /// inverts the selected status of faces. + void invert_selection() + { + selected_faces=~selected_faces; + selected_halfedges.reset(); + selected_vertices.reset(); + + for(face_descriptor fd : faces(_graph)) + { + if (!selected_faces.test(get(fimap, fd))) continue; + for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph)) + { + selected_halfedges.set(get(himap, hd)); + selected_halfedges.set(get(himap, opposite(hd, _graph))); + selected_vertices.set(get(vimap, target(hd, _graph))); + } + } + + reset_indices(); + } + private: Graph& _graph; FIM fimap; diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index d46d3e6f018..1e90245b72a 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -15,6 +15,10 @@ Release date: June 2022 - Added an overload of the function `CGAL::convex_hull_3()`, which writes the result in an indexed triangle set. +### [CGAL and the Boost Graph Library (BGL)](https://doc.cgal.org/5.5/Manual/packages.html#PkgBGL) + +- Added the function [`invert_selection()`](https://doc.cgal.org/5.5/BGL/structCGAL_1_1Face__filtered__graph.html#aa428541ebbdd35f9a6e9a3ffd60178df) in the class [`Face_filtered_graph`](https://doc.cgal.org/5.5/BGL/structCGAL_1_1Face__filtered__graph.html), which toggles the selected status of a graph: selected faces are deselected, and unselected faces are selected. + ### Combinatorial Maps - Removed old code deprecated in CGAL 4.9 and 4.10 (global fonctions, and information associated with darts).