#include <CGAL/config.h>
#ifndef CGAL_USE_CORE
#include <iostream>
int main() {
std::cout << "Sorry, this example needs CORE ...\n";
return 0;
}
#else
#include <vector>
#include <CGAL/CORE_algebraic_number_traits.h>
#include <CGAL/Arr_polycurve_traits_2.h>
#include "arr_circular.h"
#include "arr_print.h"
using X_monotone_polycurve = Polycurve_traits::X_monotone_curve_2;
using Polycurve = Polycurve_traits::Curve_2;
int main() {
Polycurve_traits traits;
auto ctr_curve = traits.construct_curve_2_object();
auto ctr_xcurve = traits.construct_x_monotone_curve_2_object();
std::vector<Curve> curves;
std::vector<X_monotone_curve> x_curves;
Rational_point c1(0, 0);
Point s1(Number_type(-1), Number_type(0));
Point t1(Number_type(1), Number_type(0));
curves.push_back(circ_arc1);
Rational_point c2(3, 0);
Point s2(Number_type(1), Number_type(0));
Point t2(Number_type(5), Number_type(0));
curves.push_back(circ_arc2);
Polycurve polycurve_1 = ctr_curve(curves.begin(), curves.end());
curves.clear();
Rational_point c3(-10, 10);
Point s3(Number_type(-10), Number_type(13));
Point t3(Number_type(-7), Number_type(10));
curves.push_back(circ_arc3);
Rational_point c4(-20, 10);
Point s4(Number_type(-7), Number_type(10));
Point t4(Number_type(-20), Number_type(23));
curves.push_back(circ_arc4);
Rational_point c5(-20, 25);
Point s5(Number_type(-20), Number_type(23));
Point t5(Number_type(-20), Number_type(27));
curves.push_back(circ_arc5);
Polycurve polycurve_2 = ctr_curve(curves.begin(), curves.end());
Rational_point circle_center1(Number_type(10), Number_type(10));
Point s6(Number_type(8), Number_type(10));
Point t6(Number_type(12), Number_type(10));
x_curves.push_back(xc1);
Rational_point circle_center2(Number_type(13), Number_type(10));
Point s7(Number_type(12), Number_type(10));
Point t7(Number_type(14), Number_type(10));
x_curves.push_back(xc2);
X_monotone_polycurve x_polycurve_1 =
ctr_xcurve(x_curves.begin(), x_curves.end());
Polycurve_circ_arc_arrangment polycurve_arrangment(&traits);
insert(polycurve_arrangment, polycurve_1);
insert(polycurve_arrangment, polycurve_2);
insert(polycurve_arrangment, x_polycurve_1);
std::cout << "Arrangement Statistics:\n";
print_arrangement(polycurve_arrangment);
return 0;
}
#endif
Note: The SubcurveTraits_2 can comprise of Line_segments, Conic_arcs, Circular_arc,...
Definition: Arr_polycurve_traits_2.h:89
Definition: Arrangement_2.h:57
const CGAL::Orientation CLOCKWISE