mirror of https://github.com/CGAL/cgal
document named parameters for all functions in which they are implemented
This commit is contained in:
parent
cc78b0c136
commit
11b8f5ca72
|
|
@ -16,12 +16,14 @@ and a `Kernel` in which constructions are performed and predicates evaluated.
|
|||
`boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and
|
||||
`Kernel::Point_3` as value type.
|
||||
|
||||
<li> `use_delaunay_triangulation`. A boolean. If `true`, use the Delaunay triangulation facet search space.
|
||||
<li> `use_delaunay_triangulation`. A boolean. If `true`, use the Delaunay triangulation facet search space. Its default value is `true`.
|
||||
|
||||
<li>
|
||||
<li> `density_control_factor`. A floating scalar value which controls the density of the mesh generated by refinement. Its default value is `CGAL::sqrt(2)`.
|
||||
|
||||
<li> `fairing_continuity`. An unsigned integer which controls the tangential continuity of the output surface for fairing. The possible values are 0, 1 and 2, refering to the C^0, C^1 and C^2 continuity. The default value is 1.
|
||||
|
||||
<li> `sparse_linear_solver`. An instance of the sparse linear solver used for fairing. It defaults to the Eigen solver ***
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
|
@ -73,23 +73,30 @@ namespace internal {
|
|||
\endcode
|
||||
@tparam PolygonMesh a model of `FaceGraph`
|
||||
@tparam VertexRange a range of vertex descriptors of `PolygonMesh`, model of `SinglePassRange`
|
||||
@tparam NamedParameters a sequence of \ref namedparameters
|
||||
|
||||
@param pmesh the polygon 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 solver an instance of the sparse linear solver to use.
|
||||
@param continuity continuity at the patch boundary (0, 1 and 2 are the possible values)
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
|
||||
\b Named \b parameters
|
||||
<ul>
|
||||
<li>\b vertex_point_map the property map with the points associated to the vertices of `pmesh`
|
||||
<li>\b fairing_continuity tangential continuity of the output surface patch
|
||||
<li>\b sparse_linear_solver an instance of the sparse linear solver used for fairing
|
||||
</ul>
|
||||
|
||||
@return `true` if fairing is successful, otherwise no vertex position is changed
|
||||
|
||||
\todo SUBMISSION: missing VertexPointMap
|
||||
\todo code: missing VertexPointMap
|
||||
@todo accuracy of solvers are not good, for example when there is no boundary condition pre_factor should fail, but it does not.
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename VertexRange,
|
||||
class P, class T, class R>
|
||||
typename NamedParameters>
|
||||
bool fair(PolygonMesh& pmesh,
|
||||
VertexRange vertices,
|
||||
const pmp_bgl_named_params<P, T, R>& p)
|
||||
const NamedParameters& np)
|
||||
{
|
||||
using boost::get_param;
|
||||
using boost::choose_param;
|
||||
|
|
@ -107,9 +114,9 @@ namespace internal {
|
|||
#endif
|
||||
|
||||
return internal::fair(pmesh, vertices,
|
||||
choose_param(get_param(p, sparse_linear_solver), Default_solver()),
|
||||
choose_param(get_param(p, weight_calculator), Default_Weight_calculator(pmesh)),
|
||||
choose_param(get_param(p, fairing_continuity), 1)
|
||||
choose_param(get_param(np, sparse_linear_solver), Default_solver()),
|
||||
choose_param(get_param(np, weight_calculator), Default_Weight_calculator(pmesh)),
|
||||
choose_param(get_param(np, fairing_continuity), 1)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,34 +39,37 @@ 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
|
||||
|
||||
@param pmesh polygon 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 put
|
||||
@param vertices_out output iterator into which descriptors of new vertices are put
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
|
||||
The function accepts named parameters
|
||||
- `CGAL::parameters::density_control_factor` which defaults to `CGAL::sqrt(2.)`
|
||||
|
||||
@param density_control_factor factor for density where larger values cause denser refinements
|
||||
\b Named \b parameters
|
||||
<ul>
|
||||
<li>\b vertex_point_map the property map with the points associated to the vertices of `pmesh`
|
||||
<li>\b density_control_factor factor for density where larger values cause denser refinements
|
||||
</ul>
|
||||
|
||||
@return pair of `faces_out` and `vertices_out`
|
||||
|
||||
\todo SUBMISSION: missing VertexPointMap
|
||||
\todo code: missing VertexPointMap
|
||||
\todo SUBMISSION: better document density_control_factor
|
||||
@todo current algorithm iterates 10 times at most, since (I guess) there is no termination proof.
|
||||
*/
|
||||
template<class PolygonMesh,
|
||||
class FaceRange,
|
||||
class FaceOutputIterator,
|
||||
class VertexOutputIterator,
|
||||
class P, class T, class R>
|
||||
template<typename PolygonMesh,
|
||||
typename FaceRange,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator,
|
||||
typename NamedParameters>
|
||||
std::pair<FaceOutputIterator, VertexOutputIterator>
|
||||
refine(PolygonMesh& pmesh,
|
||||
FaceRange faces,
|
||||
FaceOutputIterator faces_out,
|
||||
VertexOutputIterator vertices_out,
|
||||
const pmp_bgl_named_params<P, T, R>& p)
|
||||
const NamedParameters& np)
|
||||
{
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
|
|
@ -75,7 +78,7 @@ namespace Polygon_mesh_processing {
|
|||
refine_functor.refine(faces,
|
||||
faces_out,
|
||||
vertices_out,
|
||||
choose_param(get_param(p, density_control_factor), CGAL::sqrt(2.)));
|
||||
choose_param(get_param(np, density_control_factor), CGAL::sqrt(2.)));
|
||||
return std::make_pair(faces_out, vertices_out);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,47 +110,54 @@ 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
|
||||
|
||||
@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 density_control_factor factor for density where larger values cause denser refinements
|
||||
@param use_delaunay_triangulation if `true`, use the Delaunay triangulation face search space
|
||||
@param np optional sequence of \ref namedparameters among the ones listed below
|
||||
|
||||
\b Named \b parameters
|
||||
<ul>
|
||||
<li>\b vertex_point_map the property map with the points associated to the vertices of `pmesh`
|
||||
<li>\b density_control_factor factor for density where larger values cause denser refinements
|
||||
<li>\b use_delaunay_triangulation if `true`, use the Delaunay triangulation facet search space
|
||||
</ul>
|
||||
|
||||
@return pair of `face_out` and `vertex_out`
|
||||
|
||||
\sa CGAL::Polygon_mesh_processing::triangulate_hole()
|
||||
\sa CGAL::Polygon_mesh_processing::refine()
|
||||
|
||||
\todo SUBMISSION: VertexPointMap
|
||||
\todo code: VertexPointMap
|
||||
\todo SUBMISSION: better document density_control_factor (ideally we should refer to the doc of refine)
|
||||
\todo handle islands
|
||||
*/
|
||||
template<class PolygonMesh,
|
||||
class FaceOutputIterator,
|
||||
class VertexOutputIterator,
|
||||
class P, class T, class R>
|
||||
template<typename PolygonMesh,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator,
|
||||
typename NamedParameters>
|
||||
std::pair<FaceOutputIterator, VertexOutputIterator>
|
||||
triangulate_and_refine_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
FaceOutputIterator face_out,
|
||||
VertexOutputIterator vertex_out,
|
||||
const pmp_bgl_named_params<P, T, R>& p)
|
||||
const NamedParameters& np)
|
||||
{
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
|
||||
std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor> patch;
|
||||
triangulate_hole(pmesh, border_halfedge, std::back_inserter(patch), p);
|
||||
triangulate_hole(pmesh, border_halfedge, std::back_inserter(patch), np);
|
||||
face_out = std::copy(patch.begin(), patch.end(), face_out);
|
||||
|
||||
return refine(pmesh, patch, face_out, vertex_out, p);
|
||||
return refine(pmesh, patch, face_out, vertex_out, np);
|
||||
}
|
||||
|
||||
template<class PolygonMesh,
|
||||
class FaceOutputIterator,
|
||||
class VertexOutputIterator>
|
||||
template<typename PolygonMesh,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator>
|
||||
std::pair<FaceOutputIterator, VertexOutputIterator>
|
||||
triangulate_and_refine_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
|
|
@ -184,16 +191,22 @@ 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
|
||||
|
||||
@param pmesh a polygon mesh which has the hole
|
||||
@param pmesh polygon mesh which has the hole
|
||||
@param border_halfedge a border halfedge incident to the hole
|
||||
@param face_out iterator over patch faces
|
||||
@param vertex_out iterator over patch vertices without including the boundary
|
||||
@param density_control_factor factor for density where larger values cause denser refinements
|
||||
@param continuity tangential continuity, defaults to `FAIRING_C_1` and can be omitted
|
||||
@param use_delaunay_triangulation if `true`, the Delaunay triangulation face search space is used
|
||||
@param solver an instance of the sparse linear solver to use. It defaults to the
|
||||
default construtor of the `SparseLinearSolver` template parameter
|
||||
@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
|
||||
|
||||
\b Named \b parameters
|
||||
<ul>
|
||||
<li>\b vertex_point_map the property map with the points associated to the vertices of `pmesh`
|
||||
<li>\b use_delaunay_triangulation if `true`, use the Delaunay triangulation facet search space
|
||||
<li>\b density_control_factor factor for density where larger values cause denser refinements
|
||||
<li>\b fairing_continuity tangential continuity of the output surface patch
|
||||
<li>\b sparse_linear_solver an instance of the sparse linear solver used for fairing
|
||||
</ul>
|
||||
|
||||
@return tuple of
|
||||
- bool: `true` if fairing is successful
|
||||
|
|
@ -205,25 +218,25 @@ namespace Polygon_mesh_processing {
|
|||
\sa CGAL::Polygon_mesh_processing::fair()
|
||||
|
||||
\todo handle islands
|
||||
\todo SUBMISSION: VertexPointMap
|
||||
\todo code: VertexPointMap
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator,
|
||||
class P, class T, class R>
|
||||
typename NamedParameters>
|
||||
CGAL::cpp11::tuple<bool, FaceOutputIterator, VertexOutputIterator>
|
||||
triangulate_refine_and_fair_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
FaceOutputIterator face_out,
|
||||
VertexOutputIterator vertex_out,
|
||||
const pmp_bgl_named_params<P, T, R>& p)
|
||||
const NamedParameters& np)
|
||||
{
|
||||
std::vector<typename boost::graph_traits<PolygonMesh>::vertex_descriptor> patch;
|
||||
|
||||
face_out = triangulate_and_refine_hole
|
||||
(pmesh, border_halfedge, face_out, std::back_inserter(patch), p).first;
|
||||
(pmesh, border_halfedge, face_out, std::back_inserter(patch), np).first;
|
||||
|
||||
bool fair_success = fair(pmesh, patch, p);
|
||||
bool fair_success = fair(pmesh, patch, np);
|
||||
|
||||
vertex_out = std::copy(patch.begin(), patch.end(), vertex_out);
|
||||
return CGAL::cpp11::make_tuple(fair_success, face_out, vertex_out);
|
||||
|
|
|
|||
Loading…
Reference in New Issue