forked from twpayne/go-geom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
derived.gen.go
314 lines (290 loc) · 7.35 KB
/
derived.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
// Code generated by goderive DO NOT EDIT.
package geom
// deriveCloneBounds returns a clone of the src parameter.
func deriveCloneBounds(src *Bounds) *Bounds {
if src == nil {
return nil
}
dst := new(Bounds)
deriveDeepCopy(dst, src)
return dst
}
// deriveCloneCoord returns a clone of the src parameter.
func deriveCloneCoord(src Coord) Coord {
if src == nil {
return nil
}
dst := make(Coord, len(src))
deriveDeepCopy_(dst, src)
return dst
}
// deriveCloneLinearRing returns a clone of the src parameter.
func deriveCloneLinearRing(src *LinearRing) *LinearRing {
if src == nil {
return nil
}
dst := new(LinearRing)
deriveDeepCopy_1(dst, src)
return dst
}
// deriveCloneLineString returns a clone of the src parameter.
func deriveCloneLineString(src *LineString) *LineString {
if src == nil {
return nil
}
dst := new(LineString)
deriveDeepCopy_2(dst, src)
return dst
}
// deriveCloneMultiLineString returns a clone of the src parameter.
func deriveCloneMultiLineString(src *MultiLineString) *MultiLineString {
if src == nil {
return nil
}
dst := new(MultiLineString)
deriveDeepCopy_3(dst, src)
return dst
}
// deriveCloneMultiPoint returns a clone of the src parameter.
func deriveCloneMultiPoint(src *MultiPoint) *MultiPoint {
if src == nil {
return nil
}
dst := new(MultiPoint)
deriveDeepCopy_4(dst, src)
return dst
}
// deriveCloneMultiPolygon returns a clone of the src parameter.
func deriveCloneMultiPolygon(src *MultiPolygon) *MultiPolygon {
if src == nil {
return nil
}
dst := new(MultiPolygon)
deriveDeepCopy_5(dst, src)
return dst
}
// deriveClonePoint returns a clone of the src parameter.
func deriveClonePoint(src *Point) *Point {
if src == nil {
return nil
}
dst := new(Point)
deriveDeepCopy_6(dst, src)
return dst
}
// deriveClonePolygon returns a clone of the src parameter.
func deriveClonePolygon(src *Polygon) *Polygon {
if src == nil {
return nil
}
dst := new(Polygon)
deriveDeepCopy_7(dst, src)
return dst
}
// deriveDeepCopy recursively copies the contents of src into dst.
func deriveDeepCopy(dst, src *Bounds) {
dst.layout = src.layout
if src.min == nil {
dst.min = nil
} else {
if dst.min != nil {
if len(src.min) > len(dst.min) {
if cap(dst.min) >= len(src.min) {
dst.min = (dst.min)[:len(src.min)]
} else {
dst.min = make([]float64, len(src.min))
}
} else if len(src.min) < len(dst.min) {
dst.min = (dst.min)[:len(src.min)]
}
} else {
dst.min = make([]float64, len(src.min))
}
copy(dst.min, src.min)
}
if src.max == nil {
dst.max = nil
} else {
if dst.max != nil {
if len(src.max) > len(dst.max) {
if cap(dst.max) >= len(src.max) {
dst.max = (dst.max)[:len(src.max)]
} else {
dst.max = make([]float64, len(src.max))
}
} else if len(src.max) < len(dst.max) {
dst.max = (dst.max)[:len(src.max)]
}
} else {
dst.max = make([]float64, len(src.max))
}
copy(dst.max, src.max)
}
}
// deriveDeepCopy_ recursively copies the contents of src into dst.
func deriveDeepCopy_(dst, src Coord) {
copy(dst, src)
}
// deriveDeepCopy_1 recursively copies the contents of src into dst.
func deriveDeepCopy_1(dst, src *LinearRing) {
func() {
field := new(geom1)
deriveDeepCopy_8(field, &src.geom1)
dst.geom1 = *field
}()
}
// deriveDeepCopy_2 recursively copies the contents of src into dst.
func deriveDeepCopy_2(dst, src *LineString) {
func() {
field := new(geom1)
deriveDeepCopy_8(field, &src.geom1)
dst.geom1 = *field
}()
}
// deriveDeepCopy_3 recursively copies the contents of src into dst.
func deriveDeepCopy_3(dst, src *MultiLineString) {
func() {
field := new(geom2)
deriveDeepCopy_9(field, &src.geom2)
dst.geom2 = *field
}()
}
// deriveDeepCopy_4 recursively copies the contents of src into dst.
func deriveDeepCopy_4(dst, src *MultiPoint) {
func() {
field := new(geom2)
deriveDeepCopy_9(field, &src.geom2)
dst.geom2 = *field
}()
}
// deriveDeepCopy_5 recursively copies the contents of src into dst.
func deriveDeepCopy_5(dst, src *MultiPolygon) {
func() {
field := new(geom3)
deriveDeepCopy_10(field, &src.geom3)
dst.geom3 = *field
}()
}
// deriveDeepCopy_6 recursively copies the contents of src into dst.
func deriveDeepCopy_6(dst, src *Point) {
func() {
field := new(geom0)
deriveDeepCopy_11(field, &src.geom0)
dst.geom0 = *field
}()
}
// deriveDeepCopy_7 recursively copies the contents of src into dst.
func deriveDeepCopy_7(dst, src *Polygon) {
func() {
field := new(geom2)
deriveDeepCopy_9(field, &src.geom2)
dst.geom2 = *field
}()
}
// deriveDeepCopy_8 recursively copies the contents of src into dst.
func deriveDeepCopy_8(dst, src *geom1) {
func() {
field := new(geom0)
deriveDeepCopy_11(field, &src.geom0)
dst.geom0 = *field
}()
}
// deriveDeepCopy_9 recursively copies the contents of src into dst.
func deriveDeepCopy_9(dst, src *geom2) {
func() {
field := new(geom1)
deriveDeepCopy_8(field, &src.geom1)
dst.geom1 = *field
}()
if src.ends == nil {
dst.ends = nil
} else {
if dst.ends != nil {
if len(src.ends) > len(dst.ends) {
if cap(dst.ends) >= len(src.ends) {
dst.ends = (dst.ends)[:len(src.ends)]
} else {
dst.ends = make([]int, len(src.ends))
}
} else if len(src.ends) < len(dst.ends) {
dst.ends = (dst.ends)[:len(src.ends)]
}
} else {
dst.ends = make([]int, len(src.ends))
}
copy(dst.ends, src.ends)
}
}
// deriveDeepCopy_10 recursively copies the contents of src into dst.
func deriveDeepCopy_10(dst, src *geom3) {
func() {
field := new(geom1)
deriveDeepCopy_8(field, &src.geom1)
dst.geom1 = *field
}()
if src.endss == nil {
dst.endss = nil
} else {
if dst.endss != nil {
if len(src.endss) > len(dst.endss) {
if cap(dst.endss) >= len(src.endss) {
dst.endss = (dst.endss)[:len(src.endss)]
} else {
dst.endss = make([][]int, len(src.endss))
}
} else if len(src.endss) < len(dst.endss) {
dst.endss = (dst.endss)[:len(src.endss)]
}
} else {
dst.endss = make([][]int, len(src.endss))
}
deriveDeepCopy_12(dst.endss, src.endss)
}
}
// deriveDeepCopy_11 recursively copies the contents of src into dst.
func deriveDeepCopy_11(dst, src *geom0) {
dst.layout = src.layout
dst.stride = src.stride
if src.flatCoords == nil {
dst.flatCoords = nil
} else {
if dst.flatCoords != nil {
if len(src.flatCoords) > len(dst.flatCoords) {
if cap(dst.flatCoords) >= len(src.flatCoords) {
dst.flatCoords = (dst.flatCoords)[:len(src.flatCoords)]
} else {
dst.flatCoords = make([]float64, len(src.flatCoords))
}
} else if len(src.flatCoords) < len(dst.flatCoords) {
dst.flatCoords = (dst.flatCoords)[:len(src.flatCoords)]
}
} else {
dst.flatCoords = make([]float64, len(src.flatCoords))
}
copy(dst.flatCoords, src.flatCoords)
}
dst.srid = src.srid
}
// deriveDeepCopy_12 recursively copies the contents of src into dst.
func deriveDeepCopy_12(dst, src [][]int) {
for src_i, src_value := range src {
if src_value == nil {
dst[src_i] = nil
} else {
if dst[src_i] != nil {
if len(src_value) > len(dst[src_i]) {
if cap(dst[src_i]) >= len(src_value) {
dst[src_i] = (dst[src_i])[:len(src_value)]
} else {
dst[src_i] = make([]int, len(src_value))
}
} else if len(src_value) < len(dst[src_i]) {
dst[src_i] = (dst[src_i])[:len(src_value)]
}
} else {
dst[src_i] = make([]int, len(src_value))
}
copy(dst[src_i], src_value)
}
}
}