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 new file mode 100644 index 00000000000..dcd4a5bf54e --- /dev/null +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp @@ -0,0 +1,40 @@ +//! \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; + +int main () +{ + // Construct the arrangement of five intersecting segments. + Geom_traits_2 traits; + traits.disable_all_traces(); + traits.enable_trace(Tracing_traits_2::INTERSECT_OP); + Arrangement_2 arr(&traits);; + std::list segments; + + segments.push_back (Segment_2 (Point_2(1, 0), Point_2(2, 4))); + segments.push_back (Segment_2 (Point_2(5, 0), Point_2(5, 5))); + segments.push_back (Segment_2 (Point_2(1, 0), Point_2(5, 3))); + segments.push_back (Segment_2 (Point_2(0, 2), Point_2(6, 0))); + segments.push_back (Segment_2 (Point_2(3, 0), Point_2(5, 5))); + + insert (arr, segments.begin(), segments.end()); + std::cout << traits << std::endl; + + return 0; +}