3 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 4 #include <CGAL/Polygon_2.h> 5 #include <CGAL/Polygon_with_holes_2.h> 6 #include <CGAL/Boolean_set_operations_2.h> 13 typedef CGAL::Exact_predicates_exact_constructions_kernel
EK;
20 int main(
int argc,
char* argv[])
36 cerr<<
"diff between polygons...";
55 if (process_num == -1)
59 srand((
unsigned)time(NULL));
60 vector<EPoint_2> temp;
61 for (
int i = 0; i < eDomain.outer_boundary().size(); i++)
62 temp.push_back(
EPoint_2(eDomain.outer_boundary()[i].x() + (double)rand() / RAND_MAX / 10, eDomain.outer_boundary()[i].y() + (double)rand() / RAND_MAX / 10));
63 eDomain.outer_boundary() =
EPolygon_2(temp.begin(), temp.end());
67 srand((
unsigned)time(NULL));
68 vector<EPoint_2> temp;
69 for (
int i = 0; i < eHole.size(); i++)
70 temp.push_back(
EPoint_2(eHole[i].x() + (
double)rand() / RAND_MAX / 10, eHole[i].y() + (
double)rand() / RAND_MAX / 10));
76 CGAL::difference(eDomain, eHole, back_inserter(eList));
78 if (eList.size() == 0)
88 if (eList.size() != 1)
90 auto j = eList.begin();
91 CGAL::Lazy_exact_nt<CGAL::Quotient<CGAL::Gmpq> > max_area = 0;
92 for (
auto i = eList.begin(); i != eList.end(); i++)
94 if ((i->outer_boundary().area())*(i->outer_boundary().area()) > max_area*max_area)
96 max_area = i->outer_boundary().area();
116 cerr <<
"done." << endl;
std::list< EPolygon_with_holes_2 > EPwh_list_2
CGAL::Exact_predicates_exact_constructions_kernel EK
CGAL::Polygon_2< EK > EPolygon_2
int main(int argc, char *argv[])
const std::string domainFilePath
const std::string communicateFile
CGAL::Polygon_with_holes_2< EK > EPolygon_with_holes_2
const std::string holeFilePath
const std::string resultFilePath