From ba3a0d7d22131acf826f5138fa897f0e8a6e16af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 2 Nov 2022 13:46:45 +0100 Subject: [PATCH] Replace SMS::Count_* stop predicates with new Edge/Face_count_* stop predicates --- .../Mesh_simplification_plugin.cpp | 4 +- .../benchmark/polyhedron_performance.h | 4 +- .../benchmark/surface_mesh_performance.h | 4 +- .../Count_ratio_stop_predicate.h | 8 ++- .../Edge_collapse/Count_stop_predicate.h | 6 +- .../Edge_count_ratio_stop_predicate.h | 50 +++++++++++++++++ .../Edge_collapse/Edge_count_stop_predicate.h | 48 ++++++++++++++++ .../Face_count_ratio_stop_predicate.h | 51 +++++++++++++++++ .../Edge_collapse/Face_count_stop_predicate.h | 49 ++++++++++++++++ .../Concepts/StopPredicate.h | 6 +- .../PackageDescription.txt | 8 ++- .../edge_collapse_OpenMesh.cpp | 4 +- .../edge_collapse_bounded_normal_change.cpp | 4 +- .../edge_collapse_constrain_sharp_edges.cpp | 4 +- ...collapse_constrained_border_polyhedron.cpp | 4 +- ...llapse_constrained_border_surface_mesh.cpp | 4 +- .../edge_collapse_enriched_polyhedron.cpp | 4 +- .../edge_collapse_envelope.cpp | 4 +- .../edge_collapse_garland_heckbert.cpp | 8 ++- .../edge_collapse_linear_cell_complex.cpp | 4 +- .../edge_collapse_polyhedron.cpp | 4 +- .../edge_collapse_surface_mesh.cpp | 4 +- .../edge_collapse_visitor_surface_mesh.cpp | 4 +- .../Count_ratio_stop_predicate.h | 36 ++++-------- .../Edge_collapse/Count_stop_predicate.h | 36 ++++-------- .../Edge_count_ratio_stop_predicate.h | 52 +++++++++++++++++ .../Edge_collapse/Edge_count_stop_predicate.h | 50 +++++++++++++++++ .../Face_count_ratio_stop_predicate.h | 56 +++++++++++++++++++ .../Edge_collapse/Face_count_stop_predicate.h | 52 +++++++++++++++++ .../test/Surface_mesh_simplification/basics.h | 3 +- ...e_collapse_garland_heckbert_variations.cpp | 4 +- .../edge_collapse_topology.cpp | 4 +- .../test_edge_collapse_Envelope.cpp | 4 +- .../test_edge_collapse_Polyhedron_3.cpp | 2 +- .../test_edge_collapse_bounded_distance.cpp | 4 +- 35 files changed, 492 insertions(+), 101 deletions(-) create mode 100644 Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h create mode 100644 Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h create mode 100644 Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h create mode 100644 Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h create mode 100644 Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h create mode 100644 Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h create mode 100644 Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h create mode 100644 Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp index c8913412da2..31f46ffc2fb 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -25,7 +25,7 @@ typedef Scene_facegraph_item::Face_graph FaceGraph; class Custom_stop_predicate { bool m_and; - CGAL::Surface_mesh_simplification::Count_stop_predicate m_count_stop; + CGAL::Surface_mesh_simplification::Edge_count_stop_predicate m_count_stop; CGAL::Surface_mesh_simplification::Edge_length_stop_predicate m_length_stop; public: diff --git a/Surface_mesh/benchmark/polyhedron_performance.h b/Surface_mesh/benchmark/polyhedron_performance.h index 6229adb0007..b4de8bd6b6d 100644 --- a/Surface_mesh/benchmark/polyhedron_performance.h +++ b/Surface_mesh/benchmark/polyhedron_performance.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -461,7 +461,7 @@ private: ) vb->id() = index++; - SMS::Count_ratio_stop_predicate stop(0.1); + SMS::Edge_count_ratio_stop_predicate stop(0.1); int r = SMS::edge_collapse(P, stop); #endif } diff --git a/Surface_mesh/benchmark/surface_mesh_performance.h b/Surface_mesh/benchmark/surface_mesh_performance.h index 9ab57e28c9a..e310a6f4400 100644 --- a/Surface_mesh/benchmark/surface_mesh_performance.h +++ b/Surface_mesh/benchmark/surface_mesh_performance.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include typedef CGAL::Simple_cartesian K; @@ -284,7 +284,7 @@ private: mesh.clear(); bool b = CGAL::IO::read_OFF(_filename, mesh); - SMS::Count_ratio_stop_predicate stop(0.1); + SMS::Edge_count_ratio_stop_predicate stop(0.1); int r = SMS::edge_collapse(mesh, stop); } diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h index 8ffe08d081a..5825ac62f5b 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h @@ -5,6 +5,8 @@ namespace Surface_mesh_simplification { /*! \ingroup PkgSurfaceMeshSimplificationRef +\deprecated + The class `Count_ratio_stop_predicate` is a model for the `StopPredicate` concept which returns `true` when the relation between the initial and current number of edges drops below a certain ratio. @@ -12,8 +14,8 @@ which returns `true` when the relation between the initial and current number of \cgalModels `StopPredicate` -\sa `CGAL::Surface_mesh_simplification::Count_stop_predicate` - +\sa `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` */ template< typename TriangleMesh> class Count_ratio_stop_predicate @@ -34,7 +36,7 @@ public: /// @{ /*! - Returns `((double)current_edge_count / (double)initial_edge_count) < ratio`. + Returns `(double(current_edge_count) / double(initial_edge_count)) < ratio`. All other parameters are ignored (but exist since this is a generic policy). */ bool operator()(const Edge_profile::FT current_cost, diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h index 7e6deb0254a..452302a0634 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h @@ -4,6 +4,8 @@ namespace Surface_mesh_simplification { /*! \ingroup PkgSurfaceMeshSimplificationRef +\deprecated + The class `Count_stop_predicate` is a model for the `StopPredicate` concept, which returns `true` when the number of current edges drops below a certain threshold. @@ -11,8 +13,8 @@ which returns `true` when the number of current edges drops below a certain thre \cgalModels `StopPredicate` -\sa `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` - +\sa `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` */ template class Count_stop_predicate diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..31da80779c6 --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h @@ -0,0 +1,50 @@ + +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Edge_count_ratio_stop_predicate` is a model for the `StopPredicate` concept +which returns `true` when the relation between the initial and current number of edges drops below a certain ratio. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` +*/ +template< typename TriangleMesh> +class Edge_count_ratio_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `ratio`. + */ + Edge_count_ratio_stop_predicate(const double ratio); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `(double(current_edge_count) / double(initial_edge_count)) < ratio`. + All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h new file mode 100644 index 00000000000..6e3920dd421 --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h @@ -0,0 +1,48 @@ +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Edge_count_stop_predicate` is a model for the `StopPredicate` concept, +which returns `true` when the number of current edges drops below a certain threshold. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Edge_ratio_count_stop_predicate` +*/ +template +class Edge_count_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `threshold` value. + */ + Edge_count_stop_predicate(const Edge_profile::edges_size_type threshold); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `(current_edge_count < threshold)`. All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT& current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..82cfdf2e62e --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h @@ -0,0 +1,51 @@ + +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Face_count_ratio_stop_predicate` is a model for the `StopPredicate` concept +which returns `true` when the relation between the initial and current number of edges drops below a certain ratio. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` +*/ +template< typename TriangleMesh> +class Face_count_ratio_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `ratio`. + */ + Face_count_ratio_stop_predicate(const double ratio, const TriangleMesh& tmesh); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `true` if the ratio of current face count over initial face count is strictly smaller than `ratio`, + and `false` otherwise. + All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h new file mode 100644 index 00000000000..8c35a5c35e7 --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h @@ -0,0 +1,49 @@ +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Face_count_stop_predicate` is a model for the `StopPredicate` concept, +which returns `true` when the number of current faces drops below a certain threshold. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` +*/ +template +class Face_count_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `threshold` value. + */ + Face_count_stop_predicate(const Edge_profile::edges_size_type threshold); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `true` if the current face count is strictly smaller than `threshold`, and `false` otherwise. + All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT& current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h index b24bc09c99e..ad5f22d4ccb 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h @@ -4,8 +4,10 @@ The concept `StopPredicate` describes the requirements for the predicate which indicates if the simplification process must finish. -\cgalHasModel `CGAL::Surface_mesh_simplification::Count_stop_predicate` -\cgalHasModel `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` \cgalHasModel `CGAL::Surface_mesh_simplification::Edge_length_stop_predicate` */ diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt b/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt index f29f913fc0a..1d97e670f9d 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt @@ -34,8 +34,12 @@ - `CGAL::Surface_mesh_simplification::edge_collapse()` \cgalCRPSection{Policies} -- `CGAL::Surface_mesh_simplification::Count_stop_predicate` -- `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` +- `CGAL::Surface_mesh_simplification::Count_stop_predicate` (deprecated) +- `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` (deprecated) +- `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +- `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +- `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +- `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` - `CGAL::Surface_mesh_simplification::Edge_length_stop_predicate` - `CGAL::Surface_mesh_simplification::Edge_length_cost` - `CGAL::Surface_mesh_simplification::Midpoint_placement` diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp index ae8c50b4c45..7612d7436e2 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp @@ -5,7 +5,7 @@ // Simplification function #include -#include +#include #include #include @@ -70,7 +70,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000) const std::size_t stop_n = (argc > 2) ? std::stoi(argv[2]) : 1000; - SMS::Count_stop_predicate stop(stop_n); + SMS::Edge_count_stop_predicate stop(stop_n); // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp index e8d0ba8ba1b..88eb9b986e7 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number const std::size_t stop_n = (argc > 2) ? std::stoi(argv[2]) : num_halfedges(surface_mesh)/2 - 1; - SMS::Count_stop_predicate stop(stop_n); + SMS::Edge_count_stop_predicate stop(stop_n); typedef SMS::LindstromTurk_placement Placement; diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp index 678087c38b2..f40a35faeae 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -121,7 +121,7 @@ int main(int argc, char** argv) std::cerr << "# sharp edges = " << nb_sharp_edges << std::endl; // Contract the surface mesh as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); std::cout << "Collapsing as many non-sharp edges of mesh: " << filename << " as possible..." << std::endl; int r = SMS::edge_collapse(surface_mesh, stop, diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp index 9c50a593725..1fcb9ce4e05 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp @@ -11,7 +11,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -78,7 +78,7 @@ int main(int argc, char** argv) } // Contract the surface mesh as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); Border_is_constrained_edge_map bem(surface_mesh); // This the actual call to the simplification algorithm. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp index b60753cddfc..4d3418e9abe 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp @@ -11,7 +11,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -77,7 +77,7 @@ int main(int argc, char** argv) } // Contract the surface mesh as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); Border_is_constrained_edge_map bem(surface_mesh); // This the actual call to the simplification algorithm. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp index d8b574b241f..a48e1833bb3 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below xx% of the initial count const double ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); // The index maps are not explicitelty passed as in the previous // example because the surface mesh items have a proper id() field. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp index 6b8ee4e8902..7fc05ffc8b8 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp @@ -3,7 +3,7 @@ #include -#include +#include #include #include #include @@ -33,7 +33,7 @@ int main(int argc, char** argv) std::ifstream is(argc > 1 ? argv[1] : CGAL::data_file_path("meshes/helmet.off")); is >> mesh; - SMS::Count_stop_predicate stop(0); // go as far as you can while in the envelope + SMS::Edge_count_stop_predicate stop(0); // go as far as you can while in the envelope CGAL::Iso_cuboid_3 bbox(CGAL::Polygon_mesh_processing::bbox(mesh)); 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 ef14f4f94ba..8a70a30d560 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 @@ -1,11 +1,13 @@ #include #include -#include +#include #include #include #include +#include + #include #include #include @@ -29,13 +31,13 @@ void collapse_gh(Surface_mesh& mesh, { std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now(); - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); // Garland&Heckbert simplification policies typedef typename GHPolicies::Get_cost GH_cost; typedef typename GHPolicies::Get_placement GH_placement; - typedef SMS::Bounded_normal_change_placement Bounded_GH_placement; + typedef SMS::Bounded_normal_change_placement Bounded_GH_placement; GHPolicies gh_policies(mesh); const GH_cost& gh_cost = gh_policies.get_cost(); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp index 3528fb06646..4bedf34619a 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp @@ -4,7 +4,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -42,7 +42,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000 by default) const std::size_t edge_count_treshold = (argc > 2) ? std::stoi(argv[2]) : 1000; - SMS::Count_stop_predicate stop(edge_count_treshold); + SMS::Edge_count_stop_predicate stop(edge_count_treshold); // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp index a46b5ab76db..712afa46742 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp @@ -5,7 +5,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -36,7 +36,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000) const std::size_t edge_count_treshold = (argc > 2) ? std::stoi(argv[2]) : 1000; - SMS::Count_stop_predicate stop(edge_count_treshold); + SMS::Edge_count_stop_predicate stop(edge_count_treshold); // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index d0bce9ca051..d21417d9829 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -36,7 +36,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below 10% of the initial count double stop_ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; - SMS::Count_ratio_stop_predicate stop(stop_ratio); + SMS::Edge_count_ratio_stop_predicate stop(stop_ratio); int r = SMS::edge_collapse(surface_mesh, stop); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp index 2568e555755..f0b747108a6 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp @@ -8,7 +8,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -112,7 +112,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below xx% of the initial count const double ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); Stats stats; My_visitor vis(&stats); diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h index 3d97e16e490..ec8f2a3a225 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h @@ -13,40 +13,24 @@ #include -#include -#include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include + +#ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { namespace Surface_mesh_simplification { // Stops when the ratio of initial to current number of edges is below some value. template -class Count_ratio_stop_predicate -{ -public: - typedef TM_ TM; - typedef typename boost::graph_traits::edges_size_type size_type; - - Count_ratio_stop_predicate(const double ratio) - : m_ratio(ratio) - { - CGAL_warning(0. < ratio && ratio <= 1.); - } - - template - bool operator()(const F& /*current_cost*/, - const Profile& /*profile*/, - size_type initial_edge_count, - size_type current_edge_count) const - { - return (static_cast(current_edge_count) / static_cast(initial_edge_count)) < m_ratio; - } - -private: - double m_ratio; -}; +using Count_ratio_stop_predicate = CGAL_DEPRECATED Edge_count_ratio_stop_predicate; } // namespace Surface_mesh_simplification } // namespace CGAL +#endif // CGAL_NO_DEPRECATED_CODE + #endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_COUNT_RATIO_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h index 0fea930b44a..c72b0bafea2 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h @@ -13,38 +13,24 @@ #include -#include -#include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include + +#ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { namespace Surface_mesh_simplification { -// Stops when the number of edges falls below a given number. +// Stops when the number of edges left falls below a given number. template -class Count_stop_predicate -{ -public: - typedef TM_ TM; - typedef typename boost::graph_traits::edges_size_type size_type; - - Count_stop_predicate(const std::size_t edge_count_threshold) - : m_edge_count_threshold(edge_count_threshold) - { } - - template - bool operator()(const F& /*current_cost*/, - const Profile& /*profile*/, - std::size_t /*initial_edge_count*/, - std::size_t current_edge_count) const - { - return current_edge_count < m_edge_count_threshold; - } - -private: - std::size_t m_edge_count_threshold; -}; +using Count_stop_predicate = CGAL_DEPRECATED Edge_count_stop_predicate; } // namespace Surface_mesh_simplification } // namespace CGAL +#endif // CGAL_NO_DEPRECATED_CODE + #endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..0642d1644b0 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h @@ -0,0 +1,52 @@ +// Copyright (c) 2006 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_EDGE_COUNT_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_EDGE_COUNT_STOP_PREDICATE_H + +#include + +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the ratio of initial to current number of edges is below some value. +template +class Edge_count_ratio_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::edges_size_type size_type; + + Edge_count_ratio_stop_predicate(const double ratio) + : m_ratio(ratio) + { + CGAL_warning(0. < ratio && ratio <= 1.); + } + + template + bool operator()(const F& /*current_cost*/, + const Profile& /*profile*/, + size_type initial_edge_count, + size_type current_edge_count) const + { + return (static_cast(current_edge_count) / static_cast(initial_edge_count)) < m_ratio; + } + +private: + double m_ratio; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_EDGE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h new file mode 100644 index 00000000000..aa3de2159a9 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h @@ -0,0 +1,50 @@ +// Copyright (c) 2006 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_STOP_PREDICATE_H + +#include + +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the number of edges falls below a given number. +template +class Edge_count_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::edges_size_type size_type; + + Edge_count_stop_predicate(const std::size_t edge_count_threshold) + : m_edge_count_threshold(edge_count_threshold) + { } + + template + bool operator()(const F& /*current_cost*/, + const Profile& /*profile*/, + std::size_t /*initial_edge_count*/, + std::size_t current_edge_count) const + { + return current_edge_count < m_edge_count_threshold; + } + +private: + std::size_t m_edge_count_threshold; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..383d389d2a3 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h @@ -0,0 +1,56 @@ +// Copyright (c) 2006 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_EDGE_FACE_COUNT_RATIO_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_EDGE_FACE_COUNT_RATIO_STOP_PREDICATE_H + +#include + +#include +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the ratio of initial to current number of edges is below some value. +template +class Face_count_ratio_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::edges_size_type size_type; + + Face_count_ratio_stop_predicate(const double ratio, + const TM& tmesh) + : m_ratio(ratio), m_initial_face_count(CGAL::internal::exact_num_faces(tmesh)) + { + CGAL_warning(0. < ratio && ratio <= 1.); + } + + template + bool operator()(const F& /*current_cost*/, + const Profile& profile, + size_type /*initial_edge_count*/, + size_type /*current_edge_count*/) const + { + const std::size_t current_face_count = CGAL::internal::exact_num_faces(profile.surface_mesh()); + return (static_cast(current_face_count) / static_cast(m_initial_face_count)) < m_ratio; + } + +private: + const double m_ratio; + const std::size_t m_initial_face_count; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_EDGE_FACE_COUNT_RATIO_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h new file mode 100644 index 00000000000..873cac7c320 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h @@ -0,0 +1,52 @@ +// Copyright (c) 2006 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_STOP_PREDICATE_H + +#include + +#include +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the number of faces falls below a given number. +template +class Face_count_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::faces_size_type size_type; + + Face_count_stop_predicate(const std::size_t face_count_threshold) + : m_face_count_threshold(face_count_threshold) + { } + + template + bool operator()(const F& /*current_cost*/, + const Profile& profile, + std::size_t /*initial_edge_count*/, + std::size_t /*current_edge_count*/) const + { + const std::size_t current_face_count = CGAL::internal::exact_num_faces(profile.surface_mesh()); + return (current_face_count < m_face_count_threshold); + } + +private: + std::size_t m_face_count_threshold; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h b/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h index 703a7f4c194..e1363e7fed6 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h @@ -32,7 +32,8 @@ void Surface_simplification_external_trace(std::string s) #include #include #include -#include +#include +#include #include #include diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp index 9b7bd975503..32505153d06 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -102,7 +102,7 @@ Surface_mesh edge_collapse(Surface_mesh& mesh, const Cost& cost = p.get_cost(); const Placement& unbounded_placement = p.get_placement(); Bounded_placement bounded_placement(unbounded_placement); - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); std::chrono::time_point start_time = std::chrono::steady_clock::now(); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp index 5e0ab17d1d6..d52a8e1daa1 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp @@ -8,7 +8,7 @@ #include // Stop-condition policy -#include +#include typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Polyhedron_3 Surface; @@ -36,7 +36,7 @@ int main(int argc, char** argv) std::cout << "Initial count " << initial_count << " edges.\n"; // Contract the surface as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); int r = SMS::edge_collapse (surface diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp index d7228a1406a..cb52e089ede 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include #include @@ -96,7 +96,7 @@ int main(int argc, char** argv) std::ifstream is(argc > 1 ? argv[1] : "data/helmet.off"); is >> input_mesh; - SMS::Count_stop_predicate stop(0); // go as far as you can while in the envelope + SMS::Edge_count_stop_predicate stop(0); // go as far as you can while in the envelope Stats stats; My_visitor vis(&stats); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index 7c641c5eb69..b81c477049c 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -378,7 +378,7 @@ bool Test (string aName) set_halfedgeds_items_id(lSurface); - SMS::Count_stop_predicate stop(sStop); + SMS::Edge_count_stop_predicate stop(sStop); Real_timer t; t.start(); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp index 0764b881fe1..f6cd535bf50 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp @@ -4,7 +4,7 @@ // Simplification function #include #include -#include +#include #include #include @@ -42,7 +42,7 @@ int main(int argc, char** argv) std::ifstream is(argc > 1 ? argv[1] : "data/helmet.off"); is >> ref_mesh; - SMS::Count_stop_predicate stop(num_halfedges(ref_mesh)/10); + SMS::Edge_count_stop_predicate stop(num_halfedges(ref_mesh)/10); std::cout << "input has " << num_vertices(ref_mesh) << " vertices." << std::endl; CGAL::Iso_cuboid_3 bbox(CGAL::Polygon_mesh_processing::bbox(ref_mesh));