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; }