33#ifdef OGDF_INCLUDE_CGAL
41# include <boost/graph/breadth_first_search.hpp>
42# include <boost/graph/visitors.hpp>
45# include <CGAL/Arr_extended_dcel.h>
46# include <CGAL/Arr_face_index_map.h>
47# include <CGAL/Arr_linear_traits_2.h>
48# include <CGAL/Arr_segment_traits_2.h>
49# include <CGAL/Arr_walk_along_line_point_location.h>
50# include <CGAL/Arrangement_2.h>
51# include <CGAL/Arrangement_with_history_2.h>
52# include <CGAL/graph_traits_dual_arrangement_2.h>
61template<
typename kernel>
64 using LineSegment = geometry::LineSegment_t<kernel>;
65 using Point = geometry::Point_t<kernel>;
66 using Polygon = geometry::Polygon_t<kernel>;
67 using Line = geometry::Line_t<kernel>;
68 using Ray = geometry::Ray_t<kernel>;
69 using Direction = geometry::Direction_t<kernel>;
70 using Traits = CGAL::Arr_segment_traits_2<kernel>;
74 using Dcel = CGAL::Arr_extended_dcel<Traits, unsigned int, unsigned int, unsigned int>;
75 using ArrWH = CGAL::Arrangement_with_history_2<Traits, Dcel>;
77 using Arr = CGAL::Arrangement_2<Traits>;
78 using LinearArr = CGAL::Arrangement_2<LinearTraits>;
80 using DualArr = CGAL::Dual<Arr>;
83 template<
typename _Arr>
85 auto obj =
pl.locate(
q);
96 if ((
f = boost::get<Face_const_handle>(&obj))) {
98 auto c = (*f)->outer_ccb();
100 poly.push_back(c->source()->point());
101 }
while (++c != (*f)->outer_ccb());
102 }
else if ((e = boost::get<Halfedge_const_handle>(&obj))) {
104 poly.push_back((*e)->source()->point());
105 poly.push_back((*e)->target()->point());
106 }
else if ((v = boost::get<Vertex_const_handle>(&obj))) {
107 poly.push_back((*v)->point());
117 using LCGEdge = std::tuple<unsigned int, unsigned int, unsigned int>;
121 CGAL::Arr_walk_along_line_point_location<LinearArr>
pl(
arr);
128 CGAL::Arr_walk_along_line_point_location<Arr>
pl(
arr);
140 void process(std::vector<LineSegment>&
segments, std::vector<Line>&
lines,
151 unsigned int node = 1;
153 v_it->set_data(node++);
160 LineSegment t(e->source()->point(), e->target()->point());
162 if (
t.direction() == ref) {
163 return LCGEdge(e->source()->data() - 1, e->target()->data() - 1,
flag);
165 return LCGEdge(e->target()->data() - 1, e->source()->data() - 1,
flag);
168 auto itr =
arr.curves_begin();
169 for (
unsigned int i = 0; i <
segments.size(); ++i, ++
itr) {
177 for (
unsigned int i = 0; i <
lines.size(); ++i, ++
itr) {
182 if (e->source()->data() > 0 && e->target()->data() > 0) {
183 edge_list.push_back(
LCGEdge(e->source()->data() - 1, e->target()->data() - 1, i));
NodeElement * node
The type of nodes.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.