line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODULE = Geo::Geos PACKAGE = Geo::Geos::Triangulate::VoronoiDiagramBuilder |
2
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
Sv new(SV*, SV* geometry_factory, Sv sites, SV* tolerance = NULL, SV* env = NULL) { |
5
|
2
|
50
|
|
|
|
|
auto builder = std::unique_ptr(new VoronoiDiagramBuilder()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
6
|
1
|
50
|
|
|
|
|
GeometryFactory* factory = xs::in(geometry_factory); |
7
|
|
|
|
|
|
|
|
8
|
1
|
50
|
|
|
|
|
if (sites.is_array_ref()) { |
|
|
50
|
|
|
|
|
|
9
|
2
|
50
|
|
|
|
|
auto seq = std::unique_ptr(Helper::convert_copy(*factory, sites, 2)); |
|
|
50
|
|
|
|
|
|
10
|
1
|
50
|
|
|
|
|
builder->setSites(*seq); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
else { |
13
|
0
|
0
|
|
|
|
|
auto& g = xs::in(sites); |
14
|
0
|
0
|
|
|
|
|
builder->setSites(g); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
1
|
50
|
|
|
|
|
if (tolerance) { |
18
|
1
|
50
|
|
|
|
|
builder->setTolerance(Simple(tolerance)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
1
|
50
|
|
|
|
|
if (env) { |
22
|
1
|
50
|
|
|
|
|
auto envelope = xs::in(env); |
23
|
1
|
50
|
|
|
|
|
builder->setClipEnvelope(envelope); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
2
|
50
|
|
|
|
|
Object wrapped = xs::out(builder.release()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
27
|
1
|
50
|
|
|
|
|
wrapped.payload_attach(SvRV(geometry_factory), &payload_marker); |
28
|
1
|
50
|
|
|
|
|
RETVAL = wrapped.ref(); |
|
|
50
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Sv VoronoiDiagramBuilder::getDiagramEdges() { |
32
|
2
|
50
|
|
|
|
|
Object me{ST(0)}; |
|
|
50
|
|
|
|
|
|
33
|
1
|
|
|
|
|
|
auto payload = me.payload(&payload_marker); |
34
|
1
|
50
|
|
|
|
|
GeometryFactory* factory = xs::in(payload.obj); |
35
|
2
|
50
|
|
|
|
|
auto edges = THIS->getDiagramEdges(*factory); |
|
|
50
|
|
|
|
|
|
36
|
1
|
50
|
|
|
|
|
RETVAL = Helper::uplift(edges.release()); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Sv VoronoiDiagramBuilder::getDiagram() { |
40
|
2
|
50
|
|
|
|
|
Object me{ST(0)}; |
|
|
50
|
|
|
|
|
|
41
|
1
|
|
|
|
|
|
auto payload = me.payload(&payload_marker); |
42
|
1
|
50
|
|
|
|
|
GeometryFactory* factory = xs::in(payload.obj); |
43
|
2
|
50
|
|
|
|
|
auto edges = THIS->getDiagram(*factory); |
|
|
50
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
|
RETVAL = Helper::uplift(edges.release()); |
|
|
50
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|