From 79a38d5cb9fc6f4d6d4d46ee6c9739eafadecff1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Jan 2022 10:19:04 +0000 Subject: [PATCH 01/10] CGAL Examples: CGAL_assertion -> assert --- .../Alpha_shapes_2/ex_alpha_shapes_2.cpp | 1 - .../surface_mesh_partition.cpp | 3 ++- .../examples/Generator/random_segments2.cpp | 19 +++++++++-------- .../examples/HalfedgeDS/hds_prog_color.cpp | 3 ++- .../examples/HalfedgeDS/hds_prog_compact.cpp | 9 ++++---- .../examples/HalfedgeDS/hds_prog_compact2.cpp | 9 ++++---- .../examples/HalfedgeDS/hds_prog_default.cpp | 3 ++- .../HalfedgeDS/hds_prog_edge_iterator.cpp | 5 +++-- .../examples/HalfedgeDS/hds_prog_graph.cpp | 3 ++- .../examples/HalfedgeDS/hds_prog_graph2.cpp | 3 ++- .../HalfedgeDS/hds_prog_halfedge_iterator.cpp | 5 +++-- .../Mesh_3/mesh_polyhedral_complex.cpp | 4 ++-- .../Mesh_3/mesh_polyhedral_complex_sm.cpp | 5 +++-- Nef_2/examples/Nef_2/nef_2_construction.cpp | 5 +++-- Nef_3/examples/Nef_3/comparison.cpp | 17 ++++++++------- Nef_3/examples/Nef_3/nef_3_construction.cpp | 21 ++++++++++--------- Nef_3/examples/Nef_3/nef_3_simple.cpp | 5 +++-- Nef_3/examples/Nef_3/point_set_operations.cpp | 13 ++++++------ Nef_3/examples/Nef_3/set_operations.cpp | 3 ++- .../examples/Nef_3/topological_operations.cpp | 7 ++++--- Nef_3/examples/Nef_3/transformation.cpp | 7 ++++--- .../examples/Nef_S2/nef_s2_construction.cpp | 5 +++-- .../draw_periodic_2_triangulation_2.cpp | 1 - .../p2t2_info_insert_with_pair_iterator_2.cpp | 2 -- ..._info_insert_with_transform_iterator_2.cpp | 2 -- .../p2t2_info_insert_with_zip_iterator_2.cpp | 3 --- .../hole_filling_example_OM.cpp | 5 +++-- .../triangulate_polyline_example.cpp | 3 ++- .../polyhedron_prog_incr_builder.cpp | 3 ++- .../Polyhedron/polyhedron_prog_off.cpp | 1 - .../Polyhedron/polyhedron_prog_subdiv.cpp | 5 +++-- .../polyhedron_prog_subdiv_with_boundary.cpp | 12 +++++------ .../polyhedron_self_intersection.cpp | 3 ++- .../sdg-voronoi-edges-exact-linf.cpp | 2 -- .../sdg-voronoi-edges-linf.cpp | 2 -- .../examples/Stream_support/iv2off.cpp | 3 --- .../draw_surface_mesh_small_faces.h | 6 ++++-- .../Surface_mesh/sm_draw_small_faces.cpp | 4 ++-- .../tetrahedral_remeshing_generate_input.h | 9 ++++---- .../tetrahedral_remeshing_with_features.cpp | 11 +++++----- .../Triangulation_2/copy_triangulation_2.cpp | 3 ++- .../info_insert_with_pair_iterator_2.cpp | 2 -- ...fo_insert_with_pair_iterator_regular_2.cpp | 2 -- .../info_insert_with_transform_iterator_2.cpp | 2 -- .../info_insert_with_zip_iterator_2.cpp | 3 --- .../Triangulation_3/copy_triangulation_3.cpp | 3 ++- .../info_insert_with_pair_iterator.cpp | 2 -- ...info_insert_with_pair_iterator_regular.cpp | 2 -- .../info_insert_with_transform_iterator.cpp | 2 -- .../info_insert_with_zip_iterator.cpp | 2 -- 50 files changed, 124 insertions(+), 131 deletions(-) diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp index 28c8bea6915..1892df87e98 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp index 50ec6b0affa..57c96a907d8 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp @@ -7,6 +7,7 @@ #include #include +#include typedef CGAL::Simple_cartesian K; typedef CGAL::Surface_mesh SM; @@ -39,7 +40,7 @@ int main(int argc, char** argv) // Extract the part n°0 of the partition into a new, independent mesh typedef CGAL::Face_filtered_graph Filtered_graph; Filtered_graph filtered_sm(sm, 0 /*id of th part*/, face_pid_map); - CGAL_assertion(filtered_sm.is_selection_valid()); + assert(filtered_sm.is_selection_valid()); SM part_sm; CGAL::copy_face_graph(filtered_sm, part_sm); diff --git a/Generator/examples/Generator/random_segments2.cpp b/Generator/examples/Generator/random_segments2.cpp index d13c64c333b..f8c4fa99f62 100644 --- a/Generator/examples/Generator/random_segments2.cpp +++ b/Generator/examples/Generator/random_segments2.cpp @@ -8,6 +8,7 @@ #include #include #include +#include using namespace CGAL; @@ -41,16 +42,16 @@ int main() { Count_iterator t2_end( t2, 50); std::copy( t2_begin, t2_end, std::back_inserter(segs)); - CGAL_assertion( segs.size() == 100); + assert( segs.size() == 100); for ( Vector::iterator i = segs.begin(); i != segs.end(); i++){ - CGAL_assertion( i->source().x() <= 250); - CGAL_assertion( i->source().x() >= -250); - CGAL_assertion( i->source().y() <= 250); - CGAL_assertion( i->source().y() >= -250); - CGAL_assertion( i->target().x() <= 250); - CGAL_assertion( i->target().x() >= -250); - CGAL_assertion( i->target().y() <= 250); - CGAL_assertion( i->target().y() >= -250); + assert( i->source().x() <= 250); + assert( i->source().x() >= -250); + assert( i->source().y() <= 250); + assert( i->source().y() >= -250); + assert( i->target().x() <= 250); + assert( i->target().x() >= -250); + assert( i->target().y() <= 250); + assert( i->target().y() >= -250); } return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp index adcfdc0c5fe..ce64abdac99 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp @@ -1,6 +1,7 @@ #include #include #include +#include // A face type with a color member variable. template @@ -30,6 +31,6 @@ int main() { HDS hds; Face_handle f = hds.faces_push_back( Face( CGAL::IO::red())); f->color = CGAL::IO::blue(); - CGAL_assertion( f->color == CGAL::IO::blue()); + assert( f->color == CGAL::IO::blue()); return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp index 2c6844a496b..04690850cce 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp @@ -2,6 +2,7 @@ #include #include #include +#include // Define a new halfedge class. We assume that the Halfedge_handle can // be created from a pointer (e.g. the HalfedgeDS is based here on the @@ -55,15 +56,15 @@ public: (nxt & (~ std::ptrdiff_t(1)))); } void set_opposite( Halfedge_handle h) { - CGAL_precondition(( &* h - 1 == &* HDS::halfedge_handle(this)) || - ( &* h + 1 == &* HDS::halfedge_handle(this))); + assert(( &* h - 1 == &* HDS::halfedge_handle(this)) || + ( &* h + 1 == &* HDS::halfedge_handle(this))); if ( &* h - 1 == &* HDS::halfedge_handle(this)) nxt |= 1; else nxt &= (~ std::ptrdiff_t(1)); } void set_next( Halfedge_handle h) { - CGAL_precondition( ((std::ptrdiff_t)(&*h) & 1) == 0); + assert( ((std::ptrdiff_t)(&*h) & 1) == 0); nxt = ((std::ptrdiff_t)(&*h)) | (nxt & 1); } private: // Support for the Vertex_handle. @@ -99,6 +100,6 @@ int main() { HDS hds(1,2,2); Decorator decorator(hds); decorator.create_loop(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp index ff101610451..6c8ff61f26f 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp @@ -2,6 +2,7 @@ #include #include #include +#include // Define a new halfedge class. We assume that the Halfedge_handle can // be created from a pointer (e.g. the HalfedgeDS is based here on the @@ -54,15 +55,15 @@ public: (~ std::ptrdiff_t(1)))); } void set_opposite( Halfedge_handle h) { - CGAL_precondition(( &* h - 1 == &* HDS::halfedge_handle(this)) || - ( &* h + 1 == &* HDS::halfedge_handle(this))); + asseert(( &* h - 1 == &* HDS::halfedge_handle(this)) || + ( &* h + 1 == &* HDS::halfedge_handle(this))); if ( &* h - 1 == &* HDS::halfedge_handle(this)) nxt |= 1; else nxt &= (~ std::ptrdiff_t(1)); } void set_next( Halfedge_handle h) { - CGAL_precondition( ((std::ptrdiff_t)(&*h) & 1) == 0); + assert( ((std::ptrdiff_t)(&*h) & 1) == 0); nxt = ((std::ptrdiff_t)(&*h)) | (nxt & 1); } private: // Support for the Vertex_handle. @@ -98,6 +99,6 @@ int main() { HDS hds; Decorator decorator(hds); decorator.create_loop(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_default.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_default.cpp index 766d8d287ce..3f570bfa960 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_default.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_default.cpp @@ -1,5 +1,6 @@ #include #include +#include struct Traits { typedef int Point_2; }; typedef CGAL::HalfedgeDS_default HDS; @@ -9,6 +10,6 @@ int main() { HDS hds; Decorator decorator(hds); decorator.create_loop(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_edge_iterator.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_edge_iterator.cpp index 494552136f6..4e0d8fb6a42 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_edge_iterator.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_edge_iterator.cpp @@ -1,6 +1,7 @@ #include #include #include +#include struct Traits { typedef int Point_2; }; typedef CGAL::HalfedgeDS_default HDS; @@ -13,10 +14,10 @@ int main() { Decorator decorator(hds); decorator.create_loop(); decorator.create_segment(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); int n = 0; for ( Iterator e = hds.halfedges_begin(); e != hds.halfedges_end(); ++e) ++n; - CGAL_assertion( n == 2); // == 2 edges + assert( n == 2); // == 2 edges return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph.cpp index 32c087268ea..f5e7a26a443 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph.cpp @@ -1,6 +1,7 @@ #include #include #include +#include // no traits needed, argument can be arbitrary dummy. typedef CGAL::HalfedgeDS_default HDS; @@ -10,6 +11,6 @@ int main() { HDS hds; Decorator decorator(hds); decorator.create_loop(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph2.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph2.cpp index e33ec754b24..e042370de9a 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph2.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_graph2.cpp @@ -1,6 +1,7 @@ #include #include #include +#include // An items type using a halfedge with previous-pointer. struct My_items : public CGAL::HalfedgeDS_min_items { @@ -22,6 +23,6 @@ int main() { HDS hds; Decorator decorator(hds); decorator.create_loop(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); return 0; } diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_halfedge_iterator.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_halfedge_iterator.cpp index f1aea66723c..f81b87be6ee 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_halfedge_iterator.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_halfedge_iterator.cpp @@ -1,5 +1,6 @@ #include #include +#include struct Traits { typedef int Point_2; }; typedef CGAL::HalfedgeDS_default HDS; @@ -11,10 +12,10 @@ int main() { Decorator decorator(hds); decorator.create_loop(); decorator.create_segment(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); int n = 0; for ( Iterator i = hds.halfedges_begin(); i != hds.halfedges_end(); ++i ) ++n; - CGAL_assertion( n == 4); // == 2 edges + assert( n == 4); // == 2 edges return 0; } diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp index d87fd6bd85c..134092b3fba 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp @@ -8,6 +8,7 @@ #include #include +#include // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -54,8 +55,7 @@ const std::pair incident_subdomains[] = { int main() { const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*); - CGAL_assertion(sizeof(incident_subdomains) == - nb_patches * sizeof(std::pair)); + assert(sizeof(incident_subdomains) == nb_patches * sizeof(std::pair)); std::vector patches(nb_patches); for(std::size_t i = 0; i < nb_patches; ++i) { std::ifstream input(CGAL::data_file_path(filenames[i])); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp index 025870f6cbc..d6e2a8d8a89 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp @@ -9,6 +9,7 @@ #include #include #include +#include // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -63,8 +64,8 @@ int main() #endif const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*); - CGAL_assertion(sizeof(incident_subdomains) == - nb_patches * sizeof(std::pair)); + assert(sizeof(incident_subdomains) == + nb_patches * sizeof(std::pair)); std::vector patches(nb_patches); for(std::size_t i = 0; i < nb_patches; ++i) { std::ifstream input(CGAL::data_file_path(filenames[i])); diff --git a/Nef_2/examples/Nef_2/nef_2_construction.cpp b/Nef_2/examples/Nef_2/nef_2_construction.cpp index 903bee5bf28..cb434cf297f 100644 --- a/Nef_2/examples/Nef_2/nef_2_construction.cpp +++ b/Nef_2/examples/Nef_2/nef_2_construction.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Exact_integer RT; typedef CGAL::Filtered_extended_homogeneous Extended_kernel; @@ -15,13 +16,13 @@ int main() { Line l(2,4,2); // l : 2x + 4y + 2 = 0 Nef_polyhedron N2(l,Nef_polyhedron::INCLUDED); Nef_polyhedron N3 = N2.complement(); - CGAL_assertion(N1 == N2.join(N3)); + assert(N1 == N2.join(N3)); Point p1(0,0), p2(10,10), p3(-20,15); Point triangle[3] = { p1, p2, p3 }; Nef_polyhedron N4(triangle, triangle+3); Nef_polyhedron N5 = N2.intersection(N4); - CGAL_assertion(N5 <= N2 && N5 <= N4); + assert(N5 <= N2 && N5 <= N4); return 0; } diff --git a/Nef_3/examples/Nef_3/comparison.cpp b/Nef_3/examples/Nef_3/comparison.cpp index 79dceebb052..f6c5c40c474 100644 --- a/Nef_3/examples/Nef_3/comparison.cpp +++ b/Nef_3/examples/Nef_3/comparison.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Exact_integer NT; typedef CGAL::Extended_homogeneous Kernel; @@ -12,16 +13,16 @@ int main() { Nef_polyhedron N1(Plane_3(2,5,7,11), Nef_polyhedron::INCLUDED); Nef_polyhedron N2(Plane_3(2,5,7,11), Nef_polyhedron::EXCLUDED); - CGAL_assertion(N1 >= N2); - CGAL_assertion(N2 <= N1); - CGAL_assertion(N1 != N2); - CGAL_assertion(N1 > N2); - CGAL_assertion(N2 < N1); + assert(N1 >= N2); + assert(N2 <= N1); + assert(N1 != N2); + assert(N1 > N2); + assert(N2 < N1); N2 = N2.closure(); - CGAL_assertion(N1==N2); - CGAL_assertion(N1>=N2); - CGAL_assertion(N1<=N2); + assert(N1==N2); + assert(N1>=N2); + assert(N1<=N2); return 0; } diff --git a/Nef_3/examples/Nef_3/nef_3_construction.cpp b/Nef_3/examples/Nef_3/nef_3_construction.cpp index c70a1d5dae9..043f8ca8bdc 100644 --- a/Nef_3/examples/Nef_3/nef_3_construction.cpp +++ b/Nef_3/examples/Nef_3/nef_3_construction.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Extended_homogeneous Kernel; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; @@ -14,19 +15,19 @@ int main() { Nef_polyhedron N4(Plane_3( 1, 2, 5,-1), Nef_polyhedron::INCLUDED); Nef_polyhedron N5(Plane_3( 1, 2, 5,-1), Nef_polyhedron::EXCLUDED); - CGAL_assertion(N0 == N1); - CGAL_assertion(N3 == N4); - CGAL_assertion(N0 != N2); - CGAL_assertion(N3 != N5); + assert(N0 == N1); + assert(N3 == N4); + assert(N0 != N2); + assert(N3 != N5); - CGAL_assertion(N4 >= N5); - CGAL_assertion(N5 <= N4); - CGAL_assertion(N4 > N5); - CGAL_assertion(N5 < N4); + assert(N4 >= N5); + assert(N5 <= N4); + assert(N4 > N5); + assert(N5 < N4); N5 = N5.closure(); - CGAL_assertion(N4 >= N5); - CGAL_assertion(N4 <= N5); + assert(N4 >= N5); + assert(N4 <= N5); return 0; } diff --git a/Nef_3/examples/Nef_3/nef_3_simple.cpp b/Nef_3/examples/Nef_3/nef_3_simple.cpp index 5902ad85b20..bd9c1b2099b 100644 --- a/Nef_3/examples/Nef_3/nef_3_simple.cpp +++ b/Nef_3/examples/Nef_3/nef_3_simple.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Homogeneous Kernel; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; @@ -9,7 +10,7 @@ int main() { Nef_polyhedron N0(Nef_polyhedron::EMPTY); Nef_polyhedron N1(Nef_polyhedron::COMPLETE); - CGAL_assertion (N0 == N1.complement()); - CGAL_assertion (N0 != N1); + assert(N0 == N1.complement()); + assert(N0 != N1); return 0; } diff --git a/Nef_3/examples/Nef_3/point_set_operations.cpp b/Nef_3/examples/Nef_3/point_set_operations.cpp index 210ea348cef..82f09cd177d 100644 --- a/Nef_3/examples/Nef_3/point_set_operations.cpp +++ b/Nef_3/examples/Nef_3/point_set_operations.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Extended_homogeneous Kernel; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; @@ -22,11 +23,11 @@ int main() { Cube1 *= !I3; Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6; - CGAL_assertion(Cube1 == Cube2); // both are closed cube - CGAL_assertion(Cube1 == Cube1.closure()); - CGAL_assertion(Cube1 == Cube1.regularization()); - CGAL_assertion((N1 - N1.boundary()) == N1.interior()); - CGAL_assertion(I1.closure() == I1.complement().interior().complement()); - CGAL_assertion(I1.regularization() == I1.interior().closure()); + assert(Cube1 == Cube2); // both are closed cube + assert(Cube1 == Cube1.closure()); + assert(Cube1 == Cube1.regularization()); + assert((N1 - N1.boundary()) == N1.interior()); + assert(I1.closure() == I1.complement().interior().complement()); + assert(I1.regularization() == I1.interior().closure()); return 0; } diff --git a/Nef_3/examples/Nef_3/set_operations.cpp b/Nef_3/examples/Nef_3/set_operations.cpp index 5efa840cf8e..93a9ac78a96 100644 --- a/Nef_3/examples/Nef_3/set_operations.cpp +++ b/Nef_3/examples/Nef_3/set_operations.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Exact_integer NT; typedef CGAL::Extended_homogeneous Kernel; @@ -22,6 +23,6 @@ int main() { Nef_polyhedron Cube1(I2 *!I1); Cube1 *= !I3; Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6; - CGAL_assertion (Cube1 == Cube2); + assert(Cube1 == Cube2); return 0; } diff --git a/Nef_3/examples/Nef_3/topological_operations.cpp b/Nef_3/examples/Nef_3/topological_operations.cpp index 087d37b4418..d42d7210658 100644 --- a/Nef_3/examples/Nef_3/topological_operations.cpp +++ b/Nef_3/examples/Nef_3/topological_operations.cpp @@ -2,6 +2,7 @@ #include #include #include +#include typedef CGAL::Exact_integer NT; typedef CGAL::Homogeneous Kernel; @@ -12,9 +13,9 @@ int main() { Nef_polyhedron N; std::cin >> N; - CGAL_assertion((N - N.boundary()) == N.interior()); - CGAL_assertion(N.closure() == N.complement().interior().complement()); - CGAL_assertion(N.regularization() == N.interior().closure()); + assert((N - N.boundary()) == N.interior()); + assert(N.closure() == N.complement().interior().complement()); + assert(N.regularization() == N.interior().closure()); return 0; } diff --git a/Nef_3/examples/Nef_3/transformation.cpp b/Nef_3/examples/Nef_3/transformation.cpp index 0e79e62e832..a69de27ee48 100644 --- a/Nef_3/examples/Nef_3/transformation.cpp +++ b/Nef_3/examples/Nef_3/transformation.cpp @@ -2,6 +2,7 @@ #include #include #include +#include typedef CGAL::Extended_homogeneous Kernel; @@ -21,11 +22,11 @@ int main() { Aff_transformation_3 scale(CGAL::SCALING, 3, 2); N.transform(transl); - CGAL_assertion(N == Nef_polyhedron(Plane_3(0,1,0,-7))); + assert(N == Nef_polyhedron(Plane_3(0,1,0,-7))); N.transform(rotx90); - CGAL_assertion(N == Nef_polyhedron(Plane_3(0,0,1,-7))); + assert(N == Nef_polyhedron(Plane_3(0,0,1,-7))); N.transform(scale); - CGAL_assertion(N == Nef_polyhedron(Plane_3(0,0,2,-21))); + assert(N == Nef_polyhedron(Plane_3(0,0,2,-21))); return 0; } diff --git a/Nef_S2/examples/Nef_S2/nef_s2_construction.cpp b/Nef_S2/examples/Nef_S2/nef_s2_construction.cpp index 679f5f0b4bf..e0c28b413e0 100644 --- a/Nef_S2/examples/Nef_S2/nef_s2_construction.cpp +++ b/Nef_S2/examples/Nef_S2/nef_s2_construction.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Exact_integer RT; typedef CGAL::Homogeneous Kernel; @@ -16,7 +17,7 @@ int main() { Sphere_circle c(1,1,1); // c : x + y + z = 0 Nef_polyhedron N2(c, Nef_polyhedron::INCLUDED); Nef_polyhedron N3(N2.complement()); - CGAL_assertion(N1 == N2.join(N3)); + assert(N1 == N2.join(N3)); Sphere_point p1(1,0,0), p2(0,1,0), p3(0,0,1); Sphere_segment s1(p1,p2), s2(p2,p3), s3(p3,p1); Sphere_segment triangle[3] = { s1, s2, s3 }; @@ -24,7 +25,7 @@ int main() { Nef_polyhedron N5; N5 += N2; N5 = N5.intersection(N4); - CGAL_assertion(N5 <= N2 && N5 != N4); + assert(N5 <= N2 && N5 != N4); return 0; } diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/draw_periodic_2_triangulation_2.cpp b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/draw_periodic_2_triangulation_2.cpp index c99cf2361d0..11bbef2e0f4 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/draw_periodic_2_triangulation_2.cpp +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/draw_periodic_2_triangulation_2.cpp @@ -23,7 +23,6 @@ int main(int argc, char* argv[]) { while (ifs >> p) { T.insert(p); } - CGAL_assertion(T.is_valid()); if( T.is_triangulation_in_1_sheet()) { T.convert_to_9_sheeted_covering(); } diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_pair_iterator_2.cpp b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_pair_iterator_2.cpp index 921afdc0bd1..3a18d93e99d 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_pair_iterator_2.cpp +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_pair_iterator_2.cpp @@ -31,8 +31,6 @@ int main() Delaunay T; T.insert( points.begin(), points.end() ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. Delaunay::Finite_vertices_iterator vit; for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_transform_iterator_2.cpp b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_transform_iterator_2.cpp index c67bf9f324c..e416be8bf4f 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_transform_iterator_2.cpp +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_transform_iterator_2.cpp @@ -46,8 +46,6 @@ int main() T.insert( boost::make_transform_iterator(points.begin(), Auto_count()), boost::make_transform_iterator(points.end(), Auto_count() ) ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. Delaunay::Finite_vertices_iterator vit; for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_zip_iterator_2.cpp b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_zip_iterator_2.cpp index 7862f102373..dabb31388a7 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_zip_iterator_2.cpp +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_info_insert_with_zip_iterator_2.cpp @@ -41,9 +41,6 @@ int main() T.insert( boost::make_zip_iterator(boost::make_tuple( points.begin(), indices.begin() )), boost::make_zip_iterator(boost::make_tuple( points.end(), indices.end() ) ) ); - CGAL_assertion( T.number_of_vertices() == 6 ); - - // check that the info was correctly set. Delaunay::Finite_vertices_iterator vit; for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_OM.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_OM.cpp index 1ebd95c650d..cc8dd4d54f4 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_OM.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_OM.cpp @@ -10,6 +10,7 @@ #include #include #include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -42,7 +43,7 @@ int main(int argc, char* argv[]) CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh)) .geom_traits(Kernel()))); - CGAL_assertion(CGAL::is_valid_polygon_mesh(mesh)); + assert(CGAL::is_valid_polygon_mesh(mesh)); std::cout << "* FILL HOLE NUMBER " << ++nb_holes << std::endl; std::cout << " Number of facets in constructed patch: " << patch_facets.size() << std::endl; @@ -51,7 +52,7 @@ int main(int argc, char* argv[]) } } - CGAL_assertion(CGAL::is_valid_polygon_mesh(mesh)); + assert(CGAL::is_valid_polygon_mesh(mesh)); std::cout << std::endl; std::cout << nb_holes << " holes have been filled" << std::endl; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_polyline_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_polyline_example.cpp index 204dd3e2ed5..5133aa1ffcc 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_polyline_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_polyline_example.cpp @@ -5,6 +5,7 @@ #include #include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; @@ -44,7 +45,7 @@ int main() std::vector patch_will_be_empty; CGAL::Polygon_mesh_processing::triangulate_hole_polyline(polyline_collinear, back_inserter(patch_will_be_empty)); - CGAL_assertion(patch_will_be_empty.empty()); + assert(patch_will_be_empty.empty()); return 0; } diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_incr_builder.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_incr_builder.cpp index a5f62cce5a1..f43e5b4e6a8 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_incr_builder.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_incr_builder.cpp @@ -1,6 +1,7 @@ #include #include #include +#include // A modifier creating a triangle with the incremental builder. template @@ -33,6 +34,6 @@ int main() { Polyhedron P; Build_triangle triangle; P.delegate( triangle); - CGAL_assertion( P.is_triangle( P.halfedges_begin())); + assert( P.is_triangle( P.halfedges_begin())); return 0; } diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp index d1fdd179c41..ff7a3209571 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp @@ -26,7 +26,6 @@ int main() { for ( Facet_iterator i = P.facets_begin(); i != P.facets_end(); ++i) { Halfedge_facet_circulator j = i->facet_begin(); // Facets in polyhedral surfaces are at least triangles. - CGAL_assertion( CGAL::circulator_size(j) >= 3); std::cout << CGAL::circulator_size(j) << ' '; do { std::cout << ' ' << std::distance(P.vertices_begin(), j->vertex()); diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv.cpp index 0a2c85b4c8c..e972a9f92d8 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv.cpp @@ -5,6 +5,7 @@ #include #include #include +#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Vector_3 Vector; @@ -27,7 +28,7 @@ void create_center_vertex( Polyhedron& P, Facet_iterator f) { vec = vec + ( h->vertex()->point() - CGAL::ORIGIN); ++ order; } while ( ++h != f->facet_begin()); - CGAL_assertion( order >= 3); // guaranteed by definition of polyhedron + assert( order >= 3); // guaranteed by definition of polyhedron Point center = CGAL::ORIGIN + (vec / static_cast(order)); Halfedge_handle new_center = P.create_center_vertex( f->halfedge()); new_center->vertex()->point() = center; @@ -44,7 +45,7 @@ struct Smooth_old_vertex { vec = vec + ( h->opposite()->vertex()->point() - CGAL::ORIGIN) * alpha / static_cast(degree); ++ h; - CGAL_assertion( h != v.vertex_begin()); // even degree guaranteed + assert( h != v.vertex_begin()); // even degree guaranteed ++ h; } while ( h != v.vertex_begin()); return (CGAL::ORIGIN + vec); diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv_with_boundary.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv_with_boundary.cpp index f1d0de4f8f5..d8c7c05c2e5 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv_with_boundary.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv_with_boundary.cpp @@ -7,6 +7,7 @@ #include #include #include +#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Vector_3 Vector; @@ -29,7 +30,7 @@ void create_center_vertex( Polyhedron& P, Facet_iterator f) { vec = vec + ( h->vertex()->point() - CGAL::ORIGIN); ++ order; } while ( ++h != f->facet_begin()); - CGAL_assertion( order >= 3); // guaranteed by definition of polyhedron + assert( order >= 3); // guaranteed by definition of polyhedron Point center = CGAL::ORIGIN + (vec / static_cast(order)); Halfedge_handle new_center = P.create_center_vertex( f->halfedge()); new_center->vertex()->point() = center; @@ -55,7 +56,7 @@ struct Smooth_old_vertex { vec = vec + ( h->opposite()->vertex()->point() - CGAL::ORIGIN) * alpha / static_cast(degree); ++ h; - CGAL_assertion( h != v.vertex_begin()); // even degree guaranteed + assert( h != v.vertex_begin()); // even degree guaranteed ++ h; } while ( h != v.vertex_begin()); return (CGAL::ORIGIN + vec); @@ -101,11 +102,10 @@ void subdiv( Polyhedron& P) { ++e; // careful, incr. before flip since flip destroys current edge flip_edge( P, h); }; - CGAL_postcondition( P.is_valid()); } void trisect_border_halfedge( Polyhedron& P, Halfedge_handle e) { - CGAL_precondition( e->is_border()); + assert( e->is_border()); // Create two new vertices on e. e = e->prev(); P.split_vertex( e, e->next()->opposite()); @@ -121,7 +121,7 @@ void trisect_border_halfedge( Polyhedron& P, Halfedge_handle e) { template void smooth_border_vertices( Halfedge_handle e, OutputIterator out) { - CGAL_precondition( e->is_border()); + assert( e->is_border()); // We know that the vertex at this edge is from the unrefined mesh. // Get the locus vectors of the unrefined vertices in the neighborhood. Vector v0 = e->prev()->prev()->opposite()->vertex()->point() -CGAL::ORIGIN; @@ -166,8 +166,6 @@ void subdiv_border( Polyhedron& P) { e->next()->vertex()->point() = *i++; } } while ( e++ != last_e); - CGAL_assertion( i == pts.end()); - CGAL_postcondition( P.is_valid()); } using namespace std; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp b/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp index 4561bd14770..909531d09eb 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp @@ -6,6 +6,7 @@ #include #include #include +#include using std::cerr; using std::endl; @@ -63,7 +64,7 @@ struct Intersect_facets { } if ( v != Halfedge_const_handle()) { // found shared vertex: - CGAL_assertion( h->vertex() == v->vertex()); + assert( h->vertex() == v->vertex()); // geomtric check if the opposite segments intersect the triangles Triangle t1( h->vertex()->point(), h->next()->vertex()->point(), diff --git a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-exact-linf.cpp b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-exact-linf.cpp index 99f740e5110..7259ddd553e 100644 --- a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-exact-linf.cpp +++ b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-exact-linf.cpp @@ -35,8 +35,6 @@ int main( int argc, char *argv[] ) { // read the sites from the stream and insert them in the diagram while ( ifs >> site ) { sdg.insert( site ); - CGAL_SDG_DEBUG( sdg.file_output_verbose(std::cout); ); - CGAL_assertion( sdg.is_valid(false, 1) ); } ifs.close(); diff --git a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-linf.cpp b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-linf.cpp index 576f3fe4d4c..9a6fc350e19 100644 --- a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-linf.cpp +++ b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/sdg-voronoi-edges-linf.cpp @@ -32,8 +32,6 @@ int main( int argc, char *argv[] ) { // read the sites from the stream and insert them in the diagram while ( ifs >> site ) { sdg.insert( site ); - CGAL_SDG_DEBUG( sdg.file_output_verbose(std::cout); ); - CGAL_assertion( sdg.is_valid(false, 1) ); } ifs.close(); diff --git a/Stream_support/examples/Stream_support/iv2off.cpp b/Stream_support/examples/Stream_support/iv2off.cpp index 231c7cff65d..676a6e56ac4 100644 --- a/Stream_support/examples/Stream_support/iv2off.cpp +++ b/Stream_support/examples/Stream_support/iv2off.cpp @@ -67,7 +67,6 @@ void iv_file_scanner( istream& in) // point coordinate list starts here offset = points.size(); in >> c; - CGAL_assertion( c == '['); in >> c; while ( in && ( c != ']')) { in.putback( c); @@ -99,7 +98,6 @@ void iv_file_scanner( istream& in) // indices start here std::size_t face_offset = facets.size(); in >> c; - CGAL_assertion( c == '['); facets.push_back( Facet()); Facet* facet = &facets.back(); in >> c; @@ -133,7 +131,6 @@ void iv_file_scanner( istream& in) // indices start here std::size_t face_offset = facets.size(); in >> c; - CGAL_assertion( c == '['); facets.push_back( Facet()); Facet* facet = &facets.back(); in >> c; diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h index 0e5043c8f08..b8eeac5b008 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h @@ -20,6 +20,8 @@ #include #include +#include + template class SimpleSurfaceMeshWithSmallFacesViewerQt : public CGAL::Basic_viewer_qt { @@ -54,7 +56,7 @@ public: bool exist; typename SM::template Property_map faces_size; boost::tie(faces_size, exist)=sm.template property_map("f:size"); - CGAL_assertion(exist); + assert(exist); m_min_size=faces_size[*(sm.faces().begin())]; m_max_size=m_min_size; @@ -84,7 +86,7 @@ protected: bool exist; typename SM::template Property_map faces_size; boost::tie(faces_size, exist)=sm.template property_map("f:size"); - CGAL_assertion(exist); + assert(exist); // It it is smaller, color the face in red. if (get(faces_size, fh) #include #include +#include #include "draw_surface_mesh_small_faces.h" typedef CGAL::Simple_cartesian K; @@ -28,7 +29,7 @@ int main(int argc, char* argv[]) Mesh::Property_map faces_size; bool created; boost::tie(faces_size, created)=sm.add_property_map("f:size",0.); - CGAL_assertion(created); + assert(created); for(face_descriptor fd : sm.faces()) { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } @@ -39,4 +40,3 @@ int main(int argc, char* argv[]) return EXIT_SUCCESS; } - diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_generate_input.h b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_generate_input.h index 7f020ae5c6a..36afb2b7419 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_generate_input.h +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_generate_input.h @@ -14,6 +14,7 @@ #include #include +#include namespace CGAL { @@ -42,7 +43,7 @@ namespace Tetrahedral_remeshing else c->set_subdomain_index(2); } - CGAL_assertion(tr.is_valid(true)); + assert(tr.is_valid(true)); } @@ -66,7 +67,7 @@ namespace Tetrahedral_remeshing for (typename Tr::Cell_handle c : tr.finite_cell_handles()) c->set_subdomain_index(1); - CGAL_assertion(tr.is_valid(true)); + assert(tr.is_valid(true)); } template @@ -185,7 +186,7 @@ namespace Tetrahedral_remeshing add_edge(v2, v6, tr, constraints); add_edge(v3, v7, tr, constraints); - CGAL_assertion(tr.is_valid(true)); + assert(tr.is_valid(true)); } } -} \ No newline at end of file +} diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp index 26c967e5f63..bc7504705d7 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp @@ -9,6 +9,7 @@ #include #include +#include #include "tetrahedral_remeshing_generate_input.h" @@ -45,8 +46,8 @@ public: const key_type& k, const bool b) { - CGAL_assertion(map.m_set_ptr != nullptr); - CGAL_assertion(k.first < k.second); + assert(map.m_set_ptr != nullptr); + assert(k.first < k.second); if (b) map.m_set_ptr->insert(k); else map.m_set_ptr->erase(k); } @@ -54,8 +55,8 @@ public: friend value_type get(const Constrained_edges_property_map& map, const key_type& k) { - CGAL_assertion(map.m_set_ptr != nullptr); - CGAL_assertion(k.first < k.second); + assert(map.m_set_ptr != nullptr); + assert(k.first < k.second); return (map.m_set_ptr->count(k) > 0); } }; @@ -80,7 +81,6 @@ int main(int argc, char* argv[]) CGAL::Tetrahedral_remeshing::generate_input_cube(nbv, t3, constraints); make_constraints_from_cube_edges(t3, constraints); - CGAL_assertion(t3.is_valid()); CGAL::tetrahedral_isotropic_remeshing(t3, target_edge_length, CGAL::parameters::edge_is_constrained_map( @@ -89,4 +89,3 @@ int main(int argc, char* argv[]) return EXIT_SUCCESS; } - diff --git a/Triangulation_2/examples/Triangulation_2/copy_triangulation_2.cpp b/Triangulation_2/examples/Triangulation_2/copy_triangulation_2.cpp index db1bd13ea3a..e757b35c7fb 100644 --- a/Triangulation_2/examples/Triangulation_2/copy_triangulation_2.cpp +++ b/Triangulation_2/examples/Triangulation_2/copy_triangulation_2.cpp @@ -3,6 +3,7 @@ #include #include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC; @@ -44,5 +45,5 @@ int main() dt2_epec.set_infinite_vertex( dt2_epec.tds().copy_tds( dt2_epic.tds(),dt2_epic.infinite_vertex(), Convert_vertex(), Convert_face() ) ); - CGAL_assertion( dt2_epec.is_valid() ); + assert( dt2_epec.is_valid() ); } diff --git a/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_2.cpp b/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_2.cpp index 5d5f3620366..21d0df6bebd 100644 --- a/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_2.cpp +++ b/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_2.cpp @@ -24,8 +24,6 @@ int main() Delaunay T; T.insert( points.begin(),points.end() ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. Delaunay::Finite_vertices_iterator vit; for (Vertex_handle v : T.finite_vertex_handles()) diff --git a/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_regular_2.cpp b/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_regular_2.cpp index 27b51dba0db..468b386d888 100644 --- a/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_regular_2.cpp +++ b/Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_regular_2.cpp @@ -28,8 +28,6 @@ int main() Regular rt; rt.insert( points.begin(),points.end() ); - CGAL_assertion( rt.number_of_vertices() == 6 ); - // check that the info was correctly set. for (Vertex_handle v : rt.finite_vertex_handles()) if( points[ v->info() ].first != v->point() ){ diff --git a/Triangulation_2/examples/Triangulation_2/info_insert_with_transform_iterator_2.cpp b/Triangulation_2/examples/Triangulation_2/info_insert_with_transform_iterator_2.cpp index 5cf0f395c7a..13de245d23d 100644 --- a/Triangulation_2/examples/Triangulation_2/info_insert_with_transform_iterator_2.cpp +++ b/Triangulation_2/examples/Triangulation_2/info_insert_with_transform_iterator_2.cpp @@ -37,8 +37,6 @@ int main() T.insert( boost::make_transform_iterator(points.begin(),Auto_count()), boost::make_transform_iterator(points.end(), Auto_count() ) ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. Delaunay::Finite_vertices_iterator vit; for (Vertex_handle v : T.finite_vertex_handles()) diff --git a/Triangulation_2/examples/Triangulation_2/info_insert_with_zip_iterator_2.cpp b/Triangulation_2/examples/Triangulation_2/info_insert_with_zip_iterator_2.cpp index 27b0855a8c9..94059abb6f7 100644 --- a/Triangulation_2/examples/Triangulation_2/info_insert_with_zip_iterator_2.cpp +++ b/Triangulation_2/examples/Triangulation_2/info_insert_with_zip_iterator_2.cpp @@ -36,9 +36,6 @@ int main() T.insert( boost::make_zip_iterator(boost::make_tuple( points.begin(),indices.begin() )), boost::make_zip_iterator(boost::make_tuple( points.end(),indices.end() ) ) ); - CGAL_assertion( T.number_of_vertices() == 6 ); - - // check that the info was correctly set. for (Vertex_handle v : T.finite_vertex_handles()) diff --git a/Triangulation_3/examples/Triangulation_3/copy_triangulation_3.cpp b/Triangulation_3/examples/Triangulation_3/copy_triangulation_3.cpp index 2915dc1ef6c..ab7e2c42458 100644 --- a/Triangulation_3/examples/Triangulation_3/copy_triangulation_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/copy_triangulation_3.cpp @@ -3,6 +3,7 @@ #include #include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC; @@ -43,5 +44,5 @@ int main() dt3_epec.set_infinite_vertex( dt3_epec.tds().copy_tds( dt3_epic.tds(),dt3_epic.infinite_vertex(), Convert_vertex(), Convert_cell() ) ); - CGAL_assertion( dt3_epec.is_valid() ); + assert( dt3_epec.is_valid() ); } diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp index 0b9c8a44100..8e089f0c368 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator.cpp @@ -26,8 +26,6 @@ int main() Delaunay T( points.begin(),points.end() ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. for (Delaunay::Vertex_handle v : T.finite_vertex_handles()) if( points[ v->info() ].first != v->point() ){ diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator_regular.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator_regular.cpp index 63d68a3e20a..ec51d80a277 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator_regular.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_pair_iterator_regular.cpp @@ -26,8 +26,6 @@ int main() Regular rt( points.begin(),points.end() ); - CGAL_assertion( rt.number_of_vertices() == 6 ); - // check that the info was correctly set. for (Regular::Vertex_handle v : rt.finite_vertex_handles()) if( points[ v->info() ].first != v->point() ){ diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp index b28d792f3d4..9c673471bc9 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_transform_iterator.cpp @@ -38,8 +38,6 @@ int main() Delaunay T( boost::make_transform_iterator(points.begin(),Auto_count()), boost::make_transform_iterator(points.end(), Auto_count() ) ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. for (Delaunay::Vertex_handle v : T.finite_vertex_handles()) if( points[ v->info() ] != v->point() ){ diff --git a/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp b/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp index bf3a5988f30..ba8eb60b2f8 100644 --- a/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp +++ b/Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp @@ -37,8 +37,6 @@ int main() Delaunay T( boost::make_zip_iterator(boost::make_tuple( points.begin(),indices.begin() )), boost::make_zip_iterator(boost::make_tuple( points.end(),indices.end() ) ) ); - CGAL_assertion( T.number_of_vertices() == 6 ); - // check that the info was correctly set. for (Delaunay::Vertex_handle v : T.finite_vertex_handles() ) if( points[ v->info() ] != v->point() ){ From c7730920cf6b457d6af2a504f4cc707debd8138b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Jan 2022 10:27:38 +0000 Subject: [PATCH 02/10] untabify --- HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp | 2 +- HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp | 2 +- Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp index 04690850cce..dd1f3d6c432 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact.cpp @@ -57,7 +57,7 @@ public: } void set_opposite( Halfedge_handle h) { assert(( &* h - 1 == &* HDS::halfedge_handle(this)) || - ( &* h + 1 == &* HDS::halfedge_handle(this))); + ( &* h + 1 == &* HDS::halfedge_handle(this))); if ( &* h - 1 == &* HDS::halfedge_handle(this)) nxt |= 1; else diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp index 6c8ff61f26f..2d4f3f6893d 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp @@ -56,7 +56,7 @@ public: } void set_opposite( Halfedge_handle h) { asseert(( &* h - 1 == &* HDS::halfedge_handle(this)) || - ( &* h + 1 == &* HDS::halfedge_handle(this))); + ( &* h + 1 == &* HDS::halfedge_handle(this))); if ( &* h - 1 == &* HDS::halfedge_handle(this)) nxt |= 1; else diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp index d6e2a8d8a89..789b5737892 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp @@ -65,7 +65,7 @@ int main() const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*); assert(sizeof(incident_subdomains) == - nb_patches * sizeof(std::pair)); + nb_patches * sizeof(std::pair)); std::vector patches(nb_patches); for(std::size_t i = 0; i < nb_patches; ++i) { std::ifstream input(CGAL::data_file_path(filenames[i])); From a75a88945dad3058f1dcf91191b2d851fbcaccc7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Jan 2022 16:43:39 +0000 Subject: [PATCH 03/10] LCC CM GM --- .../Combinatorial_map/map_3_operations.cpp | 30 +++++++++---------- .../examples/Generalized_map/gmap_3_marks.cpp | 8 ++--- .../Generalized_map/gmap_3_operations.cpp | 16 +++++----- .../Generalized_map/gmap_4_simple_example.cpp | 3 +- .../examples/HalfedgeDS/hds_prog_vector.cpp | 3 +- .../linear_cell_complex_4.cpp | 10 +++---- .../Linear_cell_complex/voronoi_2.cpp | 10 +++---- .../Linear_cell_complex/voronoi_3.cpp | 8 ++--- 8 files changed, 45 insertions(+), 43 deletions(-) diff --git a/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp b/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp index cf96103b56a..2949da9b484 100644 --- a/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp +++ b/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Combinatorial_map<3> CMap_3; typedef CMap_3::Dart_handle Dart_handle; @@ -13,19 +14,19 @@ int main() Dart_handle dh1 = cm.make_combinatorial_hexahedron(); // Add two edges along two opposite facets. - CGAL_assertion( cm.is_insertable_cell_1_in_cell_2 - (cm.beta(dh1,1),cm.beta(dh1,0)) ); + assert( cm.is_insertable_cell_1_in_cell_2 + (cm.beta(dh1,1),cm.beta(dh1,0)) ); cm.insert_cell_1_in_cell_2(cm.beta(dh1,1), cm.beta(dh1,0)); - CGAL_assertion( cm.is_valid() ); + assert( cm.is_valid() ); Dart_handle dh2=cm.beta(dh1,2,1,1,2); - CGAL_assertion( cm.is_insertable_cell_1_in_cell_2 - (dh2,cm.beta(dh2,1,1)) ); + assert( cm.is_insertable_cell_1_in_cell_2 + (dh2,cm.beta(dh2,1,1)) ); cm.insert_cell_1_in_cell_2(dh2, cm.beta(dh2,1,1)); - CGAL_assertion( cm.is_valid() ); + assert( cm.is_valid() ); // Insert a facet along these two new edges plus two initial edges // of the hexahedron. @@ -35,28 +36,28 @@ int main() path.push_back(cm.beta(dh2,0)); path.push_back(cm.beta(dh2,2,1)); - CGAL_assertion( (cm.is_insertable_cell_2_in_cell_3 + assert( (cm.is_insertable_cell_2_in_cell_3 (path.begin(),path.end())) ); Dart_handle dh3=cm.insert_cell_2_in_cell_3(path.begin(),path.end()); - CGAL_assertion( cm.is_valid() ); + assert( cm.is_valid() ); // Display the combinatorial map characteristics. cm.display_characteristics(std::cout) << ", valid=" << cm.is_valid() << std::endl; // We use the removal operations to get back to the initial hexahedron. - CGAL_assertion( (cm.is_removable<2>(dh3)) ); + assert( (cm.is_removable<2>(dh3)) ); cm.remove_cell<2>(dh3); - CGAL_assertion( cm.is_valid() ); + assert( cm.is_valid() ); - CGAL_assertion( (cm.is_removable<1>(cm.beta(dh1,1))) ); + assert( (cm.is_removable<1>(cm.beta(dh1,1))) ); cm.remove_cell<1>(cm.beta(dh1,1)); - CGAL_assertion( cm.is_valid() ); + assert( cm.is_valid() ); - CGAL_assertion( (cm.is_removable<1>(cm.beta(dh2,0))) ); + assert( (cm.is_removable<1>(cm.beta(dh2,0))) ); cm.remove_cell<1>(cm.beta(dh2,0)); - CGAL_assertion( cm.is_valid() ); + assert( cm.is_valid() ); // Display the combinatorial map characteristics. cm.display_characteristics(std::cout) << ", valid=" @@ -64,4 +65,3 @@ int main() return EXIT_SUCCESS; } - diff --git a/Generalized_map/examples/Generalized_map/gmap_3_marks.cpp b/Generalized_map/examples/Generalized_map/gmap_3_marks.cpp index a0d3acb288d..e87b9413fbd 100644 --- a/Generalized_map/examples/Generalized_map/gmap_3_marks.cpp +++ b/Generalized_map/examples/Generalized_map/gmap_3_marks.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Generalized_map<3> GMap_3; typedef GMap_3::Dart_handle Dart_handle; @@ -26,9 +27,9 @@ int main() Dart_handle dh1 = gm.make_combinatorial_tetrahedron(); Dart_handle dh2 = gm.make_combinatorial_tetrahedron(); - CGAL_assertion( gm.is_valid() ); - CGAL_assertion( gm.is_volume_combinatorial_tetrahedron(dh1) ); - CGAL_assertion( gm.is_volume_combinatorial_tetrahedron(dh2) ); + assert( gm.is_valid() ); + assert( gm.is_volume_combinatorial_tetrahedron(dh1) ); + assert( gm.is_volume_combinatorial_tetrahedron(dh2) ); // 3) 3-sew them. gm.sew<3>(dh1, dh2); @@ -59,4 +60,3 @@ int main() return EXIT_SUCCESS; } - diff --git a/Generalized_map/examples/Generalized_map/gmap_3_operations.cpp b/Generalized_map/examples/Generalized_map/gmap_3_operations.cpp index 9c3050d6dbd..7b99b1838f2 100644 --- a/Generalized_map/examples/Generalized_map/gmap_3_operations.cpp +++ b/Generalized_map/examples/Generalized_map/gmap_3_operations.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Generalized_map<3> GMap_3; typedef GMap_3::Dart_handle Dart_handle; @@ -14,11 +15,11 @@ int main() // Add two edges along two opposite facets. gm.insert_cell_1_in_cell_2(d1,gm.alpha<0,1,0>(d1)); - CGAL_assertion( gm.is_valid() ); + assert( gm.is_valid() ); Dart_handle d2=gm.alpha<2,1,0,1,2>(d1); gm.insert_cell_1_in_cell_2(d2,gm.alpha<0,1,0>(d2)); - CGAL_assertion( gm.is_valid() ); + assert( gm.is_valid() ); // Insert a facet along these two new edges plus two initial edges // of the hexahedron. @@ -29,7 +30,7 @@ int main() path.push_back(gm.alpha<2,1>(d2)); Dart_handle d3=gm.insert_cell_2_in_cell_3(path.begin(),path.end()); - CGAL_assertion( gm.is_valid() ); + assert( gm.is_valid() ); // Display the generalized map characteristics. gm.display_characteristics(std::cout) << ", valid=" << @@ -37,14 +38,14 @@ int main() // We use the removal operations to get back to the initial hexahedron. gm.remove_cell<2>(d3); - CGAL_assertion( gm.is_valid() ); + assert( gm.is_valid() ); gm.remove_cell<1>(gm.alpha<1>(d1)); - CGAL_assertion( gm.is_valid() ); + assert( gm.is_valid() ); gm.remove_cell<1>(gm.alpha<1>(d2)); - CGAL_assertion( gm.is_valid() ); - CGAL_assertion( gm.is_volume_combinatorial_hexahedron(d1) ); + assert( gm.is_valid() ); + assert( gm.is_volume_combinatorial_hexahedron(d1) ); // Display the generalized map characteristics. gm.display_characteristics(std::cout) << ", valid=" @@ -52,4 +53,3 @@ int main() return EXIT_SUCCESS; } - diff --git a/Generalized_map/examples/Generalized_map/gmap_4_simple_example.cpp b/Generalized_map/examples/Generalized_map/gmap_4_simple_example.cpp index e447da890e0..0f31affd7e0 100644 --- a/Generalized_map/examples/Generalized_map/gmap_4_simple_example.cpp +++ b/Generalized_map/examples/Generalized_map/gmap_4_simple_example.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Generalized_map<4> GMap_4; typedef GMap_4::Dart_handle Dart_handle; @@ -11,7 +12,7 @@ int main() Dart_handle d1 = gm.make_combinatorial_tetrahedron(); Dart_handle d2 = gm.make_combinatorial_tetrahedron(); - CGAL_assertion(gm.is_valid()); + assert(gm.is_valid()); gm.sew<4>(d1,d2); diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_vector.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_vector.cpp index 6e7fab933bb..9843c8199cc 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_vector.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_vector.cpp @@ -1,6 +1,7 @@ #include #include #include +#include struct Traits { typedef int Point_2; }; typedef CGAL::HalfedgeDS_vector< Traits, CGAL::HalfedgeDS_items_2> HDS; @@ -10,6 +11,6 @@ int main() { HDS hds(1,2,2); Decorator decorator(hds); decorator.create_loop(); - CGAL_assertion( decorator.is_valid()); + assert( decorator.is_valid()); return 0; } diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_4.cpp b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_4.cpp index c912b78abb2..e83e81fb878 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_4.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_4.cpp @@ -1,6 +1,7 @@ #include #include #include +#include typedef CGAL::Linear_cell_complex_for_generalized_map<4,5> LCC_4; typedef LCC_4::Dart_handle Dart_handle; @@ -42,24 +43,24 @@ int main() // Add one vertex on the middle of the edge containing dart d1. Dart_handle d3 = lcc.insert_barycenter_in_cell<1>(d1); - CGAL_assertion( lcc.is_valid() ); + assert( lcc.is_valid() ); lcc.display_characteristics(std::cout); std::cout<<", valid="< #include #include -#include +#include #include #include @@ -28,7 +28,7 @@ int main(int argc, char **argv) std::copy_n(rand_it, N, std::back_inserter(points)); T t(D); - CGAL_assertion(t.empty()); + assert(t.empty()); // insert the points in the triangulation, only if they are outside the // convex hull diff --git a/Triangulation/examples/Triangulation/regular_triangulation.cpp b/Triangulation/examples/Triangulation/regular_triangulation.cpp index 4dc0bf5e6c1..fb2b30ccf8c 100644 --- a/Triangulation/examples/Triangulation/regular_triangulation.cpp +++ b/Triangulation/examples/Triangulation/regular_triangulation.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include @@ -27,11 +27,11 @@ int main() points.push_back(Weighted_point(*rand_it++, rng.get_double(0., 10.))); T t(D); - CGAL_assertion(t.empty()); + assert(t.empty()); // Insert the points in the triangulation t.insert(points.begin(), points.end()); - CGAL_assertion( t.is_valid() ); + assert( t.is_valid() ); std::cout << "Regular triangulation successfully computed: " << t.number_of_vertices() << " vertices, " << t.number_of_finite_full_cells() << " finite cells." diff --git a/Triangulation/examples/Triangulation/triangulation.cpp b/Triangulation/examples/Triangulation/triangulation.cpp index 966b771cbdb..0044bc1da77 100644 --- a/Triangulation/examples/Triangulation/triangulation.cpp +++ b/Triangulation/examples/Triangulation/triangulation.cpp @@ -4,11 +4,11 @@ #include #include #include -#include #include #include #include +#include typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > K; typedef CGAL::Triangulation Triangulation; @@ -23,9 +23,9 @@ int main() std::copy_n(rand_it, N, std::back_inserter(points)); Triangulation t(D); // create triangulation - CGAL_assertion(t.empty()); + assert(t.empty()); t.insert(points.begin(), points.end()); // compute triangulation - CGAL_assertion( t.is_valid() ); + assert( t.is_valid() ); // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 typedef Triangulation::Face Face; typedef std::vector Faces; @@ -41,4 +41,3 @@ int main() return 0; } - diff --git a/Triangulation/examples/Triangulation/triangulation_data_structure_dynamic.cpp b/Triangulation/examples/Triangulation/triangulation_data_structure_dynamic.cpp index f8fc86dff17..3d06d01ccda 100644 --- a/Triangulation/examples/Triangulation/triangulation_data_structure_dynamic.cpp +++ b/Triangulation/examples/Triangulation/triangulation_data_structure_dynamic.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include @@ -11,17 +11,17 @@ int main() typedef TDS::Vertex_handle Vertex_handle; TDS D(ddim); // the argument is taken into account. - CGAL_assertion( ddim == D.maximal_dimension() ); - CGAL_assertion( -2 == D.current_dimension() ); - CGAL_assertion( D.is_valid() ); + assert( ddim == D.maximal_dimension() ); + assert( -2 == D.current_dimension() ); + assert( D.is_valid() ); std::vector V(5); V[0] = D.insert_increase_dimension(); V[1] = D.insert_increase_dimension(V[0]); V[2] = D.insert_increase_dimension(V[0]); V[3] = D.insert_increase_dimension(V[0]); V[4] = D.insert_in_full_cell(V[3]->full_cell()); - CGAL_assertion( 6 == D.number_of_full_cells() ); - CGAL_assertion( 2 == D.current_dimension() ); - CGAL_assertion( D.is_valid() ); + assert( 6 == D.number_of_full_cells() ); + assert( 2 == D.current_dimension() ); + assert( D.is_valid() ); return 0; } diff --git a/Triangulation/examples/Triangulation/triangulation_data_structure_static.cpp b/Triangulation/examples/Triangulation/triangulation_data_structure_static.cpp index c56ae7390ca..19c22790805 100644 --- a/Triangulation/examples/Triangulation/triangulation_data_structure_static.cpp +++ b/Triangulation/examples/Triangulation/triangulation_data_structure_static.cpp @@ -1,42 +1,42 @@ #include -#include #include +#include int main() { typedef CGAL::Triangulation_data_structure > TDS; TDS S; - CGAL_assertion( 7 == S.maximal_dimension() ); - CGAL_assertion( -2 == S.current_dimension() ); - CGAL_assertion( S.is_valid() ); + assert( 7 == S.maximal_dimension() ); + assert( -2 == S.current_dimension() ); + assert( S.is_valid() ); std::vector V(10); V[0] = S.insert_increase_dimension(); //insert first vertex - CGAL_assertion( -1 == S.current_dimension() ); + assert( -1 == S.current_dimension() ); for( int i = 1; i <= 5; ++i ) V[i] = S.insert_increase_dimension(V[0]); // the first 6 vertices have created a triangulation // of the 4-dimensional topological sphere // (the boundary of a five dimensional simplex). - CGAL_assertion( 4 == S.current_dimension() ); - CGAL_assertion( 6 == S.number_of_vertices() ); - CGAL_assertion( 6 == S.number_of_full_cells() ); + assert( 4 == S.current_dimension() ); + assert( 6 == S.number_of_vertices() ); + assert( 6 == S.number_of_full_cells() ); TDS::Full_cell_handle c = V[5]->full_cell(); V[6] = S.insert_in_full_cell(c); // full cell c is split in 5 - CGAL_assertion( 7 == S.number_of_vertices() ); - CGAL_assertion( 10 == S.number_of_full_cells() ); + assert( 7 == S.number_of_vertices() ); + assert( 10 == S.number_of_full_cells() ); c = V[3]->full_cell(); TDS::Facet ft(c, 2); // the Facet opposite to vertex 2 in c V[7] = S.insert_in_facet(ft); // facet ft is split in 4 and the two incident cells are split accordingly - CGAL_assertion( 8 == S.number_of_vertices() ); - CGAL_assertion( 16 == S.number_of_full_cells() ); + assert( 8 == S.number_of_vertices() ); + assert( 16 == S.number_of_full_cells() ); c = V[3]->full_cell(); TDS::Face face(c); @@ -45,7 +45,7 @@ int main() face.set_index(1, 4); // and vertex 4 V[8] = S.insert_in_face(face); // face is split in 2, and all incident full cells also - CGAL_assertion( S.is_valid() ); + assert( S.is_valid() ); TDS::Full_cell_handle hole[2]; hole[0] = V[8]->full_cell(); @@ -54,6 +54,6 @@ int main() ft = TDS::Facet(hole[0], 1); // a face on the boundary of hole[0] V[9] = S.insert_in_hole(hole, hole+2, ft); // the hole is triangulated by linking a new vertex to its boundary - CGAL_assertion( S.is_valid() ); + assert( S.is_valid() ); return 0; } From 8e5b5cdc3f2cb2b7b8df09d3c1bbbe879fa9fbe4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Jan 2022 17:03:43 +0000 Subject: [PATCH 05/10] untabify --- .../examples/Combinatorial_map/map_3_operations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp b/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp index 2949da9b484..83217577d5d 100644 --- a/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp +++ b/Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp @@ -15,7 +15,7 @@ int main() // Add two edges along two opposite facets. assert( cm.is_insertable_cell_1_in_cell_2 - (cm.beta(dh1,1),cm.beta(dh1,0)) ); + (cm.beta(dh1,1),cm.beta(dh1,0)) ); cm.insert_cell_1_in_cell_2(cm.beta(dh1,1), cm.beta(dh1,0)); assert( cm.is_valid() ); @@ -23,7 +23,7 @@ int main() Dart_handle dh2=cm.beta(dh1,2,1,1,2); assert( cm.is_insertable_cell_1_in_cell_2 - (dh2,cm.beta(dh2,1,1)) ); + (dh2,cm.beta(dh2,1,1)) ); cm.insert_cell_1_in_cell_2(dh2, cm.beta(dh2,1,1)); assert( cm.is_valid() ); From 44f72971b40d5eddfa5501ea0210af573e331139 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jan 2022 06:50:22 +0000 Subject: [PATCH 06/10] Fix in HDS examples --- HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp index 2d4f3f6893d..0f628ab69fa 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp @@ -55,7 +55,7 @@ public: (~ std::ptrdiff_t(1)))); } void set_opposite( Halfedge_handle h) { - asseert(( &* h - 1 == &* HDS::halfedge_handle(this)) || + assert(( &* h - 1 == &* HDS::halfedge_handle(this)) || ( &* h + 1 == &* HDS::halfedge_handle(this))); if ( &* h - 1 == &* HDS::halfedge_handle(this)) nxt |= 1; From 0ce35e88ff951245a9f15ecc59668f92423d7dd0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jan 2022 16:45:19 +0000 Subject: [PATCH 07/10] TAU packages --- .../algebraic_segments.cpp | 3 ++- .../Arrangement_on_surface_2/conics.cpp | 4 ++-- .../Arrangement_on_surface_2/dual_lines.cpp | 3 ++- .../edge_manipulation_curve_history.cpp | 1 - .../face_extension_overlay.cpp | 6 ++++-- .../incremental_insertion.cpp | 2 +- .../Arrangement_on_surface_2/overlay_color.cpp | 6 ++++-- .../polycurve_bezier.cpp | 1 - .../spherical_degenerate_sweep.cpp | 17 +++++++++-------- .../unb_planar_vertical_decomposition.cpp | 2 -- .../unbounded_non_intersecting.cpp | 4 +++- .../Boolean_set_operations_2/circle_segment.cpp | 3 ++- .../Boolean_set_operations_2/set_union.cpp | 3 ++- .../examples/Envelope_2/envelope_circles.cpp | 3 ++- .../examples/Envelope_2/envelope_segments.cpp | 3 ++- .../examples/Minkowski_sum_2/bops_linear.h | 1 + .../Minkowski_sum_2/sum_triangle_square.cpp | 2 +- .../examples/Surface_sweep_2/plane_sweep.cpp | 5 +++-- 18 files changed, 40 insertions(+), 29 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp index a546f9c16ae..95eb729bb66 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp @@ -2,6 +2,7 @@ // Constructing an arrangement of algebraic segments. #include +#include #include #if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI)) @@ -52,7 +53,7 @@ int main() { std::vector segs; for(size_t i = 0; i < pre_segs.size(); ++i) { auto* curr_p = boost::get(&pre_segs[i]); - CGAL_assertion(curr_p); + assert(curr_p); segs.push_back(*curr_p); } // Construct an ellipse (C2) with the equation 2*x^2+5*y^2-7=0. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp index f01501c054a..a8688f55a98 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics.cpp @@ -29,7 +29,7 @@ int main() { // with (-3, 4) and (4, 3) as its endpoints. We want the arc to be // clockwise-oriented, so it passes through (0, 5) as well. Conic_arc c4(Rat_point(-3, 4), Rat_point(0, 5), Rat_point(4, 3)); - CGAL_assertion(c4.is_valid()); + insert(arr, c4); // Insert a full unit circle (C5) that is centered at (0, 4). @@ -46,7 +46,7 @@ int main() { 0, 0, 0, 0, 1, 3, // the line: y = -3. Point(1.41, -2), // approximation of the target. 0, 0, 0, 0, 1, 2); // the line: y = -2. - CGAL_assertion(c6.is_valid()); + insert(arr, c6); // Insert the right half of the circle centered at (4, 2.5) whose radius diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp index b6b4304c1a0..36a5cbb3b5b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp @@ -3,6 +3,7 @@ // using the arrangement of the dual lines. #include +#include #include "arr_linear.h" #include "read_objects.h" @@ -74,7 +75,7 @@ int main(int argc, char* argv[]) { break; } } - CGAL_assertion(found_collinear); + assert(found_collinear); return (0); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp index 59c36abf614..e89d8b57d89 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp @@ -46,7 +46,6 @@ int main() { const Point q{_7_halves, 7}; Point_location::result_type obj = pl.locate(q); auto* e = boost::get(&obj); - CGAL_assertion(e); // Split the edge e to two edges e1 and e2; auto e1 = arr.split_edge(arr.non_const_handle(*e), q); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp index c5fbb593f25..7eda7deea85 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp @@ -1,6 +1,8 @@ //! \file examples/Arrangement_on_surface_2/face_extension_overlay.cpp // A face overlay of two arrangements with extended face records. +#include + #include #include #include @@ -21,7 +23,8 @@ int main() { insert_non_intersecting_curve(arr1, Segment(Point(6, 2), Point(6, 6))); insert_non_intersecting_curve(arr1, Segment(Point(6, 6), Point(2, 6))); insert_non_intersecting_curve(arr1, Segment(Point(2, 6), Point(2, 2))); - CGAL_assertion(arr1.number_of_faces() == 2); + // 2 because the bounded and the unbounded one + assert(arr1.number_of_faces() == 2); // Mark just the bounded face. for (auto fit = arr1.faces_begin(); fit != arr1.faces_end(); ++fit) @@ -33,7 +36,6 @@ int main() { insert_non_intersecting_curve(arr2, Segment(Point(7, 4), Point(4, 7))); insert_non_intersecting_curve(arr2, Segment(Point(4, 7), Point(1, 4))); insert_non_intersecting_curve(arr2, Segment(Point(1, 4), Point(4, 1))); - CGAL_assertion(arr2.number_of_faces() == 2); for (auto fit = arr2.faces_begin(); fit != arr2.faces_end(); ++fit) fit->set_data(fit != arr2.unbounded_face()); // mark the bounded face. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp index 7f6e63e1661..51112be6c50 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp @@ -33,7 +33,7 @@ int main() { Point q(4, 1); auto obj = pl.locate(q); auto* f = boost::get(&obj); - CGAL_assertion(f != nullptr); + std::cout << "The query point (" << q << ") is located in: "; print_face(*f); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp index 0a1e106681d..6cb7f17f477 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp @@ -1,6 +1,8 @@ //! \file examples/Arrangement_on_surface_2/overlay_color.cpp // The overlay of two arrangement with extended dcel structures +#include + #include #include #include @@ -25,7 +27,7 @@ int main() { insert(arr1, Segment(Point(0, 0), Point(0, 4))); insert(arr1, Segment(Point(2, 0), Point(2, 4))); insert(arr1, Segment(Point(4, 0), Point(4, 4))); - CGAL_assertion(arr1.number_of_faces() == 5); + assert(arr1.number_of_faces() == 5); for (auto vit = arr1.vertices_begin(); vit != arr1.vertices_end(); ++vit) vit->set_data(vcol1); for (auto hit = arr1.halfedges_begin(); hit != arr1.halfedges_end(); ++hit) @@ -41,7 +43,7 @@ int main() { insert(arr2, Segment(Point(0, 0), Point(0, 6))); insert(arr2, Segment(Point(3, 0), Point(3, 6))); insert(arr2, Segment(Point(6, 0), Point(6, 6))); - CGAL_assertion(arr2.number_of_faces() == 5); + assert(arr2.number_of_faces() == 5); for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit) vit->set_data(vcol2); for (auto hit = arr2.halfedges_begin(); hit != arr2.halfedges_end(); ++hit) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp index 020320acb89..287fd51786a 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp @@ -59,7 +59,6 @@ int main() { std::vector obj_vector; bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector)); auto* x_seg_p = boost::get(&obj_vector[0]); - CGAL_assertion(x_seg_p); x_curves.push_back(*x_seg_p); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp index 4646b0cda36..8c6f46dfeb6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp @@ -5,6 +5,7 @@ // #define CGAL_ARRANGEMENT_ON_SURFACE_INSERT_VERBOSE 1 // #define CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE 1 +#include #include #include @@ -57,26 +58,26 @@ int main() { X_monotone_curve_2 xcv_sp1 = ctr_xcv(sp, p1); X_monotone_curve_2 xcv_sp2 = ctr_xcv(sp, p2); X_monotone_curve_2 xcv_sp3 = ctr_xcv(sp, p3); - CGAL_assertion(xcv_sp1.is_vertical()); - CGAL_assertion(xcv_sp2.is_vertical()); - CGAL_assertion(xcv_sp3.is_vertical()); + assert(xcv_sp1.is_vertical()); + assert(xcv_sp2.is_vertical()); + assert(xcv_sp3.is_vertical()); xcvs.push_back(xcv_sp1); // 0 xcvs.push_back(xcv_sp2); // 1 xcvs.push_back(xcv_sp3); // 2 X_monotone_curve_2 xcv_12 = ctr_xcv(p1, p2); X_monotone_curve_2 xcv_23 = ctr_xcv(p2, p3); - CGAL_assertion(!xcv_12.is_vertical()); - CGAL_assertion(!xcv_23.is_vertical()); + assert(!xcv_12.is_vertical()); + assert(!xcv_23.is_vertical()); xcvs.push_back(xcv_12); // 3 xcvs.push_back(xcv_23); // 4 X_monotone_curve_2 xcv_np1 = ctr_xcv(np, p1); X_monotone_curve_2 xcv_np2 = ctr_xcv(np, p2); X_monotone_curve_2 xcv_np3 = ctr_xcv(np, p3); - CGAL_assertion(xcv_np1.is_vertical()); - CGAL_assertion(xcv_np2.is_vertical()); - CGAL_assertion(xcv_np3.is_vertical()); + assert(xcv_np1.is_vertical()); + assert(xcv_np2.is_vertical()); + assert(xcv_np3.is_vertical()); xcvs.push_back(xcv_np1); // 5 xcvs.push_back(xcv_np2); // 6 xcvs.push_back(xcv_np3); // 7 diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp index 72dc3469703..831e0e44395 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp @@ -45,7 +45,6 @@ int main() { if (vh) std::cout << '(' << (*vh)->point() << ')'; else { auto* hh = boost::get(&*(curr.first)); - CGAL_assertion(hh); if (! (*hh)->is_fictitious()) std::cout << '[' << (*hh)->curve() << ']'; else std::cout << "NONE"; @@ -59,7 +58,6 @@ int main() { if (vh) std::cout << '(' << (*vh)->point() << ")\n"; else { auto* hh = boost::get(&*(curr.second)); - CGAL_assertion(hh); if (! (*hh)->is_fictitious()) std::cout << '[' << (*hh)->curve() << "]\n"; else std::cout << "NONE\n"; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp index 159d66a6184..7de9d0981d6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting.cpp @@ -2,6 +2,8 @@ // Constructing an arrangement of unbounded linear objects using the insertion // function for non-intersecting curves. +#include + #include "arr_linear.h" #include "arr_print.h" @@ -13,7 +15,7 @@ int main() { X_monotone_curve c1 = Line(Point(-1, 0), Point(1, 0)); arr.insert_in_face_interior(c1, arr.unbounded_face()); Vertex_handle v = insert_point(arr, Point(0,0)); - CGAL_assertion(! v->is_at_open_boundary()); + assert(! v->is_at_open_boundary()); // Add two more rays using the specialized insertion functions. arr.insert_from_right_vertex(Ray(Point(0, 0), Point(-1, 1)), v); // c2 diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp index 523f1961907..7cf3ec3dc7b 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp @@ -8,6 +8,7 @@ #include #include +#include typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef Kernel::Point_2 Point_2; @@ -28,7 +29,7 @@ Polygon_2 construct_polygon (const Circle_2& circle) Curve_2 curve (circle); std::list objects; traits.make_x_monotone_2_object() (curve, std::back_inserter(objects)); - CGAL_assertion (objects.size() == 2); + assert(objects.size() == 2); // Construct the polygon. Polygon_2 pgn; diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp index a6d2e2e3dd6..cecacc9a107 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/set_union.cpp @@ -10,6 +10,7 @@ #include #include #include +#include typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef Kernel::Point_2 Point_2; @@ -29,7 +30,7 @@ Polygon_2 construct_polygon (const Circle_2& circle) Curve_2 curve (circle); std::list objects; traits.make_x_monotone_2_object() (curve, std::back_inserter(objects)); - CGAL_assertion (objects.size() == 2); + assert(objects.size() == 2); // Construct the polygon. Polygon_2 pgn; diff --git a/Envelope_2/examples/Envelope_2/envelope_circles.cpp b/Envelope_2/examples/Envelope_2/envelope_circles.cpp index daae2157203..94da9077706 100644 --- a/Envelope_2/examples/Envelope_2/envelope_circles.cpp +++ b/Envelope_2/examples/Envelope_2/envelope_circles.cpp @@ -8,6 +8,7 @@ #include #include #include +#include typedef CGAL::Exact_rational Number_type; typedef CGAL::Cartesian Kernel; @@ -42,7 +43,7 @@ void print_diagram (const Diagram_1& diag) e = v->right(); } - CGAL_assertion (e->is_empty()); + assert(e->is_empty()); std::cout << "Edge: [empty]" << std::endl; return; diff --git a/Envelope_2/examples/Envelope_2/envelope_segments.cpp b/Envelope_2/examples/Envelope_2/envelope_segments.cpp index 751d4feb501..e3cd1d9fa99 100644 --- a/Envelope_2/examples/Envelope_2/envelope_segments.cpp +++ b/Envelope_2/examples/Envelope_2/envelope_segments.cpp @@ -10,6 +10,7 @@ #include #include +#include typedef CGAL::Exact_rational Number_type; typedef CGAL::Cartesian Kernel; @@ -74,7 +75,7 @@ int main () e = v->right(); } - CGAL_assertion (e->is_empty()); + assert(e->is_empty()); std::cout << "Edge: [empty]" << std::endl; return (0); diff --git a/Minkowski_sum_2/examples/Minkowski_sum_2/bops_linear.h b/Minkowski_sum_2/examples/Minkowski_sum_2/bops_linear.h index 65668686580..d6e57c0eef1 100644 --- a/Minkowski_sum_2/examples/Minkowski_sum_2/bops_linear.h +++ b/Minkowski_sum_2/examples/Minkowski_sum_2/bops_linear.h @@ -2,6 +2,7 @@ #define BOPS_LINEAR_H #include +#include #include #include diff --git a/Minkowski_sum_2/examples/Minkowski_sum_2/sum_triangle_square.cpp b/Minkowski_sum_2/examples/Minkowski_sum_2/sum_triangle_square.cpp index 5923d1e5fdf..de46f19e9e4 100644 --- a/Minkowski_sum_2/examples/Minkowski_sum_2/sum_triangle_square.cpp +++ b/Minkowski_sum_2/examples/Minkowski_sum_2/sum_triangle_square.cpp @@ -21,7 +21,7 @@ int main() // Compute the Minkowski sum. Polygon_with_holes_2 sum = CGAL::minkowski_sum_2(P, Q); - CGAL_assertion(sum.number_of_holes() == 0); + assert(sum.number_of_holes() == 0); std::cout << "P (+) Q = " << sum.outer_boundary() << std::endl; return 0; } diff --git a/Surface_sweep_2/examples/Surface_sweep_2/plane_sweep.cpp b/Surface_sweep_2/examples/Surface_sweep_2/plane_sweep.cpp index d6d2fbbdfa8..28f894cd8bf 100644 --- a/Surface_sweep_2/examples/Surface_sweep_2/plane_sweep.cpp +++ b/Surface_sweep_2/examples/Surface_sweep_2/plane_sweep.cpp @@ -1,7 +1,8 @@ -//! \file examples/Arrangement_on_surface_2/plane_sweep.cpp +//! \file examples/Surface_sweep_2/plane_sweep.cpp // Computing intersection points among curves using the surface-sweep alg. #include +#include #include #include @@ -39,7 +40,7 @@ int main() std::cout << "Found " << sub_segs.size() << " interior-disjoint sub-segments." << std::endl; - CGAL_assertion(CGAL::do_curves_intersect (segments, segments + 4)); + assert(CGAL::do_curves_intersect (segments, segments + 4)); return 0; } From 31b6b06aa497a0d25a7eb31fca2480d2352b2600 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jan 2022 16:46:41 +0000 Subject: [PATCH 08/10] Bounding_volumes --- .../Min_sphere_of_spheres_d/min_sphere_of_spheres_d_2.cpp | 3 ++- .../Min_sphere_of_spheres_d/min_sphere_of_spheres_d_3.cpp | 3 ++- .../Min_sphere_of_spheres_d/min_sphere_of_spheres_d_d.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_2.cpp b/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_2.cpp index 2d133ddba86..81562b974fd 100644 --- a/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_2.cpp +++ b/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_2.cpp @@ -5,6 +5,7 @@ #include #include #include +#include const int N = 1000; // number of spheres const int LOW = 0, HIGH = 10000; // range of coordinates and radii @@ -29,5 +30,5 @@ int main () { } Min_sphere ms(S.begin(),S.end()); // check in the spheres - CGAL_assertion(ms.is_valid()); + assert(ms.is_valid()); } diff --git a/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_3.cpp b/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_3.cpp index c0b8b978e0c..a8a998a991f 100644 --- a/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_3.cpp +++ b/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_3.cpp @@ -5,6 +5,7 @@ #include #include #include +#include const int N = 1000; // number of spheres const int LOW = 0, HIGH = 10000; // range of coordinates and radii @@ -30,5 +31,5 @@ int main () { } Min_sphere ms(S.begin(),S.end()); // check in the spheres - CGAL_assertion(ms.is_valid()); + assert(ms.is_valid()); } diff --git a/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_d.cpp b/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_d.cpp index 0ddbe825fba..984ce89e8e5 100644 --- a/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_d.cpp +++ b/Bounding_volumes/examples/Min_sphere_of_spheres_d/min_sphere_of_spheres_d_d.cpp @@ -5,6 +5,7 @@ #include #include #include +#include const int N = 1000; // number of spheres const int D = 3; // dimension of points @@ -31,5 +32,5 @@ int main () { } Min_sphere ms(S.begin(),S.end()); // check in the spheres - CGAL_assertion(ms.is_valid()); + assert(ms.is_valid()); } From 25d2b98903a104f7eb8f2ed89fa35275946630cb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jan 2022 16:49:38 +0000 Subject: [PATCH 09/10] TAU packages --- .../examples/Arrangement_on_surface_2/point_location_utils.h | 3 ++- .../Arrangement_on_surface_2/spherical_is_in_x_range.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h index 556b75113e3..70bc38bce3f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h @@ -1,3 +1,4 @@ +#include #include //----------------------------------------------------------------------------- @@ -106,7 +107,7 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs, else if ((e = boost::get(&obj)) ) // hit an edge std::cout << "an edge: " << (*e)->curve() << std::endl; else if ((f = boost::get(&obj))) { // hit nothing - CGAL_assertion((*f)->is_unbounded()); + assert((*f)->is_unbounded()); std::cout << "nothing." << std::endl; } else CGAL_error_msg("Invalid object."); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_is_in_x_range.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_is_in_x_range.h index 8e25bff3b3a..21eac95bb4b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_is_in_x_range.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_is_in_x_range.h @@ -1,13 +1,15 @@ #ifndef IS_IN_X_RANGE_H #define IS_IN_X_RANGE_H +#include + // Check whether the given point is in the x-range of the given curve that // represents a great-circle arc. template bool is_in_x_range(const typename GeometryTraits::X_monotone_curve_2& c, const typename GeometryTraits::Point_2& p, const GeometryTraits& traits) { - CGAL_assertion(! traits.is_on_y_identification_2_object()(p)); + assert(! traits.is_on_y_identification_2_object()(p)); if (traits.is_on_y_identification_2_object()(c)) return false; From d08592b7084e2860675c2e09c6ed920af8ce5068 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jan 2022 16:57:32 +0000 Subject: [PATCH 10/10] T2 --- .../Triangulation_2/triangulation_print_OFF.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Triangulation_2/examples/Triangulation_2/triangulation_print_OFF.h b/Triangulation_2/examples/Triangulation_2/triangulation_print_OFF.h index 255f93d4e3c..c4fe2d995c3 100644 --- a/Triangulation_2/examples/Triangulation_2/triangulation_print_OFF.h +++ b/Triangulation_2/examples/Triangulation_2/triangulation_print_OFF.h @@ -4,6 +4,7 @@ #define CGAL_TRIANGULATION_PRINT_OFF_H 1 #include +#include namespace CGAL { @@ -23,17 +24,17 @@ triangulation_print_OFF( std::ostream& out, std::size_t vn = 0; Vertex_iterator vi = triang.vertices_begin(); for ( ; vi != triang.vertices_end(); ++vi) { - CGAL_assertion( ! triang.is_infinite( vi)); + assert( ! triang.is_infinite( vi)); mapping[ &*vi] = vn; vn++; } - CGAL_assertion( vn == std::size_t( triang.number_of_vertices())); + assert( vn == std::size_t( triang.number_of_vertices())); // Count finite and infinite faces. std::size_t fn = 0; Face_iterator fi = triang.faces_begin(); for ( ; fi != triang.faces_end(); ++fi) { - CGAL_assertion( ! triang.is_infinite( fi)); + assert( ! triang.is_infinite( fi)); fn++; } std::size_t fin = triang.number_of_faces() - fn; @@ -44,7 +45,7 @@ triangulation_print_OFF( std::ostream& out, vi = triang.vertices_begin(); for ( ; vi != triang.vertices_end(); ++vi) { - CGAL_assertion( ! triang.is_infinite( vi)); + assert( ! triang.is_infinite( vi)); writer.write_vertex( to_double(vi->point().x()), to_double(vi->point().y()), to_double(vi->point().z())); @@ -54,16 +55,16 @@ triangulation_print_OFF( std::ostream& out, fi = triang.faces_begin(); while ( fn --) { writer.write_facet_begin( 3); - CGAL_assertion( mapping.find(&*(fi->vertex(0))) != mapping.end()); - CGAL_assertion( mapping.find(&*(fi->vertex(1))) != mapping.end()); - CGAL_assertion( mapping.find(&*(fi->vertex(2))) != mapping.end()); + assert( mapping.find(&*(fi->vertex(0))) != mapping.end()); + assert( mapping.find(&*(fi->vertex(1))) != mapping.end()); + assert( mapping.find(&*(fi->vertex(2))) != mapping.end()); writer.write_facet_vertex_index( mapping[ &*(fi->vertex(0))]); writer.write_facet_vertex_index( mapping[ &*(fi->vertex(1))]); writer.write_facet_vertex_index( mapping[ &*(fi->vertex(2))]); writer.write_facet_end(); ++fi; } - CGAL_assertion( fi == triang.faces_end()); + assert( fi == triang.faces_end()); writer.write_footer(); }