From 6cbb0d071228142e4a5372d536249fbdf1f85f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 29 Nov 2019 09:30:54 +0100 Subject: [PATCH] Make the VertexCostMap a member of the policy If the dynamic property map isn't attached to the mesh, this could not work previously. --- .../Policies/Edge_collapse/GarlandHeckbert_policies.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h index 6a8b2bfe329..d5fddc423b0 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h @@ -170,9 +170,9 @@ public: GarlandHeckbert_policies(TriangleMesh& tmesh, const FT discontinuity_multiplier = FT(100)) { - Vertex_cost_map vcm = get(Cost_property(), tmesh); - get_cost_ = Get_cost(vcm, discontinuity_multiplier); - get_placement_ = Get_placement(vcm); + vcm_ = get(Cost_property(), tmesh); + get_cost_ = Get_cost(vcm_, discontinuity_multiplier); + get_placement_ = Get_placement(vcm_); } Get_cost& get_cost() { return get_cost_; } @@ -181,6 +181,7 @@ public: const Get_placement& get_placement() const { return get_placement_; } private: + Vertex_cost_map vcm_; Get_cost get_cost_; Get_placement get_placement_; };