mirror of https://github.com/CGAL/cgal
Merge pull request #7094 from afabri/PMP_named_parameters-GF
PMP: Replace parameter with named parameter
This commit is contained in:
commit
f1e1878b8d
|
|
@ -473,8 +473,7 @@ int main (int argc, char** argv)
|
|||
// Fill all holes except the bigest (which is the outer hull of the mesh)
|
||||
for (Mesh::Halfedge_index hi : holes)
|
||||
if (hi != outer_hull)
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(dtm_mesh, hi, CGAL::Emptyset_iterator(), CGAL::Emptyset_iterator());
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole (dtm_mesh, hi);
|
||||
|
||||
// Save DTM with holes filled
|
||||
std::ofstream dtm_filled_ofile ("dtm_filled.ply", std::ios_base::binary);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ Release date: June 2023
|
|||
|
||||
### [Polygon Mesh Processing](https://doc.cgal.org/5.6/Manual/packages.html#PkgPolygonMeshProcessing)
|
||||
|
||||
- **Breaking change**: Deprecated the overloads of functions `CGAL::Polygon_mesh_processing::triangulate_hole()`,
|
||||
`CGAL::Polygon_mesh_processing::triangulate_and_refine_hole()`, and `CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole()`
|
||||
which have output iterators for vertices and faces as parameter. They are replaced by overloads with two additional named parameters.
|
||||
|
||||
- Added the function `CGAL::Polygon_mesh_processing::surface_Delaunay_remeshing()`, that remeshes a surface triangle mesh following the
|
||||
CGAL tetrahedral Delaunay refinement algorithm.
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ int main(int argc, char* argv[])
|
|||
std::vector<Vertex_handle> patch_vertices;
|
||||
bool success = std::get<0>(PMP::triangulate_refine_and_fair_hole(poly,
|
||||
h,
|
||||
std::back_inserter(patch_facets),
|
||||
std::back_inserter(patch_vertices),
|
||||
CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, poly))
|
||||
CGAL::parameters::face_output_iterator(std::back_inserter(patch_facets))
|
||||
.vertex_output_iterator(std::back_inserter(patch_vertices))
|
||||
.vertex_point_map(get(CGAL::vertex_point, poly))
|
||||
.geom_traits(Kernel())));
|
||||
|
||||
std::cout << " Number of facets in constructed patch: " << patch_facets.size() << std::endl;
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ int main(int argc, char* argv[])
|
|||
std::vector<vertex_descriptor> patch_vertices;
|
||||
bool success = std::get<0>(PMP::triangulate_refine_and_fair_hole(mesh,
|
||||
h,
|
||||
std::back_inserter(patch_facets),
|
||||
std::back_inserter(patch_vertices),
|
||||
CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh))
|
||||
CGAL::parameters::face_output_iterator(std::back_inserter(patch_facets))
|
||||
.vertex_output_iterator(std::back_inserter(patch_vertices))
|
||||
.vertex_point_map(get(CGAL::vertex_point, mesh))
|
||||
.geom_traits(Kernel())));
|
||||
|
||||
std::cout << "* Number of facets in constructed patch: " << patch_facets.size() << std::endl;
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ int main(int argc, char* argv[])
|
|||
std::vector<face_descriptor> patch_facets;
|
||||
std::vector<vertex_descriptor> patch_vertices;
|
||||
bool success = std::get<0>(PMP::triangulate_refine_and_fair_hole(mesh, h,
|
||||
std::back_inserter(patch_facets),
|
||||
std::back_inserter(patch_vertices),
|
||||
CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh))
|
||||
CGAL::parameters::face_output_iterator(std::back_inserter(patch_facets))
|
||||
.vertex_output_iterator(std::back_inserter(patch_vertices))
|
||||
.vertex_point_map(get(CGAL::vertex_point, mesh))
|
||||
.geom_traits(Kernel())));
|
||||
|
||||
assert(CGAL::is_valid_polygon_mesh(mesh));
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ int main(int argc, char* argv[])
|
|||
std::vector<vertex_descriptor> patch_vertices;
|
||||
bool success = std::get<0>(PMP::triangulate_refine_and_fair_hole(mesh,
|
||||
h,
|
||||
std::back_inserter(patch_facets),
|
||||
std::back_inserter(patch_vertices)));
|
||||
CGAL::parameters::face_output_iterator(std::back_inserter(patch_facets))
|
||||
.vertex_output_iterator(std::back_inserter(patch_vertices))));
|
||||
|
||||
std::cout << "* Number of facets in constructed patch: " << patch_facets.size() << std::endl;
|
||||
std::cout << " Number of vertices in constructed patch: " << patch_vertices.size() << std::endl;
|
||||
|
|
|
|||
|
|
@ -160,23 +160,17 @@ int main(int argc, char* argv[])
|
|||
!is_small_hole(h, mesh, max_hole_diam, max_num_hole_edges))
|
||||
continue;
|
||||
|
||||
std::vector<face_descriptor> patch_facets;
|
||||
std::vector<vertex_descriptor> patch_vertices;
|
||||
Progress progress(10.0);
|
||||
bool success = false;
|
||||
|
||||
try {
|
||||
success = std::get<0>(PMP::triangulate_refine_and_fair_hole(mesh,
|
||||
h,
|
||||
std::back_inserter(patch_facets),
|
||||
std::back_inserter(patch_vertices),
|
||||
CGAL::parameters::visitor(std::ref(progress)).use_delaunay_triangulation(true)));
|
||||
}
|
||||
catch (const Stop&) {
|
||||
std::cout << "We stopped with a timeout" << std::endl;
|
||||
}
|
||||
std::cout << "* Number of facets in constructed patch: " << patch_facets.size() << std::endl;
|
||||
std::cout << " Number of vertices in constructed patch: " << patch_vertices.size() << std::endl;
|
||||
std::cout << " Is fairing successful: " << success << std::endl;
|
||||
++nb_holes;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,19 +70,25 @@ namespace Polygon_mesh_processing {
|
|||
must not intersect the surface. Otherwise, additionally, the boundary
|
||||
of the hole must not contain any non-manifold vertex. The patch generated does not
|
||||
introduce non-manifold edges nor degenerate triangles. If a hole cannot be triangulated,
|
||||
`pmesh` is not modified and nothing is recorded in `out`.
|
||||
`pmesh` is not modified and nothing is recorded in the face output
|
||||
iterator.
|
||||
|
||||
@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 bgl_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 an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
|
||||
\cgalParamNBegin{face_output_iterator}
|
||||
\cgalParamDescription{iterator over patch faces}
|
||||
\cgalParamType{a model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%face_descriptor` for patch faces}
|
||||
\cgalParamDefault{`Emptyset_iterator`}
|
||||
\cgalParamNEnd
|
||||
|
||||
\cgalParamNBegin{vertex_point_map}
|
||||
\cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
\cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
|
|
@ -145,7 +151,7 @@ namespace Polygon_mesh_processing {
|
|||
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
@return `out`
|
||||
@return the face output iterator
|
||||
|
||||
\todo handle islands
|
||||
@todo Replace border_halfedge by a range of border halfedges.
|
||||
|
|
@ -156,19 +162,23 @@ namespace Polygon_mesh_processing {
|
|||
@todo handle the case where an island is reduced to a point
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename OutputIterator,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
OutputIterator
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
auto
|
||||
triangulate_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
OutputIterator out,
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
using parameters::get_parameter_reference;
|
||||
|
||||
typedef typename GetGeomTraits<PolygonMesh,NamedParameters>::type GeomTraits;
|
||||
typedef typename GetGeomTraits<PolygonMesh,CGAL_NP_CLASS>::type GeomTraits;
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::face_output_iterator_t,
|
||||
CGAL_NP_CLASS,
|
||||
Emptyset_iterator>::type Face_output_iterator;
|
||||
|
||||
Face_output_iterator out = choose_parameter<Emptyset_iterator>(get_parameter(np, internal_np::face_output_iterator));
|
||||
|
||||
bool use_dt3 =
|
||||
#ifdef CGAL_HOLE_FILLING_DO_NOT_USE_DT3
|
||||
|
|
@ -210,37 +220,77 @@ namespace Polygon_mesh_processing {
|
|||
|
||||
Hole_filling::Default_visitor default_visitor;
|
||||
|
||||
return internal::triangulate_hole_polygon_mesh(
|
||||
pmesh,
|
||||
border_halfedge,
|
||||
out,
|
||||
choose_parameter(get_parameter(np, internal_np::vertex_point), get_property_map(vertex_point, pmesh)),
|
||||
use_dt3,
|
||||
choose_parameter<GeomTraits>(get_parameter(np, internal_np::geom_traits)),
|
||||
use_cdt,
|
||||
choose_parameter(get_parameter(np, internal_np::do_not_use_cubic_algorithm), false),
|
||||
choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor),
|
||||
max_squared_distance).first;
|
||||
return
|
||||
internal::triangulate_hole_polygon_mesh(
|
||||
pmesh,
|
||||
border_halfedge,
|
||||
out,
|
||||
choose_parameter(get_parameter(np, internal_np::vertex_point), get_property_map(vertex_point, pmesh)),
|
||||
use_dt3,
|
||||
choose_parameter<GeomTraits>(get_parameter(np, internal_np::geom_traits)),
|
||||
use_cdt,
|
||||
choose_parameter(get_parameter(np, internal_np::do_not_use_cubic_algorithm), false),
|
||||
choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor),
|
||||
max_squared_distance).first;
|
||||
}
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
/*!
|
||||
\ingroup PMP_hole_filling_grp
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.6 and the
|
||||
overload with the named parameter `face_output_iterator` should be
|
||||
used instead.
|
||||
|
||||
\brief triangulates a hole in a polygon mesh.
|
||||
|
||||
|
||||
@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 bgl_namedparameters "Named Parameters"
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename OutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED
|
||||
OutputIterator
|
||||
triangulate_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
OutputIterator out,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return triangulate_hole(pmesh, border_halfedge,np.face_output_iterator(out));
|
||||
}
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PMP_hole_filling_grp
|
||||
@brief triangulates and refines a hole in a polygon mesh.
|
||||
|
||||
@tparam PolygonMesh must be model of `MutableFaceGraph`
|
||||
@tparam FacetOutputIterator model of `OutputIterator`
|
||||
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 bgl_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 an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
|
||||
\cgalParamNBegin{face_output_iterator}
|
||||
\cgalParamDescription{iterator over patch faces}
|
||||
\cgalParamType{a model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%face_descriptor` for patch faces}
|
||||
\cgalParamDefault{`Emptyset_iterator`}
|
||||
\cgalParamNEnd
|
||||
|
||||
\cgalParamNBegin{vertex_output_iterator}
|
||||
\cgalParamDescription{iterator over patch vertices}
|
||||
\cgalParamType{a model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%vertex_descriptor` for patch vertices}
|
||||
\cgalParamDefault{`Emptyset_iterator`}
|
||||
\cgalParamNEnd
|
||||
|
||||
\cgalParamNBegin{vertex_point_map}
|
||||
\cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
\cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
|
|
@ -309,61 +359,116 @@ namespace Polygon_mesh_processing {
|
|||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
@return pair of `face_out` and `vertex_out`
|
||||
@return pair of face and vertex output iterator
|
||||
|
||||
\sa CGAL::Polygon_mesh_processing::triangulate_hole()
|
||||
\sa CGAL::Polygon_mesh_processing::refine()
|
||||
|
||||
\todo handle islands
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
auto
|
||||
triangulate_and_refine_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
using parameters::get_parameter_reference;
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::face_output_iterator_t,
|
||||
CGAL_NP_CLASS,
|
||||
Emptyset_iterator>::type Face_output_iterator;
|
||||
|
||||
Face_output_iterator face_out = choose_parameter<Emptyset_iterator>(get_parameter(np, internal_np::face_output_iterator));
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::vertex_output_iterator_t,
|
||||
CGAL_NP_CLASS,
|
||||
Emptyset_iterator>::type Vertex_output_iterator;
|
||||
|
||||
Vertex_output_iterator vertex_out = choose_parameter<Emptyset_iterator>(get_parameter(np, internal_np::vertex_output_iterator));
|
||||
|
||||
std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor> patch;
|
||||
triangulate_hole(pmesh, border_halfedge, np.face_output_iterator(std::back_inserter(patch)));
|
||||
face_out = std::copy(patch.begin(), patch.end(), face_out);
|
||||
|
||||
Hole_filling::Default_visitor default_visitor;
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::visitor_t,
|
||||
CGAL_NP_CLASS,
|
||||
Hole_filling::Default_visitor>::reference Visitor;
|
||||
|
||||
Visitor visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor);
|
||||
visitor.start_refine_phase();
|
||||
std::pair<Face_output_iterator, Vertex_output_iterator> res = refine(pmesh, patch, face_out, vertex_out, np);
|
||||
visitor.end_refine_phase();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
/*!
|
||||
\ingroup PMP_hole_filling_grp
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.6 and the
|
||||
overload with the named parameters `face_output_iterator` and
|
||||
`vertex_output_iterator` should be used instead.
|
||||
|
||||
@brief triangulates and refines a hole in a polygon mesh.
|
||||
|
||||
@tparam PolygonMesh must be model of `MutableFaceGraph`
|
||||
@tparam FaceOutputIterator model of `OutputIterator`
|
||||
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 bgl_namedparameters "Named Parameters"
|
||||
*/
|
||||
|
||||
template<typename PolygonMesh,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED
|
||||
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 NamedParameters& np = parameters::default_values())
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter_reference;
|
||||
|
||||
std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor> patch;
|
||||
triangulate_hole(pmesh, border_halfedge, std::back_inserter(patch), np);
|
||||
face_out = std::copy(patch.begin(), patch.end(), face_out);
|
||||
|
||||
Hole_filling::Default_visitor default_visitor;
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::visitor_t,
|
||||
NamedParameters,
|
||||
Hole_filling::Default_visitor>::reference Visitor;
|
||||
|
||||
Visitor visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor);
|
||||
visitor.start_refine_phase();
|
||||
std::pair<FaceOutputIterator, VertexOutputIterator> res = refine(pmesh, patch, face_out, vertex_out, np);
|
||||
visitor.end_refine_phase();
|
||||
return res;
|
||||
return triangulate_and_refine_hole(pmesh, border_halfedge,
|
||||
np.face_output_iterator(face_out).vertex_output_iterator(vertex_out));
|
||||
}
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PMP_hole_filling_grp
|
||||
@brief triangulates, refines and fairs a hole in a polygon mesh.
|
||||
|
||||
@tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
@tparam FaceOutputIterator model of `OutputIterator`
|
||||
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 bgl_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 an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
|
||||
\cgalNamedParamsBegin
|
||||
|
||||
\cgalParamNBegin{face_output_iterator}
|
||||
\cgalParamDescription{iterator over patch faces}
|
||||
\cgalParamType{a model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%face_descriptor` for patch faces}
|
||||
\cgalParamDefault{`Emptyset_iterator`}
|
||||
\cgalParamNEnd
|
||||
|
||||
\cgalParamNBegin{vertex_output_iterator}
|
||||
\cgalParamDescription{iterator over patch vertices}
|
||||
\cgalParamType{a model of `OutputIterator`
|
||||
holding `boost::graph_traits<PolygonMesh>::%vertex_descriptor` for patch vertices}
|
||||
\cgalParamDefault{`Emptyset_iterator`}
|
||||
\cgalParamNEnd
|
||||
|
||||
\cgalParamNBegin{vertex_point_map}
|
||||
\cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
\cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
|
|
@ -441,10 +546,8 @@ namespace Polygon_mesh_processing {
|
|||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
@return tuple of
|
||||
- `bool`: `true` if fairing is successful
|
||||
- `face_out`
|
||||
- `vertex_out`
|
||||
@return tuple of `bool` with `true` if fairing is successful, and
|
||||
the face and vertex output iterator
|
||||
|
||||
\sa CGAL::Polygon_mesh_processing::triangulate_hole()
|
||||
\sa CGAL::Polygon_mesh_processing::refine()
|
||||
|
|
@ -453,32 +556,41 @@ namespace Polygon_mesh_processing {
|
|||
\todo handle islands
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
std::tuple<bool, FaceOutputIterator, VertexOutputIterator>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
auto
|
||||
triangulate_refine_and_fair_hole(PolygonMesh& pmesh,
|
||||
typename boost::graph_traits<PolygonMesh>::halfedge_descriptor border_halfedge,
|
||||
FaceOutputIterator face_out,
|
||||
VertexOutputIterator vertex_out,
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
CGAL_precondition(CGAL::is_triangle_mesh(pmesh));
|
||||
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
using parameters::get_parameter_reference;
|
||||
|
||||
CGAL_precondition(is_valid_halfedge_descriptor(border_halfedge, pmesh));
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::face_output_iterator_t,
|
||||
CGAL_NP_CLASS,
|
||||
Emptyset_iterator>::type Face_output_iterator;
|
||||
|
||||
Face_output_iterator face_out = choose_parameter<Emptyset_iterator>(get_parameter(np, internal_np::face_output_iterator));
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::vertex_output_iterator_t,
|
||||
CGAL_NP_CLASS,
|
||||
Emptyset_iterator>::type Vertex_output_iterator;
|
||||
|
||||
Vertex_output_iterator vertex_out = choose_parameter<Emptyset_iterator>(get_parameter(np, internal_np::vertex_output_iterator));
|
||||
|
||||
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), np).first;
|
||||
(pmesh, border_halfedge, np.face_output_iterator(face_out).vertex_output_iterator(std::back_inserter(patch))).first;
|
||||
|
||||
CGAL_postcondition(CGAL::is_triangle_mesh(pmesh));
|
||||
|
||||
Hole_filling::Default_visitor default_visitor;
|
||||
typedef typename internal_np::Lookup_named_param_def<internal_np::visitor_t,
|
||||
NamedParameters,
|
||||
CGAL_NP_CLASS,
|
||||
Hole_filling::Default_visitor>::reference Visitor;
|
||||
|
||||
Visitor visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor);
|
||||
|
|
@ -490,6 +602,39 @@ namespace Polygon_mesh_processing {
|
|||
return std::make_tuple(fair_success, face_out, vertex_out);
|
||||
}
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
/*!
|
||||
\ingroup PMP_hole_filling_grp
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.6 and the
|
||||
overload with the named parameters `face_output_iterator` and
|
||||
`vertex_output_iterator` should be used instead.
|
||||
|
||||
\brief triangulates, refines, and fairs a hole in a polygon mesh.
|
||||
|
||||
@tparam PolygonMesh a model of `MutableFaceGraph`
|
||||
@tparam FaceOutputIterator model of `OutputIterator`
|
||||
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 bgl_namedparameters "Named Parameters"
|
||||
*/
|
||||
template<typename PolygonMesh,
|
||||
typename FaceOutputIterator,
|
||||
typename VertexOutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED
|
||||
std::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 CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return triangulate_refine_and_fair_hole(pmesh, border_halfedge, np.face_output_iterator(face_out).vertex_output_iterator(vertex_out));
|
||||
}
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PMP_hole_filling_grp
|
||||
creates triangles to fill the hole defined by points in the range `points`.
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ void test_triangulate_hole_weight(const std::string file_name, std::size_t nb_re
|
|||
for(typename std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(
|
||||
poly, *it, back_inserter(patch),CGAL::parameters::use_delaunay_triangulation(true));
|
||||
poly, *it, CGAL::parameters::use_delaunay_triangulation(true).face_output_iterator(back_inserter(patch)));
|
||||
if(patch.empty()) { continue; }
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ void test_triangulate_hole(const std::string file_name) {
|
|||
|
||||
for(typename std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, CGAL::parameters::face_output_iterator(back_inserter(patch)));
|
||||
if(patch.empty()) {
|
||||
std::cerr << " Error: empty patch created." << std::endl;
|
||||
assert(false);
|
||||
|
|
@ -161,15 +161,15 @@ void test_triangulate_hole_should_be_no_output(const std::string file_name) {
|
|||
|
||||
for(typename std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
|
||||
CGAL::parameters::use_delaunay_triangulation(false));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
|
||||
CGAL::parameters::use_delaunay_triangulation(false).face_output_iterator(back_inserter(patch)));
|
||||
if(!patch.empty()) {
|
||||
std::cerr << " Error: patch should be empty" << std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
|
||||
CGAL::parameters::use_delaunay_triangulation(true));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
|
||||
CGAL::parameters::use_delaunay_triangulation(true).face_output_iterator(back_inserter(patch)));
|
||||
if(!patch.empty()) {
|
||||
std::cerr << " Error: patch should be empty" << std::endl;
|
||||
assert(false);
|
||||
|
|
@ -194,7 +194,7 @@ void test_triangulate_and_refine_hole(const std::string file_name) {
|
|||
std::vector<Facet_handle> patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices;
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly, *it,
|
||||
back_inserter(patch_facets), back_inserter(patch_vertices));
|
||||
CGAL::parameters::face_output_iterator(back_inserter(patch_facets)).vertex_output_iterator(back_inserter(patch_vertices)));
|
||||
|
||||
if(patch_facets.empty()) {
|
||||
std::cerr << " Error: empty patch created." << std::endl;
|
||||
|
|
@ -225,7 +225,7 @@ void test_triangulate_refine_and_fair_hole(const std::string file_name) {
|
|||
std::vector<Facet_handle> patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices;
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly,
|
||||
*it, back_inserter(patch_facets), back_inserter(patch_vertices));
|
||||
*it, CGAL::parameters::face_output_iterator(back_inserter(patch_facets)).vertex_output_iterator(back_inserter(patch_vertices)));
|
||||
|
||||
if(patch_facets.empty()) {
|
||||
std::cerr << " Error: empty patch created." << std::endl;
|
||||
|
|
@ -258,11 +258,11 @@ void test_ouput_iterators_triangulate_hole(const std::string file_name) {
|
|||
typename std::vector<Halfedge_handle>::iterator it_2 = border_reps_2.begin();
|
||||
for(typename std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it, ++it_2) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, CGAL::parameters::face_output_iterator(back_inserter(patch)));
|
||||
|
||||
std::vector<Facet_handle> patch_2 = patch;
|
||||
Facet_handle* output_it =
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly_2, *it_2, &*patch_2.begin());
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly_2, *it_2, CGAL::parameters::face_output_iterator(& *patch_2.begin()));
|
||||
|
||||
if(patch.size() != (std::size_t)(output_it - &*patch_2.begin())) {
|
||||
std::cerr << " Error: returned facet output iterator is not valid!" << std::endl;
|
||||
|
|
@ -291,8 +291,8 @@ void test_ouput_iterators_triangulate_and_refine_hole(const std::string file_nam
|
|||
for(typename std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it, ++it_2) {
|
||||
std::vector<Facet_handle> patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices;
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly,
|
||||
*it, back_inserter(patch_facets), back_inserter(patch_vertices));
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly, *it,
|
||||
CGAL::parameters::face_output_iterator(back_inserter(patch_facets)).vertex_output_iterator(back_inserter(patch_vertices)));
|
||||
// create enough space to hold outputs
|
||||
std::vector<Facet_handle> patch_facets_2 = patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices_2 = patch_vertices;
|
||||
|
|
@ -300,7 +300,7 @@ void test_ouput_iterators_triangulate_and_refine_hole(const std::string file_nam
|
|||
|
||||
std::pair<Facet_handle*, Vertex_handle*> output_its =
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly_2,
|
||||
*it_2, &*patch_facets_2.begin(), &*patch_vertices_2.begin());
|
||||
*it_2, CGAL::parameters::face_output_iterator(& *patch_facets_2.begin()).vertex_output_iterator(& *patch_vertices_2.begin()));
|
||||
|
||||
if(patch_facets.size() != (std::size_t) (output_its.first - &*patch_facets_2.begin())) {
|
||||
std::cout << " Error: returned facet output iterator is not valid!" << std::endl;
|
||||
|
|
@ -337,22 +337,29 @@ void test_triangulate_refine_and_fair_hole_compile() {
|
|||
// use all param
|
||||
read_poly_with_borders("elephant_quad_hole.off", poly, border_reps);
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(poly, border_reps[0], back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
(poly, border_reps[0],
|
||||
CGAL::parameters::
|
||||
face_output_iterator(back_inserter(patch_facets)).
|
||||
vertex_output_iterator(back_inserter(patch_vertices)).
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Polyhedron>()).
|
||||
sparse_linear_solver(Default_solver()));
|
||||
|
||||
// default solver
|
||||
read_poly_with_borders("elephant_quad_hole.off", poly, border_reps);
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(poly, border_reps[0], back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
(poly, border_reps[0],
|
||||
CGAL::parameters::
|
||||
face_output_iterator(back_inserter(patch_facets)).
|
||||
vertex_output_iterator(back_inserter(patch_vertices)).
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Polyhedron>()));
|
||||
|
||||
// default solver and weight
|
||||
read_poly_with_borders("elephant_quad_hole.off", poly, border_reps);
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(poly, border_reps[0], back_inserter(patch_facets), back_inserter(patch_vertices));
|
||||
(poly, border_reps[0],
|
||||
CGAL::parameters::
|
||||
face_output_iterator(back_inserter(patch_facets)).
|
||||
vertex_output_iterator(back_inserter(patch_vertices)));
|
||||
}
|
||||
|
||||
template <class Polyhedron>
|
||||
|
|
|
|||
|
|
@ -138,8 +138,10 @@ void test_triangulate_hole(const std::string file_name, bool use_cdt) {
|
|||
|
||||
for(std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
|
||||
CGAL::parameters::use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch)).
|
||||
use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
if(patch.empty()) {
|
||||
std::cerr << " Error: empty patch created." << std::endl;
|
||||
assert(false);
|
||||
|
|
@ -163,16 +165,17 @@ void test_triangulate_hole_should_be_no_output(const std::string file_name, bool
|
|||
|
||||
for(std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
|
||||
CGAL::parameters::use_delaunay_triangulation(false)
|
||||
.face_output_iterator(back_inserter(patch))
|
||||
.use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
if(!patch.empty()) {
|
||||
std::cerr << " Error: patch should be empty" << std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
|
||||
CGAL::parameters::use_delaunay_triangulation(true));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
|
||||
CGAL::parameters::use_delaunay_triangulation(true).face_output_iterator(back_inserter(patch)));
|
||||
if(!patch.empty()) {
|
||||
std::cerr << " Error: patch should be empty" << std::endl;
|
||||
assert(false);
|
||||
|
|
@ -193,8 +196,10 @@ void test_triangulate_and_refine_hole(const std::string file_name, bool use_cdt)
|
|||
std::vector<Facet_handle> patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices;
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly, *it,
|
||||
back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
CGAL::parameters::use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch_facets)).
|
||||
vertex_output_iterator(std::back_inserter(patch_vertices)).
|
||||
use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
|
||||
if(patch_facets.empty()) {
|
||||
std::cerr << " Error: empty patch created." << std::endl;
|
||||
|
|
@ -220,9 +225,11 @@ void test_triangulate_refine_and_fair_hole(const std::string file_name, bool use
|
|||
for(std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it) {
|
||||
std::vector<Facet_handle> patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices;
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly,
|
||||
*it, back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
CGAL::parameters::use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly, *it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch_facets)).
|
||||
vertex_output_iterator(std::back_inserter(patch_vertices)).
|
||||
use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
|
||||
if(patch_facets.empty()) {
|
||||
std::cerr << " Error: empty patch created." << std::endl;
|
||||
|
|
@ -251,12 +258,14 @@ void test_ouput_iterators_triangulate_hole(const std::string file_name, bool use
|
|||
std::vector<Halfedge_handle>::iterator it_2 = border_reps_2.begin();
|
||||
for(std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it, ++it_2) {
|
||||
std::vector<Facet_handle> patch;
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
|
||||
CGAL::parameters::use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch)).
|
||||
use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
|
||||
std::vector<Facet_handle> patch_2 = patch;
|
||||
Facet_handle* output_it =
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly_2, *it_2, &*patch_2.begin());
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly_2, *it_2, CGAL::parameters::face_output_iterator(& *patch_2.begin()));
|
||||
|
||||
if(patch.size() != (std::size_t)(output_it - &*patch_2.begin())) {
|
||||
std::cerr << " Error: returned facet output iterator is not valid!" << std::endl;
|
||||
|
|
@ -282,18 +291,22 @@ void test_ouput_iterators_triangulate_and_refine_hole(const std::string file_nam
|
|||
for(std::vector<Halfedge_handle>::iterator it = border_reps.begin(); it != border_reps.end(); ++it, ++it_2) {
|
||||
std::vector<Facet_handle> patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices;
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly,
|
||||
*it, back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
CGAL::parameters::use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly, *it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch_facets)).
|
||||
vertex_output_iterator(std::back_inserter(patch_vertices)).
|
||||
use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
// create enough space to hold outputs
|
||||
std::vector<Facet_handle> patch_facets_2 = patch_facets;
|
||||
std::vector<Vertex_handle> patch_vertices_2 = patch_vertices;
|
||||
if(patch_vertices_2.empty()) { patch_vertices_2.push_back(Vertex_handle()); } //just allocate space for dereferencing
|
||||
|
||||
std::pair<Facet_handle*, Vertex_handle*> output_its =
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly_2,
|
||||
*it_2, &*patch_facets_2.begin(), &*patch_vertices_2.begin(),
|
||||
CGAL::parameters::use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly_2, *it_2,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(&*patch_facets_2.begin()).
|
||||
vertex_output_iterator(&*patch_vertices_2.begin()).
|
||||
use_2d_constrained_delaunay_triangulation(use_cdt));
|
||||
|
||||
if(patch_facets.size() != (std::size_t) (output_its.first - &*patch_facets_2.begin())) {
|
||||
std::cout << " Error: returned facet output iterator is not valid!" << std::endl;
|
||||
|
|
@ -327,23 +340,30 @@ void test_triangulate_refine_and_fair_hole_compile() {
|
|||
// use all param
|
||||
read_poly_with_borders("elephant_quad_hole.off", poly, border_reps);
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(poly, border_reps[0], back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
CGAL::parameters::
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Polyhedron>()).
|
||||
sparse_linear_solver(Default_solver()).
|
||||
use_2d_constrained_delaunay_triangulation(false));
|
||||
(poly, border_reps[0],
|
||||
CGAL::parameters::
|
||||
face_output_iterator(back_inserter(patch_facets)).
|
||||
vertex_output_iterator(back_inserter(patch_vertices)).
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Polyhedron>()).
|
||||
sparse_linear_solver(Default_solver()).
|
||||
use_2d_constrained_delaunay_triangulation(false));
|
||||
|
||||
// default solver
|
||||
read_poly_with_borders("elephant_quad_hole.off", poly, border_reps);
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(poly, border_reps[0], back_inserter(patch_facets), back_inserter(patch_vertices),
|
||||
CGAL::parameters::
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Polyhedron>()));
|
||||
(poly, border_reps[0],
|
||||
CGAL::parameters::
|
||||
face_output_iterator(back_inserter(patch_facets)).
|
||||
vertex_output_iterator(back_inserter(patch_vertices)).
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Polyhedron>()));
|
||||
|
||||
// default solver and weight
|
||||
read_poly_with_borders("elephant_quad_hole.off", poly, border_reps);
|
||||
CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole
|
||||
(poly, border_reps[0], back_inserter(patch_facets), back_inserter(patch_vertices));
|
||||
(poly, border_reps[0],
|
||||
CGAL::parameters::
|
||||
face_output_iterator(back_inserter(patch_facets)).
|
||||
vertex_output_iterator(back_inserter(patch_vertices)));
|
||||
}
|
||||
|
||||
void generate_elephant_with_hole()
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ void test_triangulate_hole_with_cdt_2(
|
|||
CGAL::Polygon_mesh_processing::triangulate_hole(
|
||||
pmesh,
|
||||
h,
|
||||
std::back_inserter(patch_faces),
|
||||
CGAL::parameters::vertex_point_map(
|
||||
get(CGAL::vertex_point, pmesh)).
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch_faces)).
|
||||
vertex_point_map(get(CGAL::vertex_point, pmesh)).
|
||||
use_2d_constrained_delaunay_triangulation(true).
|
||||
geom_traits(GeomTraits()));
|
||||
|
||||
|
|
|
|||
|
|
@ -701,14 +701,16 @@ bool Polyhedron_demo_hole_filling_plugin::fill
|
|||
CGAL::Timer timer; timer.start();
|
||||
std::vector<fg_face_descriptor> patch;
|
||||
if(action_index == 0) {
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly,
|
||||
it, std::back_inserter(patch),
|
||||
CGAL::parameters::use_delaunay_triangulation(use_DT));
|
||||
CGAL::Polygon_mesh_processing::triangulate_hole(poly, it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch)).
|
||||
use_delaunay_triangulation(use_DT));
|
||||
}
|
||||
else if(action_index == 1) {
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly,
|
||||
it, std::back_inserter(patch), CGAL::Emptyset_iterator(),
|
||||
CGAL::parameters::density_control_factor(alpha).
|
||||
CGAL::Polygon_mesh_processing::triangulate_and_refine_hole(poly, it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch)).
|
||||
density_control_factor(alpha).
|
||||
use_delaunay_triangulation(use_DT));
|
||||
}
|
||||
else {
|
||||
|
|
@ -716,9 +718,9 @@ bool Polyhedron_demo_hole_filling_plugin::fill
|
|||
|
||||
bool success;
|
||||
if(weight_index == 0) {
|
||||
success = std::get<0>(CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly,
|
||||
it, std::back_inserter(patch), CGAL::Emptyset_iterator(),
|
||||
success = std::get<0>(CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly, it,
|
||||
CGAL::parameters::
|
||||
face_output_iterator(std::back_inserter(patch)).
|
||||
weight_calculator(CGAL::Weights::Uniform_weight<Face_graph>()).
|
||||
density_control_factor(alpha).
|
||||
fairing_continuity(continuity).
|
||||
|
|
@ -728,12 +730,12 @@ bool Polyhedron_demo_hole_filling_plugin::fill
|
|||
auto vpm = get_property_map(CGAL::vertex_point, poly);
|
||||
auto weight_calc = CGAL::Weights::Secure_cotangent_weight_with_voronoi_area<Face_graph, decltype(vpm), EPICK>(poly, vpm, EPICK());
|
||||
|
||||
success = std::get<0>(CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly,
|
||||
it, std::back_inserter(patch), CGAL::Emptyset_iterator(),
|
||||
CGAL::parameters::weight_calculator(weight_calc).
|
||||
density_control_factor(alpha).
|
||||
fairing_continuity(continuity).
|
||||
use_delaunay_triangulation(use_DT)));
|
||||
success = std::get<0>(CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(poly,it,
|
||||
CGAL::parameters::face_output_iterator(std::back_inserter(patch)).
|
||||
weight_calculator(weight_calc).
|
||||
density_control_factor(alpha).
|
||||
fairing_continuity(continuity).
|
||||
use_delaunay_triangulation(use_DT)));
|
||||
}
|
||||
|
||||
if(!success) { print_message("Error: fairing is not successful, only triangulation and refinement are applied!"); }
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ CGAL_add_named_parameter(metis_options_t, METIS_options, METIS_options)
|
|||
CGAL_add_named_parameter(vertex_partition_id_t, vertex_partition_id, vertex_partition_id_map)
|
||||
CGAL_add_named_parameter(face_partition_id_t, face_partition_id, face_partition_id_map)
|
||||
|
||||
CGAL_add_named_parameter(vertex_output_iterator_t, vertex_output_iterator, vertex_output_iterator)
|
||||
CGAL_add_named_parameter(face_output_iterator_t, face_output_iterator, face_output_iterator)
|
||||
|
||||
CGAL_add_named_parameter(vertex_to_vertex_output_iterator_t, vertex_to_vertex_output_iterator, vertex_to_vertex_output_iterator)
|
||||
CGAL_add_named_parameter(halfedge_to_halfedge_output_iterator_t, halfedge_to_halfedge_output_iterator, halfedge_to_halfedge_output_iterator)
|
||||
CGAL_add_named_parameter(face_to_face_output_iterator_t, face_to_face_output_iterator, face_to_face_output_iterator)
|
||||
|
|
@ -327,4 +330,3 @@ CGAL_add_named_parameter_with_compatibility_ref_only(sizing_field_param_t, sizin
|
|||
|
||||
CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function)
|
||||
CGAL_add_named_parameter_with_compatibility(bounding_object_param_t, bounding_object_param, bounding_object)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue