Branch Coverage

xsi/LineSegment.xsi
Criterion Covered Total %
branch 109 208 52.4


line true false branch
6 1 16 else if (!arg3) {
1 0 else if (!arg3) {
1 0 else if (!arg3) {
7 15 1 auto& c1 = xs::in(arg1);
8 15 0 auto& c2 = xs::in(arg2);
9 15 0 RETVAL = new LineSegment(c1, c2);
10 15 0 }
15 0 }
13 0 1 if(!arg3) throw("undef not allowed");
14 0 1 if(!arg4) throw("undef not allowed");
15 0 1 double x0 = SvNV(arg1);
16 0 1 double y0 = SvNV(arg2);
1 0 double y0 = SvNV(arg2);
17 0 1 double x1 = SvNV(arg3);
1 0 double x1 = SvNV(arg3);
18 0 1 double y1 = SvNV(arg4);
1 0 double y1 = SvNV(arg4);
19 0 1 RETVAL = new LineSegment(x0, y0, x1, y1);
1 0 RETVAL = new LineSegment(x0, y0, x1, y1);
20 1 0 }
1 0 }
23 1 0 double LineSegment::getLength()
25 1 0 bool LineSegment::isHorizontal()
27 1 0 bool LineSegment::isVertical()
30 1 1 if (!arg2) {
42 2 0 if (arg.stash().name() == "Geo::Geos::Coordinate") {
2 0 if (arg.stash().name() == "Geo::Geos::Coordinate") {
1 1 if (arg.stash().name() == "Geo::Geos::Coordinate") {
43 1 0 auto c = xs::in(arg);
44 1 0 RETVAL = THIS->orientationIndex(*c);
47 1 0 auto& ls = xs::in(arg);
48 1 0 RETVAL = THIS->orientationIndex(ls);
56 1 0 double LineSegment::angle ()
60 1 0 THIS->midPoint(c);
61 1 0 RETVAL = new Coordinate(c);
62 1 0 }
65 2 0 if (arg.stash().name() == "Geo::Geos::Coordinate") {
2 0 if (arg.stash().name() == "Geo::Geos::Coordinate") {
1 1 if (arg.stash().name() == "Geo::Geos::Coordinate") {
66 1 0 auto c = xs::in(arg);
67 1 0 RETVAL = THIS->distance(*c);
70 1 0 auto& ls = xs::in(arg);
71 1 0 RETVAL = THIS->distance(ls);
75 1 0 double LineSegment::distancePerpendicular(Coordinate& p)
79 1 0 THIS->pointAlong(segmentLengthFraction, c);
80 1 0 RETVAL = new Coordinate(c);
81 1 0 }
85 1 0 THIS->pointAlongOffset(segmentLengthFraction, offsetDistance, c);
86 1 0 RETVAL = new Coordinate(c);
87 1 0 }
89 1 0 double LineSegment::projectionFactor(Coordinate& p)
91 1 0 double LineSegment::segmentFraction (Coordinate& p)
94 4 0 if (arg.stash().name() == "Geo::Geos::Coordinate") {
4 0 if (arg.stash().name() == "Geo::Geos::Coordinate") {
2 2 if (arg.stash().name() == "Geo::Geos::Coordinate") {
95 2 0 auto& c = xs::in(arg);
96 2 0 Coordinate c_out;
97 2 0 THIS->project(c, c_out);
98 2 0 auto wrapped = xs::out<>(new Coordinate(c_out));
2 0 auto wrapped = xs::out<>(new Coordinate(c_out));
99 0 2 mXPUSHs(wrapped.detach());
0 0 mXPUSHs(wrapped.detach());
2 0 mXPUSHs(wrapped.detach());
102 2 0 auto& ls = xs::in(arg);
103 2 0 LineSegment ls_out;
104 2 0 bool overlap = THIS->project(ls, ls_out);
105 2 0 auto wrapped = xs::out<>(new LineSegment(ls_out));
2 0 auto wrapped = xs::out<>(new LineSegment(ls_out));
2 0 auto wrapped = xs::out<>(new LineSegment(ls_out));
106 0 2 mXPUSHs(wrapped.detach());
0 0 mXPUSHs(wrapped.detach());
2 0 mXPUSHs(wrapped.detach());
107 2 0 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
0 0 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
1 1 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
0 1 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
0 0 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
1 0 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
1 0 if (GIMME_V == G_ARRAY) mXPUSHi(overlap);
113 1 0 THIS->closestPoint(p, c);
114 1 0 RETVAL = new Coordinate(c);
115 1 0 }
117 1 0 int LineSegment::compareTo(LineSegment& other)
119 1 0 bool LineSegment::equalsTopo(LineSegment& other)
122 1 0 auto seq = std::unique_ptr(THIS->closestPoints(line));
1 0 auto seq = std::unique_ptr(THIS->closestPoints(line));
123 1 0 RETVAL = Helper::convert_copy(seq.get());
128 2 0 if(THIS->intersection(line, c)) RETVAL = new Coordinate(c);
129 2 0 else XSRETURN_UNDEF;
1 1 else XSRETURN_UNDEF;
1 0 else XSRETURN_UNDEF;
134 2 0 if(THIS->lineIntersection(line, c)) RETVAL = new Coordinate(c);
135 2 0 else XSRETURN_UNDEF;
1 1 else XSRETURN_UNDEF;
1 0 else XSRETURN_UNDEF;
140 1 0 RETVAL = ptr.release();
144 14 0 std::ostringstream out;
145 14 0 out << *THIS;
146 14 0 RETVAL = out.str();
14 0 RETVAL = out.str();
152 4 4 case 0: val = &THIS->p0; break;
156 0 8 auto& c = xs::in(newval);
157 0 0 *val = c;
160 8 0 }