33#ifdef OGDF_INCLUDE_CGAL
45template<
typename Kernel>
50 using Point = geometry::Point_t<Kernel>;
51 using Segment = geometry::LineSegment_t<Kernel>;
52 using Polygon = geometry::Polygon_t<Kernel>;
56 datastructure::UnionFind&
uf) {
59 auto rep = geometry::find_representative_node(
bd, p);
65 std::vector<typename BD::Node> parent(
bd.number_of_nodes());
66 std::vector<typename BD::Edge>
parent_edge(
bd.number_of_nodes());
68 auto f_weight = [&](
typename BD::Node v,
typename BD::Edge e) {
69 if (
bd.is_face_edge(e) ||
bd.degree(v) == 2) {
71 }
else if (
bd.is_left(v)) {
78 auto expand = [&](
typename BD::Node w,
typename BD::Edge e) {
85 std::vector<typename BD::Node>
queue;
86 std::vector<int> weight(
bd.number_of_nodes(), 0);
93 auto handle_edge = [&](
typename BD::Node v,
typename BD::Edge e) {
94 typename BD::Node w =
bd.edges[e];
97 if (!visited[w] && expand(v, e) && v != w) {
98 weight[w] = weight[v] +
f_weight(v, e);
103 if (
bd.is_face_edge(e)) {
109 while (!
queue.empty()) {
120 for (
auto& w : weight) {
129 const Point& reference,
unsigned int nof_points, std::mt19937_64&
gen) {
130 datastructure::UnionFind
uf(
bd.number_of_nodes());
131 uf.all_to_singletons();
133 std::vector<bool> visited(
bd.number_of_nodes(),
false);
136 std::vector<unsigned int>
repr;
137 for (
unsigned int u = 0; u <
bd.number_of_nodes(); ++u) {
138 if (
uf.find(u) == u && visited[u]) {
147 for (
unsigned int i = 0; i <
repr.size(); ++i) {
167 auto seq = geometry::extract_cell(
bd, v);
168 auto region = geometry::extract_polygon(
bd.segments,
seq);
169 if (CGAL::abs(
region.area()) > 1e-5) {
170 auto p = geometry::random_point_in_polygon(
region,
gen);
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.