From 9af250625b29b40e9a22f6123c6a7c52a334bc30 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 6 May 2020 17:02:32 +0200 Subject: [PATCH 1/3] clear() actually removes the property_maps --- .../include/CGAL/Surface_mesh/Surface_mesh.h | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index 96ef666128f..441ffdce437 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2838,20 +2838,33 @@ void Surface_mesh

:: clear() { - vprops_.resize(0); - hprops_.resize(0); - eprops_.resize(0); - fprops_.resize(0); + vprops_.clear(); + hprops_.clear(); + eprops_.clear(); + fprops_.clear(); - vprops_.shrink_to_fit(); - hprops_.shrink_to_fit(); - eprops_.shrink_to_fit(); - fprops_.shrink_to_fit(); + vprops_.resize(0); + hprops_.resize(0); + eprops_.resize(0); + fprops_.resize(0); - removed_vertices_ = removed_edges_ = removed_faces_ = 0; - vertices_freelist_ = edges_freelist_ = faces_freelist_ = (std::numeric_limits::max)(); - garbage_ = false; - anonymous_property_ = 0; + vprops_.shrink_to_fit(); + hprops_.shrink_to_fit(); + eprops_.shrink_to_fit(); + fprops_.shrink_to_fit(); + + vconn_ = add_property_map("v:connectivity").first; + hconn_ = add_property_map("h:connectivity").first; + fconn_ = add_property_map("f:connectivity").first; + vpoint_ = add_property_map("v:point").first; + vremoved_ = add_property_map("v:removed", false).first; + eremoved_ = add_property_map("e:removed", false).first; + fremoved_ = add_property_map("f:removed", false).first; + + removed_vertices_ = removed_edges_ = removed_faces_ = 0; + vertices_freelist_ = edges_freelist_ = faces_freelist_ = (std::numeric_limits::max)(); + garbage_ = false; + anonymous_property_ = 0; } //----------------------------------------------------------------------------- From 380e7c579e70a1b02ae72d6430ff047d7928a852 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 18 May 2020 12:25:28 +0200 Subject: [PATCH 2/3] Update doc and CHANGES.MD --- Installation/CHANGES.md | 4 ++++ Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index dbc8910ac48..8656ae9466f 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -37,6 +37,10 @@ Release History is given an optional template parameter `ConcurrencyTag` (default value remains `CGAL::Sequential_tag` for backward compatibility). +### Surface Mesh + + - The function `CGAL::Surface_mesh::clear()` now removes all non-default properties instead of just emptying them. + Release 5.0 ----------- diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index 441ffdce437..ef546224112 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -1129,6 +1129,8 @@ public: } /// removes all vertices, halfedge, edges and faces. Collects garbage and clears all properties. + /// + /// After calling this method, the object is the same as a newly constructed object. The additional properties (such as normal vectors) are also removed and must thus be re-added if needed. void clear(); From 3ab72f217a52ad7f41b0ad00e07d66d6bec7f5c2 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 25 May 2020 09:07:48 +0200 Subject: [PATCH 3/3] Add 'breaking change' to the change log --- Installation/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 8656ae9466f..63622bfd592 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -39,7 +39,7 @@ Release History ### Surface Mesh - - The function `CGAL::Surface_mesh::clear()` now removes all non-default properties instead of just emptying them. + - **Breaking change**: The function `CGAL::Surface_mesh::clear()` now removes all non-default properties instead of just emptying them. Release 5.0 -----------