#ifndef CGAL_USE_LEDA #include int main(){ std::cout << "This demo needs LEDA" << std::endl; return 0;} #else #include //CGAL definitions that need to be before anything else #include #include #include #include #include #include #include #include // uncomment if LEDA is installed. //#include //used for visualization. //#include typedef CGAL::Quotient NT; typedef CGAL::Cartesian K; typedef K::Point_2 Point_2; typedef CGAL::Polygon_2 Polygon_2; typedef Polygon_2::Segment_2 Segment_2; typedef CGAL::Polygons_bops_traits_2 Bops_traits; using std::cin; using std::cout; using std::endl; void read_polygon(Polygon_2& polygon) { unsigned int n; cin >> n; int x, y; while (n--) { cin >> x >> y; polygon.push_back(Point_2(x,y)); } } int main() { Polygon_2 poly1, poly2; read_polygon(poly1); read_polygon(poly2); cout<<"Polygons are"< polygons; std::list curves; std::list points; CGAL::Polygons_do_intersect_2 poly_do_intersect; if (poly_do_intersect(poly1,poly2)) cout <<"The two input polygons do intersect"<