@gmgis/gm-sdk 1.12.5 → 2.0.2

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.
Files changed (159) hide show
  1. package/dist/dist/index.js +1848 -0
  2. package/dist/gm.min.js +16983 -16483
  3. package/dist/index.js +1436 -1434
  4. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  5. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  7. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  8. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  9. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  10. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  11. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  12. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  13. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  14. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  15. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  16. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  17. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  18. package/dist/resources/Workers/{chunk-I2ITFFPX.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-PRGYLLJT.js → chunk-ARG42DC4.js} +2 -31
  21. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  22. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  23. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  24. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  25. package/dist/resources/Workers/{chunk-DI5NGJUP.js → chunk-D6AA5QVT.js} +2 -20
  26. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  27. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  28. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  29. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  30. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  31. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  32. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  33. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  34. package/dist/resources/Workers/{chunk-7JO7GPJN.js → chunk-GBYLG25F.js} +2 -15
  35. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  36. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  37. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  38. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  39. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  40. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  41. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  42. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  43. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  44. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  45. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  46. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  47. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  48. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  49. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  50. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  51. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  52. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  53. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  54. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  55. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  56. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  57. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  58. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  59. package/dist/resources/Workers/{chunk-6CHGCNMW.js → chunk-WZDE3RYP.js} +4 -34
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -40
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -32
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -209
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -175
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -121
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -481
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -199
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1237
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -542
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -34
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -205
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -45
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -38
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -33
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -35
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -32
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -210
  78. package/dist/resources/Workers/createGeometry.js +2 -144
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1582
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -198
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -98
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1381
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -509
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -470
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -354
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -251
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1246
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -453
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -374
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -92
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -92
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -466
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -361
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -359
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -236
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -539
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2252
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -729
  101. package/dist/resources/Workers/createWallGeometry.js +2 -464
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -312
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2642
  105. package/dist/resources/Workers/decodeI3S.js +2 -1319
  106. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  107. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  108. package/dist/resources/Workers/transcodeKTX2.js +29 -3360
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -793
  111. package/package.json +74 -74
  112. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  113. package/dist/resources/Workers/chunk-26GA3JAM.js +0 -139
  114. package/dist/resources/Workers/chunk-27HUZ7SA.js +0 -305
  115. package/dist/resources/Workers/chunk-2ZGOQXYU.js +0 -171
  116. package/dist/resources/Workers/chunk-3Q2L65QU.js +0 -1258
  117. package/dist/resources/Workers/chunk-472HQ3EH.js +0 -100
  118. package/dist/resources/Workers/chunk-5ODQSF26.js +0 -101
  119. package/dist/resources/Workers/chunk-5OOFQLKF.js +0 -634
  120. package/dist/resources/Workers/chunk-5PTXS2GO.js +0 -10390
  121. package/dist/resources/Workers/chunk-76BYBWHP.js +0 -122
  122. package/dist/resources/Workers/chunk-7BMOHCPM.js +0 -390
  123. package/dist/resources/Workers/chunk-7KTQP4VB.js +0 -59
  124. package/dist/resources/Workers/chunk-7O373FFS.js +0 -665
  125. package/dist/resources/Workers/chunk-AD63PIY6.js +0 -163
  126. package/dist/resources/Workers/chunk-BHQJ2NT7.js +0 -353
  127. package/dist/resources/Workers/chunk-C6YYBQXW.js +0 -102
  128. package/dist/resources/Workers/chunk-CKY7HOHV.js +0 -287
  129. package/dist/resources/Workers/chunk-DHYHSFFJ.js +0 -73
  130. package/dist/resources/Workers/chunk-E27BLMDD.js +0 -115
  131. package/dist/resources/Workers/chunk-E63IIM5T.js +0 -75
  132. package/dist/resources/Workers/chunk-E6V6SQZW.js +0 -456
  133. package/dist/resources/Workers/chunk-EJZTDTUH.js +0 -138
  134. package/dist/resources/Workers/chunk-FDOV2LBJ.js +0 -220
  135. package/dist/resources/Workers/chunk-FIGIZHAQ.js +0 -684
  136. package/dist/resources/Workers/chunk-GESF4OXQ.js +0 -1800
  137. package/dist/resources/Workers/chunk-GGZJN2TI.js +0 -2717
  138. package/dist/resources/Workers/chunk-GNBFYG7F.js +0 -1481
  139. package/dist/resources/Workers/chunk-GWCFU2SA.js +0 -300
  140. package/dist/resources/Workers/chunk-IBLIYJZR.js +0 -196
  141. package/dist/resources/Workers/chunk-JW4FOI6M.js +0 -476
  142. package/dist/resources/Workers/chunk-K4GQUNB5.js +0 -262
  143. package/dist/resources/Workers/chunk-M3GMB5OP.js +0 -834
  144. package/dist/resources/Workers/chunk-MXIZJAPH.js +0 -629
  145. package/dist/resources/Workers/chunk-N5KJGGCM.js +0 -1073
  146. package/dist/resources/Workers/chunk-NGPPMXRM.js +0 -435
  147. package/dist/resources/Workers/chunk-O3E4OAOE.js +0 -511
  148. package/dist/resources/Workers/chunk-PGRPDNHG.js +0 -1048
  149. package/dist/resources/Workers/chunk-S6MRMMQU.js +0 -157
  150. package/dist/resources/Workers/chunk-SMDOP47J.js +0 -945
  151. package/dist/resources/Workers/chunk-TGONEMZO.js +0 -421
  152. package/dist/resources/Workers/chunk-TKVT5GQM.js +0 -781
  153. package/dist/resources/Workers/chunk-U72QNFOJ.js +0 -758
  154. package/dist/resources/Workers/chunk-VJZB3WAV.js +0 -963
  155. package/dist/resources/Workers/chunk-VU2MNO7L.js +0 -239
  156. package/dist/resources/Workers/chunk-XY4BATBS.js +0 -500
  157. package/dist/resources/Workers/chunk-YFXQECWV.js +0 -2857
  158. package/dist/resources/Workers/chunk-YSGTGQQO.js +0 -398
  159. package/dist/resources/Workers/chunk-YZ733KKS.js +0 -368
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,455 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- RectangleGeometryLibrary_default
28
- } from "./chunk-VU2MNO7L.js";
29
- import {
30
- GeometryOffsetAttribute_default
31
- } from "./chunk-I2ITFFPX.js";
32
- import {
33
- PolygonPipeline_default
34
- } from "./chunk-SMDOP47J.js";
35
- import "./chunk-E6V6SQZW.js";
36
- import {
37
- IndexDatatype_default
38
- } from "./chunk-26GA3JAM.js";
39
- import {
40
- GeometryAttributes_default
41
- } from "./chunk-DI5NGJUP.js";
42
- import {
43
- GeometryAttribute_default,
44
- Geometry_default,
45
- PrimitiveType_default
46
- } from "./chunk-GWCFU2SA.js";
47
- import {
48
- BoundingSphere_default
49
- } from "./chunk-VJZB3WAV.js";
50
- import {
51
- Rectangle_default
52
- } from "./chunk-5PTXS2GO.js";
53
- import {
54
- ComponentDatatype_default
55
- } from "./chunk-K4GQUNB5.js";
56
- import {
57
- Cartesian3_default,
58
- Cartographic_default,
59
- Ellipsoid_default
60
- } from "./chunk-YFXQECWV.js";
61
- import {
62
- Math_default
63
- } from "./chunk-XY4BATBS.js";
64
- import "./chunk-MXIZJAPH.js";
65
- import "./chunk-6CHGCNMW.js";
66
- import {
67
- defaultValue_default
68
- } from "./chunk-7JO7GPJN.js";
69
- import {
70
- DeveloperError_default
71
- } from "./chunk-AD63PIY6.js";
72
- import {
73
- defined_default
74
- } from "./chunk-E63IIM5T.js";
75
-
76
- // packages/engine/Source/Core/RectangleOutlineGeometry.js
77
- var bottomBoundingSphere = new BoundingSphere_default();
78
- var topBoundingSphere = new BoundingSphere_default();
79
- var positionScratch = new Cartesian3_default();
80
- var rectangleScratch = new Rectangle_default();
81
- function constructRectangle(geometry, computedOptions) {
82
- const ellipsoid = geometry._ellipsoid;
83
- const height = computedOptions.height;
84
- const width = computedOptions.width;
85
- const northCap = computedOptions.northCap;
86
- const southCap = computedOptions.southCap;
87
- let rowHeight = height;
88
- let widthMultiplier = 2;
89
- let size = 0;
90
- let corners = 4;
91
- if (northCap) {
92
- widthMultiplier -= 1;
93
- rowHeight -= 1;
94
- size += 1;
95
- corners -= 2;
96
- }
97
- if (southCap) {
98
- widthMultiplier -= 1;
99
- rowHeight -= 1;
100
- size += 1;
101
- corners -= 2;
102
- }
103
- size += widthMultiplier * width + 2 * rowHeight - corners;
104
- const positions = new Float64Array(size * 3);
105
- let posIndex = 0;
106
- let row = 0;
107
- let col;
108
- const position = positionScratch;
109
- if (northCap) {
110
- RectangleGeometryLibrary_default.computePosition(
111
- computedOptions,
112
- ellipsoid,
113
- false,
114
- row,
115
- 0,
116
- position
117
- );
118
- positions[posIndex++] = position.x;
119
- positions[posIndex++] = position.y;
120
- positions[posIndex++] = position.z;
121
- } else {
122
- for (col = 0; col < width; col++) {
123
- RectangleGeometryLibrary_default.computePosition(
124
- computedOptions,
125
- ellipsoid,
126
- false,
127
- row,
128
- col,
129
- position
130
- );
131
- positions[posIndex++] = position.x;
132
- positions[posIndex++] = position.y;
133
- positions[posIndex++] = position.z;
134
- }
135
- }
136
- col = width - 1;
137
- for (row = 1; row < height; row++) {
138
- RectangleGeometryLibrary_default.computePosition(
139
- computedOptions,
140
- ellipsoid,
141
- false,
142
- row,
143
- col,
144
- position
145
- );
146
- positions[posIndex++] = position.x;
147
- positions[posIndex++] = position.y;
148
- positions[posIndex++] = position.z;
149
- }
150
- row = height - 1;
151
- if (!southCap) {
152
- for (col = width - 2; col >= 0; col--) {
153
- RectangleGeometryLibrary_default.computePosition(
154
- computedOptions,
155
- ellipsoid,
156
- false,
157
- row,
158
- col,
159
- position
160
- );
161
- positions[posIndex++] = position.x;
162
- positions[posIndex++] = position.y;
163
- positions[posIndex++] = position.z;
164
- }
165
- }
166
- col = 0;
167
- for (row = height - 2; row > 0; row--) {
168
- RectangleGeometryLibrary_default.computePosition(
169
- computedOptions,
170
- ellipsoid,
171
- false,
172
- row,
173
- col,
174
- position
175
- );
176
- positions[posIndex++] = position.x;
177
- positions[posIndex++] = position.y;
178
- positions[posIndex++] = position.z;
179
- }
180
- const indicesSize = positions.length / 3 * 2;
181
- const indices = IndexDatatype_default.createTypedArray(
182
- positions.length / 3,
183
- indicesSize
184
- );
185
- let index = 0;
186
- for (let i = 0; i < positions.length / 3 - 1; i++) {
187
- indices[index++] = i;
188
- indices[index++] = i + 1;
189
- }
190
- indices[index++] = positions.length / 3 - 1;
191
- indices[index++] = 0;
192
- const geo = new Geometry_default({
193
- attributes: new GeometryAttributes_default(),
194
- primitiveType: PrimitiveType_default.LINES
195
- });
196
- geo.attributes.position = new GeometryAttribute_default({
197
- componentDatatype: ComponentDatatype_default.DOUBLE,
198
- componentsPerAttribute: 3,
199
- values: positions
200
- });
201
- geo.indices = indices;
202
- return geo;
203
- }
204
- function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
205
- const maxHeight = rectangleGeometry._surfaceHeight;
206
- const minHeight = rectangleGeometry._extrudedHeight;
207
- const ellipsoid = rectangleGeometry._ellipsoid;
208
- const geo = constructRectangle(rectangleGeometry, computedOptions);
209
- const height = computedOptions.height;
210
- const width = computedOptions.width;
211
- const topPositions = PolygonPipeline_default.scaleToGeodeticHeight(
212
- geo.attributes.position.values,
213
- maxHeight,
214
- ellipsoid,
215
- false
216
- );
217
- let length = topPositions.length;
218
- const positions = new Float64Array(length * 2);
219
- positions.set(topPositions);
220
- const bottomPositions = PolygonPipeline_default.scaleToGeodeticHeight(
221
- geo.attributes.position.values,
222
- minHeight,
223
- ellipsoid
224
- );
225
- positions.set(bottomPositions, length);
226
- geo.attributes.position.values = positions;
227
- const northCap = computedOptions.northCap;
228
- const southCap = computedOptions.southCap;
229
- let corners = 4;
230
- if (northCap) {
231
- corners -= 1;
232
- }
233
- if (southCap) {
234
- corners -= 1;
235
- }
236
- const indicesSize = (positions.length / 3 + corners) * 2;
237
- const indices = IndexDatatype_default.createTypedArray(
238
- positions.length / 3,
239
- indicesSize
240
- );
241
- length = positions.length / 6;
242
- let index = 0;
243
- for (let i = 0; i < length - 1; i++) {
244
- indices[index++] = i;
245
- indices[index++] = i + 1;
246
- indices[index++] = i + length;
247
- indices[index++] = i + length + 1;
248
- }
249
- indices[index++] = length - 1;
250
- indices[index++] = 0;
251
- indices[index++] = length + length - 1;
252
- indices[index++] = length;
253
- indices[index++] = 0;
254
- indices[index++] = length;
255
- let bottomCorner;
256
- if (northCap) {
257
- bottomCorner = height - 1;
258
- } else {
259
- const topRightCorner = width - 1;
260
- indices[index++] = topRightCorner;
261
- indices[index++] = topRightCorner + length;
262
- bottomCorner = width + height - 2;
263
- }
264
- indices[index++] = bottomCorner;
265
- indices[index++] = bottomCorner + length;
266
- if (!southCap) {
267
- const bottomLeftCorner = width + bottomCorner - 1;
268
- indices[index++] = bottomLeftCorner;
269
- indices[index] = bottomLeftCorner + length;
270
- }
271
- geo.indices = indices;
272
- return geo;
273
- }
274
- function RectangleOutlineGeometry(options) {
275
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
276
- const rectangle = options.rectangle;
277
- const granularity = defaultValue_default(
278
- options.granularity,
279
- Math_default.RADIANS_PER_DEGREE
280
- );
281
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.default);
282
- const rotation = defaultValue_default(options.rotation, 0);
283
- if (!defined_default(rectangle)) {
284
- throw new DeveloperError_default("rectangle is required.");
285
- }
286
- Rectangle_default._validate(rectangle);
287
- if (rectangle.north < rectangle.south) {
288
- throw new DeveloperError_default(
289
- "options.rectangle.north must be greater than options.rectangle.south"
290
- );
291
- }
292
- const height = defaultValue_default(options.height, 0);
293
- const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
294
- this._rectangle = Rectangle_default.clone(rectangle);
295
- this._granularity = granularity;
296
- this._ellipsoid = ellipsoid;
297
- this._surfaceHeight = Math.max(height, extrudedHeight);
298
- this._rotation = rotation;
299
- this._extrudedHeight = Math.min(height, extrudedHeight);
300
- this._offsetAttribute = options.offsetAttribute;
301
- this._workerName = "createRectangleOutlineGeometry";
302
- }
303
- RectangleOutlineGeometry.packedLength = Rectangle_default.packedLength + Ellipsoid_default.packedLength + 5;
304
- RectangleOutlineGeometry.pack = function(value, array, startingIndex) {
305
- if (!defined_default(value)) {
306
- throw new DeveloperError_default("value is required");
307
- }
308
- if (!defined_default(array)) {
309
- throw new DeveloperError_default("array is required");
310
- }
311
- startingIndex = defaultValue_default(startingIndex, 0);
312
- Rectangle_default.pack(value._rectangle, array, startingIndex);
313
- startingIndex += Rectangle_default.packedLength;
314
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
315
- startingIndex += Ellipsoid_default.packedLength;
316
- array[startingIndex++] = value._granularity;
317
- array[startingIndex++] = value._surfaceHeight;
318
- array[startingIndex++] = value._rotation;
319
- array[startingIndex++] = value._extrudedHeight;
320
- array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
321
- return array;
322
- };
323
- var scratchRectangle = new Rectangle_default();
324
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
325
- var scratchOptions = {
326
- rectangle: scratchRectangle,
327
- ellipsoid: scratchEllipsoid,
328
- granularity: void 0,
329
- height: void 0,
330
- rotation: void 0,
331
- extrudedHeight: void 0,
332
- offsetAttribute: void 0
333
- };
334
- RectangleOutlineGeometry.unpack = function(array, startingIndex, result) {
335
- if (!defined_default(array)) {
336
- throw new DeveloperError_default("array is required");
337
- }
338
- startingIndex = defaultValue_default(startingIndex, 0);
339
- const rectangle = Rectangle_default.unpack(array, startingIndex, scratchRectangle);
340
- startingIndex += Rectangle_default.packedLength;
341
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
342
- startingIndex += Ellipsoid_default.packedLength;
343
- const granularity = array[startingIndex++];
344
- const height = array[startingIndex++];
345
- const rotation = array[startingIndex++];
346
- const extrudedHeight = array[startingIndex++];
347
- const offsetAttribute = array[startingIndex];
348
- if (!defined_default(result)) {
349
- scratchOptions.granularity = granularity;
350
- scratchOptions.height = height;
351
- scratchOptions.rotation = rotation;
352
- scratchOptions.extrudedHeight = extrudedHeight;
353
- scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
354
- return new RectangleOutlineGeometry(scratchOptions);
355
- }
356
- result._rectangle = Rectangle_default.clone(rectangle, result._rectangle);
357
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
358
- result._surfaceHeight = height;
359
- result._rotation = rotation;
360
- result._extrudedHeight = extrudedHeight;
361
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
362
- return result;
363
- };
364
- var nwScratch = new Cartographic_default();
365
- RectangleOutlineGeometry.createGeometry = function(rectangleGeometry) {
366
- const rectangle = rectangleGeometry._rectangle;
367
- const ellipsoid = rectangleGeometry._ellipsoid;
368
- const computedOptions = RectangleGeometryLibrary_default.computeOptions(
369
- rectangle,
370
- rectangleGeometry._granularity,
371
- rectangleGeometry._rotation,
372
- 0,
373
- rectangleScratch,
374
- nwScratch
375
- );
376
- let geometry;
377
- let boundingSphere;
378
- if (Math_default.equalsEpsilon(
379
- rectangle.north,
380
- rectangle.south,
381
- Math_default.EPSILON10
382
- ) || Math_default.equalsEpsilon(
383
- rectangle.east,
384
- rectangle.west,
385
- Math_default.EPSILON10
386
- )) {
387
- return void 0;
388
- }
389
- const surfaceHeight = rectangleGeometry._surfaceHeight;
390
- const extrudedHeight = rectangleGeometry._extrudedHeight;
391
- const extrude = !Math_default.equalsEpsilon(
392
- surfaceHeight,
393
- extrudedHeight,
394
- 0,
395
- Math_default.EPSILON2
396
- );
397
- let offsetValue;
398
- if (extrude) {
399
- geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
400
- if (defined_default(rectangleGeometry._offsetAttribute)) {
401
- const size = geometry.attributes.position.values.length / 3;
402
- let offsetAttribute = new Uint8Array(size);
403
- if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
404
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
405
- } else {
406
- offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
407
- offsetAttribute = offsetAttribute.fill(offsetValue);
408
- }
409
- geometry.attributes.applyOffset = new GeometryAttribute_default({
410
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
411
- componentsPerAttribute: 1,
412
- values: offsetAttribute
413
- });
414
- }
415
- const topBS = BoundingSphere_default.fromRectangle3D(
416
- rectangle,
417
- ellipsoid,
418
- surfaceHeight,
419
- topBoundingSphere
420
- );
421
- const bottomBS = BoundingSphere_default.fromRectangle3D(
422
- rectangle,
423
- ellipsoid,
424
- extrudedHeight,
425
- bottomBoundingSphere
426
- );
427
- boundingSphere = BoundingSphere_default.union(topBS, bottomBS);
428
- } else {
429
- geometry = constructRectangle(rectangleGeometry, computedOptions);
430
- geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
431
- geometry.attributes.position.values,
432
- surfaceHeight,
433
- ellipsoid,
434
- false
435
- );
436
- if (defined_default(rectangleGeometry._offsetAttribute)) {
437
- const length = geometry.attributes.position.values.length;
438
- offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
439
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
440
- geometry.attributes.applyOffset = new GeometryAttribute_default({
441
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
442
- componentsPerAttribute: 1,
443
- values: applyOffset
444
- });
445
- }
446
- boundingSphere = BoundingSphere_default.fromRectangle3D(
447
- rectangle,
448
- ellipsoid,
449
- surfaceHeight
450
- );
451
- }
452
- return new Geometry_default({
453
- attributes: geometry.attributes,
454
- indices: geometry.indices,
455
- primitiveType: PrimitiveType_default.LINES,
456
- boundingSphere,
457
- offsetAttribute: rectangleGeometry._offsetAttribute
458
- });
459
- };
460
- var RectangleOutlineGeometry_default = RectangleOutlineGeometry;
461
-
462
- // packages/engine/Source/Workers/createRectangleOutlineGeometry.js
463
- function createRectangleOutlineGeometry(rectangleGeometry, offset) {
464
- if (defined_default(offset)) {
465
- rectangleGeometry = RectangleOutlineGeometry_default.unpack(
466
- rectangleGeometry,
467
- offset
468
- );
469
- }
470
- rectangleGeometry._ellipsoid = Ellipsoid_default.clone(rectangleGeometry._ellipsoid);
471
- rectangleGeometry._rectangle = Rectangle_default.clone(rectangleGeometry._rectangle);
472
- return RectangleOutlineGeometry_default.createGeometry(rectangleGeometry);
473
- }
474
- var createRectangleOutlineGeometry_default = createRectangleOutlineGeometry;
475
- export {
476
- createRectangleOutlineGeometry_default as default
477
- };
26
+ import{a as R}from"./chunk-5YEWO3HT.js";import{a as y}from"./chunk-GBYLG25F.js";import{b as z}from"./chunk-77IHZJJ3.js";import"./chunk-G5AGHVVC.js";import{a as q}from"./chunk-OFUUQVMR.js";import{a as F}from"./chunk-A56XVLQR.js";import{b as v,c as B,d as T}from"./chunk-RCV6KWXS.js";import{d as P}from"./chunk-4IW2T6GF.js";import{h as b}from"./chunk-PSPPBZWI.js";import{a as D}from"./chunk-AU7IKHOH.js";import{a as x,b as U,d as w,f as M}from"./chunk-64RSHJUE.js";import{a as S}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as C}from"./chunk-LEYMRMBK.js";import{e as H}from"./chunk-VTAIKJXX.js";var j=new P,K=new P,Q=new x,W=new b;function Y(t,e){let i=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,p=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),p&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;let n=new Float64Array(o*3),l=0,f=0,a,r=Q;if(h)R.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;else for(a=0;a<s;a++)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(a=s-1,f=1;f<m;f++)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!p)for(a=s-2;a>=0;a--)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(a=0,f=m-2;f>0;f--)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;let u=n.length/3*2,c=q.createTypedArray(n.length/3,u),E=0;for(let L=0;L<n.length/3-1;L++)c[E++]=L,c[E++]=L+1;c[E++]=n.length/3-1,c[E++]=0;let d=new B({attributes:new F,primitiveType:v.LINES});return d.attributes.position=new T({componentDatatype:D.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}function X(t,e){let i=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=Y(t,e),p=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=new Float64Array(o*2);g.set(A);let n=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;let l=e.northCap,f=e.southCap,a=4;l&&(a-=1),f&&(a-=1);let r=(g.length/3+a)*2,u=q.createTypedArray(g.length/3,r);o=g.length/6;let c=0;for(let d=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;let E;if(l)E=p-1;else{let d=_-1;u[c++]=d,u[c++]=d+o,E=_+p-2}if(u[c++]=E,u[c++]=E+o,!f){let d=_+E-1;u[c++]=d,u[c]=d+o}return h.indices=u,h}function k(t){t=t??M.EMPTY_OBJECT;let e=t.rectangle,i=t.granularity??S.RADIANS_PER_DEGREE,m=t.ellipsoid??w.default,s=t.rotation??0;if(!H(e))throw new C("rectangle is required.");if(b._validate(e),e.north<e.south)throw new C("options.rectangle.north must be greater than options.rectangle.south");let h=t.height??0,p=t.extrudedHeight??h;this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,p),this._rotation=s,this._extrudedHeight=Math.min(h,p),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}k.packedLength=b.packedLength+w.packedLength+5;k.pack=function(t,e,i){if(!H(t))throw new C("value is required");if(!H(e))throw new C("array is required");return i=i??0,b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=t._offsetAttribute??-1,e};var J=new b,V=w.clone(w.UNIT_SPHERE),N={rectangle:J,ellipsoid:V,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};k.unpack=function(t,e,i){if(!H(t))throw new C("array is required");e=e??0;let m=b.unpack(t,e,J);e+=b.packedLength;let s=w.unpack(t,e,V);e+=w.packedLength;let h=t[e++],p=t[e++],_=t[e++],A=t[e++],o=t[e];return H(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=p,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void 0:o,i):(N.granularity=h,N.height=p,N.rotation=_,N.extrudedHeight=A,N.offsetAttribute=o===-1?void 0:o,new k(N))};var Z=new U;k.createGeometry=function(t){let e=t._rectangle,i=t._ellipsoid,m=R.computeOptions(e,t._granularity,t._rotation,0,W,Z),s,h;if(S.equalsEpsilon(e.north,e.south,S.EPSILON10)||S.equalsEpsilon(e.east,e.west,S.EPSILON10))return;let p=t._surfaceHeight,_=t._extrudedHeight,A=!S.equalsEpsilon(p,_,0,S.EPSILON2),o;if(A){if(s=X(t,m),H(t._offsetAttribute)){let l=s.attributes.position.values.length/3,f=new Uint8Array(l);t._offsetAttribute===y.TOP?f=f.fill(1,0,l/2):(o=t._offsetAttribute===y.NONE?0:1,f=f.fill(o)),s.attributes.applyOffset=new T({componentDatatype:D.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let g=P.fromRectangle3D(e,i,p,K),n=P.fromRectangle3D(e,i,_,j);h=P.union(g,n)}else{if(s=Y(t,m),s.attributes.position.values=z.scaleToGeodeticHeight(s.attributes.position.values,p,i,!1),H(t._offsetAttribute)){let g=s.attributes.position.values.length;o=t._offsetAttribute===y.NONE?0:1;let n=new Uint8Array(g/3).fill(o);s.attributes.applyOffset=new T({componentDatatype:D.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}h=P.fromRectangle3D(e,i,p)}return new B({attributes:s.attributes,indices:s.indices,primitiveType:v.LINES,boundingSphere:h,offsetAttribute:t._offsetAttribute})};var O=k;function $(t,e){return H(e)&&(t=O.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),t._rectangle=b.clone(t._rectangle),O.createGeometry(t)}var Et=$;export{Et as default};