@itwin/ecschema-rpcinterface-tests 4.5.0-dev.3 → 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.
@@ -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
- constructor(providerName = "CesiumWorldTerrain", exaggeration = 1.0, applyLighting = false, heightOrigin = 0.0, heightOriginMode = TerrainHeightOriginMode.Geodetic) {
43316
- this.providerName = providerName;
43317
- this.exaggeration = Math.min(100, Math.max(0.1, exaggeration));
43318
- this.applyLighting = applyLighting;
43319
- this.heightOrigin = heightOrigin;
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
- if (undefined === json)
43332
- return new TerrainSettings();
43333
- const providerName = json?.providerName ?? "CesiumWorldTerrain";
43334
- const settings = new TerrainSettings(providerName, json.exaggeration, json.applyLighting, json.heightOrigin, json.heightOriginMode);
43335
- if (true === json.nonLocatable)
43336
- settings._nonLocatable = true;
43337
- return settings;
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 version 5.0.
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 version 5.0.
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 version 5.0. */
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 version 5.0.
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 version 5.0.
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 version 5.0.
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) {
@@ -61946,6 +61978,11 @@ class SchemaReadHelper {
61946
61978
  for (const providerTuple of caProviders) {
61947
61979
  // First tuple entry is the CA class name.
61948
61980
  const caClass = await this.findSchemaItem(providerTuple[0]);
61981
+ // If custom attribute exist within the context and is referenced, validate the reference is defined in the container's schema
61982
+ if (caClass && caClass.key.schemaName !== container.schema.name &&
61983
+ !container.schema.getReferenceSync(caClass.key.schemaName)) {
61984
+ throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `Unable to load custom attribute ${caClass.fullName} from container ${container.fullName}, ${caClass.key.schemaName} reference not defined`);
61985
+ }
61949
61986
  // Second tuple entry ia a function that provides the CA instance.
61950
61987
  const provider = providerTuple[1];
61951
61988
  const customAttribute = provider(caClass);
@@ -85703,7 +85740,7 @@ class RealityDataSourceCesiumIonAssetImpl {
85703
85740
  // The following is only if the reality data is not stored on PW Context Share.
85704
85741
  const cesiumAsset = _tile_internal__WEBPACK_IMPORTED_MODULE_3__.CesiumIonAssetProvider.parseCesiumUrl(url);
85705
85742
  if (cesiumAsset) {
85706
- const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(cesiumAsset.id, cesiumAsset.key);
85743
+ const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(`${cesiumAsset.id}`, cesiumAsset.key);
85707
85744
  if (tokenAndUrl.url && tokenAndUrl.token) {
85708
85745
  url = tokenAndUrl.url;
85709
85746
  this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;
@@ -139482,9 +139519,17 @@ class GltfReader {
139482
139519
  renderGraphic = renderGraphicList[0];
139483
139520
  else
139484
139521
  renderGraphic = this._system.createGraphicList(renderGraphicList);
139485
- if (featureTable)
139486
- renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), contentRange);
139487
139522
  const transform = this.getTileTransform(transformToRoot, pseudoRtcBias);
139523
+ // Compute range in tileset/world space.
139524
+ let range = contentRange;
139525
+ const invTransform = transform?.inverse();
139526
+ if (invTransform)
139527
+ range = invTransform.multiplyRange(contentRange);
139528
+ // The batch range needs to be in tile coordinate space.
139529
+ // If we computed the content range ourselves, it's already in tile space.
139530
+ // If the content range was supplied by the caller, it's in tileset space and needs to be transformed to tile space.
139531
+ if (featureTable)
139532
+ renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), this._computedContentRange ? contentRange : range);
139488
139533
  const viewFlagOverrides = this.viewFlagOverrides;
139489
139534
  if (transform || viewFlagOverrides) {
139490
139535
  const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_4__.GraphicBranch(true);
@@ -139493,8 +139538,6 @@ class GltfReader {
139493
139538
  branch.add(renderGraphic);
139494
139539
  renderGraphic = this._system.createBranch(branch, transform ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity());
139495
139540
  }
139496
- const invTransform = transform?.inverse();
139497
- const range = invTransform ? invTransform.multiplyRange(contentRange) : contentRange;
139498
139541
  return {
139499
139542
  readStatus,
139500
139543
  isLeaf,
@@ -150673,7 +150716,7 @@ function getCesiumOSMBuildingsUrl() {
150673
150716
  return getCesiumAssetUrl(osmBuildingAssetId, key);
150674
150717
  }
150675
150718
  /** @internal */
150676
- async function getCesiumAccessTokenAndEndpointUrl(assetId = 1, requestKey) {
150719
+ async function getCesiumAccessTokenAndEndpointUrl(assetId, requestKey) {
150677
150720
  if (undefined === requestKey) {
150678
150721
  requestKey = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tileAdmin.cesiumIonKey;
150679
150722
  if (undefined === requestKey)
@@ -150704,7 +150747,7 @@ function notifyTerrainError(detailedDescription) {
150704
150747
  }
150705
150748
  /** @internal */
150706
150749
  async function getCesiumTerrainProvider(opts) {
150707
- const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
150750
+ const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default);
150708
150751
  if (!accessTokenAndEndpointUrl.token || !accessTokenAndEndpointUrl.url) {
150709
150752
  notifyTerrainError(_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString(`iModelJs:BackgroundMap.MissingCesiumToken`));
150710
150753
  return undefined;
@@ -150790,13 +150833,17 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
150790
150833
  this._tilingScheme = tilingScheme;
150791
150834
  this._tileAvailability = tileAvailability;
150792
150835
  this._metaDataAvailableLevel = metaDataAvailableLevel;
150836
+ this._assetId = opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default;
150793
150837
  this._tokenTimeOut = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().plus(CesiumTerrainProvider._tokenTimeoutInterval);
150794
150838
  }
150795
150839
  addLogoCards(cards) {
150796
150840
  if (cards.dataset.cesiumIonLogoCard)
150797
150841
  return;
150798
150842
  cards.dataset.cesiumIonLogoCard = "true";
150799
- 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: _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumWorldTerrainAttribution") });
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 });
150800
150847
  cards.appendChild(card);
150801
150848
  }
150802
150849
  get maxDepth() { return this._maxDepth; }
@@ -150828,7 +150875,7 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
150828
150875
  // ###TODO why does he update the access token when reading the mesh instead of when requesting it?
150829
150876
  // This function only returns undefined if it fails to acquire token - but it doesn't need the token...
150830
150877
  if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().milliseconds > this._tokenTimeOut.milliseconds) {
150831
- const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
150878
+ const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(this._assetId);
150832
150879
  if (!accessTokenAndEndpointUrl.token || args.isCanceled())
150833
150880
  return undefined;
150834
150881
  this._accessToken = accessTokenAndEndpointUrl.token;
@@ -156136,13 +156183,16 @@ class MapTreeSupplier {
156136
156183
  // Terrain-only settings.
156137
156184
  cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.terrainProviderName, rhs.terrainProviderName);
156138
156185
  if (0 === cmp) {
156139
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
156186
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.terrainDataSource, rhs.terrainDataSource);
156140
156187
  if (0 === cmp) {
156141
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOriginMode, rhs.terrainHeightOriginMode);
156188
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
156142
156189
  if (0 === cmp) {
156143
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainExaggeration, rhs.terrainExaggeration);
156144
- if (0 === cmp)
156145
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleansOrUndefined)(lhs.produceGeometry, rhs.produceGeometry);
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
+ }
156146
156196
  }
156147
156197
  }
156148
156198
  }
@@ -156185,6 +156235,7 @@ class MapTreeSupplier {
156185
156235
  wantSkirts: id.wantSkirts,
156186
156236
  exaggeration: id.terrainExaggeration,
156187
156237
  wantNormals: id.wantNormals,
156238
+ dataSource: id.terrainDataSource,
156188
156239
  };
156189
156240
  if (id.applyTerrain) {
156190
156241
  await _ApproximateTerrainHeights__WEBPACK_IMPORTED_MODULE_3__.ApproximateTerrainHeights.instance.initialize();
@@ -156343,6 +156394,7 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
156343
156394
  tileUserId: this._tileUserId,
156344
156395
  applyTerrain: this.settings.applyTerrain && !this._isDrape,
156345
156396
  terrainProviderName: this.settings.terrainSettings.providerName,
156397
+ terrainDataSource: this.settings.terrainSettings.dataSource,
156346
156398
  terrainHeightOrigin: this.settings.terrainSettings.heightOrigin,
156347
156399
  terrainHeightOriginMode: this.settings.terrainSettings.heightOriginMode,
156348
156400
  terrainExaggeration: this.settings.terrainSettings.exaggeration,
@@ -185415,27 +185467,32 @@ __webpack_require__.r(__webpack_exports__);
185415
185467
  */
185416
185468
  class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
185417
185469
  /** Return a (REFERENCE TO) the coordinate data. */
185418
- get point() { return this._xyz; }
185470
+ get point() {
185471
+ return this._xyz;
185472
+ }
185419
185473
  /**
185474
+ * Constructor
185420
185475
  * @param xyz point to be CAPTURED.
185421
185476
  */
185422
185477
  constructor(xyz) {
185423
185478
  super();
185424
- /** String name for interface properties */
185479
+ /** String name for interface properties. */
185425
185480
  this.geometryCategory = "point";
185426
185481
  this._xyz = xyz;
185427
185482
  }
185428
- /** Create a new CoordinateXYZ containing a CLONE of point */
185483
+ /** Create a new CoordinateXYZ containing a CLONE of point. */
185429
185484
  static create(point) {
185430
185485
  return new CoordinateXYZ(point.clone());
185431
185486
  }
185432
- /** Create a new CoordinateXYZ */
185487
+ /** Create a new CoordinateXYZ. */
185433
185488
  static createXYZ(x = 0, y = 0, z = 0) {
185434
185489
  return new CoordinateXYZ(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z));
185435
185490
  }
185436
- /** Return the range of the point */
185437
- range() { return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(this._xyz); }
185438
- /** Extend `rangeToExtend` to include this point (optionally transformed) */
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). */
185439
185496
  extendRange(rangeToExtend, transform) {
185440
185497
  if (transform)
185441
185498
  rangeToExtend.extendTransformedXYZ(transform, this._xyz.x, this._xyz.y, this._xyz.z);
@@ -185447,27 +185504,23 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
185447
185504
  transform.multiplyPoint3d(this._xyz, this._xyz);
185448
185505
  return true;
185449
185506
  }
185450
- /** Return a transformed clone */
185507
+ /** Return a transformed clone. */
185451
185508
  cloneTransformed(transform) {
185452
185509
  const result = new CoordinateXYZ(this._xyz.clone());
185453
185510
  result.tryTransformInPlace(transform);
185454
185511
  return result;
185455
185512
  }
185456
- /** Return a clone */
185513
+ /** Return a clone. */
185457
185514
  clone() {
185458
185515
  return new CoordinateXYZ(this._xyz.clone());
185459
185516
  }
185460
- /**
185461
- * Return GeometryQuery children for recursive queries.
185462
- * * Leaf classes do not need to implement.
185463
- */
185464
185517
  /** Test if (other instanceof Coordinate). */
185465
185518
  isSameGeometryClass(other) {
185466
185519
  return other instanceof CoordinateXYZ;
185467
185520
  }
185468
185521
  /**
185469
185522
  * Test for exact structure and nearly identical geometry.
185470
- * * Leaf classes must implement !!!
185523
+ * * Leaf classes must implement.
185471
185524
  * * Base class implementation recurses through children.
185472
185525
  * * Base implementation is complete for classes with children and no properties.
185473
185526
  * * Classes with both children and properties must implement for properties, call super for children.
@@ -185475,7 +185528,7 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
185475
185528
  isAlmostEqual(other) {
185476
185529
  return (other instanceof CoordinateXYZ) && this._xyz.isAlmostEqual(other._xyz);
185477
185530
  }
185478
- /** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
185531
+ /** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
185479
185532
  dispatchToGeometryHandler(handler) {
185480
185533
  return handler.handleCoordinateXYZ(this);
185481
185534
  }
@@ -189124,13 +189177,13 @@ __webpack_require__.r(__webpack_exports__);
189124
189177
 
189125
189178
 
189126
189179
  /**
189127
- * Queries to be supported by Curve, Surface, and Solid objects
189180
+ * Queries to be supported by Curve, Surface, and Solid objects.
189128
189181
  * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,
189129
- * and bspline surfaces
189182
+ * and bspline surfaces.
189130
189183
  * @public
189131
189184
  */
189132
189185
  class GeometryQuery {
189133
- /** Return the range of the entire GeometryQuery tree */
189186
+ /** Return the range of the entire GeometryQuery tree. */
189134
189187
  range(transform, result) {
189135
189188
  if (result)
189136
189189
  result.setNull();
@@ -189138,7 +189191,7 @@ class GeometryQuery {
189138
189191
  this.extendRange(range, transform);
189139
189192
  return range;
189140
189193
  }
189141
- /** Try to move the geometry by dx,dy,dz */
189194
+ /** Try to move the geometry by dx,dy,dz. */
189142
189195
  tryTranslateInPlace(dx, dy = 0.0, dz = 0.0) {
189143
189196
  return this.tryTransformInPlace(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslationXYZ(dx, dy, dz));
189144
189197
  }
@@ -189146,13 +189199,15 @@ class GeometryQuery {
189146
189199
  * Return GeometryQuery children for recursive queries.
189147
189200
  * * leaf classes do not need to implement.
189148
189201
  */
189149
- get children() { return undefined; }
189202
+ get children() {
189203
+ return undefined;
189204
+ }
189150
189205
  /**
189151
189206
  * Test for exact structure and nearly identical geometry.
189152
- * * Leaf classes must implement !!!
189153
- * * base class implementation recurses through children.
189154
- * * base implementation is complete for classes with children and no properties.
189155
- * * classes with both children and properties must implement for properties, call super for children.
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.
189156
189211
  */
189157
189212
  isAlmostEqual(other) {
189158
189213
  if (this.isSameGeometryClass(other)) {
@@ -189167,20 +189222,19 @@ class GeometryQuery {
189167
189222
  }
189168
189223
  return true;
189169
189224
  }
189170
- else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children. So these null pointer cases are never reached.
189171
- 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
189172
189227
  }
189173
189228
  else {
189174
- // both children null. call it equal? This class should probably have implemented.
189175
- return true;
189229
+ return true; // both children null; call it equal
189176
189230
  }
189177
189231
  }
189178
189232
  return false;
189179
189233
  }
189180
189234
  /**
189181
189235
  * Apply instance method [[isAlmostEqual]] if both are defined.
189182
- * * both undefined returns true
189183
- * * single defined returns false
189236
+ * * Both undefined returns true.
189237
+ * * Single defined returns false.
189184
189238
  */
189185
189239
  static areAlmostEqual(a, b) {
189186
189240
  if (a instanceof GeometryQuery && b instanceof GeometryQuery)
@@ -191814,9 +191868,13 @@ __webpack_require__.r(__webpack_exports__);
191814
191868
  */
191815
191869
  class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
191816
191870
  /** Test if `other` is a PointString3d */
191817
- isSameGeometryClass(other) { return other instanceof PointString3d; }
191818
- /** return a clone of the points array. */
191819
- get points() { return this._points; }
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
+ }
191820
191878
  constructor() {
191821
191879
  super();
191822
191880
  /** String name for schema properties */
@@ -191826,11 +191884,18 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191826
191884
  /** Clone and apply a transform. */
191827
191885
  cloneTransformed(transform) {
191828
191886
  const c = this.clone();
191829
- c.tryTransformInPlace(transform);
191887
+ c.tryTransformInPlace(transform); // we know tryTransformInPlace succeeds
191830
191888
  return c;
191831
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
+ */
191832
191894
  static flattenArray(arr) {
191833
- return arr.reduce((flat, toFlatten) => {
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) => {
191834
191899
  return flat.concat(Array.isArray(toFlatten) ? PointString3d.flattenArray(toFlatten) : toFlatten);
191835
191900
  }, []);
191836
191901
  }
@@ -191840,7 +191905,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191840
191905
  result.addPoints(points);
191841
191906
  return result;
191842
191907
  }
191843
- /** Add multiple points to the PointString3d */
191908
+ /** Add multiple points to the PointString3d. */
191844
191909
  addPoints(...points) {
191845
191910
  const toAdd = PointString3d.flattenArray(points);
191846
191911
  for (const p of toAdd) {
@@ -191848,25 +191913,25 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191848
191913
  this._points.push(p);
191849
191914
  }
191850
191915
  }
191851
- /** Add a single point to the PointString3d */
191916
+ /** Add a single point to the PointString3d. */
191852
191917
  addPoint(point) {
191853
191918
  this._points.push(point);
191854
191919
  }
191855
- /** Remove the last point added to the PointString3d */
191920
+ /** Remove the last point added to the PointString3d. */
191856
191921
  popPoint() {
191857
191922
  this._points.pop();
191858
191923
  }
191859
- /** 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`. */
191860
191925
  setFrom(other) {
191861
191926
  this._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(other._points);
191862
191927
  }
191863
- /** Create from an array of Point3d */
191928
+ /** Create from an array of Point3d. */
191864
191929
  static createPoints(points) {
191865
191930
  const ps = new PointString3d();
191866
191931
  ps._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(points);
191867
191932
  return ps;
191868
191933
  }
191869
- /** Create a PointString3d from xyz coordinates packed in a Float64Array */
191934
+ /** Create a PointString3d from xyz coordinates packed in a Float64Array. */
191870
191935
  static createFloat64Array(xyzData) {
191871
191936
  const ps = new PointString3d();
191872
191937
  for (let i = 0; i + 3 <= xyzData.length; i += 3)
@@ -191879,7 +191944,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191879
191944
  retVal.setFrom(this);
191880
191945
  return retVal;
191881
191946
  }
191882
- /** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,2,2]]` */
191947
+ /** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
191883
191948
  setFromJSON(json) {
191884
191949
  this._points.length = 0;
191885
191950
  if (Array.isArray(json)) {
@@ -191890,7 +191955,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191890
191955
  }
191891
191956
  /**
191892
191957
  * Convert an PointString3d to a JSON object.
191893
- * @return {*} [[x,y,z],...[x,y,z]]
191958
+ * @return {*} e.g., `[[1,2,3], [4,5,6]]`.
191894
191959
  */
191895
191960
  toJSON() {
191896
191961
  const value = [];
@@ -191898,7 +191963,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191898
191963
  value.push(p.toJSON());
191899
191964
  return value;
191900
191965
  }
191901
- /** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,2,2]]` */
191966
+ /** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
191902
191967
  static fromJSON(json) {
191903
191968
  const ps = new PointString3d();
191904
191969
  ps.setFromJSON(json);
@@ -191916,14 +191981,16 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191916
191981
  return undefined;
191917
191982
  }
191918
191983
  /** Return the number of points. */
191919
- numPoints() { return this._points.length; }
191984
+ numPoints() {
191985
+ return this._points.length;
191986
+ }
191920
191987
  /** Reverse the point order */
191921
191988
  reverseInPlace() {
191922
191989
  if (this._points.length >= 2) {
191923
191990
  let i0 = 0;
191924
191991
  let i1 = this._points.length - 1;
191925
191992
  while (i0 < i1) {
191926
- const a = this._points[i0];
191993
+ const a = this._points[i1];
191927
191994
  this._points[i1] = this._points[i0];
191928
191995
  this._points[i0] = a;
191929
191996
  i0++;
@@ -191931,7 +191998,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191931
191998
  }
191932
191999
  }
191933
192000
  }
191934
- /** Return the number of points. */
192001
+ /** Apply transform on points in place. */
191935
192002
  tryTransformInPlace(transform) {
191936
192003
  transform.multiplyPoint3dArrayInPlace(this._points);
191937
192004
  return true;
@@ -191950,7 +192017,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191950
192017
  isInPlane(plane) {
191951
192018
  return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isCloseToPlane(this._points, plane, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance);
191952
192019
  }
191953
- /** Extend a range to include the points in this PointString3d. */
192020
+ /** Extend a range to include the points in this PointString3d (optionally transformed). */
191954
192021
  extendRange(rangeToExtend, transform) {
191955
192022
  rangeToExtend.extendArray(this._points, transform);
191956
192023
  }
@@ -191961,8 +192028,10 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
191961
192028
  return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isAlmostEqual(this._points, other._points);
191962
192029
  }
191963
192030
  /** Reduce to empty set of points. */
191964
- clear() { this._points.length = 0; }
191965
- /** Second step of double dispatch: call `handler.handlePointString(this)` */
192031
+ clear() {
192032
+ this._points.length = 0;
192033
+ }
192034
+ /** Second step of double dispatch: call `handler.handlePointString(this)` */
191966
192035
  dispatchToGeometryHandler(handler) {
191967
192036
  return handler.handlePointString3d(this);
191968
192037
  }
@@ -233818,6 +233887,7 @@ __webpack_require__.r(__webpack_exports__);
233818
233887
  * @public
233819
233888
  */
233820
233889
  class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
233890
+ /** Constructor */
233821
233891
  constructor(data) {
233822
233892
  super();
233823
233893
  /** String name for schema properties */
@@ -233825,69 +233895,102 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
233825
233895
  this.data = data;
233826
233896
  }
233827
233897
  /** Flag indicating if the mesh display must assume both sides are visible. */
233828
- get twoSided() { return this.data.twoSided; }
233829
- set twoSided(value) { this.data.twoSided = value; }
233830
- /** Flag indicating if the mesh closure is unknown (0), open sheet (1), closed (2) */
233831
- get expectedClosure() { return this.data.expectedClosure; }
233832
- set expectedClosure(value) { this.data.expectedClosure = value; }
233833
- /**
233834
- * Check validity of indices into a data array.
233835
- * * It is valid to have both indices and data undefined.
233836
- * * It is NOT valid for just one to be defined.
233837
- * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
233838
- * @param indices array of indices.
233839
- * @param indexPositionA first index to test
233840
- * @param indexPositionB one past final index to test
233841
- * @param data data array
233842
- * @param dataLength length of data array
233843
- */
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
+ */
233844
233926
  static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
233845
233927
  if (indices === undefined && data === undefined)
233846
233928
  return true;
233847
- if (!indices || !data)
233929
+ if (indices === undefined || data === undefined)
233848
233930
  return false;
233849
233931
  if (indexPositionA < 0 || indexPositionA >= indices.length)
233850
233932
  return false;
233851
- if (indexPositionB < indexPositionA || indexPositionB > indices.length)
233933
+ if (indexPositionB <= indexPositionA || indexPositionB > indices.length)
233852
233934
  return false;
233853
233935
  for (let i = indexPositionA; i < indexPositionB; i++)
233854
233936
  if (indices[i] < 0 || indices[i] >= dataLength)
233855
233937
  return false;
233856
233938
  return true;
233857
233939
  }
233858
- /**
233859
- * Returns the number of facets of this polyface. Subclasses should override.
233860
- */
233940
+ /** Returns the number of facets of this polyface. Subclasses should override. */
233861
233941
  get facetCount() {
233862
233942
  return undefined;
233863
233943
  }
233864
233944
  }
233865
233945
  /**
233866
- * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point, normal, param, and color indices.
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.
233867
233948
  * @public
233868
233949
  */
233869
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
+ }
233870
233970
  /** Test if other is an instance of `IndexedPolyface` */
233871
- isSameGeometryClass(other) { return other instanceof IndexedPolyface; }
233971
+ isSameGeometryClass(other) {
233972
+ return other instanceof IndexedPolyface;
233973
+ }
233872
233974
  /** Tests for equivalence between two IndexedPolyfaces. */
233873
233975
  isAlmostEqual(other) {
233874
233976
  if (other instanceof IndexedPolyface) {
233875
- return this.data.isAlmostEqual(other.data) && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
233977
+ return this.data.isAlmostEqual(other.data) &&
233978
+ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
233876
233979
  _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);
233877
233980
  }
233878
233981
  return false;
233879
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
+ }
233880
233987
  /**
233881
- * Returns true if either the point array or the point index array is empty.
233882
- */
233883
- get isEmpty() { return this.data.pointCount === 0 || this.data.pointIndex.length === 0; }
233884
- /**
233885
- * * apply the transform to points
233886
- * * apply the (inverse transpose of) the matrix part to normals
233887
- * * 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
233888
233992
  * * negate normals
233889
233993
  * * reverse index order around each facet.
233890
- * @param transform
233891
233994
  */
233892
233995
  tryTransformInPlace(transform) {
233893
233996
  if (!this.data.tryTransformInPlace(transform))
@@ -233908,52 +234011,47 @@ class IndexedPolyface extends Polyface {
233908
234011
  const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
233909
234012
  return result;
233910
234013
  }
233911
- /** Return a deep clone with transformed points and normals */
234014
+ /**
234015
+ * Return a deep clone with transformed points and normals.
234016
+ * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.
234017
+ */
233912
234018
  cloneTransformed(transform) {
233913
234019
  const result = this.clone();
233914
234020
  result.tryTransformInPlace(transform);
233915
234021
  return result;
233916
234022
  }
233917
234023
  /** Reverse the order of indices around all facets. */
233918
- reverseIndices() { this.data.reverseIndices(this._facetStart); }
234024
+ reverseIndices() {
234025
+ this.data.reverseIndices(this._facetStart);
234026
+ }
233919
234027
  /** Reverse the direction of all normal vectors. */
233920
- reverseNormals() { this.data.reverseNormals(); }
233921
- /** return face data using a facet index. This is the REFERENCE to the FacetFaceData, not a copy. Returns undefined if none found. */
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
+ */
233922
234036
  tryGetFaceData(i) {
234037
+ if (i < 0 || i >= this._facetToFaceData.length)
234038
+ return undefined;
233923
234039
  const faceIndex = this._facetToFaceData[i];
233924
- if (faceIndex >= this.data.face.length)
234040
+ if (faceIndex < 0 || faceIndex >= this.data.face.length)
233925
234041
  return undefined;
233926
234042
  return this.data.face[faceIndex];
233927
234043
  }
233928
234044
  /**
233929
- * Constructor for a new polyface.
233930
- * @param data PolyfaceData arrays to capture.
233931
- * @param facetStart optional array of facet start indices (e.g. known during clone)
233932
- * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
233933
- */
233934
- constructor(data, facetStart, facetToFaceData) {
233935
- super(data);
233936
- if (facetStart)
233937
- this._facetStart = facetStart.slice();
233938
- else {
233939
- this._facetStart = [];
233940
- this._facetStart.push(0);
233941
- }
233942
- if (facetToFaceData)
233943
- this._facetToFaceData = facetToFaceData.slice();
233944
- else
233945
- this._facetToFaceData = [];
233946
- }
233947
- /**
233948
- * * Add facets from source to this polyface.
233949
- * * Optionally reverse facet indices as per PolyfaceData.reverseIndicesSingleFacet() with preserveStart = false, and invert source normals.
233950
- * * 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.
233951
234049
  * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.
233952
234050
  */
233953
234051
  addIndexedPolyface(source, reversed, transform) {
233954
234052
  const numSourceFacets = source.facetCount;
233955
- // Add point, point index, and edge visibility data
233956
- // Note: there is no need to build an intermediate index map since all points are added
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
233957
234055
  const startOfNewPoints = this.data.point.length;
233958
234056
  const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
233959
234057
  for (let i = 0; i < source.data.point.length; i++) {
@@ -233980,11 +234078,11 @@ class IndexedPolyface extends Polyface {
233980
234078
  }
233981
234079
  this.terminateFacet(false);
233982
234080
  }
233983
- // Add param and param index data
234081
+ // add param and param index data
233984
234082
  if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {
233985
234083
  const startOfNewParams = this.data.param.length;
233986
234084
  this.data.param.pushFromGrowableXYArray(source.data.param);
233987
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
234085
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
233988
234086
  const i0 = source._facetStart[i];
233989
234087
  const i1 = source._facetStart[i + 1];
233990
234088
  if (reversed) {
@@ -233997,7 +234095,7 @@ class IndexedPolyface extends Polyface {
233997
234095
  }
233998
234096
  }
233999
234097
  }
234000
- // Add normal and normal index data
234098
+ // add normal and normal index data
234001
234099
  if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {
234002
234100
  const startOfNewNormals = this.data.normal.length;
234003
234101
  for (let i = 0; i < source.data.normal.length; i++) {
@@ -234008,7 +234106,7 @@ class IndexedPolyface extends Polyface {
234008
234106
  sourceNormal.scaleInPlace(-1.0);
234009
234107
  this.addNormal(sourceNormal);
234010
234108
  }
234011
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
234109
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
234012
234110
  const i0 = source._facetStart[i];
234013
234111
  const i1 = source._facetStart[i + 1];
234014
234112
  if (reversed) {
@@ -234021,12 +234119,12 @@ class IndexedPolyface extends Polyface {
234021
234119
  }
234022
234120
  }
234023
234121
  }
234024
- // Add color and color index data
234122
+ // add color and color index data
234025
234123
  if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {
234026
234124
  const startOfNewColors = this.data.color.length;
234027
234125
  for (const sourceColor of source.data.color)
234028
234126
  this.addColor(sourceColor);
234029
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match colors
234127
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors
234030
234128
  const i0 = source._facetStart[i];
234031
234129
  const i1 = source._facetStart[i + 1];
234032
234130
  if (reversed) {
@@ -234039,7 +234137,7 @@ class IndexedPolyface extends Polyface {
234039
234137
  }
234040
234138
  }
234041
234139
  }
234042
- // Add face and facetToFace index data
234140
+ // add face and facetToFace index data
234043
234141
  if (source.data.face.length !== 0) {
234044
234142
  const startOfNewFaceData = this.data.face.length;
234045
234143
  for (const face of source.data.face) {
@@ -234051,25 +234149,31 @@ class IndexedPolyface extends Polyface {
234051
234149
  }
234052
234150
  }
234053
234151
  }
234054
- /** Return the total number of param indices in zero-terminated style, which includes
234055
- * * all the indices in the packed zero-based table
234152
+ /**
234153
+ * Return the total number of indices in zero-terminated style, which includes
234154
+ * * all the indices in the packed zero-based table.
234056
234155
  * * one additional index for the zero-terminator of each facet.
234057
- * @note Note that all index arrays (point, normal, param, color) have the same counts, so there
234156
+ * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there
234058
234157
  * is not a separate query for each of them.
234059
234158
  */
234060
- get zeroTerminatedIndexCount() { return this.data.pointIndex.length + this._facetStart.length - 1; }
234061
- /** Create an empty facet set, with coordinate and index data to be supplied later.
234062
- * @param needNormals true if normals will be constructed
234063
- * @param needParams true if uv parameters will be constructed
234064
- * @param needColors true if colors will e constructed.
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.
234065
234168
  */
234066
234169
  static create(needNormals = false, needParams = false, needColors = false, twoSided = false) {
234067
234170
  return new IndexedPolyface(new _PolyfaceData__WEBPACK_IMPORTED_MODULE_3__.PolyfaceData(needNormals, needParams, needColors, twoSided));
234068
234171
  }
234069
- /** add (a clone of ) a point. return its 0 based index.
234070
- * @param point point coordinates
234071
- * @param priorIndex optional index of prior point to check for repeated coordinates
234072
- * @returns Returns the zero-based index of the added or reused point.
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.
234073
234177
  */
234074
234178
  addPoint(point, priorIndex) {
234075
234179
  if (priorIndex !== undefined) {
@@ -234080,12 +234184,21 @@ class IndexedPolyface extends Polyface {
234080
234184
  this.data.point.pushXYZ(point.x, point.y, point.z);
234081
234185
  return this.data.point.length - 1;
234082
234186
  }
234083
- /** add a point.
234084
- * @returns Returns the zero-based index of the added point.
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.
234085
234193
  */
234086
- addPointXYZ(x, y, z) { this.data.point.pushXYZ(x, y, z); return this.data.point.length - 1; }
234087
- /** Add a uv param.
234088
- * @returns 0-based index of the added param.
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.
234089
234202
  */
234090
234203
  addParam(param) {
234091
234204
  if (!this.data.param)
@@ -234093,10 +234206,13 @@ class IndexedPolyface extends Polyface {
234093
234206
  this.data.param.push(param);
234094
234207
  return this.data.param.length - 1;
234095
234208
  }
234096
- /** Add a uv parameter to the parameter array.
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.
234097
234213
  * @param priorIndexA first index to check for possible duplicate value.
234098
234214
  * @param priorIndexB second index to check for possible duplicate value.
234099
- * @returns 0-based index of the added or reused param.
234215
+ * @returns zero-based index of the added or duplicate parameter.
234100
234216
  */
234101
234217
  addParamUV(u, v, priorIndexA, priorIndexB) {
234102
234218
  if (!this.data.param)
@@ -234108,37 +234224,39 @@ class IndexedPolyface extends Polyface {
234108
234224
  this.data.param.pushXY(u, v);
234109
234225
  return this.data.param.length - 1;
234110
234226
  }
234111
- /** Add a normal vector
234227
+ /**
234228
+ * Add (a clone of) a normal vector to the normal array.
234229
+ * @param normal the normal vector.
234112
234230
  * @param priorIndexA first index to check for possible duplicate value.
234113
234231
  * @param priorIndexB second index to check for possible duplicate value.
234114
- * @returns 0-based index of the added or reused normal.
234232
+ * @returns zero-based index of the added or duplicate normal.
234115
234233
  */
234116
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
+ };
234117
234240
  if (this.data.normal !== undefined) {
234118
- let distance;
234119
- if (priorIndexA !== undefined) {
234120
- distance = this.data.normal.distanceIndexToPoint(priorIndexA, normal);
234121
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
234122
- return priorIndexA;
234123
- }
234124
- if (priorIndexB !== undefined) {
234125
- distance = this.data.normal.distanceIndexToPoint(priorIndexB, normal);
234126
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
234127
- return priorIndexB;
234128
- }
234129
- // Note: Do NOT attempt to chain to tail if no prior indices given.
234130
- // 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
234131
234246
  if (priorIndexA !== undefined || priorIndexB !== undefined) {
234132
234247
  const tailIndex = this.data.normal.length - 1;
234133
- distance = this.data.normal.distanceIndexToPoint(tailIndex, normal);
234134
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
234248
+ if (normalIsDuplicate(this.data.normal, tailIndex))
234135
234249
  return tailIndex;
234136
234250
  }
234137
234251
  }
234138
234252
  return this.addNormalXYZ(normal.x, normal.y, normal.z);
234139
234253
  }
234140
- /** Add a normal vector given by direct coordinates
234141
- * @returns 0-based index of the added or reused param.
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.
234142
234260
  */
234143
234261
  addNormalXYZ(x, y, z) {
234144
234262
  if (!this.data.normal)
@@ -234146,8 +234264,10 @@ class IndexedPolyface extends Polyface {
234146
234264
  this.data.normal.pushXYZ(x, y, z);
234147
234265
  return this.data.normal.length - 1;
234148
234266
  }
234149
- /** Add a color
234150
- * @returns 0-based index of the added or reused color.
234267
+ /**
234268
+ * Add a color to the color array
234269
+ * @param color the color.
234270
+ * @returns zero-based index of the added color.
234151
234271
  */
234152
234272
  addColor(color) {
234153
234273
  if (!this.data.color)
@@ -234156,46 +234276,54 @@ class IndexedPolyface extends Polyface {
234156
234276
  return this.data.color.length - 1;
234157
234277
  }
234158
234278
  /** Add a point index with edge visibility flag. */
234159
- addPointIndex(index, visible = true) { this.data.pointIndex.push(index); this.data.edgeVisible.push(visible); }
234160
- /** Add a normal index */
234279
+ addPointIndex(index, visible = true) {
234280
+ this.data.pointIndex.push(index);
234281
+ this.data.edgeVisible.push(visible);
234282
+ }
234283
+ /** Add a normal index. */
234161
234284
  addNormalIndex(index) {
234162
234285
  if (!this.data.normalIndex)
234163
234286
  this.data.normalIndex = [];
234164
234287
  this.data.normalIndex.push(index);
234165
234288
  }
234166
- /** Add a param index */
234289
+ /** Add a param index. */
234167
234290
  addParamIndex(index) {
234168
234291
  if (!this.data.paramIndex)
234169
234292
  this.data.paramIndex = [];
234170
234293
  this.data.paramIndex.push(index);
234171
234294
  }
234172
- /** Add a color index */
234295
+ /** Add a color index. */
234173
234296
  addColorIndex(index) {
234174
234297
  if (!this.data.colorIndex)
234175
234298
  this.data.colorIndex = [];
234176
234299
  this.data.colorIndex.push(index);
234177
234300
  }
234178
- /** clean up the open facet. return the returnValue (so caller can easily return cleanupOpenFacet("message")) */
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
+ */
234179
234306
  cleanupOpenFacet() {
234180
234307
  this.data.trimAllIndexArrays(this.data.pointIndex.length);
234181
234308
  }
234182
- /** announce the end of construction of a facet.
234183
- *
234184
- * * The "open" facet is checked for:
234185
- *
234186
- * ** Same number of indices among all active index arrays -- point, normal, param, color
234187
- * ** All indices are within bounds of the respective data arrays.
234188
- * * in error cases, all index arrays are trimmed back to the size when previous facet was terminated.
234189
- * * "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.
234190
234316
  */
234191
234317
  terminateFacet(validateAllIndices = true) {
234192
234318
  const numFacets = this._facetStart.length - 1;
234193
- const lengthA = this._facetStart[numFacets]; // number of indices in accepted facets
234194
- const lengthB = this.data.pointIndex.length; // number of indices including the open facet
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;
234195
234323
  if (validateAllIndices) {
234196
234324
  const messages = [];
234197
234325
  if (lengthB < lengthA + 2)
234198
- messages.push("Less than 3 indices in open facet");
234326
+ messages.push("Less than 3 indices in the last facet");
234199
234327
  if (this.data.normalIndex && this.data.normalIndex.length !== lengthB)
234200
234328
  messages.push("normalIndex count must match pointIndex count");
234201
234329
  if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
@@ -234205,70 +234333,93 @@ class IndexedPolyface extends Polyface {
234205
234333
  if (this.data.edgeVisible.length !== lengthB)
234206
234334
  messages.push("visibleIndex count must equal pointIndex count");
234207
234335
  if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
234208
- messages.push("invalid normal indices in open facet");
234336
+ messages.push("invalid normal indices in the last facet");
234209
234337
  if (messages.length > 0) {
234210
- this.cleanupOpenFacet();
234338
+ this.data.trimAllIndexArrays(lengthB);
234211
234339
  return messages;
234212
234340
  }
234213
234341
  }
234214
- // appending to facetStart accepts the facet !!!
234215
- this._facetStart.push(lengthB);
234342
+ this._facetStart.push(lengthB); // append start index of the future facet
234216
234343
  return undefined;
234217
234344
  }
234218
- /**
234219
- * All terminated facets added since the declaration of the previous face
234220
- * will be grouped into a new face with their own 2D range.
234221
- */
234222
- /** (read-only property) number of facets */
234223
- get facetCount() { return this._facetStart.length - 1; }
234224
- /** (read-only property) number of faces */
234225
- get faceCount() { return this.data.faceCount; }
234226
- /** (read-only property) number of points */
234227
- get pointCount() { return this.data.pointCount; }
234228
- /** (read-only property) number of colors */
234229
- get colorCount() { return this.data.colorCount; }
234230
- /** (read-only property) number of parameters */
234231
- get paramCount() { return this.data.paramCount; }
234232
- /** (read-only property) number of normals */
234233
- get normalCount() { return this.data.normalCount; }
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
+ }
234234
234373
  /** Return the number of edges in a particular facet. */
234235
234374
  numEdgeInFacet(facetIndex) {
234236
234375
  if (this.isValidFacetIndex(facetIndex))
234237
234376
  return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];
234238
234377
  return 0;
234239
234378
  }
234240
- /** test if `index` is a valid facet index. */
234241
- isValidFacetIndex(index) { return index >= 0 && index + 1 < this._facetStart.length; }
234242
- /** ASSUME valid facet index . .. return its start index in index arrays. */
234243
- facetIndex0(index) { return this._facetStart[index]; }
234244
- /** ASSUME valid facet index . .. return its end index in index arrays. */
234245
- facetIndex1(index) { return this._facetStart[index + 1]; }
234246
- /** create a visitor for this polyface */
234247
- createVisitor(numWrap = 0) { return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, numWrap); }
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
+ }
234248
234391
  /** Return the range of (optionally transformed) points in this mesh. */
234249
- range(transform, result) { return this.data.range(result, transform); }
234250
- /** Extend `range` with coordinates from this mesh */
234251
- extendRange(range, transform) { this.data.range(range, transform); }
234252
- /** Given the index of a facet, return the data pertaining to the face it is a part of. */
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
+ */
234253
234403
  getFaceDataByFacetIndex(facetIndex) {
234254
234404
  return this.data.face[this._facetToFaceData[facetIndex]];
234255
234405
  }
234256
234406
  /**
234257
- * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object
234258
- * using facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns true if successful, false otherwise.
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.
234259
234410
  */
234260
234411
  setNewFaceData(endFacetIndex = 0) {
234261
234412
  const facetStart = this._facetToFaceData.length;
234262
234413
  if (facetStart >= this._facetStart.length)
234263
234414
  return false;
234264
- if (0 === endFacetIndex) // The default for endFacetIndex is really the last facet
234265
- endFacetIndex = this._facetStart.length; // Last facetStart index corresponds to the next facet if we were to create one
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
234266
234417
  const faceData = _FacetFaceData__WEBPACK_IMPORTED_MODULE_8__.FacetFaceData.createNull();
234267
234418
  const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, 0);
234268
- if (!visitor.moveToReadIndex(facetStart)) { // Move visitor to first facet of new face
234419
+ if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face
234269
234420
  return false;
234270
234421
  }
234271
- // If parameter range is provided (by the polyface planeSet clipper) then use it
234422
+ // if parameter range is provided (by the polyface planeSet clipper) then use it
234272
234423
  const paramDefined = this.data.param !== undefined;
234273
234424
  const setParamRange = faceData.paramRange.isNull && paramDefined;
234274
234425
  do {
@@ -234283,7 +234434,7 @@ class IndexedPolyface extends Polyface {
234283
234434
  this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);
234284
234435
  return true;
234285
234436
  }
234286
- /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)` */
234437
+ /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */
234287
234438
  dispatchToGeometryHandler(handler) {
234288
234439
  return handler.handleIndexedPolyface(this);
234289
234440
  }
@@ -236962,14 +237113,18 @@ __webpack_require__.r(__webpack_exports__);
236962
237113
  * @public
236963
237114
  */
236964
237115
  class PolyfaceData {
236965
- /** 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 */
236966
237117
  get twoSided() { return this._twoSided; }
236967
237118
  set twoSided(value) { this._twoSided = value; }
236968
237119
  /** set the `taggedNumericData` member */
236969
237120
  setTaggedNumericData(data) {
236970
237121
  this.taggedNumericData = data;
236971
237122
  }
236972
- /** boolean tag indicating if the facets are viewable from the back */
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
+ */
236973
237128
  get expectedClosure() { return this._expectedClosure; }
236974
237129
  set expectedClosure(value) { this._expectedClosure = value; }
236975
237130
  /** Constructor for facets.
@@ -237181,10 +237336,13 @@ class PolyfaceData {
237181
237336
  this.auxData.indices[numEdge + i] = this.auxData.indices[i];
237182
237337
  }
237183
237338
  }
237184
- static trimArray(data, length) { if (data && length < data.length)
237185
- data.length = length; }
237186
- /** Trim all index arrays to stated length.
237187
- * * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
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.
237188
237346
  */
237189
237347
  trimAllIndexArrays(length) {
237190
237348
  PolyfaceData.trimArray(this.pointIndex, length);
@@ -292633,7 +292791,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
292633
292791
  /***/ ((module) => {
292634
292792
 
292635
292793
  "use strict";
292636
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.3","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.3","@itwin/core-bentley":"workspace:^4.5.0-dev.3","@itwin/core-common":"workspace:^4.5.0-dev.3","@itwin/core-geometry":"workspace:^4.5.0-dev.3","@itwin/core-orbitgt":"workspace:^4.5.0-dev.3","@itwin/core-quantity":"workspace:^4.5.0-dev.3"},"//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"}}');
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"}}');
292637
292795
 
292638
292796
  /***/ })
292639
292797