33 #ifdef OGDF_INCLUDE_CGAL
45 template<
typename Kernel,
typename Graph>
46 class CrossingMinimalPosition {
48 using Point = geometry::Point_t<Kernel>;
49 using Segment = geometry::LineSegment_t<Kernel>;
50 using Polygon = geometry::Polygon_t<Kernel>;
51 using Drawing = graph::GeometricDrawing<Kernel, Graph>;
52 using Node =
typename Graph::Node;
53 using Edge =
typename Graph::Edge;
56 static Point compute(
const Drawing& d,
const Node& v,
const std::vector<Edge>& sample,
57 geometry::Rectangle_t<Kernel>& rect_box) {
58 unsigned int dump_a, dump_b;
59 auto region = CrossingMinimalRegion<Kernel, Graph>::compute(d, v, sample, rect_box, dump_a,
61 if (geometry::is_clockwise(region)) {
65 Point p = d.get_point(v);
66 if (region.size() > 2) {
67 if (!region.is_convex()) {
68 p = geometry::largest_circle_in_polygon(region, 1e-5);
70 p = geometry::centroid(region);
76 p =
Point(CGAL::to_double(p.x()), CGAL::to_double(p.y()));