#include <CGAL/config.h>
#ifndef CGAL_USE_CORE
#include <iostream>
int main ()
{
std::cout << "Sorry, this example needs CORE ..." << std::endl;
return (0);
}
#else
#include <CGAL/Cartesian.h>
#include <CGAL/CORE_algebraic_number_traits.h>
#include <CGAL/Arr_conic_traits_2.h>
#include <CGAL/General_polygon_2.h>
#include <CGAL/Gps_traits_2.h>
#include <CGAL/Boolean_set_operations_2.h>
#include <list>
typedef CGAL::CORE_algebraic_number_traits Nt_traits;
typedef Nt_traits::Rational Rational;
typedef Nt_traits::Algebraic Algebraic;
Conic_traits_2;
typedef Traits_2::General_polygon_with_holes_2 Polygon_with_holes_2;
typedef Traits_2::Curve_2 Curve_2;
typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2;
typedef Traits_2::Point_2 Point_2;
void append_conic_arc(Polygon_2& polygon, const Curve_2& arc) {
Conic_traits_2 traits;
std::list<CGAL::Object> objects;
X_monotone_curve_2 xarc;
traits.make_x_monotone_2_object() (arc, std::back_inserter(objects));
for (auto it = objects.begin(); it != objects.end(); ++it) {
if (CGAL::assign (xarc, *it))
polygon.push_back (xarc);
}
}
int main() {
Conic_traits_2 traits;
auto ctr_cv = traits.construct_curve_2_object();
Point_2(2, 0), Point_2(-2, 0));
Point_2(-2, 0), Point_2(2, 0));
Polygon_2 P;
append_conic_arc(P, parabola1);
append_conic_arc(P, parabola2);
Polygon_2 Q;
append_conic_arc(Q, ctr_cv(-1, -9, 0, 0, 0, 9));
std::list<Polygon_with_holes_2> res;
std::copy(res.begin(), res.end(),
std::ostream_iterator<Polygon_with_holes_2>(std::cout, "\n"));
std::cout << std::endl;
return 0;
}
#endif
The class General_polygon_2 models the concept GeneralPolygon_2.
Definition: General_polygon_2.h:27
The traits class Gps_traits_2 models the concept GeneralPolygonSetTraits_2.
Definition: Gps_traits_2.h:20
decltype(auto) intersection(Type1< Kernel > obj1, Type2< Kernel > obj2)
const CGAL::Orientation COUNTERCLOCKWISE