@itwin/ecschema-rpcinterface-tests 4.5.0-dev.4 → 4.5.0-dev.6
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/lib/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +401 -254
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -25632,15 +25632,12 @@ class Logger {
|
|
|
25632
25632
|
const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorStack(err)}` : "";
|
|
25633
25633
|
return _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err) + stack;
|
|
25634
25634
|
}
|
|
25635
|
-
/** Log the specified exception. The special "ExceptionType" property will be added as metadata
|
|
25636
|
-
* in addition to any other metadata that may be supplied by the caller, unless the
|
|
25637
|
-
* metadata supplied by the caller already includes this property.
|
|
25635
|
+
/** Log the specified exception. The special "ExceptionType" property will be added as metadata.
|
|
25638
25636
|
* @param category The category of the message.
|
|
25639
25637
|
* @param err The exception object.
|
|
25640
25638
|
* @param log The logger output function to use - defaults to Logger.logError
|
|
25641
|
-
* @param metaData Optional data for the message
|
|
25642
25639
|
*/
|
|
25643
|
-
static logException(category, err, log = (_category, message) => Logger.logError(_category, message)) {
|
|
25640
|
+
static logException(category, err, log = (_category, message, metaData) => Logger.logError(_category, message, metaData)) {
|
|
25644
25641
|
log(category, Logger.getExceptionMessage(err), () => {
|
|
25645
25642
|
return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMetadata(err), exceptionType: err.constructor.name };
|
|
25646
25643
|
});
|
|
@@ -43277,6 +43274,7 @@ SubCategoryOverride.defaults = new SubCategoryOverride({});
|
|
|
43277
43274
|
"use strict";
|
|
43278
43275
|
__webpack_require__.r(__webpack_exports__);
|
|
43279
43276
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
43277
|
+
/* harmony export */ "CesiumTerrainAssetId": () => (/* binding */ CesiumTerrainAssetId),
|
|
43280
43278
|
/* harmony export */ "TerrainHeightOriginMode": () => (/* binding */ TerrainHeightOriginMode),
|
|
43281
43279
|
/* harmony export */ "TerrainSettings": () => (/* binding */ TerrainSettings)
|
|
43282
43280
|
/* harmony export */ });
|
|
@@ -43287,6 +43285,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43287
43285
|
/** @packageDocumentation
|
|
43288
43286
|
* @module DisplayStyles
|
|
43289
43287
|
*/
|
|
43288
|
+
/** Ids of [Cesium ION assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.
|
|
43289
|
+
* These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain".
|
|
43290
|
+
* You may alternatively use the Id of any ION asset to which you have access.
|
|
43291
|
+
* @see [[TerrainSettings.fromCesiumIonAsset]] to create TerrainSettings that obtain terrain from a specified ION asset.
|
|
43292
|
+
* @public
|
|
43293
|
+
*/
|
|
43294
|
+
var CesiumTerrainAssetId;
|
|
43295
|
+
(function (CesiumTerrainAssetId) {
|
|
43296
|
+
/** Default [global 3d terrain](https://cesium.com/platform/cesium-ion/content/cesium-world-terrain/). */
|
|
43297
|
+
CesiumTerrainAssetId["Default"] = "1";
|
|
43298
|
+
/** Global 3d terrain that includes [bathymetry](https://cesium.com/platform/cesium-ion/content/cesium-world-bathymetry/) (seafloor) terrain. */
|
|
43299
|
+
CesiumTerrainAssetId["Bathymetry"] = "2426648";
|
|
43300
|
+
})(CesiumTerrainAssetId || (CesiumTerrainAssetId = {}));
|
|
43290
43301
|
/** Correction modes for terrain height
|
|
43291
43302
|
* @see [[TerrainProps]]
|
|
43292
43303
|
* @public
|
|
@@ -43312,11 +43323,24 @@ class TerrainSettings {
|
|
|
43312
43323
|
get nonLocatable() {
|
|
43313
43324
|
return this._nonLocatable;
|
|
43314
43325
|
}
|
|
43315
|
-
|
|
43316
|
-
|
|
43317
|
-
|
|
43318
|
-
|
|
43319
|
-
|
|
43326
|
+
/** @internal */
|
|
43327
|
+
constructor(providerNameOrProps, exaggeration, applyLighting, heightOrigin, heightOriginMode) {
|
|
43328
|
+
let providerName;
|
|
43329
|
+
let dataSource;
|
|
43330
|
+
let nonLocatable;
|
|
43331
|
+
if (typeof providerNameOrProps === "string") {
|
|
43332
|
+
providerName = providerNameOrProps;
|
|
43333
|
+
}
|
|
43334
|
+
else if (providerNameOrProps) {
|
|
43335
|
+
({ providerName, dataSource, exaggeration, applyLighting, heightOrigin, heightOriginMode, nonLocatable } = providerNameOrProps);
|
|
43336
|
+
}
|
|
43337
|
+
this.providerName = providerName ?? "CesiumWorldTerrain";
|
|
43338
|
+
this.dataSource = dataSource ?? "";
|
|
43339
|
+
this.exaggeration = Math.min(100, Math.max(0.1, exaggeration ?? 1.0));
|
|
43340
|
+
this.applyLighting = applyLighting ?? false;
|
|
43341
|
+
this.heightOrigin = heightOrigin ?? 0.0;
|
|
43342
|
+
if (true === nonLocatable)
|
|
43343
|
+
this._nonLocatable = true;
|
|
43320
43344
|
switch (heightOriginMode) {
|
|
43321
43345
|
case TerrainHeightOriginMode.Ground:
|
|
43322
43346
|
case TerrainHeightOriginMode.Geoid:
|
|
@@ -43328,18 +43352,24 @@ class TerrainSettings {
|
|
|
43328
43352
|
}
|
|
43329
43353
|
}
|
|
43330
43354
|
static fromJSON(json) {
|
|
43331
|
-
|
|
43332
|
-
|
|
43333
|
-
|
|
43334
|
-
|
|
43335
|
-
|
|
43336
|
-
|
|
43337
|
-
|
|
43355
|
+
return new TerrainSettings(json);
|
|
43356
|
+
}
|
|
43357
|
+
/** Create settings that obtain terrain from a [Cesium ION asset](https://cesium.com/platform/cesium-ion/content/) such as
|
|
43358
|
+
* one of those defined by [[CesiumTerrainAssetId]].
|
|
43359
|
+
* @note You must ensure your Cesium ION account has access to the specified asset.
|
|
43360
|
+
*/
|
|
43361
|
+
static fromCesiumIonAsset(assetId = CesiumTerrainAssetId.Default, options) {
|
|
43362
|
+
return TerrainSettings.fromJSON({
|
|
43363
|
+
...options,
|
|
43364
|
+
dataSource: assetId,
|
|
43365
|
+
});
|
|
43338
43366
|
}
|
|
43339
43367
|
toJSON() {
|
|
43340
43368
|
const props = { heightOriginMode: this.heightOriginMode };
|
|
43341
43369
|
if ("CesiumWorldTerrain" !== this.providerName)
|
|
43342
43370
|
props.providerName = this.providerName;
|
|
43371
|
+
if (this.dataSource)
|
|
43372
|
+
props.dataSource = this.dataSource;
|
|
43343
43373
|
if (1 !== this.exaggeration)
|
|
43344
43374
|
props.exaggeration = this.exaggeration;
|
|
43345
43375
|
if (this.nonLocatable)
|
|
@@ -43351,7 +43381,7 @@ class TerrainSettings {
|
|
|
43351
43381
|
return props;
|
|
43352
43382
|
}
|
|
43353
43383
|
equals(other) {
|
|
43354
|
-
return this.providerName === other.providerName && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting
|
|
43384
|
+
return this.providerName === other.providerName && this.dataSource === other.dataSource && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting
|
|
43355
43385
|
&& this.heightOrigin === other.heightOrigin && this.heightOriginMode === other.heightOriginMode && this.nonLocatable === other.nonLocatable;
|
|
43356
43386
|
}
|
|
43357
43387
|
/** Returns true if these settings are equivalent to the supplied JSON settings. */
|
|
@@ -43367,6 +43397,7 @@ class TerrainSettings {
|
|
|
43367
43397
|
return this;
|
|
43368
43398
|
const props = {
|
|
43369
43399
|
providerName: changedProps.providerName ?? this.providerName,
|
|
43400
|
+
dataSource: changedProps.dataSource ?? this.dataSource,
|
|
43370
43401
|
exaggeration: changedProps.exaggeration ?? this.exaggeration,
|
|
43371
43402
|
nonLocatable: changedProps.nonLocatable ?? this.nonLocatable,
|
|
43372
43403
|
applyLighting: changedProps.applyLighting ?? this.applyLighting,
|
|
@@ -45389,6 +45420,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45389
45420
|
/* harmony export */ "Carto2DDegrees": () => (/* reexport safe */ _geometry_Projection__WEBPACK_IMPORTED_MODULE_48__.Carto2DDegrees),
|
|
45390
45421
|
/* harmony export */ "Cartographic": () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_38__.Cartographic),
|
|
45391
45422
|
/* harmony export */ "CartographicRange": () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_38__.CartographicRange),
|
|
45423
|
+
/* harmony export */ "CesiumTerrainAssetId": () => (/* reexport safe */ _TerrainSettings__WEBPACK_IMPORTED_MODULE_103__.CesiumTerrainAssetId),
|
|
45392
45424
|
/* harmony export */ "ChangeOpCode": () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangeOpCode),
|
|
45393
45425
|
/* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _IModelError__WEBPACK_IMPORTED_MODULE_62__.ChangeSetStatus),
|
|
45394
45426
|
/* harmony export */ "ChangedValueState": () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangedValueState),
|
|
@@ -55818,7 +55850,7 @@ var RpcResponseCacheControl;
|
|
|
55818
55850
|
})(RpcResponseCacheControl || (RpcResponseCacheControl = {}));
|
|
55819
55851
|
/** RPC protocol event types.
|
|
55820
55852
|
* @public
|
|
55821
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in
|
|
55853
|
+
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
55822
55854
|
*/
|
|
55823
55855
|
var RpcProtocolEvent;
|
|
55824
55856
|
(function (RpcProtocolEvent) {
|
|
@@ -55838,7 +55870,7 @@ var RpcProtocolEvent;
|
|
|
55838
55870
|
})(RpcProtocolEvent || (RpcProtocolEvent = {}));
|
|
55839
55871
|
/** The status of an RPC operation request.
|
|
55840
55872
|
* @public
|
|
55841
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in
|
|
55873
|
+
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
55842
55874
|
*/
|
|
55843
55875
|
var RpcRequestStatus;
|
|
55844
55876
|
(function (RpcRequestStatus) {
|
|
@@ -55858,7 +55890,7 @@ var RpcRequestStatus;
|
|
|
55858
55890
|
RpcRequestStatus[RpcRequestStatus["RequestTimeout"] = 13] = "RequestTimeout";
|
|
55859
55891
|
RpcRequestStatus[RpcRequestStatus["TooManyRequests"] = 14] = "TooManyRequests";
|
|
55860
55892
|
})(RpcRequestStatus || (RpcRequestStatus = {}));
|
|
55861
|
-
/** @public @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in
|
|
55893
|
+
/** @public @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future. */
|
|
55862
55894
|
(function (RpcRequestStatus) {
|
|
55863
55895
|
function isTransientError(status) {
|
|
55864
55896
|
return status === RpcRequestStatus.BadGateway || status === RpcRequestStatus.ServiceUnavailable || status === RpcRequestStatus.GatewayTimeout
|
|
@@ -55868,7 +55900,7 @@ var RpcRequestStatus;
|
|
|
55868
55900
|
})(RpcRequestStatus || (RpcRequestStatus = {}));
|
|
55869
55901
|
/** RPC request event types.
|
|
55870
55902
|
* @public
|
|
55871
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in
|
|
55903
|
+
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
55872
55904
|
*/
|
|
55873
55905
|
var RpcRequestEvent;
|
|
55874
55906
|
(function (RpcRequestEvent) {
|
|
@@ -55878,7 +55910,7 @@ var RpcRequestEvent;
|
|
|
55878
55910
|
})(RpcRequestEvent || (RpcRequestEvent = {}));
|
|
55879
55911
|
/** RPC content types.
|
|
55880
55912
|
* @public
|
|
55881
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in
|
|
55913
|
+
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
55882
55914
|
*/
|
|
55883
55915
|
var RpcContentType;
|
|
55884
55916
|
(function (RpcContentType) {
|
|
@@ -55890,7 +55922,7 @@ var RpcContentType;
|
|
|
55890
55922
|
})(RpcContentType || (RpcContentType = {}));
|
|
55891
55923
|
/** Endpoints for RPC protocols.
|
|
55892
55924
|
* @public
|
|
55893
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in
|
|
55925
|
+
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
55894
55926
|
*/
|
|
55895
55927
|
var RpcEndpoint;
|
|
55896
55928
|
(function (RpcEndpoint) {
|
|
@@ -85708,7 +85740,7 @@ class RealityDataSourceCesiumIonAssetImpl {
|
|
|
85708
85740
|
// The following is only if the reality data is not stored on PW Context Share.
|
|
85709
85741
|
const cesiumAsset = _tile_internal__WEBPACK_IMPORTED_MODULE_3__.CesiumIonAssetProvider.parseCesiumUrl(url);
|
|
85710
85742
|
if (cesiumAsset) {
|
|
85711
|
-
const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(cesiumAsset.id
|
|
85743
|
+
const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(`${cesiumAsset.id}`, cesiumAsset.key);
|
|
85712
85744
|
if (tokenAndUrl.url && tokenAndUrl.token) {
|
|
85713
85745
|
url = tokenAndUrl.url;
|
|
85714
85746
|
this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;
|
|
@@ -150684,7 +150716,7 @@ function getCesiumOSMBuildingsUrl() {
|
|
|
150684
150716
|
return getCesiumAssetUrl(osmBuildingAssetId, key);
|
|
150685
150717
|
}
|
|
150686
150718
|
/** @internal */
|
|
150687
|
-
async function getCesiumAccessTokenAndEndpointUrl(assetId
|
|
150719
|
+
async function getCesiumAccessTokenAndEndpointUrl(assetId, requestKey) {
|
|
150688
150720
|
if (undefined === requestKey) {
|
|
150689
150721
|
requestKey = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tileAdmin.cesiumIonKey;
|
|
150690
150722
|
if (undefined === requestKey)
|
|
@@ -150715,7 +150747,7 @@ function notifyTerrainError(detailedDescription) {
|
|
|
150715
150747
|
}
|
|
150716
150748
|
/** @internal */
|
|
150717
150749
|
async function getCesiumTerrainProvider(opts) {
|
|
150718
|
-
const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
|
|
150750
|
+
const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default);
|
|
150719
150751
|
if (!accessTokenAndEndpointUrl.token || !accessTokenAndEndpointUrl.url) {
|
|
150720
150752
|
notifyTerrainError(_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString(`iModelJs:BackgroundMap.MissingCesiumToken`));
|
|
150721
150753
|
return undefined;
|
|
@@ -150801,13 +150833,17 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
|
|
|
150801
150833
|
this._tilingScheme = tilingScheme;
|
|
150802
150834
|
this._tileAvailability = tileAvailability;
|
|
150803
150835
|
this._metaDataAvailableLevel = metaDataAvailableLevel;
|
|
150836
|
+
this._assetId = opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default;
|
|
150804
150837
|
this._tokenTimeOut = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().plus(CesiumTerrainProvider._tokenTimeoutInterval);
|
|
150805
150838
|
}
|
|
150806
150839
|
addLogoCards(cards) {
|
|
150807
150840
|
if (cards.dataset.cesiumIonLogoCard)
|
|
150808
150841
|
return;
|
|
150809
150842
|
cards.dataset.cesiumIonLogoCard = "true";
|
|
150810
|
-
|
|
150843
|
+
let notice = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumWorldTerrainAttribution");
|
|
150844
|
+
if (this._assetId === _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Bathymetry)
|
|
150845
|
+
notice = `${notice}\n${_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumBathymetryAttribution")}`;
|
|
150846
|
+
const card = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.makeLogoCard({ iconSrc: `${_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.publicPath}images/cesium-ion.svg`, heading: "Cesium Ion", notice });
|
|
150811
150847
|
cards.appendChild(card);
|
|
150812
150848
|
}
|
|
150813
150849
|
get maxDepth() { return this._maxDepth; }
|
|
@@ -150839,7 +150875,7 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
|
|
|
150839
150875
|
// ###TODO why does he update the access token when reading the mesh instead of when requesting it?
|
|
150840
150876
|
// This function only returns undefined if it fails to acquire token - but it doesn't need the token...
|
|
150841
150877
|
if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().milliseconds > this._tokenTimeOut.milliseconds) {
|
|
150842
|
-
const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
|
|
150878
|
+
const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(this._assetId);
|
|
150843
150879
|
if (!accessTokenAndEndpointUrl.token || args.isCanceled())
|
|
150844
150880
|
return undefined;
|
|
150845
150881
|
this._accessToken = accessTokenAndEndpointUrl.token;
|
|
@@ -156147,13 +156183,16 @@ class MapTreeSupplier {
|
|
|
156147
156183
|
// Terrain-only settings.
|
|
156148
156184
|
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.terrainProviderName, rhs.terrainProviderName);
|
|
156149
156185
|
if (0 === cmp) {
|
|
156150
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.
|
|
156186
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.terrainDataSource, rhs.terrainDataSource);
|
|
156151
156187
|
if (0 === cmp) {
|
|
156152
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.
|
|
156188
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
|
|
156153
156189
|
if (0 === cmp) {
|
|
156154
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.
|
|
156155
|
-
if (0 === cmp)
|
|
156156
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.
|
|
156190
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOriginMode, rhs.terrainHeightOriginMode);
|
|
156191
|
+
if (0 === cmp) {
|
|
156192
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainExaggeration, rhs.terrainExaggeration);
|
|
156193
|
+
if (0 === cmp)
|
|
156194
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleansOrUndefined)(lhs.produceGeometry, rhs.produceGeometry);
|
|
156195
|
+
}
|
|
156157
156196
|
}
|
|
156158
156197
|
}
|
|
156159
156198
|
}
|
|
@@ -156196,6 +156235,7 @@ class MapTreeSupplier {
|
|
|
156196
156235
|
wantSkirts: id.wantSkirts,
|
|
156197
156236
|
exaggeration: id.terrainExaggeration,
|
|
156198
156237
|
wantNormals: id.wantNormals,
|
|
156238
|
+
dataSource: id.terrainDataSource,
|
|
156199
156239
|
};
|
|
156200
156240
|
if (id.applyTerrain) {
|
|
156201
156241
|
await _ApproximateTerrainHeights__WEBPACK_IMPORTED_MODULE_3__.ApproximateTerrainHeights.instance.initialize();
|
|
@@ -156354,6 +156394,7 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
|
|
|
156354
156394
|
tileUserId: this._tileUserId,
|
|
156355
156395
|
applyTerrain: this.settings.applyTerrain && !this._isDrape,
|
|
156356
156396
|
terrainProviderName: this.settings.terrainSettings.providerName,
|
|
156397
|
+
terrainDataSource: this.settings.terrainSettings.dataSource,
|
|
156357
156398
|
terrainHeightOrigin: this.settings.terrainSettings.heightOrigin,
|
|
156358
156399
|
terrainHeightOriginMode: this.settings.terrainSettings.heightOriginMode,
|
|
156359
156400
|
terrainExaggeration: this.settings.terrainSettings.exaggeration,
|
|
@@ -185426,27 +185467,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
185426
185467
|
*/
|
|
185427
185468
|
class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
|
|
185428
185469
|
/** Return a (REFERENCE TO) the coordinate data. */
|
|
185429
|
-
get point() {
|
|
185470
|
+
get point() {
|
|
185471
|
+
return this._xyz;
|
|
185472
|
+
}
|
|
185430
185473
|
/**
|
|
185474
|
+
* Constructor
|
|
185431
185475
|
* @param xyz point to be CAPTURED.
|
|
185432
185476
|
*/
|
|
185433
185477
|
constructor(xyz) {
|
|
185434
185478
|
super();
|
|
185435
|
-
/** String name for interface properties */
|
|
185479
|
+
/** String name for interface properties. */
|
|
185436
185480
|
this.geometryCategory = "point";
|
|
185437
185481
|
this._xyz = xyz;
|
|
185438
185482
|
}
|
|
185439
|
-
/** Create a new CoordinateXYZ containing a CLONE of point */
|
|
185483
|
+
/** Create a new CoordinateXYZ containing a CLONE of point. */
|
|
185440
185484
|
static create(point) {
|
|
185441
185485
|
return new CoordinateXYZ(point.clone());
|
|
185442
185486
|
}
|
|
185443
|
-
/** Create a new CoordinateXYZ */
|
|
185487
|
+
/** Create a new CoordinateXYZ. */
|
|
185444
185488
|
static createXYZ(x = 0, y = 0, z = 0) {
|
|
185445
185489
|
return new CoordinateXYZ(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z));
|
|
185446
185490
|
}
|
|
185447
|
-
/** Return the range of the point */
|
|
185448
|
-
range() {
|
|
185449
|
-
|
|
185491
|
+
/** Return the range of the point. */
|
|
185492
|
+
range() {
|
|
185493
|
+
return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(this._xyz);
|
|
185494
|
+
}
|
|
185495
|
+
/** Extend `rangeToExtend` to include this point (optionally transformed). */
|
|
185450
185496
|
extendRange(rangeToExtend, transform) {
|
|
185451
185497
|
if (transform)
|
|
185452
185498
|
rangeToExtend.extendTransformedXYZ(transform, this._xyz.x, this._xyz.y, this._xyz.z);
|
|
@@ -185458,27 +185504,23 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
185458
185504
|
transform.multiplyPoint3d(this._xyz, this._xyz);
|
|
185459
185505
|
return true;
|
|
185460
185506
|
}
|
|
185461
|
-
/** Return a transformed clone */
|
|
185507
|
+
/** Return a transformed clone. */
|
|
185462
185508
|
cloneTransformed(transform) {
|
|
185463
185509
|
const result = new CoordinateXYZ(this._xyz.clone());
|
|
185464
185510
|
result.tryTransformInPlace(transform);
|
|
185465
185511
|
return result;
|
|
185466
185512
|
}
|
|
185467
|
-
/** Return a clone */
|
|
185513
|
+
/** Return a clone. */
|
|
185468
185514
|
clone() {
|
|
185469
185515
|
return new CoordinateXYZ(this._xyz.clone());
|
|
185470
185516
|
}
|
|
185471
|
-
/**
|
|
185472
|
-
* Return GeometryQuery children for recursive queries.
|
|
185473
|
-
* * Leaf classes do not need to implement.
|
|
185474
|
-
*/
|
|
185475
185517
|
/** Test if (other instanceof Coordinate). */
|
|
185476
185518
|
isSameGeometryClass(other) {
|
|
185477
185519
|
return other instanceof CoordinateXYZ;
|
|
185478
185520
|
}
|
|
185479
185521
|
/**
|
|
185480
185522
|
* Test for exact structure and nearly identical geometry.
|
|
185481
|
-
* * Leaf classes must implement
|
|
185523
|
+
* * Leaf classes must implement.
|
|
185482
185524
|
* * Base class implementation recurses through children.
|
|
185483
185525
|
* * Base implementation is complete for classes with children and no properties.
|
|
185484
185526
|
* * Classes with both children and properties must implement for properties, call super for children.
|
|
@@ -185486,7 +185528,7 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
185486
185528
|
isAlmostEqual(other) {
|
|
185487
185529
|
return (other instanceof CoordinateXYZ) && this._xyz.isAlmostEqual(other._xyz);
|
|
185488
185530
|
}
|
|
185489
|
-
/** Second step of double dispatch:
|
|
185531
|
+
/** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
|
|
185490
185532
|
dispatchToGeometryHandler(handler) {
|
|
185491
185533
|
return handler.handleCoordinateXYZ(this);
|
|
185492
185534
|
}
|
|
@@ -189135,13 +189177,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
189135
189177
|
|
|
189136
189178
|
|
|
189137
189179
|
/**
|
|
189138
|
-
* Queries to be supported by Curve, Surface, and Solid objects
|
|
189180
|
+
* Queries to be supported by Curve, Surface, and Solid objects.
|
|
189139
189181
|
* * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,
|
|
189140
|
-
* and bspline surfaces
|
|
189182
|
+
* and bspline surfaces.
|
|
189141
189183
|
* @public
|
|
189142
189184
|
*/
|
|
189143
189185
|
class GeometryQuery {
|
|
189144
|
-
/** Return the range of the entire GeometryQuery tree */
|
|
189186
|
+
/** Return the range of the entire GeometryQuery tree. */
|
|
189145
189187
|
range(transform, result) {
|
|
189146
189188
|
if (result)
|
|
189147
189189
|
result.setNull();
|
|
@@ -189149,7 +189191,7 @@ class GeometryQuery {
|
|
|
189149
189191
|
this.extendRange(range, transform);
|
|
189150
189192
|
return range;
|
|
189151
189193
|
}
|
|
189152
|
-
/** Try to move the geometry by dx,dy,dz */
|
|
189194
|
+
/** Try to move the geometry by dx,dy,dz. */
|
|
189153
189195
|
tryTranslateInPlace(dx, dy = 0.0, dz = 0.0) {
|
|
189154
189196
|
return this.tryTransformInPlace(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslationXYZ(dx, dy, dz));
|
|
189155
189197
|
}
|
|
@@ -189157,13 +189199,15 @@ class GeometryQuery {
|
|
|
189157
189199
|
* Return GeometryQuery children for recursive queries.
|
|
189158
189200
|
* * leaf classes do not need to implement.
|
|
189159
189201
|
*/
|
|
189160
|
-
get children() {
|
|
189202
|
+
get children() {
|
|
189203
|
+
return undefined;
|
|
189204
|
+
}
|
|
189161
189205
|
/**
|
|
189162
189206
|
* Test for exact structure and nearly identical geometry.
|
|
189163
|
-
* * Leaf classes must implement
|
|
189164
|
-
* *
|
|
189165
|
-
* *
|
|
189166
|
-
* *
|
|
189207
|
+
* * Leaf classes must implement.
|
|
189208
|
+
* * Base class implementation recurses through children.
|
|
189209
|
+
* * Base implementation is complete for classes with children and no properties.
|
|
189210
|
+
* * Classes with both children and properties must implement for properties, call super for children.
|
|
189167
189211
|
*/
|
|
189168
189212
|
isAlmostEqual(other) {
|
|
189169
189213
|
if (this.isSameGeometryClass(other)) {
|
|
@@ -189178,20 +189222,19 @@ class GeometryQuery {
|
|
|
189178
189222
|
}
|
|
189179
189223
|
return true;
|
|
189180
189224
|
}
|
|
189181
|
-
else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children
|
|
189182
|
-
return false; // plainly different
|
|
189225
|
+
else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.
|
|
189226
|
+
return false; // plainly different
|
|
189183
189227
|
}
|
|
189184
189228
|
else {
|
|
189185
|
-
// both children null
|
|
189186
|
-
return true;
|
|
189229
|
+
return true; // both children null; call it equal
|
|
189187
189230
|
}
|
|
189188
189231
|
}
|
|
189189
189232
|
return false;
|
|
189190
189233
|
}
|
|
189191
189234
|
/**
|
|
189192
189235
|
* Apply instance method [[isAlmostEqual]] if both are defined.
|
|
189193
|
-
* *
|
|
189194
|
-
* *
|
|
189236
|
+
* * Both undefined returns true.
|
|
189237
|
+
* * Single defined returns false.
|
|
189195
189238
|
*/
|
|
189196
189239
|
static areAlmostEqual(a, b) {
|
|
189197
189240
|
if (a instanceof GeometryQuery && b instanceof GeometryQuery)
|
|
@@ -191825,9 +191868,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
191825
191868
|
*/
|
|
191826
191869
|
class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
|
|
191827
191870
|
/** Test if `other` is a PointString3d */
|
|
191828
|
-
isSameGeometryClass(other) {
|
|
191829
|
-
|
|
191830
|
-
|
|
191871
|
+
isSameGeometryClass(other) {
|
|
191872
|
+
return other instanceof PointString3d;
|
|
191873
|
+
}
|
|
191874
|
+
/** Return a clone of the points array. */
|
|
191875
|
+
get points() {
|
|
191876
|
+
return this._points;
|
|
191877
|
+
}
|
|
191831
191878
|
constructor() {
|
|
191832
191879
|
super();
|
|
191833
191880
|
/** String name for schema properties */
|
|
@@ -191837,11 +191884,18 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191837
191884
|
/** Clone and apply a transform. */
|
|
191838
191885
|
cloneTransformed(transform) {
|
|
191839
191886
|
const c = this.clone();
|
|
191840
|
-
c.tryTransformInPlace(transform);
|
|
191887
|
+
c.tryTransformInPlace(transform); // we know tryTransformInPlace succeeds
|
|
191841
191888
|
return c;
|
|
191842
191889
|
}
|
|
191890
|
+
/**
|
|
191891
|
+
* Turn any array (possibly nested) into a "flat" array of objects that are not arrays. This allows processing
|
|
191892
|
+
* the objects without recursion into nested arrays.
|
|
191893
|
+
*/
|
|
191843
191894
|
static flattenArray(arr) {
|
|
191844
|
-
return arr.reduce(
|
|
191895
|
+
return arr.reduce(
|
|
191896
|
+
// a callback function to execute for each element in the array. Its return value becomes
|
|
191897
|
+
// the value of the "flat" parameter on the next invocation of the callback function.
|
|
191898
|
+
(flat, toFlatten) => {
|
|
191845
191899
|
return flat.concat(Array.isArray(toFlatten) ? PointString3d.flattenArray(toFlatten) : toFlatten);
|
|
191846
191900
|
}, []);
|
|
191847
191901
|
}
|
|
@@ -191851,7 +191905,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191851
191905
|
result.addPoints(points);
|
|
191852
191906
|
return result;
|
|
191853
191907
|
}
|
|
191854
|
-
/** Add multiple points to the PointString3d */
|
|
191908
|
+
/** Add multiple points to the PointString3d. */
|
|
191855
191909
|
addPoints(...points) {
|
|
191856
191910
|
const toAdd = PointString3d.flattenArray(points);
|
|
191857
191911
|
for (const p of toAdd) {
|
|
@@ -191859,25 +191913,25 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191859
191913
|
this._points.push(p);
|
|
191860
191914
|
}
|
|
191861
191915
|
}
|
|
191862
|
-
/** Add a single point to the PointString3d */
|
|
191916
|
+
/** Add a single point to the PointString3d. */
|
|
191863
191917
|
addPoint(point) {
|
|
191864
191918
|
this._points.push(point);
|
|
191865
191919
|
}
|
|
191866
|
-
/** Remove the last point added to the PointString3d */
|
|
191920
|
+
/** Remove the last point added to the PointString3d. */
|
|
191867
191921
|
popPoint() {
|
|
191868
191922
|
this._points.pop();
|
|
191869
191923
|
}
|
|
191870
|
-
/** Replace this PointString3d's point array by a clone of the array in `other
|
|
191924
|
+
/** Replace this PointString3d's point array by a clone of the array in `other`. */
|
|
191871
191925
|
setFrom(other) {
|
|
191872
191926
|
this._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(other._points);
|
|
191873
191927
|
}
|
|
191874
|
-
/** Create from an array of Point3d */
|
|
191928
|
+
/** Create from an array of Point3d. */
|
|
191875
191929
|
static createPoints(points) {
|
|
191876
191930
|
const ps = new PointString3d();
|
|
191877
191931
|
ps._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(points);
|
|
191878
191932
|
return ps;
|
|
191879
191933
|
}
|
|
191880
|
-
/** Create a PointString3d from xyz coordinates packed in a Float64Array */
|
|
191934
|
+
/** Create a PointString3d from xyz coordinates packed in a Float64Array. */
|
|
191881
191935
|
static createFloat64Array(xyzData) {
|
|
191882
191936
|
const ps = new PointString3d();
|
|
191883
191937
|
for (let i = 0; i + 3 <= xyzData.length; i += 3)
|
|
@@ -191890,7 +191944,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191890
191944
|
retVal.setFrom(this);
|
|
191891
191945
|
return retVal;
|
|
191892
191946
|
}
|
|
191893
|
-
/** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,
|
|
191947
|
+
/** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
|
|
191894
191948
|
setFromJSON(json) {
|
|
191895
191949
|
this._points.length = 0;
|
|
191896
191950
|
if (Array.isArray(json)) {
|
|
@@ -191901,7 +191955,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191901
191955
|
}
|
|
191902
191956
|
/**
|
|
191903
191957
|
* Convert an PointString3d to a JSON object.
|
|
191904
|
-
* @return {*} [[
|
|
191958
|
+
* @return {*} e.g., `[[1,2,3], [4,5,6]]`.
|
|
191905
191959
|
*/
|
|
191906
191960
|
toJSON() {
|
|
191907
191961
|
const value = [];
|
|
@@ -191909,7 +191963,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191909
191963
|
value.push(p.toJSON());
|
|
191910
191964
|
return value;
|
|
191911
191965
|
}
|
|
191912
|
-
/** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,
|
|
191966
|
+
/** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
|
|
191913
191967
|
static fromJSON(json) {
|
|
191914
191968
|
const ps = new PointString3d();
|
|
191915
191969
|
ps.setFromJSON(json);
|
|
@@ -191927,14 +191981,16 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191927
191981
|
return undefined;
|
|
191928
191982
|
}
|
|
191929
191983
|
/** Return the number of points. */
|
|
191930
|
-
numPoints() {
|
|
191984
|
+
numPoints() {
|
|
191985
|
+
return this._points.length;
|
|
191986
|
+
}
|
|
191931
191987
|
/** Reverse the point order */
|
|
191932
191988
|
reverseInPlace() {
|
|
191933
191989
|
if (this._points.length >= 2) {
|
|
191934
191990
|
let i0 = 0;
|
|
191935
191991
|
let i1 = this._points.length - 1;
|
|
191936
191992
|
while (i0 < i1) {
|
|
191937
|
-
const a = this._points[
|
|
191993
|
+
const a = this._points[i1];
|
|
191938
191994
|
this._points[i1] = this._points[i0];
|
|
191939
191995
|
this._points[i0] = a;
|
|
191940
191996
|
i0++;
|
|
@@ -191942,7 +191998,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191942
191998
|
}
|
|
191943
191999
|
}
|
|
191944
192000
|
}
|
|
191945
|
-
/**
|
|
192001
|
+
/** Apply transform on points in place. */
|
|
191946
192002
|
tryTransformInPlace(transform) {
|
|
191947
192003
|
transform.multiplyPoint3dArrayInPlace(this._points);
|
|
191948
192004
|
return true;
|
|
@@ -191961,7 +192017,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191961
192017
|
isInPlane(plane) {
|
|
191962
192018
|
return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isCloseToPlane(this._points, plane, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance);
|
|
191963
192019
|
}
|
|
191964
|
-
/** Extend a range to include the points in this PointString3d. */
|
|
192020
|
+
/** Extend a range to include the points in this PointString3d (optionally transformed). */
|
|
191965
192021
|
extendRange(rangeToExtend, transform) {
|
|
191966
192022
|
rangeToExtend.extendArray(this._points, transform);
|
|
191967
192023
|
}
|
|
@@ -191972,8 +192028,10 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
|
|
|
191972
192028
|
return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isAlmostEqual(this._points, other._points);
|
|
191973
192029
|
}
|
|
191974
192030
|
/** Reduce to empty set of points. */
|
|
191975
|
-
clear() {
|
|
191976
|
-
|
|
192031
|
+
clear() {
|
|
192032
|
+
this._points.length = 0;
|
|
192033
|
+
}
|
|
192034
|
+
/** Second step of double dispatch: call `handler.handlePointString(this)` */
|
|
191977
192035
|
dispatchToGeometryHandler(handler) {
|
|
191978
192036
|
return handler.handlePointString3d(this);
|
|
191979
192037
|
}
|
|
@@ -233829,6 +233887,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
233829
233887
|
* @public
|
|
233830
233888
|
*/
|
|
233831
233889
|
class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
|
|
233890
|
+
/** Constructor */
|
|
233832
233891
|
constructor(data) {
|
|
233833
233892
|
super();
|
|
233834
233893
|
/** String name for schema properties */
|
|
@@ -233836,69 +233895,102 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
|
|
|
233836
233895
|
this.data = data;
|
|
233837
233896
|
}
|
|
233838
233897
|
/** Flag indicating if the mesh display must assume both sides are visible. */
|
|
233839
|
-
get twoSided() {
|
|
233840
|
-
|
|
233841
|
-
|
|
233842
|
-
|
|
233843
|
-
|
|
233844
|
-
|
|
233845
|
-
|
|
233846
|
-
|
|
233847
|
-
|
|
233848
|
-
|
|
233849
|
-
|
|
233850
|
-
|
|
233851
|
-
|
|
233852
|
-
|
|
233853
|
-
|
|
233854
|
-
|
|
233898
|
+
get twoSided() {
|
|
233899
|
+
return this.data.twoSided;
|
|
233900
|
+
}
|
|
233901
|
+
set twoSided(value) {
|
|
233902
|
+
this.data.twoSided = value;
|
|
233903
|
+
}
|
|
233904
|
+
/**
|
|
233905
|
+
* Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
|
|
233906
|
+
* * A boundary edge of a mesh is defined as an edge with only one connected facet.
|
|
233907
|
+
* * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
|
|
233908
|
+
*/
|
|
233909
|
+
get expectedClosure() {
|
|
233910
|
+
return this.data.expectedClosure;
|
|
233911
|
+
}
|
|
233912
|
+
set expectedClosure(value) {
|
|
233913
|
+
this.data.expectedClosure = value;
|
|
233914
|
+
}
|
|
233915
|
+
/**
|
|
233916
|
+
* Check validity of indices into a data array.
|
|
233917
|
+
* * It is valid to have both indices and data undefined.
|
|
233918
|
+
* * It is NOT valid for just one to be defined.
|
|
233919
|
+
* * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
|
|
233920
|
+
* @param indices array of indices.
|
|
233921
|
+
* @param indexPositionA first index to test.
|
|
233922
|
+
* @param indexPositionB one past final index to test.
|
|
233923
|
+
* @param data data array.
|
|
233924
|
+
* @param dataLength length of data array.
|
|
233925
|
+
*/
|
|
233855
233926
|
static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
|
|
233856
233927
|
if (indices === undefined && data === undefined)
|
|
233857
233928
|
return true;
|
|
233858
|
-
if (
|
|
233929
|
+
if (indices === undefined || data === undefined)
|
|
233859
233930
|
return false;
|
|
233860
233931
|
if (indexPositionA < 0 || indexPositionA >= indices.length)
|
|
233861
233932
|
return false;
|
|
233862
|
-
if (indexPositionB
|
|
233933
|
+
if (indexPositionB <= indexPositionA || indexPositionB > indices.length)
|
|
233863
233934
|
return false;
|
|
233864
233935
|
for (let i = indexPositionA; i < indexPositionB; i++)
|
|
233865
233936
|
if (indices[i] < 0 || indices[i] >= dataLength)
|
|
233866
233937
|
return false;
|
|
233867
233938
|
return true;
|
|
233868
233939
|
}
|
|
233869
|
-
/**
|
|
233870
|
-
* Returns the number of facets of this polyface. Subclasses should override.
|
|
233871
|
-
*/
|
|
233940
|
+
/** Returns the number of facets of this polyface. Subclasses should override. */
|
|
233872
233941
|
get facetCount() {
|
|
233873
233942
|
return undefined;
|
|
233874
233943
|
}
|
|
233875
233944
|
}
|
|
233876
233945
|
/**
|
|
233877
|
-
* An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,
|
|
233946
|
+
* An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,
|
|
233947
|
+
* normal, param, and color indices.
|
|
233878
233948
|
* @public
|
|
233879
233949
|
*/
|
|
233880
233950
|
class IndexedPolyface extends Polyface {
|
|
233951
|
+
/**
|
|
233952
|
+
* Constructor for a new polyface.
|
|
233953
|
+
* @param data PolyfaceData arrays to capture.
|
|
233954
|
+
* @param facetStart optional array of facet start indices (e.g. known during clone)
|
|
233955
|
+
* @param facetToFacetData optional array of face identifiers (e.g. known during clone)
|
|
233956
|
+
*/
|
|
233957
|
+
constructor(data, facetStart, facetToFaceData) {
|
|
233958
|
+
super(data);
|
|
233959
|
+
if (facetStart)
|
|
233960
|
+
this._facetStart = facetStart.slice(); // deep copy
|
|
233961
|
+
else {
|
|
233962
|
+
this._facetStart = [];
|
|
233963
|
+
this._facetStart.push(0);
|
|
233964
|
+
}
|
|
233965
|
+
if (facetToFaceData)
|
|
233966
|
+
this._facetToFaceData = facetToFaceData.slice(); // deep copy
|
|
233967
|
+
else
|
|
233968
|
+
this._facetToFaceData = [];
|
|
233969
|
+
}
|
|
233881
233970
|
/** Test if other is an instance of `IndexedPolyface` */
|
|
233882
|
-
isSameGeometryClass(other) {
|
|
233971
|
+
isSameGeometryClass(other) {
|
|
233972
|
+
return other instanceof IndexedPolyface;
|
|
233973
|
+
}
|
|
233883
233974
|
/** Tests for equivalence between two IndexedPolyfaces. */
|
|
233884
233975
|
isAlmostEqual(other) {
|
|
233885
233976
|
if (other instanceof IndexedPolyface) {
|
|
233886
|
-
return this.data.isAlmostEqual(other.data) &&
|
|
233977
|
+
return this.data.isAlmostEqual(other.data) &&
|
|
233978
|
+
_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
|
|
233887
233979
|
_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);
|
|
233888
233980
|
}
|
|
233889
233981
|
return false;
|
|
233890
233982
|
}
|
|
233983
|
+
/** Returns true if either the point array or the point index array is empty. */
|
|
233984
|
+
get isEmpty() {
|
|
233985
|
+
return this.data.pointCount === 0 || this.data.pointIndex.length === 0;
|
|
233986
|
+
}
|
|
233891
233987
|
/**
|
|
233892
|
-
*
|
|
233893
|
-
|
|
233894
|
-
|
|
233895
|
-
|
|
233896
|
-
* * apply the transform to points
|
|
233897
|
-
* * apply the (inverse transpose of) the matrix part to normals
|
|
233898
|
-
* * If determinant is negative, also
|
|
233988
|
+
* Transform the mesh.
|
|
233989
|
+
* * Apply the transform to points.
|
|
233990
|
+
* * Apply the (inverse transpose of the) matrix part to normals.
|
|
233991
|
+
* * If determinant of the transform matrix is negative, also
|
|
233899
233992
|
* * negate normals
|
|
233900
233993
|
* * reverse index order around each facet.
|
|
233901
|
-
* @param transform
|
|
233902
233994
|
*/
|
|
233903
233995
|
tryTransformInPlace(transform) {
|
|
233904
233996
|
if (!this.data.tryTransformInPlace(transform))
|
|
@@ -233919,52 +234011,47 @@ class IndexedPolyface extends Polyface {
|
|
|
233919
234011
|
const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
|
|
233920
234012
|
return result;
|
|
233921
234013
|
}
|
|
233922
|
-
/**
|
|
234014
|
+
/**
|
|
234015
|
+
* Return a deep clone with transformed points and normals.
|
|
234016
|
+
* @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.
|
|
234017
|
+
*/
|
|
233923
234018
|
cloneTransformed(transform) {
|
|
233924
234019
|
const result = this.clone();
|
|
233925
234020
|
result.tryTransformInPlace(transform);
|
|
233926
234021
|
return result;
|
|
233927
234022
|
}
|
|
233928
234023
|
/** Reverse the order of indices around all facets. */
|
|
233929
|
-
reverseIndices() {
|
|
234024
|
+
reverseIndices() {
|
|
234025
|
+
this.data.reverseIndices(this._facetStart);
|
|
234026
|
+
}
|
|
233930
234027
|
/** Reverse the direction of all normal vectors. */
|
|
233931
|
-
reverseNormals() {
|
|
233932
|
-
|
|
234028
|
+
reverseNormals() {
|
|
234029
|
+
this.data.reverseNormals();
|
|
234030
|
+
}
|
|
234031
|
+
/**
|
|
234032
|
+
* Return face data using a facet index.
|
|
234033
|
+
* * Returns `undefined` if none found.
|
|
234034
|
+
* * This is the REFERENCE to the FacetFaceData not a copy.
|
|
234035
|
+
*/
|
|
233933
234036
|
tryGetFaceData(i) {
|
|
234037
|
+
if (i < 0 || i >= this._facetToFaceData.length)
|
|
234038
|
+
return undefined;
|
|
233934
234039
|
const faceIndex = this._facetToFaceData[i];
|
|
233935
|
-
if (faceIndex >= this.data.face.length)
|
|
234040
|
+
if (faceIndex < 0 || faceIndex >= this.data.face.length)
|
|
233936
234041
|
return undefined;
|
|
233937
234042
|
return this.data.face[faceIndex];
|
|
233938
234043
|
}
|
|
233939
234044
|
/**
|
|
233940
|
-
*
|
|
233941
|
-
*
|
|
233942
|
-
*
|
|
233943
|
-
*
|
|
233944
|
-
*/
|
|
233945
|
-
constructor(data, facetStart, facetToFaceData) {
|
|
233946
|
-
super(data);
|
|
233947
|
-
if (facetStart)
|
|
233948
|
-
this._facetStart = facetStart.slice();
|
|
233949
|
-
else {
|
|
233950
|
-
this._facetStart = [];
|
|
233951
|
-
this._facetStart.push(0);
|
|
233952
|
-
}
|
|
233953
|
-
if (facetToFaceData)
|
|
233954
|
-
this._facetToFaceData = facetToFaceData.slice();
|
|
233955
|
-
else
|
|
233956
|
-
this._facetToFaceData = [];
|
|
233957
|
-
}
|
|
233958
|
-
/**
|
|
233959
|
-
* * Add facets from source to this polyface.
|
|
233960
|
-
* * Optionally reverse facet indices as per PolyfaceData.reverseIndicesSingleFacet() with preserveStart = false, and invert source normals.
|
|
233961
|
-
* * Optionally apply a transform to points and normals.
|
|
234045
|
+
* Add facets from `source` to `this` polyface.
|
|
234046
|
+
* * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and
|
|
234047
|
+
* invert source normals.
|
|
234048
|
+
* * Optionally apply a `transform` to points and normals.
|
|
233962
234049
|
* * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.
|
|
233963
234050
|
*/
|
|
233964
234051
|
addIndexedPolyface(source, reversed, transform) {
|
|
233965
234052
|
const numSourceFacets = source.facetCount;
|
|
233966
|
-
//
|
|
233967
|
-
//
|
|
234053
|
+
// add point, point index, and edge visibility data
|
|
234054
|
+
// note that there is no need to build an intermediate index map since all points are added
|
|
233968
234055
|
const startOfNewPoints = this.data.point.length;
|
|
233969
234056
|
const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
233970
234057
|
for (let i = 0; i < source.data.point.length; i++) {
|
|
@@ -233991,11 +234078,11 @@ class IndexedPolyface extends Polyface {
|
|
|
233991
234078
|
}
|
|
233992
234079
|
this.terminateFacet(false);
|
|
233993
234080
|
}
|
|
233994
|
-
//
|
|
234081
|
+
// add param and param index data
|
|
233995
234082
|
if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {
|
|
233996
234083
|
const startOfNewParams = this.data.param.length;
|
|
233997
234084
|
this.data.param.pushFromGrowableXYArray(source.data.param);
|
|
233998
|
-
for (let i = 0; i < numSourceFacets; i++) { //
|
|
234085
|
+
for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
|
|
233999
234086
|
const i0 = source._facetStart[i];
|
|
234000
234087
|
const i1 = source._facetStart[i + 1];
|
|
234001
234088
|
if (reversed) {
|
|
@@ -234008,7 +234095,7 @@ class IndexedPolyface extends Polyface {
|
|
|
234008
234095
|
}
|
|
234009
234096
|
}
|
|
234010
234097
|
}
|
|
234011
|
-
//
|
|
234098
|
+
// add normal and normal index data
|
|
234012
234099
|
if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {
|
|
234013
234100
|
const startOfNewNormals = this.data.normal.length;
|
|
234014
234101
|
for (let i = 0; i < source.data.normal.length; i++) {
|
|
@@ -234019,7 +234106,7 @@ class IndexedPolyface extends Polyface {
|
|
|
234019
234106
|
sourceNormal.scaleInPlace(-1.0);
|
|
234020
234107
|
this.addNormal(sourceNormal);
|
|
234021
234108
|
}
|
|
234022
|
-
for (let i = 0; i < numSourceFacets; i++) { //
|
|
234109
|
+
for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
|
|
234023
234110
|
const i0 = source._facetStart[i];
|
|
234024
234111
|
const i1 = source._facetStart[i + 1];
|
|
234025
234112
|
if (reversed) {
|
|
@@ -234032,12 +234119,12 @@ class IndexedPolyface extends Polyface {
|
|
|
234032
234119
|
}
|
|
234033
234120
|
}
|
|
234034
234121
|
}
|
|
234035
|
-
//
|
|
234122
|
+
// add color and color index data
|
|
234036
234123
|
if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {
|
|
234037
234124
|
const startOfNewColors = this.data.color.length;
|
|
234038
234125
|
for (const sourceColor of source.data.color)
|
|
234039
234126
|
this.addColor(sourceColor);
|
|
234040
|
-
for (let i = 0; i < numSourceFacets; i++) { //
|
|
234127
|
+
for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors
|
|
234041
234128
|
const i0 = source._facetStart[i];
|
|
234042
234129
|
const i1 = source._facetStart[i + 1];
|
|
234043
234130
|
if (reversed) {
|
|
@@ -234050,7 +234137,7 @@ class IndexedPolyface extends Polyface {
|
|
|
234050
234137
|
}
|
|
234051
234138
|
}
|
|
234052
234139
|
}
|
|
234053
|
-
//
|
|
234140
|
+
// add face and facetToFace index data
|
|
234054
234141
|
if (source.data.face.length !== 0) {
|
|
234055
234142
|
const startOfNewFaceData = this.data.face.length;
|
|
234056
234143
|
for (const face of source.data.face) {
|
|
@@ -234062,25 +234149,31 @@ class IndexedPolyface extends Polyface {
|
|
|
234062
234149
|
}
|
|
234063
234150
|
}
|
|
234064
234151
|
}
|
|
234065
|
-
/**
|
|
234066
|
-
*
|
|
234152
|
+
/**
|
|
234153
|
+
* Return the total number of indices in zero-terminated style, which includes
|
|
234154
|
+
* * all the indices in the packed zero-based table.
|
|
234067
234155
|
* * one additional index for the zero-terminator of each facet.
|
|
234068
|
-
* @note Note that all index arrays (
|
|
234156
|
+
* @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there
|
|
234069
234157
|
* is not a separate query for each of them.
|
|
234070
234158
|
*/
|
|
234071
|
-
get zeroTerminatedIndexCount() {
|
|
234072
|
-
|
|
234073
|
-
|
|
234074
|
-
|
|
234075
|
-
*
|
|
234159
|
+
get zeroTerminatedIndexCount() {
|
|
234160
|
+
return this.data.pointIndex.length + this._facetStart.length - 1;
|
|
234161
|
+
}
|
|
234162
|
+
/**
|
|
234163
|
+
* Create an empty facet set with coordinate and index data to be supplied later.
|
|
234164
|
+
* @param needNormals true if normals will be constructed.
|
|
234165
|
+
* @param needParams true if uv parameters will be constructed.
|
|
234166
|
+
* @param needColors true if colors will be constructed.
|
|
234167
|
+
* @param twoSided true if the facets are to be considered viewable from the back.
|
|
234076
234168
|
*/
|
|
234077
234169
|
static create(needNormals = false, needParams = false, needColors = false, twoSided = false) {
|
|
234078
234170
|
return new IndexedPolyface(new _PolyfaceData__WEBPACK_IMPORTED_MODULE_3__.PolyfaceData(needNormals, needParams, needColors, twoSided));
|
|
234079
234171
|
}
|
|
234080
|
-
/**
|
|
234081
|
-
*
|
|
234082
|
-
* @param
|
|
234083
|
-
* @
|
|
234172
|
+
/**
|
|
234173
|
+
* Add (a clone of) a point to point array.
|
|
234174
|
+
* @param point the point.
|
|
234175
|
+
* @param priorIndex (optional) index of prior point to check for possible duplicate value.
|
|
234176
|
+
* @returns the zero-based index of the added or duplicate point.
|
|
234084
234177
|
*/
|
|
234085
234178
|
addPoint(point, priorIndex) {
|
|
234086
234179
|
if (priorIndex !== undefined) {
|
|
@@ -234091,12 +234184,21 @@ class IndexedPolyface extends Polyface {
|
|
|
234091
234184
|
this.data.point.pushXYZ(point.x, point.y, point.z);
|
|
234092
234185
|
return this.data.point.length - 1;
|
|
234093
234186
|
}
|
|
234094
|
-
/**
|
|
234095
|
-
*
|
|
234187
|
+
/**
|
|
234188
|
+
* Add a point to point array.
|
|
234189
|
+
* @param x the x coordinate of point.
|
|
234190
|
+
* @param y the y coordinate of point.
|
|
234191
|
+
* @param z the z coordinate of point.
|
|
234192
|
+
* @returns the zero-based index of the added point.
|
|
234096
234193
|
*/
|
|
234097
|
-
addPointXYZ(x, y, z) {
|
|
234098
|
-
|
|
234099
|
-
|
|
234194
|
+
addPointXYZ(x, y, z) {
|
|
234195
|
+
this.data.point.pushXYZ(x, y, z);
|
|
234196
|
+
return this.data.point.length - 1;
|
|
234197
|
+
}
|
|
234198
|
+
/**
|
|
234199
|
+
* Add (a clone of) a uv parameter to the parameter array.
|
|
234200
|
+
* @param param the parameter.
|
|
234201
|
+
* @returns zero-based index of the added param.
|
|
234100
234202
|
*/
|
|
234101
234203
|
addParam(param) {
|
|
234102
234204
|
if (!this.data.param)
|
|
@@ -234104,10 +234206,13 @@ class IndexedPolyface extends Polyface {
|
|
|
234104
234206
|
this.data.param.push(param);
|
|
234105
234207
|
return this.data.param.length - 1;
|
|
234106
234208
|
}
|
|
234107
|
-
/**
|
|
234209
|
+
/**
|
|
234210
|
+
* Add a uv parameter to the parameter array.
|
|
234211
|
+
* @param u the u part of parameter.
|
|
234212
|
+
* @param v the v part of parameter.
|
|
234108
234213
|
* @param priorIndexA first index to check for possible duplicate value.
|
|
234109
234214
|
* @param priorIndexB second index to check for possible duplicate value.
|
|
234110
|
-
* @returns
|
|
234215
|
+
* @returns zero-based index of the added or duplicate parameter.
|
|
234111
234216
|
*/
|
|
234112
234217
|
addParamUV(u, v, priorIndexA, priorIndexB) {
|
|
234113
234218
|
if (!this.data.param)
|
|
@@ -234119,37 +234224,39 @@ class IndexedPolyface extends Polyface {
|
|
|
234119
234224
|
this.data.param.pushXY(u, v);
|
|
234120
234225
|
return this.data.param.length - 1;
|
|
234121
234226
|
}
|
|
234122
|
-
/**
|
|
234227
|
+
/**
|
|
234228
|
+
* Add (a clone of) a normal vector to the normal array.
|
|
234229
|
+
* @param normal the normal vector.
|
|
234123
234230
|
* @param priorIndexA first index to check for possible duplicate value.
|
|
234124
234231
|
* @param priorIndexB second index to check for possible duplicate value.
|
|
234125
|
-
* @returns
|
|
234232
|
+
* @returns zero-based index of the added or duplicate normal.
|
|
234126
234233
|
*/
|
|
234127
234234
|
addNormal(normal, priorIndexA, priorIndexB) {
|
|
234235
|
+
// check if `normal` is duplicate of `dataNormal` at index `i`
|
|
234236
|
+
const normalIsDuplicate = (dataNormal, i) => {
|
|
234237
|
+
const distance = dataNormal.distanceIndexToPoint(i, normal);
|
|
234238
|
+
return distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance);
|
|
234239
|
+
};
|
|
234128
234240
|
if (this.data.normal !== undefined) {
|
|
234129
|
-
|
|
234130
|
-
|
|
234131
|
-
|
|
234132
|
-
|
|
234133
|
-
|
|
234134
|
-
}
|
|
234135
|
-
if (priorIndexB !== undefined) {
|
|
234136
|
-
distance = this.data.normal.distanceIndexToPoint(priorIndexB, normal);
|
|
234137
|
-
if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
|
|
234138
|
-
return priorIndexB;
|
|
234139
|
-
}
|
|
234140
|
-
// Note: Do NOT attempt to chain to tail if no prior indices given.
|
|
234141
|
-
// But if they are, look also to the tail.
|
|
234241
|
+
if (priorIndexA !== undefined && normalIsDuplicate(this.data.normal, priorIndexA))
|
|
234242
|
+
return priorIndexA;
|
|
234243
|
+
if (priorIndexB !== undefined && normalIsDuplicate(this.data.normal, priorIndexB))
|
|
234244
|
+
return priorIndexB;
|
|
234245
|
+
// check the tail index for possible duplicate
|
|
234142
234246
|
if (priorIndexA !== undefined || priorIndexB !== undefined) {
|
|
234143
234247
|
const tailIndex = this.data.normal.length - 1;
|
|
234144
|
-
|
|
234145
|
-
if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
|
|
234248
|
+
if (normalIsDuplicate(this.data.normal, tailIndex))
|
|
234146
234249
|
return tailIndex;
|
|
234147
234250
|
}
|
|
234148
234251
|
}
|
|
234149
234252
|
return this.addNormalXYZ(normal.x, normal.y, normal.z);
|
|
234150
234253
|
}
|
|
234151
|
-
/**
|
|
234152
|
-
*
|
|
234254
|
+
/**
|
|
234255
|
+
* Add a normal vector to the normal array.
|
|
234256
|
+
* @param x the x coordinate of normal.
|
|
234257
|
+
* @param y the y coordinate of normal.
|
|
234258
|
+
* @param z the z coordinate of normal.
|
|
234259
|
+
* @returns zero-based index of the added normal vector.
|
|
234153
234260
|
*/
|
|
234154
234261
|
addNormalXYZ(x, y, z) {
|
|
234155
234262
|
if (!this.data.normal)
|
|
@@ -234157,8 +234264,10 @@ class IndexedPolyface extends Polyface {
|
|
|
234157
234264
|
this.data.normal.pushXYZ(x, y, z);
|
|
234158
234265
|
return this.data.normal.length - 1;
|
|
234159
234266
|
}
|
|
234160
|
-
/**
|
|
234161
|
-
*
|
|
234267
|
+
/**
|
|
234268
|
+
* Add a color to the color array
|
|
234269
|
+
* @param color the color.
|
|
234270
|
+
* @returns zero-based index of the added color.
|
|
234162
234271
|
*/
|
|
234163
234272
|
addColor(color) {
|
|
234164
234273
|
if (!this.data.color)
|
|
@@ -234167,46 +234276,54 @@ class IndexedPolyface extends Polyface {
|
|
|
234167
234276
|
return this.data.color.length - 1;
|
|
234168
234277
|
}
|
|
234169
234278
|
/** Add a point index with edge visibility flag. */
|
|
234170
|
-
addPointIndex(index, visible = true) {
|
|
234171
|
-
|
|
234279
|
+
addPointIndex(index, visible = true) {
|
|
234280
|
+
this.data.pointIndex.push(index);
|
|
234281
|
+
this.data.edgeVisible.push(visible);
|
|
234282
|
+
}
|
|
234283
|
+
/** Add a normal index. */
|
|
234172
234284
|
addNormalIndex(index) {
|
|
234173
234285
|
if (!this.data.normalIndex)
|
|
234174
234286
|
this.data.normalIndex = [];
|
|
234175
234287
|
this.data.normalIndex.push(index);
|
|
234176
234288
|
}
|
|
234177
|
-
/** Add a param index */
|
|
234289
|
+
/** Add a param index. */
|
|
234178
234290
|
addParamIndex(index) {
|
|
234179
234291
|
if (!this.data.paramIndex)
|
|
234180
234292
|
this.data.paramIndex = [];
|
|
234181
234293
|
this.data.paramIndex.push(index);
|
|
234182
234294
|
}
|
|
234183
|
-
/** Add a color index */
|
|
234295
|
+
/** Add a color index. */
|
|
234184
234296
|
addColorIndex(index) {
|
|
234185
234297
|
if (!this.data.colorIndex)
|
|
234186
234298
|
this.data.colorIndex = [];
|
|
234187
234299
|
this.data.colorIndex.push(index);
|
|
234188
234300
|
}
|
|
234189
|
-
/**
|
|
234301
|
+
/**
|
|
234302
|
+
* Clean up the open facet.
|
|
234303
|
+
* @deprecated in 4.x to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
|
|
234304
|
+
* instead.
|
|
234305
|
+
*/
|
|
234190
234306
|
cleanupOpenFacet() {
|
|
234191
234307
|
this.data.trimAllIndexArrays(this.data.pointIndex.length);
|
|
234192
234308
|
}
|
|
234193
|
-
/**
|
|
234194
|
-
*
|
|
234195
|
-
* *
|
|
234196
|
-
*
|
|
234197
|
-
*
|
|
234198
|
-
*
|
|
234199
|
-
* *
|
|
234200
|
-
* * "undefined" return is normal. Any other return is a description of an error.
|
|
234309
|
+
/**
|
|
234310
|
+
* Announce the end of construction of a facet.
|
|
234311
|
+
* * Optionally check for:
|
|
234312
|
+
* * Same number of indices among all active index arrays -- point, normal, param, color
|
|
234313
|
+
* * All indices are within bounds of the respective data arrays.
|
|
234314
|
+
* * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
|
|
234315
|
+
* * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
|
|
234201
234316
|
*/
|
|
234202
234317
|
terminateFacet(validateAllIndices = true) {
|
|
234203
234318
|
const numFacets = this._facetStart.length - 1;
|
|
234204
|
-
|
|
234205
|
-
const
|
|
234319
|
+
// number of indices in accepted facets
|
|
234320
|
+
const lengthA = this._facetStart[numFacets];
|
|
234321
|
+
// number of indices in all facets (accepted facet plus the last facet to be accepted)
|
|
234322
|
+
const lengthB = this.data.pointIndex.length;
|
|
234206
234323
|
if (validateAllIndices) {
|
|
234207
234324
|
const messages = [];
|
|
234208
234325
|
if (lengthB < lengthA + 2)
|
|
234209
|
-
messages.push("Less than 3 indices in
|
|
234326
|
+
messages.push("Less than 3 indices in the last facet");
|
|
234210
234327
|
if (this.data.normalIndex && this.data.normalIndex.length !== lengthB)
|
|
234211
234328
|
messages.push("normalIndex count must match pointIndex count");
|
|
234212
234329
|
if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
|
|
@@ -234216,70 +234333,93 @@ class IndexedPolyface extends Polyface {
|
|
|
234216
234333
|
if (this.data.edgeVisible.length !== lengthB)
|
|
234217
234334
|
messages.push("visibleIndex count must equal pointIndex count");
|
|
234218
234335
|
if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
234219
|
-
messages.push("invalid normal indices in
|
|
234336
|
+
messages.push("invalid normal indices in the last facet");
|
|
234220
234337
|
if (messages.length > 0) {
|
|
234221
|
-
this.
|
|
234338
|
+
this.data.trimAllIndexArrays(lengthB);
|
|
234222
234339
|
return messages;
|
|
234223
234340
|
}
|
|
234224
234341
|
}
|
|
234225
|
-
//
|
|
234226
|
-
this._facetStart.push(lengthB);
|
|
234342
|
+
this._facetStart.push(lengthB); // append start index of the future facet
|
|
234227
234343
|
return undefined;
|
|
234228
234344
|
}
|
|
234229
|
-
/**
|
|
234230
|
-
|
|
234231
|
-
|
|
234232
|
-
|
|
234233
|
-
/** (read-only property)
|
|
234234
|
-
get
|
|
234235
|
-
|
|
234236
|
-
|
|
234237
|
-
/** (read-only property)
|
|
234238
|
-
get pointCount() {
|
|
234239
|
-
|
|
234240
|
-
|
|
234241
|
-
/** (read-only property)
|
|
234242
|
-
get
|
|
234243
|
-
|
|
234244
|
-
|
|
234345
|
+
/** Number of facets (read-only property). */
|
|
234346
|
+
get facetCount() {
|
|
234347
|
+
return this._facetStart.length - 1;
|
|
234348
|
+
}
|
|
234349
|
+
/** Number of faces (read-only property). */
|
|
234350
|
+
get faceCount() {
|
|
234351
|
+
return this.data.faceCount;
|
|
234352
|
+
}
|
|
234353
|
+
/** Number of points (read-only property). */
|
|
234354
|
+
get pointCount() {
|
|
234355
|
+
return this.data.pointCount;
|
|
234356
|
+
}
|
|
234357
|
+
/** Number of colors (read-only property). */
|
|
234358
|
+
get colorCount() {
|
|
234359
|
+
return this.data.colorCount;
|
|
234360
|
+
}
|
|
234361
|
+
/** Number of parameters (read-only property). */
|
|
234362
|
+
get paramCount() {
|
|
234363
|
+
return this.data.paramCount;
|
|
234364
|
+
}
|
|
234365
|
+
/** Number of normals (read-only property). */
|
|
234366
|
+
get normalCount() {
|
|
234367
|
+
return this.data.normalCount;
|
|
234368
|
+
}
|
|
234369
|
+
/** Test if `index` is a valid facet index. */
|
|
234370
|
+
isValidFacetIndex(index) {
|
|
234371
|
+
return index >= 0 && index < this.facetCount;
|
|
234372
|
+
}
|
|
234245
234373
|
/** Return the number of edges in a particular facet. */
|
|
234246
234374
|
numEdgeInFacet(facetIndex) {
|
|
234247
234375
|
if (this.isValidFacetIndex(facetIndex))
|
|
234248
234376
|
return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];
|
|
234249
234377
|
return 0;
|
|
234250
234378
|
}
|
|
234251
|
-
/**
|
|
234252
|
-
|
|
234253
|
-
|
|
234254
|
-
|
|
234255
|
-
/** ASSUME valid facet index
|
|
234256
|
-
facetIndex1(index) {
|
|
234257
|
-
|
|
234258
|
-
|
|
234379
|
+
/** ASSUME valid facet index. Return start index of facet in pointIndex arrays. */
|
|
234380
|
+
facetIndex0(index) {
|
|
234381
|
+
return this._facetStart[index];
|
|
234382
|
+
}
|
|
234383
|
+
/** ASSUME valid facet index. Return one past end index of facet in pointIndex arrays. */
|
|
234384
|
+
facetIndex1(index) {
|
|
234385
|
+
return this._facetStart[index + 1];
|
|
234386
|
+
}
|
|
234387
|
+
/** Create a visitor for this polyface */
|
|
234388
|
+
createVisitor(numWrap = 0) {
|
|
234389
|
+
return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, numWrap);
|
|
234390
|
+
}
|
|
234259
234391
|
/** Return the range of (optionally transformed) points in this mesh. */
|
|
234260
|
-
range(transform, result) {
|
|
234261
|
-
|
|
234262
|
-
|
|
234263
|
-
/**
|
|
234392
|
+
range(transform, result) {
|
|
234393
|
+
return this.data.range(result, transform);
|
|
234394
|
+
}
|
|
234395
|
+
/** Extend `range` with coordinates from this mesh. */
|
|
234396
|
+
extendRange(range, transform) {
|
|
234397
|
+
this.data.range(range, transform);
|
|
234398
|
+
}
|
|
234399
|
+
/**
|
|
234400
|
+
* Given the index of a facet, return the data pertaining to the face it is a part of.
|
|
234401
|
+
* @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
|
|
234402
|
+
*/
|
|
234264
234403
|
getFaceDataByFacetIndex(facetIndex) {
|
|
234265
234404
|
return this.data.face[this._facetToFaceData[facetIndex]];
|
|
234266
234405
|
}
|
|
234267
234406
|
/**
|
|
234268
|
-
*
|
|
234269
|
-
*
|
|
234407
|
+
* Set new FacetFaceData.
|
|
234408
|
+
* * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using
|
|
234409
|
+
* facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.
|
|
234270
234410
|
*/
|
|
234271
234411
|
setNewFaceData(endFacetIndex = 0) {
|
|
234272
234412
|
const facetStart = this._facetToFaceData.length;
|
|
234273
234413
|
if (facetStart >= this._facetStart.length)
|
|
234274
234414
|
return false;
|
|
234275
|
-
if (0 === endFacetIndex) //
|
|
234276
|
-
endFacetIndex = this._facetStart.length; //
|
|
234415
|
+
if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet
|
|
234416
|
+
endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet
|
|
234277
234417
|
const faceData = _FacetFaceData__WEBPACK_IMPORTED_MODULE_8__.FacetFaceData.createNull();
|
|
234278
234418
|
const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, 0);
|
|
234279
|
-
if (!visitor.moveToReadIndex(facetStart)) { //
|
|
234419
|
+
if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face
|
|
234280
234420
|
return false;
|
|
234281
234421
|
}
|
|
234282
|
-
//
|
|
234422
|
+
// if parameter range is provided (by the polyface planeSet clipper) then use it
|
|
234283
234423
|
const paramDefined = this.data.param !== undefined;
|
|
234284
234424
|
const setParamRange = faceData.paramRange.isNull && paramDefined;
|
|
234285
234425
|
do {
|
|
@@ -234294,7 +234434,7 @@ class IndexedPolyface extends Polyface {
|
|
|
234294
234434
|
this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);
|
|
234295
234435
|
return true;
|
|
234296
234436
|
}
|
|
234297
|
-
/** Second step of double dispatch:
|
|
234437
|
+
/** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */
|
|
234298
234438
|
dispatchToGeometryHandler(handler) {
|
|
234299
234439
|
return handler.handleIndexedPolyface(this);
|
|
234300
234440
|
}
|
|
@@ -236973,14 +237113,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
236973
237113
|
* @public
|
|
236974
237114
|
*/
|
|
236975
237115
|
class PolyfaceData {
|
|
236976
|
-
/** boolean tag indicating if the facets are viewable from the back */
|
|
237116
|
+
/** boolean tag indicating if the facets are to be considered viewable from the back */
|
|
236977
237117
|
get twoSided() { return this._twoSided; }
|
|
236978
237118
|
set twoSided(value) { this._twoSided = value; }
|
|
236979
237119
|
/** set the `taggedNumericData` member */
|
|
236980
237120
|
setTaggedNumericData(data) {
|
|
236981
237121
|
this.taggedNumericData = data;
|
|
236982
237122
|
}
|
|
236983
|
-
/**
|
|
237123
|
+
/**
|
|
237124
|
+
* Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
|
|
237125
|
+
* * A boundary edge of a mesh is defined as an edge with only one connected facet.
|
|
237126
|
+
* * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
|
|
237127
|
+
*/
|
|
236984
237128
|
get expectedClosure() { return this._expectedClosure; }
|
|
236985
237129
|
set expectedClosure(value) { this._expectedClosure = value; }
|
|
236986
237130
|
/** Constructor for facets.
|
|
@@ -237192,10 +237336,13 @@ class PolyfaceData {
|
|
|
237192
237336
|
this.auxData.indices[numEdge + i] = this.auxData.indices[i];
|
|
237193
237337
|
}
|
|
237194
237338
|
}
|
|
237195
|
-
static trimArray(data, length) {
|
|
237196
|
-
data
|
|
237197
|
-
|
|
237198
|
-
|
|
237339
|
+
static trimArray(data, length) {
|
|
237340
|
+
if (data && length < data.length)
|
|
237341
|
+
data.length = length;
|
|
237342
|
+
}
|
|
237343
|
+
/**
|
|
237344
|
+
* Trim all index arrays to the stated length.
|
|
237345
|
+
* This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
|
|
237199
237346
|
*/
|
|
237200
237347
|
trimAllIndexArrays(length) {
|
|
237201
237348
|
PolyfaceData.trimArray(this.pointIndex, length);
|
|
@@ -292644,7 +292791,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
292644
292791
|
/***/ ((module) => {
|
|
292645
292792
|
|
|
292646
292793
|
"use strict";
|
|
292647
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.
|
|
292794
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.6","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.5.0-dev.6","@itwin/core-bentley":"workspace:^4.5.0-dev.6","@itwin/core-common":"workspace:^4.5.0-dev.6","@itwin/core-geometry":"workspace:^4.5.0-dev.6","@itwin/core-orbitgt":"workspace:^4.5.0-dev.6","@itwin/core-quantity":"workspace:^4.5.0-dev.6"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
292648
292795
|
|
|
292649
292796
|
/***/ })
|
|
292650
292797
|
|