29#ifndef CPPSRC_CORE_INCLUDE_COVERAGECONTROL_CGAL_UTILITIES_H_
30#define CPPSRC_CORE_INCLUDE_COVERAGECONTROL_CGAL_UTILITIES_H_
32#include <CGAL/Boolean_set_operations_2.h>
33#include <CGAL/Polygon_2_algorithms.h>
45 return Point2(CGAL::to_double(pt.x()), CGAL::to_double(pt.y()));
57template <
class Arrangement>
59 typename Arrangement::Ccb_halfedge_const_circulator circ,
62 typename Arrangement::Ccb_halfedge_const_circulator curr = circ;
63 typename Arrangement::Halfedge_const_handle he;
64 auto pt = curr->source()->point();
67 pt = he->target()->point();
68 polygon.push_back(pt);
70 }
while (curr != circ);
73template <
class Arrangement>
75 std::list<Polygon_2> &polygon_list) {
77 typename Arrangement::Face_const_iterator fit;
78 for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) {
79 if (fit->is_unbounded()) {
84 if (not polygon.is_counterclockwise_oriented()) {
85 polygon.reverse_orientation();
87 polygon_list.push_back(polygon);
93 if (CGAL::bounded_side_2(poly.begin(), poly.end(), pt,
K()) ==
94 CGAL::ON_UNBOUNDED_SIDE) {
101 int const &map_size) {
105 bbox_poly.push_back(
CGAL_Point2(map_size, map_size));
107 for (
auto it = polygon_list.begin(); it != polygon_list.end();) {
108 if (not CGAL::do_intersect(bbox_poly, *it)) {
109 it = polygon_list.erase(it);
Contains the configuration for the CGAL library.
CGAL::Exact_predicates_exact_constructions_kernel K
CGAL::Polygon_2< K > Polygon_2
Namespace for the CoverageControl library.
void PrunePolygons(std::list< Polygon_2 > &polygon_list, int const &map_size)
void CGAL_CCBTraversal(typename Arrangement::Ccb_halfedge_const_circulator circ, Polygon_2 &polygon)
Point2 CGALtoCC(CGAL_Point2 const pt)
void CGAL_GeneratePolygons(const Arrangement &arr, std::list< Polygon_2 > &polygon_list)
bool IsPointInPoly(CGAL_Point2 const &pt, Polygon_2 const &poly)
void operator<<(const Ray_2 &ray)
std::vector< Ray_2 > rays_
void operator<<(const Line_2 &line)
std::vector< Line_2 > lines_
void operator<<(const Segment_2 &seg)
std::vector< Segment_2 > segments_
Contains typedefs for the library.