@hztxi/cesium-engine 25.0.1 → 25.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 (166) hide show
  1. package/Build/Workers/chunk-27UNFKLP.js +78 -0
  2. package/Build/Workers/chunk-2NIRC5FH.js +398 -0
  3. package/Build/Workers/chunk-2YHL3RU5.js +162 -0
  4. package/Build/Workers/chunk-36Y4HYYW.js +1067 -0
  5. package/Build/Workers/chunk-3EB75M2K.js +2342 -0
  6. package/Build/Workers/chunk-3HGZ7PIQ.js +1483 -0
  7. package/Build/Workers/chunk-4A34KHP2.js +138 -0
  8. package/Build/Workers/chunk-4GKVVYGC.js +124 -0
  9. package/Build/Workers/chunk-4NOKV4XU.js +301 -0
  10. package/Build/Workers/chunk-4VMEH443.js +754 -0
  11. package/Build/Workers/chunk-4VO5KZVX.js +693 -0
  12. package/Build/Workers/chunk-53ITLB2Q.js +288 -0
  13. package/Build/Workers/chunk-5523YTNX.js +352 -0
  14. package/Build/Workers/chunk-562MM6RC.js +682 -0
  15. package/Build/Workers/chunk-5BQXC3BP.js +837 -0
  16. package/Build/Workers/chunk-5DHF2GEC.js +497 -0
  17. package/Build/Workers/chunk-5RSLOB22.js +511 -0
  18. package/Build/Workers/chunk-5SLGYIPO.js +454 -0
  19. package/Build/Workers/chunk-65RILO72.js +76 -0
  20. package/Build/Workers/chunk-6A74XDJV.js +1054 -0
  21. package/Build/Workers/chunk-6CAFY3E7.js +280 -0
  22. package/Build/Workers/chunk-6IWHUZUQ.js +959 -0
  23. package/Build/Workers/chunk-6ROOPL5F.js +455 -0
  24. package/Build/Workers/chunk-6SQMSSOR.js +352 -0
  25. package/Build/Workers/chunk-6SZK4XE5.js +1800 -0
  26. package/Build/Workers/chunk-6XE6USHI.js +280 -0
  27. package/Build/Workers/chunk-6YMLC7BS.js +1067 -0
  28. package/Build/Workers/chunk-7QXAVVZH.js +9230 -0
  29. package/Build/Workers/chunk-A4AIHOC7.js +476 -0
  30. package/Build/Workers/chunk-AFBRALW3.js +3620 -0
  31. package/Build/Workers/chunk-AGANEUZR.js +305 -0
  32. package/Build/Workers/chunk-AIA3JN4E.js +171 -0
  33. package/Build/Workers/chunk-AJ4TSZQD.js +352 -0
  34. package/Build/Workers/chunk-ANB53XEA.js +198 -0
  35. package/Build/Workers/chunk-AWP7JHXS.js +58 -0
  36. package/Build/Workers/chunk-B2MY5ZT4.js +241 -0
  37. package/Build/Workers/chunk-BVOP4FBU.js +778 -0
  38. package/Build/Workers/chunk-CUJKQD6C.js +1287 -0
  39. package/Build/Workers/chunk-DOJQOYSZ.js +1344 -0
  40. package/Build/Workers/chunk-DSOWTJU3.js +3201 -0
  41. package/Build/Workers/chunk-E4SAHWMA.js +1992 -0
  42. package/Build/Workers/chunk-EJES53XD.js +147 -0
  43. package/Build/Workers/chunk-FEMEGP72.js +97 -0
  44. package/Build/Workers/chunk-FPUTHLEQ.js +73 -0
  45. package/Build/Workers/chunk-FSGWPS5K.js +102 -0
  46. package/Build/Workers/chunk-FVGN2Y5F.js +414 -0
  47. package/Build/Workers/chunk-FYOTKGMD.js +38 -0
  48. package/Build/Workers/chunk-FYOU33DL.js +454 -0
  49. package/Build/Workers/chunk-FZQTWCZX.js +138 -0
  50. package/Build/Workers/chunk-G7QZ6W7K.js +56 -0
  51. package/Build/Workers/chunk-GBYWJNH6.js +455 -0
  52. package/Build/Workers/chunk-H62GX37Y.js +414 -0
  53. package/Build/Workers/chunk-HA42BW2W.js +73 -0
  54. package/Build/Workers/chunk-HGDGYWXB.js +368 -0
  55. package/Build/Workers/chunk-HLCNW67V.js +162 -0
  56. package/Build/Workers/chunk-HPRR2MW2.js +9230 -0
  57. package/Build/Workers/chunk-JHL6DEKL.js +1287 -0
  58. package/Build/Workers/chunk-KGNDVO6V.js +497 -0
  59. package/Build/Workers/chunk-KKXT553B.js +2719 -0
  60. package/Build/Workers/chunk-KM3TU6SW.js +101 -0
  61. package/Build/Workers/chunk-LANT2AAI.js +398 -0
  62. package/Build/Workers/chunk-LC2DM3UY.js +352 -0
  63. package/Build/Workers/chunk-LFVZBOFT.js +140 -0
  64. package/Build/Workers/chunk-M3YCBXY6.js +97 -0
  65. package/Build/Workers/chunk-MNKWZJLE.js +754 -0
  66. package/Build/Workers/chunk-MR7LJQY3.js +1344 -0
  67. package/Build/Workers/chunk-MVCGWYYA.js +693 -0
  68. package/Build/Workers/chunk-N4ECLSTH.js +163 -0
  69. package/Build/Workers/chunk-NG6PINOD.js +973 -0
  70. package/Build/Workers/chunk-NOOOB6XR.js +76 -0
  71. package/Build/Workers/chunk-NRIECATP.js +124 -0
  72. package/Build/Workers/chunk-OI6UMRBT.js +368 -0
  73. package/Build/Workers/chunk-OJMOQSS5.js +387 -0
  74. package/Build/Workers/chunk-PEK6L3A2.js +102 -0
  75. package/Build/Workers/chunk-PLMDKE2G.js +57 -0
  76. package/Build/Workers/chunk-R3E7ZNXL.js +44 -0
  77. package/Build/Workers/chunk-RGNURFR5.js +1992 -0
  78. package/Build/Workers/chunk-RHVCL4BF.js +3620 -0
  79. package/Build/Workers/chunk-S7NAPXAR.js +305 -0
  80. package/Build/Workers/chunk-SAFIA66W.js +140 -0
  81. package/Build/Workers/chunk-SLZBHAWM.js +837 -0
  82. package/Build/Workers/chunk-SOD6C4T2.js +682 -0
  83. package/Build/Workers/chunk-SOMBAQ6X.js +3201 -0
  84. package/Build/Workers/chunk-SOOUWXOJ.js +198 -0
  85. package/Build/Workers/chunk-SZONDGD2.js +778 -0
  86. package/Build/Workers/chunk-TT3NOX52.js +257 -0
  87. package/Build/Workers/chunk-TT6EXCGT.js +387 -0
  88. package/Build/Workers/chunk-UQABUNQP.js +301 -0
  89. package/Build/Workers/chunk-UUN6ELAF.js +476 -0
  90. package/Build/Workers/chunk-VDJVNJXW.js +2342 -0
  91. package/Build/Workers/chunk-VU2OEFZS.js +511 -0
  92. package/Build/Workers/chunk-VYTIQ2Y2.js +630 -0
  93. package/Build/Workers/chunk-W5MRHFMR.js +288 -0
  94. package/Build/Workers/chunk-WHJCVALR.js +241 -0
  95. package/Build/Workers/chunk-WKB3ASRI.js +973 -0
  96. package/Build/Workers/chunk-WLDDKODU.js +44 -0
  97. package/Build/Workers/chunk-X4A7LVKE.js +219 -0
  98. package/Build/Workers/chunk-XFMCNWLM.js +2719 -0
  99. package/Build/Workers/chunk-XGU44EOV.js +219 -0
  100. package/Build/Workers/chunk-XIIIDBAK.js +171 -0
  101. package/Build/Workers/chunk-XLMFFASL.js +1483 -0
  102. package/Build/Workers/chunk-Y2TJP7FF.js +959 -0
  103. package/Build/Workers/chunk-Y7LAUPYL.js +1054 -0
  104. package/Build/Workers/chunk-YMIPCEQ6.js +1800 -0
  105. package/Build/Workers/chunk-YQVAKERA.js +57 -0
  106. package/Build/Workers/chunk-YWXQX4RS.js +147 -0
  107. package/Build/Workers/chunk-ZOMW6KCQ.js +56 -0
  108. package/Build/Workers/combineGeometry.js +24 -24
  109. package/Build/Workers/createBoxGeometry.js +18 -18
  110. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  111. package/Build/Workers/createCircleGeometry.js +26 -26
  112. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  113. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  114. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  115. package/Build/Workers/createCorridorGeometry.js +29 -29
  116. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  117. package/Build/Workers/createCylinderGeometry.js +20 -20
  118. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  119. package/Build/Workers/createEllipseGeometry.js +26 -26
  120. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  121. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  122. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  123. package/Build/Workers/createFrustumGeometry.js +18 -18
  124. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  125. package/Build/Workers/createGeometry.js +24 -24
  126. package/Build/Workers/createGroundPolylineGeometry.js +23 -23
  127. package/Build/Workers/createPlaneGeometry.js +16 -16
  128. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  129. package/Build/Workers/createPolygonGeometry.js +32 -32
  130. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  131. package/Build/Workers/createPolylineGeometry.js +25 -25
  132. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  133. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  134. package/Build/Workers/createRectangleGeometry.js +27 -27
  135. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  136. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  137. package/Build/Workers/createSphereGeometry.js +19 -19
  138. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  139. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  140. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  141. package/Build/Workers/createVectorTileGeometries.js +24 -24
  142. package/Build/Workers/createVectorTilePoints.js +13 -13
  143. package/Build/Workers/createVectorTilePolygons.js +22 -22
  144. package/Build/Workers/createVectorTilePolylines.js +14 -14
  145. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
  146. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
  147. package/Build/Workers/createVerticesFromHeightmap.js +25 -25
  148. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
  149. package/Build/Workers/createWallGeometry.js +24 -24
  150. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  151. package/Build/Workers/decodeDraco.js +10 -10
  152. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +29 -29
  153. package/Build/Workers/decodeI3S.js +10 -10
  154. package/Build/Workers/gaussianSplatSorter.js +4 -4
  155. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  156. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  157. package/Build/Workers/transcodeKTX2.js +7 -7
  158. package/Build/Workers/transferTypedArrayTest.js +1 -1
  159. package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
  160. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
  161. package/Source/DataSources/PolylineGeometryUpdater.js +65 -15
  162. package/Source/Scene/GroundPolylinePrimitive.js +64 -19
  163. package/Source/Scene/Primitive.js +21 -2
  164. package/Source/ThirdParty/zip-module.wasm +0 -0
  165. package/index.js +3 -3
  166. package/package.json +10 -10
@@ -0,0 +1,257 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.141.2
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ WebGLConstants_default
28
+ } from "./chunk-VYTIQ2Y2.js";
29
+ import {
30
+ DeveloperError_default
31
+ } from "./chunk-N4ECLSTH.js";
32
+ import {
33
+ defined_default
34
+ } from "./chunk-27UNFKLP.js";
35
+
36
+ // packages/engine/Source/Core/ComponentDatatype.js
37
+ var ComponentDatatype = {
38
+ /**
39
+ * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
40
+ * of an element in <code>Int8Array</code>.
41
+ *
42
+ * @type {number}
43
+ * @constant
44
+ */
45
+ BYTE: WebGLConstants_default.BYTE,
46
+ /**
47
+ * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
48
+ * of an element in <code>Uint8Array</code>.
49
+ *
50
+ * @type {number}
51
+ * @constant
52
+ */
53
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
54
+ /**
55
+ * 16-bit signed short corresponding to <code>SHORT</code> and the type
56
+ * of an element in <code>Int16Array</code>.
57
+ *
58
+ * @type {number}
59
+ * @constant
60
+ */
61
+ SHORT: WebGLConstants_default.SHORT,
62
+ /**
63
+ * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
64
+ * of an element in <code>Uint16Array</code>.
65
+ *
66
+ * @type {number}
67
+ * @constant
68
+ */
69
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
70
+ /**
71
+ * 32-bit signed int corresponding to <code>INT</code> and the type
72
+ * of an element in <code>Int32Array</code>.
73
+ *
74
+ * @memberOf ComponentDatatype
75
+ *
76
+ * @type {number}
77
+ * @constant
78
+ */
79
+ INT: WebGLConstants_default.INT,
80
+ /**
81
+ * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
82
+ * of an element in <code>Uint32Array</code>.
83
+ *
84
+ * @memberOf ComponentDatatype
85
+ *
86
+ * @type {number}
87
+ * @constant
88
+ */
89
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT,
90
+ /**
91
+ * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
92
+ * of an element in <code>Float32Array</code>.
93
+ *
94
+ * @type {number}
95
+ * @constant
96
+ */
97
+ FLOAT: WebGLConstants_default.FLOAT,
98
+ /**
99
+ * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
100
+ * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
101
+ * and the type of an element in <code>Float64Array</code>.
102
+ *
103
+ * @memberOf ComponentDatatype
104
+ *
105
+ * @type {number}
106
+ * @constant
107
+ * @default 0x140A
108
+ */
109
+ DOUBLE: WebGLConstants_default.DOUBLE
110
+ };
111
+ ComponentDatatype.getSizeInBytes = function(componentDatatype) {
112
+ if (!defined_default(componentDatatype)) {
113
+ throw new DeveloperError_default("value is required.");
114
+ }
115
+ switch (componentDatatype) {
116
+ case ComponentDatatype.BYTE:
117
+ return Int8Array.BYTES_PER_ELEMENT;
118
+ case ComponentDatatype.UNSIGNED_BYTE:
119
+ return Uint8Array.BYTES_PER_ELEMENT;
120
+ case ComponentDatatype.SHORT:
121
+ return Int16Array.BYTES_PER_ELEMENT;
122
+ case ComponentDatatype.UNSIGNED_SHORT:
123
+ return Uint16Array.BYTES_PER_ELEMENT;
124
+ case ComponentDatatype.INT:
125
+ return Int32Array.BYTES_PER_ELEMENT;
126
+ case ComponentDatatype.UNSIGNED_INT:
127
+ return Uint32Array.BYTES_PER_ELEMENT;
128
+ case ComponentDatatype.FLOAT:
129
+ return Float32Array.BYTES_PER_ELEMENT;
130
+ case ComponentDatatype.DOUBLE:
131
+ return Float64Array.BYTES_PER_ELEMENT;
132
+ //>>includeStart('debug', pragmas.debug);
133
+ default:
134
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
135
+ }
136
+ };
137
+ ComponentDatatype.fromTypedArray = function(array) {
138
+ if (array instanceof Int8Array) {
139
+ return ComponentDatatype.BYTE;
140
+ }
141
+ if (array instanceof Uint8Array) {
142
+ return ComponentDatatype.UNSIGNED_BYTE;
143
+ }
144
+ if (array instanceof Int16Array) {
145
+ return ComponentDatatype.SHORT;
146
+ }
147
+ if (array instanceof Uint16Array) {
148
+ return ComponentDatatype.UNSIGNED_SHORT;
149
+ }
150
+ if (array instanceof Int32Array) {
151
+ return ComponentDatatype.INT;
152
+ }
153
+ if (array instanceof Uint32Array) {
154
+ return ComponentDatatype.UNSIGNED_INT;
155
+ }
156
+ if (array instanceof Float32Array) {
157
+ return ComponentDatatype.FLOAT;
158
+ }
159
+ if (array instanceof Float64Array) {
160
+ return ComponentDatatype.DOUBLE;
161
+ }
162
+ throw new DeveloperError_default(
163
+ "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array."
164
+ );
165
+ };
166
+ ComponentDatatype.validate = function(componentDatatype) {
167
+ return defined_default(componentDatatype) && (componentDatatype === ComponentDatatype.BYTE || componentDatatype === ComponentDatatype.UNSIGNED_BYTE || componentDatatype === ComponentDatatype.SHORT || componentDatatype === ComponentDatatype.UNSIGNED_SHORT || componentDatatype === ComponentDatatype.INT || componentDatatype === ComponentDatatype.UNSIGNED_INT || componentDatatype === ComponentDatatype.FLOAT || componentDatatype === ComponentDatatype.DOUBLE);
168
+ };
169
+ ComponentDatatype.createTypedArray = function(componentDatatype, valuesOrLength) {
170
+ if (!defined_default(componentDatatype)) {
171
+ throw new DeveloperError_default("componentDatatype is required.");
172
+ }
173
+ if (!defined_default(valuesOrLength)) {
174
+ throw new DeveloperError_default("valuesOrLength is required.");
175
+ }
176
+ switch (componentDatatype) {
177
+ case ComponentDatatype.BYTE:
178
+ return new Int8Array(valuesOrLength);
179
+ case ComponentDatatype.UNSIGNED_BYTE:
180
+ return new Uint8Array(valuesOrLength);
181
+ case ComponentDatatype.SHORT:
182
+ return new Int16Array(valuesOrLength);
183
+ case ComponentDatatype.UNSIGNED_SHORT:
184
+ return new Uint16Array(valuesOrLength);
185
+ case ComponentDatatype.INT:
186
+ return new Int32Array(valuesOrLength);
187
+ case ComponentDatatype.UNSIGNED_INT:
188
+ return new Uint32Array(valuesOrLength);
189
+ case ComponentDatatype.FLOAT:
190
+ return new Float32Array(valuesOrLength);
191
+ case ComponentDatatype.DOUBLE:
192
+ return new Float64Array(valuesOrLength);
193
+ //>>includeStart('debug', pragmas.debug);
194
+ default:
195
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
196
+ }
197
+ };
198
+ ComponentDatatype.createArrayBufferView = function(componentDatatype, buffer, byteOffset, length) {
199
+ if (!defined_default(componentDatatype)) {
200
+ throw new DeveloperError_default("componentDatatype is required.");
201
+ }
202
+ if (!defined_default(buffer)) {
203
+ throw new DeveloperError_default("buffer is required.");
204
+ }
205
+ byteOffset = byteOffset ?? 0;
206
+ length = length ?? (buffer.byteLength - byteOffset) / ComponentDatatype.getSizeInBytes(componentDatatype);
207
+ switch (componentDatatype) {
208
+ case ComponentDatatype.BYTE:
209
+ return new Int8Array(buffer, byteOffset, length);
210
+ case ComponentDatatype.UNSIGNED_BYTE:
211
+ return new Uint8Array(buffer, byteOffset, length);
212
+ case ComponentDatatype.SHORT:
213
+ return new Int16Array(buffer, byteOffset, length);
214
+ case ComponentDatatype.UNSIGNED_SHORT:
215
+ return new Uint16Array(buffer, byteOffset, length);
216
+ case ComponentDatatype.INT:
217
+ return new Int32Array(buffer, byteOffset, length);
218
+ case ComponentDatatype.UNSIGNED_INT:
219
+ return new Uint32Array(buffer, byteOffset, length);
220
+ case ComponentDatatype.FLOAT:
221
+ return new Float32Array(buffer, byteOffset, length);
222
+ case ComponentDatatype.DOUBLE:
223
+ return new Float64Array(buffer, byteOffset, length);
224
+ //>>includeStart('debug', pragmas.debug);
225
+ default:
226
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
227
+ }
228
+ };
229
+ ComponentDatatype.fromName = function(name) {
230
+ switch (name) {
231
+ case "BYTE":
232
+ return ComponentDatatype.BYTE;
233
+ case "UNSIGNED_BYTE":
234
+ return ComponentDatatype.UNSIGNED_BYTE;
235
+ case "SHORT":
236
+ return ComponentDatatype.SHORT;
237
+ case "UNSIGNED_SHORT":
238
+ return ComponentDatatype.UNSIGNED_SHORT;
239
+ case "INT":
240
+ return ComponentDatatype.INT;
241
+ case "UNSIGNED_INT":
242
+ return ComponentDatatype.UNSIGNED_INT;
243
+ case "FLOAT":
244
+ return ComponentDatatype.FLOAT;
245
+ case "DOUBLE":
246
+ return ComponentDatatype.DOUBLE;
247
+ //>>includeStart('debug', pragmas.debug);
248
+ default:
249
+ throw new DeveloperError_default("name is not a valid value.");
250
+ }
251
+ };
252
+ Object.freeze(ComponentDatatype);
253
+ var ComponentDatatype_default = ComponentDatatype;
254
+
255
+ export {
256
+ ComponentDatatype_default
257
+ };
@@ -0,0 +1,387 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.141.1
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ EllipseGeometryLibrary_default
28
+ } from "./chunk-AGANEUZR.js";
29
+ import {
30
+ GeometryOffsetAttribute_default
31
+ } from "./chunk-KIRR4SHO.js";
32
+ import {
33
+ IndexDatatype_default
34
+ } from "./chunk-SAFIA66W.js";
35
+ import {
36
+ GeometryAttributes_default
37
+ } from "./chunk-R3E7ZNXL.js";
38
+ import {
39
+ GeometryAttribute_default,
40
+ Geometry_default,
41
+ PrimitiveType_default
42
+ } from "./chunk-UQABUNQP.js";
43
+ import {
44
+ BoundingSphere_default
45
+ } from "./chunk-CUJKQD6C.js";
46
+ import {
47
+ ComponentDatatype_default
48
+ } from "./chunk-I6PQQIM5.js";
49
+ import {
50
+ Ellipsoid_default
51
+ } from "./chunk-E4SAHWMA.js";
52
+ import {
53
+ Cartesian3_default,
54
+ Frozen_default
55
+ } from "./chunk-3EB75M2K.js";
56
+ import {
57
+ Math_default
58
+ } from "./chunk-5DHF2GEC.js";
59
+ import {
60
+ DeveloperError_default
61
+ } from "./chunk-6JM3OV5P.js";
62
+ import {
63
+ defined_default
64
+ } from "./chunk-AMW7Q4HY.js";
65
+
66
+ // packages/engine/Source/Core/EllipseOutlineGeometry.js
67
+ var scratchCartesian1 = new Cartesian3_default();
68
+ var boundingSphereCenter = new Cartesian3_default();
69
+ function computeEllipse(options) {
70
+ const center = options.center;
71
+ boundingSphereCenter = Cartesian3_default.multiplyByScalar(
72
+ options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),
73
+ options.height,
74
+ boundingSphereCenter
75
+ );
76
+ boundingSphereCenter = Cartesian3_default.add(
77
+ center,
78
+ boundingSphereCenter,
79
+ boundingSphereCenter
80
+ );
81
+ const boundingSphere = new BoundingSphere_default(
82
+ boundingSphereCenter,
83
+ options.semiMajorAxis
84
+ );
85
+ const positions = EllipseGeometryLibrary_default.computeEllipsePositions(
86
+ options,
87
+ false,
88
+ true
89
+ ).outerPositions;
90
+ const attributes = new GeometryAttributes_default({
91
+ position: new GeometryAttribute_default({
92
+ componentDatatype: ComponentDatatype_default.DOUBLE,
93
+ componentsPerAttribute: 3,
94
+ values: EllipseGeometryLibrary_default.raisePositionsToHeight(
95
+ positions,
96
+ options,
97
+ false
98
+ )
99
+ })
100
+ });
101
+ const length = positions.length / 3;
102
+ const indices = IndexDatatype_default.createTypedArray(length, length * 2);
103
+ let index = 0;
104
+ for (let i = 0; i < length; ++i) {
105
+ indices[index++] = i;
106
+ indices[index++] = (i + 1) % length;
107
+ }
108
+ return {
109
+ boundingSphere,
110
+ attributes,
111
+ indices
112
+ };
113
+ }
114
+ var topBoundingSphere = new BoundingSphere_default();
115
+ var bottomBoundingSphere = new BoundingSphere_default();
116
+ function computeExtrudedEllipse(options) {
117
+ const center = options.center;
118
+ const ellipsoid = options.ellipsoid;
119
+ const semiMajorAxis = options.semiMajorAxis;
120
+ let scaledNormal = Cartesian3_default.multiplyByScalar(
121
+ ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),
122
+ options.height,
123
+ scratchCartesian1
124
+ );
125
+ topBoundingSphere.center = Cartesian3_default.add(
126
+ center,
127
+ scaledNormal,
128
+ topBoundingSphere.center
129
+ );
130
+ topBoundingSphere.radius = semiMajorAxis;
131
+ scaledNormal = Cartesian3_default.multiplyByScalar(
132
+ ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
133
+ options.extrudedHeight,
134
+ scaledNormal
135
+ );
136
+ bottomBoundingSphere.center = Cartesian3_default.add(
137
+ center,
138
+ scaledNormal,
139
+ bottomBoundingSphere.center
140
+ );
141
+ bottomBoundingSphere.radius = semiMajorAxis;
142
+ let positions = EllipseGeometryLibrary_default.computeEllipsePositions(
143
+ options,
144
+ false,
145
+ true
146
+ ).outerPositions;
147
+ const attributes = new GeometryAttributes_default({
148
+ position: new GeometryAttribute_default({
149
+ componentDatatype: ComponentDatatype_default.DOUBLE,
150
+ componentsPerAttribute: 3,
151
+ values: EllipseGeometryLibrary_default.raisePositionsToHeight(
152
+ positions,
153
+ options,
154
+ true
155
+ )
156
+ })
157
+ });
158
+ positions = attributes.position.values;
159
+ const boundingSphere = BoundingSphere_default.union(
160
+ topBoundingSphere,
161
+ bottomBoundingSphere
162
+ );
163
+ let length = positions.length / 3;
164
+ if (defined_default(options.offsetAttribute)) {
165
+ let applyOffset = new Uint8Array(length);
166
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
167
+ applyOffset = applyOffset.fill(1, 0, length / 2);
168
+ } else {
169
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
170
+ applyOffset = applyOffset.fill(offsetValue);
171
+ }
172
+ attributes.applyOffset = new GeometryAttribute_default({
173
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
174
+ componentsPerAttribute: 1,
175
+ values: applyOffset
176
+ });
177
+ }
178
+ let numberOfVerticalLines = options.numberOfVerticalLines ?? 16;
179
+ numberOfVerticalLines = Math_default.clamp(
180
+ numberOfVerticalLines,
181
+ 0,
182
+ length / 2
183
+ );
184
+ const indices = IndexDatatype_default.createTypedArray(
185
+ length,
186
+ length * 2 + numberOfVerticalLines * 2
187
+ );
188
+ length /= 2;
189
+ let index = 0;
190
+ let i;
191
+ for (i = 0; i < length; ++i) {
192
+ indices[index++] = i;
193
+ indices[index++] = (i + 1) % length;
194
+ indices[index++] = i + length;
195
+ indices[index++] = (i + 1) % length + length;
196
+ }
197
+ let numSide;
198
+ if (numberOfVerticalLines > 0) {
199
+ const numSideLines = Math.min(numberOfVerticalLines, length);
200
+ numSide = Math.round(length / numSideLines);
201
+ const maxI = Math.min(numSide * numberOfVerticalLines, length);
202
+ for (i = 0; i < maxI; i += numSide) {
203
+ indices[index++] = i;
204
+ indices[index++] = i + length;
205
+ }
206
+ }
207
+ return {
208
+ boundingSphere,
209
+ attributes,
210
+ indices
211
+ };
212
+ }
213
+ function EllipseOutlineGeometry(options) {
214
+ options = options ?? Frozen_default.EMPTY_OBJECT;
215
+ const center = options.center;
216
+ const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
217
+ const semiMajorAxis = options.semiMajorAxis;
218
+ const semiMinorAxis = options.semiMinorAxis;
219
+ const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
220
+ if (!defined_default(center)) {
221
+ throw new DeveloperError_default("center is required.");
222
+ }
223
+ if (!defined_default(semiMajorAxis)) {
224
+ throw new DeveloperError_default("semiMajorAxis is required.");
225
+ }
226
+ if (!defined_default(semiMinorAxis)) {
227
+ throw new DeveloperError_default("semiMinorAxis is required.");
228
+ }
229
+ if (semiMajorAxis < semiMinorAxis) {
230
+ throw new DeveloperError_default(
231
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
232
+ );
233
+ }
234
+ if (granularity <= 0) {
235
+ throw new DeveloperError_default("granularity must be greater than zero.");
236
+ }
237
+ const height = options.height ?? 0;
238
+ const extrudedHeight = options.extrudedHeight ?? height;
239
+ this._center = Cartesian3_default.clone(center);
240
+ this._semiMajorAxis = semiMajorAxis;
241
+ this._semiMinorAxis = semiMinorAxis;
242
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
243
+ this._rotation = options.rotation ?? 0;
244
+ this._height = Math.max(extrudedHeight, height);
245
+ this._granularity = granularity;
246
+ this._extrudedHeight = Math.min(extrudedHeight, height);
247
+ this._numberOfVerticalLines = Math.max(
248
+ options.numberOfVerticalLines ?? 16,
249
+ 0
250
+ );
251
+ this._offsetAttribute = options.offsetAttribute;
252
+ this._workerName = "createEllipseOutlineGeometry";
253
+ }
254
+ EllipseOutlineGeometry.packedLength = Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 8;
255
+ EllipseOutlineGeometry.pack = function(value, array, startingIndex) {
256
+ if (!defined_default(value)) {
257
+ throw new DeveloperError_default("value is required");
258
+ }
259
+ if (!defined_default(array)) {
260
+ throw new DeveloperError_default("array is required");
261
+ }
262
+ startingIndex = startingIndex ?? 0;
263
+ Cartesian3_default.pack(value._center, array, startingIndex);
264
+ startingIndex += Cartesian3_default.packedLength;
265
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
266
+ startingIndex += Ellipsoid_default.packedLength;
267
+ array[startingIndex++] = value._semiMajorAxis;
268
+ array[startingIndex++] = value._semiMinorAxis;
269
+ array[startingIndex++] = value._rotation;
270
+ array[startingIndex++] = value._height;
271
+ array[startingIndex++] = value._granularity;
272
+ array[startingIndex++] = value._extrudedHeight;
273
+ array[startingIndex++] = value._numberOfVerticalLines;
274
+ array[startingIndex] = value._offsetAttribute ?? -1;
275
+ return array;
276
+ };
277
+ var scratchCenter = new Cartesian3_default();
278
+ var scratchEllipsoid = new Ellipsoid_default();
279
+ var scratchOptions = {
280
+ center: scratchCenter,
281
+ ellipsoid: scratchEllipsoid,
282
+ semiMajorAxis: void 0,
283
+ semiMinorAxis: void 0,
284
+ rotation: void 0,
285
+ height: void 0,
286
+ granularity: void 0,
287
+ extrudedHeight: void 0,
288
+ numberOfVerticalLines: void 0,
289
+ offsetAttribute: void 0
290
+ };
291
+ EllipseOutlineGeometry.unpack = function(array, startingIndex, result) {
292
+ if (!defined_default(array)) {
293
+ throw new DeveloperError_default("array is required");
294
+ }
295
+ startingIndex = startingIndex ?? 0;
296
+ const center = Cartesian3_default.unpack(array, startingIndex, scratchCenter);
297
+ startingIndex += Cartesian3_default.packedLength;
298
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
299
+ startingIndex += Ellipsoid_default.packedLength;
300
+ const semiMajorAxis = array[startingIndex++];
301
+ const semiMinorAxis = array[startingIndex++];
302
+ const rotation = array[startingIndex++];
303
+ const height = array[startingIndex++];
304
+ const granularity = array[startingIndex++];
305
+ const extrudedHeight = array[startingIndex++];
306
+ const numberOfVerticalLines = array[startingIndex++];
307
+ const offsetAttribute = array[startingIndex];
308
+ if (!defined_default(result)) {
309
+ scratchOptions.height = height;
310
+ scratchOptions.extrudedHeight = extrudedHeight;
311
+ scratchOptions.granularity = granularity;
312
+ scratchOptions.rotation = rotation;
313
+ scratchOptions.semiMajorAxis = semiMajorAxis;
314
+ scratchOptions.semiMinorAxis = semiMinorAxis;
315
+ scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
316
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
317
+ return new EllipseOutlineGeometry(scratchOptions);
318
+ }
319
+ result._center = Cartesian3_default.clone(center, result._center);
320
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
321
+ result._semiMajorAxis = semiMajorAxis;
322
+ result._semiMinorAxis = semiMinorAxis;
323
+ result._rotation = rotation;
324
+ result._height = height;
325
+ result._granularity = granularity;
326
+ result._extrudedHeight = extrudedHeight;
327
+ result._numberOfVerticalLines = numberOfVerticalLines;
328
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
329
+ return result;
330
+ };
331
+ EllipseOutlineGeometry.createGeometry = function(ellipseGeometry) {
332
+ if (ellipseGeometry._semiMajorAxis <= 0 || ellipseGeometry._semiMinorAxis <= 0) {
333
+ return;
334
+ }
335
+ const height = ellipseGeometry._height;
336
+ const extrudedHeight = ellipseGeometry._extrudedHeight;
337
+ const extrude = !Math_default.equalsEpsilon(
338
+ height,
339
+ extrudedHeight,
340
+ 0,
341
+ Math_default.EPSILON2
342
+ );
343
+ ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
344
+ ellipseGeometry._center,
345
+ ellipseGeometry._center
346
+ );
347
+ const options = {
348
+ center: ellipseGeometry._center,
349
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
350
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
351
+ ellipsoid: ellipseGeometry._ellipsoid,
352
+ rotation: ellipseGeometry._rotation,
353
+ height,
354
+ granularity: ellipseGeometry._granularity,
355
+ numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines
356
+ };
357
+ let geometry;
358
+ if (extrude) {
359
+ options.extrudedHeight = extrudedHeight;
360
+ options.offsetAttribute = ellipseGeometry._offsetAttribute;
361
+ geometry = computeExtrudedEllipse(options);
362
+ } else {
363
+ geometry = computeEllipse(options);
364
+ if (defined_default(ellipseGeometry._offsetAttribute)) {
365
+ const length = geometry.attributes.position.values.length;
366
+ const offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
367
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
368
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
369
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
370
+ componentsPerAttribute: 1,
371
+ values: applyOffset
372
+ });
373
+ }
374
+ }
375
+ return new Geometry_default({
376
+ attributes: geometry.attributes,
377
+ indices: geometry.indices,
378
+ primitiveType: PrimitiveType_default.LINES,
379
+ boundingSphere: geometry.boundingSphere,
380
+ offsetAttribute: ellipseGeometry._offsetAttribute
381
+ });
382
+ };
383
+ var EllipseOutlineGeometry_default = EllipseOutlineGeometry;
384
+
385
+ export {
386
+ EllipseOutlineGeometry_default
387
+ };