| 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 |
1 |
▶ | auto builder = std::unique_ptr<VoronoiDiagramBuilder>(new VoronoiDiagramBuilder()); |
Branch: 3 branches
| Branch | True | False | Total |
| auto builder = std::unique_ptr<VoronoiDiagramBuilder>(new VoronoiDiagramBuilder()); |
1 |
0 |
1 |
| auto builder = std::unique_ptr<VoronoiDiagramBuilder>(new VoronoiDiagramBuilder()); |
1 |
0 |
1 |
| auto builder = std::unique_ptr<VoronoiDiagramBuilder>(new VoronoiDiagramBuilder()); |
0 |
0 |
0 |
|
| 6 |
1 |
▶ | GeometryFactory* factory = xs::in<GeometryFactory*>(geometry_factory); |
Branch: 1 branch
| Branch | True | False | Total |
| GeometryFactory* factory = xs::in<GeometryFactory*>(geometry_factory); |
1 |
0 |
1 |
|
| 7 |
|
| |
| 8 |
1 |
▶ | if (sites.is_array_ref()) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (sites.is_array_ref()) { |
1 |
0 |
1 |
| if (sites.is_array_ref()) { |
1 |
0 |
1 |
|
| 9 |
1 |
▶ | auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*factory, sites, 2)); |
Branch: 2 branches
| Branch | True | False | Total |
| auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*factory, sites, 2)); |
1 |
0 |
1 |
| auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*factory, sites, 2)); |
1 |
0 |
1 |
|
| 10 |
1 |
▶ | builder->setSites(*seq); |
Branch: 1 branch
| Branch | True | False | Total |
| builder->setSites(*seq); |
1 |
0 |
1 |
|
| 11 |
1 |
| } |
| 12 |
|
| else { |
| 13 |
0 |
▶ | auto& g = xs::in<Geometry&>(sites); |
Branch: 1 branch
| Branch | True | False | Total |
| auto& g = xs::in<Geometry&>(sites); |
0 |
0 |
0 |
|
| 14 |
0 |
▶ | builder->setSites(g); |
Branch: 1 branch
| Branch | True | False | Total |
| builder->setSites(g); |
0 |
0 |
0 |
|
| 15 |
|
| } |
| 16 |
|
| |
| 17 |
1 |
▶ | if (tolerance) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (tolerance) { |
1 |
0 |
1 |
|
| 18 |
1 |
▶ | builder->setTolerance(Simple(tolerance)); |
Branch: 3 branches
| Branch | True | False | Total |
| builder->setTolerance(Simple(tolerance)); |
1 |
0 |
1 |
| builder->setTolerance(Simple(tolerance)); |
1 |
0 |
1 |
| builder->setTolerance(Simple(tolerance)); |
1 |
0 |
1 |
|
| 19 |
|
| } |
| 20 |
|
| |
| 21 |
1 |
▶ | if (env) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (env) { |
1 |
0 |
1 |
|
| 22 |
1 |
▶ | auto envelope = xs::in<Envelope*>(env); |
Branch: 1 branch
| Branch | True | False | Total |
| auto envelope = xs::in<Envelope*>(env); |
1 |
0 |
1 |
|
| 23 |
1 |
▶ | builder->setClipEnvelope(envelope); |
Branch: 1 branch
| Branch | True | False | Total |
| builder->setClipEnvelope(envelope); |
1 |
0 |
1 |
|
| 24 |
|
| } |
| 25 |
|
| |
| 26 |
1 |
▶ | Object wrapped = xs::out<VoronoiDiagramBuilder*>(builder.release()); |
Branch: 2 branches
| Branch | True | False | Total |
| Object wrapped = xs::out<VoronoiDiagramBuilder*>(builder.release()); |
1 |
0 |
1 |
| Object wrapped = xs::out<VoronoiDiagramBuilder*>(builder.release()); |
1 |
0 |
1 |
|
| 27 |
1 |
▶ | wrapped.payload_attach(SvRV(geometry_factory), &payload_marker); |
Branch: 1 branch
| Branch | True | False | Total |
| wrapped.payload_attach(SvRV(geometry_factory), &payload_marker); |
1 |
0 |
1 |
|
| 28 |
1 |
▶ | RETVAL = wrapped.ref(); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = wrapped.ref(); |
1 |
0 |
1 |
| RETVAL = wrapped.ref(); |
1 |
0 |
1 |
|
| 29 |
|
| } |
| 30 |
|
| |
| 31 |
|
| Sv VoronoiDiagramBuilder::getDiagramEdges() { |
| 32 |
1 |
▶ | Object me{ST(0)}; |
Branch: 1 branch
| Branch | True | False | Total |
| Object me{ST(0)}; |
1 |
0 |
1 |
|
| 33 |
1 |
| auto payload = me.payload(&payload_marker); |
| 34 |
1 |
▶ | GeometryFactory* factory = xs::in<GeometryFactory*>(payload.obj); |
Branch: 1 branch
| Branch | True | False | Total |
| GeometryFactory* factory = xs::in<GeometryFactory*>(payload.obj); |
1 |
0 |
1 |
|
| 35 |
1 |
▶ | auto edges = THIS->getDiagramEdges(*factory); |
Branch: 1 branch
| Branch | True | False | Total |
| auto edges = THIS->getDiagramEdges(*factory); |
1 |
0 |
1 |
|
| 36 |
1 |
▶ | RETVAL = Helper::uplift(edges.release()); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = Helper::uplift(edges.release()); |
1 |
0 |
1 |
|
| 37 |
|
| } |
| 38 |
|
| |
| 39 |
|
| Sv VoronoiDiagramBuilder::getDiagram() { |
| 40 |
1 |
▶ | Object me{ST(0)}; |
Branch: 1 branch
| Branch | True | False | Total |
| Object me{ST(0)}; |
1 |
0 |
1 |
|
| 41 |
1 |
| auto payload = me.payload(&payload_marker); |
| 42 |
1 |
▶ | GeometryFactory* factory = xs::in<GeometryFactory*>(payload.obj); |
Branch: 1 branch
| Branch | True | False | Total |
| GeometryFactory* factory = xs::in<GeometryFactory*>(payload.obj); |
1 |
0 |
1 |
|
| 43 |
1 |
▶ | auto edges = THIS->getDiagram(*factory); |
Branch: 1 branch
| Branch | True | False | Total |
| auto edges = THIS->getDiagram(*factory); |
1 |
0 |
1 |
|
| 44 |
1 |
▶ | RETVAL = Helper::uplift(edges.release()); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = Helper::uplift(edges.release()); |
1 |
0 |
1 |
| RETVAL = Helper::uplift(edges.release()); |
1 |
0 |
1 |
|
| 45 |
|
| } |
| 46 |
|
| |