xsi/Envelope.xsi

filter: Statementstmt 97.1% 101 / 104 Branchbran 53.7% 171 / 318 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 64.4% 272 / 422 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xsi/algorithm/LineIntersector.xsi ↑ Summary xsi/operation.xsi »
1 MODULE = Geo::Geos PACKAGE = Geo::Geos::Envelope
2 PROTOTYPES: DISABLE
3  
4 Envelope* new(SV*, Sv arg1 = Sv(), SV* arg2 = NULL, SV* arg3 = NULL, SV* arg4 = NULL) {
5 42 if (items == 1) RETVAL = new Envelope();
6 42 ▶ else if (items == 2) {
Branch: 4 branches
BranchTrueFalseTotal
else if (items == 2) { 1 41 42
else if (items == 2) { 1 0 1
else if (items == 2) { 1 0 1
else if (items == 2) { 0 0 0
7 41 ▶ if (!arg1.is_simple()) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arg1.is_simple()) { 2 39 41
8 2 ▶ auto& c = xs::in<Coordinate&>(arg1);
Branch: 1 branch
BranchTrueFalseTotal
auto& c = xs::in<Coordinate&>(arg1); 1 1 2
9 1 ▶ RETVAL = new Envelope(c);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = new Envelope(c); 1 0 1
10 1 ▶ }
Branch: 3 branches
BranchTrueFalseTotal
} 1 0 1
} 1 0 1
} 0 0 0
11 else {
12 if(!arg1) throw("undef not allowed");
13 1 ▶ panda::string_view sw = Simple(arg1);
Branch: 1 branch
BranchTrueFalseTotal
panda::string_view sw = Simple(arg1); 0 1 1
14 1 ▶ std::string str { sw.begin(), sw.end() };
Branch: 2 branches
BranchTrueFalseTotal
std::string str { sw.begin(), sw.end() }; 1 0 1
std::string str { sw.begin(), sw.end() }; 1 0 1
15 2 ▶ RETVAL = new Envelope(str);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = new Envelope(str); 1 0 1
16 1 ▶ }
Branch: 3 branches
BranchTrueFalseTotal
} 1 0 1
} 1 0 1
} 0 0 0
17 1 }
18 else if (items == 3) {
19 39 ▶ auto& c1 = xs::in<Coordinate&>(arg1);
Branch: 1 branch
BranchTrueFalseTotal
auto& c1 = xs::in<Coordinate&>(arg1); 3 36 39
20 3 ▶ auto& c2 = xs::in<Coordinate&>(arg2);
Branch: 1 branch
BranchTrueFalseTotal
auto& c2 = xs::in<Coordinate&>(arg2); 3 0 3
21 3 ▶ RETVAL = new Envelope(c1, c2);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = new Envelope(c1, c2); 2 1 3
22 2 ▶ }
Branch: 3 branches
BranchTrueFalseTotal
} 2 0 2
} 2 0 2
} 0 0 0
23 else if (items == 5) RETVAL = new Envelope(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4));
24 36 ▶ else throw ("unsupported constructor");
Branch: 12 branches
BranchTrueFalseTotal
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 36 0 36
else throw ("unsupported constructor"); 0 0 0
25 0 }
26  
27 void Envelope::init(SV* arg1 = NULL, SV* arg2 = NULL, SV* arg3 = NULL, SV* arg4 = NULL) {
28 6 ▶ if (items == 1) THIS->init();
Branch: 1 branch
BranchTrueFalseTotal
if (items == 1) THIS->init(); 3 3 6
29 3 ▶ else if (items == 2) {
Branch: 1 branch
BranchTrueFalseTotal
else if (items == 2) { 1 2 3
30 1 auto& c = xs::in<Coordinate&>(arg1);
31 1 THIS->init(c);
32 }
33 2 ▶ else if (items == 3) {
Branch: 1 branch
BranchTrueFalseTotal
else if (items == 3) { 1 1 2
34 1 ▶ auto c1 = xs::in<Coordinate&>(arg1);
Branch: 1 branch
BranchTrueFalseTotal
auto c1 = xs::in<Coordinate&>(arg1); 1 0 1
35 1 ▶ auto c2 = xs::in<Coordinate&>(arg2);
Branch: 1 branch
BranchTrueFalseTotal
auto c2 = xs::in<Coordinate&>(arg2); 1 0 1
36 1 ▶ THIS->init(c1, c2);
Branch: 1 branch
BranchTrueFalseTotal
THIS->init(c1, c2); 1 0 1
37 }
38 1 ▶ else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4));
Branch: 10 branches
BranchTrueFalseTotal
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
else if (items == 5) THIS->init(Simple(arg1), Simple(arg2), Simple(arg3), Simple(arg4)); 1 0 1
39 0 else throw ("unsupported arguments");
40 }
41  
42 1 void Envelope::setToNull()
43  
44 2 ▶double Envelope::getArea()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getArea() 0 2 2
45  
46 1 ▶double Envelope::getMaxY()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getMaxY() 0 1 1
47  
48 1 ▶double Envelope::getMaxX()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getMaxX() 0 1 1
49  
50 1 ▶double Envelope::getMinY()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getMinY() 0 1 1
51  
52 1 ▶double Envelope::getMinX()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getMinX() 0 1 1
53  
54 1 ▶double Envelope::getWidth()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getWidth() 0 1 1
55  
56 1 ▶double Envelope::getHeight()
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::getHeight() 0 1 1
57  
58 9 ▶bool Envelope::isNull()
Branch: 1 branch
BranchTrueFalseTotal
bool Envelope::isNull() 3 6 9
59  
60 1 ▶int Envelope::hashCode ()
Branch: 1 branch
BranchTrueFalseTotal
int Envelope::hashCode () 0 1 1
61  
62 14 ▶std::string Envelope::toString (...)
Branch: 1 branch
BranchTrueFalseTotal
std::string Envelope::toString (...) 14 0 14
63  
64 bool Envelope::eq (Sv other_arg, SV*) {
65 8 ▶ auto other = xs::in<Envelope*>(other_arg);
Branch: 1 branch
BranchTrueFalseTotal
auto other = xs::in<Envelope*>(other_arg); 8 0 8
66 8 ▶ RETVAL = other ? THIS->equals(other) : false;
Branch: 4 branches
BranchTrueFalseTotal
RETVAL = other ? THIS->equals(other) : false; 8 0 8
RETVAL = other ? THIS->equals(other) : false; 8 0 8
RETVAL = other ? THIS->equals(other) : false; 8 0 8
RETVAL = other ? THIS->equals(other) : false; 8 0 8
67 }
68  
69 Coordinate* Envelope::centre() {
70 1 Coordinate c;
71 1 ▶ if (!THIS->centre(c)) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!THIS->centre(c)) XSRETURN_UNDEF; 1 0 1
72 1 ▶ RETVAL = new Coordinate(c);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = new Coordinate(c); 1 0 1
RETVAL = new Coordinate(c); 0 1 1
73 1 ▶}
Branch: 2 branches
BranchTrueFalseTotal
} 1 0 1
} 1 0 1
74  
75 bool Envelope::contains(SV* arg1, SV* arg2 = NULL) {
76 7 ▶ if (!arg2) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arg2) { 5 2 7
77 5 ▶ Object obj {arg1};
Branch: 1 branch
BranchTrueFalseTotal
Object obj {arg1}; 5 0 5
78 5 ▶ if(!obj) throw("wrong argument");
Branch: 1 branch
BranchTrueFalseTotal
if(!obj) throw("wrong argument"); 0 5 5
79 5 ▶ if (obj.stash().name() == "Geo::Geos::Envelope") {
Branch: 4 branches
BranchTrueFalseTotal
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 3 2 5
80 3 ▶ auto e = xs::in<Envelope*>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto e = xs::in<Envelope*>(obj); 3 0 3
81 3 ▶ RETVAL = THIS->contains(e);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->contains(e); 3 0 3
82 }
83 else {
84 2 ▶ auto& c = xs::in<Coordinate&>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto& c = xs::in<Coordinate&>(obj); 2 0 2
85 2 ▶ RETVAL = THIS->contains(c);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->contains(c); 2 0 2
86 }
87 5 }
88 2 ▶ else RETVAL = THIS->contains(Simple(arg1), Simple(arg2));
Branch: 5 branches
BranchTrueFalseTotal
else RETVAL = THIS->contains(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->contains(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->contains(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->contains(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->contains(Simple(arg1), Simple(arg2)); 2 0 2
89 }
90  
91 bool Envelope::covers(SV* arg1, SV* arg2 = NULL) {
92 7 ▶ if (!arg2) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arg2) { 5 2 7
93 5 ▶ Object obj {arg1};
Branch: 1 branch
BranchTrueFalseTotal
Object obj {arg1}; 5 0 5
94 5 ▶ if(!obj) throw("wrong argument");
Branch: 1 branch
BranchTrueFalseTotal
if(!obj) throw("wrong argument"); 0 5 5
95 5 ▶ if (obj.stash().name() == "Geo::Geos::Envelope") {
Branch: 4 branches
BranchTrueFalseTotal
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 3 2 5
96 3 ▶ auto e = xs::in<Envelope*>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto e = xs::in<Envelope*>(obj); 3 0 3
97 3 ▶ RETVAL = THIS->covers(e);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->covers(e); 3 0 3
98 }
99 else {
100 2 ▶ auto& c = xs::in<Coordinate&>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto& c = xs::in<Coordinate&>(obj); 2 0 2
101 2 ▶ RETVAL = THIS->covers(c);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = THIS->covers(c); 2 0 2
RETVAL = THIS->covers(c); 2 0 2
102 }
103 5 }
104 2 ▶ else RETVAL = THIS->covers(Simple(arg1), Simple(arg2));
Branch: 5 branches
BranchTrueFalseTotal
else RETVAL = THIS->covers(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->covers(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->covers(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->covers(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = THIS->covers(Simple(arg1), Simple(arg2)); 2 0 2
105 }
106  
107 bool intersects(Object maybe_self, SV* arg1, SV* arg2 = NULL, SV* arg3 = NULL) {
108 11 ▶ if (!maybe_self) throw("wrong argument");
Branch: 1 branch
BranchTrueFalseTotal
if (!maybe_self) throw("wrong argument"); 0 11 11
109 11 ▶ auto arg0_stash = maybe_self.stash().name();
Branch: 2 branches
BranchTrueFalseTotal
auto arg0_stash = maybe_self.stash().name(); 11 0 11
auto arg0_stash = maybe_self.stash().name(); 11 0 11
110 11 ▶ if (arg0_stash != "Geo::Geos::Envelope") {
Branch: 2 branches
BranchTrueFalseTotal
if (arg0_stash != "Geo::Geos::Envelope") { 11 0 11
if (arg0_stash != "Geo::Geos::Envelope") { 4 7 11
111 // static method
112 4 ▶ auto& p1 = xs::in<Coordinate&>(maybe_self);
Branch: 1 branch
BranchTrueFalseTotal
auto& p1 = xs::in<Coordinate&>(maybe_self); 4 0 4
113 4 ▶ auto& p2 = xs::in<Coordinate&>(arg1);
Branch: 1 branch
BranchTrueFalseTotal
auto& p2 = xs::in<Coordinate&>(arg1); 4 0 4
114 4 ▶ if (!arg3) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arg3) { 2 2 4
115 2 ▶ auto& q = xs::in<Coordinate&>(arg2);
Branch: 1 branch
BranchTrueFalseTotal
auto& q = xs::in<Coordinate&>(arg2); 2 0 2
116 2 ▶ RETVAL = Envelope::intersects(p1, p2, q);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = Envelope::intersects(p1, p2, q); 2 0 2
117 }
118 else {
119 2 ▶ auto& q1 = xs::in<Coordinate&>(arg2);
Branch: 1 branch
BranchTrueFalseTotal
auto& q1 = xs::in<Coordinate&>(arg2); 2 0 2
120 2 ▶ auto& q2 = xs::in<Coordinate&>(arg3);
Branch: 1 branch
BranchTrueFalseTotal
auto& q2 = xs::in<Coordinate&>(arg3); 2 0 2
121 2 ▶ RETVAL = Envelope::intersects(p1, p2, q1, q2);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = Envelope::intersects(p1, p2, q1, q2); 2 0 2
122 }
123 } else {
124 // object method
125 7 ▶ Envelope& self = xs::in<Envelope&>(maybe_self);
Branch: 1 branch
BranchTrueFalseTotal
Envelope& self = xs::in<Envelope&>(maybe_self); 7 0 7
126 7 ▶ if (!arg2) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arg2) { 5 2 7
127 5 ▶ Object obj {arg1};
Branch: 1 branch
BranchTrueFalseTotal
Object obj {arg1}; 5 0 5
128 5 ▶ if(!obj) throw("wrong argument");
Branch: 1 branch
BranchTrueFalseTotal
if(!obj) throw("wrong argument"); 0 5 5
129 5 ▶ if (obj.stash().name() == "Geo::Geos::Envelope") {
Branch: 4 branches
BranchTrueFalseTotal
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 5 0 5
if (obj.stash().name() == "Geo::Geos::Envelope") { 3 2 5
130 3 ▶ auto& e = xs::in<Envelope&>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto& e = xs::in<Envelope&>(obj); 3 0 3
131 3 ▶ RETVAL = self.intersects(&e);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self.intersects(&e); 3 0 3
132 }
133 else {
134 2 ▶ auto& c = xs::in<Coordinate&>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto& c = xs::in<Coordinate&>(obj); 2 0 2
135 2 ▶ RETVAL = self.intersects(c);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = self.intersects(c); 2 0 2
136 }
137 5 }
138 2 ▶ else RETVAL = self.intersects(Simple(arg1), Simple(arg2));
Branch: 5 branches
BranchTrueFalseTotal
else RETVAL = self.intersects(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = self.intersects(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = self.intersects(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = self.intersects(Simple(arg1), Simple(arg2)); 2 0 2
else RETVAL = self.intersects(Simple(arg1), Simple(arg2)); 2 0 2
139 }
140 }
141  
142 void Envelope::expandToInclude(SV* arg1, SV* arg2 = NULL) {
143 3 ▶ if (!arg2) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arg2) { 2 1 3
144 2 ▶ Object obj {arg1};
Branch: 1 branch
BranchTrueFalseTotal
Object obj {arg1}; 2 0 2
145 2 ▶ if(!obj) throw("wrong argument");
Branch: 1 branch
BranchTrueFalseTotal
if(!obj) throw("wrong argument"); 0 2 2
146 2 ▶ if (obj.stash().name() == "Geo::Geos::Envelope") {
Branch: 4 branches
BranchTrueFalseTotal
if (obj.stash().name() == "Geo::Geos::Envelope") { 2 0 2
if (obj.stash().name() == "Geo::Geos::Envelope") { 2 0 2
if (obj.stash().name() == "Geo::Geos::Envelope") { 2 0 2
if (obj.stash().name() == "Geo::Geos::Envelope") { 1 1 2
147 1 ▶ auto& e = xs::in<Envelope&>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto& e = xs::in<Envelope&>(obj); 1 0 1
148 1 ▶ THIS->expandToInclude(&e);
Branch: 1 branch
BranchTrueFalseTotal
THIS->expandToInclude(&e); 1 0 1
149 }
150 else {
151 1 ▶ auto& c = xs::in<Coordinate&>(obj);
Branch: 1 branch
BranchTrueFalseTotal
auto& c = xs::in<Coordinate&>(obj); 1 0 1
152 1 ▶ THIS->expandToInclude(c);
Branch: 1 branch
BranchTrueFalseTotal
THIS->expandToInclude(c); 1 0 1
153 }
154 2 }
155 1 ▶ else THIS->expandToInclude(Simple(arg1), Simple(arg2));
Branch: 5 branches
BranchTrueFalseTotal
else THIS->expandToInclude(Simple(arg1), Simple(arg2)); 1 0 1
else THIS->expandToInclude(Simple(arg1), Simple(arg2)); 1 0 1
else THIS->expandToInclude(Simple(arg1), Simple(arg2)); 1 0 1
else THIS->expandToInclude(Simple(arg1), Simple(arg2)); 1 0 1
else THIS->expandToInclude(Simple(arg1), Simple(arg2)); 1 0 1
156 }
157  
158 1 ▶double Envelope::distance(Envelope& other) { RETVAL = THIS->distance(&other); }
Branch: 1 branch
BranchTrueFalseTotal
double Envelope::distance(Envelope& other) { RETVAL = THIS->distance(&other); } 0 1 1
159  
160 1 void Envelope::translate(double tX, double tY)
161  
162 1 void Envelope::expandBy(double dX, double dY)
163  
164 Envelope* Envelope::intersection(Envelope& other) {
165 1 Envelope e;
166 1 ▶ if (!THIS->intersection(other, e)) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!THIS->intersection(other, e)) XSRETURN_UNDEF; 1 0 1
167 1 ▶ RETVAL = new Envelope(e);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = new Envelope(e); 1 0 1
RETVAL = new Envelope(e); 0 1 1
168 1 ▶}
Branch: 4 branches
BranchTrueFalseTotal
} 1 0 1
} 1 0 1
} 1 0 1
} 0 0 0
169  
170 0 ▶int CLONE_SKIP (...) { PERL_UNUSED_VAR(items); RETVAL = 1; }
Branch: 1 branch
BranchTrueFalseTotal
int CLONE_SKIP (...) { PERL_UNUSED_VAR(items); RETVAL = 1; } 0 0 0
« xsi/algorithm/LineIntersector.xsi ↑ Summary xsi/operation.xsi »