diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index a4972113d60..02b3b6a3ce7 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -29,6 +29,7 @@ #include #include #include +#include namespace CGAL { @@ -357,27 +358,199 @@ bool is_valid_face_descriptor( typename boost::graph_traits::face_des template -bool is_valid_polygon_mesh(const FaceGraph& g) +bool is_valid_polygon_mesh(const FaceGraph& g, bool verb = false) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - BOOST_FOREACH(vertex_descriptor v, vertices(g)){ - if(! is_valid_vertex_descriptor(v,g)){ - return false; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::vertex_iterator vertex_const_iterator; + typedef typename boost::graph_traits::halfedge_iterator halfedge_const_iterator; + typedef typename boost::graph_traits::face_iterator face_const_iterator; + typedef typename boost::graph_traits::vertices_size_type vertex_size_type; + typedef typename boost::graph_traits::halfedges_size_type halfedges_size_type; + typedef typename boost::graph_traits::faces_size_type faces_size_type; + Verbose_ostream verr(verb); + int num_v(std::distance(boost::begin(vertices(g)), boost::end(vertices(g)))), + num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g)))), + num_f(std::distance(boost::begin(faces(g)), boost::end(faces(g)))); + bool valid = ( 1 != (num_h& 1)); + if ( ! valid) + verr << "number of halfedges is odd." << std::endl; + + // All halfedges. + + halfedges_size_type n = 0; + halfedges_size_type nb = 0; + BOOST_FOREACH(halfedge_descriptor begin, halfedges(g)) { + if(!valid) + break; + verr << "halfedge " << n << std::endl; + if ( is_border(begin, g)) + verr << " is border halfedge" << std::endl; + // Pointer integrity. + valid = valid && ( next(begin, g) != boost::graph_traits::null_halfedge()); + valid = valid && ( opposite(begin, g) != boost::graph_traits::null_halfedge()); + if ( ! valid) { + verr << " pointer integrity corrupted (ptr==0)." + << std::endl; + break; } - } - BOOST_FOREACH(halfedge_descriptor h, halfedges(g)){ - if(! is_valid_halfedge_descriptor(h,g)){ - return false; + // opposite integrity. + valid = valid && ( opposite(begin, g) != begin); + valid = valid && ( opposite(opposite(begin, g), g) == begin); + if ( ! valid) { + verr << " opposite pointer integrity corrupted." + << std::endl; + break; } - } - BOOST_FOREACH(face_descriptor f, faces(g)){ - if(! is_valid_face_descriptor(f,g)){ - return false; + // previous integrity. + valid = valid && ( prev(next(begin, g), g) == begin); + if ( ! valid) { + verr << " previous pointer integrity corrupted." + << std::endl; + break; } + // vertex integrity. + valid = valid && ( target(begin, g) != boost::graph_traits::null_vertex()); + if ( ! valid) { + verr << " vertex pointer integrity corrupted." + << std::endl; + break; + } + valid = valid && ( target(begin, g) == + target(opposite(next(begin, g), g), g)); + if ( ! valid) { + verr << " vertex pointer integrity2 corrupted." + << std::endl; + break; + } + // face integrity. + + valid = valid && ( face(begin, g) == face(next(begin, g), g)); + if ( ! valid) { + verr << " face pointer integrity2 corrupted." + << std::endl; + break; + } + + ++n; + if ( is_border(begin, g)) + ++nb; } - return true; + verr << "summe border halfedges (2*nb) = " << 2 * nb << std::endl; + if ( valid && n != num_h) + verr << "counting halfedges failed." << std::endl; + // All vertices. + vertex_size_type v = 0; + n = 0; + BOOST_FOREACH(vertex_descriptor vbegin, vertices(g)){ + if(!valid) + break; + verr << "vertex " << v << std::endl; + // Pointer integrity. + if ( halfedge(vbegin, g) != boost::graph_traits::null_halfedge()) + valid = valid && ( + target( halfedge(vbegin, g), g) == vbegin); + else + valid = false; + if ( ! valid) { + verr << " halfedge pointer in vertex corrupted." + << std::endl; + break; + } + // cycle-around-vertex test. + halfedge_descriptor h = halfedge(vbegin, g); + if ( h != boost::graph_traits::null_halfedge()) { + halfedge_descriptor ge = h; + do { + verr << " halfedge " << n << std::endl; + ++n; + h = opposite(next(h, g), g); + valid = valid && ( n <= num_h && n!=0); + if ( ! valid) + verr << " too many halfedges around vertices." + << std::endl; + } while ( valid && (h != ge)); + } + ++v; + } + if ( valid && v != num_v) + verr << "counting vertices failed." << std::endl; + if ( valid && ( n != num_h)) + verr << "counting halfedges via vertices failed." << std::endl; + valid = valid && ( v == num_v); + + // All faces. + faces_size_type f = 0; + n = 0; + BOOST_FOREACH(face_descriptor fbegin, faces(g)){ + if(!valid) + break; + verr << "face " << f << std::endl; + // Pointer integrity. + if ( halfedge(fbegin, g) != boost::graph_traits::null_halfedge()) + valid = valid && ( + face(halfedge(fbegin, g), g) == fbegin); + else + valid = false; + if ( ! valid) { + verr << " halfedge pointer in face corrupted." << std::endl; + break; + } + // cycle-around-face test. + halfedge_descriptor h = halfedge( fbegin, g); + if (h != boost::graph_traits::null_halfedge()) { + halfedge_descriptor ge = h; + do { + verr << " halfedge " << n << std::endl; + ++n; + h = next(h, g); + valid = valid && ( n <= num_h && n!=0); + if ( ! valid) + verr << " too many halfedges around faces." + << std::endl; + } while ( valid && (h != ge)); + } + ++f; + } + if ( valid && f != num_f) + verr << "counting faces failed." << std::endl; + if ( valid && n + nb != num_h) + verr << "counting halfedges via faces failed." << std::endl; + valid = valid && ( f == num_f); + valid = valid && ( n + nb == num_h); + verr << "is_valid(): structure is " << ( valid ? "valid." : + "NOT VALID.") << std::endl; + // All halfedges. + n = 0; + BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){ + verr << "halfedge " << n << std::endl; + // At least triangular facets and distinct geometry. + valid = valid && ( next(i, g) != i); + valid = valid && ( next(next(i, g), g) != i); + valid = valid && ( target(i, g) != target(opposite(i, g), g)); + valid = valid && ( target(i, g) != target(next(i, g), g)); + valid = valid && ( target(i, g) != target(next(next(i, g), g), g)); + if ( ! valid) { + verr << " incident facet is not at least a triangle." + << std::endl; + break; + } + // Distinct facets on each side of an halfegde. + valid = valid && (face(i, g) != face(opposite(i, g), g)); + if ( ! valid) { + verr << " both incident facets are equal." << std::endl; + break; + } + ++n; +} +valid = valid && (n == num_h); +if ( n != num_h) + verr << "counting halfedges failed." << std::endl; + +verr << "end of CGAL::Polyhedron_3<...>::is_valid(): structure is " + << ( valid ? "valid." : "NOT VALID.") << std::endl; +return valid; } /*! diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 616ea782b3f..cdf53ec5f4c 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -41,7 +41,7 @@ join_face_test() assert(degree(f.w, f.m) == 2); assert(degree(f.v, f.m) == 3); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); } @@ -63,7 +63,7 @@ remove_face_test_1() CGAL::Euler::remove_face(e,f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); assert_EQUAL(degree(f.v, f.m) == 3); assert_EQUAL(degree(f.x, f.m) == 2); @@ -99,7 +99,7 @@ remove_face_test_2() assert(found); assert(face(e, f.m) == f.f1); CGAL::Euler::remove_face(e,f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); assert(CGAL::internal::exact_num_faces(f.m) == 3); assert(CGAL::internal::exact_num_edges(f.m) == 7); @@ -128,7 +128,7 @@ add_face_to_border_test() CGAL::Euler::add_face_to_border(f.h1, f.h2, f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); } @@ -158,7 +158,7 @@ add_vertex_and_face_to_border_test() } halfedge_descriptor res = CGAL::Euler::add_vertex_and_face_to_border(f.h1, f.h2, f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); assert(! CGAL::is_border(res,m)); assert(CGAL::is_border(opposite(res,m),m)); @@ -169,8 +169,6 @@ add_vertex_and_face_to_border_test() } assert(blength == 0); - - } @@ -193,7 +191,7 @@ join_vertex_interior_test() assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 3); assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3); assert(degree(f.x, f.m) == 4); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); } template @@ -218,7 +216,7 @@ join_vertex_exterior_test() assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 4); assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3); assert(degree(f.y, f.m) == 3); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); } { @@ -237,7 +235,7 @@ join_vertex_exterior_test() assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 4); assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); assert(degree(f.w, f.m) == 3); } @@ -261,7 +259,7 @@ split_vertex() // split border vertex y CGAL::Euler::split_vertex(h1, h2,f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); assert(CGAL::internal::exact_num_vertices(f.m) == 7); assert(CGAL::internal::exact_num_edges(f.m) == 8); assert(boost::distance(CGAL::halfedges_around_face(h1, f.m)) == 5); @@ -279,13 +277,13 @@ split_join_vertex_inverse() boost::tie(h, found) = halfedge(f.w, f.x, f.m); assert(found); CGAL::Euler::join_vertex(h,f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); boost::tie(h1, found) = halfedge(f.z, f.x, f.m); assert(found); boost::tie(h2, found) = halfedge(f.v, f.x, f.m); assert(found); CGAL::Euler::join_vertex(CGAL::Euler::split_vertex(h1, h2,f.m),f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); assert(CGAL::internal::exact_num_vertices(f.m)== 5); assert(CGAL::internal::exact_num_faces(f.m) == 2); @@ -305,7 +303,7 @@ join_loop_test() CGAL::Euler::join_loop(f.h1, f.h2, f.m); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); } template @@ -319,7 +317,7 @@ split_loop_test() assert(CGAL::internal::exact_num_vertices(f.m) == 8); assert(CGAL::internal::exact_num_faces(f.m) == 8); assert(CGAL::internal::exact_num_halfedges(f.m) == 24); - assert(CGAL::is_valid(f.m)); + assert(CGAL::is_valid_polygon_mesh(f.m)); } template diff --git a/BGL/test/BGL/test_Face_filtered_graph.cpp b/BGL/test/BGL/test_Face_filtered_graph.cpp index 75427a24292..5446a660266 100644 --- a/BGL/test/BGL/test_Face_filtered_graph.cpp +++ b/BGL/test/BGL/test_Face_filtered_graph.cpp @@ -272,7 +272,7 @@ void test_read(const Graph& g) std::map map; CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); Adapter fg(g, 0, boost::make_assoc_property_map(map)); - assert(CGAL::is_valid(fg)); + assert(CGAL::is_valid_polygon_mesh(fg)); } template @@ -357,7 +357,7 @@ void test_mesh(Adapter fga) CGAL_GRAPH_TRAITS_MEMBERS(Adapter); //check that there is the right number of simplices in fga - CGAL_assertion(CGAL::is_valid(fga)); + CGAL_assertion(CGAL::is_valid_polygon_mesh(fga)); CGAL_assertion(num_faces(fga) == 2); CGAL_assertion(num_edges(fga) == 5); CGAL_assertion(num_halfedges(fga) == 10); diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index a06a1381bec..8aacfd12f99 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -157,7 +157,7 @@ template struct Surface_fixture_1 { Surface_fixture_1() { assert(read_a_mesh(m, "data/fixture1.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::property_map::const_type pm = get(CGAL::vertex_point, const_cast(m)); @@ -206,7 +206,7 @@ template struct Surface_fixture_2 { Surface_fixture_2() { assert(read_a_mesh(m, "data/fixture2.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::property_map::const_type pm = get(CGAL::vertex_point, const_cast(m)); @@ -267,7 +267,7 @@ template struct Surface_fixture_3 { Surface_fixture_3() { assert(read_a_mesh(m, "data/fixture3.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::property_map::const_type pm = get(CGAL::vertex_point, const_cast(m)); @@ -313,7 +313,7 @@ template struct Surface_fixture_4 { Surface_fixture_4() { assert(read_a_mesh(m, "data/fixture4.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::property_map::const_type pm = get(CGAL::vertex_point, const_cast(m)); @@ -348,7 +348,7 @@ template struct Surface_fixture_5 { Surface_fixture_5() { assert(read_a_mesh(m, "data/add_face_to_border.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::property_map::const_type pm = get(CGAL::vertex_point, const_cast(m)); @@ -378,7 +378,7 @@ template struct Surface_fixture_6 { Surface_fixture_6() { assert(read_a_mesh(m, "data/quad.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::graph_traits::halfedge_descriptor h; @@ -397,7 +397,7 @@ template struct Surface_fixture_7 { Surface_fixture_7() { assert(read_a_mesh(m, "data/cube.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); h = *(halfedges(m).first); } @@ -410,7 +410,7 @@ template struct Surface_fixture_8 { Surface_fixture_8() { assert(read_a_mesh(m, "data/fixture5.off")); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); typename boost::property_map::const_type pm = get(CGAL::vertex_point, const_cast(m)); diff --git a/BGL/test/BGL/test_clear.cpp b/BGL/test/BGL/test_clear.cpp index eb733d748d4..05c8670a972 100644 --- a/BGL/test/BGL/test_clear.cpp +++ b/BGL/test/BGL/test_clear.cpp @@ -10,13 +10,13 @@ void test() { std::cout << "Error reading file: " << fname << std::endl; } - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); CGAL::clear(m); assert(num_vertices(m) == 0); assert(num_faces(m) == 0); assert(num_edges(m) == 0); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); } int main() diff --git a/BGL/test/BGL/test_graph_traits.cpp b/BGL/test/BGL/test_graph_traits.cpp index 6024ec4782a..73693da6736 100644 --- a/BGL/test/BGL/test_graph_traits.cpp +++ b/BGL/test/BGL/test_graph_traits.cpp @@ -254,7 +254,7 @@ void test_faces(const G& g) template void test_read(const G& g) { - assert(CGAL::is_valid(g)); + assert(CGAL::is_valid_polygon_mesh(g)); } template diff --git a/BGL/test/BGL/test_helpers.cpp b/BGL/test/BGL/test_helpers.cpp index e59447e3837..e2096d4df5e 100644 --- a/BGL/test/BGL/test_helpers.cpp +++ b/BGL/test/BGL/test_helpers.cpp @@ -43,42 +43,42 @@ int main() halfedge_descriptor hd; hd = CGAL::make_triangle(a,b,c,m); assert(CGAL::is_isolated_triangle(hd,m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); hd = CGAL::make_quad(a,b,c,d,m); assert(CGAL::is_isolated_quad(hd,m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); assert(CGAL::is_quad_mesh(m)); m.clear(); hd = CGAL::make_tetrahedron(a,b,c,d,m); assert(CGAL::is_tetrahedron(hd,m)); assert(CGAL::is_triangle_mesh(m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m); assert(CGAL::is_hexahedron(hd,m)); assert(CGAL::is_quad_mesh(m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); CGAL::make_icosahedron(m); assert(num_faces(m) == 20); assert(CGAL::is_triangle_mesh(m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); hd = CGAL::make_pyramid(3, m); assert(num_faces(m) == 6); assert(CGAL::is_triangle_mesh(m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); hd = CGAL::make_regular_prism(4, m); assert(num_faces(m) == 16); assert(CGAL::is_triangle_mesh(m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); m.clear(); CGAL::make_grid(3,3,m); assert(num_faces(m) == 9); assert(CGAL::is_quad_mesh(m)); - assert(CGAL::is_valid(m)); + assert(CGAL::is_valid_polygon_mesh(m)); std::cerr << "done" << std::endl; return 0; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index 15d3299f895..45e20154ca7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -176,7 +176,7 @@ bool is_outward_oriented(const PolygonMesh& pmesh, const NamedParameters& np) { CGAL_warning(CGAL::is_closed(pmesh)); - CGAL_precondition(CGAL::is_valid(pmesh)); + CGAL_precondition(CGAL::is_valid_polygon_mesh(pmesh)); //check for empty pmesh CGAL_warning(faces(pmesh).first != faces(pmesh).second); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp index 70c7162e773..386e27723a1 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp @@ -26,7 +26,7 @@ void fix(const char* fname) } CGAL::Polygon_mesh_processing::remove_degenerate_faces(mesh); - assert( CGAL::is_valid(mesh) ); + assert( CGAL::is_valid_polygon_mesh(mesh) ); } int main() diff --git a/Subdivision_method_3/include/CGAL/Subdivision_method_3/internal/subdivision_hosts_impl_3.h b/Subdivision_method_3/include/CGAL/Subdivision_method_3/internal/subdivision_hosts_impl_3.h index cf467a3112d..2c93c17e0c3 100644 --- a/Subdivision_method_3/include/CGAL/Subdivision_method_3/internal/subdivision_hosts_impl_3.h +++ b/Subdivision_method_3/include/CGAL/Subdivision_method_3/internal/subdivision_hosts_impl_3.h @@ -173,7 +173,7 @@ void PQQ_1step(Poly& p, VertexPointMap vpm, Mask mask) { for (std::size_t i = 0; i < num_v; i++, ++vitr) put(vpm, *vitr, vertex_point_buffer[i]); -// CGAL_postcondition(p.is_valid()); + CGAL_postcondition(CGAL::is_valid_polygon_mesh(p)); delete []vertex_point_buffer; } @@ -277,7 +277,7 @@ void PTQ_1step(Poly& p, VertexPointMap vpm, Mask mask) { for (std::size_t i = 0; i < num_v; i++, ++vitr) put(vpm, *vitr, vertex_point_buffer[i]); -// CGAL_postcondition(p.is_valid()); + CGAL_postcondition(CGAL::is_valid_polygon_mesh(p)); delete []vertex_point_buffer; } @@ -527,7 +527,7 @@ void Sqrt3_1step(Poly& p, VertexPointMap vpm, Mask mask, } } -// CGAL_postcondition(p.is_valid()); + CGAL_postcondition(CGAL::is_valid_polygon_mesh(p)); delete []cpt; } diff --git a/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp b/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp index 9250848883a..7b0e8f399e5 100644 --- a/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp +++ b/Subdivision_method_3/test/Subdivision_method_3/test_Subdivision_method_3.cpp @@ -58,7 +58,7 @@ void test_Subdivision_surface_3() { mesh >> P; Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Catmull-Clark subdivision on 'opened' quad mesh @@ -69,7 +69,7 @@ void test_Subdivision_surface_3() { mesh >> P; Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } @@ -81,7 +81,7 @@ void test_Subdivision_surface_3() { mesh >> P; Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Loop subdivision on 'opened' tri mesh @@ -92,7 +92,7 @@ void test_Subdivision_surface_3() { mesh >> P; Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Doo-Sabin subdivision on general mesh @@ -103,7 +103,7 @@ void test_Subdivision_surface_3() { mesh >> P; Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Sqrt-3 subdivision on tri mesh @@ -114,7 +114,7 @@ void test_Subdivision_surface_3() { mesh >> P; Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } } @@ -130,7 +130,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Catmull-Clark subdivision on 'opened' quad mesh @@ -141,7 +141,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::CatmullClark_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } @@ -153,7 +153,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Loop subdivision on 'opened' tri mesh @@ -164,7 +164,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::Loop_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Doo-Sabin subdivision on general mesh @@ -175,7 +175,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P, true)); } // test Doo-Sabin subdivision on 'opened' quad mesh @@ -186,7 +186,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Sqrt-3 subdivision on tri mesh @@ -197,7 +197,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Sqrt-3 subdivision on 'opened' tri mesh @@ -208,7 +208,7 @@ void test_Subdivision_surface_3_SM() { mesh >> P; Subdivision_method_3::Sqrt3_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } } @@ -225,7 +225,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::CatmullClark_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Catmull-Clark subdivision on 'opened' quad mesh @@ -237,7 +237,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::CatmullClark_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } @@ -250,7 +250,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::Loop_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Loop subdivision on 'opened' tri mesh @@ -262,7 +262,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::Loop_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Doo-Sabin subdivision on 'opened' tri mesh @@ -274,7 +274,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::DooSabin_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Doo-Sabin subdivision on 'opened' quad mesh @@ -285,7 +285,7 @@ void test_Subdivision_surface_3_SM_NP() { mesh >> P; Subdivision_method_3::DooSabin_subdivision(P,TEST_DEPTH); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Sqrt-3 subdivision on tri mesh @@ -298,7 +298,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::Sqrt3_subdivision(P,Subdivision_method_3::parameters::vertex_point_map(get(vertex_point, P)) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Sqrt-3 subdivision on 'opened' tri mesh @@ -314,7 +314,7 @@ void test_Subdivision_surface_3_SM_NP() { std::ofstream out("out_0.off"); out << P; - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } // test Sqrt-3 subdivision on 'opened' tri mesh & with external property map @@ -347,7 +347,7 @@ void test_Subdivision_surface_3_SM_NP() { Subdivision_method_3::parameters::vertex_point_map(apm) .number_of_iterations(TEST_DEPTH)); - assert(P.is_valid()); + assert(CGAL::is_valid_polygon_mesh(P)); } }