@pggis/pg-sdk 3.3.9 → 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.
- package/README.md +8 -8
- package/dist/index.js +1966 -4
- package/dist/pggis.min.css +1 -1
- package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
- package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
- package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
- package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
- package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
- package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
- package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
- package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
- package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
- package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
- package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
- package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
- package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
- package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
- package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
- package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
- package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
- package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
- package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
- package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
- package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
- package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
- package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
- package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
- package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
- package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
- package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
- package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
- package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
- package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
- package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
- package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
- package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
- package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
- package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
- package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
- package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
- package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
- package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
- package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
- package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
- package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
- package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
- package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
- package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
- package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
- package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
- package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
- package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
- package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
- package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
- package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
- package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
- package/dist/resources/Workers/combineGeometry.js +2 -44
- package/dist/resources/Workers/createBoxGeometry.js +2 -34
- package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
- package/dist/resources/Workers/createCircleGeometry.js +2 -173
- package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
- package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
- package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
- package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
- package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
- package/dist/resources/Workers/createCylinderGeometry.js +2 -36
- package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
- package/dist/resources/Workers/createEllipseGeometry.js +2 -47
- package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
- package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
- package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
- package/dist/resources/Workers/createFrustumGeometry.js +2 -34
- package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
- package/dist/resources/Workers/createGeometry.js +2 -147
- package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
- package/dist/resources/Workers/createPlaneGeometry.js +2 -200
- package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
- package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
- package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
- package/dist/resources/Workers/createPolylineGeometry.js +2 -472
- package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
- package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
- package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
- package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
- package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
- package/dist/resources/Workers/createSphereGeometry.js +2 -94
- package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
- package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
- package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
- package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
- package/dist/resources/Workers/createVectorTilePoints.js +2 -88
- package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
- package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
- package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
- package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
- package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
- package/dist/resources/Workers/createWallGeometry.js +2 -466
- package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
- package/dist/resources/Workers/decodeDraco.js +2 -345
- package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
- package/dist/resources/Workers/decodeI3S.js +2 -1320
- package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
- package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/resources/Workers/transcodeKTX2.js +29 -3398
- package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
- package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
- package/package.json +9 -8
- package/dist/pggis.min.js +0 -14796
- package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
- package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
- package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
- package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
- package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
- package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
- package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
- package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
- package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
- package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
- package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
- package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
- package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
- package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
- package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
- package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
- package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
- package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
- package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
- package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
- package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
- package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
- package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
- package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
- package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
- package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
- package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
- package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
- package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
- package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
- package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
- package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
- package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
- package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
- package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
- package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
- package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
- package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
- package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
- package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
- package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
- package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
- package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
- package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
- package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
- package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
- package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
- package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
- package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
- package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
- package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
|
@@ -1,421 +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
|
-
EllipsoidGeodesic_default
|
|
28
|
-
} from "./chunk-F4HFJMGM.js";
|
|
29
|
-
import {
|
|
30
|
-
EllipsoidRhumbLine_default
|
|
31
|
-
} from "./chunk-SH5USDPI.js";
|
|
32
|
-
import {
|
|
33
|
-
IntersectionTests_default
|
|
34
|
-
} from "./chunk-2FRVPMCS.js";
|
|
35
|
-
import {
|
|
36
|
-
Plane_default
|
|
37
|
-
} from "./chunk-Y5UQJLYE.js";
|
|
38
|
-
import {
|
|
39
|
-
Matrix4_default
|
|
40
|
-
} from "./chunk-YJEBABKH.js";
|
|
41
|
-
import {
|
|
42
|
-
Cartesian3_default,
|
|
43
|
-
Cartographic_default,
|
|
44
|
-
Ellipsoid_default
|
|
45
|
-
} from "./chunk-OGXZVPPM.js";
|
|
46
|
-
import {
|
|
47
|
-
Math_default
|
|
48
|
-
} from "./chunk-5QULIR53.js";
|
|
49
|
-
import {
|
|
50
|
-
defaultValue_default
|
|
51
|
-
} from "./chunk-BBWDMCVU.js";
|
|
52
|
-
import {
|
|
53
|
-
DeveloperError_default
|
|
54
|
-
} from "./chunk-XGI5BXZY.js";
|
|
55
|
-
import {
|
|
56
|
-
defined_default
|
|
57
|
-
} from "./chunk-YWTJ2B4B.js";
|
|
58
|
-
|
|
59
|
-
// packages/engine/Source/Core/PolylinePipeline.js
|
|
60
|
-
var PolylinePipeline = {};
|
|
61
|
-
PolylinePipeline.numberOfPoints = function(p0, p1, minDistance) {
|
|
62
|
-
const distance = Cartesian3_default.distance(p0, p1);
|
|
63
|
-
return Math.ceil(distance / minDistance);
|
|
64
|
-
};
|
|
65
|
-
PolylinePipeline.numberOfPointsRhumbLine = function(p0, p1, granularity) {
|
|
66
|
-
const radiansDistanceSquared = Math.pow(p0.longitude - p1.longitude, 2) + Math.pow(p0.latitude - p1.latitude, 2);
|
|
67
|
-
return Math.max(
|
|
68
|
-
1,
|
|
69
|
-
Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)))
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
var cartoScratch = new Cartographic_default();
|
|
73
|
-
PolylinePipeline.extractHeights = function(positions, ellipsoid) {
|
|
74
|
-
const length = positions.length;
|
|
75
|
-
const heights = new Array(length);
|
|
76
|
-
for (let i = 0; i < length; i++) {
|
|
77
|
-
const p = positions[i];
|
|
78
|
-
heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch).height;
|
|
79
|
-
}
|
|
80
|
-
return heights;
|
|
81
|
-
};
|
|
82
|
-
var wrapLongitudeInversMatrix = new Matrix4_default();
|
|
83
|
-
var wrapLongitudeOrigin = new Cartesian3_default();
|
|
84
|
-
var wrapLongitudeXZNormal = new Cartesian3_default();
|
|
85
|
-
var wrapLongitudeXZPlane = new Plane_default(Cartesian3_default.UNIT_X, 0);
|
|
86
|
-
var wrapLongitudeYZNormal = new Cartesian3_default();
|
|
87
|
-
var wrapLongitudeYZPlane = new Plane_default(Cartesian3_default.UNIT_X, 0);
|
|
88
|
-
var wrapLongitudeIntersection = new Cartesian3_default();
|
|
89
|
-
var wrapLongitudeOffset = new Cartesian3_default();
|
|
90
|
-
var subdivideHeightsScratchArray = [];
|
|
91
|
-
function subdivideHeights(numPoints, h0, h1) {
|
|
92
|
-
const heights = subdivideHeightsScratchArray;
|
|
93
|
-
heights.length = numPoints;
|
|
94
|
-
let i;
|
|
95
|
-
if (h0 === h1) {
|
|
96
|
-
for (i = 0; i < numPoints; i++) {
|
|
97
|
-
heights[i] = h0;
|
|
98
|
-
}
|
|
99
|
-
return heights;
|
|
100
|
-
}
|
|
101
|
-
const dHeight = h1 - h0;
|
|
102
|
-
const heightPerVertex = dHeight / numPoints;
|
|
103
|
-
for (i = 0; i < numPoints; i++) {
|
|
104
|
-
const h = h0 + i * heightPerVertex;
|
|
105
|
-
heights[i] = h;
|
|
106
|
-
}
|
|
107
|
-
return heights;
|
|
108
|
-
}
|
|
109
|
-
var carto1 = new Cartographic_default();
|
|
110
|
-
var carto2 = new Cartographic_default();
|
|
111
|
-
var cartesian = new Cartesian3_default();
|
|
112
|
-
var scaleFirst = new Cartesian3_default();
|
|
113
|
-
var scaleLast = new Cartesian3_default();
|
|
114
|
-
var ellipsoidGeodesic = new EllipsoidGeodesic_default();
|
|
115
|
-
var ellipsoidRhumb = new EllipsoidRhumbLine_default();
|
|
116
|
-
function generateCartesianArc(p0, p1, minDistance, ellipsoid, h0, h1, array, offset) {
|
|
117
|
-
const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);
|
|
118
|
-
const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);
|
|
119
|
-
const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);
|
|
120
|
-
const start = ellipsoid.cartesianToCartographic(first, carto1);
|
|
121
|
-
const end = ellipsoid.cartesianToCartographic(last, carto2);
|
|
122
|
-
const heights = subdivideHeights(numPoints, h0, h1);
|
|
123
|
-
ellipsoidGeodesic.setEndPoints(start, end);
|
|
124
|
-
const surfaceDistanceBetweenPoints = ellipsoidGeodesic.surfaceDistance / numPoints;
|
|
125
|
-
let index = offset;
|
|
126
|
-
start.height = h0;
|
|
127
|
-
let cart = ellipsoid.cartographicToCartesian(start, cartesian);
|
|
128
|
-
Cartesian3_default.pack(cart, array, index);
|
|
129
|
-
index += 3;
|
|
130
|
-
for (let i = 1; i < numPoints; i++) {
|
|
131
|
-
const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
|
|
132
|
-
i * surfaceDistanceBetweenPoints,
|
|
133
|
-
carto2
|
|
134
|
-
);
|
|
135
|
-
carto.height = heights[i];
|
|
136
|
-
cart = ellipsoid.cartographicToCartesian(carto, cartesian);
|
|
137
|
-
Cartesian3_default.pack(cart, array, index);
|
|
138
|
-
index += 3;
|
|
139
|
-
}
|
|
140
|
-
return index;
|
|
141
|
-
}
|
|
142
|
-
function generateCartesianRhumbArc(p0, p1, granularity, ellipsoid, h0, h1, array, offset) {
|
|
143
|
-
const start = ellipsoid.cartesianToCartographic(p0, carto1);
|
|
144
|
-
const end = ellipsoid.cartesianToCartographic(p1, carto2);
|
|
145
|
-
const numPoints = PolylinePipeline.numberOfPointsRhumbLine(
|
|
146
|
-
start,
|
|
147
|
-
end,
|
|
148
|
-
granularity
|
|
149
|
-
);
|
|
150
|
-
start.height = 0;
|
|
151
|
-
end.height = 0;
|
|
152
|
-
const heights = subdivideHeights(numPoints, h0, h1);
|
|
153
|
-
if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {
|
|
154
|
-
ellipsoidRhumb = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
|
|
155
|
-
}
|
|
156
|
-
ellipsoidRhumb.setEndPoints(start, end);
|
|
157
|
-
const surfaceDistanceBetweenPoints = ellipsoidRhumb.surfaceDistance / numPoints;
|
|
158
|
-
let index = offset;
|
|
159
|
-
start.height = h0;
|
|
160
|
-
let cart = ellipsoid.cartographicToCartesian(start, cartesian);
|
|
161
|
-
Cartesian3_default.pack(cart, array, index);
|
|
162
|
-
index += 3;
|
|
163
|
-
for (let i = 1; i < numPoints; i++) {
|
|
164
|
-
const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(
|
|
165
|
-
i * surfaceDistanceBetweenPoints,
|
|
166
|
-
carto2
|
|
167
|
-
);
|
|
168
|
-
carto.height = heights[i];
|
|
169
|
-
cart = ellipsoid.cartographicToCartesian(carto, cartesian);
|
|
170
|
-
Cartesian3_default.pack(cart, array, index);
|
|
171
|
-
index += 3;
|
|
172
|
-
}
|
|
173
|
-
return index;
|
|
174
|
-
}
|
|
175
|
-
PolylinePipeline.wrapLongitude = function(positions, modelMatrix) {
|
|
176
|
-
const cartesians = [];
|
|
177
|
-
const segments = [];
|
|
178
|
-
if (defined_default(positions) && positions.length > 0) {
|
|
179
|
-
modelMatrix = defaultValue_default(modelMatrix, Matrix4_default.IDENTITY);
|
|
180
|
-
const inverseModelMatrix = Matrix4_default.inverseTransformation(
|
|
181
|
-
modelMatrix,
|
|
182
|
-
wrapLongitudeInversMatrix
|
|
183
|
-
);
|
|
184
|
-
const origin = Matrix4_default.multiplyByPoint(
|
|
185
|
-
inverseModelMatrix,
|
|
186
|
-
Cartesian3_default.ZERO,
|
|
187
|
-
wrapLongitudeOrigin
|
|
188
|
-
);
|
|
189
|
-
const xzNormal = Cartesian3_default.normalize(
|
|
190
|
-
Matrix4_default.multiplyByPointAsVector(
|
|
191
|
-
inverseModelMatrix,
|
|
192
|
-
Cartesian3_default.UNIT_Y,
|
|
193
|
-
wrapLongitudeXZNormal
|
|
194
|
-
),
|
|
195
|
-
wrapLongitudeXZNormal
|
|
196
|
-
);
|
|
197
|
-
const xzPlane = Plane_default.fromPointNormal(
|
|
198
|
-
origin,
|
|
199
|
-
xzNormal,
|
|
200
|
-
wrapLongitudeXZPlane
|
|
201
|
-
);
|
|
202
|
-
const yzNormal = Cartesian3_default.normalize(
|
|
203
|
-
Matrix4_default.multiplyByPointAsVector(
|
|
204
|
-
inverseModelMatrix,
|
|
205
|
-
Cartesian3_default.UNIT_X,
|
|
206
|
-
wrapLongitudeYZNormal
|
|
207
|
-
),
|
|
208
|
-
wrapLongitudeYZNormal
|
|
209
|
-
);
|
|
210
|
-
const yzPlane = Plane_default.fromPointNormal(
|
|
211
|
-
origin,
|
|
212
|
-
yzNormal,
|
|
213
|
-
wrapLongitudeYZPlane
|
|
214
|
-
);
|
|
215
|
-
let count = 1;
|
|
216
|
-
cartesians.push(Cartesian3_default.clone(positions[0]));
|
|
217
|
-
let prev = cartesians[0];
|
|
218
|
-
const length = positions.length;
|
|
219
|
-
for (let i = 1; i < length; ++i) {
|
|
220
|
-
const cur = positions[i];
|
|
221
|
-
if (Plane_default.getPointDistance(yzPlane, prev) < 0 || Plane_default.getPointDistance(yzPlane, cur) < 0) {
|
|
222
|
-
const intersection = IntersectionTests_default.lineSegmentPlane(
|
|
223
|
-
prev,
|
|
224
|
-
cur,
|
|
225
|
-
xzPlane,
|
|
226
|
-
wrapLongitudeIntersection
|
|
227
|
-
);
|
|
228
|
-
if (defined_default(intersection)) {
|
|
229
|
-
const offset = Cartesian3_default.multiplyByScalar(
|
|
230
|
-
xzNormal,
|
|
231
|
-
5e-9,
|
|
232
|
-
wrapLongitudeOffset
|
|
233
|
-
);
|
|
234
|
-
if (Plane_default.getPointDistance(xzPlane, prev) < 0) {
|
|
235
|
-
Cartesian3_default.negate(offset, offset);
|
|
236
|
-
}
|
|
237
|
-
cartesians.push(
|
|
238
|
-
Cartesian3_default.add(intersection, offset, new Cartesian3_default())
|
|
239
|
-
);
|
|
240
|
-
segments.push(count + 1);
|
|
241
|
-
Cartesian3_default.negate(offset, offset);
|
|
242
|
-
cartesians.push(
|
|
243
|
-
Cartesian3_default.add(intersection, offset, new Cartesian3_default())
|
|
244
|
-
);
|
|
245
|
-
count = 1;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
cartesians.push(Cartesian3_default.clone(positions[i]));
|
|
249
|
-
count++;
|
|
250
|
-
prev = cur;
|
|
251
|
-
}
|
|
252
|
-
segments.push(count);
|
|
253
|
-
}
|
|
254
|
-
return {
|
|
255
|
-
positions: cartesians,
|
|
256
|
-
lengths: segments
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
PolylinePipeline.generateArc = function(options) {
|
|
260
|
-
if (!defined_default(options)) {
|
|
261
|
-
options = {};
|
|
262
|
-
}
|
|
263
|
-
const positions = options.positions;
|
|
264
|
-
if (!defined_default(positions)) {
|
|
265
|
-
throw new DeveloperError_default("options.positions is required.");
|
|
266
|
-
}
|
|
267
|
-
const length = positions.length;
|
|
268
|
-
const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
|
|
269
|
-
let height = defaultValue_default(options.height, 0);
|
|
270
|
-
const hasHeightArray = Array.isArray(height);
|
|
271
|
-
if (length < 1) {
|
|
272
|
-
return [];
|
|
273
|
-
} else if (length === 1) {
|
|
274
|
-
const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
|
|
275
|
-
height = hasHeightArray ? height[0] : height;
|
|
276
|
-
if (height !== 0) {
|
|
277
|
-
const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
|
|
278
|
-
Cartesian3_default.multiplyByScalar(n, height, n);
|
|
279
|
-
Cartesian3_default.add(p, n, p);
|
|
280
|
-
}
|
|
281
|
-
return [p.x, p.y, p.z];
|
|
282
|
-
}
|
|
283
|
-
let minDistance = options.minDistance;
|
|
284
|
-
if (!defined_default(minDistance)) {
|
|
285
|
-
const granularity = defaultValue_default(
|
|
286
|
-
options.granularity,
|
|
287
|
-
Math_default.RADIANS_PER_DEGREE
|
|
288
|
-
);
|
|
289
|
-
minDistance = Math_default.chordLength(granularity, ellipsoid.maximumRadius);
|
|
290
|
-
}
|
|
291
|
-
let numPoints = 0;
|
|
292
|
-
let i;
|
|
293
|
-
for (i = 0; i < length - 1; i++) {
|
|
294
|
-
numPoints += PolylinePipeline.numberOfPoints(
|
|
295
|
-
positions[i],
|
|
296
|
-
positions[i + 1],
|
|
297
|
-
minDistance
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
const arrayLength = (numPoints + 1) * 3;
|
|
301
|
-
const newPositions = new Array(arrayLength);
|
|
302
|
-
let offset = 0;
|
|
303
|
-
for (i = 0; i < length - 1; i++) {
|
|
304
|
-
const p0 = positions[i];
|
|
305
|
-
const p1 = positions[i + 1];
|
|
306
|
-
const h0 = hasHeightArray ? height[i] : height;
|
|
307
|
-
const h1 = hasHeightArray ? height[i + 1] : height;
|
|
308
|
-
offset = generateCartesianArc(
|
|
309
|
-
p0,
|
|
310
|
-
p1,
|
|
311
|
-
minDistance,
|
|
312
|
-
ellipsoid,
|
|
313
|
-
h0,
|
|
314
|
-
h1,
|
|
315
|
-
newPositions,
|
|
316
|
-
offset
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
subdivideHeightsScratchArray.length = 0;
|
|
320
|
-
const lastPoint = positions[length - 1];
|
|
321
|
-
const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
|
|
322
|
-
carto.height = hasHeightArray ? height[length - 1] : height;
|
|
323
|
-
const cart = ellipsoid.cartographicToCartesian(carto, cartesian);
|
|
324
|
-
Cartesian3_default.pack(cart, newPositions, arrayLength - 3);
|
|
325
|
-
return newPositions;
|
|
326
|
-
};
|
|
327
|
-
var scratchCartographic0 = new Cartographic_default();
|
|
328
|
-
var scratchCartographic1 = new Cartographic_default();
|
|
329
|
-
PolylinePipeline.generateRhumbArc = function(options) {
|
|
330
|
-
if (!defined_default(options)) {
|
|
331
|
-
options = {};
|
|
332
|
-
}
|
|
333
|
-
const positions = options.positions;
|
|
334
|
-
if (!defined_default(positions)) {
|
|
335
|
-
throw new DeveloperError_default("options.positions is required.");
|
|
336
|
-
}
|
|
337
|
-
const length = positions.length;
|
|
338
|
-
const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
|
|
339
|
-
let height = defaultValue_default(options.height, 0);
|
|
340
|
-
const hasHeightArray = Array.isArray(height);
|
|
341
|
-
if (length < 1) {
|
|
342
|
-
return [];
|
|
343
|
-
} else if (length === 1) {
|
|
344
|
-
const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
|
|
345
|
-
height = hasHeightArray ? height[0] : height;
|
|
346
|
-
if (height !== 0) {
|
|
347
|
-
const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
|
|
348
|
-
Cartesian3_default.multiplyByScalar(n, height, n);
|
|
349
|
-
Cartesian3_default.add(p, n, p);
|
|
350
|
-
}
|
|
351
|
-
return [p.x, p.y, p.z];
|
|
352
|
-
}
|
|
353
|
-
const granularity = defaultValue_default(
|
|
354
|
-
options.granularity,
|
|
355
|
-
Math_default.RADIANS_PER_DEGREE
|
|
356
|
-
);
|
|
357
|
-
let numPoints = 0;
|
|
358
|
-
let i;
|
|
359
|
-
let c0 = ellipsoid.cartesianToCartographic(
|
|
360
|
-
positions[0],
|
|
361
|
-
scratchCartographic0
|
|
362
|
-
);
|
|
363
|
-
let c1;
|
|
364
|
-
for (i = 0; i < length - 1; i++) {
|
|
365
|
-
c1 = ellipsoid.cartesianToCartographic(
|
|
366
|
-
positions[i + 1],
|
|
367
|
-
scratchCartographic1
|
|
368
|
-
);
|
|
369
|
-
numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity);
|
|
370
|
-
c0 = Cartographic_default.clone(c1, scratchCartographic0);
|
|
371
|
-
}
|
|
372
|
-
const arrayLength = (numPoints + 1) * 3;
|
|
373
|
-
const newPositions = new Array(arrayLength);
|
|
374
|
-
let offset = 0;
|
|
375
|
-
for (i = 0; i < length - 1; i++) {
|
|
376
|
-
const p0 = positions[i];
|
|
377
|
-
const p1 = positions[i + 1];
|
|
378
|
-
const h0 = hasHeightArray ? height[i] : height;
|
|
379
|
-
const h1 = hasHeightArray ? height[i + 1] : height;
|
|
380
|
-
offset = generateCartesianRhumbArc(
|
|
381
|
-
p0,
|
|
382
|
-
p1,
|
|
383
|
-
granularity,
|
|
384
|
-
ellipsoid,
|
|
385
|
-
h0,
|
|
386
|
-
h1,
|
|
387
|
-
newPositions,
|
|
388
|
-
offset
|
|
389
|
-
);
|
|
390
|
-
}
|
|
391
|
-
subdivideHeightsScratchArray.length = 0;
|
|
392
|
-
const lastPoint = positions[length - 1];
|
|
393
|
-
const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
|
|
394
|
-
carto.height = hasHeightArray ? height[length - 1] : height;
|
|
395
|
-
const cart = ellipsoid.cartographicToCartesian(carto, cartesian);
|
|
396
|
-
Cartesian3_default.pack(cart, newPositions, arrayLength - 3);
|
|
397
|
-
return newPositions;
|
|
398
|
-
};
|
|
399
|
-
PolylinePipeline.generateCartesianArc = function(options) {
|
|
400
|
-
const numberArray = PolylinePipeline.generateArc(options);
|
|
401
|
-
const size = numberArray.length / 3;
|
|
402
|
-
const newPositions = new Array(size);
|
|
403
|
-
for (let i = 0; i < size; i++) {
|
|
404
|
-
newPositions[i] = Cartesian3_default.unpack(numberArray, i * 3);
|
|
405
|
-
}
|
|
406
|
-
return newPositions;
|
|
407
|
-
};
|
|
408
|
-
PolylinePipeline.generateCartesianRhumbArc = function(options) {
|
|
409
|
-
const numberArray = PolylinePipeline.generateRhumbArc(options);
|
|
410
|
-
const size = numberArray.length / 3;
|
|
411
|
-
const newPositions = new Array(size);
|
|
412
|
-
for (let i = 0; i < size; i++) {
|
|
413
|
-
newPositions[i] = Cartesian3_default.unpack(numberArray, i * 3);
|
|
414
|
-
}
|
|
415
|
-
return newPositions;
|
|
416
|
-
};
|
|
417
|
-
var PolylinePipeline_default = PolylinePipeline;
|
|
418
|
-
|
|
419
|
-
export {
|
|
420
|
-
PolylinePipeline_default
|
|
421
|
-
};
|
|
@@ -1,138 +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
|
-
Math_default
|
|
28
|
-
} from "./chunk-5QULIR53.js";
|
|
29
|
-
import {
|
|
30
|
-
WebGLConstants_default
|
|
31
|
-
} from "./chunk-SOWMRMWA.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/IndexDatatype.js
|
|
40
|
-
var IndexDatatype = {
|
|
41
|
-
/**
|
|
42
|
-
* 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
|
|
43
|
-
* of an element in <code>Uint8Array</code>.
|
|
44
|
-
*
|
|
45
|
-
* @type {number}
|
|
46
|
-
* @constant
|
|
47
|
-
*/
|
|
48
|
-
UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
|
|
49
|
-
/**
|
|
50
|
-
* 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
|
|
51
|
-
* of an element in <code>Uint16Array</code>.
|
|
52
|
-
*
|
|
53
|
-
* @type {number}
|
|
54
|
-
* @constant
|
|
55
|
-
*/
|
|
56
|
-
UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
|
|
57
|
-
/**
|
|
58
|
-
* 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
|
|
59
|
-
* of an element in <code>Uint32Array</code>.
|
|
60
|
-
*
|
|
61
|
-
* @type {number}
|
|
62
|
-
* @constant
|
|
63
|
-
*/
|
|
64
|
-
UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT
|
|
65
|
-
};
|
|
66
|
-
IndexDatatype.getSizeInBytes = function(indexDatatype) {
|
|
67
|
-
switch (indexDatatype) {
|
|
68
|
-
case IndexDatatype.UNSIGNED_BYTE:
|
|
69
|
-
return Uint8Array.BYTES_PER_ELEMENT;
|
|
70
|
-
case IndexDatatype.UNSIGNED_SHORT:
|
|
71
|
-
return Uint16Array.BYTES_PER_ELEMENT;
|
|
72
|
-
case IndexDatatype.UNSIGNED_INT:
|
|
73
|
-
return Uint32Array.BYTES_PER_ELEMENT;
|
|
74
|
-
}
|
|
75
|
-
throw new DeveloperError_default(
|
|
76
|
-
"indexDatatype is required and must be a valid IndexDatatype constant."
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
IndexDatatype.fromSizeInBytes = function(sizeInBytes) {
|
|
80
|
-
switch (sizeInBytes) {
|
|
81
|
-
case 2:
|
|
82
|
-
return IndexDatatype.UNSIGNED_SHORT;
|
|
83
|
-
case 4:
|
|
84
|
-
return IndexDatatype.UNSIGNED_INT;
|
|
85
|
-
case 1:
|
|
86
|
-
return IndexDatatype.UNSIGNED_BYTE;
|
|
87
|
-
default:
|
|
88
|
-
throw new DeveloperError_default(
|
|
89
|
-
"Size in bytes cannot be mapped to an IndexDatatype"
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
IndexDatatype.validate = function(indexDatatype) {
|
|
94
|
-
return defined_default(indexDatatype) && (indexDatatype === IndexDatatype.UNSIGNED_BYTE || indexDatatype === IndexDatatype.UNSIGNED_SHORT || indexDatatype === IndexDatatype.UNSIGNED_INT);
|
|
95
|
-
};
|
|
96
|
-
IndexDatatype.createTypedArray = function(numberOfVertices, indicesLengthOrArray) {
|
|
97
|
-
if (!defined_default(numberOfVertices)) {
|
|
98
|
-
throw new DeveloperError_default("numberOfVertices is required.");
|
|
99
|
-
}
|
|
100
|
-
if (numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
|
|
101
|
-
return new Uint32Array(indicesLengthOrArray);
|
|
102
|
-
}
|
|
103
|
-
return new Uint16Array(indicesLengthOrArray);
|
|
104
|
-
};
|
|
105
|
-
IndexDatatype.createTypedArrayFromArrayBuffer = function(numberOfVertices, sourceArray, byteOffset, length) {
|
|
106
|
-
if (!defined_default(numberOfVertices)) {
|
|
107
|
-
throw new DeveloperError_default("numberOfVertices is required.");
|
|
108
|
-
}
|
|
109
|
-
if (!defined_default(sourceArray)) {
|
|
110
|
-
throw new DeveloperError_default("sourceArray is required.");
|
|
111
|
-
}
|
|
112
|
-
if (!defined_default(byteOffset)) {
|
|
113
|
-
throw new DeveloperError_default("byteOffset is required.");
|
|
114
|
-
}
|
|
115
|
-
if (numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
|
|
116
|
-
return new Uint32Array(sourceArray, byteOffset, length);
|
|
117
|
-
}
|
|
118
|
-
return new Uint16Array(sourceArray, byteOffset, length);
|
|
119
|
-
};
|
|
120
|
-
IndexDatatype.fromTypedArray = function(array) {
|
|
121
|
-
if (array instanceof Uint8Array) {
|
|
122
|
-
return IndexDatatype.UNSIGNED_BYTE;
|
|
123
|
-
}
|
|
124
|
-
if (array instanceof Uint16Array) {
|
|
125
|
-
return IndexDatatype.UNSIGNED_SHORT;
|
|
126
|
-
}
|
|
127
|
-
if (array instanceof Uint32Array) {
|
|
128
|
-
return IndexDatatype.UNSIGNED_INT;
|
|
129
|
-
}
|
|
130
|
-
throw new DeveloperError_default(
|
|
131
|
-
"array must be a Uint8Array, Uint16Array, or Uint32Array."
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
var IndexDatatype_default = Object.freeze(IndexDatatype);
|
|
135
|
-
|
|
136
|
-
export {
|
|
137
|
-
IndexDatatype_default
|
|
138
|
-
};
|