#include #include #include #include #include #include #include #include #include typedef CGAL::Quotient NT; typedef CGAL::Cartesian Linear_k; typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k; typedef CGAL::Circular_kernel_2 Circular_k; typedef Circular_k::Point_2 Point_2; typedef Circular_k::Circle_2 Circle_2; typedef Circular_k::Circular_arc_2 Circular_arc_2; typedef Circular_k::Line_arc_2 Line_arc_2; typedef boost::variant< Circular_arc_2, Line_arc_2> Arc_2; typedef std::vector< Arc_2> ArcContainer; typedef CGAL::Arr_circular_line_arc_traits Traits; typedef CGAL::Arrangement_2 Arr; typedef CGAL::Arr_naive_point_location Point_location; int main(){ CGAL::Random generatorOfgenerator; int random_seed = generatorOfgenerator.get_int(0, 123456); std::cout << "random_seed = " << random_seed << std::endl; CGAL::Random theRandom(random_seed); int random_max = 128; int random_min = -128; ArcContainer ac; int x1, y1, x2, y2; for (int i = 0; i < 10; i++) { x1 = theRandom.get_int(random_min,random_max); y1 = theRandom.get_int(random_min,random_max); do{ x2 = theRandom.get_int(random_min,random_max); y2 = theRandom.get_int(random_min,random_max); } while((x1 == x2) && (y1 == y2)); std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl; boost::variant< Circular_arc_2, Line_arc_2 > v = Line_arc_2(Point_2(x1,y1), Point_2(x2,y2)); ac.push_back( v); } for (int i = 0; i < 10; i++) { x1 = theRandom.get_int(random_min,random_max); y1 = theRandom.get_int(random_min,random_max); boost::variant< Circular_arc_2, Line_arc_2 > v = Circle_2( Point_2(x1,y1), x1*x1 + y1*y1); ac.push_back(v); } Arr arr; Point_location _pl(arr); for (ArcContainer::const_iterator it=ac.begin(); it != ac.end(); ++it) { insert_curve(arr, *it, _pl); }; return 0; };