#include <CGAL/basic.h>
#include <iostream>
#if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI))
int main ()
{
std::cout << "Sorry, this example needs CORE, LEDA, or GMP+MPFI ..."
<< std::endl;
return 0;
}
#else
#include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_algebraic_segment_traits_2.h>
#if CGAL_USE_GMP && CGAL_USE_MPFI
#elif CGAL_USE_CORE
#else
typedef LEDA::integer Integer;
#endif
typedef Arr_traits_2::Curve_2 Curve_2;
typedef Arr_traits_2::Polynomial_2 Polynomial_2;
int main() {
Arr_traits_2 arr_traits;
Arr_traits_2::Construct_curve_2 construct_curve
= arr_traits.construct_curve_2_object();
Arrangement_2 arr(&arr_traits);
Polynomial_2 f1 = 3*x-5*y+2;
Curve_2 cv1 = construct_curve(f1);
std::cout << "Adding curve " << f1 << " to the arrangement" << std::endl;
Polynomial_2 f2 = CGAL::ipower(x,2)+3*CGAL::ipower(y,2)-10;
Curve_2 cv2 = construct_curve(f2);
std::cout << "Adding curve " << f2 << " to the arrangement" << std::endl;
Polynomial_2 f3 = CGAL::ipower(x,2)+CGAL::ipower(y,2)+x*CGAL::ipower(y,2);
Curve_2 cv3 = construct_curve(f3);
std::cout << "Adding curve " << f3 << " to the arrangement" << std::endl;
Polynomial_2 f4 = CGAL::ipower(x,6)+CGAL::ipower(y,6)-
CGAL::ipower(x,3)*CGAL::ipower(y,3)-12;
Curve_2 cv4 = construct_curve(f4);
std::cout << "Adding curve " << f4 << " to the arrangement" << std::endl;
std::cout << "The arrangement size:" << std::endl
<< " V = " << arr.number_of_vertices()
<< ", E = " << arr.number_of_edges()
<< ", F = " << arr.number_of_faces() << std::endl;
return 0;
}
#endif