Do the same for the other hole filling functions

This commit is contained in:
Andreas Fabri
2022-11-29 14:49:59 +00:00
parent 352860ffa4
commit 63ffb5e82f
2 changed files with 150 additions and 110 deletions
@@ -112,8 +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, CGAL::parameters::use_delaunay_triangulation(true).
face_output_iterator(back_inserter(patch)));
poly, *it, back_inserter(patch),CGAL::parameters::use_delaunay_triangulation(true));
if(patch.empty()) { continue; }
}
@@ -162,17 +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,
CGAL::parameters::use_delaunay_triangulation(false).
face_output_iterator(back_inserter(patch)));
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
CGAL::parameters::use_delaunay_triangulation(false));
if(!patch.empty()) {
std::cerr << " Error: patch should be empty" << std::endl;
assert(false);
}
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it,
CGAL::parameters::use_delaunay_triangulation(true).
face_output_iterator(back_inserter(patch)));
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch),
CGAL::parameters::use_delaunay_triangulation(true));
if(!patch.empty()) {
std::cerr << " Error: patch should be empty" << std::endl;
assert(false);
@@ -197,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;
@@ -228,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;
@@ -261,12 +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, CGAL::parameters::face_output_iterator(back_inserter(patch)));
CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch));
std::vector<Facet_handle> patch_2 = patch;
Facet_handle* output_it =
CGAL::Polygon_mesh_processing::triangulate_hole(poly_2, *it_2,
CGAL::parameters::face_output_iterator(&*patch_2.begin()));
CGAL::Polygon_mesh_processing::triangulate_hole(poly_2, *it_2, &*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;