Open
Graph Drawing
Framework
v. 2023.09 (Elderberry)
Overview
Class Hierarchy
Class Index
Class List
Members
Namespaces
Source Files
Loading...
Searching...
No Matches
PerturbPolygon.h
Go to the documentation of this file.
1
31
#pragma once
32
33
#ifdef OGDF_INCLUDE_CGAL
34
35
# include <
ogdf/geometric/cr_min/geometry/objects/Polygon.h
>
36
37
namespace
ogdf
{
38
namespace
internal {
39
namespace
gcm {
40
namespace
geometry
{
41
45
template
<
typename
Kernel>
46
Polygon_t<Kernel>
peturb
(
const
Polygon_t<Kernel>
& polygon,
double
eps = 1e-5) {
47
using
Segment
=
LineSegment_t<Kernel>
;
48
49
auto
bisector
= [&](
const
Segment
& s1,
const
Segment
& s2) {
50
const
auto
&
v_in
= s1.to_vector();
51
const
auto
&
v_out
= s2.to_vector();
52
auto
bisected
=
bisect
(-
v_in
,
v_out
);
53
if
(geometry::right_turn(
v_in
,
bisected
)) {
54
bisected
= -
bisected
;
55
}
56
57
return
bisected
;
58
};
59
60
Polygon_t<Kernel>
perturbed
;
61
auto
itr
= polygon.edges_circulator();
62
for
(
unsigned
int
i = 0; i < polygon.size(); ++i) {
63
perturbed
.push_back(polygon[i] +
bisector
(*(
itr
- 1), *
itr
) * eps);
64
++
itr
;
65
}
66
return
perturbed
;
67
}
68
69
}
70
}
71
}
72
}
73
74
#endif
Polygon.h
getDoubleFactoredZeroAdjustedMerger
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
Definition
multilevelmixer.cpp:36
ogdf
The namespace for all OGDF objects.
Definition
AugmentationModule.h:36
include
ogdf
geometric
cr_min
geometry
algorithm
PerturbPolygon.h
© 1999–2023
The OGDF Team