@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,73 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
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
- defaultValue_default
28
- } from "./chunk-BBWDMCVU.js";
29
- import {
30
- defined_default
31
- } from "./chunk-YWTJ2B4B.js";
32
-
33
- // packages/engine/Source/Core/combine.js
34
- function combine(object1, object2, deep) {
35
- deep = defaultValue_default(deep, false);
36
- const result = {};
37
- const object1Defined = defined_default(object1);
38
- const object2Defined = defined_default(object2);
39
- let property;
40
- let object1Value;
41
- let object2Value;
42
- if (object1Defined) {
43
- for (property in object1) {
44
- if (object1.hasOwnProperty(property)) {
45
- object1Value = object1[property];
46
- if (object2Defined && deep && typeof object1Value === "object" && object2.hasOwnProperty(property)) {
47
- object2Value = object2[property];
48
- if (typeof object2Value === "object") {
49
- result[property] = combine(object1Value, object2Value, deep);
50
- } else {
51
- result[property] = object1Value;
52
- }
53
- } else {
54
- result[property] = object1Value;
55
- }
56
- }
57
- }
58
- }
59
- if (object2Defined) {
60
- for (property in object2) {
61
- if (object2.hasOwnProperty(property) && !result.hasOwnProperty(property)) {
62
- object2Value = object2[property];
63
- result[property] = object2Value;
64
- }
65
- }
66
- }
67
- return result;
68
- }
69
- var combine_default = combine;
70
-
71
- export {
72
- combine_default
73
- };
@@ -1,59 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
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-YJEBABKH.js";
29
- import {
30
- defaultValue_default
31
- } from "./chunk-BBWDMCVU.js";
32
- import {
33
- DeveloperError_default
34
- } from "./chunk-XGI5BXZY.js";
35
- import {
36
- defined_default
37
- } from "./chunk-YWTJ2B4B.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
- };
@@ -1,390 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
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-EERJKOAF.js";
29
- import {
30
- GeometryOffsetAttribute_default
31
- } from "./chunk-F3YA3Y2Z.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-LPR3YNP2.js";
35
- import {
36
- GeometryAttributes_default
37
- } from "./chunk-4H7PY4U5.js";
38
- import {
39
- GeometryAttribute_default,
40
- Geometry_default,
41
- PrimitiveType_default
42
- } from "./chunk-7TC63SJW.js";
43
- import {
44
- BoundingSphere_default
45
- } from "./chunk-FJKNFAKQ.js";
46
- import {
47
- ComponentDatatype_default
48
- } from "./chunk-PPH7OFP3.js";
49
- import {
50
- Cartesian3_default,
51
- Ellipsoid_default
52
- } from "./chunk-OGXZVPPM.js";
53
- import {
54
- Math_default
55
- } from "./chunk-5QULIR53.js";
56
- import {
57
- defaultValue_default
58
- } from "./chunk-BBWDMCVU.js";
59
- import {
60
- DeveloperError_default
61
- } from "./chunk-XGI5BXZY.js";
62
- import {
63
- defined_default
64
- } from "./chunk-YWTJ2B4B.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.WGS84);
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
- };