From a662c97f0084c35fb65de8f273216d438794759c Mon Sep 17 00:00:00 2001 From: Baskin Senbaslar Date: Sat, 13 Jul 2019 12:37:38 +0300 Subject: [PATCH] map_type change to state_type --- .../edge_collapse_garland_heckbert.cpp | 9 ++++----- .../edge_collapse_polyhedron_garland_heckbert.cpp | 11 +++++------ .../edge_collapse_surface_mesh_garland_heckbert.cpp | 8 ++++---- .../GarlandHeckbert_edge_collapse_visitor_base.h | 6 +++--- .../Policies/Edge_collapse/GarlandHeckbert_cost.h | 6 +++--- .../Edge_collapse/GarlandHeckbert_placement.h | 6 +++--- .../Edge_collapse/internal/GarlandHeckbert_core.h | 2 +- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp index 4b7860c4899..4bc86a7fce5 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp @@ -45,16 +45,15 @@ int main(int argc, char** argv) return EXIT_FAILURE; } - SMS::GarlandHeckbert_edge_collapse_visitor_base::garland_heckbert_map_type map; - SMS::GarlandHeckbert_edge_collapse_visitor_base vis(map); + SMS::GarlandHeckbert_edge_collapse_visitor_base::garland_heckbert_state_type state; int r = SMS::edge_collapse(surface_mesh, CGAL::Surface_mesh_simplification::GarlandHeckbert_cost_stop_predicate(threshold), CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index, surface_mesh)) .halfedge_index_map(get(CGAL::halfedge_external_index ,surface_mesh)) - .get_cost(SMS::GarlandHeckbert_cost (map)) - .get_placement(SMS::GarlandHeckbert_placement(map)) - .visitor(vis)); + .get_cost(SMS::GarlandHeckbert_cost (state)) + .get_placement(SMS::GarlandHeckbert_placement(state)) + .visitor(SMS::GarlandHeckbert_edge_collapse_visitor_base(state))); std::cout << "\nFinished...\n" << r << " edges removed.\n" << (surface_mesh.size_of_halfedges()/2) << " final edges.\n"; diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron_garland_heckbert.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron_garland_heckbert.cpp index 2d032bbee9f..49aefedcd6b 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron_garland_heckbert.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron_garland_heckbert.cpp @@ -42,9 +42,8 @@ int main(int argc, char** argv) // left in the surface mesh drops below the specified number (1000) SMS::Count_stop_predicate stop(1000); - SMS::GarlandHeckbert_edge_collapse_visitor_base::garland_heckbert_map_type map; - SMS::GarlandHeckbert_edge_collapse_visitor_base vis(map); - + SMS::GarlandHeckbert_edge_collapse_visitor_base::garland_heckbert_state_type state; + // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. // The index maps are needed because the vertices and edges @@ -54,9 +53,9 @@ int main(int argc, char** argv) ,stop ,CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index, surface_mesh)) .halfedge_index_map (get(CGAL::halfedge_external_index, surface_mesh)) - .get_cost(SMS::GarlandHeckbert_cost(map)) - .get_placement(SMS::GarlandHeckbert_placement(map)) - .visitor(vis) + .get_cost(SMS::GarlandHeckbert_cost(state)) + .get_placement(SMS::GarlandHeckbert_placement(state)) + .visitor(SMS::GarlandHeckbert_edge_collapse_visitor_base(state)) ); std::chrono::steady_clock::time_point end_time = std::chrono::steady_clock::now(); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh_garland_heckbert.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh_garland_heckbert.cpp index 5e8980a2aa6..ff9ebec15a2 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh_garland_heckbert.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh_garland_heckbert.cpp @@ -108,21 +108,21 @@ int main(int argc, char** argv) std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now(); - SMS::GarlandHeckbert_edge_collapse_visitor_base::garland_heckbert_map_type map; + SMS::GarlandHeckbert_edge_collapse_visitor_base::garland_heckbert_state_type state; // stop SMS::Count_ratio_stop_predicate stop(stop_ratio); // SMS::GarlandHeckbert_cost_stop_predicate stop(stop_ratio); // cost - SMS::GarlandHeckbert_cost cost(map); + SMS::GarlandHeckbert_cost cost(state); // placement - SMS::GarlandHeckbert_placement gh_placement(map); + SMS::GarlandHeckbert_placement gh_placement(state); SMS::Bounded_normal_change_placement > placement(gh_placement); // visitor - SMS::GarlandHeckbert_edge_collapse_visitor_base vis(map); + SMS::GarlandHeckbert_edge_collapse_visitor_base vis(state); int r = SMS::edge_collapse(surface_mesh, stop, CGAL::parameters::get_cost(cost) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/GarlandHeckbert_edge_collapse_visitor_base.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/GarlandHeckbert_edge_collapse_visitor_base.h index 7d257339556..63aa90760c3 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/GarlandHeckbert_edge_collapse_visitor_base.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/GarlandHeckbert_edge_collapse_visitor_base.h @@ -25,14 +25,14 @@ struct GarlandHeckbert_edge_collapse_visitor_base : Edge_collapse_visitor_base::Kernel Kernel; typedef typename internal::GarlandHeckbertCore::Matrix4x4 Matrix4x4; - typedef typename internal::GarlandHeckbertCore::garland_heckbert_map_type garland_heckbert_map_type; + typedef typename internal::GarlandHeckbertCore::garland_heckbert_state_type garland_heckbert_state_type; typedef typename internal::GarlandHeckbertCore::FT FT; - garland_heckbert_map_type& mCostMatrices; + garland_heckbert_state_type& mCostMatrices; FT mDiscontinuityMultiplier; GarlandHeckbert_edge_collapse_visitor_base( - garland_heckbert_map_type& aCostMatrices, FT aDiscontinuityMultiplier = 100.0) + garland_heckbert_state_type& aCostMatrices, FT aDiscontinuityMultiplier = 100.0) : mCostMatrices(aCostMatrices), mDiscontinuityMultiplier(aDiscontinuityMultiplier) { diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_cost.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_cost.h index ce4882eaa74..e9256deeb1f 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_cost.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_cost.h @@ -18,7 +18,7 @@ public: typedef typename internal::GarlandHeckbertCore GHC; - typedef typename GHC::garland_heckbert_map_type garland_heckbert_map_type; + typedef typename GHC::garland_heckbert_state_type garland_heckbert_state_type; typedef typename GHC::Matrix4x4 Matrix4x4; typedef typename GHC::Row4 Row4; typedef typename GHC::Col4 Col4; @@ -26,7 +26,7 @@ public: typedef typename boost::optional Optional_FT; - GarlandHeckbert_cost(const garland_heckbert_map_type& aCostMatrices) + GarlandHeckbert_cost(const garland_heckbert_state_type& aCostMatrices) : mCostMatrices(aCostMatrices) { } @@ -51,7 +51,7 @@ public: } private: - const garland_heckbert_map_type& mCostMatrices; + const garland_heckbert_state_type& mCostMatrices; }; } // namespace Surface_mesh_simplification diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_placement.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_placement.h index c17a25b1f7e..43dbdb52458 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_placement.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_placement.h @@ -20,7 +20,7 @@ public: typedef typename internal::GarlandHeckbertCore GHC; - typedef typename GHC::garland_heckbert_map_type garland_heckbert_map_type; + typedef typename GHC::garland_heckbert_state_type garland_heckbert_state_type; typedef typename GHC::Matrix4x4 Matrix4x4; typedef typename GHC::Row4 Row4; typedef typename GHC::Col4 Col4; @@ -28,7 +28,7 @@ public: typedef typename boost::optional Optional_FT; - GarlandHeckbert_placement(const garland_heckbert_map_type& aCostMatrices) + GarlandHeckbert_placement(const garland_heckbert_state_type& aCostMatrices) : mCostMatrices(aCostMatrices) {} @@ -53,7 +53,7 @@ public: } private: - const garland_heckbert_map_type& mCostMatrices; + const garland_heckbert_state_type& mCostMatrices; }; } // namespace Surface_mesh_simplification } // namespace CGAL diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_core.h index db4b9a97109..96906de2228 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_core.h @@ -41,7 +41,7 @@ struct GarlandHeckbertCore typedef typename Eigen::Matrix Col4; - typedef std::unordered_map garland_heckbert_map_type; + typedef std::unordered_map garland_heckbert_state_type; static Col4 point_to_homogenous_column(const Point& pt) {