xsi/noding.xsi

filter: Statementstmt 98.0% 50 / 51 Branchbran 56.4% 87 / 154 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 66.8% 137 / 205 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xsi/Triangle.xsi ↑ Summary xsi/GeometryFactory.xsi »
1 MODULE = Geo::Geos PACKAGE = Geo::Geos::Noding
2 PROTOTYPES: DISABLE
3  
4 int compareOrientedCoordinateArray(Array pts1, Array pts2) {
5 1 ▶ auto seq1 = Helper::convert_coords(pts1);
Branch: 2 branches
BranchTrueFalseTotal
auto seq1 = Helper::convert_coords(pts1); 1 0 1
auto seq1 = Helper::convert_coords(pts1); 1 0 1
6 1 ▶ auto seq2 = Helper::convert_coords(pts2);
Branch: 2 branches
BranchTrueFalseTotal
auto seq2 = Helper::convert_coords(pts2); 1 0 1
auto seq2 = Helper::convert_coords(pts2); 1 0 1
7 1 ▶ geos::noding::OrientedCoordinateArray oca{seq1};
Branch: 1 branch
BranchTrueFalseTotal
geos::noding::OrientedCoordinateArray oca{seq1}; 1 0 1
8 1 ▶ RETVAL = oca.compareTo(seq2);
Branch: 3 branches
BranchTrueFalseTotal
RETVAL = oca.compareTo(seq2); 1 0 1
RETVAL = oca.compareTo(seq2); 1 0 1
RETVAL = oca.compareTo(seq2); 0 1 1
9 }
10  
11 int octant(Sv arg1, SV* arg2) {
12 2 ▶ if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") {
Branch: 11 branches
BranchTrueFalseTotal
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 1 2
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 0 1
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 0 1
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 0 1
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 0 1
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 0 1
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 1 2
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 1 2
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 1 1 2
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 0 0 0
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { 0 0 0
13 1 ▶ auto& c1 = xs::in<Coordinate&>(arg1);
Branch: 1 branch
BranchTrueFalseTotal
auto& c1 = xs::in<Coordinate&>(arg1); 1 0 1
14 1 ▶ auto& c2 = xs::in<Coordinate&>(arg2);
Branch: 1 branch
BranchTrueFalseTotal
auto& c2 = xs::in<Coordinate&>(arg2); 1 0 1
15 1 ▶ RETVAL = Octant::octant(&c1, &c2);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = Octant::octant(&c1, &c2); 1 0 1
16 } else {
17 1 ▶ if(!arg1) throw("undef not allowed");
Branch: 1 branch
BranchTrueFalseTotal
if(!arg1) throw("undef not allowed"); 0 1 1
18 1 ▶ if(!arg2) throw("undef not allowed");
Branch: 1 branch
BranchTrueFalseTotal
if(!arg2) throw("undef not allowed"); 0 1 1
19 1 ▶ double dx = SvNV(arg1);
Branch: 1 branch
BranchTrueFalseTotal
double dx = SvNV(arg1); 1 0 1
20 1 ▶ double dy = SvNV(arg2);
Branch: 1 branch
BranchTrueFalseTotal
double dy = SvNV(arg2); 1 0 1
21 1 ▶ RETVAL = Octant::octant(dx, dy);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = Octant::octant(dx, dy); 1 0 1
22 }
23 }
24  
25 void checkNodingValid(Array segmentStrigns) {
26 1 std::vector<SegmentString*> v;
27 1 ▶ v.reserve(segmentStrigns.size());
Branch: 2 branches
BranchTrueFalseTotal
v.reserve(segmentStrigns.size()); 1 0 1
v.reserve(segmentStrigns.size()); 1 0 1
28  
29 3 ▶ for (auto it: segmentStrigns) {
Branch: 4 branches
BranchTrueFalseTotal
for (auto it: segmentStrigns) { 1 0 1
for (auto it: segmentStrigns) { 1 0 1
for (auto it: segmentStrigns) { 2 0 2
for (auto it: segmentStrigns) { 2 1 3
30 2 ▶ SegmentString& ss = xs::in<SegmentString&>(it);
Branch: 1 branch
BranchTrueFalseTotal
SegmentString& ss = xs::in<SegmentString&>(it); 2 0 2
31 2 ▶ v.push_back(&ss);
Branch: 1 branch
BranchTrueFalseTotal
v.push_back(&ss); 2 0 2
32 2 }
33 1 ▶ NodingValidator nv(v);
Branch: 1 branch
BranchTrueFalseTotal
NodingValidator nv(v); 1 0 1
34 1 ▶ nv.checkValid();
Branch: 1 branch
BranchTrueFalseTotal
nv.checkValid(); 0 1 1
35 }
36  
37 std::string fastCheckNodingValid(Array segmentStrigns) {
38 3 std::vector<SegmentString*> v;
39 3 ▶ v.reserve(segmentStrigns.size());
Branch: 2 branches
BranchTrueFalseTotal
v.reserve(segmentStrigns.size()); 3 0 3
v.reserve(segmentStrigns.size()); 3 0 3
40  
41 8 ▶ for (auto it: segmentStrigns) {
Branch: 4 branches
BranchTrueFalseTotal
for (auto it: segmentStrigns) { 3 0 3
for (auto it: segmentStrigns) { 3 0 3
for (auto it: segmentStrigns) { 5 0 5
for (auto it: segmentStrigns) { 5 3 8
42 5 ▶ SegmentString& ss = xs::in<SegmentString&>(it);
Branch: 1 branch
BranchTrueFalseTotal
SegmentString& ss = xs::in<SegmentString&>(it); 5 0 5
43 5 ▶ v.push_back(&ss);
Branch: 1 branch
BranchTrueFalseTotal
v.push_back(&ss); 5 0 5
44 5 }
45 3 ▶ FastNodingValidator fnv{v};
Branch: 1 branch
BranchTrueFalseTotal
FastNodingValidator fnv{v}; 3 0 3
46  
47 3 ▶ if (GIMME_V == G_VOID) {
Branch: 1 branch
BranchTrueFalseTotal
if (GIMME_V == G_VOID) { 1 2 3
48 1 ▶ fnv.checkValid();
Branch: 1 branch
BranchTrueFalseTotal
fnv.checkValid(); 0 1 1
49 0 XSRETURN_UNDEF;
50 }
51 else {
52 2 ▶ if (fnv.isValid()) XSRETURN_UNDEF;
Branch: 2 branches
BranchTrueFalseTotal
if (fnv.isValid()) XSRETURN_UNDEF; 2 0 2
if (fnv.isValid()) XSRETURN_UNDEF; 1 1 2
53 1 ▶ else RETVAL = fnv.getErrorMessage();
Branch: 1 branch
BranchTrueFalseTotal
else RETVAL = fnv.getErrorMessage(); 1 0 1
54 }
55 }
56  
57 int compareSegmentPoints(int octant, Coordinate& p1, Coordinate& p2) {
58 1 ▶ RETVAL = SegmentPointComparator::compare(octant, p1, p2);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = SegmentPointComparator::compare(octant, p1, p2); 0 1 1
59 }
60  
61 Array extractSegmentStrings(Geometry& g) {
62 1 SegmentString::ConstVect v;
63 1 ▶ geos::noding::SegmentStringUtil::extractSegmentStrings(&g, v);
Branch: 1 branch
BranchTrueFalseTotal
geos::noding::SegmentStringUtil::extractSegmentStrings(&g, v); 1 0 1
64  
65 1 ▶ Array result = xs::Array::create(v.size());
Branch: 1 branch
BranchTrueFalseTotal
Array result = xs::Array::create(v.size()); 1 0 1
66 2 ▶ for(auto ss: v) {
Branch: 1 branch
BranchTrueFalseTotal
for(auto ss: v) { 1 1 2
67 1 ▶ auto it = xs::out<SegmentString*>(const_cast<SegmentString*>(ss));
Branch: 1 branch
BranchTrueFalseTotal
auto it = xs::out<SegmentString*>(const_cast<SegmentString*>(ss)); 1 0 1
68 1 ▶ result.push(it);
Branch: 1 branch
BranchTrueFalseTotal
result.push(it); 1 0 1
69 1 };
70 1 ▶ RETVAL = result;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = result; 1 0 1
71 }
72  
73 bool intersects(Array baseSegmentStrings, Array segmentStrings, SV* intDetector = NULL) {
74 2 SegmentString::ConstVect vb;
75 4 ▶ for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it));
Branch: 6 branches
BranchTrueFalseTotal
for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: baseSegmentStrings) vb.push_back(&xs::in<SegmentString&>(it)); 2 2 4
76  
77 2 SegmentString::ConstVect v;
78 4 ▶ for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it));
Branch: 6 branches
BranchTrueFalseTotal
for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it)); 2 0 2
for(auto it: segmentStrings) v.push_back(&xs::in<SegmentString&>(it)); 2 2 4
79  
80 2 ▶ FastSegmentSetIntersectionFinder finder{&vb};
Branch: 1 branch
BranchTrueFalseTotal
FastSegmentSetIntersectionFinder finder{&vb}; 2 0 2
81 2 ▶ if (!intDetector) RETVAL = finder.intersects(&v);
Branch: 2 branches
BranchTrueFalseTotal
if (!intDetector) RETVAL = finder.intersects(&v); 1 1 2
if (!intDetector) RETVAL = finder.intersects(&v); 1 0 1
82 else {
83 1 ▶ auto& id = xs::in<SegmentIntersectionDetector&>(intDetector);
Branch: 1 branch
BranchTrueFalseTotal
auto& id = xs::in<SegmentIntersectionDetector&>(intDetector); 1 0 1
84 1 ▶ RETVAL = finder.intersects(&v, &id);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = finder.intersects(&v, &id); 1 0 1
85 }
86 }
87  
88 BOOT {
89 46 ▶ xs::exp::autoexport(Stash(__PACKAGE__));
Branch: 2 branches
BranchTrueFalseTotal
xs::exp::autoexport(Stash(__PACKAGE__)); 46 0 46
xs::exp::autoexport(Stash(__PACKAGE__)); 46 0 46
90 }
« xsi/Triangle.xsi ↑ Summary xsi/GeometryFactory.xsi »