From d99c7529995acc97d9542f3759965466f10bfec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Oct 2021 14:57:21 +0200 Subject: [PATCH 1/7] add a function to use the complement --- .../CGAL/boost/graph/Face_filtered_graph.h | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 25547b2ad4d..41fff741b69 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -661,6 +661,27 @@ struct Face_filtered_graph return true; } + /// flips the selected status of faces + void set_complement() + { + 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; From 4ad9a2ef878a11057ac5e7e5ed12634aacb0d444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 21 Oct 2021 11:24:32 +0200 Subject: [PATCH 2/7] better name after review --- BGL/include/CGAL/boost/graph/Face_filtered_graph.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 41fff741b69..b2c4bf1b5e0 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -661,8 +661,8 @@ struct Face_filtered_graph return true; } - /// flips the selected status of faces - void set_complement() + /// inverses the selected status of faces + void inverse_selection() { selected_faces=~selected_faces; selected_halfedges.reset(); From 420cbc4c317e4a4a0117c0bbdf8e7d7120e55cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 21 Oct 2021 12:00:13 +0200 Subject: [PATCH 3/7] fix English --- BGL/include/CGAL/boost/graph/Face_filtered_graph.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index b2c4bf1b5e0..3529b964333 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -661,8 +661,8 @@ struct Face_filtered_graph return true; } - /// inverses the selected status of faces - void inverse_selection() + /// inverts the selected status of faces + void invert_selection() { selected_faces=~selected_faces; selected_halfedges.reset(); From d4eb1d20a7aad6e869f4fb315415a608b7cd596a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 1 Feb 2022 20:06:03 +0100 Subject: [PATCH 4/7] update changes --- Installation/CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 1c5ddb9db12..6483be540c2 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()` in the class `Face_filtered_graph` to unselect selected faces + and to select unselected one. [Release 5.4](https://github.com/CGAL/cgal/releases/tag/v5.4) ----------- From c0682c21e21e37c453d45e7c7256738cb5851482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 1 Feb 2022 20:31:14 +0100 Subject: [PATCH 5/7] add links --- Installation/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 6483be540c2..a3a825c40ab 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -17,7 +17,7 @@ Release date: June 2022 ### [CGAL and the Boost Graph Library (BGL)](https://doc.cgal.org/5.5/Manual/packages.html#PkgBGL) -- Added the function `invert_selection()` in the class `Face_filtered_graph` to unselect selected faces +- 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) to unselect selected faces and to select unselected one. [Release 5.4](https://github.com/CGAL/cgal/releases/tag/v5.4) From 8126dd5accf468e2f6bffefe1a5c264aac23a93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 4 Feb 2022 09:15:47 +0100 Subject: [PATCH 6/7] add mising dots --- BGL/include/CGAL/boost/graph/Face_filtered_graph.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 3529b964333..3fe097f0787 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,7 +661,7 @@ struct Face_filtered_graph return true; } - /// inverts the selected status of faces + /// inverts the selected status of faces. void invert_selection() { selected_faces=~selected_faces; From 02e1152762f9b58149d2d4e066ad5767ecdaee44 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 23 Feb 2022 11:38:25 +0100 Subject: [PATCH 7/7] Update Installation/CHANGES.md Co-authored-by: Mael --- Installation/CHANGES.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index c6258dce0be..1e90245b72a 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -17,8 +17,7 @@ Release date: June 2022 ### [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) to unselect selected faces - and to select unselected one. +- 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