From 6e3978daf57ba8d77a70f661271c97360d0db564 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 29 Oct 2020 15:02:48 +0200 Subject: [PATCH] Updated --- .../Bezier_curves.cpp | 3 +- .../aggregated_insertion.cpp | 3 +- .../algebraic_curves.cpp | 3 +- .../algebraic_segments.cpp | 5 +- .../Arrangement_on_surface_2/arr_Bezier.h | 1 + .../Arrangement_on_surface_2/arr_circular.h | 1 + .../Arrangement_on_surface_2/arr_linear.h | 3 + .../batched_point_location.cpp | 3 +- .../bounded_vertical_decomposition.cpp | 3 +- .../Arrangement_on_surface_2/circles.cpp | 14 +- .../circular_arcs.cpp | 3 +- .../circular_line_arcs.cpp | 3 +- .../conic_multiplicities.cpp | 26 +-- .../Arrangement_on_surface_2/conics.cpp | 3 +- .../consolidated_curve_data.cpp | 5 +- .../curve_history.cpp | 3 +- .../dcel_extension.cpp | 3 +- .../dcel_extension_io.cpp | 152 +++++++----------- .../Arrangement_on_surface_2/dual_lines.cpp | 3 +- .../dual_with_data.cpp | 35 ++-- .../edge_insertion.cpp | 3 +- .../edge_manipulation.cpp | 3 +- .../edge_manipulation_curve_history.cpp | 3 +- .../face_extension.cpp | 6 +- .../face_extension_overlay.cpp | 3 +- .../generic_curve_data.cpp | 3 +- .../global_insertion.cpp | 3 +- .../global_removal.cpp | 3 +- .../incremental_insertion.cpp | 3 +- .../examples/Arrangement_on_surface_2/io.cpp | 48 ++---- .../io_curve_history.cpp | 63 +++----- .../Arrangement_on_surface_2/io_unbounded.cpp | 44 ++--- .../isolated_vertices.cpp | 3 +- .../Arrangement_on_surface_2/observer.cpp | 4 +- .../Arrangement_on_surface_2/overlay.cpp | 3 +- .../overlay_color.cpp | 3 +- .../overlay_unbounded.cpp | 3 +- .../point_location.cpp | 15 +- .../polycurve_bezier.cpp | 53 +++--- .../polycurve_circular_arc.cpp | 111 ++++++------- .../polycurve_conic.cpp | 113 ++++++------- .../polycurve_geodesic.cpp | 3 +- .../polycurves_basic.cpp | 51 +++--- .../Arrangement_on_surface_2/polylines.cpp | 5 +- .../predefined_kernel.cpp | 13 +- .../predefined_kernel_non_intersecting.cpp | 11 +- .../rational_functions.cpp | 3 +- ...tional_functions_rational_coefficients.cpp | 8 +- .../sgm_point_location.cpp | 14 +- .../special_edge_insertion.cpp | 3 +- .../spherical_degenerate_insert1.cpp | 3 +- .../spherical_degenerate_insert2.cpp | 8 +- .../spherical_degenerate_sweep.cpp | 18 ++- .../spherical_insert.cpp | 3 +- .../spherical_overlay.cpp | 3 +- .../tracing_counting.cpp | 40 ++--- .../unb_planar_vertical_decomposition.cpp | 76 ++++----- .../unbounded_non_intersecting.cpp | 3 +- .../unbounded_rational_functions.cpp | 3 +- .../vertical_ray_shooting.cpp | 3 +- 60 files changed, 424 insertions(+), 615 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp index f68ca21dc15..c0c40fc73a6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves.cpp @@ -5,8 +5,7 @@ #include "arr_print.h" #include "read_objects.h" -int main(int argc, char* argv[]) -{ +int main(int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default // Bezier.dat file if no command-line parameters are given. const char* filename = (argc > 1) ? argv[1] : "Bezier.dat"; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/aggregated_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/aggregated_insertion.cpp index d7afbcb6550..b2b24241ef6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/aggregated_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/aggregated_insertion.cpp @@ -4,8 +4,7 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { // Aggregately construct the arrangement of five line segments. Segment segments[] = {Segment(Point(1, 0), Point(2, 4)), Segment(Point(5, 0), Point(5, 5)), diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp index 7453ac669e4..8e349dd804c 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp @@ -16,8 +16,7 @@ typedef CGAL::Arrangement_2 Arrangement; typedef Traits::Curve_2 Curve; typedef Traits::Polynomial_2 Polynomial; -int main() -{ +int main() { CGAL::set_pretty_mode(std::cout); // for nice printouts. Traits traits; 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 7c669ab0ec3..4a5b3758629 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 @@ -19,9 +19,8 @@ typedef Traits::Algebraic_real_1 Algebraic_real; typedef Traits::X_monotone_curve_2 X_monotone_curve; typedef Traits::Point_2 Point; -int main() -{ - Traits traits; +int main() { + Traits traits; auto make_xmon = traits.make_x_monotone_2_object(); auto ctr_cv = traits.construct_curve_2_object(); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h index a6bfccb3e0f..30d978942c8 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h @@ -15,6 +15,7 @@ typedef CGAL::Cartesian Alg_kernel; typedef Rat_kernel::Point_2 Rat_point; typedef CGAL::Arr_Bezier_curve_traits_2 Traits; +typedef Traits::X_monotone_curve_2 Bezier_x_monotone_curve; typedef Traits::Curve_2 Bezier_curve; typedef CGAL::Arrangement_2 Arrangement; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h index 1b3d8622f3f..752a1e84a2d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h @@ -11,6 +11,7 @@ typedef CGAL::Arr_circle_segment_traits_2 Traits; typedef Traits::CoordNT CoordNT; typedef Traits::Point_2 Point; typedef Traits::Curve_2 Curve; +typedef Traits::X_monotone_curve_2 X_monotone_curve; typedef Traits::Rational_point_2 Rational_point; typedef Traits::Rational_segment_2 Segment; typedef Traits::Rational_circle_2 Circle; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h index 92a82e2a869..8dad9c70f59 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h @@ -19,5 +19,8 @@ typedef CGAL::Arrangement_2 Arrangement; typedef Arrangement::Vertex_handle Vertex_handle; typedef Arrangement::Halfedge_handle Halfedge_handle; typedef Arrangement::Face_handle Face_handle; +typedef Arrangement::Vertex_const_handle Vertex_const_handle; +typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; +typedef Arrangement::Face_const_handle Face_const_handle; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp index 4a7badceb5b..6d42fb6ca5f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp @@ -13,8 +13,7 @@ typedef CGAL::Arr_point_location_result Point_location_result; typedef std::pair Query_result; -int main() -{ +int main() { // Construct the arrangement. Arrangement arr; construct_segments_arr(arr); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp index b327fc0926b..1bc6e5664c9 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp @@ -12,8 +12,7 @@ typedef std::pair Object_pair; typedef std::pair Vert_decomp_entry; typedef std::list Vert_decomp_list; -int main() -{ +int main() { // Construct the arrangement. Segment segments[] = {Segment(Point(0, 0), Point(3, 3)), Segment(Point(3, 3), Point(6, 0)), diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circles.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circles.cpp index a0d66c48a42..014cae1d161 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circles.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circles.cpp @@ -3,9 +3,8 @@ #include "arr_circular.h" -int main() -{ - Arrangement_2 arr; +int main() { + Arrangement arr; // Create a circle centered at the origin with radius 5 (C1). insert(arr, Curve(Circle(Rational_point(0, 0), Number_type(25)))); @@ -17,10 +16,13 @@ int main() Rational_point c3(4, Number_type(-1) / Number_type(2)); insert(arr, Curve(Circle(c3, Number_type(49) / Number_type(4)))); + // Locate the vertex with maximal degree. + auto vit = arr.vertices_begin(); + Arrangement::Vertex_const_handle v_max = vit; + for (++vit; vit != arr.vertices_end(); ++vit) + if (vit->degree() > v_max->degree()) v_max = vit; + // Locate the vertex with maximum degree. - Arrangement_2::Vertex_const_handle v_max; - for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) - if (vit->degree() > max_degree) v_max = vit; std::cout << "The vertex with maximal degree in the arrangement is: " << "v_max = (" << v_max->point() << ") " diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp index 4b511da974a..926162f1997 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp @@ -4,8 +4,7 @@ #include "arr_circular.h" #include "arr_print.h" -int main() -{ +int main() { std::list curves; // Create a circle (C1) centered at the origin with squared radius 2. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp index 687a7d792ab..adc5794a000 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp @@ -33,8 +33,7 @@ typedef CGAL::Arr_circular_line_arc_traits_2 Traits; typedef CGAL::Arrangement_2 Arrangement; typedef CGAL::Arr_naive_point_location Point_location; -int main() -{ +int main() { CGAL::Random generatorOfgenerator; int random_seed = generatorOfgenerator.get_int(0, 123456); std::cout << "random_seed = " << random_seed << std::endl; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp index bf869b84189..23d4989e2df 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp @@ -1,32 +1,34 @@ //! \file examples/Arrangement_on_surface_2/conic_multiplicities.cpp // Handling intersection points with multiplicity between conic arcs. +#include +#include + #include "arr_conics.h" #include "arr_print.h" -int main () -{ - Arrangement_2 arr; +typedef CGAL::Arr_naive_point_location Naive_pl; + +int main() { + Arrangement arr; Naive_pl pl(arr); // Insert a hyperbolic arc, supported by the hyperbola y = x^2/(1-x) // (or: x^2 + xy - y = 0) with the endpoints (-1, 1/2) and (1/2, 1/2). // Note that the arc is counterclockwise oriented. - Point_2 ps1(-1, Rational(1,2)); - Point_2 pt1(Rational(1,2), Rational(1,2)); - Conic_arc_2 cv1(1, 0, 1, 0, -1, 0, CGAL::COUNTERCLOCKWISE, ps1, pt1); + Point ps1(-1, Rational(1,2)); + Point pt1(Rational(1,2), Rational(1,2)); + Conic_arc cv1(1, 0, 1, 0, -1, 0, CGAL::COUNTERCLOCKWISE, ps1, pt1); insert(arr, cv1, pl); // Insert the bottom half of the circle centered at (0, 1/2) whose radius // is 1/2 (therefore its squared radius is 1/4). - Rat_circle_2 circ2(Rat_point_2(0, Rational(1,2)), Rational(1,4)); - Point_2 ps2(-Rational(1,2), Rational(1,2)); - Point_2 pt2(Rational(1,2), Rational(1,2)); - Conic_arc_2 cv2(circ2, CGAL::COUNTERCLOCKWISE, ps2, pt2); + Rat_circle circ2(Rat_point(0, Rational(1,2)), Rational(1,4)); + Point ps2(-Rational(1,2), Rational(1,2)); + Point pt2(Rational(1,2), Rational(1,2)); + Conic_arc cv2(circ2, CGAL::COUNTERCLOCKWISE, ps2, pt2); insert(arr, cv2, pl); print_arrangement (arr); return 0; } - -#endif 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 059b2f8d2d0..dc3dbb9e583 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 @@ -4,8 +4,7 @@ #include "arr_conics.h" #include "arr_print.h" -int main() -{ +int main() { Arrangement arr; // Insert a hyperbolic arc (C1), supported by the hyperbola y = 1/x diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp index 1d74d594f9e..7e4a213bcca 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp @@ -7,15 +7,14 @@ #include "arr_exact_construction_segments.h" -enum Segment_color { RED, BLUE }; +enum Segment_color {RED, BLUE}; typedef CGAL::Arr_consolidated_curve_data_traits_2 Data_traits; typedef Data_traits::Curve_2 Colored_segment; typedef CGAL::Arrangement_2 Colored_arr; -int main() -{ +int main() { Colored_arr arr; // Construct an arrangement containing three RED line segments. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp index 8c786593766..cbf8f0b491f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp @@ -12,8 +12,7 @@ typedef CGAL::Arrangement_with_history_2 Arr_with_hist; typedef Arr_with_hist::Curve_handle Curve_handle; typedef CGAL::Arr_trapezoid_ric_point_location Point_location; -int main() -{ +int main() { // Insert s1, s2, and s3 incrementally. Arr_with_hist arr; Curve_handle s1 = insert(arr, Segment(Point(0, 3), Point(4, 3))); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp index 0b9e434d964..f8df74152c3 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp @@ -11,8 +11,7 @@ enum Color {BLUE, RED, WHITE}; typedef CGAL::Arr_extended_dcel Dcel; typedef CGAL::Arrangement_2 Ex_arrangement; -int main () -{ +int main() { // Construct the arrangement containing two intersecting triangles. Traits traits; Ex_arrangement arr(&traits); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp index fc89f889611..5c303465cb4 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp @@ -1,137 +1,105 @@ //! \file examples/Arrangement_on_surface_2/dcel_extension_io.cpp // Using the I/O operators for arrangements with extended DCEL records. -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include + +#include "arr_exact_construction_segments.h" + enum Color {BLUE, RED, WHITE}; -std::ostream& operator<< (std::ostream& os, const Color& color) -{ - switch (color) - { - case BLUE: os << "BLUE"; break; - case RED: os << "RED"; break; - case WHITE: os << "WHITE"; break; - default: os << "ERROR!"; +std::ostream& operator<<(std::ostream& os, const Color& color) { + switch (color) { + case BLUE: os << "BLUE"; break; + case RED: os << "RED"; break; + case WHITE: os << "WHITE"; break; + default: os << "ERROR!"; } - return (os); + return os; } -std::istream& operator>> (std::istream& is, Color& color) -{ - std::string str; +std::istream& operator>>(std::istream& is, Color& color) { + std::string str; is >> str; - - if (str == "BLUE") - color = BLUE; - else if (str == "RED") - color = RED; - else if (str == "WHITE") - color = WHITE; - - return (is); + if (str == "BLUE") color = BLUE; + else if (str == "RED") color = RED; + else if (str == "WHITE") color = WHITE; + return is; } -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arr_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Arrangement_2; -typedef CGAL::Arr_extended_dcel_text_formatter Formatter; +typedef CGAL::Arr_extended_dcel Ext_dcel; +typedef CGAL::Arrangement_2 Ext_arrangement; +typedef CGAL::Arr_extended_dcel_text_formatter Formatter; -int main () -{ +int main() { // Construct the arrangement containing two intersecting triangles. - Arrangement_2 arr; + Ext_arrangement arr; - Segment_2 s1 (Point_2(4, 1), Point_2(7, 6)); - Segment_2 s2 (Point_2(1, 6), Point_2(7, 6)); - Segment_2 s3 (Point_2(4, 1), Point_2(1, 6)); - Segment_2 s4 (Point_2(1, 3), Point_2(7, 3)); - Segment_2 s5 (Point_2(1, 3), Point_2(4, 8)); - Segment_2 s6 (Point_2(4, 8), Point_2(7, 3)); + Segment s1(Point(4, 1), Point(7, 6)); + Segment s2(Point(1, 6), Point(7, 6)); + Segment s3(Point(4, 1), Point(1, 6)); + Segment s4(Point(1, 3), Point(7, 3)); + Segment s5(Point(1, 3), Point(4, 8)); + Segment s6(Point(4, 8), Point(7, 3)); - insert_non_intersecting_curve (arr, s1); - insert_non_intersecting_curve (arr, s2); - insert_non_intersecting_curve (arr, s3); - insert (arr, s4); - insert (arr, s5); - insert (arr, s6); + insert_non_intersecting_curve(arr, s1); + insert_non_intersecting_curve(arr, s2); + insert_non_intersecting_curve(arr, s3); + insert(arr, s4); + insert(arr, s5); + insert(arr, s6); // Go over all arrangement vertices and set their colors. - Arrangement_2::Vertex_iterator vit; - std::size_t degree; - - for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) - { - degree = vit->degree(); - if (degree == 0) - vit->set_data (BLUE); // Isolated vertex. - else if (degree <= 2) - vit->set_data (RED); // Vertex represents an endpoint. - else - vit->set_data (WHITE); // Vertex represents an intersection point. + for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) { + auto degree = vit->degree(); + if (degree == 0) vit->set_data(BLUE); // Isolated vertex + else if (degree <= 2) vit->set_data(RED); // Vertex represents an endpoint + else vit->set_data(WHITE); // Vertex represents an intersection point } // Go over all arrangement edges and set their flags. - Arrangement_2::Edge_iterator eit; - bool flag; - - for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) - { + for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) { // Check if the halfedge has the same direction as its associated // segment. Note that its twin always has an opposite direction. - flag = (eit->source()->point() == eit->curve().source()); - eit->set_data (flag); - eit->twin()->set_data (!flag); + auto flag = (eit->source()->point() == eit->curve().source()); + eit->set_data(flag); + eit->twin()->set_data(! flag); } // Go over all arrangement faces and print their outer boundary and indices. - Arrangement_2::Face_iterator fit; - Arrangement_2::Ccb_halfedge_circulator curr; - int boundary_size; - - for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) - { + int boundary_size; + for (auto fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) { boundary_size = 0; - if (! fit->is_unbounded()) - { - curr = fit->outer_ccb(); - do - { + if (! fit->is_unbounded()) { + auto curr = fit->outer_ccb(); + do { ++boundary_size; ++curr; } while (curr != fit->outer_ccb()); } - fit->set_data (boundary_size); + fit->set_data(boundary_size); } // Write the arrangement to a file. - std::ofstream out_file ("arr_ex_dcel_io.dat"); - Formatter formatter; - - write (arr, out_file, formatter); + std::ofstream out_file("arr_ex_dcel_io.dat"); + Formatter formatter; + write(arr, out_file, formatter); out_file.close(); // Read the arrangement from the file. - Arrangement_2 arr2; - std::ifstream in_file ("arr_ex_dcel_io.dat"); + Ext_arrangement arr2; + std::ifstream in_file("arr_ex_dcel_io.dat"); - read (arr2, in_file, formatter); + read(arr2, in_file, formatter); in_file.close(); std::cout << "The arrangement vertices: " << std::endl; - for (vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit) + for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit) std::cout << '(' << vit->point() << ") - " << vit->data() << std::endl; - return (0); + return 0; } 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 191024b5261..5e2c2fc4791 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 @@ -7,8 +7,7 @@ #include "arr_linear.h" #include "read_objects.h" -int main(int argc, char* argv[]) -{ +int main(int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default // points.dat file if no command-line parameters are given. const char* filename = (argc > 1) ? argv[1] : "points.dat"; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp index 99f927f6874..e8010d9595c 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp @@ -4,42 +4,33 @@ #include -#include -#include -#include +#include #include -#include +#include "arr_linear.h" #include "read_objects.h" -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_linear_traits_2 Linear_traits_2; -typedef Linear_traits_2::Point_2 Point_2; -typedef Linear_traits_2::Line_2 Line_2; -typedef CGAL::Arr_curve_data_traits_2 Traits_2; -typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; -typedef CGAL::Arrangement_2 Arrangement_2; +typedef CGAL::Arr_curve_data_traits_2 Data_traits; +typedef Data_traits::X_monotone_curve_2 Data_x_monotone_curve_2; +typedef CGAL::Arrangement_2 Data_arrangement; -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default // points.dat file if no command-line parameters are given. const char* filename = (argc > 1) ? argv[1] : "coll_points.dat"; - std::vector points; - - read_objects(filename, std::back_inserter(points)); - std::vector dual_lines(points.size()); + std::vector points; + read_objects(filename, std::back_inserter(points)); + std::vector dual_lines(points.size()); size_t k{0}; std::transform(points.begin(), points.end(), dual_lines.begin(), - [&](const Point_2& p) { - Line_2 dual_line(p.x(), CGAL::Exact_rational(-1), -(p.y())); - return X_monotone_curve_2(dual_line, k++); + [&](const Point& p) { + Line dual_line(p.x(), -1, -(p.y())); + return Data_x_monotone_curve_2(dual_line, k++); }); // Construct the dual arrangement by aggregately inserting the lines. - Arrangement_2 arr; + Data_arrangement arr; insert(arr, dual_lines.begin(), dual_lines.end()); // Look for vertices whose degree is greater than 4. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_insertion.cpp index fb025059ed1..e3a5a1ef0a2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_insertion.cpp @@ -4,8 +4,7 @@ #include "arr_inexact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { Point p1(1, 3), p2(3, 5), p3(5, 3), p4(3, 1); Segment s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p1), s5(p1, p3); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation.cpp index f82c11ed9dd..0515690f82e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation.cpp @@ -4,8 +4,7 @@ #include "arr_inexact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { // Step (a)---construct a rectangular face. Point q1(1, 3), q2(3, 5), q3(5, 3), q4(3, 1); Segment s4(q1, q2), s1(q2, q3), s3(q3, q4), s2(q4, q1); 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 af098e30e1a..5f87c64bc5e 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 @@ -12,8 +12,7 @@ typedef CGAL::Arrangement_with_history_2 Arr_with_hist; typedef Arr_with_hist::Curve_handle Curve_handle; typedef CGAL::Arr_walk_along_line_point_location Point_location; -int main() -{ +int main() { // Construct an arrangement containing nine circles: C[0] of radius 2 and // C[1], ..., C[8] of radius 1. const Number_type _7_halves = Number_type(7) / Number_type(2); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp index d549dd22724..83e9ed7b511 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp @@ -17,7 +17,6 @@ private: size_t n_faces; // the current number of faces public: - Face_index_observer(Ex_arrangement& arr) : CGAL::Arr_observer(arr), n_faces(0) { @@ -31,10 +30,9 @@ public: } }; -int main () -{ +int main() { // Construct the arrangement containing two intersecting triangles. - Ex_arrangement arr; + Ex_arrangement arr; Face_index_observer obs(arr); insert_non_intersecting_curve(arr, Segment(Point(4, 1), Point(7, 6))); insert_non_intersecting_curve(arr, Segment(Point(1, 6), Point(7, 6))); 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 53451787cce..c5fbb593f25 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 @@ -14,8 +14,7 @@ typedef CGAL::Arr_face_overlay_traits > Overlay_traits; -int main() -{ +int main() { // Construct the first arrangement, containing a square-shaped face. Ex_arrangement arr1; insert_non_intersecting_curve(arr1, Segment(Point(2, 2), Point(6, 2))); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp index 2be08eda8aa..15273581462 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp @@ -20,8 +20,7 @@ typedef Ex_traits::Curve_2 Ex_polyline; typedef Ex_traits::X_monotone_curve_2 Ex_x_monotone_polyline; typedef CGAL::Arrangement_2 Ex_arrangement; -int main() -{ +int main() { // Construct an arrangement of four polylines named A--D. Ex_traits traits; Ex_arrangement arr(&traits); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp index bc54ddf7b0a..a19d22314e2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion.cpp @@ -4,8 +4,7 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -int main () -{ +int main() { Segment S1[] = {Segment(Point(1, 3), Point(4, 6)), Segment(Point(1, 3), Point(6, 3)), Segment(Point(1, 3), Point(4, 0)), diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_removal.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_removal.cpp index 62fff6959bc..d47b6c29379 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_removal.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_removal.cpp @@ -4,8 +4,7 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { // Create an arrangement of four line segments forming an H-shape: Arrangement arr; 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 9c01ccaee48..76a7035c047 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 @@ -10,8 +10,7 @@ typedef CGAL::Arr_naive_point_location Naive_pl; typedef CGAL::Arr_point_location_result::Type Pl_result_type; -int main() -{ +int main() { // Construct the arrangement of five intersecting segments. Arrangement arr; Naive_pl pl(arr); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp index e446b1f600a..c3bee40afed 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io.cpp @@ -1,48 +1,34 @@ //! \file examples/Arrangement_on_surface_2/io.cpp // Using the arrangement I/O operators. -#include -#include -#include -#include -#include #include +#include +#include + +#include "arr_inexact_construction_segments.h" +#include "arr_print.h" #include "point_location_utils.h" -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef CGAL::Arrangement_2 Arrangement_2; - -int main () -{ +int main() { // Construct the arrangement. - Arrangement_2 arr; - - construct_segments_arr (arr); - - std::cout << "Writing an arrangement of size:" << std::endl - << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl; + Arrangement arr1; + construct_segments_arr(arr1); + std::cout << "Writing" << std::endl; + print_arrangement_size(arr1); // Write the arrangement to a file. - std::ofstream out_file ("arr_ex_io.dat"); - - out_file << arr; + std::ofstream out_file("arr_ex_io.dat"); + out_file << arr1; out_file.close(); // Read the arrangement from the file. - Arrangement_2 arr2; - std::ifstream in_file ("arr_ex_io.dat"); - + Arrangement arr2; + std::ifstream in_file("arr_ex_io.dat"); in_file >> arr2; in_file.close(); + std::cout << "Reading" << std::endl; + print_arrangement_size(arr2); - std::cout << "Read an arrangement of size:" << std::endl - << " V = " << arr2.number_of_vertices() - << ", E = " << arr2.number_of_edges() - << ", F = " << arr2.number_of_faces() << std::endl; - - return (0); + return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp index 05ec5ce51e4..6966b3511e4 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp @@ -1,57 +1,46 @@ //! \file examples/Arrangement_on_surface_2/io_curve_history.cpp // Using the arrangement-with-history I/O operators. -#include -#include -#include -#include -#include #include -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::Curve_2 Segment_2; -typedef CGAL::Arrangement_with_history_2 Arr_with_hist_2; +#include +#include +#include -int main () -{ - Arr_with_hist_2 arr; +#include "arr_exact_construction_segments.h" +#include "arr_print.h" +typedef CGAL::Arrangement_with_history_2 Arr_with_hist; + +int main() { // Insert six additional segments aggregately: - Segment_2 segs[6]; - segs[0] = Segment_2 (Point_2 (2, 6), Point_2 (7, 1)); - segs[1] = Segment_2 (Point_2 (3, 2), Point_2 (3, 5)); - segs[2] = Segment_2 (Point_2 (2, 3), Point_2 (5, 3)); - segs[3] = Segment_2 (Point_2 (2, 6), Point_2 (7, 1)); - segs[4] = Segment_2 (Point_2 (0, 0), Point_2 (2, 6)); - segs[5] = Segment_2 (Point_2 (3, 4), Point_2 (6, 4)); - insert (arr, segs, segs + 6); + Segment segs[6]; + segs[0] = Segment(Point(2, 6), Point(7, 1)); + segs[1] = Segment(Point(3, 2), Point(3, 5)); + segs[2] = Segment(Point(2, 3), Point(5, 3)); + segs[3] = Segment(Point(2, 6), Point(7, 1)); + segs[4] = Segment(Point(0, 0), Point(2, 6)); + segs[5] = Segment(Point(3, 4), Point(6, 4)); + Arr_with_hist arr1; + insert(arr1, segs, segs + 6); std::cout << "Writing an arrangement of " - << arr.number_of_curves() << " input segments:" << std::endl - << " V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl; + << arr1.number_of_curves() << " input segments:" << std::endl; + print_arrangement_size(arr1); // Write the arrangement to a file. - std::ofstream out_file ("arr_ex_io_hist.dat"); - - out_file << arr; + std::ofstream out_file("arr_ex_io_hist.dat"); + out_file << arr1; out_file.close(); // Read the arrangement from the file. - Arr_with_hist_2 arr2; - std::ifstream in_file ("arr_ex_io_hist.dat"); - + Arr_with_hist arr2; + std::ifstream in_file("arr_ex_io_hist.dat"); in_file >> arr2; in_file.close(); - std::cout << "Read an arrangement of " - << arr2.number_of_curves() << " input segments:" << std::endl - << " V = " << arr2.number_of_vertices() - << ", E = " << arr2.number_of_edges() - << ", F = " << arr2.number_of_faces() << std::endl; + << arr2.number_of_curves() << " input segments:" << std::endl; + print_arrangement_size(arr2); - return (0); + return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp index 269feba04d7..28915836208 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded.cpp @@ -1,36 +1,26 @@ //! \file examples/Arrangement_2/io_unbounded.cpp // Using the I/O operators with an arrangement of unbounded curves. -#include -#include -#include -#include -#include #include #include -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_linear_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::Segment_2 Segment_2; -typedef Traits_2::Ray_2 Ray_2; -typedef Traits_2::Line_2 Line_2; -typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; -typedef CGAL::Arrangement_2 Arrangement_2; +#include +#include -int main () -{ +#include "arr_linear.h" + +int main() { // Construct an arrangement of five linear objects. - Arrangement_2 arr; - std::list curves; + Arrangement arr; + std::list curves; - curves.push_back (Line_2 (Point_2 (0, 0), Point_2 (2, 1))); - curves.push_back (Line_2 (Point_2 (0, 0), Point_2 (2, -1))); - curves.push_back (Line_2 (Point_2 (-1, 0), Point_2 (-1, 1))); - curves.push_back (Ray_2 (Point_2 (2, 3), Point_2 (2, 4))); - curves.push_back (Segment_2 (Point_2 (0, 1), Point_2 (0, 2))); + curves.push_back(Line(Point(0, 0), Point(2, 1))); + curves.push_back(Line(Point(0, 0), Point(2, -1))); + curves.push_back(Line(Point(-1, 0), Point(-1, 1))); + curves.push_back(Ray(Point(2, 3), Point(2, 4))); + curves.push_back(Segment(Point(0, 1), Point(0, 2))); - insert (arr, curves.begin(), curves.end()); + insert(arr, curves.begin(), curves.end()); // Print out the size of the resulting arrangement. std::cout << "Writing an arrangement of size:" << std::endl @@ -43,14 +33,14 @@ int main () << std::endl << std::endl; // Write the arrangement to a file. - std::ofstream out_file ("arr_ex_io_unbounded.dat"); + std::ofstream out_file("arr_ex_io_unbounded.dat"); out_file << arr; out_file.close(); // Read the arrangement from the file. - Arrangement_2 arr2; - std::ifstream in_file ("arr_ex_io_unbounded.dat"); + Arrangement arr2; + std::ifstream in_file("arr_ex_io_unbounded.dat"); in_file >> arr2; in_file.close(); @@ -64,5 +54,5 @@ int main () << " (" << arr2.number_of_unbounded_faces() << " unbounded)" << std::endl << std::endl; - return (0); + return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp index 968f1328f57..388a9851e67 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp @@ -4,8 +4,7 @@ #include "arr_inexact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { // Insert isolated points. Arrangement arr; Face_handle uf = arr.unbounded_face(); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp index 275330fcd2a..43dc0c5cb86 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp @@ -10,7 +10,6 @@ // An observer that receives notifications of face splits and face mergers. class My_observer : public CGAL::Arr_observer { public: - My_observer(Arrangement& arr) : CGAL::Arr_observer(arr) {} virtual void before_split_face(Face_handle, Halfedge_handle e) @@ -26,8 +25,7 @@ public: } }; -int main() -{ +int main() { // Construct the arrangement containing one diamond-shaped face. Arrangement arr; My_observer obs(arr); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp index 27ebffa6008..4f2fa8a38dd 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay.cpp @@ -7,8 +7,7 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { // Construct the first arrangement, containing a square-shaped face. Arrangement arr1; insert_non_intersecting_curve(arr1, Segment(Point(2, 2), Point(6, 2))); 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 b5ab799bf62..0a1e106681d 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 @@ -13,8 +13,7 @@ typedef unsigned int Color; typedef CGAL::Arr_extended_dcel Dcel; typedef CGAL::Arrangement_2 Ex_arrangement; -int main() -{ +int main() { const Color vcol1(0x00000080), hcol1(0x000000ff), fcol1(0x00ccccff); const Color vcol2(0x00800000), hcol2(0x00ff0000), fcol2(0x00ffcccc); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp index 33f117f6990..304b9826242 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp @@ -27,8 +27,7 @@ typedef CGAL::Arr_face_overlay_traits Overlay_traits; -int main() -{ +int main() { // Construct the first arrangement, induced by two lines y = x and y = -x. Arrangement_blue arr1; insert(arr1, Line(Point(0, 0), Point(1, 1))); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp index 0cdc79c8f09..31224d3363c 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp @@ -11,23 +11,22 @@ typedef CGAL::Arr_naive_point_location Naive_pl; typedef CGAL::Arr_landmarks_point_location Landmarks_pl; -int main () -{ +int main() { // Construct the arrangement. Arrangement arr; construct_segments_arr(arr); // Perform some point-location queries using the naive strategy. Naive_pl naive_pl(arr); - point_location_query(naive_pl, Point(1, 4)); // q1 - point_location_query(naive_pl, Point(4, 3)); // q2 - point_location_query(naive_pl, Point(6, 3)); // q3 + locate_point(naive_pl, Point(1, 4)); // q1 + locate_point(naive_pl, Point(4, 3)); // q2 + locate_point(naive_pl, Point(6, 3)); // q3 // Perform some point-location queries using the landmark strategy. Landmarks_pl landmarks_pl(arr); - point_location_query(landmarks_pl, Point(3, 2)); // q4 - point_location_query(landmarks_pl, Point(5, 2)); // q5 - point_location_query(landmarks_pl, Point(1, 0)); // q6 + locate_point(landmarks_pl, Point(3, 2)); // q4 + locate_point(landmarks_pl, Point(5, 2)); // q5 + locate_point(landmarks_pl, Point(1, 0)); // q6 return 0; } 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 bed7aead09d..17d7b8a7af5 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 @@ -6,52 +6,36 @@ #include -int main() -{ +int main() { std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else -#include -#include -#include -#include +#include #include + +#include "arr_Bezier.h" #include "arr_print.h" -typedef CGAL::CORE_algebraic_number_traits Nt_traits; -typedef Nt_traits::Rational NT; -typedef Nt_traits::Rational Rational; -typedef Nt_traits::Algebraic Algebraic; -typedef CGAL::Cartesian Rat_kernel; -typedef CGAL::Cartesian Alg_kernel; -typedef Rat_kernel::Point_2 Rat_point_2; -typedef CGAL::Arr_Bezier_curve_traits_2 - Bezier_traits; -typedef Bezier_traits::Curve_2 Bezier_curve_2; -typedef Bezier_traits::X_monotone_curve_2 Bezier_x_curve_2; -typedef CGAL::Arr_polycurve_traits_2 Polycurve_bezier_traits_2; -typedef Polycurve_bezier_traits_2::X_monotone_curve_2 X_mono_polycurve; -typedef CGAL::Arrangement_2 Arrangement_2; +typedef CGAL::Arr_polycurve_traits_2 Polycurve_bezier_traits; +typedef Polycurve_bezier_traits::X_monotone_curve_2 X_mono_polycurve; +typedef CGAL::Arrangement_2 Arrangement_2; -int main() -{ - Polycurve_bezier_traits_2 pc_traits; - Bezier_traits bezier_traits; +int main() { + Polycurve_bezier_traits pc_traits; + Traits bezier_traits; - Polycurve_bezier_traits_2::Construct_x_monotone_curve_2 - construct_x_mono_polycurve = - pc_traits.construct_x_monotone_curve_2_object(); + auto ctr_xpolycurve = pc_traits.construct_x_monotone_curve_2_object(); - std::vector x_bezier_curves; + std::vector x_bezier_curves; // Get the name of the input file from the command line, or use the default // Bezier.dat file if no command-line parameters are given. const char* filename = "Bezier_polycurve.dat"; // Open the input file. - std::ifstream in_file (filename); + std::ifstream in_file(filename); if (! in_file.is_open()) { std::cerr << "Failed to open " << filename << std::endl; @@ -60,8 +44,8 @@ int main() // Read the curves from the input file. unsigned int n_curves; - std::list x_curves; - Bezier_curve_2 B; + std::list x_curves; + Bezier_curve B; in_file >> n_curves; unsigned int k; @@ -71,13 +55,12 @@ int main() //convert it into x-monotone bezier curve. std::vector obj_vector; bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector)); - Bezier_x_curve_2 x_seg = - CGAL::object_cast((obj_vector[0])); + Bezier_x_monotone_curve x_seg = + CGAL::object_cast((obj_vector[0])); x_curves.push_back(x_seg); } - X_mono_polycurve polycurve = - construct_x_mono_polycurve(x_curves.begin(), x_curves.end()); + X_mono_polycurve polycurve = ctr_xpolycurve(x_curves.begin(), x_curves.end()); // Construct the arrangement. Arrangement_2 arr; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp index 9ca7f658075..0bd2cae7ba9 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp @@ -6,70 +6,57 @@ #include -int main() -{ +int main() { std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else -#include -#include -#include -#include #include -#include + +#include +#include #include -#include -#include + +#include "arr_circular.h" #include "arr_print.h" -typedef CGAL::Quotient Number_type; -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_circle_segment_traits_2 Arc_traits_2; -typedef CGAL::Arr_polycurve_traits_2 Polycurve_arc_traits_2; +typedef CGAL::Arr_polycurve_traits_2 Polycurve_traits; +typedef Polycurve_traits::X_monotone_curve_2 X_monotone_polycurve; +typedef Polycurve_traits::Curve_2 Polycurve; +typedef Kernel::Circle_2 Circle_2; +typedef CGAL::Arrangement_2 Polycurve_circ_arc_arrangment; -typedef Arc_traits_2::CoordNT CoordNT; -typedef Arc_traits_2::Point_2 Point_2; -typedef Arc_traits_2::Curve_2 Arc_section_2; -typedef Arc_traits_2::X_monotone_curve_2 Arc_x_monotone_section_2; - -typedef Polycurve_arc_traits_2::X_monotone_curve_2 X_monotone_polycurve; -typedef Polycurve_arc_traits_2::Curve_2 Polycurve; -typedef Kernel::Circle_2 Circle_2; -typedef CGAL::Arrangement_2 - Polycurve_circ_arc_arrangment; - -int main() -{ - Polycurve_arc_traits_2 traits; +int main() { + Polycurve_traits traits; + auto ctr_curve = traits.construct_curve_2_object(); + auto ctr_xcurve = traits.construct_x_monotone_curve_2_object(); //Containers to store conic curves that will be used to create polycurve. - std::vector curves; - std::vector x_curves; + std::vector curves; + std::vector x_curves; // Create a circular arc of the circle, directed clockwise from // (-1, 0) to (1, 0) centered at (0,0). Note that we orient the // supporting circle accordingly. - Kernel::Point_2 c1(0, 0); - Point_2 s1(Number_type(-1, 1), Number_type(0, 1)); - Point_2 t1(Number_type(1, 1), Number_type(0, 1)); - Arc_section_2 circ_arc1(c1, 1, CGAL::CLOCKWISE, s1, t1); + Rational_point c1(0, 0); + Point s1(Number_type(-1), Number_type(0)); + Point t1(Number_type(1), Number_type(0)); + Curve circ_arc1(c1, 1, CGAL::CLOCKWISE, s1, t1); curves.push_back(circ_arc1); // Create a circular arc of the unit circle, directed clockwise from // (1, 0) to (3, 0) centered at (3,0). Note that we orient the // supporting circle accordingly. - Kernel::Point_2 c2(3, 0); - Point_2 s2(Number_type(1, 1), Number_type(0, 1)); - Point_2 t2(Number_type(5, 1), Number_type(0, 1)); - Arc_section_2 circ_arc2(c2, 2, CGAL::CLOCKWISE, s2, t2); + Rational_point c2(3, 0); + Point s2(Number_type(1), Number_type(0)); + Point t2(Number_type(5), Number_type(0)); + Curve circ_arc2(c2, 2, CGAL::CLOCKWISE, s2, t2); curves.push_back(circ_arc2); // Create polycurve - Polycurve polycurve_1 = - traits.construct_curve_2_object()(curves.begin(), curves.end()); + Polycurve polycurve_1 = ctr_curve(curves.begin(), curves.end()); // Empty the vector in order to create another polycurve. curves.clear(); @@ -77,46 +64,44 @@ int main() // Create a circular arc of the circle, directed clockwise from // (-10, 13) to (-7, 10) centered at (-10,10). Note that we orient the // supporting circle accordingly. - Kernel::Point_2 c3(-10, 10); - Point_2 s3(Number_type(-10, 1), Number_type(13, 1)); - Point_2 t3(Number_type(-7, 1), Number_type(10, 1)); - Arc_section_2 circ_arc3(c3, 3, CGAL::CLOCKWISE, s3, t3); + Rational_point c3(-10, 10); + Point s3(Number_type(-10), Number_type(13)); + Point t3(Number_type(-7), Number_type(10)); + Curve circ_arc3(c3, 3, CGAL::CLOCKWISE, s3, t3); curves.push_back(circ_arc3); - Kernel::Point_2 c4(-20, 10); - Point_2 s4(Number_type(-7, 1), Number_type(10, 1)); - Point_2 t4(Number_type(-20, 1), Number_type(23, 1)); - Arc_section_2 circ_arc4(c4, 13, CGAL::CLOCKWISE, s4, t4); + Rational_point c4(-20, 10); + Point s4(Number_type(-7), Number_type(10)); + Point t4(Number_type(-20), Number_type(23)); + Curve circ_arc4(c4, 13, CGAL::CLOCKWISE, s4, t4); curves.push_back(circ_arc4); - Kernel::Point_2 c5(-20, 25); - Point_2 s5(Number_type(-20, 1), Number_type(23, 1)); - Point_2 t5(Number_type(-20, 1), Number_type(27, 1)); - Arc_section_2 circ_arc5(c5, 2, CGAL::CLOCKWISE, s5, t5); + Rational_point c5(-20, 25); + Point s5(Number_type(-20), Number_type(23)); + Point t5(Number_type(-20), Number_type(27)); + Curve circ_arc5(c5, 2, CGAL::CLOCKWISE, s5, t5); curves.push_back(circ_arc5); - Polycurve polycurve_2 = - traits.construct_curve_2_object()(curves.begin(), curves.end()); + Polycurve polycurve_2 = ctr_curve(curves.begin(), curves.end()); //circle to be used by x-monotone polycurve - Kernel::Point_2 circle_center1(Number_type(10, 1), Number_type(10, 1)); + Rational_point circle_center1(Number_type(10), Number_type(10)); Circle_2 circ_1(circle_center1, 4, CGAL::CLOCKWISE); - Point_2 s6(Number_type(8, 1), Number_type(10, 1)); - Point_2 t6(Number_type(12, 1), Number_type(10, 1)); - Arc_x_monotone_section_2 xc1(circ_1, s6, t6, CGAL::CLOCKWISE); + Point s6(Number_type(8), Number_type(10)); + Point t6(Number_type(12), Number_type(10)); + X_monotone_curve xc1(circ_1, s6, t6, CGAL::CLOCKWISE); x_curves.push_back(xc1); - Kernel::Point_2 circle_center2(Number_type(13, 1), Number_type(10, 1)); + Rational_point circle_center2(Number_type(13), Number_type(10)); Circle_2 circ_2(circle_center2, 1, CGAL::CLOCKWISE); - Point_2 s7(Number_type(12, 1), Number_type(10, 1)); - Point_2 t7(Number_type(14, 1), Number_type(10, 1)); - Arc_x_monotone_section_2 xc2(circ_2, s7, t7, CGAL::CLOCKWISE); + Point s7(Number_type(12), Number_type(10)); + Point t7(Number_type(14), Number_type(10)); + X_monotone_curve xc2(circ_2, s7, t7, CGAL::CLOCKWISE); x_curves.push_back(xc2); //create x-monotone polycurve X_monotone_polycurve x_polycurve_1 = - traits.construct_x_monotone_curve_2_object()(x_curves.begin(), - x_curves.end()); + ctr_xcurve(x_curves.begin(), x_curves.end()); // Insert polycurves to Arangment and print. Polycurve_circ_arc_arrangment polycurve_arrangment(&traits); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp index a32b4ab1150..28415058b49 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp @@ -6,108 +6,90 @@ #include -int main() -{ +int main() { std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } #else -#include -#include -#include -#include #include -#include +#include #include -#include -#include + +#include "arr_conics.h" #include "arr_print.h" -typedef CGAL::CORE_algebraic_number_traits Nt_traits; -typedef Nt_traits::Rational Rational; -typedef Nt_traits::Algebraic Algebraic; -typedef CGAL::Cartesian Rat_kernel; -typedef CGAL::Cartesian Alg_kernel; -typedef CGAL::Arr_conic_traits_2 - Conic_traits_2; -typedef Conic_traits_2::Point_2 Conic_point_2; -typedef Conic_traits_2::Curve_2 Conic_curve_2; -typedef Conic_traits_2::X_monotone_curve_2 Conic_x_monotone_curve_2; -typedef CGAL::Arr_polycurve_traits_2 Polycurve_conic_traits_2; +typedef CGAL::Arr_polycurve_traits_2 Polycurve_conic_traits_2; typedef Polycurve_conic_traits_2::X_monotone_curve_2 X_monotone_polycurve; typedef Polycurve_conic_traits_2::Curve_2 Polycurve; typedef CGAL::Arrangement_2 Polycurve_conic_arrangment; -int main() -{ +int main() { Polycurve_conic_traits_2 traits; // Polycurve construction functors - Polycurve_conic_traits_2::Construct_x_monotone_curve_2 - construct_x_mono_polycurve = traits.construct_x_monotone_curve_2_object(); - Polycurve_conic_traits_2::Construct_curve_2 construct_polycurve = - traits.construct_curve_2_object(); + auto ctr_xpolycurve = traits.construct_x_monotone_curve_2_object(); + auto ctr_polycurve = traits.construct_curve_2_object(); // Containers to store conic curves that will be used to create polycurve. - std::vector conic_curves; - std::vector xmono_conic_curves_2; + std::vector conic_curves; + std::vector xmono_conic_curves_2; // Create polycurves // y=x^2 - Conic_curve_2 c3(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(0), Algebraic(0)), - Conic_point_2(Algebraic(3), Algebraic(9))); - Conic_curve_2 c4(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(3), Algebraic(9)), - Conic_point_2(Algebraic(5), Algebraic(25))); - Conic_curve_2 c5(0,1,0,1,0,0, CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(-25), Algebraic(-5)), - Conic_point_2(Algebraic(0), Algebraic(0))); + Conic_arc c3(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(0), Algebraic(0)), + Point(Algebraic(3), Algebraic(9))); + Conic_arc c4(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(3), Algebraic(9)), + Point(Algebraic(5), Algebraic(25))); + Conic_arc c5(0,1,0,1,0,0, CGAL::COUNTERCLOCKWISE, + Point(Algebraic(-25), Algebraic(-5)), + Point(Algebraic(0), Algebraic(0))); - Conic_curve_2 c6(1,1,0,6,-26,162,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(-7), Algebraic(13)), - Conic_point_2(Algebraic(-3), Algebraic(9))); - Conic_curve_2 c7(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(-3), Algebraic(9)), - Conic_point_2(Algebraic(0), Algebraic(0))); - Conic_curve_2 c8(0,1,0,-1,0,0, CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(0), Algebraic(0)), - Conic_point_2(Algebraic(4), Algebraic(-2))); + Conic_arc c6(1,1,0,6,-26,162,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(-7), Algebraic(13)), + Point(Algebraic(-3), Algebraic(9))); + Conic_arc c7(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(-3), Algebraic(9)), + Point(Algebraic(0), Algebraic(0))); + Conic_arc c8(0,1,0,-1,0,0, CGAL::COUNTERCLOCKWISE, + Point(Algebraic(0), Algebraic(0)), + Point(Algebraic(4), Algebraic(-2))); - Conic_curve_2 c9(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(-5), Algebraic(25)), - Conic_point_2(Algebraic(5), Algebraic(25))); + Conic_arc c9(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(-5), Algebraic(25)), + Point(Algebraic(5), Algebraic(25))); // Construct poly-curve conic_curves.clear(); conic_curves.push_back(c9); Polycurve conic_polycurve_1 = - construct_polycurve(conic_curves.begin(), conic_curves.end()); + ctr_polycurve(conic_curves.begin(), conic_curves.end()); - Conic_curve_2 c11(0,1,0,-1,0,0,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(25), Algebraic(-5)), - Conic_point_2(Algebraic(0), Algebraic(0))); - Conic_curve_2 c12(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, - Conic_point_2(Algebraic(0), Algebraic(0)), - Conic_point_2(Algebraic(5), Algebraic(25))); + Conic_arc c11(0,1,0,-1,0,0,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(25), Algebraic(-5)), + Point(Algebraic(0), Algebraic(0))); + Conic_arc c12(1,0,0,0,-1,0,CGAL::COUNTERCLOCKWISE, + Point(Algebraic(0), Algebraic(0)), + Point(Algebraic(5), Algebraic(25))); // Construct poly-curve conic_curves.clear(); conic_curves.push_back(c11); conic_curves.push_back(c12); Polycurve conic_polycurve_2 = - construct_polycurve(conic_curves.begin(), conic_curves.end()); + ctr_polycurve(conic_curves.begin(), conic_curves.end()); // Construct x-monotone conic curves from conic curves - Conic_x_monotone_curve_2 xc3(c3); - Conic_x_monotone_curve_2 xc4(c4); - Conic_x_monotone_curve_2 xc5(c5); - Conic_x_monotone_curve_2 xc6(c6); - Conic_x_monotone_curve_2 xc7(c7); - Conic_x_monotone_curve_2 xc8(c8); + X_monotone_conic_arc xc3(c3); + X_monotone_conic_arc xc4(c4); + X_monotone_conic_arc xc5(c5); + X_monotone_conic_arc xc6(c6); + X_monotone_conic_arc xc7(c7); + X_monotone_conic_arc xc8(c8); // Construct x-monotone poly-curve from x-monotone conic curves. xmono_conic_curves_2.clear(); @@ -115,7 +97,7 @@ int main() xmono_conic_curves_2.push_back(xc3); xmono_conic_curves_2.push_back(xc4); X_monotone_polycurve conic_x_mono_polycurve_1 = - construct_x_mono_polycurve(xmono_conic_curves_2.begin(), + ctr_xpolycurve(xmono_conic_curves_2.begin(), xmono_conic_curves_2.end()); // Construct x-monotone poly-curve. @@ -124,8 +106,7 @@ int main() xmono_conic_curves_2.push_back(xc7); xmono_conic_curves_2.push_back(xc8); X_monotone_polycurve conic_x_mono_polycurve_2 = - construct_x_mono_polycurve(xmono_conic_curves_2.begin(), - xmono_conic_curves_2.end()); + ctr_xpolycurve(xmono_conic_curves_2.begin(), xmono_conic_curves_2.end()); // Insert the Polycurves into arrangment and print. Polycurve_conic_arrangment x_pc_arrangment(&traits); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp index d5f9d63a49c..fdf6a5d0a5a 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp @@ -29,8 +29,7 @@ typedef CGAL::Arr_spherical_topology_traits_2 typedef CGAL::Arrangement_on_surface_2 Segment_arr; -int main() -{ +int main() { Segment_traits_2 seg_traits; Segment_traits_2::Construct_point_2 ctr_p = seg_traits.construct_point_2_object(); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp index bdd1e4eab8e..0e11fef65db 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp @@ -1,44 +1,41 @@ //! \file examples/Arrangement_on_surface_2/polylines.cpp // Constructing an arrangement of polylines. +#include + #include #include #include #include -#include -#include typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef CGAL::Arr_directional_non_caching_segment_basic_traits_2 - Subcurve_traits_2; -typedef CGAL::Arr_polycurve_basic_traits_2 - Geom_traits_2; -typedef Geom_traits_2::Point_2 Point_2; -typedef Subcurve_traits_2::X_monotone_curve_2 X_monotone_subcurve_2; -typedef Geom_traits_2::X_monotone_curve_2 X_monotone_curve_2; -typedef CGAL::Arrangement_2 Arrangement_2; + Subcurve_traits; +typedef CGAL::Arr_polycurve_basic_traits_2 Geom_traits; +typedef Geom_traits::Point_2 Point; +typedef Subcurve_traits::X_monotone_curve_2 X_monotone_subcurve; +typedef Geom_traits::X_monotone_curve_2 X_monotone_curve; +typedef CGAL::Arrangement_2 Arrangement; -int main() -{ - Geom_traits_2 traits; - Arrangement_2 arr(&traits); +int main() { + Geom_traits traits; + Arrangement arr(&traits); - Geom_traits_2::Construct_x_monotone_curve_2 ctr = - traits.construct_x_monotone_curve_2_object(); + auto ctr = traits.construct_x_monotone_curve_2_object(); - std::vector segs1; - segs1.push_back(X_monotone_subcurve_2(Point_2(0, 0), Point_2(1, 1))); - segs1.push_back(X_monotone_subcurve_2(Point_2(1, 1), Point_2(2, 2))); - segs1.push_back(X_monotone_subcurve_2(Point_2(2, 2), Point_2(3, 1))); - segs1.push_back(X_monotone_subcurve_2(Point_2(3, 1), Point_2(4, 0))); - X_monotone_curve_2 pc1 = ctr(segs1.begin(), segs1.end()); + std::vector segs1; + segs1.push_back(X_monotone_subcurve(Point(0, 0), Point(1, 1))); + segs1.push_back(X_monotone_subcurve(Point(1, 1), Point(2, 2))); + segs1.push_back(X_monotone_subcurve(Point(2, 2), Point(3, 1))); + segs1.push_back(X_monotone_subcurve(Point(3, 1), Point(4, 0))); + X_monotone_curve pc1 = ctr(segs1.begin(), segs1.end()); - std::vector segs2; - segs2.push_back(X_monotone_subcurve_2(Point_2(0, 0), Point_2(1, 1))); - segs2.push_back(X_monotone_subcurve_2(Point_2(1, 1), Point_2(2, 2))); - segs2.push_back(X_monotone_subcurve_2(Point_2(2, 2), Point_2(3, 1))); - segs2.push_back(X_monotone_subcurve_2(Point_2(3, 1), Point_2(4, 0))); - X_monotone_curve_2 pc2 = ctr(segs2.begin(), segs2.end()); + std::vector segs2; + segs2.push_back(X_monotone_subcurve(Point(0, 0), Point(1, 1))); + segs2.push_back(X_monotone_subcurve(Point(1, 1), Point(2, 2))); + segs2.push_back(X_monotone_subcurve(Point(2, 2), Point(3, 1))); + segs2.push_back(X_monotone_subcurve(Point(3, 1), Point(4, 0))); + X_monotone_curve pc2 = ctr(segs2.begin(), segs2.end()); insert_non_intersecting_curve(arr, pc1); insert_non_intersecting_curve(arr, pc2); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polylines.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polylines.cpp index 80d26bd1777..90f699cf7e9 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polylines.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polylines.cpp @@ -4,7 +4,7 @@ #include #include -#include "arr_polylines .h" +#include "arr_polylines.h" #include "arr_print.h" /* Define the Arrangement traits class to be used. You can either use some user @@ -23,8 +23,7 @@ typedef Geom_traits_2::Segment_2 Segment_2; typedef Geom_traits_2::Curve_2 Polyline_2; typedef CGAL::Arrangement_2 Arrangement_2; -int main() -{ +int main() { Geom_traits_2 traits; Arrangement_2 arr(&traits); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp index 0f40279dc76..2781b6ee36c 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp @@ -16,14 +16,13 @@ typedef Traits_2::Point_2 Point_2; typedef Traits_2::X_monotone_curve_2 Segment_2; typedef CGAL::Arrangement_2 Arrangement_2; -int main (int argc, char *argv[]) -{ +int main (int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default // fan_grids.dat file if no command-line parameters are given. - const char * filename = (argc > 1) ? argv[1] : "fan_grids.dat"; + const char* filename = (argc > 1) ? argv[1] : "fan_grids.dat"; // Open the input file. - std::ifstream in_file (filename); + std::ifstream in_file(filename); if (! in_file.is_open()) { std::cerr << "Failed to open " << filename << " ..." << std::endl; @@ -52,14 +51,14 @@ int main (int argc, char *argv[]) in_file.close(); // Construct the arrangement by aggregately inserting all segments. - Arrangement_2 arr; - CGAL::Timer timer; + Arrangement_2 arr; + CGAL::Timer timer; std::cout << "Performing aggregated insertion of " << n << " segments." << std::endl; timer.start(); - insert (arr, segments.begin(), segments.end()); + insert(arr, segments.begin(), segments.end()); timer.stop(); // Print the arrangement dimensions. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp index 1dfd35593be..0e3f360fe66 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp @@ -16,14 +16,13 @@ typedef Traits_2::Point_2 Point_2; typedef Traits_2::X_monotone_curve_2 Segment_2; typedef CGAL::Arrangement_2 Arrangement_2; -int main (int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default // Europe.dat file if no command-line parameters are given. - const char * filename = (argc > 1) ? argv[1] : "Europe.dat"; + const char* filename = (argc > 1) ? argv[1] : "Europe.dat"; // Open the input file. - std::ifstream in_file (filename); + std::ifstream in_file(filename); if (! in_file.is_open()) { std::cerr << "Failed to open " << filename << " ..." << std::endl; @@ -52,8 +51,8 @@ int main (int argc, char *argv[]) in_file.close(); // Construct the arrangement by aggregately inserting all segments. - Arrangement_2 arr; - CGAL::Timer timer; + Arrangement_2 arr; + CGAL::Timer timer; std::cout << "Performing aggregated insertion of " << n << " segments." << std::endl; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp index 07e84607b39..ee7192d1d35 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp @@ -4,8 +4,7 @@ #include "arr_rat_functions.h" #include "arr_print.h" -int main() -{ +int main() { CGAL::set_pretty_mode(std::cout); // for nice printouts. // Define a traits class object and a constructor for rational functions. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp index 3b9f7e391c2..5eb4b14d07e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp @@ -5,8 +5,7 @@ #ifndef CGAL_USE_CORE #include -int main () -{ +int main() { std::cout << "Sorry, this example needs CORE ..." << std::endl; return 0; } @@ -29,8 +28,7 @@ typedef Traits_2::Algebraic_real_1 Alg_real_1; typedef CGAL::Arrangement_2 Arrangement_2; -int main () -{ +int main() { CGAL::set_pretty_mode(std::cout); // for nice printouts. // Traits class object @@ -92,7 +90,7 @@ int main () // Print the arcs. for (unsigned int i(0); i < arcs.size(); ++i) - std::cout << arcs[i]< results; @@ -97,8 +96,7 @@ protected: // CGAL::locate(gm, &points[0], &points[3], std::back_inserter(results)); // Print the results. - std::list::const_iterator it; - for (it = results.begin(); it != results.end(); ++it) { + for (auto it = results.begin(); it != results.end(); ++it) { std::cout << "The point (" << it->first << ") is located "; if (const Face_const_handle* f = boost::get(&(it->second))) // inside a face diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp index ac0feed53b2..8e07a40c3dd 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp @@ -4,8 +4,7 @@ #include "arr_inexact_construction_segments.h" #include "arr_print.h" -int main() -{ +int main() { Point p0(3, 3), p1(1, 3), p2(3, 5), p3(5, 3), p4(3, 1); Segment s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p1); Segment s5(p1, p0), s6(p0, p3), s7(p4, p0), s8(p0, p2); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert1.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert1.cpp index 94beca826d3..4fb3a452a9a 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert1.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert1.cpp @@ -20,8 +20,7 @@ typedef CGAL::Arrangement_on_surface_2 Arrangement_2; typedef Arrangement_2::Vertex_handle Vertex_handle; -int main() -{ +int main() { Geom_traits_2 traits; Geom_traits_2::Construct_point_2 ctr_p = traits.construct_point_2_object(); Geom_traits_2::Construct_x_monotone_curve_2 ctr_xcv = diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert2.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert2.cpp index 214b93d02c1..df847fb9cda 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert2.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_insert2.cpp @@ -23,12 +23,10 @@ typedef CGAL::Arrangement_on_surface_2 Arrangement_2; typedef Arrangement_2::Vertex_handle Vertex_handle; -int main() -{ +int main() { Geom_traits_2 traits; - Geom_traits_2::Construct_point_2 ctr_p = traits.construct_point_2_object(); - Geom_traits_2::Construct_x_monotone_curve_2 ctr_xcv = - traits.construct_x_monotone_curve_2_object(); + auto ctr_p = traits.construct_point_2_object(); + auto ctr_xcv = traits.construct_x_monotone_curve_2_object(); Arrangement_2 arr(&traits); Point_2 sp = ctr_p(0, 0, -1); Point_2 np = ctr_p(0, 0, 1); 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 223f937c37a..6d7d15cd7eb 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 @@ -32,8 +32,7 @@ typedef CGAL::Arrangement_on_surface_2 Arrangement_2; typedef Arrangement_2::Vertex_handle Vertex_handle; -int main() -{ +int main() { Geom_traits_2 traits; Geom_traits_2::Construct_point_2 ctr_p = traits.construct_point_2_object(); Geom_traits_2::Construct_x_monotone_curve_2 ctr_xcv = @@ -89,7 +88,8 @@ int main() unsigned subsets = (1 << xcvs.size()); std::cout << "#subsets curves: " << subsets << std::endl; - std::cout << "total combinations: " << (subsetsp)*(subsets) << std::endl<< std::endl;; + std::cout << "total combinations: " << (subsetsp)*(subsets) + << std::endl<< std::endl; for (unsigned up = 0; up < subsetsp; up++) { std::vector< Point_2 > points_sub; @@ -109,8 +109,10 @@ int main() } } - std::cout << "subsetpoints #" << up << " has size: " << points_sub.size() << std::endl; - std::cout << "subsetcurves #" << u << " has size: " << xcvs_sub.size() << std::endl; + std::cout << "subsetpoints #" << up << " has size: " + << points_sub.size() << std::endl; + std::cout << "subsetcurves #" << u << " has size: " + << xcvs_sub.size() << std::endl; #if 1 Arrangement_2 arr; @@ -120,7 +122,8 @@ int main() << std::endl; // TODO why is this signature not available as "insert(...)" - CGAL::insert_empty(arr, xcvs_sub.begin(), xcvs_sub.end(), points_sub.begin(), points_sub.end()); + CGAL::insert_empty(arr, xcvs_sub.begin(), xcvs_sub.end(), + points_sub.begin(), points_sub.end()); // Print the size of the arrangement. std::cout << "The arrangement size:" << std::endl @@ -128,7 +131,8 @@ int main() << ", E = " << arr.number_of_edges() << ", F = " << arr.number_of_faces() << std::endl; - std::cout << "=======================================================" << std::endl << std::endl << std::endl; + std::cout << "=======================================================" + << std::endl << std::endl << std::endl; #endif //std::cout << "arr: " << arr << std::endl; std::cout << std::endl; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp index b676bad6d0a..ab493f3e991 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp @@ -19,8 +19,7 @@ typedef CGAL::Arr_spherical_topology_traits_2 Topol_traits_2; typedef CGAL::Arrangement_on_surface_2 Arrangement_2; -int main() -{ +int main() { // Construct the arrangement from 12 geodesic arcs. Geom_traits_2 traits; Arrangement_2 arr(&traits); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp index 08b58129b33..542a2c78b10 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp @@ -17,8 +17,7 @@ typedef CGAL::Arrangement_on_surface_2 Arrangement_2; typedef CGAL::Arr_default_overlay_traits Overlay_traits; -int main() -{ +int main() { Geom_traits_2 traits; Geom_traits_2::Construct_point_2 ctr_p = traits.construct_point_2_object(); Geom_traits_2::Construct_x_monotone_curve_2 ctr_xcv = diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp index 89e254899d8..351e5c7e004 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp @@ -1,43 +1,37 @@ //! \file examples/Arrangement_on_surface_2/tracing_counting.cpp // Trace all traits operations and count them. -#include -#include -#include -#include -#include -#include #include -typedef CGAL::Quotient Number_type; -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Segment_traits_2; -typedef CGAL::Arr_tracing_traits_2 Tracing_traits_2; -typedef CGAL::Arr_counting_traits_2 Geom_traits_2; -typedef Geom_traits_2::Point_2 Point_2; -typedef Geom_traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arrangement_2 Arrangement_2; +#include +#include +#include -int main () -{ - const Segment_2 s1(Point_2(0, 0), Point_2(2, 2)); - const Segment_2 s2(Point_2(2, 0), Point_2(0, 2)); - std::list segments; +#include "arr_exact_construction_segments.h" + +typedef CGAL::Arr_tracing_traits_2 Tracing_traits; +typedef CGAL::Arr_counting_traits_2 Geom_traits; +typedef CGAL::Arrangement_2 My_arrangement; + +int main() { + const Segment s1(Point(0, 0), Point(2, 2)); + const Segment s2(Point(2, 0), Point(0, 2)); + std::list segments; segments.push_back(s1); segments.push_back(s2); - Geom_traits_2 traits; + Geom_traits traits; traits.disable_all_traces(); - traits.enable_trace(Tracing_traits_2::INTERSECT_OP); + traits.enable_trace(Tracing_traits::INTERSECT_OP); // Construct an arrangement using aggregated insertion: - Arrangement_2 arr1(&traits); + My_arrangement arr1(&traits); insert(arr1, segments.begin(), segments.end()); std::cout << traits << std::endl; traits.clear_counters(); // Construct an arrangement using incremental insertion: - Arrangement_2 arr2(&traits); + My_arrangement arr2(&traits); insert(arr2, s1); insert(arr2, s2); std::cout << traits << std::endl; 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 ef04deb25ce..d82482c1f1c 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 @@ -1,79 +1,59 @@ //! \file examples/Arrangement_on_surface_2/vertical_decomposition.cpp // Performing vertical decomposition of an arrangement. -#include -#include -#include -#include -#include #include -typedef CGAL::MP_Float Number_type; -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_linear_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arrangement_2 Arrangement_2; -typedef Arrangement_2::Vertex_const_handle Vertex_const_handle; -typedef Arrangement_2::Halfedge_const_handle Halfedge_const_handle; -typedef Arrangement_2::Face_const_handle Face_const_handle; +#include +#include + +#include "arr_linear.h" typedef std::pair > Vert_decomp_entry; typedef std::list Vert_decomp_list; -int main () -{ +int main() { // Construct the arrangement. - Arrangement_2 arr; + Arrangement arr; - insert_non_intersecting_curve(arr, Segment_2(Point_2(1, 1), Point_2(3, 0))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(1, 1), Point_2(2, 2))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(2, 2), Point_2(3, 0))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(2, 2), Point_2(5, 0))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(3, 2), Point_2(5, 0))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(2, 3), Point_2(3, 3))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(0, 3), Point_2(6, 4))); - insert_non_intersecting_curve(arr, Segment_2(Point_2(4, 4), Point_2(4, 5))); + insert_non_intersecting_curve(arr, Segment(Point(1, 1), Point(3, 0))); + insert_non_intersecting_curve(arr, Segment(Point(1, 1), Point(2, 2))); + insert_non_intersecting_curve(arr, Segment(Point(2, 2), Point(3, 0))); + insert_non_intersecting_curve(arr, Segment(Point(2, 2), Point(5, 0))); + insert_non_intersecting_curve(arr, Segment(Point(3, 2), Point(5, 0))); + insert_non_intersecting_curve(arr, Segment(Point(2, 3), Point(3, 3))); + insert_non_intersecting_curve(arr, Segment(Point(0, 3), Point(6, 4))); + insert_non_intersecting_curve(arr, Segment(Point(4, 4), Point(4, 5))); // Perform vertical ray-shooting from every vertex and locate the feature // that lie below it and the feature that lies above it. - Vert_decomp_list vd_list; - - CGAL::decompose (arr, std::back_inserter(vd_list)); + Vert_decomp_list vd_list; + CGAL::decompose(arr, std::back_inserter(vd_list)); // Print the results. - Vert_decomp_list::const_iterator vd_iter; - std::pair curr; - Vertex_const_handle vh; - Halfedge_const_handle hh; - Face_const_handle fh; - - for (vd_iter = vd_list.begin(); vd_iter != vd_list.end(); ++vd_iter) { + std::pair curr; + Vertex_const_handle vh; + Halfedge_const_handle hh; + Face_const_handle fh; + for (auto vd_iter = vd_list.begin(); vd_iter != vd_list.end(); ++vd_iter) { curr = vd_iter->second; std::cout << "Vertex (" << vd_iter->first->point() << ") : "; std::cout << " feature below: "; - if (CGAL::assign (vh, curr.first)) - std::cout << '(' << vh->point() << ')'; + if (CGAL::assign (vh, curr.first)) std::cout << '(' << vh->point() << ')'; else if (CGAL::assign (hh, curr.first)) - if (!hh->is_fictitious()) - std::cout << '[' << hh->curve() << ']'; - else - std::cout << "NONE"; - else - std::cout << "EMPTY"; + if (!hh->is_fictitious()) std::cout << '[' << hh->curve() << ']'; + else std::cout << "NONE"; + else std::cout << "EMPTY"; std::cout << " feature above: "; if (CGAL::assign (vh, curr.second)) - std::cout << '(' << vh->point() << ')' << std::endl; + std::cout << '(' << vh->point() << ')' << std::endl; else if (CGAL::assign (hh, curr.second)) if (!hh->is_fictitious()) std::cout << '[' << hh->curve() << ']' << std::endl; - else - std::cout << "NONE" << std::endl; - else - std::cout << "EMPTY" << std::endl; + else std::cout << "NONE" << std::endl; + else std::cout << "EMPTY" << std::endl; } return 0; 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 a97f918ffee..729f720a404 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 @@ -5,8 +5,7 @@ #include "arr_linear.h" #include "arr_print.h" -int main() -{ +int main() { Arrangement arr; // Insert a line in the (currently single) unbounded face of the arrangement; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp index 2b2ab16df86..9ebc09e97d7 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp @@ -4,8 +4,7 @@ #include "arr_rat_functions.h" #include "arr_print.h" -int main() -{ +int main() { CGAL::set_pretty_mode(std::cout); // for nice printouts. // Define a traits class object and a constructor for rational functions. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp index e64da4a8a64..a0b0912a6d6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp @@ -11,8 +11,7 @@ typedef CGAL::Arr_walk_along_line_point_location Walk_pl; typedef CGAL::Arr_trapezoid_ric_point_location Trap_pl; -int main() -{ +int main() { // Construct the arrangement. Arrangement arr; construct_segments_arr(arr);