New API support and doc for Mesh_criteria_3.h

This commit is contained in:
GYuvanShankar 2022-06-29 12:28:41 +05:30
parent 60f7a5c7cf
commit 7a080f9b92
4 changed files with 105 additions and 55 deletions

View File

@ -13,7 +13,8 @@ INPUT += \
${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 \ ${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 ${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" PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation"
HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \ HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \
${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \ ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \

View File

@ -22,7 +22,7 @@
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Mesh_3.h>
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
#include <CGAL/Named_function_parameters.h>
#include <CGAL/Mesh_3/config.h> #include <CGAL/Mesh_3/config.h>
#include <boost/parameter/preprocessor.hpp> #include <boost/parameter/preprocessor.hpp>
#include <CGAL/boost/parameter.h> #include <CGAL/boost/parameter.h>
@ -33,29 +33,6 @@
#include <boost/type_traits/is_base_of.hpp> #include <boost/type_traits/is_base_of.hpp>
namespace CGAL { namespace CGAL {
namespace parameters {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/boost/parameter.h>
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 { namespace internal {
@ -93,22 +70,22 @@ public:
// This template constructor is not instantiated when named parameters // This template constructor is not instantiated when named parameters
// are not used, so Facet_criteria and Cell_criteria construction from FT // are not used, so Facet_criteria and Cell_criteria construction from FT
// is not a problem // is not a problem
template <class ArgumentPack> template <typename CGAL_NP_TEMPLATE_PARAMETERS>
Mesh_criteria_3_impl(const ArgumentPack& args) Mesh_criteria_3_impl(const CGAL_NP_CLASS& np)
: edge_criteria_(args[parameters::edge_size :edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param),
| args[parameters::edge_sizing_field parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_sizing_field_param),
| args[parameters::sizing_field | FT(DBL_MAX)] ] ]) parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX))))),
, facet_criteria_(args[parameters::facet_angle | FT(0)], facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)),
args[parameters::facet_size parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param),
| args[parameters::facet_sizing_field parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_sizing_field_param),
| args[parameters::sizing_field | FT(0)] ] ], parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0)))),
args[parameters::facet_distance | FT(0)], parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_distance_param), FT(0)),
args[parameters::facet_topology | CGAL::FACET_VERTICES_ON_SURFACE]) parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_topology_param), CGAL::FACET_VERTICES_ON_SURFACE)),
, cell_criteria_(args[parameters::cell_radius_edge_ratio cell_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_ratio_param),
| args[parameters::cell_radius_edge | FT(0)] ], parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_param), FT(0))),
args[parameters::cell_size parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_size_param),
| args[parameters::cell_sizing_field parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_sizing_field_param),
| args[parameters::sizing_field | FT(0)] ] ]) parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0)))))
{ } { }
#ifndef CGAL_NO_DEPRECATED_CODE #ifndef CGAL_NO_DEPRECATED_CODE
@ -185,22 +162,63 @@ public:
: Base(edge_criteria, : Base(edge_criteria,
facet_criteria, facet_criteria,
cell_criteria) {} cell_criteria) {}
/*!
\brief Construction from criteria parameters.
This constructor uses named
parameters (from <I>Boost.Parameter</I>) for convenient criteria
construction.
// For convenient constructor call (see examples) \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
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_,*)
))
\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<typename CGAL_NP_TEMPLATE_PARAMETERS>
Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np)
{
}
#ifndef CGAL_NO_DEPRECATED_CODE
template<typename ... NP_PACK>
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 class Mesh_criteria_3
} // end namespace CGAL } // end namespace CGAL

View File

@ -378,6 +378,21 @@ const Boost_parameter_compatibility_wrapper<internal_np::null_subdomain_index_pa
const Boost_parameter_compatibility_wrapper<internal_np::surface_patch_index_t> construct_surface_patch_index_new; const Boost_parameter_compatibility_wrapper<internal_np::surface_patch_index_t> construct_surface_patch_index_new;
const Boost_parameter_compatibility_wrapper<internal_np::weights_param_t> weights_new; const Boost_parameter_compatibility_wrapper<internal_np::weights_param_t> weights_new;
const Boost_parameter_compatibility_wrapper<internal_np::edge_size_param_t> edge_size;
const Boost_parameter_compatibility_wrapper<internal_np::edge_sizing_field_param_t> edge_sizing_field;
const Boost_parameter_compatibility_wrapper<internal_np::facet_angle_param_t> facet_angle;
const Boost_parameter_compatibility_wrapper<internal_np::facet_size_param_t> facet_size;
const Boost_parameter_compatibility_wrapper<internal_np::facet_sizing_field_param_t> facet_sizing_field;
const Boost_parameter_compatibility_wrapper<internal_np::facet_distance_param_t> facet_distance;
const Boost_parameter_compatibility_wrapper<internal_np::facet_topology_param_t> facet_topology;
const Boost_parameter_compatibility_wrapper<internal_np::cell_radius_edge_param_t> cell_radius_edge;
const Boost_parameter_compatibility_wrapper<internal_np::cell_radius_edge_ratio_param_t> cell_radius_edge_ratio;
const Boost_parameter_compatibility_wrapper<internal_np::cell_size_param_t> cell_size;
const Boost_parameter_compatibility_wrapper<internal_np::cell_sizing_field_param_t> cell_sizing_field;
const Boost_parameter_compatibility_wrapper<internal_np::sizing_field_param_t> sizing_field;
#endif #endif

View File

@ -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(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(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(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)