CGAL 4.8.2 - Polygon Mesh Processing
|
How to use BGL Optional Named Parameters
The notion of named parameters was introduced in the BGL. You can read about it in the following site: http://www.boost.org/libs/graph/doc/bgl_named_params.html. Named parameters allow the user to specify only those parameters which are really needed, by name, making the parameter ordering unimportant.
Say there is a function f()
that takes 3 parameters called name, age and gender, and you have variables n
, a
and g
to pass as parameters to that function. Without named parameters, you would call it like this: f(n,a,g)
, whereas with named parameters, you call it like this: f(name(n).age(a).gender(g))
.
That is, you give each parameter a name by wrapping it into a function whose name matches that of the parameter. The entire list of named parameters is really a composition of function calls separated by a dot ( .). Thus, if the function takes a mix of mandatory and named parameters, you use a comma to separate the last non-named parameter from the first named parameters, like this:
f(non_named_par0, non_named_par1, name(n).age(a).gender(g))
When you use named parameters, the ordering is irrelevant, so f(name(n).age(a).gender(g))
is equivalent to f(age(a).gender(g).name(n))
, and you can just omit any named parameter that has a default value.
The sequence of named parameters should start with CGAL::Polygon_mesh_processing::parameters::
.
Example
See below a sample call of a function that uses the optional BGL named parameters.
List of Available Named Parameters
In this package, all functions optional parameters are implemented as BGL optional named parameters.
Since the parameters of the various polygon mesh processing functions defined in this package are redundant, their long descriptions are centralized below.
In the following, we assume that the following types are provided as template parameters of polygon mesh processing functions and classes. Note that, for some of these functions, the type is more specific.
PolygonMesh
implements a FaceGraph
GeomTraits
a geometric traits class in which constructions are performed and predicates evaluated. Everywhere in this package, a CGAL Kernel
fulfills the requirements. Here is the list of the named parameters available in this package:
vertex_point_map | is the property map with the points associated to the vertices of the polygon mesh boost::get(CGAL::vertex_point, pmesh)
|
use_delaunay_triangulation | enables the use of the Delaunay triangulation facet search space for hole filling functions. |
density_control_factor | controls the density of the mesh generated by refinement, and larger values cause denser refinements. The density of vertices in the refined region is this factor times higher than before refinement. |
fairing_continuity | controls the tangential continuity of the output surface for fairing.The possible values are 0, 1 and 2, refering to the C0, C1 and C2 continuity. |
sparse_linear_solver | is the solver used for fairing of polygon meshes. Eigen::SparseLU<
Eigen::COLAMDOrdering<int> > >
|
geom_traits | the geometric traits instance in which the mesh processing operation should be performed. typename CGAL::Kernel_traits<
typename boost::property_traits<
typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::type>::value_type>::Kernel
|
face_index_map | the property map containing the index of each face of the input polygon mesh. typename boost::property_traits<
typename boost::property_map<PolygonMesh, CGAL::face_index_t>::type>::value_type
Default value is boost::get(CGAL::face_index, pmesh)
|
vertex_index_map | the property map containing the index of each vertex of the input polygon mesh. typename boost::property_traits<
typename boost::property_map<PolygonMesh, CGAL::vertex_index_t>::type>::value_type
Default value is boost::get(CGAL::vertex_index, pmesh)
|
number_of_iterations | the number of iterations of the sequence of iterations performed by the isotropic remeshing algorithm. |
edge_is_constrained_map | the property map containing information about edges of the input polygon mesh being constrained or not. |
vertex_is_constrained_map | the property map containing information about vertices of the input polygon mesh being constrained or not. |
protect_constraints | enables the protection of constraints listed by edge_is_constrained_map during isotropic remeshing. If |