ol 7.0.0-dev.1658443472213 → 7.0.0-dev.1658733468997
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Overlay.d.ts +3 -25
- package/Overlay.d.ts.map +1 -1
- package/Overlay.js +3 -25
- package/Overlay.js.map +1 -1
- package/package.json +2 -1
- package/render/webgl/BatchRenderer.d.ts +92 -0
- package/render/webgl/BatchRenderer.d.ts.map +1 -0
- package/render/webgl/BatchRenderer.js +165 -0
- package/render/webgl/BatchRenderer.js.map +1 -0
- package/render/webgl/LineStringBatchRenderer.d.ts +27 -0
- package/render/webgl/LineStringBatchRenderer.d.ts.map +1 -0
- package/render/webgl/LineStringBatchRenderer.js +114 -0
- package/render/webgl/LineStringBatchRenderer.js.map +1 -0
- package/render/webgl/MixedGeometryBatch.d.ts +306 -0
- package/render/webgl/MixedGeometryBatch.d.ts.map +1 -0
- package/render/webgl/MixedGeometryBatch.js +342 -0
- package/render/webgl/MixedGeometryBatch.js.map +1 -0
- package/render/webgl/PointBatchRenderer.d.ts +26 -0
- package/render/webgl/PointBatchRenderer.d.ts.map +1 -0
- package/render/webgl/PointBatchRenderer.js +102 -0
- package/render/webgl/PointBatchRenderer.js.map +1 -0
- package/render/webgl/PolygonBatchRenderer.d.ts +25 -0
- package/render/webgl/PolygonBatchRenderer.d.ts.map +1 -0
- package/render/webgl/PolygonBatchRenderer.js +110 -0
- package/render/webgl/PolygonBatchRenderer.js.map +1 -0
- package/render/webgl/constants.d.ts +43 -0
- package/render/webgl/constants.d.ts.map +1 -0
- package/render/webgl/constants.js +26 -0
- package/render/webgl/constants.js.map +1 -0
- package/render/webgl/utils.d.ts +76 -0
- package/render/webgl/utils.d.ts.map +1 -0
- package/render/webgl/utils.js +257 -0
- package/render/webgl/utils.js.map +1 -0
- package/renderer/webgl/Layer.d.ts +0 -98
- package/renderer/webgl/Layer.d.ts.map +1 -1
- package/renderer/webgl/Layer.js +0 -134
- package/renderer/webgl/Layer.js.map +1 -1
- package/renderer/webgl/PointsLayer.d.ts +4 -1
- package/renderer/webgl/PointsLayer.d.ts.map +1 -1
- package/renderer/webgl/PointsLayer.js +15 -8
- package/renderer/webgl/PointsLayer.js.map +1 -1
- package/renderer/webgl/TileLayer.js +1 -1
- package/renderer/webgl/TileLayer.js.map +1 -1
- package/renderer/webgl/VectorLayer.d.ts +142 -0
- package/renderer/webgl/VectorLayer.d.ts.map +1 -0
- package/renderer/webgl/VectorLayer.js +304 -0
- package/renderer/webgl/VectorLayer.js.map +1 -0
- package/renderer/webgl/shaders.d.ts +43 -0
- package/renderer/webgl/shaders.d.ts.map +1 -0
- package/renderer/webgl/shaders.js +53 -0
- package/renderer/webgl/shaders.js.map +1 -0
- package/src/Overlay.js +3 -25
- package/src/render/webgl/BatchRenderer.js +201 -0
- package/src/render/webgl/LineStringBatchRenderer.js +116 -0
- package/src/render/webgl/MixedGeometryBatch.js +364 -0
- package/src/render/webgl/PointBatchRenderer.js +97 -0
- package/src/render/webgl/PolygonBatchRenderer.js +117 -0
- package/src/render/webgl/constants.js +27 -0
- package/src/render/webgl/utils.js +351 -0
- package/src/renderer/webgl/Layer.js +0 -160
- package/src/renderer/webgl/PointsLayer.js +16 -12
- package/src/renderer/webgl/TileLayer.js +1 -1
- package/src/renderer/webgl/VectorLayer.js +409 -0
- package/src/renderer/webgl/shaders.js +198 -0
- package/src/webgl/Helper.js +30 -45
- package/src/worker/webgl.js +1 -1
- package/util.js +1 -1
- package/webgl/Helper.d.ts +17 -25
- package/webgl/Helper.d.ts.map +1 -1
- package/webgl/Helper.js +29 -43
- package/webgl/Helper.js.map +1 -1
- package/worker/webgl.js +1 -1
- package/worker/webgl.js.map +1 -1
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
export default MixedGeometryBatch;
|
|
2
|
+
/**
|
|
3
|
+
* Object that holds a reference to a feature as well as the raw coordinates of its various geometries
|
|
4
|
+
*/
|
|
5
|
+
export type GeometryBatchItem = {
|
|
6
|
+
/**
|
|
7
|
+
* Feature
|
|
8
|
+
*/
|
|
9
|
+
feature: import("../../Feature").default;
|
|
10
|
+
/**
|
|
11
|
+
* Array of flat coordinates arrays, one for each geometry related to the feature
|
|
12
|
+
*/
|
|
13
|
+
flatCoordss: Array<Array<number>>;
|
|
14
|
+
/**
|
|
15
|
+
* Only defined for linestring and polygon batches
|
|
16
|
+
*/
|
|
17
|
+
verticesCount?: number | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Only defined for polygon batches
|
|
20
|
+
*/
|
|
21
|
+
ringsCount?: number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Array of vertices counts in each ring for each geometry; only defined for polygons batches
|
|
24
|
+
*/
|
|
25
|
+
ringsVerticesCounts?: number[][] | undefined;
|
|
26
|
+
};
|
|
27
|
+
export type GeometryBatch = PointGeometryBatch | LineStringGeometryBatch | PolygonGeometryBatch;
|
|
28
|
+
/**
|
|
29
|
+
* A geometry batch specific to polygons
|
|
30
|
+
*/
|
|
31
|
+
export type PolygonGeometryBatch = {
|
|
32
|
+
/**
|
|
33
|
+
* Dictionary of all entries in the batch with associated computed values.
|
|
34
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
35
|
+
*/
|
|
36
|
+
entries: {
|
|
37
|
+
[x: string]: GeometryBatchItem;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Amount of geometries in the batch.
|
|
41
|
+
*/
|
|
42
|
+
geometriesCount: number;
|
|
43
|
+
/**
|
|
44
|
+
* Render instructions for polygons are structured like so:
|
|
45
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
46
|
+
*/
|
|
47
|
+
renderInstructions: Float32Array;
|
|
48
|
+
/**
|
|
49
|
+
* Vertices WebGL buffer
|
|
50
|
+
*/
|
|
51
|
+
verticesBuffer: WebGLArrayBuffer;
|
|
52
|
+
/**
|
|
53
|
+
* Indices WebGL buffer
|
|
54
|
+
*/
|
|
55
|
+
indicesBuffer: WebGLArrayBuffer;
|
|
56
|
+
/**
|
|
57
|
+
* Converts world space coordinates to screen space; applies to the rendering instructions
|
|
58
|
+
*/
|
|
59
|
+
renderInstructionsTransform: import("../../transform.js").Transform;
|
|
60
|
+
/**
|
|
61
|
+
* Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
62
|
+
*/
|
|
63
|
+
verticesBufferTransform: import("../../transform.js").Transform;
|
|
64
|
+
/**
|
|
65
|
+
* Screen space to world space; applies to the webgl vertices buffer
|
|
66
|
+
*/
|
|
67
|
+
invertVerticesBufferTransform: import("../../transform.js").Transform;
|
|
68
|
+
/**
|
|
69
|
+
* Amount of vertices from geometries in the batch.
|
|
70
|
+
*/
|
|
71
|
+
verticesCount: number;
|
|
72
|
+
/**
|
|
73
|
+
* How many outer and inner rings in this batch.
|
|
74
|
+
*/
|
|
75
|
+
ringsCount: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* A geometry batch specific to lines
|
|
79
|
+
*/
|
|
80
|
+
export type LineStringGeometryBatch = {
|
|
81
|
+
/**
|
|
82
|
+
* Dictionary of all entries in the batch with associated computed values.
|
|
83
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
84
|
+
*/
|
|
85
|
+
entries: {
|
|
86
|
+
[x: string]: GeometryBatchItem;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Amount of geometries in the batch.
|
|
90
|
+
*/
|
|
91
|
+
geometriesCount: number;
|
|
92
|
+
/**
|
|
93
|
+
* Render instructions for polygons are structured like so:
|
|
94
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
95
|
+
*/
|
|
96
|
+
renderInstructions: Float32Array;
|
|
97
|
+
/**
|
|
98
|
+
* Vertices WebGL buffer
|
|
99
|
+
*/
|
|
100
|
+
verticesBuffer: WebGLArrayBuffer;
|
|
101
|
+
/**
|
|
102
|
+
* Indices WebGL buffer
|
|
103
|
+
*/
|
|
104
|
+
indicesBuffer: WebGLArrayBuffer;
|
|
105
|
+
/**
|
|
106
|
+
* Converts world space coordinates to screen space; applies to the rendering instructions
|
|
107
|
+
*/
|
|
108
|
+
renderInstructionsTransform: import("../../transform.js").Transform;
|
|
109
|
+
/**
|
|
110
|
+
* Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
111
|
+
*/
|
|
112
|
+
verticesBufferTransform: import("../../transform.js").Transform;
|
|
113
|
+
/**
|
|
114
|
+
* Screen space to world space; applies to the webgl vertices buffer
|
|
115
|
+
*/
|
|
116
|
+
invertVerticesBufferTransform: import("../../transform.js").Transform;
|
|
117
|
+
/**
|
|
118
|
+
* Amount of vertices from geometries in the batch.
|
|
119
|
+
*/
|
|
120
|
+
verticesCount: number;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* A geometry batch specific to points
|
|
124
|
+
*/
|
|
125
|
+
export type PointGeometryBatch = {
|
|
126
|
+
/**
|
|
127
|
+
* Dictionary of all entries in the batch with associated computed values.
|
|
128
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
129
|
+
*/
|
|
130
|
+
entries: {
|
|
131
|
+
[x: string]: GeometryBatchItem;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Amount of geometries in the batch.
|
|
135
|
+
*/
|
|
136
|
+
geometriesCount: number;
|
|
137
|
+
/**
|
|
138
|
+
* Render instructions for polygons are structured like so:
|
|
139
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
140
|
+
*/
|
|
141
|
+
renderInstructions: Float32Array;
|
|
142
|
+
/**
|
|
143
|
+
* Vertices WebGL buffer
|
|
144
|
+
*/
|
|
145
|
+
verticesBuffer: WebGLArrayBuffer;
|
|
146
|
+
/**
|
|
147
|
+
* Indices WebGL buffer
|
|
148
|
+
*/
|
|
149
|
+
indicesBuffer: WebGLArrayBuffer;
|
|
150
|
+
/**
|
|
151
|
+
* Converts world space coordinates to screen space; applies to the rendering instructions
|
|
152
|
+
*/
|
|
153
|
+
renderInstructionsTransform: import("../../transform.js").Transform;
|
|
154
|
+
/**
|
|
155
|
+
* Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
156
|
+
*/
|
|
157
|
+
verticesBufferTransform: import("../../transform.js").Transform;
|
|
158
|
+
/**
|
|
159
|
+
* Screen space to world space; applies to the webgl vertices buffer
|
|
160
|
+
*/
|
|
161
|
+
invertVerticesBufferTransform: import("../../transform.js").Transform;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* @typedef {Object} GeometryBatchItem Object that holds a reference to a feature as well as the raw coordinates of its various geometries
|
|
165
|
+
* @property {import("../../Feature").default} feature Feature
|
|
166
|
+
* @property {Array<Array<number>>} flatCoordss Array of flat coordinates arrays, one for each geometry related to the feature
|
|
167
|
+
* @property {number} [verticesCount] Only defined for linestring and polygon batches
|
|
168
|
+
* @property {number} [ringsCount] Only defined for polygon batches
|
|
169
|
+
* @property {Array<Array<number>>} [ringsVerticesCounts] Array of vertices counts in each ring for each geometry; only defined for polygons batches
|
|
170
|
+
*/
|
|
171
|
+
/**
|
|
172
|
+
* @typedef {PointGeometryBatch|LineStringGeometryBatch|PolygonGeometryBatch} GeometryBatch
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* @typedef {Object} PolygonGeometryBatch A geometry batch specific to polygons
|
|
176
|
+
* @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
|
|
177
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
178
|
+
* @property {number} geometriesCount Amount of geometries in the batch.
|
|
179
|
+
* @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
|
|
180
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
181
|
+
* @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
|
|
182
|
+
* @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
|
|
183
|
+
* @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
|
|
184
|
+
* @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
185
|
+
* @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
|
|
186
|
+
* @property {number} verticesCount Amount of vertices from geometries in the batch.
|
|
187
|
+
* @property {number} ringsCount How many outer and inner rings in this batch.
|
|
188
|
+
*/
|
|
189
|
+
/**
|
|
190
|
+
* @typedef {Object} LineStringGeometryBatch A geometry batch specific to lines
|
|
191
|
+
* @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
|
|
192
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
193
|
+
* @property {number} geometriesCount Amount of geometries in the batch.
|
|
194
|
+
* @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
|
|
195
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
196
|
+
* @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
|
|
197
|
+
* @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
|
|
198
|
+
* @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
|
|
199
|
+
* @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
200
|
+
* @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
|
|
201
|
+
* @property {number} verticesCount Amount of vertices from geometries in the batch.
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* @typedef {Object} PointGeometryBatch A geometry batch specific to points
|
|
205
|
+
* @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
|
|
206
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
207
|
+
* @property {number} geometriesCount Amount of geometries in the batch.
|
|
208
|
+
* @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
|
|
209
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
210
|
+
* @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
|
|
211
|
+
* @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
|
|
212
|
+
* @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
|
|
213
|
+
* @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
214
|
+
* @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
|
|
215
|
+
*/
|
|
216
|
+
/**
|
|
217
|
+
* @classdesc This class is used to group several geometries of various types together for faster rendering.
|
|
218
|
+
* Three inner batches are maintained for polygons, lines and points. Each time a feature is added, changed or removed
|
|
219
|
+
* from the batch, these inner batches are modified accordingly in order to keep them up-to-date.
|
|
220
|
+
*
|
|
221
|
+
* A feature can be present in several inner batches, for example a polygon geometry will be present in the polygon batch
|
|
222
|
+
* and its linar rings will be present in the line batch. Multi geometries are also broken down into individual geometries
|
|
223
|
+
* and added to the corresponding batches in a recursive manner.
|
|
224
|
+
*
|
|
225
|
+
* Corresponding {@link module:ol/render/webgl/BatchRenderer} instances are then used to generate the render instructions
|
|
226
|
+
* and WebGL buffers (vertices and indices) for each inner batches; render instructions are stored on the inner batches,
|
|
227
|
+
* alongside the transform used to convert world coords to screen coords at the time these instructions were generated.
|
|
228
|
+
* The resulting WebGL buffers are stored on the batches as well.
|
|
229
|
+
*
|
|
230
|
+
* An important aspect of geometry batches is that there is no guarantee that render instructions and WebGL buffers
|
|
231
|
+
* are synchronized, i.e. render instructions can describe a new state while WebGL buffers might not have been written yet.
|
|
232
|
+
* This is why two world-to-screen transforms are stored on each batch: one for the render instructions and one for
|
|
233
|
+
* the WebGL buffers.
|
|
234
|
+
*/
|
|
235
|
+
declare class MixedGeometryBatch {
|
|
236
|
+
/**
|
|
237
|
+
* @type {PolygonGeometryBatch}
|
|
238
|
+
*/
|
|
239
|
+
polygonBatch: PolygonGeometryBatch;
|
|
240
|
+
/**
|
|
241
|
+
* @type {PointGeometryBatch}
|
|
242
|
+
*/
|
|
243
|
+
pointBatch: PointGeometryBatch;
|
|
244
|
+
/**
|
|
245
|
+
* @type {LineStringGeometryBatch}
|
|
246
|
+
*/
|
|
247
|
+
lineStringBatch: LineStringGeometryBatch;
|
|
248
|
+
/**
|
|
249
|
+
* @param {Array<import("../../Feature").default>} features Array of features to add to the batch
|
|
250
|
+
*/
|
|
251
|
+
addFeatures(features: Array<import("../../Feature").default>): void;
|
|
252
|
+
/**
|
|
253
|
+
* @param {import("../../Feature").default} feature Feature to add to the batch
|
|
254
|
+
*/
|
|
255
|
+
addFeature(feature: import("../../Feature").default): void;
|
|
256
|
+
/**
|
|
257
|
+
* @param {import("../../Feature").default} feature Feature
|
|
258
|
+
* @return {GeometryBatchItem} Batch item added (or existing one)
|
|
259
|
+
* @private
|
|
260
|
+
*/
|
|
261
|
+
private addFeatureEntryInPointBatch_;
|
|
262
|
+
/**
|
|
263
|
+
* @param {import("../../Feature").default} feature Feature
|
|
264
|
+
* @return {GeometryBatchItem} Batch item added (or existing one)
|
|
265
|
+
* @private
|
|
266
|
+
*/
|
|
267
|
+
private addFeatureEntryInLineStringBatch_;
|
|
268
|
+
/**
|
|
269
|
+
* @param {import("../../Feature").default} feature Feature
|
|
270
|
+
* @return {GeometryBatchItem} Batch item added (or existing one)
|
|
271
|
+
* @private
|
|
272
|
+
*/
|
|
273
|
+
private addFeatureEntryInPolygonBatch_;
|
|
274
|
+
/**
|
|
275
|
+
* @param {import("../../Feature").default} feature Feature
|
|
276
|
+
* @private
|
|
277
|
+
*/
|
|
278
|
+
private clearFeatureEntryInPointBatch_;
|
|
279
|
+
/**
|
|
280
|
+
* @param {import("../../Feature").default} feature Feature
|
|
281
|
+
* @private
|
|
282
|
+
*/
|
|
283
|
+
private clearFeatureEntryInLineStringBatch_;
|
|
284
|
+
/**
|
|
285
|
+
* @param {import("../../Feature").default} feature Feature
|
|
286
|
+
* @private
|
|
287
|
+
*/
|
|
288
|
+
private clearFeatureEntryInPolygonBatch_;
|
|
289
|
+
/**
|
|
290
|
+
* @param {import("../../geom").Geometry} geometry Geometry
|
|
291
|
+
* @param {import("../../Feature").default} feature Feature
|
|
292
|
+
* @private
|
|
293
|
+
*/
|
|
294
|
+
private addGeometry_;
|
|
295
|
+
/**
|
|
296
|
+
* @param {import("../../Feature").default} feature Feature
|
|
297
|
+
*/
|
|
298
|
+
changeFeature(feature: import("../../Feature").default): void;
|
|
299
|
+
/**
|
|
300
|
+
* @param {import("../../Feature").default} feature Feature
|
|
301
|
+
*/
|
|
302
|
+
removeFeature(feature: import("../../Feature").default): void;
|
|
303
|
+
clear(): void;
|
|
304
|
+
}
|
|
305
|
+
import WebGLArrayBuffer from "../../webgl/Buffer.js";
|
|
306
|
+
//# sourceMappingURL=MixedGeometryBatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MixedGeometryBatch.d.ts","sourceRoot":"","sources":["../../src/render/webgl/MixedGeometryBatch.js"],"names":[],"mappings":";;;;;;;;aAUc,OAAO,eAAe,EAAE,OAAO;;;;iBAC/B,MAAM,MAAM,MAAM,CAAC,CAAC;;;;;;;;;;;;;;4BAOrB,kBAAkB,GAAC,uBAAuB,GAAC,oBAAoB;;;;;;;;;;YAKvD,MAAM,GAAE,iBAAiB;;;;;qBAEhC,MAAM;;;;;wBACN,YA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;IAED;;OAEG;IACH,uBAFW,OAAO,eAAe,EAAE,OAAO,QAWzC;IAED;;OAEG;IACH,uBAFW,OAAO,eAAe,EAAE,OAAO,QAMzC;IAED,cAUC;CACF"}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ol/render/webgl/MixedGeometryBatch
|
|
3
|
+
*/
|
|
4
|
+
import WebGLArrayBuffer from '../../webgl/Buffer.js';
|
|
5
|
+
import { ARRAY_BUFFER, DYNAMIC_DRAW, ELEMENT_ARRAY_BUFFER } from '../../webgl.js';
|
|
6
|
+
import { create as createTransform } from '../../transform.js';
|
|
7
|
+
import { getUid } from '../../util.js';
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} GeometryBatchItem Object that holds a reference to a feature as well as the raw coordinates of its various geometries
|
|
10
|
+
* @property {import("../../Feature").default} feature Feature
|
|
11
|
+
* @property {Array<Array<number>>} flatCoordss Array of flat coordinates arrays, one for each geometry related to the feature
|
|
12
|
+
* @property {number} [verticesCount] Only defined for linestring and polygon batches
|
|
13
|
+
* @property {number} [ringsCount] Only defined for polygon batches
|
|
14
|
+
* @property {Array<Array<number>>} [ringsVerticesCounts] Array of vertices counts in each ring for each geometry; only defined for polygons batches
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {PointGeometryBatch|LineStringGeometryBatch|PolygonGeometryBatch} GeometryBatch
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Object} PolygonGeometryBatch A geometry batch specific to polygons
|
|
21
|
+
* @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
|
|
22
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
23
|
+
* @property {number} geometriesCount Amount of geometries in the batch.
|
|
24
|
+
* @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
|
|
25
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
26
|
+
* @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
|
|
27
|
+
* @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
|
|
28
|
+
* @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
|
|
29
|
+
* @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
30
|
+
* @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
|
|
31
|
+
* @property {number} verticesCount Amount of vertices from geometries in the batch.
|
|
32
|
+
* @property {number} ringsCount How many outer and inner rings in this batch.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {Object} LineStringGeometryBatch A geometry batch specific to lines
|
|
36
|
+
* @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
|
|
37
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
38
|
+
* @property {number} geometriesCount Amount of geometries in the batch.
|
|
39
|
+
* @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
|
|
40
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
41
|
+
* @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
|
|
42
|
+
* @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
|
|
43
|
+
* @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
|
|
44
|
+
* @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
45
|
+
* @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
|
|
46
|
+
* @property {number} verticesCount Amount of vertices from geometries in the batch.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* @typedef {Object} PointGeometryBatch A geometry batch specific to points
|
|
50
|
+
* @property {Object<string, GeometryBatchItem>} entries Dictionary of all entries in the batch with associated computed values.
|
|
51
|
+
* One entry corresponds to one feature. Key is feature uid.
|
|
52
|
+
* @property {number} geometriesCount Amount of geometries in the batch.
|
|
53
|
+
* @property {Float32Array} renderInstructions Render instructions for polygons are structured like so:
|
|
54
|
+
* [ numberOfRings, numberOfVerticesInRing0, ..., numberOfVerticesInRingN, x0, y0, customAttr0, ..., xN, yN, customAttrN, numberOfRings,... ]
|
|
55
|
+
* @property {WebGLArrayBuffer} verticesBuffer Vertices WebGL buffer
|
|
56
|
+
* @property {WebGLArrayBuffer} indicesBuffer Indices WebGL buffer
|
|
57
|
+
* @property {import("../../transform.js").Transform} renderInstructionsTransform Converts world space coordinates to screen space; applies to the rendering instructions
|
|
58
|
+
* @property {import("../../transform.js").Transform} verticesBufferTransform Converts world space coordinates to screen space; applies to the webgl vertices buffer
|
|
59
|
+
* @property {import("../../transform.js").Transform} invertVerticesBufferTransform Screen space to world space; applies to the webgl vertices buffer
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* @classdesc This class is used to group several geometries of various types together for faster rendering.
|
|
63
|
+
* Three inner batches are maintained for polygons, lines and points. Each time a feature is added, changed or removed
|
|
64
|
+
* from the batch, these inner batches are modified accordingly in order to keep them up-to-date.
|
|
65
|
+
*
|
|
66
|
+
* A feature can be present in several inner batches, for example a polygon geometry will be present in the polygon batch
|
|
67
|
+
* and its linar rings will be present in the line batch. Multi geometries are also broken down into individual geometries
|
|
68
|
+
* and added to the corresponding batches in a recursive manner.
|
|
69
|
+
*
|
|
70
|
+
* Corresponding {@link module:ol/render/webgl/BatchRenderer} instances are then used to generate the render instructions
|
|
71
|
+
* and WebGL buffers (vertices and indices) for each inner batches; render instructions are stored on the inner batches,
|
|
72
|
+
* alongside the transform used to convert world coords to screen coords at the time these instructions were generated.
|
|
73
|
+
* The resulting WebGL buffers are stored on the batches as well.
|
|
74
|
+
*
|
|
75
|
+
* An important aspect of geometry batches is that there is no guarantee that render instructions and WebGL buffers
|
|
76
|
+
* are synchronized, i.e. render instructions can describe a new state while WebGL buffers might not have been written yet.
|
|
77
|
+
* This is why two world-to-screen transforms are stored on each batch: one for the render instructions and one for
|
|
78
|
+
* the WebGL buffers.
|
|
79
|
+
*/
|
|
80
|
+
var MixedGeometryBatch = /** @class */ (function () {
|
|
81
|
+
function MixedGeometryBatch() {
|
|
82
|
+
/**
|
|
83
|
+
* @type {PolygonGeometryBatch}
|
|
84
|
+
*/
|
|
85
|
+
this.polygonBatch = {
|
|
86
|
+
entries: {},
|
|
87
|
+
geometriesCount: 0,
|
|
88
|
+
verticesCount: 0,
|
|
89
|
+
ringsCount: 0,
|
|
90
|
+
renderInstructions: new Float32Array(0),
|
|
91
|
+
verticesBuffer: new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW),
|
|
92
|
+
indicesBuffer: new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW),
|
|
93
|
+
renderInstructionsTransform: createTransform(),
|
|
94
|
+
verticesBufferTransform: createTransform(),
|
|
95
|
+
invertVerticesBufferTransform: createTransform(),
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* @type {PointGeometryBatch}
|
|
99
|
+
*/
|
|
100
|
+
this.pointBatch = {
|
|
101
|
+
entries: {},
|
|
102
|
+
geometriesCount: 0,
|
|
103
|
+
renderInstructions: new Float32Array(0),
|
|
104
|
+
verticesBuffer: new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW),
|
|
105
|
+
indicesBuffer: new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW),
|
|
106
|
+
renderInstructionsTransform: createTransform(),
|
|
107
|
+
verticesBufferTransform: createTransform(),
|
|
108
|
+
invertVerticesBufferTransform: createTransform(),
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* @type {LineStringGeometryBatch}
|
|
112
|
+
*/
|
|
113
|
+
this.lineStringBatch = {
|
|
114
|
+
entries: {},
|
|
115
|
+
geometriesCount: 0,
|
|
116
|
+
verticesCount: 0,
|
|
117
|
+
renderInstructions: new Float32Array(0),
|
|
118
|
+
verticesBuffer: new WebGLArrayBuffer(ARRAY_BUFFER, DYNAMIC_DRAW),
|
|
119
|
+
indicesBuffer: new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW),
|
|
120
|
+
renderInstructionsTransform: createTransform(),
|
|
121
|
+
verticesBufferTransform: createTransform(),
|
|
122
|
+
invertVerticesBufferTransform: createTransform(),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @param {Array<import("../../Feature").default>} features Array of features to add to the batch
|
|
127
|
+
*/
|
|
128
|
+
MixedGeometryBatch.prototype.addFeatures = function (features) {
|
|
129
|
+
for (var i = 0; i < features.length; i++) {
|
|
130
|
+
this.addFeature(features[i]);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @param {import("../../Feature").default} feature Feature to add to the batch
|
|
135
|
+
*/
|
|
136
|
+
MixedGeometryBatch.prototype.addFeature = function (feature) {
|
|
137
|
+
var geometry = feature.getGeometry();
|
|
138
|
+
if (!geometry) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.addGeometry_(geometry, feature);
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* @param {import("../../Feature").default} feature Feature
|
|
145
|
+
* @return {GeometryBatchItem} Batch item added (or existing one)
|
|
146
|
+
* @private
|
|
147
|
+
*/
|
|
148
|
+
MixedGeometryBatch.prototype.addFeatureEntryInPointBatch_ = function (feature) {
|
|
149
|
+
var uid = getUid(feature);
|
|
150
|
+
if (!(uid in this.pointBatch.entries)) {
|
|
151
|
+
this.pointBatch.entries[uid] = {
|
|
152
|
+
feature: feature,
|
|
153
|
+
flatCoordss: [],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return this.pointBatch.entries[uid];
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* @param {import("../../Feature").default} feature Feature
|
|
160
|
+
* @return {GeometryBatchItem} Batch item added (or existing one)
|
|
161
|
+
* @private
|
|
162
|
+
*/
|
|
163
|
+
MixedGeometryBatch.prototype.addFeatureEntryInLineStringBatch_ = function (feature) {
|
|
164
|
+
var uid = getUid(feature);
|
|
165
|
+
if (!(uid in this.lineStringBatch.entries)) {
|
|
166
|
+
this.lineStringBatch.entries[uid] = {
|
|
167
|
+
feature: feature,
|
|
168
|
+
flatCoordss: [],
|
|
169
|
+
verticesCount: 0,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return this.lineStringBatch.entries[uid];
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* @param {import("../../Feature").default} feature Feature
|
|
176
|
+
* @return {GeometryBatchItem} Batch item added (or existing one)
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
MixedGeometryBatch.prototype.addFeatureEntryInPolygonBatch_ = function (feature) {
|
|
180
|
+
var uid = getUid(feature);
|
|
181
|
+
if (!(uid in this.polygonBatch.entries)) {
|
|
182
|
+
this.polygonBatch.entries[uid] = {
|
|
183
|
+
feature: feature,
|
|
184
|
+
flatCoordss: [],
|
|
185
|
+
verticesCount: 0,
|
|
186
|
+
ringsCount: 0,
|
|
187
|
+
ringsVerticesCounts: [],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return this.polygonBatch.entries[uid];
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* @param {import("../../Feature").default} feature Feature
|
|
194
|
+
* @private
|
|
195
|
+
*/
|
|
196
|
+
MixedGeometryBatch.prototype.clearFeatureEntryInPointBatch_ = function (feature) {
|
|
197
|
+
var entry = this.pointBatch.entries[getUid(feature)];
|
|
198
|
+
if (!entry) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
this.pointBatch.geometriesCount -= entry.flatCoordss.length;
|
|
202
|
+
delete this.pointBatch.entries[getUid(feature)];
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* @param {import("../../Feature").default} feature Feature
|
|
206
|
+
* @private
|
|
207
|
+
*/
|
|
208
|
+
MixedGeometryBatch.prototype.clearFeatureEntryInLineStringBatch_ = function (feature) {
|
|
209
|
+
var entry = this.lineStringBatch.entries[getUid(feature)];
|
|
210
|
+
if (!entry) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.lineStringBatch.verticesCount -= entry.verticesCount;
|
|
214
|
+
this.lineStringBatch.geometriesCount -= entry.flatCoordss.length;
|
|
215
|
+
delete this.lineStringBatch.entries[getUid(feature)];
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* @param {import("../../Feature").default} feature Feature
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
MixedGeometryBatch.prototype.clearFeatureEntryInPolygonBatch_ = function (feature) {
|
|
222
|
+
var entry = this.polygonBatch.entries[getUid(feature)];
|
|
223
|
+
if (!entry) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
this.polygonBatch.verticesCount -= entry.verticesCount;
|
|
227
|
+
this.polygonBatch.ringsCount -= entry.ringsCount;
|
|
228
|
+
this.polygonBatch.geometriesCount -= entry.flatCoordss.length;
|
|
229
|
+
delete this.polygonBatch.entries[getUid(feature)];
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* @param {import("../../geom").Geometry} geometry Geometry
|
|
233
|
+
* @param {import("../../Feature").default} feature Feature
|
|
234
|
+
* @private
|
|
235
|
+
*/
|
|
236
|
+
MixedGeometryBatch.prototype.addGeometry_ = function (geometry, feature) {
|
|
237
|
+
var _this = this;
|
|
238
|
+
var type = geometry.getType();
|
|
239
|
+
var flatCoords;
|
|
240
|
+
var verticesCount;
|
|
241
|
+
var batchEntry;
|
|
242
|
+
switch (type) {
|
|
243
|
+
case 'GeometryCollection':
|
|
244
|
+
/** @type {import("../../geom").GeometryCollection} */ (geometry)
|
|
245
|
+
.getGeometries()
|
|
246
|
+
.map(function (geom) { return _this.addGeometry_(geom, feature); });
|
|
247
|
+
break;
|
|
248
|
+
case 'MultiPolygon':
|
|
249
|
+
/** @type {import("../../geom").MultiPolygon} */ (geometry)
|
|
250
|
+
.getPolygons()
|
|
251
|
+
.map(function (polygon) { return _this.addGeometry_(polygon, feature); });
|
|
252
|
+
break;
|
|
253
|
+
case 'MultiLineString':
|
|
254
|
+
/** @type {import("../../geom").MultiLineString} */ (geometry)
|
|
255
|
+
.getLineStrings()
|
|
256
|
+
.map(function (line) { return _this.addGeometry_(line, feature); });
|
|
257
|
+
break;
|
|
258
|
+
case 'MultiPoint':
|
|
259
|
+
/** @type {import("../../geom").MultiPoint} */ (geometry)
|
|
260
|
+
.getPoints()
|
|
261
|
+
.map(function (point) { return _this.addGeometry_(point, feature); });
|
|
262
|
+
break;
|
|
263
|
+
case 'Polygon':
|
|
264
|
+
var polygonGeom = /** @type {import("../../geom").Polygon} */ (geometry);
|
|
265
|
+
batchEntry = this.addFeatureEntryInPolygonBatch_(feature);
|
|
266
|
+
flatCoords = polygonGeom.getFlatCoordinates();
|
|
267
|
+
verticesCount = flatCoords.length / 2;
|
|
268
|
+
var ringsCount = polygonGeom.getLinearRingCount();
|
|
269
|
+
var ringsVerticesCount = polygonGeom
|
|
270
|
+
.getEnds()
|
|
271
|
+
.map(function (end, ind, arr) {
|
|
272
|
+
return ind > 0 ? (end - arr[ind - 1]) / 2 : end / 2;
|
|
273
|
+
});
|
|
274
|
+
this.polygonBatch.verticesCount += verticesCount;
|
|
275
|
+
this.polygonBatch.ringsCount += ringsCount;
|
|
276
|
+
this.polygonBatch.geometriesCount++;
|
|
277
|
+
batchEntry.flatCoordss.push(flatCoords);
|
|
278
|
+
batchEntry.ringsVerticesCounts.push(ringsVerticesCount);
|
|
279
|
+
batchEntry.verticesCount += verticesCount;
|
|
280
|
+
batchEntry.ringsCount += ringsCount;
|
|
281
|
+
polygonGeom
|
|
282
|
+
.getLinearRings()
|
|
283
|
+
.map(function (ring) { return _this.addGeometry_(ring, feature); });
|
|
284
|
+
break;
|
|
285
|
+
case 'Point':
|
|
286
|
+
var pointGeom = /** @type {import("../../geom").Point} */ (geometry);
|
|
287
|
+
batchEntry = this.addFeatureEntryInPointBatch_(feature);
|
|
288
|
+
flatCoords = pointGeom.getFlatCoordinates();
|
|
289
|
+
this.pointBatch.geometriesCount++;
|
|
290
|
+
batchEntry.flatCoordss.push(flatCoords);
|
|
291
|
+
break;
|
|
292
|
+
case 'LineString':
|
|
293
|
+
case 'LinearRing':
|
|
294
|
+
var lineGeom = /** @type {import("../../geom").LineString} */ (geometry);
|
|
295
|
+
batchEntry = this.addFeatureEntryInLineStringBatch_(feature);
|
|
296
|
+
flatCoords = lineGeom.getFlatCoordinates();
|
|
297
|
+
verticesCount = flatCoords.length / 2;
|
|
298
|
+
this.lineStringBatch.verticesCount += verticesCount;
|
|
299
|
+
this.lineStringBatch.geometriesCount++;
|
|
300
|
+
batchEntry.flatCoordss.push(flatCoords);
|
|
301
|
+
batchEntry.verticesCount += verticesCount;
|
|
302
|
+
break;
|
|
303
|
+
default:
|
|
304
|
+
// pass
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* @param {import("../../Feature").default} feature Feature
|
|
309
|
+
*/
|
|
310
|
+
MixedGeometryBatch.prototype.changeFeature = function (feature) {
|
|
311
|
+
this.clearFeatureEntryInPointBatch_(feature);
|
|
312
|
+
this.clearFeatureEntryInPolygonBatch_(feature);
|
|
313
|
+
this.clearFeatureEntryInLineStringBatch_(feature);
|
|
314
|
+
var geometry = feature.getGeometry();
|
|
315
|
+
if (!geometry) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
this.addGeometry_(geometry, feature);
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* @param {import("../../Feature").default} feature Feature
|
|
322
|
+
*/
|
|
323
|
+
MixedGeometryBatch.prototype.removeFeature = function (feature) {
|
|
324
|
+
this.clearFeatureEntryInPointBatch_(feature);
|
|
325
|
+
this.clearFeatureEntryInPolygonBatch_(feature);
|
|
326
|
+
this.clearFeatureEntryInLineStringBatch_(feature);
|
|
327
|
+
};
|
|
328
|
+
MixedGeometryBatch.prototype.clear = function () {
|
|
329
|
+
this.polygonBatch.entries = {};
|
|
330
|
+
this.polygonBatch.geometriesCount = 0;
|
|
331
|
+
this.polygonBatch.verticesCount = 0;
|
|
332
|
+
this.polygonBatch.ringsCount = 0;
|
|
333
|
+
this.lineStringBatch.entries = {};
|
|
334
|
+
this.lineStringBatch.geometriesCount = 0;
|
|
335
|
+
this.lineStringBatch.verticesCount = 0;
|
|
336
|
+
this.pointBatch.entries = {};
|
|
337
|
+
this.pointBatch.geometriesCount = 0;
|
|
338
|
+
};
|
|
339
|
+
return MixedGeometryBatch;
|
|
340
|
+
}());
|
|
341
|
+
export default MixedGeometryBatch;
|
|
342
|
+
//# sourceMappingURL=MixedGeometryBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MixedGeometryBatch.js","sourceRoot":"","sources":["../../src/render/webgl/MixedGeometryBatch.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAC,MAAM,IAAI,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAErC;;;;;;;GAOG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACE;QACE;;WAEG;QACH,IAAI,CAAC,YAAY,GAA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