#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/Multipolygon_with_holes_2.h>
#ifdef CGAL_USE_BASIC_VIEWER
#include <CGAL/draw_multipolygon_with_holes_2.h>
#endif
#include <CGAL/Polygon_repair/repair.h>
#include <CGAL/IO/WKT.h>
#include <iostream>
#include <sstream>
using Point_2 = K::Point_2;
int
main(int argc, char* argv[])
{
Multipolygon_with_holes_2 pA;
if (argc == 2) {
{
std::ifstream in(argv[1]);
}
} else {
std::istringstream is("MULTIPOLYGON( ((0 0, 20 0, 20 20, 0 20), (1 1, 1 19, 19 19, 19 1) ) , (( 10 -2, 12 -2, 12 22, 10 22)) )");
}
{
std::ofstream out("union.wkt");
#ifdef CGAL_USE_BASIC_VIEWER
#endif
}
{
std::ofstream out("intersection.wkt");
#ifdef CGAL_USE_BASIC_VIEWER
#endif
}
{
Polygon_2 pB;
pB.push_back(Point_2(-1,-1));
pB.push_back(Point_2(1,-1));
pB.push_back(Point_2(1,1));
pB.push_back(Point_2(-1,1));
}
return 0;
}
void draw(const P &p, const GSOptions &gso)
Multipolygon_with_holes_2< Kernel, Container > repair(const Polygon_2< Kernel, Container > &p, Rule=Rule())
repairs polygon p using the given rule
Definition: repair.h:51
Multipolygon_with_holes_2< Kernel, Container > join(const Multipolygon_with_holes_2< Kernel, Container > &pa)
computes the union of all polygons with holes in p
Definition: repair.h:797
std::ostream & write_multi_polygon_WKT(std::ostream &out, MultiPolygon &polygons)
bool read_multi_polygon_WKT(std::istream &in, MultiPolygon &polygons)
Tag class to select the intersection rule when calling CGAL::Polygon_repair::repair().
Definition: Intersection_rule.h:27
Tag class to select the union rule when calling CGAL::Polygon_repair::repair().
Definition: Union_rule.h:27