From 18039c7a710ef59891c791bb4fa50556ead5c556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sat, 4 Jun 2022 10:51:50 +0200 Subject: [PATCH 001/248] add overload using named function parameters freeze_bound is still commented for now as the conflict with boost parameters must be handled --- .../doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h | 119 -------- Mesh_2/doc/Mesh_2/Doxyfile.in | 1 + Mesh_2/doc/Mesh_2/dependencies | 1 + Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 259 +++++++++++++++++- .../test/Mesh_3/data/c3t3_io-homo.binary.cgal | Bin 1360 -> 0 bytes .../internal/parameters_interface.h | 9 + 6 files changed, 266 insertions(+), 123 deletions(-) delete mode 100644 Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h delete mode 100644 Mesh_3/test/Mesh_3/data/c3t3_io-homo.binary.cgal diff --git a/Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h deleted file mode 100644 index 060cb8994e8..00000000000 --- a/Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h +++ /dev/null @@ -1,119 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh2Functions - -The function `lloyd_optimize_mesh_2()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_2()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_2()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are not moved. - -\tparam CDT is required to be or derive from `CGAL::Constrained_Delaunay_triangulation_2`, -with vertex base and face base of its underlying `TriangulationDataStructure_2` -being models of `DelaunayMeshVertexBase_2` and `DelaunayMeshFaceBase_2`, respectively. -The argument `cdt`, passed by reference, provides the initial mesh -and is modified by the algorithm to represent the final optimized mesh. - -\tparam PointIterator must be an iterator with value type `Kernel::Point_2` - -The function has several optional parameters which are named parameters -(we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `CGAL::Timer`. -The default value is 0 and means that there is no time limit. -\pre `time_limit` \f$ \geq\f$ 0 - -- `parameters::%max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. -\pre `max_iteration_number`\f$ \geq\f$ 0 - -- `parameters::%convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given fraction of the -length of the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. -\pre 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 - -- `parameters::freeze_bound` is designed to reduce running time of each -optimization iteration. Any vertex that has a displacement less than a given -fraction of the length of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. -The default value is 0.001. If it is set to 0, freezing of vertices is disabled. -\pre 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -- `parameters::seeds_begin` and `parameters::seeds_end` -are begin and end input iterators to iterate on seed points. -The sequence [`parameters::seeds_begin`, `parameters::seeds_end`) -defines the domain in which the mesh was generated, and should be optimized. - -- `parameters::mark`. If `mark` is set to true, the mesh domain -is the union of the bounded connected components including at least one seed. -If `mark` is false, the domain is the union of the bounded components including -no seed. Note that the unbounded component of the plane is never optimized. -The default value is false. - - - - -\return -The function `lloyd_optimize_mesh_2()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: - - -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// move less than 0.001*shortest_incident_edge_length -lloyd_optimize_mesh_2(cdt, - parameters::convergence=0.01, - parameters::freeze_bound=0.001); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::refine_Delaunay_mesh_2()` - -*/ - -template -CGAL::Mesh_optimization_return_code -lloyd_optimize_mesh_2(CDT& cdt, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.001, - double parameters::freeze_bound = 0.001, - PointIterator parameters::seeds_begin = PointIterator(), - PointIterator parameters::seeds_end = PointIterator(), - bool parameters::mark = false); - -} /* namespace CGAL */ diff --git a/Mesh_2/doc/Mesh_2/Doxyfile.in b/Mesh_2/doc/Mesh_2/Doxyfile.in index 06825acdea6..61cfe8b2960 100644 --- a/Mesh_2/doc/Mesh_2/Doxyfile.in +++ b/Mesh_2/doc/Mesh_2/Doxyfile.in @@ -1,3 +1,4 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 2D Conforming Triangulations and Meshes" +INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_2.h \ No newline at end of file diff --git a/Mesh_2/doc/Mesh_2/dependencies b/Mesh_2/doc/Mesh_2/dependencies index 696bf34e1fb..0c0f7765312 100644 --- a/Mesh_2/doc/Mesh_2/dependencies +++ b/Mesh_2/doc/Mesh_2/dependencies @@ -5,3 +5,4 @@ Algebraic_foundations Circulator Stream_support Triangulation_2 +BGL diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 56f9d84b16e..e8b939d634e 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -25,22 +25,146 @@ #include #include +#include + #include +#ifndef DOXYGEN_RUNNING // see CGAL_PRAGMA_DIAG_PUSH // see CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - +#endif namespace CGAL { +/*! + * @ingroup PkgMesh2Functions + * + * The function `lloyd_optimize_mesh_2()` is a mesh optimization process + * based on the minimization of a global energy function. + * + * In `lloyd_optimize_mesh_2()`, the minimized global energy may be interpreted + * as the \f$ L^1\f$-norm of the error achieved + * when the function \f$ x^2\f$ is interpolated on the mesh domain + * using a piecewise linear function which is linear + * in each cell of the Voronoi diagram of the mesh vertices. + * + * The optimizer `lloyd_optimize_mesh_2()` works in iterative steps. + * At each iteration, mesh vertices are moved into + * positions that bring to zero the energy gradient + * and the Delaunay triangulation is updated. + * Vertices on the mesh boundaries are not moved. + * + * @tparam CDT is required to be or derive from `CGAL::Constrained_Delaunay_triangulation_2`, + * with vertex base and face base of its underlying `TriangulationDataStructure_2` + * being models of `DelaunayMeshVertexBase_2` and `DelaunayMeshFaceBase_2`, respectively. + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param cdt the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{seeds} + * \cgalParamDescription{2D points used to define the domain to mesh. + * If `seeds_are_in_domain==true`, the mesh domain is the union of + * the bounded connected components including at least + * one seed. If `seeds_are_in_domain==false`, the domain is the + * union of the bounded components including no seed.} + * \cgalParamType{a class model of `ConstRange` with iterator being a model of `InputIterator` with `CDT::Point_2` as value type.} + * \cgalParamDefault{No seed.} + * \cgalParamNEnd + * + * \cgalParamNBegin{seeds_are_in_domain} + * \cgalParamDescription{specified if seeds indicates bounded connected components inside or outside of the domain.} + * \cgalParamType{`bool`} + * \cgalParamDefault{false} + * \cgalParamNEnd + * + * \cgalParamNBegin{number_of_iterations} + * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamExtra{\pre `number_of_iterations >=0`} + * \cgalParamType{`int`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * + * \cgalParamNBegin{maximum_running_time} + * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + * This time is measured using `CGAL::Timer`. 0 means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `maximum_running_time` \f$ \geq\f$ 0} + * \cgalParamDefault{0} + * \cgalParamNEnd + * + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{designed to reduce running time of each optimization iteration. + * Any vertex that has a displacement less than a given fraction of the length + * of its shortest incident edge, is frozen (i.e.\ is not relocated). + * The parameter `freeze_bound` gives the threshold ratio. + * If it is set to 0, freezing of vertices is disabled.} + * \cgalParamExtra{\pre `0<= freeze_bound <=1} + * \cgalParamType{`double`} + * \cgalParamDefault{0.001} + * \cgalParamNEnd + * + * \cgalParamNBegin{convergence_ratio} + * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + * when at the last iteration the displacement of any vertex is less than + * a given fraction of the length of the shortest edge incident to that vertex.} + * \cgalParamExtra{\pre `0 <=convergence <= 1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.001} + * \cgalParamNEnd + * + * \cgalNamedParamsEnd + * + * @returns an enum value providing some information about the outcome of the algorithm. + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::refine_Delaunay_mesh_2()` + */ +template +Mesh_optimization_return_code +lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + using parameters::get_parameter_reference; + + 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 freeze_bound = 0.001; /* choose_parameter(get_parameter(np, internal_np::freeze_bound), 0.001); */ + const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), 0.); + // Seeds + // { + typedef std::vector Default_seeds; + typedef typename internal_np::Lookup_named_param_def::reference Seeds; + Default_seeds ds; + Seeds seeds = choose_parameter(get_parameter_reference(np, internal_np::seeds), ds); + // } + const bool mark = choose_parameter(get_parameter(np, internal_np::seeds_are_in_domain), false); + + return lloyd_optimize_mesh_2_impl(cdt, + max_iterations, + convergence_ratio, + freeze_bound, + time_limit, + seeds.begin(), + seeds.end(), + mark); +} + +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE #if defined(BOOST_MSVC) # pragma warning(push) # pragma warning(disable:4003) // not enough actual parameters for macro #endif - + // TODO: check how to use CGAL_DEPRECATED here BOOST_PARAMETER_FUNCTION( (Mesh_optimization_return_code), lloyd_optimize_mesh_2, @@ -71,6 +195,8 @@ namespace CGAL # pragma warning(pop) #endif +#endif // CGAL_NO_DEPRECATED_CODE + /** * this partial specialization is a workaround * to avoid compilation errors when seeds_begin and seeds_end are @@ -140,10 +266,135 @@ namespace CGAL return rc; } -} //end namespace CGAL - CGAL_PRAGMA_DIAG_POP #include +#else + +namespace CGAL { + +/*! +\ingroup PkgMesh2Functions + +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `lloyd_optimize_mesh_2()` is a mesh optimization process +based on the minimization of a global energy function. + +In `lloyd_optimize_mesh_2()`, the minimized global energy may be interpreted +as the \f$ L^1\f$-norm of the error achieved +when the function \f$ x^2\f$ is interpolated on the mesh domain +using a piecewise linear function which is linear +in each cell of the Voronoi diagram of the mesh vertices. + +The optimizer `lloyd_optimize_mesh_2()` works in iterative steps. +At each iteration, mesh vertices are moved into +positions that bring to zero the energy gradient +and the Delaunay triangulation is updated. +Vertices on the mesh boundaries are not moved. + +\tparam CDT is required to be or derive from `CGAL::Constrained_Delaunay_triangulation_2`, +with vertex base and face base of its underlying `TriangulationDataStructure_2` +being models of `DelaunayMeshVertexBase_2` and `DelaunayMeshFaceBase_2`, respectively. +The argument `cdt`, passed by reference, provides the initial mesh +and is modified by the algorithm to represent the final optimized mesh. + +\tparam PointIterator must be an iterator with value type `Kernel::Point_2` + +The function has several optional parameters which are named parameters +(we use the Boost.Parameter library). +Therefore, when calling the function, the parameters can be provided in any order +provided that the names of the parameters are used +(see example at the bottom of this page). + +\cgalHeading{Named Parameters} + +- `parameters::time_limit` +is used to set up, in seconds, +a CPU time limit after which the optimization process is stopped. This time is +measured using `CGAL::Timer`. +The default value is 0 and means that there is no time limit. +\pre `time_limit` \f$ \geq\f$ 0 + +- `parameters::%max_iteration_number` sets a limit on the +number of performed iterations. The default value of 0 means that there is +no limit on the number of performed iterations. +\pre `max_iteration_number`\f$ \geq\f$ 0 + +- `parameters::%convergence` is a stopping criterion based on convergence: +the optimization process is stopped, when at the last iteration, +the displacement of any vertex is less than a given fraction of the +length of the shortest edge incident to that vertex. +The parameter `convergence` gives the threshold ratio. +\pre 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 + +- `parameters::freeze_bound` is designed to reduce running time of each +optimization iteration. Any vertex that has a displacement less than a given +fraction of the length of its shortest incident edge, is frozen (i.e.\ is +not relocated). The parameter `freeze_bound` gives the threshold ratio. +The default value is 0.001. If it is set to 0, freezing of vertices is disabled. +\pre 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 + +- `parameters::seeds_begin` and `parameters::seeds_end` +are begin and end input iterators to iterate on seed points. +The sequence [`parameters::seeds_begin`, `parameters::seeds_end`) +defines the domain in which the mesh was generated, and should be optimized. + +- `parameters::mark`. If `mark` is set to true, the mesh domain +is the union of the bounded connected components including at least one seed. +If `mark` is false, the domain is the union of the bounded components including +no seed. Note that the unbounded component of the plane is never optimized. +The default value is false. + + + + +\return +The function `lloyd_optimize_mesh_2()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_2()` stops because it has performed `max_iteration_number` iterations. +
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_2()` stops because the convergence criterion +is met. +
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the +`freeze_bound` parameter is set to a positive value. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_2()` stops because +most vertices have been frozen, and no better convergence can be reached. +
+ +\cgalHeading{Example} + + +\code{.cpp} +// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which +// move less than 0.001*shortest_incident_edge_length +lloyd_optimize_mesh_2(cdt, + parameters::convergence=0.01, + parameters::freeze_bound=0.001); + +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::refine_Delaunay_mesh_2()` + +*/ + +template +CGAL::Mesh_optimization_return_code +lloyd_optimize_mesh_2(CDT& cdt, + double parameters::time_limit=0, + std::size_t parameters::max_iteration_number=0, + double parameters::convergence=0.001, + double parameters::freeze_bound = 0.001, + PointIterator parameters::seeds_begin = PointIterator(), + PointIterator parameters::seeds_end = PointIterator(), + bool parameters::mark = false); + +} /* namespace CGAL */ + +#endif // DOXYGEN_RUNNING + +} //end namespace CGAL #endif diff --git a/Mesh_3/test/Mesh_3/data/c3t3_io-homo.binary.cgal b/Mesh_3/test/Mesh_3/data/c3t3_io-homo.binary.cgal deleted file mode 100644 index 1eaf9eeda87a677a289f4ff0e277f4bf51276ea0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1360 zcmcJNJxjzu5Qf+9^R%$Au&@Xsl9+U{6wPskjfF_iLL?;TaV|(sjwtxA{Rw7n=Sg(I zN?b@LGw;W|3#n{fECBhH`Ax$b#CkC{6^kI zdXd~!Vg6nfX>4N~CF3fz@ohelL1?3gv&SeJt{G!C+owOrnfpG`8ftaZEmzt%_^IOP z9AVJ$4i(?idZ5*qm6o&7KJM&i`k^(UU-J5lpO-&*gO0b_0&*XBm>*@XC#U1c?p+6T zZ<)!#W8Jles_in5e3JVl(}UyV z+F5a^Hw_JbO{RP|SCl3Gs diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 0162e1db87a..5532ee01100 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -237,3 +237,12 @@ CGAL_add_named_parameter(symmetry_direction_t, symmetry_direction, symmetry_dire CGAL_add_named_parameter(preserve_order_t, preserve_order, preserve_order) CGAL_add_named_parameter(adjust_directions_t, adjust_directions, adjust_directions) CGAL_add_named_parameter(segment_t, segment_map, segment_map) + + +// List of named parameters used in Mesh_2 package +CGAL_add_named_parameter(seeds_t, seeds, seeds) +CGAL_add_named_parameter(domain_is_initialized_t, domain_is_initialized, domain_is_initialized) +CGAL_add_named_parameter(seeds_are_in_domain_t, seeds_are_in_domain, seeds_are_in_domain) +CGAL_add_named_parameter(criteria_t, criteria, criteria) +CGAL_add_named_parameter(convergence_ratio_t, convergence_ratio, convergence_ratio) +// CGAL_add_named_parameter(freeze_bound_t, freeze_bound, freeze_bound) From 111d33bfd2c3422e75ae30d446587ebbd64e1597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sat, 4 Jun 2022 13:52:13 +0200 Subject: [PATCH 002/248] alternative version to use the boost parameter API --- BGL/include/CGAL/boost/parameter.h | 9 --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 80 +++++++------------ .../include/CGAL/Named_function_parameters.h | 49 ++++++++++++ .../internal/parameters_interface.h | 4 +- 4 files changed, 83 insertions(+), 59 deletions(-) diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h index 14ab09b0474..afec98cacb8 100644 --- a/BGL/include/CGAL/boost/parameter.h +++ b/BGL/include/CGAL/boost/parameter.h @@ -78,15 +78,6 @@ BOOST_PARAMETER_NAME( domain ) BOOST_PARAMETER_NAME( criteria ) BOOST_PARAMETER_NAME( cdt ) -BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_) -BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_) -BOOST_PARAMETER_NAME( (mark, tag) mark_) - -BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) -BOOST_PARAMETER_NAME( (convergence, tag) convergence_) -BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) -BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) - BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index e8b939d634e..973b7fc8dc7 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -22,20 +22,11 @@ #include #include #include -#include -#include #include #include -#ifndef DOXYGEN_RUNNING -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS -#endif - namespace CGAL { @@ -98,7 +89,7 @@ namespace CGAL * \cgalParamDefault{0} * \cgalParamNEnd * - * \cgalParamNBegin{freeze_bound} + * \cgalParamNBegin{vertex_freeze_bound} * \cgalParamDescription{designed to reduce running time of each optimization iteration. * Any vertex that has a displacement less than a given fraction of the length * of its shortest incident edge, is frozen (i.e.\ is not relocated). @@ -132,6 +123,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va using parameters::choose_parameter; using parameters::get_parameter; using parameters::get_parameter_reference; + using parameters::is_default_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); @@ -148,47 +140,40 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va // } const bool mark = choose_parameter(get_parameter(np, internal_np::seeds_are_in_domain), false); - return lloyd_optimize_mesh_2_impl(cdt, - max_iterations, - convergence_ratio, - freeze_bound, - time_limit, - seeds.begin(), - seeds.end(), - mark); + if (is_default_parameter::value || + is_default_parameter::value) + { + return lloyd_optimize_mesh_2_impl(cdt, + max_iterations, + convergence_ratio, + freeze_bound, + time_limit, + seeds.begin(), + seeds.end(), + mark); + } + else + { + return lloyd_optimize_mesh_2_impl(cdt, + max_iterations, + convergence_ratio, + freeze_bound, + time_limit, + choose_parameter(get_parameter(np, internal_np::i_seed_begin_iterator), CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::i_seed_end_iterator), CGAL::Emptyset_iterator()), + mark); + } } #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - // TODO: check how to use CGAL_DEPRECATED here - BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - lloyd_optimize_mesh_2, - parameters::tag, - (required (in_out(cdt),*)) - (optional - (max_iteration_number_, *, 0 ) - (convergence_, *, 0.001 ) - (time_limit_, *, 0. ) - (freeze_bound_, *, 0.001 ) - (seeds_begin_, *, CGAL::Emptyset_iterator())//see comments below - (seeds_end_, *, CGAL::Emptyset_iterator())//see comments below - (mark_, *, false) //if "false", seeds indicate "outside" regions - ) - ) + + template + CGAL_DEPRECATED + Mesh_optimization_return_code + lloyd_optimize_mesh_2(CDT& cdt, const NP_PACK& ... nps) { - return lloyd_optimize_mesh_2_impl(cdt, - max_iteration_number_, - convergence_, - freeze_bound_, - time_limit_, - seeds_begin_, - seeds_end_, - mark_); + return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(nps ...)); } #if defined(BOOST_MSVC) @@ -266,9 +251,6 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va return rc; } -CGAL_PRAGMA_DIAG_POP - -#include #else namespace CGAL { diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index a5313c72826..165f46b5a68 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -258,6 +258,20 @@ struct Named_function_parameters } #include #undef CGAL_add_named_parameter + + template + Named_function_parameters + combine(const Named_function_parameters& np) const + { + return Named_function_parameters(np.v,*this); + } + + template + auto + combine(const Named_function_parameters& np, const NPS& ... nps) const + { + return Named_function_parameters(np.v,*this).combine(nps...); + } }; namespace parameters { @@ -295,9 +309,33 @@ inline no_parameters(Named_function_parameters) typedef Named_function_parameters Params;\ return Params(p); \ } + #include #undef CGAL_add_named_parameter +#ifndef CGAL_NO_DEPRECATED_CODE +template +struct Boost_parameter_compatibility_wrapper +{ + template + Named_function_parameters + operator=(const K& p) const + { + typedef Named_function_parameters Params; + return Params(p); + } +}; + +// TODO: need to make sure this works when using several compilation units +const Boost_parameter_compatibility_wrapper max_iteration_number; +const Boost_parameter_compatibility_wrapper convergence; +const Boost_parameter_compatibility_wrapper freeze_bound; +const Boost_parameter_compatibility_wrapper time_limit; +const Boost_parameter_compatibility_wrapper seeds_begin; +const Boost_parameter_compatibility_wrapper seeds_end; +const Boost_parameter_compatibility_wrapper mark_; +#endif + // function to extract a parameter template typename internal_np::Get_param, Query_tag>::type @@ -373,6 +411,17 @@ struct is_default_parameter } // end of parameters namespace +namespace internal_np { + +template +auto +combine_named_parameters(const Named_function_parameters& np, const NPS& ... nps) +{ + return np.combine(nps ...); +} + +} // end of internal_np namespace + #ifndef CGAL_NO_DEPRECATED_CODE namespace Polygon_mesh_processing { diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 5532ee01100..99a802a9b02 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -245,4 +245,6 @@ CGAL_add_named_parameter(domain_is_initialized_t, domain_is_initialized, domain_ CGAL_add_named_parameter(seeds_are_in_domain_t, seeds_are_in_domain, seeds_are_in_domain) CGAL_add_named_parameter(criteria_t, criteria, criteria) CGAL_add_named_parameter(convergence_ratio_t, convergence_ratio, convergence_ratio) -// CGAL_add_named_parameter(freeze_bound_t, freeze_bound, freeze_bound) +CGAL_add_named_parameter(vertex_freeze_bound_t, vertex_freeze_bound, vertex_freeze_bound) +CGAL_add_named_parameter(i_seed_begin_iterator_t, i_seed_begin_iterator, i_seed_begin_iterator) +CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_iterator) From d13f4866407d7fa6005e2dcfd0fd465289749f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sat, 4 Jun 2022 14:19:00 +0200 Subject: [PATCH 003/248] update tests/examples/demos to use the new API --- .../Constrained_Delaunay_triangulation_2.cpp | 4 +- Mesh_2/examples/Mesh_2/mesh_optimization.cpp | 5 +- Mesh_2/test/Mesh_2/test_lloyd.cpp | 55 +++++++++++++++++++ .../test_mesh_opti_projection_traits.cpp | 2 +- .../Plugins/Mesh_2/Mesh_2_plugin.cpp | 2 +- 5 files changed, 61 insertions(+), 7 deletions(-) diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp index a05bf7ba8bf..220dc70f1a9 100644 --- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp @@ -961,9 +961,7 @@ MainWindow::on_actionLloyd_optimization_triggered() } CGAL::lloyd_optimize_mesh_2(cdt, - max_iteration_number = nb, - seeds_begin = m_seeds.begin(), - seeds_end = m_seeds.end()); + CGAL::parameters::number_of_iterations(nb).seeds(m_seeds)); // default cursor QApplication::restoreOverrideCursor(); diff --git a/Mesh_2/examples/Mesh_2/mesh_optimization.cpp b/Mesh_2/examples/Mesh_2/mesh_optimization.cpp index 383b7edf1a7..6ffa683ec54 100644 --- a/Mesh_2/examples/Mesh_2/mesh_optimization.cpp +++ b/Mesh_2/examples/Mesh_2/mesh_optimization.cpp @@ -52,8 +52,9 @@ int main() std::cout << "Run Lloyd optimization..."; CGAL::lloyd_optimize_mesh_2(cdt, - CGAL::parameters::max_iteration_number = 10); - std::cout << " done." << std::endl; + CGAL::parameters::number_of_iterations(10)); + +std::cout << " done." << std::endl; std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl; } diff --git a/Mesh_2/test/Mesh_2/test_lloyd.cpp b/Mesh_2/test/Mesh_2/test_lloyd.cpp index 005464fa2dd..cd6bfa0c3ec 100644 --- a/Mesh_2/test/Mesh_2/test_lloyd.cpp +++ b/Mesh_2/test/Mesh_2/test_lloyd.cpp @@ -1,3 +1,5 @@ +#define CGAL_NO_DEPRECATION_WARNINGS + #include "test_dependencies.h" #include #include @@ -55,6 +57,51 @@ struct Lloyd_tester cdt.number_of_vertices() <= 640 ); + const size_type number_of_constraints = number_of_constrained_edges(cdt); + const size_type number_of_vertices1 = cdt.number_of_vertices(); + + CGAL::Mesh_optimization_return_code rc + = CGAL::lloyd_optimize_mesh_2(cdt, + CGAL::parameters::number_of_iterations(10). + convergence_ratio(0.001). + vertex_freeze_bound(0.001). + seeds(seeds)); + const size_type number_of_vertices2 = cdt.number_of_vertices(); + std::cerr << " done (return code = "<< rc <<").\n"; + std::cerr << "Number of vertices: " << number_of_vertices2 << "\n\n"; + + assert( cdt.is_valid() ); + assert( number_of_vertices1 == number_of_vertices2 ); + assert( number_of_constraints == number_of_constrained_edges(cdt)); + } +}; + +#ifndef CGAL_NO_DEPRECATED_CODE +struct Lloyd_tester_deprecated_API +{ + void operator()(CDT& cdt) const + { + std::vector seeds; + seeds.reserve(32); + + std::cerr << "Reading fish-and-rectangle.poly..."; + std::ifstream poly_file("fish-and-rectangle.poly"); + CGAL::IO::read_triangle_poly_file(cdt, poly_file, std::back_inserter(seeds)); + assert( cdt.is_valid() ); + + std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() + << "\nNumber of seeds: " << seeds.size() << "\n\n"; + + std::cerr << "Meshing the triangulation with size 0.1..."; + CGAL::refine_Delaunay_mesh_2(cdt, + seeds.begin(), seeds.end(), + Criteria(0.125, 0.1)); + std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() << "\n\n"; + assert( cdt.is_valid() ); + assert( 580 <= cdt.number_of_vertices() && + cdt.number_of_vertices() <= 640 ); + + const size_type number_of_constraints = number_of_constrained_edges(cdt); const size_type number_of_vertices1 = cdt.number_of_vertices(); @@ -74,6 +121,7 @@ struct Lloyd_tester assert( number_of_constraints == number_of_constrained_edges(cdt)); } }; +#endif int main() { @@ -81,5 +129,12 @@ int main() CDT cdt; Lloyd_tester tester; tester(cdt); + + #ifndef CGAL_NO_DEPRECATED_CODE + std::cerr << "TESTING lloyd_optimize_mesh_2 with Epick (deprecated API)...\n\n"; + cdt = CDT(); + Lloyd_tester_deprecated_API tester_bis; + tester_bis(cdt); + #endif return 0; } diff --git a/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp b/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp index 88b379f1a1f..ef11be72b58 100644 --- a/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp +++ b/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp @@ -54,7 +54,7 @@ int main() std::cout << "Run Lloyd optimization..."; CGAL::lloyd_optimize_mesh_2(cdt, - CGAL::parameters::max_iteration_number = 10); + CGAL::parameters::number_of_iterations(10)); std::cout << " done." << std::endl; std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp index 4361cd11e7c..87fd4b7c529 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -326,7 +326,7 @@ private: ltime.restart(); std::cout << " Running lloyd_optimize_mesh_2..." << std::flush; CGAL::lloyd_optimize_mesh_2(cdt, - CGAL::parameters::max_iteration_number = nb_iter); + CGAL::parameters::number_of_iterations(nb_iter)); std::cout << " done (" << ltime.elapsed() << " ms)" << std::endl; } From db2c202f3516b9b3098d1cd765a9de14b669541d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sat, 4 Jun 2022 15:00:20 +0200 Subject: [PATCH 004/248] restore parameters used also by Mesh_3 --- BGL/include/CGAL/boost/parameter.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h index afec98cacb8..851fa3e8d39 100644 --- a/BGL/include/CGAL/boost/parameter.h +++ b/BGL/include/CGAL/boost/parameter.h @@ -78,6 +78,11 @@ BOOST_PARAMETER_NAME( domain ) BOOST_PARAMETER_NAME( criteria ) BOOST_PARAMETER_NAME( cdt ) +BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) +BOOST_PARAMETER_NAME( (convergence, tag) convergence_) +BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) +BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) + BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) From 046f1db10ae419e99c1006eff79c5f892be27ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sat, 4 Jun 2022 19:12:54 +0200 Subject: [PATCH 005/248] function call is also working now! --- STL_Extension/include/CGAL/Named_function_parameters.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 165f46b5a68..ce108229e9d 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -317,6 +317,14 @@ inline no_parameters(Named_function_parameters) template struct Boost_parameter_compatibility_wrapper { + template + Named_function_parameters + operator()(const K& p) const + { + typedef Named_function_parameters Params; + return Params(p); + } + template Named_function_parameters operator=(const K& p) const From e6619ab67b9340ca0d4fc31bcbf70243a587bc3b Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Thu, 9 Jun 2022 14:25:33 +0530 Subject: [PATCH 006/248] Provided new API support for exude_mesh_3 --- .../Mesh_3/mesh_cubes_intersection.cpp | 2 +- .../mesh_cubes_intersection_with_features.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 2 +- .../mesh_optimization_lloyd_example.cpp | 2 +- Mesh_3/include/CGAL/exude_mesh_3.h | 223 ++++++++++++++---- Mesh_3/include/CGAL/refine_mesh_3.h | 4 +- Mesh_3/test/Mesh_3/create_cgal_test | 214 +++++++++++++++++ .../test/Mesh_3/test_meshing_determinism.cpp | 2 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 4 +- .../include/CGAL/Named_function_parameters.h | 16 +- .../internal/parameters_interface.h | 3 + .../test/Triangulation_2/CMakeLists.txt | 52 ++-- 12 files changed, 439 insertions(+), 87 deletions(-) create mode 100755 Mesh_3/test/Mesh_3/create_cgal_test diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 12216cc2cbd..6cd90e2e3fe 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -87,7 +87,7 @@ int main() CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); // Output std::ofstream medit_file("out_cubes_intersection.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index 61d2d78d993..a32b9603115 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -174,7 +174,7 @@ int main() CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); // Output std::ofstream medit_file("out_cubes_intersection_with_features.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index d8790c25fd3..ad284862d75 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -63,7 +63,7 @@ int main() CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index e4a6e6a5dcb..fd114c63866 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -55,7 +55,7 @@ int main(int argc, char*argv[]) no_perturb(), no_exude()); CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30); - CGAL::exude_mesh_3(c3t3_bis, sliver_bound=10, time_limit=10); + CGAL::exude_mesh_3(c3t3_bis, CGAL::parameters::sliver_bound_new=10, CGAL::parameters::time_limit_new=10); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 3d9cb841b7c..59e89f5c91d 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -25,68 +25,201 @@ #include #include #include -#include - -#include +#include namespace CGAL { +/*! +@ingroup PkgMesh3Functions -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +The sliver exudation process consists in optimizing the weights of vertices +of the weighted Delaunay triangulation in such a way that slivers disappear and +the quality of the mesh improves. -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - exude_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) ) - (optional - (time_limit_, *, 0 ) - (sliver_bound_, *, parameters::default_values_for_mesh_3::exude_sliver_bound ) - ) -) +@warning This optimizer modifies the weight of vertices of the triangulation and, +if called, must be the last optimizer to be called. If the mesh is refined after +this optimization has been performed, all improvements will be lost. + +@pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 + +@tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. +@tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + +\cgalNamedParamsBegin + \cgalParamNBegin{parameters::time_limit_new} + \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + is stopped. This time is measured using the Real_timer class. The default value is + 0 and means that there is no time limit.} + \cgalParamNBegin{parameters::parameters::sliver_bound_new} + \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + The exudation process considers in turn all the mesh cells that have a smallest dihedral + angle less than sliver_bound and tries to make them disappear by weighting their vertices. + The optimization process stops when every cell in the mesh achieves this quality. The + default value is 0 and means that there is no targeted bound: the exuder then runs as long + as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} +\cgalNamedParamsEnd +\return +The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve +the smallest dihedral angle of the set of cells incident to some vertex in the mesh. +
+ +\cgalHeading{Example} + +\code{.cpp} +// Exude without sliver_bound, using at most 10s CPU time +exude_mesh_3(c3t3, + parameters::time_limit=10); +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` + +*/ +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { - 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); + } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING + #ifndef CGAL_NO_DEPRECATED_CODE + template + Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) + { + return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); + } + #endif //CGAL_NO_DEPRECATED_CODE - -template -Mesh_optimization_return_code -exude_mesh_3_impl(C3T3& c3t3, + template + Mesh_optimization_return_code + exude_mesh_3_impl(C3T3& c3t3, 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(); + } +#else +namespace CGAL { +/*! +\ingroup PkgMesh3Functions + +The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. + +The sliver exudation process consists in optimizing the weights of vertices +of the weighted Delaunay triangulation in such a way that slivers disappear and +the quality of the mesh improves. + +\warning This optimizer modifies the weight of vertices of the triangulation and, +if called, must be the last optimizer to be called. If the mesh is refined after +this optimization has been performed, all improvements will be lost. + +\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 + +\tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. + +The function has two optional parameters which are named parameters (we use the Boost.Parameter library). +Therefore, when calling the function, the parameters can be provided in any order +provided that the names of the parameters are used +(see example at the bottom of this page). + +\cgalHeading{Named Parameters} +- `parameters::time_limit` is used to set up, in seconds, +a CPU time limit after which the optimization process is stopped. This time is +measured using the `Real_timer` class. +The default value is 0 and means that there is no time limit. + +- `parameters::sliver_bound` is designed to give, in degrees, a targeted +lower bound on dihedral angles of mesh cells. +The exudation process considers in turn all the mesh cells +that have a smallest dihedral angle less than `sliver_bound` +and tries to make them disappear by weighting their vertices. +The optimization process +stops when every cell in the mesh achieves this quality. +The default value is 0 and means that there is no targeted bound: +the exuder then runs as long as +it can improve the smallest dihedral angles of the set of cells +incident to some vertices. + +\return +The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve +the smallest dihedral angle of the set of cells incident to some vertex in the mesh. +
+ +\cgalHeading{Example} + +\code{.cpp} +// Exude without sliver_bound, using at most 10s CPU time +exude_mesh_3(c3t3, + parameters::time_limit=10); +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` + +*/ + +template +Mesh_optimization_return_code +exude_mesh_3(C3T3& c3t3, + double parameters::time_limit=0, + double parameters::sliver_bound=0); + +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING } //namespace CGAL -#include - #endif // CGAL_EXUDE_MESH_3_H diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 0c1e550f41e..411e66aad17 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -613,8 +613,8 @@ void refine_mesh_3_impl(C3T3& c3t3, exude_time_limit = exude.time_limit(); exude_mesh_3(c3t3, - parameters::time_limit = exude_time_limit, - parameters::sliver_bound = exude.bound()); + parameters::time_limit_new = exude_time_limit, + parameters::sliver_bound_new = exude.bound()); dump_c3t3(c3t3, mesh_options.dump_after_exude_prefix); } diff --git a/Mesh_3/test/Mesh_3/create_cgal_test b/Mesh_3/test/Mesh_3/create_cgal_test new file mode 100755 index 00000000000..e10c3d11dea --- /dev/null +++ b/Mesh_3/test/Mesh_3/create_cgal_test @@ -0,0 +1,214 @@ +#! /bin/bash +# +# ============================================================================= +# $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/developer_scripts/create_cgal_test $ +# $Id: create_cgal_test 36975 2007-03-09 22:52:40Z spion $ +# +# author(s) : Wieger Wesselink, Geert-Jan Giezeman +# +# coordinator : Utrecht University +# ============================================================================= +# +# This script creates a cgal_test_with_cmake script with entries for files with a common +# C++ file extension (as mentioned in the g++ man page) in the current test directory. + +VERSION=1.1 + +DO_RUN="y" + +usage() +{ + echo 'Usage : create_cgal_test [--no-run]' + echo + echo ' --help : prints this usage help' + echo ' --no-run : produces a cgal_test_with_cmake script that only does compilation, no execution' + exit +} + +while [ $1 ]; do + case "$1" in + -h|-help|--h|--help) + usage; + ;; + --no-run) + DO_RUN="" + shift; continue + ;; + *) + echo "Unknown option: $1" + usage + ;; + esac +done + + +header() +{ + echo "#---------------------------------------------------------------------#" + echo "# $1" + echo "#---------------------------------------------------------------------#" +} + +create_script() +{ + echo "#! /bin/sh" + echo + echo "# This is a script for the CGAL test suite. Such a script must obey" + echo "# the following rules:" + echo "#" + echo "# - the name of the script is cgal_test_with_cmake" + echo "# - for every target two one line messages are written to the file 'error.txt'" + echo "# the first one indicates if the compilation was successful" + echo "# the second one indicates if the execution was successful" + echo "# if one of the two was not successful, the line should start with 'ERROR:'" + echo "# - running the script should not require any user interaction" + echo "# - the script should clean up object files and executables" + echo +cat << EOF + ERRORFILE=error.txt + DO_RUN=${DO_RUN} + if [ -z "\${MAKE_CMD}" ]; then + MAKE_CMD=make + fi + NEED_CLEAN= + +EOF + header "configure" +cat << 'EOF' + +configure() +{ + echo "Configuring... " + + if eval 'cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ + -DCGAL_DIR="$CGAL_DIR" \ + --no-warn-unused-cli \ + .' ; then + + echo " successful configuration" >> $ERRORFILE + else + echo " ERROR: configuration" >> $ERRORFILE + fi +} + +EOF + header "compile_and_run " +cat << EOF + +compile_and_run() +{ + if [ -z "\${CGAL_DATA_DIR}" ]; then + if [ -d \${CGAL_DIR}/data ]; then + export CGAL_DATA_DIR=\${CGAL_DIR}/data + else + if [ -d \${CGAL_DIR}/Data/data ]; then + export CGAL_DATA_DIR=\${CGAL_DIR}/Data/data + else + echo "ERROR: Cannot run test script, please set the variable CGAL_DATA_DIR" + exit 1 + fi + fi + fi + + echo "Runs will be using CGAL_DATA_DIR = \${CGAL_DATA_DIR}" + + echo "Compiling \$1 ... " + SUCCESS="y" + + if eval '"\${MAKE_CMD}" VERBOSE=ON -fMakefile \$1' ; then + echo " successful compilation of \$1" >> \$ERRORFILE + else + echo " ERROR: compilation of \$1" >> \$ERRORFILE + SUCCESS="" + fi + + if [ -n "\$DO_RUN" ] ; then + if [ -n "\${SUCCESS}" ] ; then + OUTPUTFILE=ProgramOutput.\$1.\$PLATFORM + rm -f \$OUTPUTFILE + COMMAND="./\$1" + if [ -f \$1.cmd ] ; then + COMMAND="\$COMMAND \`eval echo \$(cat \$1.cmd)\`" + fi + if [ -f \$1.cin ] ; then + COMMAND="cat \$1.cin | \$COMMAND" + fi + echo "Executing \$1 ... " + echo + ulimit -t 3600 2> /dev/null + if eval \$COMMAND > \$OUTPUTFILE 2>&1 ; then + echo " successful execution of \$1" >> \$ERRORFILE + else + echo " ERROR: execution of \$1" >> \$ERRORFILE + fi + else + echo " ERROR: not executed \$1" >> \$ERRORFILE + fi + fi +} + +EOF + header "remove the previous error file" +cat << EOF + +rm -f \$ERRORFILE +touch \$ERRORFILE + +EOF + header "configure, compile and run the tests" +cat << EOF + +configure + +if [ \$# -ne 0 ] ; then + for file in \$* ; do + compile_and_run \$file + done +else + echo "Run all tests." +EOF + + # workaround for Cygwin, to avoid that the 'sort' from + # C:\Windows\system32 is used instead of /usr/bin/sort + PATH=/usr/bin:$PATH + + for file in `ls *.cc *.cp *.cxx *.cpp *.CPP *.c++ *.C 2> /dev/null | sort` ; do + if [ -n "`grep '\' $file`" ] ; then + BASE=`basename $file .cc` + BASE=`basename $BASE .cp` + BASE=`basename $BASE .cxx` + BASE=`basename $BASE .cpp` + BASE=`basename $BASE .CPP` + BASE=`basename $BASE .c++` + BASE=`basename $BASE .C` + cat < cgal_test_with_cmake +chmod 755 cgal_test_with_cmake +echo "created cgal_test_with_cmake, version $VERSION, in $PWD ..." diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index d359509388f..d6a7034be0c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -120,7 +120,7 @@ void test() oss.clear(); //EXUDE (4) - CGAL::exude_mesh_3(c3t3, sliver_bound=exude_bound); + CGAL::exude_mesh_3(c3t3, CGAL::parameters::sliver_bound_new=exude_bound); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+4] oss.clear(); 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 acb3b35decd..575ea4fb948 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 @@ -299,8 +299,8 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, exude_time_limit = exude.time_limit(); exude_mesh_3(c3t3, - parameters::time_limit = exude_time_limit, - parameters::sliver_bound = exude.bound()); + CGAL::parameters::time_limit_new = exude_time_limit, + CGAL::parameters::sliver_bound_new = exude.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index ce108229e9d..528e1f6093c 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -335,13 +335,15 @@ struct Boost_parameter_compatibility_wrapper }; // TODO: need to make sure this works when using several compilation units -const Boost_parameter_compatibility_wrapper max_iteration_number; -const Boost_parameter_compatibility_wrapper convergence; -const Boost_parameter_compatibility_wrapper freeze_bound; -const Boost_parameter_compatibility_wrapper time_limit; -const Boost_parameter_compatibility_wrapper seeds_begin; -const Boost_parameter_compatibility_wrapper seeds_end; -const Boost_parameter_compatibility_wrapper mark_; +const Boost_parameter_compatibility_wrapper max_iteration_number_new; +const Boost_parameter_compatibility_wrapper convergence_new; +const Boost_parameter_compatibility_wrapper freeze_bound_new; +const Boost_parameter_compatibility_wrapper time_limit_new; +const Boost_parameter_compatibility_wrapper seeds_begin_new; +const Boost_parameter_compatibility_wrapper seeds_end_new; +const Boost_parameter_compatibility_wrapper mark_new; +//Compatibility wrappers for exude_mesh_3.h +const Boost_parameter_compatibility_wrapper sliver_bound_new; #endif // function to extract a parameter diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 99a802a9b02..1512a572d7f 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -248,3 +248,6 @@ CGAL_add_named_parameter(convergence_ratio_t, convergence_ratio, convergence_rat CGAL_add_named_parameter(vertex_freeze_bound_t, vertex_freeze_bound, vertex_freeze_bound) CGAL_add_named_parameter(i_seed_begin_iterator_t, i_seed_begin_iterator, i_seed_begin_iterator) CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_iterator) + +//List of named parameters used in exude_mesh_3.h +CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) \ No newline at end of file diff --git a/Triangulation_2/test/Triangulation_2/CMakeLists.txt b/Triangulation_2/test/Triangulation_2/CMakeLists.txt index bad1f2455bf..5c63549faa2 100644 --- a/Triangulation_2/test/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/test/Triangulation_2/CMakeLists.txt @@ -2,33 +2,33 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.23) -project(Triangulation_2_Tests) +project( Triangulation_2 ) -find_package(CGAL REQUIRED) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) -include_directories(BEFORE "include") + include_directories (BEFORE "include") -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +create_single_source_cgal_program( "issue_3447.cpp" ) +create_single_source_cgal_program( "issue_4025.cpp" ) +create_single_source_cgal_program( "issue_4405.cpp" ) +create_single_source_cgal_program( "issue_5055.cpp" ) +create_single_source_cgal_program( "issue_5080.cpp" ) +create_single_source_cgal_program( "test_cdt_2_projection_traits_special_case.cpp" ) +create_single_source_cgal_program( "test_cdt_degenerate_case.cpp" ) +create_single_source_cgal_program( "test_CDT_plus_2_with_Projection_traits_xy_3.cpp" ) +create_single_source_cgal_program( "test_const_del_triangulation_2.cpp" ) +create_single_source_cgal_program( "test_constrained_triangulation_2.cpp" ) +create_single_source_cgal_program( "test_constrained_triangulation_with_info_2.cpp" ) +create_single_source_cgal_program( "test_const_triang_plus_2.cpp" ) +create_single_source_cgal_program( "test_delaunay_hierarchy_2.cpp" ) +create_single_source_cgal_program( "test_delaunay_triangulation_2.cpp" ) +create_single_source_cgal_program( "test_delaunay_triangulation_proj.cpp" ) +create_single_source_cgal_program( "test_deprecated_projection_traits.cpp" ) +create_single_source_cgal_program( "test_regular_hierarchy_2.cpp" ) +create_single_source_cgal_program( "test_regular_triangulation_2.cpp" ) +create_single_source_cgal_program( "test_structural_filtering_traits.cpp" ) +create_single_source_cgal_program( "test_triangulation_2_bis.cpp" ) +create_single_source_cgal_program( "test_triangulation_2.cpp" ) +create_single_source_cgal_program( "test_triangulation_geom_traits.cpp" ) +create_single_source_cgal_program( "test_triangulation_with_zip_iterator_2.cpp" ) -if(BUILD_TESTING) - set_tests_properties( - execution___of__test_constrained_triangulation_2 - execution___of__test_delaunay_triangulation_2 - execution___of__test_triangulation_geom_traits - execution___of__test_triangulation_2 - execution___of__test_triangulation_2_bis - execution___of__test_delaunay_hierarchy_2 - execution___of__test_const_triang_plus_2 - execution___of__test_regular_triangulation_2 - execution___of__test_const_del_triangulation_2 - execution___of__test_regular_hierarchy_2 - execution___of__test_deprecated_projection_traits - PROPERTIES RESOURCE_LOCK Triangulation_2_Tests_IO) -endif() From f3d81b114f7c452043658cf7a29b91ac3e075b76 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Thu, 9 Jun 2022 14:49:20 +0530 Subject: [PATCH 007/248] Removed unnecessary files caused due to testing --- Mesh_3/test/Mesh_3/create_cgal_test | 214 ------------------ .../test/Triangulation_2/CMakeLists.txt | 52 ++--- 2 files changed, 26 insertions(+), 240 deletions(-) delete mode 100755 Mesh_3/test/Mesh_3/create_cgal_test diff --git a/Mesh_3/test/Mesh_3/create_cgal_test b/Mesh_3/test/Mesh_3/create_cgal_test deleted file mode 100755 index e10c3d11dea..00000000000 --- a/Mesh_3/test/Mesh_3/create_cgal_test +++ /dev/null @@ -1,214 +0,0 @@ -#! /bin/bash -# -# ============================================================================= -# $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/developer_scripts/create_cgal_test $ -# $Id: create_cgal_test 36975 2007-03-09 22:52:40Z spion $ -# -# author(s) : Wieger Wesselink, Geert-Jan Giezeman -# -# coordinator : Utrecht University -# ============================================================================= -# -# This script creates a cgal_test_with_cmake script with entries for files with a common -# C++ file extension (as mentioned in the g++ man page) in the current test directory. - -VERSION=1.1 - -DO_RUN="y" - -usage() -{ - echo 'Usage : create_cgal_test [--no-run]' - echo - echo ' --help : prints this usage help' - echo ' --no-run : produces a cgal_test_with_cmake script that only does compilation, no execution' - exit -} - -while [ $1 ]; do - case "$1" in - -h|-help|--h|--help) - usage; - ;; - --no-run) - DO_RUN="" - shift; continue - ;; - *) - echo "Unknown option: $1" - usage - ;; - esac -done - - -header() -{ - echo "#---------------------------------------------------------------------#" - echo "# $1" - echo "#---------------------------------------------------------------------#" -} - -create_script() -{ - echo "#! /bin/sh" - echo - echo "# This is a script for the CGAL test suite. Such a script must obey" - echo "# the following rules:" - echo "#" - echo "# - the name of the script is cgal_test_with_cmake" - echo "# - for every target two one line messages are written to the file 'error.txt'" - echo "# the first one indicates if the compilation was successful" - echo "# the second one indicates if the execution was successful" - echo "# if one of the two was not successful, the line should start with 'ERROR:'" - echo "# - running the script should not require any user interaction" - echo "# - the script should clean up object files and executables" - echo -cat << EOF - ERRORFILE=error.txt - DO_RUN=${DO_RUN} - if [ -z "\${MAKE_CMD}" ]; then - MAKE_CMD=make - fi - NEED_CLEAN= - -EOF - header "configure" -cat << 'EOF' - -configure() -{ - echo "Configuring... " - - if eval 'cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - --no-warn-unused-cli \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi -} - -EOF - header "compile_and_run " -cat << EOF - -compile_and_run() -{ - if [ -z "\${CGAL_DATA_DIR}" ]; then - if [ -d \${CGAL_DIR}/data ]; then - export CGAL_DATA_DIR=\${CGAL_DIR}/data - else - if [ -d \${CGAL_DIR}/Data/data ]; then - export CGAL_DATA_DIR=\${CGAL_DIR}/Data/data - else - echo "ERROR: Cannot run test script, please set the variable CGAL_DATA_DIR" - exit 1 - fi - fi - fi - - echo "Runs will be using CGAL_DATA_DIR = \${CGAL_DATA_DIR}" - - echo "Compiling \$1 ... " - SUCCESS="y" - - if eval '"\${MAKE_CMD}" VERBOSE=ON -fMakefile \$1' ; then - echo " successful compilation of \$1" >> \$ERRORFILE - else - echo " ERROR: compilation of \$1" >> \$ERRORFILE - SUCCESS="" - fi - - if [ -n "\$DO_RUN" ] ; then - if [ -n "\${SUCCESS}" ] ; then - OUTPUTFILE=ProgramOutput.\$1.\$PLATFORM - rm -f \$OUTPUTFILE - COMMAND="./\$1" - if [ -f \$1.cmd ] ; then - COMMAND="\$COMMAND \`eval echo \$(cat \$1.cmd)\`" - fi - if [ -f \$1.cin ] ; then - COMMAND="cat \$1.cin | \$COMMAND" - fi - echo "Executing \$1 ... " - echo - ulimit -t 3600 2> /dev/null - if eval \$COMMAND > \$OUTPUTFILE 2>&1 ; then - echo " successful execution of \$1" >> \$ERRORFILE - else - echo " ERROR: execution of \$1" >> \$ERRORFILE - fi - else - echo " ERROR: not executed \$1" >> \$ERRORFILE - fi - fi -} - -EOF - header "remove the previous error file" -cat << EOF - -rm -f \$ERRORFILE -touch \$ERRORFILE - -EOF - header "configure, compile and run the tests" -cat << EOF - -configure - -if [ \$# -ne 0 ] ; then - for file in \$* ; do - compile_and_run \$file - done -else - echo "Run all tests." -EOF - - # workaround for Cygwin, to avoid that the 'sort' from - # C:\Windows\system32 is used instead of /usr/bin/sort - PATH=/usr/bin:$PATH - - for file in `ls *.cc *.cp *.cxx *.cpp *.CPP *.c++ *.C 2> /dev/null | sort` ; do - if [ -n "`grep '\' $file`" ] ; then - BASE=`basename $file .cc` - BASE=`basename $BASE .cp` - BASE=`basename $BASE .cxx` - BASE=`basename $BASE .cpp` - BASE=`basename $BASE .CPP` - BASE=`basename $BASE .c++` - BASE=`basename $BASE .C` - cat < cgal_test_with_cmake -chmod 755 cgal_test_with_cmake -echo "created cgal_test_with_cmake, version $VERSION, in $PWD ..." diff --git a/Triangulation_2/test/Triangulation_2/CMakeLists.txt b/Triangulation_2/test/Triangulation_2/CMakeLists.txt index 5c63549faa2..bad1f2455bf 100644 --- a/Triangulation_2/test/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/test/Triangulation_2/CMakeLists.txt @@ -2,33 +2,33 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.23) -project( Triangulation_2 ) +project(Triangulation_2_Tests) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) +find_package(CGAL REQUIRED) - include_directories (BEFORE "include") +include_directories(BEFORE "include") -create_single_source_cgal_program( "issue_3447.cpp" ) -create_single_source_cgal_program( "issue_4025.cpp" ) -create_single_source_cgal_program( "issue_4405.cpp" ) -create_single_source_cgal_program( "issue_5055.cpp" ) -create_single_source_cgal_program( "issue_5080.cpp" ) -create_single_source_cgal_program( "test_cdt_2_projection_traits_special_case.cpp" ) -create_single_source_cgal_program( "test_cdt_degenerate_case.cpp" ) -create_single_source_cgal_program( "test_CDT_plus_2_with_Projection_traits_xy_3.cpp" ) -create_single_source_cgal_program( "test_const_del_triangulation_2.cpp" ) -create_single_source_cgal_program( "test_constrained_triangulation_2.cpp" ) -create_single_source_cgal_program( "test_constrained_triangulation_with_info_2.cpp" ) -create_single_source_cgal_program( "test_const_triang_plus_2.cpp" ) -create_single_source_cgal_program( "test_delaunay_hierarchy_2.cpp" ) -create_single_source_cgal_program( "test_delaunay_triangulation_2.cpp" ) -create_single_source_cgal_program( "test_delaunay_triangulation_proj.cpp" ) -create_single_source_cgal_program( "test_deprecated_projection_traits.cpp" ) -create_single_source_cgal_program( "test_regular_hierarchy_2.cpp" ) -create_single_source_cgal_program( "test_regular_triangulation_2.cpp" ) -create_single_source_cgal_program( "test_structural_filtering_traits.cpp" ) -create_single_source_cgal_program( "test_triangulation_2_bis.cpp" ) -create_single_source_cgal_program( "test_triangulation_2.cpp" ) -create_single_source_cgal_program( "test_triangulation_geom_traits.cpp" ) -create_single_source_cgal_program( "test_triangulation_with_zip_iterator_2.cpp" ) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(BUILD_TESTING) + set_tests_properties( + execution___of__test_constrained_triangulation_2 + execution___of__test_delaunay_triangulation_2 + execution___of__test_triangulation_geom_traits + execution___of__test_triangulation_2 + execution___of__test_triangulation_2_bis + execution___of__test_delaunay_hierarchy_2 + execution___of__test_const_triang_plus_2 + execution___of__test_regular_triangulation_2 + execution___of__test_const_del_triangulation_2 + execution___of__test_regular_hierarchy_2 + execution___of__test_deprecated_projection_traits + PROPERTIES RESOURCE_LOCK Triangulation_2_Tests_IO) +endif() From e213a90451e15b6c07bd914231b4427a17bd112c Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Sun, 12 Jun 2022 10:34:41 +0530 Subject: [PATCH 008/248] Fixed problem running testsuite --- Mesh_3/include/CGAL/exude_mesh_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 59e89f5c91d..975efe3ed92 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -55,11 +55,11 @@ to represent the final optimized mesh. @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin - \cgalParamNBegin{parameters::time_limit_new} + \cgalParamNBegin{time_limit_new} \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using the Real_timer class. The default value is 0 and means that there is no time limit.} - \cgalParamNBegin{parameters::parameters::sliver_bound_new} + \cgalParamNBegin{sliver_bound_new} \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. The exudation process considers in turn all the mesh cells that have a smallest dihedral angle less than sliver_bound and tries to make them disappear by weighting their vertices. From 11341ed33d1735a1583fdc6a4f86655f2a419241 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 14 Jun 2022 19:11:44 +0530 Subject: [PATCH 010/248] Support for docs --- Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h | 81 --------------------------- Mesh_3/doc/Mesh_3/Doxyfile.in | 4 +- Mesh_3/include/CGAL/exude_mesh_3.h | 10 +++- 3 files changed, 9 insertions(+), 86 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h deleted file mode 100644 index e9b8167c8e2..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h +++ /dev/null @@ -1,81 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. - -The sliver exudation process consists in optimizing the weights of vertices -of the weighted Delaunay triangulation in such a way that slivers disappear and -the quality of the mesh improves. - -\warning This optimizer modifies the weight of vertices of the triangulation and, -if called, must be the last optimizer to be called. If the mesh is refined after -this optimization has been performed, all improvements will be lost. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -The function has two optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} -- `parameters::time_limit` is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using the `Real_timer` class. -The default value is 0 and means that there is no time limit. - -- `parameters::sliver_bound` is designed to give, in degrees, a targeted -lower bound on dihedral angles of mesh cells. -The exudation process considers in turn all the mesh cells -that have a smallest dihedral angle less than `sliver_bound` -and tries to make them disappear by weighting their vertices. -The optimization process -stops when every cell in the mesh achieves this quality. -The default value is 0 and means that there is no targeted bound: -the exuder then runs as long as -it can improve the smallest dihedral angles of the set of cells -incident to some vertices. - -\return -The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve -the smallest dihedral angle of the set of cells incident to some vertex in the mesh. -
- -\cgalHeading{Example} - -\code{.cpp} -// Exude without sliver_bound, using at most 10s CPU time -exude_mesh_3(c3t3, - parameters::time_limit=10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -exude_mesh_3(C3T3& c3t3, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index c5f22c38811..aebf5a4b950 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -6,8 +6,8 @@ ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of poin INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h - + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 975efe3ed92..992eeb0ff8d 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -59,13 +59,17 @@ to represent the final optimized mesh. \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using the Real_timer class. The default value is 0 and means that there is no time limit.} - \cgalParamNBegin{sliver_bound_new} + \cgalParamType{'double'} + \cgalParamDefault{0} + \cgalParamNBegin{sliver_bound_new} \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. The exudation process considers in turn all the mesh cells that have a smallest dihedral angle less than sliver_bound and tries to make them disappear by weighting their vertices. The optimization process stops when every cell in the mesh achieves this quality. The default value is 0 and means that there is no targeted bound: the exuder then runs as long as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + \cgalParamType{'double'} + \cgalParamDefault{0} \cgalNamedParamsEnd \return The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` @@ -140,9 +144,9 @@ namespace CGAL { /*! \ingroup PkgMesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. -The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. - + The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. The sliver exudation process consists in optimizing the weights of vertices of the weighted Delaunay triangulation in such a way that slivers disappear and the quality of the mesh improves. From 262d4d5d9b385ea359f1bc398bb4624648bdd394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 14 Jun 2022 19:05:06 +0200 Subject: [PATCH 011/248] Timer -> Real_timer --- Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h | 4 ++-- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index 0ffcca179cc..5dcb38504e8 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -21,7 +21,7 @@ #define CGAL_MESH_2_OPTIMIZER_VERBOSE #endif -#include +#include #include #include #include @@ -464,7 +464,7 @@ private: bool seeds_mark_; double time_limit_; - CGAL::Timer running_time_; + CGAL::Real_timer running_time_; std::list big_moves_; diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 973b7fc8dc7..bb202a8379b 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -83,7 +83,7 @@ namespace CGAL * * \cgalParamNBegin{maximum_running_time} * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. - * This time is measured using `CGAL::Timer`. 0 means that there is no time limit.} + * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} * \cgalParamType{`double`} * \cgalParamExtra{\pre `maximum_running_time` \f$ \geq\f$ 0} * \cgalParamDefault{0} @@ -294,7 +294,7 @@ provided that the names of the parameters are used - `parameters::time_limit` is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is -measured using `CGAL::Timer`. +measured using `CGAL::Real_timer`. The default value is 0 and means that there is no time limit. \pre `time_limit` \f$ \geq\f$ 0 From 89c07e7718c848688e3ebf28d5eb23192d0a022e Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 15 Jun 2022 13:31:45 +0530 Subject: [PATCH 012/248] New API support and doc for odt_optimize_mesh_3.h --- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- Mesh_3/include/CGAL/exude_mesh_3.h | 4 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 273 +++++++++++++++--- Mesh_3/include/CGAL/refine_mesh_3.h | 8 +- .../test/Mesh_3/test_meshing_determinism.cpp | 4 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 4 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 8 +- .../include/CGAL/Named_function_parameters.h | 1 + .../internal/parameters_interface.h | 3 +- 9 files changed, 259 insertions(+), 49 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index aebf5a4b950..e0a38426b13 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -7,7 +7,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 992eeb0ff8d..e797a258845 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -59,7 +59,7 @@ to represent the final optimized mesh. \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using the Real_timer class. The default value is 0 and means that there is no time limit.} - \cgalParamType{'double'} + \cgalParamType{`double`} \cgalParamDefault{0} \cgalParamNBegin{sliver_bound_new} \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. @@ -68,7 +68,7 @@ to represent the final optimized mesh. The optimization process stops when every cell in the mesh achieves this quality. The default value is 0 and means that there is no targeted bound: the exuder then runs as long as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} - \cgalParamType{'double'} + \cgalParamType{`double`} \cgalParamDefault{0} \cgalNamedParamsEnd \return diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index a08d1154717..383afbdc0da 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include #include @@ -29,43 +29,136 @@ #include #include -#include namespace CGAL { +/*! +@ingroup PkgMesh3Functions -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +The function `odt_optimize_mesh_3()` is a mesh optimization process +based on the minimization of a global energy function. -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted +as the \f$ L^1\f$-norm of the error achieved +when the function \f$ x^2\f$ is interpolated on the mesh domain +using a piecewise linear function which is linear in each mesh cell. -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - odt_optimize_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) ) - (optional - (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, parameters::default_values_for_mesh_3::odt_convergence_ratio ) - (freeze_bound_, *, parameters::default_values_for_mesh_3::odt_freeze_ratio ) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze )) -) +The optimizer `odt_optimize_mesh_3()` works in iterative steps. +At each iteration, mesh vertices are moved into +positions that bring to zero the energy gradient +and the Delaunay triangulation is updated. +Vertices on the mesh boundaries are handled +in a special way so as to preserve an accurate +representation of the domain boundaries. + +@pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 + +@tparam C3T3 iis required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. + + @tparam MeshDomain is required to be a model of the concept +`MeshDomain_3`. The argument `domain` must be the `MD` +object used to create the `c3t3` parameter. + + @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + @param domain ... + @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + + \cgalNamedParamsBegin + \cgalParamNBegin{time_limit_new} + \cgalParamDescription{is used to set up, in seconds, + a CPU time limit after which the optimization process is stopped. This time is + measured using `Real_timer`. + The default value is 0 and means that there is no time limit.} + \cgalParamType{`double`} + \cgalParamDefault{0} + + \cgalParamNBegin{max_iteration_number_new} + \cgalParamDescription{sets a limit on the number of performed iterations. + The default value of 0 means that there is + no limit on the number of performed iterations.} + \cgalParamType{`std::size_t`} + \cgalParamDefault{0} + + \cgalParamNBegin{convergence_new} + \cgalParamDescription{is a stopping criterion based on convergence: + the optimization process is stopped, when at the last iteration, + the displacement of any vertex is less than a given percentage of the length + the shortest edge incident to that vertex. + The parameter `convergence` gives the threshold ratio.} + \cgalParamType{`double`} + \cgalParamDefault{0.02} + + \cgalParamNBegin{freeze_bound_new} + \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex + that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is + not relocated). The parameter `freeze_bound` gives the threshold ratio.} + \cgalParamType{`double`} + \cgalParamDefault{0.01} + + \cgalParamNBegin{do_freeze_new} + \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), + frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + moves, unfreezes all its incident vertices.} + \cgalParamType{`bool`} + \cgalParamDefault{true} + \cgalNamedParamsEnd + \return +The function `odt_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. +
  • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion +is achieved. +
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the +`do_freeze` parameter is set to true. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because +most vertices have been frozen, and no better convergence can be reached. +
+ +\cgalHeading{Example} + +\code{.cpp} +// 100 iterations of ODT-smoothing +odt_optimize_mesh_3(c3t3, + domain, + parameters::max_iteration_number = 100, + parameters::convergence = 0); +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` + */ +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - return odt_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_ - , do_freeze_ ); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING + #ifndef CGAL_NO_DEPRECATED_CODE + template + Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) + { + return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); + } + #endif //CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code @@ -106,8 +199,122 @@ odt_optimize_mesh_3_impl(C3T3& c3t3, return opt(static_cast(max_iteration_number)); } +#else +namespace CGAL { + +/*! +\ingroup PkgMesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `odt_optimize_mesh_3()` is a mesh optimization process +based on the minimization of a global energy function. + +In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted +as the \f$ L^1\f$-norm of the error achieved +when the function \f$ x^2\f$ is interpolated on the mesh domain +using a piecewise linear function which is linear in each mesh cell. + +The optimizer `odt_optimize_mesh_3()` works in iterative steps. +At each iteration, mesh vertices are moved into +positions that bring to zero the energy gradient +and the Delaunay triangulation is updated. +Vertices on the mesh boundaries are handled +in a special way so as to preserve an accurate +representation of the domain boundaries. + +\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 + +\tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. + +\tparam MD is required to be a model of the concept +`MeshDomain_3`. The argument `domain` must be the `MD` +object used to create the `c3t3` parameter. + +The function has four optional parameters which are named parameters +(we use the Boost.Parameter library). +Therefore, when calling the function, the parameters can be provided in any order +provided that the names of the parameters are used +(see example at the bottom of this page). + +\cgalHeading{Named Parameters} + +- `parameters::time_limit` +is used to set up, in seconds, +a CPU time limit after which the optimization process is stopped. This time is +measured using `Real_timer`. +The default value is 0 and means that there is no time limit. + +- `parameters::max_iteration_number` sets a limit on the +number of performed iterations. The default value of 0 means that there is +no limit on the number of performed iterations. + +- `parameters::convergence` is a stopping criterion based on convergence: +the optimization process is stopped, when at the last iteration, +the displacement of any vertex is less than a given percentage of the length +the shortest edge incident to that vertex. +The parameter `convergence` gives the threshold ratio. + +- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex +that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is +not relocated). The parameter `freeze_bound` gives the threshold ratio. + +- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), +frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that +moves, unfreezes all its incident vertices. + + +\return +The function `odt_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. +
  • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion +is achieved. +
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the +`do_freeze` parameter is set to true. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because +most vertices have been frozen, and no better convergence can be reached. +
+ +\cgalHeading{Example} + +\code{.cpp} +// 100 iterations of ODT-smoothing +odt_optimize_mesh_3(c3t3, + domain, + parameters::max_iteration_number = 100, + parameters::convergence = 0); +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` + +*/ + +template +Mesh_optimization_return_code +odt_optimize_mesh_3(C3T3& c3t3, + const MD& domain, + double parameters::time_limit=0, + std::size_t parameters::max_iteration_number=0, + double parameters::convergence=0.02, + double parameters::freeze_bound = 0.01, + bool parameters::do_freeze=true); + +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING + } // end namespace CGAL -#include - #endif // CGAL_ODT_OPTIMIZE_MESH_3_H diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 411e66aad17..b2d307db86e 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -567,10 +567,10 @@ void refine_mesh_3_impl(C3T3& c3t3, { odt_optimize_mesh_3(c3t3, domain, - parameters::time_limit = odt.time_limit(), - parameters::max_iteration_number = odt.max_iteration_number(), - parameters::convergence = odt.convergence(), - parameters::freeze_bound = odt.bound()); + parameters::time_limit_new = odt.time_limit(), + parameters::max_iteration_number_new = odt.max_iteration_number(), + parameters::convergence_new = odt.convergence(), + parameters::freeze_bound_new = odt.bound()); } // Lloyd diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index d6a7034be0c..bb29b2d383c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -98,7 +98,7 @@ void test() oss.clear(); //ODT (2) - CGAL::odt_optimize_mesh_3(c3t3, domain, max_iteration_number = nb_odt); + CGAL::odt_optimize_mesh_3(c3t3, domain, max_iteration_number_new = nb_odt); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+2] oss.clear(); @@ -120,7 +120,7 @@ void test() oss.clear(); //EXUDE (4) - CGAL::exude_mesh_3(c3t3, CGAL::parameters::sliver_bound_new=exude_bound); + CGAL::exude_mesh_3(c3t3, sliver_bound_new=exude_bound); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+4] oss.clear(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 3270d321e9b..e9a2878ffe2 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -174,8 +174,8 @@ struct Tester // Vertex number should not change (obvious) C3t3 odt_c3t3(c3t3); std::cerr << "Odt...\n"; - CGAL::odt_optimize_mesh_3(odt_c3t3, domain, CGAL::parameters::time_limit=5, - CGAL::parameters::convergence=0.001, CGAL::parameters::freeze_bound=0.0005); + CGAL::odt_optimize_mesh_3(odt_c3t3, domain, CGAL::parameters::time_limit_new=5, + CGAL::parameters::convergence_new=0.001, CGAL::parameters::freeze_bound_new=0.0005); verify_c3t3(odt_c3t3,domain,domain_type,v,v); verify_c3t3_volume(odt_c3t3, volume*0.95, volume*1.05); verify_c3t3_hausdorff_distance(odt_c3t3, domain, domain_type, hdist); 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 575ea4fb948..22a1cf99fd8 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 @@ -254,10 +254,10 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, if(odt) { odt_optimize_mesh_3(c3t3, domain, - parameters::time_limit = odt.time_limit(), - parameters::max_iteration_number = odt.max_iteration_number(), - parameters::convergence = odt.convergence(), - parameters::freeze_bound = odt.bound()); + parameters::time_limit_new = odt.time_limit(), + parameters::max_iteration_number_new = odt.max_iteration_number(), + parameters::convergence_new = odt.convergence(), + parameters::freeze_bound_new = odt.bound()); } // Lloyd diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 528e1f6093c..913def099b1 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -342,6 +342,7 @@ const Boost_parameter_compatibility_wrapper const Boost_parameter_compatibility_wrapper seeds_begin_new; const Boost_parameter_compatibility_wrapper seeds_end_new; const Boost_parameter_compatibility_wrapper mark_new; +const Boost_parameter_compatibility_wrapper do_freeze_new; //Compatibility wrappers for exude_mesh_3.h const Boost_parameter_compatibility_wrapper sliver_bound_new; #endif diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 1512a572d7f..8bf45442913 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -250,4 +250,5 @@ CGAL_add_named_parameter(i_seed_begin_iterator_t, i_seed_begin_iterator, i_seed_ CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_iterator) //List of named parameters used in exude_mesh_3.h -CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) \ No newline at end of file +CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) +CGAL_add_named_parameter(freeze_t,freeze,freeze) \ No newline at end of file From 2555a3e3b8c11be5f1b8e39fe2c4ba5c48bf169b Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 15 Jun 2022 13:48:35 +0530 Subject: [PATCH 013/248] Real_timer to --- Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h | 111 ------------------- Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- 2 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h deleted file mode 100644 index eab650a577a..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h +++ /dev/null @@ -1,111 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `odt_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear in each mesh cell. - -The optimizer `odt_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has four optional parameters which are named parameters -(we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. - -- `parameters::convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given percentage of the length -the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. - -- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex -that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. - -- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), -frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that -moves, unfreezes all its incident vertices. - - -\return -The function `odt_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - -\code{.cpp} -// 100 iterations of ODT-smoothing -odt_optimize_mesh_3(c3t3, - domain, - parameters::max_iteration_number = 100, - parameters::convergence = 0); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -odt_optimize_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -} /* namespace CGAL */ diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index e797a258845..1b5fe11d127 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -57,7 +57,7 @@ to represent the final optimized mesh. \cgalNamedParamsBegin \cgalParamNBegin{time_limit_new} \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process - is stopped. This time is measured using the Real_timer class. The default value is + is stopped. This time is measured using the `Real_timer` class. The default value is 0 and means that there is no time limit.} \cgalParamType{`double`} \cgalParamDefault{0} From d0d64efe30b9f75662c48ccde715d33f9943b19b Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Thu, 16 Jun 2022 20:34:46 +0530 Subject: [PATCH 014/248] New API support and doc for lloyd_optimize_mesh_3.h --- .../doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h | 116 ------- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- .../mesh_optimization_lloyd_example.cpp | 4 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 287 +++++++++++++++--- Mesh_3/include/CGAL/refine_mesh_3.h | 8 +- .../test/Mesh_3/test_meshing_determinism.cpp | 2 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 4 +- 7 files changed, 264 insertions(+), 160 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h deleted file mode 100644 index b891d23810f..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h +++ /dev/null @@ -1,116 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `lloyd_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has four optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::%max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. - -- `parameters::%convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given percentage of the -length of the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. - -- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex -that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. - -- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), -frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that -moves, unfreezes all its incident vertices. - - -\return -The function `lloyd_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// 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); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -\note This function requires the \ref thirdpartyEigen library. -*/ - -template -Mesh_optimization_return_code -lloyd_optimize_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index e0a38426b13..307e18392de 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -8,7 +8,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index fd114c63866..3fa00ebf9aa 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -54,8 +54,8 @@ int main(int argc, char*argv[]) C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); - CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30); - CGAL::exude_mesh_3(c3t3_bis, CGAL::parameters::sliver_bound_new=10, CGAL::parameters::time_limit_new=10); + CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit_new=30); + CGAL::exude_mesh_3(c3t3_bis, sliver_bound_new=10, time_limit_new=10); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 8b3ec746e76..2726c9b92d9 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include #include @@ -29,44 +29,146 @@ #include #include -#include namespace CGAL { +/*! +\ingroup PkgMesh3Functions -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +The function `lloyd_optimize_mesh_3()` is a mesh optimization process +based on the minimization of a global energy function. -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted +as the \f$ L^1\f$-norm of the error achieved +when the function \f$ x^2\f$ is interpolated on the mesh domain +using a piecewise linear function which is linear +in each cell of the Voronoi diagram of the mesh vertices. -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - lloyd_optimize_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) ) - (optional - (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, parameters::default_values_for_mesh_3::lloyd_convergence_ratio ) - (freeze_bound_, *, parameters::default_values_for_mesh_3::lloyd_freeze_ratio ) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze )) -) +The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. +At each iteration, mesh vertices are moved into +positions that bring to zero the energy gradient +and the Delaunay triangulation is updated. +Vertices on the mesh boundaries are handled +in a special way so as to preserve an accurate +representation of the domain boundaries. + +\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 + +\tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. + +\tparam MD is required to be a model of the concept +`MeshDomain_3`. The argument `domain` must be the `MD` +object used to create the `c3t3` parameter. + +\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + +@param cdt the initial mesh that will be modified by the algorithm to represent the final optimized mesh. +@param domain ... +@param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + +\cgalNamedParamsBegin + \cgalParamNBegin{time_limit_new} + \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} + \cgalParamType{`double`} + \cgalParamExtra{\pre `time_limit_new` \f$ \geq\f$ 0} + \cgalParamDefault{0} + + \cgalParamNBegin{max_iteration_number_new} + \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + no limit on the number of performed iterations.} + \cgalParamExtra{\pre `max_iteration_number >=0`} + \cgalParamType{`int`} + \cgalParamDefault{0} + + + \cgalParamNBegin{freeze_bound_new} + \cgalParamDescription{designed to reduce running time of each optimization iteration. + Any vertex that has a displacement less than a given fraction of the length + of its shortest incident edge, is frozen (i.e.\ is not relocated). + The parameter `freeze_bound` gives the threshold ratio. + If it is set to 0, freezing of vertices is disabled.} + \cgalParamExtra{\pre `0<= freeze_bound <=1} + \cgalParamType{`double`} + \cgalParamDefault{0.001} + + \cgalParamNBegin{convergence_new} + \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + when at the last iteration the displacement of any vertex is less than + a given fraction of the length of the shortest edge incident to that vertex.} + \cgalParamExtra{\pre `0 <=convergence <= 1`} + \cgalParamType{`double`} + \cgalParamDefault{0.001} + + \cgalParamNBegin{do_freeze_new} + \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), + frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + moves, unfreezes all its incident vertices.} + \cgalParamType{`bool`} + \cgalParamDefault{true} + +\cgalNamedParamsEnd +\return +The function `lloyd_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. +
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion +is achieved. +
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the +`do_freeze` parameter is set to true. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because +most vertices have been frozen, and no better convergence can be reached. +
+ +\cgalHeading{Example} + + +\code{.cpp} +// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which +// 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); + +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` + +\note This function requires the \ref thirdpartyEigen library. +*/ +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain,const CGAL_NP_CLASS& np = parameters::default_values()) { - return lloyd_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_ - , do_freeze_); + 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 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); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) +{ + return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); +} +#endif //CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code @@ -106,10 +208,127 @@ lloyd_optimize_mesh_3_impl(C3T3& c3t3, // Launch optimization return opt(static_cast(max_iteration_number)); } +#else +namespace CGAL { +/*! +\ingroup PkgMesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `lloyd_optimize_mesh_3()` is a mesh optimization process +based on the minimization of a global energy function. + +In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted +as the \f$ L^1\f$-norm of the error achieved +when the function \f$ x^2\f$ is interpolated on the mesh domain +using a piecewise linear function which is linear +in each cell of the Voronoi diagram of the mesh vertices. + +The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. +At each iteration, mesh vertices are moved into +positions that bring to zero the energy gradient +and the Delaunay triangulation is updated. +Vertices on the mesh boundaries are handled +in a special way so as to preserve an accurate +representation of the domain boundaries. + +\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 + +\tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. + +\tparam MD is required to be a model of the concept +`MeshDomain_3`. The argument `domain` must be the `MD` +object used to create the `c3t3` parameter. + +The function has four optional parameters which are named parameters (we use the Boost.Parameter library). +Therefore, when calling the function, the parameters can be provided in any order +provided that the names of the parameters are used +(see example at the bottom of this page). + +\cgalHeading{Named Parameters} + +- `parameters::time_limit` +is used to set up, in seconds, +a CPU time limit after which the optimization process is stopped. This time is +measured using `Real_timer`. +The default value is 0 and means that there is no time limit. + +- `parameters::%max_iteration_number` sets a limit on the +number of performed iterations. The default value of 0 means that there is +no limit on the number of performed iterations. + +- `parameters::%convergence` is a stopping criterion based on convergence: +the optimization process is stopped, when at the last iteration, +the displacement of any vertex is less than a given percentage of the +length of the shortest edge incident to that vertex. +The parameter `convergence` gives the threshold ratio. + +- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex +that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is +not relocated). The parameter `freeze_bound` gives the threshold ratio. + +- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), +frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that +moves, unfreezes all its incident vertices. + + +\return +The function `lloyd_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. +
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion +is achieved. +
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the +`do_freeze` parameter is set to true. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because +most vertices have been frozen, and no better convergence can be reached. +
+ +\cgalHeading{Example} + + +\code{.cpp} +// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which +// 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); + +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` + +\note This function requires the \ref thirdpartyEigen library. +*/ + +template +Mesh_optimization_return_code +lloyd_optimize_mesh_3(C3T3& c3t3, + const MD& domain, + double parameters::time_limit=0, + std::size_t parameters::max_iteration_number=0, + double parameters::convergence=0.02, + double parameters::freeze_bound = 0.01, + bool parameters::do_freeze=true); + +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING } // end namespace CGAL -#include - #endif // CGAL_LLOYD_OPTIMIZE_MESH_3_H diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index b2d307db86e..cc441aba124 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -578,10 +578,10 @@ void refine_mesh_3_impl(C3T3& c3t3, { lloyd_optimize_mesh_3(c3t3, domain, - parameters::time_limit = lloyd.time_limit(), - parameters::max_iteration_number = lloyd.max_iteration_number(), - parameters::convergence = lloyd.convergence(), - parameters::freeze_bound = lloyd.bound()); + parameters::time_limit_new = lloyd.time_limit(), + parameters::max_iteration_number_new = lloyd.max_iteration_number(), + parameters::convergence_new = lloyd.convergence(), + parameters::freeze_bound_new = lloyd.bound()); } if( odt || lloyd) { diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index bb29b2d383c..068a3e495bc 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -87,7 +87,7 @@ void test() oss.clear(); //LLOYD (1) - CGAL::lloyd_optimize_mesh_3(c3t3, domain, max_iteration_number = nb_lloyd); + CGAL::lloyd_optimize_mesh_3(c3t3, domain, max_iteration_number_new = nb_lloyd); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+1] oss.clear(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index e9a2878ffe2..159bd61f160 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -184,8 +184,8 @@ struct Tester // Vertex number should not change (obvious) C3t3 lloyd_c3t3(c3t3); std::cerr << "Lloyd...\n"; - CGAL::lloyd_optimize_mesh_3(lloyd_c3t3, domain, CGAL::parameters::time_limit=5, - CGAL::parameters::convergence=0.001, CGAL::parameters::freeze_bound=0.0005); + CGAL::lloyd_optimize_mesh_3(lloyd_c3t3, domain, CGAL::parameters::time_limit_new=5, + CGAL::parameters::convergence_new=0.001, CGAL::parameters::freeze_bound_new=0.0005); verify_c3t3(lloyd_c3t3,domain,domain_type,v,v); verify_c3t3_volume(lloyd_c3t3, volume*0.95, volume*1.05); verify_c3t3_hausdorff_distance(lloyd_c3t3, domain, domain_type, hdist); From 0af311c0b33753ff782e0c2d9eb8d7b3e913275b Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Fri, 17 Jun 2022 14:30:25 +0530 Subject: [PATCH 015/248] New API support and docs for perturb_mesh_3.h --- Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h | 91 -------- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- .../Mesh_3/mesh_cubes_intersection.cpp | 2 +- .../mesh_cubes_intersection_with_features.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 4 +- .../Mesh_3/mesh_implicit_ellipsoid.cpp | 2 +- .../Mesh_3/mesh_optimization_example.cpp | 2 +- Mesh_3/include/CGAL/perturb_mesh_3.h | 218 +++++++++++++++--- Mesh_3/include/CGAL/refine_mesh_3.h | 4 +- .../test/Mesh_3/test_meshing_determinism.cpp | 2 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 2 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 4 +- .../include/CGAL/Named_function_parameters.h | 2 + .../internal/parameters_interface.h | 6 +- 14 files changed, 210 insertions(+), 134 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h deleted file mode 100644 index 216f3d5e662..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h +++ /dev/null @@ -1,91 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `perturb_mesh_3()` is a mesh optimizer that -improves the quality of a Delaunay mesh -by changing the positions of some vertices of the mesh. - -The perturber tries to improve the dihedral angles of the worst cells in the mesh -degree by degree: the -step number `n` is considered as successful -if after this step the worst tetrahedron of the mesh has a minimal dihedral -angle larger than `n` degrees. -The perturber exits if this is not the case. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has two optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::sliver_bound` -is designed to give, in degrees, a targeted -lower bound on dihedral angles of mesh cells. -The function `perturb_mesh_3()` runs as long as steps are successful -and step number `sliver_bound` (after which -the worst tetrahedron in the mesh has a smallest angle larger than -`sliver_bound` degrees) has not been reached. -The default value is 0 and means that there is no targeted bound: -the perturber then runs as long as -steps are successful. - - -\return -The function `perturb_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. -
- - -\cgalHeading{Example} - -\code{.cpp} -// Perturb until every dihedral angle of the mesh is >= 10 degrees -// No time bound is set -perturb_mesh_3(c3t3, - domain, - parameters::sliver_bound = 10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -perturb_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 307e18392de..eac8697ced5 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -9,7 +9,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 6cd90e2e3fe..38f4363a04b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -84,7 +84,7 @@ int main() C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); // Exudation CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index a32b9603115..9ef132eaf23 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -171,7 +171,7 @@ int main() C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); // Exudation CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index ad284862d75..b3adb97954d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -60,10 +60,10 @@ int main() C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); // Exudation - CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); + CGAL::exude_mesh_3(c3t3, time_limit_new=12); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp index 9e28374783e..4f3ee34b2e7 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp @@ -59,7 +59,7 @@ int main() medit_file.close(); // Perturbation (5s, 12degree) - CGAL::perturb_mesh_3(c3t3, domain, time_limit=5, sliver_bound=12); + CGAL::perturb_mesh_3(c3t3, domain, time_limit_new=5, sliver_bound_new=12); // Exudation CGAL::exude_mesh_3(c3t3); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index 9f72d6c276a..1053b4f1d21 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -55,7 +55,7 @@ int main(int argc, char* argv[]) C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); - CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit=15); + CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit_new=15); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 669fad1dfb0..e09b3854b25 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -34,41 +34,108 @@ #include namespace CGAL { +/*! +\ingroup PkgMesh3Functions -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +The function `perturb_mesh_3()` is a mesh optimizer that +improves the quality of a Delaunay mesh +by changing the positions of some vertices of the mesh. -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +The perturber tries to improve the dihedral angles of the worst cells in the mesh +degree by degree: the +step number `n` is considered as successful +if after this step the worst tetrahedron of the mesh has a minimal dihedral +angle larger than `n` degrees. +The perturber exits if this is not the case. -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - perturb_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) ) - (optional - (time_limit_, *, 0 ) - (sliver_bound_, *, parameters::default_values_for_mesh_3::perturb_sliver_bound ) - (sliver_criterion_, *, - parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound_)) - (perturbation_vector_, *, - default_perturbation_vector(c3t3,domain,sliver_criterion_)) - ) -) +\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 + +\tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3`, passed by +reference, provides the initial mesh +and is modified by the algorithm +to represent the final optimized mesh. + +\tparam MD is required to be a model of the concept +`MeshDomain_3`. The argument `domain` must be the `MD` +object used to create the `c3t3` parameter. + +\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + @param domain ... + @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + + \cgalNamedParamsBegin + \cgalParamNBegin{time_limit_new} + \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + is stopped. This time is measured using the `Real_timer` class. The default value is + 0 and means that there is no time limit.} + \cgalParamType{`double`} + \cgalParamDefault{0} + \cgalParamNBegin{sliver_bound_new} + \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + The exudation process considers in turn all the mesh cells that have a smallest dihedral + angle less than sliver_bound and tries to make them disappear by weighting their vertices. + The optimization process stops when every cell in the mesh achieves this quality. The + default value is 0 and means that there is no targeted bound: the exuder then runs as long + as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + \cgalParamType{`double`} + \cgalParamDefault{0} +\cgalNamedParamsEnd + + +\return +The function `perturb_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. +
+ + +\cgalHeading{Example} + +\code{.cpp} +// Perturb until every dihedral angle of the mesh is >= 10 degrees +// No time bound is set +perturb_mesh_3(c3t3, + domain, + parameters::sliver_bound = 10); +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` + +*/ + + +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - CGAL_USE(sliver_bound_); - return perturb_mesh_3_impl(c3t3, domain, time_limit_, sliver_criterion_, - perturbation_vector_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE + template + Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) + { + return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); + } +#endif //CGAL_NO_DEPRECATED_CODE template `parameters::time_limit` +is used to set up, in seconds, +a CPU time limit after which the optimization process is stopped. This time is +measured using `Real_timer`. +The default value is 0 and means that there is no time limit. + +- `parameters::sliver_bound` +is designed to give, in degrees, a targeted +lower bound on dihedral angles of mesh cells. +The function `perturb_mesh_3()` runs as long as steps are successful +and step number `sliver_bound` (after which +the worst tetrahedron in the mesh has a smallest angle larger than +`sliver_bound` degrees) has not been reached. +The default value is 0 and means that there is no targeted bound: +the perturber then runs as long as +steps are successful. +\return +The function `perturb_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` +which is: +
    +
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. +
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. +
  • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. +
+ + +\cgalHeading{Example} + +\code{.cpp} +// Perturb until every dihedral angle of the mesh is >= 10 degrees +// No time bound is set +perturb_mesh_3(c3t3, + domain, + parameters::sliver_bound = 10); +\endcode + +\sa `CGAL::Mesh_optimization_return_code` +\sa `CGAL::make_mesh_3()` +\sa `CGAL::refine_mesh_3()` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` + +*/ + +template +Mesh_optimization_return_code +perturb_mesh_3(C3T3& c3t3, + const MD& domain, + double parameters::time_limit=0, + double parameters::sliver_bound=0); + +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING } //namespace CGAL diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index cc441aba124..1c0e5f2035d 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -598,8 +598,8 @@ void refine_mesh_3_impl(C3T3& c3t3, perturb_mesh_3(c3t3, domain, - parameters::time_limit = perturb_time_limit, - parameters::sliver_bound = perturb.bound()); + parameters::time_limit_new = perturb_time_limit, + parameters::sliver_bound_new = perturb.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index 068a3e495bc..000202adef4 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -109,7 +109,7 @@ void test() oss.clear(); //PERTURB (3) - CGAL::perturb_mesh_3(c3t3, domain, sliver_bound=perturb_bound); + CGAL::perturb_mesh_3(c3t3, domain, sliver_bound_new=perturb_bound); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+3] oss.clear(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 159bd61f160..03a123aca35 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -164,7 +164,7 @@ struct Tester // Quality should increase C3t3 perturb_c3t3(c3t3); std::cerr << "Perturb...\n"; - CGAL::perturb_mesh_3(perturb_c3t3, domain, CGAL::parameters::time_limit=5); + CGAL::perturb_mesh_3(perturb_c3t3, domain, CGAL::parameters::time_limit_new =5); verify_c3t3(perturb_c3t3,domain,domain_type,v,v); verify_c3t3_quality(c3t3,perturb_c3t3); verify_c3t3_volume(perturb_c3t3, volume*0.95, volume*1.05); 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 22a1cf99fd8..87833d80c00 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 @@ -284,8 +284,8 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, perturb_time_limit = perturb.time_limit(); perturb_mesh_3(c3t3, domain, - parameters::time_limit = perturb_time_limit, - parameters::sliver_bound = perturb.bound()); + parameters::time_limit_new = perturb_time_limit, + parameters::sliver_bound_new = perturb.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 913def099b1..2ac35c9ec46 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -343,6 +343,8 @@ const Boost_parameter_compatibility_wrapper seeds_end_new; const Boost_parameter_compatibility_wrapper mark_new; const Boost_parameter_compatibility_wrapper do_freeze_new; +const Boost_parameter_compatibility_wrapper sliver_criterion_new; +const Boost_parameter_compatibility_wrapper perturbation_vector_new; //Compatibility wrappers for exude_mesh_3.h const Boost_parameter_compatibility_wrapper sliver_bound_new; #endif diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 8bf45442913..a56cc034084 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -251,4 +251,8 @@ CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_ //List of named parameters used in exude_mesh_3.h CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) -CGAL_add_named_parameter(freeze_t,freeze,freeze) \ No newline at end of file +CGAL_add_named_parameter(freeze_t,freeze,freeze) + +//List of named parameters used in perturb_mesh_3.h +CGAL_add_named_parameter(sliver_criteria_t, sliver_criteria, sliver_criteria) +CGAL_add_named_parameter(perturb_vector_t, perturb_vector, perturb_vector) From 93514bd82621d2664d26f01ec6a942ac33a0c74f Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Mon, 20 Jun 2022 18:31:49 +0530 Subject: [PATCH 016/248] New API support and doc for refine_mesh_3.h --- Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h | 158 ----- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- .../Mesh_3/mesh_polyhedral_domain.cpp | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 5 +- Mesh_3/include/CGAL/refine_mesh_3.h | 632 ++++++++++++++---- .../Mesh_3/test_meshing_3D_gray_image.cpp | 2 +- .../test_meshing_3D_gray_image_deprecated.cpp | 2 +- .../Mesh_3/test_meshing_implicit_function.cpp | 4 +- ...t_meshing_implicit_function_deprecated.cpp | 4 +- .../test/Mesh_3/test_meshing_polyhedron.cpp | 4 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 12 +- .../include/CGAL/Named_function_parameters.h | 19 + .../internal/parameters_interface.h | 21 + 13 files changed, 546 insertions(+), 322 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h index 25ddc7311ed..73c6ba18270 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h @@ -1,163 +1,5 @@ namespace CGAL { -/*! -\ingroup PkgMesh3Functions - -The function `refine_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_mesh_3()` may be used to refine a previously -computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); - -CGAL::refine_mesh_3(c3t3, domain, new_criteria); -\endcode - -Please note that we guarantee the result if and only if the domain does -not change from one refinement to the next one. - - -\tparam C3T3 is required to be a model of -the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3` is passed by -reference as this object is modified by the refinement process. As the -refinement process only adds points to the triangulation, all -vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. Object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3` or of the refined concept -`MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` -if the domain has exposed features. The argument `criteria` of -type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalHeading{Named Parameters} -- `manifold` allows the user to drive the meshing algorithm, -and ensure that the output mesh surface follows the given manifold criterion. -It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` -and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold -surface if the input surface is not manifold. - -- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_mesh_3()` is used for this parameter. - -- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_mesh_3()` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_mesh_3()` is used for this parameter. - -- `perturb` `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_mesh_3()` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::parameters::manifold` -\sa `CGAL::parameters::manifold_with_boundary` -\sa `CGAL::parameters::non_manifold` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::parameters::exude` -\sa `CGAL::parameters::no_exude` -\sa `CGAL::parameters::perturb` -\sa `CGAL::parameters::no_perturb` -\sa `CGAL::parameters::lloyd` -\sa `CGAL::parameters::no_lloyd` -\sa `CGAL::parameters::odt` -\sa `CGAL::parameters::no_odt` - -*/ - -template -void refine_mesh_3(C3T3& c3t3, - const MD& mesh_domain, - const MC& mesh_criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude(), - parameters::internal::Manifold_options manifold = parameters::non_manifold()); - namespace parameters { /*! diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index eac8697ced5..4e3c799b245 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -10,7 +10,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index f5cf67e0204..8598715077c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -68,7 +68,7 @@ int main(int argc, char*argv[]) Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); // Mesh refinement (and make the output manifold) - CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold()); + CGAL::refine_mesh_3(c3t3, domain, new_criteria, CGAL::parameters::manifold_options_param_new = manifold()); // Output medit_file.open("out_2.mesh"); diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index a75e120da69..ab440913779 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -466,8 +466,9 @@ void make_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process // Don't reset c3t3 as we just created it refine_mesh_3(c3t3, domain, criteria, - exude, perturb, odt, lloyd, parameters::no_reset_c3t3(), mesh_options, - manifold_options); + parameters::exude_param_new=exude, parameters::perturb_param_new=perturb, parameters::odt_param_new=odt, parameters::lloyd_param_new= lloyd, + parameters::reset_param_new=parameters::no_reset_c3t3(), parameters::mesh_options_param_new= mesh_options, + parameters::manifold_options_param_new= manifold_options); } } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 1c0e5f2035d..5ceeabc8a74 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -238,111 +238,154 @@ struct Mesh_3_options { } // end namespace internal -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - // ----------------------------------- // Perturb // ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Perturb_options), perturb, tag, - (optional (time_limit_, *, internal::undef_parameter ) - (sliver_bound_, *, default_values_for_mesh_3::perturb_sliver_bound ))) + +template +internal::Perturb_options perturb(const CGAL_NP_CLASS& np = parameters::default_values()) { - internal::Perturb_options options(true); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - if ( internal::undef_parameter != time_limit_ ) - options.set_time_limit(time_limit_); + internal::Perturb_options options(true); - options.set_bound(sliver_bound_); + if ( internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); - return options; + options.set_bound(sliver_bound); + + return options; } +#ifndef CGAL_NO_DEPRECATED_CODE +template +internal::Perturb_options perturb(const NP_Pack& ...nps) +{ + return perturb(internal_np::combine_named_parameters(nps...)); +} +#endif + + inline internal::Perturb_options no_perturb() { return internal::Perturb_options(false); } // ----------------------------------- // Exude // ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Exude_options), exude, tag, - (optional (time_limit_, *, internal::undef_parameter ) - (sliver_bound_, *, default_values_for_mesh_3::exude_sliver_bound ))) +template +internal::Exude_options exude(const CGAL_NP_CLASS& np = parameters::default_values()) { - internal::Exude_options options(true); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - if ( internal::undef_parameter != time_limit_ ) - options.set_time_limit(time_limit_); + internal::Exude_options options(true); - options.set_bound(sliver_bound_); + if ( internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); - return options; + options.set_bound(sliver_bound); + + return options; } +#ifndef CGAL_NO_DEPRECATED_CODE +template +internal::Exude_options exude(const NP_Pack& ...nps) +{ + return perturb(internal_np::combine_named_parameters(nps...)); +} +#endif inline internal::Exude_options no_exude() { return internal::Exude_options(false); } // ----------------------------------- // Odt // ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Odt_options), odt, tag, - (optional (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, default_values_for_mesh_3::odt_convergence_ratio ) - (freeze_bound_, *, default_values_for_mesh_3::odt_freeze_ratio ))) +template +internal::Odt_options odt(const CGAL_NP_CLASS& np = parameters::default_values()) { - internal::Odt_options options(true); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::odt_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::odt_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); + internal::Odt_options options(true); - options.set_time_limit(time_limit_); - options.set_bound(freeze_bound_); - options.set_convergence(convergence_); - options.set_max_iteration_number(max_iteration_number_); + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); - return options; + return options; } +#ifndef CGAL_NO_DEPRECATED_CODE +template +internal::Odt_options Odt(const NP_Pack& ...nps) +{ + return Odt(internal_np::combine_named_parameters(nps...)); +} +#endif inline internal::Odt_options no_odt() { return internal::Odt_options(false); } // ----------------------------------- // Lloyd // ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Lloyd_options), lloyd, tag, - (optional (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, default_values_for_mesh_3::lloyd_convergence_ratio ) - (freeze_bound_, *, default_values_for_mesh_3::lloyd_freeze_ratio ))) +template +internal::Lloyd_options lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) { - internal::Lloyd_options options(true); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::lloyd_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::lloyd_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); + internal::Lloyd_options options(true); - options.set_time_limit(time_limit_); - options.set_bound(freeze_bound_); - options.set_convergence(convergence_); - options.set_max_iteration_number(max_iteration_number_); + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); - return options; + return options; } +#ifndef CGAL_NO_DEPRECATED_CODE +template +internal::Lloyd_options lloyd(const NP_Pack& ...nps) +{ + return lloyd(internal_np::combine_named_parameters(nps...)); +} +#endif inline internal::Lloyd_options no_lloyd() { return internal::Lloyd_options(false); } // ----------------------------------- // Manifold options ------------------ // ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Manifold_options), manifold_options, tag, - (optional - (mesh_topology_, (int), -1) - ) - ) +template +internal::Manifold_options manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) { - internal::Manifold_options options; - options.mesh_topology = mesh_topology_; - return options; + using parameters::choose_parameter; + using parameters::get_parameter; + int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); + internal::Manifold_options options; + options.mesh_topology = mesh_topology; + return options; } +#ifndef CGAL_NO_DEPRECATED_CODE +template +internal::Manifold_options manifold_options(const NP_Pack& ...nps) +{ + return manifold_options(internal_np::combine_named_parameters(nps...)); +} +#endif + inline internal::Manifold_options manifold() { return internal::Manifold_options( @@ -366,41 +409,37 @@ inline internal::Manifold_options non_manifold() // Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. // Allows to dump the mesh at given stage of the mesh generation // algorithm. -BOOST_PARAMETER_FUNCTION((internal::Mesh_3_options), mesh_3_options, tag, - (optional - (dump_after_init_prefix_, (std::string), "" ) - (dump_after_refine_surface_prefix_, (std::string), "" ) - (dump_after_refine_prefix_, (std::string), "" ) - (dump_after_glob_opt_prefix_, (std::string), "" ) - (dump_after_perturb_prefix_, (std::string), "" ) - (dump_after_exude_prefix_, (std::string), "" ) - (number_of_initial_points_, (int), -1) - (maximal_number_of_vertices_, (std::size_t), 0) - (nonlinear_growth_of_balls_, (bool), false) - (pointer_to_error_code_, (Mesh_error_code*), ((Mesh_error_code*)0)) - (pointer_to_stop_atomic_boolean_, (internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t), ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)) - ) - ) + +template +internal::Mesh_3_options mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) { - internal::Mesh_3_options options; + using parameters::choose_parameter; + using parameters::get_parameter; + internal::Mesh_3_options options; - options.dump_after_init_prefix=dump_after_init_prefix_; - options.dump_after_refine_surface_prefix=dump_after_refine_surface_prefix_; - options.dump_after_refine_prefix=dump_after_refine_prefix_; - options.dump_after_glob_opt_prefix=dump_after_glob_opt_prefix_; - options.dump_after_perturb_prefix=dump_after_perturb_prefix_; - options.dump_after_exude_prefix=dump_after_exude_prefix_; - options.number_of_initial_points=number_of_initial_points_; - options.nonlinear_growth_of_balls = nonlinear_growth_of_balls_; - options.maximal_number_of_vertices=maximal_number_of_vertices_; - options.pointer_to_error_code=pointer_to_error_code_; + options.dump_after_init_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_init_prefix_param), ""); + options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); + options.dump_after_refine_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_prefix_param), ""); + options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_glob_opt_prefix_param), ""); + options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_perturb_prefix_param), ""); + options.dump_after_exude_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); + options.number_of_initial_points=choose_parameter(get_parameter(np, internal_np::number_of_initial_points_param), -1); + options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, internal_np::nonlinear_growth_of_balls_param), false); + options.maximal_number_of_vertices=choose_parameter(get_parameter(np, internal_np::maximal_number_of_vertices_param), 0); + options.pointer_to_error_code=choose_parameter(get_parameter(np, internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); #ifndef CGAL_NO_ATOMIC - options.pointer_to_stop_atomic_boolean=pointer_to_stop_atomic_boolean_; + options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), + ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); #endif - - return options; + return options; } - +#ifndef CGAL_NO_DEPRECATED_CODE +template +internal::Mesh_3_options manifold_options(const NP_Pack& ...nps) +{ + return mesh_3_options(internal_np::combine_named_parameters(nps...)); +} +#endif // Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. // Default Mesh_3_options: dump at every stage of the mesh generation. inline internal::Mesh_3_options mesh_3_dump() @@ -417,87 +456,227 @@ inline internal::Mesh_3_options mesh_3_dump() return options; } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - // ----------------------------------- // Reset_c3t3 (undocumented) // ----------------------------------- CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) // CGAL_BOOLEAN_PARAMETER defined in - // see -CGAL_PRAGMA_DIAG_PUSH + CGAL_PRAGMA_DIAG_PUSH // see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS + CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS // ----------------------------------- // Parameters // ----------------------------------- -BOOST_PARAMETER_NAME( exude_param ) -BOOST_PARAMETER_NAME( perturb_param ) -BOOST_PARAMETER_NAME( odt_param ) -BOOST_PARAMETER_NAME( lloyd_param ) -BOOST_PARAMETER_NAME( reset_param ) -BOOST_PARAMETER_NAME( mesh_options_param ) -BOOST_PARAMETER_NAME( manifold_options_param ) + BOOST_PARAMETER_NAME( exude_param ) + BOOST_PARAMETER_NAME( perturb_param ) + BOOST_PARAMETER_NAME( odt_param ) + BOOST_PARAMETER_NAME( lloyd_param ) + BOOST_PARAMETER_NAME( reset_param ) + BOOST_PARAMETER_NAME( mesh_options_param ) + BOOST_PARAMETER_NAME( manifold_options_param ) -CGAL_PRAGMA_DIAG_POP + CGAL_PRAGMA_DIAG_POP } // end namespace parameters +/*! +\ingroup PkgMesh3Functions + +The function `refine_mesh_3()` is a 3D +mesh generator. It produces simplicial meshes which discretize +3D domains. + +The mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. +The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, +etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd smoothing, a sliver perturber, and a sliver exuder. +Each optimization process +can be activated or not, +according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward. + +\attention The function template `refine_mesh_3()` may be used to refine a previously +computed mesh, e.g.: +\code{.cpp} +C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); + +CGAL::refine_mesh_3(c3t3, domain, new_criteria); +\endcode + +Please note that we guarantee the result if and only if the domain does +not change from one refinement to the next one. -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +\tparam C3T3 is required to be a model of +the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3` is passed by +reference as this object is modified by the refinement process. As the +refinement process only adds points to the triangulation, all +vertices of the triangulation of `c3t3` remain in the +mesh during the refinement process. Object `c3t3` can be used to insert +specific points in the domain to ensure that they will be contained in the +final triangulation. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D triangulation +embedding the mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `MeshCellBase_3` +respectively. -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +\tparam MD is required to be a model of +the concept `MeshDomain_3` or of the refined concept +`MeshDomainWithFeatures_3` if 0 and 1-dimensional features +of the input complex have to be accurately represented in the mesh. +The argument `domain` +is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. -BOOST_PARAMETER_FUNCTION( - (void), - refine_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (exude_param, (parameters::internal::Exude_options), parameters::exude()) - (perturb_param, (parameters::internal::Perturb_options), parameters::perturb()) - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (reset_param, (parameters::Reset), parameters::reset_c3t3()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) -) +\tparam MC is required to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` +if the domain has exposed features. The argument `criteria` of +type `MC` specifies the +size and shape requirements for mesh tetrahedra +and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +The four additional parameters are optimization parameters. +They control which optimization processes are performed +and allow the user to tune the parameters of the optimization processes. +Individual optimization parameters are not described here as they are +internal types (see instead the documentation page of each optimizer). +For each optimization algorithm, there exist two global functions +that allow to enable or disable the optimizer: + +\cgalNamedParamsBegin + \cgalParamNBegin{manifold_options_param_new} + \cgalParamDescription{allows the user to drive the meshing algorithm, + and ensure that the output mesh surface follows the given manifold criterion. + It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` + and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold + surface if the input surface is not manifold.} + \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} + \cgalParamDefault{`parameters::non_manifold()`} + + \cgalParamNBegin{lloyd_param_new} + \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to + trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the + parameters of this optimizer. If one parameter is not set, the default value of + `lloyd_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} + \cgalParamDefault{'parameters::no_lloyd()'} + + \cgalParamNBegin{odt_param_new} + \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to + trigger or not a call to `odt_optimize_mesh_3()` function and + to set the parameters of this optimizer. + If one parameter is not set, the default value of + `odt_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} + \cgalParamDefault{`parameters::no_odt()`} + + \cgalParamNBegin{perturb_param_new} + \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to + trigger or not a call to `perturb_mesh_3()` function and + to set the parameters of this optimizer. If one parameter is not set, the default value of + `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} + \cgalParamDefault{'parameters::no_perturb`} + + \cgalParamNBegin{exude_param_new} + \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to + trigger or not a call to `exude_mesh_3()` function and to override to set the + parameters of this optimizer. If one parameter is not set, the default value of + `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} + \cgalParamDefault{'parameters::no_exude`} + +\cgalNamedParamsEnd + +The optimization parameters can be passed in arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `CGAL::make_mesh_3()` +\sa `CGAL::parameters::manifold` +\sa `CGAL::parameters::manifold_with_boundary` +\sa `CGAL::parameters::non_manifold` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` +\sa `CGAL::parameters::exude` +\sa `CGAL::parameters::no_exude` +\sa `CGAL::parameters::perturb` +\sa `CGAL::parameters::no_perturb` +\sa `CGAL::parameters::lloyd` +\sa `CGAL::parameters::no_lloyd` +\sa `CGAL::parameters::odt` +\sa `CGAL::parameters::no_odt` + */ + +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - return refine_mesh_3_impl(c3t3, - domain, - criteria, - exude_param, - perturb_param, - odt_param, - lloyd_param, - reset_param(), - mesh_options_param, - manifold_options_param); + 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::exude()); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb()); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); + parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3()); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + return refine_mesh_3_impl(c3t3, + domain, + criteria, + exude_param, + perturb_param, + odt_param, + lloyd_param, + reset_param(), + mesh_options_param, + manifold_options_param); } - -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE + template + void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) + { + return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); + } #endif /** @@ -619,9 +798,170 @@ void refine_mesh_3_impl(C3T3& c3t3, dump_c3t3(c3t3, mesh_options.dump_after_exude_prefix); } } +#else +namespace CGAL { +/*! +\ingroup PkgMesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `refine_mesh_3()` is a 3D +mesh generator. It produces simplicial meshes which discretize +3D domains. + +The mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. +The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, +etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd smoothing, a sliver perturber, and a sliver exuder. +Each optimization process +can be activated or not, +according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward. + +\attention The function template `refine_mesh_3()` may be used to refine a previously +computed mesh, e.g.: +\code{.cpp} +C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); + +CGAL::refine_mesh_3(c3t3, domain, new_criteria); +\endcode + +Please note that we guarantee the result if and only if the domain does +not change from one refinement to the next one. + + +\tparam C3T3 is required to be a model of +the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3` is passed by +reference as this object is modified by the refinement process. As the +refinement process only adds points to the triangulation, all +vertices of the triangulation of `c3t3` remain in the +mesh during the refinement process. Object `c3t3` can be used to insert +specific points in the domain to ensure that they will be contained in the +final triangulation. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D triangulation +embedding the mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `MeshCellBase_3` +respectively. + +\tparam MD is required to be a model of +the concept `MeshDomain_3` or of the refined concept +`MeshDomainWithFeatures_3` if 0 and 1-dimensional features +of the input complex have to be accurately represented in the mesh. +The argument `domain` +is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + +\tparam MC is required to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` +if the domain has exposed features. The argument `criteria` of +type `MC` specifies the +size and shape requirements for mesh tetrahedra +and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +The four additional parameters are optimization parameters. +They control which optimization processes are performed +and allow the user to tune the parameters of the optimization processes. +Individual optimization parameters are not described here as they are +internal types (see instead the documentation page of each optimizer). +For each optimization algorithm, there exist two global functions +that allow to enable or disable the optimizer: + +\cgalHeading{Named Parameters} +- `manifold` allows the user to drive the meshing algorithm, +and ensure that the output mesh surface follows the given manifold criterion. +It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` +and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold +surface if the input surface is not manifold. + +- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to +trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the +parameters of this optimizer. If one parameter is not set, the default value of +`lloyd_optimize_mesh_3()` is used for this parameter. + +- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to +trigger or not a call to `odt_optimize_mesh_3()` function and +to set the parameters of this optimizer. +If one parameter is not set, the default value of +`odt_optimize_mesh_3()` is used for this parameter. + +- `perturb` `parameters::perturb()` and `parameters::no_perturb()` are designed to +trigger or not a call to `perturb_mesh_3()` function and +to set the parameters of this optimizer. If one parameter is not set, the default value of +`perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to +trigger or not a call to `exude_mesh_3()` function and to override to set the +parameters of this optimizer. If one parameter is not set, the default value of +`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +The optimization parameters can be passed in arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `CGAL::make_mesh_3()` +\sa `CGAL::parameters::manifold` +\sa `CGAL::parameters::manifold_with_boundary` +\sa `CGAL::parameters::non_manifold` +\sa `CGAL::exude_mesh_3()` +\sa `CGAL::perturb_mesh_3()` +\sa `CGAL::lloyd_optimize_mesh_3()` +\sa `CGAL::odt_optimize_mesh_3()` +\sa `CGAL::parameters::exude` +\sa `CGAL::parameters::no_exude` +\sa `CGAL::parameters::perturb` +\sa `CGAL::parameters::no_perturb` +\sa `CGAL::parameters::lloyd` +\sa `CGAL::parameters::no_lloyd` +\sa `CGAL::parameters::odt` +\sa `CGAL::parameters::no_odt` + +*/ + +template +void refine_mesh_3(C3T3& c3t3, + const MD& mesh_domain, + const MC& mesh_criteria, + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude(), + parameters::internal::Manifold_options manifold = parameters::non_manifold()); +} +#endif // DOXYGEN_RUNNING } // end namespace CGAL -#include #endif // CGAL_REFINE_MESH_3_H diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index 191ea47fafa..eb41399c0d5 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -84,7 +84,7 @@ public: C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude(), - mesh_3_options(number_of_initial_points = 30), + mesh_3_options(number_of_initial_points_new = 30), non_manifold() ); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp index b2ba365111f..e9105ff2a9e 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp @@ -76,7 +76,7 @@ public: C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude(), - mesh_3_options(number_of_initial_points = 30), + mesh_3_options(number_of_initial_points_new = 30), non_manifold() ); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp index 58eab9a7500..c2a0fe8f0fe 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp @@ -68,8 +68,8 @@ struct Implicit_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp index 6a7a8aa0b57..9949d92f5b9 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp @@ -66,8 +66,8 @@ struct Implicit_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp index b758086448e..3da362738d5 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp @@ -80,8 +80,8 @@ struct Polyhedron_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 03a123aca35..64245d8726a 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -118,9 +118,9 @@ struct Tester // Refine again and verify nothing changed std::cerr << "Refining again...\n"; refine_mesh_3(c3t3,domain,criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb(), - CGAL::parameters::no_reset_c3t3()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb(), + CGAL::parameters::reset_param_new = CGAL::parameters::no_reset_c3t3()); #ifndef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE // Using adjacencies instead of calling oracle to update restricted @@ -134,9 +134,9 @@ struct Tester v = c3t3.triangulation().number_of_vertices(); refine_mesh_3(c3t3,domain,criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb(), - CGAL::parameters::no_reset_c3t3()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb(), + CGAL::parameters::reset_param_new = CGAL::parameters::no_reset_c3t3()); } f = c3t3.number_of_facets_in_complex(); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 2ac35c9ec46..6aa6bd51b6d 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -347,6 +347,25 @@ const Boost_parameter_compatibility_wrapper sliv const Boost_parameter_compatibility_wrapper perturbation_vector_new; //Compatibility wrappers for exude_mesh_3.h const Boost_parameter_compatibility_wrapper sliver_bound_new; +const Boost_parameter_compatibility_wrapper mesh_topology_new; +const Boost_parameter_compatibility_wrapper dump_after_init_prefix_new; +const Boost_parameter_compatibility_wrapper dump_after_refine_surface_prefix_new; +const Boost_parameter_compatibility_wrapper dump_after_refine_prefix_new; +const Boost_parameter_compatibility_wrapper dump_after_glob_opt_prefix_new; +const Boost_parameter_compatibility_wrapper dump_after_perturb_prefix_new; +const Boost_parameter_compatibility_wrapper dump_after_exude_prefix_new; +const Boost_parameter_compatibility_wrapper number_of_initial_points_new; +const Boost_parameter_compatibility_wrapper maximal_number_of_vertices_new; +const Boost_parameter_compatibility_wrapper nonlinear_growth_of_balls_new; +const Boost_parameter_compatibility_wrapper pointer_to_error_code_new; +const Boost_parameter_compatibility_wrapper pointer_to_stop_atomic_boolean_new; +const Boost_parameter_compatibility_wrapper exude_param_new; +const Boost_parameter_compatibility_wrapper perturb_param_new; +const Boost_parameter_compatibility_wrapper odt_param_new; +const Boost_parameter_compatibility_wrapper lloyd_param_new; +const Boost_parameter_compatibility_wrapper reset_param_new; +const Boost_parameter_compatibility_wrapper mesh_options_param_new; +const Boost_parameter_compatibility_wrapper manifold_options_param_new; #endif // function to extract a parameter diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index a56cc034084..e723acf187e 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -256,3 +256,24 @@ CGAL_add_named_parameter(freeze_t,freeze,freeze) //List of named parameters used in perturb_mesh_3.h CGAL_add_named_parameter(sliver_criteria_t, sliver_criteria, sliver_criteria) CGAL_add_named_parameter(perturb_vector_t, perturb_vector, perturb_vector) + +//List of named parameters used in refine_mesh_3.h +CGAL_add_named_parameter(mesh_topology_number_t, mesh_topology_number, mesh_topology_number) +CGAL_add_named_parameter(dump_after_init_prefix_param_t, dump_after_init_prefix_param, dump_after_init_prefix_param) +CGAL_add_named_parameter(dump_after_refine_surface_prefix_param_t, dump_after_refine_surface_prefix_param, dump_after_refine_surface_prefix_param) +CGAL_add_named_parameter(dump_after_refine_prefix_param_t, dump_after_refine_prefix_param, dump_after_refine_prefix_param) +CGAL_add_named_parameter(dump_after_glob_opt_prefix_param_t, dump_after_glob_opt_prefix_param, dump_after_glob_opt_prefix_param) +CGAL_add_named_parameter(dump_after_perturb_prefix_param_t, dump_after_perturb_prefix_param, dump_after_perturb_prefix_param) +CGAL_add_named_parameter(dump_after_exude_prefix_param_t, dump_after_exude_prefix_param, dump_after_exude_prefix_param) +CGAL_add_named_parameter(number_of_initial_points_param_t, number_of_initial_points_param, number_of_initial_points_param) +CGAL_add_named_parameter(maximal_number_of_vertices_param_t, maximal_number_of_vertices_param, maximal_number_of_vertices_param) +CGAL_add_named_parameter(nonlinear_growth_of_balls_param_t, nonlinear_growth_of_balls_param, nonlinear_growth_of_balls_param) +CGAL_add_named_parameter(pointer_to_error_code_param_t, pointer_to_error_code_param, pointer_to_error_code_param) +CGAL_add_named_parameter(pointer_to_stop_atomic_boolean_param_t, pointer_to_stop_atomic_boolean_param, pointer_to_stop_atomic_boolean_param) +CGAL_add_named_parameter(exude_options_param_t, exude_options_param, exude_options_param) +CGAL_add_named_parameter(perturb_options_param_t, perturb_options_param, perturb_options_param) +CGAL_add_named_parameter(odt_options_param_t, odt_options_param, odt_options_param) +CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_options_param) +CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options_param) +CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_param) +CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_param) From 109d74466d4efa6770c5749c6ec5d75577be477d Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 21 Jun 2022 14:11:49 +0530 Subject: [PATCH 017/248] New API support and docs for make_mesh_3.h --- .../random_points_in_tetrahedral_mesh_3.cpp | 2 +- .../random_points_on_tetrahedral_mesh_3.cpp | 2 +- Mesh_3/benchmark/Mesh_3/concurrency.cpp | 42 +- Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h | 167 -------- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- .../Mesh_3/mesh_cubes_intersection.cpp | 4 +- .../mesh_cubes_intersection_with_features.cpp | 2 +- .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 2 +- .../Mesh_3/mesh_implicit_domains_2.cpp | 2 +- .../Mesh_3/mesh_implicit_ellipsoid.cpp | 2 +- .../mesh_implicit_sphere_variable_size.cpp | 2 +- .../Mesh_3/mesh_optimization_example.cpp | 6 +- .../mesh_optimization_lloyd_example.cpp | 8 +- .../Mesh_3/mesh_polyhedral_domain.cpp | 4 +- .../Mesh_3/mesh_polyhedral_domain_sm.cpp | 2 +- ..._polyhedral_domain_with_surface_inside.cpp | 2 +- .../mesh_two_implicit_spheres_with_balls.cpp | 2 +- .../Mesh_3/remesh_polyhedral_surface.cpp | 2 +- .../Mesh_3/remesh_polyhedral_surface_sm.cpp | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 403 ++++++++++++++++-- ...est_c3t3_extract_subdomains_boundaries.cpp | 2 +- Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp | 2 +- .../Mesh_3/test_meshing_3D_gray_image.cpp | 8 +- .../test_meshing_3D_gray_image_deprecated.cpp | 8 +- Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp | 4 +- .../test_meshing_3D_image_deprecated.cpp | 4 +- .../test/Mesh_3/test_meshing_determinism.cpp | 4 +- .../test_meshing_polyhedron_with_features.cpp | 6 +- .../poisson_and_parallel_mesh_3.cpp | 2 +- .../include/CGAL/Named_function_parameters.h | 1 + .../internal/parameters_interface.h | 1 + .../test_mesh_and_remesh_image.cpp | 2 +- 33 files changed, 428 insertions(+), 279 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h diff --git a/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp b/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp index 79a1ea4fd14..86be1b6e2ca 100644 --- a/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp +++ b/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp @@ -51,7 +51,7 @@ int main() Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Create the generator, input is the C3t3 c3t3 Random_points_in_tetrahedral_mesh_3 g(c3t3); diff --git a/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp b/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp index d564ee7c2f3..0d24d88d5b0 100644 --- a/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp +++ b/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp @@ -50,7 +50,7 @@ int main() Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Create the generator, input is the C3t3 c3t3 Random_points_in_tetrahedral_mesh_boundary_3 g(c3t3); diff --git a/Mesh_3/benchmark/Mesh_3/concurrency.cpp b/Mesh_3/benchmark/Mesh_3/concurrency.cpp index ea383a78832..151d1f6a2a3 100644 --- a/Mesh_3/benchmark/Mesh_3/concurrency.cpp +++ b/Mesh_3/benchmark/Mesh_3/concurrency.cpp @@ -531,22 +531,22 @@ bool make_mesh_polyhedron(const std::string &input_filename, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd(time_limit=timelimit) + , lloyd_param_new = lloyd(time_limit=timelimit) # else - , no_lloyd() + , lloyd_param_new = no_lloyd() # endif - , no_odt() + , odt_param_new = no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb(time_limit = timelimit, + , perturb_param_new = perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , no_perturb() + , perturb_param_new = no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude(time_limit = timelimit, + , exude_param_new = exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , no_exude() + , exude_param_new = no_exude() #endif ); @@ -637,22 +637,22 @@ bool make_mesh_3D_images(const std::string &input_filename, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd(time_limit=timelimit) + , lloyd_param_new = lloyd(time_limit=timelimit) # else - , no_lloyd() + , lloyd_param_new = no_lloyd() # endif - , no_odt() + , odt_param_new = no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb(time_limit = timelimit, + , perturb_param_new = perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , no_perturb() + , perturb_param_new = no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude(time_limit = timelimit, + , exude_param_new = exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , no_exude() + , exude_param_new = no_exude() #endif ); @@ -774,22 +774,22 @@ bool make_mesh_implicit(double facet_approx, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd(time_limit=timelimit) + , lloyd_param_new = lloyd(time_limit=timelimit) # else - , no_lloyd() + , lloyd_param_new = no_lloyd() # endif - , no_odt() + , odt_param_new = no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb(time_limit = timelimit, + , perturb_param_new = perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , no_perturb() + , perturb_param_new = no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude(time_limit = timelimit, + , exude_param_new = exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , no_exude() + , exude_param_new = no_exude() #endif ); diff --git a/Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h deleted file mode 100644 index 08bd5ee1761..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h +++ /dev/null @@ -1,167 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `make_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd-smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Mesh_3_section_examples ). - - -\tparam C3T3 is required to be a model of -the concept `MeshComplex_3InTriangulation_3`. This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3`, or of the refined concept -`MeshDomainWithFeatures_3` -if the domain has corners and curves that need to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - - -\tparam MC has to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\cgalHeading{Named Parameters} - -- `features` allows -the user to specify whether 0 and 1-dimensional features have to be -taken into account or not -when the domain is a model of `MeshDomainWithFeatures_3`. -The type `Features` of this parameter is an internal undescribed type. -The library provides functions to construct appropriate values of that type. -
    -
  • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, -i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a -`MeshDomainWithFeatures_3`. This is the default behavior -if parameter `features` is not specified. -
  • `parameters::no_features()` prevents the representation -of 0 and 1-dimensional features in the mesh. -
- -- `manifold` allows the user to drive the meshing algorithm, -and ensure that the output mesh surface follows the given manifold criterion. -It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` -and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold -surface if the input surface is not manifold. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_mesh_3()` is used for this parameter. - -- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_mesh_3` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_mesh_3()` is used for this parameter. - -- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_mesh_3` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`CGAL::perturb_mesh_3` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_mesh_3()` -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `parameters::manifold()` -\sa `parameters::manifold_with_boundary()` -\sa `parameters::non_manifold()` -\sa `exude_mesh_3()` -\sa `perturb_mesh_3()` -\sa `lloyd_optimize_mesh_3()` -\sa `odt_optimize_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` - -*/ - -template -C3T3 make_mesh_3(const MD& domain, - const MC& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude(), - parameters::internal::Manifold_options manifold = parameters::non_manifold()); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 4e3c799b245..0eecbbb80cc 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -11,7 +11,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 38f4363a04b..2a5e5f17480 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -81,13 +81,13 @@ int main() cell_radius_edge_ratio = 2, cell_size = 0.4); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); // Exudation - CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); + CGAL::exude_mesh_3(c3t3,time_limit_new=12); // Output std::ofstream medit_file("out_cubes_intersection.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index 9ef132eaf23..3478946f53c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -168,7 +168,7 @@ int main() cell_radius_edge_ratio = 2, cell_size = 0.4); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index c638395342c..e1bf3711a82 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -240,7 +240,7 @@ int main() // Mesh generation (without optimization) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Output dump_c3t3(c3t3, "out"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index b3adb97954d..decc6822b62 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -57,7 +57,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index 6d50993bbdd..647e13a72d4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -59,7 +59,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp index 4f3ee34b2e7..8d699afd3de 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp @@ -51,7 +51,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation (without optimization) - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Output std::ofstream medit_file("out_wo.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index 3eaa7ce389f..3c1fc5c163d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -65,7 +65,7 @@ int main() cell_radius_edge_ratio=2, cell_size=size); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index 1053b4f1d21..41485abadd3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -48,12 +48,12 @@ int main(int argc, char* argv[]) // Mesh generation and optimization in one call (sliver_bound is the // targeted dihedral angle in degrees) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_exude(), - perturb(sliver_bound=10, time_limit=15)); + exude_param_new = no_exude(), + perturb_param_new = perturb(sliver_bound=10, time_limit=15)); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + perturb_param_new = no_perturb(), exude_param_new = no_exude()); CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit_new=15); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index 3fa00ebf9aa..12752c2d5f6 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -46,13 +46,13 @@ int main(int argc, char*argv[]) // Mesh generation and optimization in one call C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - lloyd(time_limit=30), - no_perturb(), - exude(time_limit=10, sliver_bound=10)); + lloyd_param_new = lloyd(time_limit=30), + perturb_param_new = no_perturb(), + exude_param_new = exude(time_limit=10, sliver_bound=10)); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + perturb_param_new = no_perturb(), exude_param_new = no_exude()); CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit_new=30); CGAL::exude_mesh_3(c3t3_bis, sliver_bound_new=10, time_limit_new=10); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index 8598715077c..2d9ca52a2fe 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -57,7 +57,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -68,7 +68,7 @@ int main(int argc, char*argv[]) Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); // Mesh refinement (and make the output manifold) - CGAL::refine_mesh_3(c3t3, domain, new_criteria, CGAL::parameters::manifold_options_param_new = manifold()); + CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold_options_param_new = manifold()); // Output medit_file.open("out_2.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp index 7cb6dda697d..7888d04ccfe 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp @@ -57,7 +57,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Output std::ofstream medit_file("out_1.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp index 51009ad7cb8..c9ebc63fa74 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp @@ -59,7 +59,7 @@ int main(int argc, char*argv[]) // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + perturb_param_new = no_perturb(), exude_param_new = no_exude()); std::cerr << t.time() << " sec." << std::endl; // Output diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index bdc5ac62e7a..f161329d59d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -85,7 +85,7 @@ int main() // Mesh generation without feature preservation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::no_features()); + features_param_new = CGAL::parameters::no_features()); std::ofstream medit_file("out-no-protection.mesh"); c3t3.output_to_medit(medit_file); diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp index 3a22bb35526..2236aab3a21 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp @@ -55,7 +55,7 @@ int main() facet_distance = 0.001); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp index 1ddf6772d04..49b4e61b19f 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp @@ -54,7 +54,7 @@ int main() facet_distance = 0.001); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index ab440913779..0eb2b65b071 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -369,57 +369,202 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > // make_mesh_3 stuff // ----------------------------------- -// Manual redirections -// boost::parameter can't handle make_mesh_3 return_type alone... -template -C3T3 make_mesh_3(const MD& md, const MC& mc, const T& ...t) +/*! +\ingroup PkgMesh3Functions + +The function `make_mesh_3()` is a 3D +mesh generator. It produces simplicial meshes which discretize +3D domains. + +The mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. +The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, +etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd-smoothing, a sliver perturber, and a sliver exuder. +Each optimization process +can be activated or not, +according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, +and sliver perturber should never be called after the sliver exuder. +In the case of further refinement, only the sliver exuder can be used. + +The function outputs the mesh to an object which provides iterators to +traverse the resulting mesh data structure or can be written to a file +(see \ref Mesh_3_section_examples ). + + +\tparam C3T3 is required to be a model of +the concept `MeshComplex_3InTriangulation_3`. This is the return type. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D triangulation +embedding the mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `MeshCellBase_3` +respectively. + +\tparam MD is required to be a model of +the concept `MeshDomain_3`, or of the refined concept +`MeshDomainWithFeatures_3` +if the domain has corners and curves that need to be accurately represented in the mesh. +The argument `domain` +is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + +\tparam MC has to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. +The argument `criteria` of type `MC` specifies the +size and shape requirements for mesh tetrahedra +and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + +\cgalNamedParamsBegin + \cgalParamNBegin{features_param_new} + \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be + taken into account or not + when the domain is a model of `MeshDomainWithFeatures_3`. + The type `Features` of this parameter is an internal undescribed type. + The library provides functions to construct appropriate values of that type. +
    +
  • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, + i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a + `MeshDomainWithFeatures_3`. This is the default behavior + if parameter `features` is not specified. +
  • `parameters::no_features()` prevents the representation + of 0 and 1-dimensional features in the mesh. +
} + \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} + \cgalParamDefault{`parameters::features(domain)`} + + \cgalParamNBegin{manifold_options_param_new} + \cgalParamDescription{allows the user to drive the meshing algorithm, + and ensure that the output mesh surface follows the given manifold criterion. + It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` + and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold + surface if the input surface is not manifold.} + \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} + \cgalParamDefault{`parameters::non_manifold()`} + + \cgalParamNBegin{lloyd_param_new} + \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to + trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the + parameters of this optimizer. If one parameter is not set, the default value of + `lloyd_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} + \cgalParamDefault{`parameters::no_lloyd()`} + + \cgalParamNBegin{odt_param_new} + \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to + trigger or not a call to `odt_optimize_mesh_3()` function and + to set the parameters of this optimizer. + If one parameter is not set, the default value of + `odt_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} + \cgalParamDefault{`parameters::no_odt()`} + + \cgalParamNBegin{perturb_param_new} + \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to + trigger or not a call to `perturb_mesh_3()` function and + to set the parameters of this optimizer. If one parameter is not set, the default value of + `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} + \cgalParamDefault{`parameters::no_perturb`} + + \cgalParamNBegin{exude_param_new} + \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to + trigger or not a call to `exude_mesh_3()` function and to override to set the + parameters of this optimizer. If one parameter is not set, the default value of + `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} + \cgalParamDefault{`parameters::no_exude`} + +\cgalNamedParamsEnd + + The optimization parameters can be passed in an arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `refine_mesh_3()` +\sa `parameters::features()` +\sa `parameters::no_features()` +\sa `parameters::manifold()` +\sa `parameters::manifold_with_boundary()` +\sa `parameters::non_manifold()` +\sa `exude_mesh_3()` +\sa `perturb_mesh_3()` +\sa `lloyd_optimize_mesh_3()` +\sa `odt_optimize_mesh_3()` +\sa `parameters::exude()` +\sa `parameters::no_exude()` +\sa `parameters::perturb()` +\sa `parameters::no_perturb()` +\sa `parameters::lloyd()` +\sa `parameters::no_lloyd()` +\sa `parameters::odt()` +\sa `parameters::no_odt()` +*/ + +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - C3T3 c3t3; - make_mesh_3_bp(c3t3,md,mc,t...); - return c3t3; + using parameters::choose_parameter; + using parameters::get_parameter; + C3T3 c3t3; + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude()); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb()); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain)); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + make_mesh_3_impl(c3t3, domain, criteria, + exude_param, perturb_param, odt_param, lloyd_param, + features_param.features(), mesh_options_param, + manifold_options_param); + return c3t3; } -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (void), - make_mesh_3_bp, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (features_param, (parameters::internal::Features_options), parameters::features(domain)) - (exude_param, (parameters::internal::Exude_options), parameters::exude()) - (perturb_param, (parameters::internal::Perturb_options), parameters::perturb()) - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) -) +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps) { - make_mesh_3_impl(c3t3, domain, criteria, - exude_param, perturb_param, odt_param, lloyd_param, - features_param.features(), mesh_options_param, - manifold_options_param); + return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } -CGAL_PRAGMA_DIAG_POP +#endif //CGAL_NO_DEPRECATED_CODE -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif /** * @brief This function meshes the domain defined by mesh_traits @@ -470,9 +615,177 @@ void make_mesh_3_impl(C3T3& c3t3, parameters::reset_param_new=parameters::no_reset_c3t3(), parameters::mesh_options_param_new= mesh_options, parameters::manifold_options_param_new= manifold_options); } +#else +namespace CGAL { +/*! +\ingroup PkgMesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `make_mesh_3()` is a 3D +mesh generator. It produces simplicial meshes which discretize +3D domains. + +The mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. +The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, +etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd-smoothing, a sliver perturber, and a sliver exuder. +Each optimization process +can be activated or not, +according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, +and sliver perturber should never be called after the sliver exuder. +In the case of further refinement, only the sliver exuder can be used. + +The function outputs the mesh to an object which provides iterators to +traverse the resulting mesh data structure or can be written to a file +(see \ref Mesh_3_section_examples ). + + +\tparam C3T3 is required to be a model of +the concept `MeshComplex_3InTriangulation_3`. This is the return type. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D triangulation +embedding the mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `MeshCellBase_3` +respectively. + +\tparam MD is required to be a model of +the concept `MeshDomain_3`, or of the refined concept +`MeshDomainWithFeatures_3` +if the domain has corners and curves that need to be accurately represented in the mesh. +The argument `domain` +is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + + +\tparam MC has to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. +The argument `criteria` of type `MC` specifies the +size and shape requirements for mesh tetrahedra +and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +\cgalHeading{Named Parameters} + +- `features` allows +the user to specify whether 0 and 1-dimensional features have to be +taken into account or not +when the domain is a model of `MeshDomainWithFeatures_3`. +The type `Features` of this parameter is an internal undescribed type. +The library provides functions to construct appropriate values of that type. +
    +
  • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, +i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a +`MeshDomainWithFeatures_3`. This is the default behavior +if parameter `features` is not specified. +
  • `parameters::no_features()` prevents the representation +of 0 and 1-dimensional features in the mesh. +
+ +- `manifold` allows the user to drive the meshing algorithm, +and ensure that the output mesh surface follows the given manifold criterion. +It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` +and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold +surface if the input surface is not manifold. + +The four additional parameters are optimization parameters. +They control which optimization processes are performed +and allow the user to tune the parameters of the optimization processes. +Individual optimization parameters are not described here as they are +internal types (see instead the documentation page of each optimizer). +For each optimization algorithm, there exist two global functions +that allow to enable or disable the optimizer: + +- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to +trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the +parameters of this optimizer. If one parameter is not set, the default value of +`lloyd_optimize_mesh_3()` is used for this parameter. + +- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to +trigger or not a call to `odt_optimize_mesh_3` function and +to set the parameters of this optimizer. +If one parameter is not set, the default value of +`odt_optimize_mesh_3()` is used for this parameter. + +- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to +trigger or not a call to `perturb_mesh_3` function and +to set the parameters of this optimizer. If one parameter is not set, the default value of +`CGAL::perturb_mesh_3` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to +trigger or not a call to `exude_mesh_3()` function and to override to set the +parameters of this optimizer. If one parameter is not set, the default value of +`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +The optimization parameters can be passed in an arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `refine_mesh_3()` +\sa `parameters::features()` +\sa `parameters::no_features()` +\sa `parameters::manifold()` +\sa `parameters::manifold_with_boundary()` +\sa `parameters::non_manifold()` +\sa `exude_mesh_3()` +\sa `perturb_mesh_3()` +\sa `lloyd_optimize_mesh_3()` +\sa `odt_optimize_mesh_3()` +\sa `parameters::exude()` +\sa `parameters::no_exude()` +\sa `parameters::perturb()` +\sa `parameters::no_perturb()` +\sa `parameters::lloyd()` +\sa `parameters::no_lloyd()` +\sa `parameters::odt()` +\sa `parameters::no_odt()` + +*/ + +template +C3T3 make_mesh_3(const MD& domain, + const MC& criteria, + parameters::internal::Features_options features = parameters::features(domain), + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude(), + parameters::internal::Manifold_options manifold = parameters::non_manifold()); + +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING } // end namespace CGAL -#include - #endif // CGAL_MAKE_MESH_3_H diff --git a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp index 54c31079acf..67047b119a8 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp @@ -76,7 +76,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); // Output std::stringstream off_file; diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp index fe31c62f6a4..df88c7451a2 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp @@ -66,7 +66,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio = 3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); Gt::Construct_weighted_circumcenter_3 w_circumcenter = c3t3.triangulation().geom_traits().construct_weighted_circumcenter_3_object(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index eb41399c0d5..bbb5951b56c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -82,10 +82,10 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), - no_exude(), - mesh_3_options(number_of_initial_points_new = 30), - non_manifold() + perturb_param_new = no_perturb(), + exude_param_new = no_exude(), + mesh_options_param_new = mesh_3_options(number_of_initial_points_new = 30), + manifold_options_param_new = non_manifold() ); // Verify diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp index e9105ff2a9e..c785c2f528e 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp @@ -74,10 +74,10 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), - no_exude(), - mesh_3_options(number_of_initial_points_new = 30), - non_manifold() + perturb_param_new = no_perturb(), + exude_param_new = no_exude(), + mesh_options_param_new = mesh_3_options(number_of_initial_points_new = 30), + manifold_options_param_new = non_manifold() ); // Verify diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 0d151fc1b9b..5edfe1648a6 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -58,8 +58,8 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); c3t3.remove_isolated_vertices(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp index ed1a1fbd14b..3a931aced34 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp @@ -42,8 +42,8 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); // Verify this->verify_c3t3_volume(c3t3, 1772330*0.95, 1772330*1.05); diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index 000202adef4..27aefc874ed 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -73,8 +73,8 @@ void test() { std::cout << "------- Iteration " << (i+1) << " -------" << std::endl; C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), - no_exude()); + perturb_param_new = no_perturb(), + exude_param_new = no_exude()); std::ostringstream oss; c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str()); //[5*i] diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp index 9babdd1a160..014777bcea9 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp @@ -125,9 +125,9 @@ struct Polyhedron_with_features_tester : public Tester // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::manifold(), - CGAL::parameters::no_exude(), - CGAL::parameters::no_perturb()); + CGAL::parameters::manifold_options_param_new = CGAL::parameters::manifold(), + CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp index 6e584c7aa44..a270c889e9a 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp @@ -72,7 +72,7 @@ int main(int, char**) CGAL::parameters::facet_size = 4, CGAL::parameters::facet_distance = 0.1); C3t3 c3t3 = CGAL::make_mesh_3 (domain, criteria, - CGAL::parameters::manifold()); + CGAL::parameters::manifold_options_param_new = CGAL::parameters::manifold()); return EXIT_SUCCESS; } diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 6aa6bd51b6d..b0ab6d00de5 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -366,6 +366,7 @@ const Boost_parameter_compatibility_wrapper const Boost_parameter_compatibility_wrapper reset_param_new; const Boost_parameter_compatibility_wrapper mesh_options_param_new; const Boost_parameter_compatibility_wrapper manifold_options_param_new; +const Boost_parameter_compatibility_wrapper features_param_new; #endif // function to extract a parameter diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index e723acf187e..c45593c5aab 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -277,3 +277,4 @@ CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_optio CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options_param) CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_param) CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_param) +CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options_param) \ No newline at end of file diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp index cf75b94c0a5..2b6164634de 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp @@ -47,7 +47,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Meshing - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); std::cout << "Meshing done." << std::endl; From 5a8d90019e0127954f215c9d64b32de782e66b27 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 21 Jun 2022 18:45:25 +0530 Subject: [PATCH 018/248] New API support and docs for optimize_periodic_3_mesh_3.h --- Mesh_3/include/CGAL/perturb_mesh_3.h | 4 +- Mesh_3/include/CGAL/refine_mesh_3.h | 2 +- .../mesh_implicit_shape_with_optimizers.cpp | 8 +- .../include/CGAL/optimize_periodic_3_mesh_3.h | 144 ++++++++---------- .../include/CGAL/refine_periodic_3_mesh_3.h | 12 +- 5 files changed, 79 insertions(+), 91 deletions(-) diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index e09b3854b25..7b4ab01cde4 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -21,15 +21,13 @@ #include -#include #include #include #include #include #include #include - -#include +#include #include diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 5ceeabc8a74..6c535a9ffdc 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 3d2c42a4c4e..1ae7a7376a3 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -87,10 +87,10 @@ int main(int argc, char** argv) CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); // Now, call each optimizer with its global function - CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence=0.03, freeze_bound=0.02, time_limit=30); - CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number=10); - CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound=10, time_limit=30); - CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound=10, time_limit=0); + CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence_new=0.03, freeze_bound_new=0.02, time_limit_new=30); + CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number_new=10); + CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound_new=10, time_limit_new=30); + CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound_new=10, time_limit_new=0); std::ofstream medit_file_ter("output_implicit_shape_two_steps.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output); 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 8b3d75cbfe4..e44d2d119f4 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 @@ -19,106 +19,96 @@ #define CGAL_OPTIMIZE_PERIODIC_3_MESH_3_H #include - +#include #include namespace CGAL { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - // ---------------------------------- pertuber --------------------------------- - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - perturb_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*)) - (optional - (time_limit_, *, 0) - (sliver_bound_, *, parameters::default_values_for_mesh_3::perturb_sliver_bound) - (sliver_criterion_, *, parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3, sliver_bound_)) - (perturbation_vector_, *, default_perturbation_vector(c3t3,domain,sliver_criterion_)) - ) -) +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - CGAL_USE(sliver_bound_); - return perturb_mesh_3_impl(c3t3, domain, time_limit_, sliver_criterion_, - perturbation_vector_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } +#ifndef CGAL_NO_DEPRECATED_CODE +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) +{ + return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); +} +#endif //CGAL_NO_DEPRECATED_CODE // ---------------------------------- exuder ----------------------------------- -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - exude_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*)) - (optional - (time_limit_, *, 0) - (sliver_bound_, *, parameters::default_values_for_mesh_3::exude_sliver_bound) - ) -) +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { - 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 +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) +{ + return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); +} +#endif //CGAL_NO_DEPRECATED_CODE // ------------------------------ odt optimizer -------------------------------- -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - odt_optimize_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*)) - (optional - (time_limit_, *, 0) - (max_iteration_number_, *, 0) - (convergence_, *, parameters::default_values_for_mesh_3::odt_convergence_ratio) - (freeze_bound_, *, parameters::default_values_for_mesh_3::odt_freeze_ratio) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze) - ) -) +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - return odt_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_, do_freeze_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } +#ifndef CGAL_NO_DEPRECATED_CODE +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) +{ + return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); +} +#endif //CGAL_NO_DEPRECATED_CODE + // ------------------------------- lloyd optimizer ----------------------------- - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - lloyd_optimize_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*)) - (optional - (time_limit_, *, 0) - (max_iteration_number_, *, 0) - (convergence_, *, parameters::default_values_for_mesh_3::lloyd_convergence_ratio) - (freeze_bound_, *, parameters::default_values_for_mesh_3::lloyd_freeze_ratio) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze) - ) -) +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain,const CGAL_NP_CLASS& np = parameters::default_values()) { - return lloyd_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_, do_freeze_); + 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 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); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef CGAL_NO_DEPRECATED_CODE +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) +{ + return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); +} +#endif //CGAL_NO_DEPRECATED_CODE } // namespace CGAL 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 87833d80c00..82f5e233079 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 @@ -264,10 +264,10 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, if(lloyd) { lloyd_optimize_mesh_3(c3t3, domain, - parameters::time_limit = lloyd.time_limit(), - parameters::max_iteration_number = lloyd.max_iteration_number(), - parameters::convergence = lloyd.convergence(), - parameters::freeze_bound = lloyd.bound()); + parameters::time_limit_new = lloyd.time_limit(), + parameters::max_iteration_number_new = lloyd.max_iteration_number(), + parameters::convergence_new = lloyd.convergence(), + parameters::freeze_bound_new = lloyd.bound()); } if(odt || lloyd) @@ -299,8 +299,8 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, exude_time_limit = exude.time_limit(); exude_mesh_3(c3t3, - CGAL::parameters::time_limit_new = exude_time_limit, - CGAL::parameters::sliver_bound_new = exude.bound()); + parameters::time_limit_new = exude_time_limit, + parameters::sliver_bound_new = exude.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } From 9d870b3377e07f69b7fe603453eeef082d15dca2 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 21 Jun 2022 19:39:58 +0530 Subject: [PATCH 019/248] New API support for make_periodic_3_mesh_3.h --- .../CGAL/make_periodic_3_mesh_3.h | 149 ------- .../doc/Periodic_3_mesh_3/Doxyfile.in | 2 + .../mesh_implicit_shape_with_features.cpp | 4 +- .../mesh_implicit_shape_with_optimizers.cpp | 8 +- .../include/CGAL/make_periodic_3_mesh_3.h | 380 +++++++++++++++--- .../test_implicit_shapes_with_features.cpp | 6 +- 6 files changed, 345 insertions(+), 204 deletions(-) delete mode 100644 Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h deleted file mode 100644 index d6e097fc9e6..00000000000 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h +++ /dev/null @@ -1,149 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. -It produces simplicial meshes which discretize 3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Periodic_3_mesh_3_section_examples ). - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D periodic triangulation -embedding the periodic mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of -the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. - -\tparam MD is required to be a model of the concept `Periodic_3MeshDomain_3`, -or of the refined concept `Periodic_3MeshDomainWithFeatures_3` if the domain has corners -and curve segments that need to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the size and shape -requirements for mesh tetrahedra and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\cgalHeading{Named Parameters} - -- `features` allows -the user to specify whether 0 and 1-dimensional features have to be -taken into account or not -when the domain is a model of `Periodic_3MeshDomainWithFeatures_3`. -The type `Features` of this parameter is an internal undescribed type. -The library provides functions to construct appropriate values of that type. -
    -
  • \link parameters::features() `parameters::features(domain)` \endlink -sets `features` according to the domain, -i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a -`Periodic_3MeshDomainWithFeatures_3`. This is the default behavior -if parameter `features` is not specified. -
  • `parameters::no_features()` prevents the representation -of 0 and 1-dimensional features in the mesh. -
- -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_periodic_3_mesh_3` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_periodic_3_mesh_3` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`CGAL::perturb_periodic_3_mesh_3` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further - details): *ODT-smoother*, *Lloyd-smoother*, *perturb*, *exude*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_periodic_3_mesh_3()` -\sa `make_mesh_3()` - -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` -*/ - -template -C3T3 make_periodic_3_mesh_3(const MD& domain, - const MC& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); -} /* namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in index d49050978bf..9c18c8d19b3 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in @@ -1,5 +1,7 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} +INPUT += \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_periodic_3_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Periodic Mesh Generation" EXTRACT_ALL = false HIDE_UNDOC_CLASSES = true diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index 680b0153c95..50d70fb646a 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -108,8 +108,8 @@ int main(int argc, char** argv) domain.add_corner(Point(0.51, 0.51, 0.5)); // Mesh generation WITHOUT feature preservation (and no optimizers) - C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, no_features(), - no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, features_param_new = no_features(), + exude_param_new = no_exude(), perturb_param_new = no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 1ae7a7376a3..5aafbe917d8 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -70,10 +70,10 @@ int main(int argc, char** argv) // Mesh generation with optimizers C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, - odt(convergence=0.03, freeze_bound=0.02, time_limit=30), - lloyd(max_iteration_number=10), - perturb(sliver_bound=10, time_limit=30), - exude(sliver_bound=10, time_limit=0)); + odt_param_new = odt(convergence=0.03, freeze_bound=0.02, time_limit=30), + lloyd_param_new = lloyd(max_iteration_number=10), + perturb_param_new = perturb(sliver_bound=10, time_limit=30), + exude_param_new = exude(sliver_bound=10, time_limit=0)); std::ofstream medit_file("output_implicit_shape_optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 092e864bab5..cfe32268b44 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -26,11 +26,9 @@ #include #include -#include #include #include - -#include +#include namespace CGAL { namespace Periodic_3_mesh_3 { @@ -168,56 +166,194 @@ struct C3t3_initializer // make_periodic_3_mesh_3 stuff // ----------------------------------- -// Manual redirections -// boost::parameter can't handle make_periodic_3_mesh_3 return_type alone... -template -C3T3 make_periodic_3_mesh_3(const MD& md, const MC& mc, const T& ...t) +/*! +\ingroup PkgPeriodic3Mesh3Functions + +The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. +It produces simplicial meshes which discretize 3D periodic domains. +The periodic mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, +etc. +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd smoothing, a sliver perturber, and a sliver exuder. +Each optimization process can be activated or not, according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, +and sliver perturber should never be called after the sliver exuder. +In the case of further refinement, only the sliver exuder can be used. +The function outputs the mesh to an object which provides iterators to +traverse the resulting mesh data structure or can be written to a file +(see \ref Periodic_3_mesh_3_section_examples ). + + +\tparam C3T3 is required to be a model of +the concept `MeshComplex_3InTriangulation_3`. This is the return type. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D triangulation +embedding the mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `MeshCellBase_3` +respectively. + +\tparam MD is required to be a model of +the concept `MeshDomain_3`, or of the refined concept +`MeshDomainWithFeatures_3` +if the domain has corners and curves that need to be accurately represented in the mesh. +The argument `domain` +is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + +\tparam MC has to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. +The argument `criteria` of type `MC` specifies the +size and shape requirements for mesh tetrahedra +and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + +\cgalNamedParamsBegin + \cgalParamNBegin{features_param_new} + \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be + taken into account or not + when the domain is a model of `MeshDomainWithFeatures_3`. + The type `Features` of this parameter is an internal undescribed type. + The library provides functions to construct appropriate values of that type. +
    +
  • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, + i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a + `MeshDomainWithFeatures_3`. This is the default behavior + if parameter `features` is not specified. +
  • `parameters::no_features()` prevents the representation + of 0 and 1-dimensional features in the mesh. +
} + \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} + \cgalParamDefault{`parameters::features(domain)`} + + \cgalParamNBegin{manifold_options_param_new} + \cgalParamDescription{allows the user to drive the meshing algorithm, + and ensure that the output mesh surface follows the given manifold criterion. + It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` + and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold + surface if the input surface is not manifold.} + \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} + \cgalParamDefault{`parameters::non_manifold()`} + + \cgalParamNBegin{lloyd_param_new} + \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to + trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the + parameters of this optimizer. If one parameter is not set, the default value of + `lloyd_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} + \cgalParamDefault{`parameters::no_lloyd()`} + + \cgalParamNBegin{odt_param_new} + \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to + trigger or not a call to `odt_optimize_mesh_3()` function and + to set the parameters of this optimizer. + If one parameter is not set, the default value of + `odt_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} + \cgalParamDefault{`parameters::no_odt()`} + + \cgalParamNBegin{perturb_param_new} + \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to + trigger or not a call to `perturb_mesh_3()` function and + to set the parameters of this optimizer. If one parameter is not set, the default value of + `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} + \cgalParamDefault{`parameters::no_perturb`} + + \cgalParamNBegin{exude_param_new} + \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to + trigger or not a call to `exude_mesh_3()` function and to override to set the + parameters of this optimizer. If one parameter is not set, the default value of + `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} + \cgalParamDefault{`parameters::no_exude`} + +\cgalNamedParamsEnd + + The optimization parameters can be passed in an arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `refine_periodic_3_mesh_3()` +\sa `make_mesh_3()` +\sa `parameters::features()` +\sa `parameters::no_features()` +\sa `parameters::manifold()` +\sa `parameters::manifold_with_boundary()` +\sa `parameters::non_manifold()` +\sa `exude_mesh_3()` +\sa `perturb_mesh_3()` +\sa `lloyd_optimize_mesh_3()` +\sa `odt_optimize_mesh_3()` +\sa `parameters::exude()` +\sa `parameters::no_exude()` +\sa `parameters::perturb()` +\sa `parameters::no_perturb()` +\sa `parameters::lloyd()` +\sa `parameters::no_lloyd()` +\sa `parameters::odt()` +\sa `parameters::no_odt()` +*/ +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - C3T3 c3t3; - make_periodic_3_mesh_3_bp(c3t3,md,mc,t...); - return c3t3; + using parameters::choose_parameter; + using parameters::get_parameter; + C3T3 c3t3; + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude()); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb()); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain)); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + make_periodic_3_mesh_3_impl(c3t3, domain, criteria, + exude_param, perturb_param, odt_param, lloyd_param, + features_param.features(), mesh_options_param, + manifold_options_param); + return c3t3; } -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (void), - make_periodic_3_mesh_3_bp, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (features_param, (parameters::internal::Features_options), parameters::features(domain)) - (exude_param, (parameters::internal::Exude_options), parameters::exude()) - (perturb_param, (parameters::internal::Perturb_options), parameters::perturb()) - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) - ) +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps) { - make_periodic_3_mesh_3_impl(c3t3, domain, criteria, - exude_param, perturb_param, odt_param, lloyd_param, - features_param.features(), mesh_options_param, - manifold_options_param); + return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#endif //CGAL_NO_DEPRECATED_CODE /** * @brief This function meshes the domain defined by mesh_traits @@ -259,7 +395,159 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it mesh_options, manifold_options); } +#else +namespace CGAL { +/*! +\ingroup PkgPeriodic3Mesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. +It produces simplicial meshes which discretize 3D periodic domains. + +The periodic mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, +etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd smoothing, a sliver perturber, and a sliver exuder. +Each optimization process can be activated or not, according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, +and sliver perturber should never be called after the sliver exuder. +In the case of further refinement, only the sliver exuder can be used. + +The function outputs the mesh to an object which provides iterators to +traverse the resulting mesh data structure or can be written to a file +(see \ref Periodic_3_mesh_3_section_examples ). + +\tparam C3T3 is required to be a model of the concept +`MeshComplex_3InTriangulation_3`. This is the return type. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D periodic triangulation +embedding the periodic mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of +the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. + +\tparam MD is required to be a model of the concept `Periodic_3MeshDomain_3`, +or of the refined concept `Periodic_3MeshDomainWithFeatures_3` if the domain has corners +and curve segments that need to be accurately represented in the mesh. +The argument `domain` is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + +\tparam MC is required to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. +The argument `criteria` of type `MC` specifies the size and shape +requirements for mesh tetrahedra and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +\cgalHeading{Named Parameters} + +- `features` allows +the user to specify whether 0 and 1-dimensional features have to be +taken into account or not +when the domain is a model of `Periodic_3MeshDomainWithFeatures_3`. +The type `Features` of this parameter is an internal undescribed type. +The library provides functions to construct appropriate values of that type. +
    +
  • \link parameters::features() `parameters::features(domain)` \endlink +sets `features` according to the domain, +i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a +`Periodic_3MeshDomainWithFeatures_3`. This is the default behavior +if parameter `features` is not specified. +
  • `parameters::no_features()` prevents the representation +of 0 and 1-dimensional features in the mesh. +
+ +The four additional parameters are optimization parameters. +They control which optimization processes are performed +and allow the user to tune the parameters of the optimization processes. +Individual optimization parameters are not described here as they are +internal types (see instead the documentation page of each optimizer). +For each optimization algorithm, there exist two global functions +that allow to enable or disable the optimizer: + +- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to +trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the +parameters of this optimizer. If one parameter is not set, the default value of +`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. + +- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to +trigger or not a call to `odt_optimize_periodic_3_mesh_3` function and +to set the parameters of this optimizer. +If one parameter is not set, the default value of +`odt_optimize_periodic_3_mesh_3()` is used for this parameter. + +- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to +trigger or not a call to `perturb_periodic_3_mesh_3` function and +to set the parameters of this optimizer. If one parameter is not set, the default value of +`CGAL::perturb_periodic_3_mesh_3` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to +trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the +parameters of this optimizer. If one parameter is not set, the default value of +`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +The optimization parameters can be passed in an arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further + details): *ODT-smoother*, *Lloyd-smoother*, *perturb*, *exude*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `refine_periodic_3_mesh_3()` +\sa `make_mesh_3()` + +\sa `parameters::features()` +\sa `parameters::no_features()` +\sa `exude_periodic_3_mesh_3()` +\sa `perturb_periodic_3_mesh_3()` +\sa `lloyd_optimize_periodic_3_mesh_3()` +\sa `odt_optimize_periodic_3_mesh_3()` +\sa `parameters::exude()` +\sa `parameters::no_exude()` +\sa `parameters::perturb()` +\sa `parameters::no_perturb()` +\sa `parameters::lloyd()` +\sa `parameters::no_lloyd()` +\sa `parameters::odt()` +\sa `parameters::no_odt()` +*/ + +template +C3T3 make_periodic_3_mesh_3(const MD& domain, + const MC& criteria, + parameters::internal::Features_options features = parameters::features(domain), + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude()); +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING } // end namespace CGAL #endif // CGAL_PERIODIC_3_MESH_3_MAKE_PERIODIC_3_MESH_3_H diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp index 2a297d3f89b..000b1b74a69 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp @@ -94,7 +94,7 @@ void test_protected_sphere() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param_new = manifold()); // Output std::ofstream medit_file_bis("protected_sphere.mesh"); @@ -159,7 +159,7 @@ void test_protected_squary_cylinder() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param_new = manifold()); // Output std::ofstream medit_file_bis("squary_cylinder.mesh"); @@ -272,7 +272,7 @@ void test_protected_squary_cylinder_2() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param_new = manifold()); // Output std::ofstream medit_file_bis("squary_cylinder_2.mesh"); From f32c84f0c5bd4128eda75c47facfe0d8004d742c Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 22 Jun 2022 19:17:36 +0530 Subject: [PATCH 020/248] New API support and doc for refine_periodic_3_mesh_3.h --- .../CGAL/refine_periodic_3_mesh_3.h | 142 ------- .../doc/Periodic_3_mesh_3/Doxyfile.in | 3 +- .../include/CGAL/make_periodic_3_mesh_3.h | 6 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 379 ++++++++++++++++-- 4 files changed, 343 insertions(+), 187 deletions(-) delete mode 100644 Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h deleted file mode 100644 index ea2d35cc1bf..00000000000 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h +++ /dev/null @@ -1,142 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `refine_periodic_3_mesh_3()` is a 3D periodic -mesh generator. It produces periodic simplicial meshes which discretize -3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_periodic_3_mesh_3()` may be used -to refine a previously computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); - -CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); -\endcode - -\attention Note that the triangulation must form at all times a simplicial complex within -a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro -of the manual of 3D periodic triangulations). It is the responsability of the user to provide -a triangulation that satisfies this condition when calling the refinement -function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh -complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` -will always satisfy this condition. - -\tparam C3T3 is required to be a model of the concept `MeshComplex_3InTriangulation_3`. -The argument `c3t3` is passed by reference as this object is modified -by the refinement process. As the refinement process only adds points -to the triangulation, all vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. The object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D periodic triangulation -embedding the periodic mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of -the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. - -\tparam MD is required to be a model of -the concept `Periodic_3MeshDomain_3` or of the refined concept -`Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC has to be a model of the concept `MeshCriteria_3`, -or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain -has exposed features. The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument `criteria` provides -a sizing field to guide the discretization of 1-dimensional exposed features. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalHeading{Named Parameters} -- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_periodic_3_mesh_3()` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `perturb` `parameters::perturb()` and `parameters::no_perturb()` -are designed to trigger or not a call to `perturb_periodic_3_mesh_3()` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`perturb_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained by perturbing mesh vertices -and modifying the mesh connectivity and that this has an impact on the strict -compliance to the refinement criteria. Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `make_periodic_3_mesh_3()` -\sa `refine_mesh_3()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude` -\sa `parameters::no_exude` -\sa `parameters::perturb` -\sa `parameters::no_perturb` -\sa `parameters::lloyd` -\sa `parameters::no_lloyd` -\sa `parameters::odt` -\sa `parameters::no_odt` -*/ -template -void refine_periodic_3_mesh_3(C3T3& c3t3, - const MD& mesh_domain, - const MC& mesh_criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); - -} /* namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in index 9c18c8d19b3..b10860987eb 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in @@ -1,7 +1,8 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} INPUT += \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_periodic_3_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_periodic_3_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_periodic_3_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Periodic Mesh Generation" EXTRACT_ALL = false HIDE_UNDOC_CLASSES = true diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index cfe32268b44..237f51ee01b 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -391,9 +391,9 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process refine_periodic_3_mesh_3(c3t3, domain, criteria, - exude, perturb, odt, lloyd, - parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it - mesh_options, manifold_options); + parameters::exude_param_new = exude, parameters::perturb_param_new = perturb, parameters::odt_param_new = odt, + parameters::lloyd_param_new = lloyd, parameters::reset_param_new = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it + parameters::mesh_options_param_new = mesh_options, parameters::manifold_options_param_new = manifold_options); } #else namespace CGAL { 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 82f5e233079..7f1a05562a1 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 @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -133,52 +133,203 @@ void project_points(C3T3& c3t3, } // namespace internal -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +/*! +\ingroup PkgPeriodic3Mesh3Functions -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +The function `refine_periodic_3_mesh_3()` is a 3D periodic +mesh generator. It produces periodic simplicial meshes which discretize +3D periodic domains. -BOOST_PARAMETER_FUNCTION( - (void), - refine_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (exude_param, (parameters::internal::Exude_options), parameters::no_exude()) // another default parameter distinct from Mesh_3 - (perturb_param, (parameters::internal::Perturb_options), parameters::no_perturb()) // another default parameter distinct from Mesh_3 - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (reset_param, (parameters::Reset), parameters::reset_c3t3()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) -) +The periodic mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. +The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd smoothing, a sliver perturber, and a sliver exuder. +Each optimization process can be activated or not, according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward. + +\attention The function template `refine_periodic_3_mesh_3()` may be used +to refine a previously computed mesh, e.g.: +\code{.cpp} +C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); + +CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); +\endcode + +\attention Note that the triangulation must form at all times a simplicial complex within +a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro +of the manual of 3D periodic triangulations). It is the responsability of the user to provide +a triangulation that satisfies this condition when calling the refinement +function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh +complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` +will always satisfy this condition. + + +\tparam C3T3 is required to be a model of +the concept +`MeshComplex_3InTriangulation_3`. +The argument `c3t3` is passed by +reference as this object is modified by the refinement process. As the +refinement process only adds points to the triangulation, all +vertices of the triangulation of `c3t3` remain in the +mesh during the refinement process. Object `c3t3` can be used to insert +specific points in the domain to ensure that they will be contained in the +final triangulation. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D triangulation +embedding the mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `MeshCellBase_3` +respectively. + +\tparam MD is required to be a model of +the concept `Periodic_3MeshDomain_3` or of the refined concept +`Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features +of the input complex have to be accurately represented in the mesh. +The argument `domain` is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + +\tparam MC is required to be a model of the concept +`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` +if the domain has exposed features. The argument `criteria` of +type `MC` specifies the +size and shape requirements for mesh tetrahedra +and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument +`criteria` provides a sizing field to guide the discretization +of 1-dimensional exposed features. + +The four additional parameters are optimization parameters. +They control which optimization processes are performed +and allow the user to tune the parameters of the optimization processes. +Individual optimization parameters are not described here as they are +internal types (see instead the documentation page of each optimizer). +For each optimization algorithm, there exist two global functions +that allow to enable or disable the optimizer: + +\cgalNamedParamsBegin + \cgalParamNBegin{manifold_options_param_new} + \cgalParamDescription{allows the user to drive the meshing algorithm, + and ensure that the output mesh surface follows the given manifold criterion. + It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` + and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold + surface if the input surface is not manifold.} + \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} + \cgalParamDefault{`parameters::non_manifold()`} + + \cgalParamNBegin{lloyd_param_new} + \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to + trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the + parameters of this optimizer. If one parameter is not set, the default value of + `lloyd_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} + \cgalParamDefault{`parameters::no_lloyd()'} + + \cgalParamNBegin{odt_param_new} + \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to + trigger or not a call to `odt_optimize_mesh_3()` function and + to set the parameters of this optimizer. + If one parameter is not set, the default value of + `odt_optimize_mesh_3()` is used for this parameter.} + \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} + \cgalParamDefault{`parameters::no_odt()`} + + \cgalParamNBegin{perturb_param_new} + \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to + trigger or not a call to `perturb_mesh_3()` function and + to set the parameters of this optimizer. If one parameter is not set, the default value of + `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} + \cgalParamDefault{`parameters::no_perturb`} + + \cgalParamNBegin{exude_param_new} + \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to + trigger or not a call to `exude_mesh_3()` function and to override to set the + parameters of this optimizer. If one parameter is not set, the default value of + `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be + equal to the refinement CPU time.} + \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} + \cgalParamDefault{`parameters::no_exude`} + +\cgalNamedParamsEnd + +The optimization parameters can be passed in arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained +by perturbing mesh vertices and modifying the mesh connectivity +and that this has an impact +on the strict compliance to the refinement criteria. +Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `make_periodic_3_mesh_3()` +\sa `refine_mesh_3()` +\sa `exude_periodic_3_mesh_3()` +\sa `perturb_periodic_3_mesh_3()` +\sa `lloyd_optimize_periodic_3_mesh_3()` +\sa `odt_optimize_periodic_3_mesh_3()` +\sa `parameters::exude` +\sa `parameters::no_exude` +\sa `parameters::perturb` +\sa `parameters::no_perturb` +\sa `parameters::lloyd` +\sa `parameters::no_lloyd` +\sa `parameters::odt` +\sa `parameters::no_odt` + */ + + +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - return refine_periodic_3_mesh_3_impl(c3t3, domain, criteria, - exude_param, - perturb_param, - odt_param, - lloyd_param, - reset_param(), - mesh_options_param, - manifold_options_param); + 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()); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::no_perturb()); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); + parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3()); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + return refine_periodic_3_mesh_3_impl(c3t3, + domain, + criteria, + exude_param, + perturb_param, + odt_param, + lloyd_param, + reset_param(), + mesh_options_param, + manifold_options_param); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) +#ifndef DOXYGEN_RUNNING +#ifndef CGAL_NO_DEPRECATED_CODE + template + void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) + { + return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); + } #endif - /** * @brief This function refines the mesh c3t3 wrt domain & criteria * @@ -309,6 +460,152 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, CGAL_expensive_postcondition(c3t3.triangulation().is_valid()); CGAL_expensive_postcondition(c3t3.is_valid()); } +#else +namespace CGAL { + +/*! +\ingroup PkgPeriodic3Mesh3Functions +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. + +The function `refine_periodic_3_mesh_3()` is a 3D periodic +mesh generator. It produces periodic simplicial meshes which discretize +3D periodic domains. + +The periodic mesh generation algorithm is a Delaunay refinement process +followed by an optimization phase. +The criteria driving the Delaunay refinement +process may be tuned to achieve the user needs with respect to +the size of mesh elements, the accuracy of boundaries approximation, etc. + +The optimization phase is a sequence of optimization processes, +amongst the following available optimizers: an ODT-smoothing, +a Lloyd smoothing, a sliver perturber, and a sliver exuder. +Each optimization process can be activated or not, according to the user requirements +and available time. +By default, only the perturber and the exuder are activated. +Note that the benefits of the exuder will be lost if the mesh +is further refined afterward. + +\attention The function template `refine_periodic_3_mesh_3()` may be used +to refine a previously computed mesh, e.g.: +\code{.cpp} +C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); + +CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); +\endcode + +\attention Note that the triangulation must form at all times a simplicial complex within +a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro +of the manual of 3D periodic triangulations). It is the responsability of the user to provide +a triangulation that satisfies this condition when calling the refinement +function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh +complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` +will always satisfy this condition. + +\tparam C3T3 is required to be a model of the concept `MeshComplex_3InTriangulation_3`. +The argument `c3t3` is passed by reference as this object is modified +by the refinement process. As the refinement process only adds points +to the triangulation, all vertices of the triangulation of `c3t3` remain in the +mesh during the refinement process. The object `c3t3` can be used to insert +specific points in the domain to ensure that they will be contained in the +final triangulation. +The type `C3T3` is in particular required to provide a nested type +`C3T3::Triangulation` for the 3D periodic triangulation +embedding the periodic mesh. The vertex and cell base classes of the +triangulation `C3T3::Triangulation` are required to be models of the +concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of +the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. + +\tparam MD is required to be a model of +the concept `Periodic_3MeshDomain_3` or of the refined concept +`Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features +of the input complex have to be accurately represented in the mesh. +The argument `domain` is the sole link through which the domain +to be discretized is known by the mesh generation algorithm. + +\tparam MC has to be a model of the concept `MeshCriteria_3`, +or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain +has exposed features. The argument `criteria` of type `MC` specifies the +size and shape requirements for mesh tetrahedra and surface facets. These criteria +form the rules which drive the refinement process. All mesh elements +satisfy those criteria at the end of the refinement process. +In addition, if the domain has features, the argument `criteria` provides +a sizing field to guide the discretization of 1-dimensional exposed features. + +The four additional parameters are optimization parameters. +They control which optimization processes are performed +and allow the user to tune the parameters of the optimization processes. +Individual optimization parameters are not described here as they are +internal types (see instead the documentation page of each optimizer). +For each optimization algorithm, there exist two global functions +that allow to enable or disable the optimizer: + +\cgalHeading{Named Parameters} +- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to +trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the +parameters of this optimizer. If one parameter is not set, the default value of +`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. + +- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to +trigger or not a call to `odt_optimize_periodic_3_mesh_3()` function and +to set the parameters of this optimizer. +If one parameter is not set, the default value of +`odt_optimize_periodic_3_mesh_3()` is used for this parameter. + +- `perturb` `parameters::perturb()` and `parameters::no_perturb()` +are designed to trigger or not a call to `perturb_periodic_3_mesh_3()` function and +to set the parameters of this optimizer. If one parameter is not set, the default value of +`perturb_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to +trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the +parameters of this optimizer. If one parameter is not set, the default value of +`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be +equal to the refinement CPU time. + +The optimization parameters can be passed in arbitrary order. If one parameter +is not passed, its default value is used. The default values are +`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. +Note that whatever may be the optimization processes activated, +they are always launched in the order that is a suborder +of the following (see user manual for further +details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + +Beware that optimization of the mesh is obtained by perturbing mesh vertices +and modifying the mesh connectivity and that this has an impact on the strict +compliance to the refinement criteria. Though a strict compliance to mesh criteria +is guaranteed at the end of the Delaunay refinement, this may no longer be true after +some optimization processes. Also beware that the default behavior does involve some +optimization processes. + +\sa `make_periodic_3_mesh_3()` +\sa `refine_mesh_3()` +\sa `exude_periodic_3_mesh_3()` +\sa `perturb_periodic_3_mesh_3()` +\sa `lloyd_optimize_periodic_3_mesh_3()` +\sa `odt_optimize_periodic_3_mesh_3()` +\sa `parameters::exude` +\sa `parameters::no_exude` +\sa `parameters::perturb` +\sa `parameters::no_perturb` +\sa `parameters::lloyd` +\sa `parameters::no_lloyd` +\sa `parameters::odt` +\sa `parameters::no_odt` +*/ +template +void refine_periodic_3_mesh_3(C3T3& c3t3, + const MD& mesh_domain, + const MC& mesh_criteria, + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude()); + +} /* namespace CGAL */ + +#endif //DOXYGEN_RUNNING } // end namespace CGAL From 60f7a5c7cf0a76997002e7a9a72b30dbd11e09d8 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Mon, 27 Jun 2022 20:26:35 +0530 Subject: [PATCH 021/248] New API support and docs for Labeled_mesh_domain_3.h --- .../doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h | 3 + Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp | 2 +- ..._gray_image_with_custom_initialization.cpp | 2 +- .../Mesh_3/mesh_3D_weighted_image.cpp | 4 +- .../mesh_implicit_sphere_variable_size.cpp | 4 +- .../include/CGAL/Gray_image_mesh_domain_3.h | 8 +- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 4 +- .../CGAL/Labeled_image_mesh_domain_3.h | 6 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 421 ++++++++++++------ ...est_c3t3_extract_subdomains_boundaries.cpp | 2 +- .../Mesh_3/test_labeled_mesh_domain_3.cpp | 4 +- .../Mesh_3/test_meshing_3D_gray_image.cpp | 8 +- Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp | 4 +- .../Mesh_3/test_meshing_implicit_function.cpp | 8 +- .../Surface_mesh/Offset_meshing_plugin.cpp | 4 +- .../include/CGAL/Named_function_parameters.h | 12 + .../internal/parameters_interface.h | 12 +- .../test_mesh_and_remesh_image.cpp | 2 +- 19 files changed, 338 insertions(+), 175 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h index 59808d44899..2ed642b8bb5 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h @@ -110,6 +110,7 @@ Labeled_mesh_domain_3(const A_i&...); /*! \brief Construction from an implicit function +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. This static method is a named constructor. It constructs a domain whose bounding surface is described implicitly as the zero level set of a @@ -156,6 +157,7 @@ create_implicit_mesh_domain(A_i&...); /*! \brief Construction from a 3D gray image +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. This static method is a named constructor. It constructs a domain described by a 3D gray image. A 3D gray image is a grid of voxels, @@ -215,6 +217,7 @@ create_gray_image_mesh_domain(A_i&...); /*! \brief Construction from a 3D labeled image +\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. This static method is a named constructor. It constructs a domain described by a 3D labeled image. A 3D labeled image is a grid diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 0eecbbb80cc..ee7aea455cc 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -12,7 +12,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_mesh_domain_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp index 40dddc6a1a9..3ba8acb7336 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp @@ -37,7 +37,7 @@ int main(int argc, char*argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, 2.9f, 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, iso_value_new = 2.9f, value_outside_new = 0.f); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index 86edd7f2e78..8e5f8e69345 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, 2.9f, 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, iso_value_new - 2.9f, value_outside_new = 0.f); /// [Domain creation] /// [Mesh criteria] diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp index f6b072b3dcd..d82201f87f7 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp @@ -45,8 +45,8 @@ int main(int argc, char* argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, - weights = img_weights, - relative_error_bound = 1e-6); + weights_new = img_weights, + relative_error_bound_new = 1e-6); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index 3c1fc5c163d..afddfcd006e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -54,8 +54,8 @@ int main() /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (p::function = &sphere_function, - p::bounding_object = K::Sphere_3(CGAL::ORIGIN, 2.) + (sphere_function, + K::Sphere_3(CGAL::ORIGIN, 2.) ); /// [Domain creation] diff --git a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h index 2cc5e2cb59d..fd3210695c5 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -68,8 +68,8 @@ public: Transform(iso_value), Transform(iso_value)(value_outside)), Mesh_3::internal::compute_bounding_box(image), - error_bound, - p_rng) + parameters::relative_error_bound_new = error_bound, + parameters::p_rng_new = p_rng) { CGAL_assertion(Transform(iso_value)(value_outside) == 0); } @@ -81,8 +81,8 @@ public: CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, transform, transform(value_outside)), Mesh_3::internal::compute_bounding_box(image), - error_bound, - p_rng) + parameters::relative_error_bound_new = error_bound, + parameters::p_rng_new = p_rng) { CGAL_assertion(transform(value_outside) == 0); } diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 3b969f95e8d..4e11f6eb886 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -65,8 +65,8 @@ public: const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-6), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(f), bounding_sphere, error_bound, - Null_subdomain_index(), p_rng) {} + : Base(Wrapper(f), bounding_sphere, parameters::relative_error_bound_new = error_bound, + parameters::null_subdomain_index_new = Null_subdomain_index(), parameters::p_rng_new = p_rng) {} /// Destructor virtual ~Implicit_mesh_domain_3() {} diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 31ffaee34c8..ea7c79383b1 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -77,7 +77,7 @@ public: CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, Identity(), value_outside), compute_bounding_box(image), - error_bound, + parameters::relative_error_bound_new = error_bound, parameters::null_subdomain_index = null, parameters::p_rng = p_rng) {} @@ -87,8 +87,8 @@ public: CGAL::Random* p_rng) : Base(Wrapper(image), compute_bounding_box(image), - error_bound, - p_rng) + parameters::relative_error_bound_new = error_bound, + parameters::p_rng_new = p_rng) {} /// Destructor diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index c093cc52119..2ad605d9905 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -43,7 +43,7 @@ // support for implicit functions #include - +#include #include #include #include @@ -310,24 +310,24 @@ public: typedef typename BGT::FT FT; typedef BGT Geom_traits; - - - BOOST_PARAMETER_CONSTRUCTOR(Labeled_mesh_domain_3, - (Impl_details), - parameters::tag, - (required - (function_,(Function)) - (bounding_object_,*) - ) - (optional - (relative_error_bound_, (const FT&)) - (p_rng_, (CGAL::Random*)) - (null_subdomain_index_,(Null)) - (construct_surface_patch_index_, - (Construct_surface_patch_index)) - ) - ) using Impl_details::construct_pair_functor; + + template + Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const CGAL_NP_CLASS& np = parameters::default_values()) + :Impl_details(f,bbox, + parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::surface_patch_index), construct_pair_functor()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) + { + } +#ifndef CGAL_NO_DEPRECATED_CODE + template + Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const NP_PACK& ...nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) + { + } +#endif //CGAL_NO_DEPRECATED_CODE + /** * Backward-compatibility constructors, with `null_subdomain_index` as * fourth parameter. @@ -368,144 +368,281 @@ public: /// Named constructors /// @{ -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable: 4003) -#endif + /*! + \brief Construction from a 3D gray image - // see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS + This static method is a named constructor. It constructs a domain + described by a 3D gray image. A 3D gray image is a grid of voxels, + where each voxel is associated with a gray level value. Unless otherwise specified by the parameter `image_values_to_subdom_indices`, the domain to + be discretized is the union of voxels that lie inside a surface + described by an isolevel value, called \a isovalue. The voxels lying + inside the domain have gray level values that are larger than the + isovalue. + + The value of voxels is interpolated to a gray level value at any query point. + + This constructor uses named parameters . They can be specified in any order. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param image the input 3D image. Must be a `CGAL::Image_3` object. + + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + + \cgalNamedParamsBegin + \cgalParamNBegin{iso_value} + \cgalParamDescription{the isovalue, inside + `image`, of the surface describing the boundary of the object to be + meshed.} + \cgalParamDefault{0} + + \cgalParamNBegin{image_values_to_subdomain_indices} + \cgalParamDescription{a function or + a function object, compatible with the signature + `Subdomain_index(double)`. This function returns the subdomain index + corresponding to a pixel value. If this parameter is used, then the + parameter `iso_value` is ignored..} + \cgalParamDefault{Null_functor()} + + \cgalParamNBegin{value_outside} + \cgalParamDescription{the value attached to voxels + outside of the domain to be meshed. It should be lower than + `iso_value`.} + \cgalParamDefault{0} + + \cgalParamNBegin{relative_error_bound} + \cgalParamDescription{ is the relative error + bound, relative to the diameter of the box of the image.} + \cgalParamDefault{FT(1e-3)} - BOOST_PARAMETER_MEMBER_FUNCTION( - (Labeled_mesh_domain_3), - static create_gray_image_mesh_domain, - parameters::tag, - (required - (image_, (const CGAL::Image_3&)) - ) - (optional - (iso_value_, *, 0) - (value_outside_, *, 0) - (relative_error_bound_, (const FT&), - FT(1e-3)) - (p_rng_, (CGAL::Random*), (CGAL::Random*)(0)) - (image_values_to_subdomain_indices_, *, - Null_functor()) - (null_subdomain_index_,*,Null_functor()) - (construct_surface_patch_index_, *, - Null_functor()) - ) - ) + \cgalNamedParamsEnd + + \cgalHeading{Examples} + + From the example (\ref Mesh_3/mesh_3D_gray_image.cpp), where the name + of the parameters is not specified, as they are given is the same + order as the parameters definition: + + \snippet Mesh_3/mesh_3D_gray_image.cpp Domain creation + + From the example (\ref Mesh_3/mesh_3D_gray_vtk_image.cpp): + + \snippet Mesh_3/mesh_3D_gray_vtk_image.cpp Domain creation + + */ + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) { + using parameters::get_parameter; + using parameters::choose_parameter; + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (create_gray_image_wrapper - (image_, - iso_value_, - image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } + (create_gray_image_wrapper + (image_, + iso_value_, + image_values_to_subdomain_indices_, + value_outside_), + Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound_new = relative_error_bound_, + p::p_rng_new = p_rng_, + p::null_subdomain_index_new = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index_new = + create_construct_surface_patch_index(construct_surface_patch_index_)); - BOOST_PARAMETER_MEMBER_FUNCTION( - (Labeled_mesh_domain_3), - static create_labeled_image_mesh_domain, - parameters::tag, - (required - (image_, (const CGAL::Image_3&)) - ) - (optional - (relative_error_bound_, (const FT&), - FT(1e-3)) - (weights_, (const CGAL::Image_3&), CGAL::Image_3()) - (value_outside_, *, 0) - (p_rng_, (CGAL::Random*), (CGAL::Random*)(0)) - (image_values_to_subdomain_indices_, *, - Null_functor()) - (null_subdomain_index_,*,Null_functor()) - (construct_surface_patch_index_, *, - Null_functor()) - ) - ) + } +#ifndef CGAL_NO_DEPRECATED_CODE + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) + { + return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); + } +#endif //CGAL_NO_DEPRECATED_CODE + + + /*! + * \brief Construction from a 3D labeled image + + This static method is a named constructor. It constructs a + domain described by a 3D labeled image. A 3D labeled image is a grid + of voxels, where each voxel is associated with an index (a subdomain + index) characterizing the subdomain in which the voxel lies. The + domain to be discretized is the union of voxels that have non-zero + values. + + This constructor uses named parameters . They can be specified in any order. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param image the input 3D image. Must be a `CGAL::Image_3` object. + + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + + \cgalNamedParamsBegin + \cgalParamNBegin{weights} + \cgalParamDescription{an input 3D image that provides + weights associated to each voxel (the word type is `unsigned char`, + and the voxels values are integers between 0 and 255). + The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`. + Its dimensions must be the same as the dimensions of `parameters::image`.} + \cgalParamDefault{CGAL::Image_3()} + + \cgalParamNBegin{value_outside} + \cgalParamDescription{the value attached to voxels + outside of the domain to be meshed. It should be lower than + `iso_value`.} + \cgalParamDefault{0} + + \cgalParamNBegin{relative_error_bound} + \cgalParamDescription{ is the relative error + bound, relative to the diameter of the box of the image.} + \cgalParamDefault{FT(1e-3)} + \cgalNamedParamsEnd + +\cgalHeading{Example} + +From the example (\ref Mesh_3/mesh_3D_image.cpp): + +\snippet Mesh_3/mesh_3D_image.cpp Domain creation + +From the example (\ref Mesh_3/mesh_3D_weighted_image.cpp), +where the labeled image is used with a precomputed 3D image of weights : + +\snippet Mesh_3/mesh_3D_weighted_image.cpp Domain creation + + */ + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) + { + using parameters::get_parameter; + using parameters::choose_parameter; + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + CGAL::Image_3 weights_ = choose_parameter(get_parameter(np, internal_np::weights_param), CGAL::Image_3()); + + namespace p = CGAL::parameters; + if (weights_.is_valid()) + { + return Labeled_mesh_domain_3 + (create_weighted_labeled_image_wrapper + (image_, + weights_, + image_values_to_subdomain_indices_, + value_outside_), + Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound_new = relative_error_bound_, + p::p_rng_new = p_rng_, + p::null_subdomain_index_new = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index_new = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } + else + { + return Labeled_mesh_domain_3 + (create_labeled_image_wrapper + (image_, + image_values_to_subdomain_indices_, + value_outside_), + Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound_new = relative_error_bound_, + p::p_rng_new = p_rng_, + p::null_subdomain_index_new = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index_new = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } + } +#ifndef CGAL_NO_DEPRECATED_CODE + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) + { + return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); + } +#endif //CGAL_NO_DEPRECATED_CODE + + + +/// \name Creation of domains from implicit functions + +/*! +\brief Construction from an implicit function + +This static method is a named constructor. It constructs a domain +whose bounding surface is described implicitly as the zero level set of a +function. The domain to be discretized is assumed to be the domain where +the function has negative values. + +The method takes as argument a bounding sphere which is required to +circumscribe the surface and to have its center inside the domain. + +This constructor uses named parameters (from the Boost Parameter +Library). They can be specified in any order. + + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param function the implicit function, compatible with the signature `FT(Point_3)`: it takes a point as argument, + and returns a scalar value. That object must be model of `CopyConstructible`. + \param bounding_object the bounding object is either a bounding sphere (of type `Sphere_3`), a bounding box (type + `Bbox_3`), or a bounding `Iso_cuboid_3`. It must bounds the surface, and + its center must be inside the domain. + + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters". + +\cgalHeading{Examples} + +From the example (\ref Mesh_3/mesh_implicit_sphere.cpp), where the name of +the parameters is not specified, as they are given is the same order as the +parameters definition: + +\snippet Mesh_3/mesh_implicit_sphere.cpp Domain creation + +From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): + +\snippet Mesh_3/mesh_implicit_sphere_variable_size.cpp Domain creation + + */ + + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const CGAL_NP_CLASS& np = parameters::default_values()) { - namespace p = CGAL::parameters; - if (weights_.is_valid()) - { + using parameters::get_parameter; + using parameters::choose_parameter; + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (create_weighted_labeled_image_wrapper - (image_, - weights_, - image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - else - { - return Labeled_mesh_domain_3 - (create_labeled_image_wrapper - (image_, - image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } + (make_implicit_to_labeling_function_wrapper(function_), + bounding_object_, + p::relative_error_bound_new = relative_error_bound_, + p::p_rng_new = p_rng_, + p::null_subdomain_index_new = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index_new = + create_construct_surface_patch_index(construct_surface_patch_index_)); } - BOOST_PARAMETER_MEMBER_FUNCTION( - (Labeled_mesh_domain_3), - static create_implicit_mesh_domain, - parameters::tag, - (required - (function_, *) - (bounding_object_,*) - ) - (optional - (relative_error_bound_, (const FT&), - FT(1e-3)) - (p_rng_, (CGAL::Random*), (CGAL::Random*)(0)) - (null_subdomain_index_,*,Null_functor()) - (construct_surface_patch_index_, *, - Null_functor()) - ) - ) +#ifndef CGAL_NO_DEPRECATED_CODE + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const NP_Pack& ...nps) { - namespace p = CGAL::parameters; - return Labeled_mesh_domain_3 - (make_implicit_to_labeling_function_wrapper(function_), - bounding_object_, - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); + return create_implicit_mesh_domain(function_, bounding_object_, internal_np::combine_named_parameters(nps...)); } +#endif //CGAL_NO_DEPRECATED_CODE -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif /// @} /** diff --git a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp index 67047b119a8..f7a9ba7cba8 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp @@ -68,7 +68,7 @@ int main() v.push_back(f1); v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), 1e-6); + Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), relative_error_bound_new = 1e-6); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation diff --git a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp index 0c3a1b8c7bb..d4b8802ee13 100644 --- a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp +++ b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp @@ -72,12 +72,12 @@ private: Function f_sphere(&sphere_function); Function_wrapper wrapper_1(f_sphere); - Mesh_domain domain(wrapper_1, bounding_shape, error_bound); + Mesh_domain domain(wrapper_1, bounding_shape, CGAL::parameters::relative_error_bound_new = error_bound); test_construct_initial_points(domain, error_bound); Function f_shape(&shape_function); Function_wrapper wrapper_2(f_shape); - Mesh_domain domain_2(wrapper_2, bounding_shape, error_bound); + Mesh_domain domain_2(wrapper_2, bounding_shape, CGAL::parameters::relative_error_bound_new = error_bound); test_is_in_domain(domain_2); test_do_intersect_surface(domain_2); test_construct_intersection(domain_2); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index bbb5951b56c..95e516f5da8 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -67,10 +67,10 @@ public: // Domain Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain(image, - p::iso_value = 2.9f, - p::value_outside = 0.f, - p::relative_error_bound = 1e-3, - p::p_rng = + p::iso_value_new = 2.9f, + p::value_outside_new = 0.f, + p::relative_error_bound_new = 1e-3, + p::p_rng_new = &CGAL::get_default_random()); // Mesh criteria diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 5edfe1648a6..a08fc1acbc0 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -48,8 +48,8 @@ public: << CGAL::get_default_random().get_seed() << std::endl; Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain (image, - 1e-9, - CGAL::parameters::p_rng = &CGAL::get_default_random()); + CGAL::parameters::relative_error_bound_new = 1e-9, + CGAL::parameters::p_rng_new = &CGAL::get_default_random()); // Set mesh criteria Facet_criteria facet_criteria(25, 20*image.vx(), 5*image.vx()); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp index c2a0fe8f0fe..64f9490a957 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp @@ -43,10 +43,10 @@ struct Implicit_tester : public Tester namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (p::function = Implicit_tester::sphere_function, - p::bounding_object = Sphere_3(CGAL::ORIGIN,2.), - p::p_rng = &CGAL::get_default_random(), - p::relative_error_bound = 1e-3); + (Implicit_tester::sphere_function, + Sphere_3(CGAL::ORIGIN,2.), + p::p_rng_new = &CGAL::get_default_random(), + p::relative_error_bound_new = 1e-3); // Set mesh criteria Facet_criteria facet_criteria(0, 0, 0.3); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp index 4ef6a35b7a1..f79b0e70341 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp @@ -288,8 +288,8 @@ SMesh* cgal_off_meshing(QWidget*, Mesh_domain::create_implicit_mesh_domain (offset_function(tm_ptr, offset_value), Sphere_3(center, sqrad), - p::relative_error_bound = 1e-7, - p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); }); + p::relative_error_bound_new = 1e-7, + p::construct_surface_patch_index_new = [](int i, int j) { return (i * 1000 + j); }); const CGAL::Mesh_facet_topology topology = CGAL::FACET_VERTICES_ON_SAME_SURFACE_PATCH; auto manifold_option = p::non_manifold(); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index b0ab6d00de5..743574ff08f 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -367,6 +367,18 @@ const Boost_parameter_compatibility_wrapper const Boost_parameter_compatibility_wrapper mesh_options_param_new; const Boost_parameter_compatibility_wrapper manifold_options_param_new; const Boost_parameter_compatibility_wrapper features_param_new; + +const Boost_parameter_compatibility_wrapper image_new; +const Boost_parameter_compatibility_wrapper iso_value_new; +const Boost_parameter_compatibility_wrapper image_values_to_subdomain_indices_new; +const Boost_parameter_compatibility_wrapper value_outside_new; +const Boost_parameter_compatibility_wrapper relative_error_bound_new; +const Boost_parameter_compatibility_wrapper p_rng_new; +const Boost_parameter_compatibility_wrapper null_subdomain_index_new; +const Boost_parameter_compatibility_wrapper construct_surface_patch_index_new; +const Boost_parameter_compatibility_wrapper weights_new; + + #endif // function to extract a parameter diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index c45593c5aab..8e003417825 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -277,4 +277,14 @@ CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_optio CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options_param) CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_param) CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_param) -CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options_param) \ No newline at end of file +CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options_param) + +CGAL_add_named_parameter(image_3_param_t, image_3_param, image_3_param) +CGAL_add_named_parameter(iso_value_param_t, iso_value_param, iso_value_param) +CGAL_add_named_parameter(image_subdomain_index_t, image_subdomain_index, image_subdomain_index) +CGAL_add_named_parameter(voxel_value_t, voxel_value, voxel_value) +CGAL_add_named_parameter(error_bound_t, error_bound, error_bound) +CGAL_add_named_parameter(rng_t, rng, rng) +CGAL_add_named_parameter(null_subdomain_index_param_t,null_subdomain_index_param, null_subdomain_index_param) +CGAL_add_named_parameter(surface_patch_index_t, surface_patch_index, surface_patch_index) +CGAL_add_named_parameter(weights_param_t, weights_param, weights_param) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp index 2b6164634de..eb74c9b3fdb 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp @@ -39,7 +39,7 @@ int main() std::cerr << "Error: Cannot read file " << filename << std::endl; return EXIT_FAILURE; } - Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, 1e-9); + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, relative_error_bound_new = 1e-9); // Mesh criteria Facet_criteria facet_criteria(25, 20, 2); // angle, size, approximation From 7a080f9b92bc30456479c46bce20f024baffd764 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 29 Jun 2022 12:28:41 +0530 Subject: [PATCH 022/248] New API support and doc for Mesh_criteria_3.h --- Mesh_3/doc/Mesh_3/Doxyfile.in | 3 +- Mesh_3/include/CGAL/Mesh_criteria_3.h | 126 ++++++++++-------- .../include/CGAL/Named_function_parameters.h | 15 +++ .../internal/parameters_interface.h | 16 +++ 4 files changed, 105 insertions(+), 55 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index ee7aea455cc..42773fd414f 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -13,7 +13,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_mesh_domain_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_mesh_domain_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_criteria_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation" HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 5c88815ec9d..206de4a25df 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -22,7 +22,7 @@ #include #include - +#include #include #include #include @@ -33,29 +33,6 @@ #include namespace CGAL { -namespace parameters { - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - - BOOST_PARAMETER_NAME( (edge_size, tag) edge_size_ ) - BOOST_PARAMETER_NAME( (edge_sizing_field, tag) edge_sizing_field_ ) - BOOST_PARAMETER_NAME( (facet_angle, tag) facet_angle_ ) - BOOST_PARAMETER_NAME( (facet_size, tag) facet_size_ ) - BOOST_PARAMETER_NAME( (facet_sizing_field, tag) facet_sizing_field_ ) - BOOST_PARAMETER_NAME( (facet_distance, tag) facet_distance_ ) - BOOST_PARAMETER_NAME( (facet_topology, tag) facet_topology_ ) - BOOST_PARAMETER_NAME( (cell_radius_edge, tag) cell_radius_edge_ ) - BOOST_PARAMETER_NAME( (cell_radius_edge_ratio, tag) cell_radius_edge_ratio_ ) - BOOST_PARAMETER_NAME( (cell_size, tag) cell_size_ ) - BOOST_PARAMETER_NAME( (cell_sizing_field, tag) cell_sizing_field_ ) - BOOST_PARAMETER_NAME( (sizing_field, tag) sizing_field_ ) - -CGAL_PRAGMA_DIAG_POP - -} // end namespace parameters namespace internal { @@ -93,22 +70,22 @@ public: // This template constructor is not instantiated when named parameters // are not used, so Facet_criteria and Cell_criteria construction from FT // is not a problem - template - Mesh_criteria_3_impl(const ArgumentPack& args) - : edge_criteria_(args[parameters::edge_size - | args[parameters::edge_sizing_field - | args[parameters::sizing_field | FT(DBL_MAX)] ] ]) - , facet_criteria_(args[parameters::facet_angle | FT(0)], - args[parameters::facet_size - | args[parameters::facet_sizing_field - | args[parameters::sizing_field | FT(0)] ] ], - args[parameters::facet_distance | FT(0)], - args[parameters::facet_topology | CGAL::FACET_VERTICES_ON_SURFACE]) - , cell_criteria_(args[parameters::cell_radius_edge_ratio - | args[parameters::cell_radius_edge | FT(0)] ], - args[parameters::cell_size - | args[parameters::cell_sizing_field - | args[parameters::sizing_field | FT(0)] ] ]) + template + Mesh_criteria_3_impl(const CGAL_NP_CLASS& np) + :edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX))))), + facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0)))), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_distance_param), FT(0)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_topology_param), CGAL::FACET_VERTICES_ON_SURFACE)), + cell_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_ratio_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_param), FT(0))), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_size_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0))))) { } #ifndef CGAL_NO_DEPRECATED_CODE @@ -185,22 +162,63 @@ public: : Base(edge_criteria, facet_criteria, cell_criteria) {} +/*! + \brief Construction from criteria parameters. + This constructor uses named + parameters (from Boost.Parameter) for convenient criteria + construction. - // For convenient constructor call (see examples) - BOOST_PARAMETER_CONSTRUCTOR(Mesh_criteria_3, (Base), parameters::tag, - (optional (edge_size_,*) - (edge_sizing_field_,*) - (facet_angle_,*) - (facet_size_,*) - (facet_sizing_field_,*) - (facet_distance_,*) - (facet_topology_,*) - (cell_radius_edge_,*) - (cell_size_,*) - (cell_sizing_field_,*) - (sizing_field_,*) - )) + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + + \cgalNamedParamsBegin + \cgalParamNBegin{edge_size} + \cgalParamDescription{a scalar field (resp. a constant) providing a space varying + (resp. a uniform) + upper bound for the lengths of curve edges. This parameter has to be set to a positive + value when 1-dimensional features protection is used.} + + \cgalParamNBegin{facet_angle} + \cgalParamDescription{a lower bound for the angles (in degrees) of the + surface mesh facets.} + + \cgalParamNBegin{facet_size} + \cgalParamDescription{ a scalar field (resp. a constant) describing + a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls.} + + \cgalParamNBegin{facet_distance} + \cgalParamDescription{ a scalar field (resp. a constant) describing a space varying (resp. a uniform) + upper bound for the distance between the facet circumcenter and the center of its surface + Delaunay ball.} + \cgalParamNBegin{facet_topology} + \cgalParamDescription{ the set of topological constraints + which have to be verified by each surface facet. See `Mesh_facet_topology` manual page to + get all possible values.} + \cgalParamDefault{CGAL::FACET_VERTICES_ON_SURFACE} + + \cgalParamNBegin{cell_radius_edge_ratio} + \cgalParamDescription{ an upper bound for the radius-edge ratio of the mesh tetrahedra.} + + \cgalParamNBegin{cell_size} + \cgalParamDescription{ a scalar field (resp. a constant) describing + a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra.} + + + \cgalNamedParamsEnd + */ + +template +Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np) +{ +} + +#ifndef CGAL_NO_DEPRECATED_CODE + template + Mesh_criteria_3(const NP_PACK& ...nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) + { + } +#endif //CGAL_NO_DEPRECATED_CODE }; // end class Mesh_criteria_3 } // end namespace CGAL diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 743574ff08f..70ec897b8c2 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -378,6 +378,21 @@ const Boost_parameter_compatibility_wrapper construct_surface_patch_index_new; const Boost_parameter_compatibility_wrapper weights_new; +const Boost_parameter_compatibility_wrapper edge_size; +const Boost_parameter_compatibility_wrapper edge_sizing_field; +const Boost_parameter_compatibility_wrapper facet_angle; +const Boost_parameter_compatibility_wrapper facet_size; +const Boost_parameter_compatibility_wrapper facet_sizing_field; +const Boost_parameter_compatibility_wrapper facet_distance; +const Boost_parameter_compatibility_wrapper facet_topology; +const Boost_parameter_compatibility_wrapper cell_radius_edge; +const Boost_parameter_compatibility_wrapper cell_radius_edge_ratio; +const Boost_parameter_compatibility_wrapper cell_size; +const Boost_parameter_compatibility_wrapper cell_sizing_field; +const Boost_parameter_compatibility_wrapper sizing_field; + + + #endif diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 8e003417825..05abe4bb162 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -288,3 +288,19 @@ CGAL_add_named_parameter(rng_t, rng, rng) CGAL_add_named_parameter(null_subdomain_index_param_t,null_subdomain_index_param, null_subdomain_index_param) CGAL_add_named_parameter(surface_patch_index_t, surface_patch_index, surface_patch_index) CGAL_add_named_parameter(weights_param_t, weights_param, weights_param) + +CGAL_add_named_parameter(edge_size_param_t, edge_size_param, edge_size_param) +CGAL_add_named_parameter(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field_param) +CGAL_add_named_parameter(facet_angle_param_t, facet_angle_param, facet_angle_param) +CGAL_add_named_parameter(facet_size_param_t, facet_size_param, facet_size_param) +CGAL_add_named_parameter(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field_param) +CGAL_add_named_parameter(facet_distance_param_t, facet_distance_param, facet_distance_param) +CGAL_add_named_parameter(facet_topology_param_t, facet_topology_param, facet_topology_param) +CGAL_add_named_parameter(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge_param) +CGAL_add_named_parameter(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio_param) +CGAL_add_named_parameter(cell_size_param_t, cell_size_param, cell_size_param) +CGAL_add_named_parameter(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field_param) +CGAL_add_named_parameter(sizing_field_param_t, sizing_field_param, sizing_field_param) + + + From 4457b05350e7496d3cc3bd7d628138e1fe3b747d Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 29 Jun 2022 17:38:54 +0530 Subject: [PATCH 023/248] Removed _new prefix from named parameters --- .../random_points_in_tetrahedral_mesh_3.cpp | 2 +- .../random_points_on_tetrahedral_mesh_3.cpp | 2 +- Mesh_3/benchmark/Mesh_3/concurrency.cpp | 42 +++++----- Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp | 2 +- ..._gray_image_with_custom_initialization.cpp | 2 +- .../Mesh_3/mesh_3D_weighted_image.cpp | 4 +- .../Mesh_3/mesh_cubes_intersection.cpp | 6 +- .../mesh_cubes_intersection_with_features.cpp | 6 +- .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 6 +- .../Mesh_3/mesh_implicit_domains_2.cpp | 2 +- .../Mesh_3/mesh_implicit_ellipsoid.cpp | 4 +- .../mesh_implicit_sphere_variable_size.cpp | 2 +- .../Mesh_3/mesh_optimization_example.cpp | 8 +- .../mesh_optimization_lloyd_example.cpp | 12 +-- .../Mesh_3/mesh_polyhedral_domain.cpp | 4 +- .../Mesh_3/mesh_polyhedral_domain_sm.cpp | 2 +- ..._polyhedral_domain_with_surface_inside.cpp | 2 +- .../mesh_two_implicit_spheres_with_balls.cpp | 2 +- .../Mesh_3/remesh_polyhedral_surface.cpp | 2 +- .../Mesh_3/remesh_polyhedral_surface_sm.cpp | 2 +- .../include/CGAL/Gray_image_mesh_domain_3.h | 8 +- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 4 +- .../CGAL/Labeled_image_mesh_domain_3.h | 6 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 53 ++++-------- Mesh_3/include/CGAL/Mesh_criteria_3.h | 2 - Mesh_3/include/CGAL/exude_mesh_3.h | 4 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 12 +-- Mesh_3/include/CGAL/make_mesh_3.h | 33 +++----- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 10 +-- Mesh_3/include/CGAL/perturb_mesh_3.h | 4 +- Mesh_3/include/CGAL/refine_mesh_3.h | 68 +++++++--------- ...est_c3t3_extract_subdomains_boundaries.cpp | 4 +- .../Mesh_3/test_labeled_mesh_domain_3.cpp | 4 +- Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp | 2 +- .../Mesh_3/test_meshing_3D_gray_image.cpp | 16 ++-- .../test_meshing_3D_gray_image_deprecated.cpp | 8 +- Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp | 8 +- .../test_meshing_3D_image_deprecated.cpp | 4 +- .../test/Mesh_3/test_meshing_determinism.cpp | 12 +-- .../Mesh_3/test_meshing_implicit_function.cpp | 8 +- ...t_meshing_implicit_function_deprecated.cpp | 4 +- .../test/Mesh_3/test_meshing_polyhedron.cpp | 4 +- .../test_meshing_polyhedron_with_features.cpp | 6 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 22 ++--- .../mesh_implicit_shape_with_features.cpp | 4 +- .../mesh_implicit_shape_with_optimizers.cpp | 16 ++-- .../include/CGAL/make_periodic_3_mesh_3.h | 18 ++--- .../include/CGAL/refine_periodic_3_mesh_3.h | 34 ++++---- .../test_implicit_shapes_with_features.cpp | 6 +- .../poisson_and_parallel_mesh_3.cpp | 2 +- .../Surface_mesh/Offset_meshing_plugin.cpp | 4 +- .../include/CGAL/Named_function_parameters.h | 80 +++++++++---------- .../test_mesh_and_remesh_image.cpp | 4 +- 54 files changed, 273 insertions(+), 317 deletions(-) diff --git a/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp b/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp index 86be1b6e2ca..59e4f98797b 100644 --- a/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp +++ b/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp @@ -51,7 +51,7 @@ int main() Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Create the generator, input is the C3t3 c3t3 Random_points_in_tetrahedral_mesh_3 g(c3t3); diff --git a/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp b/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp index 0d24d88d5b0..42a4209d20b 100644 --- a/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp +++ b/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp @@ -50,7 +50,7 @@ int main() Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Create the generator, input is the C3t3 c3t3 Random_points_in_tetrahedral_mesh_boundary_3 g(c3t3); diff --git a/Mesh_3/benchmark/Mesh_3/concurrency.cpp b/Mesh_3/benchmark/Mesh_3/concurrency.cpp index 151d1f6a2a3..641ac1b0db7 100644 --- a/Mesh_3/benchmark/Mesh_3/concurrency.cpp +++ b/Mesh_3/benchmark/Mesh_3/concurrency.cpp @@ -531,22 +531,22 @@ bool make_mesh_polyhedron(const std::string &input_filename, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd_param_new = lloyd(time_limit=timelimit) + , lloyd_param = lloyd(time_limit=timelimit) # else - , lloyd_param_new = no_lloyd() + , lloyd_param = no_lloyd() # endif - , odt_param_new = no_odt() + , odt_param = no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb_param_new = perturb(time_limit = timelimit, + , perturb_param = perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , perturb_param_new = no_perturb() + , perturb_param = no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude_param_new = exude(time_limit = timelimit, + , exude_param = exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , exude_param_new = no_exude() + , exude_param = no_exude() #endif ); @@ -637,22 +637,22 @@ bool make_mesh_3D_images(const std::string &input_filename, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd_param_new = lloyd(time_limit=timelimit) + , lloyd_param = lloyd(time_limit=timelimit) # else - , lloyd_param_new = no_lloyd() + , lloyd_param = no_lloyd() # endif - , odt_param_new = no_odt() + , odt_param = no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb_param_new = perturb(time_limit = timelimit, + , perturb_param = perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , perturb_param_new = no_perturb() + , perturb_param = no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude_param_new = exude(time_limit = timelimit, + , exude_param = exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , exude_param_new = no_exude() + , exude_param = no_exude() #endif ); @@ -774,22 +774,22 @@ bool make_mesh_implicit(double facet_approx, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd_param_new = lloyd(time_limit=timelimit) + , lloyd_param = lloyd(time_limit=timelimit) # else - , lloyd_param_new = no_lloyd() + , lloyd_param = no_lloyd() # endif - , odt_param_new = no_odt() + , odt_param = no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb_param_new = perturb(time_limit = timelimit, + , perturb_param = perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , perturb_param_new = no_perturb() + , perturb_param = no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude_param_new = exude(time_limit = timelimit, + , exude_param = exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , exude_param_new = no_exude() + , exude_param = no_exude() #endif ); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp index 3ba8acb7336..31752737950 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp @@ -37,7 +37,7 @@ int main(int argc, char*argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, iso_value_new = 2.9f, value_outside_new = 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, iso_value = 2.9f, value_outside = 0.f); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index 8e5f8e69345..758145532e9 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, iso_value_new - 2.9f, value_outside_new = 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, iso_value = 2.9f, value_outside = 0.f); /// [Domain creation] /// [Mesh criteria] diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp index d82201f87f7..f6b072b3dcd 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp @@ -45,8 +45,8 @@ int main(int argc, char* argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, - weights_new = img_weights, - relative_error_bound_new = 1e-6); + weights = img_weights, + relative_error_bound = 1e-6); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 2a5e5f17480..e79e3634ab1 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -81,13 +81,13 @@ int main() cell_radius_edge_ratio = 2, cell_size = 0.4); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); + CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); // Exudation - CGAL::exude_mesh_3(c3t3,time_limit_new=12); + CGAL::exude_mesh_3(c3t3,time_limit=12); // Output std::ofstream medit_file("out_cubes_intersection.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index 3478946f53c..62ef5462944 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -168,13 +168,13 @@ int main() cell_radius_edge_ratio = 2, cell_size = 0.4); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); + CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); // Exudation - CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12); + CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit = 12); // Output std::ofstream medit_file("out_cubes_intersection_with_features.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index e1bf3711a82..3a31d4f61ed 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -240,7 +240,7 @@ int main() // Mesh generation (without optimization) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), exude_param_new = no_exude()); + perturb_param = no_perturb(), exude_param = no_exude()); // Output dump_c3t3(c3t3, "out"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index decc6822b62..7dd591df6d0 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -57,13 +57,13 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10); + CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); // Exudation - CGAL::exude_mesh_3(c3t3, time_limit_new=12); + CGAL::exude_mesh_3(c3t3, time_limit=12); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index 647e13a72d4..fee895f8443 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -59,7 +59,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp index 8d699afd3de..dbf3eb00ac7 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp @@ -51,7 +51,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation (without optimization) - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Output std::ofstream medit_file("out_wo.mesh"); @@ -59,7 +59,7 @@ int main() medit_file.close(); // Perturbation (5s, 12degree) - CGAL::perturb_mesh_3(c3t3, domain, time_limit_new=5, sliver_bound_new=12); + CGAL::perturb_mesh_3(c3t3, domain, time_limit=5, sliver_bound=12); // Exudation CGAL::exude_mesh_3(c3t3); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index afddfcd006e..0bc9deb4fd9 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -65,7 +65,7 @@ int main() cell_radius_edge_ratio=2, cell_size=size); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index 41485abadd3..b5c22f9438e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -48,14 +48,14 @@ int main(int argc, char* argv[]) // Mesh generation and optimization in one call (sliver_bound is the // targeted dihedral angle in degrees) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - exude_param_new = no_exude(), - perturb_param_new = perturb(sliver_bound=10, time_limit=15)); + exude_param = no_exude(), + perturb_param = perturb(sliver_bound=10, time_limit=15)); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), exude_param_new = no_exude()); + perturb_param = no_perturb(), exude_param = no_exude()); - CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit_new=15); + CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit=15); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index 12752c2d5f6..ddf6a7872f2 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -46,16 +46,16 @@ int main(int argc, char*argv[]) // Mesh generation and optimization in one call C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - lloyd_param_new = lloyd(time_limit=30), - perturb_param_new = no_perturb(), - exude_param_new = exude(time_limit=10, sliver_bound=10)); + lloyd_param = lloyd(time_limit=30), + perturb_param = no_perturb(), + exude_param = exude(time_limit=10, sliver_bound=10)); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), exude_param_new = no_exude()); + perturb_param = no_perturb(), exude_param = no_exude()); - CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit_new=30); - CGAL::exude_mesh_3(c3t3_bis, sliver_bound_new=10, time_limit_new=10); + CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30); + CGAL::exude_mesh_3(c3t3_bis, sliver_bound=10, time_limit=10); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index 2d9ca52a2fe..fe1917a822e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -57,7 +57,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -68,7 +68,7 @@ int main(int argc, char*argv[]) Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); // Mesh refinement (and make the output manifold) - CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold_options_param_new = manifold()); + CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold_options_param = manifold()); // Output medit_file.open("out_2.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp index 7888d04ccfe..a5f54bc712d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp @@ -57,7 +57,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Output std::ofstream medit_file("out_1.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp index c9ebc63fa74..0b5ec60b8dd 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp @@ -59,7 +59,7 @@ int main(int argc, char*argv[]) // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), exude_param_new = no_exude()); + perturb_param = no_perturb(), exude_param = no_exude()); std::cerr << t.time() << " sec." << std::endl; // Output diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index f161329d59d..b1a9a4a1984 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -85,7 +85,7 @@ int main() // Mesh generation without feature preservation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - features_param_new = CGAL::parameters::no_features()); + features_param = CGAL::parameters::no_features()); std::ofstream medit_file("out-no-protection.mesh"); c3t3.output_to_medit(medit_file); diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp index 2236aab3a21..61b215755a4 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp @@ -55,7 +55,7 @@ int main() facet_distance = 0.001); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp index 49b4e61b19f..b3357736b26 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp @@ -54,7 +54,7 @@ int main() facet_distance = 0.001); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h index fd3210695c5..4cee05d8d90 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -68,8 +68,8 @@ public: Transform(iso_value), Transform(iso_value)(value_outside)), Mesh_3::internal::compute_bounding_box(image), - parameters::relative_error_bound_new = error_bound, - parameters::p_rng_new = p_rng) + parameters::relative_error_bound = error_bound, + parameters::p_rng = p_rng) { CGAL_assertion(Transform(iso_value)(value_outside) == 0); } @@ -81,8 +81,8 @@ public: CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, transform, transform(value_outside)), Mesh_3::internal::compute_bounding_box(image), - parameters::relative_error_bound_new = error_bound, - parameters::p_rng_new = p_rng) + parameters::relative_error_bound = error_bound, + parameters::p_rng = p_rng) { CGAL_assertion(transform(value_outside) == 0); } diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 4e11f6eb886..dab6fffc355 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -65,8 +65,8 @@ public: const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-6), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(f), bounding_sphere, parameters::relative_error_bound_new = error_bound, - parameters::null_subdomain_index_new = Null_subdomain_index(), parameters::p_rng_new = p_rng) {} + : Base(Wrapper(f), bounding_sphere, parameters::relative_error_bound = error_bound, + parameters::null_subdomain_index = Null_subdomain_index(), parameters::p_rng = p_rng) {} /// Destructor virtual ~Implicit_mesh_domain_3() {} diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index ea7c79383b1..3e4a39e5f69 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -77,7 +77,7 @@ public: CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, Identity(), value_outside), compute_bounding_box(image), - parameters::relative_error_bound_new = error_bound, + parameters::relative_error_bound = error_bound, parameters::null_subdomain_index = null, parameters::p_rng = p_rng) {} @@ -87,8 +87,8 @@ public: CGAL::Random* p_rng) : Base(Wrapper(image), compute_bounding_box(image), - parameters::relative_error_bound_new = error_bound, - parameters::p_rng_new = p_rng) + parameters::relative_error_bound = error_bound, + parameters::p_rng = p_rng) {} /// Destructor diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 2ad605d9905..85bb78ba7ea 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -44,9 +43,6 @@ // support for implicit functions #include #include -#include -#include -#include #ifdef CGAL_MESH_3_VERBOSE # include #endif @@ -181,23 +177,6 @@ protected: return Construct_pair_from_subdomain_indices(); } - template - Labeled_mesh_domain_3_impl_details(ArgumentPack const& args) - : function_(args[parameters::function]) - , bbox_(iso_cuboid(args[parameters::bounding_object])) - , cstr_s_p_index(args[parameters::construct_surface_patch_index | - construct_pair_functor()]) - , null(args[parameters::null_subdomain_index | Null_subdomain_index()]) - , p_rng_(args[parameters::p_rng|0] == 0 ? - CGAL_Random_share_ptr_t(new CGAL::Random(0)) : - CGAL_Random_share_ptr_t(args[parameters::p_rng|(CGAL::Random*)(0)], - Mesh_3::internal::Do_not_delete())) - , squared_error_bound_ - ( squared_error_bound(bbox_, - args[parameters::relative_error_bound|FT(1e-3)])) - { - } - template (function_), bounding_object_, - p::relative_error_bound_new = relative_error_bound_, - p::p_rng_new = p_rng_, - p::null_subdomain_index_new = + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index_new = + p::construct_surface_patch_index = create_construct_surface_patch_index(construct_surface_patch_index_)); } diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 206de4a25df..a4f5d5e9a74 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 1b5fe11d127..5c7cf969392 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -55,13 +55,13 @@ to represent the final optimized mesh. @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin - \cgalParamNBegin{time_limit_new} + \cgalParamNBegin{time_limit} \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using the `Real_timer` class. The default value is 0 and means that there is no time limit.} \cgalParamType{`double`} \cgalParamDefault{0} - \cgalParamNBegin{sliver_bound_new} + \cgalParamNBegin{sliver_bound} \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. The exudation process considers in turn all the mesh cells that have a smallest dihedral angle less than sliver_bound and tries to make them disappear by weighting their vertices. diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 2726c9b92d9..82a09540e78 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -71,14 +71,14 @@ object used to create the `c3t3` parameter. @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin - \cgalParamNBegin{time_limit_new} + \cgalParamNBegin{time_limit} \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} \cgalParamType{`double`} - \cgalParamExtra{\pre `time_limit_new` \f$ \geq\f$ 0} + \cgalParamExtra{\pre `time_limit` \f$ \geq\f$ 0} \cgalParamDefault{0} - \cgalParamNBegin{max_iteration_number_new} + \cgalParamNBegin{max_iteration_number} \cgalParamDescription{limit on the number of performed iterations. 0 means that there is no limit on the number of performed iterations.} \cgalParamExtra{\pre `max_iteration_number >=0`} @@ -86,7 +86,7 @@ object used to create the `c3t3` parameter. \cgalParamDefault{0} - \cgalParamNBegin{freeze_bound_new} + \cgalParamNBegin{freeze_bound} \cgalParamDescription{designed to reduce running time of each optimization iteration. Any vertex that has a displacement less than a given fraction of the length of its shortest incident edge, is frozen (i.e.\ is not relocated). @@ -96,7 +96,7 @@ object used to create the `c3t3` parameter. \cgalParamType{`double`} \cgalParamDefault{0.001} - \cgalParamNBegin{convergence_new} + \cgalParamNBegin{convergence} \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped when at the last iteration the displacement of any vertex is less than a given fraction of the length of the shortest edge incident to that vertex.} @@ -104,7 +104,7 @@ object used to create the `c3t3` parameter. \cgalParamType{`double`} \cgalParamDefault{0.001} - \cgalParamNBegin{do_freeze_new} + \cgalParamNBegin{do_freeze} \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that moves, unfreezes all its incident vertices.} diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 0eb2b65b071..013a82fed14 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -30,7 +29,6 @@ #include #include -#include #include @@ -111,19 +109,6 @@ namespace parameters { return Generator()(); } - // ----------------------------------- - // Parameters - // ----------------------------------- - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - - BOOST_PARAMETER_NAME( features_param ) - -CGAL_PRAGMA_DIAG_POP - } // end namespace parameters::internal // ----------------------------------- @@ -432,7 +417,7 @@ of 1-dimensional exposed features. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" \cgalNamedParamsBegin - \cgalParamNBegin{features_param_new} + \cgalParamNBegin{features_param} \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be taken into account or not when the domain is a model of `MeshDomainWithFeatures_3`. @@ -449,7 +434,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} \cgalParamDefault{`parameters::features(domain)`} - \cgalParamNBegin{manifold_options_param_new} + \cgalParamNBegin{manifold_options_param} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -458,7 +443,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param_new} + \cgalParamNBegin{lloyd_param} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -466,7 +451,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{`parameters::no_lloyd()`} - \cgalParamNBegin{odt_param_new} + \cgalParamNBegin{odt_param} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -475,7 +460,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param_new} + \cgalParamNBegin{perturb_param} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -484,7 +469,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{`parameters::no_perturb`} - \cgalParamNBegin{exude_param_new} + \cgalParamNBegin{exude_param} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -611,9 +596,9 @@ void make_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process // Don't reset c3t3 as we just created it refine_mesh_3(c3t3, domain, criteria, - parameters::exude_param_new=exude, parameters::perturb_param_new=perturb, parameters::odt_param_new=odt, parameters::lloyd_param_new= lloyd, - parameters::reset_param_new=parameters::no_reset_c3t3(), parameters::mesh_options_param_new= mesh_options, - parameters::manifold_options_param_new= manifold_options); + parameters::exude_param=exude, parameters::perturb_param=perturb, parameters::odt_param=odt, parameters::lloyd_param= lloyd, + parameters::reset_param=parameters::no_reset_c3t3(), parameters::mesh_options_param= mesh_options, + parameters::manifold_options_param= manifold_options); } #else namespace CGAL { diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 383afbdc0da..f5430f9c072 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -70,7 +70,7 @@ object used to create the `c3t3` parameter. @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin - \cgalParamNBegin{time_limit_new} + \cgalParamNBegin{time_limit} \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using `Real_timer`. @@ -78,14 +78,14 @@ object used to create the `c3t3` parameter. \cgalParamType{`double`} \cgalParamDefault{0} - \cgalParamNBegin{max_iteration_number_new} + \cgalParamNBegin{max_iteration_number} \cgalParamDescription{sets a limit on the number of performed iterations. The default value of 0 means that there is no limit on the number of performed iterations.} \cgalParamType{`std::size_t`} \cgalParamDefault{0} - \cgalParamNBegin{convergence_new} + \cgalParamNBegin{convergence} \cgalParamDescription{is a stopping criterion based on convergence: the optimization process is stopped, when at the last iteration, the displacement of any vertex is less than a given percentage of the length @@ -94,14 +94,14 @@ object used to create the `c3t3` parameter. \cgalParamType{`double`} \cgalParamDefault{0.02} - \cgalParamNBegin{freeze_bound_new} + \cgalParamNBegin{freeze_bound} \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is not relocated). The parameter `freeze_bound` gives the threshold ratio.} \cgalParamType{`double`} \cgalParamDefault{0.01} - \cgalParamNBegin{do_freeze_new} + \cgalParamNBegin{do_freeze} \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that moves, unfreezes all its incident vertices.} diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 7b4ab01cde4..15860848e8d 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -66,13 +66,13 @@ object used to create the `c3t3` parameter. @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin - \cgalParamNBegin{time_limit_new} + \cgalParamNBegin{time_limit} \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process is stopped. This time is measured using the `Real_timer` class. The default value is 0 and means that there is no time limit.} \cgalParamType{`double`} \cgalParamDefault{0} - \cgalParamNBegin{sliver_bound_new} + \cgalParamNBegin{sliver_bound} \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. The exudation process considers in turn all the mesh cells that have a smallest dihedral angle less than sliver_bound and tries to make them disappear by weighting their vertices. diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 6c535a9ffdc..1e2b5343595 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -33,6 +32,12 @@ #include +#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ + struct Class : public Base { Class(bool b) : Base(b){} }; \ + inline Class function_true() { return Class(true); } \ + inline Class function_false() { return Class(false); } + + namespace CGAL { namespace details { @@ -455,30 +460,19 @@ inline internal::Mesh_3_options mesh_3_dump() return options; } + template + struct Base + { + Base(T t) : t_(t) {} + T operator()() const { return t_; } + private: + T t_; + }; // ----------------------------------- // Reset_c3t3 (undocumented) // ----------------------------------- CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) - // CGAL_BOOLEAN_PARAMETER defined in - -// see - CGAL_PRAGMA_DIAG_PUSH -// see - CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -// ----------------------------------- -// Parameters -// ----------------------------------- - BOOST_PARAMETER_NAME( exude_param ) - BOOST_PARAMETER_NAME( perturb_param ) - BOOST_PARAMETER_NAME( odt_param ) - BOOST_PARAMETER_NAME( lloyd_param ) - BOOST_PARAMETER_NAME( reset_param ) - BOOST_PARAMETER_NAME( mesh_options_param ) - BOOST_PARAMETER_NAME( manifold_options_param ) - - CGAL_PRAGMA_DIAG_POP } // end namespace parameters @@ -565,7 +559,7 @@ For each optimization algorithm, there exist two global functions that allow to enable or disable the optimizer: \cgalNamedParamsBegin - \cgalParamNBegin{manifold_options_param_new} + \cgalParamNBegin{manifold_options_param} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -574,7 +568,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param_new} + \cgalParamNBegin{lloyd_param} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -582,7 +576,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{'parameters::no_lloyd()'} - \cgalParamNBegin{odt_param_new} + \cgalParamNBegin{odt_param} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -591,7 +585,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param_new} + \cgalParamNBegin{perturb_param} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -600,7 +594,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{'parameters::no_perturb`} - \cgalParamNBegin{exude_param_new} + \cgalParamNBegin{exude_param} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -746,10 +740,10 @@ void refine_mesh_3_impl(C3T3& c3t3, { odt_optimize_mesh_3(c3t3, domain, - parameters::time_limit_new = odt.time_limit(), - parameters::max_iteration_number_new = odt.max_iteration_number(), - parameters::convergence_new = odt.convergence(), - parameters::freeze_bound_new = odt.bound()); + parameters::time_limit = odt.time_limit(), + parameters::max_iteration_number = odt.max_iteration_number(), + parameters::convergence = odt.convergence(), + parameters::freeze_bound = odt.bound()); } // Lloyd @@ -757,10 +751,10 @@ void refine_mesh_3_impl(C3T3& c3t3, { lloyd_optimize_mesh_3(c3t3, domain, - parameters::time_limit_new = lloyd.time_limit(), - parameters::max_iteration_number_new = lloyd.max_iteration_number(), - parameters::convergence_new = lloyd.convergence(), - parameters::freeze_bound_new = lloyd.bound()); + parameters::time_limit = lloyd.time_limit(), + parameters::max_iteration_number = lloyd.max_iteration_number(), + parameters::convergence = lloyd.convergence(), + parameters::freeze_bound = lloyd.bound()); } if( odt || lloyd) { @@ -777,8 +771,8 @@ void refine_mesh_3_impl(C3T3& c3t3, perturb_mesh_3(c3t3, domain, - parameters::time_limit_new = perturb_time_limit, - parameters::sliver_bound_new = perturb.bound()); + parameters::time_limit = perturb_time_limit, + parameters::sliver_bound = perturb.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } @@ -792,8 +786,8 @@ void refine_mesh_3_impl(C3T3& c3t3, exude_time_limit = exude.time_limit(); exude_mesh_3(c3t3, - parameters::time_limit_new = exude_time_limit, - parameters::sliver_bound_new = exude.bound()); + parameters::time_limit = exude_time_limit, + parameters::sliver_bound = exude.bound()); dump_c3t3(c3t3, mesh_options.dump_after_exude_prefix); } diff --git a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp index f7a9ba7cba8..da325ca36fb 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp @@ -68,7 +68,7 @@ int main() v.push_back(f1); v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), relative_error_bound_new = 1e-6); + Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), relative_error_bound = 1e-6); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation @@ -76,7 +76,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); // Output std::stringstream off_file; diff --git a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp index d4b8802ee13..78aef17f68d 100644 --- a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp +++ b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp @@ -72,12 +72,12 @@ private: Function f_sphere(&sphere_function); Function_wrapper wrapper_1(f_sphere); - Mesh_domain domain(wrapper_1, bounding_shape, CGAL::parameters::relative_error_bound_new = error_bound); + Mesh_domain domain(wrapper_1, bounding_shape, CGAL::parameters::relative_error_bound = error_bound); test_construct_initial_points(domain, error_bound); Function f_shape(&shape_function); Function_wrapper wrapper_2(f_shape); - Mesh_domain domain_2(wrapper_2, bounding_shape, CGAL::parameters::relative_error_bound_new = error_bound); + Mesh_domain domain_2(wrapper_2, bounding_shape, CGAL::parameters::relative_error_bound = error_bound); test_is_in_domain(domain_2); test_do_intersect_surface(domain_2); test_construct_intersection(domain_2); diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp index df88c7451a2..b2a15b42094 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp @@ -66,7 +66,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio = 3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); Gt::Construct_weighted_circumcenter_3 w_circumcenter = c3t3.triangulation().geom_traits().construct_weighted_circumcenter_3_object(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index 95e516f5da8..5d5b957c25c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -67,10 +67,10 @@ public: // Domain Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain(image, - p::iso_value_new = 2.9f, - p::value_outside_new = 0.f, - p::relative_error_bound_new = 1e-3, - p::p_rng_new = + p::iso_value = 2.9f, + p::value_outside = 0.f, + p::relative_error_bound = 1e-3, + p::p_rng = &CGAL::get_default_random()); // Mesh criteria @@ -82,10 +82,10 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), - exude_param_new = no_exude(), - mesh_options_param_new = mesh_3_options(number_of_initial_points_new = 30), - manifold_options_param_new = non_manifold() + perturb_param = no_perturb(), + exude_param = no_exude(), + mesh_options_param = mesh_3_options(number_of_initial_points = 30), + manifold_options_param = non_manifold() ); // Verify diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp index c785c2f528e..b2de44f7fc0 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp @@ -74,10 +74,10 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), - exude_param_new = no_exude(), - mesh_options_param_new = mesh_3_options(number_of_initial_points_new = 30), - manifold_options_param_new = non_manifold() + perturb_param = no_perturb(), + exude_param = no_exude(), + mesh_options_param = mesh_3_options(number_of_initial_points = 30), + manifold_options_param = non_manifold() ); // Verify diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index a08fc1acbc0..17a976c1ed9 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -48,8 +48,8 @@ public: << CGAL::get_default_random().get_seed() << std::endl; Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain (image, - CGAL::parameters::relative_error_bound_new = 1e-9, - CGAL::parameters::p_rng_new = &CGAL::get_default_random()); + CGAL::parameters::relative_error_bound = 1e-9, + CGAL::parameters::p_rng = &CGAL::get_default_random()); // Set mesh criteria Facet_criteria facet_criteria(25, 20*image.vx(), 5*image.vx()); @@ -58,8 +58,8 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); c3t3.remove_isolated_vertices(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp index 3a931aced34..3326826c74c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp @@ -42,8 +42,8 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); // Verify this->verify_c3t3_volume(c3t3, 1772330*0.95, 1772330*1.05); diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index 27aefc874ed..1d9b8dc4511 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -73,8 +73,8 @@ void test() { std::cout << "------- Iteration " << (i+1) << " -------" << std::endl; C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param_new = no_perturb(), - exude_param_new = no_exude()); + perturb_param = no_perturb(), + exude_param = no_exude()); std::ostringstream oss; c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str()); //[5*i] @@ -87,7 +87,7 @@ void test() oss.clear(); //LLOYD (1) - CGAL::lloyd_optimize_mesh_3(c3t3, domain, max_iteration_number_new = nb_lloyd); + CGAL::lloyd_optimize_mesh_3(c3t3, domain, max_iteration_number = nb_lloyd); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+1] oss.clear(); @@ -98,7 +98,7 @@ void test() oss.clear(); //ODT (2) - CGAL::odt_optimize_mesh_3(c3t3, domain, max_iteration_number_new = nb_odt); + CGAL::odt_optimize_mesh_3(c3t3, domain, max_iteration_number = nb_odt); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+2] oss.clear(); @@ -109,7 +109,7 @@ void test() oss.clear(); //PERTURB (3) - CGAL::perturb_mesh_3(c3t3, domain, sliver_bound_new=perturb_bound); + CGAL::perturb_mesh_3(c3t3, domain, sliver_bound=perturb_bound); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+3] oss.clear(); @@ -120,7 +120,7 @@ void test() oss.clear(); //EXUDE (4) - CGAL::exude_mesh_3(c3t3, sliver_bound_new=exude_bound); + CGAL::exude_mesh_3(c3t3, sliver_bound=exude_bound); c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str());//[i*5+4] oss.clear(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp index 64f9490a957..c243e8dc08b 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp @@ -45,8 +45,8 @@ struct Implicit_tester : public Tester Mesh_domain::create_implicit_mesh_domain (Implicit_tester::sphere_function, Sphere_3(CGAL::ORIGIN,2.), - p::p_rng_new = &CGAL::get_default_random(), - p::relative_error_bound_new = 1e-3); + p::p_rng = &CGAL::get_default_random(), + p::relative_error_bound = 1e-3); // Set mesh criteria Facet_criteria facet_criteria(0, 0, 0.3); @@ -68,8 +68,8 @@ struct Implicit_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp index 9949d92f5b9..aab81352ea2 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp @@ -66,8 +66,8 @@ struct Implicit_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp index 3da362738d5..351e65ada19 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp @@ -80,8 +80,8 @@ struct Polyhedron_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp index 014777bcea9..ff07e9b231a 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp @@ -125,9 +125,9 @@ struct Polyhedron_with_features_tester : public Tester // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::manifold_options_param_new = CGAL::parameters::manifold(), - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb()); + CGAL::parameters::manifold_options_param = CGAL::parameters::manifold(), + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 64245d8726a..7cb7a60603a 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -118,9 +118,9 @@ struct Tester // Refine again and verify nothing changed std::cerr << "Refining again...\n"; refine_mesh_3(c3t3,domain,criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb(), - CGAL::parameters::reset_param_new = CGAL::parameters::no_reset_c3t3()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb(), + CGAL::parameters::reset_param = CGAL::parameters::no_reset_c3t3()); #ifndef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE // Using adjacencies instead of calling oracle to update restricted @@ -134,9 +134,9 @@ struct Tester v = c3t3.triangulation().number_of_vertices(); refine_mesh_3(c3t3,domain,criteria, - CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb(), - CGAL::parameters::reset_param_new = CGAL::parameters::no_reset_c3t3()); + CGAL::parameters::exude_param = CGAL::parameters::no_exude(), + CGAL::parameters::perturb_param = CGAL::parameters::no_perturb(), + CGAL::parameters::reset_param = CGAL::parameters::no_reset_c3t3()); } f = c3t3.number_of_facets_in_complex(); @@ -164,7 +164,7 @@ struct Tester // Quality should increase C3t3 perturb_c3t3(c3t3); std::cerr << "Perturb...\n"; - CGAL::perturb_mesh_3(perturb_c3t3, domain, CGAL::parameters::time_limit_new =5); + CGAL::perturb_mesh_3(perturb_c3t3, domain, CGAL::parameters::time_limit =5); verify_c3t3(perturb_c3t3,domain,domain_type,v,v); verify_c3t3_quality(c3t3,perturb_c3t3); verify_c3t3_volume(perturb_c3t3, volume*0.95, volume*1.05); @@ -174,8 +174,8 @@ struct Tester // Vertex number should not change (obvious) C3t3 odt_c3t3(c3t3); std::cerr << "Odt...\n"; - CGAL::odt_optimize_mesh_3(odt_c3t3, domain, CGAL::parameters::time_limit_new=5, - CGAL::parameters::convergence_new=0.001, CGAL::parameters::freeze_bound_new=0.0005); + CGAL::odt_optimize_mesh_3(odt_c3t3, domain, CGAL::parameters::time_limit=5, + CGAL::parameters::convergence=0.001, CGAL::parameters::freeze_bound=0.0005); verify_c3t3(odt_c3t3,domain,domain_type,v,v); verify_c3t3_volume(odt_c3t3, volume*0.95, volume*1.05); verify_c3t3_hausdorff_distance(odt_c3t3, domain, domain_type, hdist); @@ -184,8 +184,8 @@ struct Tester // Vertex number should not change (obvious) C3t3 lloyd_c3t3(c3t3); std::cerr << "Lloyd...\n"; - CGAL::lloyd_optimize_mesh_3(lloyd_c3t3, domain, CGAL::parameters::time_limit_new=5, - CGAL::parameters::convergence_new=0.001, CGAL::parameters::freeze_bound_new=0.0005); + CGAL::lloyd_optimize_mesh_3(lloyd_c3t3, domain, CGAL::parameters::time_limit=5, + CGAL::parameters::convergence=0.001, CGAL::parameters::freeze_bound=0.0005); verify_c3t3(lloyd_c3t3,domain,domain_type,v,v); verify_c3t3_volume(lloyd_c3t3, volume*0.95, volume*1.05); verify_c3t3_hausdorff_distance(lloyd_c3t3, domain, domain_type, hdist); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index 50d70fb646a..e7327e8b3f5 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -108,8 +108,8 @@ int main(int argc, char** argv) domain.add_corner(Point(0.51, 0.51, 0.5)); // Mesh generation WITHOUT feature preservation (and no optimizers) - C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, features_param_new = no_features(), - exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, features_param = no_features(), + exude_param = no_exude(), perturb_param = no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 5aafbe917d8..563b8e2f932 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -70,10 +70,10 @@ int main(int argc, char** argv) // Mesh generation with optimizers C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, - odt_param_new = odt(convergence=0.03, freeze_bound=0.02, time_limit=30), - lloyd_param_new = lloyd(max_iteration_number=10), - perturb_param_new = perturb(sliver_bound=10, time_limit=30), - exude_param_new = exude(sliver_bound=10, time_limit=0)); + odt_param = odt(convergence=0.03, freeze_bound=0.02, time_limit=30), + lloyd_param = lloyd(max_iteration_number=10), + perturb_param = perturb(sliver_bound=10, time_limit=30), + exude_param = exude(sliver_bound=10, time_limit=0)); std::ofstream medit_file("output_implicit_shape_optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); @@ -87,10 +87,10 @@ int main(int argc, char** argv) CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); // Now, call each optimizer with its global function - CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence_new=0.03, freeze_bound_new=0.02, time_limit_new=30); - CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number_new=10); - CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound_new=10, time_limit_new=30); - CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound_new=10, time_limit_new=0); + CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence=0.03, freeze_bound=0.02, time_limit=30); + CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number=10); + CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound=10, time_limit=30); + CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound=10, time_limit=0); std::ofstream medit_file_ter("output_implicit_shape_two_steps.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 237f51ee01b..96f25ce548a 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -222,7 +222,7 @@ of 1-dimensional exposed features. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" \cgalNamedParamsBegin - \cgalParamNBegin{features_param_new} + \cgalParamNBegin{features_param} \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be taken into account or not when the domain is a model of `MeshDomainWithFeatures_3`. @@ -239,7 +239,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} \cgalParamDefault{`parameters::features(domain)`} - \cgalParamNBegin{manifold_options_param_new} + \cgalParamNBegin{manifold_options_param} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -248,7 +248,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param_new} + \cgalParamNBegin{lloyd_param} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -256,7 +256,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{`parameters::no_lloyd()`} - \cgalParamNBegin{odt_param_new} + \cgalParamNBegin{odt_param} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -265,7 +265,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param_new} + \cgalParamNBegin{perturb_param} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -274,7 +274,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{`parameters::no_perturb`} - \cgalParamNBegin{exude_param_new} + \cgalParamNBegin{exude_param} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -391,9 +391,9 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process refine_periodic_3_mesh_3(c3t3, domain, criteria, - parameters::exude_param_new = exude, parameters::perturb_param_new = perturb, parameters::odt_param_new = odt, - parameters::lloyd_param_new = lloyd, parameters::reset_param_new = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it - parameters::mesh_options_param_new = mesh_options, parameters::manifold_options_param_new = manifold_options); + parameters::exude_param = exude, parameters::perturb_param = perturb, parameters::odt_param = odt, + parameters::lloyd_param = lloyd, parameters::reset_param = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it + parameters::mesh_options_param = mesh_options, parameters::manifold_options_param = manifold_options); } #else namespace CGAL { 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 7f1a05562a1..98c9e72792d 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 @@ -217,7 +217,7 @@ For each optimization algorithm, there exist two global functions that allow to enable or disable the optimizer: \cgalNamedParamsBegin - \cgalParamNBegin{manifold_options_param_new} + \cgalParamNBegin{manifold_options_param} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -226,7 +226,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param_new} + \cgalParamNBegin{lloyd_param} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -234,7 +234,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{`parameters::no_lloyd()'} - \cgalParamNBegin{odt_param_new} + \cgalParamNBegin{odt_param} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -243,7 +243,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param_new} + \cgalParamNBegin{perturb_param} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -252,7 +252,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{`parameters::no_perturb`} - \cgalParamNBegin{exude_param_new} + \cgalParamNBegin{exude_param} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -405,20 +405,20 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, if(odt) { odt_optimize_mesh_3(c3t3, domain, - parameters::time_limit_new = odt.time_limit(), - parameters::max_iteration_number_new = odt.max_iteration_number(), - parameters::convergence_new = odt.convergence(), - parameters::freeze_bound_new = odt.bound()); + parameters::time_limit = odt.time_limit(), + parameters::max_iteration_number = odt.max_iteration_number(), + parameters::convergence = odt.convergence(), + parameters::freeze_bound = odt.bound()); } // Lloyd if(lloyd) { lloyd_optimize_mesh_3(c3t3, domain, - parameters::time_limit_new = lloyd.time_limit(), - parameters::max_iteration_number_new = lloyd.max_iteration_number(), - parameters::convergence_new = lloyd.convergence(), - parameters::freeze_bound_new = lloyd.bound()); + parameters::time_limit = lloyd.time_limit(), + parameters::max_iteration_number = lloyd.max_iteration_number(), + parameters::convergence = lloyd.convergence(), + parameters::freeze_bound = lloyd.bound()); } if(odt || lloyd) @@ -435,8 +435,8 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, perturb_time_limit = perturb.time_limit(); perturb_mesh_3(c3t3, domain, - parameters::time_limit_new = perturb_time_limit, - parameters::sliver_bound_new = perturb.bound()); + parameters::time_limit = perturb_time_limit, + parameters::sliver_bound = perturb.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } @@ -450,8 +450,8 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, exude_time_limit = exude.time_limit(); exude_mesh_3(c3t3, - parameters::time_limit_new = exude_time_limit, - parameters::sliver_bound_new = exude.bound()); + parameters::time_limit = exude_time_limit, + parameters::sliver_bound = exude.bound()); dump_c3t3(c3t3, mesh_options.dump_after_perturb_prefix); } diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp index 000b1b74a69..37196a7faaf 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp @@ -94,7 +94,7 @@ void test_protected_sphere() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param_new = manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param = manifold()); // Output std::ofstream medit_file_bis("protected_sphere.mesh"); @@ -159,7 +159,7 @@ void test_protected_squary_cylinder() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param_new = manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param = manifold()); // Output std::ofstream medit_file_bis("squary_cylinder.mesh"); @@ -272,7 +272,7 @@ void test_protected_squary_cylinder_2() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param_new = manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param = manifold()); // Output std::ofstream medit_file_bis("squary_cylinder_2.mesh"); diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp index a270c889e9a..42ece573bab 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp @@ -72,7 +72,7 @@ int main(int, char**) CGAL::parameters::facet_size = 4, CGAL::parameters::facet_distance = 0.1); C3t3 c3t3 = CGAL::make_mesh_3 (domain, criteria, - CGAL::parameters::manifold_options_param_new = CGAL::parameters::manifold()); + CGAL::parameters::manifold_options_param = CGAL::parameters::manifold()); return EXIT_SUCCESS; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp index f79b0e70341..4ef6a35b7a1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp @@ -288,8 +288,8 @@ SMesh* cgal_off_meshing(QWidget*, Mesh_domain::create_implicit_mesh_domain (offset_function(tm_ptr, offset_value), Sphere_3(center, sqrad), - p::relative_error_bound_new = 1e-7, - p::construct_surface_patch_index_new = [](int i, int j) { return (i * 1000 + j); }); + p::relative_error_bound = 1e-7, + p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); }); const CGAL::Mesh_facet_topology topology = CGAL::FACET_VERTICES_ON_SAME_SURFACE_PATCH; auto manifold_option = p::non_manifold(); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 70ec897b8c2..8887e8c7889 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -335,48 +335,48 @@ struct Boost_parameter_compatibility_wrapper }; // TODO: need to make sure this works when using several compilation units -const Boost_parameter_compatibility_wrapper max_iteration_number_new; -const Boost_parameter_compatibility_wrapper convergence_new; -const Boost_parameter_compatibility_wrapper freeze_bound_new; -const Boost_parameter_compatibility_wrapper time_limit_new; -const Boost_parameter_compatibility_wrapper seeds_begin_new; -const Boost_parameter_compatibility_wrapper seeds_end_new; -const Boost_parameter_compatibility_wrapper mark_new; -const Boost_parameter_compatibility_wrapper do_freeze_new; -const Boost_parameter_compatibility_wrapper sliver_criterion_new; -const Boost_parameter_compatibility_wrapper perturbation_vector_new; +const Boost_parameter_compatibility_wrapper max_iteration_number; +const Boost_parameter_compatibility_wrapper convergence; +const Boost_parameter_compatibility_wrapper freeze_bound; +const Boost_parameter_compatibility_wrapper time_limit; +const Boost_parameter_compatibility_wrapper seeds_begin; +const Boost_parameter_compatibility_wrapper seeds_end; +const Boost_parameter_compatibility_wrapper mark; +const Boost_parameter_compatibility_wrapper do_freeze; +const Boost_parameter_compatibility_wrapper sliver_criterion; +const Boost_parameter_compatibility_wrapper perturbation_vector; //Compatibility wrappers for exude_mesh_3.h -const Boost_parameter_compatibility_wrapper sliver_bound_new; -const Boost_parameter_compatibility_wrapper mesh_topology_new; -const Boost_parameter_compatibility_wrapper dump_after_init_prefix_new; -const Boost_parameter_compatibility_wrapper dump_after_refine_surface_prefix_new; -const Boost_parameter_compatibility_wrapper dump_after_refine_prefix_new; -const Boost_parameter_compatibility_wrapper dump_after_glob_opt_prefix_new; -const Boost_parameter_compatibility_wrapper dump_after_perturb_prefix_new; -const Boost_parameter_compatibility_wrapper dump_after_exude_prefix_new; -const Boost_parameter_compatibility_wrapper number_of_initial_points_new; -const Boost_parameter_compatibility_wrapper maximal_number_of_vertices_new; -const Boost_parameter_compatibility_wrapper nonlinear_growth_of_balls_new; -const Boost_parameter_compatibility_wrapper pointer_to_error_code_new; -const Boost_parameter_compatibility_wrapper pointer_to_stop_atomic_boolean_new; -const Boost_parameter_compatibility_wrapper exude_param_new; -const Boost_parameter_compatibility_wrapper perturb_param_new; -const Boost_parameter_compatibility_wrapper odt_param_new; -const Boost_parameter_compatibility_wrapper lloyd_param_new; -const Boost_parameter_compatibility_wrapper reset_param_new; -const Boost_parameter_compatibility_wrapper mesh_options_param_new; -const Boost_parameter_compatibility_wrapper manifold_options_param_new; -const Boost_parameter_compatibility_wrapper features_param_new; +const Boost_parameter_compatibility_wrapper sliver_bound; +const Boost_parameter_compatibility_wrapper mesh_topology; +const Boost_parameter_compatibility_wrapper dump_after_init_prefix; +const Boost_parameter_compatibility_wrapper dump_after_refine_surface_prefix; +const Boost_parameter_compatibility_wrapper dump_after_refine_prefix; +const Boost_parameter_compatibility_wrapper dump_after_glob_opt_prefix; +const Boost_parameter_compatibility_wrapper dump_after_perturb_prefix; +const Boost_parameter_compatibility_wrapper dump_after_exude_prefix; +const Boost_parameter_compatibility_wrapper number_of_initial_points; +const Boost_parameter_compatibility_wrapper maximal_number_of_vertices; +const Boost_parameter_compatibility_wrapper nonlinear_growth_of_balls; +const Boost_parameter_compatibility_wrapper pointer_to_error_code; +const Boost_parameter_compatibility_wrapper pointer_to_stop_atomic_boolean; +const Boost_parameter_compatibility_wrapper exude_param; +const Boost_parameter_compatibility_wrapper perturb_param; +const Boost_parameter_compatibility_wrapper odt_param; +const Boost_parameter_compatibility_wrapper lloyd_param; +const Boost_parameter_compatibility_wrapper reset_param; +const Boost_parameter_compatibility_wrapper mesh_options_param; +const Boost_parameter_compatibility_wrapper manifold_options_param; +const Boost_parameter_compatibility_wrapper features_param; -const Boost_parameter_compatibility_wrapper image_new; -const Boost_parameter_compatibility_wrapper iso_value_new; -const Boost_parameter_compatibility_wrapper image_values_to_subdomain_indices_new; -const Boost_parameter_compatibility_wrapper value_outside_new; -const Boost_parameter_compatibility_wrapper relative_error_bound_new; -const Boost_parameter_compatibility_wrapper p_rng_new; -const Boost_parameter_compatibility_wrapper null_subdomain_index_new; -const Boost_parameter_compatibility_wrapper construct_surface_patch_index_new; -const Boost_parameter_compatibility_wrapper weights_new; +const Boost_parameter_compatibility_wrapper image; +const Boost_parameter_compatibility_wrapper iso_value; +const Boost_parameter_compatibility_wrapper image_values_to_subdomain_indices; +const Boost_parameter_compatibility_wrapper value_outside; +const Boost_parameter_compatibility_wrapper relative_error_bound; +const Boost_parameter_compatibility_wrapper p_rng; +const Boost_parameter_compatibility_wrapper null_subdomain_index; +const Boost_parameter_compatibility_wrapper construct_surface_patch_index; +const Boost_parameter_compatibility_wrapper weights; const Boost_parameter_compatibility_wrapper edge_size; const Boost_parameter_compatibility_wrapper edge_sizing_field; diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp index eb74c9b3fdb..300723a93e7 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp @@ -39,7 +39,7 @@ int main() std::cerr << "Error: Cannot read file " << filename << std::endl; return EXIT_FAILURE; } - Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, relative_error_bound_new = 1e-9); + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, relative_error_bound = 1e-9); // Mesh criteria Facet_criteria facet_criteria(25, 20, 2); // angle, size, approximation @@ -47,7 +47,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Meshing - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); std::cout << "Meshing done." << std::endl; From 996985126c509bba206f88df772018fb29f66511 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 5 Jul 2022 20:33:49 +0530 Subject: [PATCH 024/248] Changed some functions to pass without specifying param. name --- .../random_points_in_tetrahedral_mesh_3.cpp | 2 +- .../random_points_on_tetrahedral_mesh_3.cpp | 2 +- Mesh_3/benchmark/Mesh_3/concurrency.cpp | 42 +++---- .../mesh_cubes_intersection_with_features.cpp | 2 +- .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 2 +- .../Mesh_3/mesh_implicit_domains_2.cpp | 2 +- .../Mesh_3/mesh_implicit_ellipsoid.cpp | 2 +- .../mesh_implicit_sphere_variable_size.cpp | 2 +- .../Mesh_3/mesh_optimization_example.cpp | 6 +- .../mesh_optimization_lloyd_example.cpp | 8 +- .../Mesh_3/mesh_polyhedral_domain.cpp | 4 +- .../Mesh_3/mesh_polyhedral_domain_sm.cpp | 2 +- ..._polyhedral_domain_with_surface_inside.cpp | 2 +- .../mesh_two_implicit_spheres_with_balls.cpp | 2 +- .../Mesh_3/remesh_polyhedral_surface.cpp | 2 +- .../Mesh_3/remesh_polyhedral_surface_sm.cpp | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 30 +++-- Mesh_3/include/CGAL/refine_mesh_3.h | 111 +++++++++++------- ...est_c3t3_extract_subdomains_boundaries.cpp | 2 +- Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp | 2 +- .../Mesh_3/test_meshing_3D_gray_image.cpp | 8 +- .../test_meshing_3D_gray_image_deprecated.cpp | 8 +- Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp | 4 +- .../test_meshing_3D_image_deprecated.cpp | 4 +- .../test/Mesh_3/test_meshing_determinism.cpp | 4 +- .../Mesh_3/test_meshing_implicit_function.cpp | 4 +- ...t_meshing_implicit_function_deprecated.cpp | 4 +- .../test/Mesh_3/test_meshing_polyhedron.cpp | 4 +- .../test_meshing_polyhedron_with_features.cpp | 6 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 12 +- .../mesh_implicit_shape_with_features.cpp | 4 +- .../mesh_implicit_shape_with_optimizers.cpp | 6 +- .../test_implicit_shapes_with_features.cpp | 6 +- .../poisson_and_parallel_mesh_3.cpp | 2 +- .../test_mesh_and_remesh_image.cpp | 2 +- 36 files changed, 170 insertions(+), 139 deletions(-) diff --git a/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp b/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp index 59e4f98797b..79a1ea4fd14 100644 --- a/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp +++ b/Generator/examples/Generator/random_points_in_tetrahedral_mesh_3.cpp @@ -51,7 +51,7 @@ int main() Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Create the generator, input is the C3t3 c3t3 Random_points_in_tetrahedral_mesh_3 g(c3t3); diff --git a/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp b/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp index 42a4209d20b..d564ee7c2f3 100644 --- a/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp +++ b/Generator/examples/Generator/random_points_on_tetrahedral_mesh_3.cpp @@ -50,7 +50,7 @@ int main() Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Create the generator, input is the C3t3 c3t3 Random_points_in_tetrahedral_mesh_boundary_3 g(c3t3); diff --git a/Mesh_3/benchmark/Mesh_3/concurrency.cpp b/Mesh_3/benchmark/Mesh_3/concurrency.cpp index 641ac1b0db7..ea383a78832 100644 --- a/Mesh_3/benchmark/Mesh_3/concurrency.cpp +++ b/Mesh_3/benchmark/Mesh_3/concurrency.cpp @@ -531,22 +531,22 @@ bool make_mesh_polyhedron(const std::string &input_filename, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd_param = lloyd(time_limit=timelimit) + , lloyd(time_limit=timelimit) # else - , lloyd_param = no_lloyd() + , no_lloyd() # endif - , odt_param = no_odt() + , no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb_param = perturb(time_limit = timelimit, + , perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , perturb_param = no_perturb() + , no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude_param = exude(time_limit = timelimit, + , exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , exude_param = no_exude() + , no_exude() #endif ); @@ -637,22 +637,22 @@ bool make_mesh_3D_images(const std::string &input_filename, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd_param = lloyd(time_limit=timelimit) + , lloyd(time_limit=timelimit) # else - , lloyd_param = no_lloyd() + , no_lloyd() # endif - , odt_param = no_odt() + , no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb_param = perturb(time_limit = timelimit, + , perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , perturb_param = no_perturb() + , no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude_param = exude(time_limit = timelimit, + , exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , exude_param = no_exude() + , no_exude() #endif ); @@ -774,22 +774,22 @@ bool make_mesh_implicit(double facet_approx, C3t3 c3t3 = CGAL::make_mesh_3( domain , criteria # ifdef CGAL_MESH_3_BENCHMARK_LLOYD - , lloyd_param = lloyd(time_limit=timelimit) + , lloyd(time_limit=timelimit) # else - , lloyd_param = no_lloyd() + , no_lloyd() # endif - , odt_param = no_odt() + , no_odt() # ifdef CGAL_MESH_3_BENCHMARK_PERTURB - , perturb_param = perturb(time_limit = timelimit, + , perturb(time_limit = timelimit, sliver_bound = sliverbound) # else - , perturb_param = no_perturb() + , no_perturb() #endif #ifdef CGAL_MESH_3_BENCHMARK_EXUDE - , exude_param = exude(time_limit = timelimit, + , exude(time_limit = timelimit, sliver_bound = sliverbound) #else - , exude_param = no_exude() + , no_exude() #endif ); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index 62ef5462944..2cd6f54fb6b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -168,7 +168,7 @@ int main() cell_radius_edge_ratio = 2, cell_size = 0.4); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index 3a31d4f61ed..8bac578a112 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -240,7 +240,7 @@ int main() // Mesh generation (without optimization) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), exude_param = no_exude()); + no_perturb(), no_exude()); // Output dump_c3t3(c3t3, "out"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index 7dd591df6d0..04d5b876c35 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -57,7 +57,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index fee895f8443..6d50993bbdd 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -59,7 +59,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp index dbf3eb00ac7..9e28374783e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp @@ -51,7 +51,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation (without optimization) - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Output std::ofstream medit_file("out_wo.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index 0bc9deb4fd9..a385cfb8a54 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -65,7 +65,7 @@ int main() cell_radius_edge_ratio=2, cell_size=size); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index b5c22f9438e..9f72d6c276a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -48,12 +48,12 @@ int main(int argc, char* argv[]) // Mesh generation and optimization in one call (sliver_bound is the // targeted dihedral angle in degrees) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - exude_param = no_exude(), - perturb_param = perturb(sliver_bound=10, time_limit=15)); + no_exude(), + perturb(sliver_bound=10, time_limit=15)); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), exude_param = no_exude()); + no_perturb(), no_exude()); CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit=15); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index ddf6a7872f2..e4a6e6a5dcb 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -46,13 +46,13 @@ int main(int argc, char*argv[]) // Mesh generation and optimization in one call C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - lloyd_param = lloyd(time_limit=30), - perturb_param = no_perturb(), - exude_param = exude(time_limit=10, sliver_bound=10)); + lloyd(time_limit=30), + no_perturb(), + exude(time_limit=10, sliver_bound=10)); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), exude_param = no_exude()); + no_perturb(), no_exude()); CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30); CGAL::exude_mesh_3(c3t3_bis, sliver_bound=10, time_limit=10); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index fe1917a822e..f5cf67e0204 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -57,7 +57,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -68,7 +68,7 @@ int main(int argc, char*argv[]) Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); // Mesh refinement (and make the output manifold) - CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold_options_param = manifold()); + CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold()); // Output medit_file.open("out_2.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp index a5f54bc712d..7cb6dda697d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp @@ -57,7 +57,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio=3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Output std::ofstream medit_file("out_1.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp index 0b5ec60b8dd..51009ad7cb8 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp @@ -59,7 +59,7 @@ int main(int argc, char*argv[]) // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), exude_param = no_exude()); + no_perturb(), no_exude()); std::cerr << t.time() << " sec." << std::endl; // Output diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index b1a9a4a1984..bdc5ac62e7a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -85,7 +85,7 @@ int main() // Mesh generation without feature preservation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - features_param = CGAL::parameters::no_features()); + CGAL::parameters::no_features()); std::ofstream medit_file("out-no-protection.mesh"); c3t3.output_to_medit(medit_file); diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp index 61b215755a4..3a22bb35526 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp @@ -55,7 +55,7 @@ int main() facet_distance = 0.001); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp index b3357736b26..1ddf6772d04 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp @@ -54,7 +54,7 @@ int main() facet_distance = 0.001); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 013a82fed14..e33f6022161 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -92,21 +92,27 @@ namespace parameters { // ----------------------------------- // Features_options // ----------------------------------- - inline internal::Features_options - features() { return internal::Features_options(true); } + inline Named_function_parameters + features() { + typedef Named_function_parameters Param; + return Param(internal::Features_options(true)); + } - inline internal::Features_options - no_features() { return internal::Features_options(false); } + inline Named_function_parameters + no_features() { + typedef Named_function_parameters Param; + return Param(internal::Features_options(false)); } template < typename MeshDomain > - inline internal::Features_options + inline Named_function_parameters features(const MeshDomain& /*domain*/) { typedef typename internal::Domain_features_generator< MeshDomain, CGAL::Mesh_3::internal::has_Has_features::value > Generator; - return Generator()(); + typedef Named_function_parameters Param; + return Param(Generator()()); } } // end namespace parameters::internal @@ -524,11 +530,11 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS using parameters::choose_parameter; using parameters::get_parameter; C3T3 c3t3; - parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude()); - parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb()); - parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); - parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); - parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain)); + 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); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); @@ -597,7 +603,7 @@ void make_mesh_3_impl(C3T3& c3t3, // Don't reset c3t3 as we just created it refine_mesh_3(c3t3, domain, criteria, parameters::exude_param=exude, parameters::perturb_param=perturb, parameters::odt_param=odt, parameters::lloyd_param= lloyd, - parameters::reset_param=parameters::no_reset_c3t3(), parameters::mesh_options_param= mesh_options, + parameters::no_reset_c3t3(), parameters::mesh_options_param= mesh_options, parameters::manifold_options_param= manifold_options); } #else diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 1e2b5343595..b5b95fe33f6 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -34,8 +34,12 @@ #define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ struct Class : public Base { Class(bool b) : Base(b){} }; \ - inline Class function_true() { return Class(true); } \ - inline Class function_false() { return Class(false); } + inline Named_function_parameters function_true() { \ + typedef Named_function_parameters Param; \ + return Param(Class(true)); } \ + inline Named_function_parameters function_false() {\ + typedef Named_function_parameters Param; \ + return Param(Class(false)); } namespace CGAL { @@ -249,7 +253,7 @@ struct Mesh_3_options { // ----------------------------------- template -internal::Perturb_options perturb(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters perturb(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -262,26 +266,30 @@ internal::Perturb_options perturb(const CGAL_NP_CLASS& np = parameters::default_ options.set_time_limit(time_limit); options.set_bound(sliver_bound); - - return options; + typedef Named_function_parameters Param; + return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE template -internal::Perturb_options perturb(const NP_Pack& ...nps) +Named_function_parameters perturb(const NP_Pack& ...nps) { return perturb(internal_np::combine_named_parameters(nps...)); } #endif -inline internal::Perturb_options no_perturb() { return internal::Perturb_options(false); } +inline Named_function_parameters no_perturb() { + + typedef Named_function_parameters Param; + return Param(internal::Perturb_options(false)); +} // ----------------------------------- // Exude // ----------------------------------- template -internal::Exude_options exude(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters exude(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -292,26 +300,29 @@ internal::Exude_options exude(const CGAL_NP_CLASS& np = parameters::default_valu if ( internal::undef_parameter != time_limit) options.set_time_limit(time_limit); - options.set_bound(sliver_bound); + typedef Named_function_parameters Param; - return options; + return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE template -internal::Exude_options exude(const NP_Pack& ...nps) +Named_function_parameters exude(const NP_Pack& ...nps) { - return perturb(internal_np::combine_named_parameters(nps...)); + return exude(internal_np::combine_named_parameters(nps...)); } #endif -inline internal::Exude_options no_exude() { return internal::Exude_options(false); } +inline Named_function_parameters no_exude() { + typedef Named_function_parameters Param; + return Param(internal::Exude_options(false)); +} // ----------------------------------- // Odt // ----------------------------------- template -internal::Odt_options odt(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters odt(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -325,24 +336,27 @@ internal::Odt_options odt(const CGAL_NP_CLASS& np = parameters::default_values() options.set_bound(freeze_bound); options.set_convergence(convergence); options.set_max_iteration_number(max_iteration_number); - - return options; + typedef Named_function_parameters Param; + return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE template -internal::Odt_options Odt(const NP_Pack& ...nps) +Named_function_parameters odt(const NP_Pack& ...nps) { - return Odt(internal_np::combine_named_parameters(nps...)); + return odt(internal_np::combine_named_parameters(nps...)); } #endif -inline internal::Odt_options no_odt() { return internal::Odt_options(false); } +inline Named_function_parameters no_odt() { + typedef Named_function_parameters Param; + return Param(internal::Odt_options(false)); +} // ----------------------------------- // Lloyd // ----------------------------------- template -internal::Lloyd_options lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -357,54 +371,63 @@ internal::Lloyd_options lloyd(const CGAL_NP_CLASS& np = parameters::default_valu options.set_convergence(convergence); options.set_max_iteration_number(max_iteration_number); - return options; + typedef Named_function_parameters Param; + return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE template -internal::Lloyd_options lloyd(const NP_Pack& ...nps) +Named_function_parameters lloyd(const NP_Pack& ...nps) { return lloyd(internal_np::combine_named_parameters(nps...)); } #endif -inline internal::Lloyd_options no_lloyd() { return internal::Lloyd_options(false); } +inline Named_function_parameters no_lloyd() { + typedef Named_function_parameters Param; + return Param(internal::Lloyd_options(false)); +} // ----------------------------------- // Manifold options ------------------ // ----------------------------------- template -internal::Manifold_options manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); internal::Manifold_options options; options.mesh_topology = mesh_topology; - return options; + + typedef Named_function_parameters Param; + return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE template -internal::Manifold_options manifold_options(const NP_Pack& ...nps) +Named_function_parameters manifold_options(const NP_Pack& ...nps) { return manifold_options(internal_np::combine_named_parameters(nps...)); } #endif -inline internal::Manifold_options manifold() +inline Named_function_parameters manifold() { - return internal::Manifold_options( - internal::Manifold_options::MANIFOLD); + typedef Named_function_parameters Param; + return Param(internal::Manifold_options( + internal::Manifold_options::MANIFOLD)); } -inline internal::Manifold_options manifold_with_boundary() +inline Named_function_parameters manifold_with_boundary() { - return internal::Manifold_options( - internal::Manifold_options::MANIFOLD_WITH_BOUNDARY); + typedef Named_function_parameters Param; + return Param(internal::Manifold_options( + internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); } -inline internal::Manifold_options non_manifold() +inline Named_function_parameters non_manifold() { - return internal::Manifold_options( - internal::Manifold_options::NON_MANIFOLD); + typedef Named_function_parameters Param; + return Param(internal::Manifold_options( + internal::Manifold_options::NON_MANIFOLD)); } // ----------------------------------- @@ -416,7 +439,7 @@ inline internal::Manifold_options non_manifold() // algorithm. template -internal::Mesh_3_options mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -436,11 +459,13 @@ internal::Mesh_3_options mesh_3_options(const CGAL_NP_CLASS& np = parameters::de options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); #endif - return options; + + typedef Named_function_parameters Param; + return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE template -internal::Mesh_3_options manifold_options(const NP_Pack& ...nps) +Named_function_parameters mesh_3_options(const NP_Pack& ...nps) { return mesh_3_options(internal_np::combine_named_parameters(nps...)); } @@ -645,11 +670,11 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const { 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::exude()); - parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb()); - parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); - parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); - parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3()); + 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); + parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3().v); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); diff --git a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp index da325ca36fb..43614d7dd46 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_extract_subdomains_boundaries.cpp @@ -76,7 +76,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Output std::stringstream off_file; diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp index b2a15b42094..fe31c62f6a4 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp @@ -66,7 +66,7 @@ int main(int argc, char*argv[]) cell_radius_edge_ratio = 3); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, perturb_param = no_perturb(), exude_param = no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); Gt::Construct_weighted_circumcenter_3 w_circumcenter = c3t3.triangulation().geom_traits().construct_weighted_circumcenter_3_object(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index 5d5b957c25c..191ea47fafa 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -82,10 +82,10 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), - exude_param = no_exude(), - mesh_options_param = mesh_3_options(number_of_initial_points = 30), - manifold_options_param = non_manifold() + no_perturb(), + no_exude(), + mesh_3_options(number_of_initial_points = 30), + non_manifold() ); // Verify diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp index b2de44f7fc0..b2ba365111f 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image_deprecated.cpp @@ -74,10 +74,10 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), - exude_param = no_exude(), - mesh_options_param = mesh_3_options(number_of_initial_points = 30), - manifold_options_param = non_manifold() + no_perturb(), + no_exude(), + mesh_3_options(number_of_initial_points = 30), + non_manifold() ); // Verify diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 17a976c1ed9..9885213a25c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -58,8 +58,8 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb()); c3t3.remove_isolated_vertices(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp index 3326826c74c..ed1a1fbd14b 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp @@ -42,8 +42,8 @@ public: // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb()); // Verify this->verify_c3t3_volume(c3t3, 1772330*0.95, 1772330*1.05); diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index 1d9b8dc4511..d359509388f 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -73,8 +73,8 @@ void test() { std::cout << "------- Iteration " << (i+1) << " -------" << std::endl; C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - perturb_param = no_perturb(), - exude_param = no_exude()); + no_perturb(), + no_exude()); std::ostringstream oss; c3t3.output_to_medit(oss); output_c3t3.push_back(oss.str()); //[5*i] diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp index c243e8dc08b..39e8cd88d78 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp @@ -68,8 +68,8 @@ struct Implicit_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp index aab81352ea2..6a7a8aa0b57 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function_deprecated.cpp @@ -66,8 +66,8 @@ struct Implicit_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp index 351e65ada19..b758086448e 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp @@ -80,8 +80,8 @@ struct Polyhedron_tester : public Tester domain.index_from_surface_patch_index(Surface_patch_index(0,1))); CGAL::refine_mesh_3(c3t3, domain, criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp index ff07e9b231a..9babdd1a160 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp @@ -125,9 +125,9 @@ struct Polyhedron_with_features_tester : public Tester // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::manifold_options_param = CGAL::parameters::manifold(), - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb()); + CGAL::parameters::manifold(), + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb()); CGAL::remove_far_points_in_mesh_3(c3t3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 7cb7a60603a..82854729aa6 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -118,9 +118,9 @@ struct Tester // Refine again and verify nothing changed std::cerr << "Refining again...\n"; refine_mesh_3(c3t3,domain,criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb(), - CGAL::parameters::reset_param = CGAL::parameters::no_reset_c3t3()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb(), + CGAL::parameters::no_reset_c3t3()); #ifndef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE // Using adjacencies instead of calling oracle to update restricted @@ -134,9 +134,9 @@ struct Tester v = c3t3.triangulation().number_of_vertices(); refine_mesh_3(c3t3,domain,criteria, - CGAL::parameters::exude_param = CGAL::parameters::no_exude(), - CGAL::parameters::perturb_param = CGAL::parameters::no_perturb(), - CGAL::parameters::reset_param = CGAL::parameters::no_reset_c3t3()); + CGAL::parameters::no_exude(), + CGAL::parameters::no_perturb(), + CGAL::parameters::no_reset_c3t3()); } f = c3t3.number_of_facets_in_complex(); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index e7327e8b3f5..6b608a5bda1 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -108,8 +108,8 @@ int main(int argc, char** argv) domain.add_corner(Point(0.51, 0.51, 0.5)); // Mesh generation WITHOUT feature preservation (and no optimizers) - C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, features_param = no_features(), - exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, no_features(), + no_exude(), perturb_param = no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 563b8e2f932..9318df4c689 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -71,9 +71,9 @@ int main(int argc, char** argv) // Mesh generation with optimizers C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, odt_param = odt(convergence=0.03, freeze_bound=0.02, time_limit=30), - lloyd_param = lloyd(max_iteration_number=10), - perturb_param = perturb(sliver_bound=10, time_limit=30), - exude_param = exude(sliver_bound=10, time_limit=0)); + lloyd(max_iteration_number=10), + perturb(sliver_bound=10, time_limit=30), + exude(sliver_bound=10, time_limit=0)); std::ofstream medit_file("output_implicit_shape_optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp index 37196a7faaf..2a297d3f89b 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp @@ -94,7 +94,7 @@ void test_protected_sphere() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param = manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold()); // Output std::ofstream medit_file_bis("protected_sphere.mesh"); @@ -159,7 +159,7 @@ void test_protected_squary_cylinder() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param = manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold()); // Output std::ofstream medit_file_bis("squary_cylinder.mesh"); @@ -272,7 +272,7 @@ void test_protected_squary_cylinder_2() domain.add_features(polylines.begin(), polylines.end()); // Mesh generation with feature preservation - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold_options_param = manifold()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, manifold()); // Output std::ofstream medit_file_bis("squary_cylinder_2.mesh"); diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp index 42ece573bab..6e584c7aa44 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp @@ -72,7 +72,7 @@ int main(int, char**) CGAL::parameters::facet_size = 4, CGAL::parameters::facet_distance = 0.1); C3t3 c3t3 = CGAL::make_mesh_3 (domain, criteria, - CGAL::parameters::manifold_options_param = CGAL::parameters::manifold()); + CGAL::parameters::manifold()); return EXIT_SUCCESS; } diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp index 300723a93e7..1e415320b5e 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp @@ -47,7 +47,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Meshing - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); std::cout << "Meshing done." << std::endl; From 3c5299dd94a6ed7232bbf1cb4958db7b9e460eaa Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 5 Jul 2022 20:45:04 +0530 Subject: [PATCH 025/248] Changed missed out calls --- Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp | 2 +- Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp | 2 +- .../Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp | 2 +- .../Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index e79e3634ab1..c9fe2896b14 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -81,7 +81,7 @@ int main() cell_radius_edge_ratio = 2, cell_size = 0.4); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, exude_param = no_exude(), perturb_param = no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index 8bac578a112..c638395342c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -240,7 +240,7 @@ int main() // Mesh generation (without optimization) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + no_perturb(), no_exude()); // Output dump_c3t3(c3t3, "out"); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index 6b608a5bda1..680b0153c95 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -109,7 +109,7 @@ int main(int argc, char** argv) // Mesh generation WITHOUT feature preservation (and no optimizers) C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, no_features(), - no_exude(), perturb_param = no_perturb()); + no_exude(), no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 9318df4c689..3d2c42a4c4e 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -70,7 +70,7 @@ int main(int argc, char** argv) // Mesh generation with optimizers C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, - odt_param = odt(convergence=0.03, freeze_bound=0.02, time_limit=30), + odt(convergence=0.03, freeze_bound=0.02, time_limit=30), lloyd(max_iteration_number=10), perturb(sliver_bound=10, time_limit=30), exude(sliver_bound=10, time_limit=0)); From 78afe0c76e9e9b707f92b00ff32afa487f027733 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Thu, 14 Jul 2022 12:34:50 +0530 Subject: [PATCH 026/248] Moved named parameter specific code to seperate file --- .../doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h | 6 +- .../include/CGAL/Mesh_3/internal/parameters.h | 237 ++++++++++++++++++ Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/perturb_mesh_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 230 +---------------- .../include/CGAL/refine_periodic_3_mesh_3.h | 2 +- 8 files changed, 247 insertions(+), 236 deletions(-) create mode 100644 Mesh_3/include/CGAL/Mesh_3/internal/parameters.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h index 2ed642b8bb5..c5e547f7f6b 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h @@ -110,7 +110,7 @@ Labeled_mesh_domain_3(const A_i&...); /*! \brief Construction from an implicit function -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. This static method is a named constructor. It constructs a domain whose bounding surface is described implicitly as the zero level set of a @@ -157,7 +157,7 @@ create_implicit_mesh_domain(A_i&...); /*! \brief Construction from a 3D gray image -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. This static method is a named constructor. It constructs a domain described by a 3D gray image. A 3D gray image is a grid of voxels, @@ -217,7 +217,7 @@ create_gray_image_mesh_domain(A_i&...); /*! \brief Construction from a 3D labeled image -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. This static method is a named constructor. It constructs a domain described by a 3D labeled image. A 3D labeled image is a grid diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h new file mode 100644 index 00000000000..83790c0892a --- /dev/null +++ b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h @@ -0,0 +1,237 @@ +#ifndef CGAL_PARAMETERS_H +#define CGAL_PARAMETERS_H + +#include +#include +#include +#include + +namespace parameters{ + +// ----------------------------------- +// Perturb +// ----------------------------------- + +template +Named_function_parameters perturb(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); + + internal::Perturb_options options(true); + + if ( internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + + options.set_bound(sliver_bound); + typedef Named_function_parameters Param; + return Param(options); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +template +Named_function_parameters perturb(const NP_Pack& ...nps) +{ + return perturb(internal_np::combine_named_parameters(nps...)); +} +#endif + + +inline Named_function_parameters no_perturb() { + + typedef Named_function_parameters Param; + return Param(internal::Perturb_options(false)); +} + +// ----------------------------------- +// Exude +// ----------------------------------- +template +Named_function_parameters exude(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); + + internal::Exude_options options(true); + + if ( internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + options.set_bound(sliver_bound); + typedef Named_function_parameters Param; + + return Param(options); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +template +Named_function_parameters exude(const NP_Pack& ...nps) +{ + return exude(internal_np::combine_named_parameters(nps...)); +} +#endif +inline Named_function_parameters no_exude() { + typedef Named_function_parameters Param; + return Param(internal::Exude_options(false)); +} + +// ----------------------------------- +// Odt +// ----------------------------------- +template +Named_function_parameters odt(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::odt_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::odt_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); + internal::Odt_options options(true); + + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + typedef Named_function_parameters Param; + return Param(options); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +template +Named_function_parameters odt(const NP_Pack& ...nps) +{ + return odt(internal_np::combine_named_parameters(nps...)); +} +#endif +inline Named_function_parameters no_odt() { + typedef Named_function_parameters Param; + return Param(internal::Odt_options(false)); +} + +// ----------------------------------- +// Lloyd +// ----------------------------------- +template +Named_function_parameters lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::lloyd_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::lloyd_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); + internal::Lloyd_options options(true); + + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + + typedef Named_function_parameters Param; + return Param(options); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +template +Named_function_parameters lloyd(const NP_Pack& ...nps) +{ + return lloyd(internal_np::combine_named_parameters(nps...)); +} +#endif +inline Named_function_parameters no_lloyd() { + typedef Named_function_parameters Param; + return Param(internal::Lloyd_options(false)); +} + +// ----------------------------------- +// Manifold options ------------------ +// ----------------------------------- +template +Named_function_parameters manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); + internal::Manifold_options options; + options.mesh_topology = mesh_topology; + + typedef Named_function_parameters Param; + return Param(options); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +template +Named_function_parameters manifold_options(const NP_Pack& ...nps) +{ + return manifold_options(internal_np::combine_named_parameters(nps...)); +} +#endif + +inline Named_function_parameters manifold() +{ + typedef Named_function_parameters Param; + return Param(internal::Manifold_options( + internal::Manifold_options::MANIFOLD)); +} +inline Named_function_parameters manifold_with_boundary() +{ + typedef Named_function_parameters Param; + return Param(internal::Manifold_options( + internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); +} +inline Named_function_parameters non_manifold() +{ + typedef Named_function_parameters Param; + return Param(internal::Manifold_options( + internal::Manifold_options::NON_MANIFOLD)); +} + +// ----------------------------------- +// Mesh options +// ----------------------------------- + +// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. +// Allows to dump the mesh at given stage of the mesh generation +// algorithm. + +template +Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + internal::Mesh_3_options options; + + options.dump_after_init_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_init_prefix_param), ""); + options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); + options.dump_after_refine_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_prefix_param), ""); + options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_glob_opt_prefix_param), ""); + options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_perturb_prefix_param), ""); + options.dump_after_exude_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); + options.number_of_initial_points=choose_parameter(get_parameter(np, internal_np::number_of_initial_points_param), -1); + options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, internal_np::nonlinear_growth_of_balls_param), false); + options.maximal_number_of_vertices=choose_parameter(get_parameter(np, internal_np::maximal_number_of_vertices_param), 0); + options.pointer_to_error_code=choose_parameter(get_parameter(np, internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); +#ifndef CGAL_NO_ATOMIC + options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), + ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); +#endif + + typedef Named_function_parameters Param; + return Param(options); +} +#ifndef CGAL_NO_DEPRECATED_CODE +template +Named_function_parameters mesh_3_options(const NP_Pack& ...nps) +{ + return mesh_3_options(internal_np::combine_named_parameters(nps...)); +} +#endif + + +} //namespace parameters + +#endif //CGAL_PARAMETERS_H \ No newline at end of file diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 5c7cf969392..7b43940a626 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -144,7 +144,7 @@ namespace CGAL { /*! \ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. The sliver exudation process consists in optimizing the weights of vertices diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 82a09540e78..1fd954b09de 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -213,7 +213,7 @@ namespace CGAL { /*! \ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. The function `lloyd_optimize_mesh_3()` is a mesh optimization process based on the minimization of a global energy function. diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index f5430f9c072..4b7ccde8bb1 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -204,7 +204,7 @@ namespace CGAL { /*! \ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. The function `odt_optimize_mesh_3()` is a mesh optimization process based on the minimization of a global energy function. diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 15860848e8d..f5c6db9e0f8 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -200,7 +200,7 @@ namespace CGAL { /*! \ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. The function `perturb_mesh_3()` is a mesh optimizer that improves the quality of a Delaunay mesh diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index b5b95fe33f6..f88853bd28a 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -27,7 +27,6 @@ #include #include #include - #include #include @@ -247,229 +246,6 @@ struct Mesh_3_options { } // end namespace internal - -// ----------------------------------- -// Perturb -// ----------------------------------- - -template -Named_function_parameters perturb(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); - double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - - internal::Perturb_options options(true); - - if ( internal::undef_parameter != time_limit) - options.set_time_limit(time_limit); - - options.set_bound(sliver_bound); - typedef Named_function_parameters Param; - return Param(options); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters perturb(const NP_Pack& ...nps) -{ - return perturb(internal_np::combine_named_parameters(nps...)); -} -#endif - - -inline Named_function_parameters no_perturb() { - - typedef Named_function_parameters Param; - return Param(internal::Perturb_options(false)); -} - -// ----------------------------------- -// Exude -// ----------------------------------- -template -Named_function_parameters exude(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); - double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - - internal::Exude_options options(true); - - if ( internal::undef_parameter != time_limit) - options.set_time_limit(time_limit); - options.set_bound(sliver_bound); - typedef Named_function_parameters Param; - - return Param(options); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters exude(const NP_Pack& ...nps) -{ - return exude(internal_np::combine_named_parameters(nps...)); -} -#endif -inline Named_function_parameters no_exude() { - typedef Named_function_parameters Param; - return Param(internal::Exude_options(false)); -} - -// ----------------------------------- -// Odt -// ----------------------------------- -template -Named_function_parameters odt(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::odt_freeze_ratio); - double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::odt_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); - internal::Odt_options options(true); - - options.set_time_limit(time_limit); - options.set_bound(freeze_bound); - options.set_convergence(convergence); - options.set_max_iteration_number(max_iteration_number); - typedef Named_function_parameters Param; - return Param(options); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters odt(const NP_Pack& ...nps) -{ - return odt(internal_np::combine_named_parameters(nps...)); -} -#endif -inline Named_function_parameters no_odt() { - typedef Named_function_parameters Param; - return Param(internal::Odt_options(false)); -} - -// ----------------------------------- -// Lloyd -// ----------------------------------- -template -Named_function_parameters lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::lloyd_freeze_ratio); - double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::lloyd_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); - internal::Lloyd_options options(true); - - options.set_time_limit(time_limit); - options.set_bound(freeze_bound); - options.set_convergence(convergence); - options.set_max_iteration_number(max_iteration_number); - - typedef Named_function_parameters Param; - return Param(options); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters lloyd(const NP_Pack& ...nps) -{ - return lloyd(internal_np::combine_named_parameters(nps...)); -} -#endif -inline Named_function_parameters no_lloyd() { - typedef Named_function_parameters Param; - return Param(internal::Lloyd_options(false)); -} - -// ----------------------------------- -// Manifold options ------------------ -// ----------------------------------- -template -Named_function_parameters manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); - internal::Manifold_options options; - options.mesh_topology = mesh_topology; - - typedef Named_function_parameters Param; - return Param(options); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters manifold_options(const NP_Pack& ...nps) -{ - return manifold_options(internal_np::combine_named_parameters(nps...)); -} -#endif - -inline Named_function_parameters manifold() -{ - typedef Named_function_parameters Param; - return Param(internal::Manifold_options( - internal::Manifold_options::MANIFOLD)); -} -inline Named_function_parameters manifold_with_boundary() -{ - typedef Named_function_parameters Param; - return Param(internal::Manifold_options( - internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); -} -inline Named_function_parameters non_manifold() -{ - typedef Named_function_parameters Param; - return Param(internal::Manifold_options( - internal::Manifold_options::NON_MANIFOLD)); -} - -// ----------------------------------- -// Mesh options -// ----------------------------------- - -// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. -// Allows to dump the mesh at given stage of the mesh generation -// algorithm. - -template -Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - internal::Mesh_3_options options; - - options.dump_after_init_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_init_prefix_param), ""); - options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); - options.dump_after_refine_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_prefix_param), ""); - options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_glob_opt_prefix_param), ""); - options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_perturb_prefix_param), ""); - options.dump_after_exude_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); - options.number_of_initial_points=choose_parameter(get_parameter(np, internal_np::number_of_initial_points_param), -1); - options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, internal_np::nonlinear_growth_of_balls_param), false); - options.maximal_number_of_vertices=choose_parameter(get_parameter(np, internal_np::maximal_number_of_vertices_param), 0); - options.pointer_to_error_code=choose_parameter(get_parameter(np, internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); -#ifndef CGAL_NO_ATOMIC - options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), - ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); -#endif - - typedef Named_function_parameters Param; - return Param(options); -} -#ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters mesh_3_options(const NP_Pack& ...nps) -{ - return mesh_3_options(internal_np::combine_named_parameters(nps...)); -} -#endif // Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. // Default Mesh_3_options: dump at every stage of the mesh generation. inline internal::Mesh_3_options mesh_3_dump() @@ -500,7 +276,7 @@ inline internal::Mesh_3_options mesh_3_dump() CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) } // end namespace parameters - +#include /*! \ingroup PkgMesh3Functions @@ -822,7 +598,7 @@ namespace CGAL { /*! \ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. The function `refine_mesh_3()` is a 3D mesh generator. It produces simplicial meshes which discretize @@ -981,6 +757,4 @@ void refine_mesh_3(C3T3& c3t3, } #endif // DOXYGEN_RUNNING } // end namespace CGAL - - #endif // CGAL_REFINE_MESH_3_H 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 98c9e72792d..2b4b4968221 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 @@ -465,7 +465,7 @@ namespace CGAL { /*! \ingroup PkgPeriodic3Mesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. +\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. The function `refine_periodic_3_mesh_3()` is a 3D periodic mesh generator. It produces periodic simplicial meshes which discretize From c0e134235aea8c4c565118ec3f0e7c137c88ab00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 15 Jul 2022 11:35:25 +0200 Subject: [PATCH 027/248] do not document OLD API and do not issue deprecation warnings --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 134 -------------------- Mesh_2/test/Mesh_2/test_lloyd.cpp | 11 +- 2 files changed, 4 insertions(+), 141 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index bb202a8379b..f40faf77d51 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -166,22 +166,13 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE - template - CGAL_DEPRECATED Mesh_optimization_return_code lloyd_optimize_mesh_2(CDT& cdt, const NP_PACK& ... nps) { return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(nps ...)); } -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - -#endif // CGAL_NO_DEPRECATED_CODE - /** * this partial specialization is a workaround * to avoid compilation errors when seeds_begin and seeds_end are @@ -250,131 +241,6 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va return rc; } - -#else - -namespace CGAL { - -/*! -\ingroup PkgMesh2Functions - -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. - -The function `lloyd_optimize_mesh_2()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_2()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_2()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are not moved. - -\tparam CDT is required to be or derive from `CGAL::Constrained_Delaunay_triangulation_2`, -with vertex base and face base of its underlying `TriangulationDataStructure_2` -being models of `DelaunayMeshVertexBase_2` and `DelaunayMeshFaceBase_2`, respectively. -The argument `cdt`, passed by reference, provides the initial mesh -and is modified by the algorithm to represent the final optimized mesh. - -\tparam PointIterator must be an iterator with value type `Kernel::Point_2` - -The function has several optional parameters which are named parameters -(we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `CGAL::Real_timer`. -The default value is 0 and means that there is no time limit. -\pre `time_limit` \f$ \geq\f$ 0 - -- `parameters::%max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. -\pre `max_iteration_number`\f$ \geq\f$ 0 - -- `parameters::%convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given fraction of the -length of the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. -\pre 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 - -- `parameters::freeze_bound` is designed to reduce running time of each -optimization iteration. Any vertex that has a displacement less than a given -fraction of the length of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. -The default value is 0.001. If it is set to 0, freezing of vertices is disabled. -\pre 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -- `parameters::seeds_begin` and `parameters::seeds_end` -are begin and end input iterators to iterate on seed points. -The sequence [`parameters::seeds_begin`, `parameters::seeds_end`) -defines the domain in which the mesh was generated, and should be optimized. - -- `parameters::mark`. If `mark` is set to true, the mesh domain -is the union of the bounded connected components including at least one seed. -If `mark` is false, the domain is the union of the bounded components including -no seed. Note that the unbounded component of the plane is never optimized. -The default value is false. - - - - -\return -The function `lloyd_optimize_mesh_2()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_2()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_2()` stops because the convergence criterion -is met. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`freeze_bound` parameter is set to a positive value. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_2()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// move less than 0.001*shortest_incident_edge_length -lloyd_optimize_mesh_2(cdt, - parameters::convergence=0.01, - parameters::freeze_bound=0.001); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::refine_Delaunay_mesh_2()` - -*/ - -template -CGAL::Mesh_optimization_return_code -lloyd_optimize_mesh_2(CDT& cdt, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.001, - double parameters::freeze_bound = 0.001, - PointIterator parameters::seeds_begin = PointIterator(), - PointIterator parameters::seeds_end = PointIterator(), - bool parameters::mark = false); - -} /* namespace CGAL */ - #endif // DOXYGEN_RUNNING } //end namespace CGAL diff --git a/Mesh_2/test/Mesh_2/test_lloyd.cpp b/Mesh_2/test/Mesh_2/test_lloyd.cpp index cd6bfa0c3ec..b77bc5b8009 100644 --- a/Mesh_2/test/Mesh_2/test_lloyd.cpp +++ b/Mesh_2/test/Mesh_2/test_lloyd.cpp @@ -76,8 +76,7 @@ struct Lloyd_tester } }; -#ifndef CGAL_NO_DEPRECATED_CODE -struct Lloyd_tester_deprecated_API +struct Lloyd_tester_original_BP_API { void operator()(CDT& cdt) const { @@ -121,7 +120,6 @@ struct Lloyd_tester_deprecated_API assert( number_of_constraints == number_of_constrained_edges(cdt)); } }; -#endif int main() { @@ -130,11 +128,10 @@ int main() Lloyd_tester tester; tester(cdt); - #ifndef CGAL_NO_DEPRECATED_CODE - std::cerr << "TESTING lloyd_optimize_mesh_2 with Epick (deprecated API)...\n\n"; + std::cerr << "TESTING lloyd_optimize_mesh_2 with Epick (original Boost Parameter API)...\n\n"; cdt = CDT(); - Lloyd_tester_deprecated_API tester_bis; + Lloyd_tester_original_BP_API tester_bis; tester_bis(cdt); - #endif + return 0; } From 520545d543f26c983c7eb643cd2ff9eb3fd15c74 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 19 Jul 2022 13:10:35 +0530 Subject: [PATCH 028/248] Named parameter for mandatory parameters DRAFT --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 119 ++++++++++++++++++ .../include/CGAL/Mesh_3/internal/parameters.h | 15 +++ Mesh_3/include/CGAL/exude_mesh_3.h | 19 +++ Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 24 ++++ Mesh_3/include/CGAL/make_mesh_3.h | 2 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 23 ++++ Mesh_3/include/CGAL/perturb_mesh_3.h | 22 ++++ Mesh_3/include/CGAL/refine_mesh_3.h | 37 ++++++ .../include/CGAL/optimize_periodic_3_mesh_3.h | 82 +++++++++++- .../include/CGAL/refine_periodic_3_mesh_3.h | 36 ++++++ .../include/CGAL/Named_function_parameters.h | 5 + .../internal/parameters_interface.h | 8 +- 12 files changed, 384 insertions(+), 8 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 85bb78ba7ea..95773cbb5db 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -437,12 +437,47 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter; + using parameters::choose_parameter; + const CGAL::Image_3& image_ = get_parameter(np,internal_np::image_3_param); + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + namespace p = CGAL::parameters; + return Labeled_mesh_domain_3 + (create_gray_image_wrapper + (image_, + iso_value_, + image_values_to_subdomain_indices_, + value_outside_), + Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + + } #ifndef CGAL_NO_DEPRECATED_CODE template static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) { return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); } + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const NP_PACK& ...nps) + { + return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); + } #endif //CGAL_NO_DEPRECATED_CODE @@ -510,6 +545,55 @@ where the labeled image is used with a precomputed 3D image of weights : auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); CGAL::Image_3 weights_ = choose_parameter(get_parameter(np, internal_np::weights_param), CGAL::Image_3()); + namespace p = CGAL::parameters; + if (weights_.is_valid()) + { + return Labeled_mesh_domain_3 + (create_weighted_labeled_image_wrapper + (image_, + weights_, + image_values_to_subdomain_indices_, + value_outside_), + Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } + else + { + return Labeled_mesh_domain_3 + (create_labeled_image_wrapper + (image_, + image_values_to_subdomain_indices_, + value_outside_), + Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } + } + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter; + using parameters::choose_parameter; + const CGAL::Image_3& image_ = get_parameter(np,internal_np::image_3_param); + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + CGAL::Image_3 weights_ = choose_parameter(get_parameter(np, internal_np::weights_param), CGAL::Image_3()); + namespace p = CGAL::parameters; if (weights_.is_valid()) { @@ -549,6 +633,11 @@ where the labeled image is used with a precomputed 3D image of weights : { return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); } + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const NP_PACK& ...nps) + { + return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); + } #endif //CGAL_NO_DEPRECATED_CODE @@ -614,12 +703,42 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): create_construct_surface_patch_index(construct_surface_patch_index_)); } + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter; + using parameters::choose_parameter; + auto function_ = get_parameter(np, internal_np::function_param); + auto bounding_object_ = get_parameter(np, internal_np::bounding_object_param); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + namespace p = CGAL::parameters; + return Labeled_mesh_domain_3 + (make_implicit_to_labeling_function_wrapper(function_), + bounding_object_, + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } + #ifndef CGAL_NO_DEPRECATED_CODE template static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const NP_Pack& ...nps) { return create_implicit_mesh_domain(function_, bounding_object_, internal_np::combine_named_parameters(nps...)); } + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const NP_PACK& ...nps) + { + return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); + } #endif //CGAL_NO_DEPRECATED_CODE /// @} diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h index 83790c0892a..48cddc5025e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h @@ -1,3 +1,18 @@ +// Copyright (c) 2009 INRIA Sophia-Antipolis (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 +// +// +// +// +//****************************************************************************** +// File Description : Named Function Parameters specific code +//****************************************************************************** #ifndef CGAL_PARAMETERS_H #define CGAL_PARAMETERS_H diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 7b43940a626..42d79f327ba 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -108,6 +108,17 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = } +template +Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) +{ + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + 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); + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); +} #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -115,6 +126,14 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = { return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } + + template + Mesh_optimization_return_code exude_mesh_3(const NP_PACK& ...nps) + { + return exude_mesh_3(internal_np::combine_named_parameters(nps...)); + } + + #endif //CGAL_NO_DEPRECATED_CODE diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 1fd954b09de..10011b0599e 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -161,6 +161,24 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& doma bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } + +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& np) +{ + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + 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 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); + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); +} + #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -168,6 +186,12 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domai { return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } + +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(const NP_PACK& ...nps) +{ + return lloyd_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); +} #endif //CGAL_NO_DEPRECATED_CODE template diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index e33f6022161..9a504bc6452 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -545,7 +545,6 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS return c3t3; } - #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -554,6 +553,7 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...np return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } + #endif //CGAL_NO_DEPRECATED_CODE diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 4b7ccde8bb1..249985e0162 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -151,6 +151,24 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } + + template + Mesh_optimization_return_code odt_optimize_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); + } + #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -158,6 +176,11 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain { return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } + template + Mesh_optimization_return_code odt_optimize_mesh_3(const NP_PACK& ...nps) + { + return odt_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); + } #endif //CGAL_NO_DEPRECATED_CODE template diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index f5c6db9e0f8..236f51c8fc8 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -126,6 +126,23 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } + template + Mesh_optimization_return_code perturb_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); + + } + #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -133,6 +150,11 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con { return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } + template + Mesh_optimization_return_code perturb_mesh_3(const NP_PACK& ...nps) + { + return perturb_mesh_3(internal_np::combine_named_parameters(nps...)); + } #endif //CGAL_NO_DEPRECATED_CODE template + Mesh_optimization_return_code refine_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + auto criteria = get_parameter(np, internal_np::mesh_criteria_param); + 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); + parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3().v); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + return refine_mesh_3_impl(c3t3, + domain, + criteria, + exude_param, + perturb_param, + odt_param, + lloyd_param, + reset_param(), + mesh_options_param, + manifold_options_param); + + } #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -472,6 +504,11 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const { return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } + template + void refine_mesh_3(const NP_PACK& ...nps) + { + return refine_mesh_3(internal_np::combine_named_parameters(nps...)); + } #endif /** 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 e44d2d119f4..0a29590871f 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 @@ -35,13 +35,32 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } - +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& np) +{ + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); +} #ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) { return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const NP_PACK& ...nps) +{ + return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); +} #endif //CGAL_NO_DEPRECATED_CODE // ---------------------------------- exuder ----------------------------------- @@ -55,13 +74,28 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } - + template + Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + 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 template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) { return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(const NP_PACK& ...nps) +{ + return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); +} #endif //CGAL_NO_DEPRECATED_CODE // ------------------------------ odt optimizer -------------------------------- @@ -78,13 +112,33 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } - + template + Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); + } #ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) { return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const NP_PACK& ...nps) +{ + return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); +} #endif //CGAL_NO_DEPRECATED_CODE @@ -101,13 +155,33 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } - + template + Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + 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 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); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); + } #ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) { return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const NP_PACK& ...nps) +{ + return lloyd_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); +} #endif //CGAL_NO_DEPRECATED_CODE } // namespace CGAL 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 2b4b4968221..ebada4374c8 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 @@ -322,6 +322,37 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit manifold_options_param); } + template + void refine_periodic_3_mesh_3(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::choose_parameter; + using parameters::get_parameter; + auto c3t3 = get_parameter(np,internal_np::c3t3_param); + auto domain = get_parameter(np,internal_np::mesh_domain_param); + auto criteria = get_parameter(np, internal_np::mesh_criteria_param); + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::no_exude()); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::no_perturb()); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); + parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3()); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + return refine_periodic_3_mesh_3_impl(c3t3, + domain, + criteria, + exude_param, + perturb_param, + odt_param, + lloyd_param, + reset_param(), + mesh_options_param, + manifold_options_param); + } + #ifndef DOXYGEN_RUNNING #ifndef CGAL_NO_DEPRECATED_CODE template @@ -329,6 +360,11 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit { return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } + template + void refine_periodic_3_mesh_3(const NP_PACK& ...nps) + { + return refine_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); + } #endif /** * @brief This function refines the mesh c3t3 wrt domain & criteria diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 8887e8c7889..e80affdf4a8 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -347,6 +347,9 @@ const Boost_parameter_compatibility_wrapper sliv const Boost_parameter_compatibility_wrapper perturbation_vector; //Compatibility wrappers for exude_mesh_3.h const Boost_parameter_compatibility_wrapper sliver_bound; +const Boost_parameter_compatibility_wrapper c3t3_named_param; +const Boost_parameter_compatibility_wrapper mesh_domain; +const Boost_parameter_compatibility_wrapper mesh_criteria; const Boost_parameter_compatibility_wrapper mesh_topology; const Boost_parameter_compatibility_wrapper dump_after_init_prefix; const Boost_parameter_compatibility_wrapper dump_after_refine_surface_prefix; @@ -368,6 +371,8 @@ const Boost_parameter_compatibility_wrapper mesh_opti const Boost_parameter_compatibility_wrapper manifold_options_param; const Boost_parameter_compatibility_wrapper features_param; +const Boost_parameter_compatibility_wrapper function; +const Boost_parameter_compatibility_wrapper bounding_object; const Boost_parameter_compatibility_wrapper image; const Boost_parameter_compatibility_wrapper iso_value; const Boost_parameter_compatibility_wrapper image_values_to_subdomain_indices; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 05abe4bb162..88e9ad94f9f 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -252,7 +252,9 @@ CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_ //List of named parameters used in exude_mesh_3.h CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) CGAL_add_named_parameter(freeze_t,freeze,freeze) - +CGAL_add_named_parameter(c3t3_param_t, c3t3_param, c3t3_param) +CGAL_add_named_parameter(mesh_domain_param_t, mesh_domain_param, mesh_domain_param) +CGAL_add_named_parameter(mesh_criteria_param_t, mesh_criteria_param, mesh_criteria_param) //List of named parameters used in perturb_mesh_3.h CGAL_add_named_parameter(sliver_criteria_t, sliver_criteria, sliver_criteria) CGAL_add_named_parameter(perturb_vector_t, perturb_vector, perturb_vector) @@ -302,5 +304,5 @@ CGAL_add_named_parameter(cell_size_param_t, cell_size_param, cell_size_param) CGAL_add_named_parameter(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field_param) CGAL_add_named_parameter(sizing_field_param_t, sizing_field_param, sizing_field_param) - - +CGAL_add_named_parameter(function_param_t, function_param, function_param) +CGAL_add_named_parameter(bounding_object_param_t, bounding_object_param, bounding_object_param) \ No newline at end of file From cafe5b1817bb82d780621a742091e1269bd4eec3 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 19 Jul 2022 14:10:05 +0530 Subject: [PATCH 029/248] Removed deprecated docs/warnings --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 16 +- Mesh_3/include/CGAL/Mesh_criteria_3.h | 12 +- Mesh_3/include/CGAL/exude_mesh_3.h | 106 +--------- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 121 ------------ Mesh_3/include/CGAL/make_mesh_3.h | 173 ---------------- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 137 ++----------- Mesh_3/include/CGAL/perturb_mesh_3.h | 116 +---------- Mesh_3/include/CGAL/refine_mesh_3.h | 184 +----------------- .../include/CGAL/make_periodic_3_mesh_3.h | 154 --------------- .../include/CGAL/optimize_periodic_3_mesh_3.h | 8 - .../include/CGAL/refine_periodic_3_mesh_3.h | 167 +--------------- 11 files changed, 61 insertions(+), 1133 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 95773cbb5db..527bc1227bd 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -300,12 +300,10 @@ public: parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) { } -#ifndef CGAL_NO_DEPRECATED_CODE - template - Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const NP_PACK& ...nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) - { - } -#endif //CGAL_NO_DEPRECATED_CODE + template + Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const NP_PACK& ...nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) + { + } /** * Backward-compatibility constructors, with `null_subdomain_index` as @@ -467,7 +465,6 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } -#ifndef CGAL_NO_DEPRECATED_CODE template static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) { @@ -478,7 +475,6 @@ public: { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE /*! @@ -627,7 +623,6 @@ where the labeled image is used with a precomputed 3D image of weights : create_construct_surface_patch_index(construct_surface_patch_index_)); } } -#ifndef CGAL_NO_DEPRECATED_CODE template static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) { @@ -638,7 +633,6 @@ where the labeled image is used with a precomputed 3D image of weights : { return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE @@ -728,7 +722,6 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): create_construct_surface_patch_index(construct_surface_patch_index_)); } -#ifndef CGAL_NO_DEPRECATED_CODE template static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const NP_Pack& ...nps) { @@ -739,7 +732,6 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): { return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE /// @} diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index a4f5d5e9a74..1b8bea7b674 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -211,12 +211,12 @@ Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np { } -#ifndef CGAL_NO_DEPRECATED_CODE - template - Mesh_criteria_3(const NP_PACK& ...nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) - { - } -#endif //CGAL_NO_DEPRECATED_CODE + +template +Mesh_criteria_3(const NP_PACK& ...nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) +{ +} + }; // end class Mesh_criteria_3 } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 42d79f327ba..2cd0220993f 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -120,22 +120,19 @@ Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } #ifndef DOXYGEN_RUNNING - #ifndef CGAL_NO_DEPRECATED_CODE - template - Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) - { - return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); - } +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) +{ + return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); +} - template - Mesh_optimization_return_code exude_mesh_3(const NP_PACK& ...nps) - { - return exude_mesh_3(internal_np::combine_named_parameters(nps...)); - } +template +Mesh_optimization_return_code exude_mesh_3(const NP_PACK& ...nps) +{ + return exude_mesh_3(internal_np::combine_named_parameters(nps...)); +} - #endif //CGAL_NO_DEPRECATED_CODE - template Mesh_optimization_return_code @@ -158,89 +155,6 @@ Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) // Launch exudation return exuder(); } -#else -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - - The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. -The sliver exudation process consists in optimizing the weights of vertices -of the weighted Delaunay triangulation in such a way that slivers disappear and -the quality of the mesh improves. - -\warning This optimizer modifies the weight of vertices of the triangulation and, -if called, must be the last optimizer to be called. If the mesh is refined after -this optimization has been performed, all improvements will be lost. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -The function has two optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} -- `parameters::time_limit` is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using the `Real_timer` class. -The default value is 0 and means that there is no time limit. - -- `parameters::sliver_bound` is designed to give, in degrees, a targeted -lower bound on dihedral angles of mesh cells. -The exudation process considers in turn all the mesh cells -that have a smallest dihedral angle less than `sliver_bound` -and tries to make them disappear by weighting their vertices. -The optimization process -stops when every cell in the mesh achieves this quality. -The default value is 0 and means that there is no targeted bound: -the exuder then runs as long as -it can improve the smallest dihedral angles of the set of cells -incident to some vertices. - -\return -The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve -the smallest dihedral angle of the set of cells incident to some vertex in the mesh. -
- -\cgalHeading{Example} - -\code{.cpp} -// Exude without sliver_bound, using at most 10s CPU time -exude_mesh_3(c3t3, - parameters::time_limit=10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -exude_mesh_3(C3T3& c3t3, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ - #endif //DOXYGEN_RUNNING } //namespace CGAL diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 10011b0599e..b8734dfec82 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -180,7 +180,6 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& np) } #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) { @@ -192,7 +191,6 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(const NP_PACK& ...nps) { return lloyd_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code @@ -232,125 +230,6 @@ lloyd_optimize_mesh_3_impl(C3T3& c3t3, // Launch optimization return opt(static_cast(max_iteration_number)); } -#else -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -The function `lloyd_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has four optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::%max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. - -- `parameters::%convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given percentage of the -length of the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. - -- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex -that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. - -- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), -frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that -moves, unfreezes all its incident vertices. - - -\return -The function `lloyd_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// 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); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -\note This function requires the \ref thirdpartyEigen library. -*/ - -template -Mesh_optimization_return_code -lloyd_optimize_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -} /* namespace CGAL */ - #endif //DOXYGEN_RUNNING } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 9a504bc6452..3ee8b649d2e 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -546,7 +546,6 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS } #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE template C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps) { @@ -554,9 +553,6 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...np } -#endif //CGAL_NO_DEPRECATED_CODE - - /** * @brief This function meshes the domain defined by mesh_traits * (respecting criteria), and outputs the mesh to c3t3 @@ -606,175 +602,6 @@ void make_mesh_3_impl(C3T3& c3t3, parameters::no_reset_c3t3(), parameters::mesh_options_param= mesh_options, parameters::manifold_options_param= manifold_options); } -#else -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. - -The function `make_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd-smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Mesh_3_section_examples ). - - -\tparam C3T3 is required to be a model of -the concept `MeshComplex_3InTriangulation_3`. This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3`, or of the refined concept -`MeshDomainWithFeatures_3` -if the domain has corners and curves that need to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - - -\tparam MC has to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\cgalHeading{Named Parameters} - -- `features` allows -the user to specify whether 0 and 1-dimensional features have to be -taken into account or not -when the domain is a model of `MeshDomainWithFeatures_3`. -The type `Features` of this parameter is an internal undescribed type. -The library provides functions to construct appropriate values of that type. -
    -
  • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, -i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a -`MeshDomainWithFeatures_3`. This is the default behavior -if parameter `features` is not specified. -
  • `parameters::no_features()` prevents the representation -of 0 and 1-dimensional features in the mesh. -
- -- `manifold` allows the user to drive the meshing algorithm, -and ensure that the output mesh surface follows the given manifold criterion. -It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` -and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold -surface if the input surface is not manifold. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_mesh_3()` is used for this parameter. - -- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_mesh_3` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_mesh_3()` is used for this parameter. - -- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_mesh_3` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`CGAL::perturb_mesh_3` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_mesh_3()` -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `parameters::manifold()` -\sa `parameters::manifold_with_boundary()` -\sa `parameters::non_manifold()` -\sa `exude_mesh_3()` -\sa `perturb_mesh_3()` -\sa `lloyd_optimize_mesh_3()` -\sa `odt_optimize_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` - -*/ - -template -C3T3 make_mesh_3(const MD& domain, - const MC& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude(), - parameters::internal::Manifold_options manifold = parameters::non_manifold()); - -} /* namespace CGAL */ #endif //DOXYGEN_RUNNING } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 249985e0162..0177e08f851 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -170,18 +170,17 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain } #ifndef DOXYGEN_RUNNING - #ifndef CGAL_NO_DEPRECATED_CODE - template - Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) - { - return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); - } - template - Mesh_optimization_return_code odt_optimize_mesh_3(const NP_PACK& ...nps) - { - return odt_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); - } - #endif //CGAL_NO_DEPRECATED_CODE + +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) +{ + return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); +} +template +Mesh_optimization_return_code odt_optimize_mesh_3(const NP_PACK& ...nps) +{ + return odt_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); +} template Mesh_optimization_return_code @@ -222,120 +221,6 @@ odt_optimize_mesh_3_impl(C3T3& c3t3, return opt(static_cast(max_iteration_number)); } -#else -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -The function `odt_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear in each mesh cell. - -The optimizer `odt_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has four optional parameters which are named parameters -(we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. - -- `parameters::convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given percentage of the length -the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. - -- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex -that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. - -- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), -frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that -moves, unfreezes all its incident vertices. - - -\return -The function `odt_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - -\code{.cpp} -// 100 iterations of ODT-smoothing -odt_optimize_mesh_3(c3t3, - domain, - parameters::max_iteration_number = 100, - parameters::convergence = 0); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -odt_optimize_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -} /* namespace CGAL */ - #endif //DOXYGEN_RUNNING } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 236f51c8fc8..94c2aa3bf7a 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -144,18 +144,16 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con } #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE - template - Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) - { - return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); - } - template - Mesh_optimization_return_code perturb_mesh_3(const NP_PACK& ...nps) - { - return perturb_mesh_3(internal_np::combine_named_parameters(nps...)); - } -#endif //CGAL_NO_DEPRECATED_CODE +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) +{ + return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); +} +template +Mesh_optimization_return_code perturb_mesh_3(const NP_PACK& ...nps) +{ + return perturb_mesh_3(internal_np::combine_named_parameters(nps...)); +} template `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::sliver_bound` -is designed to give, in degrees, a targeted -lower bound on dihedral angles of mesh cells. -The function `perturb_mesh_3()` runs as long as steps are successful -and step number `sliver_bound` (after which -the worst tetrahedron in the mesh has a smallest angle larger than -`sliver_bound` degrees) has not been reached. -The default value is 0 and means that there is no targeted bound: -the perturber then runs as long as -steps are successful. - - -\return -The function `perturb_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. -
- - -\cgalHeading{Example} - -\code{.cpp} -// Perturb until every dihedral angle of the mesh is >= 10 degrees -// No time bound is set -perturb_mesh_3(c3t3, - domain, - parameters::sliver_bound = 10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -perturb_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ - #endif //DOXYGEN_RUNNING } //namespace CGAL diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 572671f6223..2180d1af289 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -498,18 +498,16 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const } #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE - template - void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) - { - return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); - } - template - void refine_mesh_3(const NP_PACK& ...nps) - { - return refine_mesh_3(internal_np::combine_named_parameters(nps...)); - } -#endif +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) +{ + return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); +} +template +void refine_mesh_3(const NP_PACK& ...nps) +{ + return refine_mesh_3(internal_np::combine_named_parameters(nps...)); +} /** * @brief This function refines the mesh c3t3 wrt domain & criteria @@ -630,168 +628,6 @@ void refine_mesh_3_impl(C3T3& c3t3, dump_c3t3(c3t3, mesh_options.dump_after_exude_prefix); } } -#else -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -The function `refine_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_mesh_3()` may be used to refine a previously -computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); - -CGAL::refine_mesh_3(c3t3, domain, new_criteria); -\endcode - -Please note that we guarantee the result if and only if the domain does -not change from one refinement to the next one. - - -\tparam C3T3 is required to be a model of -the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3` is passed by -reference as this object is modified by the refinement process. As the -refinement process only adds points to the triangulation, all -vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. Object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3` or of the refined concept -`MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` -if the domain has exposed features. The argument `criteria` of -type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalHeading{Named Parameters} -- `manifold` allows the user to drive the meshing algorithm, -and ensure that the output mesh surface follows the given manifold criterion. -It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` -and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold -surface if the input surface is not manifold. - -- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_mesh_3()` is used for this parameter. - -- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_mesh_3()` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_mesh_3()` is used for this parameter. - -- `perturb` `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_mesh_3()` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::parameters::manifold` -\sa `CGAL::parameters::manifold_with_boundary` -\sa `CGAL::parameters::non_manifold` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::parameters::exude` -\sa `CGAL::parameters::no_exude` -\sa `CGAL::parameters::perturb` -\sa `CGAL::parameters::no_perturb` -\sa `CGAL::parameters::lloyd` -\sa `CGAL::parameters::no_lloyd` -\sa `CGAL::parameters::odt` -\sa `CGAL::parameters::no_odt` - -*/ - -template -void refine_mesh_3(C3T3& c3t3, - const MD& mesh_domain, - const MC& mesh_criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude(), - parameters::internal::Manifold_options manifold = parameters::non_manifold()); -} #endif // DOXYGEN_RUNNING } // end namespace CGAL #endif // CGAL_REFINE_MESH_3_H diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 96f25ce548a..78efe0ff665 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -346,14 +346,12 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE template C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps) { return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE /** * @brief This function meshes the domain defined by mesh_traits @@ -395,158 +393,6 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, parameters::lloyd_param = lloyd, parameters::reset_param = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it parameters::mesh_options_param = mesh_options, parameters::manifold_options_param = manifold_options); } -#else -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions -\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead. - -The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. -It produces simplicial meshes which discretize 3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Periodic_3_mesh_3_section_examples ). - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D periodic triangulation -embedding the periodic mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of -the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. - -\tparam MD is required to be a model of the concept `Periodic_3MeshDomain_3`, -or of the refined concept `Periodic_3MeshDomainWithFeatures_3` if the domain has corners -and curve segments that need to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the size and shape -requirements for mesh tetrahedra and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\cgalHeading{Named Parameters} - -- `features` allows -the user to specify whether 0 and 1-dimensional features have to be -taken into account or not -when the domain is a model of `Periodic_3MeshDomainWithFeatures_3`. -The type `Features` of this parameter is an internal undescribed type. -The library provides functions to construct appropriate values of that type. -
    -
  • \link parameters::features() `parameters::features(domain)` \endlink -sets `features` according to the domain, -i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a -`Periodic_3MeshDomainWithFeatures_3`. This is the default behavior -if parameter `features` is not specified. -
  • `parameters::no_features()` prevents the representation -of 0 and 1-dimensional features in the mesh. -
- -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_periodic_3_mesh_3` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_periodic_3_mesh_3` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`CGAL::perturb_periodic_3_mesh_3` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further - details): *ODT-smoother*, *Lloyd-smoother*, *perturb*, *exude*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_periodic_3_mesh_3()` -\sa `make_mesh_3()` - -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` -*/ - -template -C3T3 make_periodic_3_mesh_3(const MD& domain, - const MC& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); -} /* namespace CGAL */ - #endif //DOXYGEN_RUNNING } // end namespace CGAL 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 0a29590871f..fae69597bd1 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 @@ -50,7 +50,6 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& np) auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -#ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) { @@ -61,7 +60,6 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(const NP_PACK& ...nps) { return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE // ---------------------------------- exuder ----------------------------------- template @@ -85,7 +83,6 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C 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 template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) { @@ -96,7 +93,6 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(const NP_PACK& ...nps) { return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE // ------------------------------ odt optimizer -------------------------------- @@ -128,7 +124,6 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -#ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) { @@ -139,7 +134,6 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const NP_PACK& ...n { return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE // ------------------------------- lloyd optimizer ----------------------------- @@ -171,7 +165,6 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -#ifndef CGAL_NO_DEPRECATED_CODE template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) { @@ -182,7 +175,6 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const NP_PACK& .. { return lloyd_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } -#endif //CGAL_NO_DEPRECATED_CODE } // namespace CGAL 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 ebada4374c8..eb7bb89cc67 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 @@ -354,18 +354,16 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit } #ifndef DOXYGEN_RUNNING -#ifndef CGAL_NO_DEPRECATED_CODE - template - void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) - { - return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); - } - template - void refine_periodic_3_mesh_3(const NP_PACK& ...nps) - { - return refine_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); - } -#endif +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) +{ + return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); +} +template +void refine_periodic_3_mesh_3(const NP_PACK& ...nps) +{ + return refine_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); +} /** * @brief This function refines the mesh c3t3 wrt domain & criteria * @@ -496,151 +494,6 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, CGAL_expensive_postcondition(c3t3.triangulation().is_valid()); CGAL_expensive_postcondition(c3t3.is_valid()); } -#else -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -The function `refine_periodic_3_mesh_3()` is a 3D periodic -mesh generator. It produces periodic simplicial meshes which discretize -3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_periodic_3_mesh_3()` may be used -to refine a previously computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); - -CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); -\endcode - -\attention Note that the triangulation must form at all times a simplicial complex within -a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro -of the manual of 3D periodic triangulations). It is the responsability of the user to provide -a triangulation that satisfies this condition when calling the refinement -function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh -complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` -will always satisfy this condition. - -\tparam C3T3 is required to be a model of the concept `MeshComplex_3InTriangulation_3`. -The argument `c3t3` is passed by reference as this object is modified -by the refinement process. As the refinement process only adds points -to the triangulation, all vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. The object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D periodic triangulation -embedding the periodic mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of -the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. - -\tparam MD is required to be a model of -the concept `Periodic_3MeshDomain_3` or of the refined concept -`Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC has to be a model of the concept `MeshCriteria_3`, -or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain -has exposed features. The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument `criteria` provides -a sizing field to guide the discretization of 1-dimensional exposed features. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalHeading{Named Parameters} -- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_periodic_3_mesh_3()` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `perturb` `parameters::perturb()` and `parameters::no_perturb()` -are designed to trigger or not a call to `perturb_periodic_3_mesh_3()` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`perturb_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained by perturbing mesh vertices -and modifying the mesh connectivity and that this has an impact on the strict -compliance to the refinement criteria. Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `make_periodic_3_mesh_3()` -\sa `refine_mesh_3()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude` -\sa `parameters::no_exude` -\sa `parameters::perturb` -\sa `parameters::no_perturb` -\sa `parameters::lloyd` -\sa `parameters::no_lloyd` -\sa `parameters::odt` -\sa `parameters::no_odt` -*/ -template -void refine_periodic_3_mesh_3(C3T3& c3t3, - const MD& mesh_domain, - const MC& mesh_criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); - -} /* namespace CGAL */ - #endif //DOXYGEN_RUNNING } // end namespace CGAL From 347a0220b34dbe3c6301b8d18503847fac16f278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 26 Jul 2022 18:02:33 +0200 Subject: [PATCH 030/248] restrict the parameter pack to Named_function_parameters --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 4 ++-- STL_Extension/include/CGAL/Named_function_parameters.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index f40faf77d51..7ec80b4c530 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -166,9 +166,9 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } #ifndef DOXYGEN_RUNNING - template + template Mesh_optimization_return_code - lloyd_optimize_mesh_2(CDT& cdt, const NP_PACK& ... nps) + lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(nps ...)); } diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index ce108229e9d..bb07dd0f7fc 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -33,6 +33,8 @@ #define CGAL_NP_TEMPLATE_PARAMETERS_2 NP_T2=bool, typename NP_Tag2=CGAL::internal_np::all_default_t, typename NP_Base2=CGAL::internal_np::No_property #define CGAL_NP_CLASS_2 CGAL::Named_function_parameters +#define CGAL_NP_TEMPLATE_PARAMETERS_VARIADIC NP_T, typename ... NP_Tag, typename ... NP_Base + namespace CGAL { namespace internal_np{ From 6802528cd650dc1000db7d885cc9c56536ea8bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Jul 2022 11:07:28 +0200 Subject: [PATCH 031/248] make it uniform --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 20 ++++++++-------- .../include/CGAL/Mesh_3/internal/parameters.h | 24 +++++++++---------- Mesh_3/include/CGAL/Mesh_criteria_3.h | 2 +- Mesh_3/include/CGAL/exude_mesh_3.h | 4 ++-- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 4 ++-- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 6 ++--- Mesh_3/include/CGAL/perturb_mesh_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 6 ++--- .../include/CGAL/make_periodic_3_mesh_3.h | 2 +- .../include/CGAL/optimize_periodic_3_mesh_3.h | 16 ++++++------- .../include/CGAL/refine_periodic_3_mesh_3.h | 6 ++--- 12 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 527bc1227bd..650cd283016 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -301,7 +301,7 @@ public: { } template - Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const NP_PACK& ...nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) + Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const NP_PACK& ... nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) { } @@ -465,13 +465,13 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const NP_PACK& ... nps) { return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); } template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const NP_PACK& ...nps) + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const NP_PACK& ... nps) { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } @@ -623,13 +623,13 @@ where the labeled image is used with a precomputed 3D image of weights : create_construct_surface_patch_index(construct_surface_patch_index_)); } } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const NP_Pack& ...nps) + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const NP_PACK& ... nps) { return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); } template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const NP_PACK& ...nps) + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const NP_PACK& ... nps) { return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } @@ -722,13 +722,13 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): create_construct_surface_patch_index(construct_surface_patch_index_)); } - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const NP_Pack& ...nps) + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const NP_PACK& ... nps) { return create_implicit_mesh_domain(function_, bounding_object_, internal_np::combine_named_parameters(nps...)); } template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const NP_PACK& ...nps) + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const NP_PACK& ... nps) { return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h index 48cddc5025e..0202936396c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h @@ -46,8 +46,8 @@ Named_function_parameters -Named_function_parameters perturb(const NP_Pack& ...nps) +template +Named_function_parameters perturb(const NP_PACK& ... nps) { return perturb(internal_np::combine_named_parameters(nps...)); } @@ -82,8 +82,8 @@ Named_function_parameters -Named_function_parameters exude(const NP_Pack& ...nps) +template +Named_function_parameters exude(const NP_PACK& ... nps) { return exude(internal_np::combine_named_parameters(nps...)); } @@ -116,8 +116,8 @@ Named_function_parameters -Named_function_parameters odt(const NP_Pack& ...nps) +template +Named_function_parameters odt(const NP_PACK& ... nps) { return odt(internal_np::combine_named_parameters(nps...)); } @@ -151,8 +151,8 @@ Named_function_parameters -Named_function_parameters lloyd(const NP_Pack& ...nps) +template +Named_function_parameters lloyd(const NP_PACK& ... nps) { return lloyd(internal_np::combine_named_parameters(nps...)); } @@ -179,8 +179,8 @@ Named_function_parameters -Named_function_parameters manifold_options(const NP_Pack& ...nps) +template +Named_function_parameters manifold_options(const NP_PACK& ... nps) { return manifold_options(internal_np::combine_named_parameters(nps...)); } @@ -239,8 +239,8 @@ Named_function_parameters m return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters mesh_3_options(const NP_Pack& ...nps) +template +Named_function_parameters mesh_3_options(const NP_PACK& ... nps) { return mesh_3_options(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 1b8bea7b674..3d4053d15ee 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -213,7 +213,7 @@ Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np template -Mesh_criteria_3(const NP_PACK& ...nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) +Mesh_criteria_3(const NP_PACK& ... nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) { } diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 2cd0220993f..002e535580c 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -121,13 +121,13 @@ Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) } #ifndef DOXYGEN_RUNNING template -Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const NP_PACK& ... nps) { return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code exude_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code exude_mesh_3(const NP_PACK& ... nps) { return exude_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index b8734dfec82..73abad34c24 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -181,13 +181,13 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& np) #ifndef DOXYGEN_RUNNING template -Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ... nps) { return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code lloyd_optimize_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code lloyd_optimize_mesh_3(const NP_PACK& ... nps) { return lloyd_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 3ee8b649d2e..c1601acd381 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -547,7 +547,7 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS #ifndef DOXYGEN_RUNNING template -C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps) +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) { return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 0177e08f851..7173c37ed39 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -171,13 +171,13 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain #ifndef DOXYGEN_RUNNING -template -Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) { return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code odt_optimize_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code odt_optimize_mesh_3(const NP_PACK& ... nps) { return odt_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 94c2aa3bf7a..da06dd6342b 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -150,7 +150,7 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code perturb_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code perturb_mesh_3(const NP_PACK& ... nps) { return perturb_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 2180d1af289..7300fc8b269 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -498,13 +498,13 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const } #ifndef DOXYGEN_RUNNING -template -void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) { return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } template -void refine_mesh_3(const NP_PACK& ...nps) +void refine_mesh_3(const NP_PACK& ... nps) { return refine_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 78efe0ff665..45539d76a48 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -347,7 +347,7 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG #ifndef DOXYGEN_RUNNING template -C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps) +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) { return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } 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 fae69597bd1..a4a5ca8986b 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 @@ -56,7 +56,7 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const NP_PACK& ... nps) { return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } @@ -84,12 +84,12 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } template -Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const NP_PACK& ...nps) +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const NP_PACK& ... nps) { return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code exude_periodic_3_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code exude_periodic_3_mesh_3(const NP_PACK& ... nps) { return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } @@ -124,13 +124,13 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_Pack& ...nps) +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) { return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const NP_PACK& ... nps) { return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } @@ -166,12 +166,12 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ...nps) +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ... nps) { return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const NP_PACK& ...nps) +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const NP_PACK& ... nps) { return lloyd_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } 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 eb7bb89cc67..6e87c5ccc1f 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 @@ -354,13 +354,13 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit } #ifndef DOXYGEN_RUNNING -template -void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_Pack& ...nps) +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) { return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } template -void refine_periodic_3_mesh_3(const NP_PACK& ...nps) +void refine_periodic_3_mesh_3(const NP_PACK& ... nps) { return refine_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } From f2aeaf710b21ebed35b5d7461096a73a71d859aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Jul 2022 11:24:26 +0200 Subject: [PATCH 032/248] use Named_parameters for variadic specialization --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 28 ++++++++-------- .../include/CGAL/Mesh_3/internal/parameters.h | 24 +++++++------- Mesh_3/include/CGAL/Mesh_criteria_3.h | 4 +-- Mesh_3/include/CGAL/exude_mesh_3.h | 8 ++--- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 8 ++--- Mesh_3/include/CGAL/make_mesh_3.h | 4 +-- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 8 ++--- Mesh_3/include/CGAL/perturb_mesh_3.h | 8 ++--- Mesh_3/include/CGAL/refine_mesh_3.h | 8 ++--- .../include/CGAL/make_periodic_3_mesh_3.h | 4 +-- .../include/CGAL/optimize_periodic_3_mesh_3.h | 32 +++++++++---------- .../include/CGAL/refine_periodic_3_mesh_3.h | 8 ++--- 12 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 650cd283016..0ef1937ddff 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -300,8 +300,8 @@ public: parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) { } - template - Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const NP_PACK& ... nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) + template + Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const CGAL_NP_CLASS& ... nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) { } @@ -465,13 +465,13 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const NP_PACK& ... nps) + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) { return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const NP_PACK& ... nps) + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& ... nps) { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } @@ -623,13 +623,13 @@ where the labeled image is used with a precomputed 3D image of weights : create_construct_surface_patch_index(construct_surface_patch_index_)); } } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const NP_PACK& ... nps) + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) { return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const NP_PACK& ... nps) + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& ... nps) { return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } @@ -722,13 +722,13 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): create_construct_surface_patch_index(construct_surface_patch_index_)); } - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const NP_PACK& ... nps) + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const CGAL_NP_CLASS& ... nps) { return create_implicit_mesh_domain(function_, bounding_object_, internal_np::combine_named_parameters(nps...)); } - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const NP_PACK& ... nps) + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& ... nps) { return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h index 0202936396c..cf2576ab09b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h @@ -46,8 +46,8 @@ Named_function_parameters -Named_function_parameters perturb(const NP_PACK& ... nps) +template +Named_function_parameters perturb(const CGAL_NP_CLASS& ... nps) { return perturb(internal_np::combine_named_parameters(nps...)); } @@ -82,8 +82,8 @@ Named_function_parameters -Named_function_parameters exude(const NP_PACK& ... nps) +template +Named_function_parameters exude(const CGAL_NP_CLASS& ... nps) { return exude(internal_np::combine_named_parameters(nps...)); } @@ -116,8 +116,8 @@ Named_function_parameters -Named_function_parameters odt(const NP_PACK& ... nps) +template +Named_function_parameters odt(const CGAL_NP_CLASS& ... nps) { return odt(internal_np::combine_named_parameters(nps...)); } @@ -151,8 +151,8 @@ Named_function_parameters -Named_function_parameters lloyd(const NP_PACK& ... nps) +template +Named_function_parameters lloyd(const CGAL_NP_CLASS& ... nps) { return lloyd(internal_np::combine_named_parameters(nps...)); } @@ -179,8 +179,8 @@ Named_function_parameters -Named_function_parameters manifold_options(const NP_PACK& ... nps) +template +Named_function_parameters manifold_options(const CGAL_NP_CLASS& ... nps) { return manifold_options(internal_np::combine_named_parameters(nps...)); } @@ -239,8 +239,8 @@ Named_function_parameters m return Param(options); } #ifndef CGAL_NO_DEPRECATED_CODE -template -Named_function_parameters mesh_3_options(const NP_PACK& ... nps) +template +Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& ... nps) { return mesh_3_options(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 3d4053d15ee..8c4ed59c305 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -212,8 +212,8 @@ Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np } -template -Mesh_criteria_3(const NP_PACK& ... nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) +template +Mesh_criteria_3(const CGAL_NP_CLASS& ... nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) { } diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 002e535580c..484ff01e5f4 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -120,14 +120,14 @@ Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } #ifndef DOXYGEN_RUNNING -template -Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const NP_PACK& ... nps) +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code exude_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& ... nps) { return exude_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 73abad34c24..2f262fa9aaf 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -180,14 +180,14 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& np) } #ifndef DOXYGEN_RUNNING -template -Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ... nps) +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code lloyd_optimize_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c1601acd381..0ac0da73a75 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -546,8 +546,8 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS } #ifndef DOXYGEN_RUNNING -template -C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 7173c37ed39..13bcd1edbfa 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -171,13 +171,13 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain #ifndef DOXYGEN_RUNNING -template -Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code odt_optimize_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code odt_optimize_mesh_3(const CGAL_NP_CLASS& ... nps) { return odt_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index da06dd6342b..615ef8da156 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -144,13 +144,13 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con } #ifndef DOXYGEN_RUNNING -template -Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code perturb_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code perturb_mesh_3(const CGAL_NP_CLASS& ... nps) { return perturb_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 7300fc8b269..ce74ed70387 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -498,13 +498,13 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const } #ifndef DOXYGEN_RUNNING -template -void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } -template -void refine_mesh_3(const NP_PACK& ... nps) +template +void refine_mesh_3(const CGAL_NP_CLASS& ... nps) { return refine_mesh_3(internal_np::combine_named_parameters(nps...)); } diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 45539d76a48..cc62a33a200 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -346,8 +346,8 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG #ifndef DOXYGEN_RUNNING -template -C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } 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 a4a5ca8986b..d05710e9396 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 @@ -50,13 +50,13 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& np) auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } @@ -83,13 +83,13 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C 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); } -template -Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const NP_PACK& ... nps) +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code exude_periodic_3_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } @@ -124,13 +124,13 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const NP_PACK& ... nps) +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } @@ -165,13 +165,13 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const NP_PACK& ... nps) +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const NP_PACK& ... nps) +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } 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 6e87c5ccc1f..f0715163f4c 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 @@ -354,13 +354,13 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit } #ifndef DOXYGEN_RUNNING -template -void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const NP_PACK& ... nps) +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } -template -void refine_periodic_3_mesh_3(const NP_PACK& ... nps) +template +void refine_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { return refine_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } From 19c146b6e214e3aadc9e764213508f77b91c548d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Jul 2022 12:07:08 +0200 Subject: [PATCH 033/248] add deprecated compatibility version --- Mesh_3/include/CGAL/exude_mesh_3.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 484ff01e5f4..0eb9f52b571 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -105,9 +105,15 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = 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 +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, double sliver_bound = 0) +{ + return exude_mesh_3(c3t3, CGAL::parameters::time_limit(time_limit).lower_sliver_bound(sliver_bound)); +} +#endif template Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) { From 8a13b7fbeb637d3569af4abd3eb1475969002d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Jul 2022 12:07:27 +0200 Subject: [PATCH 034/248] Add missing NP only version also remove other constructors that does not seem needed --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 0ef1937ddff..372829c88c5 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -291,17 +291,20 @@ public: typedef BGT Geom_traits; using Impl_details::construct_pair_functor; - template - Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const CGAL_NP_CLASS& np = parameters::default_values()) - :Impl_details(f,bbox, + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS& np = parameters::default_values()) + :Impl_details(parameters::get_parameter(np, internal_np::function_param), + parameters::get_parameter(np, internal_np::bounding_object_param), parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), parameters::choose_parameter(parameters::get_parameter(np, internal_np::surface_patch_index), construct_pair_functor()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) { } - template - Labeled_mesh_domain_3(const Func& f, const BoundingBox& bbox, const CGAL_NP_CLASS& ... nps):Labeled_mesh_domain_3(f, bbox, internal_np::combine_named_parameters(nps...)) + + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS& ... nps) + : Labeled_mesh_domain_3(internal_np::combine_named_parameters(nps...)) { } From 1ee734034375e3f5406244ccd67cc7f117d866fd Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 27 Jul 2022 20:16:47 +0530 Subject: [PATCH 035/248] Removed np for mandatory param for certain fns --- .../include/CGAL/Mesh_3/internal/parameters.h | 18 ++++------ Mesh_3/include/CGAL/exude_mesh_3.h | 16 --------- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 22 ------------ Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 22 ------------ Mesh_3/include/CGAL/perturb_mesh_3.h | 21 ----------- Mesh_3/include/CGAL/refine_mesh_3.h | 36 ------------------- .../include/CGAL/optimize_periodic_3_mesh_3.h | 22 +----------- .../include/CGAL/refine_periodic_3_mesh_3.h | 36 ------------------- .../include/CGAL/Named_function_parameters.h | 3 -- .../internal/parameters_interface.h | 3 -- 10 files changed, 7 insertions(+), 192 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h index cf2576ab09b..29aded71b4e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h @@ -45,13 +45,11 @@ Named_function_parameters Named_function_parameters perturb(const CGAL_NP_CLASS& ... nps) { return perturb(internal_np::combine_named_parameters(nps...)); } -#endif inline Named_function_parameters no_perturb() { @@ -81,13 +79,12 @@ Named_function_parameters Named_function_parameters exude(const CGAL_NP_CLASS& ... nps) { return exude(internal_np::combine_named_parameters(nps...)); } -#endif + inline Named_function_parameters no_exude() { typedef Named_function_parameters Param; return Param(internal::Exude_options(false)); @@ -115,13 +112,12 @@ Named_function_parameters Named_function_parameters odt(const CGAL_NP_CLASS& ... nps) { return odt(internal_np::combine_named_parameters(nps...)); } -#endif + inline Named_function_parameters no_odt() { typedef Named_function_parameters Param; return Param(internal::Odt_options(false)); @@ -150,13 +146,13 @@ Named_function_parameters Named_function_parameters lloyd(const CGAL_NP_CLASS& ... nps) { return lloyd(internal_np::combine_named_parameters(nps...)); } -#endif + inline Named_function_parameters no_lloyd() { typedef Named_function_parameters Param; return Param(internal::Lloyd_options(false)); @@ -178,13 +174,12 @@ Named_function_parameters Named_function_parameters manifold_options(const CGAL_NP_CLASS& ... nps) { return manifold_options(internal_np::combine_named_parameters(nps...)); } -#endif inline Named_function_parameters manifold() { @@ -238,13 +233,12 @@ Named_function_parameters m typedef Named_function_parameters Param; return Param(options); } -#ifndef CGAL_NO_DEPRECATED_CODE + template Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& ... nps) { return mesh_3_options(internal_np::combine_named_parameters(nps...)); } -#endif } //namespace parameters diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 0eb9f52b571..9c3a9f7e5be 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -114,17 +114,6 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, do return exude_mesh_3(c3t3, CGAL::parameters::time_limit(time_limit).lower_sliver_bound(sliver_bound)); } #endif -template -Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& np) -{ - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - 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); - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); -} #ifndef DOXYGEN_RUNNING template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) @@ -132,11 +121,6 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code exude_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return exude_mesh_3(internal_np::combine_named_parameters(nps...)); -} diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 2f262fa9aaf..a1c03bf4719 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -162,23 +162,6 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& doma return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -template -Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& np) -{ - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - 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 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); - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); -} - #ifndef DOXYGEN_RUNNING template Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) @@ -186,11 +169,6 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domai return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code lloyd_optimize_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return lloyd_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); -} template Mesh_optimization_return_code diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 13bcd1edbfa..81ca35e7bcf 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -152,23 +152,6 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } - template - Mesh_optimization_return_code odt_optimize_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); - double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); - double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); - bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); - } - #ifndef DOXYGEN_RUNNING template @@ -176,11 +159,6 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain { return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code odt_optimize_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return odt_optimize_mesh_3(internal_np::combine_named_parameters(nps...)); -} template Mesh_optimization_return_code diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 615ef8da156..81ae6e6609a 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -126,22 +126,6 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } - template - Mesh_optimization_return_code perturb_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); - auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); - auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); - return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); - - } #ifndef DOXYGEN_RUNNING template @@ -149,11 +133,6 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con { return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code perturb_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return perturb_mesh_3(internal_np::combine_named_parameters(nps...)); -} template - Mesh_optimization_return_code refine_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - auto criteria = get_parameter(np, internal_np::mesh_criteria_param); - 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); - parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3().v); - parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); - parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - - return refine_mesh_3_impl(c3t3, - domain, - criteria, - exude_param, - perturb_param, - odt_param, - lloyd_param, - reset_param(), - mesh_options_param, - manifold_options_param); - - } #ifndef DOXYGEN_RUNNING template void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } -template -void refine_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return refine_mesh_3(internal_np::combine_named_parameters(nps...)); -} /** * @brief This function refines the mesh c3t3 wrt domain & criteria 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 d05710e9396..c5c3f748670 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 @@ -149,32 +149,12 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } - template - Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - 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 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); - return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); - } + template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } -template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return lloyd_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); -} } // namespace CGAL 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 f0715163f4c..ecf853a3b8a 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 @@ -322,48 +322,12 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit manifold_options_param); } - template - void refine_periodic_3_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - auto criteria = get_parameter(np, internal_np::mesh_criteria_param); - parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::no_exude()); - parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::no_perturb()); - parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); - parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); - parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3()); - parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); - parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - - return refine_periodic_3_mesh_3_impl(c3t3, - domain, - criteria, - exude_param, - perturb_param, - odt_param, - lloyd_param, - reset_param(), - mesh_options_param, - manifold_options_param); - } - #ifndef DOXYGEN_RUNNING template void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } -template -void refine_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return refine_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); -} /** * @brief This function refines the mesh c3t3 wrt domain & criteria * diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 1337480676a..75460bfc12d 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -349,9 +349,6 @@ const Boost_parameter_compatibility_wrapper sliv const Boost_parameter_compatibility_wrapper perturbation_vector; //Compatibility wrappers for exude_mesh_3.h const Boost_parameter_compatibility_wrapper sliver_bound; -const Boost_parameter_compatibility_wrapper c3t3_named_param; -const Boost_parameter_compatibility_wrapper mesh_domain; -const Boost_parameter_compatibility_wrapper mesh_criteria; const Boost_parameter_compatibility_wrapper mesh_topology; const Boost_parameter_compatibility_wrapper dump_after_init_prefix; const Boost_parameter_compatibility_wrapper dump_after_refine_surface_prefix; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 88e9ad94f9f..bf997eb3c9a 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -252,9 +252,6 @@ CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_ //List of named parameters used in exude_mesh_3.h CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) CGAL_add_named_parameter(freeze_t,freeze,freeze) -CGAL_add_named_parameter(c3t3_param_t, c3t3_param, c3t3_param) -CGAL_add_named_parameter(mesh_domain_param_t, mesh_domain_param, mesh_domain_param) -CGAL_add_named_parameter(mesh_criteria_param_t, mesh_criteria_param, mesh_criteria_param) //List of named parameters used in perturb_mesh_3.h CGAL_add_named_parameter(sliver_criteria_t, sliver_criteria, sliver_criteria) CGAL_add_named_parameter(perturb_vector_t, perturb_vector, perturb_vector) From e532260914a86c19243714767204c5d31f81eb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Jul 2022 18:42:38 +0200 Subject: [PATCH 036/248] fix compilation issues --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 73 ++++++++------------- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 372829c88c5..08b01c8eac5 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -424,12 +424,12 @@ public: auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (create_gray_image_wrapper + (p::function(create_gray_image_wrapper (image_, iso_value_, image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -454,12 +454,12 @@ public: auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (create_gray_image_wrapper + (p::function(create_gray_image_wrapper (image_, iso_value_, image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -548,12 +548,12 @@ where the labeled image is used with a precomputed 3D image of weights : if (weights_.is_valid()) { return Labeled_mesh_domain_3 - (create_weighted_labeled_image_wrapper + (p::function(create_weighted_labeled_image_wrapper (image_, weights_, image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -564,11 +564,11 @@ where the labeled image is used with a precomputed 3D image of weights : else { return Labeled_mesh_domain_3 - (create_labeled_image_wrapper + (p::function(create_labeled_image_wrapper (image_, image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -679,19 +679,24 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): */ - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const CGAL_NP_CLASS& np = parameters::default_values()) + + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np) { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); using parameters::get_parameter; using parameters::choose_parameter; + auto function_ = get_parameter(np, internal_np::function_param); + auto bounding_object_ = get_parameter(np, internal_np::bounding_object_param); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (make_implicit_to_labeling_function_wrapper(function_), - bounding_object_, + (p::function(make_implicit_to_labeling_function_wrapper(function_)), + p::bounding_object(bounding_object_), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -700,42 +705,18 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): create_construct_surface_patch_index(construct_surface_patch_index_)); } - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::get_parameter; - using parameters::choose_parameter; - auto function_ = get_parameter(np, internal_np::function_param); - auto bounding_object_ = get_parameter(np, internal_np::bounding_object_param); - FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); - auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); - auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - namespace p = CGAL::parameters; - return Labeled_mesh_domain_3 - (make_implicit_to_labeling_function_wrapper(function_), - bounding_object_, - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(Function function_, BoundingObject bounding_object_, const CGAL_NP_CLASS& ... nps) - { - return create_implicit_mesh_domain(function_, bounding_object_, internal_np::combine_named_parameters(nps...)); - } template static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& ... nps) { return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const Function& f, const Bounding_object& bo) + { + return create_implicit_mesh_domain(parameters::function_param(f).bounding_object_param(bo)); + } + /// @} /** From 02ddb5c1c330505fe27a12be8c67cf1419bd1bf3 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Mon, 8 Aug 2022 14:36:26 +0530 Subject: [PATCH 037/248] Documentation for mandatory parameters --- Mesh_3/include/CGAL/Mesh_criteria_3.h | 2 ++ Mesh_3/include/CGAL/exude_mesh_3.h | 1 - Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 6 ++++++ Mesh_3/include/CGAL/refine_mesh_3.h | 6 +++++- Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h | 6 ++++++ Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h | 6 +++++- 7 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 8c4ed59c305..119cabfbd8c 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -170,6 +170,8 @@ public: \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + The following are optional named parameters. + \cgalNamedParamsBegin \cgalParamNBegin{edge_size} \cgalParamDescription{a scalar field (resp. a constant) providing a space varying diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 9c3a9f7e5be..a9f83e3a72e 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -53,7 +53,6 @@ to represent the final optimized mesh. @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - \cgalNamedParamsBegin \cgalParamNBegin{time_limit} \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index a1c03bf4719..dcf5b3ad5b7 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -67,7 +67,7 @@ object used to create the `c3t3` parameter. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" @param cdt the initial mesh that will be modified by the algorithm to represent the final optimized mesh. -@param domain ... +@param domain the domain to be discretized @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 0ac0da73a75..440af964d8a 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -422,6 +422,12 @@ of 1-dimensional exposed features. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + @param c3t3 the mesh to be refined. + @param domain the domain to be discretized + @param criteria the criteria + + The following are optional named parameters. + \cgalNamedParamsBegin \cgalParamNBegin{features_param} \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index ac0f9cab421..1bc790b26f3 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -351,7 +351,11 @@ In addition, if the domain has features, the argument `criteria` provides a sizing field to guide the discretization of 1-dimensional exposed features. -The four additional parameters are optimization parameters. +\param c3t3 the mesh to be refined. +\param domain the domain to be discretized +\param criteria the criteria + +The following four parameters are optional optimization parameters. They control which optimization processes are performed and allow the user to tune the parameters of the optimization processes. Individual optimization parameters are not described here as they are diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index cc62a33a200..bcbe5131711 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -221,6 +221,12 @@ of 1-dimensional exposed features. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" +\param c3t3 the mesh to be refined. +\param domain the domain to be discretized +\param criteria the criteria + +The following are optional named parameters. + \cgalNamedParamsBegin \cgalParamNBegin{features_param} \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be 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 ecf853a3b8a..7629a881927 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 @@ -208,7 +208,11 @@ In addition, if the domain has features, the argument `criteria` provides a sizing field to guide the discretization of 1-dimensional exposed features. -The four additional parameters are optimization parameters. + \param c3t3 the mesh to be refined. +\param domain the domain to be discretized +\param criteria the criteria + +The following four parameters are optional optimization parameters. They control which optimization processes are performed and allow the user to tune the parameters of the optimization processes. Individual optimization parameters are not described here as they are From fe5befbf255f514470192c0fc13b7b16d222e322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 16 Aug 2022 18:07:14 +0200 Subject: [PATCH 038/248] remove whitespace --- Mesh_3/include/CGAL/Mesh_criteria_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 119cabfbd8c..d06e8d64e35 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -171,7 +171,7 @@ public: \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: The following are optional named parameters. - + \cgalNamedParamsBegin \cgalParamNBegin{edge_size} \cgalParamDescription{a scalar field (resp. a constant) providing a space varying From ce44ebf64d17d6857ba7a95d81e1c2d13e09fd17 Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 17 Aug 2022 18:03:26 +0530 Subject: [PATCH 039/248] Documentation change, removed BOOST_PARAMETER_MAX_ARITY macro --- BGL/include/CGAL/boost/parameter.h | 9 --------- Installation/include/CGAL/config.h | 11 ----------- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 2 +- Mesh_3/include/CGAL/Mesh_criteria_3.h | 2 -- Polyhedron/demo/Polyhedron/C3t3_type.h | 2 -- .../demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp | 1 - .../demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h | 2 -- 7 files changed, 1 insertion(+), 28 deletions(-) diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h index 851fa3e8d39..83cc6384577 100644 --- a/BGL/include/CGAL/boost/parameter.h +++ b/BGL/include/CGAL/boost/parameter.h @@ -14,15 +14,6 @@ #include - -#ifdef BOOST_PARAMETER_MAX_ARITY -# if (BOOST_PARAMETER_MAX_ARITY < 12) -# error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3" -# endif -#else -# define BOOST_PARAMETER_MAX_ARITY 12 -#endif - #include #if defined(__clang__) || defined(BOOST_GCC) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index a2d01e9293a..7d7d435a302 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -112,17 +112,6 @@ #endif #endif -// Macro used by Boost Parameter. Mesh_3 needs at least 12, before the -// Boost Parameter headers are included: -// defines the value to 8, if it is not yet defined. -// The CGAL BGL properties mechanism includes -// , that includes -// , and maybe other Boost libraries may use -// Boost Parameter as well. -// That is why that is important to define that macro as early as possible, -// in -#define BOOST_PARAMETER_MAX_ARITY 12 - // The following header file defines among other things BOOST_PREVENT_MACRO_SUBSTITUTION #include #include diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index ccd6e94e60b..837c17414fd 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -543,7 +543,7 @@ where the labeled image is used with a precomputed 3D image of weights : auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); CGAL::Image_3 weights_ = choose_parameter(get_parameter(np, internal_np::weights_param), CGAL::Image_3()); - + CGAL_USE(iso_value_); namespace p = CGAL::parameters; if (weights_.is_valid()) { diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index d06e8d64e35..8c4ed59c305 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -170,8 +170,6 @@ public: \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - The following are optional named parameters. - \cgalNamedParamsBegin \cgalParamNBegin{edge_size} \cgalParamDescription{a scalar field (resp. a constant) providing a space varying diff --git a/Polyhedron/demo/Polyhedron/C3t3_type.h b/Polyhedron/demo/Polyhedron/C3t3_type.h index d666f6546b5..c9f890b6eac 100644 --- a/Polyhedron/demo/Polyhedron/C3t3_type.h +++ b/Polyhedron/demo/Polyhedron/C3t3_type.h @@ -3,8 +3,6 @@ #include "config.h" #include "Plugins/Mesh_3/config_mesh_3.h" - -// include this to get #define BOOST_PARAMETER_MAX_ARITY 12 // as otherwise it gets set via inclusion of Polyhedron_3.h #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp index 87fd4b7c529..f289245a996 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -2,7 +2,6 @@ // Needed for lloyd_optimize_mesh_2 which does it too late // (and we don't want to spend the time on finding out who // includes the header file that sets it too a value too low -#define BOOST_PARAMETER_MAX_ARITY 12 #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h index 50aa90773b8..482e1f323fc 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h @@ -1,8 +1,6 @@ #ifndef CGAL_DEMO_MESH_3_CONFIG_H #define CGAL_DEMO_MESH_3_CONFIG_H -#define BOOST_PARAMETER_MAX_ARITY 12 - // CGAL_MESH_3_PROTECTION_DEBUG: // - 1 : display debug messages // - 2 : dump file `polylines_graph.polylines.txt` and From d085d7b36898a15c1ca5c42fe205af1d1d45d7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 19 Aug 2022 00:55:54 +0200 Subject: [PATCH 040/248] use macros for compatibility internal code to be updated --- Mesh_2/test/Mesh_2/test_lloyd.cpp | 4 +- .../include/CGAL/Named_function_parameters.h | 126 +++++++----------- .../internal/parameters_interface.h | 113 ++++++++-------- 3 files changed, 105 insertions(+), 138 deletions(-) diff --git a/Mesh_2/test/Mesh_2/test_lloyd.cpp b/Mesh_2/test/Mesh_2/test_lloyd.cpp index dc49df49155..f2d663fca3b 100644 --- a/Mesh_2/test/Mesh_2/test_lloyd.cpp +++ b/Mesh_2/test/Mesh_2/test_lloyd.cpp @@ -62,8 +62,8 @@ struct Lloyd_tester CGAL::Mesh_optimization_return_code rc = CGAL::lloyd_optimize_mesh_2(cdt, CGAL::parameters::number_of_iterations(10). - convergence_ratio(0.001). - vertex_freeze_bound(0.001). + convergence(0.001). + freeze_bound(0.001). seeds(seeds)); const size_type number_of_vertices2 = cdt.number_of_vertices(); std::cerr << " done (return code = "<< rc <<").\n"; diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 25f296e443c..bb61f49afb3 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -46,8 +46,13 @@ enum all_default_t { all_default }; // define enum types and values for new named parameters #define CGAL_add_named_parameter(X, Y, Z) \ enum X { Y }; +#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ + enum X { Y }; +#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) #include #undef CGAL_add_named_parameter +#undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_extra_named_parameter_with_compatibility template struct Named_params_impl : Base @@ -250,16 +255,34 @@ struct Named_function_parameters // create the functions for new named parameters and the one imported boost // used to concatenate several parameters -#define CGAL_add_named_parameter(X, Y, Z) \ - template \ +#define CGAL_add_named_parameter(X, Y, Z) \ + template \ Named_function_parameters \ - Z(const K& k) const \ - { \ + Z(const K& k) const \ + { \ typedef Named_function_parameters Params;\ - return Params(k, *this); \ + return Params(k, *this); \ + } +#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters Params;\ + return Params(k, *this); \ + } +#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters Params;\ + return Params(k, *this); \ } #include #undef CGAL_add_named_parameter +#undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_extra_named_parameter_with_compatibility template Named_function_parameters @@ -302,20 +325,6 @@ inline no_parameters(Named_function_parameters) return Params(); } -// define free functions for named parameters -#define CGAL_add_named_parameter(X, Y, Z) \ - template \ - Named_function_parameters \ - Z(const K& p) \ - { \ - typedef Named_function_parameters Params;\ - return Params(p); \ - } - -#include -#undef CGAL_add_named_parameter - -#ifndef CGAL_NO_DEPRECATED_CODE template struct Boost_parameter_compatibility_wrapper { @@ -336,69 +345,24 @@ struct Boost_parameter_compatibility_wrapper } }; +// define free functions and Boost_parameter_compatibility_wrapper for named parameters +#define CGAL_add_named_parameter(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& p) \ + { \ + typedef Named_function_parameters Params;\ + return Params(p); \ + } // TODO: need to make sure this works when using several compilation units -const Boost_parameter_compatibility_wrapper max_iteration_number; -const Boost_parameter_compatibility_wrapper convergence; -const Boost_parameter_compatibility_wrapper freeze_bound; -const Boost_parameter_compatibility_wrapper time_limit; -const Boost_parameter_compatibility_wrapper seeds_begin; -const Boost_parameter_compatibility_wrapper seeds_end; -const Boost_parameter_compatibility_wrapper mark; -const Boost_parameter_compatibility_wrapper do_freeze; -const Boost_parameter_compatibility_wrapper sliver_criterion; -const Boost_parameter_compatibility_wrapper perturbation_vector; -//Compatibility wrappers for exude_mesh_3.h -const Boost_parameter_compatibility_wrapper sliver_bound; -const Boost_parameter_compatibility_wrapper mesh_topology; -const Boost_parameter_compatibility_wrapper dump_after_init_prefix; -const Boost_parameter_compatibility_wrapper dump_after_refine_surface_prefix; -const Boost_parameter_compatibility_wrapper dump_after_refine_prefix; -const Boost_parameter_compatibility_wrapper dump_after_glob_opt_prefix; -const Boost_parameter_compatibility_wrapper dump_after_perturb_prefix; -const Boost_parameter_compatibility_wrapper dump_after_exude_prefix; -const Boost_parameter_compatibility_wrapper number_of_initial_points; -const Boost_parameter_compatibility_wrapper maximal_number_of_vertices; -const Boost_parameter_compatibility_wrapper nonlinear_growth_of_balls; -const Boost_parameter_compatibility_wrapper pointer_to_error_code; -const Boost_parameter_compatibility_wrapper pointer_to_stop_atomic_boolean; -const Boost_parameter_compatibility_wrapper exude_param; -const Boost_parameter_compatibility_wrapper perturb_param; -const Boost_parameter_compatibility_wrapper odt_param; -const Boost_parameter_compatibility_wrapper lloyd_param; -const Boost_parameter_compatibility_wrapper reset_param; -const Boost_parameter_compatibility_wrapper mesh_options_param; -const Boost_parameter_compatibility_wrapper manifold_options_param; -const Boost_parameter_compatibility_wrapper features_param; - -const Boost_parameter_compatibility_wrapper function; -const Boost_parameter_compatibility_wrapper bounding_object; -const Boost_parameter_compatibility_wrapper image; -const Boost_parameter_compatibility_wrapper iso_value; -const Boost_parameter_compatibility_wrapper image_values_to_subdomain_indices; -const Boost_parameter_compatibility_wrapper value_outside; -const Boost_parameter_compatibility_wrapper relative_error_bound; -const Boost_parameter_compatibility_wrapper p_rng; -const Boost_parameter_compatibility_wrapper null_subdomain_index; -const Boost_parameter_compatibility_wrapper construct_surface_patch_index; -const Boost_parameter_compatibility_wrapper weights; - -const Boost_parameter_compatibility_wrapper edge_size; -const Boost_parameter_compatibility_wrapper edge_sizing_field; -const Boost_parameter_compatibility_wrapper facet_angle; -const Boost_parameter_compatibility_wrapper facet_size; -const Boost_parameter_compatibility_wrapper facet_sizing_field; -const Boost_parameter_compatibility_wrapper facet_distance; -const Boost_parameter_compatibility_wrapper facet_topology; -const Boost_parameter_compatibility_wrapper cell_radius_edge; -const Boost_parameter_compatibility_wrapper cell_radius_edge_ratio; -const Boost_parameter_compatibility_wrapper cell_size; -const Boost_parameter_compatibility_wrapper cell_sizing_field; -const Boost_parameter_compatibility_wrapper sizing_field; - - - - -#endif +#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ + const Boost_parameter_compatibility_wrapper Z; +#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \ + const Boost_parameter_compatibility_wrapper Z; +#include +#undef CGAL_add_named_parameter +#undef CGAL_add_extra_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility // function to extract a parameter template diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index f0792753812..2f0dff8e864 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -261,67 +261,70 @@ CGAL_add_named_parameter(adjust_directions_t, adjust_directions, adjust_directio CGAL_add_named_parameter(segment_t, segment_map, segment_map) // List of named parameters used in Mesh_2 package -CGAL_add_named_parameter(seeds_t, seeds, seeds) -CGAL_add_named_parameter(domain_is_initialized_t, domain_is_initialized, domain_is_initialized) -CGAL_add_named_parameter(seeds_are_in_domain_t, seeds_are_in_domain, seeds_are_in_domain) -CGAL_add_named_parameter(criteria_t, criteria, criteria) -CGAL_add_named_parameter(convergence_ratio_t, convergence_ratio, convergence_ratio) -CGAL_add_named_parameter(vertex_freeze_bound_t, vertex_freeze_bound, vertex_freeze_bound) -CGAL_add_named_parameter(i_seed_begin_iterator_t, i_seed_begin_iterator, i_seed_begin_iterator) -CGAL_add_named_parameter(i_seed_end_iterator_t, i_seed_end_iterator, i_seed_end_iterator) +CGAL_add_named_parameter_with_compatibility(seeds_t, seeds, seeds) +CGAL_add_named_parameter_with_compatibility(domain_is_initialized_t, domain_is_initialized, domain_is_initialized) +CGAL_add_named_parameter_with_compatibility(seeds_are_in_domain_t, seeds_are_in_domain, seeds_are_in_domain) +CGAL_add_extra_named_parameter_with_compatibility(seeds_are_in_domain_t, seeds_are_in_domain, mark) +CGAL_add_named_parameter_with_compatibility(criteria_t, criteria, criteria) +CGAL_add_named_parameter_with_compatibility(convergence_ratio_t, convergence_ratio, convergence) +CGAL_add_named_parameter_with_compatibility(vertex_freeze_bound_t, vertex_freeze_bound, freeze_bound) +CGAL_add_named_parameter_with_compatibility(i_seed_begin_iterator_t, i_seed_begin_iterator, seeds_begin) +CGAL_add_named_parameter_with_compatibility(i_seed_end_iterator_t, i_seed_end_iterator, seeds_end) //List of named parameters used in exude_mesh_3.h -CGAL_add_named_parameter(lower_sliver_bound_t,lower_sliver_bound,lower_sliver_bound) -CGAL_add_named_parameter(freeze_t,freeze,freeze) +CGAL_add_named_parameter_with_compatibility(lower_sliver_bound_t,lower_sliver_bound,sliver_bound) +CGAL_add_named_parameter_with_compatibility(freeze_t,freeze,do_freeze) //List of named parameters used in perturb_mesh_3.h -CGAL_add_named_parameter(sliver_criteria_t, sliver_criteria, sliver_criteria) -CGAL_add_named_parameter(perturb_vector_t, perturb_vector, perturb_vector) +CGAL_add_named_parameter_with_compatibility(sliver_criteria_t, sliver_criteria, sliver_criterion) +CGAL_add_named_parameter_with_compatibility(perturb_vector_t, perturb_vector, perturbation_vector) //List of named parameters used in refine_mesh_3.h -CGAL_add_named_parameter(mesh_topology_number_t, mesh_topology_number, mesh_topology_number) -CGAL_add_named_parameter(dump_after_init_prefix_param_t, dump_after_init_prefix_param, dump_after_init_prefix_param) -CGAL_add_named_parameter(dump_after_refine_surface_prefix_param_t, dump_after_refine_surface_prefix_param, dump_after_refine_surface_prefix_param) -CGAL_add_named_parameter(dump_after_refine_prefix_param_t, dump_after_refine_prefix_param, dump_after_refine_prefix_param) -CGAL_add_named_parameter(dump_after_glob_opt_prefix_param_t, dump_after_glob_opt_prefix_param, dump_after_glob_opt_prefix_param) -CGAL_add_named_parameter(dump_after_perturb_prefix_param_t, dump_after_perturb_prefix_param, dump_after_perturb_prefix_param) -CGAL_add_named_parameter(dump_after_exude_prefix_param_t, dump_after_exude_prefix_param, dump_after_exude_prefix_param) -CGAL_add_named_parameter(number_of_initial_points_param_t, number_of_initial_points_param, number_of_initial_points_param) -CGAL_add_named_parameter(maximal_number_of_vertices_param_t, maximal_number_of_vertices_param, maximal_number_of_vertices_param) -CGAL_add_named_parameter(nonlinear_growth_of_balls_param_t, nonlinear_growth_of_balls_param, nonlinear_growth_of_balls_param) -CGAL_add_named_parameter(pointer_to_error_code_param_t, pointer_to_error_code_param, pointer_to_error_code_param) -CGAL_add_named_parameter(pointer_to_stop_atomic_boolean_param_t, pointer_to_stop_atomic_boolean_param, pointer_to_stop_atomic_boolean_param) -CGAL_add_named_parameter(exude_options_param_t, exude_options_param, exude_options_param) -CGAL_add_named_parameter(perturb_options_param_t, perturb_options_param, perturb_options_param) -CGAL_add_named_parameter(odt_options_param_t, odt_options_param, odt_options_param) -CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_options_param) -CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options_param) -CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_param) -CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_param) -CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options_param) +CGAL_add_extra_named_parameter_with_compatibility(number_of_iterations_t, number_of_iterations, max_iteration_number) +CGAL_add_extra_named_parameter_with_compatibility(maximum_running_time_t, maximum_running_time, time_limit) +CGAL_add_named_parameter_with_compatibility(mesh_topology_number_t, mesh_topology_number, mesh_topology) +CGAL_add_named_parameter_with_compatibility(dump_after_init_prefix_param_t, dump_after_init_prefix_param, dump_after_init_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_refine_surface_prefix_param_t, dump_after_refine_surface_prefix_param, dump_after_refine_surface_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_refine_prefix_param_t, dump_after_refine_prefix_param, dump_after_refine_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_glob_opt_prefix_param_t, dump_after_glob_opt_prefix_param, dump_after_glob_opt_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_perturb_prefix_param_t, dump_after_perturb_prefix_param, dump_after_perturb_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_exude_prefix_param_t, dump_after_exude_prefix_param, dump_after_exude_prefix) +CGAL_add_named_parameter_with_compatibility(number_of_initial_points_param_t, number_of_initial_points_param, number_of_initial_points) +CGAL_add_named_parameter_with_compatibility(maximal_number_of_vertices_param_t, maximal_number_of_vertices_param, maximal_number_of_vertices) +CGAL_add_named_parameter_with_compatibility(nonlinear_growth_of_balls_param_t, nonlinear_growth_of_balls_param, nonlinear_growth_of_balls) +CGAL_add_named_parameter_with_compatibility(pointer_to_error_code_param_t, pointer_to_error_code_param, pointer_to_error_code) +CGAL_add_named_parameter_with_compatibility(pointer_to_stop_atomic_boolean_param_t, pointer_to_stop_atomic_boolean_param, pointer_to_stop_atomic_boolean) +CGAL_add_named_parameter(exude_options_param_t, exude_options_param, exude_options) +CGAL_add_named_parameter(perturb_options_param_t, perturb_options_param, perturb_options) +CGAL_add_named_parameter(odt_options_param_t, odt_options_param, odt_options) +CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_options) +CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options) +CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_options) +CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_options) +CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options) -CGAL_add_named_parameter(image_3_param_t, image_3_param, image_3_param) -CGAL_add_named_parameter(iso_value_param_t, iso_value_param, iso_value_param) -CGAL_add_named_parameter(image_subdomain_index_t, image_subdomain_index, image_subdomain_index) -CGAL_add_named_parameter(voxel_value_t, voxel_value, voxel_value) -CGAL_add_named_parameter(error_bound_t, error_bound, error_bound) -CGAL_add_named_parameter(rng_t, rng, rng) -CGAL_add_named_parameter(null_subdomain_index_param_t,null_subdomain_index_param, null_subdomain_index_param) -CGAL_add_named_parameter(surface_patch_index_t, surface_patch_index, surface_patch_index) -CGAL_add_named_parameter(weights_param_t, weights_param, weights_param) +CGAL_add_named_parameter_with_compatibility(image_3_param_t, image_3_param, image) +CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) +CGAL_add_named_parameter_with_compatibility(image_subdomain_index_t, image_subdomain_index, image_values_to_subdomain_indices) +CGAL_add_named_parameter_with_compatibility(voxel_value_t, voxel_value, value_outside) +CGAL_add_named_parameter_with_compatibility(error_bound_t, error_bound, relative_error_bound) +CGAL_add_named_parameter_with_compatibility(rng_t, rng, p_rng) +CGAL_add_named_parameter_with_compatibility(null_subdomain_index_param_t,null_subdomain_index_param, null_subdomain_index) +CGAL_add_named_parameter_with_compatibility(surface_patch_index_t, surface_patch_index, construct_surface_patch_index) +CGAL_add_named_parameter_with_compatibility(weights_param_t, weights_param, weights) -CGAL_add_named_parameter(edge_size_param_t, edge_size_param, edge_size_param) -CGAL_add_named_parameter(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field_param) -CGAL_add_named_parameter(facet_angle_param_t, facet_angle_param, facet_angle_param) -CGAL_add_named_parameter(facet_size_param_t, facet_size_param, facet_size_param) -CGAL_add_named_parameter(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field_param) -CGAL_add_named_parameter(facet_distance_param_t, facet_distance_param, facet_distance_param) -CGAL_add_named_parameter(facet_topology_param_t, facet_topology_param, facet_topology_param) -CGAL_add_named_parameter(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge_param) -CGAL_add_named_parameter(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio_param) -CGAL_add_named_parameter(cell_size_param_t, cell_size_param, cell_size_param) -CGAL_add_named_parameter(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field_param) -CGAL_add_named_parameter(sizing_field_param_t, sizing_field_param, sizing_field_param) +CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size) +CGAL_add_named_parameter_with_compatibility(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field) +CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle) +CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size) +CGAL_add_named_parameter_with_compatibility(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field) +CGAL_add_named_parameter_with_compatibility(facet_distance_param_t, facet_distance_param, facet_distance) +CGAL_add_named_parameter_with_compatibility(facet_topology_param_t, facet_topology_param, facet_topology) +CGAL_add_named_parameter_with_compatibility(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge) +CGAL_add_named_parameter_with_compatibility(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio) +CGAL_add_named_parameter_with_compatibility(cell_size_param_t, cell_size_param, cell_size) +CGAL_add_named_parameter_with_compatibility(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field) +CGAL_add_named_parameter_with_compatibility(sizing_field_param_t, sizing_field_param, sizing_field) -CGAL_add_named_parameter(function_param_t, function_param, function_param) -CGAL_add_named_parameter(bounding_object_param_t, bounding_object_param, bounding_object_param) +CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function) +CGAL_add_named_parameter_with_compatibility(bounding_object_param_t, bounding_object_param, bounding_object) From 530d6e0f78baec67af91e978078c6b36b285a94f Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 23 Aug 2022 14:58:15 +0530 Subject: [PATCH 041/248] Fixed tests not running in Mesh_3 --- Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h | 8 ++++---- Mesh_3/include/CGAL/Implicit_mesh_domain_3.h | 2 +- .../include/CGAL/Labeled_image_mesh_domain_3.h | 8 ++++---- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 2 +- Mesh_3/include/CGAL/exude_mesh_3.h | 3 ++- Mesh_3/include/CGAL/make_mesh_3.h | 6 +++--- .../test/Mesh_3/test_labeled_mesh_domain_3.cpp | 4 ++-- .../Mesh_3/test_meshing_implicit_function.cpp | 4 ++-- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 2 +- .../internal/parameters_interface.h | 16 ++++++++-------- 10 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h index 4cee05d8d90..99bc1e6b313 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -64,10 +64,10 @@ public: const Image_word_type value_outside = 0., const FT& error_bound = FT(1e-3), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(image, + : Base(parameters::function = Wrapper(image, Transform(iso_value), Transform(iso_value)(value_outside)), - Mesh_3::internal::compute_bounding_box(image), + parameters::bounding_object = Mesh_3::internal::compute_bounding_box(image), parameters::relative_error_bound = error_bound, parameters::p_rng = p_rng) { @@ -79,8 +79,8 @@ public: const Image_word_type value_outside = 0., const FT& error_bound = FT(1e-3), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(image, transform, transform(value_outside)), - Mesh_3::internal::compute_bounding_box(image), + : Base(parameters::function = Wrapper(image, transform, transform(value_outside)), + parameters::bounding_object = Mesh_3::internal::compute_bounding_box(image), parameters::relative_error_bound = error_bound, parameters::p_rng = p_rng) { diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index dab6fffc355..764444851de 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -65,7 +65,7 @@ public: const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-6), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(f), bounding_sphere, parameters::relative_error_bound = error_bound, + : Base(parameters::function = Wrapper(f), parameters::bounding_object = bounding_sphere, parameters::relative_error_bound = error_bound, parameters::null_subdomain_index = Null_subdomain_index(), parameters::p_rng = p_rng) {} /// Destructor diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 3e4a39e5f69..08a6ded1f20 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -75,8 +75,8 @@ public: Subdomain_index value_outside = 0, Null null = Null(), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(image, Identity(), value_outside), - compute_bounding_box(image), + : Base(parameters::function = Wrapper(image, Identity(), value_outside), + parameters::bounding_object = compute_bounding_box(image), parameters::relative_error_bound = error_bound, parameters::null_subdomain_index = null, parameters::p_rng = p_rng) @@ -85,8 +85,8 @@ public: Labeled_image_mesh_domain_3(const Image& image, const FT error_bound, CGAL::Random* p_rng) - : Base(Wrapper(image), - compute_bounding_box(image), + : Base(parameters::function = Wrapper(image), + parameters::bounding_object = compute_bounding_box(image), parameters::relative_error_bound = error_bound, parameters::p_rng = p_rng) {} diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 837c17414fd..0820a9a429e 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -714,7 +714,7 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): template static Labeled_mesh_domain_3 create_implicit_mesh_domain(const Function& f, const Bounding_object& bo) { - return create_implicit_mesh_domain(parameters::function_param(f).bounding_object_param(bo)); + return create_implicit_mesh_domain(parameters::function(f).bounding_object(bo)); } /// @} diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index a9f83e3a72e..52d50ebefba 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -96,6 +96,7 @@ exude_mesh_3(c3t3, \sa `CGAL::odt_optimize_mesh_3()` */ + template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { @@ -110,7 +111,7 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, double sliver_bound = 0) { - return exude_mesh_3(c3t3, CGAL::parameters::time_limit(time_limit).lower_sliver_bound(sliver_bound)); + return exude_mesh_3(c3t3, CGAL::parameters::time_limit(time_limit).sliver_bound(sliver_bound)); } #endif #ifndef DOXYGEN_RUNNING diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 74798e59f26..c67386b2f0b 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -607,9 +607,9 @@ void make_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process // Don't reset c3t3 as we just created it refine_mesh_3(c3t3, domain, criteria, - parameters::exude_param=exude, parameters::perturb_param=perturb, parameters::odt_param=odt, parameters::lloyd_param= lloyd, - parameters::no_reset_c3t3(), parameters::mesh_options_param= mesh_options, - parameters::manifold_options_param= manifold_options); + parameters::exude_options=exude, parameters::perturb_options=perturb, parameters::odt_options=odt, parameters::lloyd_options= lloyd, + parameters::no_reset_c3t3(), parameters::mesh_options= mesh_options, + parameters::manifold_option= manifold_options); } #endif //DOXYGEN_RUNNING diff --git a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp index 78aef17f68d..0c3a1b8c7bb 100644 --- a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp +++ b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp @@ -72,12 +72,12 @@ private: Function f_sphere(&sphere_function); Function_wrapper wrapper_1(f_sphere); - Mesh_domain domain(wrapper_1, bounding_shape, CGAL::parameters::relative_error_bound = error_bound); + Mesh_domain domain(wrapper_1, bounding_shape, error_bound); test_construct_initial_points(domain, error_bound); Function f_shape(&shape_function); Function_wrapper wrapper_2(f_shape); - Mesh_domain domain_2(wrapper_2, bounding_shape, CGAL::parameters::relative_error_bound = error_bound); + Mesh_domain domain_2(wrapper_2, bounding_shape, error_bound); test_is_in_domain(domain_2); test_do_intersect_surface(domain_2); test_construct_intersection(domain_2); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp index 39e8cd88d78..58eab9a7500 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp @@ -43,8 +43,8 @@ struct Implicit_tester : public Tester namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (Implicit_tester::sphere_function, - Sphere_3(CGAL::ORIGIN,2.), + (p::function = Implicit_tester::sphere_function, + p::bounding_object = Sphere_3(CGAL::ORIGIN,2.), p::p_rng = &CGAL::get_default_random(), p::relative_error_bound = 1e-3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 82854729aa6..a16c177a937 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -153,7 +153,7 @@ struct Tester // Quality should increase C3t3 exude_c3t3(c3t3); std::cerr << "Exude...\n"; - CGAL::exude_mesh_3(exude_c3t3); + CGAL::exude_mesh_3(exude_c3t3, CGAL::parameters::time_limit = 0); verify_c3t3(exude_c3t3,domain,domain_type,v,v,f,f); verify_c3t3_quality(c3t3,exude_c3t3); verify_c3t3_volume(exude_c3t3, volume*0.95, volume*1.05); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 2f0dff8e864..cf9ef27c66c 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -293,14 +293,14 @@ CGAL_add_named_parameter_with_compatibility(maximal_number_of_vertices_param_t, CGAL_add_named_parameter_with_compatibility(nonlinear_growth_of_balls_param_t, nonlinear_growth_of_balls_param, nonlinear_growth_of_balls) CGAL_add_named_parameter_with_compatibility(pointer_to_error_code_param_t, pointer_to_error_code_param, pointer_to_error_code) CGAL_add_named_parameter_with_compatibility(pointer_to_stop_atomic_boolean_param_t, pointer_to_stop_atomic_boolean_param, pointer_to_stop_atomic_boolean) -CGAL_add_named_parameter(exude_options_param_t, exude_options_param, exude_options) -CGAL_add_named_parameter(perturb_options_param_t, perturb_options_param, perturb_options) -CGAL_add_named_parameter(odt_options_param_t, odt_options_param, odt_options) -CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_options) -CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options) -CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_options) -CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_options) -CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options) +CGAL_add_named_parameter_with_compatibility(exude_options_param_t, exude_options_param, exude_options) +CGAL_add_named_parameter_with_compatibility(perturb_options_param_t, perturb_options_param, perturb_options) +CGAL_add_named_parameter_with_compatibility(odt_options_param_t, odt_options_param, odt_options) +CGAL_add_named_parameter_with_compatibility(lloyd_options_param_t, lloyd_options_param, lloyd_options) +CGAL_add_named_parameter_with_compatibility(reset_options_param_t, reset_options_param, reset_options) +CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_options) +CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) +CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) CGAL_add_named_parameter_with_compatibility(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) From a2ae9ea98f4789e3aff7384048b31135bd65d0be Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 23 Aug 2022 15:11:49 +0530 Subject: [PATCH 042/248] Fixed tests in SMDS_3 --- SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp b/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp index 43614d7dd46..851e8fe38c6 100644 --- a/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp +++ b/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp @@ -68,7 +68,7 @@ int main() v.push_back(f1); v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), relative_error_bound = 1e-6); + Mesh_domain domain(CGAL::parameters::function = Function_wrapper(v), CGAL::parameters::bounding_object = K::Sphere_3(CGAL::ORIGIN, 5.*5.), relative_error_bound = 1e-6); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation From 620a8f204c0d375e40c513da9e43d6a618fcc7ce Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 23 Aug 2022 15:43:26 +0530 Subject: [PATCH 043/248] Fixed named parameters not found error --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 12 ++++++------ Mesh_3/include/CGAL/make_mesh_3.h | 12 ++++++------ Mesh_3/include/CGAL/refine_mesh_3.h | 10 +++++----- .../include/CGAL/make_periodic_3_mesh_3.h | 12 ++++++------ .../include/CGAL/refine_periodic_3_mesh_3.h | 10 +++++----- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 7ec80b4c530..53e02a2ed9e 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -73,23 +73,23 @@ namespace CGAL * \cgalParamDefault{false} * \cgalParamNEnd * - * \cgalParamNBegin{number_of_iterations} + * \cgalParamNBegin{max_iteration_number} * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is * no limit on the number of performed iterations.} - * \cgalParamExtra{\pre `number_of_iterations >=0`} + * \cgalParamExtra{\pre `max_iteration_number >=0`} * \cgalParamType{`int`} * \cgalParamDefault{0} * \cgalParamNEnd * - * \cgalParamNBegin{maximum_running_time} + * \cgalParamNBegin{time_limit} * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `maximum_running_time` \f$ \geq\f$ 0} + * \cgalParamExtra{\pre `time_limit` \f$ \geq\f$ 0} * \cgalParamDefault{0} * \cgalParamNEnd * - * \cgalParamNBegin{vertex_freeze_bound} + * \cgalParamNBegin{freeze_bound} * \cgalParamDescription{designed to reduce running time of each optimization iteration. * Any vertex that has a displacement less than a given fraction of the length * of its shortest incident edge, is frozen (i.e.\ is not relocated). @@ -100,7 +100,7 @@ namespace CGAL * \cgalParamDefault{0.001} * \cgalParamNEnd * - * \cgalParamNBegin{convergence_ratio} + * \cgalParamNBegin{convergence} * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped * when at the last iteration the displacement of any vertex is less than * a given fraction of the length of the shortest edge incident to that vertex.} diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c67386b2f0b..522101ba0a3 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -432,7 +432,7 @@ of 1-dimensional exposed features. The following are optional named parameters. \cgalNamedParamsBegin - \cgalParamNBegin{features_param} + \cgalParamNBegin{features_options} \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be taken into account or not when the domain is a model of `MeshDomainWithFeatures_3`. @@ -449,7 +449,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} \cgalParamDefault{`parameters::features(domain)`} - \cgalParamNBegin{manifold_options_param} + \cgalParamNBegin{manifold_option} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -458,7 +458,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param} + \cgalParamNBegin{lloyd_options} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -466,7 +466,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{`parameters::no_lloyd()`} - \cgalParamNBegin{odt_param} + \cgalParamNBegin{odt_options} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -475,7 +475,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param} + \cgalParamNBegin{perturb_options} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -484,7 +484,7 @@ of 1-dimensional exposed features. \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{`parameters::no_perturb`} - \cgalParamNBegin{exude_param} + \cgalParamNBegin{exude_options} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 48792a03046..f7321aaa6c4 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -367,7 +367,7 @@ For each optimization algorithm, there exist two global functions that allow to enable or disable the optimizer: \cgalNamedParamsBegin - \cgalParamNBegin{manifold_options_param} + \cgalParamNBegin{manifold_option} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -376,7 +376,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param} + \cgalParamNBegin{lloyd_options} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -384,7 +384,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{'parameters::no_lloyd()'} - \cgalParamNBegin{odt_param} + \cgalParamNBegin{odt_options} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -393,7 +393,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param} + \cgalParamNBegin{perturb_options} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -402,7 +402,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{'parameters::no_perturb`} - \cgalParamNBegin{exude_param} + \cgalParamNBegin{exude_options} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index bcbe5131711..354977f4182 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -228,7 +228,7 @@ of 1-dimensional exposed features. The following are optional named parameters. \cgalNamedParamsBegin - \cgalParamNBegin{features_param} + \cgalParamNBegin{features_options} \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be taken into account or not when the domain is a model of `MeshDomainWithFeatures_3`. @@ -245,7 +245,7 @@ The following are optional named parameters. \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} \cgalParamDefault{`parameters::features(domain)`} - \cgalParamNBegin{manifold_options_param} + \cgalParamNBegin{manifold_option} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -254,7 +254,7 @@ The following are optional named parameters. \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param} + \cgalParamNBegin{lloyd_options} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -262,7 +262,7 @@ The following are optional named parameters. \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{`parameters::no_lloyd()`} - \cgalParamNBegin{odt_param} + \cgalParamNBegin{odt_options} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -271,7 +271,7 @@ The following are optional named parameters. \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param} + \cgalParamNBegin{perturb_options} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -280,7 +280,7 @@ The following are optional named parameters. \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{`parameters::no_perturb`} - \cgalParamNBegin{exude_param} + \cgalParamNBegin{exude_options} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of 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 a720658ecb5..a25ba5c3e6c 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 @@ -221,7 +221,7 @@ For each optimization algorithm, there exist two global functions that allow to enable or disable the optimizer: \cgalNamedParamsBegin - \cgalParamNBegin{manifold_options_param} + \cgalParamNBegin{manifold_option} \cgalParamDescription{allows the user to drive the meshing algorithm, and ensure that the output mesh surface follows the given manifold criterion. It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` @@ -230,7 +230,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} \cgalParamDefault{`parameters::non_manifold()`} - \cgalParamNBegin{lloyd_param} + \cgalParamNBegin{lloyd_options} \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -238,7 +238,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} \cgalParamDefault{`parameters::no_lloyd()'} - \cgalParamNBegin{odt_param} + \cgalParamNBegin{odt_options} \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to trigger or not a call to `odt_optimize_mesh_3()` function and to set the parameters of this optimizer. @@ -247,7 +247,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} \cgalParamDefault{`parameters::no_odt()`} - \cgalParamNBegin{perturb_param} + \cgalParamNBegin{perturb_options} \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to trigger or not a call to `perturb_mesh_3()` function and to set the parameters of this optimizer. If one parameter is not set, the default value of @@ -256,7 +256,7 @@ that allow to enable or disable the optimizer: \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} \cgalParamDefault{`parameters::no_perturb`} - \cgalParamNBegin{exude_param} + \cgalParamNBegin{exude_options} \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to trigger or not a call to `exude_mesh_3()` function and to override to set the parameters of this optimizer. If one parameter is not set, the default value of From b9ff787e7b73320f1aabc489466115f174a215ea Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 7 Sep 2022 11:35:43 +0530 Subject: [PATCH 044/248] Testsuite fixes --- .../include/CGAL/make_periodic_3_mesh_3.h | 6 +-- .../include/CGAL/optimize_periodic_3_mesh_3.h | 44 +------------------ Polyhedron/demo/Polyhedron/C3t3_type.h | 1 - .../Surface_mesh/Offset_meshing_plugin.cpp | 4 +- 4 files changed, 7 insertions(+), 48 deletions(-) diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 354977f4182..c4af309a809 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -395,9 +395,9 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process refine_periodic_3_mesh_3(c3t3, domain, criteria, - parameters::exude_param = exude, parameters::perturb_param = perturb, parameters::odt_param = odt, - parameters::lloyd_param = lloyd, parameters::reset_param = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it - parameters::mesh_options_param = mesh_options, parameters::manifold_options_param = manifold_options); + parameters::exude_options = exude, parameters::perturb_options = perturb, parameters::odt_options = odt, + parameters::lloyd_options = lloyd, parameters::reset_options = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it + parameters::mesh_options = mesh_options, parameters::manifold_option = manifold_options); } #endif //DOXYGEN_RUNNING } // end namespace CGAL 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 c5c3f748670..b989055d1bd 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 @@ -35,21 +35,7 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& np) -{ - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); - auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); - auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); - return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); -} + template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { @@ -72,17 +58,6 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } - template - Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - 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); - } template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { @@ -108,22 +83,7 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } - template - Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::choose_parameter; - using parameters::get_parameter; - auto c3t3 = get_parameter(np,internal_np::c3t3_param); - auto domain = get_parameter(np,internal_np::mesh_domain_param); - double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); - double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); - double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); - bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); - return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); - } + template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { diff --git a/Polyhedron/demo/Polyhedron/C3t3_type.h b/Polyhedron/demo/Polyhedron/C3t3_type.h index c9f890b6eac..fe815264335 100644 --- a/Polyhedron/demo/Polyhedron/C3t3_type.h +++ b/Polyhedron/demo/Polyhedron/C3t3_type.h @@ -4,7 +4,6 @@ #include "config.h" #include "Plugins/Mesh_3/config_mesh_3.h" // as otherwise it gets set via inclusion of Polyhedron_3.h -#include #include #include "SMesh_type.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp index 4ef6a35b7a1..b626be445d3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp @@ -286,8 +286,8 @@ SMesh* cgal_off_meshing(QWidget*, Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (offset_function(tm_ptr, offset_value), - Sphere_3(center, sqrad), + (p::function = offset_function(tm_ptr, offset_value), + p::bounding_object = Sphere_3(center, sqrad), p::relative_error_bound = 1e-7, p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); }); From 7b30693cd7317c239caacfa197bc33d8047aaf3b Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 7 Sep 2022 17:57:34 +0530 Subject: [PATCH 045/248] More testsuite/polyhedron fixes --- Mesh_2/doc/Mesh_2/dependencies | 1 - Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 12 ++++++------ .../demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h | 2 +- .../Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Mesh_2/doc/Mesh_2/dependencies b/Mesh_2/doc/Mesh_2/dependencies index 0c0f7765312..696bf34e1fb 100644 --- a/Mesh_2/doc/Mesh_2/dependencies +++ b/Mesh_2/doc/Mesh_2/dependencies @@ -5,4 +5,3 @@ Algebraic_foundations Circulator Stream_support Triangulation_2 -BGL diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 0820a9a429e..20f622733c0 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -597,12 +597,12 @@ where the labeled image is used with a precomputed 3D image of weights : if (weights_.is_valid()) { return Labeled_mesh_domain_3 - (create_weighted_labeled_image_wrapper + (p::function(create_weighted_labeled_image_wrapper (image_, weights_, image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -613,11 +613,11 @@ where the labeled image is used with a precomputed 3D image of weights : else { return Labeled_mesh_domain_3 - (create_labeled_image_wrapper + (p::function(create_labeled_image_wrapper (image_, image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index d5249e256b9..9681a52738b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -232,7 +232,7 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag) criteria, p_.protect_features, p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_, - p::nonlinear_growth_of_balls = true)); + p::nonlinear_growth_of_balls = true).v); } template < typename D_, typename Tag > diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp index 627afb7577b..0ceb091a78a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp @@ -171,7 +171,7 @@ Optimizer_thread* cgal_code_optimization(Scene_c3t3_item& c3t3_item, p_function->bbox().zmax()); Function_mesh_domain* p_domain = - new Function_mesh_domain(Function_wrapper(*p_function), dom_bbox, 1e-7, + new Function_mesh_domain(CGAL::parameters::function = Function_wrapper(*p_function), CGAL::parameters::bounding_object = dom_bbox, CGAL::parameters::relative_error_bound = 1e-7, CGAL::parameters::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); } ); From 086fb949608d8e8307d64f1863c262528f68a60e Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Wed, 7 Sep 2022 19:12:34 +0530 Subject: [PATCH 046/248] Fixed polyhedral demo not working --- .../demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp index fecc73c41ea..c4f59578610 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp @@ -248,7 +248,7 @@ Meshing_thread* cgal_code_mesh_3(const Implicit_function_interface* pfunction, pfunction->bbox().zmax()); namespace p = CGAL::parameters; Function_mesh_domain* p_domain = - new Function_mesh_domain(Function_wrapper(*pfunction), domain_bbox, 1e-7, + new Function_mesh_domain(p::function = Function_wrapper(*pfunction), p::bounding_object = domain_bbox, p::relative_error_bound = 1e-7, p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); } ); From 4365c8b95ea8d071bdf8a84c16c87368a9762a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 7 Sep 2022 16:31:49 +0200 Subject: [PATCH 047/248] remove dependency --- Mesh_2/package_info/Mesh_2/dependencies | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_2/package_info/Mesh_2/dependencies b/Mesh_2/package_info/Mesh_2/dependencies index a0eb105c10e..8e839394994 100644 --- a/Mesh_2/package_info/Mesh_2/dependencies +++ b/Mesh_2/package_info/Mesh_2/dependencies @@ -1,5 +1,4 @@ Algebraic_foundations -BGL Circulator Distance_2 Hash_map From cfac69a2902c482161c8a080d3e90fff08762fbd Mon Sep 17 00:00:00 2001 From: GYuvanShankar Date: Tue, 13 Sep 2022 20:22:54 +0530 Subject: [PATCH 048/248] Fixed Periodic_3_mesh_3 tests/examples --- .../include/CGAL/make_periodic_3_mesh_3.h | 12 ++++++------ .../include/CGAL/refine_periodic_3_mesh_3.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index c4af309a809..3f9175ca598 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -335,11 +335,11 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG using parameters::choose_parameter; using parameters::get_parameter; C3T3 c3t3; - parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude()); - parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb()); - parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); - parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); - parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain)); + 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); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); @@ -396,7 +396,7 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process refine_periodic_3_mesh_3(c3t3, domain, criteria, parameters::exude_options = exude, parameters::perturb_options = perturb, parameters::odt_options = odt, - parameters::lloyd_options = lloyd, parameters::reset_options = parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it + parameters::lloyd_options = lloyd, parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it parameters::mesh_options = mesh_options, parameters::manifold_option = manifold_options); } #endif //DOXYGEN_RUNNING 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 a25ba5c3e6c..c55ca44df5f 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 @@ -306,11 +306,11 @@ 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()); - parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::no_perturb()); - parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt()); - parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd()); - parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3()); + 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::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); + parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3().v); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); From 195605627daae60cb8911ed5952b496c5f3f7152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Sep 2022 09:21:35 +0200 Subject: [PATCH 049/248] remove no longer needed file --- BGL/include/CGAL/boost/parameter.h | 116 ----------------------------- 1 file changed, 116 deletions(-) delete mode 100644 BGL/include/CGAL/boost/parameter.h diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h deleted file mode 100644 index 83cc6384577..00000000000 --- a/BGL/include/CGAL/boost/parameter.h +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) 2014 GeometryFactory (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Andreas Fabri - -#ifndef CGAL_BOOST_PARAMETER_H -#define CGAL_BOOST_PARAMETER_H - -#include - -#include - -#if defined(__clang__) || defined(BOOST_GCC) -# define CGAL_IGNORE_UNUSED_VARIABLES \ - _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \ - _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") -#else -# define CGAL_IGNORE_UNUSED_VARIABLES -#endif -#if __has_warning("-Wunneeded-internal-declaration") -# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION \ - _Pragma("clang diagnostic ignored \"-Wunneeded-internal-declaration\"") -#else -# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION -#endif - -#define CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \ - CGAL_IGNORE_UNUSED_VARIABLES \ - CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION - - -namespace CGAL -{ -namespace parameters -{ - -template -struct Base -{ - Base(T t) : t_(t) {} - T operator()() const { return t_; } -private: - T t_; -}; - -#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ - struct Class : public Base { Class(bool b) : Base(b){} }; \ - inline Class function_true() { return Class(true); } \ - inline Class function_false() { return Class(false); } - -#define CGAL_DOUBLE_PARAMETER(Class, function, precondition) \ - struct Class : public Base \ - { Class(double d) : Base(d) { precondition(d); } }; \ - inline Class function(double d) { return Class(d); } - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_NAME( c3t3 ) -BOOST_PARAMETER_NAME( domain ) -BOOST_PARAMETER_NAME( criteria ) -BOOST_PARAMETER_NAME( cdt ) - -BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) -BOOST_PARAMETER_NAME( (convergence, tag) convergence_) -BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) -BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) - -BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) -BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) -BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) -BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_) - -BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_) - -BOOST_PARAMETER_NAME( (dump_after_init_prefix, tag ) dump_after_init_prefix_) -BOOST_PARAMETER_NAME( (dump_after_refine_surface_prefix, tag ) dump_after_refine_surface_prefix_) -BOOST_PARAMETER_NAME( (dump_after_refine_prefix, tag ) dump_after_refine_prefix_) -BOOST_PARAMETER_NAME( (dump_after_glob_opt_prefix, tag ) dump_after_glob_opt_prefix_) -BOOST_PARAMETER_NAME( (dump_after_perturb_prefix, tag ) dump_after_perturb_prefix_) -BOOST_PARAMETER_NAME( (dump_after_exude_prefix, tag ) dump_after_exude_prefix_) -BOOST_PARAMETER_NAME( (number_of_initial_points, tag) number_of_initial_points_) -BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_) -BOOST_PARAMETER_NAME( (nonlinear_growth_of_balls, tag ) nonlinear_growth_of_balls_) -BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_) -BOOST_PARAMETER_NAME( (pointer_to_stop_atomic_boolean, tag ) pointer_to_stop_atomic_boolean_) - -// First used in -BOOST_PARAMETER_NAME( (function, tag ) function_) -BOOST_PARAMETER_NAME( (bounding_object, tag ) bounding_object_) -BOOST_PARAMETER_NAME( (relative_error_bound, tag ) relative_error_bound_) -BOOST_PARAMETER_NAME( (weights, tag) weights_) -BOOST_PARAMETER_NAME( (p_rng, tag ) p_rng_) -BOOST_PARAMETER_NAME( (null_subdomain_index, tag ) null_subdomain_index_) -BOOST_PARAMETER_NAME( (construct_surface_patch_index, tag ) construct_surface_patch_index_) - -// First used in -BOOST_PARAMETER_NAME( (image, tag ) image_) -BOOST_PARAMETER_NAME( (iso_value, tag) iso_value_) -BOOST_PARAMETER_NAME( (value_outside, tag) value_outside_) -BOOST_PARAMETER_NAME( (image_values_to_subdomain_indices, tag ) image_values_to_subdomain_indices_) - -CGAL_PRAGMA_DIAG_POP -} // parameters -} // CGAL - - -#endif // CGAL_BOOST_PARAMETER_H From dfc24f98d8eb1b5a05eba0f86a2864939fee81e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Sep 2022 09:49:28 +0200 Subject: [PATCH 050/248] move header before documenting it --- Mesh_3/include/CGAL/Mesh_3/{internal => }/parameters.h | 0 Mesh_3/include/CGAL/refine_mesh_3.h | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Mesh_3/include/CGAL/Mesh_3/{internal => }/parameters.h (100%) diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h similarity index 100% rename from Mesh_3/include/CGAL/Mesh_3/internal/parameters.h rename to Mesh_3/include/CGAL/Mesh_3/parameters.h diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index f7321aaa6c4..9347a3f02c5 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -277,7 +277,7 @@ inline internal::Mesh_3_options mesh_3_dump() CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) } // end namespace parameters -#include +#include /*! \ingroup PkgMesh3Functions From e085a47b19fb03f425c97f380eb0b24bb1ad2f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Sep 2022 12:49:13 +0200 Subject: [PATCH 051/248] fix doc warnings/errors in Mesh_3 --- .../doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h | 321 ------------------ .../{refine_mesh_3.h => Mesh_3/parameters.h} | 30 +- Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h | 161 --------- Mesh_3/doc/Mesh_3/Doxyfile.in | 2 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 117 +++++-- Mesh_3/include/CGAL/Mesh_3/parameters.h | 18 +- Mesh_3/include/CGAL/Mesh_criteria_3.h | 143 ++++++-- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 6 +- Mesh_3/include/CGAL/refine_mesh_3.h | 6 +- 10 files changed, 227 insertions(+), 579 deletions(-) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h rename Mesh_3/doc/Mesh_3/CGAL/{refine_mesh_3.h => Mesh_3/parameters.h} (92%) delete mode 100644 Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h deleted file mode 100644 index c5e547f7f6b..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h +++ /dev/null @@ -1,321 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -\brief The class `Labeled_mesh_domain_3` implements indexed domains. - -This class is a model of concept `MeshDomain_3`. - -Any boundary facet is labeled , with a, where b!=0. - -This class includes a labeling function that provides the index of the subdomain in which any -query point lies. An intersection between a segment and bounding -surfaces is detected when both segment endpoints are associated with different -values of subdomain indices. The intersection is then constructed by bisection. -The bisection stops when the query segment is shorter than an error bound -`e` given by the product of the -length of the diagonal of the bounding box (in world coordinates), or the radius of the bounding sphere, and -a relative error bound passed as argument to the constructor of `Labeled_mesh_domain_3`. - -This class has a constructor taking a labeling function. It has also three -static template member functions that act as named constructors: -
    -
  • `create_gray_image_mesh_domain()`, to create a domain from a 3D gray image, -
  • `create_labeled_image_mesh_domain()`, to create a domain from a 3D labeled image, and -
  • `create_implicit_mesh_domain()`, to create a domain from an implicit function. -
- -\tparam BGT is a geometric traits class that provides -the basic operations to implement -intersection tests and intersection computations -through a bisection method. This parameter must be instantiated -with a model of the concept `BisectionGeometricTraits_3`. - -\cgalHeading{Labeling function} - -A labeling function `f` must return `0` if the point isn't located in any subdomain. The return type of labeling functions is an integer. - -Let `p` be a Point. -
    -
  • `f(p)=0` means that `p` is outside domain.
  • -
  • `f(p)=a`, `a!=0` means that `p` is inside subdomain `a`.
  • -
-`CGAL::Implicit_multi_domain_to_labeling_function_wrapper` is a good candidate for this template parameter -if there are several components to mesh. - -The function type can be any model of the concept `Callable` compatible with the signature `Subdomain_index(const Point_3&)`: it can be a function, a function object, a lambda expression... that takes a `%Point_3` as argument, and returns a type convertible to `Subdomain_index`. - -\cgalModels MeshDomain_3 - -\sa `Implicit_multi_domain_to_labeling_function_wrapper` -\sa `CGAL::make_mesh_3()`. - -*/ -template -class Labeled_mesh_domain_3 -{ -public: - -/// \name Types -///@{ - -/// The subdomain index of this model of `MeshDomain_3`. -typedef int Subdomain_index; - -/// The type of object that stores the function using type-erasure -typedef std::function Labeling_function; - -///@} -/// \name Types imported from the geometric traits class -///@{ - -/// The point type of the geometric traits class -typedef typename Geom_traits::Point_3 Point_3; -/// The sphere type of the geometric traits class -typedef typename Geom_traits::Sphere_3 Sphere_3; -/// The iso-cuboid type of the geometric traits class -typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; -/// The number type (a field type) of the geometric traits class -typedef typename Geom_traits::FT FT; -///@} - -/// \name Creation -/// @{ -/*! \brief Construction from a function, a bounding -object and a relative error bound. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -- `parameters::function` (mandatory) the labeling function, compatible with `Labeling_function`. -- `parameters::bounding_object` (mandatory) the bounding object is either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), or a bounding `Iso_cuboid_3`. It bounds the meshable space. -- `parameters::relative_error_bound` (optional) the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diameter of the bounding object. Its default value is `FT(1e-3)`. - -\cgalHeading{Example} -From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): -\snippet Mesh_3/mesh_implicit_domains_2.cpp Domain creation - - */ -template -Labeled_mesh_domain_3(const A_i&...); - -///@} - -/// \name Creation of domains from implicit functions - -/*! -\brief Construction from an implicit function -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -This static method is a named constructor. It constructs a domain -whose bounding surface is described implicitly as the zero level set of a -function. The domain to be discretized is assumed to be the domain where -the function has negative values. - -The method takes as argument a bounding sphere which is required to -circumscribe the surface and to have its center inside the domain. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -
    -
  • `parameters::function` (mandatory) the implicit function, -compatible with the signature `FT(Point_3)`: it takes a point as argument, -and returns a scalar value. That object must be model of `CopyConstructible`. -
  • `parameters::bounding_object` (mandatory) the bounding object is -either a bounding sphere (of type `Sphere_3`), a bounding box (type -`Bbox_3`), or a bounding `Iso_cuboid_3`. It must bounds the surface, and -its center must be inside the domain. -
- -\cgalHeading{Examples} - -From the example (\ref Mesh_3/mesh_implicit_sphere.cpp), where the name of -the parameters is not specified, as they are given is the same order as the -parameters definition: - -\snippet Mesh_3/mesh_implicit_sphere.cpp Domain creation - -From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): - -\snippet Mesh_3/mesh_implicit_sphere_variable_size.cpp Domain creation - - */ -template -static -Labeled_mesh_domain_3 -create_implicit_mesh_domain(A_i&...); - -/// \name Creation of domains from 3D images - - -/*! -\brief Construction from a 3D gray image -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -This static method is a named constructor. It constructs a domain -described by a 3D gray image. A 3D gray image is a grid of voxels, -where each voxel is associated with a gray level value. Unless otherwise specified by the parameter `image_values_to_subdom_indices`, the domain to -be discretized is the union of voxels that lie inside a surface -described by an isolevel value, called \a isovalue. The voxels lying -inside the domain have gray level values that are larger than the -isovalue. - -The value of voxels is interpolated to a gray level value at any query point. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -The parameters are optional unless otherwise specified. -
    - -
  • `parameters::image` (mandatory) the input 3D image. Must -be a `CGAL::Image_3` object. - -
  • `parameters::iso_value` the isovalue, inside - `image`, of the surface describing the boundary of the object to be - meshed. Its default value is `0`. - -
  • `parameters::image_values_to_subdom_indices` a function or - a function object, compatible with the signature - `Subdomain_index(double)`. This function returns the subdomain index - corresponding to a pixel value. If this parameter is used, then the - parameter `iso_value` is ignored. - -
  • `parameter::value_outside` the value attached to voxels - outside of the domain to be meshed. It should be lower than - `iso_value`. Its default value is `0`. - -
  • `parameter::relative_error_bound` is the relative error - bound, relative to the diameter of the box of the image. Its default - value is `FT(1e-3)`.
- -\cgalHeading{Examples} - -From the example (\ref Mesh_3/mesh_3D_gray_image.cpp), where the name -of the parameters is not specified, as they are given is the same -order as the parameters definition: - -\snippet Mesh_3/mesh_3D_gray_image.cpp Domain creation - -From the example (\ref Mesh_3/mesh_3D_gray_vtk_image.cpp): - -\snippet Mesh_3/mesh_3D_gray_vtk_image.cpp Domain creation - - */ -template -static -Labeled_mesh_domain_3 -create_gray_image_mesh_domain(A_i&...); - -/*! -\brief Construction from a 3D labeled image -\deprecated This function is deprecated since \cgal 5.6, the overload using `NamedParameters` must be used instead. - -This static method is a named constructor. It constructs a -domain described by a 3D labeled image. A 3D labeled image is a grid -of voxels, where each voxel is associated with an index (a subdomain -index) characterizing the subdomain in which the voxel lies. The -domain to be discretized is the union of voxels that have non-zero -values. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -The parameters are optional unless otherwise specified. -
    - -
  • `parameters::image` (mandatory) the input 3D image. Must -be a `CGAL::Image_3` object. - -
  • `parameters::weights` an input 3D image that provides -weights associated to each voxel (the word type is `unsigned char`, -and the voxels values are integers between 0 and 255). -The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`. -Its dimensions must be the same as the dimensions of `parameters::image`. - -
  • `parameter::value_outside` the value attached to voxels - outside of the domain to be meshed. Its default value is `0`. - -
  • `parameter::relative_error_bound` is the relative error - bound, relative to the diameter of the box of the image. Its default - value is `FT(1e-3)`.
- -\cgalHeading{Example} - -From the example (\ref Mesh_3/mesh_3D_image.cpp): - -\snippet Mesh_3/mesh_3D_image.cpp Domain creation - -From the example (\ref Mesh_3/mesh_3D_weighted_image.cpp), -where the labeled image is used with a precomputed 3D image of weights : - -\snippet Mesh_3/mesh_3D_weighted_image.cpp Domain creation - - */ -template -static -Labeled_mesh_domain_3 -create_labeled_image_mesh_domain(A_i&...); - -/// \name Deprecated constructors -/// -/// Those three constructors have been deprecated since CGAL-4.13, and -/// replaced by the constructor using the Boost Parameter Library. -/// -/// @{ - -/*! -\brief Construction from a labeling function, a bounding Sphere and a relative error bound. -\param f the labeling function. -\param bounding_sphere the bounding sphere of the meshable space. -\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the radius of -`bounding_sphere`. -\deprecated This constructor is deprecated since CGAL-4.13, and -replaced by the constructor using the Boost Parameter Library. -*/ -Labeled_mesh_domain_3(Labeling_function f, - const Sphere_3& bounding_sphere, - const FT& relative_error_bound = FT(1e-3)); - -/*! -\brief Construction from a labeling function, a bounding box and a relative error bound. -\param f the labeling function. -\param bbox the bounding box of the meshable space. -\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diagonal of -`bounding_box`. -\deprecated This constructor is deprecated since CGAL-4.13, and -replaced by the constructor using the Boost Parameter Library. -*/ -Labeled_mesh_domain_3(Labeling_function f, - const Bbox_3& bbox, - const FT& relative_error_bound = FT(1e-3)); - -/*! -\brief Construction from a function, a bounding Iso_cuboid_3 and a relative error bound. -\param f the function. -\param bbox the bounding box of the meshable space. -\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diagonal of -`bounding_box`. -\deprecated This constructor is deprecated since CGAL-4.13, and -replaced by the constructor using the Boost Parameter Library. -*/ -Labeled_mesh_domain_3(Labeling_function f, - const Iso_cuboid_3& bbox, - const FT& relative_error_bound = FT(1e-3)); - -/// @} - -}; /* end Labeled_mesh_domain_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h similarity index 92% rename from Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h rename to Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h index 73c6ba18270..391455094c1 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -20,7 +20,7 @@ namespace parameters { \sa `CGAL::parameters::manifold_with_boundary()` \sa `CGAL::parameters::non_manifold()` */ - parameters::internal::Manifold_options manifold(); + unspecified_type manifold(); /*! \ingroup PkgMesh3Parameters @@ -35,7 +35,7 @@ namespace parameters { \sa `CGAL::parameters::manifold_with_boundary()` \sa `CGAL::parameters::manifold()` */ - parameters::internal::Manifold_options non_manifold(); + unspecified_type non_manifold(); /*! \ingroup PkgMesh3Parameters @@ -55,7 +55,7 @@ namespace parameters { \sa `CGAL::parameters::non_manifold()` \sa `CGAL::parameters::manifold()` */ - parameters::internal::Manifold_options manifold_with_boundary(); + unspecified_type manifold_with_boundary(); /*! \ingroup PkgMesh3Parameters @@ -91,15 +91,15 @@ refine_mesh_3(c3t3, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Exude_options exude( +unspecified_type exude( double parameters::time_limit = 0, double parameters::sliver_bound = 0); /*! \ingroup PkgMesh3Parameters -The function `parameters::features()` provides a value of internal type `Features` -to specify if 0 and 1-dimensional features have to be taken into account. +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 of `MeshDomainWithFeatures_3`. @@ -113,7 +113,7 @@ if domain is a model of the refined concept `MeshDomainWithFeatures_3`. \sa `CGAL::parameters::no_features()` */ -parameters::internal::Features_options features(); +unspecified_type features(); /*! \ingroup PkgMesh3Parameters @@ -151,7 +151,7 @@ refine_mesh_3(c3t3, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Lloyd_options lloyd( +unspecified_type lloyd( double parameters::time_limit = 0, std::size_t parameters::max_iteration_number = 0, double parameters::convergence = 0.02, @@ -179,7 +179,7 @@ C3t3 c3t3 = make_mesh_3(domain, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Exude_options no_exude(); +unspecified_type no_exude(); /*! \ingroup PkgMesh3Parameters @@ -199,7 +199,7 @@ to take into account 0 and 1-dimensional input features. \sa `CGAL::parameters::features()` */ -parameters::internal::Features_options no_features(); +unspecified_type no_features(); /*! \ingroup PkgMesh3Parameters @@ -222,7 +222,7 @@ C3t3 c3t3 = make_mesh_3(domain, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Lloyd_options no_lloyd(); +unspecified_type no_lloyd(); /*! \ingroup PkgMesh3Parameters @@ -245,7 +245,7 @@ C3t3 c3t3 = make_mesh_3(domain, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Odt_options no_odt(); +unspecified_type no_odt(); /*! \ingroup PkgMesh3Parameters @@ -268,7 +268,7 @@ C3t3 c3t3 = make_mesh_3(domain, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Perturb_options no_perturb(); +unspecified_type no_perturb(); /*! \ingroup PkgMesh3Parameters @@ -305,7 +305,7 @@ refine_mesh_3(c3t3, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Odt_options odt( +unspecified_type odt( double parameters::time_limit = 0, std::size_t parameters::max_iteration_number = 0, double parameters::convergence = 0.02, @@ -348,7 +348,7 @@ refine_mesh_3(c3t3, \sa `CGAL::refine_mesh_3()` */ -parameters::internal::Perturb_options perturb( +unspecified_type perturb( double parameters::time_limit = 0, double parameters::sliver_bound = 0); diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h deleted file mode 100644 index f6511eda70b..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h +++ /dev/null @@ -1,161 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_criteria_3` is a model of both concepts `MeshCriteria_3` -and `MeshCriteriaWithFeatures_3`. -It gathers the refinement criteria for mesh tetrahedra and -surface facets where -surface facets are facets in the mesh approximating the domain surface patches. -In addition, for domain with exposed 1-dimensional features, -the class `Mesh_criteria_3` -handles the definition of a sizing field to guide the discretization of -1-dimensional features. - -\tparam Tr has to be instantiated with the type used for -`C3T3::Triangulation`, -where `C3T3` is the model of `MeshComplex_3InTriangulation_3` -used in the mesh generation process, -and `C3T3::Triangulation` its nested triangulation type. - -\cgalModels `MeshCriteria_3` - -\cgalHeading{Example} - -\code{.cpp} - -// Create a Mesh_criteria_3 object with all cell and facet parameters set -Mesh_criteria_3 criteria (parameters::facet_angle=30, - parameters::facet_size=1, - parameters::facet_distance=0.1, - parameters::cell_radius_edge_ratio=2, - parameters::cell_size=1.5); - -// Create a Mesh_criteria_3 object with size ignored (note that the order changed) -Mesh_criteria_3 criteria (parameters::cell_radius_edge_ratio=2, - parameters::facet_angle=30, - parameters::facet_distance=0.1); - -\endcode - -\sa `MeshCriteria_3` -\sa `MeshCriteriaWithFeatures_3` -\sa `MeshCellCriteria_3` -\sa `MeshEdgeCriteria_3` -\sa `MeshFacetCriteria_3` -\sa `MeshDomainField_3` -\sa `CGAL::Mesh_cell_criteria_3` -\sa `CGAL::Mesh_edge_criteria_3` -\sa `CGAL::Mesh_facet_criteria_3` -\sa `CGAL::Mesh_facet_topology` - -*/ -template< typename Tr > -class Mesh_criteria_3 -{ -public: - -/// \name Types -/// @{ - -/*! -The criteria for edges. -*/ -typedef Mesh_edge_criteria_3 Edge_criteria; - -/*! -The criteria for facets. -*/ -typedef Mesh_facet_criteria_3 Facet_criteria; - -/*! -The -criteria for cells. -*/ -typedef Mesh_cell_criteria_3 Cell_criteria; - -/// @} - -/// \name Creation -/// @{ - -/*! -Construction from facet and cell criteria. The edge criteria are ignored -in this case. -*/ -Mesh_criteria_3(const Facet_criteria& facet_criteria, - const Cell_criteria& cell_criteria); - -/*! -Construction from edge, facet and cell criteria. -*/ -Mesh_criteria_3(const Edge_criteria& edge_criteria, - const Facet_criteria& facet_criteria, - const Cell_criteria& cell_criteria); - -/*! -\brief Construction from criteria parameters. This constructor uses named -parameters (from Boost.Parameter) for convenient criteria -construction. - -\tparam FT must be a model of `Field` -\tparam Fieldi (`i`=1,..,4) should be either a model -of the concept `Field` or a model of the concept `MeshDomainField_3` - -The parameters are named parameters and can be passed in any order -provided their name is given (see example below). The name of each -parameter is the one that is written in the description of the -function (e.g. `parameters::facet_size`). - -The description of each parameter is as follows: - -- `edge_size`: a scalar field (resp. a constant) providing a space varying -(resp. a uniform) -upper bound for the lengths of curve edges. This parameter has to be set to a positive -value when 1-dimensional features protection is used. - -- `facet_angle`: a lower bound for the angles (in degrees) of the -surface mesh facets. - -- `facet_size`: a scalar field (resp. a constant) describing -a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls. - -- `facet_distance`: a scalar field (resp. a constant) describing a space varying (resp. a uniform) -upper bound for the distance between the facet circumcenter and the center of its surface -Delaunay ball. - -- `facet_topology`: the set of topological constraints -which have to be verified by each surface facet. The default value is -`CGAL::FACET_VERTICES_ON_SURFACE`. See `Mesh_facet_topology` manual page to -get all possible values. - -- `cell_radius_edge_ratio`: an upper bound for the radius-edge ratio of the mesh tetrahedra. - -- `cell_size`: a scalar field (resp. a constant) describing -a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra. - -Note that each size or distance parameter can be specified using two ways: either as -a scalar field or as a numerical value when the field is uniform. - -Each parameter has a special default value `ignored` which means that the -corresponding criterion will be ignored. -Numerical sizing or distance values, as well as scalar fields -should be given in the unit used for coordinates of points in the mesh domain class -of the mesh generation process. - -*/ -template -Mesh_criteria_3(Field1 parameters::edge_size = ignored, - FT parameters::facet_angle = ignored, - Field2 parameters::facet_size = ignored, - Field3 parameters::facet_distance = ignored, - Mesh_facet_topology parameters::facet_topology = CGAL::FACET_VERTICES_ON_SURFACE, - FT parameters::cell_radius_edge_ratio = ignored, - Field4 parameters::cell_size = ignored); - -/// @} - -}; /* end Mesh_criteria_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 759b92514da..1cc04ed4dbe 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -14,7 +14,7 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_mesh_domain_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_criteria_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_criteria_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_facet_topology.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_vertex_base_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_cell_base_3.h \ diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 20f622733c0..8e9b13fb37f 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -217,18 +217,60 @@ protected: FT squared_error_bound_; }; // Labeled_mesh_domain_3_impl_details -/** - * \class Labeled_mesh_domain_3 - * - * Function f must take his values into N. - * Let p be a Point. - * - f(p)=0 means that p is outside domain. - * - f(p)=a, a!=0 means that p is inside subdomain a. - * - * Any boundary facet is labelled , with a, where b!=0. - */ +/*! +\ingroup PkgMesh3Domains + +\brief The class `Labeled_mesh_domain_3` implements indexed domains. + +This class is a model of concept `MeshDomain_3`. + +Any boundary facet is labeled , with a, where b!=0. + +This class includes a labeling function that provides the index of the subdomain in which any +query point lies. An intersection between a segment and bounding +surfaces is detected when both segment endpoints are associated with different +values of subdomain indices. The intersection is then constructed by bisection. +The bisection stops when the query segment is shorter than an error bound +`e` given by the product of the +length of the diagonal of the bounding box (in world coordinates), or the radius of the bounding sphere, and +a relative error bound passed as argument to the constructor of `Labeled_mesh_domain_3`. + +This class has a constructor taking a labeling function. It has also three +static template member functions that act as named constructors: +
    +
  • `create_gray_image_mesh_domain()`, to create a domain from a 3D gray image, +
  • `create_labeled_image_mesh_domain()`, to create a domain from a 3D labeled image, and +
  • `create_implicit_mesh_domain()`, to create a domain from an implicit function. +
+ +\tparam BGT is a geometric traits class that provides +the basic operations to implement +intersection tests and intersection computations +through a bisection method. This parameter must be instantiated +with a model of the concept `BisectionGeometricTraits_3`. + +\cgalHeading{Labeling function} + +A labeling function `f` must return `0` if the point isn't located in any subdomain. The return type of labeling functions is an integer. + +Let `p` be a Point. +
    +
  • `f(p)=0` means that `p` is outside domain.
  • +
  • `f(p)=a`, `a!=0` means that `p` is inside subdomain `a`.
  • +
+`CGAL::Implicit_multi_domain_to_labeling_function_wrapper` is a good candidate for this template parameter +if there are several components to mesh. + +The function type can be any model of the concept `Callable` compatible with the signature `Subdomain_index(const Point_3&)`: it can be a function, a function object, a lambda expression... that takes a `%Point_3` as argument, and returns a type convertible to `Subdomain_index`. + +\cgalModels MeshDomain_3 + +\sa `Implicit_multi_domain_to_labeling_function_wrapper` +\sa `CGAL::make_mesh_3()`. + +*/ templateBoost Parameter +Library). They can be specified in any order. + +\cgalHeading{Named Parameters} +- `parameters::function` (mandatory) the labeling function, compatible with `Labeling_function`. +- `parameters::bounding_object` (mandatory) the bounding object is either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), or a bounding `Iso_cuboid_3`. It bounds the meshable space. +- `parameters::relative_error_bound` (optional) the relative error bound used to compute intersection points between the implicit surface and query segments. The +bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diameter of the bounding object. Its default value is `FT(1e-3)`. + +\cgalHeading{Example} +From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): +\snippet Mesh_3/mesh_implicit_domains_2.cpp Domain creation + + */ template Labeled_mesh_domain_3(const CGAL_NP_CLASS& np = parameters::default_values()) :Impl_details(parameters::get_parameter(np, internal_np::function_param), @@ -308,7 +369,9 @@ public: { } - /** +///@} + + /* * Backward-compatibility constructors, with `null_subdomain_index` as * fourth parameter. * @{ @@ -342,7 +405,7 @@ public: construct_pair_functor(), null, p_rng) {} - /** + /* * @} */ @@ -364,7 +427,7 @@ public: This constructor uses named parameters . They can be specified in any order. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - \param image the input 3D image. Must be a `CGAL::Image_3` object. + \param image_ the input 3D image. Must be a `CGAL::Image_3` object. \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: @@ -493,7 +556,7 @@ public: This constructor uses named parameters . They can be specified in any order. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - \param image the input 3D image. Must be a `CGAL::Image_3` object. + \param image_ the input 3D image. Must be a `CGAL::Image_3` object. \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: @@ -720,9 +783,9 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): /// @} /** - * Constructs a set of \ccc{n} points on the surface, and output them to - * the output iterator \ccc{pts} whose value type is required to be - * \ccc{std::pair}. + * Constructs a set of `n` points on the surface, and output them to + * the output iterator `pts` whose value type is required to be + * `std::pair`. */ struct Construct_initial_points { @@ -750,7 +813,7 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): } /** - * Returns true if point~\ccc{p} is in the domain. If \ccc{p} is in the + * Returns true if point~`p` is in the domain. If `p` is in the * domain, the parameter index is set to the index of the subdomain * including $p$. It is set to the default value otherwise. */ @@ -775,12 +838,12 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): Is_in_domain is_in_domain_object() const { return Is_in_domain(*this); } /** - * Returns true is the element \ccc{type} intersect properly any of the + * Returns true is the element `type` intersect properly any of the * surface patches describing the either the domain boundary or some * subdomain boundary. - * \ccc{Type} is either \ccc{Segment_3}, \ccc{Ray_3} or \ccc{Line_3}. + * `Type is either `Segment_3`, `Ray_3` or `Line_3`. * Parameter index is set to the index of the intersected surface patch - * if \ccc{true} is returned and to the default \ccc{Surface_patch_index} + * if `true` is returned and to the default `Surface_patch_index` * value otherwise. */ struct Do_intersect_surface @@ -849,12 +912,12 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): } /** - * Returns a point in the intersection of the primitive \ccc{type} + * Returns a point in the intersection of the primitive `type` * with some boundary surface. - * \ccc{Type1} is either \ccc{Segment_3}, \ccc{Ray_3} or \ccc{Line_3}. - * The integer \ccc{dimension} is set to the dimension of the lowest + * `Type1` is either `Segment_3`, `Ray_3` or `Line_3`. + * The integer `dimension` is set to the dimension of the lowest * dimensional face in the input complex containing the returned point, and - * \ccc{index} is set to the index to be stored at a mesh vertex lying + * `index` is set to the index to be stored at a mesh vertex lying * on this face. */ struct Construct_intersection diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 29aded71b4e..745666f470c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -7,21 +7,17 @@ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // -// -// -// -//****************************************************************************** -// File Description : Named Function Parameters specific code -//****************************************************************************** -#ifndef CGAL_PARAMETERS_H -#define CGAL_PARAMETERS_H + +#ifndef CGAL_MESH_3_PARAMETERS_H +#define CGAL_MESH_3_PARAMETERS_H #include #include #include #include -namespace parameters{ +namespace CGAL { +namespace parameters { // ----------------------------------- // Perturb @@ -241,6 +237,6 @@ Named_function_parameters m } -} //namespace parameters +} } //namespace CGAL::parameters -#endif //CGAL_PARAMETERS_H \ No newline at end of file +#endif //CGAL_MESH_3_PARAMETERS_H \ No newline at end of file diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 8c4ed59c305..4778361f245 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -125,8 +125,58 @@ private: -// Class Mesh_criteria_3 -// Provides default mesh criteria to drive Mesh_3 process + +/*! +\ingroup PkgMesh3MeshClasses + +The class `Mesh_criteria_3` is a model of both concepts `MeshCriteria_3` +and `MeshCriteriaWithFeatures_3`. +It gathers the refinement criteria for mesh tetrahedra and +surface facets where +surface facets are facets in the mesh approximating the domain surface patches. +In addition, for domain with exposed 1-dimensional features, +the class `Mesh_criteria_3` +handles the definition of a sizing field to guide the discretization of +1-dimensional features. + +\tparam Tr has to be instantiated with the type used for +`C3T3::Triangulation`, +where `C3T3` is the model of `MeshComplex_3InTriangulation_3` +used in the mesh generation process, +and `C3T3::Triangulation` its nested triangulation type. + +\cgalModels `MeshCriteria_3` + +\cgalHeading{Example} + +\code{.cpp} + +// Create a Mesh_criteria_3 object with all cell and facet parameters set +Mesh_criteria_3 criteria (parameters::facet_angle=30, + parameters::facet_size=1, + parameters::facet_distance=0.1, + parameters::cell_radius_edge_ratio=2, + parameters::cell_size=1.5); + +// Create a Mesh_criteria_3 object with size ignored (note that the order changed) +Mesh_criteria_3 criteria (parameters::cell_radius_edge_ratio=2, + parameters::facet_angle=30, + parameters::facet_distance=0.1); + +\endcode + +\sa `MeshCriteria_3` +\sa `MeshCriteriaWithFeatures_3` +\sa `MeshCellCriteria_3` +\sa `MeshEdgeCriteria_3` +\sa `MeshFacetCriteria_3` +\sa `MeshDomainField_3` +\sa `CGAL::Mesh_cell_criteria_3` +\sa `CGAL::Mesh_edge_criteria_3` +\sa `CGAL::Mesh_facet_criteria_3` +\sa `CGAL::Mesh_facet_topology` + +*/ template , typename FacetCriteria = Mesh_facet_criteria_3, @@ -143,9 +193,32 @@ class Mesh_criteria_3 CellCriteria> Base; public: +#ifdef DOXYGEN_RUNNING +/// \name Types +/// @{ + +/*! +The criteria for edges. +*/ +typedef Mesh_edge_criteria_3 Edge_criteria; + +/*! +The criteria for facets. +*/ +typedef Mesh_facet_criteria_3 Facet_criteria; + +/*! +The +criteria for cells. +*/ +typedef Mesh_cell_criteria_3 Cell_criteria; + +/// @} +#else typedef typename Base::Edge_criteria Edge_criteria; typedef typename Base::Facet_criteria Facet_criteria; typedef typename Base::Cell_criteria Cell_criteria; +#endif // Constructor Mesh_criteria_3(Facet_criteria facet_criteria, @@ -161,51 +234,47 @@ public: facet_criteria, cell_criteria) {} /*! - \brief Construction from criteria parameters. - This constructor uses named - parameters (from Boost.Parameter) for convenient criteria - construction. + \brief Construction from criteria parameters. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - \cgalNamedParamsBegin - \cgalParamNBegin{edge_size} - \cgalParamDescription{a scalar field (resp. a constant) providing a space varying - (resp. a uniform) - upper bound for the lengths of curve edges. This parameter has to be set to a positive - value when 1-dimensional features protection is used.} + \cgalNamedParamsBegin + \cgalParamNBegin{edge_size} + \cgalParamDescription{a scalar field (resp. a constant) providing a space varying + (resp. a uniform) + upper bound for the lengths of curve edges. This parameter has to be set to a positive + value when 1-dimensional features protection is used.} - \cgalParamNBegin{facet_angle} - \cgalParamDescription{a lower bound for the angles (in degrees) of the - surface mesh facets.} + \cgalParamNBegin{facet_angle} + \cgalParamDescription{a lower bound for the angles (in degrees) of the + surface mesh facets.} - \cgalParamNBegin{facet_size} - \cgalParamDescription{ a scalar field (resp. a constant) describing - a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls.} + \cgalParamNBegin{facet_size} + \cgalParamDescription{ a scalar field (resp. a constant) describing + a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls.} - \cgalParamNBegin{facet_distance} - \cgalParamDescription{ a scalar field (resp. a constant) describing a space varying (resp. a uniform) - upper bound for the distance between the facet circumcenter and the center of its surface - Delaunay ball.} - \cgalParamNBegin{facet_topology} - \cgalParamDescription{ the set of topological constraints - which have to be verified by each surface facet. See `Mesh_facet_topology` manual page to - get all possible values.} - \cgalParamDefault{CGAL::FACET_VERTICES_ON_SURFACE} + \cgalParamNBegin{facet_distance} + \cgalParamDescription{ a scalar field (resp. a constant) describing a space varying (resp. a uniform) + upper bound for the distance between the facet circumcenter and the center of its surface + Delaunay ball.} + \cgalParamNBegin{facet_topology} + \cgalParamDescription{ the set of topological constraints + which have to be verified by each surface facet. See `Mesh_facet_topology` manual page to + get all possible values.} + \cgalParamDefault{CGAL::FACET_VERTICES_ON_SURFACE} - \cgalParamNBegin{cell_radius_edge_ratio} - \cgalParamDescription{ an upper bound for the radius-edge ratio of the mesh tetrahedra.} + \cgalParamNBegin{cell_radius_edge_ratio} + \cgalParamDescription{ an upper bound for the radius-edge ratio of the mesh tetrahedra.} - \cgalParamNBegin{cell_size} - \cgalParamDescription{ a scalar field (resp. a constant) describing - a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra.} + \cgalParamNBegin{cell_size} + \cgalParamDescription{ a scalar field (resp. a constant) describing + a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra.} - \cgalNamedParamsEnd - */ - + \cgalNamedParamsEnd + */ template Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np) { diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index dcf5b3ad5b7..e0e9dfdcf13 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -66,7 +66,7 @@ object used to create the `c3t3` parameter. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" -@param cdt the initial mesh that will be modified by the algorithm to represent the final optimized mesh. +@param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. @param domain the domain to be discretized @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 522101ba0a3..c083b325ba4 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -425,11 +425,9 @@ of 1-dimensional exposed features. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - @param c3t3 the mesh to be refined. @param domain the domain to be discretized @param criteria the criteria - - The following are optional named parameters. + @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin \cgalParamNBegin{features_options} @@ -495,7 +493,7 @@ of 1-dimensional exposed features. \cgalNamedParamsEnd - The optimization parameters can be passed in an arbitrary order. If one parameter +The optimization parameters can be passed in an arbitrary order. If one parameter is not passed, its default value is used. The default values are `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 9347a3f02c5..95be2940420 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -277,7 +277,7 @@ inline internal::Mesh_3_options mesh_3_dump() CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) } // end namespace parameters -#include + /*! \ingroup PkgMesh3Functions @@ -357,6 +357,7 @@ of 1-dimensional exposed features. \param c3t3 the mesh to be refined. \param domain the domain to be discretized \param criteria the criteria +\param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. The following four parameters are optional optimization parameters. They control which optimization processes are performed @@ -601,4 +602,7 @@ void refine_mesh_3_impl(C3T3& c3t3, } #endif // DOXYGEN_RUNNING } // end namespace CGAL + +#include + #endif // CGAL_REFINE_MESH_3_H From 788bd7144f7600948749052c25728655476d7bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Sep 2022 12:51:51 +0200 Subject: [PATCH 052/248] fix doc warnings in P3M3 --- Mesh_2/doc/Mesh_2/dependencies | 1 + Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h | 5 ++--- Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Mesh_2/doc/Mesh_2/dependencies b/Mesh_2/doc/Mesh_2/dependencies index 696bf34e1fb..5ef261da50f 100644 --- a/Mesh_2/doc/Mesh_2/dependencies +++ b/Mesh_2/doc/Mesh_2/dependencies @@ -4,4 +4,5 @@ STL_Extension Algebraic_foundations Circulator Stream_support +BGL Triangulation_2 diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 3f9175ca598..cd0fd70a1a6 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -221,11 +221,10 @@ of 1-dimensional exposed features. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" -\param c3t3 the mesh to be refined. + \param domain the domain to be discretized \param criteria the criteria - -The following are optional named parameters. +\param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: \cgalNamedParamsBegin \cgalParamNBegin{features_options} 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 c55ca44df5f..f27e56761ee 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 @@ -208,9 +208,10 @@ In addition, if the domain has features, the argument `criteria` provides a sizing field to guide the discretization of 1-dimensional exposed features. - \param c3t3 the mesh to be refined. +\param c3t3 the mesh to be refined. \param domain the domain to be discretized \param criteria the criteria +\param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: The following four parameters are optional optimization parameters. They control which optimization processes are performed From 793f446e19ccbe9af64aaa0a070b67197c98dcfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Sep 2022 13:11:32 +0200 Subject: [PATCH 053/248] whitespace --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 391455094c1..cb4f081ba67 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -98,7 +98,7 @@ unspecified_type exude( /*! \ingroup PkgMesh3Parameters -The function `parameters::features()` can be used to specify +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 From 953b01db1f2e9f5b9b970b2fffc86767e5691179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 15 Sep 2022 15:10:12 +0200 Subject: [PATCH 054/248] regroup code for named parameters --- Mesh_3/include/CGAL/Mesh_3/parameters.h | 177 +++++++++++++++++++++++ Mesh_3/include/CGAL/refine_mesh_3.h | 182 +----------------------- 2 files changed, 178 insertions(+), 181 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 745666f470c..ee512effc0c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -17,8 +17,185 @@ #include namespace CGAL { + namespace parameters { +namespace internal { + +const int undef_parameter = -1; + +// Helpers +struct Optimization_options_base +{ + Optimization_options_base(bool b) + : b_(b), time_limit_(undef_parameter), bound_(undef_parameter) {} + + operator bool() const { return b_; } + + bool is_time_limit_set() const { return time_limit_ != undef_parameter; } + void set_time_limit(double d) { time_limit_ = d; } + double time_limit() const { return time_limit_; } + + bool is_bound_set() const { return bound_ != undef_parameter; } + void set_bound(double d) { bound_ = d; } + double bound() const { return bound_; } + +private: + bool b_; + double time_limit_; + double bound_; +}; + +struct Global_optimization_options_base +{ + Global_optimization_options_base() + : convergence_(undef_parameter), max_it_nb_(undef_parameter) {} + + bool is_convergence_set() const { return convergence_ != undef_parameter; } + void set_convergence(double d) { convergence_ = d; } + double convergence() const { return convergence_; } + + bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } + void set_max_iteration_number(int i) { max_it_nb_ = i; } + int max_iteration_number() const { return max_it_nb_; } + +private: + double convergence_; + int max_it_nb_; +}; + +// Perturb +struct Perturb_options : public Optimization_options_base +{ + Perturb_options(bool b) : Optimization_options_base(b) {} +}; + +// Exude +struct Exude_options : public Optimization_options_base +{ + Exude_options(bool b) : Optimization_options_base(b) {} +}; + +// Odt +struct Odt_options : public Optimization_options_base +, public Global_optimization_options_base +{ + Odt_options(bool b) : Optimization_options_base(b) + , Global_optimization_options_base() {} +}; + +// Lloyd +struct Lloyd_options : public Optimization_options_base +, public Global_optimization_options_base +{ + Lloyd_options(bool b) : Optimization_options_base(b) + , Global_optimization_options_base() {} +}; + +// Manifold +struct Manifold_options { + enum { + NON_MANIFOLD = 0, + MANIFOLD_WITH_BOUNDARY = 8, + NO_BOUNDARY = 16, + MANIFOLD = 24 + }; + + Manifold_options(const int topology) + : mesh_topology(topology) + {} + Manifold_options() + : mesh_topology(NON_MANIFOLD) + {} + + int mesh_topology; +}; + +// Various Mesh_3 option +struct Mesh_3_options { +#ifndef CGAL_NO_ATOMIC + typedef std::atomic* Pointer_to_stop_atomic_boolean_t; +#else + typedef bool* Pointer_to_stop_atomic_boolean_t; +#endif + Mesh_3_options(bool nonlinear = false) + // This parameter `nonlinear` adds a compatibility with previous + // API of the constructor of `C3t3_initializer`. + // -- Laurent Rineau, 2019/05/03 + : dump_after_init_prefix() + , dump_after_refine_surface_prefix() + , dump_after_refine_prefix() + , dump_after_glob_opt_prefix() + , dump_after_perturb_prefix() + , dump_after_exude_prefix() + , number_of_initial_points(-1) + , nonlinear_growth_of_balls(nonlinear) + , maximal_number_of_vertices(0) + , pointer_to_error_code(0) +#ifndef CGAL_NO_ATOMIC + , pointer_to_stop_atomic_boolean(0) +#endif + {} + + std::string dump_after_init_prefix; + std::string dump_after_refine_surface_prefix; + std::string dump_after_refine_prefix; + std::string dump_after_glob_opt_prefix; + std::string dump_after_perturb_prefix; + std::string dump_after_exude_prefix; + int number_of_initial_points; + bool nonlinear_growth_of_balls; + std::size_t maximal_number_of_vertices; + Mesh_error_code* pointer_to_error_code; +#ifndef CGAL_NO_ATOMIC + Pointer_to_stop_atomic_boolean_t pointer_to_stop_atomic_boolean; +#endif + +}; // end struct Mesh_3_options + +} // end namespace internal + +// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. +// Default Mesh_3_options: dump at every stage of the mesh generation. +inline internal::Mesh_3_options mesh_3_dump() +{ + internal::Mesh_3_options options; + + options.dump_after_init_prefix = "mesh_dump_after_init"; + options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; + options.dump_after_refine_prefix = "mesh_dump_after_refine"; + options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; + options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; + options.dump_after_exude_prefix = "mesh_dump_after_exude"; + + return options; +} + template + struct Base + { + Base(T t) : t_(t) {} + T operator()() const { return t_; } + private: + T t_; + }; + +// ----------------------------------- +// Reset_c3t3 (undocumented) +// ----------------------------------- + +#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ + struct Class : public Base { Class(bool b) : Base(b){} }; \ + inline Named_function_parameters function_true() { \ + typedef Named_function_parameters Param; \ + return Param(Class(true)); } \ + inline Named_function_parameters function_false() {\ + typedef Named_function_parameters Param; \ + return Param(Class(false)); } + + CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) + +#undef CGAL_BOOLEAN_PARAMETER + // ----------------------------------- // Perturb // ----------------------------------- diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 95be2940420..9ea8cdda8e2 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -28,20 +28,10 @@ #include #include #include - +#include #include -#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ - struct Class : public Base { Class(bool b) : Base(b){} }; \ - inline Named_function_parameters function_true() { \ - typedef Named_function_parameters Param; \ - return Param(Class(true)); } \ - inline Named_function_parameters function_false() {\ - typedef Named_function_parameters Param; \ - return Param(Class(false)); } - - namespace CGAL { namespace details { @@ -110,174 +100,6 @@ private: } // namespace details -namespace parameters { - -namespace internal { - -const int undef_parameter = -1; - -// Helpers -struct Optimization_options_base -{ - Optimization_options_base(bool b) - : b_(b), time_limit_(undef_parameter), bound_(undef_parameter) {} - - operator bool() const { return b_; } - - bool is_time_limit_set() const { return time_limit_ != undef_parameter; } - void set_time_limit(double d) { time_limit_ = d; } - double time_limit() const { return time_limit_; } - - bool is_bound_set() const { return bound_ != undef_parameter; } - void set_bound(double d) { bound_ = d; } - double bound() const { return bound_; } - -private: - bool b_; - double time_limit_; - double bound_; -}; - -struct Global_optimization_options_base -{ - Global_optimization_options_base() - : convergence_(undef_parameter), max_it_nb_(undef_parameter) {} - - bool is_convergence_set() const { return convergence_ != undef_parameter; } - void set_convergence(double d) { convergence_ = d; } - double convergence() const { return convergence_; } - - bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } - void set_max_iteration_number(int i) { max_it_nb_ = i; } - int max_iteration_number() const { return max_it_nb_; } - -private: - double convergence_; - int max_it_nb_; -}; - -// Perturb -struct Perturb_options : public Optimization_options_base -{ - Perturb_options(bool b) : Optimization_options_base(b) {} -}; - -// Exude -struct Exude_options : public Optimization_options_base -{ - Exude_options(bool b) : Optimization_options_base(b) {} -}; - -// Odt -struct Odt_options : public Optimization_options_base -, public Global_optimization_options_base -{ - Odt_options(bool b) : Optimization_options_base(b) - , Global_optimization_options_base() {} -}; - -// Lloyd -struct Lloyd_options : public Optimization_options_base -, public Global_optimization_options_base -{ - Lloyd_options(bool b) : Optimization_options_base(b) - , Global_optimization_options_base() {} -}; - -// Manifold -struct Manifold_options { - enum { - NON_MANIFOLD = 0, - MANIFOLD_WITH_BOUNDARY = 8, - NO_BOUNDARY = 16, - MANIFOLD = 24 - }; - - Manifold_options(const int topology) - : mesh_topology(topology) - {} - Manifold_options() - : mesh_topology(NON_MANIFOLD) - {} - - int mesh_topology; -}; - -// Various Mesh_3 option -struct Mesh_3_options { -#ifndef CGAL_NO_ATOMIC - typedef std::atomic* Pointer_to_stop_atomic_boolean_t; -#else - typedef bool* Pointer_to_stop_atomic_boolean_t; -#endif - Mesh_3_options(bool nonlinear = false) - // This parameter `nonlinear` adds a compatibility with previous - // API of the constructor of `C3t3_initializer`. - // -- Laurent Rineau, 2019/05/03 - : dump_after_init_prefix() - , dump_after_refine_surface_prefix() - , dump_after_refine_prefix() - , dump_after_glob_opt_prefix() - , dump_after_perturb_prefix() - , dump_after_exude_prefix() - , number_of_initial_points(-1) - , nonlinear_growth_of_balls(nonlinear) - , maximal_number_of_vertices(0) - , pointer_to_error_code(0) -#ifndef CGAL_NO_ATOMIC - , pointer_to_stop_atomic_boolean(0) -#endif - {} - - std::string dump_after_init_prefix; - std::string dump_after_refine_surface_prefix; - std::string dump_after_refine_prefix; - std::string dump_after_glob_opt_prefix; - std::string dump_after_perturb_prefix; - std::string dump_after_exude_prefix; - int number_of_initial_points; - bool nonlinear_growth_of_balls; - std::size_t maximal_number_of_vertices; - Mesh_error_code* pointer_to_error_code; -#ifndef CGAL_NO_ATOMIC - Pointer_to_stop_atomic_boolean_t pointer_to_stop_atomic_boolean; -#endif - -}; // end struct Mesh_3_options - -} // end namespace internal - -// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. -// Default Mesh_3_options: dump at every stage of the mesh generation. -inline internal::Mesh_3_options mesh_3_dump() -{ - internal::Mesh_3_options options; - - options.dump_after_init_prefix = "mesh_dump_after_init"; - options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; - options.dump_after_refine_prefix = "mesh_dump_after_refine"; - options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; - options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; - options.dump_after_exude_prefix = "mesh_dump_after_exude"; - - return options; -} - template - struct Base - { - Base(T t) : t_(t) {} - T operator()() const { return t_; } - private: - T t_; - }; - -// ----------------------------------- -// Reset_c3t3 (undocumented) -// ----------------------------------- - CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) - -} // end namespace parameters - /*! \ingroup PkgMesh3Functions @@ -603,6 +425,4 @@ void refine_mesh_3_impl(C3T3& c3t3, #endif // DOXYGEN_RUNNING } // end namespace CGAL -#include - #endif // CGAL_REFINE_MESH_3_H From 0e62685f39ce88500b601fb4d46d7fe1981da259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 16 Sep 2022 14:36:06 +0200 Subject: [PATCH 055/248] force images to be taken by reference --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 12 ++++-- Mesh_3/include/CGAL/Mesh_3/parameters.h | 2 - .../include/CGAL/Named_function_parameters.h | 39 ++++++++++++++++++- .../internal/parameters_interface.h | 4 +- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 8e9b13fb37f..2d430d2d5bc 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -506,8 +506,9 @@ From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): { static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); using parameters::get_parameter; + using parameters::get_parameter_reference; using parameters::choose_parameter; - const CGAL::Image_3& image_ = get_parameter(np,internal_np::image_3_param); + const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); @@ -597,6 +598,7 @@ where the labeled image is used with a precomputed 3D image of weights : static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::get_parameter; + using parameters::get_parameter_reference; using parameters::choose_parameter; auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); @@ -605,9 +607,10 @@ where the labeled image is used with a precomputed 3D image of weights : CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - CGAL::Image_3 weights_ = choose_parameter(get_parameter(np, internal_np::weights_param), CGAL::Image_3()); + const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); CGAL_USE(iso_value_); namespace p = CGAL::parameters; + if (weights_.is_valid()) { return Labeled_mesh_domain_3 @@ -645,8 +648,9 @@ where the labeled image is used with a precomputed 3D image of weights : { static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); using parameters::get_parameter; + using parameters::get_parameter_reference; using parameters::choose_parameter; - const CGAL::Image_3& image_ = get_parameter(np,internal_np::image_3_param); + const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); @@ -654,7 +658,7 @@ where the labeled image is used with a precomputed 3D image of weights : CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - CGAL::Image_3 weights_ = choose_parameter(get_parameter(np, internal_np::weights_param), CGAL::Image_3()); + const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); namespace p = CGAL::parameters; if (weights_.is_valid()) diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index ee512effc0c..5e6fd972523 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -12,9 +12,7 @@ #define CGAL_MESH_3_PARAMETERS_H #include -#include #include -#include namespace CGAL { diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index bb61f49afb3..2d5a83bc92c 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -48,10 +48,13 @@ enum all_default_t { all_default }; enum X { Y }; #define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ enum X { Y }; +#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ + enum X { Y }; #define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) #include #undef CGAL_add_named_parameter #undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility_ref_only #undef CGAL_add_extra_named_parameter_with_compatibility template @@ -271,6 +274,16 @@ struct Named_function_parameters typedef Named_function_parameters Params;\ return Params(k, *this); \ } +#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ + template \ + Named_function_parameters, \ + internal_np::X, self> \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters,\ + internal_np::X, self> Params; \ + return Params(std::cref(k), *this); \ + } #define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \ template \ Named_function_parameters \ @@ -282,6 +295,7 @@ struct Named_function_parameters #include #undef CGAL_add_named_parameter #undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility_ref_only #undef CGAL_add_extra_named_parameter_with_compatibility template @@ -325,7 +339,7 @@ inline no_parameters(Named_function_parameters) return Params(); } -template +template struct Boost_parameter_compatibility_wrapper { template @@ -345,6 +359,26 @@ struct Boost_parameter_compatibility_wrapper } }; +template +struct Boost_parameter_compatibility_wrapper +{ + template + Named_function_parameters, Tag> + operator()(const K& p) const + { + typedef Named_function_parameters, Tag> Params; + return Params(std::cref(p)); + } + + template + Named_function_parameters, Tag> + operator=(const K& p) const + { + typedef Named_function_parameters, Tag> Params; + return Params(std::cref(p)); + } +}; + // define free functions and Boost_parameter_compatibility_wrapper for named parameters #define CGAL_add_named_parameter(X, Y, Z) \ template \ @@ -357,12 +391,15 @@ struct Boost_parameter_compatibility_wrapper // TODO: need to make sure this works when using several compilation units #define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ const Boost_parameter_compatibility_wrapper Z; +#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ + const Boost_parameter_compatibility_wrapper Z; #define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \ const Boost_parameter_compatibility_wrapper Z; #include #undef CGAL_add_named_parameter #undef CGAL_add_extra_named_parameter_with_compatibility #undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility_ref_only // function to extract a parameter template diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index cf9ef27c66c..01b9cae28ad 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -302,7 +302,7 @@ CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_optio CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) -CGAL_add_named_parameter_with_compatibility(image_3_param_t, image_3_param, image) +CGAL_add_named_parameter_with_compatibility_ref_only(image_3_param_t, image_3_param, image) CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) CGAL_add_named_parameter_with_compatibility(image_subdomain_index_t, image_subdomain_index, image_values_to_subdomain_indices) CGAL_add_named_parameter_with_compatibility(voxel_value_t, voxel_value, value_outside) @@ -310,7 +310,7 @@ CGAL_add_named_parameter_with_compatibility(error_bound_t, error_bound, relative CGAL_add_named_parameter_with_compatibility(rng_t, rng, p_rng) CGAL_add_named_parameter_with_compatibility(null_subdomain_index_param_t,null_subdomain_index_param, null_subdomain_index) CGAL_add_named_parameter_with_compatibility(surface_patch_index_t, surface_patch_index, construct_surface_patch_index) -CGAL_add_named_parameter_with_compatibility(weights_param_t, weights_param, weights) +CGAL_add_named_parameter_with_compatibility_ref_only(weights_param_t, weights_param, weights) CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size) CGAL_add_named_parameter_with_compatibility(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field) From 950c6b75f36725f09a21090d72c75601e8edf47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 16 Sep 2022 14:50:30 +0200 Subject: [PATCH 056/248] remove last mention to boost ARITY --- Installation/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 28ee5079fdb..5f506634ba8 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1200,8 +1200,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" endif() endforeach() # loop on packages #Now check that a cpp file including all documented headers compiles - file(WRITE ${CGAL_BINARY_DIR}/test_headers.cpp - "#define BOOST_PARAMETER_MAX_ARITY 12 \n") foreach(header ${list_of_headers_to_test}) file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "#include <${header}>\n") endforeach() #loop on headers to include in test file From acf2a7ecdf1dbd91e63966e4f5a3e22cc20035d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 16 Sep 2022 16:54:58 +0200 Subject: [PATCH 057/248] try to present backward compatibility --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 2d430d2d5bc..9f539c7e912 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -542,7 +542,20 @@ From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } - + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, + double iso_value=0, + double value_outside=0, + double relative_error_bound = 1e-3, + CGAL::Random* rng = nullptr, + SubdomainIndex image_values_to_subdom_indices = SubdomainIndex()) + { + return create_gray_image_mesh_domain(image_, parameters::iso_value(iso_value) + .image_values_to_subdomain_indices(image_values_to_subdom_indices) + .value_outside(value_outside) + .relative_error_bound(relative_error_bound) + .p_rng(rng)); + } /*! * \brief Construction from a 3D labeled image From 4701aadf1d0fc78e53bdaa22974c2d8cfec7d334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 16 Sep 2022 17:00:26 +0200 Subject: [PATCH 058/248] add missing include directives for CI --- Mesh_3/include/CGAL/Mesh_3/parameters.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 5e6fd972523..507ee7d0f15 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -12,6 +12,8 @@ #define CGAL_MESH_3_PARAMETERS_H #include +#include +#include #include namespace CGAL { From c879db0bcd607b5b6dd2365a00e3160b6fcdf6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 06:29:15 +0200 Subject: [PATCH 059/248] add a way to disambiguate template overloads for named parameters --- STL_Extension/include/CGAL/Named_function_parameters.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 2d5a83bc92c..75db8c5ca11 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -311,6 +312,9 @@ struct Named_function_parameters { return Named_function_parameters(np.v,*this).combine(nps...); } + + // typedef for SFINAE + typedef int CGAL_Named_function_parameters_class; }; namespace parameters { @@ -522,4 +526,9 @@ namespace boost } #endif +// For disambiguation using SFINAR +BOOST_MPL_HAS_XXX_TRAIT_DEF(CGAL_Named_function_parameters_class) +template +CGAL_CPP17_INLINE constexpr bool is_named_function_parameter = has_CGAL_Named_function_parameters_class::value; + #endif // CGAL_BOOST_FUNCTION_PARAMS_HPP From 28c583ce178d843a99be9eb634eb7b26d4385713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 06:29:37 +0200 Subject: [PATCH 060/248] disambiguate and mark it as deprecated --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 9f539c7e912..0e5834f6b37 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -791,12 +791,17 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } +#ifndef CGAL_NO_DEPRECATED_CODE template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const Function& f, const Bounding_object& bo) + static + CGAL_DEPRECATED Labeled_mesh_domain_3 + create_implicit_mesh_domain(const Function& f, + const Bounding_object& bo, + std::enable_if_t>* = nullptr) { return create_implicit_mesh_domain(parameters::function(f).bounding_object(bo)); } - +#endif /// @} /** From 457877b21b6403ea398ab5d39bccd245dbfc61c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 06:31:43 +0200 Subject: [PATCH 061/248] mark the function as deprecated --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 0e5834f6b37..8cef38118db 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -542,13 +542,17 @@ From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } + +#ifndef CGAL_NO_DEPRECATED_CODE template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, - double iso_value=0, - double value_outside=0, - double relative_error_bound = 1e-3, - CGAL::Random* rng = nullptr, - SubdomainIndex image_values_to_subdom_indices = SubdomainIndex()) + CGAL_DEPRECATED + static Labeled_mesh_domain_3 + create_gray_image_mesh_domain(const CGAL::Image_3& image_, + double iso_value=0, + double value_outside=0, + double relative_error_bound = 1e-3, + CGAL::Random* rng = nullptr, + SubdomainIndex image_values_to_subdom_indices = SubdomainIndex()) { return create_gray_image_mesh_domain(image_, parameters::iso_value(iso_value) .image_values_to_subdomain_indices(image_values_to_subdom_indices) @@ -556,6 +560,7 @@ From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): .relative_error_bound(relative_error_bound) .p_rng(rng)); } +#endif /*! * \brief Construction from a 3D labeled image @@ -793,8 +798,8 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): #ifndef CGAL_NO_DEPRECATED_CODE template - static - CGAL_DEPRECATED Labeled_mesh_domain_3 + CGAL_DEPRECATED + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const Function& f, const Bounding_object& bo, std::enable_if_t>* = nullptr) From e18fa44fd9dd812b564dec24aa32a9c6fad7e58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 06:47:30 +0200 Subject: [PATCH 062/248] more deprecated functions --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 53e02a2ed9e..e7e897c777b 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -165,6 +165,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } } +#ifndef CGAL_NO_DEPRECATED_CODE #ifndef DOXYGEN_RUNNING template Mesh_optimization_return_code @@ -183,6 +184,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va * (and any other type could). */ template + CGAL_DEPRECATED Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, const int max_iterations, @@ -199,6 +201,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } template + CGAL_DEPRECATED Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, const int max_iterations, @@ -242,7 +245,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va return rc; } #endif // DOXYGEN_RUNNING - +#endif // CGAL_NO_DEPRECATED_CODE } //end namespace CGAL #endif From 0f4fa7d8bf3c2d17c9f5235b1e67f1366bda1b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 06:47:43 +0200 Subject: [PATCH 063/248] do not use deprecated API --- Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp | 6 +++--- Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp | 4 ++-- .../examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index c0ba926d412..80508fec2f1 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -214,9 +214,9 @@ int main() // - the second argument is a bounding sphere of the domain // (Warning: Sphere_3 constructor uses square radius !) Implicit_domain sphere_domain = - Implicit_domain::create_implicit_mesh_domain(sphere_centered_at_111, - K::Sphere_3(K::Point_3(1, 1, 1), - 2.)); + Implicit_domain::create_implicit_mesh_domain(function = sphere_centered_at_111, + bounding_object = K::Sphere_3(K::Point_3(1, 1, 1), + 2.)); Domain domain(sphere_domain, polyhedron_domain); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp index 2e318913c84..67a3c7df7d3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp @@ -39,8 +39,8 @@ int main() { /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain(sphere_function, - K::Sphere_3(CGAL::ORIGIN, 2.)); + Mesh_domain::create_implicit_mesh_domain( function = sphere_function, + bounding_object = K::Sphere_3(CGAL::ORIGIN, 2.)); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index 9d33b2b3a74..61c3952bb68 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -54,8 +54,8 @@ int main() /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (sphere_function, - K::Sphere_3(CGAL::ORIGIN, 2.) + (p::function = &sphere_function, + p::bounding_object = K::Sphere_3(CGAL::ORIGIN, 2.) ); /// [Domain creation] From 4cb97e076764ee95ed7262318c44b5b522603b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 08:48:10 +0200 Subject: [PATCH 064/248] do not use deprecated API --- .../examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp | 4 ++-- Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index 7458ae88390..3daf8426138 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -61,8 +61,8 @@ int main() { // Domain (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain(sphere_function, - K::Sphere_3(Point(1, 0, 0), 6.)); + Mesh_domain::create_implicit_mesh_domain(function = sphere_function, + bounding_object = K::Sphere_3(Point(1, 0, 0), 6.)); // Mesh criteria Mesh_criteria criteria(edge_size = 0.15, diff --git a/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp b/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp index 03b91d15d8c..14390abda0d 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp @@ -50,8 +50,8 @@ auto field = [](const Point& p, const int, const Mesh_domain::Index) int main() { Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain(capsule_function, - K::Sphere_3(CGAL::ORIGIN, 49.)); + Mesh_domain::create_implicit_mesh_domain(function = capsule_function, + bounding_object = K::Sphere_3(CGAL::ORIGIN, 49.)); // Mesh criteria Mesh_criteria criteria(facet_angle=30, facet_size=0.5, From b1610e10a7175c5566366201e418a59ca75c85d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Sep 2022 21:32:02 +0200 Subject: [PATCH 065/248] fix Labeled_mesh_domain_3 doc and add missing backward compatibility functions --- Mesh_3/doc/Mesh_3/Doxyfile.in | 4 + .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 5 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 3 +- .../Mesh_3/mesh_implicit_domains_2.cpp | 15 +- .../examples/Mesh_3/mesh_implicit_sphere.cpp | 4 +- .../mesh_implicit_sphere_variable_size.cpp | 3 +- .../mesh_two_implicit_spheres_with_balls.cpp | 4 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 909 +++++++++--------- 8 files changed, 478 insertions(+), 469 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 1cc04ed4dbe..86d1772380e 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -36,3 +36,7 @@ HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg ${CGAL_PACKAGE_DOC_DIR}/fig/no-protection-complex.png EXAMPLE_PATH += ${CGAL_PACKAGE_INCLUDE_DIR} # non-documented headers are advertised + +EXTRACT_ALL = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index 80508fec2f1..31c3c0e917e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -214,9 +214,8 @@ int main() // - the second argument is a bounding sphere of the domain // (Warning: Sphere_3 constructor uses square radius !) Implicit_domain sphere_domain = - Implicit_domain::create_implicit_mesh_domain(function = sphere_centered_at_111, - bounding_object = K::Sphere_3(K::Point_3(1, 1, 1), - 2.)); + Implicit_domain::create_implicit_mesh_domain(sphere_centered_at_111, + K::Sphere_3(K::Point_3(1, 1, 1), 2.)); Domain domain(sphere_domain, polyhedron_domain); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index 154d2ad9da5..ecce9ce2ca1 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -49,7 +49,8 @@ int main() v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), 1e-6); + Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), + CGAL::parameters::relative_error_bound(1e-6)); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index e3ec7922475..d8ea29734ee 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -12,8 +12,6 @@ // IO #include -using namespace CGAL::parameters; - // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef FT_to_point_function_wrapper Function; @@ -46,11 +44,10 @@ int main() vps.push_back("+-"); /// [Domain creation] (Warning: Sphere_3 constructor uses square radius !) - namespace param = CGAL::parameters; - Mesh_domain domain(param::function = Function_wrapper(v, vps), - param::bounding_object = K::Sphere_3(CGAL::ORIGIN, - 5.*5.), - param::relative_error_bound = 1e-6); + namespace params = CGAL::parameters; + Mesh_domain domain(Function_wrapper(v, vps), + K::Sphere_3(CGAL::ORIGIN,5.*5.), + params::relative_error_bound = 1e-6); /// [Domain creation] // Set mesh criteria @@ -59,10 +56,10 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude(), params::no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit = 10); // Exudation CGAL::exude_mesh_3(c3t3,12); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp index 67a3c7df7d3..e69306618cc 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp @@ -39,8 +39,8 @@ int main() { /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain( function = sphere_function, - bounding_object = K::Sphere_3(CGAL::ORIGIN, 2.)); + Mesh_domain::create_implicit_mesh_domain( sphere_function, + K::Sphere_3(CGAL::ORIGIN, 2.)); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index 61c3952bb68..fd3f8d715ca 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -54,8 +54,7 @@ int main() /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (p::function = &sphere_function, - p::bounding_object = K::Sphere_3(CGAL::ORIGIN, 2.) + (sphere_function, K::Sphere_3(CGAL::ORIGIN, 2.) ); /// [Domain creation] diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index 3daf8426138..7458ae88390 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -61,8 +61,8 @@ int main() { // Domain (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain(function = sphere_function, - bounding_object = K::Sphere_3(Point(1, 0, 0), 6.)); + Mesh_domain::create_implicit_mesh_domain(sphere_function, + K::Sphere_3(Point(1, 0, 0), 6.)); // Mesh criteria Mesh_criteria criteria(edge_size = 0.15, diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 8cef38118db..2db08fddd40 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -72,7 +72,7 @@ namespace internal { template void operator()(T*) const { } }; - /// Returns a box enclosing image \c im + // Returns a box enclosing image \c im inline Bbox_3 compute_bounding_box(const Image_3& im) { return Bbox_3(-1+im.tx(),-1+im.ty(),-1+im.tz(), @@ -146,7 +146,7 @@ protected: typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; typedef typename Geom_traits::FT FT; typedef std::shared_ptr CGAL_Random_share_ptr_t; - /// Returns squared error bound from \c bbox and \c error + // Returns squared error bound from \c bbox and \c error FT squared_error_bound(const Iso_cuboid_3& bbox, const FT& error) const { typename Geom_traits::Compute_squared_distance_3 squared_distance = @@ -197,23 +197,23 @@ protected: , squared_error_bound_(squared_error_bound(bbox_,error_bound)) {} - /// The function which answers subdomain queries + // The function which answers subdomain queries typedef std::function Function; Function function_; - /// The bounding box + // The bounding box const Iso_cuboid_3 bbox_; typedef std::function< Surface_patch_index(Subdomain_index, Subdomain_index)> Construct_surface_patch_index; Construct_surface_patch_index cstr_s_p_index; - /// The functor that decides which sub-domain indices correspond to the - /// outside of the domain. + // The functor that decides which sub-domain indices correspond to the + // outside of the domain. typedef std::function Null; Null null; - /// The random number generator used by Construct_initial_points + // The random number generator used by Construct_initial_points CGAL_Random_share_ptr_t p_rng_; - /// Error bound relative to sphere radius + // Error bound relative to sphere radius FT squared_error_bound_; }; // Labeled_mesh_domain_3_impl_details @@ -275,25 +275,49 @@ template > -class Labeled_mesh_domain_3 : - protected Labeled_mesh_domain_3_impl_details +class Labeled_mesh_domain_3 +#ifndef DOXYGEN_RUNNING +: protected Labeled_mesh_domain_3_impl_details +#endif { public: //------------------------------------------------------- // Index Types //------------------------------------------------------- - /// Type of indexes for cells of the input complex + // Type of indexes for cells of the input complex +/// \name Types +///@{ + /// The subdomain index of this model of `MeshDomain_3` typedef Subdomain_index_ Subdomain_index; - typedef boost::optional Subdomain; + // +#ifdef DOXYGEN_RUNNING + /// The type of object that stores the function using type-erasure. + typedef std::function< Subdomain_index(const Point_3 &)> Labeling_function; +///@} - /// Type of indexes for cells of the input complex +/// \name Types imported from the geometric traits class +///@{ + /// The point type of the geometric traits class + typedef typename Geom_traits::Point_3 Point_3; + /// The sphere type of the geometric traits class + typedef typename Geom_traits::Sphere_3 Sphere_3; + /// The iso-cuboid type of the geometric traits class + typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; + /// The number type (a field type) of the geometric traits class + typedef typename Geom_traits::FT FT; +///@} +#else + typedef boost::optional Subdomain; +#endif + + // Type of indexes for cells of the input complex typedef Surface_patch_index_ Surface_patch_index; typedef boost::optional Surface_patch; - /// Type of indexes to characterize the lowest dimensional face of the input - /// complex on which a vertex lie + // Type of indexes to characterize the lowest dimensional face of the input + // complex on which a vertex lie typedef typename CGAL::Mesh_3::internal:: Index_generator::Index Index; @@ -308,7 +332,7 @@ private: typedef typename Impl_details::Function Function; public: - /// Geometric object types + // Geometric object types typedef typename BGT::Point_3 Point_3; typedef typename BGT::Segment_3 Segment_3; typedef typename BGT::Ray_3 Ray_3; @@ -335,144 +359,130 @@ public: /// \name Creation /// @{ -/*! \brief Construction from a function, a bounding -object and a relative error bound. + /*! \brief Construction from a function, a bounding object and a relative error bound. + * + * \tparam Function a type compatible with `Labeling_function` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \tparam Bounding_object either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), + * or a bounding `Iso_cuboid_3` + * + * \param function the labeling function + * \param bounding_object the bounding object bounding the meshable space. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{the relative error bound used to compute intersection points between the implicit surface and query segments. + * The bisection is stopped when the length of the intersected segment is less than the product + * of `relative_error_bound` by the diameter of the bounding object.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * \cgalHeading{Example} + * From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): + * \snippet Mesh_3/mesh_implicit_domains_2.cpp Domain creation + * + */ + template + Labeled_mesh_domain_3(const Function& function, + const Bounding_object& bounding_object, + const CGAL_NP_CLASS& np = parameters::default_values(), + std::enable_if_t>* = nullptr) + :Impl_details(function, + bounding_object, + parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::surface_patch_index), construct_pair_functor()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) + {} +///@} -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -- `parameters::function` (mandatory) the labeling function, compatible with `Labeling_function`. -- `parameters::bounding_object` (mandatory) the bounding object is either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), or a bounding `Iso_cuboid_3`. It bounds the meshable space. -- `parameters::relative_error_bound` (optional) the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diameter of the bounding object. Its default value is `FT(1e-3)`. - -\cgalHeading{Example} -From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): -\snippet Mesh_3/mesh_implicit_domains_2.cpp Domain creation - - */ - template - Labeled_mesh_domain_3(const CGAL_NP_CLASS& np = parameters::default_values()) + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS& np) :Impl_details(parameters::get_parameter(np, internal_np::function_param), parameters::get_parameter(np, internal_np::bounding_object_param), parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), parameters::choose_parameter(parameters::get_parameter(np, internal_np::surface_patch_index), construct_pair_functor()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) - { - } + {} template Labeled_mesh_domain_3(const CGAL_NP_CLASS& ... nps) : Labeled_mesh_domain_3(internal_np::combine_named_parameters(nps...)) - { - } - -///@} - - /* - * Backward-compatibility constructors, with `null_subdomain_index` as - * fourth parameter. - * @{ - */ - Labeled_mesh_domain_3(const Function& f, - const Sphere_3& bounding_sphere, - const FT& error_bound = FT(1e-3), - Null null = Null_subdomain_index(), - CGAL::Random* p_rng = nullptr) - : Impl_details(f, bounding_sphere, - error_bound, - construct_pair_functor(), - null, p_rng) {} - - Labeled_mesh_domain_3(const Function& f, - const Bbox_3& bbox, - const FT& error_bound = FT(1e-3), - Null null = Null_subdomain_index(), - CGAL::Random* p_rng = nullptr) - : Impl_details(f, bbox, - error_bound, - construct_pair_functor(), - null, p_rng) {} - - Labeled_mesh_domain_3(const Function& f, - const Iso_cuboid_3& bbox, - const FT& error_bound = FT(1e-3), - Null null = Null_subdomain_index(), - CGAL::Random* p_rng = nullptr) - : Impl_details(f, bbox, error_bound, - construct_pair_functor(), - null, p_rng) {} - /* - * @} + +#ifndef CGAL_NO_DEPRECATED_CODE + template + CGAL_DEPRECATED + Labeled_mesh_domain_3(const Function& function, + const Bounding_object& bounding_object, + double error_bound, + std::enable_if_t>* = nullptr) + : Labeled_mesh_domain_3(function, + bounding_object, + parameters::relative_error_bound(error_bound)) + {} +#endif + +/// \name Creation of domains from 3D images +/// @{ + /*! + * \brief Construction from a 3D gray image + * + * This static method is a named constructor. It constructs a domain + * described by a 3D gray image. A 3D gray image is a grid of voxels, + * where each voxel is associated with a gray level value. Unless otherwise specified by the parameter `image_values_to_subdom_indices`, the domain to + * be discretized is the union of voxels that lie inside a surface + * described by an isolevel value, called \a isovalue. The voxels lying + * inside the domain have gray level values that are larger than the + * isovalue. + * + * The value of voxels is interpolated to a gray level value at any query point. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param image_ the input 3D image. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{iso_value} + * \cgalParamDescription{the isovalue, inside + * `image`, of the surface describing the boundary of the object to be + * meshed.} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{image_values_to_subdomain_indices} + * \cgalParamDescription{a function or a function object, compatible with the signature + * `Subdomain_index(double)`. This function returns the subdomain index + * corresponding to a pixel value. If this parameter is used, then the + * parameter `iso_value` is ignored.} + * \cgalParamDefault{Null_functor()} + * \cgalParamNEnd + * \cgalParamNBegin{value_outside} + * \cgalParamDescription{the value attached to voxels + * outside of the domain to be meshed. It should be lower than + * `iso_value`.} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{ is the relative error + * bound, relative to the diameter of the box of the image.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Examples} + * + * From the example (\ref Mesh_3/mesh_3D_gray_image.cpp): + * + * \snippet Mesh_3/mesh_3D_gray_image.cpp Domain creation + * + * From the example (\ref Mesh_3/mesh_3D_gray_vtk_image.cpp): + * + * \snippet Mesh_3/mesh_3D_gray_vtk_image.cpp Domain creation + * */ - - /// Named constructors - /// @{ - /*! - \brief Construction from a 3D gray image - - This static method is a named constructor. It constructs a domain - described by a 3D gray image. A 3D gray image is a grid of voxels, - where each voxel is associated with a gray level value. Unless otherwise specified by the parameter `image_values_to_subdom_indices`, the domain to - be discretized is the union of voxels that lie inside a surface - described by an isolevel value, called \a isovalue. The voxels lying - inside the domain have gray level values that are larger than the - isovalue. - - The value of voxels is interpolated to a gray level value at any query point. - - This constructor uses named parameters . They can be specified in any order. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param image_ the input 3D image. Must be a `CGAL::Image_3` object. - - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - - \cgalNamedParamsBegin - \cgalParamNBegin{iso_value} - \cgalParamDescription{the isovalue, inside - `image`, of the surface describing the boundary of the object to be - meshed.} - \cgalParamDefault{0} - - \cgalParamNBegin{image_values_to_subdomain_indices} - \cgalParamDescription{a function or - a function object, compatible with the signature - `Subdomain_index(double)`. This function returns the subdomain index - corresponding to a pixel value. If this parameter is used, then the - parameter `iso_value` is ignored..} - \cgalParamDefault{Null_functor()} - - \cgalParamNBegin{value_outside} - \cgalParamDescription{the value attached to voxels - outside of the domain to be meshed. It should be lower than - `iso_value`.} - \cgalParamDefault{0} - - \cgalParamNBegin{relative_error_bound} - \cgalParamDescription{ is the relative error - bound, relative to the diameter of the box of the image.} - \cgalParamDefault{FT(1e-3)} - - - \cgalNamedParamsEnd - - \cgalHeading{Examples} - - From the example (\ref Mesh_3/mesh_3D_gray_image.cpp), where the name - of the parameters is not specified, as they are given is the same - order as the parameters definition: - - \snippet Mesh_3/mesh_3D_gray_image.cpp Domain creation - - From the example (\ref Mesh_3/mesh_3D_gray_vtk_image.cpp): - - \snippet Mesh_3/mesh_3D_gray_vtk_image.cpp Domain creation - - */ template static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) { @@ -501,315 +511,314 @@ From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): create_construct_surface_patch_index(construct_surface_patch_index_)); } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::get_parameter; - using parameters::get_parameter_reference; - using parameters::choose_parameter; - const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); - auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); - auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); - FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); - auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); - auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); - auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - namespace p = CGAL::parameters; - return Labeled_mesh_domain_3 - (p::function(create_gray_image_wrapper - (image_, - iso_value_, - image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) - { - return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); - } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& ... nps) - { - return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); - } - -#ifndef CGAL_NO_DEPRECATED_CODE - template - CGAL_DEPRECATED - static Labeled_mesh_domain_3 - create_gray_image_mesh_domain(const CGAL::Image_3& image_, - double iso_value=0, - double value_outside=0, - double relative_error_bound = 1e-3, - CGAL::Random* rng = nullptr, - SubdomainIndex image_values_to_subdom_indices = SubdomainIndex()) - { - return create_gray_image_mesh_domain(image_, parameters::iso_value(iso_value) - .image_values_to_subdomain_indices(image_values_to_subdom_indices) - .value_outside(value_outside) - .relative_error_bound(relative_error_bound) - .p_rng(rng)); - } -#endif - - /*! - * \brief Construction from a 3D labeled image - - This static method is a named constructor. It constructs a - domain described by a 3D labeled image. A 3D labeled image is a grid - of voxels, where each voxel is associated with an index (a subdomain - index) characterizing the subdomain in which the voxel lies. The - domain to be discretized is the union of voxels that have non-zero - values. - - This constructor uses named parameters . They can be specified in any order. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param image_ the input 3D image. Must be a `CGAL::Image_3` object. - - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - - \cgalNamedParamsBegin - \cgalParamNBegin{weights} - \cgalParamDescription{an input 3D image that provides - weights associated to each voxel (the word type is `unsigned char`, - and the voxels values are integers between 0 and 255). - The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`. - Its dimensions must be the same as the dimensions of `parameters::image`.} - \cgalParamDefault{CGAL::Image_3()} - - \cgalParamNBegin{value_outside} - \cgalParamDescription{the value attached to voxels - outside of the domain to be meshed. It should be lower than - `iso_value`.} - \cgalParamDefault{0} - - \cgalParamNBegin{relative_error_bound} - \cgalParamDescription{ is the relative error - bound, relative to the diameter of the box of the image.} - \cgalParamDefault{FT(1e-3)} - \cgalNamedParamsEnd - -\cgalHeading{Example} - -From the example (\ref Mesh_3/mesh_3D_image.cpp): - -\snippet Mesh_3/mesh_3D_image.cpp Domain creation - -From the example (\ref Mesh_3/mesh_3D_weighted_image.cpp), -where the labeled image is used with a precomputed 3D image of weights : - -\snippet Mesh_3/mesh_3D_weighted_image.cpp Domain creation - - */ - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) - { - using parameters::get_parameter; - using parameters::get_parameter_reference; - using parameters::choose_parameter; - auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); - auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); - FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); - auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); - auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); - auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); - CGAL_USE(iso_value_); - namespace p = CGAL::parameters; - - if (weights_.is_valid()) - { - return Labeled_mesh_domain_3 - (p::function(create_weighted_labeled_image_wrapper - (image_, - weights_, - image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - else - { - return Labeled_mesh_domain_3 - (p::function(create_labeled_image_wrapper - (image_, - image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& np) - { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::get_parameter; - using parameters::get_parameter_reference; - using parameters::choose_parameter; - const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); - auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); - auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); - FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); - auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); - auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); - auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); - - namespace p = CGAL::parameters; - if (weights_.is_valid()) - { - return Labeled_mesh_domain_3 - (p::function(create_weighted_labeled_image_wrapper - (image_, - weights_, - image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - else - { - return Labeled_mesh_domain_3 - (p::function(create_labeled_image_wrapper - (image_, - image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); - } - } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) - { - return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); - } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& ... nps) - { - return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); - } - - - -/// \name Creation of domains from implicit functions - -/*! -\brief Construction from an implicit function - -This static method is a named constructor. It constructs a domain -whose bounding surface is described implicitly as the zero level set of a -function. The domain to be discretized is assumed to be the domain where -the function has negative values. - -The method takes as argument a bounding sphere which is required to -circumscribe the surface and to have its center inside the domain. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param function the implicit function, compatible with the signature `FT(Point_3)`: it takes a point as argument, - and returns a scalar value. That object must be model of `CopyConstructible`. - \param bounding_object the bounding object is either a bounding sphere (of type `Sphere_3`), a bounding box (type - `Bbox_3`), or a bounding `Iso_cuboid_3`. It must bounds the surface, and - its center must be inside the domain. - - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters". - -\cgalHeading{Examples} - -From the example (\ref Mesh_3/mesh_implicit_sphere.cpp), where the name of -the parameters is not specified, as they are given is the same order as the -parameters definition: - -\snippet Mesh_3/mesh_implicit_sphere.cpp Domain creation - -From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): - -\snippet Mesh_3/mesh_implicit_sphere_variable_size.cpp Domain creation - - */ - - - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np) + /*! + * \brief Construction from a 3D labeled image + * + * This static method is a named constructor. It constructs a + * domain described by a 3D labeled image. A 3D labeled image is a grid + * of voxels, where each voxel is associated with an index (a subdomain + * index) characterizing the subdomain in which the voxel lies. The + * domain to be discretized is the union of voxels that have non-zero + * values. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \param image_ the input 3D image. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{weights} + * \cgalParamDescription{an input 3D image that provides + * weights associated to each voxel (the word type is `unsigned char`, + * and the voxels values are integers between 0 and 255). + * The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`. + * Its dimensions must be the same as the dimensions of `parameters::image`.} + * \cgalParamDefault{CGAL::Image_3()} + * \cgalParamExtra{A const reference will be taken to the parameter passed.} + * \cgalParamNEnd + * \cgalParamNBegin{value_outside} + * \cgalParamDescription{the value attached to voxels + * outside of the domain to be meshed. It should be lower than + * `iso_value`.} + * \cgalParamDefault{0} + * \cgalParamNEnd + * + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{ is the relative error + * bound, relative to the diameter of the box of the image.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * From the example (\ref Mesh_3/mesh_3D_image.cpp): + * + * \snippet Mesh_3/mesh_3D_image.cpp Domain creation + * + * From the example (\ref Mesh_3/mesh_3D_weighted_image.cpp), + * where the labeled image is used with a precomputed 3D image of weights : + * + * \snippet Mesh_3/mesh_3D_weighted_image.cpp Domain creation + * + */ + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) { - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); - using parameters::get_parameter; - using parameters::choose_parameter; - auto function_ = get_parameter(np, internal_np::function_param); - auto bounding_object_ = get_parameter(np, internal_np::bounding_object_param); - FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); - auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); - auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); - namespace p = CGAL::parameters; + using parameters::get_parameter; + using parameters::get_parameter_reference; + using parameters::choose_parameter; + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); + CGAL_USE(iso_value_); + namespace p = CGAL::parameters; + + if (weights_.is_valid()) + { return Labeled_mesh_domain_3 - (p::function(make_implicit_to_labeling_function_wrapper(function_)), - p::bounding_object(bounding_object_), + (p::function(create_weighted_labeled_image_wrapper + (image_, + weights_, + image_values_to_subdomain_indices_, + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = create_null_subdomain_index(null_subdomain_index_), p::construct_surface_patch_index = create_construct_surface_patch_index(construct_surface_patch_index_)); + } + else + { + return Labeled_mesh_domain_3 + (p::function(create_labeled_image_wrapper + (image_, + image_values_to_subdomain_indices_, + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } + } +/// @} + + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter; + using parameters::get_parameter_reference; + using parameters::choose_parameter; + const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + namespace p = CGAL::parameters; + return Labeled_mesh_domain_3 + (p::function(create_gray_image_wrapper + (image_, + iso_value_, + image_values_to_subdomain_indices_, + value_outside_)), + p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + + } + + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) + { + return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); + } + + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& ... nps) + { + return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); + } + + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter_reference; + const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); + return create_labeled_image_mesh_domain(image_, np); + } + + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) + { + return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); + } + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& ... nps) + { + return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); + } + + +/// \name Creation of domains from implicit functions +/// @{ + + /*! + * \brief Construction from an implicit function + * + * This static method is a named constructor. It constructs a domain + * whose bounding surface is described implicitly as the zero level set of a + * function. The domain to be discretized is assumed to be the domain where + * the function has negative values. + * + * The method takes as argument a bounding sphere which is required to + * circumscribe the surface and to have its center inside the domain. + * + * \tparam Function a type compatible with the signature `FT(Point_3)`: it takes a point as argument, + * and returns a scalar value. That object must be model of `CopyConstructible` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \tparam Bounding_object either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), + * or a bounding `Iso_cuboid_3` + * + * \param function the implicit function + * \param bounding_object object boundint the meshable domain and its center is inside the domain. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{function} + * \cgalParamDescription{the .} + * \cgalParamNEnd + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{ is the relative error + * bound, relative to the diameter of the box of the image.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Examples} + * + * From the example (\ref Mesh_3/mesh_implicit_sphere.cpp): + * + * \snippet Mesh_3/mesh_implicit_sphere.cpp Domain creation + * + * From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): + * + * \snippet Mesh_3/mesh_implicit_sphere_variable_size.cpp Domain creation + * + */ + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const Function& function, + const Bounding_object& bounding_object, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t>* = nullptr +#endif +) + { + using parameters::get_parameter; + using parameters::choose_parameter; + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + namespace p = CGAL::parameters; + return Labeled_mesh_domain_3 + (p::function(make_implicit_to_labeling_function_wrapper(function)), + p::bounding_object(bounding_object), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } +/// @} + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np = parameters::default_values()) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + + using parameters::get_parameter; + return create_implicit_mesh_domain(parameters::get_parameter(np, internal_np::function_param), + parameters::get_parameter(np, internal_np::bounding_object_param), + np); } template static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& ... nps) { - return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); + return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } + #ifndef CGAL_NO_DEPRECATED_CODE - template + template CGAL_DEPRECATED static Labeled_mesh_domain_3 - create_implicit_mesh_domain(const Function& f, - const Bounding_object& bo, - std::enable_if_t>* = nullptr) + create_gray_image_mesh_domain(const CGAL::Image_3& image_, + double iso_value, + double value_outside=0, + double relative_error_bound = 1e-3, + CGAL::Random* rng = nullptr, + SubdomainIndex image_values_to_subdom_indices = SubdomainIndex(), + NullSubdomainIndex null_subdomain_index_ = NullSubdomainIndex(), + ConstructSurfacePatchIndex construct_surface_patch_index_ = ConstructSurfacePatchIndex()) { - return create_implicit_mesh_domain(parameters::function(f).bounding_object(bo)); + return create_gray_image_mesh_domain(image_, parameters::iso_value(iso_value) + .image_values_to_subdomain_indices(image_values_to_subdom_indices) + .value_outside(value_outside) + .relative_error_bound(relative_error_bound) + .p_rng(rng).null_subdomain_index(null_subdomain_index_) + .construct_surface_patch_index(construct_surface_patch_index_)); + } + + template + CGAL_DEPRECATED + static Labeled_mesh_domain_3 + create_labeled_image_mesh_domain(const CGAL::Image_3& image_, + double relative_error_bound, + const CGAL::Image_3& weights_ = CGAL::Image_3(), + int value_outside=0, + CGAL::Random* rng = nullptr, + SubdomainIndex image_values_to_subdom_indices = SubdomainIndex(), + NullSubdomainIndex null_subdomain_index_ = NullSubdomainIndex(), + ConstructSurfacePatchIndex construct_surface_patch_index_ = ConstructSurfacePatchIndex()) + { + return create_labeled_image_mesh_domain(image_, parameters::weights(weights_) + .image_values_to_subdomain_indices(image_values_to_subdom_indices) + .value_outside(value_outside) + .relative_error_bound(relative_error_bound) + .p_rng(rng) + .null_subdomain_index(null_subdomain_index_) + .construct_surface_patch_index(construct_surface_patch_index_)); } #endif - /// @} - /** + + /* * Constructs a set of `n` points on the surface, and output them to * the output iterator `pts` whose value type is required to be * `std::pair`. @@ -826,21 +835,21 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Construct_initial_points object + // Returns Construct_initial_points object Construct_initial_points construct_initial_points_object() const { return Construct_initial_points(*this); } - /** + /* * Returns a bounding box of the domain */ Bbox_3 bbox() const { return this->bbox_.bbox(); } - /** - * Returns true if point~`p` is in the domain. If `p` is in the + /* + * Returns true if point `p` is in the domain. If `p` is in the * domain, the parameter index is set to the index of the subdomain * including $p$. It is set to the default value otherwise. */ @@ -861,10 +870,10 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Is_in_domain object + // Returns Is_in_domain object Is_in_domain is_in_domain_object() const { return Is_in_domain(*this); } - /** + /* * Returns true is the element `type` intersect properly any of the * surface patches describing the either the domain boundary or some * subdomain boundary. @@ -894,8 +903,8 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): } private: - /// Returns true if points \c a & \c b do not belong to the same subdomain - /// \c index is set to the surface index of subdomains f(a), f(b) + // Returns true if points \c a & \c b do not belong to the same subdomain + // \c index is set to the surface index of subdomains f(a), f(b) Surface_patch operator()(const Point_3& a, const Point_3& b) const { // If f(a) != f(b), then [a,b] intersects some surface. Here we consider @@ -914,7 +923,7 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): return Surface_patch(); } - /** + /* * Clips \c query to a segment \c s, and call operator()(s) */ template @@ -932,13 +941,13 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Do_intersect_surface object + // Returns Do_intersect_surface object Do_intersect_surface do_intersect_surface_object() const { return Do_intersect_surface(*this); } - /** + /* * Returns a point in the intersection of the primitive `type` * with some boundary surface. * `Type1` is either `Segment_3`, `Ray_3` or `Line_3`. @@ -971,7 +980,7 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): } private: - /** + /* * Returns a point in the intersection of [a,b] with the surface * \c a must be the source point, and \c b the out point. It's important * because it drives bisection cuts. @@ -1044,7 +1053,7 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): } } - /// Clips \c query to a segment \c s, and call operator()(s) + // Clips \c query to a segment \c s, and call operator()(s) template Intersection clip_to_segment(const Query& query) const { @@ -1060,34 +1069,34 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Construct_intersection object + // Returns Construct_intersection object Construct_intersection construct_intersection_object() const { return Construct_intersection(*this); } - /** + /* * Returns the index to be stored in a vertex lying on the surface identified * by \c index. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } - /** + /* * Returns the index to be stored in a vertex lying in the subdomain * identified by \c index. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } - /** + /* * Returns the \c Surface_patch_index of the surface patch * where lies a vertex with dimension 2 and index \c index. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } - /** + /* * Returns the index of the subdomain containing a vertex * with dimension 3 and index \c index. */ @@ -1111,7 +1120,7 @@ From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): // ----------------------------------- protected: - /// Returns Surface_patch_index from \c i and \c j + // Returns Surface_patch_index from \c i and \c j Surface_patch_index make_surface_index(const Subdomain_index i, const Subdomain_index j) const { @@ -1121,7 +1130,7 @@ protected: return this->cstr_s_p_index(j, i); } - /// Returns the bounding sphere of an Iso_cuboid_3 + // Returns the bounding sphere of an Iso_cuboid_3 Sphere_3 bounding_sphere(const Iso_cuboid_3& bbox) const { typename BGT::Construct_sphere_3 sphere = BGT().construct_sphere_3_object(); @@ -1287,7 +1296,7 @@ protected: } public: - /// Returns bounding box + // Returns bounding box const Iso_cuboid_3& bounding_box() const { return this->bbox_; } }; // end class Labeled_mesh_domain_3 From d5a82f3412ec9c29380f8138964fd23b425bc4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 14:03:13 +0200 Subject: [PATCH 066/248] clean up Mesh_criteria --- Mesh_3/include/CGAL/Mesh_criteria_3.h | 94 +++++++++++++++------------ 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 4778361f245..24eed881504 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -182,10 +182,12 @@ template , typename CellCriteria = Mesh_cell_criteria_3 > class Mesh_criteria_3 +#ifndef DOXYGEN_RUNNING : public internal::Mesh_criteria_3_impl< Tr, EdgeCriteria, FacetCriteria, CellCriteria > +#endif { typedef internal::Mesh_criteria_3_impl< Tr, EdgeCriteria, @@ -220,13 +222,13 @@ typedef Mesh_cell_criteria_3 Cell_criteria; typedef typename Base::Cell_criteria Cell_criteria; #endif - // Constructor + /// Construction from facet and cell criteria, the edge criteria are ignored in this case. Mesh_criteria_3(Facet_criteria facet_criteria, Cell_criteria cell_criteria) : Base(facet_criteria, cell_criteria) {} - // Constructor + /// Constructor from edge, face and cell criteria. Mesh_criteria_3(Edge_criteria edge_criteria, Facet_criteria facet_criteria, Cell_criteria cell_criteria) @@ -234,47 +236,53 @@ typedef Mesh_cell_criteria_3 Cell_criteria; facet_criteria, cell_criteria) {} /*! - \brief Construction from criteria parameters. - - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - - \cgalNamedParamsBegin - \cgalParamNBegin{edge_size} - \cgalParamDescription{a scalar field (resp. a constant) providing a space varying - (resp. a uniform) - upper bound for the lengths of curve edges. This parameter has to be set to a positive - value when 1-dimensional features protection is used.} - - \cgalParamNBegin{facet_angle} - \cgalParamDescription{a lower bound for the angles (in degrees) of the - surface mesh facets.} - - \cgalParamNBegin{facet_size} - \cgalParamDescription{ a scalar field (resp. a constant) describing - a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls.} - - \cgalParamNBegin{facet_distance} - \cgalParamDescription{ a scalar field (resp. a constant) describing a space varying (resp. a uniform) - upper bound for the distance between the facet circumcenter and the center of its surface - Delaunay ball.} - \cgalParamNBegin{facet_topology} - \cgalParamDescription{ the set of topological constraints - which have to be verified by each surface facet. See `Mesh_facet_topology` manual page to - get all possible values.} - \cgalParamDefault{CGAL::FACET_VERTICES_ON_SURFACE} - - \cgalParamNBegin{cell_radius_edge_ratio} - \cgalParamDescription{ an upper bound for the radius-edge ratio of the mesh tetrahedra.} - - \cgalParamNBegin{cell_size} - \cgalParamDescription{ a scalar field (resp. a constant) describing - a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra.} - - - \cgalNamedParamsEnd - */ + * \brief Construction from criteria parameters. + * + * Note that each size or distance parameter can be specified using two ways: either as a scalar field or + * as a numerical value when the field is uniform. + * + * If not specified, each parameter has a default value such that the corresponding criterion will be ignored. + * Numerical sizing or distance values, as well as scalar fields should be given in the unit used for coordinates + * of points in the mesh domain class of the mesh generation process. + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{edge_size} + * \cgalParamDescription{a scalar field (resp. a constant) providing a space varying + * (resp. a uniform) + * upper bound for the lengths of curve edges. This parameter has to be set to a positive + * value when 1-dimensional features protection is used.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_angle} + * \cgalParamDescription{a lower bound for the angles (in degrees) of the + * surface mesh facets.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_size} + * \cgalParamDescription{a scalar field (resp. a constant) describing + * a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_distance} + * \cgalParamDescription{a scalar field (resp. a constant) describing a space varying (resp. a uniform) + * upper bound for the distance between the facet circumcenter and the center of its surface + * Delaunay ball.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_topology} + * \cgalParamDescription{the set of topological constraints + * which have to be verified by each surface facet. See `Mesh_facet_topology` manual page to + * get all possible values.} + * \cgalParamDefault{CGAL::FACET_VERTICES_ON_SURFACE} + * \cgalParamNEnd + * \cgalParamNBegin{cell_radius_edge_ratio} + * \cgalParamDescription{ an upper bound for the radius-edge ratio of the mesh tetrahedra.} + * \cgalParamNEnd + * \cgalParamNBegin{cell_size} + * \cgalParamDescription{ a scalar field (resp. a constant) describing + * a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + */ template Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np) { From 928ef0b447fc27cad843fecd5d0dd38e981fe347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 14:08:57 +0200 Subject: [PATCH 067/248] clean up exude_mesh --- Mesh_3/include/CGAL/exude_mesh_3.h | 132 ++++++++++++++--------------- 1 file changed, 64 insertions(+), 68 deletions(-) diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 52d50ebefba..911a4cf5ce6 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -29,74 +29,70 @@ namespace CGAL { /*! -@ingroup PkgMesh3Functions - -The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. - -The sliver exudation process consists in optimizing the weights of vertices -of the weighted Delaunay triangulation in such a way that slivers disappear and -the quality of the mesh improves. - -@warning This optimizer modifies the weight of vertices of the triangulation and, -if called, must be the last optimizer to be called. If the mesh is refined after -this optimization has been performed, all improvements will be lost. - -@pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -@tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. -@tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. - @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: -\cgalNamedParamsBegin - \cgalParamNBegin{time_limit} - \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process - is stopped. This time is measured using the `Real_timer` class. The default value is - 0 and means that there is no time limit.} - \cgalParamType{`double`} - \cgalParamDefault{0} - \cgalParamNBegin{sliver_bound} - \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. - The exudation process considers in turn all the mesh cells that have a smallest dihedral - angle less than sliver_bound and tries to make them disappear by weighting their vertices. - The optimization process stops when every cell in the mesh achieves this quality. The - default value is 0 and means that there is no targeted bound: the exuder then runs as long - as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} - \cgalParamType{`double`} - \cgalParamDefault{0} -\cgalNamedParamsEnd -\return -The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve -the smallest dihedral angle of the set of cells incident to some vertex in the mesh. -
- -\cgalHeading{Example} - -\code{.cpp} -// Exude without sliver_bound, using at most 10s CPU time -exude_mesh_3(c3t3, - parameters::time_limit=10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - + * @ingroup PkgMesh3Functions + * + * The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. + * + * The sliver exudation process consists in optimizing the weights of vertices + * of the weighted Delaunay triangulation in such a way that slivers disappear and + * the quality of the mesh improves. + * + * @warning This optimizer modifies the weight of vertices of the triangulation and, + * if called, must be the last optimizer to be called. If the mesh is refined after + * this optimization has been performed, all improvements will be lost. + * + * @tparam C3T3 is required to be a model of the concept `MeshComplex_3InTriangulation_3`. + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
    + *
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. + *
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
  • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve + * the smallest dihedral angle of the set of cells incident to some vertex in the mesh. + *
+ * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Exude without sliver_bound, using at most 10s CPU time + * exude_mesh_3(c3t3, + * parameters::time_limit=10); + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * + */ template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { From e23d77bbf79f9862273205ed849dbc5ffef155b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 14:27:30 +0200 Subject: [PATCH 068/248] clean lloyd_optimize_mesh_3 --- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 230 ++++++++++---------- 1 file changed, 113 insertions(+), 117 deletions(-) diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index e0e9dfdcf13..226cdbdeb10 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -32,123 +32,119 @@ namespace CGAL { /*! -\ingroup PkgMesh3Functions - -The function `lloyd_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - -@param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. -@param domain the domain to be discretized -@param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - -\cgalNamedParamsBegin - \cgalParamNBegin{time_limit} - \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. - This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} - \cgalParamType{`double`} - \cgalParamExtra{\pre `time_limit` \f$ \geq\f$ 0} - \cgalParamDefault{0} - - \cgalParamNBegin{max_iteration_number} - \cgalParamDescription{limit on the number of performed iterations. 0 means that there is - no limit on the number of performed iterations.} - \cgalParamExtra{\pre `max_iteration_number >=0`} - \cgalParamType{`int`} - \cgalParamDefault{0} - - - \cgalParamNBegin{freeze_bound} - \cgalParamDescription{designed to reduce running time of each optimization iteration. - Any vertex that has a displacement less than a given fraction of the length - of its shortest incident edge, is frozen (i.e.\ is not relocated). - The parameter `freeze_bound` gives the threshold ratio. - If it is set to 0, freezing of vertices is disabled.} - \cgalParamExtra{\pre `0<= freeze_bound <=1} - \cgalParamType{`double`} - \cgalParamDefault{0.001} - - \cgalParamNBegin{convergence} - \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped - when at the last iteration the displacement of any vertex is less than - a given fraction of the length of the shortest edge incident to that vertex.} - \cgalParamExtra{\pre `0 <=convergence <= 1`} - \cgalParamType{`double`} - \cgalParamDefault{0.001} - - \cgalParamNBegin{do_freeze} - \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), - frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that - moves, unfreezes all its incident vertices.} - \cgalParamType{`bool`} - \cgalParamDefault{true} - -\cgalNamedParamsEnd -\return -The function `lloyd_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// 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); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -\note This function requires the \ref thirdpartyEigen library. -*/ + * \ingroup PkgMesh3Functions + * + * The function `lloyd_optimize_mesh_3()` is a mesh optimization process + * based on the minimization of a global energy function. + * + * In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted + * as the \f$ L^1\f$-norm of the error achieved + * when the function \f$ x^2\f$ is interpolated on the mesh domain + * using a piecewise linear function which is linear + * in each cell of the Voronoi diagram of the mesh vertices. + * + * The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. + * At each iteration, mesh vertices are moved into + * positions that bring to zero the energy gradient + * and the Delaunay triangulation is updated. + * Vertices on the mesh boundaries are handled + * in a special way so as to preserve an accurate + * representation of the domain boundaries. + * + * \tparam C3T3 is required to be a model of the concept + * `MeshComplex_3InTriangulation_3`. + * The argument `c3t3`, passed by + * reference, provides the initial mesh + * and is modified by the algorithm + * to represent the final optimized mesh. + * + * \tparam MD is required to be a model of the concept + * `MeshDomain_3`. The argument `domain` must be the `MD` + * object used to create the `c3t3` parameter. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + * @param domain the domain to be discretized + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamExtra{\pre `max_iteration_number >=0`} + * \cgalParamType{`int`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{designed to reduce running time of each optimization iteration. + * Any vertex that has a displacement less than a given fraction of the length + * of its shortest incident edge, is frozen (i.e.\ is not relocated). + * The parameter `freeze_bound` gives the threshold ratio. + * If it is set to 0, freezing of vertices is disabled.} + * \cgalParamExtra{\pre `0<= freeze_bound <=1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.001} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + * when at the last iteration the displacement of any vertex is less than + * a given fraction of the length of the shortest edge incident to that vertex.} + * \cgalParamExtra{\pre `0 <=convergence <= 1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
    + *
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. + *
  • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion + * is achieved. + *
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the + * `do_freeze` parameter is set to true. + *
  • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because + * most vertices have been frozen, and no better convergence can be reached. + *
+ * + * \cgalHeading{Example} + * + * + * \code{.cpp} + * // Lloyd-smoothing until convergence reaches 0.01, freezing vertices which + * // 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); + * + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * + * \note This function requires the \ref thirdpartyEigen library. + */ template Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain,const CGAL_NP_CLASS& np = parameters::default_values()) { From e6c88542600512bbc63811e33aabf6636e22977e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 15:54:17 +0200 Subject: [PATCH 069/248] clean up odt_optimize_mesh_3 --- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 204 +++++++++++----------- 1 file changed, 98 insertions(+), 106 deletions(-) diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 81ca35e7bcf..2d0fae5d32d 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -32,112 +32,104 @@ namespace CGAL { /*! -@ingroup PkgMesh3Functions - -The function `odt_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear in each mesh cell. - -The optimizer `odt_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -@pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -@tparam C3T3 iis required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - - @tparam MeshDomain is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - - @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. - @param domain ... - @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - - \cgalNamedParamsBegin - \cgalParamNBegin{time_limit} - \cgalParamDescription{is used to set up, in seconds, - a CPU time limit after which the optimization process is stopped. This time is - measured using `Real_timer`. - The default value is 0 and means that there is no time limit.} - \cgalParamType{`double`} - \cgalParamDefault{0} - - \cgalParamNBegin{max_iteration_number} - \cgalParamDescription{sets a limit on the number of performed iterations. - The default value of 0 means that there is - no limit on the number of performed iterations.} - \cgalParamType{`std::size_t`} - \cgalParamDefault{0} - - \cgalParamNBegin{convergence} - \cgalParamDescription{is a stopping criterion based on convergence: - the optimization process is stopped, when at the last iteration, - the displacement of any vertex is less than a given percentage of the length - the shortest edge incident to that vertex. - The parameter `convergence` gives the threshold ratio.} - \cgalParamType{`double`} - \cgalParamDefault{0.02} - - \cgalParamNBegin{freeze_bound} - \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex - that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is - not relocated). The parameter `freeze_bound` gives the threshold ratio.} - \cgalParamType{`double`} - \cgalParamDefault{0.01} - - \cgalParamNBegin{do_freeze} - \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), - frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that - moves, unfreezes all its incident vertices.} - \cgalParamType{`bool`} - \cgalParamDefault{true} - \cgalNamedParamsEnd - \return -The function `odt_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
  • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
- -\cgalHeading{Example} - -\code{.cpp} -// 100 iterations of ODT-smoothing -odt_optimize_mesh_3(c3t3, - domain, - parameters::max_iteration_number = 100, - parameters::convergence = 0); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` + * @ingroup PkgMesh3Functions + * + * The function `odt_optimize_mesh_3()` is a mesh optimization process + * based on the minimization of a global energy function. + * + * In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted + * as the \f$ L^1\f$-norm of the error achieved + * when the function \f$ x^2\f$ is interpolated on the mesh domain + * using a piecewise linear function which is linear in each mesh cell. + * + * The optimizer `odt_optimize_mesh_3()` works in iterative steps. + * At each iteration, mesh vertices are moved into + * positions that bring to zero the energy gradient + * and the Delaunay triangulation is updated. + * Vertices on the mesh boundaries are handled + * in a special way so as to preserve an accurate + * representation of the domain boundaries. + * + * @tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain a model of the concept `MeshDomain_3` + * + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh and is modified by the algorithm to represent the final optimized mesh. + * @param domain the domain used to create the `c3t3` parameter + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, + * a CPU time limit after which the optimization process is stopped. This time is + * measured using `Real_timer`. + * The default value is 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{sets a limit on the number of performed iterations. + * The default value of 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamType{`std::size_t`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{is a stopping criterion based on convergence: + * the optimization process is stopped, when at the last iteration, + * the displacement of any vertex is less than a given percentage of the length + * the shortest edge incident to that vertex. + * The parameter `convergence` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `0 <= convergence <= 1`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex + * that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is + * not relocated). The parameter `freeze_bound` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `0 <= freeze_bound <= 1`} + * \cgalParamDefault{0.01} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true`, + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
    + *
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
  • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. + *
  • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion + * is achieved. + *
  • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the + * `do_freeze` parameter is set to true. + *
  • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because + * most vertices have been frozen, and no better convergence can be reached. + *
+ * + * \cgalHeading{Example} + * + * \code{.cpp} + * // 100 iterations of ODT-smoothing + * odt_optimize_mesh_3(c3t3, + * domain, + * parameters::max_iteration_number = 100, + * parameters::convergence = 0); + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` */ template Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) From bab2d0c280ae6d3bc57ccb9198b2857cb76bdcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 16:02:10 +0200 Subject: [PATCH 070/248] clean up perturb_mesh_3 --- Mesh_3/include/CGAL/perturb_mesh_3.h | 150 ++++++++++++--------------- 1 file changed, 69 insertions(+), 81 deletions(-) diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 81ae6e6609a..2de68221b72 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -33,87 +33,75 @@ namespace CGAL { /*! -\ingroup PkgMesh3Functions - -The function `perturb_mesh_3()` is a mesh optimizer that -improves the quality of a Delaunay mesh -by changing the positions of some vertices of the mesh. - -The perturber tries to improve the dihedral angles of the worst cells in the mesh -degree by degree: the -step number `n` is considered as successful -if after this step the worst tetrahedron of the mesh has a minimal dihedral -angle larger than `n` degrees. -The perturber exits if this is not the case. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. - @param domain ... - @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - - \cgalNamedParamsBegin - \cgalParamNBegin{time_limit} - \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process - is stopped. This time is measured using the `Real_timer` class. The default value is - 0 and means that there is no time limit.} - \cgalParamType{`double`} - \cgalParamDefault{0} - \cgalParamNBegin{sliver_bound} - \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. - The exudation process considers in turn all the mesh cells that have a smallest dihedral - angle less than sliver_bound and tries to make them disappear by weighting their vertices. - The optimization process stops when every cell in the mesh achieves this quality. The - default value is 0 and means that there is no targeted bound: the exuder then runs as long - as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} - \cgalParamType{`double`} - \cgalParamDefault{0} -\cgalNamedParamsEnd - - -\return -The function `perturb_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
    -
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
  • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. -
- - -\cgalHeading{Example} - -\code{.cpp} -// Perturb until every dihedral angle of the mesh is >= 10 degrees -// No time bound is set -perturb_mesh_3(c3t3, - domain, - parameters::sliver_bound = 10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - - + * \ingroup PkgMesh3Functions + * + * The function `perturb_mesh_3()` is a mesh optimizer that + * improves the quality of a Delaunay mesh + * by changing the positions of some vertices of the mesh. + * + * The perturber tries to improve the dihedral angles of the worst cells in the mesh + * degree by degree: the + * step number `n` is considered as successful + * if after this step the worst tetrahedron of the mesh has a minimal dihedral + * angle larger than `n` degrees. + * The perturber exits if this is not the case. + * + * \tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3` + * \tparam MD a model of the concept `MeshDomain_3` + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh and is modified by the algorithm to represent the final optimized mesh + * @param domain the domain used to create the `c3t3` parameter + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `0 <= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
    + *
  • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. + *
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
  • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. + *
+ * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Perturb until every dihedral angle of the mesh is >= 10 degrees + * // No time bound is set + * perturb_mesh_3(c3t3, + * domain, + * parameters::sliver_bound = 10); + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * + */ template Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { From b740c31bc1b9184d17772eae8dd2d1938c5c1fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 18:03:47 +0200 Subject: [PATCH 071/248] clean up make_mesh_3 and refine_mesh_3 --- Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 15 +- Mesh_3/include/CGAL/make_mesh_3.h | 323 +++++++++---------- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 329 ++++++++++---------- 5 files changed, 317 insertions(+), 354 deletions(-) diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 911a4cf5ce6..78d3d644de3 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -41,7 +41,7 @@ namespace CGAL { * if called, must be the last optimizer to be called. If the mesh is refined after * this optimization has been performed, all improvements will be lost. * - * @tparam C3T3 is required to be a model of the concept `MeshComplex_3InTriangulation_3`. + * @tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3`. * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 226cdbdeb10..5215190a1a8 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -51,21 +51,12 @@ namespace CGAL { * in a special way so as to preserve an accurate * representation of the domain boundaries. * - * \tparam C3T3 is required to be a model of the concept - * `MeshComplex_3InTriangulation_3`. - * The argument `c3t3`, passed by - * reference, provides the initial mesh - * and is modified by the algorithm - * to represent the final optimized mesh. - * - * \tparam MD is required to be a model of the concept - * `MeshDomain_3`. The argument `domain` must be the `MD` - * object used to create the `c3t3` parameter. - * + * \tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3`. + * \tparam MD a model of the concept `MeshDomain_3`. * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. - * @param domain the domain to be discretized + * @param domain the domain used to create the `c3t3` parameter * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: * * \cgalNamedParamsBegin diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index c083b325ba4..2634dab6665 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -361,176 +361,159 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > // ----------------------------------- /*! -\ingroup PkgMesh3Functions - -The function `make_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd-smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Mesh_3_section_examples ). - - -\tparam C3T3 is required to be a model of -the concept `MeshComplex_3InTriangulation_3`, -and a model of `MeshComplexWithFeatures_3InTriangulation_3` -if the domain is a model of `MeshDomainWithFeatures_3`. -This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3`, or of the refined concept -`MeshDomainWithFeatures_3` -if the domain has corners and curves that need to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC has to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - @param domain the domain to be discretized - @param criteria the criteria - @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - -\cgalNamedParamsBegin - \cgalParamNBegin{features_options} - \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be - taken into account or not - when the domain is a model of `MeshDomainWithFeatures_3`. - The type `Features` of this parameter is an internal undescribed type. - The library provides functions to construct appropriate values of that type. -
    -
  • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, - i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a - `MeshDomainWithFeatures_3`. This is the default behavior - if parameter `features` is not specified. -
  • `parameters::no_features()` prevents the representation - of 0 and 1-dimensional features in the mesh. -
} - \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} - \cgalParamDefault{`parameters::features(domain)`} - - \cgalParamNBegin{manifold_option} - \cgalParamDescription{allows the user to drive the meshing algorithm, - and ensure that the output mesh surface follows the given manifold criterion. - It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` - and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold - surface if the input surface is not manifold.} - \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} - \cgalParamDefault{`parameters::non_manifold()`} - - \cgalParamNBegin{lloyd_options} - \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to - trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the - parameters of this optimizer. If one parameter is not set, the default value of - `lloyd_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} - \cgalParamDefault{`parameters::no_lloyd()`} - - \cgalParamNBegin{odt_options} - \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to - trigger or not a call to `odt_optimize_mesh_3()` function and - to set the parameters of this optimizer. - If one parameter is not set, the default value of - `odt_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} - \cgalParamDefault{`parameters::no_odt()`} - - \cgalParamNBegin{perturb_options} - \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to - trigger or not a call to `perturb_mesh_3()` function and - to set the parameters of this optimizer. If one parameter is not set, the default value of - `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} - \cgalParamDefault{`parameters::no_perturb`} - - \cgalParamNBegin{exude_options} - \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to - trigger or not a call to `exude_mesh_3()` function and to override to set the - parameters of this optimizer. If one parameter is not set, the default value of - `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} - \cgalParamDefault{`parameters::no_exude`} - -\cgalNamedParamsEnd - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_mesh_3()` -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `parameters::manifold()` -\sa `parameters::manifold_with_boundary()` -\sa `parameters::non_manifold()` -\sa `exude_mesh_3()` -\sa `perturb_mesh_3()` -\sa `lloyd_optimize_mesh_3()` -\sa `odt_optimize_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` -*/ - + * \ingroup PkgMesh3Functions + * + * The function `make_mesh_3()` is a 3D + * mesh generator. It produces simplicial meshes which discretize + * 3D domains. + * + * The mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. + * The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, + * etc. + * + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd-smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process + * can be activated or not, + * according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, + * and sliver perturber should never be called after the sliver exuder. + * In the case of further refinement, only the sliver exuder can be used. + * + * The function outputs the mesh to an object which provides iterators to + * traverse the resulting mesh data structure or can be written to a file + * (see \ref Mesh_3_section_examples ). + * + * \tparam C3T3 either a model of the concept `MeshComplex_3InTriangulation_3` or + * of `MeshComplexWithFeatures_3InTriangulation_3` if `MD` + * is a model of `MeshDomainWithFeatures_3`. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` respectively. + * + * \tparam MD either a model of the concept `MeshDomain_3` or of + * `MeshDomainWithFeatures_3` if 0 and 1-dimensional features + * of the input complex have to be accurately represented in the mesh. + * + * \tparam MC either a model of the concept `MeshCriteria_3` or a model + * of `MeshCriteriaWithFeatures_3` if the domain has exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param domain the domain used to create the `c3t3` parameter. It is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * \param criteria specifies the size and shape requirements for mesh tetrahedra + * and surface facets. These criteria form the rules which drive + * the refinement process. All mesh elements satisfy those criteria + * at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{Feature preservation options} + * \cgalParamDescription{If the domain is a model of `MeshDomainWithFeatures_3`, 0 and 1-dimensional features can be + * taken into account while generating the mesh. The following two named parameters control + * this option: + *
    + *
  • \link parameters::features() `parameters::features(domain)` \endlink + *
  • `parameters::no_features()` + *
} + * \cgalParamDefault{`parameters::features(domain)`} + * \cgalParamNEnd + * \cgalParamNBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
    + *
  • `parameters::manifold()` + *
  • `parameters::manifold_with_boundary()` + *
  • `parameters::non_manifold()` + *
+ * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamNEnd + * \cgalParamNBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
    + *
  • `parameters::no_lloyd()` + *
  • `parameters::lloyd_optimize_mesh_3()` + *
} + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamNEnd + * \cgalParamNBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
    + *
  • `parameters::no_odt()` + *
  • `parameters::odt()` + *
} + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamNEnd + * \cgalParamNBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
    + *
  • `parameters::no_perturb()` + *
  • `parameters::perturb()` + *
} + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamNEnd + * \cgalParamNBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
    + *
  • `parameters::exude()` + *
  • `parameters::no_exude()` + *
} + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * Note that whatever may be the optimization processes activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `refine_mesh_3()` + * \sa `parameters::features()` + * \sa `parameters::no_features()` + * \sa `parameters::manifold()` + * \sa `parameters::manifold_with_boundary()` + * \sa `parameters::non_manifold()` + * \sa `exude_mesh_3()` + * \sa `perturb_mesh_3()` + * \sa `lloyd_optimize_mesh_3()` + * \sa `odt_optimize_mesh_3()` + * \sa `parameters::exude()` + * \sa `parameters::no_exude()` + * \sa `parameters::perturb()` + * \sa `parameters::no_perturb()` + * \sa `parameters::lloyd()` + * \sa `parameters::no_lloyd()` + * \sa `parameters::odt()` + * \sa `parameters::no_odt()` + */ template C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 2d0fae5d32d..0d939726df9 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -52,7 +52,6 @@ namespace CGAL { * * @tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3` * @tparam MeshDomain a model of the concept `MeshDomain_3` - * * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param c3t3 the initial mesh and is modified by the algorithm to represent the final optimized mesh. @@ -102,6 +101,7 @@ namespace CGAL { * \cgalParamDefault{true} * \cgalParamNEnd * \cgalNamedParamsEnd + * * \return a value of type `CGAL::Mesh_optimization_return_code` which is: *
    *
  • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 9ea8cdda8e2..95e3692b468 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -101,176 +101,165 @@ private: } // namespace details /*! -\ingroup PkgMesh3Functions - -The function `refine_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_mesh_3()` may be used to refine a previously -computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); - -CGAL::refine_mesh_3(c3t3, domain, new_criteria); -\endcode - -Please note that we guarantee the result if and only if the domain does -not change from one refinement to the next one. - - -\tparam C3T3 is required to be a model of -the concept -`MeshComplex_3InTriangulation_3`, -and a model of `MeshComplexWithFeatures_3InTriangulation_3` -if the domain is a model of `MeshDomainWithFeatures_3`. -The argument `c3t3` is passed by -reference as this object is modified by the refinement process. As the -refinement process only adds points to the triangulation, all -vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. Object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3` or of the refined concept -`MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` -if the domain has exposed features. The argument `criteria` of -type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\param c3t3 the mesh to be refined. -\param domain the domain to be discretized -\param criteria the criteria -\param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. - -The following four parameters are optional optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalNamedParamsBegin - \cgalParamNBegin{manifold_option} - \cgalParamDescription{allows the user to drive the meshing algorithm, - and ensure that the output mesh surface follows the given manifold criterion. - It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` - and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold - surface if the input surface is not manifold.} - \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} - \cgalParamDefault{`parameters::non_manifold()`} - - \cgalParamNBegin{lloyd_options} - \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to - trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the - parameters of this optimizer. If one parameter is not set, the default value of - `lloyd_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} - \cgalParamDefault{'parameters::no_lloyd()'} - - \cgalParamNBegin{odt_options} - \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to - trigger or not a call to `odt_optimize_mesh_3()` function and - to set the parameters of this optimizer. - If one parameter is not set, the default value of - `odt_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} - \cgalParamDefault{`parameters::no_odt()`} - - \cgalParamNBegin{perturb_options} - \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to - trigger or not a call to `perturb_mesh_3()` function and - to set the parameters of this optimizer. If one parameter is not set, the default value of - `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} - \cgalParamDefault{'parameters::no_perturb`} - - \cgalParamNBegin{exude_options} - \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to - trigger or not a call to `exude_mesh_3()` function and to override to set the - parameters of this optimizer. If one parameter is not set, the default value of - `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} - \cgalParamDefault{'parameters::no_exude`} - -\cgalNamedParamsEnd - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::parameters::manifold` -\sa `CGAL::parameters::manifold_with_boundary` -\sa `CGAL::parameters::non_manifold` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::parameters::exude` -\sa `CGAL::parameters::no_exude` -\sa `CGAL::parameters::perturb` -\sa `CGAL::parameters::no_perturb` -\sa `CGAL::parameters::lloyd` -\sa `CGAL::parameters::no_lloyd` -\sa `CGAL::parameters::odt` -\sa `CGAL::parameters::no_odt` + * \ingroup PkgMesh3Functions + * + * The function `refine_mesh_3()` is a 3D + * mesh generator. It produces simplicial meshes which discretize + * 3D domains. + * + * The mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. + * The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, + * etc. + * + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process + * can be activated or not, + * according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward. + * + * \attention The function template `refine_mesh_3()` may be used to refine a previously + * computed mesh, e.g.: + * \code{.cpp} + * C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); + * + * CGAL::refine_mesh_3(c3t3, domain, new_criteria); + * \endcode + * + * Please note that we guarantee the result if and only if the domain does + * not change from one refinement to the next one. + * + * + * \tparam C3T3 either a model of the concept `MeshComplex_3InTriangulation_3` or + * of `MeshComplexWithFeatures_3InTriangulation_3` if `MD` + * is a model of `MeshDomainWithFeatures_3`. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` respectively. + * + * \tparam MD either a model of the concept `MeshDomain_3` or of + * `MeshDomainWithFeatures_3` if 0 and 1-dimensional features + * of the input complex have to be accurately represented in the mesh. + * + * \tparam MC either a model of the concept `MeshCriteria_3` or a model + * of `MeshCriteriaWithFeatures_3` if the domain has exposed features. + * + * \param c3t3 the mesh to be refined that is modified by the refinement process. + * As the refinement process only adds points to the triangulation, all + * vertices of the triangulation of `c3t3` remain in the + * mesh during the refinement process. `c3t3` can be used to insert + * specific points in the domain to ensure that they will be contained in the + * final triangulation. + * \param domain the domain used to create the `c3t3` parameter. It is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * \param criteria specifies the size and shape requirements for mesh tetrahedra + * and surface facets. These criteria form the rules which drive + * the refinement process. All mesh elements satisfy those criteria + * at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. + * They control which optimization processes are performed + * and allow the user to tune the parameters of the optimization processes. + * Individual optimization parameters are not described here as they are + * internal types (see instead the documentation page of each optimizer). + * For each optimization algorithm, there exist two global functions + * that allow to enable or disable the optimizer. + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamNEnd + * \cgalParamNBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamNEnd + * \cgalParamNBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamNEnd + * \cgalParamNBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamNEnd + * \cgalParamNBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::exude()` + *
    • `parameters::no_exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * The optimization parameters can be passed in arbitrary order. If one parameter + * is not passed, its default value is used. The default values are + * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + * Note that whatever may be the optimization processes activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::parameters::manifold` + * \sa `CGAL::parameters::manifold_with_boundary` + * \sa `CGAL::parameters::non_manifold` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * \sa `CGAL::parameters::exude` + * \sa `CGAL::parameters::no_exude` + * \sa `CGAL::parameters::perturb` + * \sa `CGAL::parameters::no_perturb` + * \sa `CGAL::parameters::lloyd` + * \sa `CGAL::parameters::no_lloyd` + * \sa `CGAL::parameters::odt` + * \sa `CGAL::parameters::no_odt` */ - template void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { @@ -307,7 +296,7 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const * @brief This function refines the mesh c3t3 wrt domain & criteria * * @param c3t3 the mesh to be refined. - * @param domain the domain to be discretized + * @param domain the domain used to create the `c3t3` parameter * @param criteria the criteria * @param exude if \c true, an exudation step will be done at * the end of the Delaunay refinement process From 74b90ca71b4d7aa98bc845d00fca07ccad92502b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Sep 2022 18:09:53 +0200 Subject: [PATCH 072/248] fix links --- Mesh_3/include/CGAL/refine_mesh_3.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 95e3692b468..23f7202c049 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -244,21 +244,21 @@ private: * optimization processes. * * \sa `CGAL::make_mesh_3()` - * \sa `CGAL::parameters::manifold` - * \sa `CGAL::parameters::manifold_with_boundary` - * \sa `CGAL::parameters::non_manifold` + * \sa `CGAL::parameters::manifold()` + * \sa `CGAL::parameters::manifold_with_boundary()` + * \sa `CGAL::parameters::non_manifold()` * \sa `CGAL::exude_mesh_3()` * \sa `CGAL::perturb_mesh_3()` * \sa `CGAL::lloyd_optimize_mesh_3()` * \sa `CGAL::odt_optimize_mesh_3()` - * \sa `CGAL::parameters::exude` - * \sa `CGAL::parameters::no_exude` - * \sa `CGAL::parameters::perturb` - * \sa `CGAL::parameters::no_perturb` - * \sa `CGAL::parameters::lloyd` - * \sa `CGAL::parameters::no_lloyd` - * \sa `CGAL::parameters::odt` - * \sa `CGAL::parameters::no_odt` + * \sa `CGAL::parameters::exude()` + * \sa `CGAL::parameters::no_exude()` + * \sa `CGAL::parameters::perturb()` + * \sa `CGAL::parameters::no_perturb()` + * \sa `CGAL::parameters::lloyd()` + * \sa `CGAL::parameters::no_lloyd()` + * \sa `CGAL::parameters::odt()` + * \sa `CGAL::parameters::no_odt()` */ template void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) From 681120764e849ea210a2cfa4f1c5b49f75a5fb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 09:36:41 +0200 Subject: [PATCH 073/248] please the CI with a new macro --- .../doc/resources/1.8.13/BaseDoxyfile.in | 4 +++- .../doc/resources/1.8.14/BaseDoxyfile.in | 4 +++- .../doc/resources/1.8.20/BaseDoxyfile.in | 5 +++- .../doc/resources/1.8.4/BaseDoxyfile.in | 3 +++ .../doc/resources/1.9.3/BaseDoxyfile.in | 4 +++- Mesh_3/include/CGAL/make_mesh_3.h | 24 +++++++++---------- Mesh_3/include/CGAL/refine_mesh_3.h | 20 ++++++++-------- 7 files changed, 38 insertions(+), 26 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 2c1a87d69a6..83043b16504 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -349,7 +349,9 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd=
\htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index f436e62be4c..b50b8b27c69 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -350,7 +350,9 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index dfffc15a705..571028383ef 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -372,7 +372,10 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" + # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 2aa14b65920..43681a4c2dd 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -356,6 +356,9 @@ ALIASES+= "cgalParamType{1}=
  • Type: \1
  • " ALIASES+= "cgalParamDefault{1}=
  • %Default: \1
  • " ALIASES+= "cgalParamExtra{1}=
  • Extra: \1
  • " ALIASES+= "cgalParamNEnd= \htmlonly[block] \endhtmlonly " +ALIASES+= "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" +ALIASES+= "cgalParamSectionEnd=\cgalParamNEnd" + # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding diff --git a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in index 7cd7843e137..99f3dddbd5a 100644 --- a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in @@ -372,7 +372,9 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 2634dab6665..a4694082222 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -422,7 +422,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: * * \cgalNamedParamsBegin - * \cgalParamNBegin{Feature preservation options} + * \cgalParamSectionBegin{Feature preservation options} * \cgalParamDescription{If the domain is a model of `MeshDomainWithFeatures_3`, 0 and 1-dimensional features can be * taken into account while generating the mesh. The following two named parameters control * this option: @@ -431,8 +431,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
  • `parameters::no_features()` * } * \cgalParamDefault{`parameters::features(domain)`} - * \cgalParamNEnd - * \cgalParamNBegin{Topological options (manifoldness)} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Topological options (manifoldness)} * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, * three named parameters control this option: *
      @@ -442,8 +442,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} * \cgalParamDefault{`parameters::non_manifold()`} - * \cgalParamNEnd - * \cgalParamNBegin{Lloyd optimization} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -451,8 +451,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    • `parameters::lloyd_optimize_mesh_3()` *
    } * \cgalParamDefault{`parameters::no_lloyd()`} - * \cgalParamNEnd - * \cgalParamNBegin{ODT optimization} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -460,8 +460,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    • `parameters::odt()` *
    } * \cgalParamDefault{`parameters::no_odt()`} - * \cgalParamNEnd - * \cgalParamNBegin{Mesh perturbation} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -469,8 +469,8 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    • `parameters::perturb()` *
    } * \cgalParamDefault{`parameters::perturb()`} - * \cgalParamNEnd - * \cgalParamNBegin{Mesh exudation} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -478,7 +478,7 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > *
    • `parameters::no_exude()` *
    } * \cgalParamDefault{`parameters::exude()`} - * \cgalParamNEnd + * \cgalParamSectionEnd * \cgalNamedParamsEnd * * Note that whatever may be the optimization processes activated, diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 23f7202c049..7e55cb69e38 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -177,7 +177,7 @@ private: * that allow to enable or disable the optimizer. * * \cgalNamedParamsBegin - * \cgalParamNBegin{Topological options (manifoldness)} + * \cgalParamSectionBegin{Topological options (manifoldness)} * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, * three named parameters control this option: *
      @@ -187,8 +187,8 @@ private: *
    * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} * \cgalParamDefault{`parameters::non_manifold()`} - * \cgalParamNEnd - * \cgalParamNBegin{Lloyd optimization} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -196,8 +196,8 @@ private: *
    • `parameters::lloyd_optimize_mesh_3()` *
    } * \cgalParamDefault{`parameters::no_lloyd()`} - * \cgalParamNEnd - * \cgalParamNBegin{ODT optimization} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -205,8 +205,8 @@ private: *
    • `parameters::odt()` *
    } * \cgalParamDefault{`parameters::no_odt()`} - * \cgalParamNEnd - * \cgalParamNBegin{Mesh perturbation} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -214,8 +214,8 @@ private: *
    • `parameters::perturb()` *
    } * \cgalParamDefault{`parameters::perturb()`} - * \cgalParamNEnd - * \cgalParamNBegin{Mesh exudation} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *
      @@ -223,7 +223,7 @@ private: *
    • `parameters::no_exude()` *
    } * \cgalParamDefault{`parameters::exude()`} - * \cgalParamNEnd + * \cgalParamSectionEnd * \cgalNamedParamsEnd * * The optimization parameters can be passed in arbitrary order. If one parameter From d8f0bc4c0871e19cae3bd5c83aedae19f15fd3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 09:42:32 +0200 Subject: [PATCH 074/248] dedicated macro for precondition --- Documentation/doc/resources/1.8.13/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.8.14/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.8.20/BaseDoxyfile.in | 3 ++- Documentation/doc/resources/1.8.4/BaseDoxyfile.in | 1 + Documentation/doc/resources/1.9.3/BaseDoxyfile.in | 3 ++- Mesh_3/include/CGAL/exude_mesh_3.h | 4 ++-- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 8 ++++---- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 6 +++--- Mesh_3/include/CGAL/perturb_mesh_3.h | 4 ++-- 9 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 83043b16504..7d6685977cf 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -351,7 +351,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ - "cgalParamSectionEnd=\cgalParamNEnd" + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index b50b8b27c69..44a6b9f72b3 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -352,7 +352,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ - "cgalParamSectionEnd=\cgalParamNEnd" + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index 571028383ef..7f258d33a4b 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -374,7 +374,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ - "cgalParamSectionEnd=\cgalParamNEnd" + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 43681a4c2dd..45d422384df 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -358,6 +358,7 @@ ALIASES+= "cgalParamExtra{1}=
  • Extra: \1
  • " ALIASES+= "cgalParamNEnd= \htmlonly[block] \endhtmlonly " ALIASES+= "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" ALIASES+= "cgalParamSectionEnd=\cgalParamNEnd" +ALIASES+= "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # This tag can be used to specify a number of word-keyword mappings (TCL only). diff --git a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in index 99f3dddbd5a..1977f82b158 100644 --- a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in @@ -374,7 +374,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ - "cgalParamSectionEnd=\cgalParamNEnd" + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 78d3d644de3..f39e21c6db1 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -53,7 +53,7 @@ namespace CGAL { * is stopped. This time is measured using the `Real_timer` class. The default value is * 0 and means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamPrecondition{`time_limit >= 0`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalParamNBegin{sliver_bound} @@ -64,7 +64,7 @@ namespace CGAL { * default value is 0 and means that there is no targeted bound: the exuder then runs as long * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `sliver_bound <= 180`} + * \cgalParamPrecondition{`0<= sliver_bound <= 180`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalNamedParamsEnd diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 5215190a1a8..5591185ce5b 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -64,13 +64,13 @@ namespace CGAL { * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamPrecondition{`time_limit >= 0`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalParamNBegin{max_iteration_number} * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is * no limit on the number of performed iterations.} - * \cgalParamExtra{\pre `max_iteration_number >=0`} + * \cgalParamPrecondition{`max_iteration_number >=0`} * \cgalParamType{`int`} * \cgalParamDefault{0} * \cgalParamNEnd @@ -80,7 +80,7 @@ namespace CGAL { * of its shortest incident edge, is frozen (i.e.\ is not relocated). * The parameter `freeze_bound` gives the threshold ratio. * If it is set to 0, freezing of vertices is disabled.} - * \cgalParamExtra{\pre `0<= freeze_bound <=1`} + * \cgalParamPrecondition{`0<= freeze_bound <=1`} * \cgalParamType{`double`} * \cgalParamDefault{0.001} * \cgalParamNEnd @@ -88,7 +88,7 @@ namespace CGAL { * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped * when at the last iteration the displacement of any vertex is less than * a given fraction of the length of the shortest edge incident to that vertex.} - * \cgalParamExtra{\pre `0 <=convergence <= 1`} + * \cgalParamPrecondition{`0 <=convergence <= 1`} * \cgalParamType{`double`} * \cgalParamDefault{0.02} * \cgalParamNEnd diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 0d939726df9..40ee94753fe 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -65,7 +65,7 @@ namespace CGAL { * measured using `Real_timer`. * The default value is 0 and means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamPrecondition{`time_limit >= 0`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalParamNBegin{max_iteration_number} @@ -82,7 +82,7 @@ namespace CGAL { * the shortest edge incident to that vertex. * The parameter `convergence` gives the threshold ratio.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `0 <= convergence <= 1`} + * \cgalParamPrecondition{`0 <= convergence <= 1`} * \cgalParamDefault{0.02} * \cgalParamNEnd * \cgalParamNBegin{freeze_bound} @@ -90,7 +90,7 @@ namespace CGAL { * that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is * not relocated). The parameter `freeze_bound` gives the threshold ratio.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `0 <= freeze_bound <= 1`} + * \cgalParamPrecondition{`0 <= freeze_bound <= 1`} * \cgalParamDefault{0.01} * \cgalParamNEnd * \cgalParamNBegin{do_freeze} diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 2de68221b72..ac6d1b338d8 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -61,7 +61,7 @@ namespace CGAL { * is stopped. This time is measured using the `Real_timer` class. The default value is * 0 and means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `0 <= sliver_bound <= 180`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalParamNBegin{sliver_bound} @@ -72,7 +72,7 @@ namespace CGAL { * default value is 0 and means that there is no targeted bound: the exuder then runs as long * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `time_limit >= 0`} + * \cgalParamPrecondition{`time_limit >= 0`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalNamedParamsEnd From 70468210a4986fee791a069207abf150ebb55896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 10:18:21 +0200 Subject: [PATCH 075/248] fix indentation --- Mesh_3/include/CGAL/Mesh_3/parameters.h | 194 ++++++++++++------------ 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 507ee7d0f15..ddb0804b466 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -192,43 +192,42 @@ inline internal::Mesh_3_options mesh_3_dump() typedef Named_function_parameters Param; \ return Param(Class(false)); } - CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) +CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) #undef CGAL_BOOLEAN_PARAMETER // ----------------------------------- // Perturb // ----------------------------------- - template Named_function_parameters perturb(const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); - double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - internal::Perturb_options options(true); + internal::Perturb_options options(true); - if ( internal::undef_parameter != time_limit) - options.set_time_limit(time_limit); + if ( internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); - options.set_bound(sliver_bound); - typedef Named_function_parameters Param; - return Param(options); + options.set_bound(sliver_bound); + typedef Named_function_parameters Param; + return Param(options); } template Named_function_parameters perturb(const CGAL_NP_CLASS& ... nps) { - return perturb(internal_np::combine_named_parameters(nps...)); + return perturb(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_perturb() { - - typedef Named_function_parameters Param; - return Param(internal::Perturb_options(false)); +inline Named_function_parameters no_perturb() +{ + typedef Named_function_parameters Param; + return Param(internal::Perturb_options(false)); } // ----------------------------------- @@ -237,30 +236,31 @@ inline Named_function_parameters Named_function_parameters exude(const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); - double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - internal::Exude_options options(true); + internal::Exude_options options(true); - if ( internal::undef_parameter != time_limit) - options.set_time_limit(time_limit); - options.set_bound(sliver_bound); - typedef Named_function_parameters Param; + if ( internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + options.set_bound(sliver_bound); + typedef Named_function_parameters Param; - return Param(options); + return Param(options); } template Named_function_parameters exude(const CGAL_NP_CLASS& ... nps) { - return exude(internal_np::combine_named_parameters(nps...)); + return exude(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_exude() { - typedef Named_function_parameters Param; - return Param(internal::Exude_options(false)); +inline Named_function_parameters no_exude() +{ + typedef Named_function_parameters Param; + return Param(internal::Exude_options(false)); } // ----------------------------------- @@ -269,31 +269,32 @@ inline Named_function_parameters Named_function_parameters odt(const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::odt_freeze_ratio); - double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::odt_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); - internal::Odt_options options(true); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::odt_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::odt_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); + internal::Odt_options options(true); - options.set_time_limit(time_limit); - options.set_bound(freeze_bound); - options.set_convergence(convergence); - options.set_max_iteration_number(max_iteration_number); - typedef Named_function_parameters Param; - return Param(options); + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + typedef Named_function_parameters Param; + return Param(options); } template Named_function_parameters odt(const CGAL_NP_CLASS& ... nps) { - return odt(internal_np::combine_named_parameters(nps...)); + return odt(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_odt() { - typedef Named_function_parameters Param; - return Param(internal::Odt_options(false)); +inline Named_function_parameters no_odt() +{ + typedef Named_function_parameters Param; + return Param(internal::Odt_options(false)); } // ----------------------------------- @@ -302,33 +303,34 @@ inline Named_function_parameters Named_function_parameters lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::lloyd_freeze_ratio); - double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::lloyd_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); - internal::Lloyd_options options(true); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::lloyd_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::lloyd_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); + internal::Lloyd_options options(true); - options.set_time_limit(time_limit); - options.set_bound(freeze_bound); - options.set_convergence(convergence); - options.set_max_iteration_number(max_iteration_number); + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); - typedef Named_function_parameters Param; - return Param(options); + typedef Named_function_parameters Param; + return Param(options); } template Named_function_parameters lloyd(const CGAL_NP_CLASS& ... nps) { - return lloyd(internal_np::combine_named_parameters(nps...)); + return lloyd(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_lloyd() { - typedef Named_function_parameters Param; - return Param(internal::Lloyd_options(false)); +inline Named_function_parameters no_lloyd() +{ + typedef Named_function_parameters Param; + return Param(internal::Lloyd_options(false)); } // ----------------------------------- @@ -337,28 +339,27 @@ inline Named_function_parameters Named_function_parameters manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); - internal::Manifold_options options; - options.mesh_topology = mesh_topology; + using parameters::choose_parameter; + using parameters::get_parameter; + int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); + internal::Manifold_options options; + options.mesh_topology = mesh_topology; - typedef Named_function_parameters Param; - return Param(options); + typedef Named_function_parameters Param; + return Param(options); } template Named_function_parameters manifold_options(const CGAL_NP_CLASS& ... nps) { - return manifold_options(internal_np::combine_named_parameters(nps...)); + return manifold_options(internal_np::combine_named_parameters(nps...)); } inline Named_function_parameters manifold() { - typedef Named_function_parameters Param; - return Param(internal::Manifold_options( - internal::Manifold_options::MANIFOLD)); + typedef Named_function_parameters Param; + return Param(internal::Manifold_options(internal::Manifold_options::MANIFOLD)); } inline Named_function_parameters manifold_with_boundary() { @@ -368,9 +369,8 @@ inline Named_function_parameters non_manifold() { - typedef Named_function_parameters Param; - return Param(internal::Manifold_options( - internal::Manifold_options::NON_MANIFOLD)); + typedef Named_function_parameters Param; + return Param(internal::Manifold_options(internal::Manifold_options::NON_MANIFOLD)); } // ----------------------------------- @@ -384,33 +384,33 @@ inline Named_function_parameters Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - internal::Mesh_3_options options; + using parameters::choose_parameter; + using parameters::get_parameter; + internal::Mesh_3_options options; - options.dump_after_init_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_init_prefix_param), ""); - options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); - options.dump_after_refine_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_prefix_param), ""); - options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_glob_opt_prefix_param), ""); - options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_perturb_prefix_param), ""); - options.dump_after_exude_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); - options.number_of_initial_points=choose_parameter(get_parameter(np, internal_np::number_of_initial_points_param), -1); - options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, internal_np::nonlinear_growth_of_balls_param), false); - options.maximal_number_of_vertices=choose_parameter(get_parameter(np, internal_np::maximal_number_of_vertices_param), 0); - options.pointer_to_error_code=choose_parameter(get_parameter(np, internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); + options.dump_after_init_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_init_prefix_param), ""); + options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); + options.dump_after_refine_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_prefix_param), ""); + options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_glob_opt_prefix_param), ""); + options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_perturb_prefix_param), ""); + options.dump_after_exude_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); + options.number_of_initial_points=choose_parameter(get_parameter(np, internal_np::number_of_initial_points_param), -1); + options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, internal_np::nonlinear_growth_of_balls_param), false); + options.maximal_number_of_vertices=choose_parameter(get_parameter(np, internal_np::maximal_number_of_vertices_param), 0); + options.pointer_to_error_code=choose_parameter(get_parameter(np, internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); #ifndef CGAL_NO_ATOMIC - options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), - ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); + options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), + ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); #endif - typedef Named_function_parameters Param; - return Param(options); + typedef Named_function_parameters Param; + return Param(options); } template Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& ... nps) { - return mesh_3_options(internal_np::combine_named_parameters(nps...)); + return mesh_3_options(internal_np::combine_named_parameters(nps...)); } From 6505bb7d3963cb5064a59efcd091502b09b60def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 11:49:28 +0200 Subject: [PATCH 076/248] fix parameters --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 753 ++++++++++++--------- Mesh_3/include/CGAL/Mesh_3/parameters.h | 216 +++++- Mesh_3/include/CGAL/make_mesh_3.h | 83 --- Mesh_3/include/CGAL/perturb_mesh_3.h | 1 - 4 files changed, 617 insertions(+), 436 deletions(-) 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 cb4f081ba67..d1d2ab57741 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -2,355 +2,466 @@ namespace CGAL { namespace parameters { - /*! - \ingroup PkgMesh3Parameters - - The function `parameters::manifold()` is used to drive the - meshing algorithm for surfaces. - It ensures that the surface of the output mesh is a manifold surface - without boundaries. - The manifold property of the output mesh can be achieved only if the input surface - is a manifold. - Note that the meshing algorithm provably terminates only if the input - sharp edges have been protected, using the - feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). - - \sa `CGAL::make_mesh_3()` - \sa `CGAL::refine_mesh_3()` - \sa `CGAL::parameters::manifold_with_boundary()` - \sa `CGAL::parameters::non_manifold()` - */ - unspecified_type manifold(); - - /*! - \ingroup PkgMesh3Parameters - - The function `parameters::non_manifold()` is used to drive the - meshing algorithm for surfaces. - It does not ensure that the surface of the output mesh is a manifold surface. - The manifold property of the output mesh might nevertheless result from an appropriate - choice of meshing criteria. - \sa `CGAL::make_mesh_3()` - \sa `CGAL::refine_mesh_3()` - \sa `CGAL::parameters::manifold_with_boundary()` - \sa `CGAL::parameters::manifold()` - */ - unspecified_type non_manifold(); - - /*! - \ingroup PkgMesh3Parameters - - The function `parameters::manifold_with_boundary()` is used to drive the - meshing algorithm for surfaces. - It ensures that the surface of the output mesh is a manifold surface which - may have boundaries. - The manifold property of the output mesh can be achieved only if the input surface - is a manifold. - Note that the meshing algorithm provably terminates only if the input - sharp edges have been protected, using the - feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). - - \sa `CGAL::make_mesh_3()` - \sa `CGAL::refine_mesh_3()` - \sa `CGAL::parameters::non_manifold()` - \sa `CGAL::parameters::manifold()` - */ - unspecified_type manifold_with_boundary(); +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::manifold()` is used to drive the + * meshing algorithm for surfaces. + * It ensures that the surface of the output mesh is a manifold surface + * without boundaries. + * The manifold property of the output mesh can be achieved only if the input surface + * is a manifold. + * Note that the meshing algorithm provably terminates only if the input + * sharp edges have been protected, using the + * feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::manifold_with_boundary()` + * \sa `CGAL::parameters::non_manifold()` + */ +unspecified_type manifold(); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::exude()` allows the user to trigger a call to `exude_mesh_3()` in the -`make_mesh_3()` and `refine_mesh_3()` mesh generation functions. -It also allows the user to pass parameters -to the optimization function `exude_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of `exude_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with an exudation step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::exude()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::exude(parameters::time_limit=10)); -\endcode - -\sa `CGAL::parameters::no_exude()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -unspecified_type exude( - double parameters::time_limit = 0, - double parameters::sliver_bound = 0); + * \ingroup PkgMesh3Parameters + * + * The function `parameters::non_manifold()` is used to drive the + * meshing algorithm for surfaces. + * It does not ensure that the surface of the output mesh is a manifold surface. + * The manifold property of the output mesh might nevertheless result from an appropriate + * choice of meshing criteria. + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::manifold_with_boundary()` + * \sa `CGAL::parameters::manifold()` + */ +unspecified_type non_manifold(); /*! -\ingroup PkgMesh3Parameters + * \ingroup PkgMesh3Parameters + * + * The function `parameters::manifold_with_boundary()` is used to drive the + * meshing algorithm for surfaces. + * It ensures that the surface of the output mesh is a manifold surface which + * may have boundaries. + * The manifold property of the output mesh can be achieved only if the input surface + * is a manifold. + * Note that the meshing algorithm provably terminates only if the input + * sharp edges have been protected, using the + * feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::non_manifold()` + * \sa `CGAL::parameters::manifold()` + */ +unspecified_type manifold_with_boundary(); -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 -of `MeshDomainWithFeatures_3`. +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::exude()` allows the user to trigger a call to `exude_mesh_3()` in the + * `make_mesh_3()` and `refine_mesh_3()` mesh generation functions. + * It also allows the user to pass parameters + * to the optimization function `exude_mesh_3()` through these mesh generation functions. + * + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with an exudation step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::exude()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::exude(parameters::time_limit=10)); + * \endcode + * + * \sa `CGAL::parameters::no_exude()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type exude(const Named_function_parameters& np = parameters::default_values()); -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()` - -*/ +/*! + * \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 + * 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()` + * + */ unspecified_type features(); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::lloyd()` allows the user to trigger a call of -`lloyd_optimize_mesh_3()` in the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()`. It also allows the user to pass -parameters to the optimization function -`lloyd_optimize_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of the `lloyd_optimize_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with lloyd optimization step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::lloyd()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::lloyd(parameters::time_limit=10)); - -\endcode - -\sa `CGAL::parameters::no_lloyd()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -unspecified_type lloyd( -double parameters::time_limit = 0, -std::size_t parameters::max_iteration_number = 0, -double parameters::convergence = 0.02, -double parameters::freeze_bound = 0.01, -bool parameters::do_freeze=true); + * \ingroup PkgMesh3Parameters + * + * The function `parameters::lloyd()` allows the user to trigger a call of + * `lloyd_optimize_mesh_3()` in the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()`. It also allows the user to pass + * parameters to the optimization function + * `lloyd_optimize_mesh_3()` through these mesh generation functions. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamPrecondition{`max_iteration_number >=0`} + * \cgalParamType{`int`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{designed to reduce running time of each optimization iteration. + * Any vertex that has a displacement less than a given fraction of the length + * of its shortest incident edge, is frozen (i.e.\ is not relocated). + * The parameter `freeze_bound` gives the threshold ratio. + * If it is set to 0, freezing of vertices is disabled.} + * \cgalParamPrecondition{`0<= freeze_bound <=1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.001} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + * when at the last iteration the displacement of any vertex is less than + * a given fraction of the length of the shortest edge incident to that vertex.} + * \cgalParamPrecondition{`0 <=convergence <= 1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with lloyd optimization step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::lloyd()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::lloyd(parameters::time_limit=10)); + * + * \endcode + * + * \sa `CGAL::parameters::no_lloyd()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type lloyd(const Named_function_parameters& np = parameters::default_values()); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_exude()` allows the user to tell the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()` that no exudation must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without exudation -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_exude()); -\endcode - -\sa `CGAL::parameters::exude()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_exude()` allows the user to tell the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()` that no exudation must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without exudation + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_exude()); + * \endcode + * + * \sa `CGAL::parameters::exude()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ 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. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::parameters::features()` - -*/ + * \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. + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::features()` + * + */ unspecified_type no_features(); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_lloyd()` allows the user to tell the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()` that no lloyd optimization must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without lloyd optimization -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_lloyd()); -\endcode - -\sa `CGAL::parameters::lloyd()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_lloyd()` allows the user to tell the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()` that no lloyd optimization must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without lloyd optimization + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_lloyd()); + * \endcode + * + * \sa `CGAL::parameters::lloyd()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ unspecified_type no_lloyd(); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_odt()` allows the user to tell the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()` that no odt optimization must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without odt optimization -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_odt()); -\endcode - -\sa `CGAL::parameters::odt()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_odt()` allows the user to tell the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()` that no odt optimization must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without odt optimization + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_odt()); + * \endcode + * + * \sa `CGAL::parameters::odt()` + * \sa `CGAL::odt_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ unspecified_type no_odt(); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_perturb()` allows the user to tell mesh generation global functions -`make_mesh_3()` and `refine_mesh_3()` that no perturbation must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without perturbation -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_perturb()); -\endcode - -\sa `CGAL::parameters::perturb()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_perturb()` allows the user to tell mesh generation global functions + * `make_mesh_3()` and `refine_mesh_3()` that no perturbation must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without perturbation + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_perturb()); + * \endcode + * + * \sa `CGAL::parameters::perturb()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ unspecified_type no_perturb(); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::odt()` allows the user to trigger a call to -`CGAL::odt_optimize_mesh_3()` in -`CGAL::make_mesh_3()` and `CGAL::refine_mesh_3()` mesh optimization functions. It also -allows the user to pass parameters to the optimization function -`odt_optimize_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of `odt_optimize_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with odt optimization step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::odt()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::odt(parameters::time_limit=10)); -\endcode - -\sa `CGAL::parameters::no_odt()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -unspecified_type odt( -double parameters::time_limit = 0, -std::size_t parameters::max_iteration_number = 0, -double parameters::convergence = 0.02, -double parameters::freeze_bound = 0.01, -bool parameters::do_freeze=true); + * \ingroup PkgMesh3Parameters + * + * The function `parameters::odt()` allows the user to trigger a call to + * `CGAL::odt_optimize_mesh_3()` in + * `CGAL::make_mesh_3()` and `CGAL::refine_mesh_3()` mesh optimization functions. It also + * allows the user to pass parameters to the optimization function + * `odt_optimize_mesh_3()` through these mesh generation functions. + * + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, + * a CPU time limit after which the optimization process is stopped. This time is + * measured using `Real_timer`. + * The default value is 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{sets a limit on the number of performed iterations. + * The default value of 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamType{`std::size_t`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{is a stopping criterion based on convergence: + * the optimization process is stopped, when at the last iteration, + * the displacement of any vertex is less than a given percentage of the length + * the shortest edge incident to that vertex. + * The parameter `convergence` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= convergence <= 1`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex + * that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is + * not relocated). The parameter `freeze_bound` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= freeze_bound <= 1`} + * \cgalParamDefault{0.01} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true`, + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with odt optimization step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::odt()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::odt(parameters::time_limit=10)); + * \endcode + * + * \sa `CGAL::parameters::no_odt()` + * \sa `CGAL::odt_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type odt(const Named_function_parameters& np = parameters::default_values()); /*! -\ingroup PkgMesh3Parameters - -The function `parameters::perturb()` allows the user to trigger a call to -`perturb_mesh_3()` in -`make_mesh_3()` and `refine_mesh_3()` mesh generation functions. It also -allows the user to pass parameters -to the optimization function `perturb_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of `perturb_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with a perturbation step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::perturb()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::perturb(parameters::time_limit=10)); - -\endcode - -\sa `CGAL::parameters::no_perturb()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -unspecified_type perturb( - double parameters::time_limit = 0, - double parameters::sliver_bound = 0); + * \ingroup PkgMesh3Parameters + * + * The function `parameters::perturb()` allows the user to trigger a call to + * `perturb_mesh_3()` in + * `make_mesh_3()` and `refine_mesh_3()` mesh generation functions. It also + * allows the user to pass parameters + * to the optimization function `perturb_mesh_3()` through these mesh generation functions. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with a perturbation step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::perturb()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::perturb(parameters::time_limit=10)); + * + * \endcode + * + * \sa `CGAL::parameters::no_perturb()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type perturb(const Named_function_parameters& np = parameters::default_values()); } /* namespace parameters */ diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index ddb0804b466..15184d651b8 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -153,9 +153,60 @@ struct Mesh_3_options { }; // end struct Mesh_3_options +// Features +struct Features_options +{ + Features_options(bool b) : b_(b) {} + bool features() const { return b_; } +private: + bool b_; +}; + +// ----------------------------------- +// Features generator +// ----------------------------------- +// struct Features_option_generator +template +struct Features_options_generator {}; + +template<> +struct Features_options_generator +{ + Features_options operator()() { return Features_options(true); } +}; + +template<> +struct Features_options_generator +{ + Features_options operator()() { return Features_options(false); } +}; + +// struct Domain_features_generator is designed to handle cases where +// MeshDomain::Has_features is not a valid type +template< typename MeshDomain, bool MeshDomainHasHasFeatures > +struct Domain_features_generator {}; + +template< typename MeshDomain > +struct Domain_features_generator< MeshDomain, false > +{ + Features_options operator()() + { + return Features_options_generator()(); + } +}; + +template< typename MeshDomain > +struct Domain_features_generator< MeshDomain, true > +{ + Features_options operator()() + { + return Features_options_generator()(); + } +}; + } // end namespace internal -// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. +// Undocumented parameter for refine_mesh_3 and make_mesh_3. // Default Mesh_3_options: dump at every stage of the mesh generation. inline internal::Mesh_3_options mesh_3_dump() { @@ -170,14 +221,15 @@ inline internal::Mesh_3_options mesh_3_dump() return options; } - template - struct Base - { - Base(T t) : t_(t) {} - T operator()() const { return t_; } - private: - T t_; - }; + +template +struct Base +{ + Base(T t) : t_(t) {} + T operator()() const { return t_; } +private: + T t_; +}; // ----------------------------------- // Reset_c3t3 (undocumented) @@ -200,7 +252,8 @@ CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) // Perturb // ----------------------------------- template -Named_function_parameters perturb(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters +perturb(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -218,23 +271,38 @@ Named_function_parameters -Named_function_parameters perturb(const CGAL_NP_CLASS& ... nps) +Named_function_parameters +perturb(const CGAL_NP_CLASS& ... nps) { return perturb(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_perturb() +inline Named_function_parameters +no_perturb() { typedef Named_function_parameters Param; return Param(internal::Perturb_options(false)); } +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters +perturb(double time_limit_, + double sliver_bound_=0) +{ + return perturb(time_limit(time_limit_). + sliver_bound(sliver_bound_)); +} +#endif + // ----------------------------------- // Exude // ----------------------------------- template -Named_function_parameters exude(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters +exude(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -252,22 +320,36 @@ Named_function_parameters -Named_function_parameters exude(const CGAL_NP_CLASS& ... nps) +Named_function_parameters +exude(const CGAL_NP_CLASS& ... nps) { return exude(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_exude() +inline Named_function_parameters +no_exude() { typedef Named_function_parameters Param; return Param(internal::Exude_options(false)); } +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters +exude(double time_limit_, + double sliver_bound_ = 0) +{ + return exude(time_limit(time_limit_).sliver_bound(sliver_bound_)); +} +#endif + // ----------------------------------- // Odt // ----------------------------------- template -Named_function_parameters odt(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters +odt(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -286,22 +368,43 @@ Named_function_parameters -Named_function_parameters odt(const CGAL_NP_CLASS& ... nps) +Named_function_parameters +odt(const CGAL_NP_CLASS& ... nps) { return odt(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_odt() +inline Named_function_parameters +no_odt() { typedef Named_function_parameters Param; return Param(internal::Odt_options(false)); } +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters +odt(double time_limit_, + std::size_t max_iteration_number_ = 0, + double convergence_ = 0.02, + double freeze_bound_ = 0.01, + bool do_freeze_ = true) +{ + return odt(time_limit(time_limit_). + max_iteration_number(max_iteration_number_). + convergence(convergence_). + freeze_bound(freeze_bound_). + do_freeze(do_freeze_)); +} +#endif + // ----------------------------------- // Lloyd // ----------------------------------- template -Named_function_parameters lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters +lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -320,24 +423,44 @@ Named_function_parameters -Named_function_parameters lloyd(const CGAL_NP_CLASS& ... nps) +Named_function_parameters +lloyd(const CGAL_NP_CLASS& ... nps) { return lloyd(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters no_lloyd() +inline Named_function_parameters +no_lloyd() { typedef Named_function_parameters Param; return Param(internal::Lloyd_options(false)); } +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters +lloyd(double time_limit_, + std::size_t max_iteration_number_ = 0, + double convergence_ = 0.02, + double freeze_bound_ = 0.01, + bool do_freeze_= true) +{ + return lloyd(time_limit(time_limit_). + max_iteration_number(max_iteration_number_). + convergence(convergence_). + freeze_bound(freeze_bound_). + do_freeze(do_freeze_)); +} +#endif + // ----------------------------------- -// Manifold options ------------------ +// Manifold options // ----------------------------------- template -Named_function_parameters manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters +manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -351,23 +474,27 @@ Named_function_parameters -Named_function_parameters manifold_options(const CGAL_NP_CLASS& ... nps) +Named_function_parameters +manifold_options(const CGAL_NP_CLASS& ... nps) { return manifold_options(internal_np::combine_named_parameters(nps...)); } -inline Named_function_parameters manifold() +inline Named_function_parameters +manifold() { typedef Named_function_parameters Param; return Param(internal::Manifold_options(internal::Manifold_options::MANIFOLD)); } -inline Named_function_parameters manifold_with_boundary() +inline Named_function_parameters +manifold_with_boundary() { typedef Named_function_parameters Param; return Param(internal::Manifold_options( internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); } -inline Named_function_parameters non_manifold() +inline Named_function_parameters +non_manifold() { typedef Named_function_parameters Param; return Param(internal::Manifold_options(internal::Manifold_options::NON_MANIFOLD)); @@ -377,12 +504,13 @@ inline Named_function_parameters -Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) +Named_function_parameters +mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) { using parameters::choose_parameter; using parameters::get_parameter; @@ -408,11 +536,37 @@ Named_function_parameters m } template -Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& ... nps) +Named_function_parameters +mesh_3_options(const CGAL_NP_CLASS& ... nps) { return mesh_3_options(internal_np::combine_named_parameters(nps...)); } +// ----------------------------------- +// Features_options +// ----------------------------------- +inline Named_function_parameters +features() { + typedef Named_function_parameters Param; + return Param(internal::Features_options(true)); +} + +inline Named_function_parameters +no_features() { + typedef Named_function_parameters Param; + return Param(internal::Features_options(false)); } + +template < typename MeshDomain > +inline Named_function_parameters +features(const MeshDomain& /*domain*/) +{ +typedef typename internal::Domain_features_generator< + MeshDomain, + CGAL::Mesh_3::internal::has_Has_features::value > Generator; + +typedef Named_function_parameters Param; +return Param(Generator()()); +} } } //namespace CGAL::parameters diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index a4694082222..6ebd6ab8166 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -34,89 +34,6 @@ namespace CGAL { -namespace parameters { - namespace internal { - // Features - struct Features_options - { - Features_options(bool b) : b_(b) {} - bool features() const { return b_; } - private: - bool b_; - }; - - // ----------------------------------- - // Features generator - // ----------------------------------- - // struct Features_option_generator - template - struct Features_options_generator {}; - - template<> - struct Features_options_generator - { - Features_options operator()() { return Features_options(true); } - }; - - template<> - struct Features_options_generator - { - Features_options operator()() { return Features_options(false); } - }; - - // struct Domain_features_generator is designed to handle cases where - // MeshDomain::Has_features is not a valid type - template< typename MeshDomain, bool MeshDomainHasHasFeatures > - struct Domain_features_generator {}; - - template< typename MeshDomain > - struct Domain_features_generator< MeshDomain, false > - { - Features_options operator()() - { - return Features_options_generator()(); - } - }; - - template< typename MeshDomain > - struct Domain_features_generator< MeshDomain, true > - { - Features_options operator()() - { - return Features_options_generator()(); - } - }; - - } // end namespace internal - - // ----------------------------------- - // Features_options - // ----------------------------------- - inline Named_function_parameters - features() { - typedef Named_function_parameters Param; - return Param(internal::Features_options(true)); - } - - inline Named_function_parameters - no_features() { - typedef Named_function_parameters Param; - return Param(internal::Features_options(false)); } - - template < typename MeshDomain > - inline Named_function_parameters - features(const MeshDomain& /*domain*/) - { - typedef typename internal::Domain_features_generator< - MeshDomain, - CGAL::Mesh_3::internal::has_Has_features::value > Generator; - - typedef Named_function_parameters Param; - return Param(Generator()()); - } - -} // end namespace parameters::internal - // ----------------------------------- // Initialize c3t3 stuff // ----------------------------------- diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index ac6d1b338d8..c8b5d87a04e 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -48,7 +48,6 @@ namespace CGAL { * * \tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3` * \tparam MD a model of the concept `MeshDomain_3` - * * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * * @param c3t3 the initial mesh and is modified by the algorithm to represent the final optimized mesh From 6b07cbdadd8f2f9150fb1837be6b1bb42e2cbdfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 15:45:14 +0200 Subject: [PATCH 077/248] clean up Mesh_3 internal parameters --- Mesh_3/include/CGAL/Mesh_3/parameters.h | 67 ++--- Mesh_3/include/CGAL/refine_mesh_3.h | 4 +- .../Mesh_3/test_labeled_mesh_domain_3.cpp | 280 +++++++++--------- .../include/CGAL/refine_periodic_3_mesh_3.h | 4 +- .../internal/parameters_interface.h | 2 +- 5 files changed, 176 insertions(+), 181 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 15184d651b8..6df4476b0a1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -206,47 +206,24 @@ struct Domain_features_generator< MeshDomain, true > } // end namespace internal -// Undocumented parameter for refine_mesh_3 and make_mesh_3. -// Default Mesh_3_options: dump at every stage of the mesh generation. -inline internal::Mesh_3_options mesh_3_dump() -{ - internal::Mesh_3_options options; - options.dump_after_init_prefix = "mesh_dump_after_init"; - options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; - options.dump_after_refine_prefix = "mesh_dump_after_refine"; - options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; - options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; - options.dump_after_exude_prefix = "mesh_dump_after_exude"; - - return options; -} - -template -struct Base -{ - Base(T t) : t_(t) {} - T operator()() const { return t_; } -private: - T t_; -}; // ----------------------------------- // Reset_c3t3 (undocumented) // ----------------------------------- +inline +Named_function_parameters +reset_c3t3() +{ + return Named_function_parameters(true); +} -#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ - struct Class : public Base { Class(bool b) : Base(b){} }; \ - inline Named_function_parameters function_true() { \ - typedef Named_function_parameters Param; \ - return Param(Class(true)); } \ - inline Named_function_parameters function_false() {\ - typedef Named_function_parameters Param; \ - return Param(Class(false)); } - -CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) - -#undef CGAL_BOOLEAN_PARAMETER +inline +Named_function_parameters +no_reset_c3t3() +{ + return Named_function_parameters(false); +} // ----------------------------------- // Perturb @@ -507,7 +484,6 @@ non_manifold() // Undocumented parameter for refine_mesh_3 and make_mesh_3. // Allows to dump the mesh at given stage of the mesh generation // algorithm. - template Named_function_parameters mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) @@ -542,6 +518,25 @@ mesh_3_options(const CGAL_NP_CLASS& ... nps) return mesh_3_options(internal_np::combine_named_parameters(nps...)); } +// Undocumented parameter for refine_mesh_3 and make_mesh_3. +// Default Mesh_3_options: dump at every stage of the mesh generation. +inline +Named_function_parameters +mesh_3_dump() +{ + typedef Named_function_parameters Param; + internal::Mesh_3_options options; + + options.dump_after_init_prefix = "mesh_dump_after_init"; + options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; + options.dump_after_refine_prefix = "mesh_dump_after_refine"; + options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; + options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; + options.dump_after_exude_prefix = "mesh_dump_after_exude"; + + return Param(options); +} + // ----------------------------------- // Features_options // ----------------------------------- diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 7e55cb69e38..9f7ebe370a2 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -269,7 +269,7 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const 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); - parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3().v); + bool reset = choose_parameter(get_parameter(np, internal_np::do_reset_c3t3), false); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); @@ -280,7 +280,7 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const perturb_param, odt_param, lloyd_param, - reset_param(), + reset, mesh_options_param, manifold_options_param); } diff --git a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp index 0c3a1b8c7bb..25a468bbf6f 100644 --- a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp +++ b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp @@ -42,8 +42,8 @@ struct LM3_tester static FT shape_function (const Point_3& p) { - if (p.x() < 0) - return -1; + if (p.x() < 0) + return -1; const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z(); return x2 + y2 + z2 - 1; } @@ -56,12 +56,12 @@ struct LM3_tester void operator() () const { - typedef typename K::Sphere_3 Sphere_3; - typedef typename K::Iso_cuboid_3 Iso_cuboid_3; + typedef typename K::Sphere_3 Sphere_3; + typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - test_domain(Sphere_3(CGAL::ORIGIN, 4.)); - test_domain(CGAL::Bbox_3(-2.,-2.,-2., 2.,2.,2.)); - test_domain(Iso_cuboid_3(Point_3(-2.,-2.,-2.), Point_3(2.,2.,2.))); + test_domain(Sphere_3(CGAL::ORIGIN, 4.)); + test_domain(CGAL::Bbox_3(-2.,-2.,-2., 2.,2.,2.)); + test_domain(Iso_cuboid_3(Point_3(-2.,-2.,-2.), Point_3(2.,2.,2.))); } private: @@ -72,12 +72,12 @@ private: Function f_sphere(&sphere_function); Function_wrapper wrapper_1(f_sphere); - Mesh_domain domain(wrapper_1, bounding_shape, error_bound); + Mesh_domain domain(wrapper_1, bounding_shape, CGAL::parameters::relative_error_bound(error_bound)); test_construct_initial_points(domain, error_bound); Function f_shape(&shape_function); Function_wrapper wrapper_2(f_shape); - Mesh_domain domain_2(wrapper_2, bounding_shape, error_bound); + Mesh_domain domain_2(wrapper_2, bounding_shape, CGAL::parameters::relative_error_bound(error_bound)); test_is_in_domain(domain_2); test_do_intersect_surface(domain_2); test_construct_intersection(domain_2); @@ -85,171 +85,171 @@ private: void test_construct_initial_points (const Mesh_domain& domain, FT error_bound) const { - typedef typename Mesh_domain::Construct_initial_points Construct_initial_points; - typedef typename Mesh_domain::Index Index; - typedef typename std::vector >::const_iterator Points_const_iterator; - typedef typename K::Compute_squared_distance_3 Compute_squared_distance_3; + typedef typename Mesh_domain::Construct_initial_points Construct_initial_points; + typedef typename Mesh_domain::Index Index; + typedef typename std::vector >::const_iterator Points_const_iterator; + typedef typename K::Compute_squared_distance_3 Compute_squared_distance_3; - Compute_squared_distance_3 squared_distance = K().compute_squared_distance_3_object(); + Compute_squared_distance_3 squared_distance = K().compute_squared_distance_3_object(); - Construct_initial_points construct_initial_points = domain.construct_initial_points_object(); - std::vector > points; - int point_count = 12; - construct_initial_points(std::back_inserter(points), point_count); + Construct_initial_points construct_initial_points = domain.construct_initial_points_object(); + std::vector > points; + int point_count = 12; + construct_initial_points(std::back_inserter(points), point_count); - for (Points_const_iterator iter = points.begin(), end_iter = points.end(); iter != end_iter; ++iter) - { - const Point_3& p = iter->first; + for (Points_const_iterator iter = points.begin(), end_iter = points.end(); iter != end_iter; ++iter) + { + const Point_3& p = iter->first; - FT sd = squared_distance(CGAL::ORIGIN, p); - FT diff = sd - 1; - if (diff < FT(0.)) - diff = -diff; - assert(diff <= error_bound); - } + FT sd = squared_distance(CGAL::ORIGIN, p); + FT diff = sd - 1; + if (diff < FT(0.)) + diff = -diff; + assert(diff <= error_bound); + } } void test_is_in_domain (const Mesh_domain& domain) const { - typedef typename Mesh_domain::Is_in_domain Is_in_domain; - typedef typename Mesh_domain::Subdomain Subdomain; - typedef typename Mesh_domain::Subdomain_index Subdomain_index; + typedef typename Mesh_domain::Is_in_domain Is_in_domain; + typedef typename Mesh_domain::Subdomain Subdomain; + typedef typename Mesh_domain::Subdomain_index Subdomain_index; - Is_in_domain is_in_domain = domain.is_in_domain_object(); + Is_in_domain is_in_domain = domain.is_in_domain_object(); - { - Subdomain subdomain = is_in_domain(Point_3(CGAL::ORIGIN)); - assert(subdomain); - Subdomain_index subdomain_index = *subdomain; - assert(subdomain_index == 1); - } + { + Subdomain subdomain = is_in_domain(Point_3(CGAL::ORIGIN)); + assert(subdomain); + Subdomain_index subdomain_index = *subdomain; + assert(subdomain_index == 1); + } - { - Subdomain subdomain = is_in_domain(Point_3(1.5, 0., 0.)); - assert(!subdomain); - } + { + Subdomain subdomain = is_in_domain(Point_3(1.5, 0., 0.)); + assert(!subdomain); + } } void test_do_intersect_surface (const Mesh_domain& domain) const { - typedef typename Mesh_domain::Do_intersect_surface Do_intersect_surface; - typedef typename Mesh_domain::Surface_patch Surface_patch; - typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; - typedef typename Mesh_domain::Segment_3 Segment_3; - typedef typename Mesh_domain::Ray_3 Ray_3; - typedef typename Mesh_domain::Line_3 Line_3; - typedef typename Mesh_domain::Vector_3 Vector_3; + typedef typename Mesh_domain::Do_intersect_surface Do_intersect_surface; + typedef typename Mesh_domain::Surface_patch Surface_patch; + typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; + typedef typename Mesh_domain::Segment_3 Segment_3; + typedef typename Mesh_domain::Ray_3 Ray_3; + typedef typename Mesh_domain::Line_3 Line_3; + typedef typename Mesh_domain::Vector_3 Vector_3; - Do_intersect_surface do_intersect_surface = domain.do_intersect_surface_object(); + Do_intersect_surface do_intersect_surface = domain.do_intersect_surface_object(); - { - Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Surface_patch p = do_intersect_surface(s); - assert(p); - Surface_patch_index pi = *p; - assert(pi.first == 0 && pi.second == 1); - } + { + Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Surface_patch p = do_intersect_surface(s); + assert(p); + Surface_patch_index pi = *p; + assert(pi.first == 0 && pi.second == 1); + } - { - Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); - Surface_patch p = do_intersect_surface(s); - assert(!p); - } + { + Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); + Surface_patch p = do_intersect_surface(s); + assert(!p); + } - { - Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); - Surface_patch p = do_intersect_surface(r); - assert(p); - Surface_patch_index pi = *p; - assert(pi.first == 0 && pi.second == 1); - } + { + Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); + Surface_patch p = do_intersect_surface(r); + assert(p); + Surface_patch_index pi = *p; + assert(pi.first == 0 && pi.second == 1); + } - { - Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); - Surface_patch p = do_intersect_surface(r); - assert(!p); - } + { + Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); + Surface_patch p = do_intersect_surface(r); + assert(!p); + } - { - Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Surface_patch p = do_intersect_surface(l); - assert(p); - Surface_patch_index pi = *p; - assert(pi.first == 0 && pi.second == 1); - } + { + Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Surface_patch p = do_intersect_surface(l); + assert(p); + Surface_patch_index pi = *p; + assert(pi.first == 0 && pi.second == 1); + } - { - Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); - Surface_patch p = do_intersect_surface(l); - assert(!p); - } + { + Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); + Surface_patch p = do_intersect_surface(l); + assert(!p); + } } void test_construct_intersection (const Mesh_domain& domain) const { - typedef typename Mesh_domain::Construct_intersection Construct_intersection; - typedef typename Mesh_domain::Intersection Intersection; - typedef typename Mesh_domain::Subdomain_index Subdomain_index; - typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; - typedef typename Mesh_domain::Index Index; - typedef typename Mesh_domain::Segment_3 Segment_3; - typedef typename Mesh_domain::Ray_3 Ray_3; - typedef typename Mesh_domain::Line_3 Line_3; - typedef typename Mesh_domain::Vector_3 Vector_3; + typedef typename Mesh_domain::Construct_intersection Construct_intersection; + typedef typename Mesh_domain::Intersection Intersection; + typedef typename Mesh_domain::Subdomain_index Subdomain_index; + typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; + typedef typename Mesh_domain::Index Index; + typedef typename Mesh_domain::Segment_3 Segment_3; + typedef typename Mesh_domain::Ray_3 Ray_3; + typedef typename Mesh_domain::Line_3 Line_3; + typedef typename Mesh_domain::Vector_3 Vector_3; - Construct_intersection construct_intersection = domain.construct_intersection_object(); + Construct_intersection construct_intersection = domain.construct_intersection_object(); - { - Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Intersection i = construct_intersection(s); - assert(std::get<0>(i) != Point_3(1., 0., 0.)); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 2); - } + { + Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Intersection i = construct_intersection(s); + assert(std::get<0>(i) != Point_3(1., 0., 0.)); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 2); + } - { - Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); - Intersection i = construct_intersection(s); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 0); - } + { + Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); + Intersection i = construct_intersection(s); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 0); + } - { - Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); - Intersection i = construct_intersection(r); - assert(std::get<0>(i) != Point_3(1., 0., 0.)); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 2); - } + { + Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); + Intersection i = construct_intersection(r); + assert(std::get<0>(i) != Point_3(1., 0., 0.)); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 2); + } - { - Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); - Intersection i = construct_intersection(r); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 0); - } + { + Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); + Intersection i = construct_intersection(r); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 0); + } - { - Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Intersection i = construct_intersection(l); - assert(std::get<0>(i) != Point_3(1., 0., 0.)); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 2); - } + { + Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Intersection i = construct_intersection(l); + assert(std::get<0>(i) != Point_3(1., 0., 0.)); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 2); + } - { - Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); - Intersection i = construct_intersection(l); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 0); - } + { + Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); + Intersection i = construct_intersection(l); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 0); + } } }; 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 f27e56761ee..a21c0a54bd2 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 @@ -311,7 +311,7 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::no_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); - parameters::Reset reset_param = choose_parameter(get_parameter(np, internal_np::reset_options_param), parameters::reset_c3t3().v); + bool reset = choose_parameter(get_parameter(np, internal_np::do_reset_c3t3), false); parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); @@ -322,7 +322,7 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit perturb_param, odt_param, lloyd_param, - reset_param(), + reset, mesh_options_param, manifold_options_param); } diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 01b9cae28ad..d252c0c227a 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -297,7 +297,7 @@ CGAL_add_named_parameter_with_compatibility(exude_options_param_t, exude_options CGAL_add_named_parameter_with_compatibility(perturb_options_param_t, perturb_options_param, perturb_options) CGAL_add_named_parameter_with_compatibility(odt_options_param_t, odt_options_param, odt_options) CGAL_add_named_parameter_with_compatibility(lloyd_options_param_t, lloyd_options_param, lloyd_options) -CGAL_add_named_parameter_with_compatibility(reset_options_param_t, reset_options_param, reset_options) +CGAL_add_named_parameter_with_compatibility(do_reset_c3t3_t, do_reset_c3t3, do_reset_c3t3) CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_options) CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) From 7a6faa7c38811d8e8522ca58d6bf90c85cfa55fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 16:40:22 +0200 Subject: [PATCH 078/248] use precondition macro --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index e7e897c777b..98668866d92 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -76,7 +76,7 @@ namespace CGAL * \cgalParamNBegin{max_iteration_number} * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is * no limit on the number of performed iterations.} - * \cgalParamExtra{\pre `max_iteration_number >=0`} + * \cgalParamPrecondition{`max_iteration_number >=0`} * \cgalParamType{`int`} * \cgalParamDefault{0} * \cgalParamNEnd @@ -85,7 +85,7 @@ namespace CGAL * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamExtra{\pre `time_limit` \f$ \geq\f$ 0} + * \cgalParamPrecondition{`time_limit` \f$ \geq\f$ 0} * \cgalParamDefault{0} * \cgalParamNEnd * @@ -95,7 +95,7 @@ namespace CGAL * of its shortest incident edge, is frozen (i.e.\ is not relocated). * The parameter `freeze_bound` gives the threshold ratio. * If it is set to 0, freezing of vertices is disabled.} - * \cgalParamExtra{\pre `0<= freeze_bound <=1} + * \cgalParamPrecondition{`0<= freeze_bound <=1`} * \cgalParamType{`double`} * \cgalParamDefault{0.001} * \cgalParamNEnd @@ -104,7 +104,7 @@ namespace CGAL * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped * when at the last iteration the displacement of any vertex is less than * a given fraction of the length of the shortest edge incident to that vertex.} - * \cgalParamExtra{\pre `0 <=convergence <= 1`} + * \cgalParamPrecondition{`0 <=convergence <= 1`} * \cgalParamType{`double`} * \cgalParamDefault{0.001} * \cgalParamNEnd From d2cd6244ff8b94f9ba3da4ebf64e85a6d7521232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 17:20:29 +0200 Subject: [PATCH 079/248] clean up Periodic_3_mesh_3 doc --- Mesh_3/include/CGAL/refine_mesh_3.h | 2 + .../CGAL/optimize_periodic_3_mesh_3.h | 83 ---- .../doc/Periodic_3_mesh_3/Doxyfile.in | 3 +- .../include/CGAL/make_periodic_3_mesh_3.h | 350 ++++++++-------- .../include/CGAL/optimize_periodic_3_mesh_3.h | 119 ++++-- .../include/CGAL/refine_periodic_3_mesh_3.h | 377 +++++++++--------- 6 files changed, 448 insertions(+), 486 deletions(-) delete mode 100644 Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 9f7ebe370a2..6d97ea56937 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -153,6 +153,8 @@ private: * \tparam MC either a model of the concept `MeshCriteria_3` or a model * of `MeshCriteriaWithFeatures_3` if the domain has exposed features. * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters + * * \param c3t3 the mesh to be refined that is modified by the refinement process. * As the refinement process only adds points to the triangulation, all * vertices of the triangulation of `c3t3` remain in the diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h deleted file mode 100644 index af1e2224ca8..00000000000 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h +++ /dev/null @@ -1,83 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `lloyd_optimize_periodic_3_mesh_3()` is a periodic mesh optimization -process based on the minimization of a global energy function. - -This function directly calls `lloyd_optimize_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `lloyd_optimize_mesh_3()`. - -\note This function requires the \ref thirdpartyEigen library. -*/ -template -CGAL::Mesh_optimization_return_code -lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `odt_optimize_periodic_3_mesh_3()` is a periodic mesh optimization -process based on the minimization of a global energy function. - -This function directly calls `odt_optimize_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `odt_optimize_mesh_3()`. -*/ -template -Mesh_optimization_return_code -odt_optimize_periodic_3_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that -improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh. - -This function directly calls `perturb_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `perturb_mesh_3()`. -*/ -template -CGAL::Mesh_optimization_return_code -perturb_periodic_3_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `exude_periodic_3_mesh_3()` performs a sliver exudation process -on a periodic Delaunay mesh. - -The sliver exudation process consists in optimizing the weights of vertices -of the periodic weighted Delaunay triangulation in such a way that slivers disappear -and the quality of the mesh improves. - -\warning This optimizer modifies the weight of vertices of the periodic triangulation -and, if called, must be the last optimizer to be called. If the mesh is refined after -this optimization has been performed, all improvements will be lost. - -This function directly calls `exude_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `exude_mesh_3()`. -*/ -template -CGAL::Mesh_optimization_return_code -exude_periodic_3_mesh_3(C3T3& c3t3, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in index b10860987eb..64d22001a23 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in @@ -2,7 +2,8 @@ INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_periodic_3_mesh_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_periodic_3_mesh_3.h + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_periodic_3_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/optimize_periodic_3_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Periodic Mesh Generation" EXTRACT_ALL = false HIDE_UNDOC_CLASSES = true diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index cd0fd70a1a6..8870e19a591 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -167,186 +167,182 @@ struct C3t3_initializer // ----------------------------------- /*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. -It produces simplicial meshes which discretize 3D periodic domains. -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Periodic_3_mesh_3_section_examples ). - - -\tparam C3T3 is required to be a model of -the concept `MeshComplex_3InTriangulation_3`. This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3`, or of the refined concept -`MeshDomainWithFeatures_3` -if the domain has corners and curves that need to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC has to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - -\param domain the domain to be discretized -\param criteria the criteria -\param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - -\cgalNamedParamsBegin - \cgalParamNBegin{features_options} - \cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be - taken into account or not - when the domain is a model of `MeshDomainWithFeatures_3`. - The type `Features` of this parameter is an internal undescribed type. - The library provides functions to construct appropriate values of that type. -
      -
    • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, - i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a - `MeshDomainWithFeatures_3`. This is the default behavior - if parameter `features` is not specified. -
    • `parameters::no_features()` prevents the representation - of 0 and 1-dimensional features in the mesh. -
    } - \cgalParamType{`parameters::features()' OR `parameters::features(domain)`} - \cgalParamDefault{`parameters::features(domain)`} - - \cgalParamNBegin{manifold_option} - \cgalParamDescription{allows the user to drive the meshing algorithm, - and ensure that the output mesh surface follows the given manifold criterion. - It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` - and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold - surface if the input surface is not manifold.} - \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} - \cgalParamDefault{`parameters::non_manifold()`} - - \cgalParamNBegin{lloyd_options} - \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to - trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the - parameters of this optimizer. If one parameter is not set, the default value of - `lloyd_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} - \cgalParamDefault{`parameters::no_lloyd()`} - - \cgalParamNBegin{odt_options} - \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to - trigger or not a call to `odt_optimize_mesh_3()` function and - to set the parameters of this optimizer. - If one parameter is not set, the default value of - `odt_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} - \cgalParamDefault{`parameters::no_odt()`} - - \cgalParamNBegin{perturb_options} - \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to - trigger or not a call to `perturb_mesh_3()` function and - to set the parameters of this optimizer. If one parameter is not set, the default value of - `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} - \cgalParamDefault{`parameters::no_perturb`} - - \cgalParamNBegin{exude_options} - \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to - trigger or not a call to `exude_mesh_3()` function and to override to set the - parameters of this optimizer. If one parameter is not set, the default value of - `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} - \cgalParamDefault{`parameters::no_exude`} - -\cgalNamedParamsEnd - - The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_periodic_3_mesh_3()` -\sa `make_mesh_3()` -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `parameters::manifold()` -\sa `parameters::manifold_with_boundary()` -\sa `parameters::non_manifold()` -\sa `exude_mesh_3()` -\sa `perturb_mesh_3()` -\sa `lloyd_optimize_mesh_3()` -\sa `odt_optimize_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` -*/ + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. + * It produces simplicial meshes which discretize 3D periodic domains. + * The periodic mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, + * etc. + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process can be activated or not, according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, + * and sliver perturber should never be called after the sliver exuder. + * In the case of further refinement, only the sliver exuder can be used. + * The function outputs the mesh to an object which provides iterators to + * traverse the resulting mesh data structure or can be written to a file + * (see \ref Periodic_3_mesh_3_section_examples ). + * + * + * \tparam C3T3 is required to be a model of + * the concept `MeshComplex_3InTriangulation_3`. This is the return type. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` + * respectively. + * + * \tparam MD is required to be a model of + * the concept `MeshDomain_3`, or of the refined concept + * `MeshDomainWithFeatures_3` + * if the domain has corners and curves that need to be accurately represented in the mesh. + * The argument `domain` + * is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * + * \tparam MC has to be a model of the concept + * `MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. + * The argument `criteria` of type `MC` specifies the + * size and shape requirements for mesh tetrahedra + * and surface facets. These criteria + * form the rules which drive the refinement process. All mesh elements + * satisfy those criteria at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * + * \param domain the domain to be discretized + * \param criteria the criteria + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamSectionBegin{Feature preservation options} + * \cgalParamDescription{If the domain is a model of `MeshDomainWithFeatures_3`, 0 and 1-dimensional features can be + * taken into account while generating the mesh. The following two named parameters control + * this option: + *
      + *
    • \link parameters::features() `parameters::features(domain)` \endlink + *
    • `parameters::no_features()` + *
    } + * \cgalParamDefault{`parameters::features(domain)`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::exude()` + *
    • `parameters::no_exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamSectionEnd + * \cgalNamedParamsEnd + * + * The optimization parameters can be passed in an arbitrary order. If one parameter + * is not passed, its default value is used. The default values are + * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + * + * Note that whatever may be the optimization processes activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `refine_periodic_3_mesh_3()` + * \sa `make_mesh_3()` + * \sa `parameters::features()` + * \sa `parameters::no_features()` + * \sa `parameters::manifold()` + * \sa `parameters::manifold_with_boundary()` + * \sa `parameters::non_manifold()` + * \sa `exude_mesh_3()` + * \sa `perturb_mesh_3()` + * \sa `lloyd_optimize_mesh_3()` + * \sa `odt_optimize_mesh_3()` + * \sa `parameters::exude()` + * \sa `parameters::no_exude()` + * \sa `parameters::perturb()` + * \sa `parameters::no_perturb()` + * \sa `parameters::lloyd()` + * \sa `parameters::no_lloyd()` + * \sa `parameters::odt()` + * \sa `parameters::no_odt()` + */ template C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - C3T3 c3t3; - 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); - parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); - parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); - parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + using parameters::choose_parameter; + using parameters::get_parameter; + C3T3 c3t3; + 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); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - make_periodic_3_mesh_3_impl(c3t3, domain, criteria, - exude_param, perturb_param, odt_param, lloyd_param, - features_param.features(), mesh_options_param, - manifold_options_param); - return c3t3; + make_periodic_3_mesh_3_impl(c3t3, domain, criteria, + exude_param, perturb_param, odt_param, lloyd_param, + features_param.features(), mesh_options_param, + manifold_options_param); + return c3t3; } @@ -354,7 +350,7 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG template C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { - return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); + return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } 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 b989055d1bd..7ab4d9642a9 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 @@ -24,96 +24,139 @@ namespace CGAL { // ---------------------------------- pertuber --------------------------------- +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that + * improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh. + * + * This function directly calls `perturb_mesh_3()`, but is provided for convenience. + * Further information can be found on the documentation of the function `perturb_mesh_3()`. + */ template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); - auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); - auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); - return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { - return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); + return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } template Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { - return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); + return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } // ---------------------------------- exuder ----------------------------------- - +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `exude_periodic_3_mesh_3()` performs a sliver exudation process + * on a periodic Delaunay mesh. + * + * The sliver exudation process consists in optimizing the weights of vertices + * of the periodic weighted Delaunay triangulation in such a way that slivers disappear + * and the quality of the mesh improves. + * + * \warning This optimizer modifies the weight of vertices of the periodic triangulation + * and, if called, must be the last optimizer to be called. If the mesh is refined after + * this optimization has been performed, all improvements will be lost. + * + * This function directly calls `exude_mesh_3()`, but is provided for convenience. + * Further information can be found on the documentation of the function `exude_mesh_3()`. + */ template Mesh_optimization_return_code exude_periodic_3_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); } template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { - return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); + return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } template Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { - return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); + return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } // ------------------------------ odt optimizer -------------------------------- - +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `odt_optimize_periodic_3_mesh_3()` is a periodic mesh optimization + * process based on the minimization of a global energy function. + * + * This function directly calls `odt_optimize_mesh_3()`, but is provided for convenience. + * Further information can be found on the documentation of the function `odt_optimize_mesh_3()`. + */ template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); - double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); - double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); - bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); - return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { - return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); + return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) { - return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); + return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } // ------------------------------- lloyd optimizer ----------------------------- +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `lloyd_optimize_periodic_3_mesh_3()` is a periodic mesh optimization + * process based on the minimization of a global energy function. + * + * This function directly calls `lloyd_optimize_mesh_3()`, but is provided for convenience. + * Further information can be found on the documentation of the function `lloyd_optimize_mesh_3()`. + * + * \note This function requires the \ref thirdpartyEigen library. +*/ template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain,const CGAL_NP_CLASS& np = parameters::default_values()) { - 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 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); - return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); + 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 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); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { - return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); + return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } } // namespace CGAL 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 a21c0a54bd2..40ac29fe83e 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 @@ -134,204 +134,207 @@ void project_points(C3T3& c3t3, } // namespace internal /*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `refine_periodic_3_mesh_3()` is a 3D periodic -mesh generator. It produces periodic simplicial meshes which discretize -3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_periodic_3_mesh_3()` may be used -to refine a previously computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); - -CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); -\endcode - -\attention Note that the triangulation must form at all times a simplicial complex within -a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro -of the manual of 3D periodic triangulations). It is the responsability of the user to provide -a triangulation that satisfies this condition when calling the refinement -function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh -complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` -will always satisfy this condition. - - -\tparam C3T3 is required to be a model of -the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3` is passed by -reference as this object is modified by the refinement process. As the -refinement process only adds points to the triangulation, all -vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. Object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `Periodic_3MeshDomain_3` or of the refined concept -`Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` -if the domain has exposed features. The argument `criteria` of -type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\param c3t3 the mesh to be refined. -\param domain the domain to be discretized -\param criteria the criteria -\param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: - -The following four parameters are optional optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalNamedParamsBegin - \cgalParamNBegin{manifold_option} - \cgalParamDescription{allows the user to drive the meshing algorithm, - and ensure that the output mesh surface follows the given manifold criterion. - It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` - and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold - surface if the input surface is not manifold.} - \cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`} - \cgalParamDefault{`parameters::non_manifold()`} - - \cgalParamNBegin{lloyd_options} - \cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to - trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the - parameters of this optimizer. If one parameter is not set, the default value of - `lloyd_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`} - \cgalParamDefault{`parameters::no_lloyd()'} - - \cgalParamNBegin{odt_options} - \cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to - trigger or not a call to `odt_optimize_mesh_3()` function and - to set the parameters of this optimizer. - If one parameter is not set, the default value of - `odt_optimize_mesh_3()` is used for this parameter.} - \cgalParamType{`parameters::odt()` OR `parameters::no_odt()`} - \cgalParamDefault{`parameters::no_odt()`} - - \cgalParamNBegin{perturb_options} - \cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to - trigger or not a call to `perturb_mesh_3()` function and - to set the parameters of this optimizer. If one parameter is not set, the default value of - `perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`} - \cgalParamDefault{`parameters::no_perturb`} - - \cgalParamNBegin{exude_options} - \cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to - trigger or not a call to `exude_mesh_3()` function and to override to set the - parameters of this optimizer. If one parameter is not set, the default value of - `exude_mesh_3()` is used for this parameter, except for the time bound which is set to be - equal to the refinement CPU time.} - \cgalParamType{`parameters::exude()` and `parameters::no_exude()`} - \cgalParamDefault{`parameters::no_exude`} - -\cgalNamedParamsEnd - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `make_periodic_3_mesh_3()` -\sa `refine_mesh_3()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude` -\sa `parameters::no_exude` -\sa `parameters::perturb` -\sa `parameters::no_perturb` -\sa `parameters::lloyd` -\sa `parameters::no_lloyd` -\sa `parameters::odt` -\sa `parameters::no_odt` + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `refine_periodic_3_mesh_3()` is a 3D periodic + * mesh generator. It produces periodic simplicial meshes which discretize + * 3D periodic domains. + * + * The periodic mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. + * The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, etc. + * + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process can be activated or not, according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward. + * + * \attention The function template `refine_periodic_3_mesh_3()` may be used + * to refine a previously computed mesh, e.g.: + * \code{.cpp} + * C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); + * + * CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); + * \endcode + * + * \attention Note that the triangulation must form at all times a simplicial complex within + * a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro + * of the manual of 3D periodic triangulations). It is the responsability of the user to provide + * a triangulation that satisfies this condition when calling the refinement + * function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh + * complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` + * will always satisfy this condition. + * + * + * \tparam C3T3 is required to be a model of + * the concept + * `MeshComplex_3InTriangulation_3`. + * The argument `c3t3` is passed by + * reference as this object is modified by the refinement process. As the + * refinement process only adds points to the triangulation, all + * vertices of the triangulation of `c3t3` remain in the + * mesh during the refinement process. Object `c3t3` can be used to insert + * specific points in the domain to ensure that they will be contained in the + * final triangulation. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` + * respectively. + * + * \tparam MD is required to be a model of + * the concept `Periodic_3MeshDomain_3` or of the refined concept + * `Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features + * of the input complex have to be accurately represented in the mesh. + * The argument `domain` is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * + * \tparam MC is required to be a model of the concept + * `MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` + * if the domain has exposed features. The argument `criteria` of + * type `MC` specifies the + * size and shape requirements for mesh tetrahedra + * and surface facets. These criteria + * form the rules which drive the refinement process. All mesh elements + * satisfy those criteria at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters + * + * \param c3t3 the mesh to be refined. + * \param domain the domain to be discretized + * \param criteria the criteria + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * The following four parameters are optional optimization parameters. + * They control which optimization processes are performed + * and allow the user to tune the parameters of the optimization processes. + * Individual optimization parameters are not described here as they are + * internal types (see instead the documentation page of each optimizer). + * For each optimization algorithm, there exist two global functions + * that allow to enable or disable the optimizer: + * + * \cgalNamedParamsBegin + * \cgalParamSectionBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::exude()` + *
    • `parameters::no_exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamSectionEnd + * \cgalNamedParamsEnd + * + * The optimization parameters can be passed in arbitrary order. If one parameter + * is not passed, its default value is used. The default values are + * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + * Note that whatever may be the optimization processes activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `make_periodic_3_mesh_3()` + * \sa `refine_mesh_3()` + * \sa `exude_periodic_3_mesh_3()` + * \sa `perturb_periodic_3_mesh_3()` + * \sa `lloyd_optimize_periodic_3_mesh_3()` + * \sa `odt_optimize_periodic_3_mesh_3()` + * \sa `parameters::exude` + * \sa `parameters::no_exude` + * \sa `parameters::perturb` + * \sa `parameters::no_perturb` + * \sa `parameters::lloyd` + * \sa `parameters::no_lloyd` + * \sa `parameters::odt` + * \sa `parameters::no_odt` */ - - template void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - 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::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); - parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); - parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + 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::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); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - return refine_periodic_3_mesh_3_impl(c3t3, - domain, - criteria, - exude_param, - perturb_param, - odt_param, - lloyd_param, - reset, - mesh_options_param, - manifold_options_param); + return refine_periodic_3_mesh_3_impl(c3t3, + domain, + criteria, + exude_param, + perturb_param, + odt_param, + lloyd_param, + reset, + mesh_options_param, + manifold_options_param); } #ifndef DOXYGEN_RUNNING template void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { - return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); + return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } /** * @brief This function refines the mesh c3t3 wrt domain & criteria From 56ee7b3deb4fcae905f900fd90978af674747acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 21 Sep 2022 18:36:00 +0200 Subject: [PATCH 080/248] add missing include directive --- Mesh_3/include/CGAL/Mesh_3/parameters.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 6df4476b0a1..0c89e18a278 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace CGAL { @@ -555,9 +556,8 @@ template < typename MeshDomain > inline Named_function_parameters features(const MeshDomain& /*domain*/) { -typedef typename internal::Domain_features_generator< - MeshDomain, - CGAL::Mesh_3::internal::has_Has_features::value > Generator; + typedef typename internal::Domain_features_generator::value > Generator; typedef Named_function_parameters Param; return Param(Generator()()); From 6397378bdcff9ac1860d3444630aeddaa6ba92f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Sep 2022 13:29:40 +0200 Subject: [PATCH 081/248] fix not documented warnings --- .../doc/resources/1.8.13/BaseDoxyfile.in | 4 +- .../doc/resources/1.8.14/BaseDoxyfile.in | 3 +- .../doc/resources/1.8.20/BaseDoxyfile.in | 4 +- .../doc/resources/1.8.4/BaseDoxyfile.in | 2 +- .../doc/resources/1.9.3/BaseDoxyfile.in | 3 +- .../Implicit_to_labeling_function_wrapper.h | 6 +- .../Concepts/BisectionGeometricTraits_3.h | 65 ++------ Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h | 43 +---- Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h | 23 +-- .../Concepts/MeshTriangulationTraits_3.h | 155 +++--------------- Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h | 35 +--- .../Mesh_domain_with_polyline_features_3.h | 16 +- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 8 +- 13 files changed, 80 insertions(+), 287 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 7d6685977cf..8d8d6e7b864 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -352,7 +352,9 @@ ALIASES = "cgal=%CGAL" \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " + "cgalParamPrecondition{1}=
  • Precondition: \1
  • "\ + "cgalEmptyDoc= " + # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index 44a6b9f72b3..48929055c1e 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -353,7 +353,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " \ + "cgalEmptyDoc= " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index 7f258d33a4b..b2e66a4fa3f 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -375,8 +375,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " - + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " \ + "cgalEmptyDoc= " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 45d422384df..60a5e2b7b77 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -359,7 +359,7 @@ ALIASES+= "cgalParamNEnd= \htmlonly[block] \endhtmlonly
    \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " \ + "cgalEmptyDoc= " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h index 9a5b38be16d..9a114c57afe 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h @@ -27,10 +27,8 @@ class Implicit_multi_domain_to_labeling_function_wrapper public: /// \name Types /// @{ - //! - typedef std::vector Function_vector; - //! - typedef typename Function::Point Point_3; + typedef std::vector Function_vector; //!< \cgalEmptyDoc + typedef typename Function::Point Point_3; //!< \cgalEmptyDoc /// @} /// \name Creation diff --git a/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h index 63e2311828f..e6a9f2f0ff7 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h @@ -184,60 +184,17 @@ typedef unspecified_type Has_on_bounded_side_3; /// The following functions give access to the predicate and construction objects: /// @{ -/*! - -*/ -Compute_scalar_product_3 compute_scalar_product_3_object(); - -/*! - -*/ -Compute_squared_distance_3 compute_squared_distance_3_object(); - -/*! - -*/ -Compute_squared_radius_3 compute_squared_radius_3_object(); - -/*! - -*/ -Construct_center_3 construct_center_3_object(); - -/*! - -*/ -Construct_midpoint_3 construct_midpoint_3_object(); - -/*! - -*/ -Construct_point_on_3 construct_point_on_3_object(); - -/*! - -*/ -Construct_scaled_vector_3 construct_scaled_vector_3_object(); - -/*! - -*/ -Construct_segment_3 construct_segment_3_object(); - -/*! - -*/ -Construct_translated_point_3 construct_translated_point_3_object(); - -/*! - -*/ -Construct_vector_3 construct_vector_3_object(); - -/*! - -*/ -Has_on_bounded_side_3 has_on_bounded_side_3_object(); +Compute_scalar_product_3 compute_scalar_product_3_object(); //!< \cgalEmptyDoc +Compute_squared_distance_3 compute_squared_distance_3_object(); //!< \cgalEmptyDoc +Compute_squared_radius_3 compute_squared_radius_3_object(); //!< \cgalEmptyDoc +Construct_center_3 construct_center_3_object(); //!< \cgalEmptyDoc +Construct_midpoint_3 construct_midpoint_3_object(); //!< \cgalEmptyDoc +Construct_point_on_3 construct_point_on_3_object(); //!< \cgalEmptyDoc +Construct_scaled_vector_3 construct_scaled_vector_3_object(); //!< \cgalEmptyDoc +Construct_segment_3 construct_segment_3_object(); //!< \cgalEmptyDoc +Construct_translated_point_3 construct_translated_point_3_object(); //!< \cgalEmptyDoc +Construct_vector_3 construct_vector_3_object(); //!< \cgalEmptyDoc +Has_on_bounded_side_3 has_on_bounded_side_3_object(); //!< \cgalEmptyDoc /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h index a6ba2ba7d6f..ee856bff80e 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h @@ -177,42 +177,15 @@ The class should provide storage, accessors and modificators for two `Vertex_han and two `Cell_handle`, and a cache value for sliverity.*/ /// @{ -/*! -*/ -void set_sliver_value(double value); - -/*! -*/ -double sliver_value() const; - -/*! -*/ -bool is_cache_valid() const; - -/*! -*/ -void reset_cache_validity() const; - -/*! - -*/ -Cell_handle next_intrusive() const; - -/*! - -*/ -void set_next_intrusive(Cell_handle); - -/*! - -*/ -Cell_handle previous_intrusive() const; - -/*! - -*/ -void set_previous_intrusive(Cell_handle); +void set_sliver_value(double value); //!< \cgalEmptyDoc +double sliver_value() const; //!< \cgalEmptyDoc +bool is_cache_valid() const; //!< \cgalEmptyDoc +void reset_cache_validity() const; //!< \cgalEmptyDoc +Cell_handle next_intrusive() const; //!< \cgalEmptyDoc +void set_next_intrusive(Cell_handle); //!< \cgalEmptyDoc +Cell_handle previous_intrusive() const; //!< \cgalEmptyDoc +void set_previous_intrusive(Cell_handle); //!< \cgalEmptyDoc /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h index 240f9b0f1fb..89e04567093 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h @@ -189,25 +189,10 @@ Bbox_3 bbox() const; /// The following functions give access to the function objects: /// @{ -/*! - -*/ -Construct_initial_points construct_initial_points_object(); - -/*! - -*/ -Is_in_domain is_in_domain_object(); - -/*! - -*/ -Do_intersect_surface do_intersect_surface_object(); - -/*! - -*/ -Construct_intersection construct_intersection_object(); +Construct_initial_points construct_initial_points_object(); //!< \cgalEmptyDoc +Is_in_domain is_in_domain_object(); //!< \cgalEmptyDoc +Do_intersect_surface do_intersect_surface_object(); //!< \cgalEmptyDoc +Construct_intersection construct_intersection_object(); //!< \cgalEmptyDoc /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h index 4d1af263528..350e601e55d 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h @@ -328,135 +328,32 @@ public: /// The following functions give access to the predicate and construction objects: /// @{ - /*! - - */ - Do_intersect_3 do_intersect_3_object(); - - /*! - - */ - Equal_3 equal_3_object(); - - /*! - - */ - Is_degenerate_3 equal_3_object(); - - /*! - - */ - Compare_weighted_squared_radius_3 compare_weighted_squared_radius_3_object(); - - /*! - - */ - Compute_approximate_dihedral_angle_3 compute_approximate_dihedral_angle_3_object(); - - /*! - - */ - Compute_area_3 compute_area_3_object(); - - /*! - - */ - Compute_power_distance_to_power_sphere_3 compute_power_distance_to_power_sphere_3_object(); - - /*! - - */ - Compute_squared_area_3 compute_squared_area_3_object(); - - /*! - - */ - Compute_squared_distance_3 compute_squared_distance_3_object(); - - /*! - - */ - Compute_squared_length_3 compute_squared_length_3_object(); - - /*! - - */ - Compute_squared_radius_3 compute_squared_radius_3_object(); - - /*! - - */ - Compute_squared_radius_smallest_orthogonal_sphere_3 compute_squared_radius_smallest_orthogonal_sphere_3_object(); - - /*! - - */ - Compute_volume_3 compute_volume_3_object(); - - /*! - - */ - Compute_weight_3 compute_weight_3_object(); - - /*! - - */ - Construct_base_vector_3 construct_base_vector_3_object(); - - /*! - - */ - Construct_orthogonal_vector_3 construct_orthogonal_vector_3_object(); - - /*! - - */ - Construct_center_3 construct_center_3_object(); - - /*! - - */ - Construct_midpoint_3 construct_midpoint_3_object(); - - /*! - - */ - Construct_normal_3 construct_normal_3_object(); - - /*! - - */ - Construct_sphere_3 construct_sphere_3_object(); - - /*! - - */ - Construct_tetrahedron_3 construct_tetrahedron_3_object(); - - /*! - - */ - Construct_translated_point_3 construct_translated_point_3_object(); - - /*! - - */ - Construct_vector_3 construct_vector_3_object(); - - /*! - - */ - Construct_scaled_vector_3 construct_scaled_vector_3_object(); - - /*! - - */ - Construct_opposite_vector_3 construct_opposite_vector_3_object(); - - /*! - - */ - Intersect_3 intersect_3_object(); + Do_intersect_3 do_intersect_3_object(); //!< \cgalEmptyDoc + Equal_3 equal_3_object(); //!< \cgalEmptyDoc + Is_degenerate_3 equal_3_object(); //!< \cgalEmptyDoc + Compare_weighted_squared_radius_3 compare_weighted_squared_radius_3_object(); //!< \cgalEmptyDoc + Compute_approximate_dihedral_angle_3 compute_approximate_dihedral_angle_3_object(); //!< \cgalEmptyDoc + Compute_area_3 compute_area_3_object(); //!< \cgalEmptyDoc + Compute_power_distance_to_power_sphere_3 compute_power_distance_to_power_sphere_3_object(); //!< \cgalEmptyDoc + Compute_squared_area_3 compute_squared_area_3_object(); //!< \cgalEmptyDoc + Compute_squared_distance_3 compute_squared_distance_3_object(); //!< \cgalEmptyDoc + Compute_squared_length_3 compute_squared_length_3_object(); //!< \cgalEmptyDoc + Compute_squared_radius_3 compute_squared_radius_3_object(); //!< \cgalEmptyDoc + Compute_squared_radius_smallest_orthogonal_sphere_3 compute_squared_radius_smallest_orthogonal_sphere_3_object(); //!< \cgalEmptyDoc + Compute_volume_3 compute_volume_3_object(); //!< \cgalEmptyDoc + Compute_weight_3 compute_weight_3_object(); //!< \cgalEmptyDoc + Construct_base_vector_3 construct_base_vector_3_object(); //!< \cgalEmptyDoc + Construct_orthogonal_vector_3 construct_orthogonal_vector_3_object(); //!< \cgalEmptyDoc + Construct_center_3 construct_center_3_object(); //!< \cgalEmptyDoc + Construct_midpoint_3 construct_midpoint_3_object(); //!< \cgalEmptyDoc + Construct_normal_3 construct_normal_3_object(); //!< \cgalEmptyDoc + Construct_sphere_3 construct_sphere_3_object(); //!< \cgalEmptyDoc + Construct_tetrahedron_3 construct_tetrahedron_3_object(); //!< \cgalEmptyDoc + Construct_translated_point_3 construct_translated_point_3_object(); //!< \cgalEmptyDoc + Construct_vector_3 construct_vector_3_object(); //!< \cgalEmptyDoc + Construct_scaled_vector_3 construct_scaled_vector_3_object(); //!< \cgalEmptyDoc + Construct_opposite_vector_3 construct_opposite_vector_3_object(); //!< \cgalEmptyDoc + Intersect_3 intersect_3_object(); //!< \cgalEmptyDoc /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h index 1b1cb0d712b..854e92353ad 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h @@ -91,35 +91,12 @@ Sets the special aspect of the vertex. */ void set_special(bool); -/*! - -*/ -FT meshing_info() const; - -/*! - -*/ -void set_meshing_info(FT); - -/*! - -*/ -Vertex_handle next_intrusive() const; - -/*! - -*/ -void set_next_intrusive(Vertex_handle); - -/*! - -*/ -Vertex_handle previous_intrusive() const; - -/*! - -*/ -void set_previous_intrusive(Vertex_handle); +FT meshing_info() const; //!< \cgalEmptyDoc +void set_meshing_info(FT); //!< \cgalEmptyDoc +Vertex_handle next_intrusive() const; //!< \cgalEmptyDoc +void set_next_intrusive(Vertex_handle); //!< \cgalEmptyDoc +Vertex_handle previous_intrusive() const; //!< \cgalEmptyDoc +void set_previous_intrusive(Vertex_handle); //!< \cgalEmptyDoc /// Get the erase counter. /// Only required by the parallel algorithms. diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index e9a58de83d5..eec82744800 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -536,19 +536,20 @@ class Mesh_domain_with_polyline_features_3 public: /// \name Types /// @{ - typedef typename MeshDomain_3::Surface_patch_index Surface_patch_index; - typedef typename MeshDomain_3::Subdomain_index Subdomain_index; - typedef int Curve_index; - typedef int Corner_index; + typedef typename MeshDomain_3::Surface_patch_index Surface_patch_index; //!< \cgalEmptyDoc + typedef typename MeshDomain_3::Subdomain_index Subdomain_index; //!< \cgalEmptyDoc + typedef int Curve_index; //!< \cgalEmptyDoc + typedef int Corner_index; //!< \cgalEmptyDoc + /// \cgalEmptyDoc typedef typename Mesh_3::internal::Index_generator_with_features< typename MeshDomain_3::Subdomain_index, Surface_patch_index, Curve_index, Corner_index>::type Index; - typedef CGAL::Tag_true Has_features; - typedef typename MeshDomain_3::R::FT FT; + typedef CGAL::Tag_true Has_features; //!< \cgalEmptyDoc + typedef typename MeshDomain_3::R::FT FT; //!< \cgalEmptyDoc /// @} #ifndef DOXYGEN_RUNNING @@ -567,6 +568,7 @@ public: /// of the base class. /// @{ + /// \cgalEmptyDoc template Mesh_domain_with_polyline_features_3(const T& ...o) : MeshDomain_3(o...) @@ -574,7 +576,7 @@ public: , current_curve_index_(1) , curves_aabb_tree_is_built(false) {} - Mesh_domain_with_polyline_features_3(const Mesh_domain_with_polyline_features_3&) = default; + Mesh_domain_with_polyline_features_3(const Mesh_domain_with_polyline_features_3&) = default; //!< \cgalEmptyDoc /// @} diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 17e69ff984c..adb245eddcb 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -138,10 +138,10 @@ public: /// \name Index types /// @{ /// The types are `int` or types compatible with `int`. - typedef typename Base::Corner_index Corner_index; - typedef typename Base::Curve_index Curve_index; - typedef typename Base::Surface_patch_index Surface_patch_index; - typedef typename Base::Subdomain_index Subdomain_index; + typedef typename Base::Corner_index Corner_index; //!< \cgalEmptyDoc + typedef typename Base::Curve_index Curve_index; //!< \cgalEmptyDoc + typedef typename Base::Surface_patch_index Surface_patch_index; //!< \cgalEmptyDoc + typedef typename Base::Subdomain_index Subdomain_index; //!< \cgalEmptyDoc /// @} /// @cond DEVELOPERS From d3fca65ae59f82f4b78734b61bbce34032f0e91d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 23 Sep 2022 12:49:40 +0100 Subject: [PATCH 082/248] CGAL: No longer per package assertions --- Alpha_shapes_2/include/CGAL/Alpha_shape_2.h | 86 ++-- Alpha_shapes_3/include/CGAL/Alpha_shape_3.h | 6 +- .../Apollonius_graph_2_impl.h | 52 +- .../CGAL/Apollonius_graph_vertex_base_2.h | 1 - BGL/include/CGAL/boost/graph/IO/Tds_2_off.h | 2 +- .../Hyperbolic_Delaunay_triangulation_2.h | 34 +- ...bolic_Delaunay_triangulation_CK_traits_2.h | 30 +- ...perbolic_Delaunay_triangulation_traits_2.h | 8 +- .../Hyperbolic_triangulation_face_base_2.h | 1 - .../CGAL/natural_neighbor_coordinates_3.h | 32 +- Kernel_23/include/CGAL/kernel_assertions.h | 57 +-- ...ained_Delaunay_triangulation_face_base_2.h | 2 +- .../include/CGAL/Compact_mesh_cell_base_3.h | 24 +- .../Periodic_2_Delaunay_triangulation_2.h | 28 +- .../include/CGAL/Periodic_2_offset_2.h | 6 +- .../include/CGAL/Periodic_2_triangulation_2.h | 318 ++++++------ .../Periodic_2_triangulation_face_base_2.h | 4 +- .../Periodic_2_triangulation_hierarchy_2.h | 8 +- .../Periodic_2_triangulation_iterators_2.h | 46 +- .../CGAL/Periodic_2_triangulation_traits_2.h | 1 - .../Periodic_3_Delaunay_triangulation_3.h | 48 +- .../include/CGAL/Periodic_3_offset_3.h | 6 +- .../CGAL/Periodic_3_regular_triangulation_3.h | 90 ++-- .../include/CGAL/Periodic_3_triangulation_3.h | 388 +++++++-------- ...3_Delaunay_triangulation_remove_traits_3.h | 1 - .../Periodic_3_triangulation_iterators_3.h | 88 ++-- .../Periodic_3_triangulation_ds_cell_base_3.h | 18 +- .../Periodic_3_triangulation_hierarchy_3.h | 6 +- .../CGAL/Periodic_3_triangulation_traits_3.h | 1 - ...ic_4_hyperbolic_Delaunay_triangulation_2.h | 12 +- .../Periodic_4_hyperbolic_triangulation_2.h | 38 +- ...odic_4_hyperbolic_triangulation_dummy_14.h | 3 +- ...c_4_hyperbolic_triangulation_face_base_2.h | 1 - .../include/CGAL/IO/read_las_points.h | 1 - .../include/CGAL/IO/read_off_points.h | 1 - .../include/CGAL/IO/read_ply_points.h | 1 - .../include/CGAL/IO/read_xyz_points.h | 1 - .../include/CGAL/IO/write_las_points.h | 4 +- .../include/CGAL/IO/write_off_points.h | 4 +- .../include/CGAL/IO/write_ply_points.h | 4 +- .../include/CGAL/IO/write_xyz_points.h | 4 +- .../internal/Neighbor_query.h | 1 - .../internal/Rich_grid.h | 4 +- .../include/CGAL/bilateral_smooth_point_set.h | 10 +- .../include/CGAL/cluster_point_set.h | 2 +- .../include/CGAL/compute_average_spacing.h | 6 +- .../CGAL/edge_aware_upsample_point_set.h | 20 +- .../include/CGAL/estimate_scale.h | 2 +- .../include/CGAL/grid_simplify_point_set.h | 10 +- .../CGAL/hierarchy_simplify_point_set.h | 6 +- .../include/CGAL/jet_estimate_normals.h | 6 +- .../include/CGAL/jet_smooth_point_set.h | 6 +- .../include/CGAL/mst_orient_normals.h | 26 +- .../include/CGAL/pca_estimate_normals.h | 6 +- .../CGAL/point_set_processing_assertions.h | 348 -------------- .../include/CGAL/radial_orient_normals.h | 4 +- .../include/CGAL/random_simplify_point_set.h | 4 +- .../include/CGAL/remove_outliers.h | 8 +- .../include/CGAL/structure_point_set.h | 1 - .../include/CGAL/vcm_estimate_normals.h | 2 +- .../wlop_simplify_and_regularize_point_set.h | 14 +- .../CGAL/Poisson_reconstruction_function.h | 6 +- .../CGAL/Reconstruction_triangulation_3.h | 2 +- .../CGAL/poisson_refine_triangulation.h | 4 +- ...surface_reconstruction_points_assertions.h | 347 -------------- .../CGAL/Simplicial_mesh_cell_base_3.h | 21 +- .../include/CGAL/multiset_assertions.h | 55 +-- .../include/CGAL/triangulation_assertions.h | 339 ------------- SearchStructures/include/CGAL/Range_tree_d.h | 10 +- .../include/CGAL/Tree_assertions.h | 341 ------------- SearchStructures/include/CGAL/Tree_base.h | 1 - .../Triangulation_face_base_with_edges_2.h | 5 - Stream_lines_2/include/CGAL/Regular_grid_2.h | 8 +- Stream_lines_2/include/CGAL/Stream_lines_2.h | 6 +- .../include/CGAL/streamlines_assertions.h | 341 ------------- .../CGAL/Triangulation_data_structure_2.h | 154 +++--- .../CGAL/Triangulation_ds_circulators_2.h | 84 ++-- .../CGAL/Triangulation_ds_face_base_2.h | 22 +- .../CGAL/Triangulation_ds_iterators_2.h | 10 +- .../include/CGAL/Triangulation_ds_vertex_2.h | 6 +- TDS_2/include/CGAL/Triangulation_utils_2.h | 6 +- .../internal/Triangulation_ds_circulators_3.h | 120 ++--- .../internal/Triangulation_ds_iterators_3.h | 1 - .../CGAL/Triangulation_data_structure_3.h | 406 ++++++++-------- .../CGAL/Triangulation_ds_cell_base_3.h | 24 +- TDS_3/include/CGAL/Triangulation_utils_3.h | 16 +- .../Constrained_Delaunay_triangulation_2.h | 22 +- .../CGAL/Constrained_triangulation_2.h | 24 +- .../Constrained_triangulation_face_base_2.h | 4 +- .../CGAL/Constrained_triangulation_plus_2.h | 22 +- .../include/CGAL/Delaunay_triangulation_2.h | 46 +- .../include/CGAL/Regular_triangulation_2.h | 67 +-- .../CGAL/Regular_triangulation_face_base_2.h | 2 +- .../include/CGAL/Triangulation_2.h | 128 ++--- .../internal/Constraint_hierarchy_2.h | 28 +- .../Polyline_constraint_hierarchy_2.h | 42 +- .../Triangulation_line_face_circulator_2.h | 30 +- .../include/CGAL/Triangulation_2_traits_3.h | 2 +- .../include/CGAL/Triangulation_face_base_2.h | 2 +- .../include/CGAL/Triangulation_hierarchy_2.h | 6 +- .../include/CGAL/Delaunay_triangulation_3.h | 90 ++-- .../CGAL/Delaunay_triangulation_cell_base_3.h | 1 - ...angulation_cell_base_with_circumcenter_3.h | 2 +- .../include/CGAL/Regular_triangulation_3.h | 94 ++-- ...n_cell_base_with_weighted_circumcenter_3.h | 2 +- .../include/CGAL/Triangulation_3.h | 452 +++++++++--------- .../Triangulation_segment_traverser_3_impl.h | 110 ++--- .../include/CGAL/Triangulation_cell_base_3.h | 1 - .../CGAL/Triangulation_geom_traits_3.h | 2 - .../include/CGAL/Triangulation_hierarchy_3.h | 18 +- .../CGAL/Triangulation_segment_traverser_3.h | 10 +- .../CGAL/Delaunay_triangulation_on_sphere_2.h | 46 +- ...elaunay_triangulation_on_sphere_traits_2.h | 6 +- .../CGAL/Geographical_coordinates_traits_2.h | 2 +- .../CGAL/Projection_on_sphere_traits_3.h | 3 +- .../include/CGAL/Triangulation_on_sphere_2.h | 42 +- .../CGAL/Triangulation_on_sphere_2/IO/OFF.h | 4 +- .../internal/arc_on_sphere_2_subsampling.h | 6 +- ...angulation_sphere_line_face_circulator_2.h | 6 +- 119 files changed, 1885 insertions(+), 3724 deletions(-) delete mode 100644 Point_set_processing_3/include/CGAL/point_set_processing_assertions.h delete mode 100644 Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h delete mode 100644 STL_Extension/include/CGAL/triangulation_assertions.h delete mode 100644 SearchStructures/include/CGAL/Tree_assertions.h delete mode 100644 Stream_lines_2/include/CGAL/streamlines_assertions.h diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index d54f28b21a3..072ef376ced 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -849,7 +849,7 @@ Alpha_shape_2::initialize_interval_edge_map() { // both faces are infinite by definition unattached // the edge is finite by construction - CGAL_triangulation_precondition((is_infinite(pNeighbor) + CGAL_precondition((is_infinite(pNeighbor) && is_infinite(pFace))); interval = make_triple(squared_radius(pFace, i), Infinity, @@ -859,7 +859,7 @@ Alpha_shape_2::initialize_interval_edge_map() else { // is_infinite(pNeighbor) - CGAL_triangulation_precondition((is_infinite(pNeighbor) + CGAL_precondition((is_infinite(pNeighbor) && !is_infinite(pFace))); if (is_attached(pFace, i)) interval = make_triple(UNDEFINED, @@ -1109,7 +1109,7 @@ Alpha_shape_2::update_alpha_shape_vertex_list()const { // which might be infinity // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == REGULAR)); + CGAL_assertion((classify(v) == REGULAR)); Alpha_shape_vertices_list.push_back(v); } } @@ -1122,7 +1122,7 @@ Alpha_shape_2::update_alpha_shape_vertex_list()const { ++vertex_alpha_it) { v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == SINGULAR)); + CGAL_assertion((classify(v) == SINGULAR)); Alpha_shape_vertices_list.push_back(v); } @@ -1159,7 +1159,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const { pInterval = &(*edge_alpha_it).first; - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 2 // thus singular @@ -1171,9 +1171,9 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // and alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR)); + CGAL_assertion((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == REGULAR)); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)); } @@ -1191,7 +1191,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const if (pInterval->first == UNDEFINED) { - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 2 // thus singular @@ -1203,9 +1203,9 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // and alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR)); + CGAL_assertion((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == REGULAR)); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)); } @@ -1219,12 +1219,12 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // if alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR) - || (classify((*edge_alpha_it).second.first, + CGAL_assertion(((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) - == SINGULAR))); + == REGULAR) + || (classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == SINGULAR))); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)); } @@ -1324,7 +1324,7 @@ Alpha_shape_2::number_of_solid_components(const Type_of_alpha& alpha) c ++face_it) { Face_handle pFace = face_it; - CGAL_triangulation_postcondition( pFace != nullptr); + CGAL_postcondition( pFace != nullptr); if (classify(pFace, alpha) == INTERIOR){ Data& data = marked_face_set[pFace]; @@ -1358,7 +1358,7 @@ Alpha_shape_2::traverse(const Face_handle& pFace, for (int i=0; i<3; i++) { pNeighbor = fh->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != nullptr); + CGAL_assertion(pNeighbor != nullptr); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_face_set[pNeighbor]; if(data == false){ @@ -1514,7 +1514,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == + CGAL_assertion((classify(v) == Alpha_shape_2::REGULAR)); // if we used Edelsbrunner and Muecke's definition // regular means incident to a higher-dimensional face @@ -1536,7 +1536,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const { pInterval = &(*edge_alpha_it).first; - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 1 // thus singular @@ -1563,11 +1563,11 @@ Alpha_shape_2::op_ostream(std::ostream& os) const f = pNeighbor; } - CGAL_triangulation_assertion((classify(f) == - Alpha_shape_2::INTERIOR)); + CGAL_assertion((classify(f) == + Alpha_shape_2::INTERIOR)); - CGAL_triangulation_assertion((classify(f, i) == - Alpha_shape_2::REGULAR)); + CGAL_assertion((classify(f, i) == + Alpha_shape_2::REGULAR)); os << V[f->vertex(f->ccw(i))] << ' ' << V[f->vertex(f->cw(i))] << std::endl; @@ -1595,8 +1595,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == - Alpha_shape_2::REGULAR)); + CGAL_assertion((classify(v) == Alpha_shape_2::REGULAR)); V[v] = number_of_vertices++; os << v->point() << std::endl; } @@ -1608,8 +1607,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const ++vertex_alpha_it) { v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == - Alpha_shape_2::SINGULAR)); + CGAL_assertion((classify(v) == Alpha_shape_2::SINGULAR)); V[v] = number_of_vertices++; os << v->point() << std::endl; @@ -1652,7 +1650,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const if (pInterval->second != Infinity && pInterval->second <= get_alpha()) { - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::REGULAR)); // assure that all vertices are in ccw order if (classify(f) == Alpha_shape_2::EXTERIOR) @@ -1665,7 +1663,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const f = pNeighbor; } - CGAL_triangulation_assertion((classify(f) == + CGAL_assertion((classify(f) == Alpha_shape_2::INTERIOR)); os << V[f->vertex(f->ccw(i))] << ' ' @@ -1680,7 +1678,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the singular edges if (pInterval->first != UNDEFINED) { - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::SINGULAR)); os << V[f->vertex(f->ccw(i))] << ' ' << V[f->vertex(f->cw(i))] << std::endl; @@ -1739,7 +1737,7 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, + CGAL_assertion((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)); @@ -1769,7 +1767,7 @@ Alpha_shape_2::Output () if (pInterval->first == UNDEFINED) { - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 1 // thus singular @@ -1782,9 +1780,9 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) == - REGULAR)); + CGAL_assertion((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) == + REGULAR)); L.push_back((this->segment((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)) .source()); @@ -1802,12 +1800,12 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) == - REGULAR) || - (classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) == - SINGULAR))); + CGAL_assertion(((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) == + REGULAR) || + (classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) == + SINGULAR))); L.push_back((this->segment((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)) .source()); diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h index a0a30b5a113..b7b8c2e18ba 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h @@ -401,7 +401,7 @@ public: // Returns the n-th alpha-value. // n < size() { - CGAL_triangulation_assertion( n > 0 && + CGAL_assertion( n > 0 && n <= static_cast(alpha_spectrum.size()) ); return alpha_spectrum[n-1]; } @@ -1713,7 +1713,7 @@ Alpha_shape_3::number_of_solid_components(const NT& alpha) const for( cell_it = finite_cells_begin(); cell_it != done; ++cell_it) { Cell_handle pCell = cell_it; - CGAL_triangulation_assertion(pCell != nullptr); + CGAL_assertion(pCell != nullptr); if (classify(pCell, alpha) == INTERIOR){ Data& data = marked_cell_set[pCell]; @@ -1745,7 +1745,7 @@ void Alpha_shape_3::traverse(Cell_handle pCell, for (int i=0; i<=3; i++) { pNeighbor = pCell->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != nullptr); + CGAL_assertion(pNeighbor != nullptr); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_cell_set[pNeighbor]; if(data == false){ diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index e5988f9f77b..e9e6ee7d472 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -53,7 +53,7 @@ is_valid(bool verbose, int level) const if (number_of_vertices() < 3) return true; - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); for (All_edges_iterator eit = all_edges_begin(); eit != all_edges_end(); ++eit) { @@ -64,7 +64,7 @@ is_valid(bool verbose, int level) const if ( !is_infinite(v) ) { result = result && ( incircle(f, v->site()) != NEGATIVE ); - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); } Edge sym_e = sym_edge(e); f = sym_e.first; @@ -72,7 +72,7 @@ is_valid(bool verbose, int level) const if ( !is_infinite(v) ) { result = result && ( incircle(f, v->site()) != NEGATIVE ); - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); } } @@ -83,7 +83,7 @@ is_valid(bool verbose, int level) const std::cerr << "Apollonius diagram is NOT valid..." << std::flush; } - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); return result; } @@ -100,7 +100,7 @@ typename Apollonius_graph_2::Point_2 Apollonius_graph_2:: circumcenter(const Face_handle& f) const { - CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f)); + CGAL_precondition (dimension()==2 || !is_infinite(f)); return circumcenter(f->vertex(0)->site(), f->vertex(1)->site(), f->vertex(2)->site()); @@ -122,7 +122,7 @@ typename Apollonius_graph_2::Site_2 Apollonius_graph_2:: circumcircle(const Face_handle& f) const { - CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f)); + CGAL_precondition (dimension()==2 || !is_infinite(f)); return circumcircle(f->vertex(0)->site(), f->vertex(1)->site(), f->vertex(2)->site()); @@ -178,7 +178,7 @@ typename Gt::Object_2 Apollonius_graph_2:: dual(const Edge e) const { - CGAL_triangulation_precondition( !is_infinite(e) ); + CGAL_precondition( !is_infinite(e) ); if ( dimension() == 1 ) { Site_2 p = (e.first)->vertex(cw(e.second))->site(); @@ -207,16 +207,16 @@ dual(const Edge e) const } // only one of the adjacent faces is infinite - CGAL_triangulation_assertion( is_infinite( e.first ) || + CGAL_assertion( is_infinite( e.first ) || is_infinite( e.first->neighbor(e.second) ) ); - CGAL_triangulation_assertion( !(is_infinite( e.first ) && + CGAL_assertion( !(is_infinite( e.first ) && is_infinite( e.first->neighbor(e.second) ) ) ); - CGAL_triangulation_assertion + CGAL_assertion ( is_infinite( e.first->vertex(e.second) ) || is_infinite( tds().mirror_vertex(e.first, e.second) ) ); @@ -246,7 +246,7 @@ primal(const Edge e) const // typedef typename Geom_traits::Hyperbola_segment_2 Hyperbola_segment; // typedef typename Geom_traits::Parabola_segment_2 Parabola_segment; - // CGAL_triangulation_precondition( !is_infinite(e) ); + // CGAL_precondition( !is_infinite(e) ); if ( number_of_vertices() != 2 ) { if ( is_infinite(e) ) { @@ -257,7 +257,7 @@ primal(const Edge e) const Site_2 s = tds().mirror_vertex( e.first, e.second )->site(); ray = construct_Apollonius_primal_ray_2_object()(p,r,s); } else { - CGAL_triangulation_assertion + CGAL_assertion ( is_infinite( e.first->vertex(ccw(e.second)) ) ); Site_2 q = e.first->vertex( cw(e.second) )->site(); Site_2 r = e.first->vertex( e.second )->site(); @@ -317,11 +317,11 @@ typename Apollonius_graph_2::Edge Apollonius_graph_2:: flip(Face_handle& f, int i) { - CGAL_triangulation_precondition ( f != Face_handle() ); - CGAL_triangulation_precondition (i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( dimension()==2 ); + CGAL_precondition ( f != Face_handle() ); + CGAL_precondition (i == 0 || i == 1 || i == 2); + CGAL_precondition( dimension()==2 ); - CGAL_triangulation_precondition( f->vertex(i) != tds().mirror_vertex(f,i) ); + CGAL_precondition( f->vertex(i) != tds().mirror_vertex(f,i) ); this->_tds.flip(f, i); @@ -383,7 +383,7 @@ void Apollonius_graph_2:: remove_degree_2(Vertex_handle v) { - CGAL_triangulation_precondition( is_degree_2(v) ); + CGAL_precondition( is_degree_2(v) ); this->_tds.remove_degree_2( v ); } @@ -403,7 +403,7 @@ void Apollonius_graph_2:: remove_degree_3(Vertex_handle v, Face_handle f) { - CGAL_triangulation_precondition( degree(v) == 3 ); + CGAL_precondition( degree(v) == 3 ); this->_tds.remove_degree_3(v, f); } @@ -416,7 +416,7 @@ typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: insert_first(const Site_2& p) { - CGAL_triangulation_precondition(number_of_vertices() == 0); + CGAL_precondition(number_of_vertices() == 0); Vertex_handle v = this->_tds.insert_second(); v->set_site(p); return v; @@ -428,7 +428,7 @@ typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: insert_second(const Site_2& p) { - CGAL_triangulation_precondition( number_of_vertices() == 1 ); + CGAL_precondition( number_of_vertices() == 1 ); Vertex_handle vnew; Vertex_handle v(finite_vertices_begin()); if ( is_hidden(v->site(), p) ) { @@ -439,7 +439,7 @@ insert_second(const Site_2& p) v->set_site(p); vnew = v; } else { - CGAL_triangulation_precondition(number_of_vertices() == 1); + CGAL_precondition(number_of_vertices() == 1); vnew = this->_tds.insert_dim_up(infinite_vertex(), true); vnew->set_site(p); // vnew = Delaunay_graph::insert_second(p); @@ -453,7 +453,7 @@ typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: insert_third(const Site_2& p) { - CGAL_triangulation_precondition( number_of_vertices() == 2 ); + CGAL_precondition( number_of_vertices() == 2 ); Face_handle f((*finite_edges_begin()).first); Vertex_handle v1(f->vertex(0)); @@ -592,7 +592,7 @@ insert_third(const Site_2& p) } } - // CGAL_triangulation_assertion( is_valid() ); + // CGAL_assertion( is_valid() ); return v; } @@ -1752,8 +1752,8 @@ void Apollonius_graph_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( !is_infinite(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( !is_infinite(v) ); // find a neighbor of v to use for point location of hidden sites to // be re-inserted @@ -1900,7 +1900,7 @@ remove_degree_d_vertex(Vertex_handle v) CGAL_assertion( found ); CGAL_USE(found); } - CGAL_triangulation_precondition( degree(v) == 3 ); + CGAL_precondition( degree(v) == 3 ); this->_tds.remove_degree_3( v, Face_handle() ); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h index c16c2f1903f..a1f6fc7158d 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h @@ -19,7 +19,6 @@ #include #include -#include namespace CGAL { diff --git a/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h b/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h index 7f7d663daa4..1f893ffb43c 100644 --- a/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h +++ b/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h @@ -109,7 +109,7 @@ off_file_input( std::istream& is, Triangulation_data_structure_2& tds, bo tds.set_adjacency(fn, 2, inf_edge_map); edge_map.erase(edge_map.begin()); } - CGAL_triangulation_assertion(inf_edge_map.empty()); + CGAL_assertion(inf_edge_map.empty()); } diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h index 8e05bddc37c..166ef82c87c 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -77,7 +77,7 @@ public: Hyperbolic_Delaunay_triangulation_2(const Hyperbolic_Delaunay_triangulation_2 &tr) : Delaunay_triangulation_2(tr), _gt() { - CGAL_triangulation_postcondition(this->is_valid()); + CGAL_postcondition(this->is_valid()); } template @@ -291,13 +291,13 @@ public: Vertex& operator*() const { - CGAL_triangulation_precondition(pos != Face_handle() && _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); return *(pos->vertex(_ri)); } Vertex* operator->() const { - CGAL_triangulation_precondition(pos != Face_handle() && _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); return &*(pos->vertex(_ri)); } @@ -458,7 +458,7 @@ public: void remove(Vertex_handle v) { - CGAL_triangulation_precondition(tds().is_vertex(v)); + CGAL_precondition(tds().is_vertex(v)); std::vector nbr; bool dim_was_2 = false; if (this->dimension() == 2) @@ -541,16 +541,16 @@ private: unsigned int get_non_hyperbolic_edge() const { - CGAL_triangulation_precondition(!_is_Delaunay_hyperbolic); - CGAL_triangulation_precondition(_non_hyperbolic_edge <= 2); + CGAL_precondition(!_is_Delaunay_hyperbolic); + CGAL_precondition(_non_hyperbolic_edge <= 2); return _non_hyperbolic_edge; } void set_non_hyperbolic_edge(unsigned int uschar) { - CGAL_triangulation_precondition(!_is_Delaunay_hyperbolic); - CGAL_triangulation_precondition(uschar <= 2); + CGAL_precondition(!_is_Delaunay_hyperbolic); + CGAL_precondition(uschar <= 2); _non_hyperbolic_edge = uschar; } @@ -580,7 +580,7 @@ private: } while(++fc != done); } - CGAL_triangulation_postcondition(is_Delaunay_hyperbolic(v->face())); + CGAL_postcondition(is_Delaunay_hyperbolic(v->face())); } } @@ -588,7 +588,7 @@ private: const Point& query, Locate_type <, int& li) const { // The triangle (p,q,r) must be Delaunay hyperbolic - CGAL_triangulation_precondition(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r)); + CGAL_precondition(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r)); // Point p is assumed to be at index 0, q at index 1 and r at index 2 in the face. li = -1; @@ -652,7 +652,7 @@ private: int get_finite_non_hyperbolic_edge(Face_handle f) const { - CGAL_triangulation_precondition(is_finite_non_hyperbolic(f)); + CGAL_precondition(is_finite_non_hyperbolic(f)); Face_data fd = object_cast(f->tds_data()); return fd.get_non_hyperbolic_edge(); } @@ -862,7 +862,7 @@ public: Hyperbolic_Voronoi_point dual(Face_handle f) const { - CGAL_triangulation_precondition(is_Delaunay_hyperbolic(f)); + CGAL_precondition(is_Delaunay_hyperbolic(f)); return geom_traits().construct_hyperbolic_circumcenter_2_object()(point(f,0), point(f,1), point(f,2)); @@ -872,7 +872,7 @@ public: Hyperbolic_segment dual(Face_handle f, int i) const { - CGAL_triangulation_precondition(is_Delaunay_hyperbolic(f, i)); + CGAL_precondition(is_Delaunay_hyperbolic(f, i)); if(dimension() == 1) { @@ -938,8 +938,8 @@ public: const Point point(const Face_handle fh, const int i) const { - CGAL_triangulation_precondition(0 <= i); - CGAL_triangulation_precondition(i <= 2); + CGAL_precondition(0 <= i); + CGAL_precondition(i <= 2); return fh->vertex(i)->point(); } @@ -951,8 +951,8 @@ public: Point point(const Face_handle fh, const int i) { - CGAL_triangulation_precondition(0 <= i); - CGAL_triangulation_precondition(i <= 2); + CGAL_precondition(0 <= i); + CGAL_precondition(i <= 2); return fh->vertex(i)->point(); } diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index ebf704c4ef3..da42c7429f9 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -77,13 +77,13 @@ namespace internal { std::vector< Intersection_result > inters; intersection(*c_pq, *c_qr, std::back_inserter(inters)); - CGAL_triangulation_assertion(assign(pair, inters[0])); + CGAL_assertion(assign(pair, inters[0])); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; - CGAL_triangulation_assertion(assign(pair, inters[1])); + CGAL_assertion(assign(pair, inters[1])); return pair.first; } return pair.first; @@ -104,13 +104,13 @@ namespace internal { std::vector< Intersection_result > inters; intersection(*l, *c, std::back_inserter(inters)); - CGAL_triangulation_assertion(assign(pair,inters[0])); + CGAL_assertion(assign(pair,inters[0])); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; - CGAL_triangulation_assertion(assign(pair, inters[1])); + CGAL_assertion(assign(pair, inters[1])); return pair.first; } return pair.first; @@ -177,9 +177,9 @@ namespace internal { const Hyperbolic_point_2& r, const Hyperbolic_point_2& s) const { - CGAL_triangulation_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && + CGAL_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && (_gt.orientation_2_object()(p, s, q) == ON_POSITIVE_SIDE)); - CGAL_triangulation_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && + CGAL_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && (_gt.side_of_oriented_circle_2_object()(p, s, q, r) == ON_NEGATIVE_SIDE)); Construct_circle_or_line_supporting_bisector cclsb(_gt); @@ -218,7 +218,7 @@ namespace internal { const Hyperbolic_point_2& q, const Hyperbolic_point_2& r) const { - CGAL_triangulation_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); + CGAL_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); Construct_circle_or_line_supporting_bisector cclsb(_gt); Construct_hyperbolic_circumcenter_CK_2 chc(_gt); @@ -240,13 +240,13 @@ namespace internal { intersection(bis_pq, l_inf, std::back_inserter(inters)); std::pair pair; - CGAL_triangulation_assertion(assign(pair,inters[0])); - CGAL_triangulation_assertion(pair.second == 1); + CGAL_assertion(assign(pair,inters[0])); + CGAL_assertion(pair.second == 1); if(_gt.less_y_2_object()(p, q)) return Line_arc_2(bis_pq,a,pair.first); - CGAL_triangulation_assertion(assign(pair,inters[1])); - CGAL_triangulation_assertion(pair.second == 1); + CGAL_assertion(assign(pair,inters[1])); + CGAL_assertion(pair.second == 1); return Line_arc_2(bis_pq,a,pair.first); } @@ -261,8 +261,8 @@ namespace internal { intersection(*c_pq, l_inf, std::back_inserter(inters)); std::pair pair; - CGAL_triangulation_assertion(assign(pair,inters[0])); - CGAL_triangulation_assertion(pair.second == 1); + CGAL_assertion(assign(pair,inters[0])); + CGAL_assertion(pair.second == 1); Hyperbolic_point_2 approx_pinf(to_double(pair.first.x()), to_double(pair.first.y())); Hyperbolic_point_2 approx_c(to_double(c_pq->center().x()), @@ -275,7 +275,7 @@ namespace internal { return Circular_arc_2(*c_pq, pair.first, a); } - CGAL_triangulation_assertion(assign(pair,inters[1])); + CGAL_assertion(assign(pair,inters[1])); if(_gt.orientation_2_object()(approx_c,approx_a,approx_pinf) == POSITIVE) return Circular_arc_2(*c_pq, pair.first, a); diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h index 2e7e8d268b2..801ee71d993 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -365,9 +365,9 @@ public: const Hyperbolic_point_2& r, const Hyperbolic_point_2& s) const { - CGAL_triangulation_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && + CGAL_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && (_gt.orientation_2_object()(p, s, q) == ON_POSITIVE_SIDE)); - CGAL_triangulation_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && + CGAL_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && (_gt.side_of_oriented_circle_2_object()(p, s, q, r) == ON_NEGATIVE_SIDE)); Construct_hyperbolic_circumcenter_2 chc(_gt); @@ -405,7 +405,7 @@ public: const Hyperbolic_point_2& q, const Hyperbolic_point_2& r) const { - CGAL_triangulation_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); + CGAL_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); Construct_circle_or_line_supporting_bisector cclsb(_gt); Construct_hyperbolic_circumcenter_2 chc(_gt); diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h index 6506f397267..6ba1f63c043 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h b/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h index 4b26a1245ea..de50b9defa9 100644 --- a/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h +++ b/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -79,7 +79,7 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt, typedef typename Dt::Locate_type Locate_type; typedef typename Gt::FT Coord_type; - CGAL_triangulation_precondition (dt.dimension() == 3); + CGAL_precondition (dt.dimension() == 3); Locate_type lt; int li, lj; @@ -119,9 +119,9 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt, if (dt.is_infinite(cc1)) return make_triple(nn_out, norm_coeff=Coord_type(1), false);//point outside the convex-hull - CGAL_triangulation_assertion_code(Cell_handle cc2 = cc1->neighbor(f1.second);) - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc1) != cells.end());//TODO : Delete - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc2) == cells.end());//TODO : Delete + CGAL_assertion_code(Cell_handle cc2 = cc1->neighbor(f1.second);) + CGAL_assertion(std::find(cells.begin(),cells.end(),cc1) != cells.end());//TODO : Delete + CGAL_assertion(std::find(cells.begin(),cells.end(),cc2) == cells.end());//TODO : Delete Point C_1 = construct_circumcenter
    (f1, Q, dt.geom_traits()); for(int j=1; j<4; j++) @@ -137,7 +137,7 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt, Cell_handle next = cc3->neighbor(num_next); while (std::find(cells.begin(),cells.end(),next) != cells.end()) { - CGAL_triangulation_assertion( next != cc1 ); + CGAL_assertion( next != cc1 ); cc3 = next; num_next = dt.next_around_edge(cc3->index(vR),cc3->index(vP)); next = cc3->neighbor(num_next); @@ -181,7 +181,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, typedef typename Dt::Locate_type Locate_type; typedef typename Gt::FT Coord_type; - CGAL_triangulation_precondition (dt.dimension()== 3); + CGAL_precondition (dt.dimension()== 3); Locate_type lt; int li, lj; @@ -215,7 +215,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, { // for each cell cc1 in conflict Cell_handle cc1 = *cit; - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc1)!=cells.end());//TODO : Delete + CGAL_assertion(std::find(cells.begin(),cells.end(),cc1)!=cells.end());//TODO : Delete if (dt.is_infinite(cc1)) return make_triple(nn_out,norm_coeff=Coord_type(1), false);//point outside the convex-hull @@ -245,7 +245,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, while (std::find(cells.begin(),cells.end(),next) != cells.end()) { //next is in conflict - CGAL_triangulation_assertion( next != cc1 ); + CGAL_assertion( next != cc1 ); cc3 = next; num_next = dt.next_around_edge(cc3->index(vR),cc3->index(vP)); next = cc3->neighbor(num_next); @@ -269,7 +269,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, } else // cc2 in the conflict cavity { - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc2)!=cells.end());//TODO : Delete + CGAL_assertion(std::find(cells.begin(),cells.end(),cc2)!=cells.end());//TODO : Delete if (dt.is_infinite(cc2)) { //point outside the convex-hull @@ -352,12 +352,12 @@ construct_circumcenter(const typename DT::Facet& f, const typename DT::Geom_traits::Point_3& Q, const typename DT::Geom_traits& gt /* = typename DT::Geom_traits() */ ) { - CGAL_triangulation_precondition(//&3 in place of %4 - !gt.coplanar_3_object()( - f.first->vertex((f.second+1)&3)->point(), - f.first->vertex((f.second+2)&3)->point(), - f.first->vertex((f.second+3)&3)->point(), - Q)); + CGAL_precondition(//&3 in place of %4 + !gt.coplanar_3_object()( + f.first->vertex((f.second+1)&3)->point(), + f.first->vertex((f.second+2)&3)->point(), + f.first->vertex((f.second+3)&3)->point(), + Q)); // else the facet is not on the enveloppe of the conflict cavity associated to P return gt.construct_circumcenter_3_object()( f.first->vertex((f.second+1)&3)->point(), diff --git a/Kernel_23/include/CGAL/kernel_assertions.h b/Kernel_23/include/CGAL/kernel_assertions.h index 3bd9163f845..b34df95df1b 100644 --- a/Kernel_23/include/CGAL/kernel_assertions.h +++ b/Kernel_23/include/CGAL/kernel_assertions.h @@ -14,12 +14,9 @@ // // Author(s) : Geert-Jan Giezeman, Sven Schoenherr // -// Generated from script create_assertions.sh - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. +#ifndef CGAL_KERNEL_ASSERTIONS_H +#define CGAL_KERNEL_ASSERTIONS_H #include @@ -28,9 +25,6 @@ // assertions // ---------- -#undef CGAL_kernel_assertion -#undef CGAL_kernel_assertion_msg -#undef CGAL_kernel_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) # define CGAL_kernel_assertion(EX) (static_cast(0)) @@ -46,9 +40,6 @@ #endif // CGAL_KERNEL_NO_ASSERTIONS -#undef CGAL_kernel_exactness_assertion -#undef CGAL_kernel_exactness_assertion_msg -#undef CGAL_kernel_exactness_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -65,9 +56,6 @@ #endif // CGAL_KERNEL_NO_ASSERTIONS -#undef CGAL_kernel_expensive_assertion -#undef CGAL_kernel_expensive_assertion_msg -#undef CGAL_kernel_expensive_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) \ || defined(CGAL_NO_ASSERTIONS) \ @@ -85,9 +73,6 @@ #endif // CGAL_KERNEL_NO_ASSERTIONS -#undef CGAL_kernel_expensive_exactness_assertion -#undef CGAL_kernel_expensive_exactness_assertion_msg -#undef CGAL_kernel_expensive_exactness_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -108,9 +93,6 @@ // preconditions // ------------- -#undef CGAL_kernel_precondition -#undef CGAL_kernel_precondition_msg -#undef CGAL_kernel_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) # define CGAL_kernel_precondition(EX) (static_cast(0)) @@ -126,9 +108,6 @@ #endif // CGAL_KERNEL_NO_PRECONDITIONS -#undef CGAL_kernel_exactness_precondition -#undef CGAL_kernel_exactness_precondition_msg -#undef CGAL_kernel_exactness_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -145,9 +124,6 @@ #endif // CGAL_KERNEL_NO_PRECONDITIONS -#undef CGAL_kernel_expensive_precondition -#undef CGAL_kernel_expensive_precondition_msg -#undef CGAL_kernel_expensive_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -164,9 +140,6 @@ #endif // CGAL_KERNEL_NO_PRECONDITIONS -#undef CGAL_kernel_expensive_exactness_precondition -#undef CGAL_kernel_expensive_exactness_precondition_msg -#undef CGAL_kernel_expensive_exactness_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -187,9 +160,6 @@ // postconditions // -------------- -#undef CGAL_kernel_postcondition -#undef CGAL_kernel_postcondition_msg -#undef CGAL_kernel_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) # define CGAL_kernel_postcondition(EX) (static_cast(0)) @@ -205,9 +175,6 @@ #endif // CGAL_KERNEL_NO_POSTCONDITIONS -#undef CGAL_kernel_exactness_postcondition -#undef CGAL_kernel_exactness_postcondition_msg -#undef CGAL_kernel_exactness_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -224,9 +191,6 @@ #endif // CGAL_KERNEL_NO_POSTCONDITIONS -#undef CGAL_kernel_expensive_postcondition -#undef CGAL_kernel_expensive_postcondition_msg -#undef CGAL_kernel_expensive_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -243,9 +207,6 @@ #endif // CGAL_KERNEL_NO_POSTCONDITIONS -#undef CGAL_kernel_expensive_exactness_postcondition -#undef CGAL_kernel_expensive_exactness_postcondition_msg -#undef CGAL_kernel_expensive_exactness_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -266,9 +227,6 @@ // warnings // -------- -#undef CGAL_kernel_warning -#undef CGAL_kernel_warning_msg -#undef CGAL_kernel_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) # define CGAL_kernel_warning(EX) (static_cast(0)) @@ -284,9 +242,6 @@ #endif // CGAL_KERNEL_NO_WARNINGS -#undef CGAL_kernel_exactness_warning -#undef CGAL_kernel_exactness_warning_msg -#undef CGAL_kernel_exactness_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -303,9 +258,6 @@ #endif // CGAL_KERNEL_NO_WARNINGS -#undef CGAL_kernel_expensive_warning -#undef CGAL_kernel_expensive_warning_msg -#undef CGAL_kernel_expensive_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -322,9 +274,6 @@ #endif // CGAL_KERNEL_NO_WARNINGS -#undef CGAL_kernel_expensive_exactness_warning -#undef CGAL_kernel_expensive_exactness_warning_msg -#undef CGAL_kernel_expensive_exactness_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -340,3 +289,5 @@ # define CGAL_kernel_expensive_exactness_warning_code(CODE) CODE # define CGAL_kernel_expensive_exactness_warnings 1 #endif // CGAL_KERNEL_NO_WARNINGS + +#endif // CGAL_KERNEL_ASSERTIONS_H diff --git a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h b/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h index 3a49d756a71..fe4d4fd9869 100644 --- a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h +++ b/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index f8ea786fb06..bcccc5e3970 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -351,7 +351,7 @@ public: Vertex_handle vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); return V[i]; } @@ -374,13 +374,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } Cell_handle neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -403,7 +403,7 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } @@ -412,8 +412,8 @@ public: void set_neighbor(int i, Cell_handle n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i >= 0 && i <= 3); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -426,10 +426,10 @@ public: void set_neighbors(Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); - CGAL_triangulation_precondition( this != n3.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); + CGAL_precondition( this != n3.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; @@ -462,7 +462,7 @@ public: // but there's not much we can do for this now. void set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); invalidate_weighted_circumcenter_cache(); V[i] = v; } diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h index 71c327057ae..03537714d2a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h @@ -131,7 +131,7 @@ public: Periodic_2_Delaunay_triangulation_2(const Periodic_2_Delaunay_triangulation_2 &tr) : Base(tr) { - CGAL_triangulation_postcondition( is_valid(true) ); + CGAL_postcondition( is_valid(true) ); } /// Constructor with insertion of points @@ -467,7 +467,7 @@ public: OutputItBoundaryEdges eit, Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition( dimension() == 2); + CGAL_precondition( dimension() == 2); int li; Locate_type lt; Face_handle fh = locate(p, lt, li, start); @@ -487,7 +487,7 @@ public: pit = propagate_conflicts(p, fh, 2, pit); return pit; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return std::make_pair(fit, eit); } @@ -836,7 +836,7 @@ is_valid(bool verbose, int level) const side_of_oriented_circle(*p[0], *p[1], *p[2], *p[3], off[0], off[1], off[2], off[3], false); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } } @@ -866,7 +866,7 @@ typename Periodic_2_Delaunay_triangulation_2::Vertex_handle Periodic_2_Delaunay_triangulation_2:: nearest_vertex_2D(const Point& p, Face_handle f) const { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); f = locate(p, f); typename Geom_traits::Compare_distance_2 compare_distance = @@ -914,7 +914,7 @@ typename Periodic_2_Delaunay_triangulation_2::Point Periodic_2_Delaunay_triangulation_2:: dual (Face_handle f) const { - CGAL_triangulation_precondition (dimension() == 2); + CGAL_precondition (dimension() == 2); return circumcenter(f); } @@ -958,9 +958,9 @@ typename Periodic_2_Delaunay_triangulation_2::Vertex_handle Periodic_2_Delaunay_triangulation_2:: insert(const Point &p, Face_handle start) { - CGAL_triangulation_assertion((domain().xmin() <= p.x()) && + CGAL_assertion((domain().xmin() <= p.x()) && (p.x() < domain().xmax())); - CGAL_triangulation_assertion((domain().ymin() <= p.y()) && + CGAL_assertion((domain().ymin() <= p.y()) && (p.y() < domain().ymax())); if (empty()) @@ -1006,7 +1006,7 @@ insert(const Point &p, Locate_type lt, Face_handle loc, int li) { typename Base::Virtual_vertex_reverse_map_it vertices_it = this->virtual_vertices_reverse().find(vh); - CGAL_triangulation_assertion(vertices_it != this->virtual_vertices_reverse().end()); + CGAL_assertion(vertices_it != this->virtual_vertices_reverse().end()); const std::vector &virtual_vertices = vertices_it->second; for (size_t i = 0; i < virtual_vertices.size(); ++i) { @@ -1016,7 +1016,7 @@ insert(const Point &p, Locate_type lt, Face_handle loc, int li) this->try_to_convert_to_one_cover(); if (is_1_cover()) { - CGAL_triangulation_assertion(is_valid()); + CGAL_assertion(is_valid()); } } } @@ -1167,8 +1167,8 @@ remove(Vertex_handle v) // Make sure we have the original vertex CGAL_assertion(v == this->get_original_vertex(v)); - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(dimension() == 2); if ( this->number_of_vertices() == 1) { @@ -5070,7 +5070,7 @@ side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, if (points[i] == &p0 && (o = orientation(p, p1, p2)) != COLLINEAR) return Oriented_side(o); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -5114,7 +5114,7 @@ side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, != COLLINEAR)) return Oriented_side(orient); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h index 574fd1d31ec..1692ae346ec 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include namespace CGAL @@ -71,14 +71,14 @@ public: int &operator[](int i) { if (i == 0) return _offx; - CGAL_triangulation_assertion(i == 1); + CGAL_assertion(i == 1); return _offy; } /// Return the i-th entry of o. int operator[](int i) const { if (i == 0) return _offx; - CGAL_triangulation_assertion(i == 1); + CGAL_assertion(i == 1); return _offy; } /// Add o' to o using vector addition. diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h index 4104f5d9923..03d2a200940 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -418,8 +418,8 @@ public: /// \pre i == {0,1,2} Periodic_segment periodic_segment(Face_handle f, int i) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= 2); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( i >= 0 && i <= 2); return make_array(periodic_point(f, ccw(i)), periodic_point(f, cw(i))); } @@ -941,9 +941,9 @@ public: Offset get_neighbor_offset(Face_handle fh, int i, Face_handle nb, int j) const { // Redundance in the signature - CGAL_triangulation_precondition(fh->neighbor(i) == nb); - CGAL_triangulation_precondition(nb->neighbor(j) == fh); - CGAL_triangulation_precondition(fh->vertex(cw(i)) == nb->vertex(ccw(j))); + CGAL_precondition(fh->neighbor(i) == nb); + CGAL_precondition(nb->neighbor(j) == fh); + CGAL_precondition(fh->vertex(cw(i)) == nb->vertex(ccw(j))); return int_to_off(nb->offset(ccw(j))) - int_to_off(fh->offset(cw(i))); } @@ -975,8 +975,8 @@ public: /// Converts an offset to a bit pattern where bit1==offx and bit0==offy. int off_to_int(const Offset & off) const { - CGAL_triangulation_assertion( off.x() == 0 || off.x() == 1 ); - CGAL_triangulation_assertion( off.y() == 0 || off.y() == 1 ); + CGAL_assertion( off.x() == 0 || off.x() == 1 ); + CGAL_assertion( off.y() == 0 || off.y() == 1 ); int i = ((off.x() & 1) << 1) + (off.y() & 1); return i; } @@ -1018,9 +1018,9 @@ public: const std::vector& periodic_copies(const Vertex_handle v) const { - CGAL_triangulation_precondition(number_of_sheets() != make_array(1, 1) ); - CGAL_triangulation_precondition(_virtual_vertices.find(v) == _virtual_vertices.end()); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(v) != _virtual_vertices_reverse.end()); + CGAL_precondition(number_of_sheets() != make_array(1, 1) ); + CGAL_precondition(_virtual_vertices.find(v) == _virtual_vertices.end()); + CGAL_assertion(_virtual_vertices_reverse.find(v) != _virtual_vertices_reverse.end()); return _virtual_vertices_reverse.find(v)->second; } @@ -1044,9 +1044,9 @@ protected: // than sqrt(0.166) is fulfilled. if (_too_long_edge_counter == 0 && !is_1_cover()) { - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); this->convert_to_1_sheeted_covering(); - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); } } @@ -1218,7 +1218,7 @@ protected: /// Returns the offset such that (p, o) lies on the bounded side of the face f. Offset get_location_offset(Face_handle f, const Point &p, const Offset &o) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); if (is_1_cover() && f->has_zero_offsets()) { @@ -1296,14 +1296,14 @@ protected: } } - CGAL_triangulation_assertion((std::min)((std::min)(off0[0], off1[0]), off2[0]) == 0); - CGAL_triangulation_assertion((std::min)((std::min)(off0[1], off1[1]), off2[1]) == 0); - CGAL_triangulation_assertion((0 <= off0[0]) && (off0[0] < 2)); - CGAL_triangulation_assertion((0 <= off1[0]) && (off1[0] < 2)); - CGAL_triangulation_assertion((0 <= off2[0]) && (off2[0] < 2)); - CGAL_triangulation_assertion((0 <= off0[1]) && (off0[1] < 2)); - CGAL_triangulation_assertion((0 <= off1[1]) && (off1[1] < 2)); - CGAL_triangulation_assertion((0 <= off2[1]) && (off2[1] < 2)); + CGAL_assertion((std::min)((std::min)(off0[0], off1[0]), off2[0]) == 0); + CGAL_assertion((std::min)((std::min)(off0[1], off1[1]), off2[1]) == 0); + CGAL_assertion((0 <= off0[0]) && (off0[0] < 2)); + CGAL_assertion((0 <= off1[0]) && (off1[0] < 2)); + CGAL_assertion((0 <= off2[0]) && (off2[0] < 2)); + CGAL_assertion((0 <= off0[1]) && (off0[1] < 2)); + CGAL_assertion((0 <= off1[1]) && (off1[1] < 2)); + CGAL_assertion((0 <= off2[1]) && (off2[1] < 2)); int o0i = ((off0[0] & 1) << 1) + (off0[1] & 1); int o1i = ((off1[0] & 1) << 1) + (off1[1] & 1); @@ -1326,11 +1326,11 @@ protected: } bool has_self_edges(Face_handle fh) const { - CGAL_triangulation_assertion((fh->vertex(0) != fh->vertex(1)) || - (fh->offset(0) != fh->offset(1))); - CGAL_triangulation_assertion((fh->vertex(0) != fh->vertex(2)) || - (fh->offset(0) != fh->offset(2))); - CGAL_triangulation_assertion((fh->vertex(1) != fh->vertex(2)) || + CGAL_assertion((fh->vertex(0) != fh->vertex(1)) || + (fh->offset(0) != fh->offset(1))); + CGAL_assertion((fh->vertex(0) != fh->vertex(2)) || + (fh->offset(0) != fh->offset(2))); + CGAL_assertion((fh->vertex(1) != fh->vertex(2)) || (fh->offset(1) != fh->offset(2))); return ((fh->vertex(0) == fh->vertex(1)) || (fh->vertex(0) == fh->vertex(2)) || @@ -1408,7 +1408,7 @@ Periodic_2_triangulation_2::Periodic_2_triangulation_2( , _domain(domain) , _too_long_edge_counter(0) { - CGAL_triangulation_precondition(_domain.xmax() - _domain.xmin() == + CGAL_precondition(_domain.xmax() - _domain.xmin() == _domain.ymax() - _domain.ymin()); set_domain(_domain); } @@ -1470,7 +1470,7 @@ copy_multiple_covering(const Periodic_2_triangulation_2 & tr) vlist.push_back(vit); _virtual_vertices_reverse.insert( std::make_pair(vit, std::vector(8))); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(vit) + CGAL_assertion(_virtual_vertices_reverse.find(vit) ->second.size() == 8); } } @@ -1491,7 +1491,7 @@ copy_multiple_covering(const Periodic_2_triangulation_2 & tr) std::make_pair(*vlist_it, off))); _virtual_vertices_reverse.find(*vlist_it) ->second[3 * off[0] + off[1] - 1] = vit2; - CGAL_triangulation_assertion(get_offset(vit2) == off); + CGAL_assertion(get_offset(vit2) == off); } } // Cleanup vertex offsets @@ -1533,7 +1533,7 @@ copy_multiple_covering(const Periodic_2_triangulation_2 & tr) Vertex_handle v_no = eit->first->vertex(i); if (squared_distance(p1, p2) > _edge_length_threshold) { - CGAL_triangulation_assertion( + CGAL_assertion( find(_too_long_edges[v_no].begin(), _too_long_edges[v_no].end(), edge_to_add.second) == _too_long_edges[v_no].end()); @@ -1562,7 +1562,7 @@ void Periodic_2_triangulation_2::copy_triangulation( copy_multiple_covering(tr); } CGAL_assertion(_too_long_edge_counter == tr._too_long_edge_counter); - CGAL_triangulation_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(*this == tr); } template @@ -1628,7 +1628,7 @@ bool Periodic_2_triangulation_2::is_valid(Face_handle fh, bool /*verbos std::cerr << "Offset: " << o << std::endl; } std::cerr << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } return result; @@ -1638,7 +1638,7 @@ template bool Periodic_2_triangulation_2::is_valid(bool verbose, int level) const { bool result = _tds.is_valid(verbose, level); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); if (dimension() == 2) { @@ -1667,36 +1667,36 @@ bool Periodic_2_triangulation_2::is_valid(bool verbose, int level) cons } } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); // Check for the right number of simplices int copies = number_of_sheets()[0] * number_of_sheets()[1]; result &= (number_of_stored_vertices() == copies * number_of_vertices()); result &= (number_of_stored_edges() == copies * number_of_edges()); result &= (number_of_stored_faces() == copies * number_of_faces()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); // check number of euler characteristic. This cannot be done by the Tds // which does not know the genus result &= (number_of_stored_vertices() - number_of_stored_edges() + number_of_stored_faces() == 0); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); result &= !has_self_edges(); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); // Edges should not be longer than 1 periodicity for (Face_iterator fit = faces_begin(); fit != faces_end(); ++fit) { result &= is_valid(fit, verbose, level); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); result &= is_1_cover() == _virtual_vertices.empty(); result &= is_1_cover() == _virtual_vertices_reverse.empty(); result &= (_virtual_vertices.size() == (number_of_sheets()[0] * number_of_sheets()[1] - 1) * _virtual_vertices_reverse.size()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); for (Virtual_vertex_map_it it = _virtual_vertices.begin(); it != _virtual_vertices.end(); ++it) @@ -1722,7 +1722,7 @@ bool Periodic_2_triangulation_2::is_valid(bool verbose, int level) cons result &= false; } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); for (Virtual_vertex_reverse_map_it it = _virtual_vertices_reverse.begin(); it != _virtual_vertices_reverse.end(); ++it) @@ -1755,20 +1755,20 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, bool result = true; result &= is_1_cover() == _too_long_edges.empty(); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); size_t too_long_edges = 0; for (Too_long_edges_map_it it = _too_long_edges.begin(); it != _too_long_edges.end(); ++it) { too_long_edges += it->second.size(); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); if (_too_long_edge_counter != too_long_edges) { if (verbose) std::cout << "Too long edge counter is incorrect: " << _too_long_edge_counter << " != " << too_long_edges << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); /// Expensive check whether the right too long edges are in the list if (is_1_cover()) @@ -1781,7 +1781,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, Point p2 = construct_point(vh2->point(), get_offset(eit->first, cw(eit->second))); result &= (!edge_is_too_long(p1, p2)); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } else { @@ -1797,7 +1797,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (&*vh2 < &*vh1) std::swap(vh1, vh2); - CGAL_triangulation_assertion(&*vh1 < &*vh2); + CGAL_assertion(&*vh1 < &*vh2); bool too_long = edge_is_too_long(p1, p2); if (too_long != edge_is_too_long(p2, p1)) @@ -1805,7 +1805,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (verbose) std::cout << "Long edge criterion not symmetric c(v1,v2) != c(v2,v1)" << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); Too_long_edges_map_it it = _too_long_edges.find(vh1); if (it == _too_long_edges.end()) @@ -1816,7 +1816,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, result = false; } result &= !too_long; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } else { @@ -1829,7 +1829,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (verbose) std::cout << "2. Too long edge not in the data structure" << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } else { @@ -1838,7 +1838,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (verbose) std::cout << "Edge is not too long, but contained in the data structure" << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } } @@ -1849,7 +1849,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, std::cout << "Counts do not match: " << _too_long_edge_counter << " != " << too_long_edges << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; @@ -1926,9 +1926,9 @@ void Periodic_2_triangulation_2::flip(Face_handle f, int i) vh2_offset = it_vh2->second.second; } - CGAL_triangulation_assertion( + CGAL_assertion( virtual_vertices_reverse().find(vh1) != virtual_vertices_reverse().end()); - CGAL_triangulation_assertion( + CGAL_assertion( virtual_vertices_reverse().find(vh2) != virtual_vertices_reverse().end()); const std::vector &v1s = virtual_vertices_reverse().find(vh1)->second; @@ -1972,11 +1972,11 @@ void Periodic_2_triangulation_2::flip(Face_handle f, int i) template void Periodic_2_triangulation_2::flip_single_edge(Face_handle f, int i) { - CGAL_triangulation_precondition(f != Face_handle()); - CGAL_triangulation_precondition(i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(f != Face_handle()); + CGAL_precondition(i == 0 || i == 1 || i == 2); + CGAL_precondition(dimension() == 2); - CGAL_triangulation_precondition(flippable(f, i)); + CGAL_precondition(flippable(f, i)); if (!is_1_cover()) remove_too_long_edge(f, i); @@ -2012,7 +2012,7 @@ void Periodic_2_triangulation_2::flip_single_edge(Face_handle f, int i) } else { - CGAL_triangulation_assertion(nb_offset.x() == -1); + CGAL_assertion(nb_offset.x() == -1); CGAL_assertion((offsets[3] & 2) == 0); offsets[3] |= 2; } @@ -2028,20 +2028,20 @@ void Periodic_2_triangulation_2::flip_single_edge(Face_handle f, int i) } else { - CGAL_triangulation_assertion(nb_offset.y() == -1); + CGAL_assertion(nb_offset.y() == -1); CGAL_assertion((offsets[3] & 1) == 0); offsets[3] |= 1; } } CGAL_assertion((offsets[0] & offsets[1] & offsets[2] & offsets[3]) == 0); - CGAL_triangulation_assertion_code(Vertex_handle vh = f->vertex(i)); - CGAL_triangulation_assertion_code(Vertex_handle vh_ccw = f->vertex(ccw(i))); + CGAL_assertion_code(Vertex_handle vh = f->vertex(i)); + CGAL_assertion_code(Vertex_handle vh_ccw = f->vertex(ccw(i))); _tds.flip(f, i); // Combinatorial checks - CGAL_triangulation_assertion(vh == f->vertex(i)); - CGAL_triangulation_assertion(vh_ccw == f->vertex(ccw(i))); - CGAL_triangulation_assertion(f->vertex(i) == nb->vertex(cw(nb_index))); - CGAL_triangulation_assertion(f->vertex(cw(i)) == nb->vertex(nb_index)); + CGAL_assertion(vh == f->vertex(i)); + CGAL_assertion(vh_ccw == f->vertex(ccw(i))); + CGAL_assertion(f->vertex(i) == nb->vertex(cw(nb_index))); + CGAL_assertion(f->vertex(cw(i)) == nb->vertex(nb_index)); // Restore the offsets int new_off[3]; @@ -2065,7 +2065,7 @@ void Periodic_2_triangulation_2::remove_from_virtual_copies(Vertex_handle v) { typename Virtual_vertex_reverse_map::iterator rev_it = _virtual_vertices_reverse.find(v); - CGAL_triangulation_assertion(rev_it != _virtual_vertices_reverse.end()); + CGAL_assertion(rev_it != _virtual_vertices_reverse.end()); const std::vector &virtual_copies = rev_it->second; for (size_t i = 0; i < virtual_copies.size(); ++i) @@ -2176,8 +2176,8 @@ Gt, Tds >::insert_first(const Point& p) _tds.set_dimension(2); // create the base for too_long_edges; - CGAL_triangulation_assertion(_too_long_edges.empty() ); - CGAL_triangulation_assertion(_too_long_edge_counter == 0); + CGAL_assertion(_too_long_edges.empty() ); + CGAL_assertion(_too_long_edge_counter == 0); // Insert all vertices as the first vertex in the _too_long_edges list int k = 0; @@ -2224,14 +2224,14 @@ Periodic_2_triangulation_2::insert_in_edge(const Point& p, const Offset // Insert in edge calls an insert_in_face and a flip. // Therefore there is no need to update the too_long_edges bookkeeping directly. - CGAL_triangulation_assertion(number_of_vertices() != 0); - CGAL_triangulation_assertion((!is_1_cover()) || (o == Offset())); + CGAL_assertion(number_of_vertices() != 0); + CGAL_assertion((!is_1_cover()) || (o == Offset())); // Backup of the neighbor and its relative offset Face_handle nb = f->neighbor(i); int j = nb->index(f); - CGAL_triangulation_assertion_code(Offset current_offset = get_location_offset(f, p, o)); - CGAL_triangulation_assertion + CGAL_assertion_code(Offset current_offset = get_location_offset(f, p, o)); + CGAL_assertion (orientation(f->vertex(cw(i))->point(), p, f->vertex(ccw(i))->point(), get_offset(f, cw(i)), combine_offsets(o, current_offset), get_offset(f, ccw(i))) == COLLINEAR && collinear_between(f->vertex(cw(i))->point(), p, f->vertex(ccw(i))->point(), @@ -2256,9 +2256,9 @@ Periodic_2_triangulation_2::insert_in_face(const Point& p, const Offset Face_handle f, Vertex_handle vh) { - CGAL_triangulation_assertion(f != Face_handle()); - CGAL_triangulation_assertion(number_of_vertices() != 0); - CGAL_triangulation_assertion((!is_1_cover()) || (o == Offset())); + CGAL_assertion(f != Face_handle()); + CGAL_assertion(number_of_vertices() != 0); + CGAL_assertion((!is_1_cover()) || (o == Offset())); const bool simplicity_criterion = f->has_zero_offsets() && o.is_zero(); @@ -2269,21 +2269,21 @@ Periodic_2_triangulation_2::insert_in_face(const Point& p, const Offset Face_handle nb[3]; int nb_index[3]; int offsets[3]; - CGAL_triangulation_assertion_code( Vertex_handle vertices[3]; ) + CGAL_assertion_code( Vertex_handle vertices[3]; ) if (!simplicity_criterion) { // Choose the periodic copy of tester.point() that is inside c. current_off = get_location_offset(f, p, o); - CGAL_triangulation_assertion(oriented_side(f, p, combine_offsets(o, current_off)) != ON_NEGATIVE_SIDE); + CGAL_assertion(oriented_side(f, p, combine_offsets(o, current_off)) != ON_NEGATIVE_SIDE); for (int i = 0; i < 3; ++i) { nb[i] = f->neighbor(i); nb_index[i] = nb[i]->index(f); offsets[i] = f->offset(i); - CGAL_triangulation_assertion_code( vertices[i] = f->vertex(i); ); + CGAL_assertion_code( vertices[i] = f->vertex(i); ); } } @@ -2301,8 +2301,8 @@ Periodic_2_triangulation_2::insert_in_face(const Point& p, const Offset Face_handle new_face = nb[i]->neighbor(nb_index[i]); int v_index = new_face->index(v); - CGAL_triangulation_assertion(new_face->vertex(ccw(v_index)) == vertices[ccw(i)]); - CGAL_triangulation_assertion(new_face->vertex(cw(v_index)) == vertices[cw(i)]); + CGAL_assertion(new_face->vertex(ccw(v_index)) == vertices[ccw(i)]); + CGAL_assertion(new_face->vertex(cw(v_index)) == vertices[cw(i)]); new_offsets[v_index] = v_offset; new_offsets[ccw(v_index)] = offsets[ccw(i)]; @@ -2330,9 +2330,9 @@ template typename Periodic_2_triangulation_2::Vertex_handle Periodic_2_triangulation_2::insert(const Point &p, Face_handle start) { - CGAL_triangulation_assertion((_domain.xmin() <= p.x()) && + CGAL_assertion((_domain.xmin() <= p.x()) && (p.x() < _domain.xmax())); - CGAL_triangulation_assertion((_domain.ymin() <= p.y()) && + CGAL_assertion((_domain.ymin() <= p.y()) && (p.y() < _domain.ymax())); if (number_of_stored_vertices() == 0) @@ -2383,9 +2383,9 @@ Periodic_2_triangulation_2::insert(const Point& p, } // vstart should be non-virtual, but should have virtual copies - CGAL_triangulation_assertion(_virtual_vertices.find(vstart) + CGAL_assertion(_virtual_vertices.find(vstart) == _virtual_vertices.end()); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(vstart) + CGAL_assertion(_virtual_vertices_reverse.find(vstart) != _virtual_vertices_reverse.end()); } @@ -2455,7 +2455,7 @@ Gt, Tds >::insert(const Point& p, const Offset &o, Locate_type lt, } default: { - CGAL_triangulation_assertion(false); // locate step failed + CGAL_assertion(false); // locate step failed return Vertex_handle(); } } @@ -2744,7 +2744,7 @@ bool Periodic_2_triangulation_2::compare_walks(const Point& p, std::cerr << std::endl; } - CGAL_triangulation_assertion(b); + CGAL_assertion(b); return b; } @@ -2959,9 +2959,9 @@ typename Periodic_2_triangulation_2::Face_handle Periodic_2_triangulati Gt, Tds >::locate(const Point& p, const Offset &o, Locate_type& lt, int& li, Face_handle start) const { - CGAL_triangulation_assertion((_domain.xmin() <= p.x()) && + CGAL_assertion((_domain.xmin() <= p.x()) && (p.x() < _domain.xmax())); - CGAL_triangulation_assertion((_domain.ymin() <= p.y()) && + CGAL_assertion((_domain.ymin() <= p.y()) && (p.y() < _domain.ymax())); if (dimension() <= 0) @@ -3000,7 +3000,7 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() { if (is_1_cover()) return; - CGAL_triangulation_expensive_assertion(is_triangulation_in_1_sheet()); + CGAL_expensive_assertion(is_triangulation_in_1_sheet()); bool to_delete, has_simplifiable_offset; Virtual_vertex_map_it vvmit; @@ -3087,16 +3087,16 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() // The vector from nb to the "original" periodic copy of nb, that is // the copy that will not be deleted. Offset difference_offset(x, y); - CGAL_triangulation_assertion( !difference_offset.is_null() ); + CGAL_assertion( !difference_offset.is_null() ); // We now have to find the "original" periodic copy of nb from // its vertices. Therefore, we first have to find the vertices. for (int j = 0; j < 3; j++) { - CGAL_triangulation_assertion( (off[j] - difference_offset)[0] >= 0); - CGAL_triangulation_assertion( (off[j] - difference_offset)[1] >= 0); - CGAL_triangulation_assertion( (off[j] - difference_offset)[0] < 3); - CGAL_triangulation_assertion( (off[j] - difference_offset)[1] < 3); + CGAL_assertion( (off[j] - difference_offset)[0] >= 0); + CGAL_assertion( (off[j] - difference_offset)[1] >= 0); + CGAL_assertion( (off[j] - difference_offset)[0] < 3); + CGAL_assertion( (off[j] - difference_offset)[1] < 3); // find the Vertex_handles of the vertices of the "original" // periodic copy of nb. If the vertex is inside the original @@ -3151,19 +3151,19 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() off[i] = Offset(); get_vertex(it, i, vert[i], off[i]); it->set_vertex(i, vert[i]); - CGAL_triangulation_assertion(vert[i]->point()[0] < _domain.xmax()); - CGAL_triangulation_assertion(vert[i]->point()[1] < _domain.ymax()); - CGAL_triangulation_assertion(vert[i]->point()[0] >= _domain.xmin()); - CGAL_triangulation_assertion(vert[i]->point()[1] >= _domain.ymin()); + CGAL_assertion(vert[i]->point()[0] < _domain.xmax()); + CGAL_assertion(vert[i]->point()[1] < _domain.ymax()); + CGAL_assertion(vert[i]->point()[0] >= _domain.xmin()); + CGAL_assertion(vert[i]->point()[1] >= _domain.ymin()); // redirect also the face pointer of the vertex. it->vertex(i)->set_face(it); } // Set the offsets. set_offsets(it, off[0], off[1], off[2]); - CGAL_triangulation_assertion( int_to_off(it->offset(0)) == off[0] ); - CGAL_triangulation_assertion( int_to_off(it->offset(1)) == off[1] ); - CGAL_triangulation_assertion( int_to_off(it->offset(2)) == off[2] ); + CGAL_assertion( int_to_off(it->offset(0)) == off[0] ); + CGAL_assertion( int_to_off(it->offset(1)) == off[1] ); + CGAL_assertion( int_to_off(it->offset(2)) == off[2] ); } } @@ -3196,7 +3196,7 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() { if (_virtual_vertices.count(vit) != 0) { - CGAL_triangulation_assertion( _virtual_vertices.count( vit ) == 1 ); + CGAL_assertion( _virtual_vertices.count( vit ) == 1 ); vertices_to_delete.push_back(vit); } } @@ -3213,7 +3213,7 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() _too_long_edge_counter = 0; _too_long_edges.clear(); - CGAL_triangulation_assertion(is_1_cover()); + CGAL_assertion(is_1_cover()); } template @@ -3221,7 +3221,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { if (_cover == make_array(3, 3)) return; - CGAL_triangulation_precondition(is_1_cover()); + CGAL_precondition(is_1_cover()); // Create 9 copies of each vertex and write virtual_vertices and // virtual_vertices_reverse @@ -3299,7 +3299,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() for (int i = 0; i < 3; i++) { vvrmit[i] = _virtual_vertices_reverse.find((*fit)->vertex(i)); - CGAL_triangulation_assertion( + CGAL_assertion( vvrmit[i] != _virtual_vertices_reverse.end()); vvoff[i] = int_to_off((*fit)->offset(i)); } @@ -3313,7 +3313,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() int o_i = ((n + 1) / 3 + vvoff[i].x() + 3) % 3; int o_j = ((n + 1) + vvoff[i].y() + 3) % 3; int n_c = 3 * o_i + o_j - 1; - CGAL_triangulation_assertion(n_c >= -1); + CGAL_assertion(n_c >= -1); if (n_c == -1) vvh[i] = (*fit)->vertex(i); else @@ -3333,13 +3333,13 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { Virtual_vertex_reverse_map_it vvrmit = _virtual_vertices_reverse.find( (*fit)->vertex(i)); - CGAL_triangulation_assertion(vvrmit != _virtual_vertices_reverse.end()); + CGAL_assertion(vvrmit != _virtual_vertices_reverse.end()); Offset vvoff = int_to_off((*fit)->offset(i)); if (!vvoff.is_null()) { int n_f = 3 * vvoff.x() + vvoff.y() - 1; - CGAL_triangulation_assertion(n_f >= 0); - CGAL_triangulation_assertion(static_cast(n_f) < vvrmit->second.size()); + CGAL_assertion(n_f >= 0); + CGAL_assertion(static_cast(n_f) < vvrmit->second.size()); (*fit)->set_vertex(i, vvrmit->second[n_f]); } } @@ -3350,14 +3350,14 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() for (typename std::list::iterator fit = original_faces.begin(); fit != original_faces.end(); ++fit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); VCRMIT c_cp = virtual_faces_reverse.find(*fit); - CGAL_triangulation_assertion(c_cp != virtual_faces_reverse.end()); + CGAL_assertion(c_cp != virtual_faces_reverse.end()); for (int i = 0; i < 3; i++) { Face_handle fit_nb = (*fit)->neighbor(i); VCRMIT c_cp_nb = virtual_faces_reverse.find(fit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_faces_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_faces_reverse.end()); Offset nboff = (*oit)[i]; for (int n = 0; n < 8; n++) { @@ -3372,16 +3372,16 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() } if (n_nb == -1) { - CGAL_triangulation_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); - CGAL_triangulation_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex( cw(i))) ); + CGAL_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); + CGAL_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex( cw(i))) ); c_cp->second[n]->set_neighbor(i, fit_nb); } else { - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex( cw(i))) ); + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex( cw(i))) ); c_cp->second[n]->set_neighbor(i, c_cp_nb->second[n_nb]); } } @@ -3393,7 +3393,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() for (typename std::list::iterator fit = original_faces.begin(); fit != original_faces.end(); ++fit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); for (int i = 0; i < 3; i++) { Offset nboff = (*oit)[i]; @@ -3401,14 +3401,14 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { Face_handle fit_nb = (*fit)->neighbor(i); VCRMIT c_cp_nb = virtual_faces_reverse.find(fit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_faces_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_faces_reverse.end()); int o_i = (3 - nboff.x()) % 3; int o_j = (3 - nboff.y()) % 3; int n_nb = 3 * o_i + o_j - 1; - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex(ccw(i))) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex( cw(i))) ); + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex(ccw(i))) ); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex( cw(i))) ); (*fit)->set_neighbor(i, c_cp_nb->second[n_nb]); } } @@ -3428,7 +3428,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() != original_faces.end(); ++fit) { VCRMIT c_cp = virtual_faces_reverse.find(*fit); - CGAL_triangulation_assertion( c_cp != virtual_faces_reverse.end()); + CGAL_assertion( c_cp != virtual_faces_reverse.end()); Offset off[3]; for (int i = 0; i < 3; i++) off[i] = int_to_off((*fit)->offset(i)); @@ -3445,8 +3445,8 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { off_cp[i] = Offset((o_i == 2) ? off[i].x() : 0, (o_j == 2) ? off[i].y() : 0); - CGAL_triangulation_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); - CGAL_triangulation_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); + CGAL_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); + CGAL_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); } set_offsets(c_cp->second[n], off_cp[0], off_cp[1], off_cp[2]); } @@ -3458,9 +3458,9 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { //This statement does not seem to have any effect set_offsets(*fit, 0, 0, 0); - CGAL_triangulation_assertion((*fit)->offset(0) == 0); - CGAL_triangulation_assertion((*fit)->offset(1) == 0); - CGAL_triangulation_assertion((*fit)->offset(2) == 0); + CGAL_assertion((*fit)->offset(0) == 0); + CGAL_assertion((*fit)->offset(1) == 0); + CGAL_assertion((*fit)->offset(2) == 0); } _cover = make_array(3, 3); @@ -3474,9 +3474,9 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() } _too_long_edge_counter = find_too_long_edges(_too_long_edges); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); - CGAL_triangulation_assertion(!is_1_cover()); + CGAL_assertion(!is_1_cover()); } // iterate over all edges and store the ones that are longer than @@ -3547,17 +3547,17 @@ inline void Periodic_2_triangulation_2::get_vertex(Vertex_handle vh_i, // if vh_i is not contained in virtual_vertices, then it is in the // original domain. vh = vh_i; - CGAL_triangulation_assertion(vh != Vertex_handle()); + CGAL_assertion(vh != Vertex_handle()); } else { // otherwise it has to be looked up as well as its offset. vh = it->second.first; off += it->second.second; - CGAL_triangulation_assertion(vh->point().x() < _domain.xmax()); - CGAL_triangulation_assertion(vh->point().y() < _domain.ymax()); - CGAL_triangulation_assertion(vh->point().x() >= _domain.xmin()); - CGAL_triangulation_assertion(vh->point().y() >= _domain.ymin()); + CGAL_assertion(vh->point().x() < _domain.xmax()); + CGAL_assertion(vh->point().y() < _domain.ymax()); + CGAL_assertion(vh->point().x() >= _domain.xmin()); + CGAL_assertion(vh->point().y() >= _domain.ymin()); } } @@ -3575,7 +3575,7 @@ GT, Tds >::get_face(const Vertex_handle* vh) const Face_circulator done(fc); do { - CGAL_triangulation_assertion( + CGAL_assertion( fc->vertex(0) == vh[2] || fc->vertex(1) == vh[2] || fc->vertex(2) == vh[2]); @@ -3591,7 +3591,7 @@ GT, Tds >::get_face(const Vertex_handle* vh) const } while (++fc != done); - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Face_handle(); } @@ -3599,7 +3599,7 @@ template Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, const Offset &off, Face_handle f, Locate_type <, int &li) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); Orientation o0, o1, o2; o0 = o1 = o2 = ZERO; @@ -3607,7 +3607,7 @@ Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, if ((cumm_off == 0) && is_1_cover()) { - CGAL_triangulation_assertion(off == Offset()); + CGAL_assertion(off == Offset()); const Point &p0 = f->vertex(0)->point(); const Point &p1 = f->vertex(1)->point(); @@ -3629,7 +3629,7 @@ Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, p[i] = &(f->vertex(i)->point()); offs[i] = get_offset(f, i); } - CGAL_triangulation_assertion(orientation(*p[0], *p[1], *p[2], + CGAL_assertion(orientation(*p[0], *p[1], *p[2], offs[0], offs[1], offs[2]) == POSITIVE); bool found = false; for (int i = 0; (i < 4) && (!found); i++) @@ -3681,7 +3681,7 @@ Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, default: { // impossible : cannot be on 3 edges for a real triangle - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -3753,7 +3753,7 @@ Bounded_side Periodic_2_triangulation_2::bounded_side(const Point &p0, { // return position of point p with respect to triangle p0p1p2 - CGAL_triangulation_precondition( orientation(p0, p1, p2) != COLLINEAR); + CGAL_precondition( orientation(p0, p1, p2) != COLLINEAR); Orientation o1 = orientation(p0, p1, p); Orientation o2 = orientation(p1, p2, p); @@ -3796,7 +3796,7 @@ Bounded_side Periodic_2_triangulation_2::bounded_side(const Point &p0, const Offset &o1, const Offset &o2, const Offset &o) const { // return position of point p with respect to triangle p0p1p2 - CGAL_triangulation_precondition( orientation(p0, p1, p2, o0, o1, o2) != COLLINEAR); + CGAL_precondition( orientation(p0, p1, p2, o0, o1, o2) != COLLINEAR); Orientation orient1 = orientation(p0, p1, p, o0, o1, o); Orientation orient2 = orientation(p1, p2, p, o1, o2, o); Orientation orient3 = orientation(p2, p0, p, o2, o0, o); @@ -3995,7 +3995,7 @@ void Periodic_2_triangulation_2::insert_too_long_edge(Face_handle f, in } else { - CGAL_triangulation_precondition(&*vh2 < &*vh1); + CGAL_precondition(&*vh2 < &*vh1); if (edge_is_too_long(p2, p1) && (find(_too_long_edges[vh2].begin(), _too_long_edges[vh2].end(), vh1) == _too_long_edges[vh2].end())) { @@ -4039,7 +4039,7 @@ void Periodic_2_triangulation_2::remove_too_long_edges_in_star( } else { - CGAL_triangulation_precondition(&*vh2 < &*vh); + CGAL_precondition(&*vh2 < &*vh); if (edge_is_too_long(p1, p2) && (find(_too_long_edges[vh2].begin(), _too_long_edges[vh2].end(), vh) != _too_long_edges[vh2].end())) @@ -4190,14 +4190,14 @@ Periodic_2_triangulation_2::save(std::ostream& os) const << Offset(0, 0) << std::endl; else os << it->point() << Offset(0, 0); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(it) + CGAL_assertion(_virtual_vertices_reverse.find(it) != _virtual_vertices_reverse.end()); vv = _virtual_vertices_reverse.find(it)->second; - CGAL_triangulation_assertion(vv.size() == 8); + CGAL_assertion(vv.size() == 8); for (std::size_t j = 0; j < vv.size(); j++) { vvit = _virtual_vertices.find(vv[j]); - CGAL_triangulation_assertion(vvit != _virtual_vertices.end()); + CGAL_assertion(vvit != _virtual_vertices.end()); V[vv[j]] = i++; if (IO::is_ascii(os)) os << vv[j]->point() << std::endl @@ -4206,7 +4206,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const } } } - CGAL_triangulation_postcondition(i == _cover[0]*_cover[1]*n); + CGAL_postcondition(i == _cover[0]*_cover[1]*n); Unique_hash_map F(0, _tds.number_of_faces()); int inum = 0; @@ -4299,7 +4299,7 @@ Periodic_2_triangulation_2::load(std::istream& is) // the faces by the indices of their vertices in the preceding list // of vertices, plus the non combinatorial information on each face // the neighbors of each face by their index in the preceding list of face - CGAL_triangulation_precondition(is.good()); + CGAL_precondition(is.good()); clear(); @@ -4321,7 +4321,7 @@ Periodic_2_triangulation_2::load(std::istream& is) } std::cout << "Line:" << __LINE__ << " cx:" << cx << " cy:" << cy << " n:" << n << std::endl; - CGAL_triangulation_assertion((n / (cx * cy))*cx*cy == n); + CGAL_assertion((n / (cx * cy))*cx*cy == n); tds().set_dimension((n == 0 ? -2 : 2)); _domain = domain; @@ -4446,7 +4446,7 @@ Periodic_2_triangulation_2::load(std::istream& is) * (_domain.xmax() - _domain.xmin()); _too_long_edge_counter = find_too_long_edges(_too_long_edges); - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); return is; } @@ -4472,11 +4472,11 @@ test_next(const Periodic_2_triangulation_2 &t1, // Returns false if an inequality has been found. // Precondition: c1, c2 have been registered as well as their 4 vertices. - CGAL_triangulation_precondition(t1.number_of_vertices() != 0); - CGAL_triangulation_precondition(Cmap[c1] == c2); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); + CGAL_precondition(t1.number_of_vertices() != 0); + CGAL_precondition(Cmap[c1] == c2); + CGAL_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); typedef Periodic_2_triangulation_2 Tr1; typedef Periodic_2_triangulation_2 Tr2; diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h index 5935bd8980b..c2e8d60557a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -64,7 +64,7 @@ public: /// Periodic functions int offset(int i) const { - CGAL_triangulation_precondition( i >= 0 && i < 3 ); + CGAL_precondition( i >= 0 && i < 3 ); return ((_off >> 2 * i) & 3); } bool has_zero_offsets() const diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h index 91ddd875383..c3df3a7274d 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h @@ -455,13 +455,13 @@ typename Periodic_2_triangulation_hierarchy_2::Vertex_handle Periodic_2_triangulation_hierarchy_2:: move_if_no_collision(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); Vertex_handle old, ret; for (int l = 0; l < m_maxlevel; ++l) { Vertex_handle u = v->up(); - CGAL_triangulation_assertion(hierarchy[l]->is_valid()); + CGAL_assertion(hierarchy[l]->is_valid()); Vertex_handle w = hierarchy[l]->move_if_no_collision(v, p); if (l == 0) { @@ -491,13 +491,13 @@ typename Periodic_2_triangulation_hierarchy_2::Vertex_handle Periodic_2_triangulation_hierarchy_2:: move_point(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); Vertex_handle old, ret; for (int l = 0; l < m_maxlevel; ++l) { Vertex_handle u = v->up(); - CGAL_triangulation_assertion(hierarchy[l]->is_valid()); + CGAL_assertion(hierarchy[l]->is_valid()); Vertex_handle w = hierarchy[l]->move_point(v, p); if (l == 0) { diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h index 7e101966af8..afa1a55fce5 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h @@ -15,7 +15,7 @@ #include -#include +#include #include #include @@ -95,7 +95,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -138,7 +138,7 @@ public: bool operator==(const Periodic_triangle_iterator& ti) const { // We are only allowed to compare iterators of the same type. - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -208,7 +208,7 @@ private: void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; @@ -290,18 +290,18 @@ private: get_edge_offsets(off0, off1, off2); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->offset(0)); off1 = _t->int_to_off(pos->offset(1)); off2 = _t->int_to_off(pos->offset(2)); } - CGAL_triangulation_assertion(off0.x() == 0 || off0.x() == 1); - CGAL_triangulation_assertion(off0.y() == 0 || off0.y() == 1); - CGAL_triangulation_assertion(off1.x() == 0 || off1.x() == 1); - CGAL_triangulation_assertion(off1.y() == 0 || off1.y() == 1); - CGAL_triangulation_assertion(off2.x() == 0 || off2.x() == 1); - CGAL_triangulation_assertion(off2.y() == 0 || off2.y() == 1); + CGAL_assertion(off0.x() == 0 || off0.x() == 1); + CGAL_assertion(off0.y() == 0 || off0.y() == 1); + CGAL_assertion(off1.x() == 0 || off1.x() == 1); + CGAL_assertion(off1.y() == 0 || off1.y() == 1); + CGAL_assertion(off2.x() == 0 || off2.x() == 1); + CGAL_assertion(off2.y() == 0 || off2.y() == 1); int offx = ( ((off0.x() == 0 && off1.x() == 0 && off2.x() == 0) @@ -317,7 +317,7 @@ private: Periodic_triangle construct_periodic_triangle() const { - CGAL_triangulation_assertion(pos != typename T::Face_handle()); + CGAL_assertion(pos != typename T::Face_handle()); Offset off0, off1, off2; get_edge_offsets(off0, off1, off2); Offset transl_off = Offset((((_off >> 1) & 1) == 1 ? -1 : 0), @@ -414,7 +414,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -457,7 +457,7 @@ public: bool operator==(const Periodic_segment_iterator& ti) const { // We are only allowed to compare iterators of the same type. - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -524,7 +524,7 @@ private: void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; @@ -601,14 +601,14 @@ private: get_edge_offsets(off0, off1); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->first->offset(_t->cw(pos->second))); off1 = _t->int_to_off(pos->first->offset(_t->ccw(pos->second))); } Offset diff_off = off0 - off1; - CGAL_triangulation_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); - CGAL_triangulation_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); + CGAL_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); + CGAL_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); return( 2 * (diff_off.x() == 0 ? 0 : 1) + (diff_off.y() == 0 ? 0 : 1)); @@ -616,7 +616,7 @@ private: Periodic_segment construct_periodic_segment() const { - CGAL_triangulation_assertion(pos->first != typename T::Face_handle()); + CGAL_assertion(pos->first != typename T::Face_handle()); Offset off0, off1; get_edge_offsets(off0, off1); Offset transl_off = Offset((((_off >> 1) & 1) == 1 ? -1 : 0), @@ -708,7 +708,7 @@ public: while (pos != _t->vertices_end() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -730,7 +730,7 @@ public: while (pos != _t->vertices_begin() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -752,7 +752,7 @@ public: bool operator==(const Periodic_point_iterator& pi) const { // We are only allowed to compare iterators of the same type. - CGAL_triangulation_assertion(_it == pi._it); + CGAL_assertion(_it == pi._it); return _t == pi._t && pos == pi.pos; } @@ -795,7 +795,7 @@ private: Periodic_point construct_periodic_point() const { - CGAL_triangulation_assertion(pos != typename T::Vertex_handle()); + CGAL_assertion(pos != typename T::Vertex_handle()); Offset off = _t->get_offset(pos); return std::make_pair(pos->point(), off); } diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h index b6c6796dc00..b0ae5b190c2 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h @@ -20,7 +20,6 @@ #include #include -#include namespace CGAL { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h index 8bb160d07d2..cf3ba780543 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h @@ -239,8 +239,8 @@ public: if(!is_1_cover()) compute_too_long_edges(); - CGAL_triangulation_expensive_postcondition(*this == tr); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(is_valid()); } Periodic_3_Delaunay_triangulation_3 operator=(Periodic_3_Delaunay_triangulation_3 tr) @@ -304,9 +304,9 @@ public: Vertex_handle v_no = eit->first->vertex(i); if(squared_distance(p1,p2) > edge_length_threshold) { - CGAL_triangulation_assertion(find(too_long_edges[v_no].begin(), - too_long_edges[v_no].end(), - edge_to_add.second) == too_long_edges[v_no].end()); + CGAL_assertion(find(too_long_edges[v_no].begin(), + too_long_edges[v_no].end(), + edge_to_add.second) == too_long_edges[v_no].end()); too_long_edges[v_no].push_back(edge_to_add.second); ++too_long_edge_counter; } @@ -316,8 +316,8 @@ public: void create_initial_triangulation() { // create the base for too_long_edges; - CGAL_triangulation_assertion( too_long_edges.empty() ); - CGAL_triangulation_assertion(too_long_edge_counter == 0); + CGAL_assertion( too_long_edges.empty() ); + CGAL_assertion(too_long_edge_counter == 0); for(Vertex_iterator vit = vertices_begin(); vit !=vertices_end(); ++vit ) too_long_edges[vit] = std::list();; @@ -374,7 +374,7 @@ public: template void insert_too_long_edges(Vertex_handle v, const CellIt begin, const CellIt end) { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); // add newly added edges to too_long_edges, if necessary. Point p1,p2; std::pair< Vertex_handle, Vertex_handle > edge_to_add; @@ -389,7 +389,7 @@ public: if(&*((*it)->vertex(j)) > &*((*it)->vertex(k))) continue; // make the offsets canonical (wrt. to some notion) // add to too_long_edges, if not yet added and if "too long" - CGAL_triangulation_precondition( + CGAL_precondition( &*((*it)->vertex(j))< &*((*it)->vertex(k))); edge_to_add = std::make_pair((*it)->vertex(j), (*it)->vertex(k)); @@ -906,7 +906,7 @@ typename Periodic_3_Delaunay_triangulation_3::Vertex_handle Periodic_3_Delaunay_triangulation_3::nearest_vertex_in_cell( const Cell_handle& c, const Point& p, const Offset& o) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); Vertex_handle nearest = c->vertex(0); for(int i=1; i<4; i++) { nearest = (compare_distance(p,nearest->point(),c->vertex(i)->point(), @@ -925,12 +925,12 @@ typename Periodic_3_Delaunay_triangulation_3::Vertex_handle Periodic_3_Delaunay_triangulation_3:: move_point(Vertex_handle v, const Point& p) { - CGAL_triangulation_expensive_precondition(is_vertex(v)); + CGAL_expensive_precondition(is_vertex(v)); // Remember an incident vertex to restart // the point location after the removal. // Cell_handle c = v->cell(); //Vertex_handle old_neighbor = c->vertex(c->index(v) == 0 ? 1 : 0); - // CGAL_triangulation_assertion(old_neighbor != v); + // CGAL_assertion(old_neighbor != v); remove(v); @@ -953,7 +953,7 @@ void Periodic_3_Delaunay_triangulation_3::remove(Vertex_handle v) Cover_manager cover_manager(*this); Base::remove(v, remover, ct, cover_manager); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); } // Undocumented function that tries to remove 'v' but only does so if removal @@ -964,7 +964,7 @@ bool Periodic_3_Delaunay_triangulation_3:: remove_if_no_cover_change(Vertex_handle v) { - CGAL_triangulation_precondition(this->is_1_cover()); + CGAL_precondition(this->is_1_cover()); // Since we are in a 1-sheet configuration, we can call directly periodic_remove() // and don't need the conflict tester. The rest is copied from above. @@ -985,8 +985,8 @@ remove_if_no_cover_change(Vertex_handle v) return false; // removing would cause a cover change } - CGAL_triangulation_expensive_postcondition(is_valid()); - CGAL_triangulation_postcondition(this->is_1_cover()); + CGAL_expensive_postcondition(is_valid()); + CGAL_postcondition(this->is_1_cover()); return true; // successfully removed the vertex } @@ -999,7 +999,7 @@ Periodic_3_Delaunay_triangulation_3::find_conflicts( const Point& p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); std::vector facets; facets.reserve(64); @@ -1097,7 +1097,7 @@ _side_of_sphere(const Cell_handle& c, const Point& q, // 2 iterations are enough (cf paper) for(int i=4; i>2; --i) { if(points[i] == &pts[4]) { - CGAL_triangulation_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) + CGAL_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE); // since p0 p1 p2 p3 are non coplanar and positively oriented return ON_UNBOUNDED_SIDE; @@ -1121,7 +1121,7 @@ _side_of_sphere(const Cell_handle& c, const Point& q, } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_UNBOUNDED_SIDE; } @@ -1129,7 +1129,7 @@ template < class Gt, class Tds > bool Periodic_3_Delaunay_triangulation_3:: is_Gabriel(const Cell_handle c, int i) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); typename Geom_traits::Side_of_bounded_sphere_3 side_of_bounded_sphere = geom_traits().side_of_bounded_sphere_3_object(); @@ -1300,7 +1300,7 @@ public: bool test_initial_cell(Cell_handle c, const Offset &off) const { if(!(operator()(c, off))) - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return true; } @@ -1339,11 +1339,11 @@ public: inline void hide_point(Cell_handle, const Point &) { } inline void hide(Point &, Cell_handle ) const { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } inline void do_hide(const Point &, Cell_handle ) const { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } template < class Tester > inline bool replace_vertex(const Point &, Vertex_handle , @@ -1463,7 +1463,7 @@ operator>> (std::istream& is, Periodic_3_Delaunay_triangulation_3 &tr) tr.compute_too_long_edges(); - CGAL_triangulation_expensive_assertion( tr.is_valid() ); + CGAL_expensive_assertion( tr.is_valid() ); return is; } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h index ca7124d8688..d1b13b8e804 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -46,13 +46,13 @@ public: int &operator[](int i) { if (i==0) return _offx; if (i==1) return _offy; - CGAL_triangulation_assertion(i==2); + CGAL_assertion(i==2); return _offz; } int operator[](int i) const { if (i==0) return _offx; if (i==1) return _offy; - CGAL_triangulation_assertion(i==2); + CGAL_assertion(i==2); return _offz; } void operator+=(const Periodic_3_offset_3 &other) { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h index 65ff47224f3..d59967f0055 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h @@ -250,8 +250,8 @@ public: if(!is_1_cover()) insert_cells_with_too_big_orthoball(tr.cells_begin(), tr.cells_end()); - CGAL_triangulation_expensive_postcondition(*this == tr); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(is_valid()); } Periodic_3_regular_triangulation_3 operator=(Periodic_3_regular_triangulation_3 tr) @@ -269,7 +269,7 @@ public: void create_initial_triangulation() { - CGAL_triangulation_assertion( cells_with_too_big_orthoball.empty() ); + CGAL_assertion( cells_with_too_big_orthoball.empty() ); for(Cell_iterator iter = cells_begin(), end_iter = cells_end(); iter != end_iter; ++iter) cells_with_too_big_orthoball.insert(iter); @@ -412,8 +412,8 @@ public: Conflict_tester tester(point, this); Point_hider hider(this); Cover_manager cover_manager(*this); - CGAL_triangulation_precondition(point.weight() >= 0); - CGAL_triangulation_precondition_msg + CGAL_precondition(point.weight() >= 0); + CGAL_precondition_msg ( point.weight() < orthosphere_radius_threshold , "point.weight() < 1/64 * domain_size * domain_size" @@ -428,8 +428,8 @@ public: Conflict_tester tester(point, this); Point_hider hider(this); Cover_manager cover_manager(*this); - CGAL_triangulation_precondition(point.weight() >= 0); - CGAL_triangulation_precondition_msg + CGAL_precondition(point.weight() >= 0); + CGAL_precondition_msg ( point.weight() < orthosphere_radius_threshold, "point.weight() < 1/64 * domain_size * domain_size" @@ -444,7 +444,7 @@ public: if(first == last) return 0; - CGAL_triangulation_precondition_code + CGAL_precondition_code ( bool precondition_is_satisfied = true; for(InputIterator pc_first = first, pc_last = last; pc_first != pc_last; ++pc_first) @@ -457,7 +457,7 @@ public: } ) - CGAL_triangulation_precondition_msg + CGAL_precondition_msg ( precondition_is_satisfied, "0 <= point.weight() < 1/64 * domain_size * domain_size" @@ -555,7 +555,7 @@ public: insert(*hi); } - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } // Undocumented function that tries to remove 'v' but only does so if removal @@ -563,7 +563,7 @@ public: // \pre the triangulation is 1-sheeted bool remove_if_no_cover_change(Vertex_handle v) { - CGAL_triangulation_precondition(this->is_1_cover()); + CGAL_precondition(this->is_1_cover()); // Since we are in a 1-sheet configuration, we can call directly periodic_remove() // and don't need the conflict tester. The rest is copied from above. @@ -591,8 +591,8 @@ public: insert(*hi); } - CGAL_triangulation_expensive_postcondition(is_valid()); - CGAL_triangulation_postcondition(this->is_1_cover()); + CGAL_expensive_postcondition(is_valid()); + CGAL_postcondition(this->is_1_cover()); return true; // successfully removed the vertex } @@ -648,7 +648,7 @@ public: Oriented_side power_side_of_oriented_power_sphere(const Weighted_point &p, const Weighted_point &q) const { - CGAL_triangulation_precondition(this->equal(p, q)); + CGAL_precondition(this->equal(p, q)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q); } Oriented_side power_side_of_oriented_power_sphere(const Weighted_point &p, const Weighted_point &q, @@ -700,7 +700,7 @@ public: const Offset& o3 = this->get_offset(c,3); const Offset& oq = offset; - CGAL_triangulation_precondition( orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE ); + CGAL_precondition( orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE ); Oriented_side os = ON_NEGATIVE_SIDE; os = power_side_of_oriented_power_sphere(p0, p1, p2, p3, q, o0, o1, o2, o3, oq); @@ -721,7 +721,7 @@ public: // of the determinant has non null coefficient. for(int i=4; i>1; --i) { if(points[i] == &pts[4]) { - CGAL_triangulation_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) + CGAL_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE); // since p0 p1 p2 p3 are non coplanar and positively oriented return ON_UNBOUNDED_SIDE; @@ -745,7 +745,7 @@ public: } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_UNBOUNDED_SIDE; } @@ -802,12 +802,12 @@ public: CGAL_precondition(CGAL::abs(move.z()) < domain().zmax() - domain().zmin() ); // 'new_position' must be canonical - CGAL_triangulation_precondition(new_position.x() < domain().xmax()); - CGAL_triangulation_precondition(new_position.y() < domain().ymax()); - CGAL_triangulation_precondition(new_position.z() < domain().zmax()); - CGAL_triangulation_precondition(new_position.x() >= domain().xmin()); - CGAL_triangulation_precondition(new_position.y() >= domain().ymin()); - CGAL_triangulation_precondition(new_position.z() >= domain().zmin()); + CGAL_precondition(new_position.x() < domain().xmax()); + CGAL_precondition(new_position.y() < domain().ymax()); + CGAL_precondition(new_position.z() < domain().zmax()); + CGAL_precondition(new_position.x() >= domain().xmin()); + CGAL_precondition(new_position.y() >= domain().ymin()); + CGAL_precondition(new_position.z() >= domain().zmin()); if(new_position == v->point()) return; @@ -936,9 +936,9 @@ public: std::cout << "moved v to " << v->point() << std::endl; #endif - CGAL_triangulation_precondition(!(v->point().x() < domain().xmin()) && v->point().x() < domain().xmax()); - CGAL_triangulation_precondition(!(v->point().y() < domain().ymin()) && v->point().y() < domain().ymax()); - CGAL_triangulation_precondition(!(v->point().z() < domain().zmin()) && v->point().z() < domain().zmax()); + CGAL_precondition(!(v->point().x() < domain().xmin()) && v->point().x() < domain().xmax()); + CGAL_precondition(!(v->point().y() < domain().ymin()) && v->point().y() < domain().ymax()); + CGAL_precondition(!(v->point().z() < domain().zmin()) && v->point().z() < domain().zmax()); } Weighted_point point(const Periodic_weighted_point& pp) const @@ -968,12 +968,12 @@ public: Vertex_handle nearest_power_vertex(const Bare_point& p, Cell_handle start) const { - CGAL_triangulation_precondition(p.x() < domain().xmax()); - CGAL_triangulation_precondition(p.y() < domain().ymax()); - CGAL_triangulation_precondition(p.z() < domain().zmax()); - CGAL_triangulation_precondition(p.x() >= domain().xmin()); - CGAL_triangulation_precondition(p.y() >= domain().ymin()); - CGAL_triangulation_precondition(p.z() >= domain().zmin()); + CGAL_precondition(p.x() < domain().xmax()); + CGAL_precondition(p.y() < domain().ymax()); + CGAL_precondition(p.z() < domain().zmax()); + CGAL_precondition(p.x() >= domain().xmin()); + CGAL_precondition(p.y() >= domain().ymin()); + CGAL_precondition(p.z() >= domain().zmin()); if(number_of_vertices() == 0) return Vertex_handle(); @@ -1067,7 +1067,7 @@ public: bool is_Gabriel(Cell_handle c, int i) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_power_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -1102,7 +1102,7 @@ public: bool is_Gabriel(Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_power_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -1186,12 +1186,12 @@ public: // offsets to find the minimum Offset get_min_dist_offset_general(const Bare_point& p, const Vertex_handle vh) const { - CGAL_triangulation_precondition(p.x() < domain().xmax()); - CGAL_triangulation_precondition(p.y() < domain().ymax()); - CGAL_triangulation_precondition(p.z() < domain().zmax()); - CGAL_triangulation_precondition(p.x() >= domain().xmin()); - CGAL_triangulation_precondition(p.y() >= domain().ymin()); - CGAL_triangulation_precondition(p.z() >= domain().zmin()); + CGAL_precondition(p.x() < domain().xmax()); + CGAL_precondition(p.y() < domain().ymax()); + CGAL_precondition(p.z() < domain().zmax()); + CGAL_precondition(p.x() >= domain().xmin()); + CGAL_precondition(p.y() >= domain().ymin()); + CGAL_precondition(p.z() >= domain().zmin()); Offset min_off = Offset(0,0,0); @@ -1215,7 +1215,7 @@ public: Vertex_handle nearest_vertex_in_cell(const Cell_handle& c, const Bare_point& p, const Offset & o) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); Vertex_handle nearest = c->vertex(0); for(int i=1; i<4; i++) { @@ -1384,7 +1384,7 @@ public: OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); std::vector facets; facets.reserve(64); @@ -1671,12 +1671,12 @@ public: // inline void hide(Weighted_point&, Cell_handle ) const // useless? // { -// CGAL_triangulation_assertion(false); +// CGAL_assertion(false); // } // // inline void do_hide(const Weighted_point&, Cell_handle ) const // useless? // { -// CGAL_triangulation_assertion(false); +// CGAL_assertion(false); // } // template < class Tester > @@ -1755,7 +1755,7 @@ operator>> (std::istream& is, Periodic_3_regular_triangulation_3& tr) tr.insert_cells_with_too_big_orthoball(tr.cells_begin(), tr.cells_end()); - CGAL_triangulation_expensive_assertion( tr.is_valid() ); + CGAL_expensive_assertion( tr.is_valid() ); return is; } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 60ead7714a3..7f3f5de89a4 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -262,12 +262,12 @@ public: typedef typename internal::Exact_field_selector::Type EFT; typedef NT_converter NTC; CGAL_USE_TYPE(NTC); - CGAL_triangulation_precondition_code( NTC ntc; ) - CGAL_triangulation_precondition(ntc(domain.xmax())-ntc(domain.xmin()) + CGAL_precondition_code( NTC ntc; ) + CGAL_precondition(ntc(domain.xmax())-ntc(domain.xmin()) == ntc(domain.ymax())-ntc(domain.ymin())); - CGAL_triangulation_precondition(ntc(domain.ymax())-ntc(domain.ymin()) + CGAL_precondition(ntc(domain.ymax())-ntc(domain.ymin()) == ntc(domain.zmax())-ntc(domain.zmin())); - CGAL_triangulation_precondition(ntc(domain.zmax())-ntc(domain.zmin()) + CGAL_precondition(ntc(domain.zmax())-ntc(domain.zmin()) == ntc(domain.xmax())-ntc(domain.xmin())); _gt.set_domain(domain); @@ -290,8 +290,8 @@ public: else copy_multiple_covering(tr); - CGAL_triangulation_expensive_postcondition(*this == tr); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(is_valid()); } virtual ~Periodic_3_triangulation_3() {} @@ -316,7 +316,7 @@ public: { vlist.push_back(vit); virtual_vertices_reverse.insert(std::make_pair(vit,std::vector(26))); - CGAL_triangulation_assertion(virtual_vertices_reverse.find(vit)->second.size() == 26); + CGAL_assertion(virtual_vertices_reverse.find(vit)->second.size() == 26); } } @@ -332,7 +332,7 @@ public: Offset off = vit2->offset(); virtual_vertices.insert(std::make_pair(vit2, std::make_pair(*vlist_it,off))); virtual_vertices_reverse.find(*vlist_it)->second[9*off[0]+3*off[1]+off[2]-1] = vit2; - CGAL_triangulation_assertion(get_offset(vit2) == off); + CGAL_assertion(get_offset(vit2) == off); } } @@ -412,9 +412,9 @@ public: } const std::vector& periodic_copies(const Vertex_handle v) const { - CGAL_triangulation_precondition(number_of_sheets() != CGAL::make_array(1,1,1)); - CGAL_triangulation_precondition(virtual_vertices.find(v) == virtual_vertices.end()); - CGAL_triangulation_assertion( + CGAL_precondition(number_of_sheets() != CGAL::make_array(1,1,1)); + CGAL_precondition(virtual_vertices.find(v) == virtual_vertices.end()); + CGAL_assertion( virtual_vertices_reverse.find(v) != virtual_vertices_reverse.end()); return virtual_vertices_reverse.find(v)->second; } @@ -480,9 +480,9 @@ public: // Offset converters int off_to_int(const Offset& off) const { - CGAL_triangulation_assertion( off.x() == 0 || off.x() == 1 ); - CGAL_triangulation_assertion( off.y() == 0 || off.y() == 1 ); - CGAL_triangulation_assertion( off.z() == 0 || off.z() == 1 ); + CGAL_assertion( off.x() == 0 || off.x() == 1 ); + CGAL_assertion( off.y() == 0 || off.y() == 1 ); + CGAL_assertion( off.z() == 0 || off.z() == 1 ); int i = ((off.x()&1)<<2) + ((off.y()&1)<<1) + ((off.z()&1)); return i; } @@ -529,24 +529,24 @@ public: } } - CGAL_triangulation_assertion((std::min)((std::min)(off0[0],off1[0]), + CGAL_assertion((std::min)((std::min)(off0[0],off1[0]), (std::min)(off2[0],off3[0])) == 0); - CGAL_triangulation_assertion((std::min)((std::min)(off0[1],off1[1]), + CGAL_assertion((std::min)((std::min)(off0[1],off1[1]), (std::min)(off2[1],off3[1])) == 0); - CGAL_triangulation_assertion((std::min)((std::min)(off0[2],off1[2]), + CGAL_assertion((std::min)((std::min)(off0[2],off1[2]), (std::min)(off2[2],off3[2])) == 0); - CGAL_triangulation_assertion((0 <= off0[0]) && (off0[0] < 2)); - CGAL_triangulation_assertion((0 <= off1[0]) && (off1[0] < 2)); - CGAL_triangulation_assertion((0 <= off2[0]) && (off2[0] < 2)); - CGAL_triangulation_assertion((0 <= off3[0]) && (off3[0] < 2)); - CGAL_triangulation_assertion((0 <= off0[1]) && (off0[1] < 2)); - CGAL_triangulation_assertion((0 <= off1[1]) && (off1[1] < 2)); - CGAL_triangulation_assertion((0 <= off2[1]) && (off2[1] < 2)); - CGAL_triangulation_assertion((0 <= off3[1]) && (off3[1] < 2)); - CGAL_triangulation_assertion((0 <= off0[2]) && (off0[2] < 2)); - CGAL_triangulation_assertion((0 <= off1[2]) && (off1[2] < 2)); - CGAL_triangulation_assertion((0 <= off2[2]) && (off2[2] < 2)); - CGAL_triangulation_assertion((0 <= off3[2]) && (off3[2] < 2)); + CGAL_assertion((0 <= off0[0]) && (off0[0] < 2)); + CGAL_assertion((0 <= off1[0]) && (off1[0] < 2)); + CGAL_assertion((0 <= off2[0]) && (off2[0] < 2)); + CGAL_assertion((0 <= off3[0]) && (off3[0] < 2)); + CGAL_assertion((0 <= off0[1]) && (off0[1] < 2)); + CGAL_assertion((0 <= off1[1]) && (off1[1] < 2)); + CGAL_assertion((0 <= off2[1]) && (off2[1] < 2)); + CGAL_assertion((0 <= off3[1]) && (off3[1] < 2)); + CGAL_assertion((0 <= off0[2]) && (off0[2] < 2)); + CGAL_assertion((0 <= off1[2]) && (off1[2] < 2)); + CGAL_assertion((0 <= off2[2]) && (off2[2] < 2)); + CGAL_assertion((0 <= off3[2]) && (off3[2] < 2)); int o0i = ((off0[0]&1)<<2)+((off0[1]&1)<<1)+(off0[2]&1); int o1i = ((off1[0]&1)<<2)+((off1[1]&1)<<1)+(off1[2]&1); @@ -822,9 +822,9 @@ public: } Periodic_segment periodic_segment(const Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition( i != j ); - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= 3 && j >= 0 && j <= 3 ); + CGAL_precondition( i != j ); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( i >= 0 && i <= 3 && j >= 0 && j <= 3 ); return CGAL::make_array(std::make_pair(c->vertex(i)->point(), get_offset(c,i)), std::make_pair(c->vertex(j)->point(), get_offset(c,j))); } @@ -880,8 +880,8 @@ public: } Periodic_triangle periodic_triangle(const Cell_handle c, int i) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( i >= 0 && i <= 3 ); if( (i&1)==0 ) return CGAL::make_array(std::make_pair(c->vertex((i+2)&3)->point(), get_offset(c,(i+2)&3)), std::make_pair(c->vertex((i+1)&3)->point(), get_offset(c,(i+1)&3)), @@ -952,7 +952,7 @@ public: Periodic_tetrahedron periodic_tetrahedron(const Cell_handle c) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); return CGAL::make_array(std::make_pair(c->vertex(0)->point(), get_offset(c,0)), std::make_pair(c->vertex(1)->point(), get_offset(c,1)), std::make_pair(c->vertex(2)->point(), get_offset(c,2)), @@ -1349,21 +1349,21 @@ protected: std::vector double_vertices; Locate_type lt = Locate_type(); int li=0, lj=0; - CGAL_triangulation_assertion_code( Locate_type lta = Locate_type(); ) - CGAL_triangulation_assertion_code( int ia = 0; ) - CGAL_triangulation_assertion_code( int ja = 0; ) + CGAL_assertion_code( Locate_type lta = Locate_type(); ) + CGAL_assertion_code( int ia = 0; ) + CGAL_assertion_code( int ja = 0; ) Cell_handle hint; while(begin!=end) { tester.set_point(*begin); Offset lo; hint = periodic_locate(*begin, Offset(), lo, lt, li, lj, start); - CGAL_triangulation_assertion_code( if(number_of_vertices() != 0) { ); - CGAL_triangulation_assertion(side_of_cell( + CGAL_assertion_code( if(number_of_vertices() != 0) { ); + CGAL_assertion(side_of_cell( *begin,Offset(), hint, lta, ia, ja) != ON_UNBOUNDED_SIDE); - CGAL_triangulation_assertion(lta == lt); - CGAL_triangulation_assertion(ia == li); - CGAL_triangulation_assertion(ja == lj); - CGAL_triangulation_assertion_code( } + CGAL_assertion(lta == lt); + CGAL_assertion(ia == li); + CGAL_assertion(ja == lj); + CGAL_assertion_code( } ); new_vertex = insert_in_conflict(*begin,lt,hint,li,lj,tester,hider, cover_manager); @@ -1416,7 +1416,7 @@ protected: typename Virtual_vertex_reverse_map::iterator origin_it = this->virtual_vertices_reverse.find(vh); std::vector& copies = origin_it->second; typename std::vector::iterator copy_iter = std::find(copies.begin(), copies.end(), vertex_handle); - CGAL_triangulation_assertion(copy_iter != copies.end()); + CGAL_assertion(copy_iter != copies.end()); copies.erase(copy_iter); if(copies.empty()) virtual_vertices_reverse.erase(origin_it); @@ -1424,8 +1424,8 @@ protected: return; } - CGAL_triangulation_assertion(this->virtual_vertices.find(vertex_handle) == this->virtual_vertices.end()); - CGAL_triangulation_assertion(this->virtual_vertices_reverse.find(vertex_handle) == this->virtual_vertices_reverse.end()); + CGAL_assertion(this->virtual_vertices.find(vertex_handle) == this->virtual_vertices.end()); + CGAL_assertion(this->virtual_vertices_reverse.find(vertex_handle) == this->virtual_vertices_reverse.end()); } public: @@ -1760,7 +1760,7 @@ protected: Periodic_point_3 periodic_circumcenter(Cell_handle c, ConstructCircumcenter construct_circumcenter) const { - CGAL_triangulation_precondition(c != Cell_handle()); + CGAL_precondition(c != Cell_handle()); Point_3 p = construct_circumcenter(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point(), c->vertex(3)->point(), @@ -1820,7 +1820,7 @@ protected: bool canonical_dual_segment(Cell_handle c, int i, Periodic_segment_3& ps, ConstructCircumcenter construct_circumcenter) const { - CGAL_triangulation_precondition(c != Cell_handle()); + CGAL_precondition(c != Cell_handle()); Offset off = neighbor_offset(c,i,c->neighbor(i)); Periodic_point_3 p1 = periodic_circumcenter(c, construct_circumcenter); Periodic_point_3 p2 = periodic_circumcenter(c->neighbor(i), construct_circumcenter); @@ -1879,7 +1879,7 @@ protected: template Stream& draw_dual(Stream& os, ConstructCircumcenter construct_circumcenter) const { - CGAL_triangulation_assertion_code( unsigned int i = 0; ) + CGAL_assertion_code( unsigned int i = 0; ) for(Facet_iterator fit = facets_begin(), end = facets_end(); fit != end; ++fit) { if(!is_canonical(*fit)) @@ -1888,11 +1888,11 @@ protected: Periodic_segment_3 pso; canonical_dual_segment(fit->first, fit->second, pso, construct_circumcenter); Segment so = construct_segment(pso); - CGAL_triangulation_assertion_code ( ++i; ) + CGAL_assertion_code ( ++i; ) os << so.source() << '\n'; os << so.target() << '\n'; } - CGAL_triangulation_assertion( i == number_of_facets() ); + CGAL_assertion( i == number_of_facets() ); return os; } @@ -1988,9 +1988,9 @@ protected: z = (z < d.zmin() ? z+d.zmax()-d.zmin() : (z >= d.zmax() ? z-d.zmax()+d.zmin() : z)); - CGAL_triangulation_postcondition((d.xmin()<=x)&&(xneighbor(0)->neighbor( + CGAL_postcondition(start!=Cell_handle()); + CGAL_assertion(start->neighbor(0)->neighbor( start->neighbor(0)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(1)->neighbor( + CGAL_assertion(start->neighbor(1)->neighbor( start->neighbor(1)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(2)->neighbor( + CGAL_assertion(start->neighbor(2)->neighbor( start->neighbor(2)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(3)->neighbor( + CGAL_assertion(start->neighbor(3)->neighbor( start->neighbor(3)->index(start))==start); // We implement the remembering visibility/stochastic walk. @@ -2181,7 +2181,7 @@ try_next_cell: continue; } - CGAL_triangulation_assertion(next->neighbor(next->index(c)) == c); + CGAL_assertion(next->neighbor(next->index(c)) == c); // We temporarily put p at i's place in pts. const Point* backup = pts[i]; @@ -2251,7 +2251,7 @@ try_next_cell: break; default: // the point cannot lie on four facets - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } lo = off_query; @@ -2272,7 +2272,7 @@ inexact_periodic_locate(const Point& p, const Offset& o_p, if(number_of_vertices() == 0) { return Cell_handle(); } - CGAL_triangulation_assertion(number_of_vertices() != 0); + CGAL_assertion(number_of_vertices() != 0); if(start == Cell_handle()) { start = cells_begin(); @@ -2289,14 +2289,14 @@ inexact_periodic_locate(const Point& p, const Offset& o_p, off_query += Offset(0,0,1); } - CGAL_triangulation_postcondition(start!=Cell_handle()); - CGAL_triangulation_assertion(start->neighbor(0)->neighbor( + CGAL_postcondition(start!=Cell_handle()); + CGAL_assertion(start->neighbor(0)->neighbor( start->neighbor(0)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(1)->neighbor( + CGAL_assertion(start->neighbor(1)->neighbor( start->neighbor(1)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(2)->neighbor( + CGAL_assertion(start->neighbor(2)->neighbor( start->neighbor(2)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(3)->neighbor( + CGAL_assertion(start->neighbor(3)->neighbor( start->neighbor(3)->index(start))==start); // We implement the remembering visibility/stochastic walk. @@ -2394,14 +2394,14 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( const Point& q, const Offset& off, Cell_handle c, Locate_type& lt, int& i, int& j) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); Orientation o0,o1,o2,o3; o0 = o1 = o2 = o3 = ZERO; int cumm_off = c->offset(0) | c->offset(1) | c->offset(2) | c->offset(3); if((cumm_off == 0) && (is_1_cover())) { - CGAL_triangulation_assertion(off == Offset()); + CGAL_assertion(off == Offset()); const Point& p0 = c->vertex(0)->point(); const Point& p1 = c->vertex(1)->point(); const Point& p2 = c->vertex(2)->point(); @@ -2421,7 +2421,7 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( p[i] = &(c->vertex(i)->point()); offs[i] = get_offset(c,i); } - CGAL_triangulation_assertion(orientation(*p[0], *p[1], *p[2], *p[3], + CGAL_assertion(orientation(*p[0], *p[1], *p[2], *p[3], offs[0], offs[1], offs[2], offs[3]) == POSITIVE); bool found=false; for(int i=0; (i<8)&&(!found); i++) { @@ -2491,7 +2491,7 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( default: { // impossible : cannot be on 4 facets for a real tetrahedron - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -2524,10 +2524,10 @@ Periodic_3_triangulation_3::periodic_insert( Point_hider& hider, CoverManager& cover_manager, Vertex_handle vh) { Vertex_handle v; - CGAL_triangulation_precondition(number_of_vertices() != 0); - CGAL_triangulation_assertion_code( + CGAL_precondition(number_of_vertices() != 0); + CGAL_assertion_code( Locate_type lt_assert; int i_assert; int j_assert;); - CGAL_triangulation_precondition(side_of_cell(tester.point(),o, c, + CGAL_precondition(side_of_cell(tester.point(),o, c, lt_assert, i_assert, j_assert) != ON_UNBOUNDED_SIDE); tester.set_offset(o); @@ -2536,7 +2536,7 @@ Periodic_3_triangulation_3::periodic_insert( bool found = false; Offset current_off = get_location_offset(tester, c, found); - CGAL_triangulation_assertion(side_of_cell(tester.point(), + CGAL_assertion(side_of_cell(tester.point(), combine_offsets(o,current_off),c,lt_assert,i_assert,j_assert) != ON_UNBOUNDED_SIDE); @@ -2595,7 +2595,7 @@ Periodic_3_triangulation_3::periodic_insert( v_offsets.clear(); if(vh != Vertex_handle()) { -// CGAL_triangulation_assertion(virtual_vertices.find(v) == virtual_vertices.end()); +// CGAL_assertion(virtual_vertices.find(v) == virtual_vertices.end()); virtual_vertices[v] = Virtual_vertex(vh,o); virtual_vertices_reverse[vh].push_back(v); } @@ -2641,8 +2641,8 @@ Periodic_3_triangulation_3::create_initial_triangulation(const Point& p) virtual_vertices_reverse[vir_vertices[0][0][0]].push_back( vir_vertices[i][j][k]); } - CGAL_triangulation_assertion(vir_vertices[i][j][k] != Vertex_handle()); - CGAL_triangulation_assertion(vir_vertices[0][0][0]->point() == p); + CGAL_assertion(vir_vertices[i][j][k] != Vertex_handle()); + CGAL_assertion(vir_vertices[0][0][0]->point() == p); } } } @@ -2655,7 +2655,7 @@ Periodic_3_triangulation_3::create_initial_triangulation(const Point& p) // 6 cells per 'cube' cells[i][j][k][l] = _tds.create_cell(); for(int n=0; n<4; n++) - CGAL_triangulation_assertion(cells[i][j][k][l] != Cell_handle()); + CGAL_assertion(cells[i][j][k][l] != Cell_handle()); } } } @@ -2781,8 +2781,8 @@ find_conflicts(Cell_handle d, const Offset& current_off, OutputIteratorCells, OutputIteratorInternalFacets> it) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( tester(d, current_off) ); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( tester(d, current_off) ); std::stack > cell_stack; cell_stack.push(std::make_pair(d,current_off)); @@ -2849,11 +2849,11 @@ inline typename Periodic_3_triangulation_3::Vertex_handle Periodic_3_triangulation_3::insert_in_conflict(const Point& p, Locate_type lt, Cell_handle c, int li, int lj, const Conflict_tester& tester, Point_hider& hider, CoverManager& cover_manager) { - CGAL_triangulation_assertion((domain().xmin() <= p.x()) + CGAL_assertion((domain().xmin() <= p.x()) && (p.x() < domain().xmax())); - CGAL_triangulation_assertion((domain().ymin() <= p.y()) + CGAL_assertion((domain().ymin() <= p.y()) && (p.y() < domain().ymax())); - CGAL_triangulation_assertion((domain().zmin() <= p.z()) + CGAL_assertion((domain().zmin() <= p.z()) && (p.z() < domain().zmax())); if(number_of_vertices() == 0) { @@ -2874,14 +2874,14 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point& p, vstart = c->vertex(0); else vstart = vvmit->second.first; - CGAL_triangulation_assertion(virtual_vertices.find(vstart) + CGAL_assertion(virtual_vertices.find(vstart) == virtual_vertices.end()); - CGAL_triangulation_assertion(virtual_vertices_reverse.find(vstart) + CGAL_assertion(virtual_vertices_reverse.find(vstart) != virtual_vertices_reverse.end()); } - CGAL_triangulation_assertion( number_of_vertices() != 0 ); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_assertion( number_of_vertices() != 0 ); + CGAL_expensive_assertion(is_valid()); hider.set_original_cube(true); Vertex_handle vh = periodic_insert(p, Offset(), lt, c, tester, hider, cover_manager); if(is_1_cover()) { @@ -2903,14 +2903,14 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point& p, } } } - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); // Fall back to 1-cover if the criterion that the longest edge is shorter // than sqrt(0.166) is fulfilled. if( cover_manager.can_be_converted_to_1_sheet() ) { - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); convert_to_1_sheeted_covering(); - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); } return vh; } @@ -2918,17 +2918,17 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point& p, /// tests if two vertices of one cell are just periodic copies of each other template < class GT, class TDS > inline bool Periodic_3_triangulation_3::has_self_edges(Cell_handle c) const { - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(1)) || + CGAL_assertion((c->vertex(0) != c->vertex(1)) || (c->offset(0) != c->offset(1))); - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(2)) || + CGAL_assertion((c->vertex(0) != c->vertex(2)) || (c->offset(0) != c->offset(2))); - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(3)) || + CGAL_assertion((c->vertex(0) != c->vertex(3)) || (c->offset(0) != c->offset(3))); - CGAL_triangulation_assertion((c->vertex(1) != c->vertex(2)) || + CGAL_assertion((c->vertex(1) != c->vertex(2)) || (c->offset(1) != c->offset(2))); - CGAL_triangulation_assertion((c->vertex(1) != c->vertex(3)) || + CGAL_assertion((c->vertex(1) != c->vertex(3)) || (c->offset(1) != c->offset(3))); - CGAL_triangulation_assertion((c->vertex(2) != c->vertex(3)) || + CGAL_assertion((c->vertex(2) != c->vertex(3)) || (c->offset(2) != c->offset(3))); return ((c->vertex(0) == c->vertex(1)) || (c->vertex(0) == c->vertex(2)) || @@ -2964,8 +2964,8 @@ is_valid(bool verbose, int level) const iter_2 != end_iter_2; ++iter_2) { - CGAL_triangulation_assertion(virtual_vertices.find(*iter_2) != virtual_vertices.end()); - CGAL_triangulation_assertion(virtual_vertices.at(*iter_2).first == iter->first); + CGAL_assertion(virtual_vertices.find(*iter_2) != virtual_vertices.end()); + CGAL_assertion(virtual_vertices.at(*iter_2).first == iter->first); } } } @@ -2974,10 +2974,10 @@ is_valid(bool verbose, int level) const for(Cell_iterator cit = cells_begin(); cit != cells_end(); ++cit) { for(int i=0; i<4; i++) { - CGAL_triangulation_assertion(cit != cit->neighbor(i)); + CGAL_assertion(cit != cit->neighbor(i)); for(int j=i+1; j<4; j++) { - CGAL_triangulation_assertion(cit->neighbor(i) != cit->neighbor(j)); - CGAL_triangulation_assertion(cit->vertex(i) != cit->vertex(j)); + CGAL_assertion(cit->neighbor(i) != cit->neighbor(j)); + CGAL_assertion(cit->vertex(i) != cit->vertex(j)); } } // Check positive orientation: @@ -3107,15 +3107,15 @@ remove(Vertex_handle v, PointRemover& r, Conflict_tester& t, CoverManager& cover } Virtual_vertex_map_it vvmit = virtual_vertices.find(v); if(vvmit != virtual_vertices.end()) v = vvmit->second.first; - CGAL_triangulation_assertion(virtual_vertices_reverse.find(v) + CGAL_assertion(virtual_vertices_reverse.find(v) != virtual_vertices_reverse.end()); vhrem = virtual_vertices_reverse.find(v)->second; virtual_vertices_reverse.erase(v); - CGAL_triangulation_assertion(vhrem.size()==26); + CGAL_assertion(vhrem.size()==26); for(int i=0; i<26; i++) { periodic_remove(vhrem[i],r, cover_manager); virtual_vertices.erase(vhrem[i]); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); } periodic_remove(v,r, cover_manager); } @@ -3169,7 +3169,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana make_hole(v, outer_map, hole); - CGAL_triangulation_assertion(outer_map.size()==hole.size()); + CGAL_assertion(outer_map.size()==hole.size()); if(!is_1_cover()) { cover_manager.delete_unsatisfying_elements(hole.begin(), hole.end()); @@ -3211,16 +3211,16 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana for(unsigned int i=0; i < vertices.size(); i++) { typedef typename Point_remover::Triangulation_R3::Point TRPoint; - CGAL_triangulation_assertion( + CGAL_assertion( get_offset(vertices[i]) + combine_offsets(Offset(), vh_off_map[vertices[i]]) == combine_offsets(get_offset(vertices[i]),vh_off_map[vertices[i]])); TRPoint trp = std::make_pair(vertices[i]->point(), combine_offsets( get_offset(vertices[i]), vh_off_map[vertices[i]]) ); VertexE_handle vh = remover.tmp.insert(trp, ch); vmap[vh] = vertices[i]; - CGAL_triangulation_assertion(vmap.is_defined(vh)); + CGAL_assertion(vmap.is_defined(vh)); } - CGAL_triangulation_assertion(remover.tmp.number_of_vertices() != 0); + CGAL_assertion(remover.tmp.number_of_vertices() != 0); // Construct the set of vertex triples of tmp // We reorient the vertex triple so that it matches those from outer_map @@ -3263,7 +3263,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana typename Vertex_triple_FacetE_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_FacetE_map::value_type i_vt_f_pair = *iit; CellE_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -3282,7 +3282,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana if(cover_manager.update_cover_data_during_management(new_ch, new_cells, abort_if_cover_change)) { - CGAL_triangulation_expensive_postcondition(_tds.is_valid()); + CGAL_expensive_postcondition(_tds.is_valid()); return false; // removing would cause / has caused a cover change } @@ -3331,7 +3331,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana _tds.delete_vertex(v); _tds.delete_cells(hole.begin(), hole.end()); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); return true; // sucessfully removed the vertex } @@ -3444,17 +3444,17 @@ Periodic_3_triangulation_3::convert_to_1_sheeted_covering() // The vector from nb to the "original" periodic copy of nb, that is // the copy that will not be deleted. Offset difference_offset(x,y,z); - CGAL_triangulation_assertion( !difference_offset.is_null() ); + CGAL_assertion( !difference_offset.is_null() ); // We now have to find the "original" periodic copy of nb from // its vertices. Therefore, we first have to find the vertices. for( int j = 0; j < 4; j++ ) { - CGAL_triangulation_assertion( (off[j]-difference_offset)[0] >= 0); - CGAL_triangulation_assertion( (off[j]-difference_offset)[1] >= 0); - CGAL_triangulation_assertion( (off[j]-difference_offset)[2] >= 0); - CGAL_triangulation_assertion( (off[j]-difference_offset)[0] < 3); - CGAL_triangulation_assertion( (off[j]-difference_offset)[1] < 3); - CGAL_triangulation_assertion( (off[j]-difference_offset)[2] < 3); + CGAL_assertion( (off[j]-difference_offset)[0] >= 0); + CGAL_assertion( (off[j]-difference_offset)[1] >= 0); + CGAL_assertion( (off[j]-difference_offset)[2] >= 0); + CGAL_assertion( (off[j]-difference_offset)[0] < 3); + CGAL_assertion( (off[j]-difference_offset)[1] < 3); + CGAL_assertion( (off[j]-difference_offset)[2] < 3); // find the Vertex_handles of the vertices of the "original" // periodic copy of nb. If the vertex is inside the original @@ -3506,22 +3506,22 @@ Periodic_3_triangulation_3::convert_to_1_sheeted_covering() off[i] = Offset(); get_vertex( it, i, vert[i], off[i]); it->set_vertex( i, vert[i]); - CGAL_triangulation_assertion(vert[i]->point()[0] < domain().xmax()); - CGAL_triangulation_assertion(vert[i]->point()[1] < domain().ymax()); - CGAL_triangulation_assertion(vert[i]->point()[2] < domain().zmax()); - CGAL_triangulation_assertion(vert[i]->point()[0] >= domain().xmin()); - CGAL_triangulation_assertion(vert[i]->point()[1] >= domain().ymin()); - CGAL_triangulation_assertion(vert[i]->point()[2] >= domain().zmin()); + CGAL_assertion(vert[i]->point()[0] < domain().xmax()); + CGAL_assertion(vert[i]->point()[1] < domain().ymax()); + CGAL_assertion(vert[i]->point()[2] < domain().zmax()); + CGAL_assertion(vert[i]->point()[0] >= domain().xmin()); + CGAL_assertion(vert[i]->point()[1] >= domain().ymin()); + CGAL_assertion(vert[i]->point()[2] >= domain().zmin()); // redirect also the cell pointer of the vertex. it->vertex(i)->set_cell(it); } // Set the offsets. set_offsets(it, off[0], off[1], off[2], off[3] ); - CGAL_triangulation_assertion( int_to_off(it->offset(0)) == off[0] ); - CGAL_triangulation_assertion( int_to_off(it->offset(1)) == off[1] ); - CGAL_triangulation_assertion( int_to_off(it->offset(2)) == off[2] ); - CGAL_triangulation_assertion( int_to_off(it->offset(3)) == off[3] ); + CGAL_assertion( int_to_off(it->offset(0)) == off[0] ); + CGAL_assertion( int_to_off(it->offset(1)) == off[1] ); + CGAL_assertion( int_to_off(it->offset(2)) == off[2] ); + CGAL_assertion( int_to_off(it->offset(3)) == off[3] ); } } @@ -3553,7 +3553,7 @@ Periodic_3_triangulation_3::convert_to_1_sheeted_covering() for( Vertex_iterator vit = all_vertices_begin(); vit != all_vertices_end(); ++vit ) { if( virtual_vertices.count( vit ) != 0 ) { - CGAL_triangulation_assertion( virtual_vertices.count( vit ) == 1 ); + CGAL_assertion( virtual_vertices.count( vit ) == 1 ); vertices_to_delete.push_back( vit ); } } @@ -3572,7 +3572,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() if(_cover == CGAL::make_array(3,3,3)) return; - CGAL_triangulation_precondition(is_1_cover()); + CGAL_precondition(is_1_cover()); // Create 27 copies of each vertex and write virtual_vertices and // virtual_vertices_reverse @@ -3640,7 +3640,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() Offset vvoff[4]; for(int i=0; i<4; i++) { vvrmit[i] = virtual_vertices_reverse.find((*cit)->vertex(i)); - CGAL_triangulation_assertion( + CGAL_assertion( vvrmit[i] != virtual_vertices_reverse.end()); vvoff[i] = int_to_off((*cit)->offset(i)); } @@ -3653,7 +3653,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() int o_j = ((n+1)/3+vvoff[i].y()+3)%3; int o_k = ((n+1)+vvoff[i].z()+3)%3; int n_c = 9*o_i+3*o_j+o_k-1; - CGAL_triangulation_assertion(n_c >= -1); + CGAL_assertion(n_c >= -1); if(n_c == -1) vvh[i] = (*cit)->vertex(i); else vvh[i] = vvrmit[i]->second[n_c]; } @@ -3669,12 +3669,12 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() for(int i=0; i<4; i++) { Virtual_vertex_reverse_map_it vvrmit = virtual_vertices_reverse.find((*cit)->vertex(i)); - CGAL_triangulation_assertion(vvrmit != virtual_vertices_reverse.end()); + CGAL_assertion(vvrmit != virtual_vertices_reverse.end()); Offset vvoff = int_to_off((*cit)->offset(i)); if(!vvoff.is_null()) { int n_c = 9*vvoff.x()+3*vvoff.y()+vvoff.z()-1; - CGAL_triangulation_assertion(n_c >= 0); - CGAL_triangulation_assertion(static_cast(n_c) + CGAL_assertion(n_c >= 0); + CGAL_assertion(static_cast(n_c) < vvrmit->second.size()); (*cit)->set_vertex(i,vvrmit->second[n_c]); } @@ -3685,13 +3685,13 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() typename std::list >::iterator oit = off_nb.begin(); for(typename std::list::iterator cit = original_cells.begin(); cit != original_cells.end(); ++cit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); VCRMIT c_cp = virtual_cells_reverse.find(*cit); - CGAL_triangulation_assertion(c_cp != virtual_cells_reverse.end()); + CGAL_assertion(c_cp != virtual_cells_reverse.end()); for(int i=0; i<4; i++) { Cell_handle cit_nb = (*cit)->neighbor(i); VCRMIT c_cp_nb = virtual_cells_reverse.find(cit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_cells_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_cells_reverse.end()); Offset nboff = (*oit)[i]; for(int n=0; n<26; n++) { int n_nb; @@ -3703,23 +3703,23 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() n_nb = 9*o_i+3*o_j+o_k-1; } if(n_nb == -1) { - CGAL_triangulation_assertion(cit_nb->has_vertex( + CGAL_assertion(cit_nb->has_vertex( c_cp->second[n]->vertex((i+1)%4)) ); - CGAL_triangulation_assertion(cit_nb->has_vertex( + CGAL_assertion(cit_nb->has_vertex( c_cp->second[n]->vertex((i+2)%4)) ); - CGAL_triangulation_assertion(cit_nb->has_vertex( + CGAL_assertion(cit_nb->has_vertex( c_cp->second[n]->vertex((i+3)%4)) ); c_cp->second[n]->set_neighbor(i,cit_nb); } else { - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex(c_cp->second[n]->vertex((i+1)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex(c_cp->second[n]->vertex((i+2)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex(c_cp->second[n]->vertex((i+3)%4)) ); c_cp->second[n]->set_neighbor(i,c_cp_nb->second[n_nb]); } @@ -3731,25 +3731,25 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() oit = off_nb.begin(); for(typename std::list::iterator cit = original_cells.begin(); cit != original_cells.end(); ++cit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); for(int i=0; i<4; i++) { Offset nboff = (*oit)[i]; if(!nboff.is_null()) { Cell_handle cit_nb = (*cit)->neighbor(i); VCRMIT c_cp_nb = virtual_cells_reverse.find(cit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_cells_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_cells_reverse.end()); int o_i = (3-nboff.x())%3; int o_j = (3-nboff.y())%3; int o_k = (3-nboff.z())%3; int n_nb = 9*o_i+3*o_j+o_k-1; - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex((*cit)->vertex((i+1)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex((*cit)->vertex((i+2)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex((*cit)->vertex((i+3)%4)) ); (*cit)->set_neighbor(i,c_cp_nb->second[n_nb]); } @@ -3767,7 +3767,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() for(typename std::list::iterator cit = original_cells.begin(); cit != original_cells.end(); ++cit) { VCRMIT c_cp = virtual_cells_reverse.find(*cit); - CGAL_triangulation_assertion( c_cp != virtual_cells_reverse.end()); + CGAL_assertion( c_cp != virtual_cells_reverse.end()); Offset off[4]; for(int i=0; i<4; i++) off[i] = int_to_off((*cit)->offset(i)); @@ -3788,9 +3788,9 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() off_cp[i] = Offset((o_i==2)?off[i].x():0, (o_j==2)?off[i].y():0, (o_k==2)?off[i].z():0); - CGAL_triangulation_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); - CGAL_triangulation_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); - CGAL_triangulation_assertion(off_cp[i].z() == 0 || off_cp[i].z() == 1); + CGAL_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); + CGAL_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); + CGAL_assertion(off_cp[i].z() == 0 || off_cp[i].z() == 1); } set_offsets(c_cp->second[n],off_cp[0],off_cp[1],off_cp[2],off_cp[3]); } @@ -3801,14 +3801,14 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() cit != original_cells.end(); ++cit) { //This statement does not seem to have any effect set_offsets(*cit, 0,0,0,0); - CGAL_triangulation_assertion((*cit)->offset(0) == 0); - CGAL_triangulation_assertion((*cit)->offset(1) == 0); - CGAL_triangulation_assertion((*cit)->offset(2) == 0); - CGAL_triangulation_assertion((*cit)->offset(3) == 0); + CGAL_assertion((*cit)->offset(0) == 0); + CGAL_assertion((*cit)->offset(1) == 0); + CGAL_assertion((*cit)->offset(2) == 0); + CGAL_assertion((*cit)->offset(3) == 0); } _cover = CGAL::make_array(3,3,3); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); update_cover_data_after_converting_to_27_sheeted_covering(); } @@ -3840,7 +3840,7 @@ Periodic_3_triangulation_3::get_cell(const Vertex_handle* vh) const incident_cells(vh[3],std::back_inserter(cells)); for( typename std::vector::iterator it = cells.begin(); it != cells.end(); it++ ) { - CGAL_triangulation_assertion( + CGAL_assertion( (*it)->vertex(0) == vh[3] || (*it)->vertex(1) == vh[3] ||(*it)->vertex(2) == vh[3] || (*it)->vertex(3) == vh[3]); for( int j=0; j<3; j++ ) { @@ -3854,7 +3854,7 @@ Periodic_3_triangulation_3::get_cell(const Vertex_handle* vh) const return (*it); } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Cell_handle(); } @@ -3869,12 +3869,12 @@ inline typename Periodic_3_triangulation_3::Offset Periodic_3_triangulation_3::get_location_offset( const Conflict_tester& tester, Cell_handle c) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); int cumm_off = c->offset(0) | c->offset(1) | c->offset(2) | c->offset(3); if(cumm_off == 0) { // default case: - CGAL_triangulation_assertion(tester(c, Offset())); + CGAL_assertion(tester(c, Offset())); return Offset(); } else { // Main idea seems to just test all possibilities. @@ -3886,7 +3886,7 @@ Periodic_3_triangulation_3::get_location_offset( } } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Offset(); } @@ -3896,7 +3896,7 @@ inline typename Periodic_3_triangulation_3::Offset Periodic_3_triangulation_3::get_location_offset( const Conflict_tester& tester, Cell_handle c, bool& found) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); found = false; @@ -3932,8 +3932,8 @@ Periodic_3_triangulation_3::neighbor_offset( Cell_handle ch, int i, Cell_handle nb) const { // Redundance in the signature! - CGAL_triangulation_precondition(ch->neighbor(i) == nb); - CGAL_triangulation_precondition(nb->neighbor(nb->index(ch)) == ch); + CGAL_precondition(ch->neighbor(i) == nb); + CGAL_precondition(nb->neighbor(nb->index(ch)) == ch); Vertex_handle vertex_ch; int index_ch, index_nb; @@ -3978,17 +3978,17 @@ inline void Periodic_3_triangulation_3::get_vertex( // if 'vh_i' is not contained in virtual_vertices, then it is in // the original domain. vh = vh_i; - CGAL_triangulation_assertion(vh != Vertex_handle()); + CGAL_assertion(vh != Vertex_handle()); } else { // otherwise it has to be looked up as well as its offset. vh = it->second.first; off += it->second.second; - CGAL_triangulation_assertion(vh->point().x() < domain().xmax()); - CGAL_triangulation_assertion(vh->point().y() < domain().ymax()); - CGAL_triangulation_assertion(vh->point().z() < domain().zmax()); - CGAL_triangulation_assertion(vh->point().x() >= domain().xmin()); - CGAL_triangulation_assertion(vh->point().y() >= domain().ymin()); - CGAL_triangulation_assertion(vh->point().z() >= domain().zmin()); + CGAL_assertion(vh->point().x() < domain().xmax()); + CGAL_assertion(vh->point().y() < domain().ymax()); + CGAL_assertion(vh->point().z() < domain().zmax()); + CGAL_assertion(vh->point().x() >= domain().xmin()); + CGAL_assertion(vh->point().y() >= domain().ymin()); + CGAL_assertion(vh->point().z() >= domain().zmin()); } } @@ -4007,7 +4007,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) // of vertices, plus the non combinatorial information on each cell // the neighbors of each cell by their index in the preceding list of cells { - CGAL_triangulation_precondition(is.good()); + CGAL_precondition(is.good()); typedef Periodic_3_triangulation_3 Triangulation; typedef typename Triangulation::size_type size_type; @@ -4035,7 +4035,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) read(is,n); } - CGAL_triangulation_assertion((n/(cx*cy*cz))*cx*cy*cz == n); + CGAL_assertion((n/(cx*cy*cz))*cx*cy*cz == n); tr.tds().set_dimension((n==0?-2:3)); tr._gt.set_domain(domain); @@ -4093,7 +4093,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) for(std::size_t j=0; j < m; j++) is >> *(C[j]); - CGAL_triangulation_expensive_assertion( tr.is_valid() ); + CGAL_expensive_assertion( tr.is_valid() ); return is; } @@ -4167,13 +4167,13 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) os << it->point() << std::endl << Offset(0,0,0) << std::endl; else os << it->point() << Offset(0,0,0); - CGAL_triangulation_assertion(tr.virtual_vertices_reverse.find(it) + CGAL_assertion(tr.virtual_vertices_reverse.find(it) != tr.virtual_vertices_reverse.end()); vv = tr.virtual_vertices_reverse.find(it)->second; - CGAL_triangulation_assertion(vv.size() == 26); + CGAL_assertion(vv.size() == 26); for(std::size_t j=0; jpoint() << std::endl @@ -4182,7 +4182,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) } } } - CGAL_triangulation_postcondition(i == tr.number_of_sheets()[0] * + CGAL_postcondition(i == tr.number_of_sheets()[0] * tr.number_of_sheets()[1] * tr.number_of_sheets()[2] * n); @@ -4255,12 +4255,12 @@ test_next(const Periodic_3_triangulation_3& t1, queue.pop_back(); // Precondition: c1, c2 have been registered as well as their 4 vertices. - CGAL_triangulation_precondition(t1.number_of_vertices() != 0); - CGAL_triangulation_precondition(Cmap[c1] == c2); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(3)) != Vmap.end()); + CGAL_precondition(t1.number_of_vertices() != 0); + CGAL_precondition(Cmap[c1] == c2); + CGAL_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(3)) != Vmap.end()); for(int i=0; i <= 3; ++i) { Cell_handle1 n1 = c1->neighbor(i); diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h index fa256044b3f..128cb4038d0 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h @@ -16,7 +16,6 @@ #include #include -#include #include namespace CGAL { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h index af4192ea47f..947b8b553e5 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -86,7 +86,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -122,7 +122,7 @@ public: bool operator==(const Periodic_tetrahedron_iterator& ti) const { - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -196,7 +196,7 @@ private: // copies into account. void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; do { ++pos; } while (_it == T::UNIQUE_COVER_DOMAIN @@ -264,25 +264,25 @@ private: if (_it == T::UNIQUE_COVER_DOMAIN) get_edge_offsets(off0,off1,off2,off3); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->offset(0)); off1 = _t->int_to_off(pos->offset(1)); off2 = _t->int_to_off(pos->offset(2)); off3 = _t->int_to_off(pos->offset(3)); } - CGAL_triangulation_assertion(off0.x() == 0 || off0.x() == 1); - CGAL_triangulation_assertion(off0.y() == 0 || off0.y() == 1); - CGAL_triangulation_assertion(off0.z() == 0 || off0.z() == 1); - CGAL_triangulation_assertion(off1.x() == 0 || off1.x() == 1); - CGAL_triangulation_assertion(off1.y() == 0 || off1.y() == 1); - CGAL_triangulation_assertion(off1.z() == 0 || off1.z() == 1); - CGAL_triangulation_assertion(off2.x() == 0 || off2.x() == 1); - CGAL_triangulation_assertion(off2.y() == 0 || off2.y() == 1); - CGAL_triangulation_assertion(off2.z() == 0 || off2.z() == 1); - CGAL_triangulation_assertion(off3.x() == 0 || off3.x() == 1); - CGAL_triangulation_assertion(off3.y() == 0 || off3.y() == 1); - CGAL_triangulation_assertion(off3.z() == 0 || off3.z() == 1); + CGAL_assertion(off0.x() == 0 || off0.x() == 1); + CGAL_assertion(off0.y() == 0 || off0.y() == 1); + CGAL_assertion(off0.z() == 0 || off0.z() == 1); + CGAL_assertion(off1.x() == 0 || off1.x() == 1); + CGAL_assertion(off1.y() == 0 || off1.y() == 1); + CGAL_assertion(off1.z() == 0 || off1.z() == 1); + CGAL_assertion(off2.x() == 0 || off2.x() == 1); + CGAL_assertion(off2.y() == 0 || off2.y() == 1); + CGAL_assertion(off2.z() == 0 || off2.z() == 1); + CGAL_assertion(off3.x() == 0 || off3.x() == 1); + CGAL_assertion(off3.y() == 0 || off3.y() == 1); + CGAL_assertion(off3.z() == 0 || off3.z() == 1); int offx = ( ((off0.x() == 0 && off1.x() == 0 && off2.x() == 0 && off3.x() == 0) @@ -301,7 +301,7 @@ private: } Periodic_tetrahedron construct_periodic_tetrahedron() const { - CGAL_triangulation_assertion(pos != typename T::Cell_handle()); + CGAL_assertion(pos != typename T::Cell_handle()); Offset off0, off1, off2, off3; get_edge_offsets(off0, off1, off2, off3); Offset transl_off = Offset((((_off>>2)&1)==1 ? -1:0), @@ -392,7 +392,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -428,7 +428,7 @@ public: bool operator==(const Periodic_triangle_iterator& ti) const { - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -499,7 +499,7 @@ private: // copies into account. void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; do { ++pos; } while (_it == T::UNIQUE_COVER_DOMAIN @@ -567,21 +567,21 @@ private: if (_it == T::UNIQUE_COVER_DOMAIN) get_edge_offsets(off0,off1,off2); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->first->offset((pos->second+1)&3)); off1 = _t->int_to_off(pos->first->offset((pos->second+2)&3)); off2 = _t->int_to_off(pos->first->offset((pos->second+3)&3)); } - CGAL_triangulation_assertion(off0.x() == 0 || off0.x() == 1); - CGAL_triangulation_assertion(off0.y() == 0 || off0.y() == 1); - CGAL_triangulation_assertion(off0.z() == 0 || off0.z() == 1); - CGAL_triangulation_assertion(off1.x() == 0 || off1.x() == 1); - CGAL_triangulation_assertion(off1.y() == 0 || off1.y() == 1); - CGAL_triangulation_assertion(off1.z() == 0 || off1.z() == 1); - CGAL_triangulation_assertion(off2.x() == 0 || off2.x() == 1); - CGAL_triangulation_assertion(off2.y() == 0 || off2.y() == 1); - CGAL_triangulation_assertion(off2.z() == 0 || off2.z() == 1); + CGAL_assertion(off0.x() == 0 || off0.x() == 1); + CGAL_assertion(off0.y() == 0 || off0.y() == 1); + CGAL_assertion(off0.z() == 0 || off0.z() == 1); + CGAL_assertion(off1.x() == 0 || off1.x() == 1); + CGAL_assertion(off1.y() == 0 || off1.y() == 1); + CGAL_assertion(off1.z() == 0 || off1.z() == 1); + CGAL_assertion(off2.x() == 0 || off2.x() == 1); + CGAL_assertion(off2.y() == 0 || off2.y() == 1); + CGAL_assertion(off2.z() == 0 || off2.z() == 1); int offx = ( ((off0.x() == 0 && off1.x() == 0 && off2.x() == 0) || (off0.x() == 1 && off1.x() == 1 && off2.x() == 1)) ? 0 : 1); @@ -594,7 +594,7 @@ private: } Periodic_triangle construct_periodic_triangle() const { - CGAL_triangulation_assertion(pos->first != typename T::Cell_handle()); + CGAL_assertion(pos->first != typename T::Cell_handle()); Offset off0, off1, off2; get_edge_offsets(off0, off1, off2); Offset transl_off = Offset((((_off>>2)&1)==1 ? -1:0), @@ -682,7 +682,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -718,7 +718,7 @@ public: bool operator==(const Periodic_segment_iterator& ti) const { - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -785,7 +785,7 @@ private: // copies into account. void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; do { ++pos; } while (_it == T::UNIQUE_COVER_DOMAIN @@ -841,15 +841,15 @@ private: if (_it == T::UNIQUE_COVER_DOMAIN) get_edge_offsets(off0,off1); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->first->offset(pos->second)); off1 = _t->int_to_off(pos->first->offset(pos->third)); } Offset diff_off = off0 - off1; - CGAL_triangulation_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); - CGAL_triangulation_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); - CGAL_triangulation_assertion(diff_off.z() >= -1 || diff_off.z() <= 1); + CGAL_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); + CGAL_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); + CGAL_assertion(diff_off.z() >= -1 || diff_off.z() <= 1); return( 4*(diff_off.x() == 0 ? 0:1) + 2*(diff_off.y() == 0 ? 0:1) @@ -857,7 +857,7 @@ private: } Periodic_segment construct_periodic_segment() const { - CGAL_triangulation_assertion(pos->first != typename T::Cell_handle()); + CGAL_assertion(pos->first != typename T::Cell_handle()); Offset off0, off1; get_edge_offsets(off0, off1); Offset transl_off = Offset((((_off>>2)&1)==1 ? -1:0), @@ -939,7 +939,7 @@ public: do { ++pos; } while (pos != _t->vertices_end() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -955,7 +955,7 @@ public: do { --pos; } while (pos != _t->vertices_begin() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -976,7 +976,7 @@ public: bool operator==(const Periodic_point_iterator& pi) const { - CGAL_triangulation_assertion(_it == pi._it); + CGAL_assertion(_it == pi._it); return _t == pi._t && pos == pi.pos; } @@ -1017,7 +1017,7 @@ private: } Periodic_point construct_periodic_point() const { - CGAL_triangulation_assertion(pos != typename T::Vertex_handle()); + CGAL_assertion(pos != typename T::Vertex_handle()); Offset off = _t->get_offset(pos); return std::make_pair(pos->point(),off); } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h index c1b7a5300e6..d057339a4f0 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -87,13 +87,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } const Cell_handle& neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -116,13 +116,13 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } int offset(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); return ((off>>3*i)&7); } @@ -130,13 +130,13 @@ public: void set_vertex(int i, const Vertex_handle& v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); V[i] = v; } void set_neighbor(int i, const Cell_handle& n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); N[i] = n; } @@ -170,7 +170,7 @@ public: void set_offset(const Vertex_handle vh, int o) { - CGAL_triangulation_precondition(has_vertex(vh)); + CGAL_precondition(has_vertex(vh)); int vhi = index(vh); unsigned int offo[3] = {static_cast((o&1)), @@ -242,7 +242,7 @@ public: // TODO: Get rid of this flag! Used in convert_to_1_sheeted_covering. // Either use the conflict flag or a std::map. void set_additional_flag(unsigned char f) { - CGAL_triangulation_assertion(f < 4); + CGAL_assertion(f < 4); _additional_flag = f; } unsigned char get_additional_flag() const { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h index 5a46a8839b3..b3e6b28a413 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h @@ -396,7 +396,7 @@ void Periodic_3_triangulation_hierarchy_3:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); CGAL_expensive_precondition(is_vertex(v)); for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); @@ -412,12 +412,12 @@ typename Periodic_3_triangulation_hierarchy_3::Vertex_handle Periodic_3_triangulation_hierarchy_3:: move_point(Vertex_handle v, const Point & p) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); Vertex_handle old, ret; for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); - CGAL_triangulation_assertion(hierarchy[l]->is_valid()); + CGAL_assertion(hierarchy[l]->is_valid()); Vertex_handle w = hierarchy[l]->move_point(v, p); if (l == 0) { ret = w; diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h index 3dd20ea6fae..f9c96b8eb5c 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h @@ -22,7 +22,6 @@ #include #include -#include namespace CGAL { diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h index f08eb4316ae..58c13e394d2 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h @@ -271,7 +271,7 @@ public: Point get_dummy_point(int i) const { - CGAL_triangulation_precondition(0 <= i && i <= static_cast(dummy_points.size())); + CGAL_precondition(0 <= i && i <= static_cast(dummy_points.size())); return dummy_points[i](); } @@ -543,7 +543,7 @@ remove(Vertex_handle v) int nidx = 0; if(nbf->neighbor(1) == nb) nidx = 1; if(nbf->neighbor(2) == nb) nidx = 2; - CGAL_triangulation_assertion(nbf->neighbor(nidx) == nb); + CGAL_assertion(nbf->neighbor(nidx) == nb); bdry_nbrs.insert(Edge_neighbor(e, Neighbor_pair(nbf, nidx))); bdry_verts.push_back(nb->vertex(ccw(idx))); @@ -616,8 +616,8 @@ remove(Vertex_handle v) Nbr_entry side1(nbf, nbidx); Nbr_entry side2(nbf->neighbor(nbidx), nbf->neighbor(nbidx)->index(nbf)); - CGAL_triangulation_assertion(side1.first->neighbor(side1.second) == side2.first); - CGAL_triangulation_assertion(side2.first->neighbor(side2.second) == side1.first); + CGAL_assertion(side1.first->neighbor(side1.second) == side2.first); + CGAL_assertion(side2.first->neighbor(side2.second) == side1.first); Nbr_pair hist(side1, side2); failsafe.push_back(hist); @@ -680,7 +680,7 @@ remove(Vertex_handle v) tds().delete_face(new_f[rit]); } - CGAL_triangulation_assertion(this->is_valid(true)); + CGAL_assertion(this->is_valid(true)); return false; } @@ -712,7 +712,7 @@ remove(Vertex_handle v) tds().delete_vertex(v); - CGAL_triangulation_assertion(this->is_valid(true)); + CGAL_assertion(this->is_valid(true)); return true; } diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h index 76879a19464..29a8bba10fa 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -110,7 +110,7 @@ public: Periodic_4_hyperbolic_triangulation_2(const Periodic_4_hyperbolic_triangulation_2& tr) : _gt(tr.geom_traits()) { - CGAL_triangulation_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(*this == tr); } Periodic_4_hyperbolic_triangulation_2& operator=(Periodic_4_hyperbolic_triangulation_2 tr) @@ -175,7 +175,7 @@ public: Periodic_point periodic_point(const Face_handle c, int i) const { - CGAL_triangulation_precondition(i >= 0 && i <= 2); + CGAL_precondition(i >= 0 && i <= 2); return std::make_pair(c->vertex(i)->point(), c->translation(i)); } @@ -194,8 +194,8 @@ public: Periodic_segment periodic_segment(const Face_handle c, int i, int j) const { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition((i >= 0 && i <= 2) && (j >= 0 && j <= 2)); + CGAL_precondition(i != j); + CGAL_precondition((i >= 0 && i <= 2) && (j >= 0 && j <= 2)); return periodic_segment(c->vertex(i)->point(), c->vertex(j)->point(), c->translation(i), c->translation(j)); } @@ -263,14 +263,14 @@ public: Hyperbolic_segment construct_hyperbolic_segment(const Face_handle & fh, int idx) const { - CGAL_triangulation_precondition(idx >= 0 && idx <= 2); + CGAL_precondition(idx >= 0 && idx <= 2); return construct_hyperbolic_segment(fh->vertex(ccw(idx))->point(), fh->vertex(cw(idx))->point(), fh->translation(ccw(idx)), fh->translation(cw(idx))); } Hyperbolic_segment construct_hyperbolic_segment(const std::pair & edge) const { - CGAL_triangulation_precondition(edge.second >= 0 && edge.second <= 2); + CGAL_precondition(edge.second >= 0 && edge.second <= 2); return construct_hyperbolic_segment(edge.first, ccw(edge.second)); } @@ -523,7 +523,7 @@ public: Hyperbolic_translation neighbor_translation(const Face_handle fh, int i) const { - CGAL_triangulation_precondition(i >= 0 && i <= 2); + CGAL_precondition(i >= 0 && i <= 2); int myi = ccw(i); Hyperbolic_translation myof = fh->translation(myi); @@ -645,9 +645,9 @@ inline bool Periodic_4_hyperbolic_triangulation_2:: has_self_edges(typename TDS::Face_handle c) const { - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(1)) || (c->translation(0) != c->translation(1))); - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(2)) || (c->translation(0) != c->translation(2))); - CGAL_triangulation_assertion((c->vertex(1) != c->vertex(2)) || (c->translation(1) != c->translation(2))); + CGAL_assertion((c->vertex(0) != c->vertex(1)) || (c->translation(0) != c->translation(1))); + CGAL_assertion((c->vertex(0) != c->vertex(2)) || (c->translation(0) != c->translation(2))); + CGAL_assertion((c->vertex(1) != c->vertex(2)) || (c->translation(1) != c->translation(2))); return ((c->vertex(0) == c->vertex(1)) || (c->vertex(0) == c->vertex(2)) || @@ -691,11 +691,11 @@ is_valid(bool verbose) const { { for(int i=0; i<3; ++i) { - CGAL_triangulation_assertion(cit != cit->neighbor(i)); + CGAL_assertion(cit != cit->neighbor(i)); for(int j=i+1; j<3; ++j) { - CGAL_triangulation_assertion(cit->neighbor(i) != cit->neighbor(j)); - CGAL_triangulation_assertion(cit->vertex(i) != cit->vertex(j)); + CGAL_assertion(cit->neighbor(i) != cit->neighbor(j)); + CGAL_assertion(cit->vertex(i) != cit->vertex(j)); } } @@ -735,9 +735,9 @@ is_valid(bool verbose) const { if(!error) { - CGAL_triangulation_assertion(!has_self_edges()); - CGAL_triangulation_assertion(!has_cycles_length_2()); - CGAL_triangulation_assertion(_tds.number_of_vertices() + _tds.number_of_faces() + 2 == _tds.number_of_edges()); + CGAL_assertion(!has_self_edges()); + CGAL_assertion(!has_cycles_length_2()); + CGAL_assertion(_tds.number_of_vertices() + _tds.number_of_faces() + 2 == _tds.number_of_edges()); return true; } else @@ -990,8 +990,8 @@ hyperbolic_periodic_locate(const Point& p, Point np0 = construct_point(construct_point(nf->vertex(0)->point(), nf->translation(0)) , tr); Point np1 = construct_point(construct_point(nf->vertex(1)->point(), nf->translation(1)) , tr); Point np2 = construct_point(construct_point(nf->vertex(2)->point(), nf->translation(2)) , tr); - CGAL_triangulation_assertion_code(Oriented_side os1 = side_of_hyperbolic_triangle(np0, np1, np2, p, lt, li)); - CGAL_triangulation_assertion(os1 == ON_POSITIVE_SIDE); + CGAL_assertion_code(Oriented_side os1 = side_of_hyperbolic_triangle(np0, np1, np2, p, lt, li)); + CGAL_assertion(os1 == ON_POSITIVE_SIDE); lo = tr; return nf; } diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h index 7092e12ab6a..8d4ae64f0bb 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h @@ -251,7 +251,7 @@ insert_dummy_points(bool rational) for(Face_iterator fit = tds().faces_begin(); fit != tds().faces_end(); ++fit) this->make_canonical(fit); - CGAL_triangulation_assertion(is_valid(true)); + CGAL_assertion(is_valid(true)); return ret; } @@ -260,4 +260,3 @@ insert_dummy_points(bool rational) } // namespace CGAL #endif // CGAL_PERIODIC_4_HYPERBOLIC_TRIANGULATION_DUMMY_14_H - diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h index 8f625a81e4a..4488e67b5f0 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h @@ -17,7 +17,6 @@ #include #include -#include #include namespace CGAL { diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 0fafe579ba8..0d034a6bcb1 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index e50db48ca36..e002a834c5f 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 5ecedc40b68..282ad59d4a3 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index a420f5068b7..caf7e062a5e 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -16,7 +16,6 @@ #include #include -#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 234255d599b..d7d719d3978 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include #include @@ -193,7 +193,7 @@ bool write_LAS_with_properties(std::ostream& os, ///< output stream. LAS_property::Z> point_property, ///< property handler for points PropertyHandler&& ... properties) ///< parameter pack of property handlers { - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); if(!os) { diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index 5be867b5ecf..0be0e4183a3 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #include #include @@ -50,7 +50,7 @@ bool write_OFF_PSP(std::ostream& os, PointMap point_map = NP_helper::get_const_point_map(points, np); NormalMap normal_map = NP_helper::get_normal_map(points, np); - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); if(!os) { diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 7da025f7640..6dca998ae72 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -111,7 +111,7 @@ template #include -#include +#include #include #include @@ -51,7 +51,7 @@ bool write_XYZ_PSP(std::ostream& os, PointMap point_map = NP_helper::get_const_point_map(points, np); NormalMap normal_map = NP_helper::get_normal_map(points, np); - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); if(!os) { diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h index 282aa89afe1..6bd7481e096 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h @@ -18,7 +18,6 @@ #include #include #include -#include #include diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h index 14db499896d..b29d1c24b4c 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -454,7 +454,7 @@ void compute_ball_neighbors_one_self( CGAL::Bbox_3 bbox, ///< bounding box const typename Kernel::FT radius) { - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); for (unsigned int i = 0; i < points.size(); ++i) { diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index 86fa5d23b19..396d9cdb0e0 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -72,8 +72,8 @@ compute_denoise_projection( typename Kernel::FT sharpness_angle ///< control sharpness(0-90) ) { - CGAL_point_set_processing_precondition(radius > 0); - CGAL_point_set_processing_precondition(sharpness_angle > 0 + CGAL_precondition(radius > 0); + CGAL_precondition(sharpness_angle > 0 && sharpness_angle < 90); // basic geometric types @@ -286,8 +286,8 @@ bilateral_smooth_point_set( const std::function& callback = choose_parameter(get_parameter(np, internal_np::callback), std::function()); - CGAL_point_set_processing_precondition(points.begin() != points.end()); - CGAL_point_set_processing_precondition(k > 1); + CGAL_precondition(points.begin() != points.end()); + CGAL_precondition(k > 1); // types for K nearest neighbors search structure typedef Point_set_processing_3::internal::Neighbor_query Neighbor_query; diff --git a/Point_set_processing_3/include/CGAL/cluster_point_set.h b/Point_set_processing_3/include/CGAL/cluster_point_set.h index 55b56ec8881..c79cd850df1 100644 --- a/Point_set_processing_3/include/CGAL/cluster_point_set.h +++ b/Point_set_processing_3/include/CGAL/cluster_point_set.h @@ -169,7 +169,7 @@ std::size_t cluster_point_set (PointRange& points, // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // If no radius is given, init with 1% of bbox diagonal if (neighbor_radius < 0) diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index 3b9c0f206c6..9b05a634aaf 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -177,10 +177,10 @@ compute_average_spacing( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); // Instanciate a KD-tree search. Neighbor_query neighbor_query (points, point_map); diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 507418d45b8..bf4b589d788 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -147,8 +147,8 @@ update_new_point( typedef typename rich_grid_internal::Rich_point Rich_point; CGAL_assertion_code( unsigned int size = static_cast(rich_point_set.size()) ); - CGAL_point_set_processing_precondition(father_index < size); - CGAL_point_set_processing_precondition(mother_index < size); + CGAL_precondition(father_index < size); + CGAL_precondition(mother_index < size); // 1, get neighbor information from the two "parent points" Rich_point& new_v = rich_point_set[new_point_index]; @@ -386,16 +386,16 @@ edge_aware_upsample_point_set( typename PointRange::const_iterator end = points.end(); // preconditions - CGAL_point_set_processing_precondition(begin != end); - CGAL_point_set_processing_precondition(sharpness_angle >= 0 - &&sharpness_angle <= 90); - CGAL_point_set_processing_precondition(edge_sensitivity >= 0 - &&edge_sensitivity <= 1); + CGAL_precondition(begin != end); + CGAL_precondition(sharpness_angle >= 0 + &&sharpness_angle <= 90); + CGAL_precondition(edge_sensitivity >= 0 + &&edge_sensitivity <= 1); edge_sensitivity *= 10; // just project [0, 1] to [0, 10]. std::size_t number_of_input = std::distance(begin, end); - CGAL_point_set_processing_precondition(number_of_output_points > number_of_input); + CGAL_precondition(number_of_output_points > number_of_input); const unsigned int nb_neighbors = 6; // 1 ring @@ -424,7 +424,7 @@ edge_aware_upsample_point_set( rich_point_set[i].index = i; bbox += rich_point_set[i].pt.bbox(); - CGAL_point_set_processing_precondition(rich_point_set[i].normal.squared_length() > 1e-10); + CGAL_precondition(rich_point_set[i].normal.squared_length() > 1e-10); } // compute neighborhood diff --git a/Point_set_processing_3/include/CGAL/estimate_scale.h b/Point_set_processing_3/include/CGAL/estimate_scale.h index 3bb7db74e5a..32be7a82ffd 100644 --- a/Point_set_processing_3/include/CGAL/estimate_scale.h +++ b/Point_set_processing_3/include/CGAL/estimate_scale.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h index 86cfca10156..d5d05d3a0ac 100644 --- a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -66,7 +66,7 @@ public: Hash_epsilon_points_3 (double epsilon, PointMap p_map) : m_epsilon (epsilon), point_map(p_map) { - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); } std::size_t operator() (const Point_3& a) const @@ -96,7 +96,7 @@ public: Equal_epsilon_points_3 (const double& epsilon, PointMap p_map) : m_epsilon (epsilon), point_map(p_map) { - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); } bool operator() (const Point_3& a, const Point_3& b) const @@ -155,7 +155,7 @@ public: internal::Equal_epsilon_points_3(epsilon, point_map)) , min_points_per_cell (min_points_per_cell) { - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); } bool insert (const Point_3& p) @@ -249,7 +249,7 @@ grid_simplify_point_set( // actual type of input points typedef typename std::iterator_traits::value_type Enriched_point; - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); if (min_points_per_cell == 1) { diff --git a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h index 2d6c60c9245..4d44c8e3e21 100644 --- a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -210,8 +210,8 @@ namespace CGAL { typedef typename std::list::iterator cluster_iterator; CGAL_precondition (points.begin() != points.end()); - CGAL_point_set_processing_precondition (size > 0); - CGAL_point_set_processing_precondition (var_max > 0.0); + CGAL_precondition (size > 0); + CGAL_precondition (var_max > 0.0); // The first cluster is the whole input point set clusters_stack.push_front (cluster (std::list(), Point (0., 0., 0.))); diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 516b2671bdd..30a7f34d48c 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -215,10 +215,10 @@ jet_estimate_normals( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2 || neighbor_radius > FT(0)); + CGAL_precondition(k >= 2 || neighbor_radius > FT(0)); std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE_STREAM << (memory >> 20) << " Mb allocated\n"; diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index 9c6b34b93c3..4f6f308c274 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -218,10 +218,10 @@ jet_smooth_point_set( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); // Instanciate a KD-tree search. Neighbor_query neighbor_query (points, point_map); diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index 909dc37a63d..2a284b2e859 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -184,7 +184,7 @@ struct Propagate_normal_orientation : m_source(source), m_angle_max(angle_max) { // Precondition: 0 < angle_max <= PI/2 - CGAL_point_set_processing_precondition(0 < angle_max && angle_max <= CGAL_PI/2.); + CGAL_precondition(0 < angle_max && angle_max <= CGAL_PI/2.); } template @@ -265,7 +265,7 @@ mst_find_source( typedef typename boost::property_traits::reference Vector_ref; // Precondition: at least one element in the container - CGAL_point_set_processing_precondition(first != beyond); + CGAL_precondition(first != beyond); // Find top point ForwardIterator top_point = first; @@ -337,7 +337,7 @@ create_riemannian_graph( typedef typename boost::property_map::type Riemannian_graph_weight_map; // Precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); // Number of input points const std::size_t num_input_points = points.size(); @@ -363,7 +363,7 @@ create_riemannian_graph( for (ForwardIterator it = points.begin(); it != points.end(); it++) { typename Riemannian_graph::vertex_descriptor v = add_vertex(riemannian_graph); - CGAL_point_set_processing_assertion(v == get(index_map,it)); + CGAL_assertion(v == get(index_map,it)); riemannian_graph[v].input_point = it; } @@ -395,7 +395,7 @@ create_riemannian_graph( boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), vertex(neighbor_index, riemannian_graph), riemannian_graph); - CGAL_point_set_processing_assertion(inserted); + CGAL_assertion(inserted); // -> -> // Computes edge weight = 1 - | normal1 * normal2 | @@ -417,7 +417,7 @@ create_riemannian_graph( boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), vertex(source_point_index, riemannian_graph), riemannian_graph); - CGAL_point_set_processing_assertion(inserted); + CGAL_assertion(inserted); riemannian_graph_weight_map[e] = 0.; } @@ -475,7 +475,7 @@ create_mst_graph( typedef internal::MST_graph MST_graph; // Precondition: at least one element in the container. - CGAL_point_set_processing_precondition(first != beyond); + CGAL_precondition(first != beyond); // Number of input points const std::size_t num_input_points = num_vertices(riemannian_graph) - 1; @@ -511,13 +511,13 @@ create_mst_graph( // 1.56 and 1.57: // https://svn.boost.org/trac/boost/ticket/10382 typename MST_graph::vertex_descriptor v = add_vertex(mst_graph); - CGAL_point_set_processing_assertion(v == get(index_map,it)); + CGAL_assertion(v == get(index_map,it)); mst_graph[v].input_point = it; mst_graph[v].is_oriented = false; } typename MST_graph::vertex_descriptor v = add_vertex(mst_graph); - CGAL_point_set_processing_assertion(v == source_point_index); + CGAL_assertion(v == source_point_index); mst_graph[v].is_oriented = true; // add edges @@ -526,7 +526,7 @@ create_mst_graph( if (i != predecessor[i]) { // check that bi-directed graph is useless - CGAL_point_set_processing_assertion(predecessor[predecessor[i]] != i); + CGAL_assertion(predecessor[predecessor[i]] != i); add_edge(vertex(predecessor[i], mst_graph), vertex(i, mst_graph), @@ -655,10 +655,10 @@ mst_orient_normals( typedef MST_graph MST_graph; // Precondition: at least one element in the container. - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // Precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE_STREAM << (memory >> 20) << " Mb allocated\n"; diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 8447ae952ff..4d5e04b9491 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -186,10 +186,10 @@ pca_estimate_normals( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE_STREAM << (memory >> 20) << " Mb allocated\n"; diff --git a/Point_set_processing_3/include/CGAL/point_set_processing_assertions.h b/Point_set_processing_3/include/CGAL/point_set_processing_assertions.h deleted file mode 100644 index e5b85b5f3ef..00000000000 --- a/Point_set_processing_3/include/CGAL/point_set_processing_assertions.h +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) 2007 INRIA (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) : Geert-Jan Giezeman, Sven Schoenherr, Laurent Saboret -// -// Generated from script create_assertions.sh - - -/// \cond SKIP_IN_MANUAL - -/// @file point_set_processing_assertions.h -/// Define checking macros for the Point_set_processing_3 package - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_point_set_processing_assertion -#undef CGAL_point_set_processing_assertion_msg -#undef CGAL_point_set_processing_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_point_set_processing_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_point_set_processing_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_assertion_code(CODE) -#else -# define CGAL_point_set_processing_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_assertion_code(CODE) CODE -# define CGAL_point_set_processing_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -#undef CGAL_point_set_processing_exactness_assertion -#undef CGAL_point_set_processing_exactness_assertion_msg -#undef CGAL_point_set_processing_exactness_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_assertion(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_assertion_code(CODE) -#else -# define CGAL_point_set_processing_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_assertion_code(CODE) CODE -# define CGAL_point_set_processing_exactness_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -#undef CGAL_point_set_processing_expensive_assertion -#undef CGAL_point_set_processing_expensive_assertion_msg -#undef CGAL_point_set_processing_expensive_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_assertion(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_assertion_code(CODE) -#else -# define CGAL_point_set_processing_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_assertion_code(CODE) CODE -# define CGAL_point_set_processing_expensive_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -#undef CGAL_point_set_processing_expensive_exactness_assertion -#undef CGAL_point_set_processing_expensive_exactness_assertion_msg -#undef CGAL_point_set_processing_expensive_exactness_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_point_set_processing_precondition -#undef CGAL_point_set_processing_precondition_msg -#undef CGAL_point_set_processing_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_point_set_processing_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_precondition_code(CODE) -#else -# define CGAL_point_set_processing_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_precondition_code(CODE) CODE -# define CGAL_point_set_processing_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -#undef CGAL_point_set_processing_exactness_precondition -#undef CGAL_point_set_processing_exactness_precondition_msg -#undef CGAL_point_set_processing_exactness_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_precondition_code(CODE) -#else -# define CGAL_point_set_processing_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_precondition_code(CODE) CODE -# define CGAL_point_set_processing_exactness_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -#undef CGAL_point_set_processing_expensive_precondition -#undef CGAL_point_set_processing_expensive_precondition_msg -#undef CGAL_point_set_processing_expensive_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_precondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_precondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -#undef CGAL_point_set_processing_expensive_exactness_precondition -#undef CGAL_point_set_processing_expensive_exactness_precondition_msg -#undef CGAL_point_set_processing_expensive_exactness_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_point_set_processing_postcondition -#undef CGAL_point_set_processing_postcondition_msg -#undef CGAL_point_set_processing_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_point_set_processing_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -#undef CGAL_point_set_processing_exactness_postcondition -#undef CGAL_point_set_processing_exactness_postcondition_msg -#undef CGAL_point_set_processing_exactness_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_exactness_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -#undef CGAL_point_set_processing_expensive_postcondition -#undef CGAL_point_set_processing_expensive_postcondition_msg -#undef CGAL_point_set_processing_expensive_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -#undef CGAL_point_set_processing_expensive_exactness_postcondition -#undef CGAL_point_set_processing_expensive_exactness_postcondition_msg -#undef CGAL_point_set_processing_expensive_exactness_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_point_set_processing_warning -#undef CGAL_point_set_processing_warning_msg -#undef CGAL_point_set_processing_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_point_set_processing_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_warning_code(CODE) -#else -# define CGAL_point_set_processing_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_warning_code(CODE) CODE -# define CGAL_point_set_processing_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - - -#undef CGAL_point_set_processing_exactness_warning -#undef CGAL_point_set_processing_exactness_warning_msg -#undef CGAL_point_set_processing_exactness_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_warning_code(CODE) -#else -# define CGAL_point_set_processing_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_warning_code(CODE) CODE -# define CGAL_point_set_processing_exactness_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - - -#undef CGAL_point_set_processing_expensive_warning -#undef CGAL_point_set_processing_expensive_warning_msg -#undef CGAL_point_set_processing_expensive_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_warning_code(CODE) -#else -# define CGAL_point_set_processing_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_warning_code(CODE) CODE -# define CGAL_point_set_processing_expensive_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - - -#undef CGAL_point_set_processing_expensive_exactness_warning -#undef CGAL_point_set_processing_expensive_exactness_warning_msg -#undef CGAL_point_set_processing_expensive_exactness_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_warning_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_warning_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - -/// \endcond diff --git a/Point_set_processing_3/include/CGAL/radial_orient_normals.h b/Point_set_processing_3/include/CGAL/radial_orient_normals.h index 9c6ca92e71b..56c87840822 100644 --- a/Point_set_processing_3/include/CGAL/radial_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/radial_orient_normals.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -72,7 +72,7 @@ radial_orient_normals( typedef typename Kernel::FT FT; // Precondition: at least one element in the container. - CGAL_point_set_processing_precondition(first != beyond); + CGAL_precondition(first != beyond); // Find points barycenter. // Note: We should use CGAL::centroid() from PCA component. diff --git a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h index 50e71a2dc62..7d1f767b342 100644 --- a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ random_simplify_point_set( PointRange& points, double removed_percentage) { - CGAL_point_set_processing_precondition(removed_percentage >= 0 && removed_percentage <= 100); + CGAL_precondition(removed_percentage >= 0 && removed_percentage <= 100); // Random shuffle CGAL::cpp98::random_shuffle (points.begin(), points.end()); diff --git a/Point_set_processing_3/include/CGAL/remove_outliers.h b/Point_set_processing_3/include/CGAL/remove_outliers.h index 2b28e1e4c7b..0a2697120b6 100644 --- a/Point_set_processing_3/include/CGAL/remove_outliers.h +++ b/Point_set_processing_3/include/CGAL/remove_outliers.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -206,12 +206,12 @@ remove_outliers( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); - CGAL_point_set_processing_precondition(threshold_percent >= 0 && threshold_percent <= 100); + CGAL_precondition(threshold_percent >= 0 && threshold_percent <= 100); Neighbor_query neighbor_query (points, point_map); diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 598f0553d86..f2d9bd447c3 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h index 5b69f3ef0f9..bf7a7f5225c 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index 7e4b86cdebe..41412051408 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -105,7 +105,7 @@ compute_update_sample_point( const std::vector& sample_densities ///< ) { - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); bool is_original_densities_empty = original_densities.empty(); bool is_sample_densities_empty = sample_densities.empty(); @@ -231,7 +231,7 @@ compute_density_weight_for_original_point( const typename Kernel::FT radius ///< neighbor radius square ) { - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); // basic geometric types typedef typename Kernel::Point_3 Point; @@ -465,9 +465,9 @@ wlop_simplify_and_regularize_point_set( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); - CGAL_point_set_processing_precondition(select_percentage >= 0 - && select_percentage <= 100); + CGAL_precondition(points.begin() != points.end()); + CGAL_precondition(select_percentage >= 0 + && select_percentage <= 100); // Random shuffle CGAL::cpp98::random_shuffle (points.begin(), points.end()); @@ -507,7 +507,7 @@ wlop_simplify_and_regularize_point_set( #endif } - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); // Initiate a KD-tree search for original points std::vector original_treeElements; diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index b329573c042..bd0281cd9d7 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -38,7 +38,7 @@ #endif #include #include -#include +#include #include #include #include @@ -823,7 +823,7 @@ private: double D; if(!solver.linear_solver(A, B, X, D)) return false; - CGAL_surface_reconstruction_points_assertion(D == 1.0); + CGAL_assertion(D == 1.0); duration_solve = (clock() - time_init)/CLOCKS_PER_SEC; CGAL_TRACE_STREAM << " Solve sparse linear system: done (" << duration_solve << "sec.)\n"; @@ -1129,7 +1129,7 @@ private: if(voronoi_points.size() < 3) { - CGAL_surface_reconstruction_points_assertion(false); + CGAL_assertion(false); return 0.0; } diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h index 7dd6a245aa3..9f605978f7c 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h b/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h index 14d91140b5e..04a712e080f 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace CGAL { @@ -212,7 +212,7 @@ unsigned int poisson_refine_triangulation( { // Convergence is guaranteed if radius_edge_ratio_bound >= 1.0 - CGAL_surface_reconstruction_points_precondition(radius_edge_ratio_bound >= 1.0); + CGAL_precondition(radius_edge_ratio_bound >= 1.0); // Mesher_level types typedef Poisson_mesh_cell_criteria_3< diff --git a/Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h b/Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h deleted file mode 100644 index 67bc3df7f1a..00000000000 --- a/Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) 2007 INRIA (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) : Geert-Jan Giezeman, Sven Schoenherr, Laurent Saboret -// -// Generated from script create_assertions.sh - -/// \cond SKIP_IN_MANUAL - -/// @file surface_reconstruction_points_assertions.h -/// Define checking macros for the Poisson_surface_reconstruction_3 package - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_surface_reconstruction_points_assertion -#undef CGAL_surface_reconstruction_points_assertion_msg -#undef CGAL_surface_reconstruction_points_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_surface_reconstruction_points_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_surface_reconstruction_points_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -#undef CGAL_surface_reconstruction_points_exactness_assertion -#undef CGAL_surface_reconstruction_points_exactness_assertion_msg -#undef CGAL_surface_reconstruction_points_exactness_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_assertion(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -#undef CGAL_surface_reconstruction_points_expensive_assertion -#undef CGAL_surface_reconstruction_points_expensive_assertion_msg -#undef CGAL_surface_reconstruction_points_expensive_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_assertion(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_assertion -#undef CGAL_surface_reconstruction_points_expensive_exactness_assertion_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_surface_reconstruction_points_precondition -#undef CGAL_surface_reconstruction_points_precondition_msg -#undef CGAL_surface_reconstruction_points_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_surface_reconstruction_points_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -#undef CGAL_surface_reconstruction_points_exactness_precondition -#undef CGAL_surface_reconstruction_points_exactness_precondition_msg -#undef CGAL_surface_reconstruction_points_exactness_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_precondition -#undef CGAL_surface_reconstruction_points_expensive_precondition_msg -#undef CGAL_surface_reconstruction_points_expensive_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_precondition -#undef CGAL_surface_reconstruction_points_expensive_exactness_precondition_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_surface_reconstruction_points_postcondition -#undef CGAL_surface_reconstruction_points_postcondition_msg -#undef CGAL_surface_reconstruction_points_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_surface_reconstruction_points_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -#undef CGAL_surface_reconstruction_points_exactness_postcondition -#undef CGAL_surface_reconstruction_points_exactness_postcondition_msg -#undef CGAL_surface_reconstruction_points_exactness_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_postcondition -#undef CGAL_surface_reconstruction_points_expensive_postcondition_msg -#undef CGAL_surface_reconstruction_points_expensive_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_postcondition -#undef CGAL_surface_reconstruction_points_expensive_exactness_postcondition_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_surface_reconstruction_points_warning -#undef CGAL_surface_reconstruction_points_warning_msg -#undef CGAL_surface_reconstruction_points_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_surface_reconstruction_points_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - - -#undef CGAL_surface_reconstruction_points_exactness_warning -#undef CGAL_surface_reconstruction_points_exactness_warning_msg -#undef CGAL_surface_reconstruction_points_exactness_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - - -#undef CGAL_surface_reconstruction_points_expensive_warning -#undef CGAL_surface_reconstruction_points_expensive_warning_msg -#undef CGAL_surface_reconstruction_points_expensive_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_warning -#undef CGAL_surface_reconstruction_points_expensive_exactness_warning_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - -/// \endcond diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h index 15a4b1fd3eb..ebfbb70736b 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -117,13 +116,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } Cell_handle neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -146,15 +145,15 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } // SETTING void set_neighbor(int i, Cell_handle n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i >= 0 && i <= 3); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -166,10 +165,10 @@ public: void set_neighbors(Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); - CGAL_triangulation_precondition( this != n3.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); + CGAL_precondition( this != n3.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; @@ -197,7 +196,7 @@ public: // but there's not much we can do for this now. void set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); V[i] = v; } diff --git a/STL_Extension/include/CGAL/multiset_assertions.h b/STL_Extension/include/CGAL/multiset_assertions.h index 894accd47fc..89a7d6157ba 100644 --- a/STL_Extension/include/CGAL/multiset_assertions.h +++ b/STL_Extension/include/CGAL/multiset_assertions.h @@ -12,9 +12,8 @@ // Generated from script create_assertions.sh -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. +#ifndef CGAL_MULTISET_ASSERTIONS_H +#define CGAL_MULTISET_ASSERTIONS_H #include @@ -23,9 +22,6 @@ // assertions // ---------- -#undef CGAL_multiset_assertion -#undef CGAL_multiset_assertion_msg -#undef CGAL_multiset_assertion_code #if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) # define CGAL_multiset_assertion(EX) (static_cast(0)) @@ -41,9 +37,6 @@ #endif // CGAL_MULTISET_NO_ASSERTIONS -#undef CGAL_multiset_exactness_assertion -#undef CGAL_multiset_exactness_assertion_msg -#undef CGAL_multiset_exactness_assertion_code #if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -60,9 +53,6 @@ #endif // CGAL_MULTISET_NO_ASSERTIONS -#undef CGAL_multiset_expensive_assertion -#undef CGAL_multiset_expensive_assertion_msg -#undef CGAL_multiset_expensive_assertion_code #if defined(CGAL_MULTISET_NO_ASSERTIONS) \ || defined(CGAL_NO_ASSERTIONS) \ @@ -80,9 +70,6 @@ #endif // CGAL_MULTISET_NO_ASSERTIONS -#undef CGAL_multiset_expensive_exactness_assertion -#undef CGAL_multiset_expensive_exactness_assertion_msg -#undef CGAL_multiset_expensive_exactness_assertion_code #if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -103,9 +90,6 @@ // preconditions // ------------- -#undef CGAL_multiset_precondition -#undef CGAL_multiset_precondition_msg -#undef CGAL_multiset_precondition_code #if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) # define CGAL_multiset_precondition(EX) (static_cast(0)) @@ -121,9 +105,6 @@ #endif // CGAL_MULTISET_NO_PRECONDITIONS -#undef CGAL_multiset_exactness_precondition -#undef CGAL_multiset_exactness_precondition_msg -#undef CGAL_multiset_exactness_precondition_code #if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -140,9 +121,6 @@ #endif // CGAL_MULTISET_NO_PRECONDITIONS -#undef CGAL_multiset_expensive_precondition -#undef CGAL_multiset_expensive_precondition_msg -#undef CGAL_multiset_expensive_precondition_code #if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -159,9 +137,6 @@ #endif // CGAL_MULTISET_NO_PRECONDITIONS -#undef CGAL_multiset_expensive_exactness_precondition -#undef CGAL_multiset_expensive_exactness_precondition_msg -#undef CGAL_multiset_expensive_exactness_precondition_code #if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -182,9 +157,6 @@ // postconditions // -------------- -#undef CGAL_multiset_postcondition -#undef CGAL_multiset_postcondition_msg -#undef CGAL_multiset_postcondition_code #if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) # define CGAL_multiset_postcondition(EX) (static_cast(0)) @@ -200,9 +172,6 @@ #endif // CGAL_MULTISET_NO_POSTCONDITIONS -#undef CGAL_multiset_exactness_postcondition -#undef CGAL_multiset_exactness_postcondition_msg -#undef CGAL_multiset_exactness_postcondition_code #if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -219,9 +188,6 @@ #endif // CGAL_MULTISET_NO_POSTCONDITIONS -#undef CGAL_multiset_expensive_postcondition -#undef CGAL_multiset_expensive_postcondition_msg -#undef CGAL_multiset_expensive_postcondition_code #if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -238,9 +204,6 @@ #endif // CGAL_MULTISET_NO_POSTCONDITIONS -#undef CGAL_multiset_expensive_exactness_postcondition -#undef CGAL_multiset_expensive_exactness_postcondition_msg -#undef CGAL_multiset_expensive_exactness_postcondition_code #if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -261,9 +224,6 @@ // warnings // -------- -#undef CGAL_multiset_warning -#undef CGAL_multiset_warning_msg -#undef CGAL_multiset_warning_code #if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) # define CGAL_multiset_warning(EX) (static_cast(0)) @@ -279,9 +239,6 @@ #endif // CGAL_MULTISET_NO_WARNINGS -#undef CGAL_multiset_exactness_warning -#undef CGAL_multiset_exactness_warning_msg -#undef CGAL_multiset_exactness_warning_code #if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -298,9 +255,6 @@ #endif // CGAL_MULTISET_NO_WARNINGS -#undef CGAL_multiset_expensive_warning -#undef CGAL_multiset_expensive_warning_msg -#undef CGAL_multiset_expensive_warning_code #if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -317,9 +271,6 @@ #endif // CGAL_MULTISET_NO_WARNINGS -#undef CGAL_multiset_expensive_exactness_warning -#undef CGAL_multiset_expensive_exactness_warning_msg -#undef CGAL_multiset_expensive_exactness_warning_code #if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -335,3 +286,5 @@ # define CGAL_multiset_expensive_exactness_warning_code(CODE) CODE # define CGAL_multiset_expensive_exactness_warnings 1 #endif // CGAL_MULTISET_NO_WARNINGS + +#endif // CGAL_MULTISET_ASSERTIONS diff --git a/STL_Extension/include/CGAL/triangulation_assertions.h b/STL_Extension/include/CGAL/triangulation_assertions.h deleted file mode 100644 index 07c7c80e72f..00000000000 --- a/STL_Extension/include/CGAL/triangulation_assertions.h +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) 2001 INRIA Sophia-Antipolis (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_triangulation_assertion -#undef CGAL_triangulation_assertion_msg -#undef CGAL_triangulation_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_triangulation_assertion(EX) (static_cast(0)) - - -# define CGAL_triangulation_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_assertion_code(CODE) -#else -# define CGAL_triangulation_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_assertion_code(CODE) CODE -# define CGAL_triangulation_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -#undef CGAL_triangulation_exactness_assertion -#undef CGAL_triangulation_exactness_assertion_msg -#undef CGAL_triangulation_exactness_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_assertion(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_assertion_code(CODE) -#else -# define CGAL_triangulation_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_assertion_code(CODE) CODE -# define CGAL_triangulation_exactness_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -#undef CGAL_triangulation_expensive_assertion -#undef CGAL_triangulation_expensive_assertion_msg -#undef CGAL_triangulation_expensive_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_assertion(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_assertion_code(CODE) -#else -# define CGAL_triangulation_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_assertion_code(CODE) CODE -# define CGAL_triangulation_expensive_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -#undef CGAL_triangulation_expensive_exactness_assertion -#undef CGAL_triangulation_expensive_exactness_assertion_msg -#undef CGAL_triangulation_expensive_exactness_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_triangulation_precondition -#undef CGAL_triangulation_precondition_msg -#undef CGAL_triangulation_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_triangulation_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_precondition_code(CODE) -#else -# define CGAL_triangulation_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_precondition_code(CODE) CODE -# define CGAL_triangulation_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -#undef CGAL_triangulation_exactness_precondition -#undef CGAL_triangulation_exactness_precondition_msg -#undef CGAL_triangulation_exactness_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_precondition_code(CODE) -#else -# define CGAL_triangulation_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_precondition_code(CODE) CODE -# define CGAL_triangulation_exactness_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -#undef CGAL_triangulation_expensive_precondition -#undef CGAL_triangulation_expensive_precondition_msg -#undef CGAL_triangulation_expensive_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_precondition_code(CODE) -#else -# define CGAL_triangulation_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_precondition_code(CODE) CODE -# define CGAL_triangulation_expensive_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -#undef CGAL_triangulation_expensive_exactness_precondition -#undef CGAL_triangulation_expensive_exactness_precondition_msg -#undef CGAL_triangulation_expensive_exactness_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_triangulation_postcondition -#undef CGAL_triangulation_postcondition_msg -#undef CGAL_triangulation_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_triangulation_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_postcondition_code(CODE) -#else -# define CGAL_triangulation_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_postcondition_code(CODE) CODE -# define CGAL_triangulation_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -#undef CGAL_triangulation_exactness_postcondition -#undef CGAL_triangulation_exactness_postcondition_msg -#undef CGAL_triangulation_exactness_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_postcondition_code(CODE) -#else -# define CGAL_triangulation_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_postcondition_code(CODE) CODE -# define CGAL_triangulation_exactness_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -#undef CGAL_triangulation_expensive_postcondition -#undef CGAL_triangulation_expensive_postcondition_msg -#undef CGAL_triangulation_expensive_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_postcondition_code(CODE) -#else -# define CGAL_triangulation_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_postcondition_code(CODE) CODE -# define CGAL_triangulation_expensive_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -#undef CGAL_triangulation_expensive_exactness_postcondition -#undef CGAL_triangulation_expensive_exactness_postcondition_msg -#undef CGAL_triangulation_expensive_exactness_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_triangulation_warning -#undef CGAL_triangulation_warning_msg -#undef CGAL_triangulation_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_triangulation_warning(EX) (static_cast(0)) -# define CGAL_triangulation_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_warning_code(CODE) -#else -# define CGAL_triangulation_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_warning_code(CODE) CODE -# define CGAL_triangulation_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS - - -#undef CGAL_triangulation_exactness_warning -#undef CGAL_triangulation_exactness_warning_msg -#undef CGAL_triangulation_exactness_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_warning(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_warning_code(CODE) -#else -# define CGAL_triangulation_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_warning_code(CODE) CODE -# define CGAL_triangulation_exactness_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS - - -#undef CGAL_triangulation_expensive_warning -#undef CGAL_triangulation_expensive_warning_msg -#undef CGAL_triangulation_expensive_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_warning(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_warning_code(CODE) -#else -# define CGAL_triangulation_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_warning_code(CODE) CODE -# define CGAL_triangulation_expensive_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS - - -#undef CGAL_triangulation_expensive_exactness_warning -#undef CGAL_triangulation_expensive_exactness_warning_msg -#undef CGAL_triangulation_expensive_exactness_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_warning_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_warning_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS diff --git a/SearchStructures/include/CGAL/Range_tree_d.h b/SearchStructures/include/CGAL/Range_tree_d.h index 17f28b8383b..0a1cae56d43 100644 --- a/SearchStructures/include/CGAL/Range_tree_d.h +++ b/SearchStructures/include/CGAL/Range_tree_d.h @@ -222,18 +222,18 @@ protected: link_type vleft = new Range_tree_node2( 0, 0, (*current), m_interface.get_key(*current) ); //CGAL_NIL CGAL_NIL first two arguments - CGAL_Tree_assertion( vleft != 0); + CGAL_assertion( vleft != 0); ++current; link_type vright = new Range_tree_node2( 0,0, (*current), m_interface.get_key(*current) ); //CGAL_NIL CGAL_NIL first two arguments - CGAL_Tree_assertion( vright != 0); + CGAL_assertion( vright != 0); current++; sublevel_last = current; link_type vparent = new Range_tree_node2( vleft, vright, vleft->key ); - CGAL_Tree_assertion( vparent != 0); + CGAL_assertion( vparent != 0); vleft->parent_link = vparent; vright->parent_link = vparent; @@ -260,7 +260,7 @@ protected: link_type vright = new Range_tree_node2( 0, 0, (*current), m_interface.get_key(*current) ); //CGAL_NIL CGAL_NIL first two arguments - CGAL_Tree_assertion( vright != 0); //CGAL_NIL + CGAL_assertion( vright != 0); //CGAL_NIL current++; sublevel_last = current; prevchild = vright; @@ -276,7 +276,7 @@ protected: link_type vparent = new Range_tree_node2( prevchild, 0, rightchild->key ); //CGAL_NIL argument - CGAL_Tree_assertion( vparent != 0); + CGAL_assertion( vparent != 0); prevchild->parent_link = vparent; diff --git a/SearchStructures/include/CGAL/Tree_assertions.h b/SearchStructures/include/CGAL/Tree_assertions.h deleted file mode 100644 index 091d35fa81b..00000000000 --- a/SearchStructures/include/CGAL/Tree_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 1997 ETH Zurich (Switzerland). -// 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) : Geert-Jan Giezeman, Sven Schoenherr, Gabriele Neyer -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_Tree_assertion -#undef CGAL_Tree_assertion_msg -#undef CGAL_Tree_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_Tree_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_Tree_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_assertion_code(CODE) -#else -# define CGAL_Tree_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_assertion_code(CODE) CODE -# define CGAL_Tree_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -#undef CGAL_Tree_exactness_assertion -#undef CGAL_Tree_exactness_assertion_msg -#undef CGAL_Tree_exactness_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_assertion(EX) (static_cast(0)) -# define CGAL_Tree_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_assertion_code(CODE) -#else -# define CGAL_Tree_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_assertion_code(CODE) CODE -# define CGAL_Tree_exactness_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -#undef CGAL_Tree_expensive_assertion -#undef CGAL_Tree_expensive_assertion_msg -#undef CGAL_Tree_expensive_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_assertion(EX) (static_cast(0)) -# define CGAL_Tree_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_assertion_code(CODE) -#else -# define CGAL_Tree_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_assertion_code(CODE) CODE -# define CGAL_Tree_expensive_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -#undef CGAL_Tree_expensive_exactness_assertion -#undef CGAL_Tree_expensive_exactness_assertion_msg -#undef CGAL_Tree_expensive_exactness_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_Tree_precondition -#undef CGAL_Tree_precondition_msg -#undef CGAL_Tree_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_Tree_precondition(EX) (static_cast(0)) -# define CGAL_Tree_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_precondition_code(CODE) -#else -# define CGAL_Tree_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_precondition_code(CODE) CODE -# define CGAL_Tree_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -#undef CGAL_Tree_exactness_precondition -#undef CGAL_Tree_exactness_precondition_msg -#undef CGAL_Tree_exactness_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_precondition(EX) (static_cast(0)) -# define CGAL_Tree_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_precondition_code(CODE) -#else -# define CGAL_Tree_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_precondition_code(CODE) CODE -# define CGAL_Tree_exactness_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -#undef CGAL_Tree_expensive_precondition -#undef CGAL_Tree_expensive_precondition_msg -#undef CGAL_Tree_expensive_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_precondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_precondition_code(CODE) -#else -# define CGAL_Tree_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_precondition_code(CODE) CODE -# define CGAL_Tree_expensive_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -#undef CGAL_Tree_expensive_exactness_precondition -#undef CGAL_Tree_expensive_exactness_precondition_msg -#undef CGAL_Tree_expensive_exactness_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_Tree_postcondition -#undef CGAL_Tree_postcondition_msg -#undef CGAL_Tree_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_Tree_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_postcondition_code(CODE) -#else -# define CGAL_Tree_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_postcondition_code(CODE) CODE -# define CGAL_Tree_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -#undef CGAL_Tree_exactness_postcondition -#undef CGAL_Tree_exactness_postcondition_msg -#undef CGAL_Tree_exactness_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_postcondition_code(CODE) -#else -# define CGAL_Tree_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_postcondition_code(CODE) CODE -# define CGAL_Tree_exactness_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -#undef CGAL_Tree_expensive_postcondition -#undef CGAL_Tree_expensive_postcondition_msg -#undef CGAL_Tree_expensive_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_postcondition_code(CODE) -#else -# define CGAL_Tree_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_postcondition_code(CODE) CODE -# define CGAL_Tree_expensive_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -#undef CGAL_Tree_expensive_exactness_postcondition -#undef CGAL_Tree_expensive_exactness_postcondition_msg -#undef CGAL_Tree_expensive_exactness_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_Tree_warning -#undef CGAL_Tree_warning_msg -#undef CGAL_Tree_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_Tree_warning(EX) (static_cast(0)) -# define CGAL_Tree_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_warning_code(CODE) -#else -# define CGAL_Tree_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_warning_code(CODE) CODE -# define CGAL_Tree_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS - - -#undef CGAL_Tree_exactness_warning -#undef CGAL_Tree_exactness_warning_msg -#undef CGAL_Tree_exactness_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_warning(EX) (static_cast(0)) -# define CGAL_Tree_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_warning_code(CODE) -#else -# define CGAL_Tree_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_warning_code(CODE) CODE -# define CGAL_Tree_exactness_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS - - -#undef CGAL_Tree_expensive_warning -#undef CGAL_Tree_expensive_warning_msg -#undef CGAL_Tree_expensive_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_warning(EX) (static_cast(0)) -# define CGAL_Tree_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_warning_code(CODE) -#else -# define CGAL_Tree_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_warning_code(CODE) CODE -# define CGAL_Tree_expensive_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS - - -#undef CGAL_Tree_expensive_exactness_warning -#undef CGAL_Tree_expensive_exactness_warning_msg -#undef CGAL_Tree_expensive_exactness_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_warning_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_warning_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS diff --git a/SearchStructures/include/CGAL/Tree_base.h b/SearchStructures/include/CGAL/Tree_base.h index 90368baf98e..fd011f90a2f 100644 --- a/SearchStructures/include/CGAL/Tree_base.h +++ b/SearchStructures/include/CGAL/Tree_base.h @@ -22,7 +22,6 @@ #include #include #include -#include #ifndef CGAL_TREE_BASE_nullptr #define CGAL_TREE_BASE_nullptr 0 diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h index 4095dadf734..7519abf3039 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h @@ -17,12 +17,7 @@ #include - - #include -#include - - namespace CGAL { diff --git a/Stream_lines_2/include/CGAL/Regular_grid_2.h b/Stream_lines_2/include/CGAL/Regular_grid_2.h index 57b69a00e41..2ef9c992a01 100644 --- a/Stream_lines_2/include/CGAL/Regular_grid_2.h +++ b/Stream_lines_2/include/CGAL/Regular_grid_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include @@ -59,7 +59,7 @@ public: std::pair get_field(const Point_2 & p) const { - CGAL_streamlines_precondition(is_in_domain(p)); + CGAL_precondition(is_in_domain(p)); Vector_2 v = get_vector_field(p); FT density = get_density_field(p); return std::pair(v,density); @@ -126,7 +126,7 @@ template inline typename Regular_grid_2::Vector_2 Regular_grid_2::get_field(int i, int j) const { - CGAL_streamlines_precondition(is_in_samples(i,j)); + CGAL_precondition(is_in_samples(i,j)); int index = get_index(i,j); return Vector_2((*vector_field)[index], (*vector_field)[index+1]); } @@ -137,7 +137,7 @@ Regular_grid_2::set_field(int i, int j, const Vector_2 & v) { - CGAL_streamlines_precondition(is_in_samples(i,j)); + CGAL_precondition(is_in_samples(i,j)); int index = get_index(i,j); (*vector_field)[index++] = v.x(); (*vector_field)[index] = v.y(); diff --git a/Stream_lines_2/include/CGAL/Stream_lines_2.h b/Stream_lines_2/include/CGAL/Stream_lines_2.h index a000bbf684f..16d71b84af7 100644 --- a/Stream_lines_2/include/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/include/CGAL/Stream_lines_2.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include // undocumented class @@ -392,7 +392,7 @@ Stream_lines_2::integrate_forward(const Vector_fiel { Point_2 ex_old_point = old_point; old_point = new_point; - CGAL_streamlines_precondition(vector_field_2.is_in_domain(old_point)); + CGAL_precondition(vector_field_2.is_in_domain(old_point)); new_point = integrator(old_point,vector_field_2,true); bEnd = !vector_field_2.is_in_domain(new_point); bEnd = bEnd || (new_point == old_point);/* to review */ @@ -521,7 +521,7 @@ void Stream_lines_2::integrate_backward(const Vecto Point_2 ex_old_point = old_point; old_point = new_point; std::pair field_vector; - CGAL_streamlines_precondition(vector_field_2.is_in_domain(old_point)); + CGAL_precondition(vector_field_2.is_in_domain(old_point)); new_point = integrator(old_point,vector_field_2,false); bEnd = !vector_field_2.is_in_domain(new_point); FT dist_ = distance(ex_old_point,new_point); diff --git a/Stream_lines_2/include/CGAL/streamlines_assertions.h b/Stream_lines_2/include/CGAL/streamlines_assertions.h deleted file mode 100644 index ce5fe41b14b..00000000000 --- a/Stream_lines_2/include/CGAL/streamlines_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 2005 INRIA Sophia-Antipolis (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) : Geert-Jan Giezeman, Sven Schoenherr, Abdelkrim Mebarki -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_streamlines_assertion -#undef CGAL_streamlines_assertion_msg -#undef CGAL_streamlines_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_streamlines_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_streamlines_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_assertion_code(CODE) -#else -# define CGAL_streamlines_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_assertion_code(CODE) CODE -# define CGAL_streamlines_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -#undef CGAL_streamlines_exactness_assertion -#undef CGAL_streamlines_exactness_assertion_msg -#undef CGAL_streamlines_exactness_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_assertion(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_assertion_code(CODE) -#else -# define CGAL_streamlines_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_assertion_code(CODE) CODE -# define CGAL_streamlines_exactness_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -#undef CGAL_streamlines_expensive_assertion -#undef CGAL_streamlines_expensive_assertion_msg -#undef CGAL_streamlines_expensive_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_assertion(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_assertion_code(CODE) -#else -# define CGAL_streamlines_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_assertion_code(CODE) CODE -# define CGAL_streamlines_expensive_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -#undef CGAL_streamlines_expensive_exactness_assertion -#undef CGAL_streamlines_expensive_exactness_assertion_msg -#undef CGAL_streamlines_expensive_exactness_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_streamlines_precondition -#undef CGAL_streamlines_precondition_msg -#undef CGAL_streamlines_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_streamlines_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_precondition_code(CODE) -#else -# define CGAL_streamlines_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_precondition_code(CODE) CODE -# define CGAL_streamlines_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -#undef CGAL_streamlines_exactness_precondition -#undef CGAL_streamlines_exactness_precondition_msg -#undef CGAL_streamlines_exactness_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_precondition_code(CODE) -#else -# define CGAL_streamlines_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_precondition_code(CODE) CODE -# define CGAL_streamlines_exactness_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -#undef CGAL_streamlines_expensive_precondition -#undef CGAL_streamlines_expensive_precondition_msg -#undef CGAL_streamlines_expensive_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_precondition_code(CODE) -#else -# define CGAL_streamlines_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_precondition_code(CODE) CODE -# define CGAL_streamlines_expensive_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -#undef CGAL_streamlines_expensive_exactness_precondition -#undef CGAL_streamlines_expensive_exactness_precondition_msg -#undef CGAL_streamlines_expensive_exactness_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_streamlines_postcondition -#undef CGAL_streamlines_postcondition_msg -#undef CGAL_streamlines_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_streamlines_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_postcondition_code(CODE) -#else -# define CGAL_streamlines_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_postcondition_code(CODE) CODE -# define CGAL_streamlines_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -#undef CGAL_streamlines_exactness_postcondition -#undef CGAL_streamlines_exactness_postcondition_msg -#undef CGAL_streamlines_exactness_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_postcondition_code(CODE) -#else -# define CGAL_streamlines_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_postcondition_code(CODE) CODE -# define CGAL_streamlines_exactness_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -#undef CGAL_streamlines_expensive_postcondition -#undef CGAL_streamlines_expensive_postcondition_msg -#undef CGAL_streamlines_expensive_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_postcondition_code(CODE) -#else -# define CGAL_streamlines_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_postcondition_code(CODE) CODE -# define CGAL_streamlines_expensive_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -#undef CGAL_streamlines_expensive_exactness_postcondition -#undef CGAL_streamlines_expensive_exactness_postcondition_msg -#undef CGAL_streamlines_expensive_exactness_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_streamlines_warning -#undef CGAL_streamlines_warning_msg -#undef CGAL_streamlines_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_streamlines_warning(EX) (static_cast(0)) -# define CGAL_streamlines_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_warning_code(CODE) -#else -# define CGAL_streamlines_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_warning_code(CODE) CODE -# define CGAL_streamlines_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS - - -#undef CGAL_streamlines_exactness_warning -#undef CGAL_streamlines_exactness_warning_msg -#undef CGAL_streamlines_exactness_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_warning(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_warning_code(CODE) -#else -# define CGAL_streamlines_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_warning_code(CODE) CODE -# define CGAL_streamlines_exactness_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS - - -#undef CGAL_streamlines_expensive_warning -#undef CGAL_streamlines_expensive_warning_msg -#undef CGAL_streamlines_expensive_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_warning(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_warning_code(CODE) -#else -# define CGAL_streamlines_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_warning_code(CODE) CODE -# define CGAL_streamlines_expensive_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS - - -#undef CGAL_streamlines_expensive_exactness_warning -#undef CGAL_streamlines_expensive_exactness_warning_msg -#undef CGAL_streamlines_expensive_exactness_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_warning_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_warning_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index c49536c1a2e..79f0b1b4022 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -240,8 +240,8 @@ public: Vertex_handle mirror_vertex(Face_handle f, int i) const { - CGAL_triangulation_precondition ( f->neighbor(i) != Face_handle() - && f->dimension() >= 1); + CGAL_precondition ( f->neighbor(i) != Face_handle() + && f->dimension() >= 1); return f->neighbor(i)->vertex(mirror_index(f,i)); } @@ -249,8 +249,8 @@ public: mirror_index(Face_handle f, int i) const { // return the index of opposite vertex in neighbor(i); - CGAL_triangulation_precondition (f->neighbor(i) != Face_handle() && - f->dimension() >= 1); + CGAL_precondition (f->neighbor(i) != Face_handle() && + f->dimension() >= 1); if (f->dimension() == 1) { CGAL_assertion(i<=1); const int j = f->neighbor(i)->index(f->vertex((i==0) ? 1 : 0)); @@ -263,8 +263,8 @@ public: Edge mirror_edge(const Edge e) const { - CGAL_triangulation_precondition(e.first->neighbor(e.second) != Face_handle() - && e.first->dimension() >= 1); + CGAL_precondition(e.first->neighbor(e.second) != Face_handle() + && e.first->dimension() >= 1); return Edge(e.first->neighbor(e.second), mirror_index(e.first, e.second)); } @@ -461,7 +461,7 @@ public: void insert_in_hole(Vertex_handle v, FaceIt face_begin, FaceIt face_end) { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::vector new_faces; std::vector bdry_edges; @@ -604,7 +604,7 @@ public: // the triangulation is assumed to have dim=2 // hole is supposed to be ccw oriented { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); EdgeIt eit = edge_begin; FaceIt fit = face_begin; @@ -742,7 +742,7 @@ void Triangulation_data_structure_2:: swap(Tds &tds) { - CGAL_triangulation_expensive_precondition(tds.is_valid() && is_valid()); + CGAL_expensive_precondition(tds.is_valid() && is_valid()); std::swap(_dimension, tds._dimension); faces().swap(tds.faces()); vertices().swap(tds.vertices()); @@ -895,7 +895,7 @@ void Triangulation_data_structure_2:: flip(Face_handle f, int i) { - CGAL_triangulation_precondition( dimension()==2); + CGAL_precondition( dimension()==2); Face_handle n = f->neighbor(i); int ni = mirror_index(f,i); //ni = n->index(f); @@ -930,8 +930,8 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_first( ) { - CGAL_triangulation_precondition( number_of_vertices() == 0 && - dimension()==-2 ); + CGAL_precondition( number_of_vertices() == 0 && + dimension()==-2 ); return insert_dim_up(); } @@ -940,8 +940,8 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_second() { - CGAL_triangulation_precondition( number_of_vertices() == 1 && - dimension()==-1 ); + CGAL_precondition( number_of_vertices() == 1 && + dimension()==-1 ); return insert_dim_up(); } @@ -953,7 +953,7 @@ Triangulation_data_structure_2:: insert_in_face(Face_handle f) // New vertex will replace f->vertex(0) in face f { - CGAL_triangulation_precondition( f != Face_handle() && dimension()== 2); + CGAL_precondition( f != Face_handle() && dimension()== 2); Vertex_handle v = create_vertex(); Vertex_handle v0 = f->vertex(0); @@ -992,11 +992,11 @@ Triangulation_data_structure_2:: insert_in_edge(Face_handle f, int i) //insert in the edge opposite to vertex i of face f { - CGAL_triangulation_precondition(f != Face_handle() && dimension() >= 1); - if (dimension() == 1) {CGAL_triangulation_precondition(i == 2);} - if (dimension() == 2) {CGAL_triangulation_precondition(i == 0 || - i == 1 || - i == 2);} + CGAL_precondition(f != Face_handle() && dimension() >= 1); + if (dimension() == 1) {CGAL_precondition(i == 2);} + if (dimension() == 2) {CGAL_precondition(i == 0 || + i == 1 || + i == 2);} Vertex_handle v; if (dimension() == 1) { v = create_vertex(); @@ -1118,7 +1118,7 @@ insert_dim_up(Vertex_handle w, bool orient) } break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); break; } return v; } @@ -1130,11 +1130,11 @@ Triangulation_data_structure_2:: remove_degree_3(Vertex_handle v, Face_handle f) // remove a vertex of degree 3 { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(degree(v) == 3); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(degree(v) == 3); if (f == Face_handle()) {f= v->face();} - else { CGAL_triangulation_assertion( f->has_vertex(v));} + else { CGAL_assertion( f->has_vertex(v));} int i = f->index(v); Face_handle left = f->neighbor(cw(i)); @@ -1144,7 +1144,7 @@ remove_degree_3(Vertex_handle v, Face_handle f) Face_handle ll, rr; Vertex_handle q = left->vertex(li); - CGAL_triangulation_assertion( left->vertex(li) == right->vertex(ri)); + CGAL_assertion( left->vertex(li) == right->vertex(ri)); ll = left->neighbor(cw(li)); if(ll != Face_handle()) { @@ -1177,11 +1177,11 @@ void Triangulation_data_structure_2:: dim_down(Face_handle f, int i) { - CGAL_triangulation_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( dimension() == 2 ); - CGAL_triangulation_precondition( number_of_vertices() > 3 ); - CGAL_triangulation_precondition( degree( f->vertex(i) ) == - number_of_vertices()-1 ); + CGAL_expensive_precondition( is_valid() ); + CGAL_precondition( dimension() == 2 ); + CGAL_precondition( number_of_vertices() > 3 ); + CGAL_precondition( degree( f->vertex(i) ) == + number_of_vertices()-1 ); Vertex_handle v = f->vertex(i); std::list to_delete; @@ -1236,7 +1236,7 @@ remove_dim_down(Vertex_handle v) break; case 1: case 2: -// CGAL_triangulation_precondition ( +// CGAL_precondition ( // (dimension() == 1 && number_of_vertices() == 3) || // (dimension() == 2 && number_of_vertices() > 3) ); // the faces incident to v are down graded one dimension @@ -1282,12 +1282,12 @@ void Triangulation_data_structure_2:: remove_1D(Vertex_handle v) { - CGAL_triangulation_precondition( dimension() == 1 && - number_of_vertices() > 3); + CGAL_precondition( dimension() == 1 && + number_of_vertices() > 3); Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion( f->index(v) == 1); + CGAL_assertion( f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); set_adjacency(f, 0, g->neighbor(0), 1); @@ -1304,8 +1304,8 @@ inline void Triangulation_data_structure_2:: remove_second(Vertex_handle v) { - CGAL_triangulation_precondition(number_of_vertices()== 2 && - dimension() == 0); + CGAL_precondition(number_of_vertices()== 2 && + dimension() == 0); remove_dim_down(v); return; } @@ -1316,8 +1316,8 @@ inline void Triangulation_data_structure_2:: remove_first(Vertex_handle v) { - CGAL_triangulation_precondition(number_of_vertices()== 1 && - dimension() == -1); + CGAL_precondition(number_of_vertices()== 1 && + dimension() == -1); remove_dim_down(v); return; } @@ -1353,7 +1353,7 @@ make_hole(Vertex_handle v, List_edges& hole) // delete the faces incident to v and v // and return the dscription of the hole in hole { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::list to_delete; Face_handle f, fn; @@ -1506,9 +1506,9 @@ inline void Triangulation_data_structure_2:: set_adjacency(Face_handle f0, int i0, Face_handle f1, int i1) const { - CGAL_triangulation_assertion(i0 >= 0 && i0 <= dimension()); - CGAL_triangulation_assertion(i1 >= 0 && i1 <= dimension()); - CGAL_triangulation_assertion(f0 != f1); + CGAL_assertion(i0 >= 0 && i0 <= dimension()); + CGAL_assertion(i1 >= 0 && i1 <= dimension()); + CGAL_assertion(f0 != f1); f0->set_neighbor(i0,f1); f1->set_neighbor(i1,f0); } @@ -1518,10 +1518,10 @@ inline void Triangulation_data_structure_2:: delete_face(Face_handle f) { - CGAL_triangulation_expensive_precondition( dimension() != 2 || is_face(f)); - CGAL_triangulation_expensive_precondition( dimension() != 1 || is_edge(f,2)); - CGAL_triangulation_expensive_precondition( dimension() != 0 || - is_vertex(f->vertex(0)) ); + CGAL_expensive_precondition( dimension() != 2 || is_face(f)); + CGAL_expensive_precondition( dimension() != 1 || is_edge(f,2)); + CGAL_expensive_precondition( dimension() != 0 || + is_vertex(f->vertex(0)) ); faces().erase(f); } @@ -1530,7 +1530,7 @@ inline void Triangulation_data_structure_2:: delete_vertex(Vertex_handle v) { - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_vertex(v) ); vertices().erase(v); } @@ -1586,11 +1586,11 @@ split_vertex(Vertex_handle v, Face_handle f1, Face_handle g1) // */ - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( dimension() == 2 ); - CGAL_triangulation_precondition( f1 != Face_handle() && f1->has_vertex(v) ); - CGAL_triangulation_precondition( g1 != Face_handle() && g1->has_vertex(v) ); + CGAL_precondition( dimension() == 2 ); + CGAL_precondition( f1 != Face_handle() && f1->has_vertex(v) ); + CGAL_precondition( g1 != Face_handle() && g1->has_vertex(v) ); // 1. first we read some information that we will need int i1 = f1->index(v); @@ -1657,7 +1657,7 @@ split_vertex(Vertex_handle v, Face_handle f1, Face_handle g1) g1->set_neighbor( cw(j1), g ); g2->set_neighbor( ccw(j2), g ); - CGAL_triangulation_expensive_postcondition( is_valid() ); + CGAL_expensive_postcondition( is_valid() ); // 6. return the new stuff return Fourtuple(v1, v2, f, g); @@ -1668,9 +1668,9 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: join_vertices(Face_handle f, int i, Vertex_handle v) { - CGAL_triangulation_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( f != Face_handle() ); - CGAL_triangulation_precondition( i >= 0 && i <= 2 ); + CGAL_expensive_precondition( is_valid() ); + CGAL_precondition( f != Face_handle() ); + CGAL_precondition( i >= 0 && i <= 2 ); // this methods does the "join"-operation and preserves // the vertex v among the two vertices that define the edge (f, i) @@ -1678,7 +1678,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) Vertex_handle v1 = f->vertex( ccw(i) ); Vertex_handle v2 = f->vertex( cw(i) ); - CGAL_triangulation_precondition( v == v1 || v == v2 ); + CGAL_precondition( v == v1 || v == v2 ); if ( v == v2 ) { return join_vertices(f->neighbor(i), mirror_index(f,i), v); @@ -1686,7 +1686,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) size_type deg2 = degree(v2); - CGAL_triangulation_precondition( deg2 >= 3 ); + CGAL_precondition( deg2 >= 3 ); if ( deg2 == 3 ) { remove_degree_3(v2, f->neighbor(ccw(i))); @@ -1762,7 +1762,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) ++fc; } while ( fc != fc_start ); - CGAL_triangulation_assertion( + CGAL_assertion( static_cast(star_faces_of_v2.size()) == deg2 ); // from this point and on we modify the values @@ -1775,7 +1775,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) // contain v1 for (unsigned int k = 0; k < star_faces_of_v2.size(); k++) { int id = star_indices_of_v2[k]; - CGAL_triangulation_assertion( star_faces_of_v2[k]->vertex(id) == v2 ); + CGAL_assertion( star_faces_of_v2[k]->vertex(id) == v2 ); star_faces_of_v2[k]->set_vertex( id, v1 ); } @@ -1788,10 +1788,10 @@ join_vertices(Face_handle f, int i, Vertex_handle v) if ( v1->face() == f || v1->face() == g ) v1->set_face(tl); -#if ! defined(CGAL_TRIANGULATION_NO_ASSERTIONS) && ! defined(CGAL_NO_ASSERTIONS) +#if ! defined(CGAL_NO_ASSERTIONS) for (Face_iterator fit = faces_begin(); fit != faces_end(); ++fit) { int id; - CGAL_triangulation_assertion( !fit->has_vertex(v2, id) ); + CGAL_assertion( !fit->has_vertex(v2, id) ); } #endif @@ -1804,7 +1804,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) delete_vertex(v2); - CGAL_triangulation_expensive_postcondition( is_valid() ); + CGAL_expensive_postcondition( is_valid() ); return v1; } @@ -1912,7 +1912,7 @@ is_valid(bool verbose, int level) const bool result = (dimension()>= -1); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); //count and test the validity of the faces (for positive dimensions) Face_iterator ib = face_iterator_base_begin(); @@ -1922,25 +1922,25 @@ is_valid(bool verbose, int level) const count_stored_faces += 1; if (dimension()>= 0) { result = result && ib->is_valid(verbose,level); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } result = result && (count_stored_faces == number_of_full_dim_faces()); - CGAL_triangulation_assertion( + CGAL_assertion( count_stored_faces == number_of_full_dim_faces()); // vertex count size_type vertex_count = 0; for(Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit) { - CGAL_triangulation_assertion( vit->face() != Face_handle()); + CGAL_assertion( vit->face() != Face_handle()); result = result && vit->is_valid(verbose,level); - CGAL_triangulation_assertion( result ); + CGAL_assertion( result ); ++vertex_count; } result = result && (number_of_vertices() == vertex_count); - CGAL_triangulation_assertion( number_of_vertices() == vertex_count ); + CGAL_assertion( number_of_vertices() == vertex_count ); //edge count size_type edge_count = 0; @@ -1958,26 +1958,26 @@ is_valid(bool verbose, int level) const case -1: result = result && vertex_count == 1 && face_count == 0 && edge_count == 0; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; case 0: result = result && vertex_count == 2 && face_count == 0 && edge_count == 0; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; case 1: result = result && edge_count == vertex_count; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); result = result && face_count == 0; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; case 2: result = result && edge_count == 3*face_count/2 ; - CGAL_triangulation_assertion(edge_count == 3*face_count/2); + CGAL_assertion(edge_count == 3*face_count/2); break; default: result = false; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; } @@ -1992,7 +1992,7 @@ copy_tds(const TDS_src& tds_src, const ConvertFace& convert_face) { if (vert != typename TDS_src::Vertex_handle()) - CGAL_triangulation_precondition( tds_src.is_vertex(vert)); + CGAL_precondition( tds_src.is_vertex(vert)); clear(); set_dimension(tds_src.dimension()); @@ -2043,7 +2043,7 @@ copy_tds(const TDS_src& tds_src, // remove the post condition because it is false when copying the // TDS of a regular triangulation because of hidden vertices - // CGAL_triangulation_postcondition( is_valid() ); + // CGAL_postcondition( is_valid() ); return (vert == typename TDS_src::Vertex_handle()) ? Vertex_handle() : vmap[vert]; } diff --git a/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h b/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h index bf5aa71b9a2..3fa0d17af0a 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace CGAL { @@ -71,22 +71,22 @@ public: bool operator!=(const Face_handle &fh) const { return pos != fh; } bool is_empty() const; - bool operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; - bool operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; + bool operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const; + bool operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const; Face& operator*() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return *pos; } Face* operator->() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return &*pos; } @@ -152,22 +152,22 @@ public: { return pos->vertex(_ri) != vh; } bool is_empty() const; - bool operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; - bool operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; + bool operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const; + bool operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const; Vertex& operator*() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return *(pos->vertex(_ri)); } Vertex* operator->() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return &*(pos->vertex(_ri)); } @@ -231,8 +231,8 @@ public: bool operator==(const Edge_circulator &vc) const; bool operator!=(const Edge_circulator &vc) const; bool is_empty() const; - bool operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; - bool operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; + bool operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const; + bool operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const; Edge* operator->() const { edge.first=pos; @@ -259,7 +259,7 @@ Triangulation_ds_face_circulator_2(Vertex_handle v, Face_handle f) if (pos == Face_handle()|| pos->dimension() < 2) { _v = Vertex_handle() ; pos = Face_handle(); return;} - else CGAL_triangulation_precondition( pos->has_vertex(v)); + else CGAL_precondition( pos->has_vertex(v)); } @@ -268,8 +268,8 @@ Triangulation_ds_face_circulator_2& Triangulation_ds_face_circulator_2 :: operator++() { - CGAL_triangulation_precondition( pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition( pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); pos = pos->neighbor(ccw(i)); return *this; @@ -280,8 +280,8 @@ Triangulation_ds_face_circulator_2 Triangulation_ds_face_circulator_2 :: operator++(int) { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); Face_circulator tmp(*this); ++(*this); return tmp; @@ -292,8 +292,8 @@ Triangulation_ds_face_circulator_2& Triangulation_ds_face_circulator_2 :: operator--() { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); pos = pos->neighbor(cw(i)); return *this; @@ -304,8 +304,8 @@ Triangulation_ds_face_circulator_2 Triangulation_ds_face_circulator_2 :: operator--(int) { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); Face_circulator tmp(*this); --(*this); return tmp; @@ -338,18 +338,18 @@ return (_v == Vertex_handle() || pos == Face_handle() ); template < class Tds > inline bool Triangulation_ds_face_circulator_2 :: -operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle() ); } template < class Tds > inline bool Triangulation_ds_face_circulator_2 :: -operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return ! (*this == nullptr); } @@ -376,8 +376,8 @@ Triangulation_ds_vertex_circulator_2& Triangulation_ds_vertex_circulator_2 :: operator++() { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); if (pos->dimension() == 1) { @@ -408,7 +408,7 @@ Triangulation_ds_vertex_circulator_2& Triangulation_ds_vertex_circulator_2 :: operator--() { - CGAL_triangulation_precondition(pos != Face_handle() && + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); int i = pos->index(_v); @@ -462,18 +462,18 @@ is_empty() const template < class Tds > inline bool Triangulation_ds_vertex_circulator_2 :: -operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle()); } template < class Tds > inline bool Triangulation_ds_vertex_circulator_2 :: -operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return !(*this == nullptr); } @@ -499,7 +499,7 @@ Triangulation_ds_edge_circulator_2& Triangulation_ds_edge_circulator_2 :: operator++() { - CGAL_triangulation_precondition(pos != Face_handle() && + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); int i = pos->index(_v); if (pos->dimension() == 1) { @@ -530,8 +530,8 @@ Triangulation_ds_edge_circulator_2& Triangulation_ds_edge_circulator_2 :: operator--() { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); if (pos->dimension() == 1) { @@ -584,18 +584,18 @@ is_empty() const template < class Tds > inline bool Triangulation_ds_edge_circulator_2 :: -operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle()); } template < class Tds > inline bool Triangulation_ds_edge_circulator_2 :: -operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return !(*this == nullptr); } diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h index b9e660d9d03..bb4c448c669 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include @@ -129,7 +129,7 @@ typename Triangulation_ds_face_base_2::Vertex_handle Triangulation_ds_face_base_2:: vertex(int i) const { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); return V[i]; } @@ -169,7 +169,7 @@ index(Vertex_handle v) const { if (v == V[0]) return 0; if (v == V[1]) return 1; - CGAL_triangulation_assertion( v == V[2] ); + CGAL_assertion( v == V[2] ); return 2; } @@ -179,7 +179,7 @@ typename Triangulation_ds_face_base_2::Face_handle Triangulation_ds_face_base_2:: neighbor(int i) const { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); return N[i]; } @@ -221,7 +221,7 @@ index(Face_handle n) const { if (n == N[0]) return 0; if (n == N[1]) return 1; - CGAL_triangulation_assertion( n == N[2] ); + CGAL_assertion( n == N[2] ); return 2; } @@ -230,7 +230,7 @@ inline void Triangulation_ds_face_base_2 :: set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); V[i] = v; } @@ -239,8 +239,8 @@ inline void Triangulation_ds_face_base_2 :: set_neighbor(int i, Face_handle n) { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -275,9 +275,9 @@ inline void Triangulation_ds_face_base_2 :: set_neighbors(Face_handle n0,Face_handle n1, Face_handle n2) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; diff --git a/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h b/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h index caede3ef945..45c9c07ec23 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { @@ -109,7 +109,7 @@ void Triangulation_ds_edge_iterator_2:: increment() { - CGAL_triangulation_precondition(_tds->dimension() >= 1); + CGAL_precondition(_tds->dimension() >= 1); if (_tds->dimension() == 1) ++pos; else if (edge.second == 2) {edge.second = 0; ++pos;} else edge.second += 1; @@ -122,7 +122,7 @@ void Triangulation_ds_edge_iterator_2:: decrement() { - CGAL_triangulation_precondition(_tds->dimension() >= 1); + CGAL_precondition(_tds->dimension() >= 1); if (_tds->dimension() == 1) --pos; else if (edge.second == 0) { edge.second = 2; --pos;} else edge.second -= 1; @@ -145,7 +145,7 @@ Triangulation_ds_edge_iterator_2& Triangulation_ds_edge_iterator_2:: operator++() { - //CGAL_triangulation_precondition(pos != Iterator_base() && + //CGAL_precondition(pos != Iterator_base() && // pos != _tds->faces().end()); do increment(); while( pos != _tds->faces().end() && !associated_edge()); @@ -159,7 +159,7 @@ Triangulation_ds_edge_iterator_2& Triangulation_ds_edge_iterator_2:: operator--() { - // CGAL_triangulation_precondition(pos != Iterator_base() + // CGAL_precondition(pos != Iterator_base() // && *this != Edge_iterator(_tds)); do decrement(); while ( !associated_edge() && *this != Edge_iterator(_tds) ); diff --git a/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h b/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h index 4f2c6fee42e..ca17923ec49 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h @@ -17,7 +17,7 @@ #include -#include +#include namespace CGAL { @@ -105,13 +105,13 @@ Triangulation_ds_vertex_2 :: is_valid(bool verbose, int level) { bool result = Vb::is_valid(verbose, level); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); if (this->face() != Face_handle()) { // face==nullptr if dim <0 result = result && ( &*this->face()->vertex(0) == this || &*this->face()->vertex(1) == this || &*this->face()->vertex(2) == this ); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } diff --git a/TDS_2/include/CGAL/Triangulation_utils_2.h b/TDS_2/include/CGAL/Triangulation_utils_2.h index 2501c51858f..17f661eafea 100644 --- a/TDS_2/include/CGAL/Triangulation_utils_2.h +++ b/TDS_2/include/CGAL/Triangulation_utils_2.h @@ -18,7 +18,7 @@ #include -#include +#include namespace CGAL { template < class T = void > @@ -39,13 +39,13 @@ class Triangulation_cw_ccw_2 public: static int ccw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return ccw_map[i]; } static int cw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return cw_map[i]; } }; diff --git a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h index e39b14907bb..3568d783b53 100644 --- a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h +++ b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h @@ -15,7 +15,7 @@ #include -#include +#include #include #include @@ -45,43 +45,43 @@ public: Triangulation_ds_cell_circulator_3(Cell_handle c, int s, int t) : _s(c->vertex(s)), _t(c->vertex(t)), pos(c) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 ); } Triangulation_ds_cell_circulator_3(const Edge & e) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)), pos(e.first) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >=0 && e.second < 4 && - e.third >=0 && e.third < 4); + CGAL_precondition( e.first != Cell_handle() && + e.second >=0 && e.second < 4 && + e.third >=0 && e.third < 4); } Triangulation_ds_cell_circulator_3(Cell_handle c, int s, int t, Cell_handle start) : _s(c->vertex(s)), _t(c->vertex(t)), pos(start) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); } Triangulation_ds_cell_circulator_3(const Edge & e, Cell_handle start) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)), pos(start) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >=0 && e.second < 4 && - e.third >=0 && e.third < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( e.first != Cell_handle() && + e.second >=0 && e.second < 4 && + e.third >=0 && e.third < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); } Cell_circulator & operator++() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); //then dimension() cannot be < 3 pos = pos->neighbor(next_around_edge(pos->index(_s), pos->index(_t))); @@ -97,7 +97,7 @@ public: Cell_circulator & operator--() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); pos = pos->neighbor(next_around_edge(pos->index(_t), pos->index(_s))); return *this; @@ -140,9 +140,9 @@ public: return ch != pos; } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const + bool operator==(std::nullptr_t CGAL_assertion_code(n)) const { - CGAL_triangulation_assertion( n == nullptr); + CGAL_assertion( n == nullptr); return pos == Cell_handle(); } @@ -207,34 +207,34 @@ public: Triangulation_ds_facet_circulator_3(Cell_handle c, int s, int t) : _s(c->vertex(s)), _t(c->vertex(t)), pos(c) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 ); } Triangulation_ds_facet_circulator_3(const Edge & e) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)), pos(e.first) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >= 0 && e.second < 4 && - e.third >= 0 && e.third < 4); + CGAL_precondition( e.first != Cell_handle() && + e.second >= 0 && e.second < 4 && + e.third >= 0 && e.third < 4); } Triangulation_ds_facet_circulator_3(Cell_handle c, int s, int t, Cell_handle start, int f) : _s(c->vertex(s)), _t(c->vertex(t)) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 && - f >= 0 && f < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 && + f >= 0 && f < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); int i = start->index( _s ); int j = start->index( _t ); - CGAL_triangulation_precondition( f!=i && f!=j ); + CGAL_precondition( f!=i && f!=j ); if ( f == next_around_edge(i,j) ) pos = start; @@ -246,16 +246,16 @@ public: const Facet & start) : _s(c->vertex(s)), _t(c->vertex(t)) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 && - start.first->has_vertex( _s ) && - start.first->has_vertex( _t ) ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 && + start.first->has_vertex( _s ) && + start.first->has_vertex( _t ) ); int i = start.first->index( _s ); int j = start.first->index( _t ); - CGAL_triangulation_precondition( start.second !=i && start.second !=j ); + CGAL_precondition( start.second !=i && start.second !=j ); if ( start.second == next_around_edge(i,j) ) pos = start.first; @@ -266,17 +266,17 @@ public: Triangulation_ds_facet_circulator_3(const Edge & e, Cell_handle start, int f) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >= 0 && e.second < 4 && - e.third >= 0 && e.third < 4 && - f >= 0 && f < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( e.first != Cell_handle() && + e.second >= 0 && e.second < 4 && + e.third >= 0 && e.third < 4 && + f >= 0 && f < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); int i = start->index( _s ); int j = start->index( _t ); - CGAL_triangulation_precondition( f!=i && f!=j ); + CGAL_precondition( f!=i && f!=j ); if ( f == next_around_edge(i,j) ) pos = start; @@ -287,11 +287,11 @@ public: Triangulation_ds_facet_circulator_3(const Edge & e, const Facet & start) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >= 0 && e.second < 4 && - e.third >= 0 && e.third < 4 && - start.first->has_vertex( _s ) && - start.first->has_vertex( _t ) ); + CGAL_precondition( e.first != Cell_handle() && + e.second >= 0 && e.second < 4 && + e.third >= 0 && e.third < 4 && + start.first->has_vertex( _s ) && + start.first->has_vertex( _t ) ); int i = start.first->index( _s ); int j = start.first->index( _t ); @@ -304,7 +304,7 @@ public: Facet_circulator & operator++() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); //then dimension() cannot be < 3 pos = pos->neighbor( next_around_edge( pos->index(_s), pos->index(_t) ) ); @@ -320,7 +320,7 @@ public: Facet_circulator & operator--() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); pos = pos->neighbor( next_around_edge( pos->index(_t), pos->index(_s) ) ); return *this; @@ -359,9 +359,9 @@ public: return ! (*this == ccir); } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(c)) const + bool operator==(std::nullptr_t CGAL_assertion_code(c)) const { - CGAL_triangulation_assertion(c == nullptr); + CGAL_assertion(c == nullptr); return pos == Cell_handle(); } @@ -410,7 +410,7 @@ public: Face_circulator & operator++() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); //then dimension() cannot be < 3 pos = pos->neighbor(ccw(pos->index(_s))); @@ -426,7 +426,7 @@ public: Face_circulator & operator--() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); pos = pos->neighbor(cw(pos->index(_s))); return *this; @@ -459,9 +459,9 @@ public: return ! (*this == ccir); } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(c)) const + bool operator==(std::nullptr_t CGAL_assertion_code(c)) const { - CGAL_triangulation_assertion(c == nullptr); + CGAL_assertion(c == nullptr); return pos == Cell_handle(); } diff --git a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h index 885172184d0..459b166447e 100644 --- a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h +++ b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h @@ -17,7 +17,6 @@ #include -#include #include namespace CGAL { namespace internal { diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index 89e237cc0d4..8f2df91c48a 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -338,14 +338,14 @@ public: Cell_handle create_face() { - CGAL_triangulation_precondition(dimension()<3); + CGAL_precondition(dimension()<3); return create_cell(); } Cell_handle create_face(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2) { - CGAL_triangulation_precondition(dimension()<3); + CGAL_precondition(dimension()<3); return cells().emplace(v0, v1, v2, Vertex_handle()); } @@ -354,7 +354,7 @@ public: Cell_handle f1, int i1, Cell_handle f2, int i2) { - CGAL_triangulation_precondition(dimension() <= 2); + CGAL_precondition(dimension() <= 2); Cell_handle newf = create_face(f0->vertex(cw(i0)), f1->vertex(cw(i1)), f2->vertex(cw(i2))); @@ -367,7 +367,7 @@ public: Cell_handle create_face(Cell_handle f0, int i0, Cell_handle f1, int i1) { - CGAL_triangulation_precondition(dimension() <= 2); + CGAL_precondition(dimension() <= 2); Cell_handle newf = create_face(f0->vertex(cw(i0)), f1->vertex(cw(i1)), f1->vertex(ccw(i1))); @@ -378,7 +378,7 @@ public: Cell_handle create_face(Cell_handle f, int i, Vertex_handle v) { - CGAL_triangulation_precondition(dimension() <= 2); + CGAL_precondition(dimension() <= 2); Cell_handle newf = create_face(f->vertex(cw(i)), f->vertex(ccw(i)), v); @@ -397,13 +397,13 @@ public: void delete_vertex( Vertex_handle v ) { - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_vertex(v) ); vertices().erase(v); } void delete_cell( Cell_handle c ) { - CGAL_triangulation_expensive_precondition( is_simplex(c) ); + CGAL_expensive_precondition( is_simplex(c) ); cells().erase(c); } @@ -504,7 +504,7 @@ public: Cell_handle begin, int i, Vertex_handle newv) { - CGAL_triangulation_precondition(begin != Cell_handle()); + CGAL_precondition(begin != Cell_handle()); // if begin == nullptr (default arg), we could compute one by walking in // CellIt. At the moment, the functionality is not available, you have // to specify a starting facet. @@ -639,7 +639,7 @@ public: // Change orientation of the whole TDS. void reorient() { - CGAL_triangulation_precondition(dimension() >= 1); + CGAL_precondition(dimension() >= 1); for (Cell_iterator i = cells().begin(); i != cells().end(); ++i) change_orientation(i); @@ -728,66 +728,66 @@ public: // cells around an edge Cell_circulator incident_cells(const Edge & e) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(e); } Cell_circulator incident_cells(Cell_handle ce, int i, int j) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(ce, i, j); } Cell_circulator incident_cells(const Edge &e, Cell_handle start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(e, start); } Cell_circulator incident_cells(Cell_handle ce, int i, int j, Cell_handle start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(ce, i, j, start); } //facets around an edge Facet_circulator incident_facets(const Edge & e) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(e); } Facet_circulator incident_facets(Cell_handle ce, int i, int j) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(ce, i, j); } Facet_circulator incident_facets(const Edge & e, const Facet & start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(e, start); } Facet_circulator incident_facets(Cell_handle ce, int i, int j, const Facet & start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(ce, i, j, start); } Facet_circulator incident_facets(const Edge & e, Cell_handle start, int f) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(e, start, f); } Facet_circulator incident_facets(Cell_handle ce, int i, int j, Cell_handle start, int f) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(ce, i, j, start, f); } // 2D : circulates on the faces adjacent to a vertex. Face_circulator incident_faces(Vertex_handle v) const { - CGAL_triangulation_precondition( dimension() == 2 ); + CGAL_precondition( dimension() == 2 ); return Face_circulator(v, v->cell()); } @@ -800,7 +800,7 @@ private: std::pair it) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); std::stack cell_stack; cell_stack.push(d); @@ -861,7 +861,7 @@ private: void just_incident_cells_3(Vertex_handle v, std::vector& cells) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); Cell_handle d = v->cell(); cells.push_back(d); @@ -890,7 +890,7 @@ private: incident_cells_2(Vertex_handle v, Cell_handle, OutputIterator cells) const { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); Face_circulator fc = incident_faces(v); Face_circulator done(fc); @@ -1166,7 +1166,7 @@ public: OutputIterator incident_facets(Vertex_handle v, OutputIterator facets, Filter f = Filter()) const { - CGAL_triangulation_precondition( dimension() > 1 ); + CGAL_precondition( dimension() > 1 ); if(dimension() == 3) return visit_incident_cells, OutputIterator>(v, facets, f); else @@ -1184,7 +1184,7 @@ public: OutputIterator incident_facets_threadsafe(Vertex_handle v, OutputIterator facets, Filter f = Filter()) const { - CGAL_triangulation_precondition( dimension() > 1 ); + CGAL_precondition( dimension() > 1 ); if(dimension() == 3) return visit_incident_cells_threadsafe, OutputIterator>(v, facets, f); else @@ -1203,7 +1203,7 @@ public: incident_edges_1d(Vertex_handle v, OutputIterator edges, Filter f = Filter()) const { CGAL_assertion (dimension() == 1); - CGAL_triangulation_assertion( number_of_vertices() >= 3); + CGAL_assertion( number_of_vertices() >= 3); Cell_handle n0 = v->cell(); const int index_v_in_n0 = n0->index(v); CGAL_assume(index_v_in_n0 <= 1); @@ -1221,10 +1221,10 @@ public: OutputIterator incident_edges(Vertex_handle v, OutputIterator edges, Filter f = Filter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() >= 1 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() >= 1 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); if (dimension() == 1) { return incident_edges_1d(v, edges, f); @@ -1240,10 +1240,10 @@ public: incident_edges_threadsafe(Vertex_handle v, OutputIterator edges, Filter f = Filter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() >= 1 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() >= 1 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); if (dimension() == 1) { return incident_edges_1d(v, edges, f); @@ -1273,10 +1273,10 @@ public: OutputIterator adjacent_vertices(Vertex_handle v, OutputIterator vertices, Filter f = Filter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() >= -1 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() >= -1 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); if (dimension() == -1) return vertices; @@ -1288,7 +1288,7 @@ public: } if (dimension() == 1) { - CGAL_triangulation_assertion( number_of_vertices() >= 3); + CGAL_assertion( number_of_vertices() >= 3); Cell_handle n0 = v->cell(); const int index_v_in_n0 = n0->index(v); CGAL_assume(index_v_in_n0 <= 1); @@ -1335,10 +1335,10 @@ public: adjacent_vertices_threadsafe(Vertex_handle v, OutputIterator vertices, Filter f = Filter()) const { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(dimension() >= -1); - CGAL_triangulation_expensive_precondition(is_vertex(v)); - CGAL_triangulation_expensive_precondition(is_valid()); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(dimension() >= -1); + CGAL_expensive_precondition(is_vertex(v)); + CGAL_expensive_precondition(is_valid()); if (dimension() == -1) return vertices; @@ -1350,7 +1350,7 @@ public: } if (dimension() == 1) { - CGAL_triangulation_assertion(number_of_vertices() >= 3); + CGAL_assertion(number_of_vertices() >= 3); Cell_handle n0 = v->cell(); const int index_v_in_n0 = n0->index(v); CGAL_assume(index_v_in_n0 <= 1); @@ -1373,8 +1373,8 @@ public: OutputIterator visit_incident_cells(Vertex_handle v, OutputIterator output, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1405,8 +1405,8 @@ public: visit_incident_cells_threadsafe( Vertex_handle v, OutputIterator output, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1437,8 +1437,8 @@ public: visit_incident_cells(Vertex_handle v, OutputIterator output, std::vector &cells, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1465,8 +1465,8 @@ public: OutputIterator visit_just_incident_cells(Vertex_handle v, OutputIterator output, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1499,10 +1499,10 @@ public: std::vector &cells, VertexFilter f = VertexFilter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() == 3 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() == 3 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); return visit_incident_cells @@ -1554,16 +1554,16 @@ public: void set_adjacency(Cell_handle c0, int i0, Cell_handle c1, int i1) const { - CGAL_triangulation_assertion(i0 >= 0 && i0 <= dimension()); - CGAL_triangulation_assertion(i1 >= 0 && i1 <= dimension()); - CGAL_triangulation_assertion(c0 != c1); + CGAL_assertion(i0 >= 0 && i0 <= dimension()); + CGAL_assertion(i1 >= 0 && i1 <= dimension()); + CGAL_assertion(c0 != c1); c0->set_neighbor(i0,c1); c1->set_neighbor(i1,c0); } int mirror_index(Cell_handle c, int i) const { - CGAL_triangulation_precondition ( i>=0 && i<4 ); + CGAL_precondition ( i>=0 && i<4 ); return c->neighbor(i)->index(c); } @@ -1656,7 +1656,7 @@ public: convert_cell(c, *C[j]); } - CGAL_triangulation_assertion(is_valid(false)); + CGAL_assertion(is_valid(false)); return is; } @@ -1698,9 +1698,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) { - CGAL_triangulation_precondition( dimension() == 3); - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( dimension() == 3); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); Cell_handle cnew = create_cell(c->vertex(0), c->vertex(1), @@ -1724,7 +1724,7 @@ create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) Cell_handle n = cur->neighbor(zz); // turn around the oriented edge vj1 vj2 while ( n->tds_data().is_in_conflict() ) { - CGAL_triangulation_assertion( n != c ); + CGAL_assertion( n != c ); cur = n; zz = next_around_edge(n->index(vj1), n->index(vj2)); n = cur->neighbor(zz); @@ -1756,9 +1756,9 @@ recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2, int depth) { if ( depth == 100 ) return non_recursive_create_star_3(v,c,li,prev_ind2); - CGAL_triangulation_precondition( dimension() == 3); - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( dimension() == 3); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); Cell_handle cnew = create_cell(c->vertex(0), c->vertex(1), @@ -1782,7 +1782,7 @@ recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, Cell_handle n = cur->neighbor(zz); // turn around the oriented edge vj1 vj2 while ( n->tds_data().is_in_conflict() ) { - CGAL_triangulation_assertion( n != c ); + CGAL_assertion( n != c ); cur = n; zz = next_around_edge(n->index(vj1), n->index(vj2)); n = cur->neighbor(zz); @@ -1814,9 +1814,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) { - CGAL_triangulation_precondition( dimension() == 3); - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( dimension() == 3); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); Cell_handle cnew = create_cell(c->vertex(0), c->vertex(1), @@ -1843,7 +1843,7 @@ non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind Cell_handle n = cur->neighbor(zz); // turn around the oriented edge vj1 vj2 while ( n->tds_data().is_in_conflict() ) { - CGAL_triangulation_assertion( n != c ); + CGAL_assertion( n != c ); cur = n; zz = next_around_edge(n->index(vj1), n->index(vj2)); n = cur->neighbor(zz); @@ -1863,8 +1863,8 @@ non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind adjacency_info_stack.push( iAdjacency_info(zzz,cnew,ii,c,li,prev_ind2) ); c=nnn; li=zz; prev_ind2=zzz; ii=0; //copy-pasted from beginning to avoid if ii==0 - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); cnew = create_cell(c->vertex(0),c->vertex(1),c->vertex(2),c->vertex(3)); cnew->set_vertex(li, v); c_li = c->neighbor(li); @@ -1891,7 +1891,7 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: create_star_2(Vertex_handle v, Cell_handle c, int li ) { - CGAL_triangulation_assertion( dimension() == 2 ); + CGAL_assertion( dimension() == 2 ); Cell_handle cnew; // i1 i2 such that v,i1,i2 positive @@ -1980,7 +1980,7 @@ operator>>(std::istream& is, Triangulation_data_structure_3& tds) std::size_t m; tds.read_cells(is, V, m, C); - CGAL_triangulation_assertion( tds.is_valid() ); + CGAL_assertion( tds.is_valid() ); return is; } @@ -2022,7 +2022,7 @@ operator<<(std::ostream& os, const Triangulation_data_structure_3 &tds for (Vertex_iterator it=tds.vertices_begin(); it != tds.vertices_end(); ++it) V[it] = i++; - CGAL_triangulation_assertion( i == n ); + CGAL_assertion( i == n ); tds.print_cells(os, V); @@ -2059,7 +2059,7 @@ is_edge(Vertex_handle u, Vertex_handle v, Cell_handle &c, int &i, int &j) const // returns false when dimension <1 or when indices wrong { - CGAL_triangulation_expensive_precondition( is_vertex(u) && is_vertex(v) ); + CGAL_expensive_precondition( is_vertex(u) && is_vertex(v) ); if (u==v) return false; @@ -2113,7 +2113,7 @@ is_facet(Vertex_handle u, Vertex_handle v, Cell_handle & c, int & i, int & j, int & k) const // returns false when dimension <2 or when indices wrong { - CGAL_triangulation_expensive_precondition( is_vertex(u) && + CGAL_expensive_precondition( is_vertex(u) && is_vertex(v) && is_vertex(w) ); @@ -2141,7 +2141,7 @@ bool Triangulation_data_structure_3:: is_facet(Cell_handle c, int i) const { - CGAL_triangulation_precondition(i>=0 && i<4); + CGAL_precondition(i>=0 && i<4); if ( dimension() < 2 ) return false; @@ -2172,7 +2172,7 @@ is_cell(Vertex_handle u, Vertex_handle v, Cell_handle & c, int & i, int & j, int & k, int & l) const // returns false when dimension <3 { - CGAL_triangulation_expensive_precondition( is_vertex(u) && + CGAL_expensive_precondition( is_vertex(u) && is_vertex(v) && is_vertex(w) && is_vertex(t) ); @@ -2217,7 +2217,7 @@ has_vertex(Cell_handle c, int i, Vertex_handle v, int & j) const // facet (c,i) // j has no meaning if false is returned { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return ( c->has_vertex(v,j) && (j != i) ); } @@ -2228,7 +2228,7 @@ Triangulation_data_structure_3:: has_vertex(Cell_handle c, int i, Vertex_handle v) const // checks whether the query facet (c,i) has vertex v { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); int j; return ( c->has_vertex(v,j) && (j != i) ); } @@ -2264,7 +2264,7 @@ are_equal(Cell_handle c, int i, Cell_handle n, int j) const // if ( c->neighbor(i) != n ) return false; // if ( n->neighbor(j) != c ) return false; { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); if ( (c==n) && (i==j) ) return true; @@ -2300,9 +2300,9 @@ flip( Cell_handle c, int i ) // flips facet i of cell c // c will be replaced by one of the new cells { - CGAL_triangulation_precondition( (dimension() == 3) && (0<=i) && (i<4) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); Cell_handle n = c->neighbor(i); int in = n->index(c); @@ -2323,16 +2323,16 @@ flip_flippable(Cell_handle c, int i ) // flips facet i of cell c // c will be replaced by one of the new cells { - CGAL_triangulation_precondition( (dimension() == 3) && (0<=i) && (i<4) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); Cell_handle n = c->neighbor(i); int in = n->index(c); // checks that the facet is flippable, // ie the future edge does not already exist - CGAL_triangulation_expensive_precondition( !is_edge(c->vertex(i), + CGAL_expensive_precondition( !is_edge(c->vertex(i), n->vertex(in))); flip_really(c,i,n,in); } @@ -2374,7 +2374,7 @@ flip_really( Cell_handle c, int i, Cell_handle n, int in ) c->vertex(i2)->set_cell(c); n->vertex(in3)->set_cell(n); // to be implemented : 2d case - // CGAL_triangulation_precondition( (0<=i) && (i<3) ); + // CGAL_precondition( (0<=i) && (i<3) ); } template @@ -2386,12 +2386,12 @@ flip( Cell_handle c, int i, int j ) // flips edge i,j of cell c // c will be deleted { - CGAL_triangulation_precondition( (dimension() == 3) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (0<=j) && (j<4) && ( i != j ) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); // checks that the edge is flippable ie degree 3 int degree = 0; @@ -2436,24 +2436,24 @@ flip_flippable( Cell_handle c, int i, int j ) // flips edge i,j of cell c // c will be deleted { - CGAL_triangulation_precondition( (dimension() == 3) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (0<=j) && (j<4) && ( i != j ) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); // checks that the edge is flippable ie degree 3 - CGAL_triangulation_precondition_code( int degree = 0; ); - CGAL_triangulation_precondition_code + CGAL_precondition_code( int degree = 0; ); + CGAL_precondition_code ( Cell_circulator ccir = incident_cells(c,i,j); ); - CGAL_triangulation_precondition_code( Cell_circulator cdone = ccir; ); - CGAL_triangulation_precondition_code( do { + CGAL_precondition_code( Cell_circulator cdone = ccir; ); + CGAL_precondition_code( do { ++degree; ++ccir; } while ( ccir != cdone ); ); - CGAL_triangulation_precondition( degree == 3 ); + CGAL_precondition( degree == 3 ); int next = next_around_edge(i,j); Cell_handle c1 = c->neighbor( next ); @@ -2472,8 +2472,8 @@ flip_flippable( Cell_handle c, int i, int j ) // checks that the edge is flippable, // is the future cells do not already exist - CGAL_triangulation_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(i)) ); - CGAL_triangulation_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(j)) ); + CGAL_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(i)) ); + CGAL_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(j)) ); flip_really(c,i,j,c1,v1,i1,j1,next1,c2,v2,i2,j2,next2,v3); } @@ -2559,7 +2559,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, { m = 2; C.resize(m); - // CGAL_triangulation_assertion( n == 2 ); + // CGAL_assertion( n == 2 ); for (int i=0; i < 2; i++) { Cell_handle c = create_face(V[i], Vertex_handle(), Vertex_handle()); C[i] = c; @@ -2575,7 +2575,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, { m = 1; C.resize(m); - // CGAL_triangulation_assertion( n == 1 ); + // CGAL_assertion( n == 1 ); Cell_handle c = create_face(V[0], Vertex_handle(), Vertex_handle()); C[0] = c; V[0]->set_cell(c); @@ -2617,7 +2617,7 @@ print_cells(std::ostream& os, const Unique_hash_map write(os, V[it->vertex(j)]); } } - CGAL_triangulation_assertion( i == m ); + CGAL_assertion( i == m ); // write the neighbors for(it = cells_begin(); it != cells_end(); ++it) { @@ -2660,7 +2660,7 @@ print_cells(std::ostream& os, const Unique_hash_map } } } - CGAL_triangulation_assertion( i == m ); + CGAL_assertion( i == m ); // write the neighbors for(it = facets_begin(); it != facets_end(); ++it) { @@ -2703,7 +2703,7 @@ print_cells(std::ostream& os, const Unique_hash_map } } } - CGAL_triangulation_assertion( i == m ); + CGAL_assertion( i == m ); // write the neighbors for(it = edges_begin(); it != edges_end(); ++it) { @@ -2732,7 +2732,7 @@ Triangulation_data_structure_3::insert_first_finite_cell( Vertex_handle &v0, Vertex_handle &v1, Vertex_handle &v2, Vertex_handle &v3, Vertex_handle v_infinite) { - CGAL_triangulation_precondition( + CGAL_precondition( (v_infinite == Vertex_handle() && dimension() == -2) || (v_infinite != Vertex_handle() && dimension() == -1)); @@ -2778,9 +2778,9 @@ typename Triangulation_data_structure_3::Vertex_handle Triangulation_data_structure_3:: insert_in_cell(Cell_handle c) { - CGAL_triangulation_precondition( dimension() == 3 ); - CGAL_triangulation_precondition( c != Cell_handle() ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_precondition( dimension() == 3 ); + CGAL_precondition( c != Cell_handle() ); + CGAL_expensive_precondition( is_cell(c) ); Vertex_handle v = create_vertex(); @@ -2824,8 +2824,8 @@ Triangulation_data_structure_3:: insert_in_facet(Cell_handle c, int i) { // inserts v in the facet opposite to vertex i of cell c - CGAL_triangulation_precondition( c != Cell_handle() ); - CGAL_triangulation_precondition( dimension() >= 2 ); + CGAL_precondition( c != Cell_handle() ); + CGAL_precondition( dimension() >= 2 ); Vertex_handle v = create_vertex(); @@ -2833,8 +2833,8 @@ insert_in_facet(Cell_handle c, int i) case 3: { - CGAL_triangulation_expensive_precondition( is_cell(c) ); - CGAL_triangulation_precondition( i == 0 || i == 1 || + CGAL_expensive_precondition( is_cell(c) ); + CGAL_precondition( i == 0 || i == 1 || i == 2 || i == 3 ); // c will be modified to have v replacing vertex(i+3) int i1,i2,i3; @@ -2905,7 +2905,7 @@ insert_in_facet(Cell_handle c, int i) } case 2: { - CGAL_triangulation_expensive_precondition( is_facet(c,i) ); + CGAL_expensive_precondition( is_facet(c,i) ); Cell_handle n = c->neighbor(2); Cell_handle cnew = create_face(c->vertex(0),c->vertex(1),v); set_adjacency(cnew, 2, n, n->index(c)); @@ -2933,15 +2933,15 @@ Triangulation_data_structure_3:: insert_in_edge(Cell_handle c, int i, int j) // inserts a vertex in the edge of cell c with vertices i and j { - CGAL_triangulation_precondition( c != Cell_handle() ); - CGAL_triangulation_precondition( i != j ); - CGAL_triangulation_precondition( dimension() >= 1 ); + CGAL_precondition( c != Cell_handle() ); + CGAL_precondition( i != j ); + CGAL_precondition( dimension() >= 1 ); switch ( dimension() ) { case 3: { - CGAL_triangulation_expensive_precondition( is_cell(c) ); - CGAL_triangulation_precondition( i>=0 && i<=3 && j>=0 && j<=3 ); + CGAL_expensive_precondition( is_cell(c) ); + CGAL_precondition( i>=0 && i<=3 && j>=0 && j<=3 ); std::vector cells; cells.reserve(32); @@ -2957,7 +2957,7 @@ insert_in_edge(Cell_handle c, int i, int j) } case 2: { - CGAL_triangulation_expensive_precondition( is_edge(c,i,j) ); + CGAL_expensive_precondition( is_edge(c,i,j) ); Vertex_handle v = create_vertex(); int k=3-i-j; // index of the third vertex of the facet @@ -2996,7 +2996,7 @@ insert_in_edge(Cell_handle c, int i, int j) default: // case 1: { Vertex_handle v = create_vertex(); - CGAL_triangulation_expensive_precondition( is_edge(c,i,j) ); + CGAL_expensive_precondition( is_edge(c,i,j) ); Cell_handle cnew = create_face(v, c->vertex(1), Vertex_handle()); c->vertex(1)->set_cell(cnew); c->set_vertex(1,v); @@ -3019,15 +3019,15 @@ insert_increase_dimension(Vertex_handle star) // = nullptr only used to insert the 1st vertex (dimension -2 to dimension -1) // changes the dimension { - CGAL_triangulation_precondition( dimension() < 3); + CGAL_precondition( dimension() < 3); Vertex_handle v = create_vertex(); int dim = dimension(); if (dim != -2) { - CGAL_triangulation_precondition( star != Vertex_handle() ); + CGAL_precondition( star != Vertex_handle() ); // In this case, this precondition is not relatively expensive. - CGAL_triangulation_precondition( is_vertex(star) ); + CGAL_precondition( is_vertex(star) ); } // this is set now, so that it becomes allowed to reorient @@ -3188,13 +3188,13 @@ void Triangulation_data_structure_3:: remove_decrease_dimension(Vertex_handle v, Vertex_handle w) { - CGAL_triangulation_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( dimension() >= -1 ); - CGAL_triangulation_precondition( dimension() != 1 || + CGAL_expensive_precondition( is_valid() ); + CGAL_precondition( dimension() >= -1 ); + CGAL_precondition( dimension() != 1 || number_of_vertices() == 3); - CGAL_triangulation_precondition( number_of_vertices() > + CGAL_precondition( number_of_vertices() > (size_type) dimension() + 1 ); - CGAL_triangulation_precondition( degree(v) == number_of_vertices()-1 ); + CGAL_precondition( degree(v) == number_of_vertices()-1 ); if (dimension() <= 0) { delete_cell(v->cell()); @@ -3235,7 +3235,7 @@ remove_decrease_dimension(Vertex_handle v, Vertex_handle w) } delete_vertex(v); set_dimension(dimension()-1); - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } template @@ -3243,9 +3243,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_from_maximal_dimension_simplex(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() >= 1); - CGAL_triangulation_precondition(degree(v) == (size_type) dimension() + 1); - CGAL_triangulation_precondition(number_of_vertices() > + CGAL_precondition(dimension() >= 1); + CGAL_precondition(degree(v) == (size_type) dimension() + 1); + CGAL_precondition(number_of_vertices() > (size_type) dimension() + 1); if (number_of_vertices() == (size_type) dimension() + 2) { @@ -3267,9 +3267,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_degree_2(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() == 1); - CGAL_triangulation_precondition(degree(v) == 2); - CGAL_triangulation_precondition(number_of_vertices() >= 4); + CGAL_precondition(dimension() == 1); + CGAL_precondition(degree(v) == 2); + CGAL_precondition(number_of_vertices() >= 4); // Cells to be killed. Cell_handle c0, c1; @@ -3306,9 +3306,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_degree_3(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() == 2); - CGAL_triangulation_precondition(degree(v) == 3); - CGAL_triangulation_precondition(number_of_vertices() >= 5); + CGAL_precondition(dimension() == 2); + CGAL_precondition(degree(v) == 3); + CGAL_precondition(number_of_vertices() >= 5); // Cells to be killed. Cell_handle c0, c1, c2; @@ -3350,9 +3350,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_degree_4(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition(degree(v) == 4); - CGAL_triangulation_precondition(number_of_vertices() >= 6); + CGAL_precondition(dimension() == 3); + CGAL_precondition(degree(v) == 4); + CGAL_precondition(number_of_vertices() >= 6); // Cells to be killed. Cell_handle c0, c1, c2, c3; @@ -3400,11 +3400,11 @@ void Triangulation_data_structure_3:: decrease_dimension(Cell_handle c, int i) { - CGAL_triangulation_expensive_precondition( is_valid() );; - CGAL_triangulation_precondition( dimension() >= 2); - CGAL_triangulation_precondition( number_of_vertices() > + CGAL_expensive_precondition( is_valid() );; + CGAL_precondition( dimension() >= 2); + CGAL_precondition( number_of_vertices() > (size_type) dimension() + 1 ); - CGAL_triangulation_precondition( degree(c->vertex(i)) == number_of_vertices()-1 ); + CGAL_precondition( degree(c->vertex(i)) == number_of_vertices()-1 ); Vertex_handle v = c->vertex(i); Vertex_handle w = c->vertex(i); @@ -3530,7 +3530,7 @@ decrease_dimension(Cell_handle c, int i) v1->set_cell(c2); } - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } @@ -3556,7 +3556,7 @@ is_valid(bool verbose, int level ) const if(number_of_vertices() <= 4) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3566,7 +3566,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3584,7 +3584,7 @@ is_valid(bool verbose, int level ) const if ( cell_count - facet_count + edge_count - vertex_count != 0 ) { if (verbose) std::cerr << "Euler relation unsatisfied" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3596,7 +3596,7 @@ is_valid(bool verbose, int level ) const if(number_of_vertices() <= 3) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3607,7 +3607,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "false number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3619,7 +3619,7 @@ is_valid(bool verbose, int level ) const if (verbose) std::cerr << "Euler relation unsatisfied - edges/vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3631,7 +3631,7 @@ is_valid(bool verbose, int level ) const if (verbose) std::cerr << "Euler relation unsatisfied - facets/vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3642,7 +3642,7 @@ is_valid(bool verbose, int level ) const if(number_of_vertices() <= 1) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3652,7 +3652,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "false number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } size_type edge_count; @@ -3662,7 +3662,7 @@ is_valid(bool verbose, int level ) const if ( edge_count != vertex_count ) { if (verbose) std::cerr << "false number of edges" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3672,7 +3672,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() < 2 ) { if (verbose) std::cerr << "fewer than 2 vertices but dimension 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } CGAL_FALLTHROUGH; @@ -3682,7 +3682,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() < 1 ) { if (verbose) std::cerr << "no vertex but dimension -1" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } // vertex count @@ -3692,7 +3692,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "false number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3712,7 +3712,7 @@ is_valid(Vertex_handle v, bool verbose, int level) const if ( ! result ) { if ( verbose ) std::cerr << "invalid vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } return result; } @@ -3732,14 +3732,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( c->vertex(0) == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); if ( c->vertex(1) != Vertex_handle() || c->vertex(2) != Vertex_handle()) { if (verbose) std::cerr << "vertex 1 or 2 != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->neighbor(0) != Cell_handle() || @@ -3747,7 +3747,7 @@ is_valid(Cell_handle c, bool verbose, int level) const c->neighbor(2) != Cell_handle()) { if (verbose) std::cerr << "one neighbor != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3758,35 +3758,35 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( c->vertex(0) == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); if ( c->neighbor (0) == Cell_handle() ) { if (verbose) std::cerr << "neighbor 0 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->vertex(1) != Vertex_handle() || c->vertex(2) != Vertex_handle() ) { if (verbose) std::cerr << "vertex 1 or 2 != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->neighbor(1) != Cell_handle() || c->neighbor(2) != Cell_handle() ) { if (verbose) std::cerr << "neighbor 1 or 2 != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! c->neighbor(0)->has_vertex(c->vertex(0)) ) { if (verbose) std::cerr << "neighbor 0 does not have vertex 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3802,7 +3802,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( v0 == Vertex_handle() || v1 == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0 or 1 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); @@ -3810,7 +3810,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( n0 == Cell_handle() || n1 == Cell_handle() ) { if (verbose) std::cerr << "neighbor 0 or 1 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3818,14 +3818,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << "neighbor 1 does not have vertex 0 as vertex 1" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( v1 != n0->vertex(0) ) { if (verbose) std::cerr << "neighbor 0 does not have vertex 1 as vertex 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3833,14 +3833,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << "neighbor 0 does not have this as neighbor 1" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( n1->neighbor(0) != c ) { if (verbose) std::cerr << "neighbor 1 does not have this as neighbor 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3854,7 +3854,7 @@ is_valid(Cell_handle c, bool verbose, int level) const c->vertex(2) == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0, 1, or 2 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); @@ -3867,14 +3867,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( n == Cell_handle() ) { if (verbose) std::cerr << "neighbor " << i << " nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! n->has_vertex(c->vertex(cw(i)),in ) ) { if (verbose) std::cerr << "vertex " << cw(i) << " not vertex of neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } in = cw(in); @@ -3883,7 +3883,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << "neighbor " << i << " does not have this as neighbor " << in << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->vertex(ccw(i)) != n->vertex(cw(in)) ) { @@ -3891,7 +3891,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << "vertex " << ccw(i) << " is not vertex " << cw(in) << " of neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3905,7 +3905,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( c->vertex(i) == Vertex_handle() ) { if (verbose) std::cerr << "vertex " << i << " nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(i),verbose,level); @@ -3916,7 +3916,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( n == Cell_handle() ) { if (verbose) std::cerr << "neighbor " << i << " nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3929,7 +3929,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (in == 5) { if (verbose) std::cerr << "neighbor of c has not c as neighbor" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3938,28 +3938,28 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) { std::cerr << "vertex " << ((i+1)&3) << " not vertex of neighbor " << i << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! n->has_vertex(c->vertex((i+2)&3),j2n) ) { if (verbose) { std::cerr << "vertex " << ((i+2)&3) << " not vertex of neighbor " << i << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! n->has_vertex(c->vertex((i+3)&3),j3n) ) { if (verbose) { std::cerr << "vertex " << ((i+3)&3) << " not vertex of neighbor " << i << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( in+j1n+j2n+j3n != 6) { if (verbose) { std::cerr << "sum of the indices != 6 " << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3970,7 +3970,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3979,7 +3979,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3988,7 +3988,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3999,7 +3999,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -4008,7 +4008,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -4017,7 +4017,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -4037,7 +4037,7 @@ copy_tds(const TDS_src& tds, const ConvertVertex& convert_vertex, const ConvertCell& convert_cell) { - CGAL_triangulation_expensive_precondition( vert == Vertex_handle() + CGAL_expensive_precondition( vert == Vertex_handle() || tds.is_vertex(vert) ); clear(); @@ -4086,7 +4086,7 @@ copy_tds(const TDS_src& tds, F[cit2]->set_neighbor(j, F[cit2->neighbor(j)] ); } - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); return (vert != typename TDS_src::Vertex_handle()) ? V[vert] : Vertex_handle(); } @@ -4149,7 +4149,7 @@ void Triangulation_data_structure_3:: swap(Tds & tds) { - CGAL_triangulation_expensive_precondition(tds.is_valid() && is_valid()); + CGAL_expensive_precondition(tds.is_valid() && is_valid()); std::swap(_dimension, tds._dimension); cells().swap(tds.cells()); @@ -4178,7 +4178,7 @@ count_vertices(size_type & i, bool verbose, int level) const if ( ! is_valid(it,verbose,level) ) { if (verbose) std::cerr << "invalid vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; @@ -4198,7 +4198,7 @@ count_facets(size_type & i, bool verbose, int level) const if ( ! is_valid((*it).first,verbose, level) ) { if (verbose) std::cerr << "invalid facet" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; @@ -4218,7 +4218,7 @@ count_edges(size_type & i, bool verbose, int level) const if ( ! is_valid((*it).first,verbose, level) ) { if (verbose) std::cerr << "invalid edge" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; @@ -4238,7 +4238,7 @@ count_cells(size_type & i, bool verbose, int level) const if ( ! is_valid(it,verbose, level) ) { if (verbose) std::cerr << "invalid cell" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; diff --git a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h index 27ebcb68950..852ceefb8cb 100644 --- a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h +++ b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h @@ -19,7 +19,7 @@ #include -#include +#include #include namespace CGAL { @@ -66,7 +66,7 @@ public: Vertex_handle vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); CGAL_assume( i >= 0 && i <= 3 ); return V[i]; } @@ -90,13 +90,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } Cell_handle neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -119,7 +119,7 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } @@ -127,14 +127,14 @@ public: void set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); V[i] = v; } void set_neighbor(int i, Cell_handle n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i >= 0 && i <= 3); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -160,10 +160,10 @@ public: void set_neighbors(Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); - CGAL_triangulation_precondition( this != n3.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); + CGAL_precondition( this != n3.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; diff --git a/TDS_3/include/CGAL/Triangulation_utils_3.h b/TDS_3/include/CGAL/Triangulation_utils_3.h index 8b99c725a65..2f6646a2087 100644 --- a/TDS_3/include/CGAL/Triangulation_utils_3.h +++ b/TDS_3/include/CGAL/Triangulation_utils_3.h @@ -16,7 +16,7 @@ #include -#include +#include namespace CGAL { @@ -63,13 +63,13 @@ struct Triangulation_utils_3 { static int ccw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return ccw_map[i]; } static int cw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return cw_map[i]; } @@ -77,9 +77,9 @@ struct Triangulation_utils_3 { // index of the next cell when turning around the // oriented edge vertex(i) vertex(j) in 3d - CGAL_triangulation_precondition( ( i >= 0 && i < 4 ) && - ( j >= 0 && j < 4 ) && - ( i != j ) ); + CGAL_precondition( ( i >= 0 && i < 4 ) && + ( j >= 0 && j < 4 ) && + ( i != j ) ); return tab_next_around_edge[i][j]; } @@ -88,8 +88,8 @@ struct Triangulation_utils_3 { // indexes of the jth vertex of the facet of a cell // opposite to vertx i - CGAL_triangulation_precondition( ( i >= 0 && i < 4 ) && - ( j >= 0 && j < 3 ) ); + CGAL_precondition( ( i >= 0 && i < 4 ) && + ( j >= 0 && j < 3 ) ); return tab_vertex_triple_index[i][j]; } diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index 9d294ac7ec2..56a07c13fa8 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -163,7 +163,7 @@ public: : Ctr(gt) { insert_constraints(lc.begin(), lc.end()); - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } template @@ -173,7 +173,7 @@ public: : Ctr(gt) { insert_constraints(it, last); - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } virtual ~Constrained_Delaunay_triangulation_2() {} @@ -448,7 +448,7 @@ public: OutputItFaces fit, OutputItBoundaryEdges eit, Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition( dimension() == 2); + CGAL_precondition( dimension() == 2); int li; Locate_type lt; Face_handle fh = locate(p,lt,li, start); @@ -467,7 +467,7 @@ public: pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return std::make_pair(fit,eit); } @@ -702,7 +702,7 @@ flip (Face_handle& f, int i) // The following precondition prevents the test suit // of triangulation to work on constrained Delaunay triangulation - //CGAL_triangulation_precondition(is_flipable(f,i)); + //CGAL_precondition(is_flipable(f,i)); this->_tds.flip(f, i); // restore constraint status @@ -945,9 +945,9 @@ remove(Vertex_handle v) // remove a vertex and updates the constrained edges of the new faces // precondition : there is no incident constraints { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( ! is_infinite(v)); - CGAL_triangulation_precondition( ! are_there_incident_constraints(v)); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( ! is_infinite(v)); + CGAL_precondition( ! are_there_incident_constraints(v)); if (dimension() <= 1) Ctr::remove(v); else remove_2D(v); return; @@ -1016,13 +1016,13 @@ Constrained_Delaunay_triangulation_2:: is_valid(bool verbose, int level) const { bool result = Ctr::is_valid(verbose, level); - CGAL_triangulation_assertion( result ); + CGAL_assertion( result ); Finite_faces_iterator fit= finite_faces_begin(); for (; fit != finite_faces_end(); fit++) { for(int i=0;i<3;i++) { result = result && !is_flipable(fit,i, false); - CGAL_triangulation_assertion( result ); + CGAL_assertion( result ); } } return result; diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 37637b2909f..11531498530 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -204,7 +204,7 @@ public: for( ;lcit != lc.end(); lcit++) { insert( (*lcit).first, (*lcit).second); } - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } template @@ -216,7 +216,7 @@ public: for ( ; it != last; it++) { insert_constraint((*it).first, (*it).second); } - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } //TODO Is that destructor correct ? @@ -335,7 +335,7 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb, OutputIterator out) // if a vertex vc of t lies on segment ab // of if ab intersect some constrained edges { - CGAL_triangulation_precondition( vaa != vbb); + CGAL_precondition( vaa != vbb); Vertex_handle vi; Face_handle fr; @@ -810,7 +810,7 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) while(! stack.empty()){ boost::tie(vaa,vbb) = stack.top(); stack.pop(); - CGAL_triangulation_precondition( vaa != vbb); + CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level << "CT_2::insert_constraint, stack pop=( #" << vaa->time_stamp() << "= " << vaa->point() @@ -1073,9 +1073,9 @@ intersect(Face_handle f, int i, const Point& pc = f->vertex(cw(i))->point(); const Point& pd = f->vertex(ccw(i))->point(); Point pi; - CGAL_triangulation_assertion_code( bool ok = ) + CGAL_assertion_code( bool ok = ) intersection(geom_traits(), pa, pb, pc, pd, pi, itag ); - CGAL_triangulation_assertion(ok); + CGAL_assertion(ok); Vertex_handle vi = virtual_insert(pi, Triangulation::EDGE, f, i); return vi; } @@ -1308,7 +1308,7 @@ update_constraints_incident(Vertex_handle va, //dimension() ==2 int cwi, ccwi, indf; Face_circulator fc=incident_faces(va), done(fc); - CGAL_triangulation_assertion(fc != nullptr); + CGAL_assertion(fc != nullptr); do { indf = fc->index(va); cwi=cw(indf); @@ -1356,7 +1356,7 @@ update_constraints_opposite(Vertex_handle va) // update status of edges opposite to a // after insertion of a { - CGAL_triangulation_assertion(dimension()==2); + CGAL_assertion(dimension()==2); Face_handle f=va->face(), start=f; int indf; do { @@ -1463,9 +1463,9 @@ remove(Vertex_handle v) // remove a vertex and updates the constrained edges of the new faces // precondition : there is no incident constraints { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( ! is_infinite(v)); - CGAL_triangulation_precondition( ! are_there_incident_constraints(v)); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( ! is_infinite(v)); + CGAL_precondition( ! are_there_incident_constraints(v)); if (number_of_vertices() == 1) remove_first(v); else if (number_of_vertices() == 2) remove_second(v); diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h index 382d408abfb..941de300ded 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include namespace CGAL { @@ -109,7 +109,7 @@ inline void Constrained_triangulation_face_base_2:: set_constraint(int i, bool b) { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); C[i] = b; } diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 5a88fdc9efa..50ca1f4bfec 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -232,7 +232,7 @@ public: , hierarchy(Vh_less_xy(this)) { insert_constraints(first, last); - CGAL_triangulation_postcondition( this->is_valid() ); + CGAL_postcondition( this->is_valid() ); } @@ -242,7 +242,7 @@ public: , hierarchy(Vh_less_xy(this)) { insert_constraints(constraints.begin(), constraints.end()); - CGAL_triangulation_postcondition( this->is_valid() ); + CGAL_postcondition( this->is_valid() ); } //Helping void clear() { Base::clear(); hierarchy.clear(); } @@ -898,7 +898,7 @@ insert_subconstraint(Vertex_handle vaa, while(! stack.empty()){ boost::tie(vaa,vbb) = stack.top(); stack.pop(); - CGAL_triangulation_precondition( vaa != vbb); + CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level << "CT_plus_2::insert_subconstraint, stack pop=( #" << vaa->time_stamp() << "= " << vaa->point() @@ -1055,7 +1055,7 @@ copy_triangulation(const Constrained_triangulation_plus_2 &ctp) Vertex_iterator vit = ctp.vertices_begin(); Vertex_iterator vvit = this->vertices_begin(); for( ; vit != ctp.vertices_end(); ++vit, ++vvit) { - CGAL_triangulation_assertion(vit->point() == vvit->point()); + CGAL_assertion(vit->point() == vvit->point()); vmap[vit] = vvit; } hierarchy.copy(ctp.hierarchy, vmap); @@ -1167,12 +1167,12 @@ intersect(Face_handle f, int i, Vertex_handle vcc, vdd; vcc = f->vertex(cw(i)); vdd = f->vertex(ccw(i)); - CGAL_triangulation_assertion_code( bool b1 = ) + CGAL_assertion_code( bool b1 = ) hierarchy.enclosing_constraint(vcc,vdd,vc,vd); - CGAL_triangulation_assertion_code( bool b2 = ) + CGAL_assertion_code( bool b2 = ) hierarchy.enclosing_constraint(vaa,vbb,va,vb); - CGAL_triangulation_assertion(b1); - CGAL_triangulation_assertion(b2); + CGAL_assertion(b1); + CGAL_assertion(b2); const Point& pa = va->point(); const Point& pb = vb->point(); @@ -1189,9 +1189,9 @@ intersect(Face_handle f, int i, Point pi(ORIGIN); // initialize although we are sure that it will be // set by the intersection, but to quiet a warning Intersection_tag itag = Intersection_tag(); - CGAL_triangulation_assertion_code( bool ok = ) + CGAL_assertion_code( bool ok = ) intersection(geom_traits(), pa, pb, pc, pd, pi, itag ); - CGAL_triangulation_assertion(ok); + CGAL_assertion(ok); Vertex_handle vi = insert(pi, Triangulation::EDGE, f, i); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS diff --git a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h index 134027f99c0..f730bb08efc 100644 --- a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h @@ -88,7 +88,7 @@ public: Delaunay_triangulation_2( const Delaunay_triangulation_2 &tr) : Triangulation_2(tr) - { CGAL_triangulation_postcondition(is_valid()); } + { CGAL_postcondition(is_valid()); } Delaunay_triangulation_2(Delaunay_triangulation_2&&) = default; Delaunay_triangulation_2& operator=(const Delaunay_triangulation_2&) = default; @@ -404,7 +404,7 @@ public: OutputItBoundaryEdges eit, Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition(this->dimension() == 2); + CGAL_precondition(this->dimension() == 2); int li; Locate_type lt; Face_handle fh = this->locate(p,lt,li, start); @@ -422,7 +422,7 @@ public: pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return std::make_pair(fit,eit); } @@ -674,7 +674,7 @@ is_valid(bool verbose, int level) const result = result && ON_POSITIVE_SIDE != side_of_oriented_circle(it, this->mirror_vertex(it,i)->point(), false); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } return result; @@ -705,7 +705,7 @@ typename Delaunay_triangulation_2::Vertex_handle Delaunay_triangulation_2:: nearest_vertex_2D(const Point& p, Face_handle f) const { - CGAL_triangulation_precondition(this->dimension() == 2); + CGAL_precondition(this->dimension() == 2); f = this->locate(p,f); typename Geom_traits::Compare_distance_2 @@ -775,8 +775,8 @@ typename Delaunay_triangulation_2::Point Delaunay_triangulation_2:: dual(Face_handle f) const { - CGAL_triangulation_precondition(this->_tds.is_face(f)); - CGAL_triangulation_precondition(this->dimension()==2); + CGAL_precondition(this->_tds.is_face(f)); + CGAL_precondition(this->dimension()==2); return circumcenter(f); } @@ -785,12 +785,12 @@ Object Delaunay_triangulation_2:: dual(const Edge &e) const { - CGAL_triangulation_precondition(this->_tds.is_edge(e.first,e.second)); + CGAL_precondition(this->_tds.is_edge(e.first,e.second)); typedef typename Geom_traits::Line_2 Line; typedef typename Geom_traits::Ray_2 Ray; - CGAL_triangulation_precondition (!this->is_infinite(e)); + CGAL_precondition (!this->is_infinite(e)); if(this->dimension()== 1) { const Point& p = (e.first)->vertex(cw(e.second))->point(); const Point& q = (e.first)->vertex(ccw(e.second))->point(); @@ -1031,8 +1031,8 @@ void Delaunay_triangulation_2:: remove_and_give_new_faces(Vertex_handle v, OutputItFaces fit) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!this->is_infinite(v)); if(this->number_of_vertices() == 1) this->remove_first(v); else if(this->number_of_vertices() == 2) this->remove_second(v); @@ -1071,8 +1071,8 @@ remove(Vertex_handle v) { int d; - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!this->is_infinite(v)); if(this->dimension() <= 1) { Triangulation::remove(v); return; } @@ -2119,7 +2119,7 @@ typename Delaunay_triangulation_2::Vertex_handle Delaunay_triangulation_2:: move_if_no_collision(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; const int dim = this->dimension(); @@ -2167,7 +2167,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f = v->face(); int i = f->index(v); if(i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2177,7 +2177,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if(i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -2249,7 +2249,7 @@ typename Delaunay_triangulation_2::Vertex_handle Delaunay_triangulation_2:: move(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; Vertex_handle w = move_if_no_collision(v,p); if(w != v) { @@ -2264,9 +2264,9 @@ bool Delaunay_triangulation_2:: is_delaunay_after_displacement(Vertex_handle v, const Point &p) const { - CGAL_triangulation_precondition(!this->is_infinite(v)); - CGAL_triangulation_precondition(this->dimension() == 2); - CGAL_triangulation_precondition(!this->test_dim_down(v)); + CGAL_precondition(!this->is_infinite(v)); + CGAL_precondition(this->dimension() == 2); + CGAL_precondition(!this->test_dim_down(v)); if(v->point() == p) return true; Point ant = v->point(); v->set_point(p); @@ -2320,7 +2320,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, const Point &p, OutputItFaces oif) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; const int dim = this->dimension(); @@ -2374,7 +2374,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f = v->face(); int i = f->index(v); if(i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2385,7 +2385,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if(i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index fe4b02f7f41..145b387263f 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -563,7 +564,7 @@ public: Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); int li; Locate_type lt; Face_handle fh = locate(p,lt,li, start); @@ -640,7 +641,7 @@ public: } return make_triple(fit, eit, vit); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return make_triple(fit, eit, vit); } @@ -771,7 +772,7 @@ copy_triangulation_() for(; hvit != hidden_vertices_end() ; ++hvit){ hvit->face()->vertex_list().push_back(hvit); } - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } template < class Gt, class Tds > @@ -838,7 +839,7 @@ power_test(const Face_handle& f, int i, const Weighted_point &p) const // p is supposed to be on edge(f,i) // return ON_NEGATIVE_SIDE if p is above(f,i) // (p has to be hidden) - CGAL_triangulation_precondition(!is_infinite(f,i) && + CGAL_precondition(!is_infinite(f,i) && orientation(f->vertex(ccw(i))->point(), f->vertex(cw(i))->point(), p) == COLLINEAR); @@ -857,7 +858,7 @@ power_test(const Weighted_point &p0, const Weighted_point &p, bool perturb) const { - CGAL_triangulation_precondition(orientation(p0, p1, p2) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p2) == POSITIVE); using namespace boost; @@ -887,7 +888,7 @@ power_test(const Weighted_point &p0, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -920,7 +921,7 @@ is_valid_face(Face_handle fh) const bool result = true; if(is_infinite(fh)) result = result && fh->vertex_list().empty(); if(!result) { show_face(fh);} - CGAL_triangulation_assertion(result); + CGAL_assertion(result); typename Vertex_list::iterator vlit = fh->vertex_list().begin(), vldone = fh->vertex_list().end(); @@ -928,7 +929,7 @@ is_valid_face(Face_handle fh) const result = result && power_test(fh,(*vlit)->point()) == ON_NEGATIVE_SIDE; result = result &&((*vlit)->face() == fh); if(!result) show_face(fh); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; } @@ -978,7 +979,7 @@ is_valid_vertex(Vertex_handle vh) const // show_face(vh->face()); // } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } @@ -1022,7 +1023,7 @@ is_valid(bool verbose, int /* level */) const it2->point(), it3->point()); result = result && s == COLLINEAR ; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); ++it1 ; ++it2; ++it3; } } @@ -1030,18 +1031,18 @@ is_valid(bool verbose, int /* level */) const case 2 : for(Finite_faces_iterator it=finite_faces_begin(); it!=finite_faces_end(); it++) { - CGAL_triangulation_assertion(! is_infinite(it)); + CGAL_assertion(! is_infinite(it)); Orientation s = orientation(it->vertex(0)->point(), it->vertex(1)->point(), it->vertex(2)->point()); - CGAL_triangulation_assertion(s == LEFT_TURN); + CGAL_assertion(s == LEFT_TURN); result = result && (s == LEFT_TURN); for(int i = 0 ; i < 3 ; i++) { if(!is_infinite(it->vertex(i))) result = result && ON_POSITIVE_SIDE != power_test(it->neighbor(i), it->vertex(i)->point()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } @@ -1053,7 +1054,7 @@ is_valid(bool verbose, int /* level */) const Orientation s = orientation(pc->point(), qc->point(), rc->point()); - CGAL_triangulation_assertion(s != LEFT_TURN); + CGAL_assertion(s != LEFT_TURN); result = result && (s != LEFT_TURN); ++pc ; ++qc ; ++rc; } while(pc != start); @@ -1063,7 +1064,7 @@ is_valid(bool verbose, int /* level */) const result = result && (number_of_faces() == 2*(number_of_vertices()+1) - 4 - degree(infinite_vertex())); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; } @@ -1075,7 +1076,7 @@ is_valid(bool verbose, int /* level */) const } result = result && (Base::number_of_vertices() == number_of_vertices() + number_of_hidden_vertices()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } @@ -1167,7 +1168,7 @@ typename Regular_triangulation_2::Bare_point Regular_triangulation_2:: weighted_circumcenter(Face_handle f) const { - CGAL_triangulation_precondition(dimension() == 2 || !is_infinite(f)); + CGAL_precondition(dimension() == 2 || !is_infinite(f)); return weighted_circumcenter(f->vertex(0)->point(), f->vertex(1)->point(), f->vertex(2)->point()); @@ -1194,7 +1195,7 @@ dual(const Edge &e) const typedef typename Geom_traits::Ray_2 Ray; typedef typename Geom_traits::Segment_2 Segment; - CGAL_triangulation_precondition(! is_infinite(e)); + CGAL_precondition(! is_infinite(e)); if(dimension() == 1){ const Weighted_point& p = (e.first)->vertex(cw(e.second))->point(); const Weighted_point& q = (e.first)->vertex(ccw(e.second))->point(); @@ -1354,7 +1355,7 @@ typename Regular_triangulation_2::Vertex_handle Regular_triangulation_2:: reinsert(Vertex_handle v, Face_handle start) { - CGAL_triangulation_assertion(v->is_hidden()); + CGAL_assertion(v->is_hidden()); v->set_hidden(false); _hidden_vertices--; @@ -1385,8 +1386,8 @@ void Regular_triangulation_2:: exchange_hidden(Vertex_handle va, Vertex_handle vb) { - CGAL_triangulation_assertion(vb->is_hidden()); - CGAL_triangulation_assertion(vb == vb->face()->vertex_list().back()); + CGAL_assertion(vb->is_hidden()); + CGAL_assertion(vb == vb->face()->vertex_list().back()); // //to debug // std::cerr << "from exchange hidden 1" << std::endl; @@ -1411,7 +1412,7 @@ void Regular_triangulation_2:: exchange_incidences(Vertex_handle va, Vertex_handle vb) { - CGAL_triangulation_assertion(!vb->is_hidden()); + CGAL_assertion(!vb->is_hidden()); std::list faces; if(dimension() == 0) { faces.push_back(vb->face()); @@ -1421,7 +1422,7 @@ exchange_incidences(Vertex_handle va, Vertex_handle vb) faces.push_back(vb->face()->neighbor(1-i)); } else { - CGAL_triangulation_assertion(dimension() == 2); + CGAL_assertion(dimension() == 2); Face_circulator fc = incident_faces(vb), done(fc); do { faces.push_back(fc); @@ -1486,7 +1487,7 @@ void Regular_triangulation_2:: regularize(Vertex_handle v) { - CGAL_triangulation_precondition(v != infinite_vertex()); + CGAL_precondition(v != infinite_vertex()); Faces_around_stack faces_around; if(dimension() < 1) return; @@ -1553,8 +1554,8 @@ void Regular_triangulation_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); if(v->is_hidden()) return remove_hidden(v); @@ -1821,7 +1822,7 @@ void Regular_triangulation_2:: update_hidden_points_2_2(const Face_handle& f1, const Face_handle& f2) { - CGAL_triangulation_assertion(f1->has_neighbor(f2)); + CGAL_assertion(f1->has_neighbor(f2)); Vertex_list p_list; p_list.splice(p_list.begin(), f1->vertex_list()); @@ -1862,7 +1863,7 @@ update_hidden_points_2_2(const Face_handle& f1, const Face_handle& f2) int idx2 = f1->index(f2); Vertex_handle v0=f1->vertex(ccw(idx2)); Vertex_handle v1=f1->vertex(cw(idx2)); - CGAL_triangulation_assertion(!is_infinite(v0) && !is_infinite(v1)); + CGAL_assertion(!is_infinite(v0) && !is_infinite(v1)); while(! p_list.empty()) { @@ -1883,7 +1884,7 @@ Regular_triangulation_2:: update_hidden_points_1_3(const Face_handle& f1, const Face_handle& f2, const Face_handle& f3) { - CGAL_triangulation_assertion(f1->has_neighbor(f2) && + CGAL_assertion(f1->has_neighbor(f2) && f2->has_neighbor(f3) && f3->has_neighbor(f1)); @@ -1903,9 +1904,9 @@ update_hidden_points_1_3(const Face_handle& f1, const Face_handle& f2, v0 = f1->vertex(3-(idx2+idx3)), v1 = f2->vertex(f2->index(f1)); - CGAL_triangulation_assertion(f2->has_vertex(v0) && f1->has_vertex(v0)); - CGAL_triangulation_assertion(f3->has_vertex(v1)); - CGAL_triangulation_assertion(! is_infinite(v0)); + CGAL_assertion(f2->has_vertex(v0) && f1->has_vertex(v0)); + CGAL_assertion(f3->has_vertex(v1)); + CGAL_assertion(! is_infinite(v0)); // if two of f1, f2,and f3 are infinite // the list goes entirely to the third finite face @@ -2216,7 +2217,7 @@ typename Regular_triangulation_2::Vertex_handle Regular_triangulation_2:: finite_vertex() const { - CGAL_triangulation_precondition(number_of_vertices() >= 1); + CGAL_precondition(number_of_vertices() >= 1); return(finite_vertices_begin()); } diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h index 4e0447c39c3..db27f39b00d 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 9c20817b5d6..5b5725f86de 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -737,7 +737,7 @@ bool well_oriented(Vertex_handle v) const } bool from_convex_hull(Vertex_handle v) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); Vertex_circulator vc = incident_vertices(v), done(vc); do { if(is_infinite(vc)) return true; } while(++vc != done); return false; @@ -864,7 +864,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: finite_vertex() const { - CGAL_triangulation_precondition (number_of_vertices() >= 1); + CGAL_precondition (number_of_vertices() >= 1); return (finite_vertices_begin()); } @@ -911,7 +911,7 @@ is_valid(bool verbose, int level) const << point(it3) << " are not collinear" << std::endl; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); ++it1 ; ++it2; ++it3; } } @@ -919,7 +919,7 @@ is_valid(bool verbose, int level) const { for(Finite_faces_iterator it=finite_faces_begin(); it!=finite_faces_end(); it++) { - CGAL_triangulation_assertion( ! is_infinite(it)); + CGAL_assertion( ! is_infinite(it)); Orientation s = orientation(point(it, 0), point(it, 1), point(it, 2)); result = result && ( s == LEFT_TURN ); @@ -930,7 +930,7 @@ is_valid(bool verbose, int level) const << point(it, 2) << " form a badly oriented face" << std::endl; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } Vertex_circulator start = incident_vertices(infinite_vertex()); @@ -940,7 +940,7 @@ is_valid(bool verbose, int level) const do { Orientation s = orientation(point(pc), point(qc), point(rc)); - CGAL_triangulation_assertion( s != LEFT_TURN ); + CGAL_assertion( s != LEFT_TURN ); result = result && ( s != LEFT_TURN ); if(verbose && (s == LEFT_TURN)) @@ -966,7 +966,7 @@ is_valid(bool verbose, int level) const << " and degree(infinite_vertex()) = " << degree(infinite_vertex()) << std::endl; } - CGAL_triangulation_assertion( result); + CGAL_assertion( result); } return result; } @@ -1108,9 +1108,9 @@ const typename Triangulation_2::Point& Triangulation_2:: point(Face_handle f, int i) const { - CGAL_triangulation_precondition( dimension() >= 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= dimension() ); - CGAL_triangulation_precondition( ! is_infinite(f->vertex(i)) ); + CGAL_precondition( dimension() >= 0 ); + CGAL_precondition( i >= 0 && i <= dimension() ); + CGAL_precondition( ! is_infinite(f->vertex(i)) ); return f->vertex(i)->point(); } @@ -1119,8 +1119,8 @@ const typename Triangulation_2::Point& Triangulation_2:: point(Vertex_handle v) const { - CGAL_triangulation_precondition( dimension() >= 0 ); - CGAL_triangulation_precondition( ! is_infinite(v) ); + CGAL_precondition( dimension() >= 0 ); + CGAL_precondition( ! is_infinite(v) ); return v->point(); } @@ -1129,7 +1129,7 @@ typename Triangulation_2::Segment Triangulation_2:: segment(Face_handle f, int i) const { - CGAL_triangulation_precondition( ! is_infinite(f,i)); + CGAL_precondition( ! is_infinite(f,i)); typename Gt::Construct_segment_2 construct_segment = geom_traits().construct_segment_2_object(); return construct_segment(construct_point(f->vertex(ccw(i))->point()), @@ -1141,7 +1141,7 @@ typename Triangulation_2::Segment Triangulation_2:: segment(const Edge& e) const { - CGAL_triangulation_precondition(! is_infinite(e)); + CGAL_precondition(! is_infinite(e)); typename Gt::Construct_segment_2 construct_segment = geom_traits().construct_segment_2_object(); return construct_segment(construct_point(e.first->vertex(ccw(e.second))->point()), @@ -1177,7 +1177,7 @@ typename Triangulation_2::Triangle Triangulation_2:: triangle(Face_handle f) const { - CGAL_triangulation_precondition( ! is_infinite(f) ); + CGAL_precondition( ! is_infinite(f) ); typename Gt::Construct_triangle_2 construct_triangle = geom_traits().construct_triangle_2_object(); return construct_triangle(construct_point(f->vertex(0)->point()), @@ -1190,13 +1190,13 @@ void Triangulation_2:: flip(Face_handle f, int i) { - CGAL_triangulation_precondition ( f != Face_handle() ); - CGAL_triangulation_precondition (i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( dimension()==2); + CGAL_precondition ( f != Face_handle() ); + CGAL_precondition (i == 0 || i == 1 || i == 2); + CGAL_precondition( dimension()==2); - CGAL_triangulation_precondition( !is_infinite(f) && + CGAL_precondition( !is_infinite(f) && !is_infinite(f->neighbor(i)) ); - CGAL_triangulation_precondition( + CGAL_precondition( orientation(f->vertex(i)->point(), f->vertex(cw(i))->point(), mirror_vertex(f,i)->point()) == RIGHT_TURN && @@ -1212,7 +1212,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_first(const Point& p) { - CGAL_triangulation_precondition(number_of_vertices() == 0); + CGAL_precondition(number_of_vertices() == 0); Vertex_handle v = _tds.insert_second(); v->set_point(p); return v; @@ -1223,7 +1223,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_second(const Point& p) { - CGAL_triangulation_precondition(number_of_vertices() == 1); + CGAL_precondition(number_of_vertices() == 1); Vertex_handle v = _tds.insert_dim_up(infinite_vertex(), true); v->set_point(p); return v; @@ -1234,7 +1234,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_in_edge(const Point& p, Face_handle f,int i) { - CGAL_triangulation_exactness_precondition( + CGAL_exactness_precondition( orientation(f->vertex(cw(i))->point(), p, f->vertex(ccw(i))->point()) == COLLINEAR && collinear_between(f->vertex(cw(i))->point(), p, @@ -1249,7 +1249,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_in_face(const Point& p, Face_handle f) { - CGAL_triangulation_precondition(oriented_side(f,p) == ON_POSITIVE_SIDE); + CGAL_precondition(oriented_side(f,p) == ON_POSITIVE_SIDE); Vertex_handle v= _tds.insert_in_face(f); v->set_point(p); return v; @@ -1260,7 +1260,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_convex_hull(const Point& p, Face_handle f) { - CGAL_triangulation_precondition(is_infinite(f) && dimension() >= 1); + CGAL_precondition(is_infinite(f) && dimension() >= 1); Vertex_handle v; if (dimension() == 1) v=insert_outside_convex_hull_1(p, f); @@ -1276,8 +1276,8 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_convex_hull_1(const Point& p, Face_handle f) { - CGAL_triangulation_precondition( is_infinite(f) && dimension()==1); - CGAL_triangulation_precondition( + CGAL_precondition( is_infinite(f) && dimension()==1); + CGAL_precondition( orientation(mirror_vertex(f, f->index(infinite_vertex()))->point(), f->vertex(1- f->index(infinite_vertex()))->point(), p) == COLLINEAR && @@ -1294,11 +1294,11 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_convex_hull_2(const Point& p, Face_handle f) { - CGAL_triangulation_precondition(is_infinite(f)); + CGAL_precondition(is_infinite(f)); int li = f->index(infinite_vertex()); - CGAL_triangulation_precondition( + CGAL_precondition( orientation(p, f->vertex(ccw(li))->point(), f->vertex(cw(li))->point()) == LEFT_TURN); @@ -1359,14 +1359,14 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_affine_hull(const Point& p) { - CGAL_triangulation_precondition(dimension() < 2); + CGAL_precondition(dimension() < 2); bool conform = false; if (dimension() == 1) { Face_handle f = (*finite_edges_begin()).first; Orientation orient = orientation( f->vertex(0)->point(), f->vertex(1)->point(), p); - CGAL_triangulation_precondition(orient != COLLINEAR); + CGAL_precondition(orient != COLLINEAR); conform = ( orient == COUNTERCLOCKWISE); } Vertex_handle v = _tds.insert_dim_up( infinite_vertex(), conform); @@ -1412,7 +1412,7 @@ insert(const Point& p, Locate_type lt, Face_handle loc, int li) case VERTEX: return loc->vertex(li); } - CGAL_triangulation_assertion(false); // locate step failed + CGAL_assertion(false); // locate step failed return Vertex_handle(); } @@ -1459,8 +1459,8 @@ void Triangulation_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition( v != Vertex_handle()); - CGAL_triangulation_precondition( !is_infinite(v)); + CGAL_precondition( v != Vertex_handle()); + CGAL_precondition( !is_infinite(v)); if (number_of_vertices() == 1) remove_first(v); @@ -1491,7 +1491,7 @@ test_dim_down(Vertex_handle v) const //it goes down to 1 iff // 1) any finite face is incident to v // 2) all vertices are collinear - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); bool dim1 = true; Finite_faces_iterator fit = finite_faces_begin(); while (dim1==true && fit != finite_faces_end()) { @@ -1592,8 +1592,8 @@ void Triangulation_2:: remove_and_give_new_faces(Vertex_handle v, OutputItFaces fit) { - CGAL_triangulation_precondition( v != Vertex_handle()); - CGAL_triangulation_precondition( !is_infinite(v)); + CGAL_precondition( v != Vertex_handle()); + CGAL_precondition( !is_infinite(v)); if(number_of_vertices() == 1) remove_first(v); else if(number_of_vertices() == 2) remove_second(v); @@ -2189,7 +2189,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: move_if_no_collision(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; const int dim = dimension(); @@ -2220,7 +2220,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2230,7 +2230,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if (i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -2292,7 +2292,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: move(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; Vertex_handle w = move_if_no_collision(v,p); if(w != v) { @@ -2310,7 +2310,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, const Point &p, OutputItFaces oif) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; const int dim = this->dimension(); @@ -2346,7 +2346,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2357,7 +2357,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if (i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -2579,7 +2579,7 @@ march_locate_1D(const Point& t, return (*eit).first; } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Face_handle(); } @@ -2591,7 +2591,7 @@ march_locate_2D_LFC(Face_handle start, Locate_type& lt, int& li) const { - // CGAL_triangulation_precondition( ! is_infinite(start) ); + // CGAL_precondition( ! is_infinite(start) ); const Point& p = start->vertex(0)->point(); const Point& q = start->vertex(1)->point(); const Point& r = start->vertex(2)->point(); @@ -2669,7 +2669,7 @@ march_locate_2D_LFC(Face_handle start, } } while (--fc != done); //should not arrive there; - CGAL_triangulation_assertion(fc != done); + CGAL_assertion(fc != done); } while(! lfc.locate(t, lt, li) ){ @@ -2713,7 +2713,7 @@ compare_walks(const Point& p, show_face(c2); std::cerr << std::endl; } - CGAL_triangulation_assertion(b); + CGAL_assertion(b); } @@ -2726,7 +2726,7 @@ march_locate_2D(Face_handle c, Locate_type& lt, int& li) const { - CGAL_triangulation_assertion(! is_infinite(c)); + CGAL_assertion(! is_infinite(c)); boost::rand48 rng; @@ -2902,7 +2902,7 @@ march_locate_2D(Face_handle c, Locate_type& lt, int& li) const { - CGAL_triangulation_assertion(! is_infinite(c)); + CGAL_assertion(! is_infinite(c)); boost::uniform_smallint<> three(0, 2); boost::variate_generator > die3(rng, three); @@ -2926,7 +2926,7 @@ march_locate_2D(Face_handle c, const Point & p0 = c->vertex( i )->point(); const Point & p1 = c->vertex( ccwi )->point(); Orientation o0, o1, o2; - CGAL_triangulation_assertion(orientation(p0,p1,c->vertex( cwi )->point())==POSITIVE); + CGAL_assertion(orientation(p0,p1,c->vertex( cwi )->point())==POSITIVE); if(c->neighbor(cwi) == prev){ o0 = POSITIVE; } else { @@ -3431,7 +3431,7 @@ typename Triangulation_2::Line_face_circulator Triangulation_2:: line_walk(const Point& p, const Point& q, Face_handle f) const { - CGAL_triangulation_precondition( (dimension() == 2) && ! xy_equal(p,q)); + CGAL_precondition( (dimension() == 2) && ! xy_equal(p,q)); Line_face_circulator lfc = (f == Face_handle()) ? Line_face_circulator(p, q, this) : Line_face_circulator(p, q, f, this); @@ -3470,7 +3470,7 @@ bounded_side(const Point &p0, const Point &p1, const Point &p2, const Point &p) const { // return position of point p with respect to triangle p0p1p2 - CGAL_triangulation_precondition( orientation(p0, p1, p2) != COLLINEAR); + CGAL_precondition( orientation(p0, p1, p2) != COLLINEAR); Orientation o1 = orientation(p0, p1, p), o2 = orientation(p1, p2, p), o3 = orientation(p2, p0, p); @@ -3502,7 +3502,7 @@ Oriented_side Triangulation_2:: oriented_side(Face_handle f, const Point &p) const { - CGAL_triangulation_precondition ( dimension()==2); + CGAL_precondition ( dimension()==2); return oriented_side(f->vertex(0)->point(), f->vertex(1)->point(), f->vertex(2)->point(), @@ -3515,7 +3515,7 @@ Triangulation_2:: side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, const Point &p, bool perturb) const { - //CGAL_triangulation_precondition( orientation(p0, p1, p2) == POSITIVE ); + //CGAL_precondition( orientation(p0, p1, p2) == POSITIVE ); // no reason for such precondition and it invalidates fast removal in Delaunay typename Gt::Side_of_oriented_circle_2 pred = geom_traits().side_of_oriented_circle_2_object(); @@ -3546,7 +3546,7 @@ side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, if (points[i] == &p0 && (o = orientation(p,p1,p2)) != COLLINEAR ) return Oriented_side(o); } - // CGAL_triangulation_assertion(false); + // CGAL_assertion(false); //no reason for such precondition and it invalidates fast removal in Delaunay return ON_NEGATIVE_SIDE; } @@ -3666,7 +3666,7 @@ typename Triangulation_2::Point_2 Triangulation_2:: circumcenter(Face_handle f) const { - CGAL_triangulation_precondition (dimension()==2); + CGAL_precondition (dimension()==2); return circumcenter((f->vertex(0))->point(), (f->vertex(1))->point(), (f->vertex(2))->point()); @@ -3813,7 +3813,7 @@ std::istream& operator>>(std::istream& is, Triangulation_2 &tr) { tr.file_input(is); - CGAL_triangulation_assertion(tr.is_valid()); + CGAL_assertion(tr.is_valid()); return is; } @@ -3835,11 +3835,11 @@ test_next(const Triangulation_2& t1, // Returns false if an inequality has been found. // Precondition: f1, f2 have been registered as well as their 3 vertices. - CGAL_triangulation_precondition(t1.dimension() >= 2); - CGAL_triangulation_precondition(Fmap[f1] == f2); - CGAL_triangulation_precondition(Vmap.find(f1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(f1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(t1.dimension() == 1 || Vmap.find(f1->vertex(2)) != Vmap.end()); + CGAL_precondition(t1.dimension() >= 2); + CGAL_precondition(Fmap[f1] == f2); + CGAL_precondition(Vmap.find(f1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(f1->vertex(1)) != Vmap.end()); + CGAL_precondition(t1.dimension() == 1 || Vmap.find(f1->vertex(2)) != Vmap.end()); typedef Triangulation_2 Tr1; typedef Triangulation_2 Tr2; diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h index f6bb630f203..fd9ecd9244d 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -345,7 +345,7 @@ Constraint_hierarchy_2:: context(T va, T vb) { H_context_iterator hcit, past; - if(!get_contexts(va,vb, hcit ,past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, hcit ,past)) CGAL_assertion(false); return *hcit; } @@ -355,7 +355,7 @@ Constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) { H_context_list* hcl = get_contexts(va, vb); - CGAL_triangulation_assertion(hcl != nullptr); + CGAL_assertion(hcl != nullptr); return hcl->size(); } @@ -365,7 +365,7 @@ Constraint_hierarchy_2:: contexts_begin(T va, T vb) { H_context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return first; } @@ -375,7 +375,7 @@ Constraint_hierarchy_2:: contexts_end(T va, T vb) { H_context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return last; } @@ -385,7 +385,7 @@ Constraint_hierarchy_2:: vertices_in_constraint_begin(T va, T vb) { H_c_iterator cit = c_to_sc_map.find(make_edge(va,vb)); - CGAL_triangulation_assertion( cit != c_to_sc_map.end()); + CGAL_assertion( cit != c_to_sc_map.end()); return cit->second->begin(); } @@ -395,7 +395,7 @@ Constraint_hierarchy_2:: vertices_in_constraint_end(T va, T vb) { H_c_iterator cit = c_to_sc_map.find(make_edge(va,vb)); - CGAL_triangulation_assertion( cit != c_to_sc_map.end()); + CGAL_assertion( cit != c_to_sc_map.end()); return cit->second->end(); } @@ -444,7 +444,7 @@ Constraint_hierarchy_2:: remove_constraint(T va, T vb){ H_edge he = make_edge(va, vb); typename H_c_to_sc_map::iterator c_to_sc_it = c_to_sc_map.find(he); - CGAL_triangulation_assertion(c_to_sc_it != c_to_sc_map.end()); + CGAL_assertion(c_to_sc_it != c_to_sc_map.end()); H_vertex_list *hvl = c_to_sc_it->second; @@ -454,7 +454,7 @@ remove_constraint(T va, T vb){ ++it){ typename H_sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); H_context_list* hcl = scit->second; // and remove the contraint from the context list of the subcontraint @@ -534,7 +534,7 @@ next_along_sc(T va, T vb, T& w) const // find the next vertex after vb along any enclosing constrained // return false if there is no .... H_context_iterator ctxtit, past; - if(!get_contexts(va, vb, ctxtit, past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va, vb, ctxtit, past)) CGAL_assertion(false); H_vertex_it pos; for( ; ctxtit != past; ctxtit++){ @@ -564,9 +564,9 @@ remove_Steiner(T v, T va, T vb) CGAL_precondition(!is_constrained_vertex(v)); H_context_list* hcl1 = get_contexts(va, v); - CGAL_triangulation_assertion(hcl1 != nullptr); + CGAL_assertion(hcl1 != nullptr); H_context_list* hcl2 = get_contexts(v, vb); - CGAL_triangulation_assertion(hcl2 != nullptr); + CGAL_assertion(hcl2 != nullptr); H_vertex_it pos; for(H_context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ @@ -600,7 +600,7 @@ void Constraint_hierarchy_2:: add_Steiner(T va, T vb, T vc){ H_context_list* hcl = get_contexts(va, vb); - CGAL_triangulation_assertion(hcl != nullptr); + CGAL_assertion(hcl != nullptr); H_context_list* hcl2 = new H_context_list; @@ -701,7 +701,7 @@ Constraint_hierarchy_2:: oriented_end(T va, T vb, T& vc) const { H_context_iterator ctxt, past; - if(!get_contexts(va,vb, ctxt, past) ) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, ctxt, past) ) CGAL_assertion(false); if(*(ctxt->pos) == va) vc = ctxt->enclosing->back(); else diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 130b2a181de..a6c2bf44571 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS # include @@ -423,7 +423,7 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const va = *pos; pos = hcit->pos; ++pos; - CGAL_triangulation_assertion(vbb == *pos); + CGAL_assertion(vbb == *pos); while(!pos.input()){ ++pos; } @@ -451,7 +451,7 @@ Polyline_constraint_hierarchy_2:: context(T va, T vb) { Context_iterator hcit, past; - if(!get_contexts(va,vb, hcit ,past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, hcit ,past)) CGAL_assertion(false); return *hcit; } @@ -461,8 +461,8 @@ Polyline_constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) const { Context_list* hcl = nullptr; - CGAL_triangulation_assertion_code( bool found = ) get_contexts(va,vb,hcl); - CGAL_triangulation_assertion(found); + CGAL_assertion_code( bool found = ) get_contexts(va,vb,hcl); + CGAL_assertion(found); return hcl->size(); } @@ -472,7 +472,7 @@ Polyline_constraint_hierarchy_2:: contexts_begin(T va, T vb) const { Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return first; } @@ -482,7 +482,7 @@ Polyline_constraint_hierarchy_2:: contexts_end(T va, T vb) const { Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return last; } @@ -495,7 +495,7 @@ swap(Constraint_id first, Constraint_id second){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -511,7 +511,7 @@ swap(Constraint_id first, Constraint_id second){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -527,7 +527,7 @@ swap(Constraint_id first, Constraint_id second){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -553,7 +553,7 @@ remove_constraint(Constraint_id cid){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and remove the context of the constraint @@ -680,7 +680,7 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id firs ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -705,7 +705,7 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id firs ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and update pos in the context of the constraint @@ -733,7 +733,7 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -757,7 +757,7 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and update pos in the context of the constraint @@ -798,7 +798,7 @@ Polyline_constraint_hierarchy_2::split(Constraint_id first, Ver ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -832,7 +832,7 @@ Polyline_constraint_hierarchy_2::split2(Constraint_id first, Ve ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -985,7 +985,7 @@ next_along_sc(T va, T vb, T& w) const // find the next vertex after vb along any enclosing constrained // return false if there is no .... Context_iterator ctxtit, past; - if(!get_contexts(va, vb, ctxtit, past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va, vb, ctxtit, past)) CGAL_assertion(false); Vertex_it pos; for( ; ctxtit != past; ctxtit++){ @@ -1016,8 +1016,8 @@ remove_Steiner(T v, T va, T vb) Context_list* hcl1; Context_list* hcl2; - if(!get_contexts(va,v,hcl1)) CGAL_triangulation_assertion(false); - if(!get_contexts(v,vb,hcl2)) CGAL_triangulation_assertion(false); + if(!get_contexts(va,v,hcl1)) CGAL_assertion(false); + if(!get_contexts(v,vb,hcl2)) CGAL_assertion(false); Vertex_it pos; for(Context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ @@ -1169,7 +1169,7 @@ Polyline_constraint_hierarchy_2:: oriented_end(T va, T vb, T& vc) const { Context_iterator ctxt, past; - if(!get_contexts(va,vb, ctxt, past) ) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, ctxt, past) ) CGAL_assertion(false); if(*(ctxt->pos) == va) vc = ctxt->enclosing->back(); else diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h index 0f7800637a2..5cd70bb2a6b 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { @@ -92,7 +92,7 @@ public: bool operator==(const Face_handle& fh) const { return fh == pos; } bool operator!=(const Face_handle& fh) const { return fh != pos; } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator==(std::nullptr_t CGAL_assertion_code(n)) const; bool operator!=(std::nullptr_t n) const; bool is_empty() const; bool collinear_outside() const; @@ -139,7 +139,7 @@ Triangulation_line_face_circulator_2(const Face_handle& face, : pos(face), _tr(t), s(state), i(index), p(pp), q(qq) { - CGAL_triangulation_precondition(! t->xy_equal(p, q)); + CGAL_precondition(! t->xy_equal(p, q)); } @@ -153,7 +153,7 @@ Triangulation_line_face_circulator_2(Vertex_handle v, // dir // or null iterator { - CGAL_triangulation_precondition((!_tr->is_infinite(v)) && + CGAL_precondition((!_tr->is_infinite(v)) && (_tr->dimension() == 2) && (! _tr->xy_equal(v->point(),dir))); p=v->point(); @@ -188,7 +188,7 @@ Triangulation_line_face_circulator_2(Vertex_handle v, // reset vt and conclude. vt is still finite and [pqt] still LEFT_TURN ic = fc->index(v); vt= fc->vertex(cw(ic)); - CGAL_triangulation_assertion (_tr->orientation(p,q, vt->point())== + CGAL_assertion (_tr->orientation(p,q, vt->point())== LEFT_TURN ); if (_tr->is_infinite(vr)) { --fc; @@ -318,7 +318,7 @@ Triangulation_line_face_circulator_2(const Point& pp, // incident to p // if ff is infinite, the walk begin at the first finite face traversed { - CGAL_triangulation_precondition(_tr->is_infinite(ff) || + CGAL_precondition(_tr->is_infinite(ff) || _tr->oriented_side(ff,p) != ON_NEGATIVE_SIDE); int j; if(_tr->is_infinite(pos)){ @@ -416,7 +416,7 @@ void Triangulation_line_face_circulator_2:: increment() { - CGAL_triangulation_precondition(pos != Face_handle()); + CGAL_precondition(pos != Face_handle()); if(s == vertex_vertex || s == edge_vertex) { Orientation o; do{ @@ -469,7 +469,7 @@ void Triangulation_line_face_circulator_2:: decrement() { - CGAL_triangulation_precondition(pos != Face_handle()); + CGAL_precondition(pos != Face_handle()); if(s == vertex_vertex || s == vertex_edge) { if(s == vertex_vertex){ i = cw(i); @@ -538,7 +538,7 @@ locate(const Point& t, Locate_type <, int &li) case vertex_vertex: { if(_tr->is_infinite(pos->vertex(i))){ - CGAL_triangulation_assertion( + CGAL_assertion( _tr->orientation( pos->vertex(cw(i))->point(), pos->vertex(ccw(i))->point(), t) != LEFT_TURN); @@ -589,7 +589,7 @@ Triangulation_line_face_circulator_2& Triangulation_line_face_circulator_2:: operator++() { - CGAL_triangulation_precondition( pos != Face_handle()) ; + CGAL_precondition( pos != Face_handle()) ; increment(); return *this; } @@ -600,7 +600,7 @@ Triangulation_line_face_circulator_2& Triangulation_line_face_circulator_2:: operator--() { - CGAL_triangulation_precondition(pos != Face_handle()) ; + CGAL_precondition(pos != Face_handle()) ; decrement(); return *this; } @@ -632,7 +632,7 @@ inline bool Triangulation_line_face_circulator_2:: operator==(const Line_face_circulator& lfc) const { - CGAL_triangulation_precondition( pos != Face_handle() && + CGAL_precondition( pos != Face_handle() && lfc.pos != Face_handle()); return ( _tr == lfc._tr && ( _tr==nullptr || (pos == lfc.pos && s== lfc.s && p==lfc.p && q==lfc.q) ) ); @@ -657,9 +657,9 @@ is_empty() const template < class Triangulation > inline bool Triangulation_line_face_circulator_2:: -operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const +operator==(std::nullptr_t CGAL_assertion_code(n)) const { - CGAL_triangulation_assertion( n == nullptr); + CGAL_assertion( n == nullptr); return pos == Face_handle(); } @@ -668,7 +668,7 @@ inline bool Triangulation_line_face_circulator_2:: operator!=(std::nullptr_t n) const { - CGAL_triangulation_assertion( n == nullptr); + CGAL_assertion( n == nullptr); return !(*this == n); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h b/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h index ac015011f68..4ed05abecc1 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h +++ b/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h @@ -22,7 +22,7 @@ #include #include -#include +#include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Triangulation_face_base_2.h index 7335b7c2c74..ea91ec002cf 100644 --- a/Triangulation_2/include/CGAL/Triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h index d82c4c0a828..48333eab34a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -252,7 +252,7 @@ private: Vertex_handle nearest_vertex_dispatch(const Point&, Face_handle, Tag_true) const { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Vertex_handle(); } @@ -582,7 +582,7 @@ template typename Triangulation_hierarchy_2::Vertex_handle Triangulation_hierarchy_2:: move(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); Vertex_handle w = move_if_no_collision(v,p); if(w != v) { remove(v); diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 094950e1fe9..0099a304430 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -548,7 +548,7 @@ public: OutputIteratorInternalFacets ifit, bool *could_lock_zone = nullptr) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); std::vector cells; cells.reserve(32); @@ -621,7 +621,7 @@ public: vertices_on_conflict_zone_boundary(const Point&p, Cell_handle c, OutputIterator res) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); // Get the facets on the boundary of the hole. std::vector facets; @@ -667,7 +667,7 @@ public: template < typename InputIterator > size_type remove(InputIterator first, InputIterator beyond) { - CGAL_triangulation_precondition(!this->does_repeat_in_range(first, beyond)); + CGAL_precondition(!this->does_repeat_in_range(first, beyond)); size_type n = number_of_vertices(); #ifdef CGAL_TRIANGULATION_3_PROFILING @@ -794,7 +794,7 @@ protected: nearest_vertex(const Point& p, Vertex_handle v, Vertex_handle w) const { // In case of equality, v is returned. - CGAL_triangulation_precondition(v != w); + CGAL_precondition(v != w); if(is_infinite(v)) return w; @@ -1301,7 +1301,7 @@ remove(Vertex_handle v) Vertex_remover remover(tmp); Tr_Base::remove(v, remover); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } template < class Gt, class Tds, class Lds > @@ -1313,7 +1313,7 @@ remove(Vertex_handle v, bool *could_lock_zone) Vertex_remover remover(tmp); bool ret = Tr_Base::remove(v, remover, could_lock_zone); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return ret; } @@ -1327,7 +1327,7 @@ move_if_no_collision(Vertex_handle v, const Point& p) Vertex_inserter inserter(*this); Vertex_handle res = Tr_Base::move_if_no_collision(v,p,remover,inserter); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return res; } @@ -1336,7 +1336,7 @@ typename Delaunay_triangulation_3::Vertex_handle Delaunay_triangulation_3:: move(Vertex_handle v, const Point& p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -1356,7 +1356,7 @@ remove_and_give_new_cells(Vertex_handle v, OutputItCells fit) Vertex_remover remover(tmp); Tr_Base::remove_and_give_new_cells(v,remover,fit); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } template < class Gt, class Tds, class Lds > @@ -1373,7 +1373,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, Tr_Base::move_if_no_collision_and_give_new_cells(v,p, remover,inserter,fit); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return res; } @@ -1383,7 +1383,7 @@ Delaunay_triangulation_3:: side_of_oriented_sphere(const Point& p0, const Point& p1, const Point& p2, const Point& p3, const Point& p, bool perturb) const { - CGAL_triangulation_precondition(orientation(p0, p1, p2, p3) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p2, p3) == POSITIVE); Oriented_side os = geom_traits().side_of_oriented_sphere_3_object()(p0, p1, p2, p3, p); @@ -1416,7 +1416,7 @@ side_of_oriented_sphere(const Point& p0, const Point& p1, const Point& p2, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -1427,8 +1427,8 @@ coplanar_side_of_bounded_circle(const Point& p0, const Point& p1, const Point& p2, const Point& p, bool perturb) const { // In dim==2, we should even be able to assert orient == POSITIVE. - CGAL_triangulation_precondition(coplanar_orientation(p0, p1, p2) - != COLLINEAR); + CGAL_precondition(coplanar_orientation(p0, p1, p2) + != COLLINEAR); Bounded_side bs = geom_traits().coplanar_side_of_bounded_circle_3_object()(p0, p1, p2, p); @@ -1478,7 +1478,7 @@ side_of_sphere(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, const Point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); if(is_infinite(v0)) { @@ -1538,12 +1538,12 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const // ON_BOUNDED_SIDE for a point in the open half-plane // ON_UNBOUNDED_SIDE elsewhere - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); int i3 = 5; if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); // the triangulation is supposed to be valid, ie the facet // with vertices 0 1 2 in this order is positively oriented if(! c->has_vertex(infinite_vertex(), i3)) @@ -1556,8 +1556,8 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const // is positively oriented Vertex_handle v1 = c->vertex(ccw(i3)), v2 = c->vertex(cw(i3)); - CGAL_triangulation_assertion(coplanar_orientation(v1->point(), v2->point(), - mirror_vertex(c, i3)->point()) == NEGATIVE); + CGAL_assertion(coplanar_orientation(v1->point(), v2->point(), + mirror_vertex(c, i3)->point()) == NEGATIVE); Orientation o = coplanar_orientation(v1->point(), v2->point(), p); if(o != COLLINEAR) return Bounded_side(o); @@ -1570,7 +1570,7 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const } // else dimension == 3 - CGAL_triangulation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if((! c->has_vertex(infinite_vertex(),i3)) || (i3 != i)) { // finite facet @@ -1579,10 +1579,10 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const int i0 = (i>0) ? 0 : 1; int i1 = (i>1) ? 1 : 2; int i2 = (i>2) ? 2 : 3; - CGAL_triangulation_precondition(coplanar(c->vertex(i0)->point(), - c->vertex(i1)->point(), - c->vertex(i2)->point(), - p)); + CGAL_precondition(coplanar(c->vertex(i0)->point(), + c->vertex(i1)->point(), + c->vertex(i2)->point(), + p)); return coplanar_side_of_bounded_circle(c->vertex(i0)->point(), c->vertex(i1)->point(), c->vertex(i2)->point(), @@ -1615,7 +1615,7 @@ Delaunay_triangulation_3:: nearest_vertex_in_cell(const Point& p, Cell_handle c) const { // Returns the finite vertex of the cell c which is the closest to p. - CGAL_triangulation_precondition(dimension() >= 0); + CGAL_precondition(dimension() >= 0); Vertex_handle nearest = nearest_vertex(p, c->vertex(0), c->vertex(1)); if(dimension() >= 2) @@ -1690,9 +1690,9 @@ bool Delaunay_triangulation_3:: is_delaunay_after_displacement(Vertex_handle v, const Point& p) const { - CGAL_triangulation_precondition(!this->is_infinite(v)); - CGAL_triangulation_precondition(this->dimension() == 2); - CGAL_triangulation_precondition(!this->test_dim_down(v)); + CGAL_precondition(!this->is_infinite(v)); + CGAL_precondition(this->dimension() == 2); + CGAL_precondition(!this->test_dim_down(v)); if(v->point() == p) return true; @@ -1766,7 +1766,7 @@ bool Delaunay_triangulation_3:: is_Gabriel(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i)); typename Geom_traits::Side_of_bounded_sphere_3 side_of_bounded_sphere = geom_traits().side_of_bounded_sphere_3_object(); @@ -1803,7 +1803,7 @@ bool Delaunay_triangulation_3:: is_Gabriel(Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i,j)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i,j)); typename Geom_traits::Side_of_bounded_sphere_3 side_of_bounded_sphere = geom_traits().side_of_bounded_sphere_3_object(); @@ -1830,8 +1830,8 @@ typename Delaunay_triangulation_3::Point Delaunay_triangulation_3:: dual(Cell_handle c) const { - CGAL_triangulation_precondition(dimension()==3); - CGAL_triangulation_precondition(! is_infinite(c)); + CGAL_precondition(dimension()==3); + CGAL_precondition(! is_infinite(c)); return c->circumcenter(geom_traits()); } @@ -1840,12 +1840,12 @@ typename Delaunay_triangulation_3::Object Delaunay_triangulation_3:: dual(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension()>=2); - CGAL_triangulation_precondition(! is_infinite(c,i)); + CGAL_precondition(dimension()>=2); + CGAL_precondition(! is_infinite(c,i)); if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); return construct_object(construct_circumcenter(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point())); @@ -1890,12 +1890,12 @@ typename Delaunay_triangulation_3::Line Delaunay_triangulation_3:: dual_support(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension()>=2); - CGAL_triangulation_precondition(! is_infinite(c,i)); + CGAL_precondition(dimension()>=2); + CGAL_precondition(! is_infinite(c,i)); if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); return construct_equidistant_line(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point()); @@ -1916,7 +1916,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid data structure" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1925,7 +1925,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "no infinite vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1946,7 +1946,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty sphere " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -1972,7 +1972,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty circle " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2009,7 +2009,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << c->vertex(i)->point() << ", " ; std::cerr << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } switch(dimension()) @@ -2025,7 +2025,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if(verbose) std::cerr << "non-empty sphere " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2043,7 +2043,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if(verbose) std::cerr << "non-empty circle " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h index 44c6acdc299..db201ab0372 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h index 7c43de82703..5f4b99aa943 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h @@ -21,7 +21,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 10444aee9fc..ac6371c6484 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -195,14 +195,14 @@ public: Regular_triangulation_3(const Regular_triangulation_3& rt) : Tr_Base(rt), hidden_point_visitor(this) { - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } Regular_triangulation_3(Regular_triangulation_3&& rt) noexcept(noexcept(Tr_Base(std::move(rt)))) : Tr_Base(std::move(rt)), hidden_point_visitor(this) { - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } ~Regular_triangulation_3() = default; @@ -646,7 +646,7 @@ public: const Facet *this_facet_must_be_in_the_cz = nullptr, bool *the_facet_is_in_its_cz = nullptr) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); std::vector cells; cells.reserve(32); @@ -720,7 +720,7 @@ public: OutputIterator vertices_inside_conflict_zone(const Weighted_point&p, Cell_handle c, OutputIterator res) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); // Get the facets on the boundary of the hole, and the cells of the hole std::vector cells; @@ -778,7 +778,7 @@ public: Cell_handle c, OutputIterator res) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); // Get the facets on the boundary of the hole. std::vector facets; @@ -848,7 +848,7 @@ public: template < typename InputIterator > size_type remove(InputIterator first, InputIterator beyond) { - CGAL_triangulation_precondition(!this->does_repeat_in_range(first, beyond)); + CGAL_precondition(!this->does_repeat_in_range(first, beyond)); size_type n = number_of_vertices(); #ifdef CGAL_TRIANGULATION_3_PROFILING @@ -900,7 +900,7 @@ public: Vertex_remover remover(tmp); Tr_Base::remove_and_give_new_cells(v, remover, cit); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } // Displacement works only for regular triangulation @@ -1057,7 +1057,7 @@ protected: Vertex_handle w) const { // In case of equality, v is returned. - CGAL_triangulation_precondition(v != w); + CGAL_precondition(v != w); if(is_infinite(v)) return w; @@ -1069,21 +1069,21 @@ protected: Oriented_side power_test(const Weighted_point& p, const Weighted_point& q) const { - CGAL_triangulation_precondition(this->equal(p, q)); + CGAL_precondition(this->equal(p, q)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q); } Oriented_side power_test(const Weighted_point& p, const Weighted_point& q, const Weighted_point& r) const { - CGAL_triangulation_precondition(this->collinear(p, q, r)); + CGAL_precondition(this->collinear(p, q, r)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q, r); } Oriented_side power_test(const Weighted_point& p, const Weighted_point& q, const Weighted_point& r, const Weighted_point& s) const { - CGAL_triangulation_precondition(this->coplanar(p, q, r, s)); + CGAL_precondition(this->coplanar(p, q, r, s)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q, r, s); } @@ -1669,7 +1669,7 @@ nearest_power_vertex_in_cell(const Bare_point& p, Cell_handle c) const // Returns the finite vertex of the cell c with smaller // power distance to p. { - CGAL_triangulation_precondition(dimension() >= 1); + CGAL_precondition(dimension() >= 1); Vertex_handle nearest = nearest_power_vertex(p, c->vertex(0), c->vertex(1)); if(dimension() >= 2) { @@ -1735,8 +1735,8 @@ typename Regular_triangulation_3::Bare_point Regular_triangulation_3:: dual(Cell_handle c) const { - CGAL_triangulation_precondition(dimension()==3); - CGAL_triangulation_precondition(! is_infinite(c)); + CGAL_precondition(dimension()==3); + CGAL_precondition(! is_infinite(c)); return c->weighted_circumcenter(geom_traits()); } @@ -1767,7 +1767,7 @@ Regular_triangulation_3:: dual_ray(Cell_handle c, int i, Ray& ray) const { Cell_handle n = c->neighbor(i); - CGAL_triangulation_precondition((!is_infinite(c) != !is_infinite(n))); // xor + CGAL_precondition((!is_infinite(c) != !is_infinite(n))); // xor // either n or c is infinite int in; if(is_infinite(c)) @@ -1853,7 +1853,7 @@ dual_ray_exact(const Facet& facet, Ray& ray) const Cell_handle c = facet.first; int i = facet.second; Cell_handle n = c->neighbor(i); - CGAL_triangulation_precondition(!is_infinite(c) != !is_infinite(n)); // xor + CGAL_precondition(!is_infinite(c) != !is_infinite(n)); // xor // either n or c is infinite int in; if(is_infinite(c)) @@ -1911,12 +1911,12 @@ typename Regular_triangulation_3::Object Regular_triangulation_3:: dual(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension()>=2); - CGAL_triangulation_precondition(! is_infinite(c,i)); + CGAL_precondition(dimension()>=2); + CGAL_precondition(! is_infinite(c,i)); if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); return construct_object(construct_weighted_circumcenter(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point())); @@ -1975,7 +1975,7 @@ side_of_oriented_power_sphere(const Weighted_point& p0, const Weighted_point& p3, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(orientation(p0, p1, p2, p3) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p2, p3) == POSITIVE); using namespace boost; @@ -2008,7 +2008,7 @@ side_of_oriented_power_sphere(const Weighted_point& p0, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -2017,7 +2017,7 @@ Bounded_side Regular_triangulation_3:: side_of_power_sphere(Cell_handle c, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); int i3; if(! c->has_vertex(infinite_vertex(), i3)) { @@ -2065,7 +2065,7 @@ side_of_bounded_power_circle(const Weighted_point& p0, const Weighted_point& p2, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(coplanar_orientation(p0, p1, p2) != 0); + CGAL_precondition(coplanar_orientation(p0, p1, p2) != 0); if(coplanar_orientation(p0, p1, p2) == POSITIVE) return Bounded_side (side_of_oriented_power_circle(p0, p1, p2, p, perturb)); @@ -2084,7 +2084,7 @@ side_of_oriented_power_circle(const Weighted_point& p0, const Weighted_point& p2, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(coplanar_orientation(p0, p1, p2) == POSITIVE); + CGAL_precondition(coplanar_orientation(p0, p1, p2) == POSITIVE); using namespace boost; @@ -2116,7 +2116,7 @@ side_of_oriented_power_circle(const Weighted_point& p0, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -2126,11 +2126,11 @@ Regular_triangulation_3:: side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); int i3 = 5; if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); // the triangulation is supposed to be valid, ie the facet // with vertices 0 1 2 in this order is positively oriented if(! c->has_vertex(infinite_vertex(), i3)) @@ -2143,7 +2143,7 @@ side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, // is positively oriented Vertex_handle v1 = c->vertex(ccw(i3)), v2 = c->vertex(cw(i3)); - CGAL_triangulation_assertion( + CGAL_assertion( coplanar_orientation(v1->point(), v2->point(), mirror_vertex(c, i3)->point()) == NEGATIVE); Orientation o = coplanar_orientation(v1->point(), v2->point(), p); @@ -2157,7 +2157,7 @@ side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, } // dim 2 // else dimension == 3 - CGAL_triangulation_precondition((i >= 0) && (i < 4)); + CGAL_precondition((i >= 0) && (i < 4)); if((! c->has_vertex(infinite_vertex(),i3)) || (i3 != i)) { // finite facet @@ -2166,9 +2166,9 @@ side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, int i0 = (i>0) ? 0 : 1; int i1 = (i>1) ? 1 : 2; int i2 = (i>2) ? 2 : 3; - CGAL_triangulation_precondition(this->coplanar(c->vertex(i0)->point(), - c->vertex(i1)->point(), - c->vertex(i2)->point(), p)); + CGAL_precondition(this->coplanar(c->vertex(i0)->point(), + c->vertex(i1)->point(), + c->vertex(i2)->point(), p)); return side_of_bounded_power_circle(c->vertex(i0)->point(), c->vertex(i1)->point(), c->vertex(i2)->point(), @@ -2218,7 +2218,7 @@ side_of_bounded_power_segment(const Weighted_point& p0, ; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_UNBOUNDED_SIDE; } @@ -2227,7 +2227,7 @@ Bounded_side Regular_triangulation_3:: side_of_power_segment(Cell_handle c, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() == 1); + CGAL_precondition(dimension() == 1); if(! is_infinite(c,0,1)) return side_of_bounded_power_segment(c->vertex(0)->point(), c->vertex(1)->point(), @@ -2240,7 +2240,7 @@ side_of_power_segment(Cell_handle c, const Weighted_point& p, bool perturb) cons // Either we compare weights, or we use the finite neighboring edge Cell_handle finite_neighbor = c->neighbor(c->index(infinite_vertex())); - CGAL_triangulation_assertion(!is_infinite(finite_neighbor,0,1)); + CGAL_assertion(!is_infinite(finite_neighbor,0,1)); return side_of_bounded_power_segment(finite_neighbor->vertex(0)->point(), finite_neighbor->vertex(1)->point(), p, perturb); @@ -2269,7 +2269,7 @@ bool Regular_triangulation_3:: is_Gabriel(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i)); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_orthogonal_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -2307,7 +2307,7 @@ bool Regular_triangulation_3:: is_Gabriel(Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i,j)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i,j)); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_orthogonal_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -2416,7 +2416,7 @@ Regular_triangulation_3:: insert_in_hole(const Weighted_point& p, CellIt cell_begin, CellIt cell_end, Cell_handle begin, int i) { - CGAL_triangulation_precondition(cell_begin != cell_end); + CGAL_precondition(cell_begin != cell_end); get_hidden_point_visitor().process_cells_in_conflict(cell_begin,cell_end); @@ -2435,7 +2435,7 @@ Regular_triangulation_3:: insert_in_hole(const Weighted_point& p, CellIt cell_begin, CellIt cell_end, Cell_handle begin, int i, Vertex_handle newv) { - CGAL_triangulation_precondition(cell_begin != cell_end); + CGAL_precondition(cell_begin != cell_end); get_hidden_point_visitor().process_cells_in_conflict(cell_begin,cell_end); @@ -2542,7 +2542,7 @@ remove(Vertex_handle v) if(hv != Vertex_handle()) c = hv->cell(); } - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } template < class Gt, class Tds, class Lds > @@ -2629,7 +2629,7 @@ remove(Vertex_handle v, bool *could_lock_zone) } } - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } } @@ -2649,7 +2649,7 @@ move_if_no_collision(Vertex_handle v, const Weighted_point& p) Vertex_inserter inserter(*this); Vertex_handle res = Tr_Base::move_if_no_collision(v,p,remover,inserter); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return res; } @@ -2658,7 +2658,7 @@ typename Regular_triangulation_3::Vertex_handle Regular_triangulation_3:: move(Vertex_handle v, const Weighted_point& p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -2678,7 +2678,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid base triangulation" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -2701,7 +2701,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty sphere " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2727,7 +2727,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty circle " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2755,7 +2755,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty edge " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h index b79b2111a05..3a73305b380 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index f075bfdeb5e..336f7f1bd24 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -25,7 +25,7 @@ #endif #include -#include +#include #include #include @@ -660,8 +660,8 @@ public: // --------------- s ---------------- t -------------- // BEFORE SOURCE MIDDLE TARGET AFTER - CGAL_triangulation_precondition(!equal(s, t)); - CGAL_triangulation_precondition(collinear(s, p, t)); + CGAL_precondition(!equal(s, t)); + CGAL_precondition(collinear(s, p, t)); Comparison_result ps = compare_xyz(p, s); if(ps == EQUAL) @@ -736,7 +736,7 @@ public: : Base(tr.get_lock_data_structure()), _gt(tr._gt) { infinite = _tds.copy_tds(tr._tds, tr.infinite); - CGAL_triangulation_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(*this == tr); } Triangulation_3(Triangulation_3&& tr) = default; @@ -758,7 +758,7 @@ public: const GT& gt = GT(), Lock_data_structure *lock_ds = nullptr) : Base(lock_ds), _gt(gt) { - CGAL_triangulation_precondition(orientation(p0, p1, p3, p4) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p3, p4) == POSITIVE); init_tds(p0, p1, p3, p4); } @@ -807,15 +807,15 @@ public: Cell_handle infinite_cell() const { - CGAL_triangulation_assertion(infinite_vertex()->cell()->has_vertex(infinite_vertex())); + CGAL_assertion(infinite_vertex()->cell()->has_vertex(infinite_vertex())); return infinite_vertex()->cell(); } // GEOMETRIC ACCESS FUNCTIONS Tetrahedron tetrahedron(const Cell_handle c) const { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition(! is_infinite(c)); + CGAL_precondition(dimension() == 3); + CGAL_precondition(! is_infinite(c)); return construct_tetrahedron(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point(), @@ -848,31 +848,31 @@ public: void set_point(Cell_handle c, int i, const Point& p) { - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(i >= 0 && i <= dimension()); - CGAL_triangulation_precondition(! is_infinite(c->vertex(i))); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(i >= 0 && i <= dimension()); + CGAL_precondition(! is_infinite(c->vertex(i))); c->vertex(i)->point() = p; } const Point& point(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(i >= 0 && i <= dimension()); - CGAL_triangulation_precondition(! is_infinite(c->vertex(i))); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(i >= 0 && i <= dimension()); + CGAL_precondition(! is_infinite(c->vertex(i))); return c->vertex(i)->point(); } void set_point(Vertex_handle v, const Point& p) { - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(! is_infinite(v)); v->point() = p; } const Point& point(Vertex_handle v) const { - CGAL_triangulation_precondition(number_of_vertices() > 0); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(number_of_vertices() > 0); + CGAL_precondition(! is_infinite(v)); return v->point(); } @@ -880,7 +880,7 @@ public: bool is_infinite(const Vertex_handle v) const { return v == infinite_vertex(); } bool is_infinite(const Cell_handle c) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); return c->has_vertex(infinite_vertex()); } @@ -1060,7 +1060,7 @@ public: const Facet& f, Locate_type& lt, int& li, int& lj) const { - CGAL_triangulation_precondition(f.second == 3); + CGAL_precondition(f.second == 3); return side_of_facet(p, f.first, lt, li, lj); } Bounded_side side_of_segment(const Point& p, @@ -1073,8 +1073,8 @@ public: const Edge& e, Locate_type& lt, int& li) const { - CGAL_triangulation_precondition(e.second == 0); - CGAL_triangulation_precondition(e.third == 1); + CGAL_precondition(e.second == 0); + CGAL_precondition(e.third == 1); return side_of_edge(p, e.first, lt, li); } @@ -1329,7 +1329,7 @@ protected: const Facet *this_facet_must_be_in_the_cz = nullptr, bool *the_facet_is_in_its_cz = nullptr) const { - CGAL_triangulation_precondition(dimension()>=2); + CGAL_precondition(dimension()>=2); if(the_facet_is_in_its_cz) *the_facet_is_in_its_cz = false; @@ -1344,7 +1344,7 @@ protected: } } - CGAL_triangulation_precondition(tester(d)); + CGAL_precondition(tester(d)); // To store the boundary cells, in case we need to rollback typedef boost::container::small_vector SV; @@ -1443,9 +1443,9 @@ protected: template < class Conflict_test > Vertex_handle insert_conflict(Cell_handle c, const Conflict_test& tester) { - CGAL_triangulation_precondition(dimension() >= 2); - CGAL_triangulation_precondition(c != Cell_handle()); - CGAL_triangulation_precondition(tester(c)); + CGAL_precondition(dimension() >= 2); + CGAL_precondition(c != Cell_handle()); + CGAL_precondition(tester(c)); std::vector cells; cells.reserve(32); @@ -1569,7 +1569,7 @@ protected: // at this time, it should be implemented here. void flip_2D(Cell_handle f, int i) { - CGAL_triangulation_precondition(dimension()==2); + CGAL_precondition(dimension()==2); Cell_handle n = f->neighbor(i); int ni = this->_tds.mirror_index(f,i); // ni = n->index(f); @@ -1737,7 +1737,7 @@ private: { // tests whether removing the cluster of vertices // marked as "to remove", decreases the dimension of the triangulation - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); int k=0; Vertex_handle v[4]; for(Finite_vertices_iterator fit = finite_vertices_begin(); @@ -2348,7 +2348,7 @@ public: convert_cell(c, *C[j]); } - CGAL_triangulation_assertion( is_valid(false) ); + CGAL_assertion( is_valid(false) ); return is; } }; @@ -2413,7 +2413,7 @@ std::istream& operator>> (std::istream& is, Triangulation_3& tr) if(!(is >> *(C[j]))) return is; - CGAL_triangulation_assertion(tr.is_valid(false)); + CGAL_assertion(tr.is_valid(false)); return is; } @@ -2460,8 +2460,8 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& for(Vertex_iterator it = tr.vertices_begin(), end = tr.vertices_end(); it != end; ++it) TV[i++] = it; - CGAL_triangulation_assertion(i == n+1); - CGAL_triangulation_assertion(tr.is_infinite(TV[0])); + CGAL_assertion(i == n+1); + CGAL_assertion(tr.is_infinite(TV[0])); Unique_hash_map V; V[tr.infinite_vertex()] = 0; @@ -2578,10 +2578,10 @@ typename Triangulation_3::Triangle Triangulation_3:: triangle(const Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 2 || dimension() == 3); - CGAL_triangulation_precondition((dimension() == 2 && i == 3) || - (dimension() == 3 && i >= 0 && i <= 3)); - CGAL_triangulation_precondition(! is_infinite(Facet(c, i))); + CGAL_precondition(dimension() == 2 || dimension() == 3); + CGAL_precondition((dimension() == 2 && i == 3) || + (dimension() == 3 && i >= 0 && i <= 3)); + CGAL_precondition(! is_infinite(Facet(c, i))); if((i&1)==0) return construct_triangle(c->vertex((i+2)&3)->point(), c->vertex((i+1)&3)->point(), @@ -2597,11 +2597,11 @@ typename Triangulation_3::Segment Triangulation_3:: segment(const Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition(dimension() >= 1 && dimension() <= 3); - CGAL_triangulation_precondition(i >= 0 && i <= dimension() && - j >= 0 && j <= dimension()); - CGAL_triangulation_precondition(! is_infinite(Edge(c, i, j))); + CGAL_precondition(i != j); + CGAL_precondition(dimension() >= 1 && dimension() <= 3); + CGAL_precondition(i >= 0 && i <= dimension() && + j >= 0 && j <= dimension()); + CGAL_precondition(! is_infinite(Edge(c, i, j))); return construct_segment(c->vertex(i)->point(), c->vertex(j)->point()); } @@ -2611,9 +2611,9 @@ bool Triangulation_3:: is_infinite(const Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 2 || dimension() == 3); - CGAL_triangulation_precondition((dimension() == 2 && i == 3) || - (dimension() == 3 && i >= 0 && i <= 3)); + CGAL_precondition(dimension() == 2 || dimension() == 3); + CGAL_precondition((dimension() == 2 && i == 3) || + (dimension() == 3 && i >= 0 && i <= 3)); return is_infinite(c->vertex(i<=0 ? 1 : 0)) || is_infinite(c->vertex(i<=1 ? 2 : 1)) || is_infinite(c->vertex(i<=2 ? 3 : 2)); @@ -2625,9 +2625,9 @@ bool Triangulation_3:: is_infinite(const Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition(dimension() >= 1 && dimension() <= 3); - CGAL_triangulation_precondition(i >= 0 && i <= dimension() && + CGAL_precondition(i != j); + CGAL_precondition(dimension() >= 1 && dimension() <= 3); + CGAL_precondition(i >= 0 && i <= dimension() && j >= 0 && j <= dimension()); return is_infinite(c->vertex(i)) || is_infinite(c->vertex(j)); } @@ -2790,7 +2790,7 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, // from the rest of the triangulation // lt = OUTSIDE_AFFINE_HULL if p is not coplanar with the triangulation - CGAL_triangulation_expensive_assertion(start == Cell_handle() || tds().is_simplex(start)); + CGAL_expensive_assertion(start == Cell_handle() || tds().is_simplex(start)); if(could_lock_zone) *could_lock_zone = true; @@ -2812,8 +2812,8 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, { case 3: { - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); // We implement the remembering visibility/stochastic walk. @@ -2931,9 +2931,9 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, (o[1] != COPLANAR) ? 1 : 2; lj = (o[li+1] != COPLANAR) ? li+1 : (o[li+2] != COPLANAR) ? li+2 : li+3; - CGAL_triangulation_assertion(collinear(p, - c->vertex(li)->point(), - c->vertex(lj)->point())); + CGAL_assertion(collinear(p, + c->vertex(li)->point(), + c->vertex(lj)->point())); break; } case 3: @@ -2950,8 +2950,8 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, case 2: { - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); Cell_handle c = start; boost::uniform_smallint<> three(0, 2); @@ -2990,7 +2990,7 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, const Point& p1 = c->vertex(ccw(i))->point(); const Point& p2 = c->vertex(cw(i))->point(); Orientation o[3]; - CGAL_triangulation_assertion(coplanar_orientation(p0,p1,p2) == POSITIVE); + CGAL_assertion(coplanar_orientation(p0,p1,p2) == POSITIVE); o[0] = coplanar_orientation(p0,p1,p); if(o[0] == NEGATIVE) { @@ -3047,8 +3047,8 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, } case 1: { - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); Cell_handle c = start; //first tests whether p is collinear with the current triangulation @@ -3114,7 +3114,7 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, } default: { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Cell_handle(); } } @@ -3128,8 +3128,8 @@ Triangulation_3:: inexact_locate(const Point& t, Cell_handle start, int n_of_turns, bool *could_lock_zone) const { - CGAL_triangulation_expensive_assertion(start == Cell_handle() || - tds().is_simplex(start)); + CGAL_expensive_assertion(start == Cell_handle() || + tds().is_simplex(start)); if(could_lock_zone) *could_lock_zone = true; @@ -3155,8 +3155,8 @@ inexact_locate(const Point& t, Cell_handle start, int n_of_turns, if(start->has_vertex(infinite, ind_inf)) start = start->neighbor(ind_inf); - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); // We implement the remembering visibility walk. // In this phase, no need to be stochastic @@ -3242,7 +3242,7 @@ side_of_tetrahedron(const Point& p, // - ON_BOUNDARY if p lies on one of the facets // - ON_UNBOUNDED_SIDE if p lies strictly outside the tetrahedron - CGAL_triangulation_precondition(orientation(p0,p1,p2,p3) == POSITIVE); + CGAL_precondition(orientation(p0,p1,p2,p3) == POSITIVE); Orientation o0,o1,o2,o3; if(((o0 = orientation(p,p1,p2,p3)) == NEGATIVE) || @@ -3306,7 +3306,7 @@ side_of_tetrahedron(const Point& p, default: { // impossible : cannot be on 4 facets for a real tetrahedron - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -3330,7 +3330,7 @@ side_of_cell(const Point& p, // two cases) // lt only has meaning when ON_BOUNDED_SIDE or ON_BOUNDARY - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); if(! is_infinite(c)) { return side_of_tetrahedron(p, @@ -3401,14 +3401,14 @@ side_of_cell(const Point& p, } default: { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } // switch side } // case ZERO default: { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } // switch o @@ -3432,10 +3432,10 @@ side_of_triangle(const Point& p, // - ON_BOUNDARY if p lies on one of the edges // - ON_UNBOUNDED_SIDE if p lies strictly outside the triangle - CGAL_triangulation_precondition(coplanar(p,p0,p1,p2)); + CGAL_precondition(coplanar(p,p0,p1,p2)); Orientation o012 = coplanar_orientation(p0,p1,p2); - CGAL_triangulation_precondition(o012 != COLLINEAR); + CGAL_precondition(o012 != COLLINEAR); Orientation o0; // edge p0 p1 Orientation o1; // edge p1 p2 @@ -3485,7 +3485,7 @@ side_of_triangle(const Point& p, default: { // cannot happen - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -3512,15 +3512,15 @@ side_of_facet(const Point& p, // When they mean anything, li and lj refer to indices in the cell c // giving the facet (c,i). - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); if(! is_infinite(c,3)) { // The following precondition is useless because it is written // in side_of_facet - // CGAL_triangulation_precondition(coplanar (p, - // c->vertex(0)->point, - // c->vertex(1)->point, - // c->vertex(2)->point)); + // CGAL_precondition(coplanar (p, + // c->vertex(0)->point, + // c->vertex(1)->point, + // c->vertex(2)->point)); int i_t, j_t; Bounded_side side = side_of_triangle(p, c->vertex(0)->point(), @@ -3544,7 +3544,7 @@ side_of_facet(const Point& p, int inf = c->index(infinite); // The following precondition is useless because it is written // in side_of_facet - // CGAL_triangulation_precondition(coplanar (p, + // CGAL_precondition(coplanar (p, // c->neighbor(inf)->vertex(0)->point(), // c->neighbor(inf)->vertex(1)->point(), // c->neighbor(inf)->vertex(2)->point())); @@ -3553,8 +3553,8 @@ side_of_facet(const Point& p, Vertex_handle v1 = c->vertex(i1), v2 = c->vertex(i2); - CGAL_triangulation_assertion(coplanar_orientation(v1->point(), v2->point(), - mirror_vertex(c, inf)->point()) == POSITIVE); + CGAL_assertion(coplanar_orientation(v1->point(), v2->point(), + mirror_vertex(c, inf)->point()) == POSITIVE); switch(coplanar_orientation(v1->point(), v2->point(), p)) { @@ -3603,8 +3603,8 @@ side_of_segment(const Point& p, // - ON_BOUNDARY if p equals p0 or p1 // - ON_UNBOUNDED_SIDE if p lies strictly outside the edge - CGAL_triangulation_precondition(! equal(p0, p1)); - CGAL_triangulation_precondition(collinear(p, p0, p1)); + CGAL_precondition(! equal(p0, p1)); + CGAL_precondition(collinear(p, p0, p1)); switch(collinear_position(p0, p, p1)) { @@ -3643,7 +3643,7 @@ side_of_edge(const Point& p, // lt only has meaning when ON_BOUNDED_SIDE and ON_BOUNDARY // li refer to indices in the cell c - CGAL_triangulation_precondition(dimension() == 1); + CGAL_precondition(dimension() == 1); if(! is_infinite(c,0,1)) return side_of_segment(p, c->vertex(0)->point(), c->vertex(1)->point(), lt, li); @@ -3669,8 +3669,8 @@ bool Triangulation_3:: flip(Cell_handle c, int i) { - CGAL_triangulation_precondition((dimension() == 3) && (0<=i) && (i<4) && - (number_of_vertices() >= 5)); + CGAL_precondition((dimension() == 3) && (0<=i) && (i<4) && + (number_of_vertices() >= 5)); Cell_handle n = c->neighbor(i); int in = n->index(c); @@ -3727,41 +3727,41 @@ void Triangulation_3:: flip_flippable(Cell_handle c, int i) { - CGAL_triangulation_precondition((dimension() == 3) && (0<=i) && (i<4) && - (number_of_vertices() >= 5)); - CGAL_triangulation_precondition_code(Cell_handle n = c->neighbor(i);); - CGAL_triangulation_precondition_code(int in = n->index(c);); - CGAL_triangulation_precondition((! is_infinite(c)) &&(! is_infinite(n))); + CGAL_precondition((dimension() == 3) && (0<=i) && (i<4) && + (number_of_vertices() >= 5)); + CGAL_precondition_code(Cell_handle n = c->neighbor(i);); + CGAL_precondition_code(int in = n->index(c);); + CGAL_precondition((! is_infinite(c)) &&(! is_infinite(n))); if(i%2 == 1) { - CGAL_triangulation_precondition(orientation(c->vertex((i+1)&3)->point(), - c->vertex((i+2)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+2)&3)->point(), - c->vertex((i+3)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+3)&3)->point(), - c->vertex((i+1)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+1)&3)->point(), + c->vertex((i+2)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+2)&3)->point(), + c->vertex((i+3)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+3)&3)->point(), + c->vertex((i+1)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); } else { - CGAL_triangulation_precondition(orientation(c->vertex((i+2)&3)->point(), - c->vertex((i+1)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+3)&3)->point(), - c->vertex((i+2)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+1)&3)->point(), - c->vertex((i+3)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+2)&3)->point(), + c->vertex((i+1)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+3)&3)->point(), + c->vertex((i+2)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+1)&3)->point(), + c->vertex((i+3)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); } _tds.flip_flippable(c, i); @@ -3774,10 +3774,10 @@ flip(Cell_handle c, int i, int j) { // Flips the edge (i,j) of cell c - CGAL_triangulation_precondition((dimension() == 3) && - (0<=i) && (i<4) && (0<=j) && - (j<4) &&(i != j) && - (number_of_vertices() >= 5)); + CGAL_precondition((dimension() == 3) && + (0<=i) && (i<4) && (0<=j) && + (j<4) &&(i != j) && + (number_of_vertices() >= 5)); // Checks that degree 3 and not on the convex hull int degree = 0; @@ -3825,32 +3825,32 @@ flip_flippable(Cell_handle c, int i, int j) #if !defined CGAL_TRIANGULATION_NO_PRECONDITIONS && \ !defined CGAL_NO_PRECONDITIONS && !defined NDEBUG - CGAL_triangulation_precondition((dimension() == 3) && - (0<=i) && (i<4) && (0<=j) && (j<4) && - (i != j) && (number_of_vertices() >= 5)); + CGAL_precondition((dimension() == 3) && + (0<=i) && (i<4) && (0<=j) && (j<4) && + (i != j) && (number_of_vertices() >= 5)); int degree = 0; Cell_circulator ccir = incident_cells(c,i,j); Cell_circulator cdone = ccir; do { - CGAL_triangulation_precondition(! is_infinite(ccir)); + CGAL_precondition(! is_infinite(ccir)); ++degree; ++ccir; } while(ccir != cdone); - CGAL_triangulation_precondition(degree == 3); + CGAL_precondition(degree == 3); Cell_handle n = c->neighbor(next_around_edge(i, j)); int in = n->index(c->vertex(i)); int jn = n->index(c->vertex(j)); - CGAL_triangulation_precondition(orientation(c->vertex(next_around_edge(i,j))->point(), - c->vertex(next_around_edge(j,i))->point(), - n->vertex(next_around_edge(jn,in))->point(), - c->vertex(j)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex(i)->point(), - c->vertex(next_around_edge(j,i))->point(), - n->vertex(next_around_edge(jn,in))->point(), - c->vertex(next_around_edge(i,j))->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex(next_around_edge(i,j))->point(), + c->vertex(next_around_edge(j,i))->point(), + n->vertex(next_around_edge(jn,in))->point(), + c->vertex(j)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex(i)->point(), + c->vertex(next_around_edge(j,i))->point(), + n->vertex(next_around_edge(jn,in))->point(), + c->vertex(next_around_edge(i,j))->point()) == POSITIVE); #endif _tds.flip_flippable(c, i, j); @@ -4088,17 +4088,17 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_in_cell(const Point& p, Cell_handle c) { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition_code( + CGAL_precondition(dimension() == 3); + CGAL_precondition_code( Locate_type lt; int i; int j; ); - CGAL_triangulation_precondition(side_of_tetrahedron(p, - c->vertex(0)->point(), - c->vertex(1)->point(), - c->vertex(2)->point(), - c->vertex(3)->point(), - lt,i,j) == ON_BOUNDED_SIDE); + CGAL_precondition(side_of_tetrahedron(p, + c->vertex(0)->point(), + c->vertex(1)->point(), + c->vertex(2)->point(), + c->vertex(3)->point(), + lt,i,j) == ON_BOUNDED_SIDE); Vertex_handle v = _tds.insert_in_cell(c); v->set_point(p); @@ -4111,21 +4111,21 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_in_facet(const Point& p, Cell_handle c, int i) { - CGAL_triangulation_precondition(dimension() == 2 || dimension() == 3); - CGAL_triangulation_precondition((dimension() == 2 && i == 3) || - (dimension() == 3 && i >= 0 && i <= 3)); - CGAL_triangulation_exactness_precondition_code( + CGAL_precondition(dimension() == 2 || dimension() == 3); + CGAL_precondition((dimension() == 2 && i == 3) || + (dimension() == 3 && i >= 0 && i <= 3)); + CGAL_exactness_precondition_code( Locate_type lt; int li; int lj; ); - CGAL_triangulation_exactness_precondition(coplanar(p, c->vertex((i+1)&3)->point(), - c->vertex((i+2)&3)->point(), - c->vertex((i+3)&3)->point()) && - side_of_triangle(p, - c->vertex((i+1)&3)->point(), - c->vertex((i+2)&3)->point(), - c->vertex((i+3)&3)->point(), - lt, li, lj) == ON_BOUNDED_SIDE); + CGAL_exactness_precondition(coplanar(p, c->vertex((i+1)&3)->point(), + c->vertex((i+2)&3)->point(), + c->vertex((i+3)&3)->point()) && + side_of_triangle(p, + c->vertex((i+1)&3)->point(), + c->vertex((i+2)&3)->point(), + c->vertex((i+3)&3)->point(), + lt, li, lj) == ON_BOUNDED_SIDE); Vertex_handle v = _tds.insert_in_facet(c, i); v->set_point(p); @@ -4137,11 +4137,11 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_in_edge(const Point& p, Cell_handle c, int i, int j) { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition(dimension() >= 1 && dimension() <= 3); - CGAL_triangulation_precondition(i >= 0 && i <= dimension() && - j >= 0 && j <= dimension()); - CGAL_triangulation_exactness_precondition_code( + CGAL_precondition(i != j); + CGAL_precondition(dimension() >= 1 && dimension() <= 3); + CGAL_precondition(i >= 0 && i <= dimension() && + j >= 0 && j <= dimension()); + CGAL_exactness_precondition_code( Locate_type lt; int li; ); @@ -4151,19 +4151,19 @@ insert_in_edge(const Point& p, Cell_handle c, int i, int j) case 3: case 2: { - CGAL_triangulation_precondition(! is_infinite(c, i, j)); - CGAL_triangulation_exactness_precondition(collinear(c->vertex(i)->point(), - p, - c->vertex(j)->point()) - && side_of_segment(p, - c->vertex(i)->point(), - c->vertex(j)->point(), - lt, li) == ON_BOUNDED_SIDE); + CGAL_precondition(! is_infinite(c, i, j)); + CGAL_exactness_precondition(collinear(c->vertex(i)->point(), + p, + c->vertex(j)->point()) + && side_of_segment(p, + c->vertex(i)->point(), + c->vertex(j)->point(), + lt, li) == ON_BOUNDED_SIDE); break; } case 1: { - CGAL_triangulation_exactness_precondition(side_of_edge(p, c, lt, li) == ON_BOUNDED_SIDE); + CGAL_exactness_precondition(side_of_edge(p, c, lt, li) == ON_BOUNDED_SIDE); break; } } @@ -4182,8 +4182,8 @@ insert_outside_convex_hull(const Point& p, Cell_handle c) // p is strictly outside the convex hull // dimension 0 not allowed, use outside-affine-hull - CGAL_triangulation_precondition(dimension() > 0); - CGAL_triangulation_precondition(c->has_vertex(infinite)); + CGAL_precondition(dimension() > 0); + CGAL_precondition(c->has_vertex(infinite)); // the precondition that p is in c is tested in each of the // insertion methods called from this method @@ -4218,7 +4218,7 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_outside_affine_hull(const Point& p) { - CGAL_triangulation_precondition(dimension() < 3); + CGAL_precondition(dimension() < 3); bool reorient; switch(dimension()) { @@ -4228,7 +4228,7 @@ insert_outside_affine_hull(const Point& p) Cell_handle n = c->neighbor(c->index(infinite_vertex())); Orientation o = coplanar_orientation(n->vertex(0)->point(), n->vertex(1)->point(), p); - CGAL_triangulation_precondition(o != COLLINEAR); + CGAL_precondition(o != COLLINEAR); reorient = o == NEGATIVE; break; } @@ -4239,7 +4239,7 @@ insert_outside_affine_hull(const Point& p) Orientation o = orientation(n->vertex(0)->point(), n->vertex(1)->point(), n->vertex(2)->point(), p); - CGAL_triangulation_precondition(o != COPLANAR); + CGAL_precondition(o != COPLANAR); reorient = o == NEGATIVE; break; } @@ -4410,8 +4410,8 @@ test_dim_down(Vertex_handle v) const // Returns true iff v is incident to all finite cells/facets // and all the other vertices are coplanar/collinear in dim3/2. - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(! is_infinite(v)); if(dimension() == 3) { @@ -4474,8 +4474,8 @@ test_dim_down_using_incident_cells_3(Vertex_handle v, std::vector& adj_vertices, bool *could_lock_zone) const { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(dimension() == 3); + CGAL_precondition(! is_infinite(v)); // Collect all vertices on the boundary // and all incident cells @@ -4913,7 +4913,7 @@ make_hole_3D(Vertex_handle v, Vertex_triple_Facet_map& outer_map, std::vector& hole) { - CGAL_triangulation_expensive_precondition(! test_dim_down(v)); + CGAL_expensive_precondition(! test_dim_down(v)); incident_cells(v, std::back_inserter(hole)); @@ -4943,7 +4943,7 @@ make_hole_3D(Vertex_handle v, const std::vector& incident_cells, Vertex_triple_Facet_map& outer_map) { - CGAL_triangulation_expensive_precondition(! test_dim_down(v)); + CGAL_expensive_precondition(! test_dim_down(v)); for(typename std::vector::const_iterator cit = incident_cells.begin(), end = incident_cells.end(); cit != end; ++cit) @@ -4968,7 +4968,7 @@ VertexRemover& Triangulation_3:: remove_dim_down(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition (dimension() >= 0); + CGAL_precondition (dimension() >= 0); // Collect all the hidden points. for(All_cells_iterator ci = tds().raw_cells_begin(), @@ -4998,7 +4998,7 @@ VertexRemover& Triangulation_3:: remove_1D(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition (dimension() == 1); + CGAL_precondition (dimension() == 1); Cell_handle c1 = v->cell(); Cell_handle c2 = c1->neighbor(c1->index(v) == 0 ? 1 : 0); @@ -5016,7 +5016,7 @@ VertexRemover& Triangulation_3:: remove_2D(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::list hole; make_hole_2D(v, hole, remover); fill_hole_2D(hole, remover); @@ -5124,7 +5124,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover) vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -5179,7 +5179,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover) unsigned int o_i = o_vt_f_pair.second.second; typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -5321,7 +5321,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -5377,7 +5377,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -5431,9 +5431,9 @@ void Triangulation_3:: remove(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); - CGAL_triangulation_expensive_precondition(tds().is_vertex(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); + CGAL_expensive_precondition(tds().is_vertex(v)); if(test_dim_down (v)) { @@ -5450,7 +5450,7 @@ remove(Vertex_handle v, VertexRemover& remover) case 3: remove_3D (v, remover); break; default: - CGAL_triangulation_assertion (false); + CGAL_assertion (false); } } } @@ -5464,10 +5464,10 @@ remove(Vertex_handle v, VertexRemover& remover, bool *could_lock_zone) // N.B.: dimension doesn't need to be atomic since the parallel removal // will never decrease the dimension (the last few removes are done // sequentially) - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_expensive_precondition(tds().is_vertex(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); + CGAL_precondition(dimension() == 3); + CGAL_expensive_precondition(tds().is_vertex(v)); #ifdef CGAL_CONCURRENT_TRIANGULATION_3_PROFILING static Profile_branch_counter_3 bcounter( @@ -5551,7 +5551,7 @@ VertexRemover& Triangulation_3:: remove_2D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::list hole; make_hole_2D(v, hole, remover); fill_hole_2D(hole, remover, fit); @@ -5565,7 +5565,7 @@ VertexRemover& Triangulation_3:: remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); std::vector hole; hole.reserve(64); @@ -5624,7 +5624,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -5680,7 +5680,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -5737,9 +5737,9 @@ Triangulation_3:: remove_and_give_new_cells(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); - CGAL_triangulation_expensive_precondition(tds().is_vertex(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); + CGAL_expensive_precondition(tds().is_vertex(v)); if(test_dim_down (v)) { @@ -5756,7 +5756,7 @@ remove_and_give_new_cells(Vertex_handle v, VertexRemover& remover, case 3: remove_3D (v, remover, fit); break; default: - CGAL_triangulation_assertion (false); + CGAL_assertion (false); } } } @@ -5772,7 +5772,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, VertexRemover& remover, VertexInserter& inserter) { CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; const int dim = dimension(); @@ -5829,7 +5829,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, if(i == 0) f = f->neighbor(1); - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Cell_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -5841,7 +5841,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, if(i == 0) f_ins = f_ins->neighbor(1); - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Cell_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -6012,7 +6012,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -6069,7 +6069,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -6138,7 +6138,7 @@ move(Vertex_handle v, const Point& p, VertexRemover& remover, VertexInserter& inserter) { CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -6164,7 +6164,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, OutputItCells fit) { CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -6233,7 +6233,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, if(i==0) f = f->neighbor(1); - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Cell_handle g = f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -6246,7 +6246,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, if(i==0) f_ins = f_ins->neighbor(1); - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Cell_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -6465,7 +6465,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -6521,7 +6521,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -6861,7 +6861,7 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -6949,8 +6949,8 @@ typename Triangulation_3::size_type Triangulation_3:: remove(InputIterator first, InputIterator beyond, VertexRemover& remover) { - CGAL_triangulation_precondition(!does_repeat_in_range(first, beyond)); - CGAL_triangulation_precondition(!infinite_vertex_in_range(first, beyond)); + CGAL_precondition(!does_repeat_in_range(first, beyond)); + CGAL_precondition(!infinite_vertex_in_range(first, beyond)); size_type n = number_of_vertices(); InputIterator init = first, init2 = first; @@ -6988,7 +6988,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid data structure" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -6997,7 +6997,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "no infinite vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -7047,7 +7047,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -7083,7 +7083,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->vertex(2)->point() << ", " << c->vertex(3)->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -7101,7 +7101,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->vertex(1)->point() << ", " << c->vertex(2)->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -7123,7 +7123,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->neighbor(0)->vertex(1-c->neighbor(0)->index(c))->point() << ", " << v->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -7140,7 +7140,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->neighbor(1)->vertex(1-c->neighbor(1)->index(c))->point() << ", " << v->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -7169,12 +7169,12 @@ test_next(const Triangulation_3& t1, // Returns false if an inequality has been found. // Precondition: c1, c2 have been registered as well as their 4 vertices. - CGAL_triangulation_precondition(t1.dimension() >= 2); - CGAL_triangulation_precondition(Cmap[c1] == c2); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); - CGAL_triangulation_precondition(t1.dimension() == 2 || + CGAL_precondition(t1.dimension() >= 2); + CGAL_precondition(Cmap[c1] == c2); + CGAL_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); + CGAL_precondition(t1.dimension() == 2 || Vmap.find(c1->vertex(3)) != Vmap.end()); typedef Triangulation_3 Tr1; diff --git a/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h b/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h index 663032162a4..b93c9a3f874 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h +++ b/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h @@ -20,10 +20,10 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, Vertex_handle s, Vertex_handle t ) : _tr(tr) { - CGAL_triangulation_precondition( !_tr->is_infinite(s) ); - CGAL_triangulation_precondition( !_tr->is_infinite(t) ); - CGAL_triangulation_precondition( s->point() != t->point() ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( !_tr->is_infinite(s) ); + CGAL_precondition( !_tr->is_infinite(t) ); + CGAL_precondition( s->point() != t->point() ); + CGAL_precondition( _tr->dimension() >= 2 ); _source = s->point(); _target = t->point(); @@ -45,11 +45,11 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, Vertex_handle s, const Point& t ) : _tr(tr) { - CGAL_triangulation_precondition( !_tr->is_infinite(s) ); - CGAL_triangulation_precondition( s->point() != t ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); - CGAL_triangulation_precondition( _tr->dimension() == 3 || - orientation( *_tr->finite_facets_begin(), t ) == COPLANAR ); + CGAL_precondition( !_tr->is_infinite(s) ); + CGAL_precondition( s->point() != t ); + CGAL_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( _tr->dimension() == 3 || + orientation( *_tr->finite_facets_begin(), t ) == COPLANAR ); _source = s->point(); _target = t; @@ -71,11 +71,11 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, Vertex_handle t, Cell_handle hint ) : _tr(tr) { - CGAL_triangulation_precondition( !_tr->is_infinite(t) ); - CGAL_triangulation_precondition( s != t->point() ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); - CGAL_triangulation_precondition( _tr->dimension() == 3 || - orientation( *_tr->finite_facets_begin(), s ) == COPLANAR ); + CGAL_precondition( !_tr->is_infinite(t) ); + CGAL_precondition( s != t->point() ); + CGAL_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( _tr->dimension() == 3 || + orientation( *_tr->finite_facets_begin(), s ) == COPLANAR ); _source = s; _target = t->point(); @@ -84,7 +84,7 @@ Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, Vertex_hand cell() = _tr->locate( s, lt(), li(), lj(), hint ); - CGAL_triangulation_postcondition( cell() != Cell_handle() ); + CGAL_postcondition( cell() != Cell_handle() ); jump_to_intersecting_cell(); } @@ -93,10 +93,10 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, const Point& t, Cell_handle hint ) : _tr(tr) { - CGAL_triangulation_precondition( s != t ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); - CGAL_triangulation_precondition( _tr->dimension() == 3 || - coplanar( *_tr->finite_facets_begin(), _target ) ); + CGAL_precondition( s != t ); + CGAL_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( _tr->dimension() == 3 || + coplanar( *_tr->finite_facets_begin(), _target ) ); _source = s; _target = t; @@ -105,7 +105,7 @@ Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, const Point cell() = _tr->locate( s, lt(), li(), lj(), hint ); - CGAL_triangulation_postcondition( cell() != Cell_handle() ); + CGAL_postcondition( cell() != Cell_handle() ); jump_to_intersecting_cell(); } @@ -131,7 +131,7 @@ Triangulation_segment_cell_iterator_3::end() const { template < class Tr, class Inc > inline Triangulation_segment_cell_iterator_3& Triangulation_segment_cell_iterator_3::operator++() { - CGAL_triangulation_precondition( cell() != Cell_handle() ); + CGAL_precondition( cell() != Cell_handle() ); increment(); return *this; } @@ -169,8 +169,8 @@ operator!=( const SCI& sci ) const { template < class Tr, class Inc > inline bool Triangulation_segment_cell_iterator_3:: -operator==( Nullptr_t CGAL_triangulation_assertion_code(n) ) const { - CGAL_triangulation_assertion( n == NULL ); +operator==( Nullptr_t CGAL_assertion_code(n) ) const { + CGAL_assertion( n == NULL ); return cell() == Cell_handle(); } @@ -233,7 +233,7 @@ jump_to_intersecting_cell() template < class Tr, class Inc > void Triangulation_segment_cell_iterator_3:: walk_to_next() { - CGAL_triangulation_precondition( has_next() ); + CGAL_precondition( has_next() ); // Check if the target is in the current cell. int ti; @@ -463,7 +463,7 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre // For the remembering stochastic walk, we start trying with a random facet. int li = 0; - CGAL_triangulation_assertion_code( bool incell = true; ) + CGAL_assertion_code( bool incell = true; ) for( int k = 0; k < 4; ++k, ++li ) { // Skip the previous cell. @@ -485,7 +485,7 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre vert[li] = backup; continue; } - CGAL_triangulation_assertion_code( incell = false; ) + CGAL_assertion_code( incell = false; ) // Check if the target is inside the 3-wedge with // the source as apex and the facet as an intersection. @@ -547,15 +547,15 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre if(regular_case) { - CGAL_triangulation_assertion( std::get<0>(cur_after_walk)==nnext ); - CGAL_triangulation_assertion( li==outside ); - CGAL_triangulation_assertion( ! inside ); + CGAL_assertion( std::get<0>(cur_after_walk)==nnext ); + CGAL_assertion( li==outside ); + CGAL_assertion( ! inside ); } return std::make_pair(prev_after_walk, cur_after_walk); case 2: if(regular_case) - CGAL_triangulation_assertion(degenerate ); + CGAL_assertion(degenerate ); std::get<1>(prev_after_walk) = Tr::EDGE; std::get<1>(cur_after_walk) = Tr::EDGE; @@ -574,11 +574,11 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre return std::make_pair(prev_after_walk, cur_after_walk); } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return std::make_pair(prev, cur); case 1: if(regular_case) - CGAL_triangulation_assertion(degenerate ); + CGAL_assertion(degenerate ); std::get<1>(prev_after_walk) = Tr::VERTEX; std::get<1>(cur_after_walk) = Tr::VERTEX; @@ -592,22 +592,22 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre return std::make_pair(prev_after_walk, cur_after_walk); } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return std::make_pair(prev, cur); default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return std::make_pair(prev, cur); } } // The target lies inside this cell. Simplex prev_after_walk; - CGAL_triangulation_assertion( incell ); + CGAL_assertion( incell ); switch( op[0] + op[1] + op[2] + op[3] ) { case 4: - CGAL_triangulation_assertion( pos == 6 ); + CGAL_assertion( pos == 6 ); prev_after_walk = Simplex( std::get<0>(cur), Tr::CELL, -1, -1 ); - CGAL_triangulation_assertion( (! regular_case) || inside ); + CGAL_assertion( (! regular_case) || inside ); break; case 3: @@ -626,7 +626,7 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre break; default: prev_after_walk = Simplex( std::get<0>(cur), Tr::OUTSIDE_AFFINE_HULL, -1, -1 ); - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); } Simplex cur_after_walk(Cell_handle(), Tr::OUTSIDE_AFFINE_HULL, -1, -1); @@ -637,7 +637,7 @@ template < class Tr, class Inc > void Triangulation_segment_cell_iterator_3:: walk_to_next_3_inf( int inf ) { - CGAL_triangulation_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); + CGAL_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); // If this cell was reached by traversal from a finite one, it must be the final cell. Cell_handle fin = cell()->neighbor(inf); @@ -664,7 +664,7 @@ walk_to_next_3_inf( int inf ) } vert[inf] = &(_source); - CGAL_triangulation_assertion( _tr->orientation( *vert[0], *vert[1], *vert[2], *vert[3] ) == POSITIVE ); + CGAL_assertion( _tr->orientation( *vert[0], *vert[1], *vert[2], *vert[3] ) == POSITIVE ); int li = 0; // Check if the line enters an adjacent infinite cell. @@ -694,7 +694,7 @@ walk_to_next_3_inf( int inf ) // The target lies behind the plane through the source and two finite vertices. // Traverse to the incident infinite cell. - CGAL_triangulation_assertion( _tr->is_infinite( next ) ); + CGAL_assertion( _tr->is_infinite( next ) ); _prev = Simplex( cell(), Tr::FACET, li, -1 ); _cur = Simplex( next, Tr::FACET, next->index( prev_cell() ), -1 ); return; @@ -725,7 +725,7 @@ walk_to_next_3_inf( int inf ) return; } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; case 1: prev_lt() = Tr::VERTEX; @@ -737,10 +737,10 @@ walk_to_next_3_inf( int inf ) return; } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; } } @@ -802,7 +802,7 @@ walk_to_next_2() return; default: // The current vertex is the target. - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return; } } @@ -829,7 +829,7 @@ walk_to_next_2() _prev = Simplex( cell(), Tr::VERTEX, li(), -1 ); break; case 0: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); _prev = Simplex( cell(), Tr::OUTSIDE_AFFINE_HULL, -1, -1 ); break; } @@ -929,7 +929,7 @@ walk_to_next_2() if( op == POSITIVE ) _prev = Simplex( cell(), Tr::FACET, 3, -1 ); else { - CGAL_triangulation_assertion( op == ZERO ); + CGAL_assertion( op == ZERO ); switch( o ) { case POSITIVE: _prev = Simplex( cell(), Tr::EDGE, li(), lk ); @@ -1006,7 +1006,7 @@ walk_to_next_2() this->li() = cell()->index( prev_cell()->vertex( prev_li() ) ); return; default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; } } @@ -1017,7 +1017,7 @@ walk_to_next_2() return; } default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); } } @@ -1025,8 +1025,8 @@ template < class Tr, class Inc > void Triangulation_segment_cell_iterator_3:: walk_to_next_2_inf( int inf ) { - CGAL_triangulation_precondition( _tr->is_infinite( cell()->vertex(3) ) ); - CGAL_triangulation_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); + CGAL_precondition( _tr->is_infinite( cell()->vertex(3) ) ); + CGAL_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); // If this cell was reached by traversal from a finite one, it must be the final cell. Cell_handle fin = cell()->neighbor(inf); @@ -1126,9 +1126,9 @@ typename Triangulation_segment_cell_iterator_3::Edge Triangulation_segment_cell_iterator_3::opposite_edge( Cell_handle c, int li, int lj) const { - CGAL_triangulation_precondition(li >= 0 && li < 4); - CGAL_triangulation_precondition(lj >= 0 && lj < 4); - CGAL_triangulation_precondition(li != lj); + CGAL_precondition(li >= 0 && li < 4); + CGAL_precondition(lj >= 0 && lj < 4); + CGAL_precondition(li != lj); switch (6 - li - lj) { // i + j + missing indices = 6. case 1: return Edge(c, 0, 1); @@ -1138,7 +1138,7 @@ Triangulation_segment_cell_iterator_3::opposite_edge( case 5: return Edge(c, 2, 3); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Edge(); } diff --git a/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h index 927342b96be..de2bacddbbf 100644 --- a/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h @@ -19,7 +19,6 @@ #include -#include #include namespace CGAL { diff --git a/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h b/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h index 479d550af63..bc9c8ff3cb6 100644 --- a/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h @@ -22,8 +22,6 @@ #include -#include - namespace CGAL { template < class Repres > diff --git a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h index 7f8b2ce1dd3..8553a34a1b3 100644 --- a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -358,8 +358,8 @@ public: template < typename InputIterator > size_type remove_cluster(InputIterator first, InputIterator beyond) { - CGAL_triangulation_precondition(!this->does_repeat_in_range(first, beyond)); - CGAL_triangulation_precondition(!this->infinite_vertex_in_range(first, beyond)); + CGAL_precondition(!this->does_repeat_in_range(first, beyond)); + CGAL_precondition(!this->infinite_vertex_in_range(first, beyond)); size_type n = this->number_of_vertices(); std::vector vo(first, beyond), vc; int l=0; @@ -686,7 +686,7 @@ void Triangulation_hierarchy_3:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); hierarchy[l]->remove(v); @@ -702,8 +702,8 @@ void Triangulation_hierarchy_3:: remove_and_give_new_cells(Vertex_handle v, OutputItCells fit) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); if(l) hierarchy[l]->remove(v); @@ -719,7 +719,7 @@ typename Triangulation_hierarchy_3::Vertex_handle Triangulation_hierarchy_3:: move_if_no_collision(Vertex_handle v, const Point & p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; Vertex_handle ans; for (int l = 0; l < maxlevel; ++l) { @@ -739,7 +739,7 @@ typename Triangulation_hierarchy_3::Vertex_handle Triangulation_hierarchy_3:: move(Vertex_handle v, const Point & p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; Vertex_handle w = move_if_no_collision(v,p); if(w != v) { @@ -756,7 +756,7 @@ Triangulation_hierarchy_3:: move_if_no_collision_and_give_new_cells( Vertex_handle v, const Point & p, OutputItCells fit) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; Vertex_handle ans; for (int l = 0; l < maxlevel; ++l) { diff --git a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h index 76b0f7572e3..9aca45fae91 100644 --- a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -379,7 +379,7 @@ public: } // \} - bool operator==( Nullptr_t CGAL_triangulation_assertion_code(n) ) const; + bool operator==( Nullptr_t CGAL_assertion_code(n) ) const; bool operator!=( Nullptr_t n ) const; protected: @@ -422,9 +422,9 @@ private: private: inline int edgeIndex( int i, int j ) const { - CGAL_triangulation_precondition( i>=0 && i<=3 ); - CGAL_triangulation_precondition( j>=0 && j<=3 ); - CGAL_triangulation_precondition( i != j ); + CGAL_precondition( i>=0 && i<=3 ); + CGAL_precondition( j>=0 && j<=3 ); + CGAL_precondition( i != j ); return ( i==0 || j==0 ) ? i+j-1 : i+j; } diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h index 31158c0c9b1..9ccb879cffc 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -261,7 +261,7 @@ public: Face_handle f = Face_handle(), std::enable_if_t::value>* = nullptr) { - CGAL_triangulation_assertion((std::is_same::value)); + CGAL_assertion((std::is_same::value)); return insert(geom_traits().construct_point_on_sphere_2_object()(p), f); } @@ -474,7 +474,7 @@ typename Triangulation_on_sphere_2::Vertex_handle Delaunay_triangulation_on_sphere_2:: insert_third(const Point& p) { - CGAL_triangulation_assertion(number_of_vertices() == 2); + CGAL_assertion(number_of_vertices() == 2); Vertex_handle v = vertices_begin(); Vertex_handle u = v->face()->neighbor(0)->vertex(0); @@ -493,10 +493,10 @@ insert_third(const Point& p) nv->set_point(p); - CGAL_triangulation_assertion_code(Face_handle f = all_edges_begin()->first;) - CGAL_triangulation_assertion(orientation_on_sphere(point(f, 0), - point(f, 1), - point(f->neighbor(0), 1)) != RIGHT_TURN); + CGAL_assertion_code(Face_handle f = all_edges_begin()->first;) + CGAL_assertion(orientation_on_sphere(point(f, 0), + point(f, 1), + point(f->neighbor(0), 1)) != RIGHT_TURN); return nv; } @@ -516,7 +516,7 @@ insert_outside_affine_hull_regular(const Point& p) const Point& p1 = point(f, 1); const Point& p2 = point(fn, 1); - CGAL_triangulation_assertion(orientation_on_sphere(p0, p1, p2) != NEGATIVE); + CGAL_assertion(orientation_on_sphere(p0, p1, p2) != NEGATIVE); Orientation orient2 = side_of_oriented_circle(p0, p1, p2, p); if(orient2 == POSITIVE) @@ -587,7 +587,7 @@ insert(const Point& p, Locate_type lt, Face_handle loc, int /*li*/) } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return v; } @@ -606,7 +606,7 @@ insert(const Point& p, Face_handle start) return Vertex_handle(); case TOO_CLOSE: { - CGAL_triangulation_assertion(loc != Face_handle()); + CGAL_assertion(loc != Face_handle()); return loc->vertex(li); } case VERTEX: @@ -661,7 +661,7 @@ insert(InputIterator first, InputIterator beyond, points.reserve(input_points.size()); for(const P3_wit& p3wi : p3_points) { - CGAL_triangulation_assertion(p3wi.input_point_ptr != nullptr); + CGAL_assertion(p3wi.input_point_ptr != nullptr); points.push_back(*(p3wi.input_point_ptr)); } @@ -715,7 +715,7 @@ bool Delaunay_triangulation_on_sphere_2:: update_ghost_faces(Vertex_handle v, bool first) { - CGAL_triangulation_assertion(dimension() == 2); + CGAL_assertion(dimension() == 2); bool ghost_found = false; @@ -736,7 +736,7 @@ update_ghost_faces(Vertex_handle v, bool first) } else // not first { - CGAL_triangulation_assertion(v != Vertex_handle()); + CGAL_assertion(v != Vertex_handle()); Face_circulator fc = this->incident_faces(v, v->face()); Face_circulator done(fc); do @@ -763,7 +763,7 @@ void Delaunay_triangulation_on_sphere_2:: remove_1D(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); tds().remove_1D(v); } @@ -792,7 +792,7 @@ void Delaunay_triangulation_on_sphere_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); if(number_of_vertices() <= 3) tds().remove_dim_down(v); @@ -824,7 +824,7 @@ test_dim_down(Vertex_handle v) if(it4 == vertices_end()) break; - CGAL_triangulation_assertion(it != v && it2 != v && it3 != v && it4 != v); + CGAL_assertion(it != v && it2 != v && it3 != v && it4 != v); if(side_of_oriented_circle(it->point(), it2->point(), it3->point(), it4->point()) != ON_ORIENTED_BOUNDARY) return false; @@ -1134,7 +1134,7 @@ is_valid_face(Face_handle fh, bool verbose, int /*level*/) const { Orientation test = side_of_oriented_circle(fh, point(fh->vertex(i))); result = result && test == ON_ORIENTED_BOUNDARY; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } if(!result) @@ -1146,7 +1146,7 @@ is_valid_face(Face_handle fh, bool verbose, int /*level*/) const } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } @@ -1162,7 +1162,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid data structure" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1177,18 +1177,18 @@ is_valid(bool verbose, int level) const case 0: break; case 1: - CGAL_triangulation_assertion(this->is_plane()); + CGAL_assertion(this->is_plane()); break; case 2: for(All_faces_iterator it=all_faces_begin(); it!=all_faces_end(); ++it) { Orientation s = orientation_on_sphere(point(it, 0), point(it, 1), point(it, 2)); result = result && (s != NEGATIVE || it->is_ghost()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } result = result && (number_of_faces() == 2 * number_of_vertices() - 4); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; } @@ -1196,7 +1196,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << " number of vertices " << number_of_vertices() << "\t" << std::endl; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h index 95c12831583..ffb5d002aa0 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include @@ -101,14 +101,14 @@ public: // Check if r is on the same side of the plane orthogonal to the plane (c,p,q) // and going through c and p as q const Orientation op = _lk.coplanar_orientation_3_object()(_center, p, q, r); - CGAL_triangulation_assertion(op != COLLINEAR); + CGAL_assertion(op != COLLINEAR); if(op == NEGATIVE) return false; // Check if r is on the same side of the plane orthogonal to the plane (c,p,q) // and going through c and q as p const Orientation oq = _lk.coplanar_orientation_3_object()(_center, q, p, r); - CGAL_triangulation_assertion(oq != COLLINEAR); + CGAL_assertion(oq != COLLINEAR); if(oq == NEGATIVE) return false; diff --git a/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h b/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h index fd3675e4b7c..82a073dc5c6 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include diff --git a/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h b/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h index 4f69f9bf179..5673c7f597e 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h +++ b/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h @@ -17,8 +17,7 @@ #include #include - -#include +#include #include namespace CGAL { diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h index 0de37519ad3..743a1ca7026 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -417,7 +417,7 @@ public: Arc_on_sphere_2 segment_on_sphere(const Face_handle f, int i) const { - CGAL_triangulation_precondition(!is_ghost(f, i)); + CGAL_precondition(!is_ghost(f, i)); return geom_traits().construct_arc_on_sphere_2_object()(point(f, ccw(i)), point(f, cw(i))); } @@ -695,7 +695,7 @@ typename Triangulation_on_sphere_2::Face_handle Triangulation_on_sphere_2:: march_locate_1D(const Point& p, Locate_type& lt, int& li) const { - CGAL_triangulation_assertion(dimension() == 1); + CGAL_assertion(dimension() == 1); // Check if p is coplanar with the existing points first three points of the triangulation Face_handle f = all_edges_begin()->first; @@ -743,8 +743,8 @@ march_locate_2D(Face_handle f, Locate_type& lt, int& li) const { - CGAL_triangulation_precondition(dimension() == 2); - CGAL_triangulation_precondition(!is_ghost(f)); + CGAL_precondition(dimension() == 2); + CGAL_precondition(!is_ghost(f)); boost::rand48 rng; boost::uniform_smallint<> two(0, 1); @@ -973,7 +973,7 @@ march_locate_2D(Face_handle f, default: { // impossible - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return f; } } @@ -1221,21 +1221,21 @@ check_neighboring_faces() const { for(All_faces_iterator eit=all_faces_begin(); eit!=all_faces_end(); ++eit) { - CGAL_triangulation_assertion_code(const Face_handle f1 = eit->neighbor(0);) - CGAL_triangulation_assertion_code(const Face_handle f2 = eit->neighbor(1);) - CGAL_triangulation_assertion(f1->has_neighbor(eit)); - CGAL_triangulation_assertion(f2->has_neighbor(eit)); + CGAL_assertion_code(const Face_handle f1 = eit->neighbor(0);) + CGAL_assertion_code(const Face_handle f2 = eit->neighbor(1);) + CGAL_assertion(f1->has_neighbor(eit)); + CGAL_assertion(f2->has_neighbor(eit)); } } for(All_faces_iterator eit=all_faces_begin(); eit!=all_faces_end(); ++eit) { - CGAL_triangulation_assertion_code(const Face_handle f1 = eit->neighbor(0);) - CGAL_triangulation_assertion_code(const Face_handle f2 = eit->neighbor(1);) - CGAL_triangulation_assertion_code(const Face_handle f3 = eit->neighbor(2);) - CGAL_triangulation_assertion(f1->has_neighbor(eit)); - CGAL_triangulation_assertion(f2->has_neighbor(eit)); - CGAL_triangulation_assertion(f3->has_neighbor(eit)); + CGAL_assertion_code(const Face_handle f1 = eit->neighbor(0);) + CGAL_assertion_code(const Face_handle f2 = eit->neighbor(1);) + CGAL_assertion_code(const Face_handle f3 = eit->neighbor(2);) + CGAL_assertion(f1->has_neighbor(eit)); + CGAL_assertion(f2->has_neighbor(eit)); + CGAL_assertion(f3->has_neighbor(eit)); } } @@ -1257,7 +1257,7 @@ is_valid_vertex(Vertex_handle vh, bool verbose, int /*level*/) const show_face(vh->face()); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1283,7 +1283,7 @@ is_valid(bool verbose, { const Orientation s = orientation(point(it1), point(it2), point(it3)); result = result && (s == COLLINEAR); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); ++it1; ++it2; ++it3; } } @@ -1292,7 +1292,7 @@ is_valid(bool verbose, for(All_faces_iterator it=all_faces_begin(); it!=all_faces_end(); ++it) { const Orientation s = orientation_on_sphere(point(it, 0), point(it, 1), point(it, 2)); - CGAL_triangulation_assertion(s == LEFT_TURN || is_ghost(it)); + CGAL_assertion(s == LEFT_TURN || is_ghost(it)); result = result && (s == LEFT_TURN || is_ghost(it)); } @@ -1301,7 +1301,7 @@ is_valid(bool verbose, // which does not know the number of components nor the genus result = result && (number_of_faces() == (2 * number_of_vertices() - 4)); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; @@ -1340,7 +1340,7 @@ std::istream& operator>>(std::istream& is, Triangulation_on_sphere_2& tr) { tr.file_input(is); - CGAL_triangulation_assertion(tr.is_valid()); + CGAL_assertion(tr.is_valid()); return is; } diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h index fb5ba3d6605..3995430c2d9 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -94,7 +94,7 @@ bool write_OFF(std::ostream& os, index_of_vertex[vh] = i; } - CGAL_triangulation_assertion(i == n); + CGAL_assertion(i == n); size_type number_of_triangles = 0; for(Face_iterator fit = dt.all_faces_begin() ; fit != dt.all_faces_end() ; ++fit) diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h index 10ca5b89fc7..fbe52979939 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h @@ -15,7 +15,7 @@ #include -#include +#include #include #ifdef CGAL_EIGEN3_ENABLED @@ -103,7 +103,7 @@ void subsample_arc_on_sphere_2(const typename Kernel::Circle_3& circle, if(source > target) target += 2*CGAL_PI; - CGAL_triangulation_assertion(target > source); + CGAL_assertion(target > source); const double radius = sqrt(circle.squared_radius()); const double edge_len = (target - source) * radius; @@ -115,7 +115,7 @@ void subsample_arc_on_sphere_2(const typename Kernel::Circle_3& circle, for(int i=0; i(circle.center(), radius, current_theta, b1, b2); } *out_pts++ = compute_point(circle.center(), radius, target, b1, b2); diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h index e863d91a638..aa7ffa1ba47 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h @@ -14,7 +14,7 @@ #include -#include +#include namespace CGAL { @@ -347,7 +347,7 @@ inline bool Triangulation_sphere_line_face_circulator_2:: operator==(Nullptr_t CGAL_assertion_code(n)) const { - CGAL_triangulation_assertion(n == NULL); + CGAL_assertion(n == NULL); return pos == Face_handle(); } @@ -356,7 +356,7 @@ inline bool Triangulation_sphere_line_face_circulator_2:: operator!=(Nullptr_t n) const { - CGAL_triangulation_assertion(n == NULL); + CGAL_assertion(n == NULL); return !(*this == n); } From d191d4474a3213e05cc61d1d7ab76ff18a4d7681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Sep 2022 14:04:51 +0200 Subject: [PATCH 083/248] Revert "fix not documented warnings" This reverts commit 8d773c56348c4055d963c57426d60d118915d22b. --- .../doc/resources/1.8.13/BaseDoxyfile.in | 4 +- .../doc/resources/1.8.14/BaseDoxyfile.in | 3 +- .../doc/resources/1.8.20/BaseDoxyfile.in | 4 +- .../doc/resources/1.8.4/BaseDoxyfile.in | 2 +- .../doc/resources/1.9.3/BaseDoxyfile.in | 3 +- .../Implicit_to_labeling_function_wrapper.h | 6 +- .../Concepts/BisectionGeometricTraits_3.h | 65 ++++++-- Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h | 43 ++++- Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h | 23 ++- .../Concepts/MeshTriangulationTraits_3.h | 155 +++++++++++++++--- Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h | 35 +++- .../Mesh_domain_with_polyline_features_3.h | 16 +- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 8 +- 13 files changed, 287 insertions(+), 80 deletions(-) diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 8d8d6e7b864..7d6685977cf 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -352,9 +352,7 @@ ALIASES = "cgal=%CGAL" \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • "\ - "cgalEmptyDoc= " - + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index 48929055c1e..44a6b9f72b3 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -353,8 +353,7 @@ ALIASES = "cgal=%CGAL" \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " \ - "cgalEmptyDoc= " + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index b2e66a4fa3f..7f258d33a4b 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -375,8 +375,8 @@ ALIASES = "cgal=%CGAL" \ "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " \ - "cgalEmptyDoc= " + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " + # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 60a5e2b7b77..45d422384df 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -359,7 +359,7 @@ ALIASES+= "cgalParamNEnd= \htmlonly[block] \endhtmlonly \htmlonly[block] \endhtmlonly " \ "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ "cgalParamSectionEnd=\cgalParamNEnd" \ - "cgalParamPrecondition{1}=
  • Precondition: \1
  • " \ - "cgalEmptyDoc= " + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For diff --git a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h index 9a114c57afe..9a5b38be16d 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h @@ -27,8 +27,10 @@ class Implicit_multi_domain_to_labeling_function_wrapper public: /// \name Types /// @{ - typedef std::vector Function_vector; //!< \cgalEmptyDoc - typedef typename Function::Point Point_3; //!< \cgalEmptyDoc + //! + typedef std::vector Function_vector; + //! + typedef typename Function::Point Point_3; /// @} /// \name Creation diff --git a/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h index e6a9f2f0ff7..63e2311828f 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/BisectionGeometricTraits_3.h @@ -184,17 +184,60 @@ typedef unspecified_type Has_on_bounded_side_3; /// The following functions give access to the predicate and construction objects: /// @{ -Compute_scalar_product_3 compute_scalar_product_3_object(); //!< \cgalEmptyDoc -Compute_squared_distance_3 compute_squared_distance_3_object(); //!< \cgalEmptyDoc -Compute_squared_radius_3 compute_squared_radius_3_object(); //!< \cgalEmptyDoc -Construct_center_3 construct_center_3_object(); //!< \cgalEmptyDoc -Construct_midpoint_3 construct_midpoint_3_object(); //!< \cgalEmptyDoc -Construct_point_on_3 construct_point_on_3_object(); //!< \cgalEmptyDoc -Construct_scaled_vector_3 construct_scaled_vector_3_object(); //!< \cgalEmptyDoc -Construct_segment_3 construct_segment_3_object(); //!< \cgalEmptyDoc -Construct_translated_point_3 construct_translated_point_3_object(); //!< \cgalEmptyDoc -Construct_vector_3 construct_vector_3_object(); //!< \cgalEmptyDoc -Has_on_bounded_side_3 has_on_bounded_side_3_object(); //!< \cgalEmptyDoc +/*! + +*/ +Compute_scalar_product_3 compute_scalar_product_3_object(); + +/*! + +*/ +Compute_squared_distance_3 compute_squared_distance_3_object(); + +/*! + +*/ +Compute_squared_radius_3 compute_squared_radius_3_object(); + +/*! + +*/ +Construct_center_3 construct_center_3_object(); + +/*! + +*/ +Construct_midpoint_3 construct_midpoint_3_object(); + +/*! + +*/ +Construct_point_on_3 construct_point_on_3_object(); + +/*! + +*/ +Construct_scaled_vector_3 construct_scaled_vector_3_object(); + +/*! + +*/ +Construct_segment_3 construct_segment_3_object(); + +/*! + +*/ +Construct_translated_point_3 construct_translated_point_3_object(); + +/*! + +*/ +Construct_vector_3 construct_vector_3_object(); + +/*! + +*/ +Has_on_bounded_side_3 has_on_bounded_side_3_object(); /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h index ee856bff80e..a6ba2ba7d6f 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCellBase_3.h @@ -177,15 +177,42 @@ The class should provide storage, accessors and modificators for two `Vertex_han and two `Cell_handle`, and a cache value for sliverity.*/ /// @{ +/*! +*/ +void set_sliver_value(double value); + +/*! +*/ +double sliver_value() const; + +/*! +*/ +bool is_cache_valid() const; + +/*! +*/ +void reset_cache_validity() const; + +/*! + +*/ +Cell_handle next_intrusive() const; + +/*! + +*/ +void set_next_intrusive(Cell_handle); + +/*! + +*/ +Cell_handle previous_intrusive() const; + +/*! + +*/ +void set_previous_intrusive(Cell_handle); -void set_sliver_value(double value); //!< \cgalEmptyDoc -double sliver_value() const; //!< \cgalEmptyDoc -bool is_cache_valid() const; //!< \cgalEmptyDoc -void reset_cache_validity() const; //!< \cgalEmptyDoc -Cell_handle next_intrusive() const; //!< \cgalEmptyDoc -void set_next_intrusive(Cell_handle); //!< \cgalEmptyDoc -Cell_handle previous_intrusive() const; //!< \cgalEmptyDoc -void set_previous_intrusive(Cell_handle); //!< \cgalEmptyDoc /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h index 89e04567093..240f9b0f1fb 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomain_3.h @@ -189,10 +189,25 @@ Bbox_3 bbox() const; /// The following functions give access to the function objects: /// @{ -Construct_initial_points construct_initial_points_object(); //!< \cgalEmptyDoc -Is_in_domain is_in_domain_object(); //!< \cgalEmptyDoc -Do_intersect_surface do_intersect_surface_object(); //!< \cgalEmptyDoc -Construct_intersection construct_intersection_object(); //!< \cgalEmptyDoc +/*! + +*/ +Construct_initial_points construct_initial_points_object(); + +/*! + +*/ +Is_in_domain is_in_domain_object(); + +/*! + +*/ +Do_intersect_surface do_intersect_surface_object(); + +/*! + +*/ +Construct_intersection construct_intersection_object(); /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h index 350e601e55d..4d1af263528 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshTriangulationTraits_3.h @@ -328,32 +328,135 @@ public: /// The following functions give access to the predicate and construction objects: /// @{ - Do_intersect_3 do_intersect_3_object(); //!< \cgalEmptyDoc - Equal_3 equal_3_object(); //!< \cgalEmptyDoc - Is_degenerate_3 equal_3_object(); //!< \cgalEmptyDoc - Compare_weighted_squared_radius_3 compare_weighted_squared_radius_3_object(); //!< \cgalEmptyDoc - Compute_approximate_dihedral_angle_3 compute_approximate_dihedral_angle_3_object(); //!< \cgalEmptyDoc - Compute_area_3 compute_area_3_object(); //!< \cgalEmptyDoc - Compute_power_distance_to_power_sphere_3 compute_power_distance_to_power_sphere_3_object(); //!< \cgalEmptyDoc - Compute_squared_area_3 compute_squared_area_3_object(); //!< \cgalEmptyDoc - Compute_squared_distance_3 compute_squared_distance_3_object(); //!< \cgalEmptyDoc - Compute_squared_length_3 compute_squared_length_3_object(); //!< \cgalEmptyDoc - Compute_squared_radius_3 compute_squared_radius_3_object(); //!< \cgalEmptyDoc - Compute_squared_radius_smallest_orthogonal_sphere_3 compute_squared_radius_smallest_orthogonal_sphere_3_object(); //!< \cgalEmptyDoc - Compute_volume_3 compute_volume_3_object(); //!< \cgalEmptyDoc - Compute_weight_3 compute_weight_3_object(); //!< \cgalEmptyDoc - Construct_base_vector_3 construct_base_vector_3_object(); //!< \cgalEmptyDoc - Construct_orthogonal_vector_3 construct_orthogonal_vector_3_object(); //!< \cgalEmptyDoc - Construct_center_3 construct_center_3_object(); //!< \cgalEmptyDoc - Construct_midpoint_3 construct_midpoint_3_object(); //!< \cgalEmptyDoc - Construct_normal_3 construct_normal_3_object(); //!< \cgalEmptyDoc - Construct_sphere_3 construct_sphere_3_object(); //!< \cgalEmptyDoc - Construct_tetrahedron_3 construct_tetrahedron_3_object(); //!< \cgalEmptyDoc - Construct_translated_point_3 construct_translated_point_3_object(); //!< \cgalEmptyDoc - Construct_vector_3 construct_vector_3_object(); //!< \cgalEmptyDoc - Construct_scaled_vector_3 construct_scaled_vector_3_object(); //!< \cgalEmptyDoc - Construct_opposite_vector_3 construct_opposite_vector_3_object(); //!< \cgalEmptyDoc - Intersect_3 intersect_3_object(); //!< \cgalEmptyDoc + /*! + + */ + Do_intersect_3 do_intersect_3_object(); + + /*! + + */ + Equal_3 equal_3_object(); + + /*! + + */ + Is_degenerate_3 equal_3_object(); + + /*! + + */ + Compare_weighted_squared_radius_3 compare_weighted_squared_radius_3_object(); + + /*! + + */ + Compute_approximate_dihedral_angle_3 compute_approximate_dihedral_angle_3_object(); + + /*! + + */ + Compute_area_3 compute_area_3_object(); + + /*! + + */ + Compute_power_distance_to_power_sphere_3 compute_power_distance_to_power_sphere_3_object(); + + /*! + + */ + Compute_squared_area_3 compute_squared_area_3_object(); + + /*! + + */ + Compute_squared_distance_3 compute_squared_distance_3_object(); + + /*! + + */ + Compute_squared_length_3 compute_squared_length_3_object(); + + /*! + + */ + Compute_squared_radius_3 compute_squared_radius_3_object(); + + /*! + + */ + Compute_squared_radius_smallest_orthogonal_sphere_3 compute_squared_radius_smallest_orthogonal_sphere_3_object(); + + /*! + + */ + Compute_volume_3 compute_volume_3_object(); + + /*! + + */ + Compute_weight_3 compute_weight_3_object(); + + /*! + + */ + Construct_base_vector_3 construct_base_vector_3_object(); + + /*! + + */ + Construct_orthogonal_vector_3 construct_orthogonal_vector_3_object(); + + /*! + + */ + Construct_center_3 construct_center_3_object(); + + /*! + + */ + Construct_midpoint_3 construct_midpoint_3_object(); + + /*! + + */ + Construct_normal_3 construct_normal_3_object(); + + /*! + + */ + Construct_sphere_3 construct_sphere_3_object(); + + /*! + + */ + Construct_tetrahedron_3 construct_tetrahedron_3_object(); + + /*! + + */ + Construct_translated_point_3 construct_translated_point_3_object(); + + /*! + + */ + Construct_vector_3 construct_vector_3_object(); + + /*! + + */ + Construct_scaled_vector_3 construct_scaled_vector_3_object(); + + /*! + + */ + Construct_opposite_vector_3 construct_opposite_vector_3_object(); + + /*! + + */ + Intersect_3 intersect_3_object(); /// @} diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h index 854e92353ad..1b1cb0d712b 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshVertexBase_3.h @@ -91,12 +91,35 @@ Sets the special aspect of the vertex. */ void set_special(bool); -FT meshing_info() const; //!< \cgalEmptyDoc -void set_meshing_info(FT); //!< \cgalEmptyDoc -Vertex_handle next_intrusive() const; //!< \cgalEmptyDoc -void set_next_intrusive(Vertex_handle); //!< \cgalEmptyDoc -Vertex_handle previous_intrusive() const; //!< \cgalEmptyDoc -void set_previous_intrusive(Vertex_handle); //!< \cgalEmptyDoc +/*! + +*/ +FT meshing_info() const; + +/*! + +*/ +void set_meshing_info(FT); + +/*! + +*/ +Vertex_handle next_intrusive() const; + +/*! + +*/ +void set_next_intrusive(Vertex_handle); + +/*! + +*/ +Vertex_handle previous_intrusive() const; + +/*! + +*/ +void set_previous_intrusive(Vertex_handle); /// Get the erase counter. /// Only required by the parallel algorithms. diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index eec82744800..e9a58de83d5 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -536,20 +536,19 @@ class Mesh_domain_with_polyline_features_3 public: /// \name Types /// @{ - typedef typename MeshDomain_3::Surface_patch_index Surface_patch_index; //!< \cgalEmptyDoc - typedef typename MeshDomain_3::Subdomain_index Subdomain_index; //!< \cgalEmptyDoc - typedef int Curve_index; //!< \cgalEmptyDoc - typedef int Corner_index; //!< \cgalEmptyDoc + typedef typename MeshDomain_3::Surface_patch_index Surface_patch_index; + typedef typename MeshDomain_3::Subdomain_index Subdomain_index; + typedef int Curve_index; + typedef int Corner_index; - /// \cgalEmptyDoc typedef typename Mesh_3::internal::Index_generator_with_features< typename MeshDomain_3::Subdomain_index, Surface_patch_index, Curve_index, Corner_index>::type Index; - typedef CGAL::Tag_true Has_features; //!< \cgalEmptyDoc - typedef typename MeshDomain_3::R::FT FT; //!< \cgalEmptyDoc + typedef CGAL::Tag_true Has_features; + typedef typename MeshDomain_3::R::FT FT; /// @} #ifndef DOXYGEN_RUNNING @@ -568,7 +567,6 @@ public: /// of the base class. /// @{ - /// \cgalEmptyDoc template Mesh_domain_with_polyline_features_3(const T& ...o) : MeshDomain_3(o...) @@ -576,7 +574,7 @@ public: , current_curve_index_(1) , curves_aabb_tree_is_built(false) {} - Mesh_domain_with_polyline_features_3(const Mesh_domain_with_polyline_features_3&) = default; //!< \cgalEmptyDoc + Mesh_domain_with_polyline_features_3(const Mesh_domain_with_polyline_features_3&) = default; /// @} diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index adb245eddcb..17e69ff984c 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -138,10 +138,10 @@ public: /// \name Index types /// @{ /// The types are `int` or types compatible with `int`. - typedef typename Base::Corner_index Corner_index; //!< \cgalEmptyDoc - typedef typename Base::Curve_index Curve_index; //!< \cgalEmptyDoc - typedef typename Base::Surface_patch_index Surface_patch_index; //!< \cgalEmptyDoc - typedef typename Base::Subdomain_index Subdomain_index; //!< \cgalEmptyDoc + typedef typename Base::Corner_index Corner_index; + typedef typename Base::Curve_index Curve_index; + typedef typename Base::Surface_patch_index Surface_patch_index; + typedef typename Base::Subdomain_index Subdomain_index; /// @} /// @cond DEVELOPERS From 5023cb90cf0d38550f49b49f8332604fb2a8e436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Sep 2022 14:24:37 +0200 Subject: [PATCH 084/248] do no modify visibility and add macro to hide parts --- Mesh_3/doc/Mesh_3/Doxyfile.in | 4 +-- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 39 ++++++++++++++------- Mesh_3/include/CGAL/refine_mesh_3.h | 2 +- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 86d1772380e..13f34ec4653 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -37,6 +37,4 @@ HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg EXAMPLE_PATH += ${CGAL_PACKAGE_INCLUDE_DIR} # non-documented headers are advertised -EXTRACT_ALL = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES +EXCLUDE_SYMBOLS += details diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 2db08fddd40..17e526f983d 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -120,6 +120,7 @@ namespace internal { } // end namespace CGAL::Mesh_3::internal } // end namespace CGAL::Mesh_3 +#ifndef DOXYGEN_RUNNING struct Null_subdomain_index { template bool operator()(const T& x) const { return 0 == x; } @@ -133,11 +134,15 @@ struct Construct_pair_from_subdomain_indices { return result_type(a, b); } }; // end class template Construct_pair_from_subdomain_indices +#endif + +namespace details +{ template -class Labeled_mesh_domain_3_impl_details +class Labeled_mesh_domain_3_impl { protected: typedef Surface_patch_index_ Surface_patch_index; @@ -181,7 +186,7 @@ protected: typename Bounding_object, typename Null, typename Construct_surface_patch_index> - Labeled_mesh_domain_3_impl_details(const Function& f, + Labeled_mesh_domain_3_impl(const Function& f, const Bounding_object& bounding, const FT& error_bound, Construct_surface_patch_index cstr_s_p_i, @@ -215,7 +220,9 @@ protected: CGAL_Random_share_ptr_t p_rng_; // Error bound relative to sphere radius FT squared_error_bound_; -}; // Labeled_mesh_domain_3_impl_details +}; // Labeled_mesh_domain_3_impl + +} // namespace details /*! \ingroup PkgMesh3Domains @@ -277,9 +284,9 @@ template > class Labeled_mesh_domain_3 #ifndef DOXYGEN_RUNNING -: protected Labeled_mesh_domain_3_impl_details +: protected details::Labeled_mesh_domain_3_impl #endif { public: @@ -310,7 +317,6 @@ public: ///@} #else typedef boost::optional Subdomain; -#endif // Type of indexes for cells of the input complex typedef Surface_patch_index_ Surface_patch_index; @@ -322,10 +328,10 @@ public: Index_generator::Index Index; private: - typedef Labeled_mesh_domain_3_impl_details Impl_details; + typedef Labeled_mesh_domain_3_impl Impl_details; typedef typename Impl_details::Null Null; typedef typename Impl_details::Construct_surface_patch_index Construct_surface_patch_index; @@ -356,6 +362,7 @@ public: typedef typename BGT::FT FT; typedef BGT Geom_traits; using Impl_details::construct_pair_functor; +#endif /// \name Creation /// @{ @@ -397,6 +404,7 @@ public: {} ///@} +#ifndef DOXYGEN_RUNNING template Labeled_mesh_domain_3(const CGAL_NP_CLASS& np) :Impl_details(parameters::get_parameter(np, internal_np::function_param), @@ -424,6 +432,7 @@ public: parameters::relative_error_bound(error_bound)) {} #endif +#endif /// \name Creation of domains from 3D images /// @{ @@ -613,6 +622,7 @@ public: } /// @} +#ifndef DOXYGEN_RUNNING template static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& np) { @@ -676,7 +686,7 @@ public: { return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } - +#endif /// \name Creation of domains from implicit functions /// @{ @@ -751,6 +761,7 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } /// @} +#ifndef DOXYGEN_RUNNING template static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np = parameters::default_values()) { @@ -1298,9 +1309,11 @@ protected: public: // Returns bounding box const Iso_cuboid_3& bounding_box() const { return this->bbox_; } +#endif //DOXYGEN_RUNNING }; // end class Labeled_mesh_domain_3 +#ifndef DOXYGEN_RUNNING //------------------------------------------------------- // Method implementation //------------------------------------------------------- @@ -1382,7 +1395,7 @@ Construct_initial_points::operator()(OutputIterator pts, #endif return pts; } - +#endif } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 6d97ea56937..9aa5822c780 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -36,7 +36,7 @@ namespace CGAL { namespace details { -/** +/* * @class Insert_vertex_in_c3t3 * * A functor designed to insert unweighted points into the triangulation From 5592ae55e77ec1a1957d65efde7daeedf8589590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Sep 2022 14:41:08 +0200 Subject: [PATCH 085/248] update user manuals --- Mesh_3/doc/Mesh_3/Mesh_3.txt | 17 +++++------------ .../doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt | 17 +++++------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index fabeb649e60..ceceba81619 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -307,23 +307,16 @@ A 3D mesh generation process is launched through a call to one of the two following functions: \code{.cpp} -template +template C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); -template +template void refine_mesh_3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); \endcode The function `make_mesh_3()` generates from scratch a mesh @@ -581,7 +574,7 @@ is an isosurface defined by an implicit function. \cgalFigureRef{figureimplicit_domain} shows a cut view of the resulting mesh. -Note the use of named parameters (from Boost library) in the +Note the use of named parameters in the constructor of the `Mesh_criteria` instance. \cgalExample{Mesh_3/mesh_implicit_sphere.cpp} diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt index 5d1380e5950..2dc9e0781f1 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt @@ -256,23 +256,16 @@ A periodic 3D mesh generation process is launched through a call to one of the two following functions: \code{.cpp} -template +template C3T3 make_periodic_3_mesh_3(const PeriodicMeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); -template +template void refine_periodic_3_mesh_3(C3T3& c3t3, const PeriodicMeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); \endcode The function `make_periodic_3_mesh_3()` generates from scratch a periodic mesh @@ -444,7 +437,7 @@ These (purely visual) issues disappear when considering multiple copies together \subsection Periodic_3_mesh_33DDomainsImplicitIsosurfaces 3D Periodic Domains Bounded by Implicit Isosurfaces The following code produces a 3D periodic mesh for a domain whose boundary surface is an isosurface defined by an implicit function. -Note the use of named parameters (from the Boost library) in the +Note the use of named parameters in the constructor of the `Mesh_criteria` instance. \cgalFigureRef{Periodic_3_mesh_3Periodic_implicit_shape} shows the resulting mesh. From 6d09a886b2e7ba82cd1ee04373995d38d8b42bdd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 23 Sep 2022 14:12:53 +0100 Subject: [PATCH 086/248] Remove paragraph in the developer manual; Some fixes --- .../Bounding_volumes/PackageDescription.txt | 7 --- .../Developer_manual/Chapter_checks.txt | 49 +------------------ .../CGAL/Constrained_voronoi_diagram_2.h | 9 ++-- Mesh_3/include/CGAL/Mesh_3/Mesher_3.h | 4 +- 4 files changed, 9 insertions(+), 60 deletions(-) diff --git a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt index 6fa63e9c60d..7ec2b717b7b 100644 --- a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt +++ b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt @@ -20,12 +20,6 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} - -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks. \cgalClassifedRefPages @@ -62,4 +56,3 @@ checking off, cf. Section \ref secchecks. - `CGAL::Min_sphere_of_spheres_d` - `MinSphereOfSpheresTraits` */ - diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt index 1a6fb78e4cb..209aeca5649 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt @@ -156,53 +156,8 @@ the computation is done with some exact number type. \section secchecks_controlling Controlling checks at a finer granularity The macros and related compile-time flags described so far all operate -on the whole library. Sometimes the user may want to have a more -selective control. \cgal offers the possibility to turn checks on -and off on a per-package basis. Therefore a package-specific term is -inserted in the macro names directly after the \cgal prefix, -e.g., `CGAL_kernel_assertion()`. Similarly, the uppercase -term is used for the compile-time flags; -e.g., `CGAL_KERNEL_NO_WARNINGS` switches off the warnings -in only the kernel. Other packages have their own specific -terms as documented in the corresponding chapters of the -reference manual. - -For a new package you will first have to create a suitable header file -with all macro definitions. This is done with the shell script -cgal_create_assertions.sh, to be found in the -scripts directory. - -The following command will create a file optimisation_assertions.h: - -
    - sh cgal_create_assertions.sh optimisation - -
    - -You should place the generated file in the proper directory (and possibly -rename it). Then you can use the checks in the following fashion. - -\code{.cpp} - #include - - void optimisation_foo( int i) - { - CGAL_optimisation_precondition_msg( i == 42, "Only 42 allowed!"); - // ... - } -\endcode - -The documentation of your new package has to name the term chosen to be -part of the package-specific macros in -order to enable the user to selectively turn off and on the checks of -your package. For example, in the documentation of the optimisation -package you can find a sentence similar to the following. -
    - The optimisation code uses the term OPTIMISATION for the checks; - e.g., setting the compile time flag - `CGAL_OPTIMISATION_NO_PRECONDITIONS` switches off precondition - checking in the optimisation code. -
    +on the whole library. \cgal offers the possibility to turn checks on +and off just for the kernel. \section secchecks_cgal_assume Suppress warnings using CGAL_assume. diff --git a/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h b/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h index b03ca56d811..eb61e4bf50a 100644 --- a/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h +++ b/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace CGAL { @@ -415,8 +416,8 @@ template Cvd_cell_2 dual(const Tr& tr, const typename Tr::Vertex_handle& v) { - CGAL_triangulation_precondition( v != typename Tr::Vertex_handle()); - CGAL_triangulation_precondition( !tr.is_infinite(v)); + CGAL_precondition( v != typename Tr::Vertex_handle()); + CGAL_precondition( !tr.is_infinite(v)); Constrained_voronoi_diagram_2 diagram(tr); return diagram.cvd_cell(v); @@ -436,8 +437,8 @@ Cvd_cell_2 dual(const Tr& tr, // typedef Tr::Geom_traits::Ray_2 Ray; // typedef Tr::Geom_traits::Vector_2 Vector_2; // -// CGAL_triangulation_precondition( v != Vertex_handle()); -// CGAL_triangulation_precondition( !tr.is_infinite(v)); +// CGAL_precondition( v != Vertex_handle()); +// CGAL_precondition( !tr.is_infinite(v)); // // // The Circulator moves ccw. // std::vector segments; diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index 1a13e725a44..e8f105cd241 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -568,7 +568,7 @@ refine_mesh(std::string dump_after_refine_surface_prefix) std::cerr << "Total refining surface time: " << timer.time() << "s" << std::endl; std::cerr << std::endl; - CGAL_triangulation_postcondition(r_tr.is_valid()); + CGAL_postcondition(r_tr.is_valid()); elapsed_time += timer.time(); timer.stop(); timer.reset(); timer.start(); @@ -613,7 +613,7 @@ refine_mesh(std::string dump_after_refine_surface_prefix) std::cerr << "Total refining time: " << timer.time()+elapsed_time << "s" << std::endl; std::cerr << std::endl; - CGAL_triangulation_postcondition(r_tr.is_valid()); + CGAL_postcondition(r_tr.is_valid()); #endif (void)(forced_stop()); // sets *error_code From 363d1daaefe1270cc83e8a32aa4f9484f5461957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 23 Sep 2022 15:19:51 +0200 Subject: [PATCH 087/248] Some more conversions to non-package specific assertions --- Alpha_shapes_2/include/CGAL/Alpha_shape_2.h | 1 - .../Apollonius_graph_hierarchy_2_impl.h | 4 ++-- Hyperbolic_triangulation_2/TODO | 2 +- Mesh_3/benchmark/Mesh_3/StdAfx.h | 1 - Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h | 1 - .../CGAL/Periodic_3_mesh_triangulation_3.h | 4 ++-- .../demo/Periodic_Lloyd_3/Scene.h | 4 ++-- .../Periodic_3_triangulation_ds_cell_base_3.h | 2 +- ...ic_4_hyperbolic_triangulation_face_base_2.h | 4 ++-- .../include/CGAL/compute_average_spacing.h | 1 - .../include/CGAL/estimate_scale.h | 1 - .../connected_components.h | 3 --- .../Plugins/Mesh_3/C3t3_io_plugin.cpp | 6 +++--- .../include/CGAL/Simplicial_mesh_cell_base_3.h | 2 +- SearchStructures/include/CGAL/Segment_tree_d.h | 18 +++++++++--------- .../include/CGAL/Skin_surface_base_3.h | 4 ++-- .../Orbifold_Tutte_parameterizer_3.h | 1 - TDS_2/include/CGAL/Triangulation_ds_face_2.h | 4 ++-- 18 files changed, 27 insertions(+), 36 deletions(-) diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index 072ef376ced..373dc515573 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index ba13844eb0e..a5369929afe 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -332,8 +332,8 @@ void Apollonius_graph_hierarchy_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition( v != Vertex_handle()); - CGAL_triangulation_precondition( !is_infinite(v)); + CGAL_precondition( v != Vertex_handle()); + CGAL_precondition( !is_infinite(v)); // get the hidden circles typename Apollonius_graph_base::Site_list wp_list; diff --git a/Hyperbolic_triangulation_2/TODO b/Hyperbolic_triangulation_2/TODO index 8f691736b3d..0bc3cc547d9 100644 --- a/Hyperbolic_triangulation_2/TODO +++ b/Hyperbolic_triangulation_2/TODO @@ -8,7 +8,7 @@ class Construct_hyperbolic_bisector_2 Hyperbolic_segment_2 operator()(Point_2 p, Point_2 q, Point_2 r) at the end the following lines are giving the wrong arc (wrong orientation), aren't they? - CGAL_triangulation_assertion(assign(pair,inters[1])); + CGAL_assertion(assign(pair,inters[1])); if ( Orientation_2()(approx_c,approx_a,approx_pinf) == POSITIVE ) return Circular_arc_2( *c_pq, pair.first, a); return Circular_arc_2( *c_pq, a, pair.first); diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index e28abce381a..a07ee4b3f16 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -253,7 +253,6 @@ #include #include //#include -//#include //#include //#include //#include diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index bcccc5e3970..97ec27d45e2 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h index 64f113fa331..61d39cf6279 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h @@ -715,8 +715,8 @@ public: const Facet* /* this_facet_must_be_in_the_cz */ = nullptr, bool* /* the_facet_is_in_its_cz */ = nullptr) const { - CGAL_triangulation_precondition(could_lock_zone == nullptr); - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(could_lock_zone == nullptr); + CGAL_precondition(number_of_vertices() != 0); clear_v_offsets(); diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h index 6173cd701a0..eed30ec2d3b 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h @@ -62,8 +62,8 @@ struct Scene { y = (y < d.ymin() ? y+d.ymax()-d.ymin() : (y >= d.ymax() ? y-d.ymax()+d.ymin() : y)); - CGAL_triangulation_postcondition((d.xmin()<=x)&&(x= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); CGAL_assume( i >= 0 && i <= 3 ); return V[i]; } diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h index 4488e67b5f0..23b0972241b 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h @@ -72,13 +72,13 @@ public: Hyperbolic_translation translation(int i) const { - CGAL_triangulation_precondition(i >= 0 && i <= 2); + CGAL_precondition(i >= 0 && i <= 2); return o[i]; } void set_translation(const int& k, const Hyperbolic_translation& new_o) { - CGAL_triangulation_precondition(k >= 0 && k <= 2); + CGAL_precondition(k >= 0 && k <= 2); o[k] = new_o; } diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index 9b05a634aaf..750bc40ae23 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/estimate_scale.h b/Point_set_processing_3/include/CGAL/estimate_scale.h index 32be7a82ffd..91e66704aff 100644 --- a/Point_set_processing_3/include/CGAL/estimate_scale.h +++ b/Point_set_processing_3/include/CGAL/estimate_scale.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index 1b0b7e2e791..c5432795048 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -32,9 +32,6 @@ #include #include -#include -#include - #include #include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 3f2b08782fb..28c02726c32 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -341,9 +341,9 @@ struct Fake_CDT_3_cell_base : public Cb int constrained_facet[4]; bool _restoring[6]; int to_edge_index( int li, int lj ) const { - CGAL_triangulation_precondition( li >= 0 && li < 4 ); - CGAL_triangulation_precondition( lj >= 0 && lj < 4 ); - CGAL_triangulation_precondition( li != lj ); + CGAL_precondition( li >= 0 && li < 4 ); + CGAL_precondition( lj >= 0 && lj < 4 ); + CGAL_precondition( li != lj ); return ( li==0 || lj==0 ) ? li+lj-1 : li+lj; } diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h index ebfbb70736b..ee49f572236 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h @@ -93,7 +93,7 @@ public: // ACCESS FUNCTIONS Vertex_handle vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); return V[i]; } diff --git a/SearchStructures/include/CGAL/Segment_tree_d.h b/SearchStructures/include/CGAL/Segment_tree_d.h index e116f5f9c0c..732a9596f91 100644 --- a/SearchStructures/include/CGAL/Segment_tree_d.h +++ b/SearchStructures/include/CGAL/Segment_tree_d.h @@ -533,9 +533,9 @@ public: } else { - CGAL_Tree_warning_msg(m_interface.comp(m_interface.get_left(*count), - m_interface.get_right(*count)), - "invalid segment ignored"); + CGAL_warning_msg(m_interface.comp(m_interface.get_left(*count), + m_interface.get_right(*count)), + "invalid segment ignored"); } count++; } @@ -627,9 +627,9 @@ public: if(is_less_equal(m_interface.get_right_win(win), m_interface.get_left_win(win))) { - CGAL_Tree_warning_msg(m_interface.comp(m_interface.get_right_win(win), - m_interface.get_left_win(win)), - "invalid window -- query ignored"); + CGAL_warning_msg(m_interface.comp(m_interface.get_right_win(win), + m_interface.get_left_win(win)), + "invalid window -- query ignored"); return result; } link_type v = root(); @@ -680,9 +680,9 @@ public: if(is_less_equal(m_interface.get_right_win(win), m_interface.get_left_win(win))) { - CGAL_Tree_warning_msg(m_interface.comp(m_interface.get_right_win(win), - m_interface.get_left_win(win)), - "invalid window -- query ignored"); + CGAL_warning_msg(m_interface.comp(m_interface.get_right_win(win), + m_interface.get_left_win(win)), + "invalid window -- query ignored"); return result; } link_type v = root(); diff --git a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h index 00f97708e78..6962b1ec8f2 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h @@ -655,8 +655,8 @@ locate_in_tmc(const Bare_point &p0, TMC_Cell_handle start) const if (start->has_vertex(_tmc.infinite_vertex(), ind_inf) ) start = start->neighbor(ind_inf); - CGAL_triangulation_precondition(start != TMC_Cell_handle()); - CGAL_triangulation_precondition(!start->has_vertex(_tmc.infinite_vertex())); + CGAL_precondition(start != TMC_Cell_handle()); + CGAL_precondition(!start->has_vertex(_tmc.infinite_vertex())); // We implement the remembering visibility/stochastic walk. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 1eb0b485d45..39070956d64 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_2.h index e617e4c3320..7aee9a181a3 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_2.h @@ -67,7 +67,7 @@ typename Triangulation_ds_face_2::Vertex_handle Triangulation_ds_face_2:: mirror_vertex(int i) const { - CGAL_triangulation_precondition ( this->neighbor(i) != Face_handle() + CGAL_precondition ( this->neighbor(i) != Face_handle() && this->dimension() >= 1); //return neighbor(i)->vertex(neighbor(i)->index(this->handle())); return this->neighbor(i)->vertex(mirror_index(i)); @@ -79,7 +79,7 @@ Triangulation_ds_face_2:: mirror_index(int i) const { // return the index of opposite vertex in neighbor(i); - CGAL_triangulation_precondition (this->neighbor(i) != Face_handle() && + CGAL_precondition (this->neighbor(i) != Face_handle() && this->dimension() >= 1); if (this->dimension() == 1) { return 1 - (this->neighbor(i)->index(this->vertex(1-i))); From db7a4e9945399e533e1832a943625aeaeee679a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Sep 2022 15:21:25 +0200 Subject: [PATCH 088/248] add missing namespace --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 17e526f983d..1abeb2a1f11 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -328,10 +328,10 @@ public: Index_generator::Index Index; private: - typedef Labeled_mesh_domain_3_impl Impl_details; + typedef details::Labeled_mesh_domain_3_impl Impl_details; typedef typename Impl_details::Null Null; typedef typename Impl_details::Construct_surface_patch_index Construct_surface_patch_index; From 79d23743042f6b9b4a46daedad9629ed18ad239a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 23 Sep 2022 15:25:30 +0200 Subject: [PATCH 089/248] tiny indentation fix --- TDS_2/include/CGAL/Triangulation_ds_face_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_2.h index 7aee9a181a3..4cad650dbc3 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_2.h @@ -68,7 +68,7 @@ Triangulation_ds_face_2:: mirror_vertex(int i) const { CGAL_precondition ( this->neighbor(i) != Face_handle() - && this->dimension() >= 1); + && this->dimension() >= 1); //return neighbor(i)->vertex(neighbor(i)->index(this->handle())); return this->neighbor(i)->vertex(mirror_index(i)); } @@ -80,7 +80,7 @@ mirror_index(int i) const { // return the index of opposite vertex in neighbor(i); CGAL_precondition (this->neighbor(i) != Face_handle() && - this->dimension() >= 1); + this->dimension() >= 1); if (this->dimension() == 1) { return 1 - (this->neighbor(i)->index(this->vertex(1-i))); } From 300fbb1131b8097df8fdbb8ecbbb7638754140b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 23 Sep 2022 17:44:57 +0200 Subject: [PATCH 090/248] this is actually not deprecated --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 98668866d92..b3f61d04fdb 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -165,7 +165,6 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } } -#ifndef CGAL_NO_DEPRECATED_CODE #ifndef DOXYGEN_RUNNING template Mesh_optimization_return_code @@ -184,7 +183,6 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va * (and any other type could). */ template - CGAL_DEPRECATED Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, const int max_iterations, @@ -201,7 +199,6 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } template - CGAL_DEPRECATED Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, const int max_iterations, @@ -245,7 +242,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va return rc; } #endif // DOXYGEN_RUNNING -#endif // CGAL_NO_DEPRECATED_CODE + } //end namespace CGAL #endif From 54a6462273c7f4ec7f9f2b0be19a5620b2ea1baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 26 Sep 2022 20:09:58 +0200 Subject: [PATCH 091/248] move code so that we can reinject mesh_3 parameters functions into NFP class --- ...tialize_triangulation_from_labeled_image.h | 2 +- .../CGAL/Mesh_3/internal/check_weights.h | 4 +- Mesh_3/include/CGAL/Mesh_3/parameters.h | 552 +----------------- .../include/CGAL/Mesh_3/parameters_defaults.h | 12 +- Mesh_3/include/CGAL/Mesh_error_code.h | 8 +- Mesh_3/include/CGAL/make_mesh_3.h | 4 +- .../include/CGAL/make_periodic_3_mesh_3.h | 10 +- .../Polyhedron/Plugins/Mesh_3/Mesh_function.h | 2 +- .../CGAL/SMDS_3/internal/indices_management.h | 8 +- .../include/CGAL/Named_function_parameters.h | 182 +++--- .../STL_Extension/internal}/Has_features.h | 11 +- .../internal/mesh_option_classes.h | 229 ++++++++ .../internal/mesh_parameters_interface.h | 370 ++++++++++++ 13 files changed, 731 insertions(+), 663 deletions(-) rename {SMDS_3/include/CGAL/SMDS_3 => STL_Extension/include/CGAL/STL_Extension/internal}/Has_features.h (82%) create mode 100644 STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h create mode 100644 STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 74bb943f76e..2b1aa1d4757 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -107,7 +107,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, if(protect_features) { init_tr_from_labeled_image_call_init_features (c3t3, domain, criteria, - CGAL::Mesh_3::internal::Has_features()); + CGAL::internal::Has_features()); } const double max_v = (std::max)((std::max)(image.vx(), diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h b/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h index 4d228953ad5..b1c6080f30c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -33,7 +33,7 @@ template bool has_non_protecting_weights(const Triangulation& tr, const MeshDomain&) { - const bool with_features = Has_features::value; + const bool with_features = ::CGAL::internal::Has_features::value; typedef typename Triangulation::FT FT; typedef typename Triangulation::Weighted_point Weighted_point; diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 0c89e18a278..39146e8e5e9 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -13,556 +13,22 @@ #include #include -#include +#include #include -#include +#include namespace CGAL { - namespace parameters { -namespace internal { +#define CGAL_NP_BASE internal_np::No_property +#define CGAL_NP_BUILD(P, V) P(V) + +#include -const int undef_parameter = -1; +#undef CGAL_NP_BASE +#undef CGAL_NP_BUILD -// Helpers -struct Optimization_options_base -{ - Optimization_options_base(bool b) - : b_(b), time_limit_(undef_parameter), bound_(undef_parameter) {} +} } // end of CGAL::parameters namespace - operator bool() const { return b_; } - - bool is_time_limit_set() const { return time_limit_ != undef_parameter; } - void set_time_limit(double d) { time_limit_ = d; } - double time_limit() const { return time_limit_; } - - bool is_bound_set() const { return bound_ != undef_parameter; } - void set_bound(double d) { bound_ = d; } - double bound() const { return bound_; } - -private: - bool b_; - double time_limit_; - double bound_; -}; - -struct Global_optimization_options_base -{ - Global_optimization_options_base() - : convergence_(undef_parameter), max_it_nb_(undef_parameter) {} - - bool is_convergence_set() const { return convergence_ != undef_parameter; } - void set_convergence(double d) { convergence_ = d; } - double convergence() const { return convergence_; } - - bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } - void set_max_iteration_number(int i) { max_it_nb_ = i; } - int max_iteration_number() const { return max_it_nb_; } - -private: - double convergence_; - int max_it_nb_; -}; - -// Perturb -struct Perturb_options : public Optimization_options_base -{ - Perturb_options(bool b) : Optimization_options_base(b) {} -}; - -// Exude -struct Exude_options : public Optimization_options_base -{ - Exude_options(bool b) : Optimization_options_base(b) {} -}; - -// Odt -struct Odt_options : public Optimization_options_base -, public Global_optimization_options_base -{ - Odt_options(bool b) : Optimization_options_base(b) - , Global_optimization_options_base() {} -}; - -// Lloyd -struct Lloyd_options : public Optimization_options_base -, public Global_optimization_options_base -{ - Lloyd_options(bool b) : Optimization_options_base(b) - , Global_optimization_options_base() {} -}; - -// Manifold -struct Manifold_options { - enum { - NON_MANIFOLD = 0, - MANIFOLD_WITH_BOUNDARY = 8, - NO_BOUNDARY = 16, - MANIFOLD = 24 - }; - - Manifold_options(const int topology) - : mesh_topology(topology) - {} - Manifold_options() - : mesh_topology(NON_MANIFOLD) - {} - - int mesh_topology; -}; - -// Various Mesh_3 option -struct Mesh_3_options { -#ifndef CGAL_NO_ATOMIC - typedef std::atomic* Pointer_to_stop_atomic_boolean_t; -#else - typedef bool* Pointer_to_stop_atomic_boolean_t; -#endif - Mesh_3_options(bool nonlinear = false) - // This parameter `nonlinear` adds a compatibility with previous - // API of the constructor of `C3t3_initializer`. - // -- Laurent Rineau, 2019/05/03 - : dump_after_init_prefix() - , dump_after_refine_surface_prefix() - , dump_after_refine_prefix() - , dump_after_glob_opt_prefix() - , dump_after_perturb_prefix() - , dump_after_exude_prefix() - , number_of_initial_points(-1) - , nonlinear_growth_of_balls(nonlinear) - , maximal_number_of_vertices(0) - , pointer_to_error_code(0) -#ifndef CGAL_NO_ATOMIC - , pointer_to_stop_atomic_boolean(0) -#endif - {} - - std::string dump_after_init_prefix; - std::string dump_after_refine_surface_prefix; - std::string dump_after_refine_prefix; - std::string dump_after_glob_opt_prefix; - std::string dump_after_perturb_prefix; - std::string dump_after_exude_prefix; - int number_of_initial_points; - bool nonlinear_growth_of_balls; - std::size_t maximal_number_of_vertices; - Mesh_error_code* pointer_to_error_code; -#ifndef CGAL_NO_ATOMIC - Pointer_to_stop_atomic_boolean_t pointer_to_stop_atomic_boolean; -#endif - -}; // end struct Mesh_3_options - -// Features -struct Features_options -{ - Features_options(bool b) : b_(b) {} - bool features() const { return b_; } -private: - bool b_; -}; - -// ----------------------------------- -// Features generator -// ----------------------------------- -// struct Features_option_generator -template -struct Features_options_generator {}; - -template<> -struct Features_options_generator -{ - Features_options operator()() { return Features_options(true); } -}; - -template<> -struct Features_options_generator -{ - Features_options operator()() { return Features_options(false); } -}; - -// struct Domain_features_generator is designed to handle cases where -// MeshDomain::Has_features is not a valid type -template< typename MeshDomain, bool MeshDomainHasHasFeatures > -struct Domain_features_generator {}; - -template< typename MeshDomain > -struct Domain_features_generator< MeshDomain, false > -{ - Features_options operator()() - { - return Features_options_generator()(); - } -}; - -template< typename MeshDomain > -struct Domain_features_generator< MeshDomain, true > -{ - Features_options operator()() - { - return Features_options_generator()(); - } -}; - -} // end namespace internal - - - -// ----------------------------------- -// Reset_c3t3 (undocumented) -// ----------------------------------- -inline -Named_function_parameters -reset_c3t3() -{ - return Named_function_parameters(true); -} - -inline -Named_function_parameters -no_reset_c3t3() -{ - return Named_function_parameters(false); -} - -// ----------------------------------- -// Perturb -// ----------------------------------- -template -Named_function_parameters -perturb(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); - double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - - internal::Perturb_options options(true); - - if ( internal::undef_parameter != time_limit) - options.set_time_limit(time_limit); - - options.set_bound(sliver_bound); - typedef Named_function_parameters Param; - return Param(options); -} - -template -Named_function_parameters -perturb(const CGAL_NP_CLASS& ... nps) -{ - return perturb(internal_np::combine_named_parameters(nps...)); -} - - -inline Named_function_parameters -no_perturb() -{ - typedef Named_function_parameters Param; - return Param(internal::Perturb_options(false)); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -CGAL_DEPRECATED -inline -Named_function_parameters -perturb(double time_limit_, - double sliver_bound_=0) -{ - return perturb(time_limit(time_limit_). - sliver_bound(sliver_bound_)); -} -#endif - -// ----------------------------------- -// Exude -// ----------------------------------- -template -Named_function_parameters -exude(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),internal::undef_parameter); - double sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),default_values_for_mesh_3::perturb_sliver_bound); - - internal::Exude_options options(true); - - if ( internal::undef_parameter != time_limit) - options.set_time_limit(time_limit); - options.set_bound(sliver_bound); - typedef Named_function_parameters Param; - - return Param(options); -} - -template -Named_function_parameters -exude(const CGAL_NP_CLASS& ... nps) -{ - return exude(internal_np::combine_named_parameters(nps...)); -} - -inline Named_function_parameters -no_exude() -{ - typedef Named_function_parameters Param; - return Param(internal::Exude_options(false)); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -CGAL_DEPRECATED -inline -Named_function_parameters -exude(double time_limit_, - double sliver_bound_ = 0) -{ - return exude(time_limit(time_limit_).sliver_bound(sliver_bound_)); -} -#endif - -// ----------------------------------- -// Odt -// ----------------------------------- -template -Named_function_parameters -odt(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::odt_freeze_ratio); - double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::odt_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); - internal::Odt_options options(true); - - options.set_time_limit(time_limit); - options.set_bound(freeze_bound); - options.set_convergence(convergence); - options.set_max_iteration_number(max_iteration_number); - typedef Named_function_parameters Param; - return Param(options); -} - -template -Named_function_parameters -odt(const CGAL_NP_CLASS& ... nps) -{ - return odt(internal_np::combine_named_parameters(nps...)); -} - -inline Named_function_parameters -no_odt() -{ - typedef Named_function_parameters Param; - return Param(internal::Odt_options(false)); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -CGAL_DEPRECATED -inline -Named_function_parameters -odt(double time_limit_, - std::size_t max_iteration_number_ = 0, - double convergence_ = 0.02, - double freeze_bound_ = 0.01, - bool do_freeze_ = true) -{ - return odt(time_limit(time_limit_). - max_iteration_number(max_iteration_number_). - convergence(convergence_). - freeze_bound(freeze_bound_). - do_freeze(do_freeze_)); -} -#endif - -// ----------------------------------- -// Lloyd -// ----------------------------------- -template -Named_function_parameters -lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); - double freeze_bound = choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),default_values_for_mesh_3::lloyd_freeze_ratio); - double convergence = choose_parameter(get_parameter(np,internal_np::convergence_ratio), default_values_for_mesh_3::lloyd_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,internal_np::number_of_iterations), 0); - internal::Lloyd_options options(true); - - options.set_time_limit(time_limit); - options.set_bound(freeze_bound); - options.set_convergence(convergence); - options.set_max_iteration_number(max_iteration_number); - - typedef Named_function_parameters Param; - return Param(options); -} - -template -Named_function_parameters -lloyd(const CGAL_NP_CLASS& ... nps) -{ - return lloyd(internal_np::combine_named_parameters(nps...)); -} - -inline Named_function_parameters -no_lloyd() -{ - typedef Named_function_parameters Param; - return Param(internal::Lloyd_options(false)); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -CGAL_DEPRECATED -inline -Named_function_parameters -lloyd(double time_limit_, - std::size_t max_iteration_number_ = 0, - double convergence_ = 0.02, - double freeze_bound_ = 0.01, - bool do_freeze_= true) -{ - return lloyd(time_limit(time_limit_). - max_iteration_number(max_iteration_number_). - convergence(convergence_). - freeze_bound(freeze_bound_). - do_freeze(do_freeze_)); -} -#endif - -// ----------------------------------- -// Manifold options -// ----------------------------------- -template -Named_function_parameters -manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - int mesh_topology = choose_parameter(get_parameter(np, internal_np::mesh_topology_number), -1); - internal::Manifold_options options; - options.mesh_topology = mesh_topology; - - typedef Named_function_parameters Param; - return Param(options); -} - - -template -Named_function_parameters -manifold_options(const CGAL_NP_CLASS& ... nps) -{ - return manifold_options(internal_np::combine_named_parameters(nps...)); -} - -inline Named_function_parameters -manifold() -{ - typedef Named_function_parameters Param; - return Param(internal::Manifold_options(internal::Manifold_options::MANIFOLD)); -} -inline Named_function_parameters -manifold_with_boundary() -{ - typedef Named_function_parameters Param; - return Param(internal::Manifold_options( - internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); -} -inline Named_function_parameters -non_manifold() -{ - typedef Named_function_parameters Param; - return Param(internal::Manifold_options(internal::Manifold_options::NON_MANIFOLD)); -} - -// ----------------------------------- -// Mesh options -// ----------------------------------- - -// Undocumented parameter for refine_mesh_3 and make_mesh_3. -// Allows to dump the mesh at given stage of the mesh generation -// algorithm. -template -Named_function_parameters -mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - internal::Mesh_3_options options; - - options.dump_after_init_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_init_prefix_param), ""); - options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); - options.dump_after_refine_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_prefix_param), ""); - options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_glob_opt_prefix_param), ""); - options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_perturb_prefix_param), ""); - options.dump_after_exude_prefix=choose_parameter(get_parameter(np, internal_np::dump_after_refine_surface_prefix_param), ""); - options.number_of_initial_points=choose_parameter(get_parameter(np, internal_np::number_of_initial_points_param), -1); - options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, internal_np::nonlinear_growth_of_balls_param), false); - options.maximal_number_of_vertices=choose_parameter(get_parameter(np, internal_np::maximal_number_of_vertices_param), 0); - options.pointer_to_error_code=choose_parameter(get_parameter(np, internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); -#ifndef CGAL_NO_ATOMIC - options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, internal_np::pointer_to_stop_atomic_boolean_param), - ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); -#endif - - typedef Named_function_parameters Param; - return Param(options); -} - -template -Named_function_parameters -mesh_3_options(const CGAL_NP_CLASS& ... nps) -{ - return mesh_3_options(internal_np::combine_named_parameters(nps...)); -} - -// Undocumented parameter for refine_mesh_3 and make_mesh_3. -// Default Mesh_3_options: dump at every stage of the mesh generation. -inline -Named_function_parameters -mesh_3_dump() -{ - typedef Named_function_parameters Param; - internal::Mesh_3_options options; - - options.dump_after_init_prefix = "mesh_dump_after_init"; - options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; - options.dump_after_refine_prefix = "mesh_dump_after_refine"; - options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; - options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; - options.dump_after_exude_prefix = "mesh_dump_after_exude"; - - return Param(options); -} - -// ----------------------------------- -// Features_options -// ----------------------------------- -inline Named_function_parameters -features() { - typedef Named_function_parameters Param; - return Param(internal::Features_options(true)); -} - -inline Named_function_parameters -no_features() { - typedef Named_function_parameters Param; - return Param(internal::Features_options(false)); } - -template < typename MeshDomain > -inline Named_function_parameters -features(const MeshDomain& /*domain*/) -{ - typedef typename internal::Domain_features_generator::value > Generator; - -typedef Named_function_parameters Param; -return Param(Generator()()); -} - -} } //namespace CGAL::parameters #endif //CGAL_MESH_3_PARAMETERS_H \ No newline at end of file diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h index e9f06c9c590..6914525417e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h @@ -23,6 +23,9 @@ #include +// see also default_values_for_mesh_3 namespace +// in CGAL/STL_Extension/internal/mesh_option_classes.h + namespace CGAL { namespace parameters { namespace default_values_for_mesh_3 { @@ -30,7 +33,6 @@ namespace parameters { namespace default_values_for_mesh_3 { const double exude_sliver_bound = 0.; // perturb_mesh_3 -const double perturb_sliver_bound = 0.; template CGAL::Mesh_3::Min_dihedral_angle_criterion @@ -43,14 +45,6 @@ CGAL::Mesh_3::Min_dihedral_angle_criterion // global optimizers const bool do_freeze = true; -// lloyd_optimize_mesh_3 -const double lloyd_freeze_ratio = 0.01; -const double lloyd_convergence_ratio = 0.02; - -// odt_optimize_mesh_3 -const double odt_freeze_ratio = 0.01; -const double odt_convergence_ratio = 0.02; - } } // end namespace parameters::default_values_for_mesh_3 } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/Mesh_error_code.h b/Mesh_3/include/CGAL/Mesh_error_code.h index 2bbf47a451a..6c8f417e68a 100644 --- a/Mesh_3/include/CGAL/Mesh_error_code.h +++ b/Mesh_3/include/CGAL/Mesh_error_code.h @@ -14,17 +14,13 @@ #include +#include + #include #include namespace CGAL { -enum Mesh_error_code { - CGAL_MESH_3_NO_ERROR = 0, - CGAL_MESH_3_MAXIMAL_NUMBER_OF_VERTICES_REACHED, - CGAL_MESH_3_STOPPED -}; - inline std::string mesh_error_string(const Mesh_error_code& error_code) { switch(error_code) { diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 6ebd6ab8166..29a4ede1ff3 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -494,7 +494,7 @@ void make_mesh_3_impl(C3T3& c3t3, C3T3, MeshDomain, MeshCriteria, - Mesh_3::internal::has_Has_features::value > () (c3t3, + ::CGAL::internal::has_Has_features::value > () (c3t3, domain, criteria, with_features, diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 8870e19a591..2698c5e5373 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -382,11 +382,11 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, // Initialize c3t3 Periodic_3_mesh_3::internal::C3t3_initializer< C3T3, MeshDomain, MeshCriteria, - Mesh_3::internal::has_Has_features::value>()(c3t3, - domain, - criteria, - with_features, - mesh_options); + internal::has_Has_features::value>()(c3t3, + domain, + criteria, + with_features, + mesh_options); // Build mesher and launch refinement process refine_periodic_3_mesh_3(c3t3, domain, criteria, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index 9681a52738b..8a7c309017c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -226,7 +226,7 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag) C3t3, Domain, Mesh_criteria, - CGAL::Mesh_3::internal::has_Has_features::value >() + CGAL::internal::has_Has_features::value >() (c3t3_, *domain_, criteria, diff --git a/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h b/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h index b98528cace4..3ce7402e685 100644 --- a/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h +++ b/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ struct Index_generator typedef Index type; }; -template ::value> +template ::value> struct Indices_tuple_generator { using type = std::tuple const T& get_index(const T& x) { return x; } template ::value> + bool has_feature = ::CGAL::internal::Has_features::value> struct Read_mesh_domain_index { // here we have has_feature==true @@ -181,7 +181,7 @@ struct Read_mesh_domain_index { // Read_mesh_domain_index template ::value> + bool has_feature = ::CGAL::internal::Has_features::value> struct Write_mesh_domain_index { // here we have has_feature==true diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 75db8c5ca11..a943d5513be 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -17,6 +17,7 @@ #endif #include +#include #include #include @@ -242,11 +243,93 @@ get_parameter_reference_impl(const Named_params_impl& np, Query_ta return get_parameter_reference_impl(static_cast(np), tag); } +} // end of internal_np namespace + +template +struct Named_function_parameters; + +namespace parameters{ + +typedef Named_function_parameters Default_named_parameters; + +Default_named_parameters +inline default_values(); + +// function to extract a parameter +template +typename internal_np::Get_param, Query_tag>::type +get_parameter(const Named_function_parameters& np, Query_tag tag) +{ + return internal_np::get_parameter_impl(static_cast&>(np), tag); +} + +template +typename internal_np::Get_param, Query_tag>::reference +get_parameter_reference(const Named_function_parameters& np, Query_tag tag) +{ + return internal_np::get_parameter_reference_impl( + static_cast&>(np), + tag); +} + +// Two parameters, non-trivial default value +template +D& choose_parameter(const internal_np::Param_not_found&, D& d) +{ + return d; +} + +template +const D& choose_parameter(const internal_np::Param_not_found&, const D& d) +{ + return d; +} + +template +D choose_parameter(const internal_np::Param_not_found&, D&& d) +{ + return std::forward(d); +} + +template +T& choose_parameter(T& t, D&) +{ + return t; +} + +template +const T& choose_parameter(const T& t, const D&) +{ + return t; +} + +// single parameter so that we can avoid a default construction +template +D choose_parameter(const internal_np::Param_not_found&) +{ + return D(); +} + +template +const T& choose_parameter(const T& t) +{ + return t; +} + +} // parameters namespace + +namespace internal_np { + +template +auto +combine_named_parameters(const Named_function_parameters& np, const NPS& ... nps) +{ + return np.combine(nps ...); +} } // end of internal_np namespace - -template +template struct Named_function_parameters : internal_np::Named_params_impl { @@ -299,6 +382,15 @@ struct Named_function_parameters #undef CGAL_add_named_parameter_with_compatibility_ref_only #undef CGAL_add_extra_named_parameter_with_compatibility +// inject mesh specific named parameter functions +#define CGAL_NP_BASE self +#define CGAL_NP_BUILD(P, V) P(V, *this) + +#include + +#undef CGAL_NP_BASE +#undef CGAL_NP_BUILD + template Named_function_parameters combine(const Named_function_parameters& np) const @@ -319,7 +411,11 @@ struct Named_function_parameters namespace parameters { -typedef Named_function_parameters Default_named_parameters; +Default_named_parameters +inline default_values() +{ + return Default_named_parameters(); +} #ifndef CGAL_NO_DEPRECATED_CODE Default_named_parameters @@ -329,12 +425,6 @@ inline all_default() } #endif -Default_named_parameters -inline default_values() -{ - return Default_named_parameters(); -} - template Named_function_parameters inline no_parameters(Named_function_parameters) @@ -405,67 +495,6 @@ struct Boost_parameter_compatibility_wrapper #undef CGAL_add_named_parameter_with_compatibility #undef CGAL_add_named_parameter_with_compatibility_ref_only -// function to extract a parameter -template -typename internal_np::Get_param, Query_tag>::type -get_parameter(const Named_function_parameters& np, Query_tag tag) -{ - return internal_np::get_parameter_impl(static_cast&>(np), tag); -} - -template -typename internal_np::Get_param, Query_tag>::reference -get_parameter_reference(const Named_function_parameters& np, Query_tag tag) -{ - return internal_np::get_parameter_reference_impl( - static_cast&>(np), - tag); -} - -// Two parameters, non-trivial default value -template -D& choose_parameter(const internal_np::Param_not_found&, D& d) -{ - return d; -} - -template -const D& choose_parameter(const internal_np::Param_not_found&, const D& d) -{ - return d; -} - -template -D choose_parameter(const internal_np::Param_not_found&, D&& d) -{ - return std::forward(d); -} - -template -T& choose_parameter(T& t, D&) -{ - return t; -} - -template -const T& choose_parameter(const T& t, const D&) -{ - return t; -} - -// single parameter so that we can avoid a default construction -template -D choose_parameter(const internal_np::Param_not_found&) -{ - return D(); -} - -template -const T& choose_parameter(const T& t) -{ - return t; -} - // Version with three parameters for dynamic property maps template D choose_parameter(const internal_np::Param_not_found&, Dynamic_tag tag, PolygonMesh& pm) @@ -493,17 +522,6 @@ struct is_default_parameter } // end of parameters namespace -namespace internal_np { - -template -auto -combine_named_parameters(const Named_function_parameters& np, const NPS& ... nps) -{ - return np.combine(nps ...); -} - -} // end of internal_np namespace - #ifndef CGAL_NO_DEPRECATED_CODE namespace Polygon_mesh_processing { @@ -526,7 +544,7 @@ namespace boost } #endif -// For disambiguation using SFINAR +// For disambiguation using SFINAE BOOST_MPL_HAS_XXX_TRAIT_DEF(CGAL_Named_function_parameters_class) template CGAL_CPP17_INLINE constexpr bool is_named_function_parameter = has_CGAL_Named_function_parameters_class::value; diff --git a/SMDS_3/include/CGAL/SMDS_3/Has_features.h b/STL_Extension/include/CGAL/STL_Extension/internal/Has_features.h similarity index 82% rename from SMDS_3/include/CGAL/SMDS_3/Has_features.h rename to STL_Extension/include/CGAL/STL_Extension/internal/Has_features.h index e2c322fc0f6..d9681f1579c 100644 --- a/SMDS_3/include/CGAL/SMDS_3/Has_features.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/Has_features.h @@ -6,21 +6,17 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Stéphane Tayeb, Laurent Rineau -#ifndef CGAL_MESH_3_HAS_FEATURES_H -#define CGAL_MESH_3_HAS_FEATURES_H - -#include - +#ifndef CGAL_HAS_FEATURES_H +#define CGAL_HAS_FEATURES_H #include #include namespace CGAL { -namespace Mesh_3 { namespace internal { // A type has_Has_features to check if type 'Has_features' is a nested @@ -40,7 +36,6 @@ namespace internal { {}; } // end namespace internal -} // end namespace Mesh_3 } // end namespace CGAL #endif // CGAL_MESH_3_HAS_FEATURES_H diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h new file mode 100644 index 00000000000..4b60d895a87 --- /dev/null +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -0,0 +1,229 @@ +// Copyright (c) 2009 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// + +#ifndef CGAL_MESH_OPTION_CLASSES_H +#define CGAL_MESH_OPTION_CLASSES_H + +#include + +namespace CGAL { + +enum Mesh_error_code { + CGAL_MESH_3_NO_ERROR = 0, + CGAL_MESH_3_MAXIMAL_NUMBER_OF_VERTICES_REACHED, + CGAL_MESH_3_STOPPED +}; + +namespace parameters { + +namespace internal { + +const int undef_parameter = -1; + +// Helpers +struct Optimization_options_base +{ + Optimization_options_base(bool b) + : b_(b), time_limit_(undef_parameter), bound_(undef_parameter) {} + + operator bool() const { return b_; } + + bool is_time_limit_set() const { return time_limit_ != undef_parameter; } + void set_time_limit(double d) { time_limit_ = d; } + double time_limit() const { return time_limit_; } + + bool is_bound_set() const { return bound_ != undef_parameter; } + void set_bound(double d) { bound_ = d; } + double bound() const { return bound_; } + +private: + bool b_; + double time_limit_; + double bound_; +}; + +struct Global_optimization_options_base +{ + Global_optimization_options_base() + : convergence_(undef_parameter), max_it_nb_(undef_parameter) {} + + bool is_convergence_set() const { return convergence_ != undef_parameter; } + void set_convergence(double d) { convergence_ = d; } + double convergence() const { return convergence_; } + + bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } + void set_max_iteration_number(int i) { max_it_nb_ = i; } + int max_iteration_number() const { return max_it_nb_; } + +private: + double convergence_; + int max_it_nb_; +}; + +// Perturb +struct Perturb_options : public Optimization_options_base +{ + Perturb_options(bool b) : Optimization_options_base(b) {} +}; + +// Exude +struct Exude_options : public Optimization_options_base +{ + Exude_options(bool b) : Optimization_options_base(b) {} +}; + +// Odt +struct Odt_options : public Optimization_options_base +, public Global_optimization_options_base +{ + Odt_options(bool b) : Optimization_options_base(b) + , Global_optimization_options_base() {} +}; + +// Lloyd +struct Lloyd_options : public Optimization_options_base +, public Global_optimization_options_base +{ + Lloyd_options(bool b) : Optimization_options_base(b) + , Global_optimization_options_base() {} +}; + +// Manifold +struct Manifold_options { + enum { + NON_MANIFOLD = 0, + MANIFOLD_WITH_BOUNDARY = 8, + NO_BOUNDARY = 16, + MANIFOLD = 24 + }; + + Manifold_options(const int topology) + : mesh_topology(topology) + {} + Manifold_options() + : mesh_topology(NON_MANIFOLD) + {} + + int mesh_topology; +}; + +// Various Mesh_3 option +struct Mesh_3_options { +#ifndef CGAL_NO_ATOMIC + typedef std::atomic* Pointer_to_stop_atomic_boolean_t; +#else + typedef bool* Pointer_to_stop_atomic_boolean_t; +#endif + Mesh_3_options(bool nonlinear = false) + // This parameter `nonlinear` adds a compatibility with previous + // API of the constructor of `C3t3_initializer`. + // -- Laurent Rineau, 2019/05/03 + : dump_after_init_prefix() + , dump_after_refine_surface_prefix() + , dump_after_refine_prefix() + , dump_after_glob_opt_prefix() + , dump_after_perturb_prefix() + , dump_after_exude_prefix() + , number_of_initial_points(-1) + , nonlinear_growth_of_balls(nonlinear) + , maximal_number_of_vertices(0) + , pointer_to_error_code(0) +#ifndef CGAL_NO_ATOMIC + , pointer_to_stop_atomic_boolean(0) +#endif + {} + + std::string dump_after_init_prefix; + std::string dump_after_refine_surface_prefix; + std::string dump_after_refine_prefix; + std::string dump_after_glob_opt_prefix; + std::string dump_after_perturb_prefix; + std::string dump_after_exude_prefix; + int number_of_initial_points; + bool nonlinear_growth_of_balls; + std::size_t maximal_number_of_vertices; + Mesh_error_code* pointer_to_error_code; +#ifndef CGAL_NO_ATOMIC + Pointer_to_stop_atomic_boolean_t pointer_to_stop_atomic_boolean; +#endif + +}; // end struct Mesh_3_options + +// Features +struct Features_options +{ + Features_options(bool b) : b_(b) {} + bool features() const { return b_; } +private: + bool b_; +}; + +// ----------------------------------- +// Features generator +// ----------------------------------- +// struct Features_option_generator +template +struct Features_options_generator {}; + +template<> +struct Features_options_generator +{ + Features_options operator()() { return Features_options(true); } +}; + +template<> +struct Features_options_generator +{ + Features_options operator()() { return Features_options(false); } +}; + +// struct Domain_features_generator is designed to handle cases where +// MeshDomain::Has_features is not a valid type +template< typename MeshDomain, bool MeshDomainHasHasFeatures > +struct Domain_features_generator {}; + +template< typename MeshDomain > +struct Domain_features_generator< MeshDomain, false > +{ + Features_options operator()() + { + return Features_options_generator()(); + } +}; + +template< typename MeshDomain > +struct Domain_features_generator< MeshDomain, true > +{ + Features_options operator()() + { + return Features_options_generator()(); + } +}; + +} // end namespace internal + + +namespace default_values_for_mesh_3 { + +// perturb_mesh_3 +const double perturb_sliver_bound = 0.; + +// lloyd_optimize_mesh_3 +const double lloyd_freeze_ratio = 0.01; +const double lloyd_convergence_ratio = 0.02; + +// odt_optimize_mesh_3 +const double odt_freeze_ratio = 0.01; +const double odt_convergence_ratio = 0.02; + + +} } } //namespace CGAL::parameters::def + +#endif diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h new file mode 100644 index 00000000000..5a8e8be90e3 --- /dev/null +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -0,0 +1,370 @@ +// Copyright (c) 2017 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// + +// List of named parameters special functions used in meshing packages of CGAL +// no guard on purpose as they are injected both in the parameter namespace +// and the Named_function_parameters class. + + +// ----------------------------------- +// Reset_c3t3 (undocumented) +// ----------------------------------- +inline +Named_function_parameters +reset_c3t3() +{ + typedef Named_function_parameters Param; + return CGAL_NP_BUILD(Param, true); +} + +inline +Named_function_parameters +no_reset_c3t3() +{ + typedef Named_function_parameters Param; + return CGAL_NP_BUILD(Param, false); +} + +// ----------------------------------- +// Perturb +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +perturb(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),::CGAL::parameters::internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::lower_sliver_bound),::CGAL::parameters::default_values_for_mesh_3::perturb_sliver_bound); + + ::CGAL::parameters::internal::Perturb_options options(true); + + if ( ::CGAL::parameters::internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + + options.set_bound(sliver_bound); + typedef Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +perturb(const CGAL_NP_CLASS& ... nps) +{ + return perturb(::CGAL::internal_np::combine_named_parameters(nps...)); +} + + +inline Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +no_perturb() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Perturb_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +perturb(double time_limit_, + double sliver_bound_=0) +{ + return perturb(time_limit(time_limit_). + sliver_bound(sliver_bound_)); +} +#endif + +// ----------------------------------- +// Exude +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +exude(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),::CGAL::parameters::internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::lower_sliver_bound),::CGAL::parameters::default_values_for_mesh_3::perturb_sliver_bound); + + ::CGAL::parameters::internal::Exude_options options(true); + + if ( ::CGAL::parameters::internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + options.set_bound(sliver_bound); + typedef Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> Param; + + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +exude(const CGAL_NP_CLASS& ... nps) +{ + return exude(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +no_exude() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Exude_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +exude(double time_limit_, + double sliver_bound_ = 0) +{ + return exude(time_limit(time_limit_).sliver_bound(sliver_bound_)); +} +#endif + +// ----------------------------------- +// Odt +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +odt(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::vertex_freeze_bound),::CGAL::parameters::default_values_for_mesh_3::odt_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,::CGAL::internal_np::convergence_ratio), ::CGAL::parameters::default_values_for_mesh_3::odt_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); + ::CGAL::parameters::internal::Odt_options options(true); + + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + typedef Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +odt(const CGAL_NP_CLASS& ... nps) +{ + return odt(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +no_odt() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Odt_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +odt(double time_limit_, + std::size_t max_iteration_number_ = 0, + double convergence_ = 0.02, + double freeze_bound_ = 0.01, + bool do_freeze_ = true) +{ + return odt(time_limit(time_limit_). + max_iteration_number(max_iteration_number_). + convergence(convergence_). + freeze_bound(freeze_bound_). + do_freeze(do_freeze_)); +} +#endif + +// ----------------------------------- +// Lloyd +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::vertex_freeze_bound),::CGAL::parameters::default_values_for_mesh_3::lloyd_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,::CGAL::internal_np::convergence_ratio), ::CGAL::parameters::default_values_for_mesh_3::lloyd_convergence_ratio); + int max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); + ::CGAL::parameters::internal::Lloyd_options options(true); + + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + + typedef Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +lloyd(const CGAL_NP_CLASS& ... nps) +{ + return lloyd(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +no_lloyd() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Lloyd_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +lloyd(double time_limit_, + std::size_t max_iteration_number_ = 0, + double convergence_ = 0.02, + double freeze_bound_ = 0.01, + bool do_freeze_= true) +{ + return lloyd(time_limit(time_limit_). + max_iteration_number(max_iteration_number_). + convergence(convergence_). + freeze_bound(freeze_bound_). + do_freeze(do_freeze_)); +} +#endif + +// ----------------------------------- +// Manifold options +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + int mesh_topology = choose_parameter(get_parameter(np, ::CGAL::internal_np::mesh_topology_number), -1); + ::CGAL::parameters::internal::Manifold_options options; + options.mesh_topology = mesh_topology; + + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + + +template +Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold_options(const CGAL_NP_CLASS& ... nps) +{ + return manifold_options(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Manifold_options(::CGAL::parameters::internal::Manifold_options::MANIFOLD)); +} +inline Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold_with_boundary() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Manifold_options( + ::CGAL::parameters::internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); +} +inline Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +non_manifold() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Manifold_options(::CGAL::parameters::internal::Manifold_options::NON_MANIFOLD)); +} + +// ----------------------------------- +// Mesh options +// ----------------------------------- + +// Undocumented parameter for refine_mesh_3 and make_mesh_3. +// Allows to dump the mesh at given stage of the mesh generation +// algorithm. +template +Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> +mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + ::CGAL::parameters::internal::Mesh_3_options options; + + options.dump_after_init_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_init_prefix_param), ""); + options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_refine_surface_prefix_param), ""); + options.dump_after_refine_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_refine_prefix_param), ""); + options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_glob_opt_prefix_param), ""); + options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_perturb_prefix_param), ""); + options.dump_after_exude_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_refine_surface_prefix_param), ""); + options.number_of_initial_points=choose_parameter(get_parameter(np, ::CGAL::internal_np::number_of_initial_points_param), -1); + options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, ::CGAL::internal_np::nonlinear_growth_of_balls_param), false); + options.maximal_number_of_vertices=choose_parameter(get_parameter(np, ::CGAL::internal_np::maximal_number_of_vertices_param), 0); + options.pointer_to_error_code=choose_parameter(get_parameter(np, ::CGAL::internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); +#ifndef CGAL_NO_ATOMIC + options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, ::CGAL::internal_np::pointer_to_stop_atomic_boolean_param), + ((::CGAL::parameters::internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); +#endif + + typedef Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> +mesh_3_options(const CGAL_NP_CLASS& ... nps) +{ + return mesh_3_options(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +// Undocumented parameter for refine_mesh_3 and make_mesh_3. +// Default Mesh_3_options: dump at every stage of the mesh generation. +inline +Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> +mesh_3_dump() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> Param; + ::CGAL::parameters::internal::Mesh_3_options options; + + options.dump_after_init_prefix = "mesh_dump_after_init"; + options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; + options.dump_after_refine_prefix = "mesh_dump_after_refine"; + options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; + options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; + options.dump_after_exude_prefix = "mesh_dump_after_exude"; + + return CGAL_NP_BUILD(Param, options); +} + +// ----------------------------------- +// Features_options +// ----------------------------------- +inline Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> +features() { + typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Features_options(true)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> +no_features() { + typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Features_options(false)); } + +template < typename MeshDomain > +inline Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> +features(const MeshDomain& /*domain*/) +{ + typedef typename ::CGAL::parameters::internal::Domain_features_generator::value > Generator; + + typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,Generator()()); +} From b0a144c6e712be9c9ef26f7c84c1d6d5e25d9a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 26 Sep 2022 20:14:26 +0200 Subject: [PATCH 092/248] update examples to the new API --- Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp | 9 +++-- .../mesh_3D_gray_image_multiple_values.cpp | 16 ++++----- ..._gray_image_with_custom_initialization.cpp | 9 +++-- .../Mesh_3/mesh_3D_gray_vtk_image.cpp | 11 +++--- Mesh_3/examples/Mesh_3/mesh_3D_image.cpp | 7 ++-- .../Mesh_3/mesh_3D_image_variable_size.cpp | 7 ++-- ...sh_3D_image_with_custom_initialization.cpp | 7 ++-- .../Mesh_3/mesh_3D_image_with_features.cpp | 9 +++-- .../Mesh_3/mesh_3D_weighted_image.cpp | 11 +++--- .../Mesh_3/mesh_cubes_intersection.cpp | 14 ++++---- .../mesh_cubes_intersection_with_features.cpp | 14 ++++---- .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 5 ++- .../examples/Mesh_3/mesh_implicit_domains.cpp | 10 +++--- .../Mesh_3/mesh_implicit_domains_2.cpp | 8 ++--- .../Mesh_3/mesh_implicit_ellipsoid.cpp | 7 ++-- .../examples/Mesh_3/mesh_implicit_sphere.cpp | 7 ++-- .../mesh_implicit_sphere_variable_size.cpp | 10 +++--- .../Mesh_3/mesh_optimization_example.cpp | 16 ++++----- .../mesh_optimization_lloyd_example.cpp | 19 +++++------ .../Mesh_3/mesh_polyhedral_complex.cpp | 9 +++-- .../Mesh_3/mesh_polyhedral_complex_sm.cpp | 9 +++-- .../Mesh_3/mesh_polyhedral_domain.cpp | 13 ++++--- .../Mesh_3/mesh_polyhedral_domain_sm.cpp | 11 +++--- .../mesh_polyhedral_domain_with_features.cpp | 9 +++-- ...esh_polyhedral_domain_with_features_sm.cpp | 9 +++-- ...olyhedral_domain_with_lipschitz_sizing.cpp | 15 ++++---- ..._polyhedral_domain_with_surface_inside.cpp | 14 ++++---- .../mesh_two_implicit_spheres_with_balls.cpp | 13 +++---- .../Mesh_3/remesh_polyhedral_surface.cpp | 13 ++++--- .../Mesh_3/remesh_polyhedral_surface_sm.cpp | 13 ++++--- Mesh_3/include/CGAL/Mesh_3/parameters.h | 2 +- .../include/CGAL/Mesh_3/parameters_defaults.h | 2 +- .../mesh_implicit_multi_domain.cpp | 12 +++---- .../Periodic_3_mesh_3/mesh_implicit_shape.cpp | 12 +++---- .../mesh_implicit_shape_with_features.cpp | 24 +++++++------ .../mesh_implicit_shape_with_optimizers.cpp | 34 ++++++++++--------- .../mesh_implicit_shape_with_subdomains.cpp | 12 +++---- 37 files changed, 203 insertions(+), 219 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp index 4149eeaa6f9..d877389a530 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp @@ -23,8 +23,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -37,12 +36,12 @@ int main(int argc, char*argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, iso_value = 2.9f, value_outside = 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f)); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(8)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp index 1c99e0379f1..71b3a5950a4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; template struct Image_to_multiple_iso_level_sets { @@ -63,18 +62,17 @@ int main(int argc, char*argv[]) } // Domain - namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain - (p::image = image, - p::image_values_to_subdomain_indices = - Image_to_multiple_iso_level_sets(iso_values), - p::value_outside = 0.f + (params::image(image). + image_values_to_subdomain_indices( + Image_to_multiple_iso_level_sets(iso_values)). + value_outside(0.f) ); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(8)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index 758145532e9..afed1a34b52 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -32,8 +32,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -46,12 +45,12 @@ int main(int argc, char* argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, iso_value = 2.9f, value_outside = 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f)); /// [Domain creation] /// [Mesh criteria] - Mesh_criteria criteria(facet_angle = 30, facet_size = 6, facet_distance = 2, - cell_radius_edge_ratio = 3, cell_size = 8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(8)); /// [Meshing] C3t3 c3t3; diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp index a42b1144a0a..55799a97747 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp @@ -79,18 +79,17 @@ int main(int argc, char* argv[]) return 0; } /// [Domain creation] - // To avoid verbose function and named parameters call - using namespace CGAL::parameters; + namespace params = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain (image, - image_values_to_subdomain_indices = Less(iso), - value_outside = 0); + params::image_values_to_subdomain_indices(Less(iso)). + value_outside(0)); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=fs, facet_distance=fd, - cell_radius_edge_ratio=3, cell_size=cs); + Mesh_criteria criteria(params::facet_angle(30).facet_size(fs).facet_distance(fd). + cell_radius_edge_ratio(3).cell_size(cs)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp index dbae9919419..484863d158c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -45,8 +44,8 @@ int main(int argc, char* argv[]) /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=4, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(4). + cell_radius_edge_ratio(3).cell_size(8)); /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp index c7f205091ba..2f07fbf3abf 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp @@ -31,8 +31,7 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; typedef CGAL::Mesh_constant_domain_field_3 Sizing_field; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -55,8 +54,8 @@ int main(int argc, char* argv[]) domain.index_from_subdomain_index(127)); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2, - cell_radius_edge_ratio=3, cell_size=size); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(size)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index fcf5d94744d..253c41a920b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -31,8 +31,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -44,8 +43,8 @@ int main() Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=3, facet_distance=1, - cell_radius_edge_ratio=3, cell_size=3); + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1). + cell_radius_edge_ratio(3).cell_size(3)); /// [Meshing] C3t3 c3t3; diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp index 877fa104635..15d8c843bcf 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp @@ -32,8 +32,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; /// [Add 1D features] #include "read_polylines.h" @@ -92,9 +91,9 @@ int main(int argc, char* argv[]) /// [Call add_1D_features] /// Note that `edge_size` is needed with 1D-features [Mesh criteria] - Mesh_criteria criteria(edge_size=6, - facet_angle=30, facet_size=6, facet_distance=4, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::edge_size(6). + facet_angle(30).facet_size(6).facet_distance(4). + cell_radius_edge_ratio(3).cell_size(8)); /// [Mesh criteria] // Meshing diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp index 0374a315707..17356b21fd3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp @@ -24,8 +24,7 @@ using C3t3 = CGAL::Mesh_complex_3_in_triangulation_3; // Criteria using Mesh_criteria = CGAL::Mesh_criteria_3; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -45,13 +44,13 @@ int main(int argc, char* argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, - weights = img_weights, - relative_error_bound = 1e-6); + params::weights(img_weights). + relative_error_bound(1e-6)); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=0.5, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(0.5). + cell_radius_edge_ratio(3).cell_size(8)); /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 91a4351b395..8f42c8f556d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -19,7 +19,7 @@ // IO #include -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -76,18 +76,18 @@ int main() Mesh_domain domain(Function_wrapper(v, vps), K::Sphere_3(CGAL::ORIGIN, 5.*5.)); // Set mesh criteria - Mesh_criteria criteria(edge_size = 0.15, - facet_angle = 30, facet_size = 0.2, - cell_radius_edge_ratio = 2, cell_size = 0.4); + Mesh_criteria criteria(params::edge_size(0.15). + facet_angle(30).facet_size(0.2). + cell_radius_edge_ratio(2).cell_size(0.4)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,time_limit=12); + CGAL::exude_mesh_3(c3t3,params::time_limit(12)); // Output std::ofstream medit_file("out_cubes_intersection.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index 11e27bf0a11..568f3fec14a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -20,7 +20,7 @@ // IO #include -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -163,18 +163,18 @@ int main() domain.add_features(polylines.begin(),polylines.end()); // Set mesh criteria - Mesh_criteria criteria(edge_size = 0.15, - facet_angle = 30, facet_size = 0.2, - cell_radius_edge_ratio = 2, cell_size = 0.4); + Mesh_criteria criteria(params::edge_size(0.15). + facet_angle(30).facet_size(0.2). + cell_radius_edge_ratio(2).cell_size(0.4)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit = 12); + CGAL::exude_mesh_3(c3t3, params::time_limit(12)); // Output std::ofstream medit_file("out_cubes_intersection_with_features.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index 31c3c0e917e..ba278c43d42 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -190,8 +190,7 @@ FT sphere_centered_at_111 (const Point& p) return dx*dx+dy*dy+dz*dz-1; } -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -239,7 +238,7 @@ int main() // Mesh generation (without optimization) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); // Output dump_c3t3(c3t3, "out"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index ecce9ce2ca1..5b56c06f935 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -12,7 +12,7 @@ // IO #include -using namespace CGAL::parameters; +namespace params = CGAL::parameters; #ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Parallel_tag Concurrency_tag; @@ -50,7 +50,7 @@ int main() // Domain (Warning: Sphere_3 constructor uses square radius !) Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), - CGAL::parameters::relative_error_bound(1e-6)); + params::relative_error_bound(1e-6)); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation @@ -58,13 +58,13 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3, time_limit=12); + CGAL::exude_mesh_3(c3t3, params::time_limit(12)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index d8ea29734ee..c6fa7e3aef3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -47,7 +47,7 @@ int main() namespace params = CGAL::parameters; Mesh_domain domain(Function_wrapper(v, vps), K::Sphere_3(CGAL::ORIGIN,5.*5.), - params::relative_error_bound = 1e-6); + params::relative_error_bound(1e-6)); /// [Domain creation] // Set mesh criteria @@ -56,13 +56,13 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude(), params::no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, params::time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3, params::time_limit(12)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp index da98a23a98c..db7dabd145e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp @@ -35,8 +35,7 @@ FT ellipsoid_function (const Point& p) return x2+2*y2+4*z2-1; } -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -51,7 +50,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation (without optimization) - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output std::ofstream medit_file("out_wo.mesh"); @@ -59,7 +58,7 @@ int main() medit_file.close(); // Perturbation (5s, 12degree) - CGAL::perturb_mesh_3(c3t3, domain, time_limit=5, sliver_bound=12); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(5).sliver_bound(12)); // Exudation CGAL::exude_mesh_3(c3t3); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp index e69306618cc..d184da23cd5 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp @@ -28,8 +28,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT sphere_function (const Point& p) @@ -44,8 +43,8 @@ int main() /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025, - cell_radius_edge_ratio=2, cell_size=0.1); + Mesh_criteria criteria(params::facet_angle(30).facet_size(0.1).facet_distance(0.025). + cell_radius_edge_ratio(2).cell_size(0.1)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index fd3f8d715ca..f04609b6a6b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -42,8 +42,7 @@ struct Spherical_sizing_field } }; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT sphere_function (const Point& p) @@ -52,7 +51,6 @@ FT sphere_function (const Point& p) int main() { /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) - namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain (sphere_function, K::Sphere_3(CGAL::ORIGIN, 2.) ); @@ -60,11 +58,11 @@ int main() // Mesh criteria Spherical_sizing_field size; - Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025, - cell_radius_edge_ratio=2, cell_size=size); + Mesh_criteria criteria(params::facet_angle(30).facet_size(0.1).facet_distance(0.025). + cell_radius_edge_ratio(2).cell_size(size)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index 4d0e36ff5d3..dd37a7cfe25 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Mesh Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -42,20 +41,20 @@ int main(int argc, char* argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=5, facet_distance=1.5, - cell_radius_edge_ratio=2, cell_size=7); + Mesh_criteria criteria(params::facet_angle(30).facet_size(5).facet_distance(1.5). + cell_radius_edge_ratio(2).cell_size(7)); // Mesh generation and optimization in one call (sliver_bound is the // targeted dihedral angle in degrees) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_exude(), - perturb(sliver_bound=10, time_limit=15)); + params::no_exude(). + perturb(params::sliver_bound(10).time_limit(15))); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); - CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit=15); + CGAL::perturb_mesh_3(c3t3_bis, domain, params::time_limit(15)); // Output std::ofstream medit_file("out.mesh"); @@ -68,3 +67,4 @@ int main(int argc, char* argv[]) return 0; } +. \ No newline at end of file diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index b4db268fc59..42b8c1d0c4a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Mesh Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -41,21 +40,21 @@ int main(int argc, char*argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_distance=1.2, - cell_radius_edge_ratio=2); + Mesh_criteria criteria(params::facet_angle(30).facet_distance(1.2). + cell_radius_edge_ratio(2)); // Mesh generation and optimization in one call C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - lloyd(time_limit=30), - no_perturb(), - exude(time_limit=10, sliver_bound=10)); + params::lloyd(params::time_limit(30)). + no_perturb(). + exude(params::time_limit(10).sliver_bound(10))); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); - CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30); - CGAL::exude_mesh_3(c3t3_bis, sliver_bound=10, time_limit=10); + CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, params::time_limit(30)); + CGAL::exude_mesh_3(c3t3_bis, params::sliver_bound(10), params::time_limit(10)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp index eaee6876dc8..b502b7593e6 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp @@ -31,8 +31,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; const char* const filenames[] = { "meshes/patch-01.off", @@ -71,9 +70,9 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 8, - facet_angle = 25, facet_size = 8, facet_distance = 0.2, - cell_radius_edge_ratio = 3, cell_size = 10); + Mesh_criteria criteria(params::edge_size(8). + facet_angle(25).facet_size(8).facet_distance(0.2). + cell_radius_edge_ratio(3).cell_size(10)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp index bc4b4821dca..9bf6c385370 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp @@ -33,8 +33,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; const char* const filenames[] = { "meshes/patch-01.off", @@ -94,9 +93,9 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 8, - facet_angle = 25, facet_size = 8, facet_distance = 0.2, - cell_radius_edge_ratio = 3, cell_size = 10); + Mesh_criteria criteria(params::edge_size(8). + facet_angle(25).facet_size(8).facet_distance(0.2). + cell_radius_edge_ratio(3).cell_size(10)); #ifdef CGAL_MESHING_STEPS_WITH_CIN std::cout << "Ready for mesh generation ? (y or n)"; diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index eb24c7ef70a..cd56e3bc5c7 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -29,8 +29,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -54,11 +53,11 @@ int main(int argc, char*argv[]) Mesh_domain domain(polyhedron); // Mesh criteria (no cell_size set) - Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, - cell_radius_edge_ratio=3); + Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.008). + cell_radius_edge_ratio(3)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -66,10 +65,10 @@ int main(int argc, char*argv[]) medit_file.close(); // Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets - Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); + Mesh_criteria new_criteria(params::cell_radius_edge_ratio(3).cell_size(0.03)); // Mesh refinement (and make the output manifold) - CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold()); + CGAL::refine_mesh_3(c3t3, domain, new_criteria, params::manifold()); // Output medit_file.open("out_2.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp index c7ab9c43a4d..eac3d9a4701 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp @@ -28,8 +28,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -53,11 +52,11 @@ int main(int argc, char*argv[]) Mesh_domain domain(polyhedron); // Mesh criteria (no cell_size set) - Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, - cell_radius_edge_ratio=3); + Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.008). + cell_radius_edge_ratio(3)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -65,7 +64,7 @@ int main(int argc, char*argv[]) medit_file.close(); // Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets - Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); + Mesh_criteria new_criteria(params::cell_radius_edge_ratio(3).cell_size(0.03)); // Mesh refinement CGAL::refine_mesh_3(c3t3, domain, new_criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp index c6b092e5db1..917aeec1cf4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp @@ -29,8 +29,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -55,9 +54,9 @@ int main(int argc, char*argv[]) domain.detect_features(); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, - cell_radius_edge_ratio = 3, cell_size = 0.05); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25).facet_size(0.05).facet_distance(0.005). + cell_radius_edge_ratio(3).cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp index a05a3aa1669..cbdf8b90b97 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp @@ -30,8 +30,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -56,9 +55,9 @@ int main(int argc, char*argv[]) domain.detect_features(); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, - cell_radius_edge_ratio = 3, cell_size = 0.05); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25).facet_size(0.05).facet_distance(0.005). + cell_radius_edge_ratio(3).cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp index d6ab36133bc..520c1b1eb4c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp @@ -34,8 +34,7 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; // Sizing field typedef CGAL::Mesh_3::Lipschitz_sizing Lip_sizing; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -69,12 +68,12 @@ int main(int argc, char*argv[]) 0.5); //max_size // Mesh criteria - Mesh_criteria criteria(edge_size = min_size, - facet_angle = 25, - facet_size = min_size, - facet_distance = 0.005, - cell_radius_edge_ratio = 3, - cell_size = lip_sizing); + Mesh_criteria criteria(params::edge_size(min_size). + facet_angle(25). + facet_size(min_size). + facet_distance(0.005). + cell_radius_edge_ratio(3). + cell_size(lip_sizing)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp index 51009ad7cb8..4f81ca6ce6f 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -53,13 +52,16 @@ int main(int argc, char*argv[]) domain.detect_features(); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, - cell_radius_edge_ratio = 3, cell_size = 0.05); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25). + facet_size(0.05). + facet_distance(0.005). + cell_radius_edge_ratio(3). + cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); std::cerr << t.time() << " sec." << std::endl; // Output diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index 7458ae88390..781631cdb5a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -37,8 +37,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT sphere_function1 (const Point& p) @@ -65,9 +64,11 @@ int main() K::Sphere_3(Point(1, 0, 0), 6.)); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.15, - facet_angle = 25, facet_size = 0.15, - cell_radius_edge_ratio = 2, cell_size = 0.15); + Mesh_criteria criteria(params::edge_size(0.15). + facet_angle(25). + facet_size(0.15). + cell_radius_edge_ratio(2). + cell_size(0.15)); // Create edge that we want to preserve Polylines polylines (1); @@ -85,7 +86,7 @@ int main() // Mesh generation without feature preservation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::no_features()); + params::no_features()); std::ofstream medit_file("out-no-protection.mesh"); CGAL::IO::write_MEDIT(medit_file, c3t3); diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp index 3a22bb35526..2edfeed09cb 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp @@ -22,8 +22,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -49,13 +48,13 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, - facet_size = 0.1, - facet_distance = 0.001); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25). + facet_size(0.1). + facet_distance(0.001)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp index 1ddf6772d04..58aadb62dc7 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp @@ -21,8 +21,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -48,13 +47,13 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, - facet_size = 0.1, - facet_distance = 0.001); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25). + facet_size(0.1). + facet_distance(0.001)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 39146e8e5e9..4786c7fab87 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -22,7 +22,7 @@ namespace parameters { #define CGAL_NP_BASE internal_np::No_property #define CGAL_NP_BUILD(P, V) P(V) - + #include #undef CGAL_NP_BASE diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h index 6914525417e..b69945e77c1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h @@ -23,7 +23,7 @@ #include -// see also default_values_for_mesh_3 namespace +// see also default_values_for_mesh_3 namespace // in CGAL/STL_Extension/internal/mesh_option_classes.h namespace CGAL { diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp index 0b57091170c..b2dbdfd2bc6 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp @@ -41,7 +41,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit functions FT sphere_function(const Point& p) @@ -78,11 +78,11 @@ int main(int argc, char** argv) Multi_domain_wrapper multi_domain_function(funcs, vps); Periodic_mesh_domain domain(multi_domain_function, canonical_cube); - Periodic_mesh_criteria criteria(facet_angle = 30, - facet_size = 0.04, - facet_distance = 0.025, - cell_radius_edge_ratio = 2., - cell_size = 0.04); + Periodic_mesh_criteria criteria(params::facet_angle(30). + facet_size(0.04). + facet_distance(0.025). + cell_radius_edge_ratio(2.). + cell_size(0.04)); // Mesh generation C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp index 9c39c8758e3..7e308977787 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp @@ -34,7 +34,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit function FT schwarz_p(const Point& p) @@ -57,11 +57,11 @@ int main(int argc, char** argv) Periodic_mesh_domain domain = Periodic_mesh_domain::create_implicit_mesh_domain(schwarz_p, canonical_cube); - Periodic_mesh_criteria criteria(facet_angle = 30, - facet_size = 0.035 * domain_size, - facet_distance = 0.025 * domain_size, - cell_radius_edge_ratio = 2., - cell_size = 0.05); + Periodic_mesh_criteria criteria(params::facet_angle(30). + facet_size(0.035 * domain_size). + facet_distance(0.025 * domain_size). + cell_radius_edge_ratio(2.). + cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index 680b0153c95..b6d3cd08b66 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -45,7 +45,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit function static const FT cx = 0.51, cy = 0.51, cz = 0.5; @@ -91,11 +91,11 @@ int main(int argc, char** argv) Periodic_function(cone_function, canonical_cube), canonical_cube); // Mesh criteria - Periodic_mesh_criteria criteria(edge_size = 0.02 * domain_size, - facet_angle = 0.05 * domain_size, - facet_size = 0.02 * domain_size, - cell_radius_edge_ratio = 2, - cell_size = 0.5); + Periodic_mesh_criteria criteria(params::edge_size(0.02 * domain_size). + facet_angle(0.05 * domain_size). + facet_size(0.02 * domain_size). + cell_radius_edge_ratio(2). + cell_size(0.5)); // Create the features that we want to preserve Polylines polylines; @@ -108,14 +108,18 @@ int main(int argc, char** argv) domain.add_corner(Point(0.51, 0.51, 0.5)); // Mesh generation WITHOUT feature preservation (and no optimizers) - C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, no_features(), - no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, + params::no_features(). + no_exude(). + no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); // Mesh generation WITH feature preservation (and no optimizers) - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, features(), - no_exude(), no_perturb()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, + params::features(). + no_exude(). + no_perturb()); std::ofstream medit_file_bis("output_implicit_shape_with_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 3d2c42a4c4e..d4dc33167d9 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -34,7 +34,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit function FT double_p(const Point& p) @@ -62,35 +62,37 @@ int main(int argc, char** argv) Periodic_mesh_domain domain = Periodic_mesh_domain::create_implicit_mesh_domain(double_p, canonical_cube); - Periodic_mesh_criteria criteria(facet_angle = 30, - facet_size = 0.05 * domain_size, - facet_distance = 0.025 * domain_size, - cell_radius_edge_ratio = 2., - cell_size = 0.05); + Periodic_mesh_criteria criteria(params::facet_angle(30). + facet_size(0.05 * domain_size). + facet_distance(0.025 * domain_size). + cell_radius_edge_ratio(2.). + cell_size(0.05)); // Mesh generation with optimizers C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, - odt(convergence=0.03, freeze_bound=0.02, time_limit=30), - lloyd(max_iteration_number=10), - perturb(sliver_bound=10, time_limit=30), - exude(sliver_bound=10, time_limit=0)); + params::odt(params::convergence(0.03).freeze_bound(0.02).time_limit(30)), + params::lloyd(params::max_iteration_number(10)), + params::perturb(params::sliver_bound(10).time_limit(30)), + params::exude(params::sliver_bound(10).time_limit(0))); std::ofstream medit_file("output_implicit_shape_optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); // Below, the mesh generation and the optimizations are done in several calls C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, - no_odt(), no_lloyd(), - no_perturb(), no_exude()); + params::no_odt(). + no_lloyd(). + no_perturb(). + no_exude()); std::ofstream medit_file_bis("output_implicit_shape_non-optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); // Now, call each optimizer with its global function - CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence=0.03, freeze_bound=0.02, time_limit=30); - CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number=10); - CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound=10, time_limit=30); - CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound=10, time_limit=0); + CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, params::convergence(0.03).freeze_bound(0.02).time_limit(30)); + CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, params::max_iteration_number(10)); + CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, params::sliver_bound(10).time_limit(30)); + CGAL::exude_periodic_3_mesh_3(c3t3_bis, params::sliver_bound(10).time_limit(0)); std::ofstream medit_file_ter("output_implicit_shape_two_steps.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp index 8de56fad9a7..ecc1758386a 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp @@ -36,7 +36,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT schwarz_p(const Point& p) @@ -67,11 +67,11 @@ int main(int argc, char** argv) size.set_size(0.1, volume_dimension, domain.index_from_subdomain_index(2)); // exterior size.set_size(0.03, volume_dimension, domain.index_from_subdomain_index(1)); // interior - Periodic_mesh_criteria criteria(facet_angle = 30., - facet_size = 0.05, - facet_distance = 0.025, - cell_radius_edge_ratio = 2., - cell_size = size); + Periodic_mesh_criteria criteria(params::facet_angle(30.). + facet_size(0.05). + facet_distance(0.025). + cell_radius_edge_ratio(2.). + cell_size(size)); // Mesh generation C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); From bdd2fb8e4b48691cb328302f27e623b336b1428c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 08:14:30 +0100 Subject: [PATCH 093/248] Polygon package --- Polygon/include/CGAL/Polygon_2.h | 3 +- .../Polygon_2/Polygon_2_algorithms_impl.h | 12 +- .../Polygon_2/Polygon_2_edge_circulator.h | 4 +- .../include/CGAL/Polygon_2/Polygon_2_impl.h | 1 - .../CGAL/Polygon_2/Polygon_2_simplicity.h | 16 +- .../CGAL/Polygon_2/polygon_assertions.h | 366 ------------------ Polygon/include/CGAL/Polygon_2_algorithms.h | 2 +- 7 files changed, 19 insertions(+), 385 deletions(-) delete mode 100644 Polygon/include/CGAL/Polygon_2/polygon_assertions.h diff --git a/Polygon/include/CGAL/Polygon_2.h b/Polygon/include/CGAL/Polygon_2.h index be5ca8c9ef0..e4305cccfed 100644 --- a/Polygon/include/CGAL/Polygon_2.h +++ b/Polygon/include/CGAL/Polygon_2.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -370,7 +371,7 @@ class Polygon_2 { /// `p.is_simple()`. Bounded_side bounded_side(const Point_2& value) const { - CGAL_polygon_precondition(is_simple()); + CGAL_precondition(is_simple()); return bounded_side_2(d_container.begin(), d_container.end(), value, traits); } diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h index 8338ce335a2..400c2a2e7a7 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h @@ -166,7 +166,7 @@ ForwardIterator left_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits&traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); internal::Polygon_2::Compare_vertices less(traits.less_xy_2_object()); return std::min_element(first, last, less); @@ -182,7 +182,7 @@ ForwardIterator right_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits &traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); internal::Polygon_2::Compare_vertices less(traits.less_xy_2_object()); return std::max_element(first, last, less); @@ -198,7 +198,7 @@ ForwardIterator top_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits&traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); return std::max_element(first, last, traits.less_yx_2_object()); } @@ -212,7 +212,7 @@ ForwardIterator bottom_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits&traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); return std::min_element(first, last, traits.less_yx_2_object()); } @@ -325,7 +325,7 @@ Oriented_side oriented_side_2(ForwardIterator first, const Traits& traits) { Orientation o = orientation_2(first, last, traits); - CGAL_polygon_assertion(o != COLLINEAR); + CGAL_assertion(o != COLLINEAR); Bounded_side b = bounded_side_2(first, last, point, traits); switch (b) { @@ -507,7 +507,7 @@ Orientation orientation_2(ForwardIterator first, ForwardIterator last, const Traits& traits) { - CGAL_polygon_precondition(is_simple_2(first, last, traits)); + CGAL_precondition(is_simple_2(first, last, traits)); ForwardIterator i = left_vertex_2(first, last, traits); diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h index ba7dfdecb12..b7c6c10b94b 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace CGAL { #ifndef DOXYGEN_RUNNING //to avoid conflicts @@ -57,7 +57,7 @@ class Polygon_2_const_edge_circulator { : first_vertex(f) {} bool operator==( std::nullptr_t CGAL_assertion_code(p) ) const { - CGAL_polygon_assertion( p == 0); + CGAL_assertion( p == 0); return (first_vertex == 0); } diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h index ce0714af873..8ba11273428 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h @@ -41,7 +41,6 @@ bool operator==( const Polygon_2 &x, return true; typedef typename Traits_P::Equal_2 Equal_2; typedef typename Traits_P::Point_2 Point_2; -// CGAL_polygon_precondition( (x.size() != 0) || (y.size() != 0)); if ((x.size() == 0) && (y.size() == 0)) return true; if (x.size() != y.size()) return false; diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h index 0d77320370f..5e93c02bf43 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -220,9 +220,9 @@ template bool Less_segments:: less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const { - CGAL_polygon_precondition( + CGAL_precondition( m_vertex_data->edges[tree_edge.as_int()].is_in_tree); - CGAL_polygon_precondition( + CGAL_precondition( !m_vertex_data->edges[new_edge.as_int()].is_in_tree); Vertex_index left, mid, right; m_vertex_data->left_and_right_index(left, right, tree_edge); @@ -323,20 +323,20 @@ insertion_event(Tree *tree, Vertex_index prev_vt, std::pair result; if (left_turn) { result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; } else { result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; } @@ -369,7 +369,7 @@ replacement_event(Tree *tree, Vertex_index cur_edge, Vertex_index next_edge) // check if continuation point is on the right side of neighbor segments typedef typename Tree::iterator It; Edge_data &td = edges[cur_edge.as_int()]; - CGAL_polygon_assertion(td.is_in_tree); + CGAL_assertion(td.is_in_tree); It cur_seg = td.tree_it; Vertex_index cur_vt = (td.is_left_to_right) ? next_edge : cur_edge; if (cur_seg != tree->begin()) { diff --git a/Polygon/include/CGAL/Polygon_2/polygon_assertions.h b/Polygon/include/CGAL/Polygon_2/polygon_assertions.h deleted file mode 100644 index 47711d72fef..00000000000 --- a/Polygon/include/CGAL/Polygon_2/polygon_assertions.h +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright (c) 1997 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_polygon_assertion -#undef CGAL_polygon_assertion_msg -#undef CGAL_polygon_assertion_code - - -#ifndef CGAL_POLYGON_ASSERTIONS_H -#define CGAL_POLYGON_ASSERTIONS_H -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -namespace CGAL{ -inline void set_use_polygon_assertions(bool){} -inline bool get_use_polygon_assertions(){return true;} -} -#else -#include -namespace CGAL{ -inline bool& get_use_polygon_assertions() -{ - CGAL_STATIC_THREAD_LOCAL_VARIABLE(bool, b, true); - return b; -} -inline void set_use_polygon_assertions(bool b) -{ - get_use_polygon_assertions() = b; -} -} -#endif -#endif // CGAL_POLYGON_ASSERTIONS_H - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_polygon_assertion(EX) (static_cast(0)) -# define CGAL_polygon_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_assertion_code(CODE) -#else -# define CGAL_polygon_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_assertion_code(CODE) CODE -# define CGAL_polygon_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -#undef CGAL_polygon_exactness_assertion -#undef CGAL_polygon_exactness_assertion_msg -#undef CGAL_polygon_exactness_assertion_code - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_assertion(EX) (static_cast(0)) -# define CGAL_polygon_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_assertion_code(CODE) -#else -# define CGAL_polygon_exactness_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_assertion_code(CODE) CODE -# define CGAL_polygon_exactness_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -#undef CGAL_polygon_expensive_assertion -#undef CGAL_polygon_expensive_assertion_msg -#undef CGAL_polygon_expensive_assertion_code - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_assertion(EX) (static_cast(0)) -# define CGAL_polygon_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_assertion_code(CODE) -#else -# define CGAL_polygon_expensive_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_assertion_code(CODE) CODE -# define CGAL_polygon_expensive_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -#undef CGAL_polygon_expensive_exactness_assertion -#undef CGAL_polygon_expensive_exactness_assertion_msg -#undef CGAL_polygon_expensive_exactness_assertion_code - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_polygon_precondition -#undef CGAL_polygon_precondition_msg -#undef CGAL_polygon_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_polygon_precondition(EX) (static_cast(0)) -# define CGAL_polygon_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_precondition_code(CODE) -#else -# define CGAL_polygon_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_precondition_code(CODE) CODE -# define CGAL_polygon_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -#undef CGAL_polygon_exactness_precondition -#undef CGAL_polygon_exactness_precondition_msg -#undef CGAL_polygon_exactness_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_precondition(EX) (static_cast(0)) -# define CGAL_polygon_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_precondition_code(CODE) -#else -# define CGAL_polygon_exactness_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_precondition_code(CODE) CODE -# define CGAL_polygon_exactness_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -#undef CGAL_polygon_expensive_precondition -#undef CGAL_polygon_expensive_precondition_msg -#undef CGAL_polygon_expensive_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_precondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_precondition_code(CODE) -#else -# define CGAL_polygon_expensive_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_precondition_code(CODE) CODE -# define CGAL_polygon_expensive_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -#undef CGAL_polygon_expensive_exactness_precondition -#undef CGAL_polygon_expensive_exactness_precondition_msg -#undef CGAL_polygon_expensive_exactness_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_polygon_postcondition -#undef CGAL_polygon_postcondition_msg -#undef CGAL_polygon_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_polygon_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_postcondition_code(CODE) -#else -# define CGAL_polygon_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_postcondition_code(CODE) CODE -# define CGAL_polygon_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -#undef CGAL_polygon_exactness_postcondition -#undef CGAL_polygon_exactness_postcondition_msg -#undef CGAL_polygon_exactness_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_postcondition_code(CODE) -#else -# define CGAL_polygon_exactness_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_postcondition_code(CODE) CODE -# define CGAL_polygon_exactness_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -#undef CGAL_polygon_expensive_postcondition -#undef CGAL_polygon_expensive_postcondition_msg -#undef CGAL_polygon_expensive_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_postcondition_code(CODE) -#else -# define CGAL_polygon_expensive_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_postcondition_code(CODE) CODE -# define CGAL_polygon_expensive_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -#undef CGAL_polygon_expensive_exactness_postcondition -#undef CGAL_polygon_expensive_exactness_postcondition_msg -#undef CGAL_polygon_expensive_exactness_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_polygon_warning -#undef CGAL_polygon_warning_msg -#undef CGAL_polygon_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_polygon_warning(EX) (static_cast(0)) -# define CGAL_polygon_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_warning_code(CODE) -#else -# define CGAL_polygon_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_warning_code(CODE) CODE -# define CGAL_polygon_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS - - -#undef CGAL_polygon_exactness_warning -#undef CGAL_polygon_exactness_warning_msg -#undef CGAL_polygon_exactness_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_warning(EX) (static_cast(0)) -# define CGAL_polygon_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_warning_code(CODE) -#else -# define CGAL_polygon_exactness_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_warning_code(CODE) CODE -# define CGAL_polygon_exactness_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS - - -#undef CGAL_polygon_expensive_warning -#undef CGAL_polygon_expensive_warning_msg -#undef CGAL_polygon_expensive_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_warning(EX) (static_cast(0)) -# define CGAL_polygon_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_warning_code(CODE) -#else -# define CGAL_polygon_expensive_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_warning_code(CODE) CODE -# define CGAL_polygon_expensive_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS - - -#undef CGAL_polygon_expensive_exactness_warning -#undef CGAL_polygon_expensive_exactness_warning_msg -#undef CGAL_polygon_expensive_exactness_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_warning_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_warning_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS diff --git a/Polygon/include/CGAL/Polygon_2_algorithms.h b/Polygon/include/CGAL/Polygon_2_algorithms.h index 5c836466c11..8233269217a 100644 --- a/Polygon/include/CGAL/Polygon_2_algorithms.h +++ b/Polygon/include/CGAL/Polygon_2_algorithms.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include /// namespace CGAL { From 1ad69e0432f17650bf52ed234d7e4a512559a14d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 08:32:49 +0100 Subject: [PATCH 094/248] Partition_2 --- .../Partition_2/partition_approx_convex_2.h | 6 +- .../CGAL/Partition_2/partition_assertions.h | 341 ------------------ .../partition_greene_approx_convex_2.h | 12 +- .../Partition_2/partition_optimal_convex_2.h | 6 +- .../CGAL/Partition_2/partition_y_monotone_2.h | 6 +- .../include/CGAL/partition_is_valid_2.h | 8 +- 6 files changed, 19 insertions(+), 360 deletions(-) delete mode 100644 Partition_2/include/CGAL/Partition_2/partition_assertions.h diff --git a/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h b/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h index 076e78cee57..88d756d243a 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h @@ -29,7 +29,7 @@ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") #include #include #include -#include +#include #include #include #include @@ -138,7 +138,7 @@ OutputIterator partition_approx_convex_2(InputIterator first, P_Polygon_2 polygon(first, beyond,traits); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); Circulator first_c(polygon.begin(), polygon.end(), polygon.begin()); @@ -238,7 +238,7 @@ OutputIterator partition_approx_convex_2(InputIterator first, #endif // no postconditions polygon.partition(res, 0); - CGAL_partition_postcondition( + CGAL_postcondition( convex_partition_is_valid_2(polygon.begin(), polygon.end(), res.output_so_far_begin(), res.output_so_far_end(), traits)); diff --git a/Partition_2/include/CGAL/Partition_2/partition_assertions.h b/Partition_2/include/CGAL/Partition_2/partition_assertions.h deleted file mode 100644 index 6d0f0288b3e..00000000000 --- a/Partition_2/include/CGAL/Partition_2/partition_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 1997 Max-Planck-Institute Saarbruecken (Germany). -// 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) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_partition_assertion -#undef CGAL_partition_assertion_msg -#undef CGAL_partition_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_partition_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_partition_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_assertion_code(CODE) -#else -# define CGAL_partition_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_assertion_code(CODE) CODE -# define CGAL_partition_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -#undef CGAL_partition_exactness_assertion -#undef CGAL_partition_exactness_assertion_msg -#undef CGAL_partition_exactness_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_assertion(EX) (static_cast(0)) -# define CGAL_partition_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_assertion_code(CODE) -#else -# define CGAL_partition_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_assertion_code(CODE) CODE -# define CGAL_partition_exactness_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -#undef CGAL_partition_expensive_assertion -#undef CGAL_partition_expensive_assertion_msg -#undef CGAL_partition_expensive_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_assertion(EX) (static_cast(0)) -# define CGAL_partition_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_assertion_code(CODE) -#else -# define CGAL_partition_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_assertion_code(CODE) CODE -# define CGAL_partition_expensive_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -#undef CGAL_partition_expensive_exactness_assertion -#undef CGAL_partition_expensive_exactness_assertion_msg -#undef CGAL_partition_expensive_exactness_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_partition_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_partition_expensive_exactness_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_partition_precondition -#undef CGAL_partition_precondition_msg -#undef CGAL_partition_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_partition_precondition(EX) (static_cast(0)) -# define CGAL_partition_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_precondition_code(CODE) -#else -# define CGAL_partition_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_precondition_code(CODE) CODE -# define CGAL_partition_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -#undef CGAL_partition_exactness_precondition -#undef CGAL_partition_exactness_precondition_msg -#undef CGAL_partition_exactness_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_precondition(EX) (static_cast(0)) -# define CGAL_partition_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_precondition_code(CODE) -#else -# define CGAL_partition_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_precondition_code(CODE) CODE -# define CGAL_partition_exactness_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -#undef CGAL_partition_expensive_precondition -#undef CGAL_partition_expensive_precondition_msg -#undef CGAL_partition_expensive_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_precondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_precondition_code(CODE) -#else -# define CGAL_partition_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_precondition_code(CODE) CODE -# define CGAL_partition_expensive_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -#undef CGAL_partition_expensive_exactness_precondition -#undef CGAL_partition_expensive_exactness_precondition_msg -#undef CGAL_partition_expensive_exactness_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_partition_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_partition_expensive_exactness_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_partition_postcondition -#undef CGAL_partition_postcondition_msg -#undef CGAL_partition_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_partition_postcondition(EX) (static_cast(0)) -# define CGAL_partition_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_postcondition_code(CODE) -#else -# define CGAL_partition_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_postcondition_code(CODE) CODE -# define CGAL_partition_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -#undef CGAL_partition_exactness_postcondition -#undef CGAL_partition_exactness_postcondition_msg -#undef CGAL_partition_exactness_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_partition_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_postcondition_code(CODE) -#else -# define CGAL_partition_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_postcondition_code(CODE) CODE -# define CGAL_partition_exactness_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -#undef CGAL_partition_expensive_postcondition -#undef CGAL_partition_expensive_postcondition_msg -#undef CGAL_partition_expensive_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_postcondition_code(CODE) -#else -# define CGAL_partition_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_postcondition_code(CODE) CODE -# define CGAL_partition_expensive_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -#undef CGAL_partition_expensive_exactness_postcondition -#undef CGAL_partition_expensive_exactness_postcondition_msg -#undef CGAL_partition_expensive_exactness_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_partition_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_partition_expensive_exactness_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_partition_warning -#undef CGAL_partition_warning_msg -#undef CGAL_partition_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_partition_warning(EX) (static_cast(0)) -# define CGAL_partition_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_warning_code(CODE) -#else -# define CGAL_partition_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_warning_code(CODE) CODE -# define CGAL_partition_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS - - -#undef CGAL_partition_exactness_warning -#undef CGAL_partition_exactness_warning_msg -#undef CGAL_partition_exactness_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_warning(EX) (static_cast(0)) -# define CGAL_partition_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_warning_code(CODE) -#else -# define CGAL_partition_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_warning_code(CODE) CODE -# define CGAL_partition_exactness_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS - - -#undef CGAL_partition_expensive_warning -#undef CGAL_partition_expensive_warning_msg -#undef CGAL_partition_expensive_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_warning(EX) (static_cast(0)) -# define CGAL_partition_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_warning_code(CODE) -#else -# define CGAL_partition_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_warning_code(CODE) CODE -# define CGAL_partition_expensive_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS - - -#undef CGAL_partition_expensive_exactness_warning -#undef CGAL_partition_expensive_exactness_warning_msg -#undef CGAL_partition_expensive_exactness_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_warning_code(CODE) -#else -# define CGAL_partition_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_warning_code(CODE) CODE -# define CGAL_partition_expensive_exactness_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS diff --git a/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h b/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h index 8f3d54ce5dd..194e777a188 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -90,7 +90,7 @@ void erase_vertices(BidirectionalCirculator first, #endif it = first.current_iterator(); - CGAL_partition_assertion (it != polygon.end()); + CGAL_assertion (it != polygon.end()); while ( (it != polygon.end()) && (*it != *last) ) { @@ -692,9 +692,9 @@ void ga_convex_decomposition(ForwardIterator first, ForwardIterator beyond, Vertex_list polygon(first, beyond); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); - CGAL_partition_precondition( + CGAL_precondition( is_y_monotone_2(polygon.begin(), polygon.end(), traits)); Vertex_circulator point_ref(&polygon); @@ -806,7 +806,7 @@ OutputIterator partition_greene_approx_convex_2(InputIterator first, #endif // no postconditions Polygon_2 polygon(first, beyond); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.vertices_begin(), polygon.vertices_end(), traits) == COUNTERCLOCKWISE); @@ -822,7 +822,7 @@ OutputIterator partition_greene_approx_convex_2(InputIterator first, (*MP_it).vertices_end(), res, traits); } - CGAL_partition_postcondition( + CGAL_postcondition( convex_partition_is_valid_2(polygon.vertices_begin(), polygon.vertices_end(), res.output_so_far_begin(), diff --git a/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h b/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h index 0b87e73eb84..f5f500720a4 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include #include @@ -520,7 +520,7 @@ OutputIterator partition_optimal_convex_2(InputIterator first, #endif // no postconditions P_Polygon_2 polygon(first, beyond,traits); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); #ifdef CGAL_PARTITION_OPTIMAL_CONVEX_DEBUG @@ -559,7 +559,7 @@ OutputIterator partition_optimal_convex_2(InputIterator first, // be pruned away. These crop up when there are collinear vertices. // See explanation at top of file. polygon.partition(res, 1); - CGAL_partition_postcondition( + CGAL_postcondition( convex_partition_is_valid_2(polygon.begin(), polygon.end(), res.output_so_far_begin(), res.output_so_far_end(), traits) diff --git a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h index a4918e5548f..d74bc9b9db8 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -426,7 +426,7 @@ OutputIterator partition_y_monotone_2(InputIterator first, #endif // no postcondition P_Polygon_2 polygon(first, beyond, traits); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); Circulator circ(polygon.begin(), polygon.end()), done = circ; @@ -484,7 +484,7 @@ OutputIterator partition_y_monotone_2(InputIterator first, #endif polygon.partition(res, 0); - CGAL_partition_postcondition( + CGAL_postcondition( y_monotone_partition_is_valid_2(polygon.begin(), polygon.end(), res.output_so_far_begin(), res.output_so_far_end(), traits)); diff --git a/Partition_2/include/CGAL/partition_is_valid_2.h b/Partition_2/include/CGAL/partition_is_valid_2.h index 71ddd0d66e3..f6a5f2bbd7f 100644 --- a/Partition_2/include/CGAL/partition_is_valid_2.h +++ b/Partition_2/include/CGAL/partition_is_valid_2.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -147,8 +147,8 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, for (;point_first != point_last; point_first++) orig_poly.push_back(*point_first); - CGAL_partition_precondition(orientation_2(orig_poly.begin(),orig_poly.end(), - traits) == COUNTERCLOCKWISE); + CGAL_precondition(orientation_2(orig_poly.begin(),orig_poly.end(), + traits) == COUNTERCLOCKWISE); P_Vertex_map output_vertex_set(poly_first, poly_last, traits); @@ -163,7 +163,7 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, std::cout << "Polygon " << poly_num << " is " << std::endl; std::cout << *poly_first << std::endl; #endif - CGAL_partition_assertion ( + CGAL_assertion ( orientation_2(vtx_begin, vtx_end, traits) == COUNTERCLOCKWISE); if (!is_valid(vtx_begin, vtx_end)) { From dc531cbaa92f5de3b77f0a97bc546f744d93a7ba Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 08:40:26 +0100 Subject: [PATCH 095/248] Convex_hull_2 --- .../Convex_hull_2/ch_akl_toussaint_impl.h | 10 +- .../CGAL/Convex_hull_2/ch_assertions.h | 341 ------------------ .../CGAL/Convex_hull_2/ch_bykat_impl.h | 10 +- .../include/CGAL/Convex_hull_2/ch_eddy_impl.h | 8 +- .../Convex_hull_2/ch_graham_andrew_impl.h | 28 +- .../CGAL/Convex_hull_2/ch_jarvis_impl.h | 22 +- .../CGAL/Convex_hull_2/ch_melkman_impl.h | 20 +- 7 files changed, 49 insertions(+), 390 deletions(-) delete mode 100644 Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h index ae896d3e374..455c2ce3fcf 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h @@ -20,7 +20,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -252,7 +252,7 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, region3.push_back( *e); region4.push_back( *n); - CGAL_ch_postcondition_code( ForwardIterator save_first = first; ) + CGAL_postcondition_code( ForwardIterator save_first = first; ) int duplicated_exteme_points = (std::get<0>(ranges)==std::get<1>(ranges)?1:0) + (std::get<1>(ranges)==std::get<2>(ranges)?1:0) + @@ -323,12 +323,12 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, res, ch_traits); } - CGAL_ch_postcondition_code( first = save_first; ) - CGAL_ch_postcondition( \ + CGAL_postcondition_code( first = save_first; ) + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ first, last, \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h deleted file mode 100644 index 1706f796e9f..00000000000 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 1999 Max-Planck-Institute Saarbruecken (Germany). -// 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) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_ch_assertion -#undef CGAL_ch_assertion_msg -#undef CGAL_ch_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_ch_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_ch_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_assertion_code(CODE) -#else -# define CGAL_ch_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_assertion_code(CODE) CODE -# define CGAL_ch_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -#undef CGAL_ch_exactness_assertion -#undef CGAL_ch_exactness_assertion_msg -#undef CGAL_ch_exactness_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_assertion(EX) (static_cast(0)) -# define CGAL_ch_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_assertion_code(CODE) -#else -# define CGAL_ch_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_assertion_code(CODE) CODE -# define CGAL_ch_exactness_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -#undef CGAL_ch_expensive_assertion -#undef CGAL_ch_expensive_assertion_msg -#undef CGAL_ch_expensive_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_assertion(EX) (static_cast(0)) -# define CGAL_ch_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_assertion_code(CODE) -#else -# define CGAL_ch_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_assertion_code(CODE) CODE -# define CGAL_ch_expensive_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -#undef CGAL_ch_expensive_exactness_assertion -#undef CGAL_ch_expensive_exactness_assertion_msg -#undef CGAL_ch_expensive_exactness_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_ch_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_ch_expensive_exactness_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_ch_precondition -#undef CGAL_ch_precondition_msg -#undef CGAL_ch_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_ch_precondition(EX) (static_cast(0)) -# define CGAL_ch_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_precondition_code(CODE) -#else -# define CGAL_ch_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_precondition_code(CODE) CODE -# define CGAL_ch_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -#undef CGAL_ch_exactness_precondition -#undef CGAL_ch_exactness_precondition_msg -#undef CGAL_ch_exactness_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_precondition(EX) (static_cast(0)) -# define CGAL_ch_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_precondition_code(CODE) -#else -# define CGAL_ch_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_precondition_code(CODE) CODE -# define CGAL_ch_exactness_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -#undef CGAL_ch_expensive_precondition -#undef CGAL_ch_expensive_precondition_msg -#undef CGAL_ch_expensive_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_precondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_precondition_code(CODE) -#else -# define CGAL_ch_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_precondition_code(CODE) CODE -# define CGAL_ch_expensive_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -#undef CGAL_ch_expensive_exactness_precondition -#undef CGAL_ch_expensive_exactness_precondition_msg -#undef CGAL_ch_expensive_exactness_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_ch_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_ch_expensive_exactness_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_ch_postcondition -#undef CGAL_ch_postcondition_msg -#undef CGAL_ch_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_ch_postcondition(EX) (static_cast(0)) -# define CGAL_ch_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_postcondition_code(CODE) -#else -# define CGAL_ch_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_postcondition_code(CODE) CODE -# define CGAL_ch_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -#undef CGAL_ch_exactness_postcondition -#undef CGAL_ch_exactness_postcondition_msg -#undef CGAL_ch_exactness_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_ch_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_postcondition_code(CODE) -#else -# define CGAL_ch_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_postcondition_code(CODE) CODE -# define CGAL_ch_exactness_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -#undef CGAL_ch_expensive_postcondition -#undef CGAL_ch_expensive_postcondition_msg -#undef CGAL_ch_expensive_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_postcondition_code(CODE) -#else -# define CGAL_ch_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_postcondition_code(CODE) CODE -# define CGAL_ch_expensive_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -#undef CGAL_ch_expensive_exactness_postcondition -#undef CGAL_ch_expensive_exactness_postcondition_msg -#undef CGAL_ch_expensive_exactness_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_ch_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_ch_expensive_exactness_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_ch_warning -#undef CGAL_ch_warning_msg -#undef CGAL_ch_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_ch_warning(EX) (static_cast(0)) -# define CGAL_ch_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_warning_code(CODE) -#else -# define CGAL_ch_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_warning_code(CODE) CODE -# define CGAL_ch_warnings 1 -#endif // CGAL_CH_NO_WARNINGS - - -#undef CGAL_ch_exactness_warning -#undef CGAL_ch_exactness_warning_msg -#undef CGAL_ch_exactness_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_warning(EX) (static_cast(0)) -# define CGAL_ch_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_warning_code(CODE) -#else -# define CGAL_ch_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_warning_code(CODE) CODE -# define CGAL_ch_exactness_warnings 1 -#endif // CGAL_CH_NO_WARNINGS - - -#undef CGAL_ch_expensive_warning -#undef CGAL_ch_expensive_warning_msg -#undef CGAL_ch_expensive_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_warning(EX) (static_cast(0)) -# define CGAL_ch_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_warning_code(CODE) -#else -# define CGAL_ch_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_warning_code(CODE) CODE -# define CGAL_ch_expensive_warnings 1 -#endif // CGAL_CH_NO_WARNINGS - - -#undef CGAL_ch_expensive_exactness_warning -#undef CGAL_ch_expensive_exactness_warning_msg -#undef CGAL_ch_expensive_exactness_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_warning_code(CODE) -#else -# define CGAL_ch_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_warning_code(CODE) CODE -# define CGAL_ch_expensive_exactness_warnings 1 -#endif // CGAL_CH_NO_WARNINGS diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h index cd48b9b9e67..180f44f7e7d 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h @@ -20,7 +20,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -116,11 +116,11 @@ ch_bykat(InputIterator first, InputIterator last, r = R.back(); R.pop_back(); } } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ P.begin(), P.end(), \ res.output_so_far_begin(), res.output_so_far_end(), \ @@ -255,11 +255,11 @@ ch_bykat_with_threshold(InputIterator first, InputIterator last, r = R.back(); R.pop_back(); } } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ Pbegin, Pend, \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h index c72f79f4c90..0f484f2b72b 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h @@ -20,7 +20,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -44,7 +44,7 @@ ch__recursive_eddy(List& L, Left_turn_2 left_turn = ch_traits.left_turn_2_object(); Less_xy_2 less_xy = ch_traits.less_xy_2_object(); - CGAL_ch_precondition( \ + CGAL_precondition( \ std::find_if(a_it, b_it, \ [&left_turn, a_it, b_it](const Point_2& p) { return left_turn(*b_it, *a_it, p); }) \ @@ -137,9 +137,9 @@ ch_eddy(InputIterator first, InputIterator last, ch__recursive_eddy( L, e, w, ch_traits); - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( L.begin(), w, ch_traits) ); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( first, last, \ L.begin(), w, ch_traits ) ); diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h index d30fccdc8e3..1fdef8d9d0c 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h @@ -21,7 +21,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -42,11 +42,11 @@ ch_graham_andrew_scan( BidirectionalIterator first, BidirectionalIterator alpha; BidirectionalIterator beta; BidirectionalIterator iter; - CGAL_ch_precondition( first != last ); - CGAL_ch_precondition( std::next(first) != last ); + CGAL_precondition( first != last ); + CGAL_precondition( std::next(first) != last ); --last; - CGAL_ch_precondition( *first != *last ); + CGAL_precondition( *first != *last ); S.push_back( last ); S.push_back( first ); Left_turn left_turn = ch_traits.left_turn_2_object(); @@ -78,7 +78,7 @@ ch_graham_andrew_scan( BidirectionalIterator first, alpha = beta; stack_rev_iter = S.rbegin(); beta = *++stack_rev_iter; - CGAL_ch_assertion(S.size() >= 2); + CGAL_assertion(S.size() >= 2); } S.push_back( iter ); beta = alpha; @@ -98,11 +98,11 @@ ch_graham_andrew_scan( BidirectionalIterator first, #endif // no postconditions ... for ( ++stack_iter; stack_iter != S.end(); ++stack_iter) { *res = **stack_iter; ++res; } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_chain_check_2( \ first, last, \ res.output_so_far_begin(), res.output_so_far_end(), \ @@ -123,7 +123,7 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first, { typedef typename Traits::Left_turn_2 Left_turn; - CGAL_ch_precondition_code( + CGAL_precondition_code( typedef typename Traits::Equal_2 Equal_2; Equal_2 equal_points = ch_traits.equal_2_object(); ) @@ -134,11 +134,11 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first, BidirectionalIterator alpha; BidirectionalIterator beta; BidirectionalIterator iter; - CGAL_ch_precondition( first != last ); - CGAL_ch_precondition( std::next(first) != last ); + CGAL_precondition( first != last ); + CGAL_precondition( std::next(first) != last ); --last; - CGAL_ch_precondition(! equal_points(*first,*last) ); + CGAL_precondition(! equal_points(*first,*last) ); S.push_back( last ); S.push_back( first ); @@ -168,7 +168,7 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first, alpha = beta; stack_rev_iter = S.rbegin(); beta = *++stack_rev_iter; - CGAL_ch_assertion(S.size() >= 2); + CGAL_assertion(S.size() >= 2); } S.push_back( iter ); beta = alpha; @@ -213,11 +213,11 @@ ch_graham_andrew( InputIterator first, #endif // no postconditions ... ch__ref_graham_andrew_scan( V.begin(), V.end(), res, ch_traits); ch__ref_graham_andrew_scan( V.rbegin(), V.rend(), res, ch_traits); - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ V.begin(), V.end(), \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h index 1ecdd0b7ea8..8710ea0a030 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h @@ -21,7 +21,7 @@ #endif // CGAL_CH_NO_POSTCONDITIONS #include -#include +#include #include #include @@ -48,16 +48,16 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last, typedef typename Traits::Point_2 Point_2; Tee_for_output_iterator res(result); #endif // no postconditions ... - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ int count_points = 0; ) - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ for (ForwardIterator fit = first; fit!= last; ++fit) ++count_points; ) Less_rotate_ccw rotation_predicate = ch_traits.less_rotate_ccw_2_object( ); *res = start_p; ++res; - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ int constructed_points = 1; ) - CGAL_ch_exactness_assertion_code( \ + CGAL_exactness_assertion_code( \ Point previous_point = start_p; ) ForwardIterator it = std::min_element( first, last, @@ -65,26 +65,26 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last, {return rotation_predicate(start_p, p1, p2);} ); while (! equal_points(*it, stop_p) ) { - CGAL_ch_exactness_assertion( \ + CGAL_exactness_assertion( \ *it != previous_point ); - CGAL_ch_exactness_assertion_code( \ + CGAL_exactness_assertion_code( \ previous_point = *it; ) *res = *it; ++res; - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ ++constructed_points;) - CGAL_ch_assertion( \ + CGAL_assertion( \ constructed_points <= count_points + 1 ); it = std::min_element( first, last, [it, &rotation_predicate](const Point& p1, const Point& p2) {return rotation_predicate(*it, p1, p2);} ); } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( first, last, \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h index 4af027e992d..04e1e931f66 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h @@ -19,7 +19,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include @@ -37,19 +37,19 @@ ch_melkman( InputIterator first, InputIterator last, typename Traits::Left_turn_2 left_turn = ch_traits.left_turn_2_object(); Equal_2 equal_points = ch_traits.equal_2_object(); - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ typename Traits::Less_xy_2 less = ch_traits.less_xy_2_object(); ) std::deque< Point> Q; - CGAL_ch_expensive_postcondition_code( std::deque< Point> IN; ) + CGAL_expensive_postcondition_code( std::deque< Point> IN; ) if (first == last) return result; // 0 elements Point p = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(p); ) + CGAL_expensive_postcondition_code( IN.push_back(p); ) if (++first == last) { *result = p; ++result; return result; } // 1 element Point q = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(q); ) + CGAL_expensive_postcondition_code( IN.push_back(q); ) if (++first == last) // 2 elements { *result = p; ++result; @@ -63,11 +63,11 @@ ch_melkman( InputIterator first, InputIterator last, while (first != last) { r = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(r); ) + CGAL_expensive_postcondition_code( IN.push_back(r); ) // visited input sequence = p,..., q, r if ( left_turn(p,q,r)) { Q.push_back( q); break; } if ( left_turn(q,p,r)) { Q.push_front( q); break; } - CGAL_ch_assertion( less( p, q) ? less (p, r) : less( r, p)); + CGAL_assertion( less( p, q) ? less (p, r) : less( r, p)); q = r; ++first; } @@ -84,7 +84,7 @@ ch_melkman( InputIterator first, InputIterator last, while ( ++first != last) { r = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(r); ) + CGAL_expensive_postcondition_code( IN.push_back(r); ) if (left_turn( current, r, Q.front()) || left_turn( Q.back(), r, current)) // r outside cone Q.front(), current, Q.back() <=> @@ -110,9 +110,9 @@ ch_melkman( InputIterator first, InputIterator last, Q.push_back( current); // add last point to Q - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( Q.begin(), Q.end(), ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( IN.begin(),IN.end(), Q.begin(),Q.end(), ch_traits)); std::copy( Q.begin(), Q.end(), result); return result; From 15c0ead4991fbd304f781f13a3b749d659651215 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 09:34:25 +0100 Subject: [PATCH 096/248] Straight_skeleton_2 --- .../include/CGAL/Straight_skeleton_2/assertions.h | 13 ------------- .../include/CGAL/arrange_offset_polygons_2.h | 5 ----- .../test/Straight_skeleton_2/test_sls_offset.cpp | 4 ++-- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h index 3916c7627c5..252fab5815e 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h @@ -15,18 +15,6 @@ #include -#if defined(CGAL_STRAIGHT_SKELETON_NO_POSTCONDITIONS) \ - || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STRAIGHT_SKELETON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_stskel_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_stskel_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_stskel_expensive_postcondition_code(CODE) -#else -# define CGAL_stskel_expensive_postcondition(EX) (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_stskel_expensive_postcondition_msg(EX,MSG) (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_stskel_expensive_postcondition_code(CODE) CODE -#endif - namespace CGAL { @@ -44,4 +32,3 @@ template inline bool handle_assigned ( Handle const& aH ) #endif // CGAL_STRAIGHT_SKELETON_ASSERTIONS_H // // EOF // - diff --git a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h index 7331f70bd69..e7fca71b2b2 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -46,9 +46,6 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin , const K& ) { - bool bk_poly_assert_mode = get_use_polygon_assertions(); - set_use_polygon_assertions(false); // disable assertions in Polygon_2 function as we may manipulate strictly simple polygons - typedef typename std::iterator_traits::difference_type difference_type ; typedef typename std::iterator_traits::value_type PolygonPtr ; @@ -100,14 +97,12 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin if (lParent == nullptr) { - set_use_polygon_assertions(bk_poly_assert_mode); return false; } lParent->add_hole(*lPoly); } } - set_use_polygon_assertions(bk_poly_assert_mode); return true; } diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index ad14146a74b..f1296a0eb06 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -943,12 +943,12 @@ void test_offset(const char* filename) std::cout << offset_poly_with_holes.size() << " polygons with holes" << std::endl; // for(const auto& offp : offset_poly_with_holes) // print_polygon_with_holes(*offp); - CGAL::set_use_polygon_assertions(false); + for(const auto& offp : offset_poly_with_holes){ (void)offp; assert(offp->outer_boundary().is_counterclockwise_oriented()); } - CGAL::set_use_polygon_assertions(true); + #ifdef CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE if(i > 2) break; From f411e0902cb744ae33151f342ceedb04dbe644cc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 10:57:18 +0200 Subject: [PATCH 097/248] STL_extension: doc improvements Add `()` to functions. Backtick. --- .../doc/STL_Extension/CGAL/algorithm.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h index 7536f029c71..0fdcb3d1001 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h +++ b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h @@ -7,7 +7,7 @@ namespace CGAL { /*! \ingroup STLAlgos -\deprecated This function is deprecated, std::copy_n should be +\deprecated This function is deprecated, `std::copy_n()` should be used instead. Copies the first `n` items from `first` to `result`. @@ -36,15 +36,15 @@ namespace CGAL { Computes the minimal and the maximal element of a range. It is modeled after the STL functions -`std::min_element` and `std::max_element`. The advantage of -`min_max_element` compared to calling both STL functions is that +`std::min_element()` and `std::max_element()`. The advantage of +`min_max_element()` compared to calling both STL functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences. \cgalHeading{Example} The following example program computes the minimal and -maximal element of the sequence ` (3,\,6,\,5)`. Hence the output is +maximal element of the sequence `(3,\,6,\,5)`. Hence the output is `min = 3, max = 6`. \cgalExample{STL_Extension/min_max_element_example.cpp} @@ -65,8 +65,8 @@ first, ForwardIterator last); Computes the minimal and the maximal element of a range. It is modeled after the STL functions -`std::min_element` and `std::max_element`. The advantage of -`min_max_element` compared to calling both STL functions is that +`std::min_element()` and `std::max_element()`. The advantage of +`min_max_element()` compared to calling both STL functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences. @@ -95,11 +95,11 @@ namespace CGAL { /*! \ingroup STLAlgos -\deprecated This function is deprecated. `std::prev` should be used +\deprecated This function is deprecated. `std::prev()` should be used instead. Returns the previous iterator, -i.e.\ the result of `operator--` on a bidirectional iterator. +i.e.\ the result of `operator--()` on a bidirectional iterator. \sa `CGAL::successor()` @@ -115,17 +115,17 @@ namespace CGAL { /*! \ingroup STLAlgos -\deprecated This function is deprecated. `std::next` should be used +\deprecated This function is deprecated. `std::next()` should be used instead. -Returns the next iterator, i.e. -the result of `operator++` on a forward iterator. +Returns the next iterator, i.e., +the result of `operator++()` on a forward iterator. \sa `CGAL::predecessor()` -\returns `++it`. +\returns `it`. */ template ForwardIterator successor(ForwardIterator it); From 94c72ae3860205c1c222b475d6c54e73a720ce58 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 10:08:50 +0100 Subject: [PATCH 098/248] Convex_hull_3 --- Convex_hull_3/include/CGAL/convex_hull_3.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 46d2082ab0b..18a11329308 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -565,7 +565,7 @@ farthest_outside_point(Face_handle f, std::list& outside_set, { typedef typename std::list::iterator Outside_set_iterator; - CGAL_ch_assertion(!outside_set.empty()); + CGAL_assertion(!outside_set.empty()); typename Traits::Plane_3 plane = traits.construct_plane_3_object()(f->vertex(0)->point(), @@ -682,7 +682,7 @@ ch_quickhull_3_scan(TDS_2& tds, border.erase(it); while(! border.empty()){ it = border.find(e.first->vertex(TDS_2::ccw(e.second))); - CGAL_ch_assertion(it != border.end()); + CGAL_assertion(it != border.end()); e = it->second; e.first->info() = 0; edges.push_back(e); @@ -758,9 +758,9 @@ void non_coplanar_quickhull_3(std::list& points, ch_quickhull_3_scan(tds, pending_facets, traits); //std::cout << "|V(tds)| = " << tds.number_of_vertices() << std::endl; -// CGAL_ch_expensive_postcondition(all_points_inside(points.begin(), +// CGAL_expensive_postcondition(all_points_inside(points.begin(), // points.end(),P,traits)); -// CGAL_ch_postcondition(is_strongly_convex_3(P, traits)); +// CGAL_postcondition(is_strongly_convex_3(P, traits)); } template From 74e4d89cbc1d53619cfe799a842df0b8c6df10e1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 10:42:05 +0100 Subject: [PATCH 099/248] Optimisation --- Bounding_volumes/include/CGAL/Min_annulus_d.h | 32 +- Bounding_volumes/include/CGAL/Min_circle_2.h | 8 +- .../Min_circle_2/Min_circle_2_adapterC2.h | 4 +- .../Min_circle_2/Min_circle_2_adapterH2.h | 4 +- .../CGAL/Min_circle_2/Min_circle_2_impl.h | 4 +- .../Min_circle_2/Optimisation_circle_2_impl.h | 6 +- Bounding_volumes/include/CGAL/Min_ellipse_2.h | 12 +- .../Min_ellipse_2/Min_ellipse_2_adapterC2.h | 10 +- .../Min_ellipse_2/Min_ellipse_2_adapterH2.h | 10 +- .../CGAL/Min_ellipse_2/Min_ellipse_2_impl.h | 4 +- .../Min_ellipse_2/Optimisation_ellipse_2.h | 38 +-- .../Optimisation_ellipse_2_impl.h | 4 +- .../include/CGAL/Min_quadrilateral_traits_2.h | 18 +- Bounding_volumes/include/CGAL/Min_sphere_d.h | 22 +- .../CGAL/Min_sphere_d/Min_sphere_d_impl.h | 4 +- .../CGAL/Min_sphere_d/Optimisation_sphere_d.h | 8 +- .../CGAL/Rectangular_p_center_traits_2.h | 12 +- .../include/CGAL/min_quadrilateral_2.h | 12 +- .../include/CGAL/pierce_rectangles_2.h | 44 +-- .../include/CGAL/rectangular_3_center_2.h | 44 +-- .../include/CGAL/rectangular_p_center_2.h | 22 +- .../include/CGAL/Extremal_polygon_traits_2.h | 10 +- .../include/CGAL/extremal_polygon_2.h | 92 ++--- Matrix_search/include/CGAL/Cartesian_matrix.h | 6 +- Matrix_search/include/CGAL/Dynamic_matrix.h | 14 +- .../include/CGAL/Transform_iterator.h | 1 - .../include/CGAL/monotone_matrix_search.h | 14 +- .../include/CGAL/sorted_matrix_search.h | 16 +- .../include/CGAL/Optimisation/assertions.h | 323 ------------------ .../include/CGAL/Optimisation/basic.h | 1 - .../include/CGAL/Polytope_distance_d.h | 38 +-- .../include/CGAL/all_furthest_neighbors_2.h | 16 +- 32 files changed, 264 insertions(+), 589 deletions(-) delete mode 100644 Optimisation_basic/include/CGAL/Optimisation/assertions.h diff --git a/Bounding_volumes/include/CGAL/Min_annulus_d.h b/Bounding_volumes/include/CGAL/Min_annulus_d.h index 8dae7e73d26..eb7435ef1f8 100644 --- a/Bounding_volumes/include/CGAL/Min_annulus_d.h +++ b/Bounding_volumes/include/CGAL/Min_annulus_d.h @@ -325,7 +325,7 @@ public: Support_point_iterator support_points_begin() const { - CGAL_optimisation_assertion_msg(number_of_points() >= 2, + CGAL_assertion_msg(number_of_points() >= 2, "support_points_begin: not enough points"); return Support_point_iterator( solver->basic_original_variable_indices_begin(), @@ -334,7 +334,7 @@ public: Support_point_iterator support_points_end() const { - CGAL_optimisation_assertion_msg(number_of_points() >= 2, + CGAL_assertion_msg(number_of_points() >= 2, "support_points_begin: not enough points"); return Support_point_iterator( solver->basic_original_variable_indices_end(), @@ -401,27 +401,27 @@ public: // NOTE: an implicit conversion from ET to RT must be available! Point center( ) const - { CGAL_optimisation_precondition( ! is_empty()); + { CGAL_precondition( ! is_empty()); return tco.construct_point_d_object()( ambient_dimension(), center_coordinates_begin(), center_coordinates_end()); } FT squared_inner_radius( ) const - { CGAL_optimisation_precondition( ! is_empty()); + { CGAL_precondition( ! is_empty()); return FT( squared_inner_radius_numerator()) / FT( squared_radii_denominator()); } FT squared_outer_radius( ) const - { CGAL_optimisation_precondition( ! is_empty()); + { CGAL_precondition( ! is_empty()); return FT( squared_outer_radius_numerator()) / FT( squared_radii_denominator()); } // predicates CGAL::Bounded_side bounded_side( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d]; @@ -431,7 +431,7 @@ public: bool has_on_bounded_side( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d]; @@ -440,7 +440,7 @@ public: bool has_on_boundary( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d]; @@ -449,7 +449,7 @@ public: bool has_on_unbounded_side( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr(da_coord(p)[d]); @@ -468,14 +468,14 @@ public: { if ( points.size() > 0) points.erase( points.begin(), points.end()); std::copy( first, last, std::back_inserter( points)); set_dimension(); - CGAL_optimisation_precondition_msg( check_dimension(), + CGAL_precondition_msg( check_dimension(), "Not all points have the same dimension."); compute_min_annulus(); } void insert( const Point& p) { if ( is_empty()) d = tco.access_dimension_d_object()( p); - CGAL_optimisation_precondition( + CGAL_precondition( tco.access_dimension_d_object()( p) == d); points.push_back( p); compute_min_annulus(); } @@ -483,10 +483,10 @@ public: template < class InputIterator > void insert( InputIterator first, InputIterator last) - { CGAL_optimisation_precondition_code( std::size_t old_n = points.size()); + { CGAL_precondition_code( std::size_t old_n = points.size()); points.insert( points.end(), first, last); set_dimension(); - CGAL_optimisation_precondition_msg( check_dimension( old_n), + CGAL_precondition_msg( check_dimension( old_n), "Not all points have the same dimension."); compute_min_annulus(); } @@ -645,7 +645,7 @@ private: options.set_pricing_strategy(pricing_strategy(NT())); delete solver; solver = new Solver(lp, options); - CGAL_optimisation_assertion(solver->status() == QP_OPTIMAL); + CGAL_assertion(solver->status() == QP_OPTIMAL); // compute center and squared radius ET sqr_sum = 0; @@ -829,7 +829,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -858,7 +858,7 @@ operator >> ( std::istream& is, CGAL::Min_annulus_d& min_annulus) break; default: - CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!"); + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_circle_2.h b/Bounding_volumes/include/CGAL/Min_circle_2.h index 759eb9195ef..ee36071ce21 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2.h @@ -191,7 +191,7 @@ class Min_circle_2 { const Point& support_point( std::size_t i) const { - CGAL_optimisation_precondition(i < number_of_support_points()); + CGAL_precondition(i < number_of_support_points()); return( support_points[ i]); } // circle @@ -256,7 +256,7 @@ class Min_circle_2 { tco.circle.set( ); break; default: - CGAL_optimisation_assertion( n_support_points <= 3 ); } + CGAL_assertion( n_support_points <= 3 ); } } void @@ -334,7 +334,7 @@ class Min_circle_2 { // initialize circle tco.circle.set(); - CGAL_optimisation_postcondition( is_empty()); + CGAL_postcondition( is_empty()); } // constructor for one point @@ -349,7 +349,7 @@ class Min_circle_2 { support_points[ 0] = p; tco.circle.set( p); - CGAL_optimisation_postcondition( is_degenerate()); + CGAL_postcondition( is_degenerate()); } // constructor for two points diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h index 47d93bb8288..5121c02919c 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h @@ -293,7 +293,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -323,7 +323,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h index 43b90b757d0..cc5bbbf4164 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h @@ -332,7 +332,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -363,7 +363,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h index ccb2d79af91..114a59a297a 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h @@ -60,7 +60,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -89,7 +89,7 @@ operator >> ( std::istream& is, CGAL::Min_circle_2& min_circle) break; default: - CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!"); + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h b/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h index 33cf439dd26..f2e94333b61 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h @@ -11,7 +11,7 @@ // Author(s) : Sven Schoenherr , Bernd Gaertner // includes -# include +# include namespace CGAL { @@ -42,7 +42,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_circle_2& c) break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -79,7 +79,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2& c) break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( is) invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2.h index 3421a2de847..b8b35130a50 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2.h @@ -203,7 +203,7 @@ class Min_ellipse_2 { const Point& support_point( std::size_t i) const { - CGAL_optimisation_precondition(i < number_of_support_points()); + CGAL_precondition(i < number_of_support_points()); return( support_points[ i]); } // ellipse @@ -281,7 +281,7 @@ class Min_ellipse_2 { tco.ellipse.set( ); break; default: - CGAL_optimisation_assertion( ( n_support_points >= 0) && + CGAL_assertion( ( n_support_points >= 0) && ( n_support_points <= 5) ); } } @@ -360,7 +360,7 @@ class Min_ellipse_2 { // initialize ellipse tco.ellipse.set(); - CGAL_optimisation_postcondition( is_empty()); + CGAL_postcondition( is_empty()); } inline @@ -373,7 +373,7 @@ class Min_ellipse_2 { // initialize ellipse tco.ellipse.set(); - CGAL_optimisation_postcondition( is_empty()); + CGAL_postcondition( is_empty()); } // constructor for one point @@ -388,7 +388,7 @@ class Min_ellipse_2 { support_points[ 0] = p; tco.ellipse.set( p); - CGAL_optimisation_postcondition( is_degenerate()); + CGAL_postcondition( is_degenerate()); } // constructor for two points @@ -409,7 +409,7 @@ class Min_ellipse_2 { // compute me me( points.end(), 0); - CGAL_optimisation_postcondition( is_degenerate()); + CGAL_postcondition( is_degenerate()); } // constructor for three points diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h index e2fad6bc1bb..be22328dfb4 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h @@ -18,7 +18,7 @@ // includes # include -# include +# include namespace CGAL { @@ -235,7 +235,7 @@ class _Min_ellipse_2_adapterC2__Ellipse { int tau_star = c.vol_derivative( dr, ds, dt, du, dv, dw); return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); } // keeps g++ happy return( CGAL::Bounded_side( 0)); @@ -298,7 +298,7 @@ class _Min_ellipse_2_adapterC2__Ellipse { || ( ( conic1 == e.conic2) && ( conic2 == e.conic1))); default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5)); } // keeps g++ happy return( false); @@ -341,7 +341,7 @@ operator << ( std::ostream& os, case CGAL::IO::BINARY: break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -405,7 +405,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h index f971e915fc4..22c12492b8d 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h @@ -18,7 +18,7 @@ // includes # include -# include +# include namespace CGAL { @@ -243,7 +243,7 @@ class _Min_ellipse_2_adapterH2__Ellipse { int tau_star = c.vol_derivative( dr, ds, dt, du, dv, dw); return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); } // keeps g++ happy return( CGAL::Bounded_side( 0)); @@ -306,7 +306,7 @@ class _Min_ellipse_2_adapterH2__Ellipse { || ( ( conic1 == e.conic2) && ( conic2 == e.conic1))); default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5)); } // keeps g++ happy return( false); @@ -349,7 +349,7 @@ operator << ( std::ostream& os, case CGAL::IO::BINARY: break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -413,7 +413,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h index 708c6644d9c..d7bd821350e 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h @@ -60,7 +60,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -89,7 +89,7 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2& min_ellipse) break; default: - CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!"); + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h index ef343d86c91..54c72de0678 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include @@ -131,7 +131,7 @@ class Optimisation_ellipse_2 { set( const Point& p, const Point& q) { n_boundary_points = 2; - CGAL_optimisation_precondition(boundary_point1 == p); CGAL_USE(p); + CGAL_precondition(boundary_point1 == p); CGAL_USE(p); boundary_point2 = q; } @@ -139,20 +139,20 @@ class Optimisation_ellipse_2 { set( const Point& p1, const Point& p2, const Point& p3) { n_boundary_points = 3; - CGAL_optimisation_precondition(boundary_point1 == p1); - CGAL_optimisation_precondition(boundary_point2 == p2); + CGAL_precondition(boundary_point1 == p1); + CGAL_precondition(boundary_point2 == p2); boundary_point3 = p3; helper_conic.set_ellipse( p1, p2, p3); - CGAL_optimisation_assertion(helper_conic.is_ellipse()); + CGAL_assertion(helper_conic.is_ellipse()); } void set( const Point& p1, const Point& p2, const Point& p3, const Point& p4) { n_boundary_points = 4; - CGAL_optimisation_precondition(boundary_point1 == p1); - CGAL_optimisation_precondition(boundary_point2 == p2); - CGAL_optimisation_precondition(boundary_point3 == p3); + CGAL_precondition(boundary_point1 == p1); + CGAL_precondition(boundary_point2 == p2); + CGAL_precondition(boundary_point3 == p3); boundary_point4 = p4; Conic::set_two_linepairs( p1, p2, p3, p4, conic1, conic2); @@ -195,7 +195,7 @@ class Optimisation_ellipse_2 { if (!helper_ellipse_set) { helper_ellipse.set_ellipse( conic1, conic2); helper_ellipse.analyse(); - CGAL_optimisation_assertion (helper_ellipse.is_ellipse()); + CGAL_assertion (helper_ellipse.is_ellipse()); helper_ellipse_set= true; } } @@ -211,14 +211,14 @@ class Optimisation_ellipse_2 { // In that case, helper_conic is already correct, // but in general, this optimization is NOT valid. n_boundary_points = 5; - CGAL_optimisation_assertion(helper_conic.is_ellipse()); + CGAL_assertion(helper_conic.is_ellipse()); // the following assertion is too strict if we run under // double (which is sometimes the case, e.g. in demos) - // CGAL_optimisation_assertion(helper_conic.has_on_boundary(p5)); - CGAL_optimisation_precondition(boundary_point1 == p1); - CGAL_optimisation_precondition(boundary_point2 == p2); - CGAL_optimisation_precondition(boundary_point3 == p3); - CGAL_optimisation_precondition(boundary_point4 == p4); + // CGAL_assertion(helper_conic.has_on_boundary(p5)); + CGAL_precondition(boundary_point1 == p1); + CGAL_precondition(boundary_point2 == p2); + CGAL_precondition(boundary_point3 == p3); + CGAL_precondition(boundary_point4 == p4); CGAL_USE(p1); CGAL_USE(p2); CGAL_USE(p3); CGAL_USE(p4); boundary_point5 = p5; } @@ -247,7 +247,7 @@ class Optimisation_ellipse_2 { double &u, double &v, double &w) const { // just like double_conic, but we only get the coefficients - CGAL_optimisation_precondition( ! is_degenerate()); + CGAL_precondition( ! is_degenerate()); if ( n_boundary_points == 4) { set_e_values(); @@ -297,7 +297,7 @@ class Optimisation_ellipse_2 { || ( ( conic1 == e.conic2) && ( conic2 == e.conic1))); default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5)); } // keeps g++ happy return( false); @@ -343,7 +343,7 @@ class Optimisation_ellipse_2 { helper_conic.vol_derivative( dr, ds, dt, du, dv, dw); return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); } // keeps g++ happy return( CGAL::Bounded_side( 0)); @@ -416,7 +416,7 @@ class Optimisation_ellipse_2 { return (CGAL::ZERO == (c.vol_derivative(dr, ds, dt, du, dv, dw))); } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); return false; } diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h index f2b1d2e8e87..4f94bbe4047 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h @@ -43,7 +43,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2& e) case CGAL::IO::BINARY: break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -106,7 +106,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2& e) break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( is) invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h b/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h index 9fd4c66ec0b..d3ad2595068 100644 --- a/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h +++ b/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h @@ -18,7 +18,7 @@ #include -#include +#include #include #include #include @@ -303,36 +303,36 @@ public: if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p1; } tmpo = isec(line(r.p3, r.d1), line(r.p2, r.d2)); if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p2; } tmpo = isec(line(r.p3, r.d1), line(r.p4, r.d2)); if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p3; } tmpo = isec(line(r.p1, r.d1), line(r.p4, r.d2)); if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p3; } return o; diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d.h b/Bounding_volumes/include/CGAL/Min_sphere_d.h index 96d11c86368..e76b989b39a 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d.h @@ -26,7 +26,7 @@ # include -# include +# include # include @@ -110,7 +110,7 @@ public: #endif if (points.size()>0) { d = tco.access_dimension_d_object() (points.front()); - CGAL_optimisation_precondition ((d>=0) && all_points_have_dim(d)); + CGAL_precondition ((d>=0) && all_points_have_dim(d)); ms_basis.get_sphere(Rep_tag()).set_size (d); pivot_ms(); } @@ -137,7 +137,7 @@ public: #endif if (points.size()>0) { d = tco.access_dimension_d_object() (points.front()); - CGAL_optimisation_precondition ((d>=0) && all_points_have_dim(d)); + CGAL_precondition ((d>=0) && all_points_have_dim(d)); ms_basis.get_sphere(Rep_tag()).set_size (d); pivot_ms(); } @@ -211,13 +211,13 @@ public: Point center () const { - CGAL_optimisation_precondition (!is_empty()); + CGAL_precondition (!is_empty()); return ms_basis.get_sphere(Rep_tag()).center(); } FT squared_radius () const { - CGAL_optimisation_precondition (!is_empty()); + CGAL_precondition (!is_empty()); return ms_basis.get_sphere(Rep_tag()).squared_radius(); } @@ -227,7 +227,7 @@ public: if (d == -1) return ON_UNBOUNDED_SIDE; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (Bounded_side (-CGAL::sign (ms_basis.get_sphere(Rep_tag()).excess (p)))); @@ -239,7 +239,7 @@ public: if (d == -1) return false; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (CGAL_NTS is_negative (ms_basis.get_sphere(Rep_tag()).excess (p))); } @@ -250,7 +250,7 @@ public: if (d == -1) return true; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (CGAL_NTS is_positive (ms_basis.get_sphere(Rep_tag()).excess (p))); } @@ -261,7 +261,7 @@ public: if (d == -1) return false; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (CGAL_NTS is_zero (ms_basis.get_sphere(Rep_tag()).excess (p))); } @@ -296,7 +296,7 @@ public: support_end = points.begin(); if (points.size()>0) { d = tco.access_dimension_d_object() (points.front()); - CGAL_optimisation_precondition ((d>=0) && all_points_have_dim (d)); + CGAL_precondition ((d>=0) && all_points_have_dim (d)); ms_basis.get_sphere(Rep_tag()).set_size (d); pivot_ms(); } else { @@ -310,7 +310,7 @@ public: if (has_on_unbounded_side (p)) { if (is_empty()) { d = tco.access_dimension_d_object() (p); - CGAL_optimisation_precondition (d>=0); + CGAL_precondition (d>=0); ms_basis.get_sphere(Rep_tag()).set_size (d); } // ensure precondition of pivot_ms diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h b/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h index 0415adbf47f..17231e575e4 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h @@ -62,7 +62,7 @@ operator << ( std::ostream& os, const Min_sphere_d& min_sphere) break; default: - CGAL_optimisation_assertion_msg + CGAL_assertion_msg ( false, "IO::get_mode( os) invalid!"); break; } @@ -93,7 +93,7 @@ operator >> ( std::istream& is, Min_sphere_d& min_sphere) } break; default: - CGAL_optimisation_assertion_msg( false, "IO::mode invalid!"); + CGAL_assertion_msg( false, "IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h b/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h index 02c554f9610..8e10f2b499c 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h @@ -42,7 +42,7 @@ class Optimisation_sphere_d; #include - #include + #include namespace CGAL { @@ -188,7 +188,7 @@ class Optimisation_sphere_d; // compute z FT z = FT_(2)*v_basis[m+1] - prod(v,x,m+1); - CGAL_optimisation_assertion (!CGAL_NTS is_zero (z)); + CGAL_assertion (!CGAL_NTS is_zero (z)); FT inv_z = FT_(1)/z; // set up A^{-1}_{B^m} @@ -461,7 +461,7 @@ class Optimisation_sphere_d; // compute \tilde{z} RT old_denom = denom[m-1]; RT z = old_denom*RT_(2)*sqr_q_m - prod(v,x,m+1); - CGAL_optimisation_assertion (!CGAL_NTS is_zero (z)); + CGAL_assertion (!CGAL_NTS is_zero (z)); // set up \tilde{A}^{-1}_{B^m} RT** M = inv[m-1]; // \tilde{A}^{-1}_B, old matrix @@ -503,7 +503,7 @@ class Optimisation_sphere_d; // get h_p RT h_p = *(i++); - CGAL_optimisation_precondition (!CGAL_NTS is_zero (h_p)); + CGAL_precondition (!CGAL_NTS is_zero (h_p)); // compute (h_p h D)^2 (c-p)^2 RT sqr_dist(RT(0)); diff --git a/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h b/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h index bc93c75bf74..d096b37c88f 100644 --- a/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h +++ b/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -228,21 +228,21 @@ struct Rectangular_p_center_matrix_search_traits_2 { bool operator()(FT v) { - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); ld.r = v / FT(2); bool ok; pf(ld, Wastebasket< Point_2 >(), ok); - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); return ok; } template < class OutputIterator > OutputIterator operator()(FT v, OutputIterator o, bool& ok) { - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); ld.r = v / FT(2); OutputIterator n = pf(ld, o, ok); - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); return n; //pf(ld, o, ok); } @@ -250,7 +250,7 @@ protected: // data members: LD ld; PiercingFunction pf; - CGAL_optimisation_assertion_code(typename LD::size_type ld_size;) + CGAL_assertion_code(typename LD::size_type ld_size;) // copying this would be too inefficient Rectangular_p_center_matrix_search_traits_2( diff --git a/Bounding_volumes/include/CGAL/min_quadrilateral_2.h b/Bounding_volumes/include/CGAL/min_quadrilateral_2.h index dfa0eb1e30c..081520c0846 100644 --- a/Bounding_volumes/include/CGAL/min_quadrilateral_2.h +++ b/Bounding_volumes/include/CGAL/min_quadrilateral_2.h @@ -18,7 +18,7 @@ #include -#include +#include #include #include @@ -346,8 +346,8 @@ min_rectangle_2( { typedef Optimisation::Min_quadrilateral_traits_wrapper Traits; Traits t(bt); - CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t)); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition(is_convex_2(f, l, t)); + CGAL_expensive_precondition( orientation_2(f, l, t) == COUNTERCLOCKWISE); // check for trivial cases @@ -395,7 +395,7 @@ min_rectangle_2( int yet_to_finish = 0; for (int i1 = 0; i1 < 4; ++i1) { - CGAL_optimisation_assertion(limit[i1] != l); + CGAL_assertion(limit[i1] != l); if (curr[i1] != limit[i1]) ++yet_to_finish; } @@ -448,7 +448,7 @@ min_parallelogram_2(ForwardIterator f, { typedef Optimisation::Min_quadrilateral_traits_wrapper Traits; Traits t(bt); - CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t)); + CGAL_expensive_precondition(is_convex_2(f, l, t)); // types from the traits class typedef typename Traits::Direction_2 Direction_2; @@ -630,7 +630,7 @@ min_strip_2(ForwardIterator f, { typedef Optimisation::Min_quadrilateral_traits_wrapper Traits; Traits t(bt); - CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t)); + CGAL_expensive_precondition(is_convex_2(f, l, t)); // types from the traits class typedef typename Traits::Direction_2 Direction_2; diff --git a/Bounding_volumes/include/CGAL/pierce_rectangles_2.h b/Bounding_volumes/include/CGAL/pierce_rectangles_2.h index ebaf8081e1c..8a7f3560a38 100644 --- a/Bounding_volumes/include/CGAL/pierce_rectangles_2.h +++ b/Bounding_volumes/include/CGAL/pierce_rectangles_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -75,7 +75,7 @@ struct Loc_domain { void update(int j, Citerator i) { - CGAL_optimisation_precondition(j >= 0 && j < 4); + CGAL_precondition(j >= 0 && j < 4); if (j < 2) if (j == 0) { if (traits.less_x_2_object()(*i, minx)) minx = *i; @@ -106,9 +106,9 @@ struct Loc_domain { maxy(pts.front()), traits(t) { - CGAL_optimisation_precondition(b != e); + CGAL_precondition(b != e); Iterator i = pts.begin(); - CGAL_optimisation_assertion(i != pts.end()); + CGAL_assertion(i != pts.end()); while (++i != pts.end()) { if (traits.less_x_2_object()(*i, minx)) minx = *i; if (traits.less_x_2_object()(maxx, *i)) maxx = *i; @@ -124,7 +124,7 @@ struct Loc_domain { operator[](int i) const // return corner points (0 <-> bottom-left, 1 <-> bottom-right) { - CGAL_optimisation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if (i == 0) return traits.construct_point_2_above_right_implicit_point_2_object()( minx, miny, r); @@ -142,7 +142,7 @@ struct Loc_domain { extreme(int i) const // return extreme points (0 <-> left, 1 <-> bottom) { - CGAL_optimisation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if (i > 1) return i == 2 ? maxx : maxy; return i == 0 ? minx : miny; } @@ -151,7 +151,7 @@ struct Loc_domain { extreme(int i) // return extreme points (0 <-> left, 1 <-> bottom) { - CGAL_optimisation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if (i > 1) return i == 2 ? maxx : maxy; return i == 0 ? minx : miny; } @@ -177,13 +177,13 @@ struct Loc_domain { void check() const { - CGAL_optimisation_expensive_assertion_code( + CGAL_expensive_assertion_code( Iterator i = pts.begin(); do { - CGAL_optimisation_assertion(!traits.less_x_2_object()(*i, minx)); - CGAL_optimisation_assertion(!traits.less_x_2_object()(maxx, *i)); - CGAL_optimisation_assertion(!traits.less_y_2_object()(*i, miny)); - CGAL_optimisation_assertion(!traits.less_y_2_object()(maxy, *i)); + CGAL_assertion(!traits.less_x_2_object()(*i, minx)); + CGAL_assertion(!traits.less_x_2_object()(maxx, *i)); + CGAL_assertion(!traits.less_y_2_object()(*i, miny)); + CGAL_assertion(!traits.less_y_2_object()(maxy, *i)); } while (++i != end); ) } @@ -463,7 +463,7 @@ inline OutputIterator two_cover_points( InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); // compute location domain: Loc_domain< Traits > d(f, l, t); @@ -475,7 +475,7 @@ inline OutputIterator three_cover_points( InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); // compute location domain: Loc_domain< Traits > d(f, l, t); @@ -487,7 +487,7 @@ inline OutputIterator four_cover_points( InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); // compute location domain: Loc_domain< Traits > d(f, l, t); @@ -562,7 +562,7 @@ three_cover_points( using std::less; using std::iter_swap; - CGAL_optimisation_precondition(!d.empty()); + CGAL_precondition(!d.empty()); // typedefs: typedef typename Traits::Point_2 Point_2; @@ -583,7 +583,7 @@ three_cover_points( // are all points already covered? if (i == d.end()) { - CGAL_optimisation_assertion(k == 0); + CGAL_assertion(k == 0); *o++ = d[0]; ok = true; return o; @@ -620,11 +620,11 @@ three_cover_points( // check disjoint for two-pierceability: - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( save_end == find_if(d.end(), save_end, [&d, &dist, &corner](const Point_2& p) { return d.r < dist(corner, p); })); - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( d.end() == find_if(d.begin(), d.end(), [&d,&dist, &corner](const Point_2& p) { return d.r >= dist(corner, p); })); @@ -721,7 +721,7 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok) // are all points already covered? if (i == d.end()) { - CGAL_optimisation_assertion(k == 0); + CGAL_assertion(k == 0); *o++ = d[0]; ok = true; return o; @@ -758,11 +758,11 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok) // check disjoint for two-pierceability: - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( save_end == find_if(d.end(), save_end, [&d,&dist,&corner](const Point_2& p) { return d.r < dist(corner, p); })); - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( d.end() == find_if(d.begin(), d.end(), [&d,&dist,&corner](const Point_2& p) { return d.r >= dist(corner, p); })); diff --git a/Bounding_volumes/include/CGAL/rectangular_3_center_2.h b/Bounding_volumes/include/CGAL/rectangular_3_center_2.h index cd3a1f14bee..a75118764b7 100644 --- a/Bounding_volumes/include/CGAL/rectangular_3_center_2.h +++ b/Bounding_volumes/include/CGAL/rectangular_3_center_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include #include @@ -965,7 +965,7 @@ rectangular_3_center_2_type2( (Q_r_empty || op.compute_y_distance(q_r, Q_r) <= op.delta()(*m))) { boost::function1 greater_delta_m = boost::bind(less< FT >(), op.delta()(*m)); - CGAL_optimisation_assertion_code(RandomAccessIterator iii =) + CGAL_assertion_code(RandomAccessIterator iii =) find_if(e, l, boost::bind(logical_and< bool >(), @@ -973,7 +973,7 @@ rectangular_3_center_2_type2( boost::bind(op.distance(), q_t, _1)), boost::bind(greater_delta_m, boost::bind(op.distance(), q_r, _1)))); - CGAL_optimisation_assertion(iii == l); + CGAL_assertion(iii == l); } // check whether the points in [f,s) are covered { @@ -985,7 +985,7 @@ rectangular_3_center_2_type2( boost::bind(le_delta_m, boost::bind(op.distance(), q_t, _1))); iii = partition(iii, s, boost::bind(le_delta_m, boost::bind(op.distance(), q_r, _1))); - CGAL_optimisation_assertion(iii == s); + CGAL_assertion(iii == s); } #endif // CGAL_3COVER_CHECK @@ -1052,7 +1052,7 @@ rectangular_3_center_2_type2( } // step (e) [not enough points in G] - CGAL_optimisation_assertion(b1 - (m + 1) >= 5 * cutoff); + CGAL_assertion(b1 - (m + 1) >= 5 * cutoff); // compute the four cutting lines for R std::nth_element(m + 1, m + 1 + cutoff, b1, less_x_2); @@ -1113,7 +1113,7 @@ rectangular_3_center_2_type2( // now s_b corresponds to the first moment in [s, m+1) // where q_t and q_r cover B - CGAL_optimisation_assertion_code(bool loopcheck = false;) + CGAL_assertion_code(bool loopcheck = false;) CGAL_3CENTER_REPEAT_CHECK: // place q_t and q_r q_t = op.place_x_square(q_t_afap, r, op.delta()(*s_b)); @@ -1142,9 +1142,9 @@ CGAL_3CENTER_REPEAT_CHECK: // in degenerate situations it can happen that the number of // points in R is too small => decrease radius and check again --s_b; - CGAL_optimisation_assertion(!loopcheck); - CGAL_optimisation_assertion(s != s_b); - CGAL_optimisation_assertion_code(loopcheck = true;) + CGAL_assertion(!loopcheck); + CGAL_assertion(s != s_b); + CGAL_assertion_code(loopcheck = true;) goto CGAL_3CENTER_REPEAT_CHECK; } s = b1; @@ -1166,7 +1166,7 @@ CGAL_3CENTER_REPEAT_CHECK: // we still have a covering if (s_b == s) { - CGAL_optimisation_expensive_assertion_code( + CGAL_expensive_assertion_code( std::vector< Point > tmppts(f, l); RandomAccessIterator ii = partition(tmppts.begin(), tmppts.end(), @@ -1174,9 +1174,9 @@ CGAL_3CENTER_REPEAT_CHECK: IP tmppos = min_max_element(ii, tmppts.end(), op.compare_x(), op.compare_y()); ) - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( !op.compare_x()(*tmppos.first, q_t)); - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( !op.compare_y()(q_r, *tmppos.second)); // we are done @@ -1219,7 +1219,7 @@ CGAL_3CENTER_REPEAT_CHECK: [&op, s_b](const Point& p){ return op.delta()(*s_b) != op.delta()(p); }); rho_max = op.delta()(*s_b); q_t_at_rho_max = q_t, q_r_at_rho_max = q_r; - CGAL_optimisation_assertion(op.delta()(*next) < op.delta()(*s_b)); + CGAL_assertion(op.delta()(*next) < op.delta()(*s_b)); q_t_afap = op.update_x_square(q_t_afap, *s_b); q_r_afap = op.update_y_square(q_r_afap, *s_b); q_t = op.place_x_square(q_t_afap, r, op.delta()(*next)); @@ -1255,7 +1255,7 @@ CGAL_3CENTER_REPEAT_CHECK: } - CGAL_optimisation_assertion(b3 - b1 >= cutoff); + CGAL_assertion(b3 - b1 >= cutoff); e = b1; // adjust Q_t if (b1 != b2) { @@ -1299,7 +1299,7 @@ CGAL_3CENTER_REPEAT_CHECK: rho_max = max BOOST_PREVENT_MACRO_SUBSTITUTION (op.compute_x_distance(q_t, Q_t), op.compute_y_distance(q_r, Q_r)); #ifndef CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST - CGAL_optimisation_assertion(rho_max <= rad); + CGAL_assertion(rho_max <= rad); #endif // ! CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST rad = rho_max; *o++ = op.construct_corner_square(r, rad / FT(2)); @@ -1307,7 +1307,7 @@ CGAL_3CENTER_REPEAT_CHECK: *o++ = op.construct_y_square(q_r, rad / FT(2)); return o; } - CGAL_optimisation_assertion(s != e); + CGAL_assertion(s != e); // find the first diameter where covering is possible for (;;) { @@ -1324,7 +1324,7 @@ CGAL_3CENTER_REPEAT_CHECK: // try the next possible diameter value FT try_rho = op.delta()(*t); - CGAL_optimisation_assertion(t == s || try_rho < rho_max); + CGAL_assertion(t == s || try_rho < rho_max); q_t = op.place_x_square(q_t_afap, r, try_rho); q_r = op.place_y_square(q_r_afap, r, try_rho); @@ -1370,8 +1370,8 @@ CGAL_3CENTER_REPEAT_CHECK: // - q_r_at_rho_max is the corr. position of q_r. // try rho_min - CGAL_optimisation_assertion(rho_min <= rho_max); - CGAL_optimisation_assertion(rho_min >= 0); + CGAL_assertion(rho_min <= rho_max); + CGAL_assertion(rho_min >= 0); FT rad_2 = q_t_q_r_cover_at_rho_min; if (s_at_rho_min != e_at_rho_min) { auto mydist = [&q_t_at_rho_min, &q_r_at_rho_min, &op](const Point& p) @@ -1384,7 +1384,7 @@ CGAL_3CENTER_REPEAT_CHECK: [&mydist](const Point& p1, const Point& p2) { return mydist(p1) < mydist(p2); }))); } - CGAL_optimisation_assertion(rad_2 == 0 || rad_2 > rho_min); + CGAL_assertion(rad_2 == 0 || rad_2 > rho_min); // if a covering with rho == 0 is possible, // it will be catched in the type1 functions @@ -1397,7 +1397,7 @@ CGAL_3CENTER_REPEAT_CHECK: q_t = q_t_at_rho_min, q_r = q_r_at_rho_min; #ifndef CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST - CGAL_optimisation_assertion(rad_2 <= rad); + CGAL_assertion(rad_2 <= rad); #endif // ! CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST rad = rad_2; *o++ = op.construct_corner_square(r, rad / FT(2)); @@ -1414,7 +1414,7 @@ rectangular_3_center_2( typename Traits::FT& r, Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); typedef typename Traits::FT FT; typedef typename Traits::Point_2 Point; typedef typename Traits::Iso_rectangle_2 Rectangle; diff --git a/Bounding_volumes/include/CGAL/rectangular_p_center_2.h b/Bounding_volumes/include/CGAL/rectangular_p_center_2.h index 1d680e9572f..78ec4b6e9cb 100644 --- a/Bounding_volumes/include/CGAL/rectangular_p_center_2.h +++ b/Bounding_volumes/include/CGAL/rectangular_p_center_2.h @@ -72,8 +72,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition( r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition( c >= 0 && c < number_of_columns()); + CGAL_precondition( r >= 0 && r < number_of_rows()); + CGAL_precondition( c >= 0 && c < number_of_columns()); return Base::operator()( r, number_of_columns() - 1 - c); } }; @@ -145,7 +145,7 @@ rectangular_p_center_2_binary_search( // -------------- // { - CGAL_optimisation_precondition( f != l); + CGAL_precondition( f != l); // typedefs: typedef typename Traits::FT FT; @@ -171,7 +171,7 @@ rectangular_p_center_2_binary_search( c_diffs.push_back( CGAL_NTS abs( i->x() - j->x())); c_diffs.push_back( CGAL_NTS abs( i->y() - j->y())); } - CGAL_optimisation_assertion( + CGAL_assertion( c_diffs.size() == pierce_it.number_of_points() * (pierce_it.number_of_points() - 1)); @@ -195,12 +195,12 @@ rectangular_p_center_2_binary_search( b = c + 1; } } // while ( e > b) - CGAL_optimisation_assertion( e == b); + CGAL_assertion( e == b); // return the result: r = c_diffs[e]; OutputIterator o_return( pierce_it( r, o, ok)); - CGAL_optimisation_assertion( ok); + CGAL_assertion( ok); return o_return; } // rectangular_p_center_2_binary_search( ... ) @@ -221,7 +221,7 @@ rectangular_p_center_2_matrix_search( const MatrixOperator& mop) { std::size_t number_of_points( iterator_distance( f, l)); - CGAL_optimisation_precondition( number_of_points > 0); + CGAL_precondition( number_of_points > 0); using std::minus; using std::sort; @@ -296,7 +296,7 @@ rectangular_p_center_2_matrix_search( // return result: OutputIterator o_return(pierce_it(r, o, ok)); - CGAL_optimisation_assertion(ok); + CGAL_assertion(ok); return o_return; } // P_center_matrix_search @@ -341,7 +341,7 @@ rectangular_p_center_matrix_search_2( FT& r, int p) { - CGAL_optimisation_precondition(p >= 2 && p < 5); + CGAL_precondition(p >= 2 && p < 5); typename std::iterator_traits::value_type::R t; if (p == 2) return rectangular_p_center_2_matrix_search( @@ -401,7 +401,7 @@ rectangular_p_center_2(ForwardIterator f, int p, Traits& t) { - CGAL_optimisation_precondition(p >= 2 && p < 5); + CGAL_precondition(p >= 2 && p < 5); r=0; if ( !internal::is_distance_greater_than_p(f,l,p) ) return std::copy(f,l,o); @@ -422,7 +422,7 @@ rectangular_p_center_2(ForwardIterator f, FT& r, int p) { - CGAL_optimisation_precondition(p >= 2 && p < 5); + CGAL_precondition(p >= 2 && p < 5); typedef typename std::iterator_traits< ForwardIterator >::value_type::R R; Rectangular_p_center_default_traits_2< R > t; diff --git a/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h b/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h index a85e9a76f47..9c4cb0a113f 100644 --- a/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h +++ b/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -83,7 +83,7 @@ struct Extremal_polygon_area_traits_2 { int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > min_k()); + CGAL_precondition( number_of_points > min_k()); // this gives the area of the triangle of two points with // the root: @@ -136,7 +136,7 @@ protected: }; } //namespace CGAL -#include + #include #ifdef CGAL_USE_LEDA #include @@ -221,11 +221,11 @@ struct Extremal_polygon_perimeter_traits_2 { using std::less; using std::max_element; - CGAL_optimisation_precondition_code( + CGAL_precondition_code( int number_of_points( static_cast(iterator_distance( points_begin, points_end)));) - CGAL_optimisation_precondition( number_of_points > min_k()); + CGAL_precondition( number_of_points > min_k()); // kind of messy, but first we have to have something // like Distance (function object) ... diff --git a/Inscribed_areas/include/CGAL/extremal_polygon_2.h b/Inscribed_areas/include/CGAL/extremal_polygon_2.h index 2cd09fdd7c0..e1543637f53 100644 --- a/Inscribed_areas/include/CGAL/extremal_polygon_2.h +++ b/Inscribed_areas/include/CGAL/extremal_polygon_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -76,7 +76,7 @@ public: RandomAccessIC_object begin_col, RandomAccessIC_object end_col, RandomAccessIC_value begin_value, - RandomAccessIC_value CGAL_optimisation_precondition_code(end_value), + RandomAccessIC_value CGAL_precondition_code(end_value), const Operation& o) // initialization with two ranges [begin_row, end_row) and // [begin_col, end_col) of Objects, a range [begin_value, end_value) @@ -92,9 +92,9 @@ public: n_rows( static_cast(iterator_distance( begin_row, end_row))), n_cols( static_cast(iterator_distance( begin_col, end_col))) { - CGAL_optimisation_precondition( + CGAL_precondition( iterator_distance( begin_value, end_value) == n_cols); - CGAL_optimisation_assertion( n_rows > 0 && n_cols > 0); + CGAL_assertion( n_rows > 0 && n_cols > 0); } int @@ -108,8 +108,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition( r >= 0 && r < n_rows); - CGAL_optimisation_precondition( c >= 0 && c < n_cols); + CGAL_precondition( r >= 0 && r < n_rows); + CGAL_precondition( c >= 0 && c < n_cols); return begin_value_[c] + op( begin_row_[r], begin_col_[c]); } @@ -181,11 +181,11 @@ CGAL_maximum_inscribed_rooted_k_gon_2( // returns the past-the-end iterator of that sequence. { // check preconditions: - CGAL_optimisation_precondition( k >= t.min_k()); + CGAL_precondition( k >= t.min_k()); int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > k); + CGAL_precondition( number_of_points > k); typedef std::vector< int > Index_cont; @@ -203,7 +203,7 @@ CGAL_maximum_inscribed_rooted_k_gon_2( points_begin, points_end, max_area, gon.rbegin() + k + 1 - i); for (;;) { - CGAL_optimisation_assertion( gon[0] == 0); + CGAL_assertion( gon[0] == 0); gon[i] = number_of_points - 1; if ( ++i >= k) break; @@ -243,7 +243,7 @@ CGAL_maximum_inscribed_rooted_k_gon_2( RandomAccessIC_point points_end, int root, RandomAccessIC_int left_c_begin, - RandomAccessIC_int CGAL_optimisation_precondition_code(left_c_end), + RandomAccessIC_int CGAL_precondition_code(left_c_end), RandomAccessIC_int right_c_begin, RandomAccessIC_int right_c_end, typename Traits::FT& max_area, @@ -294,26 +294,26 @@ CGAL_maximum_inscribed_rooted_k_gon_2( right_c_end)); // check preconditions: - CGAL_optimisation_precondition( number_of_points > t.min_k()); - CGAL_optimisation_precondition( size_of_gon >= t.min_k() - 1); - CGAL_optimisation_precondition( + CGAL_precondition( number_of_points > t.min_k()); + CGAL_precondition( size_of_gon >= t.min_k() - 1); + CGAL_precondition( iterator_distance( left_c_begin, left_c_end) == iterator_distance( right_c_begin, right_c_end)); - CGAL_optimisation_precondition( left_c_begin[0] >= 0); - CGAL_optimisation_precondition( right_c_begin[0] >= 0); - CGAL_optimisation_precondition( + CGAL_precondition( left_c_begin[0] >= 0); + CGAL_precondition( right_c_begin[0] >= 0); + CGAL_precondition( left_c_begin[size_of_gon-1] < number_of_points); - CGAL_optimisation_precondition( + CGAL_precondition( right_c_begin[size_of_gon-1] < number_of_points); - CGAL_optimisation_expensive_precondition_code( + CGAL_expensive_precondition_code( for ( i = 0; i < size_of_gon; ++i) { - CGAL_optimisation_expensive_precondition( left_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( right_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] >= 0); + CGAL_expensive_precondition( right_c_begin[i] >= 0); + CGAL_expensive_precondition( left_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( right_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] <= right_c_begin[i]); }) @@ -426,12 +426,12 @@ extremal_polygon_2( // returns the past-the-end iterator of that sequence. { // check preconditions: - CGAL_optimisation_precondition_code( + CGAL_precondition_code( int number_of_points( static_cast(iterator_distance( points_begin, points_end)));) - CGAL_optimisation_precondition( number_of_points >= t.min_k()); - CGAL_optimisation_expensive_precondition( + CGAL_precondition( number_of_points >= t.min_k()); + CGAL_expensive_precondition( is_convex_2( points_begin, points_end, t)); typedef typename Traits::Point_2 Point_2; @@ -491,11 +491,11 @@ CGAL_maximum_inscribed_k_gon_2( // returns the past-the-end iterator of that sequence. { // check preconditions: - CGAL_optimisation_precondition( k >= t.min_k()); + CGAL_precondition( k >= t.min_k()); int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > 0); + CGAL_precondition( number_of_points > 0); using std::copy; @@ -518,7 +518,7 @@ CGAL_maximum_inscribed_k_gon_2( P_0.rbegin() + 1, t); P_0[k] = number_of_points - 1; - CGAL_optimisation_assertion( P_0[0] == 0); + CGAL_assertion( P_0[0] == 0); // compute k-gon rooted at points_begin[P_0[1]] Index_cont P_1( k); FT area_1; @@ -535,7 +535,7 @@ CGAL_maximum_inscribed_k_gon_2( P_1.rbegin(), t); - CGAL_optimisation_assertion( P_1[0] == P_0[1]); + CGAL_assertion( P_1[0] == P_0[1]); // start recursive computation: @@ -630,29 +630,29 @@ CGAL_maximum_inscribed_k_gon_2( using std::copy; // check preconditions: - CGAL_optimisation_precondition( k >= t.min_k()); - CGAL_optimisation_precondition( left_index <= right_index); - CGAL_optimisation_precondition( left_index >= 0); - CGAL_optimisation_precondition( right_index >= 0); - CGAL_optimisation_precondition_code( + CGAL_precondition( k >= t.min_k()); + CGAL_precondition( left_index <= right_index); + CGAL_precondition( left_index >= 0); + CGAL_precondition( right_index >= 0); + CGAL_precondition_code( int number_of_points( static_cast(iterator_distance( points_begin, points_end)));) - CGAL_optimisation_precondition( left_index < number_of_points); - CGAL_optimisation_precondition( right_index < number_of_points); - CGAL_optimisation_precondition( + CGAL_precondition( left_index < number_of_points); + CGAL_precondition( right_index < number_of_points); + CGAL_precondition( iterator_distance( left_c_begin, left_c_end) == k - 1); - CGAL_optimisation_precondition( + CGAL_precondition( iterator_distance( right_c_begin, right_c_end) == k - 1); - CGAL_optimisation_expensive_precondition_code( + CGAL_expensive_precondition_code( for ( int i( 0); i < k - 1; ++i) { - CGAL_optimisation_expensive_precondition( left_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( right_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] >= 0); + CGAL_expensive_precondition( right_c_begin[i] >= 0); + CGAL_expensive_precondition( left_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( right_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] <= right_c_begin[i]); }) @@ -671,7 +671,7 @@ CGAL_maximum_inscribed_k_gon_2( area_middle, P_m.rbegin(), t); - CGAL_optimisation_assertion( P_m[0] == middle_index); + CGAL_assertion( P_m[0] == middle_index); // left recursive branch: FT area_left( 0); Index_cont P_l( k); diff --git a/Matrix_search/include/CGAL/Cartesian_matrix.h b/Matrix_search/include/CGAL/Cartesian_matrix.h index d3ad276a715..1aa192ab2c8 100644 --- a/Matrix_search/include/CGAL/Cartesian_matrix.h +++ b/Matrix_search/include/CGAL/Cartesian_matrix.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { @@ -67,8 +67,8 @@ public: Value operator()(int r, int c) const { - CGAL_optimisation_precondition(r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition(c >= 0 && c < number_of_columns()); + CGAL_precondition(r >= 0 && r < number_of_rows()); + CGAL_precondition(c >= 0 && c < number_of_columns()); return op(row_vec[r], column_vec[c]); } diff --git a/Matrix_search/include/CGAL/Dynamic_matrix.h b/Matrix_search/include/CGAL/Dynamic_matrix.h index 83b9063cf3e..2ae86317ebb 100644 --- a/Matrix_search/include/CGAL/Dynamic_matrix.h +++ b/Matrix_search/include/CGAL/Dynamic_matrix.h @@ -18,7 +18,7 @@ #include #include -#include +#include namespace CGAL { @@ -56,8 +56,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition( r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition( c >= 0 && c < number_of_columns()); + CGAL_precondition( r >= 0 && r < number_of_rows()); + CGAL_precondition( c >= 0 && c < number_of_columns()); return (*matrix)( r << row_power, column_indices[c]); } @@ -70,18 +70,18 @@ public: void replace_column( int o, int n) { - CGAL_optimisation_precondition( o >= 0 && o < number_of_columns()); - CGAL_optimisation_precondition( n >= 0 && n < number_of_columns()); + CGAL_precondition( o >= 0 && o < number_of_columns()); + CGAL_precondition( n >= 0 && n < number_of_columns()); column_indices[o] = column_indices[n]; } void shrink_to_quadratic_size() { - CGAL_optimisation_precondition( number_of_columns() >= number_of_rows()); + CGAL_precondition( number_of_columns() >= number_of_rows()); column_indices.erase( column_indices.begin() + number_of_rows(), column_indices.end()); - CGAL_optimisation_postcondition( number_of_columns() == number_of_rows()); + CGAL_postcondition( number_of_columns() == number_of_rows()); } private: diff --git a/Matrix_search/include/CGAL/Transform_iterator.h b/Matrix_search/include/CGAL/Transform_iterator.h index c3ab6e8c437..18d4f9986ab 100644 --- a/Matrix_search/include/CGAL/Transform_iterator.h +++ b/Matrix_search/include/CGAL/Transform_iterator.h @@ -16,7 +16,6 @@ #include -#include #include #include diff --git a/Matrix_search/include/CGAL/monotone_matrix_search.h b/Matrix_search/include/CGAL/monotone_matrix_search.h index 4f527634e70..ae1bd6f4ce9 100644 --- a/Matrix_search/include/CGAL/monotone_matrix_search.h +++ b/Matrix_search/include/CGAL/monotone_matrix_search.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -57,9 +57,9 @@ monotone_matrix_search( // ------ // get even rows of M: Matrix* M_new = M.extract_all_even_rows(); - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_columns() == M.number_of_columns()); - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_rows() == 0 || M_new->number_of_rows() == ( M.number_of_rows() + 1) >> 1); @@ -75,7 +75,7 @@ monotone_matrix_search( reduction_table[M_new->number_of_rows()] = M.number_of_columns() - 1; _reduce_matrix( *M_new, reduction_table, compare_strictly); - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_columns() == M_new->number_of_rows()); } // if ( M_new->number_of_rows() < M_new->number_of_columns()) @@ -92,7 +92,7 @@ monotone_matrix_search( // recursion: - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_rows() >= M_new->number_of_columns()); // table to store the rmax values of M_new: @@ -160,7 +160,7 @@ _reduce_matrix( // and returns for each column of the resulting // matrix its column index in the original matrix { - CGAL_optimisation_precondition( + CGAL_precondition( M.number_of_columns() >= M.number_of_rows()); // active columns are 0, ..., j1, j2, ..., M.x_dim()-1 int j1( 0), j2( 1); @@ -191,7 +191,7 @@ _reduce_matrix( // have been deleted, now move columns // j2 .. M.number_of_columns()-1 to the first part while ( j1 < M.number_of_rows() - 1) { - CGAL_optimisation_assertion( j2 < M.number_of_columns()); + CGAL_assertion( j2 < M.number_of_columns()); M.replace_column( ++j1, j2); *(t+j1) = j2++; } diff --git a/Matrix_search/include/CGAL/sorted_matrix_search.h b/Matrix_search/include/CGAL/sorted_matrix_search.h index dd21234b4f5..d481ce8c07a 100644 --- a/Matrix_search/include/CGAL/sorted_matrix_search.h +++ b/Matrix_search/include/CGAL/sorted_matrix_search.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include #include @@ -159,13 +159,13 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) Cell_container active_cells; // set of input matrices must not be empty: - CGAL_optimisation_precondition( f != l); + CGAL_precondition( f != l); // for each input matrix insert a cell into active_cells: InputIterator i( f); int maxdim( -1); while ( i != l) { - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( PaddedMatrix( *i).is_sorted()); active_cells.push_back( Cell( PaddedMatrix( *i))); maxdim = max BOOST_PREVENT_MACRO_SUBSTITUTION ( max BOOST_PREVENT_MACRO_SUBSTITUTION ( (*i).number_of_columns(), @@ -173,7 +173,7 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) maxdim); ++i; } - CGAL_optimisation_precondition( maxdim > 0); + CGAL_precondition( maxdim > 0); // current cell dimension: @@ -239,7 +239,7 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) break; // there has to be at least one cell left: - CGAL_optimisation_assertion( active_cells.size() > 0); + CGAL_assertion( active_cells.size() > 0); // ------------------------------------------------------ // compute medians of smallest and largest elements: @@ -285,7 +285,7 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) { return equal_to< Value >()(lower_median, Cell_min< Cell >()(c)); }); - CGAL_optimisation_assertion(lower_median_cell != active_cells.end()); + CGAL_assertion(lower_median_cell != active_cells.end()); // ------------------------------------------------------ // test feasibility of medians and remove cells accordingly: Cell_iterator new_end; @@ -385,8 +385,8 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) } // for (;;) // there must be only one cell left: - CGAL_optimisation_assertion( active_cells.size() == 1); - CGAL_optimisation_assertion( ccd == 1); + CGAL_assertion( active_cells.size() == 1); + CGAL_assertion( ccd == 1); return ((*active_cells.begin()).min)(); } diff --git a/Optimisation_basic/include/CGAL/Optimisation/assertions.h b/Optimisation_basic/include/CGAL/Optimisation/assertions.h deleted file mode 100644 index 7186d883d15..00000000000 --- a/Optimisation_basic/include/CGAL/Optimisation/assertions.h +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) 1997-2001 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr - -#ifndef CGAL_OPTIMISATION_ASSERTIONS_H -#define CGAL_OPTIMISATION_ASSERTIONS_H - -#include - -// macro definitions -// ================= - -// assertions -// ---------- -#if ( defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_assertion(EX) ((void)0) -# define CGAL_optimisation_assertion_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_assertion_code(CODE) -# undef CGAL_OPTIMISATION_ASSERTION_TAG -#else -# define CGAL_optimisation_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_ASSERTION_TAG 1 -#endif // optimisation assertions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_assertion(EX) ((void)0) -# define CGAL_optimisation_exactness_assertion_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_assertion_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_ASSERTION_TAG -#else -# define CGAL_optimisation_exactness_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_ASSERTION_TAG 1 -#endif // optimisation exactness assertions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_assertion(EX) ((void)0) -# define CGAL_optimisation_expensive_assertion_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_assertion_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_ASSERTION_TAG -#else -# define CGAL_optimisation_expensive_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_ASSERTION_TAG 1 -#endif // optimisation expensive assertions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_assertion(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_assertion_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_assertion_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_ASSERTION_TAG -#else -# define CGAL_optimisation_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_ASSERTION_TAG 1 -#endif // optimisation expensive exactness assertions - - - -// preconditions -// ------------- -#if ( defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_precondition(EX) ((void)0) -# define CGAL_optimisation_precondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_precondition_code(CODE) -# undef CGAL_OPTIMISATION_PRECONDITION_TAG -#else -# define CGAL_optimisation_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_PRECONDITION_TAG 1 -#endif // optimisation preconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_precondition(EX) ((void)0) -# define CGAL_optimisation_exactness_precondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_precondition_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_PRECONDITION_TAG -#else -# define CGAL_optimisation_exactness_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_PRECONDITION_TAG 1 -#endif // optimisation exactness preconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_precondition(EX) ((void)0) -# define CGAL_optimisation_expensive_precondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_precondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG -#else -# define CGAL_optimisation_expensive_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG 1 -#endif // optimisation expensive preconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_precondition(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_precondition_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_precondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_PRECONDITION_TAG -#else -# define CGAL_optimisation_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_PRECONDITION_TAG 1 -#endif // optimisation expensive exactness preconditions - - - -// postconditions -// -------------- -#if ( defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_postcondition(EX) ((void)0) -# define CGAL_optimisation_postcondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_POSTCONDITION_TAG -#else -# define CGAL_optimisation_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_POSTCONDITION_TAG 1 -#endif // optimisation postconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_postcondition(EX) ((void)0) -# define CGAL_optimisation_exactness_postcondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_POSTCONDITION_TAG -#else -# define CGAL_optimisation_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_POSTCONDITION_TAG 1 -#endif // optimisation exactness postconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_postcondition(EX) ((void)0) -# define CGAL_optimisation_expensive_postcondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_POSTCONDITION_TAG -#else -# define CGAL_optimisation_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_POSTCONDITION_TAG 1 -#endif // optimisation expensive postconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_postcondition(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_postcondition_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_POSTCONDITION_TAG -#else -# define CGAL_optimisation_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_POSTCONDITION_TAG 1 -#endif // optimisation expensive exactness postconditions - - - -// warnings -// -------- -#if ( defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_warning(EX) ((void)0) -# define CGAL_optimisation_warning_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_warning_code(CODE) -# undef CGAL_OPTIMISATION_WARNING_TAG -#else -# define CGAL_optimisation_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_WARNING_TAG 1 -#endif // optimisation warnings - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_warning(EX) ((void)0) -# define CGAL_optimisation_exactness_warning_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_warning_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_WARNING_TAG -#else -# define CGAL_optimisation_exactness_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_WARNING_TAG 1 -#endif // optimisation exactness warnings - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_warning(EX) ((void)0) -# define CGAL_optimisation_expensive_warning_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_warning_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_WARNING_TAG -#else -# define CGAL_optimisation_expensive_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_WARNING_TAG 1 -#endif // optimisation expensive warnings - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_warning(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_warning_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_warning_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_WARNING_TAG -#else -# define CGAL_optimisation_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_WARNING_TAG 1 -#endif // optimisation expensive exactness warnings - - - -#endif // CGAL_OPTIMISATION_ASSERTIONS_H - -// ===== EOF ================================================================== diff --git a/Optimisation_basic/include/CGAL/Optimisation/basic.h b/Optimisation_basic/include/CGAL/Optimisation/basic.h index 6e8dd5f511c..900b0cac964 100644 --- a/Optimisation_basic/include/CGAL/Optimisation/basic.h +++ b/Optimisation_basic/include/CGAL/Optimisation/basic.h @@ -19,7 +19,6 @@ // includes #include -#include #include #include diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d.h index ede3b47aa92..e58d94539f9 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d.h @@ -473,7 +473,7 @@ public: // NOTE: an implicit conversion from ET to RT must be available! Point realizing_point_p( ) const - { CGAL_optimisation_precondition( is_finite()); + { CGAL_precondition( is_finite()); return tco.construct_point_d_object() ( ambient_dimension(), realizing_point_p_coordinates_begin(), @@ -481,7 +481,7 @@ public: Point realizing_point_q( ) const - { CGAL_optimisation_precondition( is_finite()); + { CGAL_precondition( is_finite()); return tco.construct_point_d_object() ( ambient_dimension(), realizing_point_q_coordinates_begin(), @@ -512,7 +512,7 @@ public: std::copy( p_first, p_last, std::back_inserter( p_points)); std::copy( q_first, q_last, std::back_inserter( q_points)); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin(), p_points.end()) && check_dimension( q_points.begin(), q_points.end()), "Not all points have the same dimension."); @@ -527,7 +527,7 @@ public: p_points.clear(); std::copy( p_first, p_last, std::back_inserter( p_points)); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin(), p_points.end()), "Not all points have the same dimension."); @@ -541,7 +541,7 @@ public: q_points.clear(); std::copy( q_first, q_last, std::back_inserter( q_points)); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( q_points.begin(), q_points.end()), "Not all points have the same dimension."); @@ -551,7 +551,7 @@ public: void insert_p( const Point& p) { - CGAL_optimisation_precondition + CGAL_precondition ( ( ! is_finite()) || ( tco.access_dimension_d_object()( p) == d)); p_points.push_back( p); @@ -562,7 +562,7 @@ public: void insert_q( const Point& q) { - CGAL_optimisation_precondition + CGAL_precondition ( ( ! is_finite()) || ( tco.access_dimension_d_object()( q) == d)); q_points.push_back( q); @@ -575,12 +575,12 @@ public: insert( InputIterator1 p_first, InputIterator1 p_last, InputIterator2 q_first, InputIterator2 q_last) { - CGAL_optimisation_precondition_code(int old_r = static_cast(p_points.size())); - CGAL_optimisation_precondition_code(int old_s = static_cast(q_points.size())); + CGAL_precondition_code(int old_r = static_cast(p_points.size())); + CGAL_precondition_code(int old_s = static_cast(q_points.size())); p_points.insert( p_points.end(), p_first, p_last); q_points.insert( q_points.end(), q_first, q_last); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin()+old_r, p_points.end()) && check_dimension( q_points.begin()+old_s, q_points.end()), "Not all points have the same dimension."); @@ -591,10 +591,10 @@ public: void insert_p( InputIterator p_first, InputIterator p_last) { - CGAL_optimisation_precondition_code(int old_r = static_cast(p_points.size())); + CGAL_precondition_code(int old_r = static_cast(p_points.size())); p_points.insert( p_points.end(), p_first, p_last); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin()+old_r, p_points.end()), "Not all points have the same dimension."); compute_distance(); @@ -604,10 +604,10 @@ public: void insert_q( InputIterator q_first, InputIterator q_last) { - CGAL_optimisation_precondition_code( int old_s = static_cast(q_points.size())); + CGAL_precondition_code( int old_s = static_cast(q_points.size())); q_points.insert( q_points.end(), q_first, q_last); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( q_points.begin()+old_s, q_points.end()), "Not all points have the same dimension."); compute_distance(); @@ -681,7 +681,7 @@ private: // construct program int n = 2 * d + static_cast(p_points.size() + q_points.size()); int m = d + 2; - CGAL_optimisation_precondition (p_points.size() > 0); + CGAL_precondition (p_points.size() > 0); QP qp (n, m, A_iterator (boost::counting_iterator(0), @@ -696,7 +696,7 @@ private: Quadratic_program_options options; options.set_pricing_strategy(pricing_strategy(NT())); solver = new Solver(qp, options); - CGAL_optimisation_assertion(solver->status() == QP_OPTIMAL); + CGAL_assertion(solver->status() == QP_OPTIMAL); // compute support and realizing points ET et_0 = 0; int r = static_cast(p_points.size()); @@ -773,8 +773,8 @@ is_valid( bool verbose, int level) const // compute normal vector ET_vector normal( d), diff( d); ET et_0 = 0, den = p_coords[d]; - CGAL_optimisation_assertion (den > et_0); - CGAL_optimisation_assertion (den == q_coords[d]); + CGAL_assertion (den > et_0); + CGAL_assertion (den == q_coords[d]); int i, j; for ( j = 0; j < d; ++j) normal[ j] = p_coords[ j] - q_coords[ j]; @@ -917,7 +917,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } diff --git a/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h b/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h index d2927f43d6b..4c2b6ae4039 100644 --- a/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h +++ b/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -53,8 +53,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition(r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition(c >= 0 && c < number_of_columns()); + CGAL_precondition(r >= 0 && r < number_of_rows()); + CGAL_precondition(c >= 0 && c < number_of_columns()); if (c <= r) return Value(c - r); else if (c >= r + number_of_rows()) @@ -93,8 +93,8 @@ all_furthest_neighbors_2( RandomAccessIC points_begin, // check preconditions: int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > 0); - CGAL_optimisation_expensive_precondition( + CGAL_precondition( number_of_points > 0); + CGAL_expensive_precondition( is_convex_2( points_begin, points_end, t)); // prepare random access container: @@ -125,7 +125,7 @@ all_furthest_neighbors_2( RandomAccessIC points_begin, RandomAccessIC points_end, OutputIterator o, const Traits& - CGAL_optimisation_expensive_precondition_code(t), + CGAL_expensive_precondition_code(t), std::random_access_iterator_tag) { typedef All_furthest_neighbor_matrix< @@ -135,8 +135,8 @@ all_furthest_neighbors_2( RandomAccessIC points_begin, // check preconditions: int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > 0); - CGAL_optimisation_expensive_precondition( + CGAL_precondition( number_of_points > 0); + CGAL_expensive_precondition( is_convex_2( points_begin, points_end, t)); // compute maxima: From a8dc42d557c9bbceeb227140d99774a49ef37d4c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 27 Sep 2022 13:49:31 +0100 Subject: [PATCH 100/248] Generator --- .../include/CGAL/Random_polygon_2_sweep.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Generator/include/CGAL/Random_polygon_2_sweep.h b/Generator/include/CGAL/Random_polygon_2_sweep.h index 2aa4102bbb1..84cb7ad5818 100644 --- a/Generator/include/CGAL/Random_polygon_2_sweep.h +++ b/Generator/include/CGAL/Random_polygon_2_sweep.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -156,9 +156,9 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const #if defined(CGAL_POLY_GENERATOR_DEBUG) std::cout << "less_than_in_tree; new: " << new_edge.as_int() << " tree edge: " << tree_edge.as_int() << std::endl; #endif - CGAL_polygon_precondition( + CGAL_precondition( m_vertex_data->edges[tree_edge.as_int()].is_in_tree); - CGAL_polygon_precondition( + CGAL_precondition( !m_vertex_data->edges[new_edge.as_int()].is_in_tree); Vertex_index left, mid, right; m_vertex_data->left_and_right_index(left, right, tree_edge); @@ -172,10 +172,10 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const case RIGHT_TURN: return false; case COLLINEAR: break; } - CGAL_polygon_assertion(m_vertex_data->less_xy_2( + CGAL_assertion(m_vertex_data->less_xy_2( m_vertex_data->point(left), m_vertex_data->point(mid))); - CGAL_polygon_assertion( m_vertex_data->less_xy_2( + CGAL_assertion( m_vertex_data->less_xy_2( m_vertex_data->point(mid), m_vertex_data->point(right))); m_vertex_data->is_simple_result = false; @@ -321,23 +321,23 @@ insertion_event(Tree *tree, Vertex_index prev_vt, std::pair result; if (left_turn) { result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; if (!this->is_simple_result) return false; result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; if (!this->is_simple_result) return false; } else { result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; if (!this->is_simple_result) return false; result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; if (!this->is_simple_result) return false; @@ -374,7 +374,7 @@ replacement_event(Tree *tree, Vertex_index cur_edge, Vertex_index next_edge) // check if continuation point is on the right side of neighbor segments typedef typename Tree::iterator It; Edge_data &td = edges[cur_edge.as_int()]; - CGAL_polygon_assertion(td.is_in_tree); + CGAL_assertion(td.is_in_tree); It cur_seg = td.tree_it; Vertex_index cur_vt = (td.is_left_to_right) ? next_edge : cur_edge; if (cur_seg != tree->begin()) { @@ -613,7 +613,7 @@ void make_simple_polygon(Iterator points_begin, Iterator points_end, #if defined(CGAL_POLY_GENERATOR_DEBUG) std::cout << "To swap: " << swap_interval.first << " " << swap_interval.second << std::endl; - CGAL_polygon_assertion(swap_interval.first >= -1 && + CGAL_assertion(swap_interval.first >= -1 && swap_interval.second >= -1 && swap_interval.first < size && swap_interval.second < size); From 8237f5c98f6f302656c98e8f6378bf97f34add78 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 28 Sep 2022 13:38:24 +0200 Subject: [PATCH 101/248] Fix dependencies The explanation for the differences: - the line `#include ` has been removed from several header files, - the header `` is no longer documented in `doc/Documentation/Developer_manual/Chapter_checks.txt` --- Inscribed_areas/package_info/Inscribed_areas/dependencies | 1 - Matrix_search/package_info/Matrix_search/dependencies | 1 - .../package_info/Optimal_bounding_box/dependencies | 1 - .../package_info/Optimisation_basic/dependencies | 4 ---- 4 files changed, 7 deletions(-) diff --git a/Inscribed_areas/package_info/Inscribed_areas/dependencies b/Inscribed_areas/package_info/Inscribed_areas/dependencies index da58f1b4f08..e380dc379d9 100644 --- a/Inscribed_areas/package_info/Inscribed_areas/dependencies +++ b/Inscribed_areas/package_info/Inscribed_areas/dependencies @@ -8,7 +8,6 @@ Kernel_23 Matrix_search Modular_arithmetic Number_types -Optimisation_basic Polygon Profiling_tools STL_Extension diff --git a/Matrix_search/package_info/Matrix_search/dependencies b/Matrix_search/package_info/Matrix_search/dependencies index 226536b676a..50ab94de3e7 100644 --- a/Matrix_search/package_info/Matrix_search/dependencies +++ b/Matrix_search/package_info/Matrix_search/dependencies @@ -5,7 +5,6 @@ Kernel_23 Matrix_search Modular_arithmetic Number_types -Optimisation_basic Profiling_tools STL_Extension Stream_support diff --git a/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies b/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies index 34ad48e6a80..249760e2928 100644 --- a/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies +++ b/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies @@ -18,7 +18,6 @@ Kernel_23 Modular_arithmetic Number_types Optimal_bounding_box -Optimisation_basic Polygon Profiling_tools Property_map diff --git a/Optimisation_basic/package_info/Optimisation_basic/dependencies b/Optimisation_basic/package_info/Optimisation_basic/dependencies index 4b1b3cb93f3..e69de29bb2d 100644 --- a/Optimisation_basic/package_info/Optimisation_basic/dependencies +++ b/Optimisation_basic/package_info/Optimisation_basic/dependencies @@ -1,4 +0,0 @@ -Installation -Kernel_23 -Profiling_tools -STL_Extension From eea79d0394c4b054fa8410c0944069b6ee456fe8 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 28 Sep 2022 13:39:05 +0200 Subject: [PATCH 102/248] Collateral fix of the documentation --- .../Documentation/Developer_manual/Chapter_checks.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt index 209aeca5649..523ec4f321a 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt @@ -145,12 +145,9 @@ To disable all checks in the library, the flag `CGAL_NDEBUG` can be set. Note that the standard flag `NDEBUG` sets `CGAL_NDEBUG`, but it also affects the `assert` macro. -To enable expensive and exactness checks, respectively, the compile-time -flags `CGAL_CHECK_EXPENSIVE` - -and `CGAL_CHECK_EXACTNESS` - -have to be supplied. However, exactness checks should only be turned on if +To enable expensive and exactness checks, respectively, the preprocessor macros +`CGAL_CHECK_EXPENSIVE` and `CGAL_CHECK_EXACTNESS` +have to be defined. However, exactness checks should only be turned on if the computation is done with some exact number type. \section secchecks_controlling Controlling checks at a finer granularity From e90b64f1b7c5bd7aa0eaaed3b8c38ef069195891 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 28 Sep 2022 14:02:06 +0200 Subject: [PATCH 103/248] Addition to the section about kernel assertions --- .../doc/Documentation/Developer_manual/Chapter_checks.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt index 523ec4f321a..9a9cbb715c5 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt @@ -154,7 +154,9 @@ the computation is done with some exact number type. The macros and related compile-time flags described so far all operate on the whole library. \cgal offers the possibility to turn checks on -and off just for the kernel. +and off just for the kernel. Kernel assertions are stated using the +macro `CGAL_kernel_assertion()`, and they can be disabled by defining +the macros `CGAL_KERNEL_NO_ASSERTIONS` or `CGAL_NO_ASSERTIONS`. \section secchecks_cgal_assume Suppress warnings using CGAL_assume. From b3174acf53dc9fd93bf4e776a39a68ac95021a8f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 28 Sep 2022 14:42:39 +0200 Subject: [PATCH 104/248] Add a ref --- .../doc/Documentation/Developer_manual/Chapter_checks.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt index 9a9cbb715c5..73cd228cf95 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt @@ -157,6 +157,7 @@ on the whole library. \cgal offers the possibility to turn checks on and off just for the kernel. Kernel assertions are stated using the macro `CGAL_kernel_assertion()`, and they can be disabled by defining the macros `CGAL_KERNEL_NO_ASSERTIONS` or `CGAL_NO_ASSERTIONS`. +See \ref secchecks "the section Checks in STL Extensions", for details. \section secchecks_cgal_assume Suppress warnings using CGAL_assume. From fc4c86a491b0d35dc11516bd3b27973a9381440c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 30 Sep 2022 15:28:06 +0200 Subject: [PATCH 105/248] try to work around MSVC 2015 bugs... --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 50 ++++++++++++++++--- Mesh_3/include/CGAL/Mesh_criteria_3.h | 9 +++- Mesh_3/include/CGAL/exude_mesh_3.h | 46 ++++++++++------- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 8 +++ Mesh_3/include/CGAL/make_mesh_3.h | 10 +++- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 10 +++- Mesh_3/include/CGAL/perturb_mesh_3.h | 11 +++- Mesh_3/include/CGAL/refine_mesh_3.h | 11 +++- .../include/CGAL/Named_function_parameters.h | 2 + 9 files changed, 125 insertions(+), 32 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 1abeb2a1f11..3b82645cbd2 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -394,7 +394,7 @@ public: Labeled_mesh_domain_3(const Function& function, const Bounding_object& bounding_object, const CGAL_NP_CLASS& np = parameters::default_values(), - std::enable_if_t>* = nullptr) + typename std::enable_if>::type* = nullptr) :Impl_details(function, bounding_object, parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), @@ -414,11 +414,17 @@ public: parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) {} - +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Labeled_mesh_domain_3(const CGAL_NP_CLASS& ... nps) : Labeled_mesh_domain_3(internal_np::combine_named_parameters(nps...)) {} +#else + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + : Labeled_mesh_domain_3(internal_np::combine_named_parameters(np1, np2, nps...)) + {} +#endif #ifndef CGAL_NO_DEPRECATED_CODE template @@ -426,7 +432,7 @@ public: Labeled_mesh_domain_3(const Function& function, const Bounding_object& bounding_object, double error_bound, - std::enable_if_t>* = nullptr) + typename std::enable_if>::type* = nullptr) : Labeled_mesh_domain_3(function, bounding_object, parameters::relative_error_bound(error_bound)) @@ -654,7 +660,7 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } - +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) { @@ -666,7 +672,19 @@ public: { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } +#else + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + { + return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(np1, np2, nps...)); + } + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + { + return create_gray_image_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); + } +#endif template static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& np) { @@ -676,6 +694,7 @@ public: return create_labeled_image_mesh_domain(image_, np); } +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) { @@ -686,6 +705,18 @@ public: { return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); } +#else + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + { + return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(np1, np2, nps...)); + } + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + { + return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); + } +#endif #endif /// \name Creation of domains from implicit functions @@ -739,7 +770,7 @@ public: const Bounding_object& bounding_object, const CGAL_NP_CLASS& np = parameters::default_values() #ifndef DOXYGEN_RUNNING - , std::enable_if_t>* = nullptr + , typename std::enable_if>::type* = nullptr #endif ) { @@ -774,12 +805,19 @@ public: np); } +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& ... nps) { return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); } - +#else + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + { + return create_implicit_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); + } +#endif #ifndef CGAL_NO_DEPRECATED_CODE template= 1910) template Mesh_criteria_3(const CGAL_NP_CLASS& ... nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) { } +#else +template +Mesh_criteria_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + : Mesh_criteria_3(internal_np::combine_named_parameters(np1, np2, nps...)) +{ +} +#endif }; // end class Mesh_criteria_3 diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index f39e21c6db1..42fa393d4e4 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -111,36 +111,44 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, do } #endif #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { - return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); + return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); } +#else +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return exude_mesh_3(c3t3,internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif - template - Mesh_optimization_return_code - exude_mesh_3_impl(C3T3& c3t3, - 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; +template +Mesh_optimization_return_code +exude_mesh_3_impl(C3T3& c3t3, + 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; - // 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 } //namespace CGAL diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 5591185ce5b..7270704578b 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -150,11 +150,19 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& doma } #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } +#else +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif template diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 29a4ede1ff3..d244dffa816 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -453,11 +453,19 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS } #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { - return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); + return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } +#else +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif /** diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 40ee94753fe..b606dce441f 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -146,11 +146,19 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { - return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); + return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); } +#else +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif template Mesh_optimization_return_code diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index c8b5d87a04e..0f7ddf30efd 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -115,12 +115,19 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { - return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); + return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } - +#else +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif template diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 9aa5822c780..90b139757a0 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -288,12 +288,19 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const } #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { - return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); + return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } - +#else +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif /** * @brief This function refines the mesh c3t3 wrt domain & criteria * diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index a943d5513be..4f6cea2f174 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -28,6 +28,8 @@ #define CGAL_NP_TEMPLATE_PARAMETERS NP_T=bool, typename NP_Tag=CGAL::internal_np::all_default_t, typename NP_Base=CGAL::internal_np::No_property #define CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT NP_T, typename NP_Tag, typename NP_Base +#define CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT_1 NP_T1, typename NP_Tag1, typename NP_Base1 +#define CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT_2 NP_T2, typename NP_Tag2, typename NP_Base2 #define CGAL_NP_CLASS CGAL::Named_function_parameters #define CGAL_NP_TEMPLATE_PARAMETERS_1 NP_T1=bool, typename NP_Tag1=CGAL::internal_np::all_default_t, typename NP_Base1=CGAL::internal_np::No_property From 69516da282d778a655675d088a394b7c795c4677 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Mon, 3 Oct 2022 09:45:22 +0200 Subject: [PATCH 106/248] no need for return doc --- STL_Extension/doc/STL_Extension/CGAL/algorithm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h index 0fdcb3d1001..1e520e6defc 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h +++ b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h @@ -125,7 +125,6 @@ the result of `operator++()` on a forward iterator. \sa `CGAL::predecessor()` -\returns `it`. */ template ForwardIterator successor(ForwardIterator it); From fa67108bdb909a783380f5931e803d3705869e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Oct 2022 09:54:03 +0200 Subject: [PATCH 107/248] msvc 15 workaround for P3M3 --- .../include/CGAL/make_periodic_3_mesh_3.h | 9 +++- .../include/CGAL/optimize_periodic_3_mesh_3.h | 50 ++++++++++++++++++- .../include/CGAL/refine_periodic_3_mesh_3.h | 8 +++ 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 2698c5e5373..a99b6dc1aea 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -347,12 +347,19 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); } - +#else +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif /** * @brief This function meshes the domain defined by mesh_traits 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 7ab4d9642a9..34513504a0f 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 @@ -45,6 +45,7 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { @@ -55,6 +56,18 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& ... { return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } +#else +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif // ---------------------------------- exuder ----------------------------------- /*! * \ingroup PkgPeriodic3Mesh3Functions @@ -82,6 +95,7 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C 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); } +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { @@ -92,6 +106,19 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS& ... n { return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } +#else +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(np1, np2, nps...)); +} +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif + // ------------------------------ odt optimizer -------------------------------- /*! @@ -116,6 +143,7 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { @@ -126,7 +154,18 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS { return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); } - +#else +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif // ------------------------------- lloyd optimizer ----------------------------- /*! @@ -153,12 +192,19 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); } - +#else +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif } // namespace CGAL #endif // CGAL_OPTIMIZE_PERIODIC_3_MESH_3_H 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 40ac29fe83e..6319702d344 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 @@ -331,11 +331,19 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit } #ifndef DOXYGEN_RUNNING +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) template void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); } +#else +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); +} +#endif /** * @brief This function refines the mesh c3t3 wrt domain & criteria * From 8dff5ceaa1a69fd0b4ea8c0b7094b87fb64d9fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Oct 2022 12:02:50 +0200 Subject: [PATCH 108/248] remove extra dot --- Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index dd37a7cfe25..5d9354615ee 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -67,4 +67,3 @@ int main(int argc, char* argv[]) return 0; } -. \ No newline at end of file From 042d5b5a9a21edb0fd4580e0d7b6988d5f6816c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Oct 2022 18:35:24 +0200 Subject: [PATCH 109/248] add migration notes --- Mesh_2/doc/Mesh_2/Mesh_2.txt | 1 + Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 ++ .../Periodic_3_mesh_3/Periodic_3_mesh_3.txt | 4 ++- .../doc/STL_Extension/STL_Extension.txt | 32 +++++++++++++++++++ STL_Extension/doc/STL_Extension/dependencies | 1 + 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Mesh_2/doc/Mesh_2/Mesh_2.txt b/Mesh_2/doc/Mesh_2/Mesh_2.txt index 4ccab5bedb4..367818dc173 100644 --- a/Mesh_2/doc/Mesh_2/Mesh_2.txt +++ b/Mesh_2/doc/Mesh_2/Mesh_2.txt @@ -278,6 +278,7 @@ After Delaunay refinement, angles are in the interval [28.5; 121.9] degrees. After 10 iterations of Lloyd optimization, they are in [29.1; 110.8]. 100 iterations take them to [29.3; 109.9]. \cgalFigureEnd +Since \cgal 5.6, `lloyd_optimize_mesh_2()` uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. \subsection Mesh_2Examples Examples diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index ceceba81619..bc93196a563 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -301,6 +301,8 @@ of the `C3T3`. They can be removed using the function `remove_isolated_vertices( \section Mesh_3_section_interface Interface +Since \cgal 5.6, this packages uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. + \subsection Mesh_3TheGlobalFunctions The Global Functions A 3D mesh generation process is launched through a call diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt index 2dc9e0781f1..715b59b132e 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt @@ -76,7 +76,7 @@ of the manual of 3D periodic triangulations). Thanks to this construction, the meshing process can be exclusively conducted within the canonical cube. The mesh can then be created using the \ref PkgMesh3 package of \cgal. -As this package originally aims to mesh non-periodic domains of \f$ \mathbb R^3\f$, an interface +As this package originally aims to mesh non-periodic domains of \f$ \mathbb R^3\f$, an interfacez is necessary between the packages \ref PkgMesh3 and \ref PkgPeriodic3Triangulation3. This package provides this interface. @@ -250,6 +250,8 @@ for further information. \section Periodic_3_mesh_3_section_interface Interface +Since \cgal 5.6, this packages uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. + \subsection Periodic_3_mesh_3TheGlobalFunctions The Global Functions A periodic 3D mesh generation process is launched through a call diff --git a/STL_Extension/doc/STL_Extension/STL_Extension.txt b/STL_Extension/doc/STL_Extension/STL_Extension.txt index 584f04e4bec..d791c3ade49 100644 --- a/STL_Extension/doc/STL_Extension/STL_Extension.txt +++ b/STL_Extension/doc/STL_Extension/STL_Extension.txt @@ -393,3 +393,35 @@ void foo() */ } /* namespace CGAL */ +/*! +\page FromBoostNPtoCGALNP Upgrading Code using \boost Parameters to \cgal Named Function Parameters + +Prior to \cgal 5.6, some packages were using Boost parameters to provide a user friendly +way to set parameters of classes and functions. In an attempt to remove a dependency and +to get a more uniform API accross packages, these packages have been updated to now use +\cgal \ref bgl_namedparameters inspired by the function named parameters from +the \boost graph library. In practice this means that the following call: +\code +Mesh_criteria criteria(edge_size = 8, + facet_angle = 25, + facet_size = 8, + facet_distance = 0.2, + cell_radius_edge_ratio = 3, + cell_size = 10); +\endcode +should now be written as follow: +\code +Mesh_criteria criteria(edge_size(8). + facet_angle(25). + facet_size(8). + facet_distance(0.2). + cell_radius_edge_ratio(3). + cell_size(10)); +\endcode + +Note that we have tried to preserve the backward compatibility by allowing previous API +to remain valid. However, if new parameters are introduced for those functions, there is +no guarantee that they will be ported to the old API. So we strongly encourage users to +upgrade to the new API. Additionally, passing parameters without names is deprecated or +and even removed for some functions. +*/ \ No newline at end of file diff --git a/STL_Extension/doc/STL_Extension/dependencies b/STL_Extension/doc/STL_Extension/dependencies index cf8c5e176f3..e3e3864ed1f 100644 --- a/STL_Extension/doc/STL_Extension/dependencies +++ b/STL_Extension/doc/STL_Extension/dependencies @@ -4,3 +4,4 @@ Number_types Kernel_23 Miscellany Surface_mesh +BGL From 3de965f16d50cf798558f60296220b51454c5974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Oct 2022 19:08:47 +0200 Subject: [PATCH 110/248] please MSVC 2015 @lrineau do you know why only the constructor has this issue? --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 3b82645cbd2..5ef39ba36be 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -428,7 +428,9 @@ public: #ifndef CGAL_NO_DEPRECATED_CODE template +#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) CGAL_DEPRECATED +#endif Labeled_mesh_domain_3(const Function& function, const Bounding_object& bounding_object, double error_bound, From a37ffee92728cdd24d3e32068f9949f069b4a204 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 4 Oct 2022 06:34:05 +0100 Subject: [PATCH 111/248] Fix a Convex_hull_3 test case --- Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp b/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp index 55b29cf4435..3638c7b9ef0 100644 --- a/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp +++ b/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include From 9666ae51653cd039e38b5273bb07687ff4863b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 4 Oct 2022 10:21:20 +0200 Subject: [PATCH 112/248] update changes --- Installation/CHANGES.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index be5a7d1fc93..0be9b59545c 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -4,7 +4,7 @@ Release History [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- -Release date: December 2022 +Release date: June 2022 ### [Combinatorial Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgCombinatorialMaps) [Generalized Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgGeneralizedMaps) [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex) @@ -38,9 +38,16 @@ CGAL tetrahedral Delaunay refinement algorithm. ### [2D Conforming Triangulations and Meshes](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh2) +- Deprecated usage of boost parameters in favor of function named parameters in `CGAL::lloyd_optimize_mesh_2()`. - Deprecated two overloads of Function `refine_Delaunay_mesh()` and replaced them with versions using function named parameters. - Add overloads of function `write_VTU()` with property maps for specifying the domain. +### [3D Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh3) +- Deprecated usage of boost parameters in favor of function named parameters. + +### [3D Periodic Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgPeriodic3Mesh3) +- Deprecated usage of boost parameters in favor of function named parameters. + [Release 5.5](https://github.com/CGAL/cgal/releases/tag/v5.5) ----------- From 9b357c6afff4cb7e6175e9096ea49e8585dc9681 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 4 Oct 2022 10:35:05 +0100 Subject: [PATCH 113/248] Reintroduce the runtime switch to enable/disable assrtions --- STL_Extension/include/CGAL/assertions.h | 93 ++++++++++++------- .../include/CGAL/arrange_offset_polygons_2.h | 6 ++ .../Straight_skeleton_2/test_sls_offset.cpp | 4 +- 3 files changed, 65 insertions(+), 38 deletions(-) diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 45d513d9f5f..9a0b9496810 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -44,6 +44,27 @@ # define CGAL_NO_WARNINGS #endif +#if defined(CGAL_NO_ASSERTIONS) +namespace CGAL{ +inline void set_use_assertions(bool){} +inline bool get_use_assertions(){return true;} +} +#else +#include +namespace CGAL{ +inline bool& get_use_assertions() +{ + CGAL_STATIC_THREAD_LOCAL_VARIABLE(bool, b, true); + return b; +} +inline void set_use_assertions(bool b) +{ + get_use_assertions() = b; +} +} +#endif + + namespace CGAL { // function declarations @@ -89,18 +110,18 @@ inline bool possibly(Uncertain c); #else // no CGAL_NO_ASSERTIONS # define CGAL_ASSERTIONS_ENABLED true # define CGAL_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17 # define CGAL_destructor_assertion(EX) \ - (CGAL::possibly(EX)||(std::uncaught_exceptions() > 0)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||(std::uncaught_exceptions() > 0))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_destructor_assertion_catch(CODE) try{ CODE } catch(...) { if(std::uncaught_exceptions() <= 0) throw; } # else // use C++03 `std::uncaught_exception()` # define CGAL_destructor_assertion(EX) \ - (CGAL::possibly(EX)||std::uncaught_exception()?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||std::uncaught_exception())?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_destructor_assertion_catch(CODE) try{ CODE } catch(...) { if(!std::uncaught_exception()) throw; } # endif // use C++03 `std::uncaught_exception()` # define CGAL_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_assertion_code(CODE) CODE # define CGAL_assume(EX) CGAL_assertion(EX) # define CGAL_assume_code(CODE) CGAL_assertion_code(CODE) @@ -124,9 +145,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_assertion_code(CODE) #else # define CGAL_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_assertion_code(CODE) CODE #endif // CGAL_NO_ASSERTIONS @@ -136,9 +157,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_assertion_code(CODE) #else # define CGAL_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_assertion_code(CODE) CODE #endif // CGAL_NO_ASSERTIONS @@ -148,9 +169,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_assertion_code(CODE) #else # define CGAL_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_assertion_code(CODE) CODE #endif // CGAL_NO_ASSERTIONS @@ -166,9 +187,9 @@ inline bool possibly(Uncertain c); #else # define CGAL_PRECONDITIONS_ENABLED true # define CGAL_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -178,9 +199,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_precondition_code(CODE) #else # define CGAL_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -190,9 +211,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_precondition_code(CODE) #else # define CGAL_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -202,9 +223,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_precondition_code(CODE) #else # define CGAL_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -218,9 +239,9 @@ inline bool possibly(Uncertain c); # define CGAL_postcondition_code(CODE) #else # define CGAL_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -230,9 +251,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_postcondition_code(CODE) #else # define CGAL_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -242,9 +263,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_postcondition_code(CODE) #else # define CGAL_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -254,9 +275,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_postcondition_code(CODE) #else # define CGAL_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -271,16 +292,16 @@ inline bool possibly(Uncertain c); # define CGAL_warning_code(CODE) #else # define CGAL_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17 # define CGAL_destructor_warning(EX) \ - (CGAL::possibly(EX)||(std::uncaught_exceptions() > 0)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||(std::uncaught_exceptions() > 0))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # else // use C++03 `std::uncaught_exception()` # define CGAL_destructor_warning(EX) \ - (CGAL::possibly(EX)||std::uncaught_exception()?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||std::uncaught_exception())?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # endif // use C++03 `std::uncaught_exception()` # define CGAL_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS @@ -290,9 +311,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_warning_code(CODE) #else # define CGAL_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS @@ -302,9 +323,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_warning_code(CODE) #else # define CGAL_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS @@ -314,9 +335,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_warning_code(CODE) #else # define CGAL_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS diff --git a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h index e7fca71b2b2..4ceae69e570 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -46,6 +46,10 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin , const K& ) { + bool bk_poly_assert_mode = get_use_assertions(); + set_use_assertions(false); // disable assertions in Polygon_2 function as we may + // manipulate strictly simple polygons + typedef typename std::iterator_traits::difference_type difference_type ; typedef typename std::iterator_traits::value_type PolygonPtr ; @@ -97,12 +101,14 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin if (lParent == nullptr) { + set_use_assertions(bk_poly_assert_mode); return false; } lParent->add_hole(*lPoly); } } + set_use_assertions(bk_poly_assert_mode); return true; } diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index f1296a0eb06..f1bb7fe7ffc 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -943,12 +943,12 @@ void test_offset(const char* filename) std::cout << offset_poly_with_holes.size() << " polygons with holes" << std::endl; // for(const auto& offp : offset_poly_with_holes) // print_polygon_with_holes(*offp); - + CGAL::set_use_assertions(false); for(const auto& offp : offset_poly_with_holes){ (void)offp; assert(offp->outer_boundary().is_counterclockwise_oriented()); } - + CGAL::set_use_assertions(true); #ifdef CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE if(i > 2) break; From e61b4a838a2d1ae1dfcf560445b884607baa90bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 15:35:36 +0200 Subject: [PATCH 114/248] Use is_valid_descriptors in graph checkers + fixes/improvements --- BGL/include/CGAL/boost/graph/helpers.h | 525 ++++++++++++++----------- 1 file changed, 299 insertions(+), 226 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 0448870f6ed..37511854041 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #include - namespace CGAL { /*! @@ -280,72 +280,249 @@ bool is_tetrahedron( typename boost::graph_traits::halfedge_descripto if ( is_border(h5,g) ) return false; if ( is_border(h6,g) ) return false; return true; - } - -template -bool is_valid_halfedge_descriptor( typename boost::graph_traits::halfedge_descriptor h, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - face_descriptor f = face(h,g); - halfedge_descriptor done(h); - do{ - if(face(h,g) != f){ - std::cerr << "halfedge " << h << " is invalid\n"; - return false; - } - halfedge_descriptor hn = h; - hn = next(h,g); - if(prev(hn,g) != h){ - std::cerr << "halfedge " << h << " is invalid\n"; - return false; - } - h = hn; - } while(h != done); - return true; } -template -bool is_valid_vertex_descriptor( typename boost::graph_traits::vertex_descriptor v, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor h = halfedge(v,g), done(h); - if(h == boost::graph_traits::null_halfedge()){ - return true; - } - do{ - if(target(h,g) != v){ - std::cerr << "vertex " << v << " is invalid\n"; - return false; - } - h = opposite(next(h,g),g); - }while(h != done); - return true; -} +namespace BGL { -template -bool is_valid_face_descriptor( typename boost::graph_traits::face_descriptor f, const FaceGraph& g) +template +bool is_valid_vertex_descriptor(typename boost::graph_traits::vertex_descriptor v, + const Graph& g, + const bool verb = false) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor h = halfedge(f,g); - if(face(h,g) != f){ - std::cerr << "face " << f << " is invalid\n"; + Verbose_ostream verr(verb); + bool valid = true; + + // null vertex + valid = (v != boost::graph_traits::null_vertex()); + if(!valid) + { + verr << "vertex is null." << std::endl; return false; } + + if(!CGAL::internal::is_isolated(v, g)) + { + // Incident halfedge integrity + valid = (target(halfedge(v, g), g) == v); + if(!valid) + { + verr << "vertex has invalid halfedge()." << std::endl; + return false; + } + } + return true; } +template +bool is_valid_halfedge_descriptor(typename boost::graph_traits::halfedge_descriptor h, + const Graph& g, + const bool verb = false) +{ + Verbose_ostream verr(verb); + bool valid = true; + + // null halfedge + valid = (h != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge is null." << std::endl; + return false; + } + + // Pointer integrity. + valid = (prev(h, g) != boost::graph_traits::null_halfedge()); + valid = valid && (next(h, g) != boost::graph_traits::null_halfedge()); + valid = valid && (opposite(h, g) != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge's prev / next / opposite halfedges are null." << std::endl; + return false; + } + + // degeneracies + valid = (next(h, g) != h); + valid = valid && (prev(h, g) != h); + valid = valid && (opposite(h, g) != h); + valid = valid && (target(h, g) != target(opposite(h, g), g)); + if(!valid) + { + verr << "combinatorial degeneracies." << std::endl; + return false; + } + + // edge integrity + valid = (halfedge(edge(h, g), g) == h); + if(!valid) + { + verr << "halfedge has an invalid edge." << std::endl; + return false; + } + + // opposite integrity. + valid = (opposite(h, g) != h); + valid = valid && (opposite(opposite(h, g), g) == h); + if(!valid) + { + verr << "halfedge has invalid opposite()." << std::endl; + return false; + } + + // previous integrity. + valid = (prev(next(h, g), g) == h); + valid = valid && (next(prev(h, g), g) == h); + if(!valid) + { + verr << "prev(next(hd)) != hd OR next(prev(hd)) != hd" << std::endl; + return false; + } + + // vertex integrity. + valid = (target(h, g) != boost::graph_traits::null_vertex()); + if(!valid) + { + verr << "target of halfedge is the null vertex." << std::endl; + return false; + } + + valid = (target(h, g) == target(opposite(next(h, g), g), g)); + valid = valid && (target(opposite(h, g), g) == target(prev(h, g), g)); + if(!valid) + { + verr << "vertex inconsistencies with prev/next." << std::endl; + return false; + } + + return true; +} + +template +bool is_valid_edge_descriptor(typename boost::graph_traits::edge_descriptor e, + const FaceGraph& g, + const bool verb = false) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + Verbose_ostream verr(verb); + bool valid = true; + + // there is no null_edge() in the Graph concepts + + + // Pointer integrity. + const halfedge_descriptor h = halfedge(e, g); + valid = (h != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge incident to edge is the null halfedge." << std::endl; + return false; + } + + // halfedge integrity + valid = (edge(h, g) == e); + if(!valid) + { + verr << "edge has an invalid halfedge()." << std::endl; + return false; + } + + return true; +} + +template +bool is_valid_face_descriptor(typename boost::graph_traits::face_descriptor f, + const FaceGraph& g, + const bool verb = false) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + Verbose_ostream verr(verb); + bool valid = true; + + // null face + valid = (f != boost::graph_traits::null_face()); + if(!valid) + { + verr << "face is null." << std::endl; + return false; + } + + // Pointer integrity. + const halfedge_descriptor h = halfedge(f, g); + valid = (h != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge incident to face is the null halfedge." << std::endl; + return false; + } + + valid = (face(h, g) == f); + if(!valid) + { + verr << "face has an invalid halfedge()." << std::endl; + return false; + } + + // face integrity. + valid = (face(h, g) == face(next(h, g), g)); + valid = valid && (face(h, g) == face(prev(h, g), g)); + if(!valid) + { + verr << "different face incident to face halfedges." << std::endl; + return false; + } + + return true; +} + +} // namespace BGL + +// These empty functions simply calling the BGL versions (just above) are done such that +// a specific graph type (e.g. Surface_mesh) can overload those and still call the BGL versions +// without duplicating code +template +bool is_valid_vertex_descriptor(typename boost::graph_traits::vertex_descriptor v, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_vertex_descriptor(v, g, verb); +} + +template +bool is_valid_halfedge_descriptor(typename boost::graph_traits::halfedge_descriptor h, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_halfedge_descriptor(h, g, verb); +} + +template +bool is_valid_edge_descriptor(typename boost::graph_traits::edge_descriptor e, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_edge_descriptor(e, g, verb); +} + +template +bool is_valid_face_descriptor(typename boost::graph_traits::face_descriptor f, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_face_descriptor(f, g, verb); +} + /*! \ingroup PkgBGLHelperFct - * \brief checks the integrity of `g`. + * \brief checks the integrity of the graph `g`. * - * `g` is valid if it follows the rules of the `HalfedgeListGraph` concept, - * and all of its associations are reciprocal. - * For example, `prev(next(h, g), g)` must be `h`, - * and `next(prev(h, g), g)` must be `h`. + * The graph `g` is valid if it follows the rules of the `HalfedgeListGraph` concept + * and all of its associations are reciprocal (for example, `prev(next(h, g), g)` must be `h`, + * and `next(prev(h, g), g)` must be `h`). * - * \param g the `Graph` to test. + * \param g the graph to test * \param verb if `true`, the details of the check will be written in the standard output. * * \tparam Graph a model of `HalfedgeListGraph` @@ -357,14 +534,13 @@ template bool is_valid_halfedge_graph(const Graph& g, bool verb = false) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::vertices_size_type vertex_size_type; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::halfedges_size_type halfedges_size_type; Verbose_ostream verr(verb); - std::size_t num_v(std::distance(boost::begin(vertices(g)), boost::end(vertices(g)))), - num_e(std::distance(boost::begin(edges(g)), boost::end(edges(g)))), - num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g)))); + + std::size_t num_v = CGAL::internal::exact_num_vertices(g), + num_e = CGAL::internal::exact_num_edges(g), + num_h = CGAL::internal::exact_num_halfedges(g); bool valid = (1 != (num_h&1) && (2*num_e == num_h)); if(!valid) @@ -375,288 +551,185 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false) } // All halfedges. - halfedges_size_type n = 0; - for(halfedge_descriptor begin : halfedges(g)) + std::size_t hc = 0; + for(halfedge_descriptor h : halfedges(g)) { - // Pointer integrity. - valid = (next(begin, g) != boost::graph_traits::null_halfedge()); - valid = valid && (opposite(begin, g) != boost::graph_traits::null_halfedge()); - if(!valid) + if(!is_valid_halfedge_descriptor(h, g, verb)) { - verr << "halfedge " << n << " next / opposite halfedges are null." << std::endl; + verr << "halfedge " << hc << " is invalid." << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } - // edge integrity - valid = (halfedge(edge(begin, g), g) == begin); - - // opposite integrity. - valid = valid && (opposite(begin, g) != begin); - valid = valid && (opposite(opposite(begin, g), g) == begin); - if(!valid) - { - verr << "halfedge " << n << " invalid halfedge opposite()." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - // previous integrity. - valid = (prev(next(begin, g), g) == begin); - valid = valid && (next(prev(begin, g), g) == begin); - if(!valid) - { - verr << "halfedge " << n << " prev(next(hd)) != hd OR next(prev(hd)) != hd" << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - // vertex integrity. - valid = (target(begin, g) != boost::graph_traits::null_vertex()); - if(!valid) - { - verr << "halfedge " << n << " target of halfedge is the null vertex." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - valid = (target(begin, g) == target(opposite(next(begin, g), g), g)); - if(!valid) - { - verr << "halfedge " << n << " target(hd) != source(next(hd))." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - ++n; + ++hc; } - valid = (n == num_h); + valid = (hc == num_h); if(!valid) { - verr << "counting halfedges failed." << std::endl; + verr << "counting halfedges failed: " << hc << " vs " << num_h << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } // All vertices. - vertex_size_type v = 0; - n = 0; - for(vertex_descriptor vbegin : vertices(g)) + std::size_t vc = 0; + hc = 0; + for(vertex_descriptor v : vertices(g)) { - // Pointer integrity. - if(halfedge(vbegin, g) != boost::graph_traits::null_halfedge()) - valid = (target(halfedge(vbegin, g), g) == vbegin); - else - valid = false; - - if(!valid) + if(!is_valid_vertex_descriptor(v, g, verb)) { - verr << "vertex " << v << " halfedge incident to vertex is the null halfedge." << std::endl; + verr << "vertex " << vc << " is invalid." << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } // cycle-around-vertex test. - halfedge_descriptor h = halfedge(vbegin, g); - if(h != boost::graph_traits::null_halfedge()) + if(!CGAL::internal::is_isolated(v, g)) { - halfedge_descriptor ge = h; + halfedge_descriptor h = halfedge(v, g), done = h; do { - ++n; + ++hc; h = opposite(next(h, g), g); - valid = (n <= num_h && n != 0); + valid = (hc <= num_h); if(!valid) { - verr << "vertex " << v << " too many halfedges around vertex." << std::endl; + verr << "vertex " << vc << " too many halfedges around vertex." << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } } - while(h != ge); + while(h != done); } - ++v; + ++vc; } - valid = (v == num_v); + valid = (vc == num_v); if(!valid) { - verr << "counting vertices failed." << std::endl; + verr << "counting vertices failed: " << vc << " vs " << num_v << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } - valid = (n == num_h); + valid = (hc == num_h); if(!valid) { - verr << "counting halfedges via vertices failed." << std::endl; + verr << "counting halfedges via vertices failed: " << hc << " vs " << num_h << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } - // All halfedges. - n = 0; - for(halfedge_descriptor i : halfedges(g)) - { - // At least triangular facets and distinct geometry. - valid = (next(i, g) != i) && (target(i, g) != target(opposite(i, g), g)); - if(!valid) - { - verr << "halfedge " << n << " pointer validity corrupted." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - ++n; - } - - valid = (n == num_h); - if(!valid) - verr << "counting halfedges failed." << std::endl; - - verr << "Halfedge Graph Structure is " << (valid ? "valid." : "NOT VALID.") << std::endl; + verr << "Halfedge Graph Structure is valid" << std::endl; return valid; } /*! \ingroup PkgBGLHelperFct - * \brief checks the integrity of `g`. + * \brief checks the integrity of the graph `g`. * - * `g` is valid if it is a valid `HalfedgeListGraph`, if it follows the rules - * of the `FaceListGraph` concept, and all of its associations are reciprocal. - * For example, `face(halfedge(f,g),g)` must be `f`. - * calls `is_valid_halfedge_graph()` + * The graph `g` is a valid face graph if it is a valid halfedge graph, and if it follows the rules + * of the `FaceListGraph` concept and all of its associations are reciprocal (for example, + * `face(halfedge(f,g),g)` must be `f`). * - * \param g the `Graph` to test. - * \param verb if `true`, the details of the check will be written in the standard output. + * \param g the graph to test + * \param verb if `true`, the details of the check will be written in the standard output * - * \tparam Graph a model of `FaceListGraph` + * \tparam FaceGraph a model of `FaceListGraph` and `HalfedgeListGraph` * * \return `true` if `g` is valid, `false` otherwise. * * \see `is_valid_halfedge_graph()` */ -template -bool is_valid_face_graph(const Graph& g, bool verb = false) +template +bool is_valid_face_graph(const FaceGraph& g, bool verb = false) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::halfedges_size_type halfedges_size_type; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename boost::graph_traits::faces_size_type faces_size_type; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; Verbose_ostream verr(verb); - std::size_t num_f(std::distance(boost::begin(faces(g)), boost::end(faces(g)))), - num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g)))); + std::size_t num_f = CGAL::internal::exact_num_faces(g), + num_h = CGAL::internal::exact_num_halfedges(g); - faces_size_type f = 0; - std::size_t n = 0; - std::size_t hn = 0; - halfedges_size_type nb = 0; + std::size_t fc = 0, hc = 0, nb = 0; - //is valid halfedge_graph ? bool valid = is_valid_halfedge_graph(g, verb); if(!valid) return false; // All faces. - for(face_descriptor fbegin : faces(g)) + for(face_descriptor f : faces(g)) { - // Pointer integrity. - if(halfedge(fbegin, g) != boost::graph_traits::null_halfedge()) - valid = (face(halfedge(fbegin, g), g) == fbegin); - else - valid = false; - - if(!valid) + if(!is_valid_face_descriptor(f, g, verb)) { - verr << "face " << f << " halfedge incident to face is the null halfedge." << std::endl; + verr << "face " << fc << " is invalid." << std::endl; verr << "Face Graph Structure is NOT VALID." << std::endl; return false; } // cycle-around-face test. - halfedge_descriptor h = halfedge( fbegin, g); - if(h != boost::graph_traits::null_halfedge()) + halfedge_descriptor h = halfedge(f, g), done(h); + do { - halfedge_descriptor ge = h; - do + ++hc; + valid = (hc <= num_h); + if(!valid) { - ++n; - h = next(h, g); - valid = (n <= num_h && n != 0); - if(!valid) - { - verr << "face " << f << " too many halfedges around face." << std::endl; - verr << "Face Graph Structure is NOT VALID." << std::endl; - return false; - } + verr << "face " << fc << " too many halfedges around face." << std::endl; + verr << "Face Graph Structure is NOT VALID." << std::endl; + return false; } - while(h != ge); + h = next(h, g); } + while(h != done); - ++f; + ++fc; } - valid = (f == num_f); + valid = (fc == num_f); if(!valid) { - verr << "counting faces failed." << std::endl; + verr << "counting faces failed: " << fc << " vs " << num_f << std::endl; verr << "Face Graph Structure is NOT VALID." << std::endl; return false; } - for(halfedge_descriptor i : halfedges(g)) + for(halfedge_descriptor h : halfedges(g)) { - ++hn; - //counting borders - if(is_border(i, g)) + if(is_border(h, g)) ++nb; - - // face integrity. - valid = (face(i, g) == face(next(i, g), g)); - if(!valid) - { - verr << "halfedge " << hn << " face(hd) != face(next(hd))." << std::endl; - verr << "Face Graph Structure is NOT VALID." << std::endl; - return false; - } } - valid = (n + nb == num_h); + valid = (hc + nb == num_h); if(!valid) { - verr << "sum border halfedges (2*nb) = " << 2 * nb << std::endl; verr << "counting halfedges via faces failed." << std::endl; + verr << "sum border halfedges (2*nb) = " << 2 * nb << " vs " << num_h << std::endl; verr << "Face Graph Structure is NOT VALID." << std::endl; return false; } - valid = (f == num_f); - if(!valid) - verr << "counting faces failed." << std::endl; - - verr << "Face Graph Structure is " << (valid ? "valid." : "NOT VALID.") << std::endl; + verr << "Face Graph Structure is valid" << std::endl; return valid; } /*! \ingroup PkgBGLHelperFct - * \brief checks the integrity of `g`. + * \brief checks the integrity of the mesh `g`. * - * `g` is valid if it is a valid `FaceListGraph` and it has distinct faces on each side of an edge. - * calls `is_valid_face_graph()`. + * The mesh `g` is a valid polygon mesh if it is a valid face graph and if it follows the rules + * defined in \ref PMPDef "PolygonMesh". * - * \param g the `Mesh` to test. - * \param verb : if `true`, the details of the check will be written in the standard output. + * \param g the `Mesh` to test + * \param verb if `true`, the details of the check will be written in the standard output * - * \tparam Mesh a model of `FaceListGraph` and `HalfedgeListGraph`, and follows - * the definition of a \ref PMPDef "PolygonMesh" + * \tparam Mesh a model of `FaceListGraph` and `HalfedgeListGraph` * \return `true` if `g` is valid, `false` otherwise. * * \see `is_valid_face_graph()` From 226f84f2e65848446c740d33d0451a7fa5eb6c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 15:36:04 +0200 Subject: [PATCH 115/248] Check face graph validity and not just halfedge validity in post-reading BGL IO --- BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h index 331f8a0f44b..b1a3bf3eeaf 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h @@ -151,7 +151,7 @@ public: put(fcm, f, face_colors[i]); } - return is_valid(g); + return is_valid_face_graph(g); } protected: From 723e44389c7f9f0f2f66c095dc0efe0ec6682090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 15:36:34 +0200 Subject: [PATCH 116/248] Drive-by boost removal --- BGL/include/CGAL/boost/graph/internal/helpers.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/internal/helpers.h b/BGL/include/CGAL/boost/graph/internal/helpers.h index ec6b47baf83..b0a4ab885ae 100644 --- a/BGL/include/CGAL/boost/graph/internal/helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/helpers.h @@ -11,14 +11,15 @@ #ifndef CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H #define CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H -#include -#include #include #include #include #include + #include +#include + namespace CGAL { // breaks a dependency loop between @@ -133,7 +134,7 @@ std::size_t exact_num_vertices(const Graph& g) { typename boost::graph_traits::vertex_iterator beg, end; - boost::tie(beg,end) = vertices(g); + std::tie(beg,end) = vertices(g); return std::distance(beg,end); } @@ -142,7 +143,7 @@ std::size_t exact_num_halfedges(const Graph& g) { typename boost::graph_traits::halfedge_iterator beg, end; - boost::tie(beg,end) = halfedges(g); + std::tie(beg,end) = halfedges(g); return std::distance(beg,end); } @@ -151,7 +152,7 @@ std::size_t exact_num_edges(const Graph& g) { typename boost::graph_traits::edge_iterator beg, end; - boost::tie(beg,end) = edges(g); + std::tie(beg,end) = edges(g); return std::distance(beg,end); } @@ -160,7 +161,7 @@ std::size_t exact_num_faces(const Graph& g) { typename boost::graph_traits::face_iterator beg, end; - boost::tie(beg,end) = faces(g); + std::tie(beg,end) = faces(g); return std::distance(beg,end); } From 13cbddd22b648bbd695e7027f2d37191337d0e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 16:23:54 +0200 Subject: [PATCH 117/248] Regroup similar BGL helpers --- BGL/include/CGAL/boost/graph/helpers.h | 436 +++++++++++++------------ 1 file changed, 228 insertions(+), 208 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 37511854041..9ea86004dec 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -75,213 +75,6 @@ is_border(typename boost::graph_traits::vertex_descriptor vd, return boost::optional::halfedge_descriptor>(); } - - /*! - \ingroup PkgBGLHelperFct - returns `true` if there are no border edges. - */ -template -bool is_closed(const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - for(halfedge_descriptor hd : halfedges(g)){ - if(is_border(hd,g)){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if the target of `hd` has exactly two incident edges. - */ -template -bool is_bivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == opposite(next(opposite(next(hd,g),g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all vertices have exactly two incident edges. - */ -template - bool is_bivalent_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - for(vertex_descriptor vd : vertices(g)){ - halfedge_descriptor hd = halfedge(vd,g); - if((hd == boost::graph_traits::null_halfedge()) || - (! is_bivalent(hd,g))){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if the target of `hd` has exactly three incident edges. - */ -template -bool is_trivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == opposite(next(opposite(next(opposite(next(hd,g),g),g),g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all - vertices have exactly three incident edges. - */ -template - bool is_trivalent_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - for(vertex_descriptor vd : vertices(g)){ - halfedge_descriptor hd = halfedge(vd,g); - if((hd == boost::graph_traits::null_halfedge()) || - (! is_trivalent(halfedge(hd,g),g))){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a triangle. - \pre `g` must be valid. - */ -template - bool is_isolated_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor beg = hd; - if(is_border(hd,g)) return false; - for(int i=0; i<3;i++){ - if(! is_border(opposite(hd,g),g)) return false; - hd = next(hd,g); - } - return hd == beg; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the face denoted by `hd` is a triangle, that is it has three incident halfedges. - */ -template -bool is_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == next(next(next(hd,g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all faces are triangles. - */ -template - bool is_triangle_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::face_descriptor face_descriptor; - for(face_descriptor fd : faces(g)){ - if(! is_triangle(halfedge(fd,g),g)){ - return false; - } - } - return true; -} - -/*! - \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a quadrilateral. - */ -template -bool is_isolated_quad(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor beg = hd; - if(is_border(hd,g)) return false; - for(int i=0; i<4;i++){ - if(! is_border(opposite(hd,g),g)) return false; - hd = next(hd,g); - } - return hd == beg; -} - - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the face denoted by `hd` is a quad, that is it has four incident halfedges. - */ -template -bool is_quad(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == next(next(next(next(hd,g),g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all faces are quadrilaterals. - */ -template - bool is_quad_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::face_descriptor face_descriptor; - for(face_descriptor fd : faces(g)){ - if(! is_quad(halfedge(fd,g),g)){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a tetrahedron. - */ -template -bool is_tetrahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - - halfedge_descriptor h1 = hd; - if(is_border(h1,g)) return false; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor h2 = next(h1,g); - halfedge_descriptor h3 = next(h2,g); - halfedge_descriptor h4 = next(opposite(h1,g),g ); - halfedge_descriptor h5 = next(opposite(h2,g),g ); - halfedge_descriptor h6 = next(opposite(h3,g),g ); - // check halfedge combinatorics. - // at least three edges at vertices 1, 2, 3. - if ( h4 == opposite(h3,g) ) return false; - if ( h5 == opposite(h1,g) ) return false; - if ( h6 == opposite(h2,g) ) return false; - // exact three edges at vertices 1, 2, 3. - if ( next(opposite(h4,g),g) != opposite(h3,g) ) return false; - if ( next(opposite(h5,g),g) != opposite(h1,g) ) return false; - if ( next(opposite(h6,g),g) != opposite(h2,g) ) return false; - // three edges at v4. - if ( opposite(next(h4,g),g) != h5 ) return false; - if ( opposite(next(h5,g),g) != h6 ) return false; - if ( opposite(next(h6,g),g) != h4 ) return false; - // All facets are triangles. - if ( next(next(next(h1,g),g),g) != h1 ) return false; - if ( next(next(next(h4,g),g),g) != h4 ) return false; - if ( next(next(next(h5,g),g),g) != h5 ) return false; - if ( next(next(next(h6,g),g),g) != h6 ) return false; - // all edges are non-border edges. - if ( is_border(h1,g) ) return false; // implies h2 and h3 - if ( is_border(h4,g) ) return false; - if ( is_border(h5,g) ) return false; - if ( is_border(h6,g) ) return false; - return true; -} - namespace BGL { template @@ -410,7 +203,6 @@ bool is_valid_edge_descriptor(typename boost::graph_traits::edge_desc // there is no null_edge() in the Graph concepts - // Pointer integrity. const halfedge_descriptor h = halfedge(e, g); valid = (h != boost::graph_traits::null_halfedge()); @@ -773,6 +565,234 @@ bool is_valid_polygon_mesh(const Mesh& g, bool verb = false) return true; } + /*! + \ingroup PkgBGLHelperFct + returns `true` if there are no border edges. + */ +template +bool is_closed(const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + for(halfedge_descriptor hd : halfedges(g)){ + if(is_border(hd,g)){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if the target of `hd` has exactly two incident edges. + */ +template +bool is_bivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == opposite(next(opposite(next(hd,g),g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all vertices have exactly two incident edges. + */ +template +bool is_bivalent_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + for(vertex_descriptor vd : vertices(g)){ + halfedge_descriptor hd = halfedge(vd,g); + if((hd == boost::graph_traits::null_halfedge()) || + (! is_bivalent(hd,g))){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if the target of `hd` has exactly three incident edges. + */ +template +bool is_trivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == opposite(next(opposite(next(opposite(next(hd,g),g),g),g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all + vertices have exactly three incident edges. + */ +template +bool is_trivalent_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + for(vertex_descriptor vd : vertices(g)){ + halfedge_descriptor hd = halfedge(vd,g); + if((hd == boost::graph_traits::null_halfedge()) || + (! is_trivalent(halfedge(hd,g),g))){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the connected component denoted by `hd` is a triangle. + \pre `g` must be valid. + */ +template +bool is_isolated_triangle(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + halfedge_descriptor beg = hd; + if(is_border(hd,g)) return false; + for(int i=0; i<3;i++){ + if(! is_border(opposite(hd,g),g)) return false; + hd = next(hd,g); + } + return hd == beg; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the face denoted by `hd` is a triangle, that is it has three incident halfedges. + */ +template +bool is_triangle(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == next(next(next(hd,g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all faces are triangles. + */ +template +bool is_triangle_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::face_descriptor face_descriptor; + for(face_descriptor fd : faces(g)){ + if(! is_triangle(halfedge(fd,g),g)){ + return false; + } + } + return true; +} + +/*! + \ingroup PkgBGLHelperFct + returns `true` iff the connected component denoted by `hd` is a quadrilateral. + */ +template +bool is_isolated_quad(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + halfedge_descriptor beg = hd; + if(is_border(hd,g)) return false; + for(int i=0; i<4;i++){ + if(! is_border(opposite(hd,g),g)) return false; + hd = next(hd,g); + } + return hd == beg; +} + + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the face denoted by `hd` is a quad, that is it has four incident halfedges. + */ +template +bool is_quad(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == next(next(next(next(hd,g),g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all faces are quadrilaterals. + */ +template +bool is_quad_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::face_descriptor face_descriptor; + + for(face_descriptor fd : faces(g)){ + if(! is_quad(halfedge(fd,g),g)){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the connected component denoted by `hd` is a tetrahedron. + */ +template +bool is_tetrahedron(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + halfedge_descriptor h1 = hd; + if(is_border(h1,g)) return false; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + halfedge_descriptor h2 = next(h1,g); + halfedge_descriptor h3 = next(h2,g); + halfedge_descriptor h4 = next(opposite(h1,g),g ); + halfedge_descriptor h5 = next(opposite(h2,g),g ); + halfedge_descriptor h6 = next(opposite(h3,g),g ); + // check halfedge combinatorics. + // at least three edges at vertices 1, 2, 3. + if ( h4 == opposite(h3,g) ) return false; + if ( h5 == opposite(h1,g) ) return false; + if ( h6 == opposite(h2,g) ) return false; + // exact three edges at vertices 1, 2, 3. + if ( next(opposite(h4,g),g) != opposite(h3,g) ) return false; + if ( next(opposite(h5,g),g) != opposite(h1,g) ) return false; + if ( next(opposite(h6,g),g) != opposite(h2,g) ) return false; + // three edges at v4. + if ( opposite(next(h4,g),g) != h5 ) return false; + if ( opposite(next(h5,g),g) != h6 ) return false; + if ( opposite(next(h6,g),g) != h4 ) return false; + // All facets are triangles. + if ( next(next(next(h1,g),g),g) != h1 ) return false; + if ( next(next(next(h4,g),g),g) != h4 ) return false; + if ( next(next(next(h5,g),g),g) != h5 ) return false; + if ( next(next(next(h6,g),g),g) != h6 ) return false; + // all edges are non-border edges. + if ( is_border(h1,g) ) return false; // implies h2 and h3 + if ( is_border(h4,g) ) return false; + if ( is_border(h5,g) ) return false; + if ( is_border(h6,g) ) return false; + return true; +} + /*! \ingroup PkgBGLHelperFct returns `true` iff the connected component denoted by `hd` is a hexahedron. From a61e6bc346dd3cc6611a244240f6764d48f807d6 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Tue, 4 Oct 2022 18:56:34 +0200 Subject: [PATCH 118/248] Apply review from Jane Co-authored-by: Jane Tournois --- Installation/CHANGES.md | 2 +- Mesh_2/doc/Mesh_2/Mesh_2.txt | 2 +- Mesh_3/doc/Mesh_3/Mesh_3.txt | 2 +- Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt | 4 ++-- STL_Extension/doc/STL_Extension/STL_Extension.txt | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 0be9b59545c..c010916d246 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -4,7 +4,7 @@ Release History [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- -Release date: June 2022 +Release date: June 2023 ### [Combinatorial Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgCombinatorialMaps) [Generalized Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgGeneralizedMaps) [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex) diff --git a/Mesh_2/doc/Mesh_2/Mesh_2.txt b/Mesh_2/doc/Mesh_2/Mesh_2.txt index 367818dc173..7d31bb1fc85 100644 --- a/Mesh_2/doc/Mesh_2/Mesh_2.txt +++ b/Mesh_2/doc/Mesh_2/Mesh_2.txt @@ -278,7 +278,7 @@ After Delaunay refinement, angles are in the interval [28.5; 121.9] degrees. After 10 iterations of Lloyd optimization, they are in [29.1; 110.8]. 100 iterations take them to [29.3; 109.9]. \cgalFigureEnd -Since \cgal 5.6, `lloyd_optimize_mesh_2()` uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. +As of \cgal 5.6, `lloyd_optimize_mesh_2()` uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. \subsection Mesh_2Examples Examples diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index bc93196a563..29ba32bd500 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -301,7 +301,7 @@ of the `C3T3`. They can be removed using the function `remove_isolated_vertices( \section Mesh_3_section_interface Interface -Since \cgal 5.6, this packages uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. +As of \cgal 5.6, this package uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. \subsection Mesh_3TheGlobalFunctions The Global Functions diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 42fa393d4e4..02cccf39ed0 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -59,7 +59,7 @@ namespace CGAL { * \cgalParamNBegin{sliver_bound} * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. * The exudation process considers in turn all the mesh cells that have a smallest dihedral - * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * angle less than `sliver_bound` and tries to make them disappear by weighting their vertices. * The optimization process stops when every cell in the mesh achieves this quality. The * default value is 0 and means that there is no targeted bound: the exuder then runs as long * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt index 715b59b132e..701fa394146 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt @@ -76,7 +76,7 @@ of the manual of 3D periodic triangulations). Thanks to this construction, the meshing process can be exclusively conducted within the canonical cube. The mesh can then be created using the \ref PkgMesh3 package of \cgal. -As this package originally aims to mesh non-periodic domains of \f$ \mathbb R^3\f$, an interfacez +As this package originally aims to mesh non-periodic domains of \f$ \mathbb R^3\f$, an interface is necessary between the packages \ref PkgMesh3 and \ref PkgPeriodic3Triangulation3. This package provides this interface. @@ -250,7 +250,7 @@ for further information. \section Periodic_3_mesh_3_section_interface Interface -Since \cgal 5.6, this packages uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. +As of \cgal 5.6, this package uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. \subsection Periodic_3_mesh_3TheGlobalFunctions The Global Functions diff --git a/STL_Extension/doc/STL_Extension/STL_Extension.txt b/STL_Extension/doc/STL_Extension/STL_Extension.txt index d791c3ade49..947faab8ba2 100644 --- a/STL_Extension/doc/STL_Extension/STL_Extension.txt +++ b/STL_Extension/doc/STL_Extension/STL_Extension.txt @@ -409,7 +409,7 @@ Mesh_criteria criteria(edge_size = 8, cell_radius_edge_ratio = 3, cell_size = 10); \endcode -should now be written as follow: +should now be written as follows: \code Mesh_criteria criteria(edge_size(8). facet_angle(25). @@ -422,6 +422,6 @@ Mesh_criteria criteria(edge_size(8). Note that we have tried to preserve the backward compatibility by allowing previous API to remain valid. However, if new parameters are introduced for those functions, there is no guarantee that they will be ported to the old API. So we strongly encourage users to -upgrade to the new API. Additionally, passing parameters without names is deprecated or +upgrade to the new API. Additionally, passing parameters without names is deprecated and even removed for some functions. */ \ No newline at end of file From 8c7a1d756f0dddd1880e7c4dd2b61776b5fc5f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 4 Oct 2022 19:24:30 +0200 Subject: [PATCH 119/248] use backticks instead of \c --- .../Concepts/MeshDomainWithFeatures_3.h | 20 +-- .../include/CGAL/Compact_mesh_cell_base_3.h | 26 ++-- .../CGAL/Labeled_image_mesh_domain_3.h | 2 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 32 ++--- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 130 +++++++++--------- ...plus_weights_to_labeled_function_wrapper.h | 4 +- .../Image_to_labeled_function_wrapper.h | 4 +- Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h | 18 +-- .../CGAL/Mesh_3/Mesh_global_optimizer.h | 12 +- .../include/CGAL/Mesh_3/Mesh_sizing_field.h | 14 +- .../CGAL/Mesh_3/Mesh_surface_cell_base_3.h | 26 ++-- Mesh_3/include/CGAL/Mesh_3/Mesher_level.h | 36 ++--- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 80 +++++------ Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h | 10 +- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 32 ++--- Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 12 +- Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h | 20 +-- .../CGAL/Mesh_3/Triangulation_helpers.h | 8 +- .../CGAL/Mesh_3/Triangulation_sizing_field.h | 12 +- .../include/CGAL/Mesh_3/vertex_perturbation.h | 34 ++--- Mesh_3/include/CGAL/Mesh_cell_criteria_3.h | 4 +- .../CGAL/Mesh_constant_domain_field_3.h | 2 +- .../Mesh_domain_with_polyline_features_3.h | 18 +-- Mesh_3/include/CGAL/Mesh_facet_criteria_3.h | 4 +- .../include/CGAL/Polyhedral_mesh_domain_3.h | 10 +- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 6 +- .../Protect_edges_sizing_field.h | 78 +++++------ .../include/CGAL/make_periodic_3_mesh_3.h | 2 +- .../include/CGAL/refine_periodic_3_mesh_3.h | 6 +- 30 files changed, 332 insertions(+), 332 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h index 7b596fc79dc..279762200af 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h @@ -89,13 +89,13 @@ const Point_3& p, const Curve_index& ci, FT d) const; /// @{ /*! -Returns the length of the curve segment from \c p to \c q, on the curve -with index \c curve_index. +Returns the length of the curve segment from `p` to `q`, on the curve +with index `curve_index`. -If the curve with index \c curve_index is a loop, the +If the curve with index `curve_index` is a loop, the orientation identifies which portion of the loop corresponds to the curve -segment, otherwise \c orientation must be compatible with the orientation -of \c p and \c q on the curve. +segment, otherwise `orientation` must be compatible with the orientation +of `p` and `q` on the curve. */ FT curve_segment_length(const Point_3& p, const Point_3& q, const Curve_index& curve_index, @@ -121,14 +121,14 @@ CGAL::Sign distance_sign(const Point_3& p, const Point_3& q, /*! Returns the length of curve with index -\c curve_index +`curve_index` */ FT curve_length(const Curve_index& curve_index) const; /*! -Returns `true` if the portion of the curve of index \c index, -between the points \c c1 and \c c2, is covered by the spheres of -centers \c c1 and \c c2 and squared radii \c sq_r1 and \c sq_r2 -respectively. The points \c c1 and \c c2 are assumed to lie on the curve. +Returns `true` if the portion of the curve of index `index`, +between the points `c1` and `c2`, is covered by the spheres of +centers `c1` and `c2` and squared radii `sq_r1` and `sq_r2` +respectively. The points `c1` and `c2` are assumed to lie on the curve. */ bool is_curve_segment_covered(const Curve_index& index, CGAL::Orientation orientation, diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index 0283d6268d8..d0f167ac378 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -126,21 +126,21 @@ public: } #endif - /// Marks \c facet as visited + /// Marks `facet` as visited void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet <4); bits_ |= char(1 << facet); } - /// Marks \c facet as not visited + /// Marks `facet` as not visited void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); bits_ = char(bits_ & (15 & ~(1 << facet))); } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -197,7 +197,7 @@ public: ++this->m_erase_counter; } - /// Marks \c facet as visited + /// Marks `facet` as visited void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -209,7 +209,7 @@ public: } } - /// Marks \c facet as not visited + /// Marks `facet` as not visited void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -222,7 +222,7 @@ public: } } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -530,42 +530,42 @@ public: bool is_cache_valid() const { return sliver_cache_validity_; } void reset_cache_validity() const { sliver_cache_validity_ = false; } - /// Set surface index of \c facet to \c index + /// Set surface index of `facet` to `index` void set_surface_patch_index(const int facet, const Surface_patch_index& index) { CGAL_precondition(facet>=0 && facet<4); surface_index_table_[facet] = index; } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet` Surface_patch_index surface_patch_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_index_table_[facet]; } - /// Sets surface center of \c facet to \c point + /// Sets surface center of `facet` to `point` void set_facet_surface_center(const int facet, const Point_3& point) { CGAL_precondition(facet>=0 && facet<4); surface_center_table_[facet] = point; } - /// Returns surface center of \c facet + /// Returns surface center of `facet` Point_3 get_facet_surface_center(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_center_table_[facet]; } - /// Sets surface center index of \c facet to \c index + /// Sets surface center index of `facet` to `index` void set_facet_surface_center_index(const int facet, const Index& index) { CGAL_precondition(facet>=0 && facet<4); surface_center_index_table_[facet] = index; } - /// Returns surface center of \c facet + /// Returns surface center of `facet` Index get_facet_surface_center_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -588,7 +588,7 @@ public: void set_surface_index(const int facet, const Surface_index& index) { set_surface_patch_index(facet,index); } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet` Surface_index surface_index(const int facet) const { return surface_patch_index(facet); } #endif // CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 08a6ded1f20..bc2ff03ff73 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -97,7 +97,7 @@ public: using Base::bbox; private: - /// Returns a box enclosing image \c im + /// Returns a box enclosing image `im` Bbox_3 compute_bounding_box(const Image& im) const { return Bbox_3(-im.vx()+im.tx(), diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 5ef39ba36be..f1898ef41a9 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -72,7 +72,7 @@ namespace internal { template void operator()(T*) const { } }; - // Returns a box enclosing image \c im + // Returns a box enclosing image `im` inline Bbox_3 compute_bounding_box(const Image_3& im) { return Bbox_3(-1+im.tx(),-1+im.ty(),-1+im.tz(), @@ -151,7 +151,7 @@ protected: typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; typedef typename Geom_traits::FT FT; typedef std::shared_ptr CGAL_Random_share_ptr_t; - // Returns squared error bound from \c bbox and \c error + // Returns squared error bound from `bbox` and `error` FT squared_error_bound(const Iso_cuboid_3& bbox, const FT& error) const { typename Geom_traits::Compute_squared_distance_3 squared_distance = @@ -925,10 +925,10 @@ public: Is_in_domain is_in_domain_object() const { return Is_in_domain(*this); } /* - * Returns true is the element `type` intersect properly any of the + * Returns `true` if the element `type` intersect properly any of the * surface patches describing the either the domain boundary or some * subdomain boundary. - * `Type is either `Segment_3`, `Ray_3` or `Line_3`. + * `Type` is either `Segment_3`, `Ray_3` or `Line_3`. * Parameter index is set to the index of the intersected surface patch * if `true` is returned and to the default `Surface_patch_index` * value otherwise. @@ -954,8 +954,8 @@ public: } private: - // Returns true if points \c a & \c b do not belong to the same subdomain - // \c index is set to the surface index of subdomains f(a), f(b) + // Returns true if points `a` and `b` do not belong to the same subdomain + // `index` is set to the surface index of subdomains f(a), f(b) Surface_patch operator()(const Point_3& a, const Point_3& b) const { // If f(a) != f(b), then [a,b] intersects some surface. Here we consider @@ -975,7 +975,7 @@ public: } /* - * Clips \c query to a segment \c s, and call operator()(s) + * Clips `query` to a segment `s`, and call `operator()(s)` */ template Surface_patch clip_to_segment(const Query& query) const @@ -1033,9 +1033,9 @@ public: private: /* * Returns a point in the intersection of [a,b] with the surface - * \c a must be the source point, and \c b the out point. It's important + * `a` must be the source point, and `b` the out point. It's important * because it drives bisection cuts. - * Indeed, the returned point is the first intersection from \c [a,b] + * Indeed, the returned point is the first intersection from `[a,b]` * with a subdomain surface. */ Intersection operator()(const Point_3& a, const Point_3& b) const @@ -1104,7 +1104,7 @@ public: } } - // Clips \c query to a segment \c s, and call operator()(s) + // Clips `query` to a segment `s`, and call `operator()(s)` template Intersection clip_to_segment(const Query& query) const { @@ -1128,28 +1128,28 @@ public: /* * Returns the index to be stored in a vertex lying on the surface identified - * by \c index. + * by `index`. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } /* * Returns the index to be stored in a vertex lying in the subdomain - * identified by \c index. + * identified by `index`. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } /* - * Returns the \c Surface_patch_index of the surface patch - * where lies a vertex with dimension 2 and index \c index. + * Returns the `Surface_patch_index` of the surface patch + * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } /* * Returns the index of the subdomain containing a vertex - * with dimension 3 and index \c index. + * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } @@ -1171,7 +1171,7 @@ public: // ----------------------------------- protected: - // Returns Surface_patch_index from \c i and \c j + // Returns Surface_patch_index from `i` and `j` Surface_patch_index make_surface_index(const Subdomain_index i, const Subdomain_index j) const { diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 85683e9fbd6..2d233bd4a98 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -713,18 +713,18 @@ public: { } /** - * @brief tries to move \c old_vertex to \c new_position in the mesh + * @brief tries to move `old_vertex` to `new_position` in the mesh * @param old_vertex the old vertex * @param move the translation from the old position to the new - * @param new_position the new position of \c old_vertex + * @param new_position the new position of `old_vertex` * @param criterion the criterion which will be used to verify the new * position is ok. c3t3 minimal value of new criterion shall not decrease. * @param modified_vertices contains the vertices incident to cells which * may have been impacted by relocation * @return a pair which contains: - * - a bool which is \c true if the move has been done. + * - a bool which is `true` if the move has been done. * - a Vertex_handle which is always filled and may be the new vertex (if - * the move is a success), or the vertex which lies at \c v's position in + * the move is a success), or the vertex which lies at `v`'s position in * the updated c3t3. */ template @@ -736,7 +736,7 @@ public: OutputIterator modified_vertices, bool *could_lock_zone = nullptr); - /** @brief tries to move \c old_vertex to \c new_position in the mesh + /** @brief tries to move `old_vertex` to `new_position` in the mesh * * Same as update_mesh, but with the precondition that * Th().no_topological_change(tr_, old_vertex, new_position, @@ -751,7 +751,7 @@ public: bool *could_lock_zone = nullptr); /** - * Updates mesh moving vertex \c old_vertex to \c new_position. Returns the + * Updates mesh moving vertex `old_vertex` to `new_position`. Returns the * new vertex of the triangulation. * * Insert into modified vertices the vertices which are impacted by to move. @@ -763,7 +763,7 @@ public: bool fill_modified_vertices = true); /** - * Updates mesh moving vertex \c old_vertex to \c new_position. Returns the + * Updates mesh moving vertex `old_vertex` to `new_position`. Returns the * new vertex of the triangulation. */ Vertex_handle update_mesh(const Vertex_handle& old_vertex, @@ -800,14 +800,14 @@ public: #endif /** - * @brief Project \c p on surface, using incident facets of \c v + * @brief Project `p` on surface, using incident facets of `v` * @param v The vertex from which p was moved * @param p The point to project * @param index The index of the surface patch where v lies, if known. * @return the projected point * - * \c p is projected as follows using normal of least square fitting plane - * on \c v incident surface points. If \c index is specified, only + * `p` is projected as follows using normal of least square fitting plane + * on `v` incident surface points. If `index` is specified, only * surface points that are on the same surface patch are used to compute * the fitting plane. */ @@ -816,16 +816,16 @@ public: Surface_patch_index index = Surface_patch_index()) const; /** - * Returns the minimum value for criterion for incident cells of \c vh + * Returns the minimum value for criterion for incident cells of `vh` */ template FT min_incident_value(const Vertex_handle& vh, const SliverCriterion& criterion) const; /** - * Moves \c old_vertex to \c new_position - * Stores the cells which have to be updated in \c outdated_cells - * Updates the Vertex_handle old_vertex to its new value in \c moving_vertices + * Moves `old_vertex` to `new_position` + * Stores the cells which have to be updated in `outdated_cells` + * Updates the Vertex_handle old_vertex to its new value in `moving_vertices` * The second one (with the could_lock_zone param) is for the parallel version */ Vertex_handle move_point(const Vertex_handle& old_vertex, @@ -840,11 +840,11 @@ public: bool *could_lock_zone) const; /** - * Try to lock ALL the incident cells and return in \c cells the ones - * whose \c filter says "true". + * Try to lock ALL the incident cells and return in `cells` the ones + * whose `filter` says `true`. * Return value: - * - false: everything is unlocked and \c cells is empty - * - true: ALL incident cells are locked and \c cells is filled + * - false: everything is unlocked and `cells` is empty + * - true: ALL incident cells are locked and `cells` is filled */ template bool @@ -853,10 +853,10 @@ public: const Filter &filter) const; /** - * Try to lock ALL the incident cells and return in \c cells the slivers + * Try to lock ALL the incident cells and return in `cells` the slivers * Return value: - * - false: everything is unlocked and \c cells is empty - * - true: incident cells are locked and \c cells contains all slivers + * - false: everything is unlocked and `cells` is empty + * - true: incident cells are locked and `cells` contains all slivers */ template bool @@ -873,8 +873,8 @@ public: Cell_vector &slivers) const; /** - * Outputs to out the sliver (wrt \c criterion and \c sliver_bound) incident - * to \c v + * Outputs to out the sliver (wrt `criterion` and `sliver_bound`) incident + * to `v` */ template OutputIterator @@ -892,7 +892,7 @@ public: OutputIterator out) const; /** - * Returns the sliver (wrt \c criterion and \c sliver_bound) incident to \c v + * Returns the sliver (wrt `criterion` and `sliver_bound`) incident to `v` */ template Cell_vector @@ -918,7 +918,7 @@ public: /** - * Returns the number of slivers incident to \c v + * Returns the number of slivers incident to `v` */ template std::size_t @@ -933,8 +933,8 @@ public: const FT& sliver_bound) const; /** - * Returns the minimum criterion value of cells contained in \c cells - * Precondition: cells of \c cells must not be infinite. + * Returns the minimum criterion value of cells contained in `cells` + * Precondition: cells of `cells` must not be infinite. * Warning: Here we don't check if cells are in c3t3 */ template @@ -1093,10 +1093,10 @@ private: , c3t3_(c3t3) {} /** - * @brief Updates facet \c facet in c3t3 + * @brief Updates facet `facet` in c3t3 * @param facet the facet to update - * @param update if set to \c false, checking only is done - * @return true if \c facet is in c3t3 + * @param update if set to `false`, checking only is done + * @return true if `facet` is in c3t3 */ Surface_patch operator()(const Facet& facet, const bool update = true) const { @@ -1104,15 +1104,15 @@ private: } /** - * @brief Updates facet \c facet in c3t3 + * @brief Updates facet `facet` in c3t3 * @param facet the facet to update - * @param update_c3t3 if set to \c false, checking only is done - * @param update_surface_center if set to \c true, the facet surface + * @param update_c3t3 if set to `false`, checking only is done + * @param update_surface_center if set to `true`, the facet surface * center is updated. - * @return true if \c facet is in c3t3 + * @return true if `facet` is in c3t3 * - * By default, \c update_c3t3 is \c true, and \c update_surface_center - * is equal to \c update_c3t3. + * By default, `update_c3t3` is `true`, and `update_surface_center` + * is equal to `update_c3t3`. */ Surface_patch operator()(const Facet& facet, const bool update_c3t3, @@ -1163,10 +1163,10 @@ private: } /** - * @brief Updates cell \c ch in c3t3 + * @brief Updates cell `ch` in c3t3 * @param ch the cell to update - * @param update if set to \c false, checking only is done - * @return true if \c ch is in c3t3 + * @param update if set to `false`, checking only is done + * @return true if `ch` is in c3t3 */ Subdomain operator()(const Cell_handle& ch, const bool update = true) const { @@ -1557,7 +1557,7 @@ private: // Private methods // ----------------------------------- /** - * Returns the minimum criterion value of c3t3 cells contained in \c cells. + * Returns the minimum criterion value of c3t3 cells contained in `cells`. */ template FT min_sliver_in_c3t3_value(const Cell_vector& cells, @@ -1587,7 +1587,7 @@ private: } /** - * Removes objects of [begin,end[ range from \c c3t3_ + * Removes objects of [begin,end[ range from `c3t3_` */ template void remove_from_c3t3(ForwardIterator begin, ForwardIterator end) const @@ -1597,7 +1597,7 @@ private: } /** - * Remove cells and facets of \c cells from c3t3 + * Remove cells and facets of `cells` from c3t3 */ template < typename ForwardIterator > void remove_cells_and_facets_from_c3t3(ForwardIterator cells_begin, @@ -1609,7 +1609,7 @@ private: } /** - * Insert into \c out the vertices of range [cells_begin,cells_end[ + * Insert into `out` the vertices of range [cells_begin,cells_end[ */ template void fill_modified_vertices(InputIterator cells_begin, @@ -1689,15 +1689,15 @@ private: Surface_patch_index index = Surface_patch_index()) const; /** - * @brief Project \c p on surface, using incident facets of \c v + * @brief Project `p` on surface, using incident facets of `v` * @param v The vertex from which p was moved * @param p The point to project * @param index The index of the surface patch where v lies, if known. * @return a `boost::optional` with the projected point if the projection * was possible, or `boost::none`. * - * \c p is projected using the normal of least square fitting plane - * on \c v incident surface points. If \c index is specified, only + * `p` is projected using the normal of least square fitting plane + * on `v` incident surface points. If `index` is specified, only * surface points that are on the same surface patch are used to compute * the fitting plane. */ @@ -1707,8 +1707,8 @@ private: Surface_patch_index index = Surface_patch_index()) const; /** - * @brief Returns the projection of \c p, using direction of - * \c projection_vector + * @brief Returns the projection of `p`, using direction of + * `projection_vector` */ Bare_point project_on_surface_aux(const Bare_point& p, @@ -1716,8 +1716,8 @@ private: const Vector_3& projection_vector) const; /** - * Reverts the move from \c old_point to \c new_vertex. Returns the inserted - * vertex located at \c old_point + * Reverts the move from `old_point` to `new_vertex`. Returns the inserted + * vertex located at `old_point` * and an output iterator on outdated cells */ template @@ -1737,7 +1737,7 @@ private: } /** - * Returns the boundary of restricted facets of \c facets, + * Returns the boundary of restricted facets of `facets`, and the list of vertices of all restricted facets, which should not contain the vertex that is moving */ @@ -1747,7 +1747,7 @@ private: Vertex_set& incident_surface_vertices) const; /** - * Returns the boundary of restricted facets of \c cells + * Returns the boundary of restricted facets of `cells` and the list of vertices of all restricted facets. */ Facet_boundary @@ -1761,13 +1761,13 @@ private: } /** - * Returns false if there is a vertex belonging to one facet of \c facets + * Returns false if there is a vertex belonging to one facet of `facets` * which has not his dimension < 3 */ bool check_no_inside_vertices(const Facet_vector& facets) const; /** - * Returns the impacted cells when moving \c vertex to \c conflict_point + * Returns the impacted cells when moving `vertex` to `conflict_point` */ template OutputIterator @@ -1806,7 +1806,7 @@ private: DeletedCellsOutputIterator deleted_cells) const; /** - * Updates \c boundary wrt \c edge: if edge is already in boundary we remove + * Updates `boundary` wrt `edge`: if edge is already in boundary we remove * it, else we add it. */ void update_boundary(Facet_boundary& boundary, @@ -1832,7 +1832,7 @@ private: } /** - * Returns the facets of \c cells (returns each facet only once i.e. use + * Returns the facets of `cells` (returns each facet only once i.e. use * canonical facet) */ Facet_vector get_facets(const Cell_vector& cells) const @@ -1901,7 +1901,7 @@ private: } #else /** - * Returns the facets of \c cells (returns each facet only once i.e. use + * Returns the facets of `cells` (returns each facet only once i.e. use * canonical facet) */ template @@ -1992,7 +1992,7 @@ private: /** - * Returns the facets of \c cells (returns each facet only once i.e. use + * Returns the facets of `cells` (returns each facet only once i.e. use * canonical facet) */ template @@ -2061,7 +2061,7 @@ private: } /** - * Restore mesh for cells and facets of \c cells, using domain_ + * Restore mesh for cells and facets of `cells`, using domain_ */ template void restore_mesh(ForwardIterator first_cell, ForwardIterator last_cell) @@ -2071,7 +2071,7 @@ private: } /** - * Restore mesh for cells of \c cells and facets of \c facets, using domain_ + * Restore mesh for cells of `cells` and facets of `facets`, using domain_ */ template void restore_mesh(CellForwardIterator first_cell, @@ -2086,8 +2086,8 @@ private: } /** - * Returns true if facets of \c facets have the same boundary as - * \c old_boundary, and if the list of vertices has not changed. + * Returns true if facets of `facets` have the same boundary as + * `old_boundary`, and if the list of vertices has not changed. */ bool check_surface_mesh(const Vertex_handle& moving_vertex, const Facet_vector& facets, @@ -2114,7 +2114,7 @@ private: } /** - * Orders handles \c h1, \c h2 & \c h3 + * Orders handles `h1`, `h2` & `h3` */ template void order_handles(Handle& h1, Handle& h2, Handle& h3) const @@ -3350,8 +3350,8 @@ move_point_no_topo_change(const Vertex_handle& old_vertex, /** - * @brief Returns the projection of \c p, using direction of - * \c projection_vector + * @brief Returns the projection of `p`, using direction of + * `projection_vector` */ template typename C3T3_helpers::Bare_point diff --git a/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h b/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h index e1d54932eb6..a11d559cd9b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h +++ b/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h @@ -107,9 +107,9 @@ public: ~Image_plus_weights_to_labeled_function_wrapper() {} /** - * Returns an int corresponding to the label at point \c p + * Returns an int corresponding to the label at point `p` * @param p the input point - * @return the label at point \c p + * @return the label at point `p` */ template return_type operator()(const Point_3& p) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h b/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h index 0ba137121ca..68e80886cf2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h +++ b/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h @@ -72,9 +72,9 @@ public: ~Image_to_labeled_function_wrapper() {} /** - * Returns an int corresponding to the label at point \c p + * Returns an int corresponding to the label at point `p` * @param p the input point - * @return the label at point \c p + * @return the label at point `p` */ template return_type operator()(const Point_3& p) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h index d4a638c78c6..15bdd70d297 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h +++ b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h @@ -68,7 +68,7 @@ public: typedef SizingField Sizing_field; /** - * @brief Return the move to apply on \c v according to Lloyd optimization + * @brief Return the move to apply on `v` according to Lloyd optimization * function. */ Vector_3 operator()(const Vertex_handle& v, @@ -162,7 +162,7 @@ private: /** - * Return the move for the inside vertex \c v. + * Return the move for the inside vertex `v`. */ Vector_3 lloyd_move_inside_domain(const Vertex_handle& v, const Cell_vector& incident_cells, @@ -210,7 +210,7 @@ private: } /** - * Return the move for the on-boundary vertex \c v. + * Return the move for the on-boundary vertex `v`. */ Vector_3 lloyd_move_on_boundary(const Vertex_handle& v, const C3T3& c3t3, @@ -254,7 +254,7 @@ private: /** * Returns a vector containing the surface delaunay ball centers of the surface - * facets that are incident to vertex \c v. + * facets that are incident to vertex `v`. */ std::vector extract_lloyd_boundary_points(const Vertex_handle& v, const C3T3& c3t3) const @@ -298,7 +298,7 @@ private: } /** - * Return the move from \c v to the centroid of the segment [a,b]. + * Return the move from `v` to the centroid of the segment [a,b]. */ Vector_3 centroid_segment_move(const Vertex_handle& v, const Bare_point& a, @@ -320,7 +320,7 @@ private: } /** - * Return the move from \c v to the centroid of triangle [a,b,c]. + * Return the move from `v` to the centroid of triangle [a,b,c]. */ Vector_3 centroid_triangle_move(const Vertex_handle& v, const Bare_point& a, @@ -397,7 +397,7 @@ private: } /** - * Return the move from \c v to the centroid of polygon[first,last]. + * Return the move from `v` to the centroid of polygon[first,last]. * The polygon has to be convex. */ template @@ -523,8 +523,8 @@ private: } /** - * Turn around the edge \c edge and add the values computed from tets made by - * `v` and the circumcenters of cells incident to \c edge. + * Turn around the edge `edge` and add the values computed from tets made by + * `v` and the circumcenters of cells incident to `edge`. * * Note that this function abundantly uses dual() calls and using a cell base * which stores the circumcenter thus improves its efficiency. diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h index adf53d159c5..55f02872963 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h @@ -313,19 +313,19 @@ public: private: /** - * Returns moves for vertices of set \c moving_vertices + * Returns moves for vertices of set `moving_vertices` */ Moves_vector compute_moves(Moving_vertices_set& moving_vertices); /** - * Returns the move for vertex \c v + * Returns the move for vertex `v` * \warning This function should be called only on moving vertices * even for frozen vertices, it could return a non-zero vector */ Vector_3 compute_move(const Vertex_handle& v); /** - * Updates mesh using moves of \c moves vector. Updates moving_vertices with + * Updates mesh using moves of `moves` vector. Updates moving_vertices with * the new set of moving vertices after the move. */ void update_mesh(const Moves_vector& moves, @@ -343,17 +343,17 @@ private: bool check_convergence() const; /** - * Returns the average circumradius length of cells incident to \c v + * Returns the average circumradius length of cells incident to `v` */ FT average_circumradius_length(const Vertex_handle& v) const; /** - * Returns the minimum cicumradius length of cells incident to \c v + * Returns the minimum cicumradius length of cells incident to `v` */ FT min_circumradius_sq_length(const Vertex_handle& v, const Cell_vector& incident_cells) const; /** - * Returns the squared circumradius length of cell \c cell + * Returns the squared circumradius length of cell `cell` */ FT sq_circumradius_length(const Cell_handle& cell, const Vertex_handle& v) const; diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h index 84c84128618..406ec176778 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h @@ -107,42 +107,42 @@ public: Mesh_sizing_field(Tr& tr); /** - * Fill sizing field, using size associated to point in \c value_map + * Fill sizing field, using size associated to point in `value_map` */ void fill(const std::map& value_map); /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Bare_point& p) const { return this->operator()(p, this->get_last_cell()); } /** - * Returns size at point \c p, using \c v to accelerate \c p location + * Returns size at point `p`, using `v` to accelerate `p` location * in triangulation */ FT operator()(const Bare_point& p, const Vertex_handle& v) const { return this->operator()(p, v->cell()); } /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Bare_point& p, const Cell_handle& c) const; /** - * Returns size at point \c p. Assumes that p is the centroid of c. + * Returns size at point `p`. Assumes that p is the centroid of c. */ FT operator()(const Bare_point& p, const std::pair& c) const; private: /** - * Returns size at point \c p, by interpolation into tetrahedron. + * Returns size at point `p`, by interpolation into tetrahedron. */ FT interpolate_on_cell_vertices(const Bare_point& p, const Cell_handle& cell) const; /** - * Returns size at point \c p, by interpolation into facet (\c cell is assumed + * Returns size at point `p`, by interpolation into facet (`cell` is assumed * to be an infinite cell). */ FT interpolate_on_facet_vertices(const Bare_point& p, diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h index f0db722f898..d261af5df77 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h @@ -55,21 +55,21 @@ public: Mesh_surface_cell_base_3_base() : bits_(0) {} - /// Marks \c facet as visited + /// Marks `facet` as visited void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet <4); bits_ |= (1 << facet); } - /// Marks \c facet as not visited + /// Marks `facet` as not visited void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); bits_ &= (15 & ~(1 << facet)); } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -92,7 +92,7 @@ public: bits_ = 0; } - /// Marks \c facet as visited + /// Marks `facet` as visited void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -103,7 +103,7 @@ public: } } - /// Marks \c facet as not visited + /// Marks `facet` as not visited void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -114,7 +114,7 @@ public: } } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -187,42 +187,42 @@ public: // Default copy constructor and assignment operator are ok - /// Set surface index of \c facet to \c index + /// Set surface index of `facet` to `index` void set_surface_patch_index(const int facet, const Surface_patch_index& index) { CGAL_precondition(facet>=0 && facet<4); surface_index_table_[facet] = index; } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet` Surface_patch_index surface_patch_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_index_table_[facet]; } - /// Sets surface center of \c facet to \c point + /// Sets surface center of `facet` to `point` void set_facet_surface_center(const int facet, const Point& point) { CGAL_precondition(facet>=0 && facet<4); surface_center_table_[facet] = point; } - /// Returns surface center of \c facet + /// Returns surface center of `facet` Point get_facet_surface_center(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_center_table_[facet]; } - /// Sets surface center index of \c facet to \c index + /// Sets surface center index of `facet` to `index` void set_facet_surface_center_index(const int facet, const Index& index) { CGAL_precondition(facet>=0 && facet<4); surface_center_index_table_[facet] = index; } - /// Returns surface center of \c facet + /// Returns surface center of `facet` Index get_facet_surface_center_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -245,7 +245,7 @@ public: void set_surface_index(const int facet, const Surface_index& index) { set_surface_patch_index(facet,index); } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet` Surface_index surface_index(const int facet) const { return surface_patch_index(facet); } #endif // CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h index fc2727797d1..51df82ede61 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h @@ -120,7 +120,7 @@ template < class Element, /**< Type of elements that this level refines. */ class Previous, /* = Null_mesher_level, */ /**< Previous level type, defaults to - \c Null_mesher_level. */ + `Null_mesher_level`. */ class Triangulation_traits /** Traits class that defines types for the triangulation. */ > @@ -198,7 +198,7 @@ public: { } - /** \name FUNCTIONS IMPLEMENTED IN THE CLASS \c Derived */ + /** \name FUNCTIONS IMPLEMENTED IN THE CLASS `Derived` */ /** Access to the triangulation */ Triangulation& triangulation() @@ -248,7 +248,7 @@ public: return derived().number_of_bad_elements_impl(); } - /** Tells if, as regards the elements of type \c Element, the refinement is + /** Tells if, as regards the elements of type `Element`, the refinement is done. */ bool no_longer_element_to_refine() { @@ -292,13 +292,13 @@ public: visitor.previous_level()); } - /** Gives the point that should be inserted to refine the element \c e */ + /** Gives the point that should be inserted to refine the element `e` */ Bare_point refinement_point(const Element& e) { return derived().refinement_point_impl(e); } - /** Actions before testing conflicts for point \c p and element \c e */ + /** Actions before testing conflicts for point `p` and element `e` */ template void before_conflicts(const Element& e, const Point& p, Mesh_visitor visitor) @@ -311,7 +311,7 @@ public: point conflicts with something, and do what is needed. The return type is made of two booleans: - the first one tells if the point can be inserted, - - in case of, the first one is \c false, the second one tells if + - in case of, the first one is `false`, the second one tells if the tested element should be reconsidered latter. */ Mesher_level_conflict_status private_test_point_conflict(const Point& p, @@ -321,8 +321,8 @@ public: } /** - * Actions before inserting the point \c p in order to refine the - * element \c e. The zone of conflicts is \c zone. + * Actions before inserting the point `p` in order to refine the + * element `e`. The zone of conflicts is `zone`. */ template void before_insertion(Element& e, const Point& p, Zone& zone, @@ -343,7 +343,7 @@ public: visitor.after_insertion(vh); } - /** Actions after testing conflicts for point \c p and element \c e + /** Actions after testing conflicts for point `p` and element `e` * if no point is inserted. */ template void after_no_insertion(const Element& e, const Point& p, Zone& zone, @@ -361,7 +361,7 @@ public: */ /** - * Tells it the algorithm is done, regarding elements of type \c Element + * Tells it the algorithm is done, regarding elements of type `Element` * or elements of previous levels. */ bool is_algorithm_done() @@ -383,7 +383,7 @@ public: /** * This function takes one element from the queue, and try to refine - * it. It returns \c true if one point has been inserted. + * it. It returns `true` if one point has been inserted. * @todo Merge with try_to_refine_element(). */ template @@ -426,7 +426,7 @@ public: /** \name STEP BY STEP FUNCTIONS */ /** - * Inserts exactly one point, if possible, and returns \c false if no + * Inserts exactly one point, if possible, and returns `false` if no * point has been inserted because the algorithm is done. */ template @@ -457,7 +457,7 @@ template < class Element, /**< Type of elements that this level refines. */ class Previous, /* = Null_mesher_level, */ /**< Previous level type, defaults to - \c Null_mesher_level. */ + `Null_mesher_level`. */ class Triangulation_traits, /** Traits class that defines types for the triangulation. */ typename Concurrency_tag> @@ -519,7 +519,7 @@ public: point conflicts with something, and do what is needed. The return type is made of two booleans: - the first one tells if the point can be inserted, - - in case of, the first one is \c false, the second one tells if + - in case of, the first one is `false`, the second one tells if the tested element should be reconsidered latter. This function is called by the superior level, if any. */ @@ -648,7 +648,7 @@ public: /** * Applies one step of the algorithm: tries to refine one element of - * previous level or one element of this level. Return \c false iff + * previous level or one element of this level. Return `false` iff * is_algorithm_done()==true . */ template @@ -681,7 +681,7 @@ template < class Element, /**< Type of elements that this level refines. */ class Previous, /* = Null_mesher_level, */ /**< Previous level type, defaults to - \c Null_mesher_level. */ + `Null_mesher_level`. */ class Triangulation_traits> /** Traits class that defines types for the triangulation. */ class Mesher_level is_algorithm_done()==true . * Note that when parallelism is activated, this is not "one step" * but the full refinement. diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 767240429c2..9e43a872b72 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -196,8 +196,8 @@ private: Vertex_handle get_vertex_corner_from_point(const Bare_point& p, const Index& p_index) const; - /// Insert point(p,w) into the triangulation and set its dimension to \c dim - /// and its index to \c index. + /// Insert point(p,w) into the triangulation and set its dimension to `dim` + /// and its index to `index`. /// The handle of the newly created vertex is returned. Vertex_handle insert_point(const Bare_point& p, const Weight& w, @@ -206,8 +206,8 @@ private: const bool special_ball = false); /** - * Insert point(p,w) into the triangulation and set its dimension to \c dim and - * its index to \c index. + * Insert point(p,w) into the triangulation and set its dimension to `dim` and + * its index to `index`. * The handle of the newly created vertex is returned. * * This function also ensures that `point(p,w)` will not be inside a @@ -223,12 +223,12 @@ private: const Index& index, ErasedVeOutIt out); - /// Insert balls between the points identified by the handles \c vp and \c vq - /// on the curve identified by \c curve_index. + /// Insert balls between the points identified by the handles `vp` and `vq` + /// on the curve identified by `curve_index`. /// - /// \param orientation Orientation of the curve segment between \c vp and - /// \c vq, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `vp` and + /// `vq`, given the orientation of the curve of index + /// `curve_index` template ErasedVeOutIt insert_balls(const Vertex_handle& vp, const Vertex_handle& vq, @@ -251,25 +251,25 @@ private: const Curve_index& curve_index, ErasedVeOutIt out); - /// Return `true` if the balls of \c va and \c vb intersect, and (va,vb) is not + /// Return `true` if the balls of `va` and `vb` intersect, and `(va,vb)` is not /// an edge of the complex. bool non_adjacent_but_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Return `true` if the balls of \c va and \c vb intersect. + /// Return `true` if the balls of `va` and `vb` intersect. bool do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Change the size of the ball of the vertex \c v. + /// Change the size of the ball of the vertex `v`. Vertex_handle change_ball_size(const Vertex_handle& v, const FT squared_size, const bool special_ball = false); /// Return `true` if balls of v1 and v2 intersect "enough". - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index` bool is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, @@ -280,17 +280,17 @@ private: /// of those vertices is ok. If not, fix it. void check_and_repopulate_edges(); - /// Check if the vertex \c v is well sampled, and if its not the case, fix it. + /// Check if the vertex `v` is well sampled, and if its not the case, fix it. /// Fill `out` with deleted vertices during this process. The value type of `out` /// is `Vertex_handle`. template ErasedVeOutIt check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out); - /// Given two vertices \c start and \c next inserted on the curve with - /// index \c curve_index, return `CGAL::POSITIVE` if the curve arc from - /// \c start to \c next is oriented in the same orientation as the curve - /// segment with index \c curve_index, or `CGAL::NEGATIVE` otherwise. + /// Given two vertices `start` and `next` inserted on the curve with + /// index `curve_index`, return `CGAL::POSITIVE` if the curve arc from + /// `start` to `next` is oriented in the same orientation as the curve + /// segment with index `curve_index`, or `CGAL::NEGATIVE` otherwise. /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` CGAL::Orientation @@ -298,13 +298,13 @@ private: const Vertex_handle& next, Curve_index curve_index) const; - /// Walk along the edge from \c start, following the direction \c start to - /// \c next, and fills \c out with the vertices which do not fulfill + /// Walk along the edge from `start`, following the direction `start` to + /// `next`, and fills `out` with the vertices which do not fulfill /// the sampling conditions. /// - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` template @@ -315,8 +315,8 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out) const; - /// Return the next vertex along edge, i.e the vertex after \c start, following - /// the direction from \c previous to \c start. + /// Return the next vertex along edge, i.e the vertex after `start`, following + /// the direction from `previous` to `start`. /// \pre (previous,start) is in c3t3 /// \pre `c3t3.curve_index(start, previous) == curve_index` Vertex_handle @@ -325,12 +325,12 @@ private: const Curve_index& curve_index) const; /// Replace the vertices between ]begin,last[ with new vertices, along the curve - /// identified by \c curve_index. + /// identified by `curve_index`. /// The value type of `InputIterator` is `Vertex_handle`. /// - /// \param orientation Orientation of the curve segment between \c begin and - /// \c last, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `begin` and + /// `last`, given the orientation of the curve of index + /// `curve_index` /// template ErasedVeOutIt repopulate(InputIterator begin, @@ -346,33 +346,33 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out); - /// Check if the size of \c v2 is compatible (i.e. greater) with the linear - /// interpolation of the sizes of \c v1 and \c v3. + /// Check if the size of `v2` is compatible (i.e. greater) with the linear + /// interpolation of the sizes of `v1` and `v3`. bool is_sizing_field_correct(const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, const Curve_index& index, const CGAL::Orientation orientation) const; - /// Repopulate all incident curves around the corner \c v. - /// \pre \c v is a corner of c3t3 + /// Repopulate all incident curves around the corner `v`. + /// \pre `v` is a corner of c3t3 template ErasedVeOutIt repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out); - /// Return `true` if the edge with index \c curve_index is already treated. + /// Return `true` if the edge with index `curve_index` is already treated. bool is_treated(const Curve_index& curve_index) const { return ( treated_edges_.find(curve_index) != treated_edges_.end() ); } - /// Set the edge with index \c curve_index as treated. + /// Set the edge with index `curve_index` as treated. void set_treated(const Curve_index& curve_index) { treated_edges_.insert(curve_index); } - /// Compute the Euclidean distance between the bare points of \c va and \c vb. + /// Compute the Euclidean distance between the bare points of `va` and `vb`. FT compute_distance(const Vertex_handle& va, const Vertex_handle& vb) const { typename C3T3::Triangulation::Geom_traits::Construct_point_3 cp = @@ -384,14 +384,14 @@ private: return compute_distance(cp(wpa), cp(wpb)); } - /// Compute the Euclidean distance between the bare points \c and \c q. + /// Compute the Euclidean distance between the bare points `p` and `q`. FT compute_distance(const Bare_point& p, const Bare_point& q) const { return CGAL::sqrt(c3t3_.triangulation().geom_traits(). compute_squared_distance_3_object()(p,q)); } - /// Return the radius of the ball of vertex \c v. + /// Return the radius of the ball of vertex `v`. FT get_radius(const Vertex_handle& v) const { typename Gt::Compute_weight_3 cw = diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h index f3d1e0ba7fa..0fc61f63ec1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -438,7 +438,7 @@ public: // Parallel: it's always lazy, so do nothing void remove_element_from_refinement_queue(Cell_handle, Parallel_tag) {} - /// Handle cells contained in \c zone (before their destruction by insertion) + /// Handle cells contained in `zone` (before their destruction by insertion) void before_insertion_handle_cells_in_conflict_zone(Zone& zone); bool try_lock_element(const Cell_handle &ch, int lock_radius = 0) const @@ -479,7 +479,7 @@ public: return sstr.str(); } - /// Adds \c cell to the refinement queue if needed + /// Adds `cell` to the refinement queue if needed void treat_new_cell(const Cell_handle& cell); #ifdef CGAL_MESH_3_MESHER_STATUS_ACTIVATED @@ -531,20 +531,20 @@ private: // Updates cells incident to vertex, and add them to queue if needed void update_star_self(const Vertex_handle& vertex); - /// Set \c cell to domain, with subdomain index \c index + /// Set `cell` to domain, with subdomain index `index` void set_cell_in_domain(const Cell_handle& cell, const Subdomain_index& index) { r_c3t3_.add_to_complex(cell, index); } - /// Removes \c cell from domain + /// Removes `cell` from domain void remove_cell_from_domain(const Cell_handle& cell) { r_c3t3_.remove_from_complex(cell); } - /// Sets index and dimension of vertex \c v + /// Sets index and dimension of vertex `v` void set_vertex_properties(Vertex_handle& v, const Index& index) { r_c3t3_.set_index(v, index); diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h index 2f0db096e09..84600b8616e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -409,19 +409,19 @@ protected: return ( (facet < mirror)?facet:mirror ); } - /// Returns true if \c f has already been visited + /// Returns true if `f` has already been visited bool is_facet_visited(const Facet& f) const { return f.first->is_facet_visited(f.second); } - /// Sets facet \c f to visited + /// Sets facet `f` to visited void set_facet_visited(Facet& f) const { f.first->set_facet_visited(f.second); } - /// Sets the facet \c f and its mirrored facet's surface centers to \c p + /// Sets the facet `f` and its mirrored facet's surface centers to `p` void set_facet_surface_center(const Facet& f, const Bare_point& p, const Index& index) const @@ -435,32 +435,32 @@ protected: mirror.first->set_facet_surface_center_index(mirror.second,index); } - /// Returns facet surface center of \c f + /// Returns facet surface center of `f` Bare_point get_facet_surface_center(const Facet& f) const { return f.first->get_facet_surface_center(f.second); } - /// Returns index of surface center of facet \c f + /// Returns index of surface center of facet `f` Index get_facet_surface_center_index(const Facet& f) const { return f.first->get_facet_surface_center_index(f.second); } - /// Sets \c f to surface facets, with index \c index + /// Sets `f` to surface facets, with index `index` void set_facet_on_surface(const Facet& f, const Surface_patch_index& index) { r_c3t3_.add_to_complex(f, index); } - /// Returns index of facet \c f + /// Returns index of facet `f` Surface_patch_index get_facet_surface_index(const Facet& f) const { return r_c3t3_.surface_patch_index(f.first, f.second); } - /// Sets index and dimension of vertex \c v + /// Sets index and dimension of vertex `v` void set_vertex_properties(Vertex_handle& v, const Index& index) { r_c3t3_.set_index(v, index); @@ -554,13 +554,13 @@ protected: return stream.str(); } - /// Returns to if \c f is on surface + /// Returns to if `f` is on surface bool is_facet_on_surface(const Facet& f) const { return r_c3t3_.is_in_complex(f) ; } - /// Removes \c f from surface facets + /// Removes `f` from surface facets void remove_facet_from_surface(const Facet& f) { r_c3t3_.remove_from_complex(f); @@ -597,7 +597,7 @@ protected: /** * Computes at once is_facet_on_surface and facet_surface_center. * @param facet The input facet - * @return \c true if \c facet is on surface, \c false otherwise + * @return `true` if `facet` is on surface, `false` otherwise */ void compute_facet_properties(const Facet& facet, Facet_properties& fp, bool force_exact = false ) const; @@ -835,12 +835,12 @@ public: Container_::get_next_local_element_impl()); } - /// Tests if \c p encroaches facet from zone + /// Tests if `p` encroaches facet from zone // For sequential Mesher_level_conflict_status test_point_conflict_from_superior_impl(const Weighted_point& p, Zone& zone); - /// Tests if \c p encroaches facet from zone + /// Tests if `p` encroaches facet from zone // For parallel template Mesher_level_conflict_status @@ -875,7 +875,7 @@ public: , bool &facet_is_in_its_cz , bool &could_lock_zone); - /// Insert \c p into the triangulation + /// Insert `p` into the triangulation Vertex_handle insert_impl(const Weighted_point& p, const Zone& zone); bool try_lock_element(const Facet &f, int lock_radius = 0) const @@ -1836,8 +1836,8 @@ is_encroached_facet_refinable(Facet& facet) const } /** - * \c facet is an internal facet we are going to remove - * \c source_facet is the facet we want to refine by inserting a new point + * `facet` is an internal facet we are going to remove + * `source_facet` is the facet we want to refine by inserting a new point */ template bool diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 483c96be347..65f64176ef7 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -553,7 +553,7 @@ private: int build_priority_queue(const FT& sliver_bound, PQueue& pqueue) const; /** - * Updates priority queue for all vertices of \c vertices + * Updates priority queue for all vertices of `vertices` */ // Sequential int update_priority_queue(const Vertex_vector& vertices, @@ -568,7 +568,7 @@ private: #endif /** - * Updates \c pv in priority queue + * Updates `pv` in priority queue */ int update_priority_queue(const PVertex& pv, PQueue& pqueue) const; @@ -582,7 +582,7 @@ private: ) const; /** - * Returns a pvertex from a vertex handle \c vh, using id \c pv_id + * Returns a pvertex from a vertex handle `vh`, using id `pv_id` */ PVertex make_pvertex(const Vertex_handle& vh, @@ -595,13 +595,13 @@ private: const typename PVertex::id_type& pv_id) const; /** - * Updates a pvertex \c pv + * Updates a pvertex `pv` */ void update_pvertex(PVertex& pv, const FT& sliver_bound) const; void update_pvertex__concurrent(PVertex& pv, const FT& sliver_bound) const; /** - * Returns \c vh pvertex id + * Returns `vh` pvertex id */ typename PVertex::id_type get_pvertex_id(const Vertex_handle& vh) const { @@ -609,7 +609,7 @@ private: } /** - * Update bad vertices vector, wrt \c sliver_bound + * Update bad vertices vector, wrt `sliver_bound` */ // Sequential void update_bad_vertices(std::vector &bad_vertices, diff --git a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h index aea8be9a40f..34d2430adb0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h +++ b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h @@ -157,7 +157,7 @@ protected: } /** - * A functor to remove one \c Cell_handle from a priority queue + * A functor to remove one `Cell_handle` from a priority queue */ class Erase_from_queue { @@ -172,7 +172,7 @@ protected: }; /** - * Delete cells of \c cells from \c cells_queue + * Delete cells of `cells` from `cells_queue` */ void delete_cells_from_queue(const Cell_vector& cells) { @@ -288,7 +288,7 @@ protected: } /** - * A functor to remove one \c Cell_handle from a priority queue + * A functor to remove one `Cell_handle` from a priority queue */ class Erase_from_queue { @@ -300,7 +300,7 @@ protected: }; /** - * Delete cells of \c cells from \c cells_queue + * Delete cells of `cells` from `cells_queue` */ void delete_cells_from_queue(const Cell_vector& cells) { @@ -525,7 +525,7 @@ private: const Vertex_handle& new_vertex); /** - * Orders handles \c h1 & \c h2 + * Orders handles `h1` & `h2` */ template static @@ -594,8 +594,8 @@ private: /** - * Returns the \c Boundary_facets_from_outside object containing mirror facets - * of \c facets + * Returns the `Boundary_facets_from_outside` object containing mirror facets + * of `facets` */ Boundary_facets_from_outside get_boundary_facets_from_outside(const Facet_vector& facets) const @@ -616,7 +616,7 @@ private: } /** - * Add a cell \c ch to \c cells_queue + * Add a cell `ch` to `cells_queue` */ template void add_cell_to_queue(Cell_handle ch, FT criterion_value) @@ -651,7 +651,7 @@ private: }; /** - * Removes objects of [begin,end[ range from \c c3t3_ + * Removes objects of [begin,end[ range from `c3t3_` */ template void remove_from_c3t3(ForwardIterator begin, ForwardIterator end) @@ -852,7 +852,7 @@ private: const Vertex_handle& vh) const; /** - * Checks if the sliver criterion values from \c criterion_values are the same as + * Checks if the sliver criterion values from `criterion_values` are the same as * those that will be found if wp is inserted in the triangulation */ bool check_ratios(const Sliver_values& criterion_values, diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h index 3d91d34ffca..aa68f0d2604 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h @@ -109,8 +109,8 @@ public: ~Triangulation_helpers() {} /** - * Returns true if moving \c v to \c p makes no topological - * change in \c tr + * Returns true if moving `v` to `p` makes no topological + * change in `tr` */ bool no_topological_change(Tr& tr, const Vertex_handle v, @@ -137,7 +137,7 @@ public: const Bare_point& p) const; /** - * Returns the squared distance from \c vh to its closest vertex + * Returns the squared distance from `vh` to its closest vertex * * \pre `vh` is not the infinite vertex */ @@ -156,7 +156,7 @@ public: private: /** - * Returns true if \c v is well_oriented on each cell of \c cell_tos + * Returns true if `v` is well_oriented on each cell of `cell_tos` */ // For sequential version bool well_oriented(const Tr& tr, diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h index 11cf08c0e61..5cfd022f173 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h @@ -73,17 +73,17 @@ public: Triangulation_sizing_field(const Tr& tr); /** - * Fill sizing field, using size associated to point in \c value_map. + * Fill sizing field, using size associated to point in `value_map`. */ void fill(const std::map& value_map); /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Weighted_point& p) const; /** - * Returns size at point \c p. (needed for compatibility) + * Returns size at point `p`. (needed for compatibility) */ template FT operator()(const Weighted_point& p, const Handle&) const @@ -91,20 +91,20 @@ public: private: /** - * Returns size at point \c p, by interpolation into tetrahedron. + * Returns size at point `p`, by interpolation into tetrahedron. */ FT interpolate_on_cell_vertices(const Weighted_point& p, const CCell_handle& cell) const; /** - * Returns size at point \c p, by interpolation into facet (\c cell is assumed + * Returns size at point `p`, by interpolation into facet (`cell` is assumed * to be an infinite cell). */ FT interpolate_on_facet_vertices(const Weighted_point& p, const CCell_handle& cell) const; /** - * Returns a hint for \c p location. + * Returns a hint for `p` location. */ CCell_handle get_hint(const Weighted_point& p) const { return last_cell_; } diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index 1b5e004548a..39e4d2118b7 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -49,7 +49,7 @@ namespace Mesh_3 { namespace details { /** - * @brief Returns the angle in radian of vectors \c u and \c v + * @brief Returns the angle in radian of vectors `u` and `v` */ template typename K::FT @@ -98,7 +98,7 @@ angle_in_radian(const typename K::Vector_3& u, } /** - * @brief Returns the angle in radian of vectors \c u and \c v + * @brief Returns the angle in radian of vectors `u` and `v` */ template typename Kernel_traits::Kernel::FT @@ -108,7 +108,7 @@ angle_in_radian(const Vector_3& u, const Vector_3& v) } /** - * @brief Returns the squared length of edge \c e + * @brief Returns the squared length of edge `e` */ template typename Tr::Geom_traits::FT @@ -133,8 +133,8 @@ edge_sq_length(const typename Tr::Edge& e, } /** - * @brief Returns the minimal incident edge length of \c v - * in triangulation \c tr + * @brief Returns the minimal incident edge length of `v` + * in triangulation `tr` */ template typename Tr::Geom_traits::FT @@ -210,7 +210,7 @@ public: /** * @brief This operator try to move vertex \v using the perturbation. * @param v the vertex to move - * @param slivers a vector which contains incident slivers of \c v + * @param slivers a vector which contains incident slivers of `v` * @param c3t3 the c3t3 * @param domain the domain * @param criterion the criterion which is used to evaluate if a cell is @@ -219,12 +219,12 @@ public: * @param modified_vertices an output vector which contains vertices of c3t3 * which may have been impacted by v relocation. * @return a pair containing: - * - a bool which is \c true if a move has been done. + * - a bool which is `true` if a move has been done. * - a Vertex_handle which is always filled and may be the new vertex (if - * the move is a success), or the vertex which lies at \c v's position in + * the move is a success), or the vertex which lies at `v`'s position in * the new c3t3. * - * Note that this function is hill_climbing only. The min \c criterion value + * Note that this function is hill_climbing only. The min `criterion` value * of c3t3 could not decrease. */ std::pair @@ -432,7 +432,7 @@ protected: /** * Tries to apply a gradient perturbation using direction of - * \c gradient_vector + * `gradient_vector` */ std::pair apply_perturbation(const Vertex_handle& v, @@ -1054,7 +1054,7 @@ private: } /** - * @brief returns the cotangent of \c value + * @brief returns the cotangent of `value` */ FT cotangent(const FT& value) const { @@ -1063,7 +1063,7 @@ private: /** * @brief returns the normal of facet (ch,i), oriented from inside to outside - * of \c ch + * of `ch` */ Vector_3 normal_estimate(const C3T3& c3t3, const Cell_handle& ch, const int i) const { @@ -1157,7 +1157,7 @@ protected: FT sphere_sq_radius() const { return sphere_sq_radius_; } /** - * @brief returns a FT between \c min and \c max + * @brief returns a FT between `min` and `max` */ FT random_ft(const FT& min = FT(0.), const FT& max = FT(1.)) const { @@ -1166,7 +1166,7 @@ protected: } /** - * @brief returns a random vector with size \c vector_size + * @brief returns a random vector with size `vector_size` */ Vector_3 random_vector_fixed_size(const C3T3& c3t3, const FT& vector_sq_size) const @@ -1184,7 +1184,7 @@ protected: } /** - * @brief returns a random vector with size between 0 and \c vector_size + * @brief returns a random vector with size between 0 and `vector_size` */ Vector_3 random_vector_max_size(const C3T3& c3t3, const FT& vector_max_sq_size) const @@ -1299,7 +1299,7 @@ private: // ----------------------------------- /** - * @brief try to improve mesh using random moves of \c v + * @brief try to improve mesh using random moves of `v` */ std::pair apply_perturbation(const Vertex_handle& v, @@ -1410,7 +1410,7 @@ private: } private: - // If set to \c true, then random point will be generated on sphere surface. + // If set to `true`, then random point will be generated on sphere surface. bool on_sphere_; }; diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index 1a5508d034b..b833168691c 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -82,8 +82,8 @@ public: ~Mesh_cell_criteria_3() { } /** - * @brief returns whether the cell \c cell is bad or not. - * @param tr the triangulation within which \c cell lives + * @brief returns whether the cell `cell` is bad or not. + * @param tr the triangulation within which `cell` lives * @param cell the cell */ Is_cell_bad operator()(const Tr& tr, const Cell_handle& cell) const diff --git a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h index ded5f26da80..152127033cf 100644 --- a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h +++ b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h @@ -57,7 +57,7 @@ public: return d_; } - /// Sets size at any point of dimension \c dim and index \c index + /// Sets size at any point of dimension `dim` and index `index` void set_size(const FT& size, const int dim, const Index& index) { values_.insert(std::make_pair(std::make_pair(dim,index),size)); diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index e9a58de83d5..ea08a9d0cac 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -228,7 +228,7 @@ public: return result; } - /// Returns signed geodesic distance between \c p and \c q + /// Returns signed geodesic distance between `p` and `q` FT signed_geodesic_distance(const Point_3& p, const Point_3& q) const { // Locate p & q on polyline @@ -260,7 +260,7 @@ public: } - /// Returns a point at geodesic distance \c distance from p along the + /// Returns a point at geodesic distance `distance` from p along the /// polyline. The polyline is oriented from starting point to end point. /// The distance could be negative. Point_3 point_at(const Point_3& p, FT distance) const @@ -587,7 +587,7 @@ public: /// Add a 0-dimensional feature in the domain. Corner_index add_corner(const Point_3& p); - /// Overloads where the last parameter \c out is not `CGAL::Emptyset_iterator()`. + /// Overloads where the last parameter `out` is not `CGAL::Emptyset_iterator()`. template IndicesOutputIterator add_corners(InputIterator first, InputIterator end, @@ -605,7 +605,7 @@ public: Corner_index register_corner(const Point_3& p, const Curve_index& index); Corner_index add_corner_with_context(const Point_3& p, const Surface_patch_index& index); - /// Overloads where the last parameter \c out is not + /// Overloads where the last parameter `out` is not /// `CGAL::Emptyset_iterator()`. template IndicesOutputIterator @@ -735,14 +735,14 @@ public: /** * Returns the index to be stored in a vertex lying on the surface identified - * by \c index. + * by `index`. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } /** * Returns the index to be stored in a vertex lying in the subdomain - * identified by \c index. + * identified by `index`. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } @@ -756,15 +756,15 @@ public: { return Index(index); } /** - * Returns the \c Surface_patch_index of the surface patch - * where lies a vertex with dimension 2 and index \c index. + * Returns the `Surface_patch_index` of the surface patch + * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } /** * Returns the index of the subdomain containing a vertex - * with dimension 3 and index \c index. + * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index 4e41d82ef1c..86972063b11 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -74,8 +74,8 @@ public: ~Mesh_facet_criteria_3() { } /** - * @brief returns whether the facet \c facet is bad or not. - * @param tr the triangulation within which \c facet lives + * @brief returns whether the facet `facet` is bad or not. + * @param tr the triangulation within which `facet` lives * @param facet the facet */ Is_facet_bad operator()(const Tr& tr, const Facet& facet) const diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 96743cc70e3..01b01c90edc 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -517,28 +517,28 @@ public: /** * Returns the index to be stored in a vertex lying on the surface identified - * by \c index. + * by `index`. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } /** * Returns the index to be stored in a vertex lying in the subdomain - * identified by \c index. + * identified by `index`. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } /** - * Returns the \c Surface_patch_index of the surface patch - * where lies a vertex with dimension 2 and index \c index. + * Returns the `Surface_patch_index` of the surface patch + * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } /** * Returns the index of the subdomain containing a vertex - * with dimension 3 and index \c index. + * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index d244dffa816..0eb884bcb36 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -474,7 +474,7 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS * * @param domain the domain to be discretized * @param criteria the criteria - * @param exude if it is set to \c true, an exudation step will be done at + * @param exude if it is set to `true`, an exudation step will be done at * the end of the Delaunay refinement process * * @return The mesh as a C3T3 object diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 90b139757a0..85f90bd5b8b 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -307,11 +307,11 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const * @param c3t3 the mesh to be refined. * @param domain the domain used to create the `c3t3` parameter * @param criteria the criteria - * @param exude if \c true, an exudation step will be done at + * @param exude if `true`, an exudation step will be done at * the end of the Delaunay refinement process - * @param perturb if \c true, an explicit vertex perturbation step will be + * @param perturb if `true`, an explicit vertex perturbation step will be * done at the end of refinement process - * @param reset_c3t3 if \c true, a new C3T3 will be construct from param c3t3. + * @param reset_c3t3 if `true`, a new C3T3 will be construct from param c3t3. * The new c3t3 keeps only the vertices (as NON-weighted points with their * dimension and Index) of the triangulation. That allows to refine a mesh * which has been exuded. diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 9c4d91afea9..eb65a93fb66 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -203,8 +203,8 @@ private: Vertex_handle get_vertex_corner_from_point(const Bare_point& p, const Index& p_index) const; - /// Insert point(p,w) into the triangulation and set its dimension to \c dim - /// and its index to \c index. + /// Insert point(p,w) into the triangulation and set its dimension to `dim` + /// and its index to `index`. /// The handle of the newly created vertex is returned. template Vertex_handle insert_point(const Bare_point& p, @@ -215,8 +215,8 @@ private: const bool special_ball); /** - * Insert point(p,w) into the triangulation and set its dimension to \c dim and - * its index to \c index. + * Insert point(p,w) into the triangulation and set its dimension to `dim` and + * its index to `index`. * The handle of the newly created vertex is returned. * * This function also ensures that `point(p,w)` will not be inside a @@ -233,11 +233,11 @@ private: const Curve_index_container& curve_indices, ErasedVeOutIt out); - /// Insert balls between the points identified by the handles \c vp and \c vq - /// on the curve identified by \c curve_index. + /// Insert balls between the points identified by the handles `vp` and `vq` + /// on the curve identified by `curve_index`. /// - /// \param orientation Orientation of the curve segment between \c vp and - /// \c vq, given the orientation of the curve of index \c curve_index + /// \param orientation Orientation of the curve segment between `vp` and + /// `vq`, given the orientation of the curve of index `curve_index` template ErasedVeOutIt insert_balls(const Vertex_handle& vp, const Vertex_handle& vq, @@ -260,25 +260,25 @@ private: const Curve_index& curve_index, ErasedVeOutIt out); - /// Return `true` if the balls of \c va and \c vb intersect, and (va,vb) is not + /// Return `true` if the balls of `va` and `vb` intersect, and `(va,vb)` is not /// an edge of the complex. bool non_adjacent_but_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Return `true` if the balls of \c va and \c vb intersect. + /// Return `true` if the balls of `va` and `vb` intersect. bool do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Change the size of the ball of the vertex \c v. + /// Change the size of the ball of the vertex `v`. bool change_ball_size(Vertex_handle& v, const FT squared_size, const bool special_ball = false); /// Return `true` if balls of v1 and v2 intersect "enough". - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index` bool is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, @@ -289,17 +289,17 @@ private: /// of those vertices is ok. If not, fix it. void check_and_repopulate_edges(); - /// Check if the vertex \c v is well sampled, and if its not the case, fix it. + /// Check if the vertex `v` is well sampled, and if its not the case, fix it. /// Fill `out` with deleted vertices during this process. The value type of `out` /// is `Vertex_handle`. template ErasedVeOutIt check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out); - /// Given two vertices \c start and \c next inserted on the curve with - /// index \c curve_index, return `CGAL::POSITIVE` if the curve arc from - /// \c start to \c next is oriented in the same orientation as the curve - /// segment with index \c curve_index, or `CGAL::NEGATIVE` otherwise. + /// Given two vertices `start` and `next inserted` on the curve with + /// index `curve_index`, return `CGAL::POSITIVE` if the curve arc from + /// `start` to `next` is oriented in the same orientation as the curve + /// segment with index `curve_index`, or `CGAL::NEGATIVE` otherwise. /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` CGAL::Orientation @@ -307,13 +307,13 @@ private: const Vertex_handle& next, Curve_index curve_index) const; - /// Walk along the edge from \c start, following the direction \c start to - /// \c next, and fills \c out with the vertices which do not fulfill + /// Walk along the edge from `start`, following the direction `start` to + /// `next`, and fills `out` with the vertices which do not fulfill /// the sampling conditions. /// - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` template @@ -324,8 +324,8 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out) const; - /// Return the next vertex along edge, i.e the vertex after \c start, following - /// the direction from \c previous to \c start. + /// Return the next vertex along edge, i.e the vertex after `start`, following + /// the direction from `previous` to `start`. /// \pre (previous,start) is in c3t3 /// \pre `c3t3.curve_index(start, previous) == curve_index` Vertex_handle @@ -334,12 +334,12 @@ private: const Curve_index& curve_index) const; /// Replace the vertices between ]begin,last[ with new vertices, along the curve - /// identified by \c curve_index. + /// identified by `curve_index`. /// The value type of `InputIterator` is `Vertex_handle`. /// - /// \param orientation Orientation of the curve segment between \c begin and - /// \c last, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `begin` and + /// `last`, given the orientation of the curve of index + /// `curve_index` /// template ErasedVeOutIt repopulate(InputIterator begin, @@ -355,33 +355,33 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out); - /// Check if the size of \c v2 is compatible (i.e. greater) with the linear - /// interpolation of the sizes of \c v1 and \c v3. + /// Check if the size of `v2` is compatible (i.e. greater) with the linear + /// interpolation of the sizes of `v1` and `v3`. bool is_sizing_field_correct(const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, const Curve_index& index, const CGAL::Orientation orientation) const; - /// Repopulate all incident curves around the corner \c v. - /// \pre \c v is a corner of c3t3 + /// Repopulate all incident curves around the corner `v`. + /// \pre `v` is a corner of c3t3 template ErasedVeOutIt repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out); - /// Return `true` if the edge with index \c curve_index is already treated. + /// Return `true` if the edge with index `curve_index` is already treated. bool is_treated(const Curve_index& curve_index) const { return (treated_edges_.find(curve_index) != treated_edges_.end()); } - /// Set the edge with index \c curve_index as treated. + /// Set the edge with index `curve_index` as treated. void set_treated(const Curve_index& curve_index) { treated_edges_.insert(curve_index); } - /// Compute the Euclidean distance between the bare points \c and \c q. + /// Compute the Euclidean distance between the bare points `p` and `q`. FT compute_distance(const Bare_point& p, const Bare_point& q) const { // No need to call min_squared_distance() because 'p' and 'q' have been @@ -398,7 +398,7 @@ private: return compute_distance(pa, pb); } - /// Compute the Euclidean distance between the bare points of \c va and \c vb. + /// Compute the Euclidean distance between the bare points of `va` and `vb`. FT compute_distance(const Vertex_handle& va, const Vertex_handle& vb) const { typename Gt::Construct_point_3 cp = @@ -410,7 +410,7 @@ private: return CGAL::sqrt(c3t3_.triangulation().min_squared_distance(cp(wpa), cp(wpb))); } - /// Return the radius of the ball of vertex \c v. + /// Return the radius of the ball of vertex `v`. FT get_radius(const Vertex_handle& v) const { typename Gt::Compute_weight_3 cw = diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index a99b6dc1aea..f94f4fe52fe 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -367,7 +367,7 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG * * @param domain the domain to be discretized * @param criteria the criteria - * @param exude if it is set to \c true, an exudation step will be done at + * @param exude if it is set to `true`, an exudation step will be done at * the end of the Delaunay refinement process * * @return The mesh as a C3T3 object 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 6319702d344..919d1b43e3e 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 @@ -350,11 +350,11 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit * @param c3t3 the mesh to be refined. * @param domain the domain to be discretized * @param criteria the criteria - * @param exude if \c true, an exudation step will be done at + * @param exude if `true`, an exudation step will be done at * the end of the Delaunay refinement process - * @param perturb if \c true, an explicit vertex perturbation step will be + * @param perturb if `true`, an explicit vertex perturbation step will be * done at the end of refinement process - * @param reset_c3t3 if \c true, a new C3T3 will be construct from param c3t3. + * @param reset_c3t3 if `true`, a new C3T3 will be construct from param c3t3. * The new c3t3 keeps only the vertices (as NON-weighted points with their * dimension and Index) of the triangulation. That allows to refine a mesh * which has been exuded. From 43823988c9bd222e0012fbe64d3fbb48b6758742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 4 Oct 2022 19:31:50 +0200 Subject: [PATCH 120/248] use backticks instead of \c --- Mesh_2/include/CGAL/Delaunay_mesher_2.h | 10 ++++----- .../Delaunay_mesher_no_edge_refinement_2.h | 10 ++++----- Mesh_2/include/CGAL/Mesh_2/Clusters.h | 16 +++++++------- .../CGAL/Mesh_2/Mesh_global_optimizer_2.h | 12 +++++----- .../include/CGAL/Mesh_2/Mesh_sizing_field.h | 12 +++++----- Mesh_2/include/CGAL/Mesh_2/Refine_edges.h | 22 +++++++++---------- .../CGAL/Mesh_2/Refine_edges_visitor.h | 4 ++-- .../CGAL/Mesh_2/Refine_edges_with_clusters.h | 4 ++-- Mesh_2/include/CGAL/Mesh_2/Refine_faces.h | 6 ++--- .../include/CGAL/Triangulation_conformer_2.h | 8 +++---- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_2.h index ac01fe0e68d..f2dc490f3f2 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_2.h @@ -29,7 +29,7 @@ template class Delaunay_mesher_2 { - /** \name \c Tr types */ + /** \name `Tr` types */ typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Face_handle Face_handle; typedef typename Tr::Edge Edge; @@ -118,10 +118,10 @@ private: public: /** \name MARKING FUNCTIONS */ - /** The value type of \a InputIterator should be \c Point, and represents + /** The value type of \a InputIterator should be `Point`, and represents seeds. Connected components of seeds are marked with the value of - \a mark. Other components are marked with \c !mark. The connected - component of infinite faces is always marked with \c false. + \a mark. Other components are marked with `!mark`. The connected + component of infinite faces is always marked with `false`. */ template void set_seeds(InputIterator b, InputIterator e, @@ -190,7 +190,7 @@ public: propagate_marks(tr.infinite_face(), false); } - /** Propagates the mark \c mark recursively. */ + /** Propagates the mark `mark` recursively. */ static void propagate_marks(const Face_handle fh, bool mark) { // std::queue only works with std::list on VC++6, and not with diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h index 583929efe30..9caf4f52b7b 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h @@ -26,7 +26,7 @@ template class Delaunay_mesher_no_edge_refinement_2 { - /** \name \c Tr types */ + /** \name `Tr` types */ typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Face_handle Face_handle; typedef typename Tr::Edge Edge; @@ -109,10 +109,10 @@ private: public: /** \name MARKING FUNCTIONS */ - /** The value type of \a InputIterator should be \c Point, and represents + /** The value type of \a InputIterator should be `Point`, and represents seeds. Connected components of seeds are marked with the value of - \a mark. Other components are marked with \c !mark. The connected - component of infinite faces is always marked with \c false. + \a mark. Other components are marked with `!mark`. The connected + component of infinite faces is always marked with `false`. */ template void set_seeds(InputIterator b, InputIterator e, @@ -181,7 +181,7 @@ public: propagate_marks(tr.infinite_face(), false); } - /** Propagates the mark \c mark recursivly. */ + /** Propagates the mark `mark` recursivly. */ static void propagate_marks(const Face_handle fh, bool mark) { // std::queue only works with std::list on VC++6, and not with diff --git a/Mesh_2/include/CGAL/Mesh_2/Clusters.h b/Mesh_2/include/CGAL/Mesh_2/Clusters.h index 7ac17276f29..050674305a7 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Clusters.h @@ -70,7 +70,7 @@ public: /** \name Clusters public types */ /** - * \c Cluster register several informations about clusters. + * `Cluster` register several informations about clusters. * A cluster is a set of vertices v_i incident to one vertice * v_0, so that angles between segments [v_0, v_i] is less than 60 * degres. @@ -127,7 +127,7 @@ private: Tr& tr; /**< The triangulation itself. */ /** - * Multimap \c Vertex_handle -> \c Cluster + * Multimap `Vertex_handle -> Cluster` * Each vertex can have several clusters. */ Cluster_map cluster_map; @@ -178,14 +178,14 @@ public: private: /** - * Computes clusters of the vertex \c v, using the auxiliary function + * Computes clusters of the vertex `v`, using the auxiliary function * construct_cluster(). */ void create_clusters_of_vertex(const Vertex_handle v); /** - * Adds the sequence [\c begin, \c end] to the cluster \c c and adds it - * to the clusters of the vertex \c v. + * Adds the sequence `[begin, end]` to the cluster `c` and adds it + * to the clusters of the vertex `v`. */ void construct_cluster(const Vertex_handle v, const Constrained_edge_circulator& begin, @@ -196,7 +196,7 @@ public: /** \name Functions to manage clusters during the refinement process. */ /** - * Update the cluster of [\c va,\c vb], putting \c vm instead of \c vb. + * Update the cluster of `[va,vb]`, putting `vm` instead of `vb`. * If reduction=false, the edge [va,vm] is not set reduced. */ void update_cluster(Cluster& c, iterator it, @@ -205,8 +205,8 @@ public: bool reduction = true); /** - * Returns the cluster of [\c va,\c vb] in \c c and return true - * if it is in a cluster. Returns also a const_iterator in \c it. + * Returns the cluster of `[va,vb]` in `c` and return true + * if it is in a cluster. Returns also a const_iterator in `it`. */ bool get_cluster(const Vertex_handle va, const Vertex_handle vb, Cluster& c, iterator& it); diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index 5dcb38504e8..ccd4c4746a6 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -92,7 +92,7 @@ public: void set_time_limit(double time) { time_limit_ = time; } double time_limit() const { return time_limit_; } - /** The value type of \a InputIterator should be \c Point, and represents + /** The value type of \a InputIterator should be `Point`, and represents seeds. */ template @@ -222,7 +222,7 @@ public: private: /** - * Returns moves for vertices of set \c moving_vertices + * Returns moves for vertices of set `moving_vertices` */ Moves_vector compute_moves(Vertex_set& moving_vertices) { @@ -260,7 +260,7 @@ private: } /** - * Returns the move for vertex \c v + * Returns the move for vertex `v` */ Vector_2 compute_move(const Vertex_handle& v) { @@ -284,7 +284,7 @@ private: } /** - * Returns the minimum cicumradius length of faces incident to \c v + * Returns the minimum cicumradius length of faces incident to `v` */ FT min_sq_circumradius(const Vertex_handle& v) const { @@ -395,8 +395,8 @@ private: seeds_.end(), seeds_mark_/*faces that are not in domain are tagged false*/); //Connected components of seeds are marked with the value of - // \a mark. Other components are marked with \c !mark. The connected - // component of infinite faces is always marked with \c false. + // \a mark. Other components are marked with `!mark`. The connected + // component of infinite faces is always marked with `false`. } void after_all_moves() diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h index 94236ba7ea0..c82ef508225 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h @@ -57,20 +57,20 @@ public: } /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Point_2& p) const { return this->operator()(p, last_face_); } /** - * Returns size at point \c p, using \c v to accelerate \c p location + * Returns size at point `p`, using `v` to accelerate `p` location * in triangulation */ FT operator()(const Point_2& p, const Vertex_handle& v) const { return this->operator()(p, v->face()); } /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Point_2& p, const Face_handle& c) const { @@ -99,7 +99,7 @@ public: private: /** - * Returns size at point \c p, by interpolation inside facet + * Returns size at point `p`, by interpolation inside facet */ FT interpolate_on_face_vertices(const Point_2& #ifdef CGAL_MESH_2_SIZING_FIELD_USE_BARYCENTRIC_COORDINATES @@ -128,8 +128,8 @@ private: } /** - * Returns size at point \c p, by interpolation inside edge - * (\c e f is assumed to be an infinite face) + * Returns size at point `p`, by interpolation inside edge + * (`f` is assumed to be an infinite face) */ FT interpolate_on_edge_vertices(const Point_2& #ifdef CGAL_MESH_2_SIZING_FIELD_USE_BARYCENTRIC_COORDINATES diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index 8f2cf435d60..94a585cf134 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -41,7 +41,7 @@ namespace Mesh_2 { namespace details { - /** This class defines several auxiliary types for \c Refine_edges. */ + /** This class defines several auxiliary types for `Refine_edges`. */ template struct Refine_edges_base_types { @@ -50,7 +50,7 @@ namespace Mesh_2 { typedef std::pair Constrained_edge; - /** Object predicate that tests if a given \c Constrained_Edge is + /** Object predicate that tests if a given `Constrained_Edge` is really an edge of the triangulation and is constrained. */ class Is_a_constrained_edge { @@ -98,7 +98,7 @@ namespace Mesh_2 { typedef typename Tr::Point Point; typedef typename Tr::Geom_traits Geom_traits; - /** Operator that takes an edge (\c fh, \c index). */ + /** Operator that takes an edge (`fh`, `index`). */ bool operator()(const Tr& tr, const Face_handle& fh, const int i) const @@ -117,7 +117,7 @@ namespace Mesh_2 { ); } - /** Operator that takes an edge (\c va, \c vb). */ + /** Operator that takes an edge (`va`, `vb`). */ bool operator()(const Tr& tr, const Vertex_handle& va, const Vertex_handle& vb) const @@ -132,7 +132,7 @@ namespace Mesh_2 { } /** - * Operator that takes an edge (\c fh, \c index) and a point \c p. + * Operator that takes an edge (`fh`, `index`) and a point `p`. * Tests if the point encroached the edge. */ bool operator()(const Tr& tr, @@ -147,7 +147,7 @@ namespace Mesh_2 { } /** - * Operator that takes an edge (\c va, \c vb) and a point \c p. + * Operator that takes an edge (`va`, `vb`) and a point `p`. * Tests if the point encroached the edge. */ bool operator()(const Tr& tr, @@ -179,7 +179,7 @@ namespace Mesh_2 { typedef typename Tr::Point Point; typedef typename Tr::Geom_traits Geom_traits; - /** Operator that takes an edge (\c fh, \c index). */ + /** Operator that takes an edge (`fh`, `index`). */ bool operator()(const Tr& tr, const Face_handle& fh, const int i) const @@ -197,7 +197,7 @@ namespace Mesh_2 { return aux_outside_of_circle(tr, vi, vb, va, mvi); } - /** Operator that takes an edge (\c va, \c vb). */ + /** Operator that takes an edge (`va`, `vb`). */ bool operator()(const Tr& tr, const Vertex_handle& va, const Vertex_handle& vb) const @@ -269,7 +269,7 @@ namespace Mesh_2 { * \param Is_locally_conform defines the locally conform criterion: Gabriel * or Delaunay. It defaults to the Garbriel criterion. * \param Container is the type of container. It defaults to a filtered - * queue of \c Vertex_handle pair (see \c Filtered_queue_container). + * queue of `Vertex_handle` pair (see `Filtered_queue_container`). */ template < class Tr, @@ -615,7 +615,7 @@ public: protected: /** \name Auxiliary functions */ - /** Add an \c Edge \c e in the queue. */ + /** Add an edge `e` in the queue. */ void add_constrained_edge_to_be_conformed(const Edge& e) { const Vertex_handle& va = e.first->vertex(tr. cw(e.second)); @@ -624,7 +624,7 @@ protected: // base class } - /** Add an edge (\c va,\c vb) in the queue. */ + /** Add an edge `(va, vb)` in the queue. */ void add_constrained_edge_to_be_conformed(const Vertex_handle& va, const Vertex_handle& vb) { diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h index 442ab8b3ff4..e6efb736235 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h @@ -65,7 +65,7 @@ public: Null_mesh_visitor previous_level() const { return null_mesh_visitor; } /** - * Store vertex handles and markers at left and right of the edge \c e. + * Store vertex handles and markers at left and right of the edge `e`. */ void before_conflicts(const Edge& e, const Point&) { @@ -84,7 +84,7 @@ public: faces_mesher.before_insertion_impl(Face_handle(), p, z); } - /** Restore markers in the star of \c v. */ + /** Restore markers in the star of `v`. */ void after_insertion(const Vertex_handle& v) { Tr& tr = faces_mesher.triangulation_ref_impl(); diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h index 827a7dc7557..889403114c4 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h @@ -27,13 +27,13 @@ namespace Mesh_2 { /** * This class is the base for the first level of Mesh_2: the edge * conforming level. It \e does handle clusters. - * To handle clusters, an helping \c Clusters object is used. + * To handle clusters, an helping `Clusters` object is used. * * \param Tr is the type of triangulation on which the level acts. * \param Is_locally_conform defines the locally conform criterion: Gabriel * or Delaunay. It defaults to the Garbriel criterion. * \param Container is the type of container. It defaults to a filtered - * queue of \c Vertex_handle pair (see \c Filtered_queue_container). + * queue of `Vertex_handle` pair (see `Filtered_queue_container`). */ template < class Tr, diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h index 1d7126e80e9..f5e9dfc41c4 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h @@ -212,7 +212,7 @@ public: } } - /** Restore markers in the star of \c v. */ + /** Restore markers in the star of `v`. */ void after_insertion_impl(const Vertex_handle& v) { #ifdef CGAL_MESH_2_VERBOSE @@ -254,11 +254,11 @@ public: Mesh_2::Face_badness is_bad(Quality q) const; /** - * Adds the sequence [\c begin, \c end[ to the list + * Adds the sequence `[begin, end[` to the list * of bad faces. * Use this overriden function if the list of bad faces can be * computed easily without testing all faces. - * \param Fh_it is an iterator of \c Face_Handle. + * \param Fh_it is an iterator of `Face_Handle`. */ template void set_bad_faces(Fh_it begin, Fh_it end) diff --git a/Mesh_2/include/CGAL/Triangulation_conformer_2.h b/Mesh_2/include/CGAL/Triangulation_conformer_2.h index 6993cbf24dd..28e8c5868e3 100644 --- a/Mesh_2/include/CGAL/Triangulation_conformer_2.h +++ b/Mesh_2/include/CGAL/Triangulation_conformer_2.h @@ -38,10 +38,10 @@ protected: /** \name INITIALIZED */ enum Initialization { - NONE, /**< \c this is not initialized. */ - CLUSTERS, /**< \c this clusters are initialized. */ - DELAUNAY, /**< \c this has been \e Delaunay-initialized. */ - GABRIEL /**< \c this has been \e Gabriel-initialized. */ + NONE, /**< `this` is not initialized. */ + CLUSTERS, /**< `this` clusters are initialized. */ + DELAUNAY, /**< `this` has been \e Delaunay-initialized. */ + GABRIEL /**< `this` has been \e Gabriel-initialized. */ }; // --- PROTECTED DATAS --- From 60ecc51ba7137d2af6212b9a96f3f7f73f9505df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 16:25:17 +0200 Subject: [PATCH 121/248] Code cleaning (no real changes) --- .../CGAL/boost/graph/Euler_operations.h | 28 +++++++++---------- BGL/include/CGAL/boost/graph/helpers.h | 17 ++++++----- .../CGAL/Polygon_mesh_processing/locate.h | 1 - 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index ca9adb2d294..8bea4e264c4 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -38,7 +38,7 @@ typename boost::graph_traits::halfedge_descriptor join_face(typename boost::graph_traits::halfedge_descriptor h, Graph& g) { - typedef typename boost::graph_traits Traits; + typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; @@ -73,17 +73,17 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, remove_edge(edge(h, g), g); return hprev; - } + } // namespace EulerImpl /// \endcond - namespace Euler { +namespace Euler { + /// \ingroup PkgBGLEulerOperations /// @{ - /** * joins the two vertices incident to `h`, (that is `source(h, g)` and * `target(h, g)`) and removes `source(h,g)`. Returns the predecessor @@ -260,8 +260,6 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, return EulerImpl::join_face(h,g); } - - /** * splits the face incident to `h1` and `h2`. Creates the opposite * halfedges `h3` and `h4`, such that `next(h1,g) == h3` and `next(h2,g) == h4`. @@ -298,6 +296,7 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, internal::set_face_in_face_loop(opposite(hnew,g), fnew, g); set_halfedge(face(hnew,g), hnew, g); set_halfedge(face(opposite(hnew,g),g), opposite(hnew,g), g); + return hnew; } @@ -506,6 +505,7 @@ void remove_face(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::face_descriptor face_descriptor; CGAL_precondition(! is_border(h,g)); + face_descriptor f = face(h, g); halfedge_descriptor end = h; @@ -554,10 +554,10 @@ add_edge(typename boost::graph_traits::vertex_descriptor s, typename boost::graph_traits::edge_descriptor e = add_edge(g); set_target(halfedge(e, g), t, g); set_target(opposite(halfedge(e, g), g), s, g); + return e; } - /** * checks whether a new face defined by a range of vertices (identified by their descriptors, * `boost::graph_traits::%vertex_descriptor`) can be added. @@ -1520,8 +1520,8 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, template typename boost::graph_traits::vertex_descriptor collapse_edge(typename boost::graph_traits::edge_descriptor v0v1, - Graph& g - , EdgeIsConstrainedMap Edge_is_constrained_map) + Graph& g, + EdgeIsConstrainedMap Edge_is_constrained_map) { typedef boost::graph_traits< Graph > Traits; typedef typename Traits::vertex_descriptor vertex_descriptor; @@ -1798,9 +1798,8 @@ does_satisfy_link_condition(typename boost::graph_traits::edge_descriptor #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL template -bool - satisfies_link_condition(typename boost::graph_traits::edge_descriptor e, - const Graph& g) +bool satisfies_link_condition(typename boost::graph_traits::edge_descriptor e, + const Graph& g) { return does_satisfy_link_condition(e, g); } @@ -1808,9 +1807,8 @@ bool #endif /// @} -} // CGAL - -} // CGAL +} // namespace Euler +} // namespace CGAL #endif /* CGAL_EULER_OPERATIONS_H */ diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 9ea86004dec..25ec6153c5b 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -798,7 +798,8 @@ bool is_tetrahedron(typename boost::graph_traits::halfedge_descriptor returns `true` iff the connected component denoted by `hd` is a hexahedron. */ template -bool is_hexahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +bool is_hexahedron(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -856,10 +857,9 @@ clear_impl(FaceGraph& g) } template -void swap_vertices( - typename boost::graph_traits::vertex_descriptor& p, - typename boost::graph_traits::vertex_descriptor& q, - FaceGraph& g) +void swap_vertices(typename boost::graph_traits::vertex_descriptor& p, + typename boost::graph_traits::vertex_descriptor& q, + FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -874,10 +874,9 @@ void swap_vertices( } template -void swap_edges( - const typename boost::graph_traits::halfedge_descriptor& h1, - const typename boost::graph_traits::halfedge_descriptor& h2, - FaceGraph& g) +void swap_edges(const typename boost::graph_traits::halfedge_descriptor& h1, + const typename boost::graph_traits::halfedge_descriptor& h2, + FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index 323c0fbb089..08cc3551973 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -1307,7 +1307,6 @@ locate_in_common_face(std::pair::face else { const face_descriptor fd = boost::get(dv); - CGAL_precondition(fd != boost::graph_traits::null_face()); query_location = locate_in_face(query, fd, tm, np); From b597aa8aabedcfd886ab973a4735b80e974d940d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 22:19:35 +0200 Subject: [PATCH 122/248] Add is_valid_*_descriptor() overloads for Surface_mesh --- .../include/CGAL/Surface_mesh/Surface_mesh.h | 65 ++++++++++++------- .../boost/graph/graph_traits_Surface_mesh.h | 45 +++++++++++++ 2 files changed, 85 insertions(+), 25 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index dc30f94af43..a08689efaeb 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -1466,7 +1467,7 @@ public: /// perform an expensive validity check on the data structure and /// print found errors to `std::cerr` when `verbose == true`. - bool is_valid(bool verbose = true) const + bool is_valid(bool verbose = true) const { bool valid = true; size_type vcount = 0, hcount = 0, fcount = 0; @@ -1578,21 +1579,29 @@ public: } /// performs a validity check on a single vertex. - bool is_valid(Vertex_index v) const { + bool is_valid(Vertex_index v, + bool verbose = true) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(v)) return false; Halfedge_index h = vconn_[v].halfedge_; - if(h!= null_halfedge() && (!has_valid_index(h) || is_removed(h))) { - std::cerr << "Vertex connectivity halfedge error in " << (size_type)v - << " with " << (size_type)h << std::endl; - return false; + if(h != null_halfedge() && (!has_valid_index(h) || is_removed(h))) { + verr << "Vertex connectivity halfedge error: Vertex " << (size_type)v + << " with " << (size_type)h << std::endl; + return false; } return true; } /// performs a validity check on a single halfedge. - bool is_valid(Halfedge_index h) const { + bool is_valid(Halfedge_index h, + bool verbose = true) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(h)) return false; @@ -1605,30 +1614,30 @@ public: // don't validate the face if this is a border halfedge if(!is_border(h)) { if(!has_valid_index(f) || is_removed(f)) { - std::cerr << "Halfedge connectivity Face " - << (!has_valid_index(f) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: Face " + << (!has_valid_index(f) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } } if(!has_valid_index(v) || is_removed(v)) { - std::cerr << "Halfedge connectivity Vertex " - << (!has_valid_index(v) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: Vertex " + << (!has_valid_index(v) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } if(!has_valid_index(hn) || is_removed(hn)) { - std::cerr << "Halfedge connectivity hnext " - << (!has_valid_index(hn) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: hnext " + << (!has_valid_index(hn) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } if(!has_valid_index(hp) || is_removed(hp)) { - std::cerr << "Halfedge connectivity hprev " - << (!has_valid_index(hp) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: hprev " + << (!has_valid_index(hp) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } return valid; @@ -1636,25 +1645,31 @@ public: /// performs a validity check on a single edge. - bool is_valid(Edge_index e) const { + bool is_valid(Edge_index e, + bool verbose = true) const + { if(!has_valid_index(e)) return false; Halfedge_index h = halfedge(e); - return is_valid(h) && is_valid(opposite(h)); + return is_valid(h, verbose) && is_valid(opposite(h), verbose); } /// performs a validity check on a single face. - bool is_valid(Face_index f) const { + bool is_valid(Face_index f, + bool verbose = true) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(f)) return false; Halfedge_index h = fconn_[f].halfedge_; if(!has_valid_index(h) || is_removed(h)) { - std::cerr << "Face connectivity halfedge error in " << (size_type)f - << " with " << (size_type)h << std::endl; - return false; + verr << "Face connectivity halfedge error: Face " << (size_type)f + << " with " << (size_type)h << std::endl; + return false; } return true; } diff --git a/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h index 547b8374776..d044c38a557 100644 --- a/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h +++ b/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h @@ -528,6 +528,51 @@ template void normalize_border(const CGAL::Surface_mesh

    &) {} + +template +bool is_valid_vertex_descriptor(typename boost::graph_traits >::vertex_descriptor v, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(v, verbose)) + return false; + + return BGL::is_valid_vertex_descriptor(v, g, verbose); +} + +template +bool is_valid_halfedge_descriptor(typename boost::graph_traits >::halfedge_descriptor h, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(h, verbose)) + return false; + + return BGL::is_valid_halfedge_descriptor(h, g, verbose); +} + +template +bool is_valid_edge_descriptor(typename boost::graph_traits >::edge_descriptor e, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(e, verbose)) + return false; + + return BGL::is_valid_edge_descriptor(e, g, verbose); +} + +template +bool is_valid_face_descriptor(typename boost::graph_traits >::face_descriptor f, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(f, verbose)) + return false; + + return BGL::is_valid_face_descriptor(f, g, verbose); +} + } // namespace CGAL #endif // DOXYGEN_RUNNING From 34ea88c73d888346ec7edbffa4c1a9e6b2c95476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 4 Oct 2022 22:22:40 +0200 Subject: [PATCH 123/248] Use is_valid_*_descriptor --- .../CGAL/boost/graph/Euler_operations.h | 100 ++++++++++++++---- BGL/include/CGAL/boost/graph/generators.h | 5 + BGL/include/CGAL/boost/graph/helpers.h | 11 +- .../CGAL/Polygon_mesh_processing/bbox.h | 4 + .../Polygon_mesh_processing/compute_normal.h | 6 ++ .../Polygon_mesh_processing/detect_features.h | 2 + .../internal/refine_impl.h | 2 +- .../CGAL/Polygon_mesh_processing/locate.h | 26 +++-- .../CGAL/Polygon_mesh_processing/measure.h | 14 ++- .../merge_border_vertices.h | 2 + .../polygon_soup_to_polygon_mesh.h | 5 +- .../shape_predicates.h | 25 +++-- .../Polygon_mesh_processing/stitch_borders.h | 2 +- .../CGAL/Polygon_mesh_processing/triangle.h | 2 + .../triangulate_faces.h | 2 + .../triangulate_hole.h | 2 + 16 files changed, 155 insertions(+), 55 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 8bea4e264c4..6272bf861c5 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -43,6 +43,7 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); halfedge_descriptor hop = opposite(h,g); halfedge_descriptor hprev = prev(h, g), gprev = prev(hop, g); @@ -117,6 +118,8 @@ join_vertex(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::vertex_descriptor vertex_descriptor; typedef Halfedge_around_target_iterator halfedge_around_vertex_iterator; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + halfedge_descriptor hop = opposite(h, g) , hprev = prev(hop, g) , gprev = prev(h, g) @@ -191,8 +194,9 @@ split_vertex(typename boost::graph_traits::halfedge_descriptor h1, typename boost::graph_traits::halfedge_descriptor h2, Graph& g) { - CGAL_assertion(h1 != h2); - CGAL_assertion(target(h1, g) == target(h2, g)); + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + CGAL_precondition(h1 != h2); + CGAL_precondition(target(h1, g) == target(h2, g)); typename boost::graph_traits::halfedge_descriptor hnew = halfedge(add_edge(g), g), @@ -226,8 +230,11 @@ split_vertex(typename boost::graph_traits::halfedge_descriptor h1, template typename boost::graph_traits::halfedge_descriptor split_edge(typename boost::graph_traits::halfedge_descriptor h, Graph& g) -{ return opposite(split_vertex(prev(h,g), opposite(h,g),g), g); } +{ + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + return opposite(split_vertex(prev(h,g), opposite(h,g),g), g); +} /** * joins the two faces incident to `h` and `opposite(h,g)`. @@ -288,6 +295,12 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + CGAL_precondition(h1 != h2); + CGAL_precondition(face(h1, g) == face(h2, g)); + CGAL_precondition(next(h1, g) != h2 && next(h2, g) != h1); + halfedge_descriptor hnew = halfedge(add_edge(g), g); face_descriptor fnew = add_face(g); internal::insert_tip( hnew, h2, g); @@ -326,7 +339,9 @@ join_loop(typename boost::graph_traits::halfedge_descriptor h1, typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); CGAL_precondition( is_border(h1,g) || face(h1, g) != face(h2, g)); + if (! is_border(h1,g)) remove_face(face(h1, g), g); if (! is_border(h2,g)) @@ -400,13 +415,18 @@ split_loop(typename boost::graph_traits::halfedge_descriptor h1, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && + is_valid_halfedge_descriptor(h2, g) && + is_valid_halfedge_descriptor(h3, g)); + halfedge_descriptor h = h1, i = h2, j = h3; - CGAL_precondition( h != i); - CGAL_precondition( h != j); - CGAL_precondition( i != j); - CGAL_precondition( target(h,g) == target(opposite(i,g),g)); - CGAL_precondition( target(i,g) == target(opposite(j,g),g)); - CGAL_precondition( target(j,g) == target(opposite(h,g),g)); + CGAL_precondition(h != i); + CGAL_precondition(h != j); + CGAL_precondition(i != j); + CGAL_precondition(target(h,g) == target(opposite(i,g),g)); + CGAL_precondition(target(i,g) == target(opposite(j,g),g)); + CGAL_precondition(target(j,g) == target(opposite(h,g),g)); + // Create a copy of the triangle. halfedge_descriptor hnew = internal::copy(h,g); halfedge_descriptor inew = internal::copy(i,g); @@ -504,6 +524,7 @@ void remove_face(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); CGAL_precondition(! is_border(h,g)); face_descriptor f = face(h, g); @@ -551,6 +572,8 @@ add_edge(typename boost::graph_traits::vertex_descriptor s, typename boost::graph_traits::vertex_descriptor t, Graph& g) { + CGAL_precondition(is_valid_vertex_descriptor(s, g) && is_valid_vertex_descriptor(t, g)); + typename boost::graph_traits::edge_descriptor e = add_edge(g); set_target(halfedge(e, g), t, g); set_target(opposite(halfedge(e, g), g), s, g); @@ -568,6 +591,9 @@ bool can_add_face(const VertexRange& vrange, const PMesh& sm) typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition_code(for(vertex_descriptor v : vrange)) + CGAL_precondition(is_valid_vertex_descriptor(v, sm)); + std::vector::vertex_descriptor> face(vrange.begin(), vrange.end()); std::size_t N = face.size(); @@ -697,6 +723,9 @@ add_face(const VertexRange& vr, Graph& g) typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; + CGAL_precondition_code(for(vertex_descriptor v : vr)) + CGAL_precondition(is_valid_vertex_descriptor(v, g)); + std::vector vertices(vr.begin(), vr.end()); // quick and dirty copy unsigned int n = (unsigned int)vertices.size(); //check that every vertex is unique @@ -1115,7 +1144,9 @@ void make_hole(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::face_descriptor face_descriptor; typedef Halfedge_around_face_iterator halfedge_around_face_iterator; - CGAL_precondition(! is_border(h,g)); + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + CGAL_precondition(!is_border(h, g)); + face_descriptor fd = face(h, g); halfedge_around_face_iterator hafib, hafie; for(boost::tie(hafib, hafie) = halfedges_around_face(h, g); @@ -1139,6 +1170,9 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::face_descriptor face_descriptor; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + CGAL_precondition(!is_border(h, g)); + face_descriptor f = add_face(g); for(halfedge_descriptor hd : halfedges_around_face(h,g)){ set_face(hd, f,g); @@ -1179,6 +1213,9 @@ add_center_vertex(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + CGAL_precondition(!is_border(h, g)); + halfedge_descriptor hnew = halfedge(add_edge(g),g); vertex_descriptor vnew = add_vertex(g); internal::close_tip(hnew, vnew, g); @@ -1236,6 +1273,8 @@ remove_center_vertex(typename boost::graph_traits::halfedge_descriptor h, typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + // h points to the vertex that gets removed halfedge_descriptor h2 = opposite(next(h, g), g); halfedge_descriptor hret = prev(h, g); @@ -1283,14 +1322,28 @@ add_vertex_and_face_to_border(typename boost::graph_traits::halfedge_desc typename boost::graph_traits::halfedge_descriptor h2, Graph& g) { - typename boost::graph_traits::vertex_descriptor v = add_vertex(g); - typename boost::graph_traits::face_descriptor f = add_face(g); - typename boost::graph_traits::edge_descriptor e1 = add_edge(g); - typename boost::graph_traits::edge_descriptor e2 = add_edge(g); - typename boost::graph_traits::halfedge_descriptor he1= halfedge(e1, g); - typename boost::graph_traits::halfedge_descriptor he2= halfedge(e2, g); - typename boost::graph_traits::halfedge_descriptor ohe1= opposite(he1, g); - typename boost::graph_traits::halfedge_descriptor ohe2= opposite(he2, g); + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::edge_descriptor edge_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + CGAL_precondition(is_border(h1, g) && is_border(h2, g)); + CGAL_precondition(h1 != h2); + + CGAL_precondition_code(halfedge_descriptor h = h1;) + CGAL_precondition_code(const halfedge_descriptor done = h1;) + CGAL_precondition_code(do { if(h == h2) break; h = next(h, g); } while(h != done);) + CGAL_precondition(h != done); + + vertex_descriptor v = add_vertex(g); + face_descriptor f = add_face(g); + edge_descriptor e1 = add_edge(g); + edge_descriptor e2 = add_edge(g); + halfedge_descriptor he1 = halfedge(e1, g); + halfedge_descriptor he2 = halfedge(e2, g); + halfedge_descriptor ohe1= opposite(he1, g); + halfedge_descriptor ohe2= opposite(he2, g); set_next(ohe1, next(h1,g),g); set_next(h1,he1,g); @@ -1340,6 +1393,7 @@ add_face_to_border(typename boost::graph_traits::halfedge_descriptor h1, typename boost::graph_traits::halfedge_descriptor h2, Graph& g) { + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); CGAL_precondition(is_border(h1,g) == true); CGAL_precondition(is_border(h2,g) == true); CGAL_precondition(h1 != h2); @@ -1409,6 +1463,8 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, typedef typename Traits::vertex_descriptor vertex_descriptor; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_edge_descriptor(e, g)); + halfedge_descriptor pq = halfedge(e,g); halfedge_descriptor qp = opposite(pq, g); halfedge_descriptor pt = opposite(prev(pq, g), g); @@ -1527,8 +1583,10 @@ collapse_edge(typename boost::graph_traits::edge_descriptor v0v1, typedef typename Traits::vertex_descriptor vertex_descriptor; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_edge_descriptor(v0v1, g)); + CGAL_precondition(!get(Edge_is_constrained_map, v0v1)); + halfedge_descriptor pq = halfedge(v0v1,g); - CGAL_assertion( !get(Edge_is_constrained_map,v0v1) ); halfedge_descriptor qp = opposite(pq,g); halfedge_descriptor pt = opposite(prev(pq,g),g); @@ -1666,6 +1724,8 @@ flip_edge(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + vertex_descriptor s = source(h,g); vertex_descriptor t = target(h,g); halfedge_descriptor nh = next(h,g), nnh = next(nh,g), oh = opposite(h,g), noh = next(oh,g), nnoh = next(noh,g); @@ -1706,6 +1766,8 @@ does_satisfy_link_condition(typename boost::graph_traits::edge_descriptor typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef CGAL::Halfedge_around_source_iterator out_edge_iterator; + CGAL_precondition(is_valid_edge_descriptor(e, g)); + halfedge_descriptor v0_v1 = halfedge(e,g); halfedge_descriptor v1_v0 = opposite(v0_v1,g); diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index d49a53fd814..a4e91f177fb 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -195,6 +195,11 @@ make_quad(typename boost::graph_traits::vertex_descriptor v0, typename boost::graph_traits::vertex_descriptor v3, Graph& g) { + CGAL_precondition(is_valid_vertex_descriptor(v0, g) && + is_valid_vertex_descriptor(v1, g) && + is_valid_vertex_descriptor(v2, g) && + is_valid_vertex_descriptor(v3, g)); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; halfedge_descriptor h0 = halfedge(add_edge(g), g); diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 25ec6153c5b..961a27ae168 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -803,6 +803,8 @@ bool is_hexahedron(typename boost::graph_traits::halfedge_descriptor { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + halfedge_descriptor h1 = hd; if(is_border(h1,g)) return false; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -863,6 +865,8 @@ void swap_vertices(typename boost::graph_traits::vertex_descriptor& p { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_vertex_descriptor(p, g) && is_valid_vertex_descriptor(q, g)); + halfedge_descriptor hq=halfedge(q, g); halfedge_descriptor hp=halfedge(p, g); for(halfedge_descriptor h : halfedges_around_target(hq, g)) @@ -881,6 +885,9 @@ void swap_edges(const typename boost::graph_traits::halfedge_descript typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + const halfedge_descriptor oh1 = opposite(h1, g), oh2 = opposite(h2, g); // backup vertex pointers @@ -1010,6 +1017,8 @@ int vertex_index_in_face(const typename boost::graph_traits::vertex_descr { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_vertex_descriptor(vd, g) && is_valid_face_descriptor(fd, g)); + halfedge_descriptor start = halfedge(fd, g); halfedge_descriptor current = start; int counter = 0; @@ -1050,7 +1059,7 @@ int halfedge_index_in_face(typename boost::graph_traits::halfedge_descrip typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; - CGAL_precondition(he != boost::graph_traits::null_halfedge()); + CGAL_precondition(is_valid_halfedge_descriptor(he, g)); CGAL_precondition(!is_border(he, g)); face_descriptor f = face(he, g); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 580dccecb52..3c321c7bc18 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -179,6 +179,8 @@ namespace CGAL { using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_edge_descriptor(ed, pmesh)); + typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, pmesh)); @@ -234,6 +236,8 @@ namespace CGAL { using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(fd, pmesh)); + typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, pmesh)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index 2cd837e7bf8..0fd62621a84 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -89,6 +89,8 @@ void sum_normals(const PM& pmesh, typedef typename boost::property_traits::reference Point_ref; + CGAL_precondition(is_valid_face_descriptor(f, pmesh)); + halfedge_descriptor he = halfedge(f, pmesh); vertex_descriptor v = source(he, pmesh); vertex_descriptor the = target(he,pmesh); @@ -172,6 +174,8 @@ compute_face_normal(typename boost::graph_traits::face_descriptor f using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(f, pmesh)); + typedef typename GetGeomTraits::type GT; GT traits = choose_parameter(get_parameter(np, internal_np::geom_traits)); @@ -665,6 +669,8 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript using parameters::is_default_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_vertex_descriptor(v, pmesh)); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h index a2d1b368140..b8b80d5d437 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h @@ -57,6 +57,8 @@ is_sharp(const typename boost::graph_traits::halfedge_descriptor h, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); + if(is_border_edge(h, pmesh)) return false; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h index 727c5f50109..54369aee910 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h @@ -103,7 +103,7 @@ private: { for(face_descriptor fd : faces) { - CGAL_assertion(fd != boost::graph_traits::null_face()); + CGAL_assertion(is_valid_face_descriptor(fd, pmesh)); vertex_descriptor vi = target(halfedge(fd,pmesh),pmesh); vertex_descriptor vj = target(next(halfedge(fd,pmesh),pmesh),pmesh); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index 08cc3551973..2613b163d6e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -442,8 +442,8 @@ random_location_on_face(typename boost::graph_traits::face_descrip CGAL::Random& rnd = get_default_random()) { CGAL_USE(tm); - CGAL_precondition(CGAL::is_triangle_mesh(tm)); - CGAL_precondition(fd != boost::graph_traits::null_face()); + CGAL_precondition(is_valid_face_descriptor(fd, tm)); + CGAL_precondition(is_triangle(halfedge(fd, tm), tm)); // calling 'rnd.uniform real' with double in case FT comes from an EPECK kernel (which doesn't seem to work too well) FT u(rnd.uniform_real(0., 1.)); @@ -523,8 +523,8 @@ get_descriptor_from_location(const std::pair::null_face()); + CGAL_precondition(is_valid_face_descriptor(fd, tm)); + CGAL_precondition(is_triangle(halfedge(fd, tm), tm)); CGAL_precondition(is_in_face(loc, tm)); // the first barycentric coordinate corresponds to source(halfedge(fd, tm), tm) @@ -942,11 +942,10 @@ locate_vertex(typename boost::graph_traits::vertex_descriptor vd, } } - CGAL_postcondition(!CGAL::is_border(hd, tm)); // must find a 'real' face incident to 'vd' + CGAL_postcondition(!is_border(hd, tm)); // must find a 'real' face incident to 'vd' + CGAL_assertion(target(hd, tm) == vd); face_descriptor fd = face(hd, tm); - - CGAL_assertion(target(hd, tm) == vd); CGAL_assertion(fd != boost::graph_traits::null_face()); // isolated vertex @@ -989,7 +988,7 @@ locate_vertex(const typename boost::graph_traits::vertex_descripto const typename boost::graph_traits::face_descriptor fd, const TriangleMesh& tm) { - CGAL_precondition(fd != boost::graph_traits::null_face()); + CGAL_precondition(is_valid_vertex_descriptor(vd, tm) && is_valid_face_descriptor(fd, tm)); FT coords[3] = { FT(0), FT(0), FT(0) }; std::size_t vertex_local_index = vertex_index_in_face(vd, fd, tm); @@ -1121,14 +1120,14 @@ locate_in_face(const typename internal::Location_traits(get_parameter(np, internal_np::geom_traits)); FT snap_tolerance = choose_parameter(get_parameter(np, internal_np::snapping_tolerance), 0); - CGAL_precondition(fd != boost::graph_traits::null_face()); - vertex_descriptor vd0 = source(halfedge(fd, tm), tm); vertex_descriptor vd1 = target(halfedge(fd, tm), tm); vertex_descriptor vd2 = target(next(halfedge(fd, tm), tm), tm); @@ -1288,10 +1287,9 @@ locate_in_common_face(std::pair::face else if(const halfedge_descriptor* hd_ptr = boost::get(&dv)) { const halfedge_descriptor hd = *hd_ptr; - face_descriptor fd = face(hd, tm); - - if(fd != boost::graph_traits::null_face()) + if(!is_border(hd, tm)) { + face_descriptor fd = face(hd, tm); query_location = locate_in_face(query, fd, tm, np); internal::snap_location_to_border(query_location, tm, tolerance); // @tmp keep or not ? is_query_location_in_face = is_in_face(query_location, tm); @@ -1299,7 +1297,7 @@ locate_in_common_face(std::pair::face if(!is_query_location_in_face) { - fd = face(opposite(hd, tm), tm); + face_descriptor fd = face(opposite(hd, tm), tm); query_location = locate_in_face(query, fd, tm, np); is_query_location_in_face = is_in_face(query_location, tm); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h index 85b8dea7f29..c1b391a339a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h @@ -112,7 +112,7 @@ edge_length(typename boost::graph_traits::halfedge_descriptor h, using parameters::choose_parameter; using parameters::get_parameter; - CGAL_precondition(boost::graph_traits::null_halfedge() != h); + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -132,6 +132,8 @@ edge_length(typename boost::graph_traits::edge_descriptor e, const PolygonMesh& pmesh, const NamedParameters& np = parameters::default_values()) { + CGAL_precondition(is_valid_edge_descriptor(e, pmesh)); + return edge_length(halfedge(e, pmesh), pmesh, np); } @@ -187,7 +189,7 @@ squared_edge_length(typename boost::graph_traits::halfedge_descript using parameters::choose_parameter; using parameters::get_parameter; - CGAL_precondition(boost::graph_traits::null_halfedge() != h); + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -208,6 +210,8 @@ squared_edge_length(typename boost::graph_traits::edge_descriptor e const PolygonMesh& pmesh, const NamedParameters& np = parameters::default_values()) { + CGAL_precondition(is_valid_edge_descriptor(e, pmesh)); + return squared_edge_length(halfedge(e, pmesh), pmesh, np); } @@ -415,7 +419,7 @@ face_area(typename boost::graph_traits::face_descriptor f, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - CGAL_precondition(boost::graph_traits::null_face() != f); + CGAL_precondition(is_valid_face_descriptor(f, tmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -486,7 +490,7 @@ squared_face_area(typename boost::graph_traits::face_descriptor f, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - CGAL_precondition(boost::graph_traits::null_face() != f); + CGAL_precondition(is_valid_face_descriptor(f, tmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -741,7 +745,7 @@ face_aspect_ratio(typename boost::graph_traits::face_descriptor f, const TriangleMesh& tmesh, const CGAL_NP_CLASS& np = parameters::default_values()) { - CGAL_precondition(f != boost::graph_traits::null_face()); + CGAL_precondition(is_valid_face_descriptor(f, tmesh)); CGAL_precondition(is_triangle(halfedge(f, tmesh), tmesh)); typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h index b0a97548d83..5e15af9a1c4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h @@ -292,6 +292,8 @@ void merge_duplicated_vertices_in_boundary_cycle(typename boost::graph_traits::face_descriptor fd = - CGAL::Euler::add_face(vr, pmesh); - CGAL_assertion(fd != boost::graph_traits::null_face()); + typename boost::graph_traits::face_descriptor fd = CGAL::Euler::add_face(vr, pmesh); + CGAL_postcondition(is_valid_face_descriptor(fd, pmesh)); *i2f++ = std::make_pair(i, fd); } } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h index 63813d2186a..1bc1c90e677 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h @@ -80,6 +80,8 @@ bool is_degenerate_edge(typename boost::graph_traits::edge_descript using parameters::get_parameter; using parameters::choose_parameter; + CGAL_precondition(is_valid_edge_descriptor(e, pm)); + typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, pm)); @@ -190,11 +192,12 @@ bool is_degenerate_triangle_face(typename boost::graph_traits::fac const TriangleMesh& tm, const NamedParameters& np = parameters::default_values()) { - CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); - using parameters::get_parameter; using parameters::choose_parameter; + CGAL_precondition(is_valid_face_descriptor(f, tm)); + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tm)); @@ -396,14 +399,14 @@ is_needle_triangle_face(typename boost::graph_traits::face_descrip const double threshold, const NamedParameters& np = parameters::default_values()) { - CGAL_precondition(threshold >= 1.); - CGAL_precondition(f != boost::graph_traits::null_face()); - CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; using parameters::get_parameter; using parameters::choose_parameter; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_face_descriptor(f, tm)); + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + CGAL_precondition(threshold >= 1.); typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -545,15 +548,15 @@ is_cap_triangle_face(typename boost::graph_traits::face_descriptor const double threshold, const NamedParameters& np = parameters::default_values()) { - CGAL_precondition(f != boost::graph_traits::null_face()); - CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); - CGAL_precondition(threshold >= -1.); - CGAL_precondition(threshold <= 0.); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; using parameters::get_parameter; using parameters::choose_parameter; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_face_descriptor(f, tm)); + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + CGAL_precondition(threshold >= -1.); + CGAL_precondition(threshold <= 0.); typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index abe9160944c..b55fa22e6e3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -1063,7 +1063,7 @@ std::size_t stitch_boundary_cycle(const typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename std::pair halfedges_pair; - CGAL_precondition(h != boost::graph_traits::null_halfedge()); + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); CGAL_precondition(is_border(h, pmesh)); CGAL_precondition(is_valid(pmesh)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h index 7a131523f37..e174d04e10b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h @@ -66,6 +66,8 @@ triangle(typename boost::graph_traits::face_descriptor fd, using CGAL::parameters::choose_parameter; using CGAL::parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(fd, tmesh)); + typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, tmesh)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h index 0b48967f273..e90755b8344 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h @@ -474,6 +474,8 @@ bool triangulate_face(typename boost::graph_traits::face_descriptor using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(f, pmesh)); + //VertexPointMap typedef typename GetVertexPointMap::type VPMap; VPMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h index 71351e37125..8b64b403f73 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h @@ -468,6 +468,8 @@ namespace Polygon_mesh_processing { using parameters::choose_parameter; using parameters::get_parameter_reference; + CGAL_precondition(is_valid_halfedge_descriptor(border_halfedge, pmesh)); + std::vector::vertex_descriptor> patch; face_out = triangulate_and_refine_hole (pmesh, border_halfedge, face_out, std::back_inserter(patch), np).first; From 1098d6fd95a9831d86aae215fef7e72bd1a03eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 5 Oct 2022 12:49:10 +0200 Subject: [PATCH 124/248] Fix iDT incomplete graph_traits --- .../Intrinsic_Delaunay_triangulation_3.h | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 4006dc23be3..e011619b7ea 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -82,7 +82,8 @@ bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits) } template -struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor { +struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor +{ typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; halfedge_descriptor hd; @@ -99,6 +100,16 @@ struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor { explicit Intrinsic_Delaunay_triangulation_3_vertex_descriptor(const vertex_descriptor vd, const TriangleMesh& tm) : hd(halfedge(vd,tm)) {} + + bool operator==(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const + { + return hd == other.hd; + } + + bool operator!=(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const + { + return ! (*this == other); + } }; template @@ -549,6 +560,8 @@ struct graph_traits::vertices_size_type vertices_size_type; + static vertex_descriptor null_vertex() { return vertex_descriptor(boost::graph_traits::null_halfedge()); } + static halfedge_descriptor null_halfedge() { return boost::graph_traits::null_halfedge(); } static face_descriptor null_face() { return boost::graph_traits::null_face(); } }; @@ -589,7 +602,7 @@ template Iterator_range >::vertex_iterator> vertices(const Intrinsic_Delaunay_triangulation_3& idt) - { +{ std::pair::vertex_iterator, typename boost::graph_traits::vertex_iterator> p = vertices(idt.triangle_mesh()); @@ -597,7 +610,7 @@ vertices(const Intrinsic_Delaunay_triangulation_3& idt) Fct fct(idt.triangle_mesh()); return make_range(boost::make_transform_iterator(p.first, fct), boost::make_transform_iterator(p.second,fct)); - } +} template Iterator_range::face_iterator> faces(const Intrinsic_Delaunay_triangulation_3& idt) - { - return make_range( faces(idt.triangle_mesh()) ); - } +{ + return make_range( faces(idt.triangle_mesh()) ); +} template @@ -659,7 +672,7 @@ template typename boost::graph_traits >::halfedge_descriptor halfedge(typename boost::graph_traits >::edge_descriptor ed, - const Intrinsic_Delaunay_triangulation_3& idt) + const Intrinsic_Delaunay_triangulation_3& idt) { return halfedge(ed, idt.triangle_mesh()); } @@ -684,6 +697,23 @@ next(typename boost::graph_traits >::ha return next(hd, idt.triangle_mesh()); } +template +typename boost::graph_traits >::halfedge_descriptor +prev(typename boost::graph_traits >::halfedge_descriptor hd, + const Intrinsic_Delaunay_triangulation_3& idt) +{ + return prev(hd, idt.triangle_mesh()); +} + +template +typename boost::graph_traits >::edge_descriptor +edge(typename boost::graph_traits >::halfedge_descriptor hd, + const Intrinsic_Delaunay_triangulation_3& idt) +{ + return edge(hd, idt.triangle_mesh()); +} template From cbfeb98b389ce23b1c2db1a192e3bfed241c6668 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 5 Oct 2022 15:39:04 +0200 Subject: [PATCH 125/248] Apply suggestions from review Co-authored-by: Mael --- Mesh_2/doc/Mesh_2/Doxyfile.in | 2 +- Mesh_2/include/CGAL/Mesh_2/Clusters.h | 2 +- .../CGAL/Mesh_2/Mesh_global_optimizer_2.h | 6 +-- .../include/CGAL/Mesh_2/Mesh_sizing_field.h | 2 +- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 8 ++-- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 8 ++-- .../Mesh_3/mesh_hybrid_mesh_domain.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_domains.cpp | 2 +- .../Mesh_3/mesh_implicit_domains_2.cpp | 2 +- .../examples/Mesh_3/mesh_implicit_sphere.cpp | 2 +- .../mesh_implicit_sphere_variable_size.cpp | 2 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 7 +--- ...plus_weights_to_labeled_function_wrapper.h | 2 +- .../Image_to_labeled_function_wrapper.h | 2 +- Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h | 14 +++---- .../CGAL/Mesh_3/Mesh_global_optimizer.h | 10 ++--- .../include/CGAL/Mesh_3/Mesh_sizing_field.h | 2 +- .../CGAL/Mesh_3/Mesh_surface_cell_base_3.h | 26 ++++++------ Mesh_3/include/CGAL/Mesh_3/Mesher_level.h | 4 +- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 40 +++++++++---------- Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h | 10 ++--- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 24 +++++------ Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 12 +++--- Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h | 12 +++--- .../CGAL/Mesh_3/Triangulation_helpers.h | 8 ++-- .../CGAL/Mesh_3/Triangulation_sizing_field.h | 2 +- Mesh_3/include/CGAL/Mesh_3/parameters.h | 2 +- .../include/CGAL/Mesh_3/vertex_perturbation.h | 20 +++++----- .../CGAL/Mesh_constant_domain_field_3.h | 2 +- Mesh_3/include/CGAL/Mesh_criteria_3.h | 4 +- .../Mesh_domain_with_polyline_features_3.h | 4 +- Mesh_3/include/CGAL/make_mesh_3.h | 4 +- Mesh_3/include/CGAL/refine_mesh_3.h | 4 +- .../include/CGAL/make_periodic_3_mesh_3.h | 2 +- .../include/CGAL/optimize_periodic_3_mesh_3.h | 8 ++-- 35 files changed, 130 insertions(+), 133 deletions(-) diff --git a/Mesh_2/doc/Mesh_2/Doxyfile.in b/Mesh_2/doc/Mesh_2/Doxyfile.in index 61cfe8b2960..a277235f466 100644 --- a/Mesh_2/doc/Mesh_2/Doxyfile.in +++ b/Mesh_2/doc/Mesh_2/Doxyfile.in @@ -1,4 +1,4 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 2D Conforming Triangulations and Meshes" -INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_2.h \ No newline at end of file +INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_2.h diff --git a/Mesh_2/include/CGAL/Mesh_2/Clusters.h b/Mesh_2/include/CGAL/Mesh_2/Clusters.h index 050674305a7..93a42015025 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Clusters.h @@ -196,7 +196,7 @@ public: /** \name Functions to manage clusters during the refinement process. */ /** - * Update the cluster of `[va,vb]`, putting `vm` instead of `vb`. + * Updates the cluster of `[va,vb]`, putting `vm` instead of `vb`. * If reduction=false, the edge [va,vm] is not set reduced. */ void update_cluster(Cluster& c, iterator it, diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index ccd4c4746a6..a16d221a6b8 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -222,7 +222,7 @@ public: private: /** - * Returns moves for vertices of set `moving_vertices` + * Returns moves for vertices of set `moving_vertices`. */ Moves_vector compute_moves(Vertex_set& moving_vertices) { @@ -260,7 +260,7 @@ private: } /** - * Returns the move for vertex `v` + * Returns the move for vertex `v`. */ Vector_2 compute_move(const Vertex_handle& v) { @@ -284,7 +284,7 @@ private: } /** - * Returns the minimum cicumradius length of faces incident to `v` + * Returns the minimum cicumradius length of faces incident to `v`. */ FT min_sq_circumradius(const Vertex_handle& v) const { diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h index c82ef508225..b37602a8b57 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h @@ -99,7 +99,7 @@ public: private: /** - * Returns size at point `p`, by interpolation inside facet + * Returns size at point `p`, by interpolation inside facet. */ FT interpolate_on_face_vertices(const Point_2& #ifdef CGAL_MESH_2_SIZING_FIELD_USE_BARYCENTRIC_COORDINATES diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index b3f61d04fdb..18e48b2af45 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -63,12 +63,12 @@ namespace CGAL * the bounded connected components including at least * one seed. If `seeds_are_in_domain==false`, the domain is the * union of the bounded components including no seed.} - * \cgalParamType{a class model of `ConstRange` with iterator being a model of `InputIterator` with `CDT::Point_2` as value type.} + * \cgalParamType{a class model of `ConstRange` whose iterator is a model of `InputIterator` with `CDT::Point_2` as value type.} * \cgalParamDefault{No seed.} * \cgalParamNEnd * * \cgalParamNBegin{seeds_are_in_domain} - * \cgalParamDescription{specified if seeds indicates bounded connected components inside or outside of the domain.} + * \cgalParamDescription{specified if seeds indicate bounded connected components inside or outside of the domain.} * \cgalParamType{`bool`} * \cgalParamDefault{false} * \cgalParamNEnd @@ -82,7 +82,7 @@ namespace CGAL * \cgalParamNEnd * * \cgalParamNBegin{time_limit} - * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + * \cgalParamDescription{CPU time limit (in seconds) after which the optimization process is stopped. * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} * \cgalParamType{`double`} * \cgalParamPrecondition{`time_limit` \f$ \geq\f$ 0} @@ -127,7 +127,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va 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 freeze_bound = 0.001; /* choose_parameter(get_parameter(np, internal_np::freeze_bound), 0.001); */ + const double freeze_bound = choose_parameter(get_parameter(np, internal_np::freeze_bound), 0.001); const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), 0.); // Seeds // { 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 d1d2ab57741..d7f68d9e73d 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -101,7 +101,7 @@ unspecified_type manifold_with_boundary(); * refine_mesh_3(c3t3, * domain, * criteria, - * parameters::exude(parameters::time_limit=10)); + * parameters::exude(parameters::time_limit(10))); * \endcode * * \sa `CGAL::parameters::no_exude()` @@ -282,7 +282,7 @@ unspecified_type no_lloyd(); * \ingroup PkgMesh3Parameters * * The function `parameters::no_odt()` allows the user to tell the mesh generation functions - * `make_mesh_3()` and `refine_mesh_3()` that no odt optimization must be done. + * `make_mesh_3()` and `refine_mesh_3()` that no ODT optimization must be done. * * \cgalHeading{Example} * @@ -423,7 +423,7 @@ unspecified_type odt(const Named_function_parameters& np = parameters::default_v * is stopped. This time is measured using the `Real_timer` class. The default value is * 0 and means that there is no time limit.} * \cgalParamType{`double`} - * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} + * \cgalParamPrecondition{`time_limit >= 0`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalParamNBegin{sliver_bound} @@ -434,7 +434,7 @@ unspecified_type odt(const Named_function_parameters& np = parameters::default_v * default value is 0 and means that there is no targeted bound: the exuder then runs as long * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} * \cgalParamType{`double`} - * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} * \cgalParamDefault{0} * \cgalParamNEnd * \cgalNamedParamsEnd diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index ba278c43d42..d2ab9f47a39 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -214,7 +214,7 @@ int main() // (Warning: Sphere_3 constructor uses square radius !) Implicit_domain sphere_domain = Implicit_domain::create_implicit_mesh_domain(sphere_centered_at_111, - K::Sphere_3(K::Point_3(1, 1, 1), 2.)); + K::Sphere_3(K::Point_3(1, 1, 1), K::FT(2))); Domain domain(sphere_domain, polyhedron_domain); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index 5b56c06f935..0dcf61431e5 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -49,7 +49,7 @@ int main() v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), + Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, CGAL::square(K::FT(5))), params::relative_error_bound(1e-6)); // Set mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index c6fa7e3aef3..adff2af9689 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -46,7 +46,7 @@ int main() /// [Domain creation] (Warning: Sphere_3 constructor uses square radius !) namespace params = CGAL::parameters; Mesh_domain domain(Function_wrapper(v, vps), - K::Sphere_3(CGAL::ORIGIN,5.*5.), + K::Sphere_3(CGAL::ORIGIN, CGAL::square(K::FT(5))), params::relative_error_bound(1e-6)); /// [Domain creation] diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp index d184da23cd5..d2cec7e4d94 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp @@ -39,7 +39,7 @@ int main() /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain( sphere_function, - K::Sphere_3(CGAL::ORIGIN, 2.)); + K::Sphere_3(CGAL::ORIGIN, K::FT(2))); /// [Domain creation] // Mesh criteria diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index f04609b6a6b..7c4ad34100b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -52,7 +52,7 @@ int main() { /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (sphere_function, K::Sphere_3(CGAL::ORIGIN, 2.) + (sphere_function, K::Sphere_3(CGAL::ORIGIN, K::FT(2)) ); /// [Domain creation] diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index f1898ef41a9..7ece587fecb 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -272,7 +272,7 @@ if there are several components to mesh. The function type can be any model of the concept `Callable` compatible with the signature `Subdomain_index(const Point_3&)`: it can be a function, a function object, a lambda expression... that takes a `%Point_3` as argument, and returns a type convertible to `Subdomain_index`. -\cgalModels MeshDomain_3 +\cgalModels `MeshDomain_3` \sa `Implicit_multi_domain_to_labeling_function_wrapper` \sa `CGAL::make_mesh_3()`. @@ -509,7 +509,7 @@ public: auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; @@ -746,9 +746,6 @@ public: * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: * * \cgalNamedParamsBegin - * \cgalParamNBegin{function} - * \cgalParamDescription{the .} - * \cgalParamNEnd * \cgalParamNBegin{relative_error_bound} * \cgalParamDescription{ is the relative error * bound, relative to the diameter of the box of the image.} diff --git a/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h b/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h index a11d559cd9b..1c0adbcd617 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h +++ b/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h @@ -107,7 +107,7 @@ public: ~Image_plus_weights_to_labeled_function_wrapper() {} /** - * Returns an int corresponding to the label at point `p` + * Returns an int corresponding to the label at point `p`. * @param p the input point * @return the label at point `p` */ diff --git a/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h b/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h index 68e80886cf2..45246e4463d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h +++ b/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h @@ -72,7 +72,7 @@ public: ~Image_to_labeled_function_wrapper() {} /** - * Returns an int corresponding to the label at point `p` + * Returns an int corresponding to the label at point `p`. * @param p the input point * @return the label at point `p` */ diff --git a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h index 15bdd70d297..f709f4b4f1a 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h +++ b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h @@ -68,7 +68,7 @@ public: typedef SizingField Sizing_field; /** - * @brief Return the move to apply on `v` according to Lloyd optimization + * @brief Returns the move to apply on `v` according to Lloyd optimization * function. */ Vector_3 operator()(const Vertex_handle& v, @@ -162,7 +162,7 @@ private: /** - * Return the move for the inside vertex `v`. + * Returns the move for the inside vertex `v`. */ Vector_3 lloyd_move_inside_domain(const Vertex_handle& v, const Cell_vector& incident_cells, @@ -210,7 +210,7 @@ private: } /** - * Return the move for the on-boundary vertex `v`. + * Returns the move for the on-boundary vertex `v`. */ Vector_3 lloyd_move_on_boundary(const Vertex_handle& v, const C3T3& c3t3, @@ -298,7 +298,7 @@ private: } /** - * Return the move from `v` to the centroid of the segment [a,b]. + * Returns the move from `v` to the centroid of the segment `[a,b]`. */ Vector_3 centroid_segment_move(const Vertex_handle& v, const Bare_point& a, @@ -320,7 +320,7 @@ private: } /** - * Return the move from `v` to the centroid of triangle [a,b,c]. + * Returns the move from `v` to the centroid of triangle `[a,b,c]`. */ Vector_3 centroid_triangle_move(const Vertex_handle& v, const Bare_point& a, @@ -397,7 +397,7 @@ private: } /** - * Return the move from `v` to the centroid of polygon[first,last]. + * Returns the move from `v` to the centroid of polygon `[first,last]`. * The polygon has to be convex. */ template @@ -523,7 +523,7 @@ private: } /** - * Turn around the edge `edge` and add the values computed from tets made by + * Turns around the edge `edge` and adds the values computed from tets made by * `v` and the circumcenters of cells incident to `edge`. * * Note that this function abundantly uses dual() calls and using a cell base diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h index 55f02872963..714430116f6 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h @@ -313,12 +313,12 @@ public: private: /** - * Returns moves for vertices of set `moving_vertices` + * Returns moves for vertices of set `moving_vertices`. */ Moves_vector compute_moves(Moving_vertices_set& moving_vertices); /** - * Returns the move for vertex `v` + * Returns the move for vertex `v`. * \warning This function should be called only on moving vertices * even for frozen vertices, it could return a non-zero vector */ @@ -343,17 +343,17 @@ private: bool check_convergence() const; /** - * Returns the average circumradius length of cells incident to `v` + * Returns the average circumradius length of cells incident to `v`. */ FT average_circumradius_length(const Vertex_handle& v) const; /** - * Returns the minimum cicumradius length of cells incident to `v` + * Returns the minimum cicumradius length of cells incident to `v`. */ FT min_circumradius_sq_length(const Vertex_handle& v, const Cell_vector& incident_cells) const; /** - * Returns the squared circumradius length of cell `cell` + * Returns the squared circumradius length of cell `cell`. */ FT sq_circumradius_length(const Cell_handle& cell, const Vertex_handle& v) const; diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h index 406ec176778..e1d52d202f2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h @@ -107,7 +107,7 @@ public: Mesh_sizing_field(Tr& tr); /** - * Fill sizing field, using size associated to point in `value_map` + * Fills sizing field, using size associated to point in `value_map` */ void fill(const std::map& value_map); diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h index d261af5df77..3483e08ac54 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h @@ -55,21 +55,21 @@ public: Mesh_surface_cell_base_3_base() : bits_(0) {} - /// Marks `facet` as visited + /// Marks `facet` as visited. void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet <4); bits_ |= (1 << facet); } - /// Marks `facet` as not visited + /// Marks `facet` as not visited. void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); bits_ &= (15 & ~(1 << facet)); } - /// Returns `true` if `facet` is marked as visited + /// Returns `true` if `facet` is marked as visited. bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -92,7 +92,7 @@ public: bits_ = 0; } - /// Marks `facet` as visited + /// Marks `facet` as visited. void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -103,7 +103,7 @@ public: } } - /// Marks `facet` as not visited + /// Marks `facet` as not visited. void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -114,7 +114,7 @@ public: } } - /// Returns `true` if `facet` is marked as visited + /// Returns `true` if `facet` is marked as visited. bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -187,42 +187,42 @@ public: // Default copy constructor and assignment operator are ok - /// Set surface index of `facet` to `index` + /// Sets surface index of `facet` to `index` void set_surface_patch_index(const int facet, const Surface_patch_index& index) { CGAL_precondition(facet>=0 && facet<4); surface_index_table_[facet] = index; } - /// Returns surface index of facet `facet` + /// Returns surface index of facet `facet`. Surface_patch_index surface_patch_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_index_table_[facet]; } - /// Sets surface center of `facet` to `point` + /// Sets surface center of `facet` to `point`. void set_facet_surface_center(const int facet, const Point& point) { CGAL_precondition(facet>=0 && facet<4); surface_center_table_[facet] = point; } - /// Returns surface center of `facet` + /// Returns surface center of `facet`. Point get_facet_surface_center(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_center_table_[facet]; } - /// Sets surface center index of `facet` to `index` + /// Sets surface center index of `facet` to `index`. void set_facet_surface_center_index(const int facet, const Index& index) { CGAL_precondition(facet>=0 && facet<4); surface_center_index_table_[facet] = index; } - /// Returns surface center of `facet` + /// Returns surface center of `facet`. Index get_facet_surface_center_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -245,7 +245,7 @@ public: void set_surface_index(const int facet, const Surface_index& index) { set_surface_patch_index(facet,index); } - /// Returns surface index of facet `facet` + /// Returns surface index of facet `facet`. Surface_index surface_index(const int facet) const { return surface_patch_index(facet); } #endif // CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h index 51df82ede61..752e7630119 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h @@ -520,7 +520,7 @@ public: type is made of two booleans: - the first one tells if the point can be inserted, - in case of, the first one is `false`, the second one tells if - the tested element should be reconsidered latter. + the tested element should be reconsidered later. This function is called by the superior level, if any. */ Mesher_level_conflict_status @@ -805,7 +805,7 @@ public: type is made of two booleans: - the first one tells if the point can be inserted, - in case of, the first one is `false`, the second one tells if - the tested element should be reconsidered latter. + the tested element should be reconsidered later. This function is called by the superior level, if any. */ template diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 9e43a872b72..732999cc598 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -196,7 +196,7 @@ private: Vertex_handle get_vertex_corner_from_point(const Bare_point& p, const Index& p_index) const; - /// Insert point(p,w) into the triangulation and set its dimension to `dim` + /// Inserts `point(p,w)` into the triangulation and set its dimension to `dim` /// and its index to `index`. /// The handle of the newly created vertex is returned. Vertex_handle insert_point(const Bare_point& p, @@ -206,7 +206,7 @@ private: const bool special_ball = false); /** - * Insert point(p,w) into the triangulation and set its dimension to `dim` and + * Inserts `point(p,w)` into the triangulation and set its dimension to `dim` and * its index to `index`. * The handle of the newly created vertex is returned. * @@ -223,7 +223,7 @@ private: const Index& index, ErasedVeOutIt out); - /// Insert balls between the points identified by the handles `vp` and `vq` + /// Inserts balls between the points identified by the handles `vp` and `vq` /// on the curve identified by `curve_index`. /// /// \param orientation Orientation of the curve segment between `vp` and @@ -251,22 +251,22 @@ private: const Curve_index& curve_index, ErasedVeOutIt out); - /// Return `true` if the balls of `va` and `vb` intersect, and `(va,vb)` is not + /// Returns `true` if the balls of `va` and `vb` intersect, and `(va,vb)` is not /// an edge of the complex. bool non_adjacent_but_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Return `true` if the balls of `va` and `vb` intersect. + /// Returns `true` if the balls of `va` and `vb` intersect. bool do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Change the size of the ball of the vertex `v`. + /// Changes the size of the ball of the vertex `v`. Vertex_handle change_ball_size(const Vertex_handle& v, const FT squared_size, const bool special_ball = false); - /// Return `true` if balls of v1 and v2 intersect "enough". + /// Returns `true` if balls of v1 and v2 intersect "enough". /// \param orientation Orientation of the curve segment between `v1` and /// `v2`, given the orientation of the curve of index /// `curve_index` @@ -280,15 +280,15 @@ private: /// of those vertices is ok. If not, fix it. void check_and_repopulate_edges(); - /// Check if the vertex `v` is well sampled, and if its not the case, fix it. - /// Fill `out` with deleted vertices during this process. The value type of `out` + /// Checks if the vertex `v` is well sampled, and if its not the case, fix it. + /// Fills `out` with deleted vertices during this process. The value type of `out` /// is `Vertex_handle`. template ErasedVeOutIt check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out); /// Given two vertices `start` and `next` inserted on the curve with - /// index `curve_index`, return `CGAL::POSITIVE` if the curve arc from + /// index `curve_index`, returns `CGAL::POSITIVE` if the curve arc from /// `start` to `next` is oriented in the same orientation as the curve /// segment with index `curve_index`, or `CGAL::NEGATIVE` otherwise. /// @@ -298,7 +298,7 @@ private: const Vertex_handle& next, Curve_index curve_index) const; - /// Walk along the edge from `start`, following the direction `start` to + /// Walks along the edge from `start`, following the direction `start` to /// `next`, and fills `out` with the vertices which do not fulfill /// the sampling conditions. /// @@ -315,7 +315,7 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out) const; - /// Return the next vertex along edge, i.e the vertex after `start`, following + /// Returns the next vertex along edge, i.e the vertex after `start`, following /// the direction from `previous` to `start`. /// \pre (previous,start) is in c3t3 /// \pre `c3t3.curve_index(start, previous) == curve_index` @@ -324,7 +324,7 @@ private: const Vertex_handle& previous, const Curve_index& curve_index) const; - /// Replace the vertices between ]begin,last[ with new vertices, along the curve + /// Replaces the vertices within `]begin,last[` with new vertices, along the curve /// identified by `curve_index`. /// The value type of `InputIterator` is `Vertex_handle`. /// @@ -346,7 +346,7 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out); - /// Check if the size of `v2` is compatible (i.e. greater) with the linear + /// Checks if the size of `v2` is compatible (i.e. greater) with the linear /// interpolation of the sizes of `v1` and `v3`. bool is_sizing_field_correct(const Vertex_handle& v1, const Vertex_handle& v2, @@ -354,25 +354,25 @@ private: const Curve_index& index, const CGAL::Orientation orientation) const; - /// Repopulate all incident curves around the corner `v`. + /// Repopulates all incident curves around the corner `v`. /// \pre `v` is a corner of c3t3 template ErasedVeOutIt repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out); - /// Return `true` if the edge with index `curve_index` is already treated. + /// Returns `true` if the edge with index `curve_index` is already treated. bool is_treated(const Curve_index& curve_index) const { return ( treated_edges_.find(curve_index) != treated_edges_.end() ); } - /// Set the edge with index `curve_index` as treated. + /// Sets the edge with index `curve_index` as treated. void set_treated(const Curve_index& curve_index) { treated_edges_.insert(curve_index); } - /// Compute the Euclidean distance between the bare points of `va` and `vb`. + /// Computes the Euclidean distance between the bare points of `va` and `vb`. FT compute_distance(const Vertex_handle& va, const Vertex_handle& vb) const { typename C3T3::Triangulation::Geom_traits::Construct_point_3 cp = @@ -384,14 +384,14 @@ private: return compute_distance(cp(wpa), cp(wpb)); } - /// Compute the Euclidean distance between the bare points `p` and `q`. + /// Computes the Euclidean distance between the bare points `p` and `q`. FT compute_distance(const Bare_point& p, const Bare_point& q) const { return CGAL::sqrt(c3t3_.triangulation().geom_traits(). compute_squared_distance_3_object()(p,q)); } - /// Return the radius of the ball of vertex `v`. + /// Returns the radius of the ball of vertex `v`. FT get_radius(const Vertex_handle& v) const { typename Gt::Compute_weight_3 cw = diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h index 0fc61f63ec1..1f30da4bcff 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -438,7 +438,7 @@ public: // Parallel: it's always lazy, so do nothing void remove_element_from_refinement_queue(Cell_handle, Parallel_tag) {} - /// Handle cells contained in `zone` (before their destruction by insertion) + /// Handles cells contained in `zone` (before their destruction by insertion) void before_insertion_handle_cells_in_conflict_zone(Zone& zone); bool try_lock_element(const Cell_handle &ch, int lock_radius = 0) const @@ -479,7 +479,7 @@ public: return sstr.str(); } - /// Adds `cell` to the refinement queue if needed + /// Adds `cell` to the refinement queue if needed. void treat_new_cell(const Cell_handle& cell); #ifdef CGAL_MESH_3_MESHER_STATUS_ACTIVATED @@ -531,20 +531,20 @@ private: // Updates cells incident to vertex, and add them to queue if needed void update_star_self(const Vertex_handle& vertex); - /// Set `cell` to domain, with subdomain index `index` + /// Sets `cell` to domain, with subdomain index `index`. void set_cell_in_domain(const Cell_handle& cell, const Subdomain_index& index) { r_c3t3_.add_to_complex(cell, index); } - /// Removes `cell` from domain + /// Removes `cell` from domain. void remove_cell_from_domain(const Cell_handle& cell) { r_c3t3_.remove_from_complex(cell); } - /// Sets index and dimension of vertex `v` + /// Sets index and dimension of vertex `v`. void set_vertex_properties(Vertex_handle& v, const Index& index) { r_c3t3_.set_index(v, index); diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h index 84600b8616e..bb9e4f19860 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -409,19 +409,19 @@ protected: return ( (facet < mirror)?facet:mirror ); } - /// Returns true if `f` has already been visited + /// Returns true if `f` has already been visited. bool is_facet_visited(const Facet& f) const { return f.first->is_facet_visited(f.second); } - /// Sets facet `f` to visited + /// Sets facet `f` to visited. void set_facet_visited(Facet& f) const { f.first->set_facet_visited(f.second); } - /// Sets the facet `f` and its mirrored facet's surface centers to `p` + /// Sets the facet `f` and its mirrored facet's surface centers to `p`. void set_facet_surface_center(const Facet& f, const Bare_point& p, const Index& index) const @@ -435,13 +435,13 @@ protected: mirror.first->set_facet_surface_center_index(mirror.second,index); } - /// Returns facet surface center of `f` + /// Returns facet surface center of `f`. Bare_point get_facet_surface_center(const Facet& f) const { return f.first->get_facet_surface_center(f.second); } - /// Returns index of surface center of facet `f` + /// Returns index of surface center of facet `f`. Index get_facet_surface_center_index(const Facet& f) const { return f.first->get_facet_surface_center_index(f.second); @@ -454,13 +454,13 @@ protected: r_c3t3_.add_to_complex(f, index); } - /// Returns index of facet `f` + /// Returns index of facet `f`. Surface_patch_index get_facet_surface_index(const Facet& f) const { return r_c3t3_.surface_patch_index(f.first, f.second); } - /// Sets index and dimension of vertex `v` + /// Sets index and dimension of vertex `v`. void set_vertex_properties(Vertex_handle& v, const Index& index) { r_c3t3_.set_index(v, index); @@ -560,7 +560,7 @@ protected: return r_c3t3_.is_in_complex(f) ; } - /// Removes `f` from surface facets + /// Removes `f` from surface facets. void remove_facet_from_surface(const Facet& f) { r_c3t3_.remove_from_complex(f); @@ -595,7 +595,7 @@ protected: void treat_new_facet(Facet& facet); /** - * Computes at once is_facet_on_surface and facet_surface_center. + * Computes simultaneously `is_facet_on_surface` and `facet_surface_center`. * @param facet The input facet * @return `true` if `facet` is on surface, `false` otherwise */ @@ -835,12 +835,12 @@ public: Container_::get_next_local_element_impl()); } - /// Tests if `p` encroaches facet from zone + /// Tests if `p` encroaches facet from `zone`. // For sequential Mesher_level_conflict_status test_point_conflict_from_superior_impl(const Weighted_point& p, Zone& zone); - /// Tests if `p` encroaches facet from zone + /// Tests if `p` encroaches facet from `zone`. // For parallel template Mesher_level_conflict_status @@ -875,7 +875,7 @@ public: , bool &facet_is_in_its_cz , bool &could_lock_zone); - /// Insert `p` into the triangulation + /// Inserts `p` into the triangulation. Vertex_handle insert_impl(const Weighted_point& p, const Zone& zone); bool try_lock_element(const Facet &f, int lock_radius = 0) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 65f64176ef7..222eb87cc76 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -553,7 +553,7 @@ private: int build_priority_queue(const FT& sliver_bound, PQueue& pqueue) const; /** - * Updates priority queue for all vertices of `vertices` + * Updates priority queue for all vertices of `vertices`. */ // Sequential int update_priority_queue(const Vertex_vector& vertices, @@ -568,7 +568,7 @@ private: #endif /** - * Updates `pv` in priority queue + * Updates `pv` in priority queue. */ int update_priority_queue(const PVertex& pv, PQueue& pqueue) const; @@ -582,7 +582,7 @@ private: ) const; /** - * Returns a pvertex from a vertex handle `vh`, using id `pv_id` + * Returns a pvertex from a vertex handle `vh`, using the id `pv_id`. */ PVertex make_pvertex(const Vertex_handle& vh, @@ -595,13 +595,13 @@ private: const typename PVertex::id_type& pv_id) const; /** - * Updates a pvertex `pv` + * Updates a pvertex `pv`. */ void update_pvertex(PVertex& pv, const FT& sliver_bound) const; void update_pvertex__concurrent(PVertex& pv, const FT& sliver_bound) const; /** - * Returns `vh` pvertex id + * Returns `vh` pvertex id. */ typename PVertex::id_type get_pvertex_id(const Vertex_handle& vh) const { @@ -609,7 +609,7 @@ private: } /** - * Update bad vertices vector, wrt `sliver_bound` + * Updates bad vertices vector, wrt. `sliver_bound`. */ // Sequential void update_bad_vertices(std::vector &bad_vertices, diff --git a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h index 34d2430adb0..0f77cd3e283 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h +++ b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h @@ -172,7 +172,7 @@ protected: }; /** - * Delete cells of `cells` from `cells_queue` + * Deletes cells of `cells` from `cells_queue`. */ void delete_cells_from_queue(const Cell_vector& cells) { @@ -300,7 +300,7 @@ protected: }; /** - * Delete cells of `cells` from `cells_queue` + * Deletes cells of `cells` from `cells_queue`. */ void delete_cells_from_queue(const Cell_vector& cells) { @@ -595,7 +595,7 @@ private: /** * Returns the `Boundary_facets_from_outside` object containing mirror facets - * of `facets` + * of `facets`. */ Boundary_facets_from_outside get_boundary_facets_from_outside(const Facet_vector& facets) const @@ -616,7 +616,7 @@ private: } /** - * Add a cell `ch` to `cells_queue` + * Adds a cell `ch` to `cells_queue`. */ template void add_cell_to_queue(Cell_handle ch, FT criterion_value) @@ -651,7 +651,7 @@ private: }; /** - * Removes objects of [begin,end[ range from `c3t3_` + * Removes objects of [begin,end[ range from `c3t3_`. */ template void remove_from_c3t3(ForwardIterator begin, ForwardIterator end) @@ -853,7 +853,7 @@ private: /** * Checks if the sliver criterion values from `criterion_values` are the same as - * those that will be found if wp is inserted in the triangulation + * those that will be found if wp is inserted in the triangulation. */ bool check_ratios(const Sliver_values& criterion_values, const Weighted_point& wp, diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h index aa68f0d2604..c94cae006f8 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h @@ -109,8 +109,8 @@ public: ~Triangulation_helpers() {} /** - * Returns true if moving `v` to `p` makes no topological - * change in `tr` + * Returns `true` if moving `v` to `p` makes no topological + * change in `tr`. */ bool no_topological_change(Tr& tr, const Vertex_handle v, @@ -137,7 +137,7 @@ public: const Bare_point& p) const; /** - * Returns the squared distance from `vh` to its closest vertex + * Returns the squared distance from `vh` to its closest vertex. * * \pre `vh` is not the infinite vertex */ @@ -156,7 +156,7 @@ public: private: /** - * Returns true if `v` is well_oriented on each cell of `cell_tos` + * Returns `true` if `v` is well_oriented on each cell of `cell_tos`. */ // For sequential version bool well_oriented(const Tr& tr, diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h index 5cfd022f173..547365f9a1e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h @@ -73,7 +73,7 @@ public: Triangulation_sizing_field(const Tr& tr); /** - * Fill sizing field, using size associated to point in `value_map`. + * Fills the sizing field, using size associated to point in `value_map`. */ void fill(const std::map& value_map); diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h index 4786c7fab87..b38d501b29f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -31,4 +31,4 @@ namespace parameters { } } // end of CGAL::parameters namespace -#endif //CGAL_MESH_3_PARAMETERS_H \ No newline at end of file +#endif //CGAL_MESH_3_PARAMETERS_H diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index 39e4d2118b7..93b4119a1b1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -108,7 +108,7 @@ angle_in_radian(const Vector_3& u, const Vector_3& v) } /** - * @brief Returns the squared length of edge `e` + * @brief Returns the squared length of edge `e`. */ template typename Tr::Geom_traits::FT @@ -134,7 +134,7 @@ edge_sq_length(const typename Tr::Edge& e, /** * @brief Returns the minimal incident edge length of `v` - * in triangulation `tr` + * in triangulation `tr`. */ template typename Tr::Geom_traits::FT @@ -1054,7 +1054,7 @@ private: } /** - * @brief returns the cotangent of `value` + * @brief returns the cotangent of `value`. */ FT cotangent(const FT& value) const { @@ -1062,8 +1062,8 @@ private: } /** - * @brief returns the normal of facet (ch,i), oriented from inside to outside - * of `ch` + * @brief returns the normal of facet `(ch,i)`, oriented from inside to outside + * of `ch`. */ Vector_3 normal_estimate(const C3T3& c3t3, const Cell_handle& ch, const int i) const { @@ -1157,7 +1157,7 @@ protected: FT sphere_sq_radius() const { return sphere_sq_radius_; } /** - * @brief returns a FT between `min` and `max` + * @brief returns a FT between `min` and `max`. */ FT random_ft(const FT& min = FT(0.), const FT& max = FT(1.)) const { @@ -1166,7 +1166,7 @@ protected: } /** - * @brief returns a random vector with size `vector_size` + * @brief returns a random vector with size `vector_size`. */ Vector_3 random_vector_fixed_size(const C3T3& c3t3, const FT& vector_sq_size) const @@ -1184,7 +1184,7 @@ protected: } /** - * @brief returns a random vector with size between 0 and `vector_size` + * @brief returns a random vector with size between 0 and `vector_size`. */ Vector_3 random_vector_max_size(const C3T3& c3t3, const FT& vector_max_sq_size) const @@ -1299,7 +1299,7 @@ private: // ----------------------------------- /** - * @brief try to improve mesh using random moves of `v` + * @brief tries to improve mesh using random moves of `v`. */ std::pair apply_perturbation(const Vertex_handle& v, @@ -1410,7 +1410,7 @@ private: } private: - // If set to `true`, then random point will be generated on sphere surface. + // If set to `true`, then random points will be generated on sphere surface. bool on_sphere_; }; diff --git a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h index 152127033cf..002117b14ae 100644 --- a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h +++ b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h @@ -57,7 +57,7 @@ public: return d_; } - /// Sets size at any point of dimension `dim` and index `index` + /// Sets size at any point of dimension `dim` and index `index`. void set_size(const FT& size, const int dim, const Index& index) { values_.insert(std::make_pair(std::make_pair(dim,index),size)); diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 9beb9d844f2..7c2fe2a1162 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -134,7 +134,7 @@ and `MeshCriteriaWithFeatures_3`. It gathers the refinement criteria for mesh tetrahedra and surface facets where surface facets are facets in the mesh approximating the domain surface patches. -In addition, for domain with exposed 1-dimensional features, +In addition, for domains with exposed 1-dimensional features, the class `Mesh_criteria_3` handles the definition of a sizing field to guide the discretization of 1-dimensional features. @@ -228,7 +228,7 @@ typedef Mesh_cell_criteria_3 Cell_criteria; : Base(facet_criteria, cell_criteria) {} - /// Constructor from edge, face and cell criteria. + /// Constructor from edge, face, and cell criteria. Mesh_criteria_3(Edge_criteria edge_criteria, Facet_criteria facet_criteria, Cell_criteria cell_criteria) diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index ea08a9d0cac..7781f8b1ada 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -228,7 +228,7 @@ public: return result; } - /// Returns signed geodesic distance between `p` and `q` + /// Returns signed geodesic distance between `p` and `q`. FT signed_geodesic_distance(const Point_3& p, const Point_3& q) const { // Locate p & q on polyline @@ -587,7 +587,7 @@ public: /// Add a 0-dimensional feature in the domain. Corner_index add_corner(const Point_3& p); - /// Overloads where the last parameter `out` is not `CGAL::Emptyset_iterator()`. + /// Overload where the last parameter `out` is not `CGAL::Emptyset_iterator()`. template IndicesOutputIterator add_corners(InputIterator first, InputIterator end, diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 0eb884bcb36..f8f3727b941 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -391,14 +391,14 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. * Two named parameters control this behavior: *

      - *
    • `parameters::exude()` *
    • `parameters::no_exude()` + *
    • `parameters::exude()` *
    } * \cgalParamDefault{`parameters::exude()`} * \cgalParamSectionEnd * \cgalNamedParamsEnd * - * Note that whatever may be the optimization processes activated, + * Note that regardless of which optimization processes are activated, * they are always launched in the order that is a suborder * of the following (see user manual for further * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 85f90bd5b8b..8c3cd999864 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -115,7 +115,7 @@ private: * etc. * * The optimization phase is a sequence of optimization processes, - * amongst the following available optimizers: an ODT-smoothing, + * amongst the following available optimizers: an ODT smoothing, * a Lloyd smoothing, a sliver perturber, and a sliver exuder. * Each optimization process * can be activated or not, @@ -231,7 +231,7 @@ private: * The optimization parameters can be passed in arbitrary order. If one parameter * is not passed, its default value is used. The default values are * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - * Note that whatever may be the optimization processes activated, + * Note that regardless of which optimization processes are activated, * they are always launched in the order that is a suborder * of the following (see user manual for further * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index f94f4fe52fe..ba9935fddb7 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -290,7 +290,7 @@ struct C3t3_initializer * is not passed, its default value is used. The default values are * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. * - * Note that whatever may be the optimization processes activated, + * Note that regardless of which optimization processes are activated, * they are always launched in the order that is a suborder * of the following (see user manual for further * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. 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 34513504a0f..6c2c0fc4af0 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 @@ -31,7 +31,7 @@ namespace CGAL { * improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh. * * This function directly calls `perturb_mesh_3()`, but is provided for convenience. - * Further information can be found on the documentation of the function `perturb_mesh_3()`. + * Further information can be found in the documentation of the function `perturb_mesh_3()`. */ template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) @@ -84,7 +84,7 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS_1& * this optimization has been performed, all improvements will be lost. * * This function directly calls `exude_mesh_3()`, but is provided for convenience. - * Further information can be found on the documentation of the function `exude_mesh_3()`. + * Further information can be found in the documentation of the function `exude_mesh_3()`. */ template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) @@ -128,7 +128,7 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np * process based on the minimization of a global energy function. * * This function directly calls `odt_optimize_mesh_3()`, but is provided for convenience. - * Further information can be found on the documentation of the function `odt_optimize_mesh_3()`. + * Further information can be found in the documentation of the function `odt_optimize_mesh_3()`. */ template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) @@ -175,7 +175,7 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS * process based on the minimization of a global energy function. * * This function directly calls `lloyd_optimize_mesh_3()`, but is provided for convenience. - * Further information can be found on the documentation of the function `lloyd_optimize_mesh_3()`. + * Further information can be found in the documentation of the function `lloyd_optimize_mesh_3()`. * * \note This function requires the \ref thirdpartyEigen library. */ 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 126/248] 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); From d86db9fa7202bb32f51b5451be667366624f02fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 5 Oct 2022 16:51:31 +0200 Subject: [PATCH 127/248] fix compilation issues --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 2 +- .../include/CGAL/draw_constrained_triangulation_2.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 8a37d7226a2..57162e18a80 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -125,7 +125,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va 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 freeze_bound = choose_parameter(get_parameter(np, internal_np::freeze_bound), 0.001); + 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.); // Seeds // { diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index 7bc3856bc9d..d8aa3ccf92f 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -57,7 +57,7 @@ public: protected: void compute_face(Facet_const_handle fh) { - CGAL::IO::Color c = get(ipm, fh)? CGAL::yellow() : CGAL::white(); + CGAL::IO::Color c = get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); face_begin(c); add_point_in_face(fh->vertex(0)->point()); @@ -69,7 +69,7 @@ protected: void compute_edge(Edge_const_handle eh) { - CGAL::IO::Color c = t2.is_constrained(*eh)? CGAL::green() : CGAL::black(); + CGAL::IO::Color c = t2.is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); add_segment(eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point(), c); From 7e6d750af986cb287af5b69deda461e1153bb36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 5 Oct 2022 18:26:08 +0200 Subject: [PATCH 128/248] add missing const --- BGL/include/CGAL/boost/graph/internal/helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/internal/helpers.h b/BGL/include/CGAL/boost/graph/internal/helpers.h index b0a4ab885ae..4da0e59a63c 100644 --- a/BGL/include/CGAL/boost/graph/internal/helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/helpers.h @@ -168,7 +168,7 @@ exact_num_faces(const Graph& g) template bool is_isolated(typename boost::graph_traits::vertex_descriptor v, - Graph& g) + const Graph& g) { return halfedge(v, g) == boost::graph_traits::null_halfedge(); } From c0ff903d21771fd0fb2544bbe5bdef90c97705b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 5 Oct 2022 21:41:20 +0200 Subject: [PATCH 129/248] fix default values --- Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h | 2 +- Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h | 5 ----- Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 8 ++++---- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 6 +++--- Mesh_3/include/CGAL/perturb_mesh_3.h | 2 +- .../CGAL/STL_Extension/internal/mesh_option_classes.h | 7 +++++++ 7 files changed, 17 insertions(+), 15 deletions(-) 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 5571067fb91..65fa962d512 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -164,7 +164,7 @@ unspecified_type features(); * If it is set to 0, freezing of vertices is disabled.} * \cgalParamPrecondition{`0<= freeze_bound <=1`} * \cgalParamType{`double`} - * \cgalParamDefault{0.001} + * \cgalParamDefault{0.01} * \cgalParamNEnd * \cgalParamNBegin{convergence} * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h index b69945e77c1..12ec9eca38d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h @@ -29,8 +29,6 @@ namespace CGAL { namespace parameters { namespace default_values_for_mesh_3 { -// exude_mesh_3 -const double exude_sliver_bound = 0.; // perturb_mesh_3 template @@ -42,9 +40,6 @@ CGAL::Mesh_3::Min_dihedral_angle_criterion return CGAL::Mesh_3::Min_dihedral_angle_criterion(bound, c3t3.triangulation()); } -// global optimizers -const bool do_freeze = true; - } } // end namespace parameters::default_values_for_mesh_3 } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 35cdf3cc187..ac0700eb1b8 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -96,7 +96,7 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = { using parameters::choose_parameter; using parameters::get_parameter; - int time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + int time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); 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); } diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 7c5bdb8766a..f27c80fa401 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -82,7 +82,7 @@ namespace CGAL { * If it is set to 0, freezing of vertices is disabled.} * \cgalParamPrecondition{`0<= freeze_bound <=1`} * \cgalParamType{`double`} - * \cgalParamDefault{0.001} + * \cgalParamDefault{0.01} * \cgalParamNEnd * \cgalParamNBegin{convergence} * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped @@ -142,9 +142,9 @@ 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.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.); + const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), parameters::default_values_for_mesh_3::lloyd_convergence_ratio); + const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), parameters::default_values_for_mesh_3::lloyd_freeze_ratio); + const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), parameters::default_values_for_mesh_3::time_limit); bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index b606dce441f..966233d8482 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -136,10 +136,10 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain { using parameters::choose_parameter; using parameters::get_parameter; - double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); - double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); - double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),parameters::default_values_for_mesh_3::odt_convergence_ratio); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),parameters::default_values_for_mesh_3::odt_freeze_ratio); bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 0f7ddf30efd..c3534d03383 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -106,7 +106,7 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con { using parameters::choose_parameter; using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 4b60d895a87..4dab0134db6 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -212,6 +212,11 @@ struct Domain_features_generator< MeshDomain, true > namespace default_values_for_mesh_3 { +const double time_limit = 0.; + +// exude_mesh_3 +const double exude_sliver_bound = 0.; + // perturb_mesh_3 const double perturb_sliver_bound = 0.; @@ -223,6 +228,8 @@ const double lloyd_convergence_ratio = 0.02; const double odt_freeze_ratio = 0.01; const double odt_convergence_ratio = 0.02; +// global optimizers +const bool do_freeze = true; } } } //namespace CGAL::parameters::def From 5a022489074cf044e9779bfac3e807e013478e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 5 Oct 2022 21:50:39 +0200 Subject: [PATCH 130/248] remove disable as enable was removed --- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 -- Mesh_3/include/CGAL/make_mesh_3.h | 2 -- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 2 -- Mesh_3/include/CGAL/refine_mesh_3.h | 2 -- 4 files changed, 8 deletions(-) diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index f27c80fa401..1ad311b20fd 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index f8f3727b941..2d16c213a56 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 966233d8482..a8bd1e1b4d6 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 8c3cd999864..6fe10773a02 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -19,8 +19,6 @@ #include -#include - #include #include #include From 50938b98bc16681a20cc8427e1ff3af1f8270e75 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 5 Oct 2022 21:52:27 +0200 Subject: [PATCH 131/248] Add missing dot Co-authored-by: Mael --- Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h index bb9e4f19860..53461adecf3 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -447,7 +447,7 @@ protected: return f.first->get_facet_surface_center_index(f.second); } - /// Sets `f` to surface facets, with index `index` + /// Sets `f` to surface facets, with index `index`. void set_facet_on_surface(const Facet& f, const Surface_patch_index& index) { From b2c0dc94b7bfafba67a00027fd68be54c454a4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 5 Oct 2022 22:57:31 +0200 Subject: [PATCH 132/248] Fix bad precondition --- BGL/include/CGAL/boost/graph/Euler_operations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 6272bf861c5..30d481f8cdf 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -1171,7 +1171,7 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; CGAL_precondition(is_valid_halfedge_descriptor(h, g)); - CGAL_precondition(!is_border(h, g)); + CGAL_precondition(is_border(h, g)); face_descriptor f = add_face(g); for(halfedge_descriptor hd : halfedges_around_face(h,g)){ From e67b73e849ae346533f2f9490a9e98f790eb8946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 5 Oct 2022 22:58:40 +0200 Subject: [PATCH 133/248] Add some descriptor validity preconditions to BGL iterators --- BGL/include/CGAL/boost/graph/iterator.h | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index c8af78eaf8b..90ee1c370dd 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -815,6 +815,7 @@ Iterator_range > halfedges_around_source(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Halfedge_around_source_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -826,6 +827,7 @@ template Iterator_range > halfedges_around_source(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { + CGAL_precondition(is_valid_vertex_descriptor(v, g)); return halfedges_around_source(opposite(halfedge(v,g),g),g); } @@ -838,6 +840,7 @@ Iterator_range > halfedges_around_target(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Halfedge_around_target_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -849,6 +852,7 @@ template Iterator_range > halfedges_around_target(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { + CGAL_precondition(is_valid_vertex_descriptor(v, g)); return halfedges_around_target(halfedge(v,g),g); } @@ -861,6 +865,7 @@ Iterator_range > halfedges_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Halfedge_around_face_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -965,6 +970,7 @@ Iterator_range > faces_around_target(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Face_around_target_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -977,6 +983,7 @@ Iterator_range > faces_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Face_around_face_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1117,6 +1124,7 @@ Iterator_range > opposite_edges_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Opposite_edge_around_face_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1152,11 +1160,10 @@ Iterator_range > edges_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Edge_around_face_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } - - /** * \ingroup PkgBGLIterators * A bidirectional circulator with value type `boost::graph_traits::%vertex_descriptor` over all vertices adjacent to the same vertex. @@ -1273,15 +1280,16 @@ Iterator_range > adjacent_vertices(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Vertex_around_target_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } - template Iterator_range > adjacent_vertices(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { typedef Vertex_around_target_iterator I; + CGAL_precondition(is_valid_vertex_descriptor(v, g)); return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } @@ -1294,6 +1302,7 @@ Iterator_range > vertices_around_target(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Vertex_around_target_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1302,6 +1311,7 @@ Iterator_range > vertices_around_target(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { typedef Vertex_around_target_iterator I; + CGAL_precondition(is_valid_vertex_descriptor(v, g)); return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } /** @@ -1313,6 +1323,7 @@ Iterator_range > vertices_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Vertex_around_face_iterator I; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1355,9 +1366,6 @@ private: typename boost::graph_traits::edge_descriptor dereference() const { return opp(*this->base_reference()); } }; - - - template class In_edge_iterator : public boost::iterator_adaptor< @@ -1396,12 +1404,6 @@ public: typename boost::graph_traits::edge_descriptor dereference() const { return fct(*this->base_reference()); } }; - - - - - } // CGAL - #endif /* CGAL_BGL_ITERATORS_H */ From a7f2aeb75c2f6422779a6d6bd9cfc322370c5268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Oct 2022 09:14:40 +0200 Subject: [PATCH 134/248] Remove unused typedef --- BGL/include/CGAL/boost/graph/helpers.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 961a27ae168..21644ebf18f 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -82,8 +82,6 @@ bool is_valid_vertex_descriptor(typename boost::graph_traits::vertex_desc const Graph& g, const bool verb = false) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - Verbose_ostream verr(verb); bool valid = true; From bcf2f60be26b541b4adb45dbaf4c6e6c1660ba08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Oct 2022 09:19:47 +0200 Subject: [PATCH 135/248] Revert "Add some descriptor validity preconditions to BGL iterators" This reverts commit e67b73e849ae346533f2f9490a9e98f790eb8946. Some code such as copy_face_graph() uses iterators while building graphs --- BGL/include/CGAL/boost/graph/iterator.h | 26 ++++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index 90ee1c370dd..c8af78eaf8b 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -815,7 +815,6 @@ Iterator_range > halfedges_around_source(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Halfedge_around_source_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -827,7 +826,6 @@ template Iterator_range > halfedges_around_source(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { - CGAL_precondition(is_valid_vertex_descriptor(v, g)); return halfedges_around_source(opposite(halfedge(v,g),g),g); } @@ -840,7 +838,6 @@ Iterator_range > halfedges_around_target(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Halfedge_around_target_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -852,7 +849,6 @@ template Iterator_range > halfedges_around_target(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { - CGAL_precondition(is_valid_vertex_descriptor(v, g)); return halfedges_around_target(halfedge(v,g),g); } @@ -865,7 +861,6 @@ Iterator_range > halfedges_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Halfedge_around_face_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -970,7 +965,6 @@ Iterator_range > faces_around_target(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Face_around_target_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -983,7 +977,6 @@ Iterator_range > faces_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Face_around_face_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1124,7 +1117,6 @@ Iterator_range > opposite_edges_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Opposite_edge_around_face_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1160,10 +1152,11 @@ Iterator_range > edges_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Edge_around_face_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } + + /** * \ingroup PkgBGLIterators * A bidirectional circulator with value type `boost::graph_traits::%vertex_descriptor` over all vertices adjacent to the same vertex. @@ -1280,16 +1273,15 @@ Iterator_range > adjacent_vertices(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Vertex_around_target_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } + template Iterator_range > adjacent_vertices(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { typedef Vertex_around_target_iterator I; - CGAL_precondition(is_valid_vertex_descriptor(v, g)); return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } @@ -1302,7 +1294,6 @@ Iterator_range > vertices_around_target(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Vertex_around_target_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1311,7 +1302,6 @@ Iterator_range > vertices_around_target(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { typedef Vertex_around_target_iterator I; - CGAL_precondition(is_valid_vertex_descriptor(v, g)); return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } /** @@ -1323,7 +1313,6 @@ Iterator_range > vertices_around_face(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { typedef Vertex_around_face_iterator I; - CGAL_precondition(is_valid_halfedge_descriptor(h, g)); return make_range(I(h,g), I(h,g,1)); } @@ -1366,6 +1355,9 @@ private: typename boost::graph_traits::edge_descriptor dereference() const { return opp(*this->base_reference()); } }; + + + template class In_edge_iterator : public boost::iterator_adaptor< @@ -1404,6 +1396,12 @@ public: typename boost::graph_traits::edge_descriptor dereference() const { return fct(*this->base_reference()); } }; + + + + + } // CGAL + #endif /* CGAL_BGL_ITERATORS_H */ From 60e55fbeaa9bbc5d57b01369de86cd11f1d266de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Oct 2022 09:54:14 +0200 Subject: [PATCH 136/248] Change default verbosity to false in Surface_mesh element validity checks --- .../include/CGAL/Surface_mesh/Surface_mesh.h | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index a08689efaeb..bb2e317a130 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -1467,7 +1467,7 @@ public: /// perform an expensive validity check on the data structure and /// print found errors to `std::cerr` when `verbose == true`. - bool is_valid(bool verbose = true) const + bool is_valid(bool verbose = false) const { bool valid = true; size_type vcount = 0, hcount = 0, fcount = 0; @@ -1580,12 +1580,15 @@ public: /// performs a validity check on a single vertex. bool is_valid(Vertex_index v, - bool verbose = true) const + bool verbose = false) const { Verbose_ostream verr(verbose); if(!has_valid_index(v)) - return false; + { + verr << "Vertex has invalid index: " << (size_type)v << std::endl; + return false; + } Halfedge_index h = vconn_[v].halfedge_; if(h != null_halfedge() && (!has_valid_index(h) || is_removed(h))) { @@ -1598,12 +1601,15 @@ public: /// performs a validity check on a single halfedge. bool is_valid(Halfedge_index h, - bool verbose = true) const + bool verbose = false) const { Verbose_ostream verr(verbose); if(!has_valid_index(h)) + { + verr << "Halfedge has invalid index: " << (size_type)h << std::endl; return false; + } Face_index f = hconn_[h].face_; Vertex_index v = hconn_[h].vertex_; @@ -1646,10 +1652,15 @@ public: /// performs a validity check on a single edge. bool is_valid(Edge_index e, - bool verbose = true) const + bool verbose = false) const { + Verbose_ostream verr(verbose); + if(!has_valid_index(e)) + { + verr << "Edge has invalid index: " << (size_type)e << std::endl; return false; + } Halfedge_index h = halfedge(e); return is_valid(h, verbose) && is_valid(opposite(h), verbose); @@ -1658,12 +1669,15 @@ public: /// performs a validity check on a single face. bool is_valid(Face_index f, - bool verbose = true) const + bool verbose = false) const { Verbose_ostream verr(verbose); if(!has_valid_index(f)) + { + verr << "Face has invalid index: " << (size_type)f << std::endl; return false; + } Halfedge_index h = fconn_[f].halfedge_; if(!has_valid_index(h) || is_removed(h)) { From 13e34985ebd103e476b9956704b643911ac62ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Oct 2022 09:54:38 +0200 Subject: [PATCH 137/248] Fix test using invalid descriptors --- BGL/test/BGL/test_test_face.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BGL/test/BGL/test_test_face.cpp b/BGL/test/BGL/test_test_face.cpp index e69f7e3176e..aa4e0fa0879 100644 --- a/BGL/test/BGL/test_test_face.cpp +++ b/BGL/test/BGL/test_test_face.cpp @@ -23,9 +23,9 @@ int main() vertex_descriptor vs = CGAL::add_vertex(sm); std::array face0; assert( ! CGAL::Euler::can_add_face(face0,sm) ); - std::array face1; + std::array face1 = { vp }; assert( ! CGAL::Euler::can_add_face(face1,sm) ); - std::array face2; + std::array face2 = { vp, vq }; assert( ! CGAL::Euler::can_add_face(face2,sm) ); std::array face = { vp, vq, vr }; @@ -56,5 +56,7 @@ int main() assert( ! CGAL::Euler::can_add_face(face,sm) ); } + std::cout << "Done" << std::endl; + return 0; } From 5545eee9502d82b7a9bded8b79c7c4bf4c1d27b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Oct 2022 10:34:32 +0200 Subject: [PATCH 138/248] Revert "Check face graph validity and not just halfedge validity in post-reading BGL IO" This reverts commit 226f84f2e65848446c740d33d0451a7fa5eb6c7b. This is too strong and prevents reading some broken meshes that we still want to be able to read. Note that even is_valid_halfedge_graph() would return false --- BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h index b1a3bf3eeaf..331f8a0f44b 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h @@ -151,7 +151,7 @@ public: put(fcm, f, face_colors[i]); } - return is_valid_face_graph(g); + return is_valid(g); } protected: From fa3f8a5872678e3f91cc84b18c65cb73c430def1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 7 Oct 2022 11:21:02 +0100 Subject: [PATCH 139/248] Do the test if we want to assert at runtime only when CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME is defined --- STL_Extension/include/CGAL/assertions.h | 16 ++++++++++------ .../test/Straight_skeleton_2/test_sls_offset.cpp | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 9a0b9496810..6c58383474f 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -44,12 +44,8 @@ # define CGAL_NO_WARNINGS #endif -#if defined(CGAL_NO_ASSERTIONS) -namespace CGAL{ -inline void set_use_assertions(bool){} -inline bool get_use_assertions(){return true;} -} -#else +#if defined(CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME) + #include namespace CGAL{ inline bool& get_use_assertions() @@ -62,6 +58,14 @@ inline void set_use_assertions(bool b) get_use_assertions() = b; } } + +#else + +namespace CGAL{ +inline void set_use_assertions(bool){} +inline bool get_use_assertions(){return true;} +} + #endif diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index f1bb7fe7ffc..02082ff8724 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -2,6 +2,7 @@ #include #include +#define CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME #define CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE //#define CGAL_STRAIGHT_SKELETON_ENABLE_TRACE 100 From def163afc2d284b04ae40ec62b44574f4332f2a4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 7 Oct 2022 14:25:18 +0200 Subject: [PATCH 140/248] Update STL_Extension/include/CGAL/assertions.h Co-authored-by: Sebastien Loriot --- STL_Extension/include/CGAL/assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 6c58383474f..b9e145ec9e7 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -63,7 +63,7 @@ inline void set_use_assertions(bool b) namespace CGAL{ inline void set_use_assertions(bool){} -inline bool get_use_assertions(){return true;} +inline constexpr bool get_use_assertions(){return true;} } #endif From 1937d745781a5032a0868dd79638a2184e79c81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 10 Oct 2022 17:02:05 +0200 Subject: [PATCH 141/248] the workaround seems to be required for all MSVC versions --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 8 ++++---- Mesh_3/include/CGAL/Mesh_criteria_3.h | 2 +- Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/make_mesh_3.h | 2 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/perturb_mesh_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 2 +- Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h | 2 +- .../include/CGAL/optimize_periodic_3_mesh_3.h | 8 ++++---- Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 7ece587fecb..2159c4212ea 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -414,7 +414,7 @@ public: parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) {} -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Labeled_mesh_domain_3(const CGAL_NP_CLASS& ... nps) : Labeled_mesh_domain_3(internal_np::combine_named_parameters(nps...)) @@ -662,7 +662,7 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) { @@ -696,7 +696,7 @@ public: return create_labeled_image_mesh_domain(image_, np); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) { @@ -804,7 +804,7 @@ public: np); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& ... nps) { diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 7c2fe2a1162..ee746617190 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -288,7 +288,7 @@ Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np { } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_criteria_3(const CGAL_NP_CLASS& ... nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) { diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index ac0700eb1b8..e020d631513 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -109,7 +109,7 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, do } #endif #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 1ad311b20fd..70964c4cf3a 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -148,7 +148,7 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& doma } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 2d16c213a56..2d247257d54 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -451,7 +451,7 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index a8bd1e1b4d6..818de43e49f 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -144,7 +144,7 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index c3534d03383..0ecae5d6276 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -115,7 +115,7 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 6fe10773a02..06a27a790ff 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -286,7 +286,7 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index ba9935fddb7..f7bd01a3cbd 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -347,7 +347,7 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { 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 ca3c3020ac6..6c837d5add9 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 @@ -45,7 +45,7 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { @@ -95,7 +95,7 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C 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); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) { @@ -143,7 +143,7 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { @@ -192,7 +192,7 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) { 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 f47a1a3acc9..98678e08168 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 @@ -331,7 +331,7 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) template void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) { From c352a9cd2839a995cdd2032608aade6591b309e2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 11 Oct 2022 07:45:45 +0100 Subject: [PATCH 142/248] Address -Wunused-but-set-variable --- HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h | 7 +------ .../include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h | 2 -- Nef_2/include/CGAL/Nef_2/PM_const_decorator.h | 2 ++ Nef_2/include/CGAL/Nef_2/PM_point_locator.h | 2 ++ Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h | 2 ++ .../include/CGAL/Periodic_2_triangulation_2.h | 6 ------ .../CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h | 8 -------- .../include/CGAL/Surface_mesher/Surface_mesher_manifold.h | 4 +++- .../CGAL/Surface_mesher/Surface_mesher_regular_edges.h | 4 +++- 9 files changed, 13 insertions(+), 24 deletions(-) diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h b/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h index 92afeab7ae1..e65eb447e2e 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h @@ -795,8 +795,7 @@ public: Assert_compile_time_tag(Supports_vertex_halfedge(), Tag_true()); Assert_compile_time_tag(Supports_halfedge_vertex(), Tag_true()); - unsigned int nb_erased_components = 0, - nb_isolated_vertices = 0; + unsigned int nb_erased_components = 0; // Gets list of connected components, ordered by size (i.e. number of vertices) std::vector components; @@ -818,13 +817,9 @@ public: else // if isolated vertex { vertices_erase(vertex); - nb_isolated_vertices++; } } -// if (nb_isolated_vertices > 0) -// std::cerr << " Erased " << nb_isolated_vertices << " isolated vertices\n"; - return nb_erased_components; } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h index 10ab7f494f9..5793cc99e49 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h @@ -266,7 +266,6 @@ public: // Construct the segments of the convolution cycles. unsigned int curr_id = 0; - unsigned int cycles = 0; Segments_list conv_segments; Segments_list cycle; Labels_set used_labels; @@ -340,7 +339,6 @@ public: CGAL_assertion(cycle.empty()); } } - ++cycles; } curr1 = next1; diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index 8ccfb77c1b6..f95e1daefbd 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -485,6 +485,8 @@ check_integrity_and_topological_planarity(bool faces) const std::size_t e_num = number_of_edges(); std::size_t c_num = number_of_connected_components() - iso_vert_num; std::size_t f_num = number_of_face_cycles() - c_num + 1; + CGAL_USE(fc_num); + CGAL_USE(iv_num); CGAL_USE(v_num); CGAL_USE(e_num); CGAL_USE(f_num); diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 0f1443d4e55..ede8d2b033a 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -665,6 +666,7 @@ protected: } + CGAL_USE(flip_count); CGAL_NEF_TRACEN(" flipped "<::insert_first(const Point& p) CGAL_triangulation_assertion(_too_long_edge_counter == 0); // Insert all vertices as the first vertex in the _too_long_edges list - int k = 0; std::list empty_list; for (Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit) { _too_long_edges[vit] = empty_list; - k++; } // Insert all edges as all edges are too long @@ -3466,11 +3464,9 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() _cover = make_array(3, 3); // Set up too long edges data structure - int i = 0; for (Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit) { _too_long_edges[vit] = std::list(); - ++i; } _too_long_edge_counter = find_too_long_edges(_too_long_edges); @@ -4434,12 +4430,10 @@ Periodic_2_triangulation_2::load(std::istream& is) for (std::size_t j = 0 ; j < m; j++) is >> *(F[j]); - int i = 0; for (Vertex_iterator vi = vertices_begin(); vi != vertices_end(); ++vi) { _too_long_edges[vi] = std::list(); - ++i; } _edge_length_threshold = FT(0.166) * (_domain.xmax() - _domain.xmin()) diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h index f08eb4316ae..9c35f04b691 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h @@ -165,15 +165,11 @@ public: spatial_sort(points.begin(), points.end(), geom_traits()); Face_handle f; - int cnt = 0; - int cnt_good = 0; for(typename std::vector::const_iterator p=points.begin(), end = points.end(); p != end; ++p) { - ++cnt; Vertex_handle v = insert(*p, f); if(v != Vertex_handle()) { - ++cnt_good; f = v->face(); } } @@ -596,8 +592,6 @@ remove(Vertex_handle v) Nbr_history failsafe; - int internb = 0; - int bdrynb = 0; for(std::size_t i=0; ivertex(cw(k)) == new_f[l]->vertex(ccw(j))) { tds().set_adjacency(new_f[i], k, new_f[l], j); - internb++; break; } } diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h index 1638fc00565..71b6cb08cbd 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h @@ -107,15 +107,17 @@ namespace CGAL { { #ifdef CGAL_SURFACE_MESHER_VERBOSE std::cerr << "scanning vertices" << std::endl; -#endif int n = 0; +#endif for (Finite_vertices_iterator vit = SMMBB::tr.finite_vertices_begin(); vit != SMMBB::tr.finite_vertices_end(); ++vit) { if ( (SMMBB::c2t3.face_status(vit) // @TODO: appeler is_regular == C2t3::SINGULAR) ) { bad_vertices.insert( vit ); +#ifdef CGAL_SURFACE_MESHER_VERBOSE ++n; +#endif } } bad_vertices_initialized = true; diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h index 815ca228874..25095602a93 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h @@ -213,8 +213,8 @@ namespace CGAL { if(withBoundary) std::cerr << "(boundaries allowed)"; std::cerr << "...\n"; -#endif int n = 0; +#endif for (Finite_edges_iterator eit = SMB::tr.finite_edges_begin(); eit != SMB::tr.finite_edges_end(); ++eit) { if ( (SMB::c2t3.face_status(*eit) @@ -223,7 +223,9 @@ namespace CGAL { (SMB::c2t3.face_status(*eit) == C2t3::BOUNDARY) ) ) { bad_edges.insert( edge_to_edgevv(*eit) ); +#ifdef CGAL_SURFACE_MESHER_VERBOSE ++n; +#endif } } bad_edges_initialized = true; From db44e2853cb951a89725b1972041b30e672b779a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 11 Oct 2022 09:31:57 +0100 Subject: [PATCH 143/248] Polish in CGAL/algorithm.h --- .../doc/STL_Extension/CGAL/algorithm.h | 85 +++---------------- 1 file changed, 13 insertions(+), 72 deletions(-) diff --git a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h index 1e520e6defc..13fa64df19b 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h +++ b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h @@ -2,32 +2,6 @@ /// \ingroup PkgSTLExtensionRef -namespace CGAL { - -/*! -\ingroup STLAlgos - -\deprecated This function is deprecated, `std::copy_n()` should be -used instead. - -Copies the first `n` items from `first` to `result`. - -\returns the value of `result` after inserting the `n` items. - -\note The \stl release June 13, 1997, from SGI contains an equivalent -function, but it is not part of the ISO standard. - -\sa `CGAL::Counting_iterator` - -copies - -*/ -template OutputIterator copy_n(InputIterator first, Size n, -OutputIterator result); - -} /* namespace CGAL */ - namespace CGAL { /*! @@ -35,9 +9,10 @@ namespace CGAL { Computes the minimal and the -maximal element of a range. It is modeled after the STL functions -`std::min_element()` and `std::max_element()`. The advantage of -`min_max_element()` compared to calling both STL functions is that +maximal element of a range. It is modeled after the \stl functions +`std::min_element` +and `std::max_element`. +The advantage of `min_max_element()` compared to calling both \stl functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences. @@ -64,9 +39,11 @@ first, ForwardIterator last); \ingroup STLAlgos Computes the minimal and the -maximal element of a range. It is modeled after the STL functions -`std::min_element()` and `std::max_element()`. The advantage of -`min_max_element()` compared to calling both STL functions is that +maximal element of a range. It is modeled after the \stl functions +`std::min_element` +and `std::max_element`. +The advantage of `min_max_element()` compared to calling both \stl functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences. @@ -90,53 +67,18 @@ CompareMin comp_min, CompareMax comp_max); } /* namespace CGAL */ -namespace CGAL { - -/*! -\ingroup STLAlgos - -\deprecated This function is deprecated. `std::prev()` should be used -instead. - -Returns the previous iterator, -i.e.\ the result of `operator--()` on a bidirectional iterator. - -\sa `CGAL::successor()` - -\returns `--it`. -*/ -template -BidirectionalIterator predecessor(BidirectionalIterator it); - -} /* namespace CGAL */ namespace CGAL { -/*! -\ingroup STLAlgos - -\deprecated This function is deprecated. `std::next()` should be used -instead. - - -Returns the next iterator, i.e., -the result of `operator++()` on a forward iterator. - - -\sa `CGAL::predecessor()` - -*/ -template -ForwardIterator successor(ForwardIterator it); namespace cpp98 { /*! \ingroup STLAlgos -Replacement for `std::random_shuffle()` +Replacement for `std::random_shuffle` which was deprecated in C++14, and removed by C++17. -In the \stl it was replaced by `std::shuffle()`. +In the \stl it was replaced by `std::shuffle`. \note The implementation in \cgal produces the same order on all platforms. */ @@ -148,9 +90,9 @@ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end, /*! \ingroup STLAlgos -Replacement for `std::random_shuffle()` +Replacement for `std::random_shuffle` which was deprecated in C++14, and removed by C++17. -In the \stl it was replaced by `std::shuffle()`. +In the \stl it was replaced by `std::shuffle`. \note The implementation in \cgal produces the same order on all platforms. */ @@ -160,4 +102,3 @@ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end); } // namespace cpp98 } /* namespace CGAL */ - From 16ed309a297b2d1f2229c5ef0b204f98b787399f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 11 Oct 2022 11:30:44 +0200 Subject: [PATCH 144/248] Fix the list of documented algorithms --- STL_Extension/doc/STL_Extension/PackageDescription.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/STL_Extension/doc/STL_Extension/PackageDescription.txt b/STL_Extension/doc/STL_Extension/PackageDescription.txt index a4df6c9b0bb..552378e03e6 100644 --- a/STL_Extension/doc/STL_Extension/PackageDescription.txt +++ b/STL_Extension/doc/STL_Extension/PackageDescription.txt @@ -41,10 +41,8 @@ - `CGAL::Multiset` \cgalCRPSection{Generic Algorithms} -- `CGAL::copy_n` - `CGAL::min_max_element` -- `CGAL::predecessor` -- `CGAL::successor` +- `CGAL::cpp98::random_shuffle` \cgalCRPSection{Iterators and Iterator/Circulator Adaptors} - `CGAL::Dispatch_output_iterator` From 4f758f846d530f197023b50f07aac9b7b78e912e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 11 Oct 2022 11:36:42 +0200 Subject: [PATCH 145/248] Remove two more mentions of CGAL::copy_n --- Generator/doc/Generator/Generator.txt | 2 +- STL_Extension/doc/STL_Extension/CGAL/iterator.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Generator/doc/Generator/Generator.txt b/Generator/doc/Generator/Generator.txt index fe9e9acc0c7..3e2e4e3c856 100644 --- a/Generator/doc/Generator/Generator.txt +++ b/Generator/doc/Generator/Generator.txt @@ -18,7 +18,7 @@ Two kinds of point generators are provided: first, random point generators and second deterministic point generators. Most random point generators and a few deterministic point generators are provided as input iterators. The input iterators model an infinite sequence of -points. The function `CGAL::copy_n()` can be used to copy a +points. The algorithm `std::copy_n` can be used to copy a finite sequence. The iterator adaptor `Counting_iterator` can be used to create finite iterator ranges. diff --git a/STL_Extension/doc/STL_Extension/CGAL/iterator.h b/STL_Extension/doc/STL_Extension/CGAL/iterator.h index feab1826f47..9ebab0a5890 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/iterator.h +++ b/STL_Extension/doc/STL_Extension/CGAL/iterator.h @@ -61,8 +61,6 @@ from input iterators. `Iterator` is a model for `InputIterator`. -\sa `CGAL::copy_n()` - */ template< typename Iterator, typename Value > From 56eb3c59e1f00ba3eec91e4574dec0e6cd53b89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 14:50:14 +0200 Subject: [PATCH 146/248] apply suggestions from review --- Mesh_3/include/CGAL/Mesh_criteria_3.h | 16 ++++++++-------- .../CGAL/Mesh_domain_with_polyline_features_3.h | 2 +- Mesh_3/include/CGAL/refine_mesh_3.h | 2 +- .../include/CGAL/optimize_periodic_3_mesh_3.h | 2 +- .../include/CGAL/Named_function_parameters.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index ee746617190..3d443afc466 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -152,16 +152,16 @@ and `C3T3::Triangulation` its nested triangulation type. \code{.cpp} // Create a Mesh_criteria_3 object with all cell and facet parameters set -Mesh_criteria_3 criteria (parameters::facet_angle=30, - parameters::facet_size=1, - parameters::facet_distance=0.1, - parameters::cell_radius_edge_ratio=2, - parameters::cell_size=1.5); +Mesh_criteria_3 criteria (parameters::facet_angle(30). + parameters::facet_size(1). + parameters::facet_distance(0.1). + parameters::cell_radius_edge_ratio(2). + parameters::cell_size(1.5)); // Create a Mesh_criteria_3 object with size ignored (note that the order changed) -Mesh_criteria_3 criteria (parameters::cell_radius_edge_ratio=2, - parameters::facet_angle=30, - parameters::facet_distance=0.1); +Mesh_criteria_3 criteria (parameters::cell_radius_edge_ratio(2). + parameters::facet_angle(30). + parameters::facet_distance(0.1)); \endcode diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index 7781f8b1ada..ad6cb667cba 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -605,7 +605,7 @@ public: Corner_index register_corner(const Point_3& p, const Curve_index& index); Corner_index add_corner_with_context(const Point_3& p, const Surface_patch_index& index); - /// Overloads where the last parameter `out` is not + /// Overload where the last parameter `out` is not /// `CGAL::Emptyset_iterator()`. template IndicesOutputIterator diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 06a27a790ff..21b159bd764 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -303,7 +303,7 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const * @brief This function refines the mesh c3t3 wrt domain & criteria * * @param c3t3 the mesh to be refined. - * @param domain the domain used to create the `c3t3` parameter + * @param domain the domain used to be discretized * @param criteria the criteria * @param exude if `true`, an exudation step will be done at * the end of the Delaunay refinement process 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 6c837d5add9..7b048c15d9d 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 @@ -38,7 +38,7 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& { using parameters::choose_parameter; using parameters::get_parameter; - double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index 4f6cea2f174..e8d22f685d6 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -484,7 +484,7 @@ struct Boost_parameter_compatibility_wrapper typedef Named_function_parameters Params;\ return Params(p); \ } -// TODO: need to make sure this works when using several compilation units + #define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ const Boost_parameter_compatibility_wrapper Z; #define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ From 6145499ec7aeaac8b74de2da8d9f716397e43915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 14:54:03 +0200 Subject: [PATCH 147/248] nullptr --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 2159c4212ea..bbac45b3ee7 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -589,7 +589,7 @@ public: auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); @@ -643,7 +643,7 @@ public: auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; @@ -776,7 +776,7 @@ public: using parameters::get_parameter; using parameters::choose_parameter; FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); - CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), (CGAL::Random*)(0)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; From 775409dfd8a06e86c1b4a245c1132000e2e1b26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 14:58:12 +0200 Subject: [PATCH 148/248] remove useless links --- Mesh_3/include/CGAL/make_mesh_3.h | 13 ------------- .../include/CGAL/make_periodic_3_mesh_3.h | 13 ------------- .../include/CGAL/refine_periodic_3_mesh_3.h | 8 -------- 3 files changed, 34 deletions(-) diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 2d247257d54..5319c0cf11f 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -411,23 +411,10 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > * optimization processes. * * \sa `refine_mesh_3()` - * \sa `parameters::features()` - * \sa `parameters::no_features()` - * \sa `parameters::manifold()` - * \sa `parameters::manifold_with_boundary()` - * \sa `parameters::non_manifold()` * \sa `exude_mesh_3()` * \sa `perturb_mesh_3()` * \sa `lloyd_optimize_mesh_3()` * \sa `odt_optimize_mesh_3()` - * \sa `parameters::exude()` - * \sa `parameters::no_exude()` - * \sa `parameters::perturb()` - * \sa `parameters::no_perturb()` - * \sa `parameters::lloyd()` - * \sa `parameters::no_lloyd()` - * \sa `parameters::odt()` - * \sa `parameters::no_odt()` */ template C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index f7bd01a3cbd..f12ed4bc415 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -306,23 +306,10 @@ struct C3t3_initializer * * \sa `refine_periodic_3_mesh_3()` * \sa `make_mesh_3()` - * \sa `parameters::features()` - * \sa `parameters::no_features()` - * \sa `parameters::manifold()` - * \sa `parameters::manifold_with_boundary()` - * \sa `parameters::non_manifold()` * \sa `exude_mesh_3()` * \sa `perturb_mesh_3()` * \sa `lloyd_optimize_mesh_3()` * \sa `odt_optimize_mesh_3()` - * \sa `parameters::exude()` - * \sa `parameters::no_exude()` - * \sa `parameters::perturb()` - * \sa `parameters::no_perturb()` - * \sa `parameters::lloyd()` - * \sa `parameters::no_lloyd()` - * \sa `parameters::odt()` - * \sa `parameters::no_odt()` */ template C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) 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 98678e08168..b97b2c99604 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 @@ -296,14 +296,6 @@ void project_points(C3T3& c3t3, * \sa `perturb_periodic_3_mesh_3()` * \sa `lloyd_optimize_periodic_3_mesh_3()` * \sa `odt_optimize_periodic_3_mesh_3()` - * \sa `parameters::exude` - * \sa `parameters::no_exude` - * \sa `parameters::perturb` - * \sa `parameters::no_perturb` - * \sa `parameters::lloyd` - * \sa `parameters::no_lloyd` - * \sa `parameters::odt` - * \sa `parameters::no_odt` */ template void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) From 142190007dd291e6a1816471c94dcb71912ae5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 15:30:10 +0200 Subject: [PATCH 149/248] uniform within a call --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index bbac45b3ee7..6547264895a 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -514,12 +514,12 @@ public: auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (p::function(create_gray_image_wrapper + (p::function = create_gray_image_wrapper (image_, iso_value_, image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -599,12 +599,12 @@ public: if (weights_.is_valid()) { return Labeled_mesh_domain_3 - (p::function(create_weighted_labeled_image_wrapper + (p::function = create_weighted_labeled_image_wrapper (image_, weights_, image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -615,11 +615,11 @@ public: else { return Labeled_mesh_domain_3 - (p::function(create_labeled_image_wrapper + (p::function = create_labeled_image_wrapper (image_, image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -648,12 +648,12 @@ public: auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (p::function(create_gray_image_wrapper + (p::function = create_gray_image_wrapper (image_, iso_value_, image_values_to_subdomain_indices_, - value_outside_)), - p::bounding_object(Mesh_3::internal::compute_bounding_box(image_)), + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = @@ -781,8 +781,8 @@ public: auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (p::function(make_implicit_to_labeling_function_wrapper(function)), - p::bounding_object(bounding_object), + (p::function = make_implicit_to_labeling_function_wrapper(function), + p::bounding_object = bounding_object, p::relative_error_bound = relative_error_bound_, p::p_rng = p_rng_, p::null_subdomain_index = From 384c196074a9b5a6903c928c607d53f4df8b065e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 15:50:48 +0200 Subject: [PATCH 150/248] do not use deprecated API --- Mesh_2/test/Mesh_2/test_lloyd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_2/test/Mesh_2/test_lloyd.cpp b/Mesh_2/test/Mesh_2/test_lloyd.cpp index f2d663fca3b..e2d272ebc90 100644 --- a/Mesh_2/test/Mesh_2/test_lloyd.cpp +++ b/Mesh_2/test/Mesh_2/test_lloyd.cpp @@ -91,9 +91,9 @@ struct Lloyd_tester_original_BP_API << "\nNumber of seeds: " << seeds.size() << "\n\n"; std::cerr << "Meshing the triangulation with size 0.1..."; - CGAL::refine_Delaunay_mesh_2(cdt, - seeds.begin(), seeds.end(), - Criteria(0.125, 0.1)); + CGAL::refine_Delaunay_mesh_2(cdt, + CGAL::parameters::seeds(seeds). + criteria(Criteria(0.125, 0.1))); std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() << "\n\n"; assert( cdt.is_valid() ); assert( 580 <= cdt.number_of_vertices() && From c56198f17673ba73269aa30eee3429a8d957b973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 16:01:07 +0200 Subject: [PATCH 151/248] fix copy/paste error + improve doc --- Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h | 3 +-- Mesh_3/include/CGAL/Mesh_criteria_3.h | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h index 644c5a94eed..84a1f461abb 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h @@ -12,11 +12,10 @@ additionnally encapsulates the concept `MeshEdgeCriteria_3`, that describes the requirements, in terms of sizing, for the discretization of the domain \f$ 1\f$-dimensional features. -\cgalRefines `MeshDomain_3` +\cgalRefines `MeshCriteria_3` \cgalHasModel `CGAL::Mesh_criteria_3` -\sa `MeshCriteria_3` \sa `MeshEdgeCriteria_3` \sa `MeshFacetCriteria_3` \sa `MeshCellCriteria_3` diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 3d443afc466..6d9ee1aa251 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -129,9 +129,7 @@ private: /*! \ingroup PkgMesh3MeshClasses -The class `Mesh_criteria_3` is a model of both concepts `MeshCriteria_3` -and `MeshCriteriaWithFeatures_3`. -It gathers the refinement criteria for mesh tetrahedra and +The class gathers the refinement criteria for mesh tetrahedra and surface facets where surface facets are facets in the mesh approximating the domain surface patches. In addition, for domains with exposed 1-dimensional features, @@ -145,7 +143,7 @@ where `C3T3` is the model of `MeshComplex_3InTriangulation_3` used in the mesh generation process, and `C3T3::Triangulation` its nested triangulation type. -\cgalModels `MeshCriteria_3` +\cgalModels `MeshCriteria_3` and `MeshCriteriaWithFeatures_3` \cgalHeading{Example} From f26cfb815605f254f4788e5523e10dcdc7106cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Oct 2022 16:07:00 +0200 Subject: [PATCH 152/248] whitespace --- Mesh_2/test/Mesh_2/test_lloyd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_2/test/Mesh_2/test_lloyd.cpp b/Mesh_2/test/Mesh_2/test_lloyd.cpp index e2d272ebc90..8ff2b90e29c 100644 --- a/Mesh_2/test/Mesh_2/test_lloyd.cpp +++ b/Mesh_2/test/Mesh_2/test_lloyd.cpp @@ -91,7 +91,7 @@ struct Lloyd_tester_original_BP_API << "\nNumber of seeds: " << seeds.size() << "\n\n"; std::cerr << "Meshing the triangulation with size 0.1..."; - CGAL::refine_Delaunay_mesh_2(cdt, + CGAL::refine_Delaunay_mesh_2(cdt, CGAL::parameters::seeds(seeds). criteria(Criteria(0.125, 0.1))); std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() << "\n\n"; From 5392c3f8f7f6f2ac6dfbf167c20d94e80446ad44 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Oct 2022 08:10:47 +0100 Subject: [PATCH 153/248] selection --- BGL/include/CGAL/boost/graph/selection.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index 2604e4cf223..b641eb14a90 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -207,13 +207,11 @@ struct Regularization_graph prevent_unselection (prevent_unselection) { labels.reserve(num_faces(fg)); - std::size_t nb_selected = 0; for (fg_face_descriptor fd : faces(fg)) { if (get(is_selected_map,fd)) { labels.push_back(1); - ++ nb_selected; } else labels.push_back(0); From c8df65ebf972293ef4d9ee2f94bc818b7aebac8e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Oct 2022 08:11:12 +0100 Subject: [PATCH 154/248] repair_degeneracies --- .../CGAL/Polygon_mesh_processing/repair_degeneracies.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index a553a07dcb1..1ffd10acdba 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -1378,7 +1378,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, typedef typename GetGeomTraits::type Traits; - std::size_t nb_deg_faces = 0; bool all_removed = false; bool some_removed = true; bool preserve_genus = choose_parameter(get_parameter(np, internal_np::preserve_genus), true); @@ -1413,7 +1412,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, // remove edges that could also be set for removal if(face(h, tmesh) != GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_e = edge(prev(h, tmesh), tmesh); degenerate_edges_to_remove.erase(prev_e); local_edge_range.erase(prev_e); @@ -1422,7 +1420,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, if(face(opposite(h, tmesh), tmesh) != GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_opp_e = edge(prev(opposite(h, tmesh), tmesh), tmesh); degenerate_edges_to_remove.erase(prev_opp_e); local_edge_range.erase(prev_opp_e); @@ -1461,7 +1458,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, // remove edges that could also be set for removal if(face(h, tmesh) != GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_e = edge(prev(h, tmesh), tmesh); degenerate_edges_to_remove.erase(prev_e); local_edge_range.erase(prev_e); @@ -1470,7 +1466,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, if(face(opposite(h, tmesh), tmesh)!=GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_opp_e = edge(prev(opposite(h, tmesh), tmesh), tmesh); degenerate_edges_to_remove.erase(prev_opp_e); local_edge_range.erase(prev_opp_e); From 728be94816cdb1a10793caf936c284e117a75ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 12 Oct 2022 09:45:31 +0200 Subject: [PATCH 155/248] Move some input named parameters to in_np --- .../Alpha_wrap_3/wrap_from_cavity.cpp | 10 ++----- .../CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h | 29 ++++++++----------- Alpha_wrap_3/include/CGAL/alpha_wrap_3.h | 6 ++-- .../Alpha_wrap_3/test_AW3_manifoldness.cpp | 2 -- .../Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp | 1 - 5 files changed, 17 insertions(+), 31 deletions(-) diff --git a/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp b/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp index 91b95584f8c..2eb3f9c4155 100644 --- a/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp +++ b/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp @@ -47,16 +47,9 @@ int main(int argc, char** argv) const double offset = diag_length / relative_offset; // Construct the wrap - using Oracle = CGAL::Alpha_wraps_3::internal::Triangle_mesh_oracle; - Oracle oracle; - oracle.add_triangle_mesh(input); - CGAL::Real_timer t; t.start(); - Mesh wrap; - CGAL::Alpha_wraps_3::internal::Alpha_wrap_3 aw3(oracle); - // There is no limit on how many seeds can be used. // However, the algorithm automatically determines whether a seed can be used // to initialize the refinement based on a few conditions (distance to the offset, value of alpha, etc.) @@ -66,7 +59,8 @@ int main(int argc, char** argv) Point_3(0, 50, 0) // a point within the armadillo surface }; - aw3(alpha, offset, wrap, CGAL::parameters::seed_points(std::ref(seeds))); + Mesh wrap; + alpha_wrap_3(input, alpha, offset, wrap, CGAL::parameters::seed_points(std::ref(seeds))); t.stop(); std::cout << "Result: " << num_vertices(wrap) << " vertices, " << num_faces(wrap) << " faces" << std::endl; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h index e88e00fafe0..5f5ba3310ae 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h @@ -229,11 +229,14 @@ private: } public: - template + template void operator()(const double alpha, // = default_alpha() const double offset, // = alpha / 30. OutputMesh& output_mesh, - const NamedParameters& np) + const InputNamedParameters& in_np = parameters::default_values(), + const OutputNamedParameters& out_np = parameters::default_values()) { namespace PMP = Polygon_mesh_processing; @@ -241,25 +244,25 @@ public: using parameters::get_parameter_reference; using parameters::choose_parameter; - using OVPM = typename CGAL::GetVertexPointMap::type; - OVPM ovpm = choose_parameter(get_parameter(np, internal_np::vertex_point), + using OVPM = typename CGAL::GetVertexPointMap::type; + OVPM ovpm = choose_parameter(get_parameter(out_np, internal_np::vertex_point), get_property_map(vertex_point, output_mesh)); typedef typename internal_np::Lookup_named_param_def < internal_np::visitor_t, - NamedParameters, + InputNamedParameters, Wrapping_default_visitor // default >::reference Visitor; Wrapping_default_visitor default_visitor; - Visitor visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor); + Visitor visitor = choose_parameter(get_parameter_reference(in_np, internal_np::visitor), default_visitor); std::vector no_seeds; using Seeds = typename internal_np::Lookup_named_param_def< - internal_np::seed_points_t, NamedParameters, std::vector >::reference; - Seeds seeds = choose_parameter(get_parameter_reference(np, internal_np::seed_points), no_seeds); + internal_np::seed_points_t, InputNamedParameters, std::vector >::reference; + Seeds seeds = choose_parameter(get_parameter_reference(in_np, internal_np::seed_points), no_seeds); - const bool do_enforce_manifoldness = choose_parameter(get_parameter(np, internal_np::do_enforce_manifoldness), true); + const bool do_enforce_manifoldness = choose_parameter(get_parameter(in_np, internal_np::do_enforce_manifoldness), true); #ifdef CGAL_AW3_TIMER CGAL::Real_timer t; @@ -360,14 +363,6 @@ public: } // Convenience overloads - template - void operator()(const double alpha, - const double offset, - OutputMesh& output_mesh) - { - return operator()(alpha, offset, output_mesh, parameters::default_values()); - } - template void operator()(const double alpha, OutputMesh& output_mesh) diff --git a/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h index 13cf90f2df8..638c5fb9fa1 100644 --- a/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h @@ -112,7 +112,7 @@ void alpha_wrap_3(const PointRange& points, Oracle oracle(alpha, gt); oracle.add_triangle_soup(points, faces, in_np); AW3 alpha_wrap_builder(oracle); - alpha_wrap_builder(alpha, offset, alpha_wrap, out_np); + alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np); } // Convenience overloads @@ -261,7 +261,7 @@ void alpha_wrap_3(const TriangleMesh& tmesh, Oracle oracle(alpha, gt); oracle.add_triangle_mesh(tmesh, in_np); AW3 alpha_wrap_builder(oracle); - alpha_wrap_builder(alpha, offset, alpha_wrap, out_np); + alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np); } // The convenience overloads are the same for triangle mesh & point set @@ -357,7 +357,7 @@ void alpha_wrap_3(const PointRange& points, Oracle oracle(gt); oracle.add_point_set(points, in_np); AW3 alpha_wrap_builder(oracle); - alpha_wrap_builder(alpha, offset, alpha_wrap, out_np); + alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np); } // Convenience overloads, common to both mesh and point set diff --git a/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp b/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp index 928cade6495..638431e3056 100644 --- a/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp +++ b/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp @@ -45,7 +45,6 @@ void alpha_wrap_triangle_manifoldness(Mesh& input_mesh, Mesh nm_wrap; CGAL::alpha_wrap_3(input_mesh, alpha, offset, nm_wrap, - CGAL::parameters::default_values(), CGAL::parameters::do_enforce_manifoldness(false)); std::cout << "Result: " << vertices(nm_wrap).size() << " vertices, " << faces(nm_wrap).size() << " faces" << std::endl; @@ -67,7 +66,6 @@ void alpha_wrap_triangle_manifoldness(Mesh& input_mesh, Mesh m_wrap; CGAL::alpha_wrap_3(input_mesh, alpha, offset, m_wrap, - CGAL::parameters::default_values(), CGAL::parameters::do_enforce_manifoldness(true)); // CGAL::IO::write_polygon_mesh("last.off", wrap, CGAL::parameters::stream_precision(17)); diff --git a/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp b/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp index 5091934b62f..470d48e40d4 100644 --- a/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp +++ b/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp @@ -47,7 +47,6 @@ void alpha_wrap_triangle_mesh(Mesh& input_mesh, Mesh wrap; CGAL::alpha_wrap_3(input_mesh, alpha, offset, wrap, - CGAL::parameters::default_values(), CGAL::parameters::do_enforce_manifoldness(enforce_manifoldness)); std::cout << "Result: " << vertices(wrap).size() << " vertices, " << faces(wrap).size() << " faces" << std::endl; From 9bd49632cdb095fb1a8aa876776dac1478319305 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Oct 2022 08:54:56 +0100 Subject: [PATCH 156/248] repair_self_intersections --- .../CGAL/Polygon_mesh_processing/repair_self_intersections.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index bee807468a2..e7cd58b3145 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -251,7 +251,6 @@ FaceOutputIterator replace_faces_with_patch(const std::vector::null_face(); @@ -1581,7 +1579,6 @@ bool fill_hole_with_constraints(std::vector visited_faces; std::vector > patch; - int cc_counter = 0; for(face_descriptor f : cc_faces) { if(!visited_faces.insert(f).second) // already visited that face @@ -1593,7 +1590,6 @@ bool fill_hole_with_constraints(std::vector Date: Wed, 12 Oct 2022 08:58:19 +0100 Subject: [PATCH 157/248] Heat_method --- .../Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 4006dc23be3..160f52b9966 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -340,7 +340,6 @@ private: void loop_over_edges(edge_stack stack, std::vector& marked_edges) { - int a = 0; while(!stack.empty()) { edge_descriptor ed = stack.top(); stack.pop(); @@ -351,7 +350,6 @@ private: //if the edge itself is not locally delaunay, go back if(!(is_edge_locally_delaunay(ed))) { if(!(is_border(ed,m_intrinsic_tm))) { - a++; change_edge_length(edge_i,ed); halfedge_descriptor hd = (halfedge(ed, m_intrinsic_tm)); CGAL::Euler::flip_edge(hd, m_intrinsic_tm); From 3e90f9ccf75e2f81325a0f7a4ff1b29eec3d8183 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Oct 2022 09:28:02 +0100 Subject: [PATCH 158/248] mesh_smoothing --- .../internal/Smoothing/mesh_smoothing_impl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h index 16f8de52d49..9f04800cea6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h @@ -161,8 +161,9 @@ public: put(marks, e, false); for(edge_descriptor e : edge_range) put(marks, e, true); - +#ifdef CGAL_PMP_SMOOTHING_DEBUG int flipped_n = 0; +#endif while(!edge_range.empty()) { edge_descriptor e = edge_range.back(); @@ -172,8 +173,9 @@ public: if(should_be_flipped(e)) { +#ifdef CGAL_PMP_SMOOTHING_DEBUG ++flipped_n; - +#endif halfedge_descriptor h = halfedge(e, mesh_); #ifdef CGAL_PMP_SMOOTHING_DEBUG_PP From 341e1167a8ed7e87e51bb91e27e87e8db1207fee Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 12 Oct 2022 09:59:35 +0100 Subject: [PATCH 159/248] isotropic remeshing --- .../Isotropic_remeshing/remesh_impl.h | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 0dc2f54f2b4..e9d0357d394 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -405,7 +405,9 @@ namespace internal { } //split long edges +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_splits = 0; +#endif while (!long_edges.empty()) { //the edge with longest length @@ -420,7 +422,9 @@ namespace internal { // propagate the constrained status put(ecmap_, edge(hnew, mesh_), get(ecmap_, edge(he, mesh_))); CGAL_assertion(he == next(hnew, mesh_)); +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_splits; +#endif //move refinement point vertex_descriptor vnew = target(hnew, mesh_); @@ -642,7 +646,9 @@ namespace internal { std::cout << "done." << std::endl; #endif +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_collapses = 0; +#endif while (!short_edges.empty()) { //the edge with shortest length @@ -779,8 +785,9 @@ namespace internal { vertex_descriptor vkept = CGAL::Euler::collapse_edge(e, mesh_, ecmap_); CGAL_assertion(is_valid(mesh_)); CGAL_assertion(vkept == vb);//is the constrained point still here +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_collapses; - +#endif //fix constrained case CGAL_assertion((is_constrained(vkept) || is_corner(vkept) || is_on_patch_border(vkept)) == (is_va_constrained || is_vb_constrained || is_va_on_constrained_polyline || is_vb_on_constrained_polyline)); @@ -842,7 +849,9 @@ namespace internal { const double cap_threshold = std::cos(160. / 180 * CGAL_PI); +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_flips = 0; +#endif for(edge_descriptor e : edges(mesh_)) { //only the patch edges are allowed to be flipped @@ -906,8 +915,9 @@ namespace internal { put(degree, vc, vvc); put(degree, vd, vvd); +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_flips; - +#endif #ifdef CGAL_PMP_REMESHING_VERBOSE_PROGRESS std::cout << "\r\t(" << nb_flips << " flips)"; std::cout.flush(); @@ -956,8 +966,9 @@ namespace internal { put(degree, vc, vvc); put(degree, vd, vvd); +#ifdef CGAL_PMP_REMESHING_VERBOSE --nb_flips; - +#endif CGAL_assertion_code(Halfedge_status s3 = status(he)); CGAL_assertion(s1 == s3); CGAL_assertion(!is_border(he, mesh_)); @@ -1635,8 +1646,6 @@ private: const double& sq_low, const bool collapse_constraints) { - CGAL_assertion_code(std::size_t nb_done = 0); - std::unordered_set degenerate_faces; for(halfedge_descriptor h : halfedges_around_target(halfedge(v, mesh_), mesh_)) @@ -1695,7 +1704,6 @@ private: continue; CGAL::Euler::flip_edge(hf, mesh_); - CGAL_assertion_code(++nb_done); done = true; //update status @@ -1891,6 +1899,11 @@ private: else if(is_an_isolated_constraint(h)) nb_isolated++; else CGAL_assertion(false); } + CGAL_USE(nb_border); + CGAL_USE(nb_mesh); + CGAL_USE(nb_patch); + CGAL_USE(nb_patch_border); + CGAL_USE(nb_isolated); } #ifdef CGAL_PMP_REMESHING_DEBUG From 32efdd9110bc96092912603c1e597aa76eecebcd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 07:34:43 +0100 Subject: [PATCH 160/248] isotropic remeshing --- .../internal/Isotropic_remeshing/remesh_impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index e9d0357d394..ac9824f94e7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -501,7 +501,9 @@ namespace internal { } //split long edges +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_splits = 0; +#endif while (!long_edges.empty()) { //the edge with longest length From 10c5d59d710a4bc69c521ab9a7cea16098445d81 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 07:40:08 +0100 Subject: [PATCH 161/248] parameterization --- .../CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h | 4 ---- .../Fixed_border_parameterizer_3.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 3002d4beffe..65bd6659902 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -560,7 +560,6 @@ private: Error_code status = OK; // compute A - unsigned int count = 0; for(vertex_descriptor vd : vertices) { if(!get(vpmap, vd)) { // not yet parameterized // Compute the line i of the matrix A @@ -570,7 +569,6 @@ private: } else { // fixed vertices int index = get(vimap, vd); A.set_coef(index, index, 1, true /*new*/); - ++count; } } return status; @@ -1079,7 +1077,6 @@ private: // Initialize the right hand side B in the linear system "A*X = B" Error_code status = OK; - unsigned int count = 0; for(vertex_descriptor vd : vertices) { if(!get(vpmap, vd)) { // not yet parameterized // Compute the lines i of the vectors Bu and Bv @@ -1092,7 +1089,6 @@ private: const Point_2& uv = get(uvmap, vd); Bu.set(index, uv.x()); Bv.set(index, uv.y()); - ++count; } } return status; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index d25d7c36fa7..44f86383d32 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -255,7 +255,6 @@ public: main_border.insert(v); } - int count = 0; for(vertex_descriptor v : vertices){ // inner vertices only if(main_border.find(v) == main_border.end()){ @@ -263,8 +262,6 @@ public: status = setup_inner_vertex_relations(A, Bu, Bv, mesh, v, vimap); if(status != OK) return status; - } else { - count++; } } From 0346bec7fa568810ad58a64c3b78ff2170d3974e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 07:40:33 +0100 Subject: [PATCH 162/248] Topology --- .../examples/Surface_mesh_topology/draw_facewidth.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index 0afd17425fb..4a489b19ff1 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -54,17 +54,16 @@ template void draw_facewidth(const LCC& lcc, const std::vector& cycle) { - int nbv=0, nbf=0; typename LCC::size_type vertex_mark = lcc.get_new_mark(); typename LCC::size_type face_mark = lcc.get_new_mark(); for (std::size_t i=0; i(cycle[i], vertex_mark); ++nbv; } + { lcc.template mark_cell<0>(cycle[i], vertex_mark); } // Color the face if (!lcc.is_marked(cycle[i], face_mark)) - { lcc.template mark_cell<2>(cycle[i], face_mark); ++nbf; } + { lcc.template mark_cell<2>(cycle[i], face_mark); } } Facewidth_draw_functor df(vertex_mark, face_mark); From f002f06642a9f543eec757b14cff48e6291d553e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 07:47:13 +0100 Subject: [PATCH 163/248] Tetranedral_remeshing --- .../internal/smooth_vertices.h | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index 745f89bb1d2..49ff1c2390e 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -414,10 +414,11 @@ public: #ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE std::cout << "Smooth vertices..."; std::cout.flush(); -#endif + std::size_t nb_done_3d = 0; std::size_t nb_done_2d = 0; std::size_t nb_done_1d = 0; +#endif FT total_move = 0.; Tr& tr = c3t3.triangulation(); @@ -540,8 +541,11 @@ public: #endif // move vertex const typename Tr::Point new_pos(final_position.x(), final_position.y(), final_position.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_1d++; +#endif + } } else if (neighbors[vid] > 0) { @@ -574,8 +578,11 @@ public: #endif // move vertex const typename Tr::Point new_pos(final_position.x(), final_position.y(), final_position.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_1d++; +#endif + } } } } @@ -647,8 +654,11 @@ public: os_surf << "2 " << current_pos << " " << final_position << std::endl; #endif const typename Tr::Point new_pos(final_position.x(), final_position.y(), final_position.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_2d++; +#endif + } } else if (neighbors[vid] > 0) { @@ -660,8 +670,11 @@ public: if (boost::optional mls_projection = project(si, current_pos)) { const typename Tr::Point new_pos(CGAL::ORIGIN + *mls_projection); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_2d++; +#endif + } #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG os_surf0 << "2 " << current_pos << " " << new_pos << std::endl; @@ -715,8 +728,11 @@ public: #endif const Vector_3 p = smoothed_positions[vid] / static_cast(neighbors[vid]); typename Tr::Point new_pos(p.x(), p.y(), p.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_3d++; +#endif + } #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG os_vol << " " << point(v->point()) << std::endl; From c29f2cac525c6527446f0413a837dcde88f075dd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 07:55:32 +0100 Subject: [PATCH 164/248] Triangulation_3, Visibility_2 --- .../test/Triangulation_3/test_regular_remove_3.cpp | 5 +---- Visibility_2/test/Visibility_2/include/CGAL/test_utils.h | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp index 1ce3881222b..f37bb096413 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp @@ -288,16 +288,14 @@ bool test_case (std::istream &is) point_set points; Cls T; - int number = 0; do { - ++number; points.insert (*pi); T.insert (*pi); } while (++pi != pend); assert(T.is_valid()); - for (int i = 0; !points.empty(); ++i) { + while(! points.empty()) { assert(T.number_of_vertices() != 0); Vertex_handle v = T.finite_vertices_begin(); set_iterator pos = points.find (v->point()); @@ -376,4 +374,3 @@ int main(int argc, char **argv) return 0; } - diff --git a/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h b/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h index 63596be4174..a57dee947cf 100644 --- a/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h +++ b/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h @@ -858,7 +858,6 @@ typename Arrangement_2::Face_const_handle construct_biggest_arr_with_no_holes( Ccb_halfedge_const_circulator curr; Face_const_iterator fit; - int cnt(0); for (fit = arr_in.faces_begin() ; fit != arr_in.faces_end() ; fit++) { if (fit->has_outer_ccb()) { Ccb_halfedge_const_circulator circ = fit->outer_ccb(); @@ -868,7 +867,6 @@ typename Arrangement_2::Face_const_handle construct_biggest_arr_with_no_holes( curr_max_circ = circ; } } - cnt++; } std::vector segments; From 0ba4d58a439935f02ebcf8b68ccd61b1f919ecbd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 07:58:21 +0100 Subject: [PATCH 165/248] Voronoi_diagram_2 --- .../test/Voronoi_diagram_2/include/vda_print_report.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h index 3f58af9a3bb..63819bc0afc 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h @@ -329,6 +329,8 @@ void print_report(const VDA& vda, const Projector& project, std::cout << "# of Voronoi cells: " << n_all << std::endl; std::cout << "# of Voronoi cells with empty interior: " << n_empty << std::endl; +#else + CGAL_USE(n_vert); CGAL_USE(n_all); CGAL_USE(n_empty); #endif std::cout << "is Voronoi diagram valid? " From 683805c34a5cfea653fb3ca3f712a7f6abd99d2e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 13 Oct 2022 08:06:30 +0100 Subject: [PATCH 166/248] Isotropic remeshing --- .../internal/Isotropic_remeshing/remesh_impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index ac9824f94e7..837d16467e8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -530,8 +530,9 @@ namespace internal { halfedge_descriptor hnew = CGAL::Euler::split_edge(he, mesh_); CGAL_assertion(he == next(hnew, mesh_)); put(ecmap_, edge(hnew, mesh_), get(ecmap_, edge(he, mesh_)) ); +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_splits; - +#endif //move refinement point vertex_descriptor vnew = target(hnew, mesh_); put(vpmap_, vnew, refinement_point); From 1a1eaff65f3e178de883b2aafc3ed91d41b6df58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 13 Oct 2022 23:57:44 +0200 Subject: [PATCH 167/248] Fix broken link to ref manuals for Heat Method and Surface Mesh Topology --- .../doc/Heat_method_3/PackageDescription.txt | 11 +++++------ .../Surface_mesh_geodesic_distances_3.h | 6 +++--- .../internal/Intrinsic_Delaunay_triangulation_3.h | 2 +- .../doc/Surface_mesh_topology/PackageDescription.txt | 12 ++++++------ 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Heat_method_3/doc/Heat_method_3/PackageDescription.txt b/Heat_method_3/doc/Heat_method_3/PackageDescription.txt index f562ab1ce22..c13822436f1 100644 --- a/Heat_method_3/doc/Heat_method_3/PackageDescription.txt +++ b/Heat_method_3/doc/Heat_method_3/PackageDescription.txt @@ -1,13 +1,12 @@ // The Heat Method -/// \defgroup PkgHeatMethod Heat Method Reference +/// \defgroup PkgHeatMethodRef Heat Method Reference /// \defgroup PkgHeatMethodConcepts Concepts -/// \ingroup PkgHeatMethod - +/// \ingroup PkgHeatMethodRef /*! -\addtogroup PkgHeatMethod +\addtogroup PkgHeatMethodRef \cgalPkgDescriptionBegin{The Heat Method,PkgHeatMethod} \cgalPkgPicture{heat-method-small.png} @@ -17,8 +16,8 @@ \cgalPkgDesc{The package provides an algorithm that solves the single- or multiple-source shortest path problem by returning an approximation of the geodesic distance for all vertices of a triangle mesh to the closest vertex in a given set of -source vertices. } -\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethod} +source vertices.} +\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethodRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.14} diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 73d369695b1..2665b40d3e4 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -714,7 +714,7 @@ struct Base_helper /** - * \ingroup PkgHeatMethod + * \ingroup PkgHeatMethodRef * * Class `Surface_mesh_geodesic_distances_3` computes estimated geodesic distances for a set of source vertices where sources can be added and removed. * The class performs a preprocessing step that only depends on the mesh, so that the distance computation takes less @@ -906,7 +906,7 @@ public: }; #if defined(DOXYGEN_RUNNING) || defined(CGAL_EIGEN3_ENABLED) -/// \ingroup PkgHeatMethod +/// \ingroup PkgHeatMethodRef /// computes for each vertex of the triangle mesh `tm` the estimated geodesic distance to a given source vertex. /// This function is provided only if \ref thirdpartyEigen "Eigen" 3.3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined. /// \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph`. @@ -947,7 +947,7 @@ estimate_geodesic_distances(const TriangleMesh& tm, #endif -/// \ingroup PkgHeatMethod +/// \ingroup PkgHeatMethodRef /// computes for each vertex of the triangle mesh `tm` the estimated geodesic distance to a given set of source vertices. /// This function is provided only if \ref thirdpartyEigen "Eigen" 3.3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined. /// \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph` diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index e011619b7ea..647a32bed2b 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -132,7 +132,7 @@ struct Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor }; /** - * \ingroup PkgHeatMethod + * \ingroup PkgHeatMethodRef * * Class `Intrinsic_Delaunay_triangulation_3` is a remeshing algorithm to improve the approximation of the `Surface_mesh_geodesic_distances_3`. * It internally makes a copy of the triangle mesh, performs edge flips, and computes 2D vertex coordinates per face diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt b/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt index 53106ce0049..97f1f3bad7e 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt @@ -1,10 +1,10 @@ -/// \defgroup PkgSurfaceMeshTopology Surface Mesh Topology Reference +/// \defgroup PkgSurfaceMeshTopologyRef Surface Mesh Topology Reference /// \defgroup PkgSurfaceMeshTopologyConcepts Concepts -/// \ingroup PkgSurfaceMeshTopology +/// \ingroup PkgSurfaceMeshTopologyRef /// \defgroup PkgSurfaceMeshTopologyClasses Classes -/// \ingroup PkgSurfaceMeshTopology +/// \ingroup PkgSurfaceMeshTopologyRef /*! \code @@ -12,17 +12,17 @@ \endcode */ /// \defgroup PkgDrawFaceGraphWithPaths Draw a Mesh with Paths -/// \ingroup PkgSurfaceMeshTopology +/// \ingroup PkgSurfaceMeshTopologyRef /*! -\addtogroup PkgSurfaceMeshTopology +\addtogroup PkgSurfaceMeshTopologyRef \cgalPkgDescriptionBegin{Surface Mesh Topology,PkgSurfaceMeshTopology} \cgalPkgPicture{surface-mesh-topology-logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand, Francis Lazarus} \cgalPkgDesc{This package provides a toolbox for manipulating curves on a combinatorial surface from the topological point of view. Two main functionalities are proposed. One is the computation of shortest curves that cannot be continuously deformed to a point. This includes the computation of the so-called edge width and face width of the vertex-edge graph of a combinatorial surface. The other functionality is the homotopy test for deciding if two given curves on a combinatorial surface can be continuously deformed one into the other.} -\cgalPkgManuals{Chapter_Surface_Mesh_Topology,PkgSurfaceMeshTopology} +\cgalPkgManuals{Chapter_Surface_Mesh_Topology,PkgSurfaceMeshTopologyRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{5.1} From 87fd7ace4f2dc30c8da446812951ddde63528784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 14 Oct 2022 01:11:58 +0200 Subject: [PATCH 168/248] Remove superfluous empty lines --- .../Surface_mesh_geodesic_distances_3.h | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 2665b40d3e4..47cc87c0a75 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -90,7 +90,6 @@ protected: Face_id_map face_id_map; public: - /*! \brief Constructor */ @@ -100,7 +99,6 @@ public: build(); } - /*! \brief Constructor */ @@ -110,38 +108,33 @@ public: build(); } - /** * returns the triangle mesh the algorithm is running on. */ - const TriangleMesh& triangle_mesh() const{ + const TriangleMesh& triangle_mesh() const + { return tm; } - private: - const Matrix& mass_matrix() const { return m_mass_matrix; } - const Matrix& cotan_matrix() const { return m_cotan_matrix; } - const VertexPointMap& vertex_point_map() const { return vpm; } - const Vertex_id_map& get_vertex_id_map() const { @@ -149,7 +142,6 @@ private: } public: - /** * adds `vd` to the source set, returning `false` iff `vd` is already in the set. */ @@ -176,7 +168,6 @@ public: } } - /** * removes `vd` from the source set, returning `true` iff `vd` was in the set. */ @@ -188,7 +179,6 @@ public: return (m_sources.erase(v2v(vd)) == 1); } - /** * clears the current source set. */ @@ -203,7 +193,6 @@ public: /** * returns the set of source vertices. */ - const Vertex_const_range& sources() const { @@ -211,7 +200,6 @@ public: } private: - double summation_of_edges() const { @@ -237,14 +225,12 @@ private: return edge_sum; } - double time_step() const { return m_time_step; } - void update_kronecker_delta() { @@ -263,14 +249,12 @@ private: m_kronecker.swap(K); } - const Matrix& kronecker_delta() const { return m_kronecker; } - void factor_cotan_laplace() { Matrix A, A0; @@ -293,7 +277,6 @@ private: } } - void compute_unit_gradient() { @@ -352,7 +335,6 @@ private: } } - void compute_divergence() { @@ -400,7 +382,6 @@ private: indexD.swap(m_index_divergence); } - // modifies m_solved_phi void value_at_source_set(const Vector& phi) @@ -432,7 +413,6 @@ private: m_solved_phi.swap(source_set_val); } - void factor_phi() { @@ -443,7 +423,6 @@ private: } } - void solve_phi() { @@ -456,7 +435,6 @@ private: value_at_source_set(phi); } - // this function returns a (number of vertices)x1 vector where // the ith index has the distance from the first vertex to the ith vertex const Vector& @@ -466,7 +444,6 @@ private: } public: - /** * Updates the distance property map after changes in the source set. **/ @@ -494,7 +471,6 @@ public: } private: - void build() { @@ -788,6 +764,7 @@ class Surface_mesh_geodesic_distances_3 typedef typename Default::Get< VertexPointMap, typename boost::property_map< TriangleMesh, vertex_point_t>::const_type>::type Vertex_point_map; + typedef typename Default::Get::vertex_descriptor vertex_descriptor; #ifndef DOXYGEN_RUNNING From 947c8e3288b76dffa97fd3a4835ae0d7d867f038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 14 Oct 2022 01:12:17 +0200 Subject: [PATCH 169/248] Replace meaningless precondition --- .../internal/Intrinsic_Delaunay_triangulation_3.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 647a32bed2b..c4fecf865fa 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -404,7 +404,8 @@ private: void build(VertexPointMap vpm) { - CGAL_precondition(is_triangle_mesh(m_intrinsic_tm)); + CGAL_precondition(is_empty(m_intrinsic_tm)); + CGAL_precondition(is_triangle_mesh(m_input_tm)); typename Traits::Compute_squared_distance_3 squared_distance = Traits().compute_squared_distance_3_object(); From e294be5c61ab5383306f4d8601f5be3637d555fd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:14:22 +0100 Subject: [PATCH 170/248] AABB Tree --- AABB_tree/test/AABB_tree/AABB_test_util.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index 65be2e8a7c5..5b73a20f9f2 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -527,7 +527,6 @@ private: { CGAL::Timer timer; timer.start(); - int nb_test = 0; while ( timer.time() < duration ) { Point a = random_point_in(m_tree.bbox()); @@ -539,8 +538,6 @@ private: test(segment, m_polyhedron, m_tree, m_naive); test(ray, m_polyhedron, m_tree, m_naive); test(line, m_polyhedron, m_tree, m_naive); - - ++nb_test; } timer.stop(); From 19ad8ced1627db5f9e908ee2002849ce0f3e3957 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:15:59 +0100 Subject: [PATCH 171/248] Arrangement --- .../demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp index bdc2c17f627..74b52284922 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp @@ -48,12 +48,10 @@ ArrangementPainterOstream>& ArrangementPainterOstream>:: operator<<(const X_monotone_curve_2& curve) { - int cnt = 0; for (typename X_monotone_curve_2::Subcurve_const_iterator it = curve.subcurves_begin(); it != curve.subcurves_end(); ++it) { - cnt++; this->painterOstream << *it; } From f976348d87013201bad0c87a0f859781bdd596cf Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:18:32 +0100 Subject: [PATCH 172/248] Convex_hull_3 --- .../include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h index 2edd7244422..a1311e87c5f 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h @@ -73,7 +73,6 @@ namespace CGAL std::unordered_map primal_vertices; - size_t n = 0; // First, computing the primal vertices for(Facet_const_handle fd : faces(_dual)){ @@ -111,7 +110,6 @@ namespace CGAL vertex_descriptor vd = add_vertex(primal); primal_vertices[fd] = vd; put(vpm, vd, ppp); - ++n; } // Then, add facets to the primal polyhedron @@ -283,4 +281,3 @@ namespace CGAL #include #endif // CGAL_HALFSPACE_INTERSECTION_3_H - From a4c6df514a3dd444cc462c41a19061943590d61e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:21:44 +0100 Subject: [PATCH 173/248] Mesh_3 --- Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h index f3d1e0ba7fa..b2978714652 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -702,15 +702,18 @@ scan_triangulation_impl() { #if defined(CGAL_MESH_3_VERBOSE) || defined(CGAL_MESH_3_PROFILING) std::cerr << "Scanning triangulation for bad cells (sequential)... "; + int count = 0; #endif - int count = 0; + for(Finite_cell_iterator cell_it = r_tr_.finite_cells_begin(); cell_it != r_tr_.finite_cells_end(); ++cell_it) { treat_new_cell(cell_it); +#if defined(CGAL_MESH_3_VERBOSE) || defined(CGAL_MESH_3_PROFILING) ++count; +#endif } #if defined(CGAL_MESH_3_VERBOSE) || defined(CGAL_MESH_3_PROFILING) std::cerr << count << " cells scanned, "; From f52444425e7a73dd971be46c04ff83b096cac3dc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:25:42 +0100 Subject: [PATCH 174/248] Mesh_3 --- .../Mesh_3/search_for_connected_components_in_labeled_image.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h index 56c5d7bc6d5..4a252a7b3cb 100644 --- a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h @@ -97,9 +97,9 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, % (long)static_evaluate(image.image(), i, j, k) % number_of_connected_components % (int)current_label; -#endif // CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE int nb_voxels = 0; +#endif // CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE Indices_queue queue; Indices indices(i, j ,k, 0); @@ -137,7 +137,9 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, { visited[offset] = true; second_pass[offset] = false; +#if CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE > 1 ++nb_voxels; +#endif boost::get<0>(bbox_min) = (std::min)(i, boost::get<0>(bbox_min)); boost::get<0>(bbox_max) = (std::max)(i, boost::get<0>(bbox_max)); boost::get<1>(bbox_min) = (std::min)(j, boost::get<1>(bbox_min)); From 57535e29290704c10775d6e50fc8f51ba0da5d05 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:27:25 +0100 Subject: [PATCH 175/248] OTR --- .../demo/Optimal_transportation_reconstruction_2/scene.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h index e590f0f0489..c7f14a626da 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h @@ -440,11 +440,9 @@ public: } CGAL_assertion(vertex_count == 18); - int edge_count = 0; for (std::vector::iterator it = edges.begin(); it != edges.end(); it++) { std::cout << *it << std::endl; - edge_count++; } } From fb1b02eb946bec5f0da765f7453cd7f6de816137 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:29:45 +0100 Subject: [PATCH 176/248] PMP --- .../test/Polygon_mesh_processing/pmp_do_intersect_test.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp index 93bdd0fbd01..e0696004418 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp @@ -39,10 +39,8 @@ template int load_polylines(std::ifstream& input, std::vector >& points) { - int counter = 0; std::size_t n; while(input >> n) { - ++counter; std::vector new_polyline; points.push_back(new_polyline); std::vector&polyline = points.back(); From 46969d6cf4fc7ee8134ab2f7098d2cd257b8cd75 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:34:54 +0100 Subject: [PATCH 177/248] Scale_space_reconstruction --- .../Alpha_shape_mesher.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h index 7cfdb245391..2a55578de06 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h @@ -559,9 +559,6 @@ private: { std::set done; - unsigned int nb_facets_removed = 0; - - unsigned int nb_skipped = 0; for (Cell_iterator cit = _shape->cells_begin (); cit != _shape->cells_end (); ++ cit) { if (_shape->is_infinite (cit)) @@ -702,7 +699,6 @@ private: } else { - nb_facets_removed ++; mark_handled (f); _garbage.push_back (ordered_facet_indices (f)); } @@ -716,7 +712,6 @@ private: } else { - nb_facets_removed ++; mark_handled (_shape->mirror_facet (f)); _garbage.push_back (ordered_facet_indices (_shape->mirror_facet (f))); } @@ -782,7 +777,6 @@ private: // If number of layers is != 2, ignore volume and discard bubble if (layer != 1) { - nb_skipped ++; for (unsigned int i = 0; i < 2; ++ i) for (typename std::set::iterator fit = _bubbles.back()[i].begin (); fit != _bubbles.back()[i].end (); ++ fit) @@ -790,7 +784,6 @@ private: mark_handled (*fit); _map_f2b.erase (*fit); _garbage.push_back (ordered_facet_indices (*fit)); - nb_facets_removed ++; } _bubbles.pop_back (); } @@ -805,10 +798,6 @@ private: typedef std::map, std::set > Edge_shell_map_triples; typedef typename Edge_shell_map_triples::iterator Edge_shell_map_triples_iterator; - unsigned int nb_facets_removed = 0; - - unsigned int nb_nm_edges = 0; - // Store for each pair edge/shell the incident facets Edge_shell_map_triples eshell_triples; std::map map_t2f; @@ -841,8 +830,6 @@ private: if (eit->second.size () < 3) continue; - ++ nb_nm_edges; - Facet_iterator tit = _shells[eit->first.second]; Facet_iterator end = (eit->first.second == _shells.size () - 1) ? _surface.end () : _shells[eit->first.second + 1]; @@ -863,7 +850,6 @@ private: _map_f2s.erase (map_t2f[*current]); _surface.erase (current); - ++ nb_facets_removed; eit->second.erase (search); } @@ -931,14 +917,12 @@ private: _surface.splice(end, tmp, tmp.begin(), tmp.end()); } - unsigned int nb_facets_removed = 0; unsigned int nb_nm_vertices = 0; // Removing facets to fix non-manifold vertices might make some other vertices // become non-manifold, therefore we iterate until no facet needs to be removed. do { nb_nm_vertices = 0; - nb_facets_removed = 0; // Store for each pair vertex/shell the incident facets Vertex_shell_map_facets vshell_facets; @@ -1052,7 +1036,6 @@ private: _garbage.push_back (*current); _surface.erase (current); - ++ nb_facets_removed; ++ tindex; } From 57835beff8945a2779f3aa0b8cfbddbd5511ab1f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 10:36:35 +0100 Subject: [PATCH 178/248] Spatial_searching --- Spatial_searching/test/Spatial_searching/test_print.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Spatial_searching/test/Spatial_searching/test_print.cpp b/Spatial_searching/test/Spatial_searching/test_print.cpp index eff527cef53..8826824ef49 100644 --- a/Spatial_searching/test/Spatial_searching/test_print.cpp +++ b/Spatial_searching/test/Spatial_searching/test_print.cpp @@ -27,10 +27,9 @@ void test_print(const std::string filename) { std::ifstream in(filename); CGAL::IO::set_ascii_mode(in); - Point_3 p; std::size_t count = 0; + Point_3 p; while (in >> p) { points.push_back(p); - ++count; } assert(points.size() > 0); From 469a0362b5f709dcfe56f76d9dbc4678e2d6c22a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 11:34:34 +0100 Subject: [PATCH 179/248] Take Laurent's review into account --- .../doc/Convex_hull_2/PackageDescription.txt | 5 +- .../doc/Convex_hull_3/PackageDescription.txt | 4 +- .../Inscribed_areas/PackageDescription.txt | 14 +- Installation/CHANGES.md | 6 +- .../doc/Matrix_search/PackageDescription.txt | 11 +- .../doc/Partition_2/PackageDescription.txt | 3 - Polygon/doc/Polygon/PackageDescription.txt | 4 - .../PackageDescription.txt | 8 +- .../doc/STL_Extension/CGAL/Multiset.h | 6 - STL_Extension/include/CGAL/Multiset.h | 181 ++++++----- .../include/CGAL/multiset_assertions.h | 290 ------------------ 11 files changed, 103 insertions(+), 429 deletions(-) delete mode 100644 STL_Extension/include/CGAL/multiset_assertions.h diff --git a/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt b/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt index fd1c27ca210..7fa7625b04f 100644 --- a/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt +++ b/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt @@ -53,13 +53,11 @@ upper hull of a set of points. \cgalCRPSection{Assertions} -The assertion flags for the convex hull and extreme point algorithms -use `CH` in their names (e.g., `CGAL_CH_NO_POSTCONDITIONS`). For the convex hull algorithms, the postcondition check tests only convexity (if not disabled), but not containment of the input points in the polygon or polyhedron defined by the output points. The latter is considered an expensive checking and can be enabled by -defining `CGAL_CH_CHECK_EXPENSIVE`. +defining `CGAL_CHECK_EXPENSIVE`. \cgalCRPSection{Concepts} @@ -105,4 +103,3 @@ defining `CGAL_CH_CHECK_EXPENSIVE`. */ - diff --git a/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt b/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt index cfe86e65064..acadb02ed7e 100644 --- a/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt +++ b/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt @@ -52,13 +52,11 @@ points in is strongly convex or not. This chapter describes the functions available for three dimensions. \cgalCRPSection{Assertions} -The assertion flags for the convex hull and extreme point algorithms -use `CH` in their names (e.g., `CGAL_CH_NO_POSTCONDITIONS`). For the convex hull algorithms, the postcondition check tests only convexity (if not disabled), but not containment of the input points in the polygon or polyhedron defined by the output points. The latter is considered an expensive checking and can be enabled by -defining `CGAL_CH_CHECK_EXPENSIVE`. +defining `CGAL_CHECK_EXPENSIVE`. \cgalClassifedRefPages diff --git a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt index 869cc842f1e..a15bb4b041c 100644 --- a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt +++ b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt @@ -22,18 +22,11 @@ \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} - -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks. - \cgalClassifedRefPages -- `CGAL::maximum_area_inscribed_k_gon_2` -- `CGAL::maximum_perimeter_inscribed_k_gon_2` -- `CGAL::extremal_polygon_2` +- `CGAL::maximum_area_inscribed_k_gon_2()` +- `CGAL::maximum_perimeter_inscribed_k_gon_2()` +- `CGAL::extremal_polygon_2()` - `CGAL::Largest_empty_iso_rectangle_2` - `CGAL::Extremal_polygon_area_traits_2` - `CGAL::Extremal_polygon_perimeter_traits_2` @@ -41,4 +34,3 @@ checking off, cf. Section \ref secchecks. - `LargestEmptyIsoRectangleTraits_2` */ - diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index be5a7d1fc93..dc135619340 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -6,6 +6,10 @@ Release History Release date: December 2022 +### General Changes + +- The per package assertions, pre- and postconditions are no longer supported. + ### [Combinatorial Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgCombinatorialMaps) [Generalized Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgGeneralizedMaps) [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex) - Added a version that uses indices instead of handles as dart and attribute descriptors. As the indices are integers convertible from and to `std::size_t`, they can be used as index into vectors which store properties. To use the index version, `Use_index` must be defined and be equal to `CGAL::Tag_true` in the item class. @@ -39,7 +43,7 @@ CGAL tetrahedral Delaunay refinement algorithm. ### [2D Conforming Triangulations and Meshes](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh2) - Deprecated two overloads of Function `refine_Delaunay_mesh()` and replaced them with versions using function named parameters. -- Add overloads of function `write_VTU()` with property maps for specifying the domain. +- Add overloads of function `write_VTU()` with property maps for specifying the domain. [Release 5.5](https://github.com/CGAL/cgal/releases/tag/v5.5) ----------- diff --git a/Matrix_search/doc/Matrix_search/PackageDescription.txt b/Matrix_search/doc/Matrix_search/PackageDescription.txt index 8ec5cfdffcb..202989f2da3 100644 --- a/Matrix_search/doc/Matrix_search/PackageDescription.txt +++ b/Matrix_search/doc/Matrix_search/PackageDescription.txt @@ -23,24 +23,17 @@ This chapter describes concepts, classes, and functions for monotone and sorted matrix search. -\cgalCRPSection{Assertions} - -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks "Checks" in the chapter on STL extensions. \cgalClassifedRefPages -- `CGAL::monotone_matrix_search` +- `CGAL::monotone_matrix_search()` - `CGAL::Dynamic_matrix` - `MonotoneMatrixSearchTraits` - `BasicMatrix` -- `CGAL::sorted_matrix_search` +- `CGAL::sorted_matrix_search()` - `CGAL::Sorted_matrix_search_traits_adaptor` - `SortedMatrixSearchTraits` */ - diff --git a/Partition_2/doc/Partition_2/PackageDescription.txt b/Partition_2/doc/Partition_2/PackageDescription.txt index ee33bf48c0a..4d5b6ba9c91 100644 --- a/Partition_2/doc/Partition_2/PackageDescription.txt +++ b/Partition_2/doc/Partition_2/PackageDescription.txt @@ -53,8 +53,6 @@ primitive types and predicates used by the algorithms. \cgalCRPSection{Assertions} -The assertion flags for this package use `PARTITION` in their names -(e.g., `CGAL_PARTITION_NO_POSTCONDITIONS`). The precondition checks for the planar polygon partitioning functions are: counterclockwise ordering of the input vertices and simplicity of the polygon these vertices represent. @@ -99,4 +97,3 @@ original polygon). - `CGAL::y_monotone_partition_is_valid_2()` */ - diff --git a/Polygon/doc/Polygon/PackageDescription.txt b/Polygon/doc/Polygon/PackageDescription.txt index e5c9d156714..1d48e74493c 100644 --- a/Polygon/doc/Polygon/PackageDescription.txt +++ b/Polygon/doc/Polygon/PackageDescription.txt @@ -40,10 +40,6 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} - -The assertion flags for the polygons and polygon operations use -`POLYGON` in their names (e.g., `CGAL_POLYGON_NO_ASSERTIONS`). \cgalClassifedRefPages diff --git a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt index 0b4088ce277..aaecb2b37da 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt +++ b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt @@ -19,17 +19,12 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks. \cgalClassifedRefPages \cgalCRPSection{All Furthest Neighbors} -- `CGAL::all_furthest_neighbors_2` +- `CGAL::all_furthest_neighbors_2()` - `AllFurthestNeighborsTraits_2` \cgalCRPSection{Width} @@ -48,4 +43,3 @@ checking off, cf. Section \ref secchecks. */ - diff --git a/STL_Extension/doc/STL_Extension/CGAL/Multiset.h b/STL_Extension/doc/STL_Extension/CGAL/Multiset.h index a892f2f7702..a81cabb29ea 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Multiset.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Multiset.h @@ -69,12 +69,6 @@ less-than operator (`operator<`). \tparam Allocator the allocator type. `CGAL_ALLOCATOR` is used by default. -\cgalHeading{Assertions} - -The assertion and precondition flags for the `Multiset` class -use `MULTISET` in their names (i.e., `CGAL_MULTISET_NO_ASSERTIONS` and -`CGAL_MULTISET_NO_PRECONDITIONS`). - \cgalHeading{Implementation} `Multiset` uses a proprietary implementation of a red-black tree diff --git a/STL_Extension/include/CGAL/Multiset.h b/STL_Extension/include/CGAL/Multiset.h index 96b6bcc612b..9382923dbc6 100644 --- a/STL_Extension/include/CGAL/Multiset.h +++ b/STL_Extension/include/CGAL/Multiset.h @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -168,7 +167,7 @@ protected: Node* predecessor () const { // The DUMMY_BEGIN node has no predecessor. - CGAL_multiset_assertion (color != DUMMY_BEGIN); + CGAL_assertion (color != DUMMY_BEGIN); Node *predP; @@ -203,7 +202,7 @@ protected: Node* successor () const { // The DUMMY_END node has no successor. - CGAL_multiset_assertion (color != DUMMY_END); + CGAL_assertion (color != DUMMY_END); Node *succP; @@ -346,7 +345,7 @@ public: /*! Increment operator (prefix notation). */ iterator& operator++ () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->successor(); return (*this); @@ -355,7 +354,7 @@ public: /*! Increment operator (postfix notation). */ iterator operator++ (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); iterator temp = *this; @@ -366,7 +365,7 @@ public: /*! Decrement operator (prefix notation). */ iterator& operator-- () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->predecessor(); return (*this); @@ -375,7 +374,7 @@ public: /*! Decrement operator (postfix notation). */ iterator operator-- (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); iterator temp = *this; @@ -388,7 +387,7 @@ public: */ reference operator* () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (nodeP->object); } @@ -398,7 +397,7 @@ public: */ pointer operator-> () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (&(nodeP->object)); } @@ -461,7 +460,7 @@ public: /*! Increment operator (prefix notation). */ const_iterator& operator++ () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->successor(); return (*this); @@ -470,7 +469,7 @@ public: /*! Increment operator (postfix notation). */ const_iterator operator++ (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); const_iterator temp = *this; @@ -481,7 +480,7 @@ public: /*! Decrement operator (prefix notation). */ const_iterator& operator-- () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->predecessor(); return (*this); @@ -490,7 +489,7 @@ public: /*! Decrement operator (postfix notation). */ const_iterator operator-- (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); const_iterator temp = *this; @@ -503,7 +502,7 @@ public: */ reference operator* () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (nodeP->object); } @@ -513,7 +512,7 @@ public: */ pointer operator-> () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (&(nodeP->object)); } @@ -1956,7 +1955,7 @@ Multiset::insert (iterator positi { Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); // Compare the object to the one stored at the given node in order to decide // in which direction to proceed. @@ -2033,7 +2032,7 @@ Multiset::insert_after (iterator Node *nodeP = position.nodeP; // In case we are given a nullptr node, object should be the tree minimum. - CGAL_multiset_assertion (nodeP != &endNode); + CGAL_assertion (nodeP != &endNode); if (nodeP == &beginNode) nodeP = nullptr; @@ -2042,7 +2041,7 @@ Multiset::insert_after (iterator { // In case the tree is empty, make sure that we did not receive a valid // iterator. - CGAL_multiset_precondition (nodeP == nullptr); + CGAL_precondition (nodeP == nullptr); // Assign a new root node. Notice that the root is always black. rootP = _allocate_node (object, Node::BLACK); @@ -2070,7 +2069,7 @@ Multiset::insert_after (iterator // child of the current minimal leaf. parentP = beginNode.parentP; - CGAL_multiset_precondition (comp_f(object, parentP->object) != LARGER); + CGAL_precondition (comp_f(object, parentP->object) != LARGER); parentP->leftP = newNodeP; @@ -2081,9 +2080,9 @@ Multiset::insert_after (iterator else { // Make sure the insertion does not violate the tree order. - CGAL_multiset_precondition_code (Node *_succP = nodeP->successor()); - CGAL_multiset_precondition (comp_f(object, nodeP->object) != SMALLER); - CGAL_multiset_precondition (! _succP->is_valid() || + CGAL_precondition_code (Node *_succP = nodeP->successor()); + CGAL_precondition (comp_f(object, nodeP->object) != SMALLER); + CGAL_precondition (! _succP->is_valid() || comp_f(object, _succP->object) != LARGER); // In case given node has no right child, place the new node as its @@ -2131,7 +2130,7 @@ Multiset::insert_before (iterator Node *nodeP = position.nodeP; // In case we are given a nullptr node, object should be the tree maximum. - CGAL_multiset_assertion (nodeP != &beginNode); + CGAL_assertion (nodeP != &beginNode); if (nodeP == &endNode) nodeP = nullptr; @@ -2140,7 +2139,7 @@ Multiset::insert_before (iterator { // In case the tree is empty, make sure that we did not receive a valid // iterator. - CGAL_multiset_precondition (nodeP == nullptr); + CGAL_precondition (nodeP == nullptr); // Assign a new root node. Notice that the root is always black. rootP = _allocate_node(object, Node::BLACK); @@ -2168,7 +2167,7 @@ Multiset::insert_before (iterator // child of the current maximal leaf. parentP = endNode.parentP; - CGAL_multiset_precondition (comp_f(object, parentP->object) != SMALLER); + CGAL_precondition (comp_f(object, parentP->object) != SMALLER); parentP->rightP = newNodeP; @@ -2179,9 +2178,9 @@ Multiset::insert_before (iterator else { // Make sure the insertion does not violate the tree order. - CGAL_multiset_precondition_code (Node *_predP = nodeP->predecessor()); - CGAL_multiset_precondition (comp_f(object, nodeP->object) != LARGER); - CGAL_multiset_precondition (! _predP->is_valid() || + CGAL_precondition_code (Node *_predP = nodeP->predecessor()); + CGAL_precondition (comp_f(object, nodeP->object) != LARGER); + CGAL_precondition (! _predP->is_valid() || comp_f(object, _predP->object) != SMALLER); // In case given node has no left child, place the new node as its @@ -2258,7 +2257,7 @@ void Multiset::erase (iterator po { Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); _remove_at (nodeP); return; @@ -2294,16 +2293,16 @@ void Multiset::replace (iterator { Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); // Make sure the replacement does not violate the tree order. - CGAL_multiset_precondition_code (Node *_succP = nodeP->successor()); - CGAL_multiset_precondition (_succP == nullptr || + CGAL_precondition_code (Node *_succP = nodeP->successor()); + CGAL_precondition (_succP == nullptr || _succP->color == Node::DUMMY_END || comp_f(object, _succP->object) != LARGER); - CGAL_multiset_precondition_code (Node *_predP = nodeP->predecessor()); - CGAL_multiset_precondition (_predP == nullptr || + CGAL_precondition_code (Node *_predP = nodeP->predecessor()); + CGAL_precondition (_predP == nullptr || _predP->color == Node::DUMMY_BEGIN || comp_f(object, _predP->object) != SMALLER); @@ -2323,30 +2322,30 @@ void Multiset::swap (iterator pos Node *node1_P = pos1.nodeP; Node *node2_P = pos2.nodeP; - CGAL_multiset_precondition (_is_valid (node1_P)); - CGAL_multiset_precondition (_is_valid (node2_P)); + CGAL_precondition (_is_valid (node1_P)); + CGAL_precondition (_is_valid (node2_P)); if (node1_P == node2_P) return; // Make sure the swap does not violate the tree order. - CGAL_multiset_precondition_code (Node *_succ1_P = node1_P->successor()); - CGAL_multiset_precondition (! _is_valid (_succ1_P) || + CGAL_precondition_code (Node *_succ1_P = node1_P->successor()); + CGAL_precondition (! _is_valid (_succ1_P) || comp_f (node2_P->object, _succ1_P->object) != LARGER); - CGAL_multiset_precondition_code (Node *_pred1_P = node1_P->predecessor()); - CGAL_multiset_precondition (! _is_valid (_pred1_P) || + CGAL_precondition_code (Node *_pred1_P = node1_P->predecessor()); + CGAL_precondition (! _is_valid (_pred1_P) || comp_f (node2_P->object, _pred1_P->object) != SMALLER); - CGAL_multiset_precondition_code (Node *_succ2_P = node2_P->successor()); - CGAL_multiset_precondition (! _is_valid (_succ2_P) || + CGAL_precondition_code (Node *_succ2_P = node2_P->successor()); + CGAL_precondition (! _is_valid (_succ2_P) || comp_f (node1_P->object, _succ2_P->object) != LARGER); - CGAL_multiset_precondition_code (Node *_pred2_P = node2_P->predecessor()); - CGAL_multiset_precondition (! _is_valid (_pred2_P) || + CGAL_precondition_code (Node *_pred2_P = node2_P->predecessor()); + CGAL_precondition (! _is_valid (_pred2_P) || comp_f (node1_P->object, _pred2_P->object) != SMALLER); @@ -2438,13 +2437,13 @@ void Multiset::catenate (Self& tr if (min2_P == nullptr) { // The other tree is empty - nothing to do. - CGAL_multiset_assertion (tree.rootP == nullptr); + CGAL_assertion (tree.rootP == nullptr); return; } else if (max1_P == nullptr) { // Our tree is empty: Copy all other tree properties to our tree. - CGAL_multiset_assertion (rootP == nullptr); + CGAL_assertion (rootP == nullptr); _shallow_assign (tree); return; @@ -2452,12 +2451,12 @@ void Multiset::catenate (Self& tr // Make sure that the minimal object in the other tree is not less than the // maximal object in our tree. - CGAL_multiset_precondition (comp_f (max1_P->object, + CGAL_precondition (comp_f (max1_P->object, min2_P->object) != LARGER); // Make sure both tree roots black. - CGAL_multiset_assertion (_is_black (rootP)); - CGAL_multiset_assertion (_is_black (tree.rootP)); + CGAL_assertion (_is_black (rootP)); + CGAL_assertion (_is_black (tree.rootP)); // Splice max1_P (or min2_P) from its tree, but without deleting it. Node* auxP = nullptr; @@ -2561,7 +2560,7 @@ void Multiset::catenate (Self& tr if (_is_red (node2_P)) node2_P = node2_P->leftP; - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node2_P)); } else { @@ -2578,7 +2577,7 @@ void Multiset::catenate (Self& tr if (_is_red (node1_P)) node1_P = node1_P->rightP; - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node2_P)); } // Check which one of the tree roots have we reached. @@ -2615,7 +2614,7 @@ void Multiset::catenate (Self& tr // moving auxP to be their parent. parentP = node1_P->parentP; - CGAL_multiset_assertion (parentP != nullptr); + CGAL_assertion (parentP != nullptr); // The catenated tree will be rooted at the current root of our tree. newRootP = rootP; @@ -2670,7 +2669,7 @@ template ::split (iterator position, Self& tree) { - CGAL_multiset_precondition (tree.empty()); + CGAL_precondition (tree.empty()); // Check the extremal cases. if (position == begin()) @@ -2691,7 +2690,7 @@ void Multiset::split (iterator po // is at most twice the black-height of the tree. Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); Node *currP = nodeP; Comparison_result *path = new Comparison_result [2 * iBlackHeight]; @@ -2708,7 +2707,7 @@ void Multiset::split (iterator po currP = currP->parentP; } - CGAL_multiset_assertion (currP == rootP); + CGAL_assertion (currP == rootP); // Now go down the path and split the tree accordingly. We also keep // track of the black-height of the current node. @@ -2726,7 +2725,7 @@ void Multiset::split (iterator po while (depth >= 0) { - CGAL_multiset_assertion (_is_valid (currP)); + CGAL_assertion (_is_valid (currP)); // If we encounter a black node, the black-height of both its left and // right subtrees is decremented. @@ -2770,8 +2769,8 @@ void Multiset::split (iterator po else if (_is_valid (childP)) { // Catenate T_r with the current rightTree. - CGAL_multiset_assertion (_is_valid (spineRightP) && - _is_valid(auxRightP)); + CGAL_assertion (_is_valid (spineRightP) && + _is_valid(auxRightP)); // Make sure the root of T_r is black. size_t iCurrRightBHeight = iCurrBHeight; @@ -2784,7 +2783,7 @@ void Multiset::split (iterator po // Go down the leftmost path of rightTree until locating a black // node whose black height is exactly iCurrRightBHeight. - CGAL_multiset_assertion (iRightBHeight >= iCurrRightBHeight); + CGAL_assertion (iRightBHeight >= iCurrRightBHeight); while (iRightBHeight > iCurrRightBHeight) { @@ -2795,7 +2794,7 @@ void Multiset::split (iterator po if (_is_red (spineRightP)) spineRightP = spineRightP->leftP; - CGAL_multiset_assertion (_is_valid (spineRightP)); + CGAL_assertion (_is_valid (spineRightP)); // Use the auxiliary node and make it the parent of T_r (which // becomes its left sub-tree) and spineRightP (which becomes its @@ -2905,8 +2904,8 @@ void Multiset::split (iterator po else if (_is_valid (childP)) { // Catenate T_l with the current leftTree. - CGAL_multiset_assertion (_is_valid (spineLeftP) && - _is_valid(auxLeftP)); + CGAL_assertion (_is_valid (spineLeftP) && + _is_valid(auxLeftP)); // Make sure the root of T_l is black. size_t iCurrLeftBHeight = iCurrBHeight; @@ -2919,7 +2918,7 @@ void Multiset::split (iterator po // Go down the rightmost path of leftTree until locating a black // node whose black height is exactly iCurrLeftBHeight. - CGAL_multiset_assertion (iLeftBHeight >= iCurrLeftBHeight); + CGAL_assertion (iLeftBHeight >= iCurrLeftBHeight); while (iLeftBHeight > iCurrLeftBHeight) { @@ -2930,7 +2929,7 @@ void Multiset::split (iterator po if (_is_red (spineLeftP)) spineLeftP = spineLeftP->rightP; - CGAL_multiset_assertion (_is_valid (spineLeftP)); + CGAL_assertion (_is_valid (spineLeftP)); // Use the auxiliary node and make it the parent of T_l (which // becomes its right sub-tree) and spineLeftP (which becomes its @@ -3012,7 +3011,7 @@ void Multiset::split (iterator po // It is now possible to free the path. delete[] path; - CGAL_multiset_assertion (auxLeftP == nullptr && auxRightP == nodeP); + CGAL_assertion (auxLeftP == nullptr && auxRightP == nodeP); // Fix the properties of the left tree: We know its minimal node is the // same as the current minimum. @@ -3020,7 +3019,7 @@ void Multiset::split (iterator po leftTree.beginNode.parentP->leftP = &(leftTree.beginNode); // Traverse the rightmost path of the left tree to find the its maximum. - CGAL_multiset_assertion (_is_valid (spineLeftP)); + CGAL_assertion (_is_valid (spineLeftP)); while (_is_valid (spineLeftP->rightP)) spineLeftP = spineLeftP->rightP; @@ -3130,7 +3129,7 @@ void Multiset::_shallow_clear () template void Multiset::_remove_at (Node* nodeP) { - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); if (nodeP == rootP && ! _is_valid (rootP->leftP) && ! _is_valid (rootP->rightP)) @@ -3155,7 +3154,7 @@ void Multiset::_remove_at (Node* // which is the leftmost child in its right sub-tree and has at most // one child (it may have a right child). Node *succP = _sub_minimum (nodeP->rightP); - CGAL_multiset_assertion (_is_valid (succP)); + CGAL_assertion (_is_valid (succP)); // Now physically swap nodeP and its successor. Notice this may temporarily // violate the tree properties, but we are going to remove nodeP anyway. @@ -3169,7 +3168,7 @@ void Multiset::_remove_at (Node* if (_is_valid (nodeP->leftP)) { - CGAL_multiset_assertion (! _is_valid (nodeP->rightP)); + CGAL_assertion (! _is_valid (nodeP->rightP)); childP = nodeP->leftP; } else @@ -3247,8 +3246,8 @@ template ::_swap (Node* node1_P, Node* node2_P) { - CGAL_multiset_assertion (_is_valid (node1_P)); - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node1_P)); + CGAL_assertion (_is_valid (node2_P)); // Store the properties of the first node. typename Node::Node_color color1 = node1_P->color; @@ -3388,8 +3387,8 @@ template ::_swap_siblings (Node* node1_P, Node* node2_P) { - CGAL_multiset_assertion (_is_valid (node1_P)); - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node1_P)); + CGAL_assertion (_is_valid (node2_P)); // Store the properties of the first node. typename Node::Node_color color1 = node1_P->color; @@ -3422,7 +3421,7 @@ void Multiset::_swap_siblings (No Node *parent_P = node1_P->parentP; Node *temp; - CGAL_multiset_assertion (parent_P == node2_P->parentP); + CGAL_assertion (parent_P == node2_P->parentP); temp = parent_P->leftP; parent_P->leftP = parent_P->rightP; @@ -3464,7 +3463,7 @@ template ::_sub_height (const Node* nodeP) const { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); // Recursively calculate the heights of the left and right sub-trees. size_t iRightHeight = 0; @@ -3552,7 +3551,7 @@ template ::Node* Multiset::_sub_minimum (Node* nodeP) const { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); Node *minP = nodeP; @@ -3568,7 +3567,7 @@ template ::Node* Multiset::_sub_maximum (Node* nodeP) const { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); Node *maxP = nodeP; @@ -3593,7 +3592,7 @@ void Multiset::_rotate_left (Node // Get the right child of the node. Node *yNodeP = xNodeP->rightP; - CGAL_multiset_assertion (_is_valid (yNodeP)); + CGAL_assertion (_is_valid (yNodeP)); // Change its left subtree (T2) to x's right subtree. xNodeP->rightP = yNodeP->leftP; @@ -3639,7 +3638,7 @@ void Multiset::_rotate_right (Nod // Get the left child of the node. Node *xNodeP = yNodeP->leftP; - CGAL_multiset_assertion (_is_valid (xNodeP)); + CGAL_assertion (_is_valid (xNodeP)); // Change its right subtree (T2) to y's left subtree. yNodeP->leftP = xNodeP->rightP; @@ -3683,7 +3682,7 @@ template ::Node* Multiset::_duplicate (const Node* nodeP) { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); // Create a node of the same color, containing the same object. Node *dupNodeP = _allocate_node(nodeP->object, nodeP->color); @@ -3711,7 +3710,7 @@ Multiset::_duplicate (const Node* template void Multiset::_destroy (Node* nodeP) { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); // Destroy the children recursively. if (_is_valid (nodeP->rightP)) @@ -3734,7 +3733,7 @@ void Multiset::_destroy (Node* no template void Multiset::_insert_fixup (Node* nodeP) { - CGAL_multiset_precondition (_is_red (nodeP)); + CGAL_precondition (_is_red (nodeP)); // Fix the red-black propreties: we may have inserted a red leaf as the // child of a red parent - so we have to fix the coloring of the parent @@ -3748,7 +3747,7 @@ void Multiset::_insert_fixup (Nod // Get a pointer to the current node's grandparent (notice the root is // always black, so the red parent must have a parent). grandparentP = currP->parentP->parentP; - CGAL_multiset_precondition (grandparentP != nullptr); + CGAL_precondition (grandparentP != nullptr); if (currP->parentP == grandparentP->leftP) { @@ -3781,7 +3780,7 @@ void Multiset::_insert_fixup (Nod // Color the parent black and the grandparent red. currP->parentP->color = Node::BLACK; - CGAL_multiset_assertion (grandparentP == currP->parentP->parentP); + CGAL_assertion (grandparentP == currP->parentP->parentP); grandparentP->color = Node::RED; // Right-rotate the grandparent's sub-tree @@ -3819,7 +3818,7 @@ void Multiset::_insert_fixup (Nod // Color the parent black and the grandparent red. currP->parentP->color = Node::BLACK; - CGAL_multiset_assertion(grandparentP == currP->parentP->parentP); + CGAL_assertion(grandparentP == currP->parentP->parentP); grandparentP->color = Node::RED; // Left-rotate the grandparent's sub-tree @@ -3873,7 +3872,7 @@ void Multiset::_remove_fixup (Nod siblingP = currParentP->rightP; } - CGAL_multiset_assertion (_is_valid (siblingP)); + CGAL_assertion (_is_valid (siblingP)); if (_is_black (siblingP->leftP) && _is_black (siblingP->rightP)) { @@ -3889,7 +3888,7 @@ void Multiset::_remove_fixup (Nod // the black height of the entire tree. if (currP == rootP) { - CGAL_multiset_assertion (currParentP == nullptr); + CGAL_assertion (currParentP == nullptr); iBlackHeight--; } } @@ -3938,7 +3937,7 @@ void Multiset::_remove_fixup (Nod siblingP = currParentP->leftP; } - CGAL_multiset_assertion (_is_valid (siblingP)); + CGAL_assertion (_is_valid (siblingP)); if (_is_black (siblingP->leftP) && _is_black (siblingP->rightP)) { @@ -3954,7 +3953,7 @@ void Multiset::_remove_fixup (Nod // the black height of the entire tree. if (currP == rootP) { - CGAL_multiset_assertion (currParentP == nullptr); + CGAL_assertion (currParentP == nullptr); iBlackHeight--; } } @@ -4011,8 +4010,8 @@ Multiset::_allocate_node (const Type& object, typename Node::Node_color color) { - CGAL_multiset_assertion (color != Node::DUMMY_BEGIN && - color != Node::DUMMY_END); + CGAL_assertion (color != Node::DUMMY_BEGIN && + color != Node::DUMMY_END); Node* new_node = node_alloc.allocate(beginNode); new_node->init(object, color); diff --git a/STL_Extension/include/CGAL/multiset_assertions.h b/STL_Extension/include/CGAL/multiset_assertions.h deleted file mode 100644 index 89a7d6157ba..00000000000 --- a/STL_Extension/include/CGAL/multiset_assertions.h +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) 2005 Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -#ifndef CGAL_MULTISET_ASSERTIONS_H -#define CGAL_MULTISET_ASSERTIONS_H - -#include - -// macro definitions -// ================= -// assertions -// ---------- - - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_multiset_assertion(EX) (static_cast(0)) -# define CGAL_multiset_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_assertion_code(CODE) -#else -# define CGAL_multiset_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_assertion_code(CODE) CODE -# define CGAL_multiset_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_assertion(EX) (static_cast(0)) -# define CGAL_multiset_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_assertion_code(CODE) -#else -# define CGAL_multiset_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_assertion_code(CODE) CODE -# define CGAL_multiset_exactness_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_assertion(EX) (static_cast(0)) -# define CGAL_multiset_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_assertion_code(CODE) -#else -# define CGAL_multiset_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_assertion_code(CODE) CODE -# define CGAL_multiset_expensive_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - -// preconditions -// ------------- - - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_multiset_precondition(EX) (static_cast(0)) -# define CGAL_multiset_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_precondition_code(CODE) -#else -# define CGAL_multiset_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_precondition_code(CODE) CODE -# define CGAL_multiset_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_precondition(EX) (static_cast(0)) -# define CGAL_multiset_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_precondition_code(CODE) -#else -# define CGAL_multiset_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_precondition_code(CODE) CODE -# define CGAL_multiset_exactness_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_precondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_precondition_code(CODE) -#else -# define CGAL_multiset_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_precondition_code(CODE) CODE -# define CGAL_multiset_expensive_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - -// postconditions -// -------------- - - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_multiset_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_postcondition_code(CODE) -#else -# define CGAL_multiset_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_postcondition_code(CODE) CODE -# define CGAL_multiset_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_postcondition_code(CODE) -#else -# define CGAL_multiset_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_postcondition_code(CODE) CODE -# define CGAL_multiset_exactness_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_postcondition_code(CODE) -#else -# define CGAL_multiset_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_postcondition_code(CODE) CODE -# define CGAL_multiset_expensive_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - -// warnings -// -------- - - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_multiset_warning(EX) (static_cast(0)) -# define CGAL_multiset_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_warning_code(CODE) -#else -# define CGAL_multiset_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_warning_code(CODE) CODE -# define CGAL_multiset_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - - - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_warning(EX) (static_cast(0)) -# define CGAL_multiset_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_warning_code(CODE) -#else -# define CGAL_multiset_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_warning_code(CODE) CODE -# define CGAL_multiset_exactness_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - - - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_warning(EX) (static_cast(0)) -# define CGAL_multiset_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_warning_code(CODE) -#else -# define CGAL_multiset_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_warning_code(CODE) CODE -# define CGAL_multiset_expensive_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - - - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_warning_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_warning_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - -#endif // CGAL_MULTISET_ASSERTIONS From 075ba9be2827a75e932bbd482915fab4553853a6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 14 Oct 2022 14:44:18 +0100 Subject: [PATCH 180/248] Document breaking change --- Installation/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 6fb6917d483..e699c698d44 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -8,7 +8,7 @@ Release date: December 2022 ### General Changes -- The per package assertions, pre- and postconditions are no longer supported. +- **Breaking change**: The per package assertions, pre- and postconditions are no longer supported. ### [Combinatorial Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgCombinatorialMaps) [Generalized Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgGeneralizedMaps) [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex) From 2fe82ec9d9e6326505c618bc0861326b9620cf3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 16 Oct 2022 16:22:15 +0200 Subject: [PATCH 181/248] Add an example for ARAP parameterization --- .../examples.txt | 1 + .../ARAP_parameterization.cpp | 57 +++++++++++++++++++ .../CMakeLists.txt | 3 + 3 files changed, 61 insertions(+) create mode 100644 Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt index db7aa8e187c..c7d456389ec 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt @@ -1,4 +1,5 @@ /*! + \example Surface_mesh_parameterization/ARAP_parameterization.cpp \example Surface_mesh_parameterization/discrete_authalic.cpp \example Surface_mesh_parameterization/lscm.cpp \example Surface_mesh_parameterization/orbifold.cpp diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp new file mode 100644 index 00000000000..6919bd32dc8 --- /dev/null +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp @@ -0,0 +1,57 @@ +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_2 Point_2; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh SurfaceMesh; + +typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +namespace SMP = CGAL::Surface_mesh_parameterization; + +int main(int argc, char** argv) +{ + const std::string filename = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/head.off"); + + SurfaceMesh sm; + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Invalid input file." << std::endl; + return EXIT_FAILURE; + } + + // A halfedge on the border + halfedge_descriptor bhd = CGAL::Polygon_mesh_processing::longest_border(sm).first; + + // The 2D points of the uv parametrisation will be written into this map + typedef SurfaceMesh::Property_map UV_pmap; + UV_pmap uv_map = sm.add_property_map("v:uv").first; + + SMP::ARAP_parameterizer_3 parameterizer; + SMP::Error_code err = SMP::parameterize(sm, parameterizer, bhd, uv_map); + + if(err != SMP::OK) { + std::cerr << "Error: " << SMP::get_error_message(err) << std::endl; + return EXIT_FAILURE; + } + + std::ofstream out("result.off"); + SMP::IO::output_uvmap_to_off(sm, bhd, uv_map, out); + + return EXIT_SUCCESS; +} diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index d3a9dcad62f..6c093e87aaf 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -53,6 +53,8 @@ if(TARGET CGAL::Eigen3_support) # End of SuiteSparse detection # ------------------------------------------------------------------ + create_single_source_cgal_program("ARAP_parameterization.cpp") + target_link_libraries(ARAP_parameterization PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("discrete_authalic.cpp") target_link_libraries(discrete_authalic PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("lscm.cpp") @@ -68,6 +70,7 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program( "iterative_authalic_parameterizer.cpp" ) target_link_libraries(iterative_authalic_parameterizer PUBLIC CGAL::Eigen3_support) if(SuiteSparse_FOUND) + target_link_libraries(ARAP_parameterization PRIVATE ${SuiteSparse_LIBRARIES}) target_link_libraries(orbifold PRIVATE ${SuiteSparse_LIBRARIES}) endif() From 2a679483b2c1af4bb855bd13c2aa82ac93906ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 16 Oct 2022 16:22:29 +0200 Subject: [PATCH 182/248] Fix ARAP post processing The formula of weights is "- tan(theta / 2) / length", with: tan ( theta / 2 ) = sin ( theta ) / ( 1 + cos ( theta ) ) = ( 2 * A / |v1| * |v2| ) / ( 1 + v1 . v2 / |v1| * |v2| ) = 2 * A / ( |v1| * |v2| + v1 . v2 ) with A the _unsigned_ area. --- Weights/include/CGAL/Weights/tangent_weights.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Weights/include/CGAL/Weights/tangent_weights.h b/Weights/include/CGAL/Weights/tangent_weights.h index 03c8e91ad5b..da4c87d0fdd 100644 --- a/Weights/include/CGAL/Weights/tangent_weights.h +++ b/Weights/include/CGAL/Weights/tangent_weights.h @@ -461,7 +461,7 @@ namespace Weights { const auto v1 = construct_vector_2(q, r); const auto v2 = construct_vector_2(q, p); - const auto A = internal::area_2(traits, p, q, r); + const auto A = internal::positive_area_2(traits, p, q, r); CGAL_assertion(A != FT(0)); // three points are identical! const auto S = scalar_product_2(v1, v2); m_w_base = -tangent_half_angle(m_d_r, m_d_p, A, S); From e8486bc68eafbfabf32014dadc282ce060b5011b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 17 Oct 2022 15:28:58 +0200 Subject: [PATCH 183/248] add a convenience overload --- Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index dc30f94af43..fe30ba12085 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -82,6 +82,10 @@ namespace CGAL { size_type idx() const { return idx_; } + // For convenience + size_type id() const { + return idx_; + } /// increments the internal index. This operation does not /// guarantee that the index is valid or undeleted after the From bac56d78b49b2b90add643a78887b9a310642b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 17 Oct 2022 15:34:17 +0200 Subject: [PATCH 184/248] add convenience functions --- Polyhedron/include/CGAL/Polyhedron_3.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Polyhedron/include/CGAL/Polyhedron_3.h b/Polyhedron/include/CGAL/Polyhedron_3.h index 6505e960139..255bb786289 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_3.h @@ -855,6 +855,10 @@ public: Facet_iterator facets_end() { return hds_.faces_end();} + // added for convenience + Facet_iterator faces_begin() { return hds_.faces_begin();} + Facet_iterator faces_end() { return hds_.faces_end();} + Facet_handles facet_handles() { return make_prevent_deref_range(facets_begin(), facets_end()); } @@ -886,6 +890,10 @@ public: Facet_const_iterator facets_begin() const { return hds_.faces_begin();} Facet_const_iterator facets_end() const { return hds_.faces_end();} + // added for convenience + Facet_const_iterator faces_begin() const { return hds_.faces_begin();} + Facet_const_iterator faces_end() const { return hds_.faces_end();} + Facet_const_handles facet_handles() const { return make_prevent_deref_range(facets_begin(), facets_end()); } From 36c16eeedf7c1afb7cc8121d5ea53f3ec996134e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 17 Oct 2022 15:39:01 +0200 Subject: [PATCH 185/248] fix function names in the visitor --- .../corefinement_mesh_union_progress.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp index 8b49c843d29..ccdf1acb57e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp @@ -130,7 +130,7 @@ struct Visitor : sptr->start_triangulating_faces(tf); } - void face_triangulation(std::size_t i) const + void triangulating_faces_step(std::size_t i) const { sptr->face_triangulation(i); } @@ -140,7 +140,7 @@ struct Visitor : std::cout << "Visitor::end_triangulating_faces() at " << sptr->time() << " sec." << std::endl; } - void start_coplanar_faces(std::size_t i) const + void start_handling_intersection_of_coplanar_faces(std::size_t i) const { sptr->start_coplanar_faces(i); } @@ -150,12 +150,12 @@ struct Visitor : sptr->intersection_of_coplanar_faces_step(); } - void end_coplanar_faces() const + void end_handling_intersection_of_coplanar_faces() const { std::cout << "Visitor::end_coplanar_faces() at " << sptr->time() << " sec." << std::endl; } - void start_intersection_points(std::size_t i) const + void start_handling_edge_face_intersections(std::size_t i) const { sptr->start_intersection_points(i); } @@ -165,7 +165,7 @@ struct Visitor : sptr->edge_face_intersections_step(); } - void end_intersection_points() const + void end_handling_edge_face_intersections() const { std::cout << "Visitor::end_intersection_points() at " << sptr->time() << " sec." << std::endl; } From 40c1fdc03dfdfbc6f23372cca005b46da5516dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 18 Oct 2022 06:05:13 +0200 Subject: [PATCH 186/248] use MSVC overload for everybody clang master also have issue with the generic variadic versions --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 13 +- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 102 +++++++-------- Mesh_3/include/CGAL/Mesh_criteria_3.h | 16 +-- Mesh_3/include/CGAL/exude_mesh_3.h | 22 ++-- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 15 +-- Mesh_3/include/CGAL/make_mesh_3.h | 20 ++- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 20 ++- Mesh_3/include/CGAL/perturb_mesh_3.h | 20 +-- Mesh_3/include/CGAL/refine_mesh_3.h | 19 ++- .../include/CGAL/make_periodic_3_mesh_3.h | 20 +-- .../include/CGAL/optimize_periodic_3_mesh_3.h | 122 +++++++++--------- .../include/CGAL/refine_periodic_3_mesh_3.h | 20 +-- .../internal/mesh_parameters_interface.h | 14 +- 13 files changed, 204 insertions(+), 219 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 57162e18a80..550454df1a5 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -164,11 +164,18 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va } #ifndef DOXYGEN_RUNNING - template + // Overload handling parameters passed with operator= + template Mesh_optimization_return_code - lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& ... nps) + perturb_periodic_3_mesh_3(CDT& cdt, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { - return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(nps ...)); + return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(np1, np2, nps...)); } /** diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 6547264895a..9e26458c210 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -414,17 +414,17 @@ public: parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) {} -#if !defined(BOOST_MSVC) - template - Labeled_mesh_domain_3(const CGAL_NP_CLASS& ... nps) - : Labeled_mesh_domain_3(internal_np::combine_named_parameters(nps...)) - {} -#else - template - Labeled_mesh_domain_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + + // Overload handling parameters passed with operator= + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) : Labeled_mesh_domain_3(internal_np::combine_named_parameters(np1, np2, nps...)) {} -#endif + #ifndef CGAL_NO_DEPRECATED_CODE template @@ -662,31 +662,29 @@ public: create_construct_surface_patch_index(construct_surface_patch_index_)); } -#if !defined(BOOST_MSVC) - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) - { - return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); - } - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& ... nps) - { - return create_gray_image_mesh_domain(internal_np::combine_named_parameters(nps...)); - } -#else - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(np1, np2, nps...)); } - - template - static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return create_gray_image_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + template static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& np) { @@ -696,30 +694,28 @@ public: return create_labeled_image_mesh_domain(image_, np); } -#if !defined(BOOST_MSVC) - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& ... nps) - { - return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(nps...)); - } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& ... nps) - { - return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(nps...)); - } -#else - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(np1, np2, nps...)); } - template - static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); } #endif -#endif /// \name Creation of domains from implicit functions /// @{ @@ -804,19 +800,17 @@ public: np); } -#if !defined(BOOST_MSVC) - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& ... nps) - { - return create_implicit_mesh_domain(internal_np::combine_named_parameters(nps...)); - } -#else - template - static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return create_implicit_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + #ifndef CGAL_NO_DEPRECATED_CODE template -Mesh_criteria_3(const CGAL_NP_CLASS& ... nps):Mesh_criteria_3(internal_np::combine_named_parameters(nps...)) -{ -} -#else -template -Mesh_criteria_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_criteria_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) : Mesh_criteria_3(internal_np::combine_named_parameters(np1, np2, nps...)) { } -#endif }; // end class Mesh_criteria_3 diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index e020d631513..82ec7d512b2 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -109,22 +109,18 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, do } #endif #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) -{ - return exude_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return exude_mesh_3(c3t3,internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif - - - template Mesh_optimization_return_code diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 70964c4cf3a..8c5a2c8c3da 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -148,20 +148,15 @@ Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& doma } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) -{ - return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); -} -#else -template +// Overload handling parameters passed with operator= +template Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) { return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif - template Mesh_optimization_return_code diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 5319c0cf11f..64105159344 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -438,20 +438,18 @@ C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) -{ - return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); -} -#else -template -C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif - /** * @brief This function meshes the domain defined by mesh_traits diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 818de43e49f..5c1d39e36f0 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -143,20 +143,18 @@ Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain } #ifndef DOXYGEN_RUNNING - -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) -{ - return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif template Mesh_optimization_return_code diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 0ecae5d6276..e5be05310df 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -115,19 +115,19 @@ Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, con #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) -{ - return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + template diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index 21b159bd764..94a44676b0c 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -286,19 +286,18 @@ void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) -{ - return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); -} -#else -template -void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif /** * @brief This function refines the mesh c3t3 wrt domain & criteria * diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index f12ed4bc415..2c42a1b9800 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -334,19 +334,19 @@ C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CG #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) -{ - return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(nps...)); -} -#else -template -C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + /** * @brief This function meshes the domain defined by mesh_traits 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 7b048c15d9d..ee986ea9c8c 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 @@ -45,29 +45,29 @@ Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) -{ - return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); -} -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); } -template -Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + // ---------------------------------- exuder ----------------------------------- /*! * \ingroup PkgPeriodic3Mesh3Functions @@ -95,29 +95,29 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C 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); } -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS& ... nps) -{ - return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(nps...)); -} -template -Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(np1, np2, nps...)); } -template -Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + // ------------------------------ odt optimizer -------------------------------- @@ -143,29 +143,29 @@ Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDom return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& ... nps) -{ - return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(nps...)); -} -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS& ... nps) -{ - return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(np1, np2, nps...)); } -template -Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + // ------------------------------- lloyd optimizer ----------------------------- /*! @@ -192,19 +192,19 @@ Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshD return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -#if !defined(BOOST_MSVC) -template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS& ... nps) -{ - return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(nps...)); -} -#else -template -Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + } // namespace CGAL #endif // CGAL_OPTIMIZE_PERIODIC_3_MESH_3_H 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 b97b2c99604..a26050181ae 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 @@ -323,19 +323,19 @@ void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& crit } #ifndef DOXYGEN_RUNNING -#if !defined(BOOST_MSVC) -template -void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& ... nps) -{ - return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(nps...)); -} -#else -template -void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +// Overload handling parameters passed with operator= +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } -#endif + /** * @brief This function refines the mesh c3t3 wrt domain & criteria * diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h index 5a8e8be90e3..57362801de2 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -54,11 +54,11 @@ perturb(const CGAL_NP_CLASS& np = parameters::default_values()) return CGAL_NP_BUILD(Param, options); } -template -Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> -perturb(const CGAL_NP_CLASS& ... nps) +template +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +perturb(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) { - return perturb(::CGAL::internal_np::combine_named_parameters(nps...)); + return perturb(::CGAL::internal_np::combine_named_parameters(np1, np2, nps...)); } @@ -103,11 +103,11 @@ exude(const CGAL_NP_CLASS& np = parameters::default_values()) return CGAL_NP_BUILD(Param, options); } -template +template Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> -exude(const CGAL_NP_CLASS& ... nps) +exude(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) { - return exude(::CGAL::internal_np::combine_named_parameters(nps...)); + return exude(::CGAL::internal_np::combine_named_parameters(np1, np2, nps...)); } inline Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> From 43c127fdff8acb92c9c470083c75fb9ea2bd46ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 19 Oct 2022 13:35:35 +0200 Subject: [PATCH 187/248] copy/paste error --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 550454df1a5..3f80db3ec3f 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -170,10 +170,10 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT_2, typename ... NP> Mesh_optimization_return_code - perturb_periodic_3_mesh_3(CDT& cdt, - const CGAL_NP_CLASS_1& np1, - const CGAL_NP_CLASS_2& np2, - const NP& ... nps) + lloyd_optimize_mesh_2(CDT& cdt, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(np1, np2, nps...)); } From c4f6912e47f40ffc0e70e63980fbca87c318f7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 19 Oct 2022 13:55:19 +0200 Subject: [PATCH 188/248] use correct API --- .../corefinement_mesh_union_progress.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp index ccdf1acb57e..67c2c3615fe 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp @@ -105,6 +105,7 @@ struct Visitor : public PMP::Corefinement::Default_visitor { std::shared_ptr sptr; + mutable std::size_t tf_counter = 0; Visitor() : sptr(std::make_shared()) @@ -124,15 +125,16 @@ struct Visitor : std::cout << "Visitor::end_filtering_intersections() at " << sptr->time() << " sec." << std::endl; } - void start_triangulating_faces(std::size_t tf)const + void start_triangulating_faces(std::size_t tf) const { std::cout << "Visitor::start_triangulation() with " << tf << " faces at " << sptr->time() << " sec." << std::endl; sptr->start_triangulating_faces(tf); + tf_counter = 0; } - void triangulating_faces_step(std::size_t i) const + void triangulating_faces_step() const { - sptr->face_triangulation(i); + sptr->face_triangulation(tf_counter++); } void end_triangulating_faces()const From dcc4e6ade4b2ba2e122b97dbc74addfd08cb02ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 19 Oct 2022 16:59:47 +0200 Subject: [PATCH 189/248] disable for all MSVC --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 9e26458c210..e9f9ec831b1 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -428,7 +428,7 @@ public: #ifndef CGAL_NO_DEPRECATED_CODE template -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1910) +#if !defined(BOOST_MSVC) CGAL_DEPRECATED #endif Labeled_mesh_domain_3(const Function& function, From 645e33aa56fcf742f1365ab4a20a4643d21f7605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 19 Oct 2022 17:00:03 +0200 Subject: [PATCH 190/248] fix warnings --- Mesh_3/include/CGAL/exude_mesh_3.h | 2 +- Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h | 2 +- .../CGAL/STL_Extension/internal/mesh_parameters_interface.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 82ec7d512b2..e5480aa1dee 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -96,7 +96,7 @@ Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = { using parameters::choose_parameter; using parameters::get_parameter; - int time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); 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); } 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 ee986ea9c8c..a3f41113d8a 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 @@ -91,7 +91,7 @@ Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_C { using parameters::choose_parameter; using parameters::get_parameter; - int time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double 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); } diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h index 57362801de2..ece342c321b 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -140,7 +140,7 @@ odt(const CGAL_NP_CLASS& np = parameters::default_values()) double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),0); double freeze_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::vertex_freeze_bound),::CGAL::parameters::default_values_for_mesh_3::odt_freeze_ratio); double convergence = choose_parameter(get_parameter(np,::CGAL::internal_np::convergence_ratio), ::CGAL::parameters::default_values_for_mesh_3::odt_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); + std::size_t max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); ::CGAL::parameters::internal::Odt_options options(true); options.set_time_limit(time_limit); @@ -195,7 +195,7 @@ lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),0); double freeze_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::vertex_freeze_bound),::CGAL::parameters::default_values_for_mesh_3::lloyd_freeze_ratio); double convergence = choose_parameter(get_parameter(np,::CGAL::internal_np::convergence_ratio), ::CGAL::parameters::default_values_for_mesh_3::lloyd_convergence_ratio); - int max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); + std::size_t max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); ::CGAL::parameters::internal::Lloyd_options options(true); options.set_time_limit(time_limit); From 4ca779d991e0b57fb57cb09c87476adf4770dc17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 20 Oct 2022 11:22:40 +0200 Subject: [PATCH 191/248] fix warning --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 4dab0134db6..587143de0f8 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -59,12 +59,12 @@ struct Global_optimization_options_base double convergence() const { return convergence_; } bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } - void set_max_iteration_number(int i) { max_it_nb_ = i; } + void set_max_iteration_number(std::size_t i) { max_it_nb_ = i; } int max_iteration_number() const { return max_it_nb_; } private: double convergence_; - int max_it_nb_; + std::size_t max_it_nb_; }; // Perturb From 2285a79148384d1e23d8d7d3bca95aeee4fd3f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 21 Oct 2022 09:31:03 +0200 Subject: [PATCH 192/248] fix warning --- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 587143de0f8..5f94b308737 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -60,7 +60,7 @@ struct Global_optimization_options_base bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } void set_max_iteration_number(std::size_t i) { max_it_nb_ = i; } - int max_iteration_number() const { return max_it_nb_; } + std::size_t max_iteration_number() const { return max_it_nb_; } private: double convergence_; From 9072a9c9367f52c9121a6ce9281607930faa0330 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 21 Oct 2022 09:01:48 +0100 Subject: [PATCH 193/248] Polyhedron demo code --- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 3 --- .../demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp | 2 -- .../demo/Polyhedron/Scene_nef_polyhedron_item.cpp | 2 -- .../Polyhedron/Scene_polyhedron_selection_item.cpp | 10 ++++------ Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp | 5 ++--- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index a806f73e76f..1cae60b9a70 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -299,12 +299,10 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() std::vector remaining_cycles; CGAL::Polygon_mesh_processing::extract_boundary_cycles(tm, std::back_inserter(remaining_cycles)); - int tested=0, done=0; for (halfedge_descriptor hc : remaining_cycles) { if (next(next(hc,tm),tm)==prev(hc,tm)) { - ++tested; //get smallest halfedge halfedge_descriptor hm = hc; double min_l = CGAL::Polygon_mesh_processing::edge_length(hc, tm); @@ -335,7 +333,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() std::array vr = { source(hm, tm), target(hm, tm), target(next(hm, tm), tm) }; CGAL::Euler::add_face(vr, tm); CGAL::Euler::collapse_edge(edge(hm, tm), tm); - ++done; } } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index c2150d90688..92568b3e193 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -753,7 +753,6 @@ public Q_SLOTS: return; } std::unordered_map is_selected_map; - int index = 0; for(fg_face_descriptor fh : faces(*selection_item->polyhedron())) { if(selection_item->selected_facets.find(fh) @@ -763,7 +762,6 @@ public Q_SLOTS: { is_selected_map[fh]=true; } - ++index; } CGAL::expand_face_selection_for_removal(selection_item->selected_facets, *selection_item->polyhedron(), diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp index 27ec846f35c..4e2294cdaa6 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp @@ -189,7 +189,6 @@ Scene_nef_polyhedron_item_priv::mark_domains(CDT& ct, void Scene_nef_polyhedron_item_priv::compute_normals_and_vertices(void) const { QApplication::setOverrideCursor(Qt::WaitCursor); - int count = 0; positions_facets.resize(0); positions_points.resize(0); normals.resize(0); @@ -205,7 +204,6 @@ void Scene_nef_polyhedron_item_priv::compute_normals_and_vertices(void) const { if(f->is_twin()) continue; bool incident_volume_marked = f->incident_volume()->mark(); - count++; Nef_polyhedron::Vector_3 v = (incident_volume_marked? -1:1) * f->plane().orthogonal_vector(); P_traits cdt_traits(v); CDT cdt(cdt_traits); diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index 8c093d7675f..ea21767f2da 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -461,7 +461,6 @@ void Scene_polyhedron_selection_item_priv::compute_temp_elements()const const CGAL::qglviewer::Vec offset = Three::mainViewer()->offset(); color_fixed_points.clear(); positions_fixed_points.clear(); - int i=0; constVPmap vpm = get(CGAL::vertex_point,*polyhedron()); @@ -487,7 +486,6 @@ void Scene_polyhedron_selection_item_priv::compute_temp_elements()const color_fixed_points.push_back(0.0); color_fixed_points.push_back(0.0); } - i++; } } @@ -509,10 +507,10 @@ void Scene_polyhedron_selection_item_priv::compute_temp_elements()const positions_temp_points.data(), static_cast(positions_temp_points.size()*sizeof(float))); -item->getPointContainer(Fixed_points)->allocate( - Pc::Vertices, - positions_fixed_points.data(), - static_cast(positions_fixed_points.size()*sizeof(float))); + item->getPointContainer(Fixed_points)->allocate( + Pc::Vertices, + positions_fixed_points.data(), + static_cast(positions_fixed_points.size()*sizeof(float))); item->getPointContainer(Fixed_points)->allocate( Pc::Colors, diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp index 7dfc1825da6..966acaf34e4 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -602,12 +602,11 @@ void Scene_polylines_item::split_at_sharp_angles() typedef Polyline Bare_polyline; Polylines_container& bare_polylines = polylines; - int counter = 0; for(Bare_polyline_container::iterator bare_polyline_it = bare_polylines.begin(); bare_polyline_it != bare_polylines.end(); // the end changes - // during the loop - ++counter /* bare_polyline_it is incremented in the loop */) + // during the loop + /* bare_polyline_it is incremented in the loop */) { Bare_polyline_container::iterator current_polyline_it = bare_polyline_it; From e3ca1579925854add674946f6435f168b86afed5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 21 Oct 2022 09:04:33 +0100 Subject: [PATCH 194/248] Addess -Warray-parameter warning in Polyhedron demo code --- .../demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp index 4fd2bad9af2..96051a607c4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp @@ -203,7 +203,7 @@ void Scene_movable_sm_item::invalidateOpenGLBuffers() CGAL::Three::Scene_item::ManipulatedFrame* Scene_movable_sm_item::manipulatedFrame() { return d->frame; } const CGAL::qglviewer::Vec& Scene_movable_sm_item::center() const { return d->center_; } Scene_movable_sm_item::~Scene_movable_sm_item() { delete d; Q_EMIT killed(); } -void Scene_movable_sm_item::setFMatrix(const GLdouble matrix[]) +void Scene_movable_sm_item::setFMatrix(const GLdouble matrix[16]) { for (int i=0; i<16; ++i) d->f_matrix.data()[i] = (float)matrix[i]; From 7ea0f8bdf367d9972e90dac08e5d3df4505682e6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 21 Oct 2022 09:14:58 +0100 Subject: [PATCH 195/248] Deal with a set but unused warning --- .../include/CGAL/Segment_Delaunay_graph_Linf_2.h | 1 + .../Segment_Delaunay_graph_Linf_2_impl.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h index 47093483971..fb8d2378953 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h @@ -43,6 +43,7 @@ #include #include +#include #include #include diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h index 6f346a248bc..73a5247879e 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h @@ -105,6 +105,7 @@ find_faces_to_split(const Vertex_handle& v, const Site_2& t, Face_circulator fc_start = fc; int n_inf = 0; int n_faces = 0; + CGAL_USE(n_faces); do { if ( is_infinite(fc) ) { n_inf++; } fc++; From 9189d4265a8cbf9b6cd8af9e9d56d5953e165760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 21 Oct 2022 13:11:53 +0200 Subject: [PATCH 196/248] Remove fake PMP dependency in Heat_method_3 --- .../CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h | 1 - Heat_method_3/package_info/Heat_method_3/dependencies | 1 - 2 files changed, 2 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 47cc87c0a75..d60a7ec5a2f 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #ifdef CGAL_EIGEN3_ENABLED #include diff --git a/Heat_method_3/package_info/Heat_method_3/dependencies b/Heat_method_3/package_info/Heat_method_3/dependencies index 50488d5544f..582ac1009f9 100644 --- a/Heat_method_3/package_info/Heat_method_3/dependencies +++ b/Heat_method_3/package_info/Heat_method_3/dependencies @@ -11,7 +11,6 @@ Interval_support Kernel_23 Modular_arithmetic Number_types -Polygon_mesh_processing Profiling_tools Property_map Random_numbers From a57dab7b0b6576e095b7eb1fd5659de8c6965b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 21 Oct 2022 13:12:25 +0200 Subject: [PATCH 197/248] Misc minor code improvements --- .../Surface_mesh_geodesic_distances_3.h | 13 +++++++++---- .../Intrinsic_Delaunay_triangulation_3.h | 19 +++++++++++-------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index d60a7ec5a2f..27194ef7baf 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -92,8 +92,13 @@ public: /*! \brief Constructor */ - Surface_mesh_geodesic_distances_3(const TriangleMesh& tm) - : vertex_id_map(get(Vertex_property_tag(),tm)), face_id_map(get(Face_property_tag(),tm)), v2v(tm), tm(tm), vpm(get(vertex_point,tm)) + Surface_mesh_geodesic_distances_3(const TriangleMesh& tm, + VertexPointMap vpm) + : vertex_id_map(get(Vertex_property_tag(), tm)), + face_id_map(get(Face_property_tag(), tm)), + v2v(tm), + tm(tm), + vpm(vpm) { build(); } @@ -101,8 +106,8 @@ public: /*! \brief Constructor */ - Surface_mesh_geodesic_distances_3(const TriangleMesh& tm, VertexPointMap vpm) - : vertex_id_map(get(Vertex_property_tag(),tm)), face_id_map(get(Face_property_tag(),tm)), v2v(tm), tm(tm), vpm(vpm) + Surface_mesh_geodesic_distances_3(const TriangleMesh& tm) + : Surface_mesh_geodesic_distances_3(tm, get(vertex_point, tm)) { build(); } diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index c4fecf865fa..2d8432e0f08 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -66,13 +66,16 @@ bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits) typename Traits::Construct_cross_product_vector_3 cross_product = traits.construct_cross_product_vector_3_object(); - typename boost::property_map< TriangleMesh, boost::vertex_point_t>::const_type - vpm = get(boost::vertex_point, tm); + typedef typename boost::property_map< TriangleMesh, boost::vertex_point_t>::const_type VPM; + typedef typename boost::property_traits::reference Point_ref; + + VPM vpm = get(boost::vertex_point, tm); + for (typename boost::graph_traits::face_descriptor f : faces(tm)) { - const Point p1 = get(vpm, target(halfedge(f, tm), tm)); - const Point p2 = get(vpm, target(next(halfedge(f, tm), tm), tm)); - const Point p3 = get(vpm, target(next(next(halfedge(f, tm), tm), tm), tm)); + const Point_ref p1 = get(vpm, target(halfedge(f, tm), tm)); + const Point_ref p2 = get(vpm, target(next(halfedge(f, tm), tm), tm)); + const Point_ref p3 = get(vpm, target(next(next(halfedge(f, tm), tm), tm), tm)); Vector_3 v = cross_product(construct_vector(p1, p2), construct_vector(p1, p3)); if(scalar_product(v, v) == 0.) return true; @@ -278,7 +281,7 @@ private: } - //returns true if edge is locally Delaunay (opposing angles are less than pi): + //returns `true` if edge is locally Delaunay (opposing angles are less than pi): //Two ways of doing this: taking angles directly (not good with virtual edges) //OR: taking edge length and using law of cosines, //The second way checks cotan weights @@ -797,11 +800,11 @@ struct IDT_vertex_distance_property_map { friend void put(IDT_vertex_distance_property_map idtpm, key_type vd, - value_type v) + value_type val) { typename boost::graph_traits::vertex_descriptor tm_vd = target(vd.hd, idtpm.idt.triangle_mesh()); - put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), v); + put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), val); } }; From a80341a8fd671dc0228ef040ab9a223fd1d89f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 21 Oct 2022 13:27:17 +0200 Subject: [PATCH 198/248] Rewrite triangle mesh assertion to avoid calling BGL function The intrinsic HM3 graph is not a valid halfedge graph and would fail the new (valid) preconditons added to BGL --- .../CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 27194ef7baf..be5b7ccd5d7 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -487,13 +487,16 @@ private: } m_source_change_flag = false; - CGAL_precondition(is_triangle_mesh(tm)); Index i = 0; for(vertex_descriptor vd : vertices(tm)){ put(vertex_id_map, vd, i++); } Index face_i = 0; for(face_descriptor fd : faces(tm)){ + // Do not use BGL's version because `tm` is not a valid halfedge graph due to its weird vertex descriptor: + // it fails checks such as halfedge(target(h, g), g) == h + CGAL_assertion_code(halfedge_descriptor hd = halfedge(fd, tm);) + CGAL_assertion(hd == next(next(next(hd,tm),tm),tm)); put(face_id_map, fd, face_i++); } dimension = static_cast(num_vertices(tm)); From df67952011d901e44a2acab22e3cb677f8bd7f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 21 Oct 2022 13:28:26 +0200 Subject: [PATCH 199/248] Add missing include --- .../CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index be5b7ccd5d7..b257c53843d 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include From 40fdc6c6bc48eec140353fca3e930f578745f18b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 21 Oct 2022 14:18:03 +0200 Subject: [PATCH 200/248] updated crontab (automated commit) --- Maintenance/infrastructure/cgal.geometryfactory.com/crontab | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index ce30c5ee6d7..e5a4bd3dc05 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -21,9 +21,9 @@ LC_CTYPE=en_US.UTF-8 # "master" alone 0 21 * * Sun cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/master.git --do-it --public || echo ERROR # "integration" -0 21 * * Mon,Tue,Wed,Thu cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR +0 21 * * Mon,Tue,Wed,Thu,Fri cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR # from branch 5.5 -0 21 * * Fri cd $HOME/CGAL/create_internal_release-5.5-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.5-branch.git --public --do-it || echo ERROR +#0 21 * * Fri cd $HOME/CGAL/create_internal_release-5.5-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.5-branch.git --public --do-it || echo ERROR # from branch 5.4 0 21 * * Sat cd $HOME/CGAL/create_internal_release-5.4-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.4-branch.git --public --do-it || echo ERROR From 70da3beb845752624c23d134dc5dd21298306724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 21 Oct 2022 14:30:45 +0200 Subject: [PATCH 201/248] Remove obsolete dependency --- Heat_method_3/package_info/Heat_method_3/dependencies | 1 - 1 file changed, 1 deletion(-) diff --git a/Heat_method_3/package_info/Heat_method_3/dependencies b/Heat_method_3/package_info/Heat_method_3/dependencies index 582ac1009f9..42f0881808e 100644 --- a/Heat_method_3/package_info/Heat_method_3/dependencies +++ b/Heat_method_3/package_info/Heat_method_3/dependencies @@ -4,7 +4,6 @@ Cartesian_kernel Circulator Distance_2 Distance_3 -Filtered_kernel Heat_method_3 Installation Interval_support From 9179a2d41b731ffc6e917070595b3f76cabec172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 24 Oct 2022 09:12:44 +0200 Subject: [PATCH 202/248] fix conversion warning --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 2 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 +- Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h | 2 +- .../include/CGAL/STL_Extension/internal/mesh_option_classes.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 3f80db3ec3f..e145b6524e8 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -123,7 +123,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va using parameters::get_parameter_reference; using parameters::is_default_parameter; - int max_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 0); + std::size_t 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 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.); diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 8c5a2c8c3da..54c239802e8 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -139,7 +139,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); + std::size_t 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), parameters::default_values_for_mesh_3::lloyd_convergence_ratio); const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), parameters::default_values_for_mesh_3::lloyd_freeze_ratio); const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), parameters::default_values_for_mesh_3::time_limit); 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 a3f41113d8a..0a7c1e5ef4c 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 @@ -184,7 +184,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); + std::size_t 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.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.); diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index 5f94b308737..09487cc44f9 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -58,7 +58,7 @@ struct Global_optimization_options_base void set_convergence(double d) { convergence_ = d; } double convergence() const { return convergence_; } - bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } + bool is_max_iteration_number_set() const { return max_it_nb_ != std::size_t(undef_parameter); } void set_max_iteration_number(std::size_t i) { max_it_nb_ = i; } std::size_t max_iteration_number() const { return max_it_nb_; } From 4e0a2522f3f99c4cb3ec1980434a48d1319ffb6b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 24 Oct 2022 09:18:03 +0200 Subject: [PATCH 203/248] updated crontab (automated commit) --- Maintenance/infrastructure/cgal.geometryfactory.com/crontab | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index e5a4bd3dc05..ce30c5ee6d7 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -21,9 +21,9 @@ LC_CTYPE=en_US.UTF-8 # "master" alone 0 21 * * Sun cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/master.git --do-it --public || echo ERROR # "integration" -0 21 * * Mon,Tue,Wed,Thu,Fri cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR +0 21 * * Mon,Tue,Wed,Thu cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR # from branch 5.5 -#0 21 * * Fri cd $HOME/CGAL/create_internal_release-5.5-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.5-branch.git --public --do-it || echo ERROR +0 21 * * Fri cd $HOME/CGAL/create_internal_release-5.5-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.5-branch.git --public --do-it || echo ERROR # from branch 5.4 0 21 * * Sat cd $HOME/CGAL/create_internal_release-5.4-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.4-branch.git --public --do-it || echo ERROR From 1c28b3df45bda92866498065bfb9a3df858bdc04 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Oct 2022 15:15:50 +0100 Subject: [PATCH 204/248] Point_set_3: Fix typos in the reference manual page --- Point_set_3/include/CGAL/Point_set_3.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 74b731a0d31..304cf589d5f 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -48,23 +48,23 @@ namespace CGAL { two particular properties that are hard coded by this class: the coordinates of the points and the normal vectors. - The coordinates of a point can be access using the index of the + The coordinates of a point can be accessed using the index of the point and the member function `point()`. This property is always present. The normal vector of a point can be accessed using the index of the point and the `normal()` method. This property must be explicitly created. All properties can be accessed as a range using the methods - `points()`, `normals()`, and `range()` for points coordinates, + `points()`, `normals()`, and `range()` for point coordinates, normal vectors, and other properties respectively. - Removing a point with properties is achieved by moving its `Index` + Removing a point with properties is achieved by moving its index at the end of the container and keeping track of the number of removed elements. A garbage collection method must be called to really remove it from memory. For convenience, all functions of the package \ref - PkgPointSetProcessing3 automatically creates the right named + PkgPointSetProcessing3 automatically create the right named parameters if called with a `CGAL::Point_set_3` object as argument. From fcc68a69c80f71a7c093b7d053009a2e0b63b0f9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Oct 2022 07:34:36 +0100 Subject: [PATCH 205/248] Arrangement demo --- .../demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp index 74b52284922..b470946cec0 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp @@ -198,7 +198,6 @@ ArrangementPainterOstreamfirst, p_curr->second); @@ -206,7 +205,6 @@ ArrangementPainterOstreamqp->drawLine(p1, p2); p_curr++; p_next++; - ++count; } while (p_next != end_pts); }; From 1649d73a682083ab8a215237a72d5c61c3edd920 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Oct 2022 07:36:03 +0100 Subject: [PATCH 206/248] LCC demo --- .../Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp index d157e9ba2e6..16b74ff6736 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp @@ -134,11 +134,10 @@ subdivide_lcc_3 (LCC & m) // 2) We subdivide each facet. m.negate_mark (treated); // All the darts are marked in O(1). - unsigned int nb = 0; + for (LCC::Dart_range::iterator it (m.darts().begin ()); m.number_of_marked_darts (treated) > 0; ++it) { - ++nb; if (m.is_marked (it, treated)) { // We unmark the darts of the facet to process only once dart/facet. From fda8fa186c6ac491bd70c8710060dbde880016a6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Oct 2022 07:37:15 +0100 Subject: [PATCH 207/248] OTR demo --- .../demo/Optimal_transportation_reconstruction_2/render.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp index 46837ca5b03..54065018429 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp @@ -335,14 +335,13 @@ void R_s_k_2::draw_relevance(const float line_width, const int nb) MultiIndex mindex; FT min_value = (std::numeric_limits::max)(); FT max_value = -(std::numeric_limits::max)(); - unsigned int nb_initial = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; FT value = m_dt.get_edge_relevance(edge); // >= 0 - nb_initial++; min_value = (std::min)(min_value, value); max_value = (std::max)(max_value, value); mindex.insert(PEdge(edge, value)); From cd2210dc90da7bce9c532bc4fd4952588c6a6808 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Oct 2022 07:42:49 +0100 Subject: [PATCH 208/248] Addess -Warray-parameter warning in Polyhedron demo code --- Polyhedron/demo/Polyhedron/Viewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Viewer.h b/Polyhedron/demo/Polyhedron/Viewer.h index 40af99fc098..357e8d52ec5 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.h +++ b/Polyhedron/demo/Polyhedron/Viewer.h @@ -84,7 +84,7 @@ public: TextRenderer* textRenderer() Q_DECL_OVERRIDE; - void enableClippingBox(QVector4D box[]) Q_DECL_OVERRIDE; + void enableClippingBox(QVector4D box[6]) Q_DECL_OVERRIDE; void disableClippingBox() Q_DECL_OVERRIDE; void set2DSelectionMode(bool) Q_DECL_OVERRIDE; void setStaticImage(QImage image) Q_DECL_OVERRIDE; From 8674744f1719ced37df9ef566ea709ec603b9a42 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Oct 2022 07:44:44 +0100 Subject: [PATCH 209/248] PSP --- Point_set_processing_3/include/CGAL/scanline_orient_normals.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h index 02f956f2416..62c0ea1f76d 100644 --- a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h @@ -20,6 +20,7 @@ #include #include +#include #include @@ -545,6 +546,8 @@ void scanline_orient_normals (PointRange& points, const NamedParameters& np = pa std::cerr << nb_scanlines << " scanline(s) identified (mean length = " << std::size_t(points.size() / double(nb_scanlines)) << " point(s))" << std::endl; +#else + CGAL_USE(nb_scanlines); #endif } From 601c5d099f0fee417e6bbd082d5de64923000a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 25 Oct 2022 14:07:07 +0200 Subject: [PATCH 210/248] fix warnings --- .../include/CGAL/Mesh_2/Mesh_global_optimizer_2.h | 4 ++-- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 6 +++--- Mesh_2/test/Mesh_2/test_double_map.cpp | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index a16d221a6b8..4c6dacd7802 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -108,7 +108,7 @@ public: } } - Mesh_optimization_return_code operator()(const int nb_iterations) + Mesh_optimization_return_code operator()(const std::size_t nb_iterations) { running_time_.reset(); running_time_.start(); @@ -141,7 +141,7 @@ public: bool convergence_stop = false; // Iterate - int i = -1; + std::size_t i = -1; while ( ++i < nb_iterations && ! is_time_limit_reached() ) { this->before_move(); diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index e145b6524e8..fe7a7c321ac 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -190,7 +190,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va template Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, - const int max_iterations, + const std::size_t max_iterations, const double convergence_ratio, const double freeze_bound, const double time_limit, @@ -206,7 +206,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va template Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, - const int max_iterations, + const std::size_t max_iterations, const double convergence_ratio, const double freeze_bound, const double time_limit, @@ -231,7 +231,7 @@ lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_va #endif // 1000 iteration max to avoid infinite loop - int nb_iterations = (0 == max_iterations) + std::size_t nb_iterations = (0 == max_iterations) ? 1000 : max_iterations; diff --git a/Mesh_2/test/Mesh_2/test_double_map.cpp b/Mesh_2/test/Mesh_2/test_double_map.cpp index 7ef6a121834..f7f82d21647 100644 --- a/Mesh_2/test/Mesh_2/test_double_map.cpp +++ b/Mesh_2/test/Mesh_2/test_double_map.cpp @@ -12,7 +12,7 @@ typedef CGAL::Double_map Map; int main(int argc, char** argv) { - unsigned int number_of_elements = 500; + int number_of_elements = 500; #ifdef CGAL_USE_BOOST_BIMAP std::cerr << "(Using the \"Boost.Bimap implementation\" of ...)\n\n"; @@ -58,14 +58,14 @@ int main(int argc, char** argv) assert(f.empty() && f2.empty()); /* AUTOMATIC CHECKS */ std::cerr << "Filling f with " << number_of_elements << " random integers...\n"; - for(unsigned int n=0; nsecond; @@ -152,7 +152,7 @@ int main(int argc, char** argv) assert(counter==number_of_elements); std::cerr << "Filling f with f(i)=i*i, i=0.." << number_of_elements -1 << "...\n"; - for(unsigned int n=0; n Date: Tue, 25 Oct 2022 16:04:56 +0200 Subject: [PATCH 211/248] fix warnings --- Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index e9f9ec831b1..6faf6ee86ba 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -585,8 +585,8 @@ public: using parameters::get_parameter; using parameters::get_parameter_reference; using parameters::choose_parameter; - auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), FT(0)); - auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), FT(0)); + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); From c4b7c524dd40215903b61ed86db3fb450d0810b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 25 Oct 2022 16:55:17 +0200 Subject: [PATCH 212/248] fix indentation --- Scripts/scripts/cgal_create_cmake_script | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 33d1826bf86..a7a22294904 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -38,15 +38,15 @@ find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) EOF if [ -d "${SOURCE_DIR}" ] ; then - echo " set(CGAL_CURRENT_SOURCE_DIR \"${SOURCE_DIR}\")" + echo "set(CGAL_CURRENT_SOURCE_DIR \"${SOURCE_DIR}\")" echo fi if [ -d "${SOURCE_DIR}../include" ] ; then - echo " include_directories (BEFORE \"${SOURCE_DIR}../include\")" + echo "include_directories (BEFORE \"${SOURCE_DIR}../include\")" echo fi if [ -d "${SOURCE_DIR}include" ] ; then - echo " include_directories (BEFORE \"${SOURCE_DIR}include\")" + echo "include_directories (BEFORE \"${SOURCE_DIR}include\")" echo fi From bb604fc53849dc6867df2ad965cc3e16a94c4154 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Oct 2022 08:27:50 +0100 Subject: [PATCH 213/248] Kernel_d: Address -Wmaybe-uninitialized warning --- Kernel_d/include/CGAL/Kernel_d/Sphere_d.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h b/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h index 212480d843a..2c9a0e64955 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h @@ -47,6 +47,7 @@ class Sphere_d_rep { public: Sphere_d_rep() : cp(0) {} Sphere_d_rep(int d) : P(d), cp(0) {} + Sphere_d_rep(int d, Orientation orient) : P(d), orient(orient), cp(0) {} template Sphere_d_rep(int d, ForwardIterator first, ForwardIterator last) : @@ -109,14 +110,13 @@ typedef typename std::vector< Point_d >::const_iterator point_iterator; /*{\Mcreation 4}*/ -Sphere_d(int d = 0) : Base( Rep(d+1) ) + Sphere_d(int d = 0) : Base( Rep(d+1, ZERO) ) /*{\Mcreate introduces a variable |\Mvar| of type |\Mname|. |\Mvar| is initialized to the empty sphere centered at the origin of $d$-dimensional space. }*/ { Point_d p(d); for (int i = 0; i <= d; i++) ptr()->P[i] = p; - ptr()->orient = ZERO; ptr()->cp = new Point_d(p); } From 38209b28c635d23288eea6ccdce1155fa9a4e953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 27 Oct 2022 18:10:04 +0200 Subject: [PATCH 214/248] fix warning --- .../Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 2d8432e0f08..db293151f23 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -57,7 +57,6 @@ namespace internal { template bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits) { - typedef typename Traits::Point_3 Point; typedef typename Traits::Vector_3 Vector_3; typename Traits::Construct_vector_3 construct_vector = traits.construct_vector_3_object(); From a9162809c429442ab37fe31e7a493c08ced826bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 31 Oct 2022 10:18:39 +0100 Subject: [PATCH 215/248] fields should be taken by const ref --- Mesh_3/include/CGAL/Mesh_criteria_3.h | 10 +++++----- .../CGAL/STL_Extension/internal/parameters_interface.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 4539fcdae8f..c7dcfeb33ab 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -71,19 +71,19 @@ public: template Mesh_criteria_3_impl(const CGAL_NP_CLASS& np) :edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param), - parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::edge_sizing_field_param), parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX))))), facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)), parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param), - parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_sizing_field_param), parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0)))), - parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_distance_param), FT(0)), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_distance_param), FT(0)), parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_topology_param), CGAL::FACET_VERTICES_ON_SURFACE)), cell_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_ratio_param), parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_param), FT(0))), parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_size_param), - parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_sizing_field_param), - parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0))))) + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::cell_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::sizing_field_param), FT(0))))) { } #ifndef CGAL_NO_DEPRECATED_CODE diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index d252c0c227a..c5ad5f82e96 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -313,17 +313,17 @@ CGAL_add_named_parameter_with_compatibility(surface_patch_index_t, surface_patch CGAL_add_named_parameter_with_compatibility_ref_only(weights_param_t, weights_param, weights) CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size) -CGAL_add_named_parameter_with_compatibility(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field) +CGAL_add_named_parameter_with_compatibility_ref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field) CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle) CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size) -CGAL_add_named_parameter_with_compatibility(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field) -CGAL_add_named_parameter_with_compatibility(facet_distance_param_t, facet_distance_param, facet_distance) +CGAL_add_named_parameter_with_compatibility_ref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field) +CGAL_add_named_parameter_with_compatibility_ref_only(facet_distance_param_t, facet_distance_param, facet_distance) CGAL_add_named_parameter_with_compatibility(facet_topology_param_t, facet_topology_param, facet_topology) CGAL_add_named_parameter_with_compatibility(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge) CGAL_add_named_parameter_with_compatibility(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio) CGAL_add_named_parameter_with_compatibility(cell_size_param_t, cell_size_param, cell_size) -CGAL_add_named_parameter_with_compatibility(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field) -CGAL_add_named_parameter_with_compatibility(sizing_field_param_t, sizing_field_param, sizing_field) +CGAL_add_named_parameter_with_compatibility_ref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field) +CGAL_add_named_parameter_with_compatibility_ref_only(sizing_field_param_t, sizing_field_param, sizing_field) CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function) CGAL_add_named_parameter_with_compatibility(bounding_object_param_t, bounding_object_param, bounding_object) From 7a8f91b34c30cef8ca920606377436b1411cc2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 1 Nov 2022 16:09:26 +0100 Subject: [PATCH 216/248] rename traits class to avoid confusion --- .../include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h | 2 +- ...Alpha_wrap_AABB_traits.h => Alpha_wrap_AABB_geom_traits.h} | 4 ++-- .../include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h | 4 ++-- .../include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h | 4 ++-- .../include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h | 4 ++-- .../include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h | 4 ++-- Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h | 2 +- .../include/CGAL/Alpha_wrap_3/internal/splitting_helper.h | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) rename Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/{Alpha_wrap_AABB_traits.h => Alpha_wrap_AABB_geom_traits.h} (98%) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h index e88e00fafe0..24389bef736 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h @@ -29,7 +29,7 @@ #include -#include +#include #include #include #include diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h similarity index 98% rename from Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h rename to Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h index 1a3fa7d8183..3d32097effb 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h @@ -89,14 +89,14 @@ public: }; template -class Alpha_wrap_AABB_traits +class Alpha_wrap_AABB_geom_traits : public GT { public: using Ball_3 = internal::Ball_3; public: - Alpha_wrap_AABB_traits(const GT& gt = GT()) : GT(gt) { } + Alpha_wrap_AABB_geom_traits(const GT& gt = GT()) : GT(gt) { } public: class Construct_ball_3 diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h index b27ffa0525a..7bad2ff313d 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace internal { template struct PS_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Points = std::vector; using PR_iterator = typename Points::const_iterator; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h index a6a87f000ab..d02a9f9faaf 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace internal { template struct SS_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Segments = std::vector; using SR_iterator = typename Segments::const_iterator; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h index f4e74da51e9..6d0f65142f6 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -37,7 +37,7 @@ namespace internal { template struct TM_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Point_3 = typename Geom_traits::Point_3; using AABB_traits = typename AABB_tree_splitter_traits::AABB_traits; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h index 81fed3d58df..57f936306da 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace internal { template struct TS_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Point_3 = typename Geom_traits::Point_3; using AABB_traits = typename AABB_tree_splitter_traits::AABB_traits; using AABB_tree = typename AABB_tree_splitter_traits::AABB_tree; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h index 77a4ca313c0..509a9efe7e2 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h index 1e06b7ff30e..4b146e95d8f 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include From 9c2d9136365e103d3ece675bdf1a5580dba9cb32 Mon Sep 17 00:00:00 2001 From: Mael Date: Tue, 1 Nov 2022 19:48:55 +0100 Subject: [PATCH 217/248] Also update the name of the include guard --- .../Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h index 3d32097effb..22c64e9b5e2 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h @@ -13,8 +13,8 @@ // Andreas Fabri // Michael Hemmer // -#ifndef CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H -#define CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H +#ifndef CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H +#define CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H #include @@ -295,4 +295,4 @@ public: } // namespace Alpha_wraps_3 } // namespace CGAL -#endif // CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H +#endif // CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H From 0c36f00f71c56f92cd5eb3ba2f5c1a8f0a0d8343 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 2 Nov 2022 16:03:30 +0100 Subject: [PATCH 218/248] Update Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h --- .../Mesh_3/search_for_connected_components_in_labeled_image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h index 4a252a7b3cb..33be39851c3 100644 --- a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h @@ -137,7 +137,7 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, { visited[offset] = true; second_pass[offset] = false; -#if CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE > 1 +#ifdef CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE ++nb_voxels; #endif boost::get<0>(bbox_min) = (std::min)(i, boost::get<0>(bbox_min)); From db6b0519737a6e685769f837f09abbd00469ae72 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 20 Oct 2022 12:07:27 +0200 Subject: [PATCH 219/248] on image boundaries, construct point away from the surface this avoids creating point clusters on surfaces --- ...tialize_triangulation_from_labeled_image.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 74bb943f76e..c7476e96c67 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -33,6 +33,7 @@ struct Get_point { const double vx, vy, vz; const double tx, ty, tz; + const std::size_t xdim, ydim, zdim; Get_point(const CGAL::Image_3* image) : vx(image->vx()) , vy(image->vy()) @@ -40,15 +41,27 @@ struct Get_point , tx(image->tx()) , ty(image->ty()) , tz(image->tz()) + , xdim(image->xdim()) + , ydim(image->ydim()) + , zdim(image->zdim()) {} Point operator()(const std::size_t i, const std::size_t j, const std::size_t k) const { - return Point(double(i) * vx + tx, - double(j) * vy + ty, - double(k) * vz + tz); + double x = double(i) * vx + tx; + double y = double(j) * vy + ty; + double z = double(k) * vz + tz; + + if (i == 0) x += 1. / 6. * vx; + else if (i == xdim - 1) x -= 1. / 6. * vx; + if (j == 0) y += 1. / 6. * vy; + else if (j == ydim - 1) y -= 1. / 6. * vy; + if (k == 0) z += 1. / 6. * vz; + else if (k == zdim - 1) z -= 1. / 6. * vz; + + return Point(x, y, z); } }; template From 28a69460706803ababf0059057122e96f759de40 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 21 Oct 2022 15:05:30 +0200 Subject: [PATCH 220/248] do not run random shooting in connected components that already are represented during feature protection, most of the connected components, in particular on the bbox boundary, are already represented and ready to start/hint Delaunay refinement if the chosen seed lies in a cell that already belongs (wrt Is_in_domain(cc)) to the right connected component, random shooting is canceled and the loop continues to next seed --- ...tialize_triangulation_from_labeled_image.h | 38 +++++++++++++++---- ...or_connected_components_in_labeled_image.h | 4 +- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index c7476e96c67..ba3cad5f699 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -127,7 +128,11 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, image.vy()), image.vz()); - typedef std::vector > Seeds; + using Point_indices = std::tuple; + using Seed = std::pair; + using Seeds = std::vector; + using Subdomain_index = typename Mesh_domain::Subdomain_index; + Seeds seeds; Get_point get_point(&image); std::cout << "Searching for connected components..." << std::endl; @@ -135,20 +140,36 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::back_inserter(seeds), CGAL::Emptyset_iterator(), transform, - get_point, Image_word_type()); std::cout << " " << seeds.size() << " components were found." << std::endl; std::cout << "Construct initial points..." << std::endl; - for(typename Seeds::const_iterator it = seeds.begin(), end = seeds.end(); - it != end; ++it) + for(const Seed seed : seeds) { - const double radius = double(it->second + 1)* max_v; + const std::size_t i = get<0>(seed.first); + const std::size_t j = get<1>(seed.first); + const std::size_t k = get<2>(seed.first); + + const Bare_point seed_point = get_point(i, j, k); + Cell_handle seed_cell = tr.locate(cwp(seed_point)); + + const boost::optional seed_label + = domain.is_in_domain_object()(seed_point); + const boost::optional seed_cell_label + = domain.is_in_domain_object()( + seed_cell->weighted_circumcenter(tr.geom_traits())); + + if ( seed_label != boost::none + && seed_cell_label != boost::none + && seed_label.get() == seed_cell_label.get()) + continue; //this means the connected component has already been initialized + + const double radius = double(seed.second + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); typename Mesh_domain::Construct_intersection construct_intersection = domain.construct_intersection_object(); std::vector directions; - if(it->second < 2) { + if(seed.second < 2) { // shoot in six directions directions.push_back(Vector_3(-radius, 0, 0)); directions.push_back(Vector_3(+radius, 0, 0)); @@ -166,9 +187,10 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, for(const Vector_3& v : directions) { - const Bare_point test = it->first + v; + const Bare_point test = seed_point + v; + const typename Mesh_domain::Intersection intersect = - construct_intersection(Segment_3(it->first, test)); + construct_intersection(Segment_3(seed_point, test)); if (std::get<2>(intersect) != 0) { const Bare_point& bpi = std::get<0>(intersect); diff --git a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h index 56c5d7bc6d5..23ca8cb5cc3 100644 --- a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h @@ -34,14 +34,12 @@ template void search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, PointsOutputIterator it, DomainsOutputIterator dom_it, TransformOperator transform, - Construct_point point, Image_word_type) { const std::size_t nx = image.xdim(); @@ -210,7 +208,7 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, { // if(nb_voxels >= 100) { - *it++ = std::make_pair(point(i, j, k), + *it++ = std::make_pair(std::make_tuple(i, j, k), depth+1); #if CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE > 1 std::cerr << boost::format("Found seed %5%, which is voxel " From 8b76b55b82d66b3b65b1048f2af738420a294224 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 21 Oct 2022 15:48:45 +0200 Subject: [PATCH 221/248] remove useless include --- .../CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index ba3cad5f699..e4be4b323f9 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -24,7 +24,6 @@ #include #include #include -#include #include #include From 7faa73bb27df4e0cee95183e942964e8c15af609 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 24 Oct 2022 12:47:04 +0200 Subject: [PATCH 222/248] locate of seed that is outside affine hull returns Cell_handle() accessing the circumcenter was then failing --- .../Mesh_3/initialize_triangulation_from_labeled_image.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index e4be4b323f9..491ade42e05 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -154,8 +154,10 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, const boost::optional seed_label = domain.is_in_domain_object()(seed_point); const boost::optional seed_cell_label - = domain.is_in_domain_object()( - seed_cell->weighted_circumcenter(tr.geom_traits())); + = (seed_cell == Cell_handle()) //seed_point is OUTSIDE_AFFINE_HULL + ? boost::none + : domain.is_in_domain_object()( + seed_cell->weighted_circumcenter(tr.geom_traits())); if ( seed_label != boost::none && seed_cell_label != boost::none From a8877c5a441f309ef842f58b8625bf97fea55f6e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 25 Oct 2022 17:24:57 +0200 Subject: [PATCH 223/248] add struct Seed for better readability and avoid using boost::none to be ready for std::optional (C++17) --- ...tialize_triangulation_from_labeled_image.h | 29 +++++++++---------- ...or_connected_components_in_labeled_image.h | 3 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 491ade42e05..5c7314048f4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -127,10 +127,13 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, image.vy()), image.vz()); - using Point_indices = std::tuple; - using Seed = std::pair; + struct Seed { + std::size_t i, j, k; + std::size_t radius; + }; using Seeds = std::vector; using Subdomain_index = typename Mesh_domain::Subdomain_index; + using Subdomain = typename Mesh_domain::Subdomain; Seeds seeds; Get_point get_point(&image); @@ -144,33 +147,29 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::cout << "Construct initial points..." << std::endl; for(const Seed seed : seeds) { - const std::size_t i = get<0>(seed.first); - const std::size_t j = get<1>(seed.first); - const std::size_t k = get<2>(seed.first); - - const Bare_point seed_point = get_point(i, j, k); + const Bare_point seed_point = get_point(seed.i, seed.j, seed.k); Cell_handle seed_cell = tr.locate(cwp(seed_point)); - const boost::optional seed_label + const Subdomain seed_label = domain.is_in_domain_object()(seed_point); - const boost::optional seed_cell_label + const Subdomain seed_cell_label = (seed_cell == Cell_handle()) //seed_point is OUTSIDE_AFFINE_HULL - ? boost::none + ? Subdomain() : domain.is_in_domain_object()( seed_cell->weighted_circumcenter(tr.geom_traits())); - if ( seed_label != boost::none - && seed_cell_label != boost::none - && seed_label.get() == seed_cell_label.get()) + if ( seed_label.has_value() + && seed_cell_label.has_value() + && *seed_label == *seed_cell_label) continue; //this means the connected component has already been initialized - const double radius = double(seed.second + 1)* max_v; + const double radius = double(seed.radius + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); typename Mesh_domain::Construct_intersection construct_intersection = domain.construct_intersection_object(); std::vector directions; - if(seed.second < 2) { + if(seed.radius < 2) { // shoot in six directions directions.push_back(Vector_3(-radius, 0, 0)); directions.push_back(Vector_3(+radius, 0, 0)); diff --git a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h index 23ca8cb5cc3..26849514840 100644 --- a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h @@ -208,8 +208,7 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, { // if(nb_voxels >= 100) { - *it++ = std::make_pair(std::make_tuple(i, j, k), - depth+1); + *it++ = { i, j, k, std::size_t(depth + 1) }; #if CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE > 1 std::cerr << boost::format("Found seed %5%, which is voxel " "(%1%, %2%, %3%), value=%4%\n") From 168825a7f116f2ea2db43b98e34e31303e25307f Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Wed, 2 Nov 2022 07:49:59 +0100 Subject: [PATCH 224/248] fix warning --- .../CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 5c7314048f4..6ea46d43663 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -132,7 +132,6 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::size_t radius; }; using Seeds = std::vector; - using Subdomain_index = typename Mesh_domain::Subdomain_index; using Subdomain = typename Mesh_domain::Subdomain; Seeds seeds; From 7f70d48ab9d1797a6565a5be67bbafd04320bede Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 3 Nov 2022 12:52:05 +0100 Subject: [PATCH 225/248] seed_cell cannot be infinite --- .../CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 6ea46d43663..1d6d26718d4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -152,8 +152,8 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, const Subdomain seed_label = domain.is_in_domain_object()(seed_point); const Subdomain seed_cell_label - = (seed_cell == Cell_handle()) //seed_point is OUTSIDE_AFFINE_HULL - ? Subdomain() + = (seed_cell == Cell_handle() || tr.is_infinite(seed_cell)) + ? Subdomain() //seed_point is OUTSIDE_AFFINE_HULL : domain.is_in_domain_object()( seed_cell->weighted_circumcenter(tr.geom_traits())); From 3816d8c2af1836a7d2c5d378f6fe06ea82158e7b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 3 Nov 2022 12:53:38 +0100 Subject: [PATCH 226/248] boost::optional has_value() is available only since boost 1.68 and CGAL supports boost >= 1.66 --- .../CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 1d6d26718d4..5a7b52b6685 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -157,8 +157,8 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, : domain.is_in_domain_object()( seed_cell->weighted_circumcenter(tr.geom_traits())); - if ( seed_label.has_value() - && seed_cell_label.has_value() + if ( seed_label != boost::none + && seed_cell_label != boost::none && *seed_label == *seed_cell_label) continue; //this means the connected component has already been initialized From 69eb61b48c6d699ceb7ebb5322e1b7a8c7fa4bf1 Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Thu, 3 Nov 2022 15:36:43 +0100 Subject: [PATCH 227/248] Add Workflow to remove the 'Tested' label --- .github/workflows/Remove_labels.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/Remove_labels.yml diff --git a/.github/workflows/Remove_labels.yml b/.github/workflows/Remove_labels.yml new file mode 100644 index 00000000000..95764506865 --- /dev/null +++ b/.github/workflows/Remove_labels.yml @@ -0,0 +1,32 @@ +name: remove_labels +on: + pull_request_target: + types: [synchronize] +jobs: + remove_label: + runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'Tested') + name: remove label + steps: + - name: removelabel + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: "Tested", + }); + - name: Post address + uses: actions/github-script@v6 + if: ${{ success() && github.event_name == 'pull_request_target' }} + with: + script: | + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: "This pull-request was previously marked with the label `Tested`, but has been modified with new commits. That label has been removed." + }) From 54629efea2a2b970f3080b9cf080cdd306e277d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Nov 2022 15:51:11 +0100 Subject: [PATCH 228/248] make the operator const --- BGL/include/CGAL/boost/graph/properties_OpenMesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/properties_OpenMesh.h b/BGL/include/CGAL/boost/graph/properties_OpenMesh.h index 7f1d44979d1..5b252c00ee1 100644 --- a/BGL/include/CGAL/boost/graph/properties_OpenMesh.h +++ b/BGL/include/CGAL/boost/graph/properties_OpenMesh.h @@ -202,7 +202,7 @@ public: : sm_(pm.sm_) {} - reference operator[](key_type v) + reference operator[](key_type v) const { #if defined(CGAL_USE_OM_POINTS) return sm_->point(v); From 4cfb6840c0e33d0147bd22261b2cc6f9c33839a7 Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Thu, 3 Nov 2022 16:04:07 +0100 Subject: [PATCH 229/248] Update build_doc Workflow to add reaction --- .github/workflows/build_doc.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 208ed4b1d5c..4c816f6cbd3 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -51,12 +51,22 @@ jobs: name: "checkout branch" if: steps.get_round.outputs.result != 'stop' with: - repository: ${{ github.repository }} - ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge - token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }} - fetch-depth: 2 - + repository: ${{ github.repository }} + ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge + token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }} + fetch-depth: 2 + - name: Emoji-comment + uses: actions/github-script@v6 + if: steps.get_round.outputs.result != 'stop' + with: + script: | + github.rest.reactions.createForIssueComment({ + comment_id: ${{ github.event.comment.id }}, + owner: context.repo.owner, + repo: context.repo.repo, + content: 'rocket' + }) - name: install dependencies if: steps.get_round.outputs.result != 'stop' run: | @@ -90,14 +100,14 @@ jobs: #list impacted packages LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) if [ "$LIST_OF_PKGS" = "" ]; then - echo "::set-output name=DoxygenError::No package affected." + echo "DoxygenError=No package affected." >> $GITHUB_OUTPUT exit 1 fi cd build_doc && make -j2 doc make -j2 doc_with_postprocessing 2>tmp.log if [ -s tmp.log ]; then content=`cat ./tmp.log` - echo "::set-output name=DoxygenError::$(cat tmp.log)" + echo "DoxygenError=$(cat tmp.log)" >> $GITHUB_OUTPUT exit 1 fi cd .. @@ -117,7 +127,7 @@ jobs: mv tmp.html index.html git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master else - echo "::set-output name=DoxygenError::This round already exists. Overwrite it with /force-build." + echo "DoxygenError=This round already exists. Overwrite it with /force-build." >> $GITHUB_OUTPUT exit 1 fi From 6aa0992e53da307e9eb8501055252d2e24a9ff5f Mon Sep 17 00:00:00 2001 From: SaillantNicolas <97436229+SaillantNicolas@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:30:21 +0100 Subject: [PATCH 230/248] Remove useless condition --- .github/workflows/Remove_labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Remove_labels.yml b/.github/workflows/Remove_labels.yml index 95764506865..8e9ed55f6bd 100644 --- a/.github/workflows/Remove_labels.yml +++ b/.github/workflows/Remove_labels.yml @@ -21,7 +21,7 @@ jobs: }); - name: Post address uses: actions/github-script@v6 - if: ${{ success() && github.event_name == 'pull_request_target' }} + if: ${{ success() }} with: script: | github.rest.issues.createComment({ From f605c347aea1295a023578cbbfe5d47f531c2151 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 4 Nov 2022 10:01:53 +0100 Subject: [PATCH 231/248] Fixed typo: shrinked -> shrunk --- BGL/include/CGAL/boost/graph/selection.h | 2 +- .../include/CGAL/Polygon_mesh_processing/fair.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index 2604e4cf223..ff42075c623 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -486,7 +486,7 @@ reduce_face_selection( \cgalParamNEnd \cgalParamNBegin{prevent_unselection} - \cgalParamDescription{Boolean used to indicate if selection can be only expanded or if it can also be shrinked.} + \cgalParamDescription{Boolean used to indicate if selection can be only expanded or if it can also be shrunk.} \cgalParamType{`bool`} \cgalParamDefault{`false`} \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index 12a09222bdb..d02ef3a9023 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -76,7 +76,7 @@ namespace internal { do not suffice to solve constructed linear system. Note that if the vertex range to which fairing is applied contains all the vertices of the triangle mesh, - fairing does not fail, but the mesh gets shrinked to `CGAL::ORIGIN`. + fairing does not fail, but the mesh gets shrunk to `CGAL::ORIGIN`. @tparam TriangleMesh a model of `FaceGraph` and `MutableFaceGraph` @tparam VertexRange a range of vertex descriptors of `TriangleMesh`, model of `Range`. From 80c3693de04b8684f2125e514c9883615919bcb2 Mon Sep 17 00:00:00 2001 From: SaillantNicolas <97436229+SaillantNicolas@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:14:56 +0100 Subject: [PATCH 232/248] fix multiline string outputs --- .github/workflows/build_doc.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 4c816f6cbd3..b15b2658b6c 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -107,7 +107,10 @@ jobs: make -j2 doc_with_postprocessing 2>tmp.log if [ -s tmp.log ]; then content=`cat ./tmp.log` - echo "DoxygenError=$(cat tmp.log)" >> $GITHUB_OUTPUT + delimiter="$(openssl rand -hex 8)" + echo "DoxygenError<<${delimiter}" >> "${GITHUB_OUTPUT}" + cat tmp.log >> "${GITHUB_OUTPUT}" + echo "${delimiter}" >> "${GITHUB_OUTPUT}" exit 1 fi cd .. From b8e96fef84316d2be45a6efe1ab3c055de129688 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 7 Nov 2022 09:11:19 +0000 Subject: [PATCH 233/248] Surface_mesh: Deal with PLY files with vertex and face color which is float instead of unsigned char --- .../include/CGAL/Surface_mesh/IO/PLY.h | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 97ba5aed47b..0204a0ac701 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -289,10 +289,22 @@ public: if(m_vcolors == 3) { - unsigned char r, g, b; - element.assign(r, "red"); - element.assign(g, "green"); - element.assign(b, "blue"); + unsigned char r=0, g=0, b=0; + float rf=0, gf=0, bf=0; + if(element.has_property("red",r)) + { + element.assign(r, "red"); + element.assign(g, "green"); + element.assign(b, "blue"); + }else if(element.has_property("red", rf)) + { + element.assign(rf, "red"); + element.assign(gf, "green"); + element.assign(bf, "blue"); + r = std::floor(rf*255); + g = std::floor(gf*255); + b = std::floor(bf*255); + } m_vcolor_map[vi] = CGAL::IO::Color(r, g, b); } } @@ -331,10 +343,22 @@ public: if(m_fcolors == 3) { - unsigned char r, g, b; - element.assign(r, "red"); - element.assign(g, "green"); - element.assign(b, "blue"); + unsigned char r=0, g=0, b=0; + float rf=0, gf=0, bf=0; + if(element.has_property("red",r)) + { + element.assign(r, "red"); + element.assign(g, "green"); + element.assign(b, "blue"); + } else if(element.has_property("red", rf)) + { + element.assign(rf, "red"); + element.assign(gf, "green"); + element.assign(bf, "blue"); + r = std::floor(rf*255); + g = std::floor(gf*255); + b = std::floor(bf*255); + } m_fcolor_map[fi] = CGAL::IO::Color(r, g, b); } } From 3f9f7429b8f70eedc829b189339b2ad51cac43f2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 7 Nov 2022 10:20:13 +0100 Subject: [PATCH 234/248] Update Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h Co-authored-by: Sebastien Loriot --- Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 0204a0ac701..ae1853a0a12 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -350,7 +350,7 @@ public: element.assign(r, "red"); element.assign(g, "green"); element.assign(b, "blue"); - } else if(element.has_property("red", rf)) + } else if(element.has_property("red", rf)) { element.assign(rf, "red"); element.assign(gf, "green"); From b609f5364b64740cb022102a18895360e42e2486 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 7 Nov 2022 12:19:16 +0100 Subject: [PATCH 235/248] remove duplicate include --- Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp index 999a81bc2cf..e35576fc98f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp @@ -60,12 +60,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include From 57c6d59ddcef1fac903149ff3e3f5812191aca34 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 7 Nov 2022 12:20:14 +0100 Subject: [PATCH 236/248] add vtkNrrd reader to Io_image_plugin --- .../Plugins/Mesh_3/Io_image_plugin.cpp | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 72ef02c7c4c..826c4867696 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -65,7 +65,9 @@ #include #include #include +#include #endif + #include // Covariant return types don't work for scalar types and we cannot @@ -978,7 +980,8 @@ private Q_SLOTS: QString Io_image_plugin::nameFilters() const { return QString("Inrimage files (*.inr *.inr.gz) ;; " "Analyze files (*.hdr *.img *img.gz) ;; " - "Stanford Exploration Project files (*.H *.HH)"); + "Stanford Exploration Project files (*.H *.HH) ;; " + "NRRD image files (*.nrrd)"); } @@ -1011,7 +1014,23 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) ok = true; QApplication::restoreOverrideCursor(); Image* image = new Image; - if(fileinfo.suffix() != "H" && fileinfo.suffix() != "HH" && + if (fileinfo.suffix() == "nrrd") + { +#ifdef CGAL_USE_VTK + vtkNew reader; + reader->SetFileName(fileinfo.filePath().toUtf8()); + reader->Update(); + auto vtk_image = reader->GetOutput(); + vtk_image->Print(std::cerr); + *image = CGAL::IO::read_vtk_image_data(vtk_image); // copy the image data +#else + CGAL::Three::Three::warning("You need VTK to read a NRRD file"); + CGAL_USE(dirname); + delete image; + return QList(); +#endif + } + else if(fileinfo.suffix() != "H" && fileinfo.suffix() != "HH" && !image->read(fileinfo.filePath().toUtf8())) { QMessageBox qmb(QMessageBox::NoIcon, From 41f1acc4650b897568a1333700a0e367c9a633e6 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 7 Nov 2022 12:41:53 +0100 Subject: [PATCH 237/248] reorder if/else conditions --- .../Plugins/Mesh_3/Io_image_plugin.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 826c4867696..7a3f29db756 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -1014,6 +1014,8 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) ok = true; QApplication::restoreOverrideCursor(); Image* image = new Image; + + //read a nrrd file if (fileinfo.suffix() == "nrrd") { #ifdef CGAL_USE_VTK @@ -1030,6 +1032,15 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) return QList(); #endif } + + //read a sep file + else if (fileinfo.suffix() == "H" || fileinfo.suffix() == "HH") + { + CGAL::SEP_to_ImageIO reader(fileinfo.filePath().toUtf8().data()); + *image = *reader.cgal_image(); + is_gray = true; + } + else if(fileinfo.suffix() != "H" && fileinfo.suffix() != "HH" && !image->read(fileinfo.filePath().toUtf8())) { @@ -1119,13 +1130,7 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) return QList(); } } - //read a sep file - else if(fileinfo.suffix() == "H" || fileinfo.suffix() == "HH") - { - CGAL::SEP_to_ImageIO reader(fileinfo.filePath().toUtf8().data()); - *image = *reader.cgal_image(); - is_gray = true; - } + // Get display precision QDialog dialog; ui.setupUi(&dialog); From 26472284e4ee0ae551fbcf32bbfa663951242625 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 7 Nov 2022 12:47:35 +0100 Subject: [PATCH 238/248] the demo can now mesh images with any word type thanks to the new domain constructors that do not need to be defined explicitly a priori --- .../Plugins/Mesh_3/Mesh_3_plugin.cpp | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp index 6aa0571c8b9..ac61fa258e9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -374,27 +374,6 @@ boost::optional Mesh_3_plugin::get_items_or_return_error_string() const auto& image_item = image_mesh_items->image_item; item = image_item; features_protection_available = true; - - bool fit_wrdtp = true; - std::size_t img_wdim = image_item->image()->image()->wdim; - WORD_KIND img_wordKind = image_item->image()->image()->wordKind; - // check if the word type fits the hardcoded values in the plugin - if (image_item->isGray()) { - if (img_wordKind != WK_FLOAT) - fit_wrdtp = false; - else if (img_wdim != 4) - fit_wrdtp = false; - } else { - if (img_wordKind != WK_FIXED) - fit_wrdtp = false; - else if (img_wdim != 1) - fit_wrdtp = false; - } - if (!fit_wrdtp) { - return tr( - "Selected object can't be meshed because the image's word type is " - "not supported by this plugin."); - } } # endif From 06417e14de60e816ccebf1aaaecfa32220a93ef7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 8 Nov 2022 12:17:02 +0000 Subject: [PATCH 239/248] Polyhedron Demo: Fix upper right corner --- .../demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui index 5d276e0149d..5592bbbde5a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui @@ -934,7 +934,7 @@ QGroupBox::title { - 0 0 0 1 1 1 + 0 0 0 1 1 0 From f3f3af10bbe104ac5b49bd49700cc29d2ce91979 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 9 Nov 2022 08:18:22 +0000 Subject: [PATCH 240/248] Remove CGAL_USE(dirname) as not defined --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 7a3f29db756..f74562e6e58 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -1027,7 +1027,6 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) *image = CGAL::IO::read_vtk_image_data(vtk_image); // copy the image data #else CGAL::Three::Three::warning("You need VTK to read a NRRD file"); - CGAL_USE(dirname); delete image; return QList(); #endif From fa6a2bddac4ec08f9f1d9f37269938573b1ee225 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 9 Nov 2022 08:32:59 +0000 Subject: [PATCH 241/248] static_cast to avoid warning --- Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index ae1853a0a12..3f03e20badd 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -355,9 +355,9 @@ public: element.assign(rf, "red"); element.assign(gf, "green"); element.assign(bf, "blue"); - r = std::floor(rf*255); - g = std::floor(gf*255); - b = std::floor(bf*255); + r = static_cast(std::floor(rf*255)); + g = static_cast(std::floor(gf*255)); + b = static_cast(std::floor(bf*255)); } m_fcolor_map[fi] = CGAL::IO::Color(r, g, b); } From d1eca8310f955652616b3e1abdaa77f646ae004a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 7 Nov 2022 17:34:54 +0000 Subject: [PATCH 242/248] typo --- Orthtree/include/CGAL/Orthtree/Node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Orthtree/include/CGAL/Orthtree/Node.h b/Orthtree/include/CGAL/Orthtree/Node.h index 5a485adcae8..219959b81cc 100644 --- a/Orthtree/include/CGAL/Orthtree/Node.h +++ b/Orthtree/include/CGAL/Orthtree/Node.h @@ -345,7 +345,7 @@ public: } /*! - \brief returns the nth child fo this node. + \brief returns the nth child of this node. \pre `!is_null()` \pre `!is_leaf()` From 331ea2898a896b3a6b1c3cd4966f88c1b7221d41 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 8 Nov 2022 15:15:20 +0000 Subject: [PATCH 243/248] Orthtree: Fix memory leak --- Orthtree/include/CGAL/Orthtree.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index 5c8cc3ca021..8091001a32f 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -320,8 +320,21 @@ public: void refine(const Split_predicate& split_predicate) { // If the tree has already been refined, reset it - if (!m_root.is_leaf()) + if (!m_root.is_leaf()){ + std::queue nodes; + for (std::size_t i = 0; i < Degree::value; ++ i) + nodes.push (m_root[i]); + while (!nodes.empty()) + { + Node node = nodes.front(); + nodes.pop(); + if (!node.is_leaf()) + for (std::size_t i = 0; i < Degree::value; ++ i) + nodes.push (node[i]); + node.free(); + } m_root.unsplit(); + } // Reset the side length map, too m_side_per_depth.resize(1); From 07c60df0ce0d5f08f7fa0350f3f1d6dd500c9460 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 9 Nov 2022 10:00:54 +0000 Subject: [PATCH 244/248] Polygon_mesh_processing: reparation -> repairing --- .../doc/Polygon_mesh_processing/Polygon_mesh_processing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 08e11df647d..e7345cd3c4c 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -59,7 +59,7 @@ of the graph concepts defined in the package \ref PkgBGLRef. Using common graph enables having common input/output functions for all the models of these concepts. The page \ref PkgBGLIOFct provides an exhaustive description of the available I/O functions. In addition, this package offers the function `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()`, -which can perform some reparation if the input data do not represent a manifold surface. +which can perform some repairing if the input data do not represent a manifold surface. **************************************** \section PMPMeshing Meshing From 8ff15b25a015279856e22083e096d9aeaa3788c1 Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 9 Nov 2022 15:44:10 +0100 Subject: [PATCH 245/248] reparation -> repairing --- .../Polygon_mesh_processing/repair_polygon_soup_example.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp index 13da122a884..e58267d6da7 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp @@ -84,9 +84,9 @@ int main(int, char**) polygons.push_back({0,1,2,3,4,3,2,1}); #endif - std::cout << "Before reparation, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; + std::cout << "Before repairing, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; PMP::repair_polygon_soup(points, polygons, CGAL::parameters::geom_traits(Array_traits())); - std::cout << "After reparation, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; + std::cout << "After repairing, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; Mesh mesh; PMP::orient_polygon_soup(points, polygons); From cd4de51a4035bf066e49abb9a2fa0d5ef96cba24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 Nov 2022 18:17:31 +0100 Subject: [PATCH 246/248] fix inconsistency check --- .../Corefinement/Face_graph_output_builder.h | 17 +++++++++---- .../data-coref/floating_squares.off | 16 +++++++++++++ .../data-coref/hexa.off | 24 +++++++++++++++++++ .../test_corefinement_bool_op.cmd | 1 + 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h index bb52550f111..6709b3705eb 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h @@ -1069,15 +1069,15 @@ public: if (!used_to_clip_a_surface && !used_to_classify_patches && (!is_tm1_closed || !is_tm2_closed)) { //make sure there is no ambiguity in tm1 - if( (patch_status_was_not_already_set[0] && previous_bitvalue[0]!=is_patch_inside_tm2[patch_id_p1] ) || - (patch_status_was_not_already_set[1] && previous_bitvalue[1]!=is_patch_inside_tm2[patch_id_p2] ) ) + if( (!patch_status_was_not_already_set[0] && previous_bitvalue[0]!=is_patch_inside_tm2.test(patch_id_p1) ) || + (!patch_status_was_not_already_set[1] && previous_bitvalue[1]!=is_patch_inside_tm2.test(patch_id_p2) ) ) { impossible_operation.set(); return true; } //make sure there is no ambiguity in tm2 - if( (patch_status_was_not_already_set[2] && previous_bitvalue[2]!=is_patch_inside_tm2[patch_id_q1] ) || - (patch_status_was_not_already_set[3] && previous_bitvalue[3]!=is_patch_inside_tm2[patch_id_q2] ) ) + if( (!patch_status_was_not_already_set[2] && previous_bitvalue[2]!=is_patch_inside_tm1.test(patch_id_q1) ) || + (!patch_status_was_not_already_set[3] && previous_bitvalue[3]!=is_patch_inside_tm1.test(patch_id_q2) ) ) { impossible_operation.set(); return true; @@ -1092,6 +1092,15 @@ public: patch_status_not_set_tm2.reset(patch_id_q1); patch_status_not_set_tm2.reset(patch_id_q2); + // restore initial state, needed when checking in `inconsistent_classification()` + if (!is_tm1_closed || !is_tm2_closed) + { + is_patch_inside_tm2.reset(patch_id_p1); + is_patch_inside_tm2.reset(patch_id_p2); + is_patch_inside_tm1.reset(patch_id_q1); + is_patch_inside_tm1.reset(patch_id_q2); + } + #ifdef CGAL_COREFINEMENT_POLYHEDRA_DEBUG #warning: Factorize the orientation predicates. #endif //CGAL_COREFINEMENT_POLYHEDRA_DEBUG diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off new file mode 100644 index 00000000000..86709d5e8ac --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off @@ -0,0 +1,16 @@ +OFF +8 4 0 + +0 0 1 +1 0 1 +1 1 1 +0 1 1 +0 0 0 +1 0 0 +1 1 0 +0 1 0 +3 0 1 2 +3 2 3 0 +3 6 5 4 +3 4 7 6 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off new file mode 100644 index 00000000000..4bbb30354ec --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off @@ -0,0 +1,24 @@ +OFF +8 12 0 + +0.75 0.75 -1 +0.25 0.75 -1 +0.25 0.25 -1 +0.75 0.25 -1 +0.75 0.25 1 +0.75 0.75 1 +0.25 0.75 1 +0.25 0.25 1 +3 4 5 6 +3 0 3 2 +3 1 2 7 +3 0 1 6 +3 3 0 5 +3 2 3 4 +3 6 7 4 +3 2 1 0 +3 7 6 1 +3 6 5 0 +3 5 4 3 +3 4 7 2 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd index 99d70e20728..c11009e6559 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd @@ -1,2 +1,3 @@ ${CGAL_DATA_DIR}/meshes/elephant.off ${CGAL_DATA_DIR}/meshes/sphere.off ALL 1 1 1 1 ${CGAL_DATA_DIR}/meshes/open_cube.off data-coref/incompatible_with_open_cube.off ALL 0 0 0 0 +data-coref/floating_squares.off data-coref/hexa.off ALL 1 1 1 1 From 178bc9e905bf9221542fb23cfa0c144a183b06e7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 10 Nov 2022 09:24:26 +0000 Subject: [PATCH 247/248] More static cast --- Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 3f03e20badd..8e274941fc1 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -301,9 +301,9 @@ public: element.assign(rf, "red"); element.assign(gf, "green"); element.assign(bf, "blue"); - r = std::floor(rf*255); - g = std::floor(gf*255); - b = std::floor(bf*255); + r = static_cast(std::floor(rf*255)); + g = static_cast(std::floor(gf*255)); + b = static_cast(std::floor(bf*255)); } m_vcolor_map[vi] = CGAL::IO::Color(r, g, b); } From 5f6f1e2e8d6543745ff73daa4b5b1df71eef87fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 14 Nov 2022 20:14:55 +0100 Subject: [PATCH 248/248] remove line that seems useless --- .github/install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/install.sh b/.github/install.sh index e06328da401..32b8552aa8f 100755 --- a/.github/install.sh +++ b/.github/install.sh @@ -1,5 +1,4 @@ #!/bin/bash -sudo add-apt-repository ppa:mikhailnov/pulseeffects -y sudo apt-get update sudo apt-get install -y libmpfr-dev \ libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \