mirror of https://github.com/CGAL/cgal
Merge pull request #2649 from sgiraudot/BGL-Regroup_named_parameters-GF
Regroup PMP named parameters with BGL named parameters # Conflicts: # Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/parameters_interface.h
This commit is contained in:
commit
61e662c4e4
|
|
@ -132,29 +132,40 @@ in the \sc{Bgl} manual.
|
|||
|
||||
\subsection BGLNamedParameters Named Parameters
|
||||
|
||||
The algorithms of \sc{Bgl} often have many parameters with default
|
||||
values that are appropriate for most cases. In general, when no
|
||||
special treatment is applied, the values of such parameters are passed
|
||||
as a sequence. Deviating from the default for a certain parameter
|
||||
requires the user to explicitly pass values for all preceding
|
||||
parameters. The solution to this problem
|
||||
is to first write a tag and then the parameter, which for
|
||||
Dijkstra's shortest path algorithm might look as follows:
|
||||
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.
|
||||
|
||||
\code {.cpp}
|
||||
std::vector<vertex_descriptor> p(num_vertices(g));
|
||||
std::vector<int> d(num_vertices(g));
|
||||
vertex_descriptor s = vertex(A, g);
|
||||
dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0]));
|
||||
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::parameters::`.
|
||||
|
||||
|
||||
\subsubsection BGLNamedParametersExample Example
|
||||
|
||||
See below a sample call of a function that uses the optional BGL named parameters.
|
||||
|
||||
\code
|
||||
// pmesh : polygon mesh with patches to be refined
|
||||
// faces : the range of faces defining the patches to refine
|
||||
// faces_out : output iterator into which descriptors of new faces are put
|
||||
// vertices_out : output iterator into which descriptors of new vertices are put
|
||||
// vertex_point_map : the property map with the points associated to the vertices of `pmesh`
|
||||
// density_control_factor : factor to control density of the output mesh
|
||||
refine(pmesh
|
||||
, faces
|
||||
, faces_out
|
||||
, vertices_out
|
||||
, CGAL::Polygon_mesh_processing::parameters::vertex_point_map(vpmap)
|
||||
.density_control_factor(d));
|
||||
\endcode
|
||||
|
||||
In the \sc{Bgl} manual this is called
|
||||
<a href="http://www.boost.org/libs/graph/doc/bgl_named_params.html">named parameters</a>.
|
||||
The named parameters in the example use the tags `predecessor_map` and `distance_map`
|
||||
and they are concatenated with the dot operator.<BR>
|
||||
|
||||
|
||||
|
||||
|
||||
\section BGLHeader Header Files, Namespaces, and Naming Conventions
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,14 @@ ALIASES += "bgllink{1}=<a href=\"http://www.boost.org/libs/graph/doc/\1.html\">
|
|||
# macros to be used inside the code
|
||||
ALIASES += "cgalNamedParamsBegin=<dl class=\"params\"><dt>Named Parameters</dt><dd> <table class=\"params\">"
|
||||
ALIASES += "cgalNamedParamsEnd=</table> </dd> </dl>"
|
||||
ALIASES += "cgalParamBegin{1}=<tr><td class=\"paramname\">\1</td><td>"
|
||||
ALIASES += "cgalParamBegin{1}=<tr><td class=\"paramname\">\ref BGL_\1 \"\1\"</td><td>"
|
||||
ALIASES += "cgalParamEnd=</td></tr>"
|
||||
|
||||
#macros for NamedParameters.txt
|
||||
ALIASES += "cgalNPTableBegin=<dl class=\"params\"><dt></dt><dd> <table class=\"params\">"
|
||||
ALIASES += "cgalNPTableEnd=</table> </dd> </dl>"
|
||||
ALIASES += "cgalNPBegin{1}=<tr><td class=\"paramname\">\1 </td><td>"
|
||||
ALIASES += "cgalNPEnd=</td></tr>"
|
||||
|
||||
EXTRACT_ALL=NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
/*!
|
||||
\defgroup bgl_namedparameters BGL Named Parameters
|
||||
\ingroup PkgBGL
|
||||
|
||||
The algorithms of the \sc{Bgl} often have many parameters with default
|
||||
values that are appropriate for most cases. In general, when no
|
||||
special treatment is applied, the values of such parameters are passed
|
||||
as a sequence. Deviating from the default for a certain parameter
|
||||
requires the user to explicitly pass values for all preceding
|
||||
parameters. The solution to this problem
|
||||
is to first write a tag and then the parameter, which for
|
||||
Dijkstra's shortest path algorithm might look as follows:
|
||||
|
||||
\code {.cpp}
|
||||
std::vector<vertex_descriptor> p(num_vertices(g));
|
||||
std::vector<int> d(num_vertices(g));
|
||||
vertex_descriptor s = vertex(A, g);
|
||||
dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0]));
|
||||
\endcode
|
||||
|
||||
In the \sc{Bgl} manual, this is called
|
||||
<a href="http://www.boost.org/libs/graph/doc/bgl_named_params.html">named parameters</a>.
|
||||
The named parameters in the example use the tags `predecessor_map` and `distance_map`
|
||||
and they are concatenated with the dot operator.<BR>
|
||||
|
||||
In the following, we assume that `PolygonMesh` is a model of the concept `FaceGraph`.
|
||||
Note that for some functions, the type might be more specific:
|
||||
|
||||
Here is the list of the named parameters available in this package:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{vertex_point_map} \anchor BGL_vertex_point_map
|
||||
is the property map with the points associated to the vertices of the polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
`GeomTraits::Point_3` as value type. \n
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_point, pmesh) \endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{vertex_index_map} \anchor BGL_vertex_index_map
|
||||
is the property map containing the index of each vertex of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and the value type
|
||||
\code typename boost::property_traits<typename boost::property_map<PolygonMesh, CGAL::vertex_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_index, pmesh)\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{halfedge_index_map} \anchor BGL_halfedge_index_map
|
||||
is the property map containing the index of each halfedge of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%halfedge_descriptor` as key type and the value type:
|
||||
\code typename boost::property_traits<typename boost::property_map<PolygonMesh, CGAL::halfedge_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::halfedge_index, pmesh)\endcode
|
||||
If this internal property map exists, its values should be initialized.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{edge_index_map} \anchor BGL_edge_index_map
|
||||
is the property map containing the index of each edge of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%edge_descriptor` as key type and the value type:
|
||||
\code typename boost::property_traits<typename boost::property_map<PolygonMesh, CGAL::edge_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::edge_index, pmesh)\endcode
|
||||
If this internal property map exists, its values should be initialized.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{face_index_map} \anchor BGL_face_index_map
|
||||
is the property map containing the index of each face of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and the value type:
|
||||
\code typename boost::property_traits<typename boost::property_map<PolygonMesh, CGAL::face_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::face_index, pmesh)\endcode
|
||||
If this internal property map exists, its values should be initialized.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{edge_is_constrained_map} \anchor BGL_edge_is_constrained_map
|
||||
is the property map containing information about edges of the input polygon mesh
|
||||
being marked or not.\n
|
||||
<b>Type:</b> a class model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%edge_descriptor` as key type and
|
||||
`bool` as value type. It should be default constructible.\n
|
||||
<b>Default:</b> a default property map where no edge is constrained
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPTableEnd
|
||||
|
||||
*/
|
||||
|
|
@ -78,6 +78,7 @@ namespace boost{
|
|||
|
||||
namespace CGAL {
|
||||
namespace internal_np{
|
||||
enum all_default_t { all_default }; //cannot use macro because it takes no argument
|
||||
|
||||
// for uniformity we import them in this namespace. Note that
|
||||
// it is an import so that if we use the named parameter function
|
||||
|
|
@ -103,6 +104,12 @@ using boost::visitor;
|
|||
|
||||
cgal_bgl_named_params(T v = T()) : base(v) {}
|
||||
cgal_bgl_named_params(T v, const Base& b) : base(v, b) {}
|
||||
cgal_bgl_named_params<bool, internal_np::all_default_t, self>
|
||||
all_default() const
|
||||
{
|
||||
typedef cgal_bgl_named_params<bool, internal_np::all_default_t, self> Params;
|
||||
return Params(*this);
|
||||
}
|
||||
|
||||
// create the functions for new named parameters and the one imported boost
|
||||
// used to concatenate several parameters
|
||||
|
|
@ -119,7 +126,23 @@ using boost::visitor;
|
|||
#undef CGAL_add_named_parameter
|
||||
};
|
||||
|
||||
namespace parameters {
|
||||
namespace parameters {
|
||||
|
||||
cgal_bgl_named_params<bool, internal_np::all_default_t>
|
||||
inline all_default()
|
||||
{
|
||||
typedef cgal_bgl_named_params<bool, internal_np::all_default_t> Params;
|
||||
return Params();
|
||||
}
|
||||
|
||||
|
||||
template <typename T, typename Tag, typename Base>
|
||||
cgal_bgl_named_params<T,Tag,Base>
|
||||
inline no_parameters(cgal_bgl_named_params<T,Tag,Base>)
|
||||
{
|
||||
typedef cgal_bgl_named_params<T,Tag,Base> Params;
|
||||
return Params();
|
||||
}
|
||||
|
||||
// define free functions for named parameters
|
||||
#define CGAL_add_named_parameter(X, Y, Z) \
|
||||
|
|
@ -136,68 +159,6 @@ using boost::visitor;
|
|||
|
||||
} // namespace parameters
|
||||
|
||||
//helper classes
|
||||
template<typename PolygonMesh, typename PropertyTag>
|
||||
class property_map_selector
|
||||
{
|
||||
public:
|
||||
typedef typename boost::graph_has_property<PolygonMesh, PropertyTag>::type Has_internal_pmap;
|
||||
typedef typename boost::mpl::if_c< Has_internal_pmap::value
|
||||
, typename boost::property_map<PolygonMesh, PropertyTag>::type
|
||||
, typename boost::cgal_no_property::type
|
||||
>::type type;
|
||||
typedef typename boost::mpl::if_c< Has_internal_pmap::value
|
||||
, typename boost::property_map<PolygonMesh, PropertyTag>::const_type
|
||||
, typename boost::cgal_no_property::const_type
|
||||
>::type const_type;
|
||||
|
||||
type get_pmap(const PropertyTag& p, PolygonMesh& pmesh)
|
||||
{
|
||||
return get_impl(p, pmesh, Has_internal_pmap());
|
||||
}
|
||||
|
||||
const_type get_const_pmap(const PropertyTag& p, const PolygonMesh& pmesh)
|
||||
{
|
||||
return get_const_pmap_impl(p, pmesh, Has_internal_pmap());
|
||||
}
|
||||
|
||||
private:
|
||||
type get_impl(const PropertyTag&, PolygonMesh&, CGAL::Tag_false)
|
||||
{
|
||||
return type(); //boost::cgal_no_property::type
|
||||
}
|
||||
type get_impl(const PropertyTag& p, PolygonMesh& pmesh, CGAL::Tag_true)
|
||||
{
|
||||
return get(p, pmesh);
|
||||
}
|
||||
|
||||
const_type get_const_pmap_impl(const PropertyTag&
|
||||
, const PolygonMesh&, CGAL::Tag_false)
|
||||
{
|
||||
return const_type(); //boost::cgal_no_property::type
|
||||
}
|
||||
const_type get_const_pmap_impl(const PropertyTag& p
|
||||
, const PolygonMesh& pmesh, CGAL::Tag_true)
|
||||
{
|
||||
return get(p, pmesh);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename PropertyTag>
|
||||
typename property_map_selector<PolygonMesh, PropertyTag>::type
|
||||
get_property_map(const PropertyTag& p, PolygonMesh& pmesh)
|
||||
{
|
||||
property_map_selector<PolygonMesh, PropertyTag> pms;
|
||||
return pms.get_pmap(p, pmesh);
|
||||
}
|
||||
|
||||
template<typename PolygonMesh, typename PropertyTag>
|
||||
typename property_map_selector<PolygonMesh, PropertyTag>::const_type
|
||||
get_const_property_map(const PropertyTag& p, const PolygonMesh& pmesh)
|
||||
{
|
||||
property_map_selector<PolygonMesh, PropertyTag> pms;
|
||||
return pms.get_const_pmap(p, pmesh);
|
||||
}
|
||||
} //namespace CGAL
|
||||
|
||||
// partial specializations hate inheritance and we need to repeat
|
||||
|
|
|
|||
|
|
@ -0,0 +1,223 @@
|
|||
//=======================================================================
|
||||
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
|
||||
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
|
||||
//
|
||||
// This file is part of the Boost Graph Library
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//=======================================================================
|
||||
// Copyright (c) 2007-2015 GeometryFactory (France). All rights reserved.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
// Author(s) : Andreas Fabri, Fernando Cacciola, Jane Tournois
|
||||
|
||||
#ifndef CGAL_BOOST_GRAPH_NAMED_PARAMETERS_HELPERS_H
|
||||
#define CGAL_BOOST_GRAPH_NAMED_PARAMETERS_HELPERS_H
|
||||
|
||||
#include <CGAL/boost/graph/named_function_params.h>
|
||||
|
||||
#include <CGAL/Kernel_traits.h>
|
||||
#include <CGAL/Origin.h>
|
||||
|
||||
#include <CGAL/property_map.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/version.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
//helper classes
|
||||
template<typename PolygonMesh, typename PropertyTag>
|
||||
class property_map_selector
|
||||
{
|
||||
public:
|
||||
typedef typename boost::graph_has_property<PolygonMesh, PropertyTag>::type Has_internal_pmap;
|
||||
typedef typename boost::mpl::if_c< Has_internal_pmap::value
|
||||
, typename boost::property_map<PolygonMesh, PropertyTag>::type
|
||||
, typename boost::cgal_no_property::type
|
||||
>::type type;
|
||||
typedef typename boost::mpl::if_c< Has_internal_pmap::value
|
||||
, typename boost::property_map<PolygonMesh, PropertyTag>::const_type
|
||||
, typename boost::cgal_no_property::const_type
|
||||
>::type const_type;
|
||||
|
||||
type get_pmap(const PropertyTag& p, PolygonMesh& pmesh)
|
||||
{
|
||||
return get_impl(p, pmesh, Has_internal_pmap());
|
||||
}
|
||||
|
||||
const_type get_const_pmap(const PropertyTag& p, const PolygonMesh& pmesh)
|
||||
{
|
||||
return get_const_pmap_impl(p, pmesh, Has_internal_pmap());
|
||||
}
|
||||
|
||||
private:
|
||||
type get_impl(const PropertyTag&, PolygonMesh&, CGAL::Tag_false)
|
||||
{
|
||||
return type(); //boost::cgal_no_property::type
|
||||
}
|
||||
type get_impl(const PropertyTag& p, PolygonMesh& pmesh, CGAL::Tag_true)
|
||||
{
|
||||
return get(p, pmesh);
|
||||
}
|
||||
|
||||
const_type get_const_pmap_impl(const PropertyTag&
|
||||
, const PolygonMesh&, CGAL::Tag_false)
|
||||
{
|
||||
return const_type(); //boost::cgal_no_property::type
|
||||
}
|
||||
const_type get_const_pmap_impl(const PropertyTag& p
|
||||
, const PolygonMesh& pmesh, CGAL::Tag_true)
|
||||
{
|
||||
return get(p, pmesh);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename PropertyTag>
|
||||
typename property_map_selector<PolygonMesh, PropertyTag>::type
|
||||
get_property_map(const PropertyTag& p, PolygonMesh& pmesh)
|
||||
{
|
||||
property_map_selector<PolygonMesh, PropertyTag> pms;
|
||||
return pms.get_pmap(p, pmesh);
|
||||
}
|
||||
|
||||
template<typename PolygonMesh, typename PropertyTag>
|
||||
typename property_map_selector<PolygonMesh, PropertyTag>::const_type
|
||||
get_const_property_map(const PropertyTag& p, const PolygonMesh& pmesh)
|
||||
{
|
||||
property_map_selector<PolygonMesh, PropertyTag> pms;
|
||||
return pms.get_const_pmap(p, pmesh);
|
||||
}
|
||||
// shortcut for accessing the value type of the property map
|
||||
template <class Graph, class Property>
|
||||
class property_map_value {
|
||||
typedef typename boost::property_map<Graph, Property>::const_type PMap;
|
||||
public:
|
||||
typedef typename boost::property_traits<PMap>::value_type type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetVertexPointMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_point_t>::const_type
|
||||
DefaultVPMap_const;
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_point_t>::type
|
||||
DefaultVPMap;
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def<
|
||||
internal_np::vertex_point_t,
|
||||
NamedParameters,
|
||||
DefaultVPMap
|
||||
> ::type type;
|
||||
typedef typename boost::lookup_named_param_def<
|
||||
internal_np::vertex_point_t,
|
||||
NamedParameters,
|
||||
DefaultVPMap_const
|
||||
> ::type const_type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetK
|
||||
{
|
||||
typedef typename boost::property_traits<
|
||||
typename GetVertexPointMap<PolygonMesh, NamedParameters>::type
|
||||
>::value_type Point;
|
||||
public:
|
||||
typedef typename CGAL::Kernel_traits<Point>::Kernel Kernel;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters = cgal_bgl_named_params<bool, internal_np::all_default_t> >
|
||||
class GetGeomTraits
|
||||
{
|
||||
typedef typename boost::graph_has_property<PolygonMesh, boost::vertex_point_t>::type
|
||||
Has_internal_pmap;
|
||||
struct Fake_GT {};//to be used if there is no internal vertex_point_map in PolygonMesh
|
||||
|
||||
typedef typename boost::mpl::if_c< Has_internal_pmap::value
|
||||
, typename GetK<PolygonMesh, NamedParameters>::Kernel
|
||||
, Fake_GT
|
||||
>::type DefaultKernel;
|
||||
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::geom_traits_t,
|
||||
NamedParameters,
|
||||
DefaultKernel
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetFaceIndexMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::face_index_t>::type DefaultMap;
|
||||
typedef typename property_map_selector<PolygonMesh, boost::face_index_t>::const_type DefaultMap_const;
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::face_index_t,
|
||||
NamedParameters,
|
||||
DefaultMap
|
||||
> ::type type;
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::face_index_t,
|
||||
NamedParameters,
|
||||
DefaultMap_const
|
||||
> ::type const_type;
|
||||
typedef typename boost::is_same<type, DefaultMap>::type Is_internal_map;
|
||||
typedef typename boost::is_same<const_type, DefaultMap_const>::type Is_internal_map_const;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetVertexIndexMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_index_t>::type DefaultMap;
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::vertex_index_t,
|
||||
NamedParameters,
|
||||
DefaultMap
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetFaceNormalMap
|
||||
{
|
||||
struct DummyNormalPmap
|
||||
{
|
||||
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor key_type;
|
||||
typedef typename GetGeomTraits<PolygonMesh, NamedParameters>::type::Vector_3 value_type;
|
||||
typedef value_type reference;
|
||||
typedef boost::readable_property_map_tag category;
|
||||
|
||||
typedef DummyNormalPmap Self;
|
||||
friend reference get(const Self&, const key_type&) { return CGAL::NULL_VECTOR; }
|
||||
};
|
||||
|
||||
public:
|
||||
typedef DummyNormalPmap NoMap;
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::face_normal_t,
|
||||
NamedParameters,
|
||||
DummyNormalPmap//default
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename NamedParameters, typename DefaultSolver>
|
||||
class GetSolver
|
||||
{
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::sparse_linear_solver_t,
|
||||
NamedParameters,
|
||||
DefaultSolver
|
||||
> ::type type;
|
||||
};
|
||||
} //namespace CGAL
|
||||
|
||||
|
||||
#endif // CGAL_BOOST_GRAPH_NAMED_PARAMETERS_HELPERS_H
|
||||
|
|
@ -20,15 +20,51 @@
|
|||
|
||||
// List of named parameters that we use in CGAL
|
||||
CGAL_add_named_parameter(vertex_point_t, vertex_point, vertex_point_map)
|
||||
CGAL_add_named_parameter(face_index_t, face_index, face_index_map)
|
||||
CGAL_add_named_parameter(edge_index_t, edge_index, edge_index_map)
|
||||
CGAL_add_named_parameter(halfedge_index_t, halfedge_index, halfedge_index_map)
|
||||
CGAL_add_named_parameter(edge_index_t, edge_index, edge_index_map)
|
||||
CGAL_add_named_parameter(face_index_t, face_index, face_index_map)
|
||||
|
||||
CGAL_add_named_parameter(edge_is_constrained_t, edge_is_constrained, edge_is_constrained_map)
|
||||
CGAL_add_named_parameter(vertex_incident_patches_t, vertex_incident_patches, vertex_incident_patches_map)
|
||||
CGAL_add_named_parameter(first_index_t, first_index, first_index)
|
||||
CGAL_add_named_parameter(number_of_iterations_t, number_of_iterations, number_of_iterations)
|
||||
|
||||
// List of named parameters that we use in the package 'Mesh_3'
|
||||
CGAL_add_named_parameter(vertex_feature_degree_t, vertex_feature_degree, vertex_feature_degree_map)
|
||||
CGAL_add_named_parameter(set_cache_policy_t, set_cache_policy, set_cache)
|
||||
|
||||
// List of named parameters used in the package 'Polygon Mesh Processing'
|
||||
CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits)
|
||||
CGAL_add_named_parameter(vertex_incident_patches_t, vertex_incident_patches, vertex_incident_patches_map)
|
||||
CGAL_add_named_parameter(density_control_factor_t, density_control_factor, density_control_factor)
|
||||
CGAL_add_named_parameter(use_delaunay_triangulation_t, use_delaunay_triangulation, use_delaunay_triangulation)
|
||||
CGAL_add_named_parameter(fairing_continuity_t, fairing_continuity, fairing_continuity)
|
||||
CGAL_add_named_parameter(sparse_linear_solver_t, sparse_linear_solver, sparse_linear_solver)
|
||||
CGAL_add_named_parameter(number_of_relaxation_steps_t, number_of_relaxation_steps, number_of_relaxation_steps)
|
||||
CGAL_add_named_parameter(protect_constraints_t, protect_constraints, protect_constraints)
|
||||
CGAL_add_named_parameter(relax_constraints_t, relax_constraints, relax_constraints)
|
||||
CGAL_add_named_parameter(vertex_is_constrained_t, vertex_is_constrained, vertex_is_constrained_map)
|
||||
CGAL_add_named_parameter(face_patch_t, face_patch, face_patch_map)
|
||||
CGAL_add_named_parameter(random_uniform_sampling_t, random_uniform_sampling, use_random_uniform_sampling)
|
||||
CGAL_add_named_parameter(grid_sampling_t, grid_sampling, use_grid_sampling)
|
||||
CGAL_add_named_parameter(monte_carlo_sampling_t, monte_carlo_sampling, use_monte_carlo_sampling)
|
||||
CGAL_add_named_parameter(do_sample_edges_t, do_sample_edges, do_sample_edges)
|
||||
CGAL_add_named_parameter(do_sample_vertices_t, do_sample_vertices, do_sample_vertices)
|
||||
CGAL_add_named_parameter(do_sample_faces_t, do_sample_faces, do_sample_faces)
|
||||
CGAL_add_named_parameter(number_of_points_on_faces_t, number_of_points_on_faces, number_of_points_on_faces)
|
||||
CGAL_add_named_parameter(number_of_points_per_face_t, number_of_points_per_face, number_of_points_per_face)
|
||||
CGAL_add_named_parameter(grid_spacing_t, grid_spacing, grid_spacing)
|
||||
CGAL_add_named_parameter(number_of_points_per_edge_t, number_of_points_per_edge, number_of_points_per_edge)
|
||||
CGAL_add_named_parameter(number_of_points_on_edges_t, number_of_points_on_edges, number_of_points_on_edges)
|
||||
CGAL_add_named_parameter(nb_points_per_area_unit_t, nb_points_per_area_unit, number_of_points_per_area_unit)
|
||||
CGAL_add_named_parameter(nb_points_per_distance_unit_t, nb_points_per_distance_unit, number_of_points_per_distance_unit)
|
||||
|
||||
// List of named parameters that we use in the package 'Surface Mesh Simplification'
|
||||
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)
|
||||
CGAL_add_named_parameter(get_cost_policy_params_t, get_cost_policy_params, get_cost_params)
|
||||
CGAL_add_named_parameter(get_placement_policy_t, get_placement_policy, get_placement)
|
||||
CGAL_add_named_parameter(get_placement_policy_params_t, get_placement_policy_params, get_placement_params)
|
||||
|
||||
//to be documented
|
||||
CGAL_add_named_parameter(face_normal_t, face_normal, face_normal_map)
|
||||
CGAL_add_named_parameter(random_seed_t, random_seed, random_seed)
|
||||
CGAL_add_named_parameter(do_project_t, do_project, do_project)
|
||||
|
||||
//internal
|
||||
CGAL_add_named_parameter(weight_calculator_t, weight_calculator, weight_calculator)
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
template <int i>
|
||||
struct A{
|
||||
struct A
|
||||
{
|
||||
A(int v):v(v){}
|
||||
int v;
|
||||
};
|
||||
|
|
@ -21,50 +22,167 @@ void check_same_type(T)
|
|||
template<class NamedParameters>
|
||||
void test(const NamedParameters& np)
|
||||
{
|
||||
// test values
|
||||
assert( get_param(np,CGAL::internal_np::vertex_index).v == 0 );
|
||||
assert( get_param(np,CGAL::internal_np::halfedge_index).v == 1 );
|
||||
assert( get_param(np,CGAL::internal_np::face_index).v == 2 );
|
||||
assert( get_param(np,CGAL::internal_np::vertex_point).v == 3 );
|
||||
assert( get_param(np,CGAL::internal_np::edge_index).v == 5 );
|
||||
assert( get_param(np,boost::graph_visitor).v == 6 );
|
||||
assert( get_param(np,CGAL::internal_np::set_cache_policy).v == 7 );
|
||||
assert( get_param(np,CGAL::internal_np::get_cost_policy).v == 8 );
|
||||
assert( get_param(np,CGAL::internal_np::get_cost_policy_params).v == 9 );
|
||||
assert( get_param(np,CGAL::internal_np::get_placement_policy).v == 10 );
|
||||
assert( get_param(np,CGAL::internal_np::get_placement_policy_params).v == 11 );
|
||||
assert( get_param(np,CGAL::internal_np::edge_is_constrained).v == 12 );
|
||||
using boost::get_param;
|
||||
|
||||
// Test values
|
||||
|
||||
// Named parameters from Boost
|
||||
assert(get_param(np, boost::vertex_index).v == 0);
|
||||
assert(get_param(np, boost::graph_visitor).v == 1);
|
||||
|
||||
// Named parameters that we use in CGAL
|
||||
assert(get_param(np, CGAL::internal_np::vertex_point).v == 2);
|
||||
assert(get_param(np, CGAL::internal_np::halfedge_index).v == 3);
|
||||
assert(get_param(np, CGAL::internal_np::edge_index).v == 4);
|
||||
assert(get_param(np, CGAL::internal_np::face_index).v == 5);
|
||||
|
||||
assert(get_param(np, CGAL::internal_np::edge_is_constrained).v == 6);
|
||||
assert(get_param(np, CGAL::internal_np::first_index).v == 7);
|
||||
assert(get_param(np, CGAL::internal_np::number_of_iterations).v == 8);
|
||||
|
||||
// Named parameters that we use in the package 'Mesh_3'
|
||||
assert(get_param(np, CGAL::internal_np::vertex_feature_degree).v == 9);
|
||||
|
||||
// Named parameters used in the package 'Polygon Mesh Processing'
|
||||
assert(get_param(np, CGAL::internal_np::geom_traits).v == 10);
|
||||
assert(get_param(np, CGAL::internal_np::vertex_incident_patches).v == 11);
|
||||
assert(get_param(np, CGAL::internal_np::density_control_factor).v == 12);
|
||||
assert(get_param(np, CGAL::internal_np::use_delaunay_triangulation).v == 13);
|
||||
assert(get_param(np, CGAL::internal_np::fairing_continuity).v == 14);
|
||||
assert(get_param(np, CGAL::internal_np::sparse_linear_solver).v == 15);
|
||||
assert(get_param(np, CGAL::internal_np::number_of_relaxation_steps).v == 16);
|
||||
assert(get_param(np, CGAL::internal_np::protect_constraints).v == 17);
|
||||
assert(get_param(np, CGAL::internal_np::relax_constraints).v == 18);
|
||||
assert(get_param(np, CGAL::internal_np::vertex_is_constrained).v == 19);
|
||||
assert(get_param(np, CGAL::internal_np::face_patch).v == 20);
|
||||
assert(get_param(np, CGAL::internal_np::random_uniform_sampling).v == 21);
|
||||
assert(get_param(np, CGAL::internal_np::grid_sampling).v == 22);
|
||||
assert(get_param(np, CGAL::internal_np::monte_carlo_sampling).v == 23);
|
||||
assert(get_param(np, CGAL::internal_np::do_sample_edges).v == 24);
|
||||
assert(get_param(np, CGAL::internal_np::do_sample_vertices).v == 25);
|
||||
assert(get_param(np, CGAL::internal_np::do_sample_faces).v == 26);
|
||||
assert(get_param(np, CGAL::internal_np::number_of_points_on_faces).v == 27);
|
||||
assert(get_param(np, CGAL::internal_np::number_of_points_per_face).v == 28);
|
||||
assert(get_param(np, CGAL::internal_np::grid_spacing).v == 29);
|
||||
assert(get_param(np, CGAL::internal_np::number_of_points_per_edge).v == 30);
|
||||
assert(get_param(np, CGAL::internal_np::number_of_points_on_edges).v == 31);
|
||||
assert(get_param(np, CGAL::internal_np::nb_points_per_area_unit).v == 32);
|
||||
assert(get_param(np, CGAL::internal_np::nb_points_per_distance_unit).v == 33);
|
||||
|
||||
// Named parameters that we use in the package 'Surface Mesh Simplification'
|
||||
assert(get_param(np, CGAL::internal_np::get_cost_policy).v == 34);
|
||||
assert(get_param(np, CGAL::internal_np::get_placement_policy).v == 35);
|
||||
|
||||
// To-be-documented named parameters
|
||||
assert(get_param(np, CGAL::internal_np::face_normal).v == 36);
|
||||
assert(get_param(np, CGAL::internal_np::random_seed).v == 37);
|
||||
assert(get_param(np, CGAL::internal_np::do_project).v == 38);
|
||||
|
||||
// Internal named parameters
|
||||
assert(get_param(np, CGAL::internal_np::weight_calculator).v == 39);
|
||||
|
||||
|
||||
//test types
|
||||
check_same_type<0>( get_param(np,boost::vertex_index) );
|
||||
check_same_type<1>( get_param(np,CGAL::internal_np::halfedge_index) );
|
||||
check_same_type<2>( get_param(np,CGAL::internal_np::face_index) );
|
||||
check_same_type<3>( get_param(np,CGAL::internal_np::vertex_point) );
|
||||
check_same_type<5>( get_param(np,CGAL::internal_np::edge_index) );
|
||||
check_same_type<6>( get_param(np,boost::graph_visitor) );
|
||||
check_same_type<7>( get_param(np,CGAL::internal_np::set_cache_policy) );
|
||||
check_same_type<8>( get_param(np,CGAL::internal_np::get_cost_policy) );
|
||||
check_same_type<9>( get_param(np,CGAL::internal_np::get_cost_policy_params) );
|
||||
check_same_type<10>( get_param(np,CGAL::internal_np::get_placement_policy) );
|
||||
check_same_type<11>( get_param(np,CGAL::internal_np::get_placement_policy_params) );
|
||||
check_same_type<12>( get_param(np,CGAL::internal_np::edge_is_constrained) );
|
||||
// Test types
|
||||
|
||||
// Named parameters from Boost
|
||||
check_same_type<0>(get_param(np, boost::vertex_index));
|
||||
check_same_type<1>(get_param(np, boost::graph_visitor));
|
||||
|
||||
// Named parameters that we use in CGAL
|
||||
check_same_type<2>(get_param(np, CGAL::internal_np::vertex_point));
|
||||
check_same_type<3>(get_param(np, CGAL::internal_np::halfedge_index));
|
||||
check_same_type<4>(get_param(np, CGAL::internal_np::edge_index));
|
||||
check_same_type<5>(get_param(np, CGAL::internal_np::face_index));
|
||||
|
||||
check_same_type<6>(get_param(np, CGAL::internal_np::edge_is_constrained));
|
||||
check_same_type<7>(get_param(np, CGAL::internal_np::first_index));
|
||||
check_same_type<8>(get_param(np, CGAL::internal_np::number_of_iterations));
|
||||
|
||||
// Named parameters that we use in the package 'Mesh_3'
|
||||
check_same_type<9>(get_param(np, CGAL::internal_np::vertex_feature_degree));
|
||||
|
||||
// Named parameters used in the package 'Polygon Mesh Processing'
|
||||
check_same_type<10>(get_param(np, CGAL::internal_np::geom_traits));
|
||||
check_same_type<11>(get_param(np, CGAL::internal_np::vertex_incident_patches));
|
||||
check_same_type<12>(get_param(np, CGAL::internal_np::density_control_factor));
|
||||
check_same_type<13>(get_param(np, CGAL::internal_np::use_delaunay_triangulation));
|
||||
check_same_type<14>(get_param(np, CGAL::internal_np::fairing_continuity));
|
||||
check_same_type<15>(get_param(np, CGAL::internal_np::sparse_linear_solver));
|
||||
check_same_type<16>(get_param(np, CGAL::internal_np::number_of_relaxation_steps));
|
||||
check_same_type<17>(get_param(np, CGAL::internal_np::protect_constraints));
|
||||
check_same_type<18>(get_param(np, CGAL::internal_np::relax_constraints));
|
||||
check_same_type<19>(get_param(np, CGAL::internal_np::vertex_is_constrained));
|
||||
check_same_type<20>(get_param(np, CGAL::internal_np::face_patch));
|
||||
check_same_type<21>(get_param(np, CGAL::internal_np::random_uniform_sampling));
|
||||
check_same_type<22>(get_param(np, CGAL::internal_np::grid_sampling));
|
||||
check_same_type<23>(get_param(np, CGAL::internal_np::monte_carlo_sampling));
|
||||
check_same_type<24>(get_param(np, CGAL::internal_np::do_sample_edges));
|
||||
check_same_type<25>(get_param(np, CGAL::internal_np::do_sample_vertices));
|
||||
check_same_type<26>(get_param(np, CGAL::internal_np::do_sample_faces));
|
||||
check_same_type<27>(get_param(np, CGAL::internal_np::number_of_points_on_faces));
|
||||
check_same_type<28>(get_param(np, CGAL::internal_np::number_of_points_per_face));
|
||||
check_same_type<29>(get_param(np, CGAL::internal_np::grid_spacing));
|
||||
check_same_type<30>(get_param(np, CGAL::internal_np::number_of_points_per_edge));
|
||||
check_same_type<31>(get_param(np, CGAL::internal_np::number_of_points_on_edges));
|
||||
check_same_type<32>(get_param(np, CGAL::internal_np::nb_points_per_area_unit));
|
||||
check_same_type<33>(get_param(np, CGAL::internal_np::nb_points_per_distance_unit));
|
||||
|
||||
// Named parameters that we use in the package 'Surface Mesh Simplification'
|
||||
check_same_type<34>(get_param(np, CGAL::internal_np::get_cost_policy));
|
||||
check_same_type<35>(get_param(np, CGAL::internal_np::get_placement_policy));
|
||||
|
||||
// To-be-documented named parameters
|
||||
check_same_type<36>(get_param(np, CGAL::internal_np::face_normal));
|
||||
check_same_type<37>(get_param(np, CGAL::internal_np::random_seed));
|
||||
check_same_type<38>(get_param(np, CGAL::internal_np::do_project));
|
||||
|
||||
// Internal named parameters
|
||||
check_same_type<39>(get_param(np, CGAL::internal_np::weight_calculator));
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test(
|
||||
CGAL::parameters::vertex_index_map(A<0>(0)).
|
||||
halfedge_index_map(A<1>(1)).
|
||||
face_index_map(A<2>(2)).
|
||||
vertex_point_map(A<3>(3)).
|
||||
edge_index_map(A<5>(5)).
|
||||
visitor(A<6>(6)).
|
||||
set_cache(A<7>(7)).
|
||||
get_cost(A<8>(8)).
|
||||
get_cost_params(A<9>(9)).
|
||||
get_placement(A<10>(10)).
|
||||
get_placement_params(A<11>(11)).
|
||||
edge_is_constrained_map(A<12>(12))
|
||||
);
|
||||
test(CGAL::parameters::vertex_index_map(A<0>(0))
|
||||
.visitor(A<1>(1))
|
||||
.vertex_point_map(A<2>(2))
|
||||
.halfedge_index_map(A<3>(3))
|
||||
.edge_index_map(A<4>(4))
|
||||
.face_index_map(A<5>(5))
|
||||
.edge_is_constrained_map(A<6>(6))
|
||||
.first_index(A<7>(7))
|
||||
.number_of_iterations(A<8>(8))
|
||||
.vertex_feature_degree_map(A<9>(9))
|
||||
.geom_traits(A<10>(10))
|
||||
.vertex_incident_patches_map(A<11>(11))
|
||||
.density_control_factor(A<12>(12))
|
||||
.use_delaunay_triangulation(A<13>(13))
|
||||
.fairing_continuity(A<14>(14))
|
||||
.sparse_linear_solver(A<15>(15))
|
||||
.number_of_relaxation_steps(A<16>(16))
|
||||
.protect_constraints(A<17>(17))
|
||||
.relax_constraints(A<18>(18))
|
||||
.vertex_is_constrained_map(A<19>(19))
|
||||
.face_patch_map(A<20>(20))
|
||||
.use_random_uniform_sampling(A<21>(21))
|
||||
.use_grid_sampling(A<22>(22))
|
||||
.use_monte_carlo_sampling(A<23>(23))
|
||||
.do_sample_edges(A<24>(24))
|
||||
.do_sample_vertices(A<25>(25))
|
||||
.do_sample_faces(A<26>(26))
|
||||
.number_of_points_on_faces(A<27>(27))
|
||||
.number_of_points_per_face(A<28>(28))
|
||||
.grid_spacing(A<29>(29))
|
||||
.number_of_points_per_edge(A<30>(30))
|
||||
.number_of_points_on_edges(A<31>(31))
|
||||
.number_of_points_per_area_unit(A<32>(32))
|
||||
.number_of_points_per_distance_unit(A<33>(33))
|
||||
.get_cost(A<34>(34))
|
||||
.get_placement(A<35>(35))
|
||||
.face_normal_map(A<36>(36))
|
||||
.random_seed(A<37>(37))
|
||||
.do_project(A<38>(38))
|
||||
.weight_calculator(A<39>(39))
|
||||
);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,372 +1,300 @@
|
|||
/*!
|
||||
\defgroup namedparameters Named Parameters
|
||||
\defgroup pmp_namedparameters Named Parameters for Polygon Mesh Processing
|
||||
\ingroup PkgPolygonMeshProcessing
|
||||
|
||||
\cgalHeading{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::`.
|
||||
`#CGAL::Polygon_mesh_processing::parameters::all_default()` can be used to indicate
|
||||
In this package, all functions optional parameters are implemented as BGL optional
|
||||
named parameters (see \ref BGLNamedParameters for more information on how to use them).
|
||||
Since the parameters of the various polygon mesh processing functions defined
|
||||
in this package are redundant, their long descriptions are centralized below.
|
||||
The sequence of named parameters should start with `CGAL::parameters::`.
|
||||
`CGAL::parameters::all_default()` can be used to indicate
|
||||
that default values of optional named parameters must be used.
|
||||
|
||||
|
||||
\cgalHeading{Example}
|
||||
|
||||
See below a sample call of a function that uses the optional BGL named parameters.
|
||||
|
||||
\code
|
||||
// pmesh : polygon mesh with patches to be refined
|
||||
// faces : the range of faces defining the patches to refine
|
||||
// faces_out : output iterator into which descriptors of new faces are put
|
||||
// vertices_out : output iterator into which descriptors of new vertices are put
|
||||
// vertex_point_map : the property map with the points associated to the vertices of `pmesh`
|
||||
// density_control_factor : factor to control density of the output mesh
|
||||
refine(pmesh
|
||||
, faces
|
||||
, faces_out
|
||||
, vertices_out
|
||||
, CGAL::Polygon_mesh_processing::parameters::vertex_point_map(vpmap)
|
||||
.density_control_factor(d));
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
\cgalHeading{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.
|
||||
|
||||
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:
|
||||
<ul>
|
||||
<li>`PolygonMesh` implements a `FaceGraph`
|
||||
<li>`GeomTraits` a geometric traits class in which constructions are performed and predicates evaluated. Everywhere in this package, a \cgal `Kernel` fulfills the requirements.
|
||||
<li>`PolygonMesh` is a model of the concept `FaceGraph`</li>.
|
||||
<li>`GeomTraits` a geometric traits class in which constructions are performed and
|
||||
predicates evaluated. Everywhere in this package, a \cgal `Kernel` fulfills the requirements.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
Here is the list of the named parameters available in this package:
|
||||
|
||||
\todo reorder this list, maybe
|
||||
The following named parameters, offered by the package \ref PkgBGLSummary
|
||||
(see \ref bgl_namedparameters), are used in this package:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{vertex_point_map} \anchor PMP_vertex_point_map
|
||||
is the property map with the points associated to the vertices of the polygon mesh `pmesh`.\n
|
||||
\b Type: a class model of `ReadablePropertyMap` with
|
||||
is the property map with the points associated to the vertices of the polygon mesh `pmesh`.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
`GeomTraits::Point_3` as value type. \n
|
||||
\b Default value is \code boost::get(CGAL::vertex_point, pmesh)\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{use_delaunay_triangulation} \anchor PMP_use_delaunay_triangulation
|
||||
enables the use of the Delaunay triangulation facet search space for hole filling functions.\n
|
||||
\b Type: `bool` \n
|
||||
\b Default value is `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{density_control_factor} \anchor PMP_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.\n
|
||||
\b Type: floating scalar value\n
|
||||
\b Default value is `CGAL::sqrt(2)`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{fairing_continuity} \anchor PMP_fairing_continuity
|
||||
controls the tangential continuity of the output surface for fairing.The possible values are 0, 1 and 2, refering to the C<sup>0</sup>, C<sup>1</sup> and C<sup>2</sup> continuity.\n
|
||||
\b Type: \c unsigned \c int between 0 and 2\n
|
||||
\b Default value is `1`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{sparse_linear_solver} \anchor PMP_sparse_linear_solver
|
||||
is the solver used for fairing of polygon meshes.\n
|
||||
\b Type: a class model of `SparseLinearAlgebraWithFactorTraits_d`.\n
|
||||
\b Default: if \ref thirdpartyEigen "Eigen" 3.2 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined, then the following overload of `Eigen_solver_traits` is provided as default value\n
|
||||
\code
|
||||
CGAL::Eigen_solver_traits<
|
||||
Eigen::SparseLU<
|
||||
CGAL::Eigen_sparse_matrix<double>::EigenType,
|
||||
Eigen::COLAMDOrdering<int> > >
|
||||
\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{geom_traits} \anchor PMP_geom_traits
|
||||
the geometric traits instance in which the mesh processing operation should be performed.\n
|
||||
\b Type: a Geometric traits class.\n
|
||||
\b Default type is
|
||||
\code
|
||||
typename CGAL::Kernel_traits<
|
||||
typename boost::property_traits<
|
||||
typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::type>::value_type>::Kernel
|
||||
\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{face_index_map} \anchor PMP_face_index_map
|
||||
the property map containing the index of each face of the input polygon mesh.\n
|
||||
\b Type: a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and
|
||||
the value type
|
||||
\code typename boost::property_traits<
|
||||
typename boost::property_map<PolygonMesh, CGAL::face_index_t>::type>::value_type
|
||||
\endcode
|
||||
\b Default value is \code boost::get(CGAL::face_index, pmesh)\endcode
|
||||
If this internal property map exists, its values should be initialized
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_point, pmesh) \endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{vertex_index_map} \anchor PMP_vertex_index_map
|
||||
the property map containing the index of each vertex of the input polygon mesh.\n
|
||||
\b Type: a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
the value type
|
||||
\code typename boost::property_traits<
|
||||
typename boost::property_map<PolygonMesh, CGAL::vertex_index_t>::type>::value_type
|
||||
\endcode
|
||||
\b Default value is \code boost::get(CGAL::vertex_index, pmesh)\endcode
|
||||
is the property map containing the index of each vertex of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and the value type
|
||||
\code typename boost::property_traits<typename boost::property_map<PolygonMesh, CGAL::vertex_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_index, pmesh)\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{ number_of_iterations } \anchor PMP_number_of_iterations
|
||||
the number of iterations of the sequence of iterations performed by the isotropic remeshing
|
||||
algorithm.\n
|
||||
\b Type : \c unsigned \c int \n
|
||||
\b Default value is `1`
|
||||
\cgalNPBegin{face_index_map} \anchor PMP_face_index_map
|
||||
is the property map containing the index of each face of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and the value type:
|
||||
\code typename boost::property_traits<typename boost::property_map<PolygonMesh, CGAL::face_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::face_index, pmesh)\endcode
|
||||
If this internal property map exists, its values should be initialized.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{ edge_is_constrained_map } \anchor PMP_edge_is_constrained_map
|
||||
the property map containing information about edges of the input polygon mesh being marked or not.\n
|
||||
In `CGAL::Polygon_mesh_processing::isotropic_remeshing()` and `CGAL::Polygon_mesh_processing::connected_components()`,
|
||||
\cgalNPBegin{edge_is_constrained_map} \anchor PMP_edge_is_constrained_map
|
||||
is the property map containing information about edges of the input polygon mesh
|
||||
being marked or not. In `isotropic_remeshing()` and `connected_components()`,
|
||||
the marked edges are constrained.\n
|
||||
\b Type : a class model of `ReadWritePropertyMap` with
|
||||
<b>Type:</b> a class model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%edge_descriptor` as key type and
|
||||
`bool` as value type. It should be default constructible.\n
|
||||
\b Default : if this parameter is omitted,
|
||||
a default property map where no edge is constrained is provided.
|
||||
<b>Default:</b> a default property map where no edge is constrained
|
||||
\cgalNPEnd
|
||||
\cgalNPTableEnd
|
||||
|
||||
In addition to these named parameters, this package offers the following named parameters:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{geom_traits} \anchor PMP_geom_traits
|
||||
is the geometric traits instance in which the mesh processing operation should be performed.\n
|
||||
<b>Type:</b> a Geometric traits class.\n
|
||||
<b>Default</b>:
|
||||
\code typename CGAL::Kernel_traits<
|
||||
typename boost::property_traits<
|
||||
typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::type>::value_type>::Kernel \endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{ vertex_incident_patches_map } \anchor PMP_vertex_incident_patches_map
|
||||
the property map containing the surface patches incident to each vertex of the input polygon mesh.\n
|
||||
\b Type : a class model of `LvaluePropertyMap` with
|
||||
\cgalNPBegin{vertex_incident_patches_map} \anchor PMP_vertex_incident_patches_map
|
||||
is the property map containing the surface patches incident to each vertex of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `LvaluePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type. Its value type
|
||||
must be a container of `boost::property_traits<PatchIdMap>::%value_type` and have a function `insert()`.
|
||||
A `std::set` or a `boost::unordered_set` are recommended, as a patch index may be
|
||||
inserted several times.\n
|
||||
\b Default value is \code boost::get(CGAL::vertex_incident_patches_t, pmesh)\endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_incident_patches_t, pmesh)\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{ first_index } \anchor PMP_first_index
|
||||
The index of the first surface patch.\n
|
||||
\b Type : `std::size_t`\n
|
||||
\b Default : 1
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{ vertex_feature_degree_map } \anchor PMP_vertex_feature_degree_map
|
||||
the property map containing the number of feature edges being incident to the vertices of the polygon mesh `pmesh`.\n
|
||||
\b Type : a class model of `ReadWritePropertyMap` with
|
||||
\cgalNPBegin{vertex_feature_degree_map} \anchor PMP_vertex_feature_degree_map
|
||||
is the property map containing the number of feature edges being incident to the vertices of the polygon mesh `pmesh`.\n
|
||||
<b>Type:</b> a class model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
`int` as value type. It should be default constructible.\n
|
||||
\b Default value is \code boost::get(CGAL::vertex_feature_degree_t(), pmesh)\endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_feature_degree_t(), pmesh) \endcode
|
||||
\cgalNPEnd
|
||||
|
||||
|
||||
|
||||
\cgalNPBegin{ vertex_is_constrained_map } \anchor PMP_vertex_is_constrained_map
|
||||
the property map containing information about vertices of the input polygon mesh being constrained or not.
|
||||
\cgalNPBegin{vertex_is_constrained_map} \anchor PMP_vertex_is_constrained_map
|
||||
is the property map containing information about vertices of the input polygon mesh being constrained or not.
|
||||
Constrained vertices may be replaced by new vertices, but the number and location
|
||||
of vertices remain unchanged.\n
|
||||
\b Type : a class model of `ReadWritePropertyMap` with
|
||||
<b>Type:</b> a class model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
`bool` as value type. It should be default constructible.\n
|
||||
\b Default : if this parameter is omitted,
|
||||
a default property map where no vertex is constrained is provided.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{protect_constraints} \anchor PMP_protect_constraints
|
||||
enables the protection of constraints listed by \ref PMP_edge_is_constrained_map
|
||||
"edge_is_constrained_map" and boundary edges
|
||||
during isotropic remeshing. If `true`, constraint edges cannot be modified at all
|
||||
during the remeshing process.\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `false`
|
||||
<b>Default:</b> a default property map where no vertex is constrained is provided.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{face_patch_map} \anchor PMP_face_patch_map
|
||||
a property map containing information about faces.
|
||||
is a property map containing information about faces.
|
||||
It is particularly well-suited for preserving surface patch IDs,
|
||||
or face colors.
|
||||
The edges at the interface between surface patches are treated similarly
|
||||
to the ones of `edge_is_constrained_map`
|
||||
\n
|
||||
\b Type : a class model of `ReadWritePropertyMap` with
|
||||
to the ones of `edge_is_constrained_map`.\n
|
||||
<b>Type:</b> a class model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and
|
||||
the desired property, model of `CopyConstructible` as value type.\n
|
||||
\b Default : if this parameter is omitted,
|
||||
a default property map where each face is associated with the ID of
|
||||
<b>Default:</b> a default property map where each face is associated with the ID of
|
||||
the connected component it belongs to. Connected components are
|
||||
computed with respect to the constrained edges listed in the property map
|
||||
`edge_is_constrained_map`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_relaxation_steps} \anchor PMP_number_of_relaxation_steps
|
||||
the number of iterations of tangential relaxation that are performed at each iteration
|
||||
of the isotropic remeshing process. A larger number of relaxation steps lead to
|
||||
a more isotropic mesh.
|
||||
\n
|
||||
\b Type : \c unsigned \c int \n
|
||||
\b Default value is `1`
|
||||
\cgalNPBegin{first_index} \anchor PMP_first_index
|
||||
is the index of the first surface patch.\n
|
||||
<b>Type:</b> `std::size_t`\n
|
||||
<b>Default:</b> 1
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{relax_constraints} \anchor PMP_relax_constraints enables the tangential relaxation step
|
||||
of the isotropic remeshing algorithm to be performed on vertices that are endpoints
|
||||
of constraints listed by \ref PMP_edge_is_constrained_map "edge_is_constrained_map",
|
||||
and boundary edges.
|
||||
\cgalNPBegin{density_control_factor} \anchor PMP_density_control_factor
|
||||
controls the density of the mesh generated by refinement, with larger values causing denser refinements.
|
||||
The density of vertices in the refined region is this factor times higher than before refinement.\n
|
||||
<b>Type:</b> floating scalar value\n
|
||||
<b>Default:</b> `CGAL::sqrt(2)`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{fairing_continuity} \anchor PMP_fairing_continuity
|
||||
controls the tangential continuity of the output surface in `fair()`.
|
||||
The possible values are 0, 1 and 2, refering to the C<sup>0</sup>, C<sup>1</sup>
|
||||
and C<sup>2</sup> continuity.\n
|
||||
<b>Type:</b> \c unsigned \c int between 0 and 2\n
|
||||
<b>Default:</b> `1`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{sparse_linear_solver} \anchor PMP_sparse_linear_solver
|
||||
is the solver used in `fair()`.\n
|
||||
<b>Type:</b> a class model of `SparseLinearAlgebraWithFactorTraits_d`.\n
|
||||
<b>Default:</b> if \ref thirdpartyEigen "Eigen" 3.2 (or greater) is available and
|
||||
`CGAL_EIGEN3_ENABLED` is defined, then the following overload of `Eigen_solver_traits`
|
||||
is provided as default value:\n
|
||||
\code CGAL::Eigen_solver_traits<Eigen::SparseLU<CGAL::Eigen_sparse_matrix<double>::EigenType, Eigen::COLAMDOrdering<int> > > \endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_iterations} \anchor PMP_number_of_iterations
|
||||
is the number of iterations of the sequence of iterations performed in `isotropic_remeshing()`.\n
|
||||
<b>Type:</b> \c unsigned \c int \n
|
||||
<b>Default:</b> `1`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{protect_constraints} \anchor PMP_protect_constraints
|
||||
enables the protection of constraints listed by \ref PMP_edge_is_constrained_map
|
||||
"edge_is_constrained_map" and boundary edges
|
||||
in `isotropic_remeshing()`. If `true`, constraint edges cannot be modified at all
|
||||
during the remeshing process.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `false`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{relax_constraints} \anchor PMP_relax_constraints
|
||||
enables the tangential relaxation step in `isotropic_remeshing()`
|
||||
to be performed on vertices that are endpoints of constraints listed
|
||||
by \ref PMP_edge_is_constrained_map "edge_is_constrained_map", and boundary edges.
|
||||
The vertices move along the constrained polylines they belong to.
|
||||
Corners (i.e. vertices incident to more than 2 constraints, and vertices listed in
|
||||
\ref PMP_vertex_is_constrained_map "vertex_is_constrained_map") are not allowed
|
||||
to move at all.
|
||||
If \ref PMP_protect_constraints "protect_constraints" is
|
||||
set to `true`, this parameter is ignored.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `true`
|
||||
set to `true`, this parameter is ignored.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_relaxation_steps} \anchor PMP_number_of_relaxation_steps
|
||||
is the number of iterations of tangential relaxation that are performed at each iteration
|
||||
of `isotropic_remeshing()`. A larger number of relaxation steps lead to
|
||||
a more isotropic mesh.\n
|
||||
<b>Type:</b> \c unsigned \c int \n
|
||||
<b>Default:</b> `1`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{use_delaunay_triangulation} \anchor PMP_use_delaunay_triangulation
|
||||
enables the use of the Delaunay triangulation facet search space for hole filling functions.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{use_random_uniform_sampling} \anchor PMP_use_random_uniform_sampling
|
||||
Parameter used in `sample_triangle_mesh()` to indicate if points should be picked
|
||||
in a random uniform way.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `true`
|
||||
is a parameter used in `sample_triangle_mesh()` to indicate if points should be picked
|
||||
in a random uniform way.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{use_grid_sampling} \anchor PMP_use_grid_sampling
|
||||
Parameter used in `sample_triangle_mesh()` to indicate if points should be picked
|
||||
in on a grid in each face.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `false`
|
||||
is a parameter used in `sample_triangle_mesh()` to indicate if points should be picked
|
||||
in on a grid in each face.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `false`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{use_monte_carlo_sampling} \anchor PMP_use_monte_carlo_sampling
|
||||
Parameter used in `sample_triangle_mesh()` to indicate if points should be picked
|
||||
using a Monte-Carlo approach.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `false`
|
||||
is a parameter used in `sample_triangle_mesh()` to indicate if points should be picked
|
||||
using a Monte-Carlo approach.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `false`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{sample_edges} \anchor PMP_sample_edges
|
||||
Parameter used in `sample_triangle_mesh()` to indicate if a dedicated sampling
|
||||
of edges should be done.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `true`
|
||||
is a parameter used in `sample_triangle_mesh()` to indicate if a dedicated sampling
|
||||
of edges should be done.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{sample_vertices} \anchor PMP_sample_vertices
|
||||
Parameter used in `sample_triangle_mesh()` to indicate if triangle vertices should
|
||||
be copied in the output iterator.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `true`
|
||||
is a parameter used in `sample_triangle_mesh()` to indicate if triangle vertices should
|
||||
be copied in the output iterator.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{sample_faces} \anchor PMP_sample_faces
|
||||
Parameter used in `sample_triangle_mesh()` to indicate if the interior of faces
|
||||
should be considered for the sampling.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `true`
|
||||
is a parameter used in `sample_triangle_mesh()` to indicate if the interior of faces
|
||||
should be considered for the sampling.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_points_on_faces} \anchor PMP_number_of_points_on_faces
|
||||
Parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
using the random uniform method on faces.
|
||||
\n
|
||||
\b Type : `std::size_t` \n
|
||||
\b Default value is `0`
|
||||
is a parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
using the random uniform method on faces.\n
|
||||
<b>Type:</b> `std::size_t` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_points_on_edges} \anchor PMP_number_of_points_on_edges
|
||||
Parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
using the random uniform method on edges.
|
||||
\n
|
||||
\b Type : `std::size_t` \n
|
||||
\b Default value is `0`
|
||||
is a parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
using the random uniform method on edges.\n
|
||||
<b>Type:</b> `std::size_t` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_points_per_face} \anchor PMP_number_of_points_per_face
|
||||
Parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
per face using the Monte-Carlo method.
|
||||
\n
|
||||
\b Type : `std::size_t` \n
|
||||
\b Default value is `0`
|
||||
is a parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
per face using the Monte-Carlo method.\n
|
||||
<b>Type:</b> `std::size_t` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_points_per_edge} \anchor PMP_number_of_points_per_edge
|
||||
Parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
per edge using the Monte-Carlo method.
|
||||
\n
|
||||
\b Type : `std::size_t` \n
|
||||
\b Default value is `0`
|
||||
is a parameter used in `sample_triangle_mesh()` to set the number of points picked
|
||||
per edge using the Monte-Carlo method.\n
|
||||
<b>Type:</b> `std::size_t` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{grid_spacing} \anchor PMP_grid_spacing
|
||||
Parameter used in `sample_triangle_mesh()` to set the grid spacing when using
|
||||
the grid sampling method.
|
||||
\n
|
||||
\b Type : `double` \n
|
||||
\b Default value is `0`
|
||||
is a parameter used in `sample_triangle_mesh()` to set the grid spacing when using
|
||||
the grid sampling method.\n
|
||||
<b>Type:</b> `double` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_points_per_area_unit} \anchor PMP_number_of_points_per_area_unit
|
||||
Parameter used in `sample_triangle_mesh()` to set the number of points per
|
||||
is a parameter used in `sample_triangle_mesh()` to set the number of points per
|
||||
area unit to be picked up in faces for the random uniform sampling and
|
||||
Monte-Carlo methods.
|
||||
\n
|
||||
\b Type : `double` \n
|
||||
\b Default value is `0`
|
||||
Monte-Carlo methods.\n
|
||||
<b>Type:</b> `double` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{number_of_points_per_distance_unit} \anchor PMP_number_of_points_per_distance_unit
|
||||
Parameter used in `sample_triangle_mesh()` to set the number of points per
|
||||
is a parameter used in `sample_triangle_mesh()` to set the number of points per
|
||||
distance unit to be picked up on edges for the random uniform sampling and
|
||||
Monte-Carlo methods.
|
||||
\n
|
||||
\b Type : `double` \n
|
||||
\b Default value is `0`
|
||||
Monte-Carlo methods.\n
|
||||
<b>Type:</b> `double` \n
|
||||
<b>Default:</b> `0`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{do_project} \anchor PMP_do_project
|
||||
Parameter used in `random_perturbation()` to set whether vertices should be re-projected
|
||||
to the input surface after their geometric perturbation.
|
||||
\n
|
||||
\b Type : `bool` \n
|
||||
\b Default value is `true`
|
||||
is a parameter used in `random_perturbation()` to set whether vertices should be re-projected
|
||||
to the input surface after their geometric perturbation.\n
|
||||
<b>Type:</b> `bool` \n
|
||||
<b>Default:</b> `true`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{random_seed} \anchor PMP_random_seed
|
||||
Parameter used in `random_perturbation()` to choose a seed to initialize
|
||||
is a parameter used in `random_perturbation()` to choose a seed to initialize
|
||||
the random number generator `CGAL::Random()`.
|
||||
If this parameter is not provided,
|
||||
the random number generator is initialized with `CGAL::Random()`,
|
||||
and perturbation is not deterministic
|
||||
(i.e. not reproducible from one run to the other).
|
||||
\n
|
||||
\b Type : `unsigned int` \n
|
||||
\b Default is that this variable is not set
|
||||
If this parameter is not provided, the perturbation is not deterministic
|
||||
(i.e. not reproducible from one run to the other).\n
|
||||
<b>Type:</b> `unsigned int` \n
|
||||
<b>Default:</b> the random number generator is initialized with `CGAL::Random()`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPTableEnd
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ ranging from basic operations on simplices, to complex geometry processing algor
|
|||
## Parameters ##
|
||||
|
||||
Optional parameters of the functions of this package
|
||||
are implemented as BGL named parameters.
|
||||
The page \ref namedparameters describes their usage
|
||||
are implemented as \ref BGLNamedParameters.
|
||||
The page \ref pmp_namedparameters "Named Parameters" describes their usage
|
||||
and provides a list of the parameters that are used in this package.
|
||||
|
||||
## Meshing Functions ##
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ It can thus be used either with `Polyhedron_3`, `Surface_mesh`, or
|
|||
any class model of the concept `FaceGraph`. Each function or class of this package
|
||||
details the requirements on the input polygon mesh.
|
||||
|
||||
BGL \ref namedparameters are used to deal with optional parameters.
|
||||
\ref BGLNamedParameters are used to deal with optional parameters.
|
||||
The page \ref pmp_namedparameters describes their usage
|
||||
and provides a list of the parameters that are used in this package.
|
||||
|
||||
\subsection PMPOutline Outline
|
||||
The algorithms described in this manual are organized in sections:
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ namespace CGAL {
|
|||
* computes a bounding box of a polygon mesh.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeListGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -92,11 +92,11 @@ namespace CGAL {
|
|||
* computes a bounding box of a vertex of a polygon mesh.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param vd a descriptor of a vertex in `pmesh`
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -135,11 +135,11 @@ namespace CGAL {
|
|||
* computes a bounding box of an edge of a polygon mesh.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param ed a descriptor of an edge in `pmesh`
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -179,11 +179,11 @@ namespace CGAL {
|
|||
* computes a bounding box of a face of a polygon mesh.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param fd a descriptor of a face in `pmesh`
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
|
|||
|
|
@ -162,14 +162,14 @@ namespace Polygon_mesh_processing {
|
|||
* @tparam HalfedgeOutputIterator model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%halfedge_descriptor`
|
||||
for patch border
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh the polygon mesh to which `faces` belong
|
||||
* @param faces the range of faces defining the patch whose border halfedges
|
||||
* are collected
|
||||
* @param out the output iterator that collects the border halfedges of the patch,
|
||||
* seen from outside.
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
* \cgalNamedParamsBegin
|
||||
\cgalParamBegin{face_index_map} a property map containing the index of each face of `pmesh` \cgalParamEnd
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@ void sum_normals(const PM& pmesh,
|
|||
* \ingroup PMP_normal_grp
|
||||
* computes the outward unit vector normal to face `f`.
|
||||
* @tparam PolygonMesh a model of `FaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param f the face on which the normal is computed
|
||||
* @param pmesh the polygon mesh containing `f`
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -114,7 +114,7 @@ void sum_normals(const PM& pmesh,
|
|||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @return the computed normal. The return type is a 3D vector type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or from the geometric traits class deduced from the point property map
|
||||
* of `pmesh`.
|
||||
*
|
||||
|
|
@ -163,7 +163,7 @@ compute_face_normal(typename boost::graph_traits<PolygonMesh>::face_descriptor f
|
|||
*
|
||||
* @param pmesh the polygon mesh
|
||||
* @param fnm the property map in which the normals are written
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -200,7 +200,7 @@ compute_face_normals(const PolygonMesh& pmesh
|
|||
*
|
||||
* @param v the vertex at which the normal is computed
|
||||
* @param pmesh the polygon mesh containing `v`
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -210,7 +210,7 @@ compute_face_normals(const PolygonMesh& pmesh
|
|||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @return the computed normal. The return type is a 3D vector type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `pmesh`.
|
||||
*
|
||||
|
|
@ -280,7 +280,7 @@ compute_vertex_normal(typename boost::graph_traits<PolygonMesh>::vertex_descript
|
|||
*
|
||||
* @param pmesh the polygon mesh
|
||||
* @param vnm the property map in which the normals are written
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -326,7 +326,7 @@ compute_vertex_normals(const PolygonMesh& pmesh
|
|||
* @param pmesh the polygon mesh
|
||||
* @param vnm the property map in which the vertex normals are written
|
||||
* @param fnm the property map in which the face normals are written
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
|
|||
|
|
@ -107,13 +107,13 @@ namespace Polygon_mesh_processing{
|
|||
* \tparam FaceOutputIterator a model of `OutputIterator` that accepts
|
||||
faces of type
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor`.
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* \param seed_face a face of `pmesh` from which exploration starts to detect the connected component
|
||||
that contains it
|
||||
* \param pmesh the polygon mesh
|
||||
* \param out the output iterator that collects faces from the same connected component as `seed_face`
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd
|
||||
|
|
@ -183,17 +183,17 @@ connected_component(typename boost::graph_traits<PolygonMesh>::face_descriptor s
|
|||
* computes for each face the index of the corresponding connected component.
|
||||
*
|
||||
* A property map for `CGAL::face_index_t` should be either available as an internal property map
|
||||
* to `pmesh` or provided as one of the \ref namedparameters.
|
||||
* to `pmesh` or provided as one of the \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph`
|
||||
* \tparam FaceComponentMap a model of `WritablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and
|
||||
`boost::graph_traits<PolygonMesh>::%faces_size_type` as value type.
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
* \param pmesh the polygon mesh
|
||||
* \param fcm the property map with indices of components associated to faces in `pmesh`
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd
|
||||
|
|
@ -269,14 +269,14 @@ void keep_connected_components(PolygonMesh& pmesh
|
|||
*
|
||||
* Property maps for `CGAL::face_index_t` and `CGAL::vertex_index_t`
|
||||
* should be either available as internal property maps
|
||||
* to `pmesh` or provided as \ref namedparameters.
|
||||
* to `pmesh` or provided as \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* \param pmesh the polygon mesh
|
||||
* \param nb_components_to_keep the number of components to be kept
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd
|
||||
|
|
@ -352,14 +352,14 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh,
|
|||
*
|
||||
* Property maps for `CGAL::face_index_t` and `CGAL::vertex_index_t`
|
||||
* should be either available as internal property maps
|
||||
* to `pmesh` or provided as \ref namedparameters.
|
||||
* to `pmesh` or provided as \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* \param pmesh the polygon mesh
|
||||
* \param threshold_components_to_keep the number of faces a component must have so that it is kept
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd
|
||||
|
|
@ -567,10 +567,10 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh
|
|||
*
|
||||
* Property maps for `CGAL::vertex_index_t`
|
||||
* should be either available as internal property map
|
||||
* to `pmesh` or provided as \ref namedparameters.
|
||||
* to `pmesh` or provided as \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* \tparam ComponentRange a range of ids convertible to `std::size`
|
||||
* \tparam FaceComponentMap a model of `ReadWritePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and
|
||||
|
|
@ -580,7 +580,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh
|
|||
* \param pmesh the polygon mesh
|
||||
* \param fcm the property map with indices of components associated to faces in `pmesh`.
|
||||
* After calling this function, the values of `fcm` are undefined.
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_index_map} a property map containing the index of each vertex of `pmesh` \cgalParamEnd
|
||||
|
|
@ -610,11 +610,11 @@ void keep_connected_components(PolygonMesh& pmesh
|
|||
*
|
||||
* Property maps for `CGAL::vertex_index_t`
|
||||
* should be either available as internal property map
|
||||
* to `pmesh` or provided as \ref namedparameters.
|
||||
* to `pmesh` or provided as \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* \tparam ComponentRange a range of ids convertible to `std::size`
|
||||
* \tparam FaceComponentMap a model of `ReadWritePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and
|
||||
|
|
@ -624,7 +624,7 @@ void keep_connected_components(PolygonMesh& pmesh
|
|||
* \param pmesh the polygon mesh
|
||||
* \param fcm the property map with indices of components associated to faces in `pmesh`.
|
||||
* After calling this function, the values of `fcm` are undefined.
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_index_map} a property map containing the index of each vertex of `pmesh` \cgalParamEnd
|
||||
|
|
@ -651,19 +651,19 @@ void remove_connected_components(PolygonMesh& pmesh
|
|||
*
|
||||
* Property maps for `CGAL::face_index_t` and `CGAL::vertex_index_t`
|
||||
* should be either available as internal property maps
|
||||
* to `pmesh` or provided as \ref namedparameters.
|
||||
* to `pmesh` or provided as \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
* \note If the removal of the connected components makes `pmesh` a non-manifold surface,
|
||||
* then the behavior of this function is undefined.
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* \tparam FaceRange a range of `boost::graph_traits<PolygonMesh>::%face_descriptor`
|
||||
* indicating the connected components to be removed.
|
||||
*
|
||||
* \param components_to_remove a face range, including one face or more on each component to be removed
|
||||
* \param pmesh the polygon mesh
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd
|
||||
|
|
@ -709,19 +709,19 @@ void remove_connected_components(PolygonMesh& pmesh
|
|||
*
|
||||
* Property maps for `CGAL::face_index_t` and `CGAL::vertex_index_t`
|
||||
* should be either available as internal property maps
|
||||
* to `pmesh` or provided as \ref namedparameters.
|
||||
* to `pmesh` or provided as \ref pmp_namedparameters "Named Parameters".
|
||||
*
|
||||
* \note If the removal of the connected components makes `pmesh` a non-manifold surface,
|
||||
* then the behavior of this function is undefined.
|
||||
*
|
||||
* \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* \tparam FaceRange a range of `boost::graph_traits<PolygonMesh>::%face_descriptor`
|
||||
* indicating the connected components to be kept.
|
||||
*
|
||||
* \param pmesh the polygon mesh
|
||||
* \param components_to_keep a face range, including one face or more on each component to be kept
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd
|
||||
|
|
|
|||
|
|
@ -132,10 +132,10 @@ bool recursive_does_bound_a_volume(const TriangleMesh& tm,
|
|||
* @tparam TriangleMesh a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`.
|
||||
* If `TriangleMesh` has an internal property map for `CGAL::face_index_t`,
|
||||
* as a named parameter, then it must be initialized.
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tm a closed triangulated surface mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* @pre `CGAL::is_closed(tm)`
|
||||
*
|
||||
|
|
@ -437,15 +437,15 @@ boolean_operation( TriangleMesh& tm1,
|
|||
* If `TriangleMesh` has an internal property map for `CGAL::face_index_t`,
|
||||
* as a named parameter, then it must be initialized.
|
||||
*
|
||||
* @tparam NamedParameters1 a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters2 a sequence of \ref namedparameters
|
||||
* @tparam NamedParametersOut a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @tparam NamedParametersOut a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tm1 first input triangulated surface mesh
|
||||
* @param tm2 second input triangulated surface mesh
|
||||
* @param tm_out output surface mesh
|
||||
* @param np1 optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np2 optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np1 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
* @param np2 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map}
|
||||
|
|
@ -462,7 +462,7 @@ boolean_operation( TriangleMesh& tm1,
|
|||
* \cgalParamEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @param np_out optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np_out optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map}
|
||||
|
|
@ -580,13 +580,13 @@ corefine_and_compute_difference( TriangleMesh& tm1,
|
|||
* \pre \link CGAL::Polygon_mesh_processing::does_self_intersect() `!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)` \endlink
|
||||
*
|
||||
* @tparam TriangleMesh a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`
|
||||
* @tparam NamedParameters1 a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters2 a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tm1 first input triangulated surface mesh
|
||||
* @param tm2 second input triangulated surface mesh
|
||||
* @param np1 optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np2 optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np1 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
* @param np2 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
* @param throw_on_self_intersection if `true`, for each input triangle mesh,
|
||||
* the set of triangles closed to the intersection of `tm1` and `tm2` will be
|
||||
* checked for self-intersection and `CGAL::Corefinement::Self_intersection_exception`
|
||||
|
|
|
|||
|
|
@ -246,17 +246,17 @@ template<typename GT,
|
|||
*
|
||||
* \tparam PolygonMesh a model of `HalfedgeListGraph`
|
||||
* \tparam FT a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or from the geometric traits class deduced from the point property map
|
||||
* of `PolygonMesh`.
|
||||
* \tparam EdgeIsFeatureMap a model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%edge_descriptor`
|
||||
* as key type and `bool` as value type. It should be default constructible.
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* \param pmesh the polygon mesh
|
||||
* \param angle_in_deg the dihedral angle bound
|
||||
* \param edge_is_feature_map the property map that will contain the sharp-or-not status of each edge of `pmesh`
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd
|
||||
|
|
@ -383,20 +383,20 @@ namespace internal
|
|||
*
|
||||
* \tparam PolygonMesh a model of `FaceGraph`
|
||||
* \tparam FT a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or from the geometric traits class deduced from the point property map
|
||||
* of `PolygonMesh`.
|
||||
* \tparam EdgeIsFeatureMap a model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%edge_descriptor`
|
||||
* \tparam PatchIdMap a model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%face_descriptor` as key type
|
||||
and the desired patch id, model of `CopyConstructible` as value type.
|
||||
* \tparam NamedParameters a sequence of \ref namedparameters
|
||||
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* \param pmesh the polygon mesh
|
||||
* \param angle_in_deg the dihedral angle bound
|
||||
* \param edge_is_feature_map the property map that will contain the sharp-or-not status of each edge of `pmesh`
|
||||
* \param patch_id_map the property map that will contain the surface patch ids for the faces of `pmesh`.
|
||||
* \param np optional \ref namedparameters described below
|
||||
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ sample_triangles(const FaceRange& triangles,
|
|||
*
|
||||
* @param tm the triangle mesh that will be sampled
|
||||
* @param out output iterator to be filled with sampled points
|
||||
* @param np an optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points
|
||||
|
|
@ -596,14 +596,14 @@ double approximate_Hausdorff_distance(
|
|||
* Possible values are `Sequential_tag`
|
||||
* and `Parallel_tag`.
|
||||
* @tparam TriangleMesh a model of the concept `FaceListGraph`
|
||||
* @tparam NamedParameters1 a sequence of \ref namedparameters for `tm1`
|
||||
* @tparam NamedParameters2 a sequence of \ref namedparameters for `tm2`
|
||||
* @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm1`
|
||||
* @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm2`
|
||||
*
|
||||
* @param tm1 the triangle mesh that will be sampled
|
||||
* @param tm2 the triangle mesh to compute the distance to
|
||||
* @param np1 optional sequence of \ref namedparameters for `tm1` passed to `sample_triangle_mesh()`.
|
||||
* @param np1 optional sequence of \ref pmp_namedparameters "Named Parameters" for `tm1` passed to `sample_triangle_mesh()`.
|
||||
*
|
||||
* @param np2 optional sequence of \ref namedparameters for `tm2` among the ones listed below
|
||||
* @param np2 optional sequence of \ref pmp_namedparameters "Named Parameters" for `tm2` among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm2`
|
||||
|
|
@ -611,7 +611,7 @@ double approximate_Hausdorff_distance(
|
|||
* and in all places where vertex_point_map is used.
|
||||
* \cgalParamEnd
|
||||
* \cgalNamedParamsEnd
|
||||
* The function `CGAL::Polygon_mesh_processing::params::all_default()` can be used to indicate to use the default values for
|
||||
* The function `CGAL::parameters::all_default()` can be used to indicate to use the default values for
|
||||
* `np1` and specify custom values for `np2`
|
||||
*/
|
||||
template< class Concurrency_tag,
|
||||
|
|
@ -659,10 +659,10 @@ double approximate_symmetric_Hausdorff_distance(
|
|||
* that is the furthest from `tm`.
|
||||
* @tparam PointRange a range of `Point_3`, model of `Range`.
|
||||
* @tparam TriangleMesh a model of the concept `FaceListGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @param points the range of points of interest
|
||||
* @param tm the triangle mesh to compute the distance to
|
||||
* @param np an optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map}
|
||||
|
|
@ -693,13 +693,13 @@ double max_distance_to_triangle_mesh(const PointRange& points,
|
|||
* returns an approximation of the distance between `points` and the point lying on `tm` that is the farthest from `points`
|
||||
* @tparam PointRange a range of `Point_3`, model of `Range`.
|
||||
* @tparam TriangleMesh a model of the concept `FaceListGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @param tm a triangle mesh
|
||||
* @param points a range of points
|
||||
* @param precision for each triangle of `tm`, the distance of its farthest point from `points` is bounded.
|
||||
* A triangle is subdivided into sub-triangles so that the difference of its distance bounds
|
||||
* is smaller than `precision`. `precision` must be strictly positive to avoid infinite loops.
|
||||
* @param np an optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map}
|
||||
|
|
|
|||
|
|
@ -86,11 +86,11 @@ namespace internal {
|
|||
@tparam TriangleMesh a model of `FaceGraph` and `MutableFaceGraph`
|
||||
@tparam VertexRange a range of vertex descriptors of `TriangleMesh`, model of `Range`.
|
||||
Its iterator type is `InputIterator`.
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
@tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
@param tmesh the triangle mesh with patches to be faired
|
||||
@param vertices the vertices of the patches to be faired (the positions of only those vertices will be changed)
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
@param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tmesh`.
|
||||
|
|
|
|||
|
|
@ -27,126 +27,9 @@
|
|||
|
||||
#include <CGAL/boost/graph/named_function_params.h>
|
||||
|
||||
#define CGAL_PMP_NP_TEMPLATE_PARAMETERS T, typename Tag, typename Base
|
||||
#define CGAL_PMP_NP_CLASS CGAL::pmp_bgl_named_params<T,Tag,Base>
|
||||
|
||||
namespace CGAL{
|
||||
namespace internal_np{
|
||||
enum all_default_t { all_default }; //cannot use macro because it takes no argument
|
||||
|
||||
// define enum types and values for new named parameters
|
||||
#define CGAL_add_named_parameter(X, Y, Z) \
|
||||
enum X { Y };
|
||||
#include <CGAL/Polygon_mesh_processing/internal/parameters_interface.h>
|
||||
#undef CGAL_add_named_parameter
|
||||
|
||||
}//internal_np
|
||||
|
||||
template <typename T, typename Tag, typename Base = boost::no_property>
|
||||
struct pmp_bgl_named_params
|
||||
: CGAL::cgal_bgl_named_params<T, Tag, Base>
|
||||
{
|
||||
typedef CGAL::cgal_bgl_named_params<T, Tag, Base> base;
|
||||
typedef pmp_bgl_named_params self;
|
||||
|
||||
pmp_bgl_named_params(T v = T()) : base(v) {}
|
||||
pmp_bgl_named_params(T v, const Base& b) : base(v, b) {}
|
||||
pmp_bgl_named_params<bool, internal_np::all_default_t, self>
|
||||
all_default() const
|
||||
{
|
||||
typedef pmp_bgl_named_params<bool, internal_np::all_default_t, self> Params;
|
||||
return Params(*this);
|
||||
}
|
||||
|
||||
// define the functions for new named parameters and the one imported from BGL and boost
|
||||
// used to concatenate several parameters
|
||||
#define CGAL_add_named_parameter(X, Y, Z) \
|
||||
template<typename K> \
|
||||
pmp_bgl_named_params<K, internal_np::X, self> \
|
||||
Z(const K& k) const \
|
||||
{ \
|
||||
typedef pmp_bgl_named_params<K, internal_np::X, self> Params; \
|
||||
return Params(k, *this); \
|
||||
}
|
||||
#include <CGAL/Polygon_mesh_processing/internal/parameters_interface.h>
|
||||
#include <CGAL/boost/graph/parameters_interface.h>
|
||||
#include <CGAL/boost/graph/boost_parameters_interface.h>
|
||||
#undef CGAL_add_named_parameter
|
||||
};
|
||||
|
||||
namespace Polygon_mesh_processing{
|
||||
|
||||
namespace parameters{
|
||||
|
||||
pmp_bgl_named_params<bool, internal_np::all_default_t>
|
||||
inline all_default()
|
||||
{
|
||||
typedef pmp_bgl_named_params<bool, internal_np::all_default_t> Params;
|
||||
return Params();
|
||||
}
|
||||
|
||||
|
||||
template <typename T, typename Tag, typename Base>
|
||||
pmp_bgl_named_params<T,Tag,Base>
|
||||
inline no_parameters(pmp_bgl_named_params<T,Tag,Base>)
|
||||
{
|
||||
typedef pmp_bgl_named_params<T,Tag,Base> Params;
|
||||
return Params();
|
||||
}
|
||||
|
||||
// define free functions for new named parameters and the one imported from BGL and boost
|
||||
#define CGAL_add_named_parameter(X, Y, Z) \
|
||||
template<typename K> \
|
||||
pmp_bgl_named_params<K, internal_np::X> \
|
||||
Z(const K& k) \
|
||||
{ \
|
||||
typedef pmp_bgl_named_params<K, internal_np::X> Params; \
|
||||
return Params(k); \
|
||||
}
|
||||
#include <CGAL/boost/graph/boost_parameters_interface.h>
|
||||
#include <CGAL/boost/graph/parameters_interface.h>
|
||||
#include <CGAL/Polygon_mesh_processing/internal/parameters_interface.h>
|
||||
#undef CGAL_add_named_parameter
|
||||
} //namespace parameters
|
||||
} //namespace Polygon_mesh_processing
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
// partial specializations hate inheritance and we need to repeat
|
||||
// those here. this is rather fragile.
|
||||
namespace boost {
|
||||
#if BOOST_VERSION < 105100
|
||||
template <class Tag1, class Tag2, class T1, class Base>
|
||||
inline
|
||||
typename property_value< CGAL::pmp_bgl_named_params<T1,Tag1,Base>, Tag2>::type
|
||||
get_param(const CGAL::pmp_bgl_named_params<T1,Tag1,Base>& p, Tag2 tag2)
|
||||
{
|
||||
enum { match = detail::same_property<Tag1,Tag2>::value };
|
||||
typedef typename
|
||||
boost::property_value< CGAL::pmp_bgl_named_params<T1,Tag1,Base>, Tag2>::type T2;
|
||||
T2* t2 = 0;
|
||||
typedef detail::property_value_dispatch<match> Dispatcher;
|
||||
return Dispatcher::const_get_value(p, t2, tag2);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename T, typename Tag, typename Base, typename Def>
|
||||
struct lookup_named_param_def<Tag, CGAL::pmp_bgl_named_params<T, Tag, Base>, Def> {
|
||||
typedef T type;
|
||||
static const type& get(const bgl_named_params<T, Tag, Base>& p, const Def&) {
|
||||
return p.m_value;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tag1, typename T, typename Tag, typename Base, typename Def>
|
||||
struct lookup_named_param_def<Tag1, CGAL::pmp_bgl_named_params<T, Tag, Base>, Def> {
|
||||
typedef typename lookup_named_param_def<Tag1, Base, Def>::type type;
|
||||
static const type& get(const bgl_named_params<T, Tag, Base>& p, const Def& def) {
|
||||
return lookup_named_param_def<Tag1, Base, Def>::get(p.m_base, def);
|
||||
}
|
||||
};
|
||||
|
||||
} // boost
|
||||
#define CGAL_PMP_NP_TEMPLATE_PARAMETERS CGAL_BGL_NP_TEMPLATE_PARAMETERS
|
||||
#define CGAL_PMP_NP_CLASS CGAL_BGL_NP_CLASS
|
||||
|
||||
namespace CGAL { namespace Polygon_mesh_processing { namespace parameters = CGAL::parameters; } }
|
||||
|
||||
#endif //CGAL_PMP_BGL_NAMED_FUNCTION_PARAMS_H
|
||||
|
|
|
|||
|
|
@ -24,141 +24,6 @@
|
|||
|
||||
#include <CGAL/license/Polygon_mesh_processing/core.h>
|
||||
|
||||
|
||||
#include <CGAL/Kernel_traits.h>
|
||||
#include <CGAL/Origin.h>
|
||||
#include <CGAL/Polygon_mesh_processing/internal/named_function_params.h>
|
||||
|
||||
#include <CGAL/property_map.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
// shortcut for accessing the value type of the property map
|
||||
template <class Graph, class Property>
|
||||
class property_map_value {
|
||||
typedef typename boost::property_map<Graph, Property>::const_type PMap;
|
||||
public:
|
||||
typedef typename boost::property_traits<PMap>::value_type type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetVertexPointMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_point_t>::const_type
|
||||
DefaultVPMap_const;
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_point_t>::type
|
||||
DefaultVPMap;
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def<
|
||||
internal_np::vertex_point_t,
|
||||
NamedParameters,
|
||||
DefaultVPMap
|
||||
> ::type type;
|
||||
typedef typename boost::lookup_named_param_def<
|
||||
internal_np::vertex_point_t,
|
||||
NamedParameters,
|
||||
DefaultVPMap_const
|
||||
> ::type const_type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetK
|
||||
{
|
||||
typedef typename boost::property_traits<
|
||||
typename GetVertexPointMap<PolygonMesh, NamedParameters>::type
|
||||
>::value_type Point;
|
||||
public:
|
||||
typedef typename CGAL::Kernel_traits<Point>::Kernel Kernel;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters = pmp_bgl_named_params<bool, internal_np::all_default_t> >
|
||||
class GetGeomTraits
|
||||
{
|
||||
typedef typename boost::graph_has_property<PolygonMesh, boost::vertex_point_t>::type
|
||||
Has_internal_pmap;
|
||||
struct Fake_GT {};//to be used if there is no internal vertex_point_map in PolygonMesh
|
||||
|
||||
typedef typename boost::mpl::if_c< Has_internal_pmap::value
|
||||
, typename GetK<PolygonMesh, NamedParameters>::Kernel
|
||||
, Fake_GT
|
||||
>::type DefaultKernel;
|
||||
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::geom_traits_t,
|
||||
NamedParameters,
|
||||
DefaultKernel
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetFaceIndexMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::face_index_t>::type DefaultMap;
|
||||
typedef typename property_map_selector<PolygonMesh, boost::face_index_t>::const_type DefaultMap_const;
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::face_index_t,
|
||||
NamedParameters,
|
||||
DefaultMap
|
||||
> ::type type;
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::face_index_t,
|
||||
NamedParameters,
|
||||
DefaultMap_const
|
||||
> ::type const_type;
|
||||
typedef typename boost::is_same<type, DefaultMap>::type Is_internal_map;
|
||||
typedef typename boost::is_same<const_type, DefaultMap_const>::type Is_internal_map_const;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetVertexIndexMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_index_t>::type DefaultMap;
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::vertex_index_t,
|
||||
NamedParameters,
|
||||
DefaultMap
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetFaceNormalMap
|
||||
{
|
||||
struct DummyNormalPmap
|
||||
{
|
||||
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor key_type;
|
||||
typedef typename GetGeomTraits<PolygonMesh, NamedParameters>::type::Vector_3 value_type;
|
||||
typedef value_type reference;
|
||||
typedef boost::readable_property_map_tag category;
|
||||
|
||||
typedef DummyNormalPmap Self;
|
||||
friend reference get(const Self&, const key_type&) { return CGAL::NULL_VECTOR; }
|
||||
};
|
||||
|
||||
public:
|
||||
typedef DummyNormalPmap NoMap;
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::face_normal_t,
|
||||
NamedParameters,
|
||||
DummyNormalPmap//default
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename NamedParameters, typename DefaultSolver>
|
||||
class GetSolver
|
||||
{
|
||||
public:
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
internal_np::sparse_linear_solver_t,
|
||||
NamedParameters,
|
||||
DefaultSolver
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
} //end of namespace CGAL
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#endif //CGAL_NAMED_PARAMETERS_HELPERS_H
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
// Copyright (c) 2017 GeometryFactory (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
// You can redistribute it and/or modify it under the terms of the GNU
|
||||
// General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Maxime Gimeno
|
||||
|
||||
// List of named parameters used in the Polygon Mesh Processing package
|
||||
|
||||
CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits)
|
||||
CGAL_add_named_parameter(density_control_factor_t, density_control_factor, density_control_factor)
|
||||
CGAL_add_named_parameter(use_delaunay_triangulation_t, use_delaunay_triangulation, use_delaunay_triangulation)
|
||||
CGAL_add_named_parameter(fairing_continuity_t, fairing_continuity, fairing_continuity)
|
||||
CGAL_add_named_parameter(sparse_linear_solver_t, sparse_linear_solver, sparse_linear_solver)
|
||||
CGAL_add_named_parameter(number_of_iterations_t, number_of_iterations, number_of_iterations)
|
||||
CGAL_add_named_parameter(number_of_relaxation_steps_t, number_of_relaxation_steps, number_of_relaxation_steps)
|
||||
CGAL_add_named_parameter(protect_constraints_t, protect_constraints, protect_constraints)
|
||||
CGAL_add_named_parameter(relax_constraints_t, relax_constraints, relax_constraints)
|
||||
CGAL_add_named_parameter(vertex_is_constrained_t, vertex_is_constrained, vertex_is_constrained_map)
|
||||
CGAL_add_named_parameter(face_patch_t, face_patch, face_patch_map)
|
||||
CGAL_add_named_parameter(random_uniform_sampling_t, random_uniform_sampling, use_random_uniform_sampling)
|
||||
CGAL_add_named_parameter(grid_sampling_t, grid_sampling, use_grid_sampling)
|
||||
CGAL_add_named_parameter(monte_carlo_sampling_t, monte_carlo_sampling, use_monte_carlo_sampling)
|
||||
CGAL_add_named_parameter(do_sample_edges_t, do_sample_edges, do_sample_edges)
|
||||
CGAL_add_named_parameter(do_sample_vertices_t, do_sample_vertices, do_sample_vertices)
|
||||
CGAL_add_named_parameter(do_sample_faces_t, do_sample_faces, do_sample_faces)
|
||||
CGAL_add_named_parameter(number_of_points_on_faces_t, number_of_points_on_faces, number_of_points_on_faces)
|
||||
CGAL_add_named_parameter(number_of_points_per_face_t, number_of_points_per_face, number_of_points_per_face)
|
||||
CGAL_add_named_parameter(grid_spacing_t, grid_spacing, grid_spacing)
|
||||
CGAL_add_named_parameter(number_of_points_per_edge_t, number_of_points_per_edge, number_of_points_per_edge)
|
||||
CGAL_add_named_parameter(number_of_points_on_edges_t, number_of_points_on_edges, number_of_points_on_edges)
|
||||
CGAL_add_named_parameter(nb_points_per_area_unit_t, nb_points_per_area_unit, number_of_points_per_area_unit)
|
||||
CGAL_add_named_parameter(nb_points_per_distance_unit_t, nb_points_per_distance_unit, number_of_points_per_distance_unit)
|
||||
|
||||
//to be documented
|
||||
CGAL_add_named_parameter(face_normal_t, face_normal, face_normal_map)
|
||||
CGAL_add_named_parameter(random_seed_t, random_seed, random_seed)
|
||||
CGAL_add_named_parameter(do_project_t, do_project, do_project)
|
||||
|
||||
//internal
|
||||
CGAL_add_named_parameter(weight_calculator_t, weight_calculator, weight_calculator)
|
||||
|
|
@ -40,8 +40,8 @@ namespace Polygon_mesh_processing{
|
|||
* \pre \link CGAL::Polygon_mesh_processing::does_self_intersect() `!CGAL::Polygon_mesh_processing::does_self_intersect(tm2)` \endlink
|
||||
*
|
||||
* @tparam TriangleMesh a model of `MutableFaceGraph`, `HalfedgeListGraph` and `FaceListGraph`
|
||||
* @tparam NamedParameters1 a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters2 a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
* @tparam OutputIterator an output iterator in which `std::vector` of points
|
||||
* can be put. The point type is the one from the
|
||||
* vertex property map
|
||||
|
|
@ -54,8 +54,8 @@ namespace Polygon_mesh_processing{
|
|||
* the set of triangles closed to the intersection of `tm1` and `tm2` will be
|
||||
* checked for self-intersection and `CGAL::Corefinement::Self_intersection_exception`
|
||||
* will be thrown if at least one is found.
|
||||
* @param np1 optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np2 optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np1 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
* @param np2 optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map}
|
||||
|
|
|
|||
|
|
@ -63,11 +63,11 @@ namespace Polygon_mesh_processing {
|
|||
* The edge is given by one of its halfedges, or the edge itself.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param h one halfedge of the edge to compute the length
|
||||
* @param pmesh the polygon mesh to which `h` belongs
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -77,7 +77,7 @@ namespace Polygon_mesh_processing {
|
|||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @return the length of `h`. The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `pmesh`.
|
||||
*
|
||||
|
|
@ -144,11 +144,11 @@ namespace Polygon_mesh_processing {
|
|||
* that contains a given halfedge.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param h a halfedge of the border polyline of which the length is computed
|
||||
* @param pmesh the polygon mesh to which `h` belongs
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -159,7 +159,7 @@ namespace Polygon_mesh_processing {
|
|||
*
|
||||
* @return the length of the sequence of border edges of `face(h, pmesh)`.
|
||||
* The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `pmesh`.
|
||||
*
|
||||
|
|
@ -208,10 +208,10 @@ namespace Polygon_mesh_processing {
|
|||
* a halfedge that is part of this border and the length of this border.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh the polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -226,7 +226,7 @@ namespace Polygon_mesh_processing {
|
|||
* deduced from the graph traits corresponding to the type `PolygonMesh`.
|
||||
* - `second`: the length of the longest border
|
||||
* The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `pmesh`
|
||||
*
|
||||
|
|
@ -283,11 +283,11 @@ namespace Polygon_mesh_processing {
|
|||
* triangulated surface mesh.
|
||||
*
|
||||
* @tparam TriangleMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param f the face of which the area is computed
|
||||
* @param tmesh the triangulated surface mesh to which `f` belongs
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -300,7 +300,7 @@ namespace Polygon_mesh_processing {
|
|||
*
|
||||
* @return the area of `f`.
|
||||
* The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `tmesh`.
|
||||
*
|
||||
|
|
@ -357,11 +357,11 @@ namespace Polygon_mesh_processing {
|
|||
model of `Range`.
|
||||
Its iterator type is `InputIterator`.
|
||||
* @tparam TriangleMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param face_range the range of faces of which the area is computed
|
||||
* @param tmesh the triangulated surface mesh to which the faces of `face_range` belong
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -372,7 +372,7 @@ namespace Polygon_mesh_processing {
|
|||
*
|
||||
* @return sum of face areas of `faces`.
|
||||
* The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `tmesh`.
|
||||
*
|
||||
|
|
@ -417,10 +417,10 @@ namespace Polygon_mesh_processing {
|
|||
* computes the surface area of a triangulated surface mesh.
|
||||
*
|
||||
* @tparam TriangleMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tmesh the triangulated surface mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -431,7 +431,7 @@ namespace Polygon_mesh_processing {
|
|||
*
|
||||
* @return the surface area of `tmesh`.
|
||||
* The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `tmesh`.
|
||||
*
|
||||
|
|
@ -468,10 +468,10 @@ namespace Polygon_mesh_processing {
|
|||
* a closed triangulated surface mesh.
|
||||
*
|
||||
* @tparam TriangleMesh a model of `HalfedgeGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tmesh the closed triangulated surface mesh bounding the volume
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* @pre `tmesh` is closed
|
||||
*
|
||||
|
|
@ -484,7 +484,7 @@ namespace Polygon_mesh_processing {
|
|||
*
|
||||
* @return the volume bounded by `tmesh`.
|
||||
* The return type `FT` is a number type. It is
|
||||
* either deduced from the `geom_traits` \ref namedparameters if provided,
|
||||
* either deduced from the `geom_traits` \ref pmp_namedparameters "Named Parameters" if provided,
|
||||
* or the geometric traits class deduced from the point property map
|
||||
* of `tmesh`.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -152,10 +152,10 @@ namespace internal{
|
|||
* isolated connected component.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `FaceListGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh the closed polygon mesh to be tested
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh` \cgalParamEnd
|
||||
|
|
|
|||
|
|
@ -115,13 +115,13 @@ namespace internal {
|
|||
* vertices of type `boost::graph_traits<TriangleMesh>::%vertex_descriptor`.
|
||||
* Its iterator type is `ForwardIterator`.
|
||||
* @tparam TriangleMesh model of `MutableFaceGraph`.
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param vertices the range of vertices to be perturbed
|
||||
* @param tmesh the triangulated surface mesh
|
||||
* @param perturbation_max_size the maximal length of moves that can be applied to
|
||||
* vertices of `tmesh`.
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{geom_traits} a geometric traits class instance, model of `Kernel`.
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ namespace Polygon_mesh_processing {
|
|||
holding `boost::graph_traits<TriangleMesh>::%face_descriptor` for patch faces
|
||||
@tparam VertexOutputIterator model of `OutputIterator`
|
||||
holding `boost::graph_traits<TriangleMesh>::%vertex_descriptor` for patch vertices
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
@tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
@param tmesh triangle mesh with patches to be refined
|
||||
@param faces the range of faces defining the patches to refine
|
||||
@param faces_out output iterator into which descriptors of new faces are recorded
|
||||
@param vertices_out output iterator into which descriptors of new vertices are recorded
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
@param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tmesh`
|
||||
|
|
|
|||
|
|
@ -54,13 +54,13 @@ namespace Polygon_mesh_processing {
|
|||
* as a named parameter, then the internal one must be initialized
|
||||
* @tparam FaceRange range of `boost::graph_traits<PolygonMesh>::%face_descriptor`,
|
||||
model of `Range`. Its iterator type is `ForwardIterator`.
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh with triangulated surface patches to be remeshed
|
||||
* @param faces the range of triangular faces defining one or several surface patches to be remeshed
|
||||
* @param target_edge_length the edge length that is targeted in the remeshed patch.
|
||||
* If `0` is passed then only the edge-flip, tangential relaxation, and projection steps will be done.
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* @pre if constraints protection is activated, the constrained edges should
|
||||
* not be longer than 4/3*`target_edge_length`
|
||||
|
|
@ -283,13 +283,13 @@ void isotropic_remeshing(
|
|||
* has an internal property map for `CGAL::vertex_point_t`.
|
||||
* @tparam EdgeRange range of `boost::graph_traits<PolygonMesh>::%edge_descriptor`,
|
||||
* model of `Range`. Its iterator type is `InputIterator`.
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param edges the range of edges to be split if they are longer than given threshold
|
||||
* @param max_length the edge length above which an edge from `edges` is split
|
||||
* into to sub-edges
|
||||
* @param np optional \ref namedparameters described below
|
||||
* @param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated
|
||||
|
|
|
|||
|
|
@ -647,10 +647,10 @@ std::size_t remove_null_edges(
|
|||
/// @pre `CGAL::is_triangle_mesh(tmesh)`
|
||||
///
|
||||
/// @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
/// @tparam NamedParameters a sequence of \ref namedparameters
|
||||
/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
///
|
||||
/// @param tmesh the triangulated surface mesh to be repaired
|
||||
/// @param np optional \ref namedparameters described below
|
||||
/// @param np optional \ref pmp_namedparameters "Named Parameters" described below
|
||||
///
|
||||
/// \cgalNamedParamsBegin
|
||||
/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. The type of this map is model of `ReadWritePropertyMap`.
|
||||
|
|
|
|||
|
|
@ -240,11 +240,11 @@ self_intersections( const FaceRange& face_range,
|
|||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam OutputIterator a model of `OutputIterator` holding objects of type
|
||||
* `std::pair<boost::graph_traits<TriangleMesh>::%face_descriptor, boost::graph_traits<TriangleMesh>::%face_descriptor>`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tmesh the triangulated surface mesh to be checked
|
||||
* @param out output iterator to be filled with all pairs of non-adjacent faces that intersect
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -269,7 +269,7 @@ self_intersections(const TriangleMesh& tmesh
|
|||
#ifdef DOXYGEN_RUNNING
|
||||
, const NamedParameters& np)
|
||||
#else
|
||||
, const pmp_bgl_named_params<P,T,R>& np)
|
||||
, const cgal_bgl_named_params<P,T,R>& np)
|
||||
#endif
|
||||
{
|
||||
return self_intersections(faces(tmesh), tmesh, out, np);
|
||||
|
|
@ -298,12 +298,12 @@ self_intersections(const TriangleMesh& tmesh, OutputIterator out)
|
|||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam OutputIterator a model of `OutputIterator` holding objects of type
|
||||
* `std::pair<boost::graph_traits<TriangleMesh>::%face_descriptor, boost::graph_traits<TriangleMesh>::%face_descriptor>`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param face_range the range of faces to check for self-intersection.
|
||||
* @param tmesh the triangulated surface mesh to be checked
|
||||
* @param out output iterator to be filled with all pairs of non-adjacent faces that intersect
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -386,10 +386,10 @@ OutputIterator self_intersections(const FaceRange& face_range,
|
|||
* @pre `CGAL::is_triangle_mesh(tmesh)`
|
||||
*
|
||||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param tmesh the triangulated surface mesh to be tested
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tmesh`.
|
||||
|
|
@ -427,11 +427,11 @@ bool does_self_intersect(const TriangleMesh& tmesh
|
|||
*
|
||||
* @tparam FaceRange a range of `face_descriptor`
|
||||
* @tparam TriangleMesh a model of `FaceListGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param face_range the set of faces to test for self-intersection
|
||||
* @param tmesh the triangulated surface mesh to be tested
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tmesh`.
|
||||
|
|
|
|||
|
|
@ -494,10 +494,10 @@ void stitch_borders(PolygonMesh& pmesh,
|
|||
/// the same as those of the target and source vertices of `h2` respectively.
|
||||
///
|
||||
/// @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
/// @tparam NamedParameters a sequence of \ref namedparameters
|
||||
/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
///
|
||||
/// @param pmesh the polygon mesh to be modified by stitching
|
||||
/// @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
/// @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
///
|
||||
/// \cgalNamedParamsBegin
|
||||
/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
|
|||
|
|
@ -307,11 +307,11 @@ public:
|
|||
* \ingroup PMP_meshing_grp
|
||||
* triangulates a single face of a polygon mesh. This function depends on the package \ref PkgTriangulation2Summary
|
||||
* @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param f face to be triangulated
|
||||
* @param pmesh the polygon mesh to which the face to be triangulated belongs
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
|
|
@ -357,11 +357,11 @@ bool triangulate_face(typename boost::graph_traits<PolygonMesh>::face_descriptor
|
|||
model of `Range`.
|
||||
Its iterator type is `InputIterator`.
|
||||
* @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param face_range the range of faces to be triangulated
|
||||
* @param pmesh the polygon mesh to be triangulated
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -402,10 +402,10 @@ bool triangulate_faces(FaceRange face_range, PolygonMesh& pmesh)
|
|||
* \ingroup PMP_meshing_grp
|
||||
* triangulates all faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2Summary
|
||||
* @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh the polygon mesh to be triangulated
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ namespace Polygon_mesh_processing {
|
|||
@tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
@tparam OutputIterator a model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%face_descriptor` for patch faces.
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
@tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
@param pmesh polygon mesh containing the hole
|
||||
@param border_halfedge a border halfedge incident to the hole
|
||||
@param out iterator over patch faces
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
@param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -143,13 +143,13 @@ namespace Polygon_mesh_processing {
|
|||
holding `boost::graph_traits<PolygonMesh>::%face_descriptor` for patch faces.
|
||||
@tparam VertexOutputIterator model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%vertex_descriptor` for patch vertices.
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
@tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
@param pmesh polygon mesh which has the hole
|
||||
@param border_halfedge a border halfedge incident to the hole
|
||||
@param face_out output iterator over patch faces
|
||||
@param vertex_out output iterator over patch vertices without including the boundary
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
@param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -210,13 +210,13 @@ namespace Polygon_mesh_processing {
|
|||
holding `boost::graph_traits<PolygonMesh>::%face_descriptor` for patch faces
|
||||
@tparam VertexOutputIterator model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%vertex_descriptor` for patch vertices
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
@tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
@param pmesh polygon mesh which has the hole
|
||||
@param border_halfedge a border halfedge incident to the hole
|
||||
@param face_out output iterator over patch faces
|
||||
@param vertex_out output iterator over patch vertices without including the boundary
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
@param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -307,13 +307,13 @@ namespace Polygon_mesh_processing {
|
|||
and the corresponding value type `type` must have
|
||||
a constructor `type(int p0, int p1, int p2)` available.
|
||||
The indices correspond to the ones of input points in `points`.
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
@tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
|
||||
|
||||
@param points the range of input points
|
||||
@param third_points the range of third points
|
||||
@param out iterator over output patch triangles, described by indices of points
|
||||
in `points`
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
@param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space \cgalParamEnd
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ endif()
|
|||
create_single_source_cgal_program("self_intersection_surface_mesh_test.cpp" )
|
||||
create_single_source_cgal_program("test_is_polygon_soup_a_polygon_mesh.cpp")
|
||||
create_single_source_cgal_program("test_stitching.cpp")
|
||||
create_single_source_cgal_program("test_pmp_bgl_named_params.cpp")
|
||||
create_single_source_cgal_program("remeshing_test.cpp" )
|
||||
create_single_source_cgal_program("measures_test.cpp")
|
||||
create_single_source_cgal_program("triangulate_faces_test.cpp")
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
#include <CGAL/Polygon_mesh_processing/internal/named_function_params.h>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
template <int i>
|
||||
struct A{
|
||||
A(int v):v(v){}
|
||||
int v;
|
||||
};
|
||||
|
||||
template <int i, class T>
|
||||
void check_same_type(T)
|
||||
{
|
||||
static const bool b = boost::is_same< A<i>, T >::value;
|
||||
CGAL_static_assertion(b);
|
||||
assert(b);
|
||||
}
|
||||
|
||||
template<class NamedParameters>
|
||||
void test_np(const NamedParameters& np)
|
||||
{
|
||||
// test values
|
||||
assert( get_param(np,CGAL::internal_np::vertex_index).v == 0 );
|
||||
assert( get_param(np,CGAL::internal_np::face_index).v == 2 );
|
||||
assert( get_param(np,CGAL::internal_np::vertex_point).v == 3 );
|
||||
assert( get_param(np,CGAL::internal_np::edge_is_constrained).v == 12 );
|
||||
assert( get_param(np,CGAL::internal_np::density_control_factor).v == 14 );
|
||||
assert( get_param(np,CGAL::internal_np::use_delaunay_triangulation).v == 15 );
|
||||
assert( get_param(np,CGAL::internal_np::fairing_continuity).v == 16 );
|
||||
assert( get_param(np,CGAL::internal_np::sparse_linear_solver).v == 17 );
|
||||
assert( get_param(np,CGAL::internal_np::weight_calculator).v == 18 );
|
||||
|
||||
//test types
|
||||
check_same_type<0>( get_param(np,CGAL::internal_np::vertex_index) );
|
||||
check_same_type<2>( get_param(np,CGAL::internal_np::face_index) );
|
||||
check_same_type<3>( get_param(np,CGAL::internal_np::vertex_point) );
|
||||
check_same_type<12>( get_param(np,CGAL::internal_np::edge_is_constrained) );
|
||||
//
|
||||
check_same_type<14>( get_param(np,CGAL::internal_np::density_control_factor) );
|
||||
check_same_type<15>( get_param(np,CGAL::internal_np::use_delaunay_triangulation) );
|
||||
check_same_type<16>( get_param(np,CGAL::internal_np::fairing_continuity) );
|
||||
check_same_type<17>( get_param(np,CGAL::internal_np::sparse_linear_solver) );
|
||||
check_same_type<18>( get_param(np,CGAL::internal_np::weight_calculator) );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_np(
|
||||
// start with inherited named params
|
||||
CGAL::Polygon_mesh_processing::parameters::
|
||||
vertex_index_map(A<0>(0)).
|
||||
face_index_map(A<2>(2)).
|
||||
vertex_point_map(A<3>(3)).
|
||||
edge_is_constrained_map(A<12>(12)).
|
||||
// continue with PMP specific named params
|
||||
density_control_factor(A<14>(14)).
|
||||
use_delaunay_triangulation(A<15>(15)).
|
||||
fairing_continuity(A<16>(16)).
|
||||
sparse_linear_solver(A<17>(17)).
|
||||
weight_calculator(A<18>(18))
|
||||
);
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ WARN_IF_UNDOCUMENTED = false
|
|||
# macros to be used inside the code
|
||||
ALIASES += "cgalNamedParamsBegin=<dl class=\"params\"><dt>Named Parameters</dt><dd> <table class=\"params\">"
|
||||
ALIASES += "cgalNamedParamsEnd=</table> </dd> </dl>"
|
||||
ALIASES += "cgalParamBegin{1}=<tr><td class=\"paramname\">\ref PMP_\1 \"\1\"</td><td>"
|
||||
ALIASES += "cgalParamBegin{1}=<tr><td class=\"paramname\">\ref SM_\1 \"\1\"</td><td>"
|
||||
ALIASES += "cgalParamEnd=</td></tr>"
|
||||
|
||||
#macros for NamedParameters.txt
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
/*!
|
||||
\defgroup sm_namedparameters Named Parameters for Subdivision Methods
|
||||
\ingroup PkgSurfaceSubdivisionMethods3
|
||||
|
||||
In this package, all functions optional parameters are implemented as BGL optional
|
||||
named parameters (see \ref BGLNamedParameters for more information on how to use them).
|
||||
Since the parameters of the various functions defined in this package are redundant,
|
||||
their long descriptions are centralized below.
|
||||
The sequence of named parameters should start with `CGAL::parameters::`.
|
||||
`CGAL::parameters::all_default()` can be used to indicate
|
||||
that default values of optional named parameters must be used.
|
||||
|
||||
In the following, we assume that the type `PolygonMesh` is passed as template
|
||||
parameters of the functions, and is a model of the concept `MutableFaceGraph`.
|
||||
|
||||
The following named parameter, offered by the package \ref PkgBGLSummary
|
||||
(see \ref bgl_namedparameters), is used in this package:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{vertex_point_map} \anchor SM_vertex_point_map
|
||||
is the property map with the points associated to the vertices of the polygon mesh `pmesh`.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
`GeomTraits::Point_3` as value type. \n
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_point, pmesh) \endcode
|
||||
\cgalNPEnd
|
||||
\cgalNPTableEnd
|
||||
|
||||
In addition to this named parameter, this package offers the following named parameter:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{number_of_iterations} \anchor SM_number_of_iterations
|
||||
is the number of subdivision steps.\n
|
||||
<b>Type:</b> \c unsigned \c int \n
|
||||
<b>Default:</b> `1`
|
||||
\cgalNPEnd
|
||||
\cgalNPTableEnd
|
||||
|
||||
*/
|
||||
|
|
@ -26,6 +26,13 @@
|
|||
|
||||
\cgalClassifedRefPages
|
||||
|
||||
## Parameters ##
|
||||
|
||||
Optional parameters of the functions of this package
|
||||
are implemented as \ref BGLNamedParameters.
|
||||
The page \ref sm_namedparameters describes their usage
|
||||
and provides a list of the parameters that are used in this package.
|
||||
|
||||
## Concepts ##
|
||||
- `SubdivisionMask_3`
|
||||
- `PQQMask_3`
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ void PQQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
|||
*
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam Mask a model of `PQQMask_3`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param mask a geometry policy mask
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -114,11 +114,11 @@ void PTQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
|||
*
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam Mask a model of `PTQMask_3`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param mask a geometry policy mask
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -162,11 +162,11 @@ void DQQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
|||
*
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam Mask a model of `DQQMask_3`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param mask a geometry policy mask
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -214,11 +214,11 @@ void Sqrt3(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
|||
*
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam Mask a model of `Sqrt3Mask_3`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param mask a geometry policy mask
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
|
|||
|
|
@ -108,10 +108,10 @@ void CatmullClark_subdivision(PolygonMesh& pmesh, int step = 1) {
|
|||
* This function overwrites the control mesh `pmesh` with the subdivided mesh.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -155,10 +155,10 @@ void Loop_subdivision(PolygonMesh& pmesh, int step = 1) {
|
|||
* This function overwrites the control mesh `pmesh` with the subdivided mesh.
|
||||
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -200,10 +200,10 @@ void DooSabin_subdivision(PolygonMesh& pmesh, int step = 1) {
|
|||
* This function overwrites the control mesh `pmesh` with the subdivided mesh.
|
||||
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
@ -248,10 +248,10 @@ void Sqrt3_subdivision(PolygonMesh& pmesh, int step = 1) {
|
|||
* during a <em>single</em> call of this function.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
* @tparam NamedParameters a sequence of \ref namedparameters
|
||||
* @tparam NamedParameters a sequence of \ref sm_namedparameters "Named Parameters"
|
||||
*
|
||||
* @param pmesh a polygon mesh
|
||||
* @param np optional sequence of \ref namedparameters among the ones listed below
|
||||
* @param np optional sequence of \ref sm_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
|
||||
|
|
|
|||
|
|
@ -7,153 +7,53 @@ namespace Surface_mesh_simplification {
|
|||
Simplifies `surface_mesh` in-place by collapsing edges, and returns
|
||||
the number of edges effectively removed.
|
||||
|
||||
The function `Surface_mesh_simplification::edge_collapse` simplifies in-place a triangulated surface mesh by iteratively collapsing edges.
|
||||
@tparam TriangleMesh a model of `EdgeCollapsableSurfaceMesh`
|
||||
@tparam StopPolicy a model of `StopPredicate`
|
||||
@tparam NamedParameters a sequence of \ref sms_namedparameters "Named Parameters"
|
||||
|
||||
\cgalHeading{Non-Named Parameters}
|
||||
@param surface_mesh a triangle mesh
|
||||
@param should_stop the stop-condition policy
|
||||
@param np optional sequence of \ref sms_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
`surface_mesh` is the surface mesh to simplify.
|
||||
It must be a model of the `EdgeCollapsableSurfaceMesh` concept.
|
||||
\cgalNamedParamsBegin
|
||||
\cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of the mesh.
|
||||
If this parameter is omitted, an internal property map for
|
||||
`CGAL::vertex_point_t` should be available in `PolygonMesh`
|
||||
\cgalParamEnd
|
||||
|
||||
`should_stop` is the stop-condition policy.
|
||||
It must be a model of the `StopPredicate` concept.
|
||||
\cgalParamBegin{halfedge_index_map} the property map containing an index for each halfedge,
|
||||
initialized 0 to `num_halfedges(graph)`
|
||||
\cgalParamEnd
|
||||
|
||||
\cgalHeading{Named Parameters}
|
||||
\cgalParamBegin{get_cost}
|
||||
The policy which returns the collapse cost for an edge.
|
||||
\cgalParamEnd
|
||||
|
||||
`named_parameters` holds the list of all the additional parameters
|
||||
used by the `edge_collapse` function (including default parameters).
|
||||
\cgalParamBegin{get_placement}
|
||||
The policy which returns the placement (position of the replacemet vertex) for an edge.
|
||||
\cgalParamEnd
|
||||
|
||||
The named parameters list is a composition of function calls separated by a dot (\f$ .\f$) where
|
||||
the name of each function matches the name of an argument and wraps the actual parameter.
|
||||
\cgalParamBegin{edge_is_constrained_map}
|
||||
The property map containing the constrained-or-not status of each edge of `pmesh`
|
||||
\attention If this parameter is provided, `surface_mesh` must be a model of the
|
||||
`EdgeCollapsableSurfaceMeshWithConstraints` concept.
|
||||
\cgalParamEnd
|
||||
|
||||
This is an example with 2 arguments:
|
||||
\cgalParamBegin{visitor}
|
||||
The visitor that is called by the `edge_collapse` function
|
||||
in certain points to allow the user to track the simplification process.
|
||||
\cgalParamEnd
|
||||
|
||||
`get_cost(the_actual_cost).halfedge_index_map(the_actual_halfedge_index_map)`
|
||||
|
||||
`the_actual_cost` and `the_actual_halfedge_index_map` are
|
||||
the actual parameters, while `get_cost()` and `halfedge_index_map()`
|
||||
are wrapper functions used to designate each formal argument.
|
||||
|
||||
All named parameters have default values so you only need to compose those for which the default
|
||||
is inappropriate. Furthermore, since each actual parameter is wrapped in a function whose name
|
||||
designates the formal argument, the order of named parameters in the list is totally irrelevant.
|
||||
|
||||
In the following subsections, each named parameter is documented as a helper function. The argument to each helper
|
||||
function is the actual parameter to `edge_collapse()`, while the name of the helper
|
||||
function designates which formal argument it is.
|
||||
|
||||
\cgalHeading{vertex_point_map(VertexPointMap vpm)}
|
||||
|
||||
Maps each vertex in the surface mesh into a 3D \cgal point.
|
||||
|
||||
`VertexPointMap` must be a model of
|
||||
`ReadWritePropertyMap`
|
||||
with key type
|
||||
`boost::graph_traits<EdgeCollapsableSurfaceMesh const>::%vertex_descriptor`
|
||||
and with any model of `Kernel::Point_3` as value type.
|
||||
|
||||
<B>%Default</B>: the property map obtained by calling `get(CGAL::vertex_point,surface_mesh)`,
|
||||
|
||||
|
||||
\cgalHeading{halfedge_index_map(HalfedgeIndexMap eim)}
|
||||
|
||||
Maps each halfedge in the surface mesh into an unsigned integer number
|
||||
in the range `[0,num_halfedges(surface_mesh))`.
|
||||
|
||||
`HalfedgeIndexMap` must be a model of
|
||||
`ReadablePropertyMap` with key type
|
||||
`boost::graph_traits<EdgeCollapsableSurfaceMesh const>::%halfedge_descriptor`
|
||||
and with value type
|
||||
`boost::graph_traits<EdgeCollapsableSurfaceMesh>::%size_type`
|
||||
|
||||
<B>%Default</B>: the property map obtained by calling `get(CGAL::halfedge_index,surface_mesh)`,
|
||||
which requires the surface mesh edges to have an `id()` member properly initialized to the
|
||||
require value.
|
||||
|
||||
If the edges don't have such an `id()`, you must pass some property map explicitly.
|
||||
An external property map can be easily obtained by calling
|
||||
`get(CGAL::halfedge_external_index,surface_mesh)`. This constructs on the fly, and returns,
|
||||
a property map which non-intrusively associates a proper id with each edge.
|
||||
|
||||
|
||||
\cgalHeading{edge_is_constrained_map(EdgeIsConstrainedMap ecm)}
|
||||
|
||||
Maps each edge in the surface mesh into a Boolean value
|
||||
which indicates if the edge is constrained.
|
||||
`EdgeIsConstrainedMap` must be a model
|
||||
`ReadablePropertyMap` with key type
|
||||
`boost::graph_traits<EdgeCollapsableSurfaceMesh const>::%edge_descriptor`
|
||||
and with value type `bool`.
|
||||
|
||||
\attention If this parameter is provided, `surface_mesh` must be a model of the
|
||||
`EdgeCollapsableSurfaceMeshWithConstraints` concept.
|
||||
|
||||
<B>%Default</B>: A property map always returning `false`, that is no edge is constrained.
|
||||
|
||||
\cgalHeading{get_cost(GetCost gc)}
|
||||
|
||||
The policy which returns the collapse cost for an edge.
|
||||
|
||||
The type of `gc` must be a model of the `GetCost` concept.
|
||||
|
||||
<B>%Default</B>:
|
||||
`CGAL::Surface_mesh_simplification::LindstromTurk_cost<EdgeCollapsableSurfaceMesh>`.
|
||||
|
||||
\cgalHeading{get_placement(GetPlacement gp)}
|
||||
|
||||
The policy which returns the placement (position of the replacemet vertex)
|
||||
for an edge.
|
||||
|
||||
The type of `gp` must be a model of the `GetPlacement` concept.
|
||||
|
||||
<B>%Default</B>:
|
||||
`CGAL::Surface_mesh_simplification::LindstromTurk_placement<EdgeCollapsableSurfaceMesh>`
|
||||
|
||||
\cgalHeading{visitor(EdgeCollapseSimplificationVisitor v)}
|
||||
|
||||
The visitor that is called by the `edge_collapse` function
|
||||
in certain points to allow the user to track the simplification process.
|
||||
|
||||
The type of `v` must be a model of the `EdgeCollapseSimplificationVisitor` concept.
|
||||
|
||||
<B>%Default: an implementation-defined dummy visitor</B>.
|
||||
|
||||
If you wish to provide your own visitor, you can derive from:
|
||||
`CGAL::Surface_mesh_simplification::Edge_collapse_visitor_base<EdgeCollapsableSurfaceMesh>`
|
||||
and override only the callbacks you are interested in.
|
||||
|
||||
All these functions naming parameters are defined in
|
||||
`namespace CGAL`. Being non-member functions, they could clash
|
||||
with equally named functions in some other namespace. If that happens,
|
||||
simply qualify the <I>first</I>
|
||||
\cgalFootnote{The second and subsequent named parameters shall not be qualified as they are member functions}
|
||||
named parameter with `CGAL::`, as shown in the examples in the user manual.
|
||||
|
||||
\cgalHeading{vertex_index_map(VertexIndexMap vpm)}
|
||||
\cgalDebugBegin
|
||||
This parameter is only used by debug functions and is usually not needed for users.
|
||||
|
||||
Maps each vertex in the surface mesh into an unsigned integer number
|
||||
in the range `[0,num_vertices(surface_mesh))`.
|
||||
|
||||
`VertexIndexMap` must be a model of
|
||||
`ReadablePropertyMap`
|
||||
with key type
|
||||
`boost::graph_traits<EdgeCollapsableSurfaceMesh const>::%vertex_descriptor`
|
||||
and with value type `boost::graph_traits<EdgeCollapsableSurfaceMesh>::%size_type`,
|
||||
|
||||
<B>%Default</B>: the property map obtained by calling `get(CGAL::vertex_index,surface_mesh)`,
|
||||
which requires the surface mesh vertices to have an `id()` member properly initialized to the
|
||||
required value.
|
||||
|
||||
If the vertices don't have such an `id()`, you must pass some property map explicitly.
|
||||
An external property map can be easily obtained by calling
|
||||
`get(CGAL::vertex_external_index,surface_mesh)`. This constructs on the fly, and returns,
|
||||
a property map which non-intrusively associates a proper id with each vertex.
|
||||
\cgalDebugEnd
|
||||
\cgalParamBegin{vertex_index_map}
|
||||
is the property map containing the index of each vertex of the input polygon mesh.
|
||||
\cgalDebugBegin
|
||||
This parameter is only used by debug functions and is usually not needed for users.
|
||||
\cgalDebugEnd
|
||||
\cgalParamEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
\cgalHeading{Semantics}
|
||||
|
||||
|
||||
The simplification process continues until the `should_stop` policy returns `true`
|
||||
or the surface mesh cannot be simplified any further due to topological constraints.
|
||||
|
||||
|
|
@ -163,14 +63,11 @@ and the remaining vertex is re-positioned.
|
|||
|
||||
`visitor` is used to keep track of the simplification process. It has several member functions which
|
||||
are called at certain points in the simplification code.
|
||||
|
||||
*/
|
||||
|
||||
template<class EdgeCollapsableSurfaceMesh,class StopPredicate, class P, class T, class R>
|
||||
int edge_collapse ( EdgeCollapsableSurfaceMesh& surface_mesh
|
||||
, StopPredicate const& should_stop
|
||||
, sms_named_params<P,T,R> const& named_parameters
|
||||
) ;
|
||||
template<class TriangleMesh, class StopPolicy, class NamedParameters>
|
||||
int edge_collapse(TriangleMesh& surface_mesh,
|
||||
const StopPolicy& should_stop,
|
||||
const NamedParameters& np);
|
||||
|
||||
} /* namespace Surface_mesh_simplification */
|
||||
} /* namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}
|
||||
|
||||
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Triangulated Surface Mesh Simplification"
|
||||
|
||||
# macros to be used inside the code
|
||||
ALIASES += "cgalNamedParamsBegin=<dl class=\"params\"><dt>Named Parameters</dt><dd> <table class=\"params\">"
|
||||
ALIASES += "cgalNamedParamsEnd=</table> </dd> </dl>"
|
||||
ALIASES += "cgalParamBegin{1}=<tr><td class=\"paramname\">\ref SMS_\1 \"\1\"</td><td>"
|
||||
ALIASES += "cgalParamEnd=</td></tr>"
|
||||
|
||||
#macros for NamedParameters.txt
|
||||
ALIASES += "cgalNPTableBegin=<dl class=\"params\"><dt></dt><dd> <table class=\"params\">"
|
||||
ALIASES += "cgalNPTableEnd=</table> </dd> </dl>"
|
||||
ALIASES += "cgalNPBegin{1}=<tr><td class=\"paramname\">\1 </td><td>"
|
||||
ALIASES += "cgalNPEnd=</td></tr>"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
/*!
|
||||
\defgroup sms_namedparameters Named Parameters for Surface Mesh Simplification
|
||||
\ingroup PkgSurfaceMeshSimplification
|
||||
|
||||
In this package, some optional parameters are implemented as BGL optional
|
||||
named parameters (see \ref BGLNamedParameters for more information on how to use them).
|
||||
|
||||
The named parameters list is a composition of function calls separated by a dot (\f$ .\f$) where
|
||||
the name of each function matches the name of an argument and wraps the actual parameter.
|
||||
The sequence of named parameters should start with `CGAL::parameters::`.
|
||||
|
||||
This is an example with 2 arguments:
|
||||
|
||||
\code
|
||||
`CGAL::parameters::get_cost(the_actual_cost).halfedge_index_map(the_actual_halfedge_index_map)`
|
||||
\endcode
|
||||
|
||||
`the_actual_cost` and `the_actual_halfedge_index_map` are
|
||||
the actual parameters, while `get_cost()` and `halfedge_index_map()`
|
||||
are wrapper functions used to designate each formal argument.
|
||||
|
||||
All named parameters have default values so you only need to compose those for which the default
|
||||
is inappropriate. Furthermore, since each actual parameter is wrapped in a function whose name
|
||||
designates the formal argument, the order of named parameters in the list is totally irrelevant.
|
||||
|
||||
In the following, we assume that the type `TriangleMesh` is passed as template
|
||||
parameters of the functions, and is a model of the concept `MutableFaceGraph`.
|
||||
|
||||
The following named parameters, offered by the package \ref PkgBGLSummary
|
||||
(see \ref bgl_namedparameters), are used in this package:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{vertex_point_map} \anchor SMS_vertex_point_map
|
||||
is the property map with the points associated to the vertices of the polygon mesh `pmesh`.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key type and
|
||||
`GeomTraits::Point_3` as value type. \n
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_point, pmesh) \endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{vertex_index_map} \anchor SMS_vertex_index_map
|
||||
is the property map containing the index of each vertex of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key type and the value type
|
||||
\code typename boost::property_traits<typename boost::property_map<TriangleMesh, CGAL::vertex_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> \code boost::get(CGAL::vertex_index, pmesh)\endcode
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{halfedge_index_map} \anchor SMS_halfedge_index_map
|
||||
is the property map containing the index of each halfedge of the input polygon mesh.\n
|
||||
<b>Type:</b> a class model of `ReadablePropertyMap` with
|
||||
`boost::graph_traits<TriangleMesh>::%halfedge_descriptor` as key type and the value type:
|
||||
\code typename boost::property_traits<typename boost::property_map<TriangleMesh, CGAL::halfedge_index_t>::type>::value_type \endcode
|
||||
<b>Default:</b> the property map obtained by calling `get(CGAL::halfedge_index,surface_mesh)`,
|
||||
which requires the surface mesh edges to have an `id()` member properly initialized to the
|
||||
require value. If the edges don't have such an `id()`, a property map must be passed explicitly.
|
||||
An external property map can be easily obtained by calling
|
||||
`get(CGAL::halfedge_external_index,surface_mesh)`. This constructs on the fly, and returns,
|
||||
a property map which non-intrusively associates a proper id with each edge.
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{edge_is_constrained_map} \anchor SMS_edge_is_constrained_map
|
||||
is the property map containing information about edges of the input polygon mesh
|
||||
being marked or not.\n
|
||||
<b>Type:</b> a class model of `ReadWritePropertyMap` with
|
||||
`boost::graph_traits<TriangleMesh>::%edge_descriptor` as key type and
|
||||
`bool` as value type. It should be default constructible.\n
|
||||
<b>Default:</b> a default property map where no edge is constrained
|
||||
\cgalNPEnd
|
||||
\cgalNPTableEnd
|
||||
|
||||
In addition to these named parameters, this package offers the following named parameters:
|
||||
|
||||
\cgalNPTableBegin
|
||||
\cgalNPBegin{get_cost} \anchor SMS_get_cost
|
||||
is the policy which returns the collapse cost for an edge.\n
|
||||
<b>Type:</b> a model of the concept `GetCost`\n
|
||||
<b>Default:</b> The cost policy `CGAL::Surface_mesh_simplification::LindstromTurk_cost<EdgeCollapsableSurfaceMesh>`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{get_placement} \anchor SMS_get_placement
|
||||
is the policy which returns the placement (position of the replacemet vertex) for an edge.\n
|
||||
<b>Type:</b> a model of the concept `GetPlacement`\n
|
||||
<b>Default:</b> The cost policy `CGAL::Surface_mesh_simplification::LindstromTurk_placement<EdgeCollapsableSurfaceMesh>`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{visitor} \anchor SMS_visitor
|
||||
is the visitor that is called by the `edge_collapse()` function in certain points
|
||||
to allow the user to track the simplification process.being marked or not.
|
||||
If you wish to provide your own visitor, you can derive from:
|
||||
`CGAL::Surface_mesh_simplification::Edge_collapse_visitor_base<EdgeCollapsableSurfaceMesh>`
|
||||
and override only the callbacks you are interested in.\n
|
||||
<b>Type:</b> user specific\n
|
||||
<b>Default:</b> an implementation-defined dummy visitor
|
||||
\cgalNPEnd
|
||||
\cgalNPTableEnd
|
||||
*/
|
||||
Loading…
Reference in New Issue