mirror of https://github.com/CGAL/cgal
Merge pull request #4709 from maxGimeno/Surface_mesh-Clear_removes_the_maps-maxGimeno
Surface_mesh: fix clear()
This commit is contained in:
commit
b294b39d7e
|
|
@ -46,6 +46,10 @@ Release History
|
||||||
is given an optional template parameter `ConcurrencyTag` (default
|
is given an optional template parameter `ConcurrencyTag` (default
|
||||||
value remains `CGAL::Sequential_tag` for backward compatibility).
|
value remains `CGAL::Sequential_tag` for backward compatibility).
|
||||||
|
|
||||||
|
### Surface Mesh
|
||||||
|
|
||||||
|
- **Breaking change**: The function `CGAL::Surface_mesh::clear()` now removes all non-default properties instead of just emptying them.
|
||||||
|
|
||||||
Release 5.0
|
Release 5.0
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1129,6 +1129,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// removes all vertices, halfedge, edges and faces. Collects garbage and clears all properties.
|
/// 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();
|
void clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2838,6 +2840,11 @@ void
|
||||||
Surface_mesh<P>::
|
Surface_mesh<P>::
|
||||||
clear()
|
clear()
|
||||||
{
|
{
|
||||||
|
vprops_.clear();
|
||||||
|
hprops_.clear();
|
||||||
|
eprops_.clear();
|
||||||
|
fprops_.clear();
|
||||||
|
|
||||||
vprops_.resize(0);
|
vprops_.resize(0);
|
||||||
hprops_.resize(0);
|
hprops_.resize(0);
|
||||||
eprops_.resize(0);
|
eprops_.resize(0);
|
||||||
|
|
@ -2848,6 +2855,14 @@ clear()
|
||||||
eprops_.shrink_to_fit();
|
eprops_.shrink_to_fit();
|
||||||
fprops_.shrink_to_fit();
|
fprops_.shrink_to_fit();
|
||||||
|
|
||||||
|
vconn_ = add_property_map<Vertex_index, Vertex_connectivity>("v:connectivity").first;
|
||||||
|
hconn_ = add_property_map<Halfedge_index, Halfedge_connectivity>("h:connectivity").first;
|
||||||
|
fconn_ = add_property_map<Face_index, Face_connectivity>("f:connectivity").first;
|
||||||
|
vpoint_ = add_property_map<Vertex_index, Point>("v:point").first;
|
||||||
|
vremoved_ = add_property_map<Vertex_index, bool>("v:removed", false).first;
|
||||||
|
eremoved_ = add_property_map<Edge_index, bool>("e:removed", false).first;
|
||||||
|
fremoved_ = add_property_map<Face_index, bool>("f:removed", false).first;
|
||||||
|
|
||||||
removed_vertices_ = removed_edges_ = removed_faces_ = 0;
|
removed_vertices_ = removed_edges_ = removed_faces_ = 0;
|
||||||
vertices_freelist_ = edges_freelist_ = faces_freelist_ = (std::numeric_limits<size_type>::max)();
|
vertices_freelist_ = edges_freelist_ = faces_freelist_ = (std::numeric_limits<size_type>::max)();
|
||||||
garbage_ = false;
|
garbage_ = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue