@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,472 +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
- Color_default
28
- } from "./chunk-5OOFQLKF.js";
29
- import {
30
- ArcType_default
31
- } from "./chunk-PRGYLLJT.js";
32
- import {
33
- PolylinePipeline_default
34
- } from "./chunk-TGONEMZO.js";
35
- import "./chunk-BHQJ2NT7.js";
36
- import {
37
- VertexFormat_default
38
- } from "./chunk-EJZTDTUH.js";
39
- import {
40
- arrayRemoveDuplicates_default
41
- } from "./chunk-472HQ3EH.js";
42
- import "./chunk-E6V6SQZW.js";
43
- import "./chunk-3Q2L65QU.js";
44
- import "./chunk-2ZGOQXYU.js";
45
- import {
46
- IndexDatatype_default
47
- } from "./chunk-26GA3JAM.js";
48
- import {
49
- GeometryAttributes_default
50
- } from "./chunk-DI5NGJUP.js";
51
- import {
52
- GeometryAttribute_default,
53
- GeometryType_default,
54
- Geometry_default,
55
- PrimitiveType_default
56
- } from "./chunk-GWCFU2SA.js";
57
- import {
58
- BoundingSphere_default
59
- } from "./chunk-VJZB3WAV.js";
60
- import "./chunk-5PTXS2GO.js";
61
- import {
62
- ComponentDatatype_default
63
- } from "./chunk-K4GQUNB5.js";
64
- import {
65
- Cartesian3_default,
66
- Ellipsoid_default
67
- } from "./chunk-YFXQECWV.js";
68
- import {
69
- Math_default
70
- } from "./chunk-XY4BATBS.js";
71
- import "./chunk-MXIZJAPH.js";
72
- import "./chunk-6CHGCNMW.js";
73
- import {
74
- defaultValue_default
75
- } from "./chunk-7JO7GPJN.js";
76
- import {
77
- DeveloperError_default
78
- } from "./chunk-AD63PIY6.js";
79
- import {
80
- defined_default
81
- } from "./chunk-E63IIM5T.js";
82
-
83
- // packages/engine/Source/Core/PolylineGeometry.js
84
- var scratchInterpolateColorsArray = [];
85
- function interpolateColors(p0, p1, color0, color1, numPoints) {
86
- const colors = scratchInterpolateColorsArray;
87
- colors.length = numPoints;
88
- let i;
89
- const r0 = color0.red;
90
- const g0 = color0.green;
91
- const b0 = color0.blue;
92
- const a0 = color0.alpha;
93
- const r1 = color1.red;
94
- const g1 = color1.green;
95
- const b1 = color1.blue;
96
- const a1 = color1.alpha;
97
- if (Color_default.equals(color0, color1)) {
98
- for (i = 0; i < numPoints; i++) {
99
- colors[i] = Color_default.clone(color0);
100
- }
101
- return colors;
102
- }
103
- const redPerVertex = (r1 - r0) / numPoints;
104
- const greenPerVertex = (g1 - g0) / numPoints;
105
- const bluePerVertex = (b1 - b0) / numPoints;
106
- const alphaPerVertex = (a1 - a0) / numPoints;
107
- for (i = 0; i < numPoints; i++) {
108
- colors[i] = new Color_default(
109
- r0 + i * redPerVertex,
110
- g0 + i * greenPerVertex,
111
- b0 + i * bluePerVertex,
112
- a0 + i * alphaPerVertex
113
- );
114
- }
115
- return colors;
116
- }
117
- function PolylineGeometry(options) {
118
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
119
- const positions = options.positions;
120
- const colors = options.colors;
121
- const width = defaultValue_default(options.width, 1);
122
- const colorsPerVertex = defaultValue_default(options.colorsPerVertex, false);
123
- if (!defined_default(positions) || positions.length < 2) {
124
- throw new DeveloperError_default("At least two positions are required.");
125
- }
126
- if (typeof width !== "number") {
127
- throw new DeveloperError_default("width must be a number");
128
- }
129
- if (defined_default(colors) && (colorsPerVertex && colors.length < positions.length || !colorsPerVertex && colors.length < positions.length - 1)) {
130
- throw new DeveloperError_default("colors has an invalid length.");
131
- }
132
- this._positions = positions;
133
- this._colors = colors;
134
- this._width = width;
135
- this._colorsPerVertex = colorsPerVertex;
136
- this._vertexFormat = VertexFormat_default.clone(
137
- defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
138
- );
139
- this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
140
- this._granularity = defaultValue_default(
141
- options.granularity,
142
- Math_default.RADIANS_PER_DEGREE
143
- );
144
- this._ellipsoid = Ellipsoid_default.clone(
145
- defaultValue_default(options.ellipsoid, Ellipsoid_default.default)
146
- );
147
- this._workerName = "createPolylineGeometry";
148
- let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
149
- numComponents += defined_default(colors) ? 1 + colors.length * Color_default.packedLength : 1;
150
- this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 4;
151
- }
152
- PolylineGeometry.pack = function(value, array, startingIndex) {
153
- if (!defined_default(value)) {
154
- throw new DeveloperError_default("value is required");
155
- }
156
- if (!defined_default(array)) {
157
- throw new DeveloperError_default("array is required");
158
- }
159
- startingIndex = defaultValue_default(startingIndex, 0);
160
- let i;
161
- const positions = value._positions;
162
- let length = positions.length;
163
- array[startingIndex++] = length;
164
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
165
- Cartesian3_default.pack(positions[i], array, startingIndex);
166
- }
167
- const colors = value._colors;
168
- length = defined_default(colors) ? colors.length : 0;
169
- array[startingIndex++] = length;
170
- for (i = 0; i < length; ++i, startingIndex += Color_default.packedLength) {
171
- Color_default.pack(colors[i], array, startingIndex);
172
- }
173
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
174
- startingIndex += Ellipsoid_default.packedLength;
175
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
176
- startingIndex += VertexFormat_default.packedLength;
177
- array[startingIndex++] = value._width;
178
- array[startingIndex++] = value._colorsPerVertex ? 1 : 0;
179
- array[startingIndex++] = value._arcType;
180
- array[startingIndex] = value._granularity;
181
- return array;
182
- };
183
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
184
- var scratchVertexFormat = new VertexFormat_default();
185
- var scratchOptions = {
186
- positions: void 0,
187
- colors: void 0,
188
- ellipsoid: scratchEllipsoid,
189
- vertexFormat: scratchVertexFormat,
190
- width: void 0,
191
- colorsPerVertex: void 0,
192
- arcType: void 0,
193
- granularity: void 0
194
- };
195
- PolylineGeometry.unpack = function(array, startingIndex, result) {
196
- if (!defined_default(array)) {
197
- throw new DeveloperError_default("array is required");
198
- }
199
- startingIndex = defaultValue_default(startingIndex, 0);
200
- let i;
201
- let length = array[startingIndex++];
202
- const positions = new Array(length);
203
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
204
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
205
- }
206
- length = array[startingIndex++];
207
- const colors = length > 0 ? new Array(length) : void 0;
208
- for (i = 0; i < length; ++i, startingIndex += Color_default.packedLength) {
209
- colors[i] = Color_default.unpack(array, startingIndex);
210
- }
211
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
212
- startingIndex += Ellipsoid_default.packedLength;
213
- const vertexFormat = VertexFormat_default.unpack(
214
- array,
215
- startingIndex,
216
- scratchVertexFormat
217
- );
218
- startingIndex += VertexFormat_default.packedLength;
219
- const width = array[startingIndex++];
220
- const colorsPerVertex = array[startingIndex++] === 1;
221
- const arcType = array[startingIndex++];
222
- const granularity = array[startingIndex];
223
- if (!defined_default(result)) {
224
- scratchOptions.positions = positions;
225
- scratchOptions.colors = colors;
226
- scratchOptions.width = width;
227
- scratchOptions.colorsPerVertex = colorsPerVertex;
228
- scratchOptions.arcType = arcType;
229
- scratchOptions.granularity = granularity;
230
- return new PolylineGeometry(scratchOptions);
231
- }
232
- result._positions = positions;
233
- result._colors = colors;
234
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
235
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
236
- result._width = width;
237
- result._colorsPerVertex = colorsPerVertex;
238
- result._arcType = arcType;
239
- result._granularity = granularity;
240
- return result;
241
- };
242
- var scratchCartesian3 = new Cartesian3_default();
243
- var scratchPosition = new Cartesian3_default();
244
- var scratchPrevPosition = new Cartesian3_default();
245
- var scratchNextPosition = new Cartesian3_default();
246
- PolylineGeometry.createGeometry = function(polylineGeometry) {
247
- const width = polylineGeometry._width;
248
- const vertexFormat = polylineGeometry._vertexFormat;
249
- let colors = polylineGeometry._colors;
250
- const colorsPerVertex = polylineGeometry._colorsPerVertex;
251
- const arcType = polylineGeometry._arcType;
252
- const granularity = polylineGeometry._granularity;
253
- const ellipsoid = polylineGeometry._ellipsoid;
254
- let i;
255
- let j;
256
- let k;
257
- const removedIndices = [];
258
- let positions = arrayRemoveDuplicates_default(
259
- polylineGeometry._positions,
260
- Cartesian3_default.equalsEpsilon,
261
- false,
262
- removedIndices
263
- );
264
- if (defined_default(colors) && removedIndices.length > 0) {
265
- let removedArrayIndex = 0;
266
- let nextRemovedIndex = removedIndices[0];
267
- colors = colors.filter(function(color, index2) {
268
- let remove = false;
269
- if (colorsPerVertex) {
270
- remove = index2 === nextRemovedIndex || index2 === 0 && nextRemovedIndex === 1;
271
- } else {
272
- remove = index2 + 1 === nextRemovedIndex;
273
- }
274
- if (remove) {
275
- removedArrayIndex++;
276
- nextRemovedIndex = removedIndices[removedArrayIndex];
277
- return false;
278
- }
279
- return true;
280
- });
281
- }
282
- let positionsLength = positions.length;
283
- if (positionsLength < 2 || width <= 0) {
284
- return void 0;
285
- }
286
- if (arcType === ArcType_default.GEODESIC || arcType === ArcType_default.RHUMB) {
287
- let subdivisionSize;
288
- let numberOfPointsFunction;
289
- if (arcType === ArcType_default.GEODESIC) {
290
- subdivisionSize = Math_default.chordLength(
291
- granularity,
292
- ellipsoid.maximumRadius
293
- );
294
- numberOfPointsFunction = PolylinePipeline_default.numberOfPoints;
295
- } else {
296
- subdivisionSize = granularity;
297
- numberOfPointsFunction = PolylinePipeline_default.numberOfPointsRhumbLine;
298
- }
299
- const heights = PolylinePipeline_default.extractHeights(positions, ellipsoid);
300
- if (defined_default(colors)) {
301
- let colorLength = 1;
302
- for (i = 0; i < positionsLength - 1; ++i) {
303
- colorLength += numberOfPointsFunction(
304
- positions[i],
305
- positions[i + 1],
306
- subdivisionSize
307
- );
308
- }
309
- const newColors = new Array(colorLength);
310
- let newColorIndex = 0;
311
- for (i = 0; i < positionsLength - 1; ++i) {
312
- const p0 = positions[i];
313
- const p1 = positions[i + 1];
314
- const c0 = colors[i];
315
- const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);
316
- if (colorsPerVertex && i < colorLength) {
317
- const c1 = colors[i + 1];
318
- const interpolatedColors = interpolateColors(
319
- p0,
320
- p1,
321
- c0,
322
- c1,
323
- numColors
324
- );
325
- const interpolatedColorsLength = interpolatedColors.length;
326
- for (j = 0; j < interpolatedColorsLength; ++j) {
327
- newColors[newColorIndex++] = interpolatedColors[j];
328
- }
329
- } else {
330
- for (j = 0; j < numColors; ++j) {
331
- newColors[newColorIndex++] = Color_default.clone(c0);
332
- }
333
- }
334
- }
335
- newColors[newColorIndex] = Color_default.clone(colors[colors.length - 1]);
336
- colors = newColors;
337
- scratchInterpolateColorsArray.length = 0;
338
- }
339
- if (arcType === ArcType_default.GEODESIC) {
340
- positions = PolylinePipeline_default.generateCartesianArc({
341
- positions,
342
- minDistance: subdivisionSize,
343
- ellipsoid,
344
- height: heights
345
- });
346
- } else {
347
- positions = PolylinePipeline_default.generateCartesianRhumbArc({
348
- positions,
349
- granularity: subdivisionSize,
350
- ellipsoid,
351
- height: heights
352
- });
353
- }
354
- }
355
- positionsLength = positions.length;
356
- const size = positionsLength * 4 - 4;
357
- const finalPositions = new Float64Array(size * 3);
358
- const prevPositions = new Float64Array(size * 3);
359
- const nextPositions = new Float64Array(size * 3);
360
- const expandAndWidth = new Float32Array(size * 2);
361
- const st = vertexFormat.st ? new Float32Array(size * 2) : void 0;
362
- const finalColors = defined_default(colors) ? new Uint8Array(size * 4) : void 0;
363
- let positionIndex = 0;
364
- let expandAndWidthIndex = 0;
365
- let stIndex = 0;
366
- let colorIndex = 0;
367
- let position;
368
- for (j = 0; j < positionsLength; ++j) {
369
- if (j === 0) {
370
- position = scratchCartesian3;
371
- Cartesian3_default.subtract(positions[0], positions[1], position);
372
- Cartesian3_default.add(positions[0], position, position);
373
- } else {
374
- position = positions[j - 1];
375
- }
376
- Cartesian3_default.clone(position, scratchPrevPosition);
377
- Cartesian3_default.clone(positions[j], scratchPosition);
378
- if (j === positionsLength - 1) {
379
- position = scratchCartesian3;
380
- Cartesian3_default.subtract(
381
- positions[positionsLength - 1],
382
- positions[positionsLength - 2],
383
- position
384
- );
385
- Cartesian3_default.add(positions[positionsLength - 1], position, position);
386
- } else {
387
- position = positions[j + 1];
388
- }
389
- Cartesian3_default.clone(position, scratchNextPosition);
390
- let color0, color1;
391
- if (defined_default(finalColors)) {
392
- if (j !== 0 && !colorsPerVertex) {
393
- color0 = colors[j - 1];
394
- } else {
395
- color0 = colors[j];
396
- }
397
- if (j !== positionsLength - 1) {
398
- color1 = colors[j];
399
- }
400
- }
401
- const startK = j === 0 ? 2 : 0;
402
- const endK = j === positionsLength - 1 ? 2 : 4;
403
- for (k = startK; k < endK; ++k) {
404
- Cartesian3_default.pack(scratchPosition, finalPositions, positionIndex);
405
- Cartesian3_default.pack(scratchPrevPosition, prevPositions, positionIndex);
406
- Cartesian3_default.pack(scratchNextPosition, nextPositions, positionIndex);
407
- positionIndex += 3;
408
- const direction = k - 2 < 0 ? -1 : 1;
409
- expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;
410
- expandAndWidth[expandAndWidthIndex++] = direction * width;
411
- if (vertexFormat.st) {
412
- st[stIndex++] = j / (positionsLength - 1);
413
- st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0);
414
- }
415
- if (defined_default(finalColors)) {
416
- const color = k < 2 ? color0 : color1;
417
- finalColors[colorIndex++] = Color_default.floatToByte(color.red);
418
- finalColors[colorIndex++] = Color_default.floatToByte(color.green);
419
- finalColors[colorIndex++] = Color_default.floatToByte(color.blue);
420
- finalColors[colorIndex++] = Color_default.floatToByte(color.alpha);
421
- }
422
- }
423
- }
424
- const attributes = new GeometryAttributes_default();
425
- attributes.position = new GeometryAttribute_default({
426
- componentDatatype: ComponentDatatype_default.DOUBLE,
427
- componentsPerAttribute: 3,
428
- values: finalPositions
429
- });
430
- attributes.prevPosition = new GeometryAttribute_default({
431
- componentDatatype: ComponentDatatype_default.DOUBLE,
432
- componentsPerAttribute: 3,
433
- values: prevPositions
434
- });
435
- attributes.nextPosition = new GeometryAttribute_default({
436
- componentDatatype: ComponentDatatype_default.DOUBLE,
437
- componentsPerAttribute: 3,
438
- values: nextPositions
439
- });
440
- attributes.expandAndWidth = new GeometryAttribute_default({
441
- componentDatatype: ComponentDatatype_default.FLOAT,
442
- componentsPerAttribute: 2,
443
- values: expandAndWidth
444
- });
445
- if (vertexFormat.st) {
446
- attributes.st = new GeometryAttribute_default({
447
- componentDatatype: ComponentDatatype_default.FLOAT,
448
- componentsPerAttribute: 2,
449
- values: st
450
- });
451
- }
452
- if (defined_default(finalColors)) {
453
- attributes.color = new GeometryAttribute_default({
454
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
455
- componentsPerAttribute: 4,
456
- values: finalColors,
457
- normalize: true
458
- });
459
- }
460
- const indices = IndexDatatype_default.createTypedArray(size, positionsLength * 6 - 6);
461
- let index = 0;
462
- let indicesIndex = 0;
463
- const length = positionsLength - 1;
464
- for (j = 0; j < length; ++j) {
465
- indices[indicesIndex++] = index;
466
- indices[indicesIndex++] = index + 2;
467
- indices[indicesIndex++] = index + 1;
468
- indices[indicesIndex++] = index + 1;
469
- indices[indicesIndex++] = index + 2;
470
- indices[indicesIndex++] = index + 3;
471
- index += 4;
472
- }
473
- return new Geometry_default({
474
- attributes,
475
- indices,
476
- primitiveType: PrimitiveType_default.TRIANGLES,
477
- boundingSphere: BoundingSphere_default.fromPoints(positions),
478
- geometryType: GeometryType_default.POLYLINES
479
- });
480
- };
481
- var PolylineGeometry_default = PolylineGeometry;
482
-
483
- // packages/engine/Source/Workers/createPolylineGeometry.js
484
- function createPolylineGeometry(polylineGeometry, offset) {
485
- if (defined_default(offset)) {
486
- polylineGeometry = PolylineGeometry_default.unpack(polylineGeometry, offset);
487
- }
488
- polylineGeometry._ellipsoid = Ellipsoid_default.clone(polylineGeometry._ellipsoid);
489
- return PolylineGeometry_default.createGeometry(polylineGeometry);
490
- }
491
- var createPolylineGeometry_default = createPolylineGeometry;
492
- export {
493
- createPolylineGeometry_default as default
494
- };
26
+ import{a as m}from"./chunk-HMIYSTF6.js";import{a as R}from"./chunk-J6UP6FLE.js";import{a as N}from"./chunk-XRL4AVS5.js";import"./chunk-U4IEOH5K.js";import{a as g}from"./chunk-CYCB63OH.js";import{a as le}from"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as se}from"./chunk-OFUUQVMR.js";import{a as ce}from"./chunk-A56XVLQR.js";import{a as ne,b as re,c as ie,d as x}from"./chunk-RCV6KWXS.js";import{d as oe}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as V}from"./chunk-AU7IKHOH.js";import{a as p,d as u,f as te}from"./chunk-64RSHJUE.js";import{a as j}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as F}from"./chunk-LEYMRMBK.js";import{e as h}from"./chunk-VTAIKJXX.js";var me=[];function Ae(e,o,t,n,c){let s=me;s.length=c;let l,k=t.red,a=t.green,r=t.blue,w=t.alpha,E=n.red,i=n.green,f=n.blue,b=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);return s}let G=(E-k)/c,z=(i-a)/c,M=(f-r)/c,S=(b-w)/c;for(l=0;l<c;l++)s[l]=new m(k+l*G,a+l*z,r+l*M,w+l*S);return s}function q(e){e=e??te.EMPTY_OBJECT;let o=e.positions,t=e.colors,n=e.width??1,c=e.colorsPerVertex??!1;if(!h(o)||o.length<2)throw new F("At least two positions are required.");if(typeof n!="number")throw new F("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))throw new F("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=g.clone(e.vertexFormat??g.DEFAULT),this._arcType=e.arcType??R.GEODESIC,this._granularity=e.granularity??j.RADIANS_PER_DEGREE,this._ellipsoid=u.clone(e.ellipsoid??u.default),this._workerName="createPolylineGeometry";let s=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+g.packedLength+4}q.pack=function(e,o,t){if(!h(e))throw new F("value is required");if(!h(o))throw new F("array is required");t=t??0;let n,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);let l=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);return u.pack(e._ellipsoid,o,t),t+=u.packedLength,g.pack(e._vertexFormat,o,t),t+=g.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};var de=u.clone(u.UNIT_SPHERE),ue=new g,O={positions:void 0,colors:void 0,ellipsoid:de,vertexFormat:ue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};q.unpack=function(e,o,t){if(!h(e))throw new F("array is required");o=o??0;let n,c=e[o++],s=new Array(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];let l=c>0?new Array(c):void 0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);let k=u.unpack(e,o,de);o+=u.packedLength;let a=g.unpack(e,o,ue);o+=g.packedLength;let r=e[o++],w=e[o++]===1,E=e[o++],i=e[o];return h(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(k,t._ellipsoid),t._vertexFormat=g.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=E,t._granularity=i,t):(O.positions=s,O.colors=l,O.width=r,O.colorsPerVertex=w,O.arcType=E,O.granularity=i,new q(O))};var pe=new p,ae=new p,fe=new p,he=new p;q.createGeometry=function(e){let o=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,k=e._ellipsoid,a,r,w,E=[],i=le(e._positions,p.equalsEpsilon,!1,E);if(h(n)&&E.length>0){let d=0,P=E[0];n=n.filter(function(U,L){let A=!1;return c?A=L===P||L===0&&P===1:A=L+1===P,A?(d++,P=E[d],!1):!0})}let f=i.length;if(f<2||o<=0)return;if(s===R.GEODESIC||s===R.RHUMB){let d,P;s===R.GEODESIC?(d=j.chordLength(l,k.maximumRadius),P=N.numberOfPoints):(d=l,P=N.numberOfPointsRhumbLine);let U=N.extractHeights(i,k);if(h(n)){let L=1;for(a=0;a<f-1;++a)L+=P(i[a],i[a+1],d);let A=new Array(L),y=0;for(a=0;a<f-1;++a){let X=i[a],Z=i[a+1],$=n[a],I=P(X,Z,d);if(c&&a<L){let _e=n[a+1],ee=Ae(X,Z,$,_e,I),Pe=ee.length;for(r=0;r<Pe;++r)A[y++]=ee[r]}else for(r=0;r<I;++r)A[y++]=m.clone($)}A[y]=m.clone(n[n.length-1]),n=A,me.length=0}s===R.GEODESIC?i=N.generateCartesianArc({positions:i,minDistance:d,ellipsoid:k,height:U}):i=N.generateCartesianRhumbArc({positions:i,granularity:d,ellipsoid:k,height:U})}f=i.length;let b=f*4-4,G=new Float64Array(b*3),z=new Float64Array(b*3),M=new Float64Array(b*3),S=new Float32Array(b*2),Y=t.st?new Float32Array(b*2):void 0,T=h(n)?new Uint8Array(b*4):void 0,H=0,K=0,Q=0,W=0,_;for(r=0;r<f;++r){r===0?(_=pe,p.subtract(i[0],i[1],_),p.add(i[0],_,_)):_=i[r-1],p.clone(_,fe),p.clone(i[r],ae),r===f-1?(_=pe,p.subtract(i[f-1],i[f-2],_),p.add(i[f-1],_,_)):_=i[r+1],p.clone(_,he);let d,P;h(T)&&(r!==0&&!c?d=n[r-1]:d=n[r],r!==f-1&&(P=n[r]));let U=r===0?2:0,L=r===f-1?2:4;for(w=U;w<L;++w){p.pack(ae,G,H),p.pack(fe,z,H),p.pack(he,M,H),H+=3;let A=w-2<0?-1:1;if(S[K++]=2*(w%2)-1,S[K++]=A*o,t.st&&(Y[Q++]=r/(f-1),Y[Q++]=Math.max(S[K-2],0)),h(T)){let y=w<2?d:P;T[W++]=m.floatToByte(y.red),T[W++]=m.floatToByte(y.green),T[W++]=m.floatToByte(y.blue),T[W++]=m.floatToByte(y.alpha)}}}let D=new ce;D.position=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:G}),D.prevPosition=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:z}),D.nextPosition=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:M}),D.expandAndWidth=new x({componentDatatype:V.FLOAT,componentsPerAttribute:2,values:S}),t.st&&(D.st=new x({componentDatatype:V.FLOAT,componentsPerAttribute:2,values:Y})),h(T)&&(D.color=new x({componentDatatype:V.UNSIGNED_BYTE,componentsPerAttribute:4,values:T,normalize:!0}));let v=se.createTypedArray(b,f*6-6),C=0,B=0,we=f-1;for(r=0;r<we;++r)v[B++]=C,v[B++]=C+2,v[B++]=C+1,v[B++]=C+1,v[B++]=C+2,v[B++]=C+3,C+=4;return new ie({attributes:D,indices:v,primitiveType:re.TRIANGLES,boundingSphere:oe.fromPoints(i),geometryType:ne.POLYLINES})};var J=q;function ge(e,o){return h(o)&&(e=J.unpack(e,o)),e._ellipsoid=u.clone(e._ellipsoid),J.createGeometry(e)}var We=ge;export{We as default};