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