@pggis/pg-sdk 3.3.10 → 3.5.0

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 (163) hide show
  1. package/README.md +8 -8
  2. package/dist/index.js +1966 -4
  3. package/dist/pggis.min.css +1 -1
  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-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-EHWHNOEX.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-4H7PY4U5.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-BBWDMCVU.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-WZDE3RYP.js +28 -0
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -44
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -34
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -173
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -36
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -47
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -34
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
  78. package/dist/resources/Workers/createGeometry.js +2 -147
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -200
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -472
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -94
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
  101. package/dist/resources/Workers/createWallGeometry.js +2 -466
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
  105. package/dist/resources/Workers/decodeI3S.js +2 -1320
  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 -3398
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
  111. package/package.json +9 -8
  112. package/dist/pggis.min.js +0 -14796
  113. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  114. package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
  115. package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
  116. package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
  117. package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
  118. package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
  119. package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
  120. package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
  121. package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
  122. package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
  123. package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
  124. package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
  125. package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
  126. package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
  127. package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
  128. package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
  129. package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
  130. package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
  131. package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
  132. package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
  133. package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
  134. package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
  135. package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
  136. package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
  137. package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
  138. package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
  139. package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
  140. package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
  141. package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
  142. package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
  143. package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
  144. package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
  145. package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
  146. package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
  147. package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
  148. package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
  149. package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
  150. package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
  151. package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
  152. package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
  153. package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
  154. package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
  155. package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
  156. package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
  157. package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
  158. package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
  159. package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
  160. package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
  161. package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
  162. package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
  163. package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,474 +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-PGSJK77E.js";
29
- import {
30
- ArcType_default
31
- } from "./chunk-EHWHNOEX.js";
32
- import {
33
- PolylinePipeline_default
34
- } from "./chunk-KKCR2YOP.js";
35
- import "./chunk-F4HFJMGM.js";
36
- import {
37
- VertexFormat_default
38
- } from "./chunk-2FWRMUTY.js";
39
- import {
40
- arrayRemoveDuplicates_default
41
- } from "./chunk-FZRIVR7Y.js";
42
- import "./chunk-SH5USDPI.js";
43
- import "./chunk-2FRVPMCS.js";
44
- import "./chunk-Y5UQJLYE.js";
45
- import {
46
- IndexDatatype_default
47
- } from "./chunk-LPR3YNP2.js";
48
- import {
49
- GeometryAttributes_default
50
- } from "./chunk-4H7PY4U5.js";
51
- import {
52
- GeometryAttribute_default,
53
- GeometryType_default,
54
- Geometry_default,
55
- PrimitiveType_default
56
- } from "./chunk-7TC63SJW.js";
57
- import {
58
- BoundingSphere_default
59
- } from "./chunk-FJKNFAKQ.js";
60
- import "./chunk-TTUZP4BO.js";
61
- import "./chunk-BG4UCVXN.js";
62
- import "./chunk-YJEBABKH.js";
63
- import {
64
- ComponentDatatype_default
65
- } from "./chunk-PPH7OFP3.js";
66
- import {
67
- Cartesian3_default,
68
- Ellipsoid_default
69
- } from "./chunk-OGXZVPPM.js";
70
- import {
71
- Math_default
72
- } from "./chunk-5QULIR53.js";
73
- import "./chunk-SOWMRMWA.js";
74
- import "./chunk-STW2DGFI.js";
75
- import {
76
- defaultValue_default
77
- } from "./chunk-BBWDMCVU.js";
78
- import {
79
- DeveloperError_default
80
- } from "./chunk-XGI5BXZY.js";
81
- import {
82
- defined_default
83
- } from "./chunk-YWTJ2B4B.js";
84
-
85
- // packages/engine/Source/Core/PolylineGeometry.js
86
- var scratchInterpolateColorsArray = [];
87
- function interpolateColors(p0, p1, color0, color1, numPoints) {
88
- const colors = scratchInterpolateColorsArray;
89
- colors.length = numPoints;
90
- let i;
91
- const r0 = color0.red;
92
- const g0 = color0.green;
93
- const b0 = color0.blue;
94
- const a0 = color0.alpha;
95
- const r1 = color1.red;
96
- const g1 = color1.green;
97
- const b1 = color1.blue;
98
- const a1 = color1.alpha;
99
- if (Color_default.equals(color0, color1)) {
100
- for (i = 0; i < numPoints; i++) {
101
- colors[i] = Color_default.clone(color0);
102
- }
103
- return colors;
104
- }
105
- const redPerVertex = (r1 - r0) / numPoints;
106
- const greenPerVertex = (g1 - g0) / numPoints;
107
- const bluePerVertex = (b1 - b0) / numPoints;
108
- const alphaPerVertex = (a1 - a0) / numPoints;
109
- for (i = 0; i < numPoints; i++) {
110
- colors[i] = new Color_default(
111
- r0 + i * redPerVertex,
112
- g0 + i * greenPerVertex,
113
- b0 + i * bluePerVertex,
114
- a0 + i * alphaPerVertex
115
- );
116
- }
117
- return colors;
118
- }
119
- function PolylineGeometry(options) {
120
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
121
- const positions = options.positions;
122
- const colors = options.colors;
123
- const width = defaultValue_default(options.width, 1);
124
- const colorsPerVertex = defaultValue_default(options.colorsPerVertex, false);
125
- if (!defined_default(positions) || positions.length < 2) {
126
- throw new DeveloperError_default("At least two positions are required.");
127
- }
128
- if (typeof width !== "number") {
129
- throw new DeveloperError_default("width must be a number");
130
- }
131
- if (defined_default(colors) && (colorsPerVertex && colors.length < positions.length || !colorsPerVertex && colors.length < positions.length - 1)) {
132
- throw new DeveloperError_default("colors has an invalid length.");
133
- }
134
- this._positions = positions;
135
- this._colors = colors;
136
- this._width = width;
137
- this._colorsPerVertex = colorsPerVertex;
138
- this._vertexFormat = VertexFormat_default.clone(
139
- defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
140
- );
141
- this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
142
- this._granularity = defaultValue_default(
143
- options.granularity,
144
- Math_default.RADIANS_PER_DEGREE
145
- );
146
- this._ellipsoid = Ellipsoid_default.clone(
147
- defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
148
- );
149
- this._workerName = "createPolylineGeometry";
150
- let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
151
- numComponents += defined_default(colors) ? 1 + colors.length * Color_default.packedLength : 1;
152
- this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 4;
153
- }
154
- PolylineGeometry.pack = function(value, array, startingIndex) {
155
- if (!defined_default(value)) {
156
- throw new DeveloperError_default("value is required");
157
- }
158
- if (!defined_default(array)) {
159
- throw new DeveloperError_default("array is required");
160
- }
161
- startingIndex = defaultValue_default(startingIndex, 0);
162
- let i;
163
- const positions = value._positions;
164
- let length = positions.length;
165
- array[startingIndex++] = length;
166
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
167
- Cartesian3_default.pack(positions[i], array, startingIndex);
168
- }
169
- const colors = value._colors;
170
- length = defined_default(colors) ? colors.length : 0;
171
- array[startingIndex++] = length;
172
- for (i = 0; i < length; ++i, startingIndex += Color_default.packedLength) {
173
- Color_default.pack(colors[i], array, startingIndex);
174
- }
175
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
176
- startingIndex += Ellipsoid_default.packedLength;
177
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
178
- startingIndex += VertexFormat_default.packedLength;
179
- array[startingIndex++] = value._width;
180
- array[startingIndex++] = value._colorsPerVertex ? 1 : 0;
181
- array[startingIndex++] = value._arcType;
182
- array[startingIndex] = value._granularity;
183
- return array;
184
- };
185
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
186
- var scratchVertexFormat = new VertexFormat_default();
187
- var scratchOptions = {
188
- positions: void 0,
189
- colors: void 0,
190
- ellipsoid: scratchEllipsoid,
191
- vertexFormat: scratchVertexFormat,
192
- width: void 0,
193
- colorsPerVertex: void 0,
194
- arcType: void 0,
195
- granularity: void 0
196
- };
197
- PolylineGeometry.unpack = function(array, startingIndex, result) {
198
- if (!defined_default(array)) {
199
- throw new DeveloperError_default("array is required");
200
- }
201
- startingIndex = defaultValue_default(startingIndex, 0);
202
- let i;
203
- let length = array[startingIndex++];
204
- const positions = new Array(length);
205
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
206
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
207
- }
208
- length = array[startingIndex++];
209
- const colors = length > 0 ? new Array(length) : void 0;
210
- for (i = 0; i < length; ++i, startingIndex += Color_default.packedLength) {
211
- colors[i] = Color_default.unpack(array, startingIndex);
212
- }
213
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
214
- startingIndex += Ellipsoid_default.packedLength;
215
- const vertexFormat = VertexFormat_default.unpack(
216
- array,
217
- startingIndex,
218
- scratchVertexFormat
219
- );
220
- startingIndex += VertexFormat_default.packedLength;
221
- const width = array[startingIndex++];
222
- const colorsPerVertex = array[startingIndex++] === 1;
223
- const arcType = array[startingIndex++];
224
- const granularity = array[startingIndex];
225
- if (!defined_default(result)) {
226
- scratchOptions.positions = positions;
227
- scratchOptions.colors = colors;
228
- scratchOptions.width = width;
229
- scratchOptions.colorsPerVertex = colorsPerVertex;
230
- scratchOptions.arcType = arcType;
231
- scratchOptions.granularity = granularity;
232
- return new PolylineGeometry(scratchOptions);
233
- }
234
- result._positions = positions;
235
- result._colors = colors;
236
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
237
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
238
- result._width = width;
239
- result._colorsPerVertex = colorsPerVertex;
240
- result._arcType = arcType;
241
- result._granularity = granularity;
242
- return result;
243
- };
244
- var scratchCartesian3 = new Cartesian3_default();
245
- var scratchPosition = new Cartesian3_default();
246
- var scratchPrevPosition = new Cartesian3_default();
247
- var scratchNextPosition = new Cartesian3_default();
248
- PolylineGeometry.createGeometry = function(polylineGeometry) {
249
- const width = polylineGeometry._width;
250
- const vertexFormat = polylineGeometry._vertexFormat;
251
- let colors = polylineGeometry._colors;
252
- const colorsPerVertex = polylineGeometry._colorsPerVertex;
253
- const arcType = polylineGeometry._arcType;
254
- const granularity = polylineGeometry._granularity;
255
- const ellipsoid = polylineGeometry._ellipsoid;
256
- let i;
257
- let j;
258
- let k;
259
- const removedIndices = [];
260
- let positions = arrayRemoveDuplicates_default(
261
- polylineGeometry._positions,
262
- Cartesian3_default.equalsEpsilon,
263
- false,
264
- removedIndices
265
- );
266
- if (defined_default(colors) && removedIndices.length > 0) {
267
- let removedArrayIndex = 0;
268
- let nextRemovedIndex = removedIndices[0];
269
- colors = colors.filter(function(color, index2) {
270
- let remove = false;
271
- if (colorsPerVertex) {
272
- remove = index2 === nextRemovedIndex || index2 === 0 && nextRemovedIndex === 1;
273
- } else {
274
- remove = index2 + 1 === nextRemovedIndex;
275
- }
276
- if (remove) {
277
- removedArrayIndex++;
278
- nextRemovedIndex = removedIndices[removedArrayIndex];
279
- return false;
280
- }
281
- return true;
282
- });
283
- }
284
- let positionsLength = positions.length;
285
- if (positionsLength < 2 || width <= 0) {
286
- return void 0;
287
- }
288
- if (arcType === ArcType_default.GEODESIC || arcType === ArcType_default.RHUMB) {
289
- let subdivisionSize;
290
- let numberOfPointsFunction;
291
- if (arcType === ArcType_default.GEODESIC) {
292
- subdivisionSize = Math_default.chordLength(
293
- granularity,
294
- ellipsoid.maximumRadius
295
- );
296
- numberOfPointsFunction = PolylinePipeline_default.numberOfPoints;
297
- } else {
298
- subdivisionSize = granularity;
299
- numberOfPointsFunction = PolylinePipeline_default.numberOfPointsRhumbLine;
300
- }
301
- const heights = PolylinePipeline_default.extractHeights(positions, ellipsoid);
302
- if (defined_default(colors)) {
303
- let colorLength = 1;
304
- for (i = 0; i < positionsLength - 1; ++i) {
305
- colorLength += numberOfPointsFunction(
306
- positions[i],
307
- positions[i + 1],
308
- subdivisionSize
309
- );
310
- }
311
- const newColors = new Array(colorLength);
312
- let newColorIndex = 0;
313
- for (i = 0; i < positionsLength - 1; ++i) {
314
- const p0 = positions[i];
315
- const p1 = positions[i + 1];
316
- const c0 = colors[i];
317
- const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);
318
- if (colorsPerVertex && i < colorLength) {
319
- const c1 = colors[i + 1];
320
- const interpolatedColors = interpolateColors(
321
- p0,
322
- p1,
323
- c0,
324
- c1,
325
- numColors
326
- );
327
- const interpolatedColorsLength = interpolatedColors.length;
328
- for (j = 0; j < interpolatedColorsLength; ++j) {
329
- newColors[newColorIndex++] = interpolatedColors[j];
330
- }
331
- } else {
332
- for (j = 0; j < numColors; ++j) {
333
- newColors[newColorIndex++] = Color_default.clone(c0);
334
- }
335
- }
336
- }
337
- newColors[newColorIndex] = Color_default.clone(colors[colors.length - 1]);
338
- colors = newColors;
339
- scratchInterpolateColorsArray.length = 0;
340
- }
341
- if (arcType === ArcType_default.GEODESIC) {
342
- positions = PolylinePipeline_default.generateCartesianArc({
343
- positions,
344
- minDistance: subdivisionSize,
345
- ellipsoid,
346
- height: heights
347
- });
348
- } else {
349
- positions = PolylinePipeline_default.generateCartesianRhumbArc({
350
- positions,
351
- granularity: subdivisionSize,
352
- ellipsoid,
353
- height: heights
354
- });
355
- }
356
- }
357
- positionsLength = positions.length;
358
- const size = positionsLength * 4 - 4;
359
- const finalPositions = new Float64Array(size * 3);
360
- const prevPositions = new Float64Array(size * 3);
361
- const nextPositions = new Float64Array(size * 3);
362
- const expandAndWidth = new Float32Array(size * 2);
363
- const st = vertexFormat.st ? new Float32Array(size * 2) : void 0;
364
- const finalColors = defined_default(colors) ? new Uint8Array(size * 4) : void 0;
365
- let positionIndex = 0;
366
- let expandAndWidthIndex = 0;
367
- let stIndex = 0;
368
- let colorIndex = 0;
369
- let position;
370
- for (j = 0; j < positionsLength; ++j) {
371
- if (j === 0) {
372
- position = scratchCartesian3;
373
- Cartesian3_default.subtract(positions[0], positions[1], position);
374
- Cartesian3_default.add(positions[0], position, position);
375
- } else {
376
- position = positions[j - 1];
377
- }
378
- Cartesian3_default.clone(position, scratchPrevPosition);
379
- Cartesian3_default.clone(positions[j], scratchPosition);
380
- if (j === positionsLength - 1) {
381
- position = scratchCartesian3;
382
- Cartesian3_default.subtract(
383
- positions[positionsLength - 1],
384
- positions[positionsLength - 2],
385
- position
386
- );
387
- Cartesian3_default.add(positions[positionsLength - 1], position, position);
388
- } else {
389
- position = positions[j + 1];
390
- }
391
- Cartesian3_default.clone(position, scratchNextPosition);
392
- let color0, color1;
393
- if (defined_default(finalColors)) {
394
- if (j !== 0 && !colorsPerVertex) {
395
- color0 = colors[j - 1];
396
- } else {
397
- color0 = colors[j];
398
- }
399
- if (j !== positionsLength - 1) {
400
- color1 = colors[j];
401
- }
402
- }
403
- const startK = j === 0 ? 2 : 0;
404
- const endK = j === positionsLength - 1 ? 2 : 4;
405
- for (k = startK; k < endK; ++k) {
406
- Cartesian3_default.pack(scratchPosition, finalPositions, positionIndex);
407
- Cartesian3_default.pack(scratchPrevPosition, prevPositions, positionIndex);
408
- Cartesian3_default.pack(scratchNextPosition, nextPositions, positionIndex);
409
- positionIndex += 3;
410
- const direction = k - 2 < 0 ? -1 : 1;
411
- expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;
412
- expandAndWidth[expandAndWidthIndex++] = direction * width;
413
- if (vertexFormat.st) {
414
- st[stIndex++] = j / (positionsLength - 1);
415
- st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0);
416
- }
417
- if (defined_default(finalColors)) {
418
- const color = k < 2 ? color0 : color1;
419
- finalColors[colorIndex++] = Color_default.floatToByte(color.red);
420
- finalColors[colorIndex++] = Color_default.floatToByte(color.green);
421
- finalColors[colorIndex++] = Color_default.floatToByte(color.blue);
422
- finalColors[colorIndex++] = Color_default.floatToByte(color.alpha);
423
- }
424
- }
425
- }
426
- const attributes = new GeometryAttributes_default();
427
- attributes.position = new GeometryAttribute_default({
428
- componentDatatype: ComponentDatatype_default.DOUBLE,
429
- componentsPerAttribute: 3,
430
- values: finalPositions
431
- });
432
- attributes.prevPosition = new GeometryAttribute_default({
433
- componentDatatype: ComponentDatatype_default.DOUBLE,
434
- componentsPerAttribute: 3,
435
- values: prevPositions
436
- });
437
- attributes.nextPosition = new GeometryAttribute_default({
438
- componentDatatype: ComponentDatatype_default.DOUBLE,
439
- componentsPerAttribute: 3,
440
- values: nextPositions
441
- });
442
- attributes.expandAndWidth = new GeometryAttribute_default({
443
- componentDatatype: ComponentDatatype_default.FLOAT,
444
- componentsPerAttribute: 2,
445
- values: expandAndWidth
446
- });
447
- if (vertexFormat.st) {
448
- attributes.st = new GeometryAttribute_default({
449
- componentDatatype: ComponentDatatype_default.FLOAT,
450
- componentsPerAttribute: 2,
451
- values: st
452
- });
453
- }
454
- if (defined_default(finalColors)) {
455
- attributes.color = new GeometryAttribute_default({
456
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
457
- componentsPerAttribute: 4,
458
- values: finalColors,
459
- normalize: true
460
- });
461
- }
462
- const indices = IndexDatatype_default.createTypedArray(size, positionsLength * 6 - 6);
463
- let index = 0;
464
- let indicesIndex = 0;
465
- const length = positionsLength - 1;
466
- for (j = 0; j < length; ++j) {
467
- indices[indicesIndex++] = index;
468
- indices[indicesIndex++] = index + 2;
469
- indices[indicesIndex++] = index + 1;
470
- indices[indicesIndex++] = index + 1;
471
- indices[indicesIndex++] = index + 2;
472
- indices[indicesIndex++] = index + 3;
473
- index += 4;
474
- }
475
- return new Geometry_default({
476
- attributes,
477
- indices,
478
- primitiveType: PrimitiveType_default.TRIANGLES,
479
- boundingSphere: BoundingSphere_default.fromPoints(positions),
480
- geometryType: GeometryType_default.POLYLINES
481
- });
482
- };
483
- var PolylineGeometry_default = PolylineGeometry;
484
-
485
- // packages/engine/Source/Workers/createPolylineGeometry.js
486
- function createPolylineGeometry(polylineGeometry, offset) {
487
- if (defined_default(offset)) {
488
- polylineGeometry = PolylineGeometry_default.unpack(polylineGeometry, offset);
489
- }
490
- polylineGeometry._ellipsoid = Ellipsoid_default.clone(polylineGeometry._ellipsoid);
491
- return PolylineGeometry_default.createGeometry(polylineGeometry);
492
- }
493
- var createPolylineGeometry_default = createPolylineGeometry;
494
- export {
495
- createPolylineGeometry_default as default
496
- };
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};