File Coverage

xsi/triangulate/DelaunayTriangulationBuilder.xsi
Criterion Covered Total %
statement 22 22 100.0
branch 35 66 53.0
condition n/a
subroutine n/a
pod n/a
total 57 88 64.7


line stmt bran cond sub pod time code
1             MODULE = Geo::Geos PACKAGE = Geo::Geos::Triangulate::DelaunayTriangulationBuilder
2             PROTOTYPES: DISABLE
3              
4             Sv new(SV*, SV* geometry_factory, Sv sites, SV* tolerance = NULL) {
5 4 50         auto builder = std::unique_ptr(new DelaunayTriangulationBuilder());
    50          
    50          
6 2 50         GeometryFactory* factory = xs::in(geometry_factory);
7              
8 2 100         if (sites.is_array_ref()) {
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 1 50         auto& g = xs::in(sites);
14 1 50         builder->setSites(g);
15             }
16              
17 2 100         if (tolerance) {
18 1 50         builder->setTolerance(Simple(tolerance));
    50          
19             }
20              
21 4 50         Object wrapped = xs::out(builder.release());
    50          
    50          
22 2 50         wrapped.payload_attach(SvRV(geometry_factory), &payload_marker);
23 2 50         RETVAL = wrapped.ref();
    50          
24             }
25              
26             Sv DelaunayTriangulationBuilder::getEdges() {
27 4 50         Object me{ST(0)};
    50          
28 2           auto payload = me.payload(&payload_marker);
29 2 50         GeometryFactory* factory = xs::in(payload.obj);
30 4 50         auto edges = THIS->getEdges(*factory);
    50          
31 2 50         RETVAL = Helper::uplift(edges.release());
    50          
32             }
33              
34             Sv DelaunayTriangulationBuilder::getTriangles() {
35 4 50         Object me{ST(0)};
    50          
36 2           auto payload = me.payload(&payload_marker);
37 2 50         GeometryFactory* factory = xs::in(payload.obj);
38 4 50         auto edges = THIS->getTriangles(*factory);
    50          
39 2 50         RETVAL = Helper::uplift(edges.release());
    50          
40             }
41