@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,122 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
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
- OrientedBoundingBox_default
28
- } from "./chunk-M3GMB5OP.js";
29
- import {
30
- Cartesian2_default,
31
- Cartesian3_default,
32
- Matrix3_default
33
- } from "./chunk-YFXQECWV.js";
34
- import {
35
- Check_default
36
- } from "./chunk-AD63PIY6.js";
37
-
38
- // packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js
39
- var CoplanarPolygonGeometryLibrary = {};
40
- var scratchIntersectionPoint = new Cartesian3_default();
41
- var scratchXAxis = new Cartesian3_default();
42
- var scratchYAxis = new Cartesian3_default();
43
- var scratchZAxis = new Cartesian3_default();
44
- var obbScratch = new OrientedBoundingBox_default();
45
- CoplanarPolygonGeometryLibrary.validOutline = function(positions) {
46
- Check_default.defined("positions", positions);
47
- const orientedBoundingBox = OrientedBoundingBox_default.fromPoints(
48
- positions,
49
- obbScratch
50
- );
51
- const halfAxes = orientedBoundingBox.halfAxes;
52
- const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis);
53
- const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis);
54
- const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis);
55
- const xMag = Cartesian3_default.magnitude(xAxis);
56
- const yMag = Cartesian3_default.magnitude(yAxis);
57
- const zMag = Cartesian3_default.magnitude(zAxis);
58
- return !(xMag === 0 && (yMag === 0 || zMag === 0) || yMag === 0 && zMag === 0);
59
- };
60
- CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function(positions, centerResult, planeAxis1Result, planeAxis2Result) {
61
- Check_default.defined("positions", positions);
62
- Check_default.defined("centerResult", centerResult);
63
- Check_default.defined("planeAxis1Result", planeAxis1Result);
64
- Check_default.defined("planeAxis2Result", planeAxis2Result);
65
- const orientedBoundingBox = OrientedBoundingBox_default.fromPoints(
66
- positions,
67
- obbScratch
68
- );
69
- const halfAxes = orientedBoundingBox.halfAxes;
70
- const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis);
71
- const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis);
72
- const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis);
73
- const xMag = Cartesian3_default.magnitude(xAxis);
74
- const yMag = Cartesian3_default.magnitude(yAxis);
75
- const zMag = Cartesian3_default.magnitude(zAxis);
76
- const min = Math.min(xMag, yMag, zMag);
77
- if (xMag === 0 && (yMag === 0 || zMag === 0) || yMag === 0 && zMag === 0) {
78
- return false;
79
- }
80
- let planeAxis1;
81
- let planeAxis2;
82
- if (min === yMag || min === zMag) {
83
- planeAxis1 = xAxis;
84
- }
85
- if (min === xMag) {
86
- planeAxis1 = yAxis;
87
- } else if (min === zMag) {
88
- planeAxis2 = yAxis;
89
- }
90
- if (min === xMag || min === yMag) {
91
- planeAxis2 = zAxis;
92
- }
93
- Cartesian3_default.normalize(planeAxis1, planeAxis1Result);
94
- Cartesian3_default.normalize(planeAxis2, planeAxis2Result);
95
- Cartesian3_default.clone(orientedBoundingBox.center, centerResult);
96
- return true;
97
- };
98
- function projectTo2D(position, center, axis1, axis2, result) {
99
- const v = Cartesian3_default.subtract(position, center, scratchIntersectionPoint);
100
- const x = Cartesian3_default.dot(axis1, v);
101
- const y = Cartesian3_default.dot(axis2, v);
102
- return Cartesian2_default.fromElements(x, y, result);
103
- }
104
- CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function(center, axis1, axis2) {
105
- return function(positions) {
106
- const positionResults = new Array(positions.length);
107
- for (let i = 0; i < positions.length; i++) {
108
- positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);
109
- }
110
- return positionResults;
111
- };
112
- };
113
- CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function(center, axis1, axis2) {
114
- return function(position, result) {
115
- return projectTo2D(position, center, axis1, axis2, result);
116
- };
117
- };
118
- var CoplanarPolygonGeometryLibrary_default = CoplanarPolygonGeometryLibrary;
119
-
120
- export {
121
- CoplanarPolygonGeometryLibrary_default
122
- };
@@ -1,390 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
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-27HUZ7SA.js";
29
- import {
30
- GeometryOffsetAttribute_default
31
- } from "./chunk-I2ITFFPX.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-26GA3JAM.js";
35
- import {
36
- GeometryAttributes_default
37
- } from "./chunk-DI5NGJUP.js";
38
- import {
39
- GeometryAttribute_default,
40
- Geometry_default,
41
- PrimitiveType_default
42
- } from "./chunk-GWCFU2SA.js";
43
- import {
44
- BoundingSphere_default
45
- } from "./chunk-VJZB3WAV.js";
46
- import {
47
- ComponentDatatype_default
48
- } from "./chunk-K4GQUNB5.js";
49
- import {
50
- Cartesian3_default,
51
- Ellipsoid_default
52
- } from "./chunk-YFXQECWV.js";
53
- import {
54
- Math_default
55
- } from "./chunk-XY4BATBS.js";
56
- import {
57
- defaultValue_default
58
- } from "./chunk-7JO7GPJN.js";
59
- import {
60
- DeveloperError_default
61
- } from "./chunk-AD63PIY6.js";
62
- import {
63
- defined_default
64
- } from "./chunk-E63IIM5T.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 = defaultValue_default(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 = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
215
- const center = options.center;
216
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.default);
217
- const semiMajorAxis = options.semiMajorAxis;
218
- const semiMinorAxis = options.semiMinorAxis;
219
- const granularity = defaultValue_default(
220
- options.granularity,
221
- Math_default.RADIANS_PER_DEGREE
222
- );
223
- if (!defined_default(center)) {
224
- throw new DeveloperError_default("center is required.");
225
- }
226
- if (!defined_default(semiMajorAxis)) {
227
- throw new DeveloperError_default("semiMajorAxis is required.");
228
- }
229
- if (!defined_default(semiMinorAxis)) {
230
- throw new DeveloperError_default("semiMinorAxis is required.");
231
- }
232
- if (semiMajorAxis < semiMinorAxis) {
233
- throw new DeveloperError_default(
234
- "semiMajorAxis must be greater than or equal to the semiMinorAxis."
235
- );
236
- }
237
- if (granularity <= 0) {
238
- throw new DeveloperError_default("granularity must be greater than zero.");
239
- }
240
- const height = defaultValue_default(options.height, 0);
241
- const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
242
- this._center = Cartesian3_default.clone(center);
243
- this._semiMajorAxis = semiMajorAxis;
244
- this._semiMinorAxis = semiMinorAxis;
245
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
246
- this._rotation = defaultValue_default(options.rotation, 0);
247
- this._height = Math.max(extrudedHeight, height);
248
- this._granularity = granularity;
249
- this._extrudedHeight = Math.min(extrudedHeight, height);
250
- this._numberOfVerticalLines = Math.max(
251
- defaultValue_default(options.numberOfVerticalLines, 16),
252
- 0
253
- );
254
- this._offsetAttribute = options.offsetAttribute;
255
- this._workerName = "createEllipseOutlineGeometry";
256
- }
257
- EllipseOutlineGeometry.packedLength = Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 8;
258
- EllipseOutlineGeometry.pack = function(value, array, startingIndex) {
259
- if (!defined_default(value)) {
260
- throw new DeveloperError_default("value is required");
261
- }
262
- if (!defined_default(array)) {
263
- throw new DeveloperError_default("array is required");
264
- }
265
- startingIndex = defaultValue_default(startingIndex, 0);
266
- Cartesian3_default.pack(value._center, array, startingIndex);
267
- startingIndex += Cartesian3_default.packedLength;
268
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
269
- startingIndex += Ellipsoid_default.packedLength;
270
- array[startingIndex++] = value._semiMajorAxis;
271
- array[startingIndex++] = value._semiMinorAxis;
272
- array[startingIndex++] = value._rotation;
273
- array[startingIndex++] = value._height;
274
- array[startingIndex++] = value._granularity;
275
- array[startingIndex++] = value._extrudedHeight;
276
- array[startingIndex++] = value._numberOfVerticalLines;
277
- array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
278
- return array;
279
- };
280
- var scratchCenter = new Cartesian3_default();
281
- var scratchEllipsoid = new Ellipsoid_default();
282
- var scratchOptions = {
283
- center: scratchCenter,
284
- ellipsoid: scratchEllipsoid,
285
- semiMajorAxis: void 0,
286
- semiMinorAxis: void 0,
287
- rotation: void 0,
288
- height: void 0,
289
- granularity: void 0,
290
- extrudedHeight: void 0,
291
- numberOfVerticalLines: void 0,
292
- offsetAttribute: void 0
293
- };
294
- EllipseOutlineGeometry.unpack = function(array, startingIndex, result) {
295
- if (!defined_default(array)) {
296
- throw new DeveloperError_default("array is required");
297
- }
298
- startingIndex = defaultValue_default(startingIndex, 0);
299
- const center = Cartesian3_default.unpack(array, startingIndex, scratchCenter);
300
- startingIndex += Cartesian3_default.packedLength;
301
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
302
- startingIndex += Ellipsoid_default.packedLength;
303
- const semiMajorAxis = array[startingIndex++];
304
- const semiMinorAxis = array[startingIndex++];
305
- const rotation = array[startingIndex++];
306
- const height = array[startingIndex++];
307
- const granularity = array[startingIndex++];
308
- const extrudedHeight = array[startingIndex++];
309
- const numberOfVerticalLines = array[startingIndex++];
310
- const offsetAttribute = array[startingIndex];
311
- if (!defined_default(result)) {
312
- scratchOptions.height = height;
313
- scratchOptions.extrudedHeight = extrudedHeight;
314
- scratchOptions.granularity = granularity;
315
- scratchOptions.rotation = rotation;
316
- scratchOptions.semiMajorAxis = semiMajorAxis;
317
- scratchOptions.semiMinorAxis = semiMinorAxis;
318
- scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
319
- scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
320
- return new EllipseOutlineGeometry(scratchOptions);
321
- }
322
- result._center = Cartesian3_default.clone(center, result._center);
323
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
324
- result._semiMajorAxis = semiMajorAxis;
325
- result._semiMinorAxis = semiMinorAxis;
326
- result._rotation = rotation;
327
- result._height = height;
328
- result._granularity = granularity;
329
- result._extrudedHeight = extrudedHeight;
330
- result._numberOfVerticalLines = numberOfVerticalLines;
331
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
332
- return result;
333
- };
334
- EllipseOutlineGeometry.createGeometry = function(ellipseGeometry) {
335
- if (ellipseGeometry._semiMajorAxis <= 0 || ellipseGeometry._semiMinorAxis <= 0) {
336
- return;
337
- }
338
- const height = ellipseGeometry._height;
339
- const extrudedHeight = ellipseGeometry._extrudedHeight;
340
- const extrude = !Math_default.equalsEpsilon(
341
- height,
342
- extrudedHeight,
343
- 0,
344
- Math_default.EPSILON2
345
- );
346
- ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
347
- ellipseGeometry._center,
348
- ellipseGeometry._center
349
- );
350
- const options = {
351
- center: ellipseGeometry._center,
352
- semiMajorAxis: ellipseGeometry._semiMajorAxis,
353
- semiMinorAxis: ellipseGeometry._semiMinorAxis,
354
- ellipsoid: ellipseGeometry._ellipsoid,
355
- rotation: ellipseGeometry._rotation,
356
- height,
357
- granularity: ellipseGeometry._granularity,
358
- numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines
359
- };
360
- let geometry;
361
- if (extrude) {
362
- options.extrudedHeight = extrudedHeight;
363
- options.offsetAttribute = ellipseGeometry._offsetAttribute;
364
- geometry = computeExtrudedEllipse(options);
365
- } else {
366
- geometry = computeEllipse(options);
367
- if (defined_default(ellipseGeometry._offsetAttribute)) {
368
- const length = geometry.attributes.position.values.length;
369
- const offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
370
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
371
- geometry.attributes.applyOffset = new GeometryAttribute_default({
372
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
373
- componentsPerAttribute: 1,
374
- values: applyOffset
375
- });
376
- }
377
- }
378
- return new Geometry_default({
379
- attributes: geometry.attributes,
380
- indices: geometry.indices,
381
- primitiveType: PrimitiveType_default.LINES,
382
- boundingSphere: geometry.boundingSphere,
383
- offsetAttribute: ellipseGeometry._offsetAttribute
384
- });
385
- };
386
- var EllipseOutlineGeometry_default = EllipseOutlineGeometry;
387
-
388
- export {
389
- EllipseOutlineGeometry_default
390
- };
@@ -1,59 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
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
- Matrix4_default
28
- } from "./chunk-5PTXS2GO.js";
29
- import {
30
- defaultValue_default
31
- } from "./chunk-7JO7GPJN.js";
32
- import {
33
- DeveloperError_default
34
- } from "./chunk-AD63PIY6.js";
35
- import {
36
- defined_default
37
- } from "./chunk-E63IIM5T.js";
38
-
39
- // packages/engine/Source/Core/GeometryInstance.js
40
- function GeometryInstance(options) {
41
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
42
- if (!defined_default(options.geometry)) {
43
- throw new DeveloperError_default("options.geometry is required.");
44
- }
45
- this.geometry = options.geometry;
46
- this.modelMatrix = Matrix4_default.clone(
47
- defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
48
- );
49
- this.id = options.id;
50
- this.pickPrimitive = options.pickPrimitive;
51
- this.attributes = defaultValue_default(options.attributes, {});
52
- this.westHemisphereGeometry = void 0;
53
- this.eastHemisphereGeometry = void 0;
54
- }
55
- var GeometryInstance_default = GeometryInstance;
56
-
57
- export {
58
- GeometryInstance_default
59
- };