From daf9add03a2af7185f2e9018dde2206515f6fe9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 5 Oct 2022 16:39:56 +0200 Subject: [PATCH] fix after review --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 2 - Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 28 ++++--------- Mesh_3/include/CGAL/exude_mesh_3.h | 40 +++++++++---------- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 8 ++-- .../include/CGAL/optimize_periodic_3_mesh_3.h | 2 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 4 +- 6 files changed, 34 insertions(+), 50 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 18e48b2af45..8a37d7226a2 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -15,8 +15,6 @@ #include -#include - #include #include #include diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index d7f68d9e73d..5571067fb91 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -116,16 +116,11 @@ unspecified_type exude(const Named_function_parameters& np = parameters::default /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::features()` can be used to specify - * that 0 and 1-dimensional features have to be taken into account. - * The provided value is a default value that triggers the representation - * of corners and curves in the mesh when the domain is a model + * Provides an option indicating that 0 and 1-dimensional features + * have to be taken into account (the domain must be a model of `MeshDomainWithFeatures_3`). + * This is the default behavior when the domain is a model * of `MeshDomainWithFeatures_3`. * - * Provides a `Features_options` value such that - * 0 and 1-dimensional input features are taken into account - * if domain is a model of the refined concept `MeshDomainWithFeatures_3`. - * * \sa `CGAL::make_mesh_3()` * \sa `CGAL::refine_mesh_3()` * \sa `CGAL::parameters::no_features()` @@ -199,7 +194,7 @@ unspecified_type features(); * refine_mesh_3(c3t3, * domain, * criteria, - * parameters::lloyd(parameters::time_limit=10)); + * parameters::lloyd(parameters::time_limit(10))); * * \endcode * @@ -238,15 +233,8 @@ unspecified_type no_exude(); /*! * \ingroup PkgMesh3Parameters * - * The function `parameters::no_features()` allows the user to prevent the handling - * of 0 and 1-dimensional features. This is useful when the - * domain is a model of `MeshDomainWithFeatures_3` - * and the user does not want corners and curves - * to be accurately represented - * in the mesh. - * - * Returns a `Features_options` value that prevents the mesh generator - * to take into account 0 and 1-dimensional input features. + * Provides an option indicating no special treatment should be done + * with 0 and 1-dimensional features. * * \sa `CGAL::make_mesh_3()` * \sa `CGAL::refine_mesh_3()` @@ -392,7 +380,7 @@ unspecified_type no_perturb(); * refine_mesh_3(c3t3, * domain, * criteria, - * parameters::odt(parameters::time_limit=10)); + * parameters::odt(parameters::time_limit(10))); * \endcode * * \sa `CGAL::parameters::no_odt()` @@ -450,7 +438,7 @@ unspecified_type odt(const Named_function_parameters& np = parameters::default_v * refine_mesh_3(c3t3, * domain, * criteria, - * parameters::perturb(parameters::time_limit=10)); + * parameters::perturb(parameters::time_limit(10))); * * \endcode * diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 02cccf39ed0..35cdf3cc187 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -19,8 +19,6 @@ #include -#include - #include #include #include @@ -82,7 +80,7 @@ namespace CGAL { * \code{.cpp} * // Exude without sliver_bound, using at most 10s CPU time * exude_mesh_3(c3t3, - * parameters::time_limit=10); + * parameters::time_limit(10)); * \endcode * * \sa `CGAL::Mesh_optimization_return_code` @@ -96,11 +94,11 @@ namespace CGAL { template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - int time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double sliver_bound= choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),parameters::default_values_for_mesh_3::exude_sliver_bound); - return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); + using parameters::choose_parameter; + using parameters::get_parameter; + int time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double sliver_bound= choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),parameters::default_values_for_mesh_3::exude_sliver_bound); + return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } #ifndef CGAL_NO_DEPRECATED_CODE @@ -131,23 +129,23 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS_1& n template Mesh_optimization_return_code exude_mesh_3_impl(C3T3& c3t3, - const double time_limit, - const double sliver_bound) + const double time_limit, + const double sliver_bound) { - typedef typename C3T3::Triangulation Tr; - typedef Mesh_3::Min_dihedral_angle_criterion Sc; - //typedef Mesh_3::Radius_radio_criterion Sc; - typedef typename Mesh_3::Slivers_exuder Exuder; + typedef typename C3T3::Triangulation Tr; + typedef Mesh_3::Min_dihedral_angle_criterion Sc; + //typedef Mesh_3::Radius_radio_criterion Sc; + typedef typename Mesh_3::Slivers_exuder Exuder; - // Create exuder - Sc criterion(sliver_bound, c3t3.triangulation()); - Exuder exuder(c3t3, criterion); + // Create exuder + Sc criterion(sliver_bound, c3t3.triangulation()); + Exuder exuder(c3t3, criterion); - // Set time_limit - exuder.set_time_limit(time_limit); + // Set time_limit + exuder.set_time_limit(time_limit); - // Launch exudation - return exuder(); + // Launch exudation + return exuder(); } #endif //DOXYGEN_RUNNING diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 7270704578b..7c5bdb8766a 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -121,9 +121,9 @@ namespace CGAL { * // move less than 0.001*shortest_incident_edge_length * lloyd_optimize_mesh_3(c3t3, * domain, - * parameters::convergence=0.01, - * parameters::freeze_bound=0.001, - * parameters::do_freeze=true); + * parameters::convergence(0.01). + * parameters::freeze_bound(0.001). + * parameters::do_freeze(true)); * * \endcode * @@ -142,7 +142,7 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& doma using parameters::choose_parameter; using parameters::get_parameter; int max_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 0); - const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), 0.001); + const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), 0.02); const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), 0.001); const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), 0.); bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); diff --git a/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h index 6c2c0fc4af0..ca3c3020ac6 100644 --- a/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h @@ -185,7 +185,7 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD using parameters::choose_parameter; using parameters::get_parameter; int max_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 0); - const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), 0.001); + const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), 0.02); const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), 0.001); const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), 0.); bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); diff --git a/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h index 919d1b43e3e..f47a1a3acc9 100644 --- a/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h @@ -310,8 +310,8 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit { using parameters::choose_parameter; using parameters::get_parameter; - parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::no_exude().v); - parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::no_perturb().v); + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt().v); parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd().v); bool reset = choose_parameter(get_parameter(np, internal_np::do_reset_c3t3), false);