@itwin/rpcinterface-full-stack-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.
@@ -30890,15 +30890,12 @@ class Logger {
30890
30890
  const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorStack(err)}` : "";
30891
30891
  return _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err) + stack;
30892
30892
  }
30893
- /** Log the specified exception. The special "ExceptionType" property will be added as metadata,
30894
- * in addition to any other metadata that may be supplied by the caller, unless the
30895
- * metadata supplied by the caller already includes this property.
30893
+ /** Log the specified exception. The special "ExceptionType" property will be added as metadata.
30896
30894
  * @param category The category of the message.
30897
30895
  * @param err The exception object.
30898
30896
  * @param log The logger output function to use - defaults to Logger.logError
30899
- * @param metaData Optional data for the message
30900
30897
  */
30901
- static logException(category, err, log = (_category, message) => Logger.logError(_category, message)) {
30898
+ static logException(category, err, log = (_category, message, metaData) => Logger.logError(_category, message, metaData)) {
30902
30899
  log(category, Logger.getExceptionMessage(err), () => {
30903
30900
  return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMetadata(err), exceptionType: err.constructor.name };
30904
30901
  });
@@ -48535,6 +48532,7 @@ SubCategoryOverride.defaults = new SubCategoryOverride({});
48535
48532
  "use strict";
48536
48533
  __webpack_require__.r(__webpack_exports__);
48537
48534
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
48535
+ /* harmony export */ "CesiumTerrainAssetId": () => (/* binding */ CesiumTerrainAssetId),
48538
48536
  /* harmony export */ "TerrainHeightOriginMode": () => (/* binding */ TerrainHeightOriginMode),
48539
48537
  /* harmony export */ "TerrainSettings": () => (/* binding */ TerrainSettings)
48540
48538
  /* harmony export */ });
@@ -48545,6 +48543,19 @@ __webpack_require__.r(__webpack_exports__);
48545
48543
  /** @packageDocumentation
48546
48544
  * @module DisplayStyles
48547
48545
  */
48546
+ /** Ids of [Cesium ION assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.
48547
+ * These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain".
48548
+ * You may alternatively use the Id of any ION asset to which you have access.
48549
+ * @see [[TerrainSettings.fromCesiumIonAsset]] to create TerrainSettings that obtain terrain from a specified ION asset.
48550
+ * @public
48551
+ */
48552
+ var CesiumTerrainAssetId;
48553
+ (function (CesiumTerrainAssetId) {
48554
+ /** Default [global 3d terrain](https://cesium.com/platform/cesium-ion/content/cesium-world-terrain/). */
48555
+ CesiumTerrainAssetId["Default"] = "1";
48556
+ /** Global 3d terrain that includes [bathymetry](https://cesium.com/platform/cesium-ion/content/cesium-world-bathymetry/) (seafloor) terrain. */
48557
+ CesiumTerrainAssetId["Bathymetry"] = "2426648";
48558
+ })(CesiumTerrainAssetId || (CesiumTerrainAssetId = {}));
48548
48559
  /** Correction modes for terrain height
48549
48560
  * @see [[TerrainProps]]
48550
48561
  * @public
@@ -48570,11 +48581,24 @@ class TerrainSettings {
48570
48581
  get nonLocatable() {
48571
48582
  return this._nonLocatable;
48572
48583
  }
48573
- constructor(providerName = "CesiumWorldTerrain", exaggeration = 1.0, applyLighting = false, heightOrigin = 0.0, heightOriginMode = TerrainHeightOriginMode.Geodetic) {
48574
- this.providerName = providerName;
48575
- this.exaggeration = Math.min(100, Math.max(0.1, exaggeration));
48576
- this.applyLighting = applyLighting;
48577
- this.heightOrigin = heightOrigin;
48584
+ /** @internal */
48585
+ constructor(providerNameOrProps, exaggeration, applyLighting, heightOrigin, heightOriginMode) {
48586
+ let providerName;
48587
+ let dataSource;
48588
+ let nonLocatable;
48589
+ if (typeof providerNameOrProps === "string") {
48590
+ providerName = providerNameOrProps;
48591
+ }
48592
+ else if (providerNameOrProps) {
48593
+ ({ providerName, dataSource, exaggeration, applyLighting, heightOrigin, heightOriginMode, nonLocatable } = providerNameOrProps);
48594
+ }
48595
+ this.providerName = providerName ?? "CesiumWorldTerrain";
48596
+ this.dataSource = dataSource ?? "";
48597
+ this.exaggeration = Math.min(100, Math.max(0.1, exaggeration ?? 1.0));
48598
+ this.applyLighting = applyLighting ?? false;
48599
+ this.heightOrigin = heightOrigin ?? 0.0;
48600
+ if (true === nonLocatable)
48601
+ this._nonLocatable = true;
48578
48602
  switch (heightOriginMode) {
48579
48603
  case TerrainHeightOriginMode.Ground:
48580
48604
  case TerrainHeightOriginMode.Geoid:
@@ -48586,18 +48610,24 @@ class TerrainSettings {
48586
48610
  }
48587
48611
  }
48588
48612
  static fromJSON(json) {
48589
- if (undefined === json)
48590
- return new TerrainSettings();
48591
- const providerName = json?.providerName ?? "CesiumWorldTerrain";
48592
- const settings = new TerrainSettings(providerName, json.exaggeration, json.applyLighting, json.heightOrigin, json.heightOriginMode);
48593
- if (true === json.nonLocatable)
48594
- settings._nonLocatable = true;
48595
- return settings;
48613
+ return new TerrainSettings(json);
48614
+ }
48615
+ /** Create settings that obtain terrain from a [Cesium ION asset](https://cesium.com/platform/cesium-ion/content/) such as
48616
+ * one of those defined by [[CesiumTerrainAssetId]].
48617
+ * @note You must ensure your Cesium ION account has access to the specified asset.
48618
+ */
48619
+ static fromCesiumIonAsset(assetId = CesiumTerrainAssetId.Default, options) {
48620
+ return TerrainSettings.fromJSON({
48621
+ ...options,
48622
+ dataSource: assetId,
48623
+ });
48596
48624
  }
48597
48625
  toJSON() {
48598
48626
  const props = { heightOriginMode: this.heightOriginMode };
48599
48627
  if ("CesiumWorldTerrain" !== this.providerName)
48600
48628
  props.providerName = this.providerName;
48629
+ if (this.dataSource)
48630
+ props.dataSource = this.dataSource;
48601
48631
  if (1 !== this.exaggeration)
48602
48632
  props.exaggeration = this.exaggeration;
48603
48633
  if (this.nonLocatable)
@@ -48609,7 +48639,7 @@ class TerrainSettings {
48609
48639
  return props;
48610
48640
  }
48611
48641
  equals(other) {
48612
- return this.providerName === other.providerName && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting
48642
+ return this.providerName === other.providerName && this.dataSource === other.dataSource && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting
48613
48643
  && this.heightOrigin === other.heightOrigin && this.heightOriginMode === other.heightOriginMode && this.nonLocatable === other.nonLocatable;
48614
48644
  }
48615
48645
  /** Returns true if these settings are equivalent to the supplied JSON settings. */
@@ -48625,6 +48655,7 @@ class TerrainSettings {
48625
48655
  return this;
48626
48656
  const props = {
48627
48657
  providerName: changedProps.providerName ?? this.providerName,
48658
+ dataSource: changedProps.dataSource ?? this.dataSource,
48628
48659
  exaggeration: changedProps.exaggeration ?? this.exaggeration,
48629
48660
  nonLocatable: changedProps.nonLocatable ?? this.nonLocatable,
48630
48661
  applyLighting: changedProps.applyLighting ?? this.applyLighting,
@@ -50647,6 +50678,7 @@ __webpack_require__.r(__webpack_exports__);
50647
50678
  /* harmony export */ "Carto2DDegrees": () => (/* reexport safe */ _geometry_Projection__WEBPACK_IMPORTED_MODULE_48__.Carto2DDegrees),
50648
50679
  /* harmony export */ "Cartographic": () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_38__.Cartographic),
50649
50680
  /* harmony export */ "CartographicRange": () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_38__.CartographicRange),
50681
+ /* harmony export */ "CesiumTerrainAssetId": () => (/* reexport safe */ _TerrainSettings__WEBPACK_IMPORTED_MODULE_103__.CesiumTerrainAssetId),
50650
50682
  /* harmony export */ "ChangeOpCode": () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangeOpCode),
50651
50683
  /* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _IModelError__WEBPACK_IMPORTED_MODULE_62__.ChangeSetStatus),
50652
50684
  /* harmony export */ "ChangedValueState": () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangedValueState),
@@ -61076,7 +61108,7 @@ var RpcResponseCacheControl;
61076
61108
  })(RpcResponseCacheControl || (RpcResponseCacheControl = {}));
61077
61109
  /** RPC protocol event types.
61078
61110
  * @public
61079
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61111
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61080
61112
  */
61081
61113
  var RpcProtocolEvent;
61082
61114
  (function (RpcProtocolEvent) {
@@ -61096,7 +61128,7 @@ var RpcProtocolEvent;
61096
61128
  })(RpcProtocolEvent || (RpcProtocolEvent = {}));
61097
61129
  /** The status of an RPC operation request.
61098
61130
  * @public
61099
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61131
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61100
61132
  */
61101
61133
  var RpcRequestStatus;
61102
61134
  (function (RpcRequestStatus) {
@@ -61116,7 +61148,7 @@ var RpcRequestStatus;
61116
61148
  RpcRequestStatus[RpcRequestStatus["RequestTimeout"] = 13] = "RequestTimeout";
61117
61149
  RpcRequestStatus[RpcRequestStatus["TooManyRequests"] = 14] = "TooManyRequests";
61118
61150
  })(RpcRequestStatus || (RpcRequestStatus = {}));
61119
- /** @public @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0. */
61151
+ /** @public @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future. */
61120
61152
  (function (RpcRequestStatus) {
61121
61153
  function isTransientError(status) {
61122
61154
  return status === RpcRequestStatus.BadGateway || status === RpcRequestStatus.ServiceUnavailable || status === RpcRequestStatus.GatewayTimeout
@@ -61126,7 +61158,7 @@ var RpcRequestStatus;
61126
61158
  })(RpcRequestStatus || (RpcRequestStatus = {}));
61127
61159
  /** RPC request event types.
61128
61160
  * @public
61129
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61161
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61130
61162
  */
61131
61163
  var RpcRequestEvent;
61132
61164
  (function (RpcRequestEvent) {
@@ -61136,7 +61168,7 @@ var RpcRequestEvent;
61136
61168
  })(RpcRequestEvent || (RpcRequestEvent = {}));
61137
61169
  /** RPC content types.
61138
61170
  * @public
61139
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61171
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61140
61172
  */
61141
61173
  var RpcContentType;
61142
61174
  (function (RpcContentType) {
@@ -61148,7 +61180,7 @@ var RpcContentType;
61148
61180
  })(RpcContentType || (RpcContentType = {}));
61149
61181
  /** Endpoints for RPC protocols.
61150
61182
  * @public
61151
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61183
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61152
61184
  */
61153
61185
  var RpcEndpoint;
61154
61186
  (function (RpcEndpoint) {
@@ -67204,6 +67236,11 @@ class SchemaReadHelper {
67204
67236
  for (const providerTuple of caProviders) {
67205
67237
  // First tuple entry is the CA class name.
67206
67238
  const caClass = await this.findSchemaItem(providerTuple[0]);
67239
+ // If custom attribute exist within the context and is referenced, validate the reference is defined in the container's schema
67240
+ if (caClass && caClass.key.schemaName !== container.schema.name &&
67241
+ !container.schema.getReferenceSync(caClass.key.schemaName)) {
67242
+ 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`);
67243
+ }
67207
67244
  // Second tuple entry ia a function that provides the CA instance.
67208
67245
  const provider = providerTuple[1];
67209
67246
  const customAttribute = provider(caClass);
@@ -90792,7 +90829,7 @@ class RealityDataSourceCesiumIonAssetImpl {
90792
90829
  // The following is only if the reality data is not stored on PW Context Share.
90793
90830
  const cesiumAsset = _tile_internal__WEBPACK_IMPORTED_MODULE_3__.CesiumIonAssetProvider.parseCesiumUrl(url);
90794
90831
  if (cesiumAsset) {
90795
- const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(cesiumAsset.id, cesiumAsset.key);
90832
+ const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(`${cesiumAsset.id}`, cesiumAsset.key);
90796
90833
  if (tokenAndUrl.url && tokenAndUrl.token) {
90797
90834
  url = tokenAndUrl.url;
90798
90835
  this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;
@@ -144571,9 +144608,17 @@ class GltfReader {
144571
144608
  renderGraphic = renderGraphicList[0];
144572
144609
  else
144573
144610
  renderGraphic = this._system.createGraphicList(renderGraphicList);
144574
- if (featureTable)
144575
- renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), contentRange);
144576
144611
  const transform = this.getTileTransform(transformToRoot, pseudoRtcBias);
144612
+ // Compute range in tileset/world space.
144613
+ let range = contentRange;
144614
+ const invTransform = transform?.inverse();
144615
+ if (invTransform)
144616
+ range = invTransform.multiplyRange(contentRange);
144617
+ // The batch range needs to be in tile coordinate space.
144618
+ // If we computed the content range ourselves, it's already in tile space.
144619
+ // If the content range was supplied by the caller, it's in tileset space and needs to be transformed to tile space.
144620
+ if (featureTable)
144621
+ renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), this._computedContentRange ? contentRange : range);
144577
144622
  const viewFlagOverrides = this.viewFlagOverrides;
144578
144623
  if (transform || viewFlagOverrides) {
144579
144624
  const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_4__.GraphicBranch(true);
@@ -144582,8 +144627,6 @@ class GltfReader {
144582
144627
  branch.add(renderGraphic);
144583
144628
  renderGraphic = this._system.createBranch(branch, transform ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity());
144584
144629
  }
144585
- const invTransform = transform?.inverse();
144586
- const range = invTransform ? invTransform.multiplyRange(contentRange) : contentRange;
144587
144630
  return {
144588
144631
  readStatus,
144589
144632
  isLeaf,
@@ -155762,7 +155805,7 @@ function getCesiumOSMBuildingsUrl() {
155762
155805
  return getCesiumAssetUrl(osmBuildingAssetId, key);
155763
155806
  }
155764
155807
  /** @internal */
155765
- async function getCesiumAccessTokenAndEndpointUrl(assetId = 1, requestKey) {
155808
+ async function getCesiumAccessTokenAndEndpointUrl(assetId, requestKey) {
155766
155809
  if (undefined === requestKey) {
155767
155810
  requestKey = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tileAdmin.cesiumIonKey;
155768
155811
  if (undefined === requestKey)
@@ -155793,7 +155836,7 @@ function notifyTerrainError(detailedDescription) {
155793
155836
  }
155794
155837
  /** @internal */
155795
155838
  async function getCesiumTerrainProvider(opts) {
155796
- const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
155839
+ const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default);
155797
155840
  if (!accessTokenAndEndpointUrl.token || !accessTokenAndEndpointUrl.url) {
155798
155841
  notifyTerrainError(_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString(`iModelJs:BackgroundMap.MissingCesiumToken`));
155799
155842
  return undefined;
@@ -155879,13 +155922,17 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
155879
155922
  this._tilingScheme = tilingScheme;
155880
155923
  this._tileAvailability = tileAvailability;
155881
155924
  this._metaDataAvailableLevel = metaDataAvailableLevel;
155925
+ this._assetId = opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default;
155882
155926
  this._tokenTimeOut = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().plus(CesiumTerrainProvider._tokenTimeoutInterval);
155883
155927
  }
155884
155928
  addLogoCards(cards) {
155885
155929
  if (cards.dataset.cesiumIonLogoCard)
155886
155930
  return;
155887
155931
  cards.dataset.cesiumIonLogoCard = "true";
155888
- 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") });
155932
+ let notice = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumWorldTerrainAttribution");
155933
+ if (this._assetId === _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Bathymetry)
155934
+ notice = `${notice}\n${_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumBathymetryAttribution")}`;
155935
+ 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 });
155889
155936
  cards.appendChild(card);
155890
155937
  }
155891
155938
  get maxDepth() { return this._maxDepth; }
@@ -155917,7 +155964,7 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
155917
155964
  // ###TODO why does he update the access token when reading the mesh instead of when requesting it?
155918
155965
  // This function only returns undefined if it fails to acquire token - but it doesn't need the token...
155919
155966
  if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().milliseconds > this._tokenTimeOut.milliseconds) {
155920
- const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
155967
+ const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(this._assetId);
155921
155968
  if (!accessTokenAndEndpointUrl.token || args.isCanceled())
155922
155969
  return undefined;
155923
155970
  this._accessToken = accessTokenAndEndpointUrl.token;
@@ -161225,13 +161272,16 @@ class MapTreeSupplier {
161225
161272
  // Terrain-only settings.
161226
161273
  cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.terrainProviderName, rhs.terrainProviderName);
161227
161274
  if (0 === cmp) {
161228
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
161275
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.terrainDataSource, rhs.terrainDataSource);
161229
161276
  if (0 === cmp) {
161230
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOriginMode, rhs.terrainHeightOriginMode);
161277
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
161231
161278
  if (0 === cmp) {
161232
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainExaggeration, rhs.terrainExaggeration);
161233
- if (0 === cmp)
161234
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleansOrUndefined)(lhs.produceGeometry, rhs.produceGeometry);
161279
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOriginMode, rhs.terrainHeightOriginMode);
161280
+ if (0 === cmp) {
161281
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainExaggeration, rhs.terrainExaggeration);
161282
+ if (0 === cmp)
161283
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleansOrUndefined)(lhs.produceGeometry, rhs.produceGeometry);
161284
+ }
161235
161285
  }
161236
161286
  }
161237
161287
  }
@@ -161274,6 +161324,7 @@ class MapTreeSupplier {
161274
161324
  wantSkirts: id.wantSkirts,
161275
161325
  exaggeration: id.terrainExaggeration,
161276
161326
  wantNormals: id.wantNormals,
161327
+ dataSource: id.terrainDataSource,
161277
161328
  };
161278
161329
  if (id.applyTerrain) {
161279
161330
  await _ApproximateTerrainHeights__WEBPACK_IMPORTED_MODULE_3__.ApproximateTerrainHeights.instance.initialize();
@@ -161432,6 +161483,7 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
161432
161483
  tileUserId: this._tileUserId,
161433
161484
  applyTerrain: this.settings.applyTerrain && !this._isDrape,
161434
161485
  terrainProviderName: this.settings.terrainSettings.providerName,
161486
+ terrainDataSource: this.settings.terrainSettings.dataSource,
161435
161487
  terrainHeightOrigin: this.settings.terrainSettings.heightOrigin,
161436
161488
  terrainHeightOriginMode: this.settings.terrainSettings.heightOriginMode,
161437
161489
  terrainExaggeration: this.settings.terrainSettings.exaggeration,
@@ -190504,27 +190556,32 @@ __webpack_require__.r(__webpack_exports__);
190504
190556
  */
190505
190557
  class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
190506
190558
  /** Return a (REFERENCE TO) the coordinate data. */
190507
- get point() { return this._xyz; }
190559
+ get point() {
190560
+ return this._xyz;
190561
+ }
190508
190562
  /**
190563
+ * Constructor
190509
190564
  * @param xyz point to be CAPTURED.
190510
190565
  */
190511
190566
  constructor(xyz) {
190512
190567
  super();
190513
- /** String name for interface properties */
190568
+ /** String name for interface properties. */
190514
190569
  this.geometryCategory = "point";
190515
190570
  this._xyz = xyz;
190516
190571
  }
190517
- /** Create a new CoordinateXYZ containing a CLONE of point */
190572
+ /** Create a new CoordinateXYZ containing a CLONE of point. */
190518
190573
  static create(point) {
190519
190574
  return new CoordinateXYZ(point.clone());
190520
190575
  }
190521
- /** Create a new CoordinateXYZ */
190576
+ /** Create a new CoordinateXYZ. */
190522
190577
  static createXYZ(x = 0, y = 0, z = 0) {
190523
190578
  return new CoordinateXYZ(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z));
190524
190579
  }
190525
- /** Return the range of the point */
190526
- range() { return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(this._xyz); }
190527
- /** Extend `rangeToExtend` to include this point (optionally transformed) */
190580
+ /** Return the range of the point. */
190581
+ range() {
190582
+ return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(this._xyz);
190583
+ }
190584
+ /** Extend `rangeToExtend` to include this point (optionally transformed). */
190528
190585
  extendRange(rangeToExtend, transform) {
190529
190586
  if (transform)
190530
190587
  rangeToExtend.extendTransformedXYZ(transform, this._xyz.x, this._xyz.y, this._xyz.z);
@@ -190536,27 +190593,23 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
190536
190593
  transform.multiplyPoint3d(this._xyz, this._xyz);
190537
190594
  return true;
190538
190595
  }
190539
- /** Return a transformed clone */
190596
+ /** Return a transformed clone. */
190540
190597
  cloneTransformed(transform) {
190541
190598
  const result = new CoordinateXYZ(this._xyz.clone());
190542
190599
  result.tryTransformInPlace(transform);
190543
190600
  return result;
190544
190601
  }
190545
- /** Return a clone */
190602
+ /** Return a clone. */
190546
190603
  clone() {
190547
190604
  return new CoordinateXYZ(this._xyz.clone());
190548
190605
  }
190549
- /**
190550
- * Return GeometryQuery children for recursive queries.
190551
- * * Leaf classes do not need to implement.
190552
- */
190553
190606
  /** Test if (other instanceof Coordinate). */
190554
190607
  isSameGeometryClass(other) {
190555
190608
  return other instanceof CoordinateXYZ;
190556
190609
  }
190557
190610
  /**
190558
190611
  * Test for exact structure and nearly identical geometry.
190559
- * * Leaf classes must implement !!!
190612
+ * * Leaf classes must implement.
190560
190613
  * * Base class implementation recurses through children.
190561
190614
  * * Base implementation is complete for classes with children and no properties.
190562
190615
  * * Classes with both children and properties must implement for properties, call super for children.
@@ -190564,7 +190617,7 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
190564
190617
  isAlmostEqual(other) {
190565
190618
  return (other instanceof CoordinateXYZ) && this._xyz.isAlmostEqual(other._xyz);
190566
190619
  }
190567
- /** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
190620
+ /** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
190568
190621
  dispatchToGeometryHandler(handler) {
190569
190622
  return handler.handleCoordinateXYZ(this);
190570
190623
  }
@@ -194213,13 +194266,13 @@ __webpack_require__.r(__webpack_exports__);
194213
194266
 
194214
194267
 
194215
194268
  /**
194216
- * Queries to be supported by Curve, Surface, and Solid objects
194269
+ * Queries to be supported by Curve, Surface, and Solid objects.
194217
194270
  * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,
194218
- * and bspline surfaces
194271
+ * and bspline surfaces.
194219
194272
  * @public
194220
194273
  */
194221
194274
  class GeometryQuery {
194222
- /** Return the range of the entire GeometryQuery tree */
194275
+ /** Return the range of the entire GeometryQuery tree. */
194223
194276
  range(transform, result) {
194224
194277
  if (result)
194225
194278
  result.setNull();
@@ -194227,7 +194280,7 @@ class GeometryQuery {
194227
194280
  this.extendRange(range, transform);
194228
194281
  return range;
194229
194282
  }
194230
- /** Try to move the geometry by dx,dy,dz */
194283
+ /** Try to move the geometry by dx,dy,dz. */
194231
194284
  tryTranslateInPlace(dx, dy = 0.0, dz = 0.0) {
194232
194285
  return this.tryTransformInPlace(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslationXYZ(dx, dy, dz));
194233
194286
  }
@@ -194235,13 +194288,15 @@ class GeometryQuery {
194235
194288
  * Return GeometryQuery children for recursive queries.
194236
194289
  * * leaf classes do not need to implement.
194237
194290
  */
194238
- get children() { return undefined; }
194291
+ get children() {
194292
+ return undefined;
194293
+ }
194239
194294
  /**
194240
194295
  * Test for exact structure and nearly identical geometry.
194241
- * * Leaf classes must implement !!!
194242
- * * base class implementation recurses through children.
194243
- * * base implementation is complete for classes with children and no properties.
194244
- * * classes with both children and properties must implement for properties, call super for children.
194296
+ * * Leaf classes must implement.
194297
+ * * Base class implementation recurses through children.
194298
+ * * Base implementation is complete for classes with children and no properties.
194299
+ * * Classes with both children and properties must implement for properties, call super for children.
194245
194300
  */
194246
194301
  isAlmostEqual(other) {
194247
194302
  if (this.isSameGeometryClass(other)) {
@@ -194256,20 +194311,19 @@ class GeometryQuery {
194256
194311
  }
194257
194312
  return true;
194258
194313
  }
194259
- else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children. So these null pointer cases are never reached.
194260
- return false; // plainly different .
194314
+ else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.
194315
+ return false; // plainly different
194261
194316
  }
194262
194317
  else {
194263
- // both children null. call it equal? This class should probably have implemented.
194264
- return true;
194318
+ return true; // both children null; call it equal
194265
194319
  }
194266
194320
  }
194267
194321
  return false;
194268
194322
  }
194269
194323
  /**
194270
194324
  * Apply instance method [[isAlmostEqual]] if both are defined.
194271
- * * both undefined returns true
194272
- * * single defined returns false
194325
+ * * Both undefined returns true.
194326
+ * * Single defined returns false.
194273
194327
  */
194274
194328
  static areAlmostEqual(a, b) {
194275
194329
  if (a instanceof GeometryQuery && b instanceof GeometryQuery)
@@ -196903,9 +196957,13 @@ __webpack_require__.r(__webpack_exports__);
196903
196957
  */
196904
196958
  class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
196905
196959
  /** Test if `other` is a PointString3d */
196906
- isSameGeometryClass(other) { return other instanceof PointString3d; }
196907
- /** return a clone of the points array. */
196908
- get points() { return this._points; }
196960
+ isSameGeometryClass(other) {
196961
+ return other instanceof PointString3d;
196962
+ }
196963
+ /** Return a clone of the points array. */
196964
+ get points() {
196965
+ return this._points;
196966
+ }
196909
196967
  constructor() {
196910
196968
  super();
196911
196969
  /** String name for schema properties */
@@ -196915,11 +196973,18 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196915
196973
  /** Clone and apply a transform. */
196916
196974
  cloneTransformed(transform) {
196917
196975
  const c = this.clone();
196918
- c.tryTransformInPlace(transform);
196976
+ c.tryTransformInPlace(transform); // we know tryTransformInPlace succeeds
196919
196977
  return c;
196920
196978
  }
196979
+ /**
196980
+ * Turn any array (possibly nested) into a "flat" array of objects that are not arrays. This allows processing
196981
+ * the objects without recursion into nested arrays.
196982
+ */
196921
196983
  static flattenArray(arr) {
196922
- return arr.reduce((flat, toFlatten) => {
196984
+ return arr.reduce(
196985
+ // a callback function to execute for each element in the array. Its return value becomes
196986
+ // the value of the "flat" parameter on the next invocation of the callback function.
196987
+ (flat, toFlatten) => {
196923
196988
  return flat.concat(Array.isArray(toFlatten) ? PointString3d.flattenArray(toFlatten) : toFlatten);
196924
196989
  }, []);
196925
196990
  }
@@ -196929,7 +196994,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196929
196994
  result.addPoints(points);
196930
196995
  return result;
196931
196996
  }
196932
- /** Add multiple points to the PointString3d */
196997
+ /** Add multiple points to the PointString3d. */
196933
196998
  addPoints(...points) {
196934
196999
  const toAdd = PointString3d.flattenArray(points);
196935
197000
  for (const p of toAdd) {
@@ -196937,25 +197002,25 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196937
197002
  this._points.push(p);
196938
197003
  }
196939
197004
  }
196940
- /** Add a single point to the PointString3d */
197005
+ /** Add a single point to the PointString3d. */
196941
197006
  addPoint(point) {
196942
197007
  this._points.push(point);
196943
197008
  }
196944
- /** Remove the last point added to the PointString3d */
197009
+ /** Remove the last point added to the PointString3d. */
196945
197010
  popPoint() {
196946
197011
  this._points.pop();
196947
197012
  }
196948
- /** Replace this PointString3d's point array by a clone of the array in `other` */
197013
+ /** Replace this PointString3d's point array by a clone of the array in `other`. */
196949
197014
  setFrom(other) {
196950
197015
  this._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(other._points);
196951
197016
  }
196952
- /** Create from an array of Point3d */
197017
+ /** Create from an array of Point3d. */
196953
197018
  static createPoints(points) {
196954
197019
  const ps = new PointString3d();
196955
197020
  ps._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(points);
196956
197021
  return ps;
196957
197022
  }
196958
- /** Create a PointString3d from xyz coordinates packed in a Float64Array */
197023
+ /** Create a PointString3d from xyz coordinates packed in a Float64Array. */
196959
197024
  static createFloat64Array(xyzData) {
196960
197025
  const ps = new PointString3d();
196961
197026
  for (let i = 0; i + 3 <= xyzData.length; i += 3)
@@ -196968,7 +197033,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196968
197033
  retVal.setFrom(this);
196969
197034
  return retVal;
196970
197035
  }
196971
- /** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,2,2]]` */
197036
+ /** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
196972
197037
  setFromJSON(json) {
196973
197038
  this._points.length = 0;
196974
197039
  if (Array.isArray(json)) {
@@ -196979,7 +197044,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196979
197044
  }
196980
197045
  /**
196981
197046
  * Convert an PointString3d to a JSON object.
196982
- * @return {*} [[x,y,z],...[x,y,z]]
197047
+ * @return {*} e.g., `[[1,2,3], [4,5,6]]`.
196983
197048
  */
196984
197049
  toJSON() {
196985
197050
  const value = [];
@@ -196987,7 +197052,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196987
197052
  value.push(p.toJSON());
196988
197053
  return value;
196989
197054
  }
196990
- /** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,2,2]]` */
197055
+ /** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
196991
197056
  static fromJSON(json) {
196992
197057
  const ps = new PointString3d();
196993
197058
  ps.setFromJSON(json);
@@ -197005,14 +197070,16 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197005
197070
  return undefined;
197006
197071
  }
197007
197072
  /** Return the number of points. */
197008
- numPoints() { return this._points.length; }
197073
+ numPoints() {
197074
+ return this._points.length;
197075
+ }
197009
197076
  /** Reverse the point order */
197010
197077
  reverseInPlace() {
197011
197078
  if (this._points.length >= 2) {
197012
197079
  let i0 = 0;
197013
197080
  let i1 = this._points.length - 1;
197014
197081
  while (i0 < i1) {
197015
- const a = this._points[i0];
197082
+ const a = this._points[i1];
197016
197083
  this._points[i1] = this._points[i0];
197017
197084
  this._points[i0] = a;
197018
197085
  i0++;
@@ -197020,7 +197087,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197020
197087
  }
197021
197088
  }
197022
197089
  }
197023
- /** Return the number of points. */
197090
+ /** Apply transform on points in place. */
197024
197091
  tryTransformInPlace(transform) {
197025
197092
  transform.multiplyPoint3dArrayInPlace(this._points);
197026
197093
  return true;
@@ -197039,7 +197106,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197039
197106
  isInPlane(plane) {
197040
197107
  return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isCloseToPlane(this._points, plane, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance);
197041
197108
  }
197042
- /** Extend a range to include the points in this PointString3d. */
197109
+ /** Extend a range to include the points in this PointString3d (optionally transformed). */
197043
197110
  extendRange(rangeToExtend, transform) {
197044
197111
  rangeToExtend.extendArray(this._points, transform);
197045
197112
  }
@@ -197050,8 +197117,10 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197050
197117
  return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isAlmostEqual(this._points, other._points);
197051
197118
  }
197052
197119
  /** Reduce to empty set of points. */
197053
- clear() { this._points.length = 0; }
197054
- /** Second step of double dispatch: call `handler.handlePointString(this)` */
197120
+ clear() {
197121
+ this._points.length = 0;
197122
+ }
197123
+ /** Second step of double dispatch: call `handler.handlePointString(this)` */
197055
197124
  dispatchToGeometryHandler(handler) {
197056
197125
  return handler.handlePointString3d(this);
197057
197126
  }
@@ -238907,6 +238976,7 @@ __webpack_require__.r(__webpack_exports__);
238907
238976
  * @public
238908
238977
  */
238909
238978
  class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
238979
+ /** Constructor */
238910
238980
  constructor(data) {
238911
238981
  super();
238912
238982
  /** String name for schema properties */
@@ -238914,69 +238984,102 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
238914
238984
  this.data = data;
238915
238985
  }
238916
238986
  /** Flag indicating if the mesh display must assume both sides are visible. */
238917
- get twoSided() { return this.data.twoSided; }
238918
- set twoSided(value) { this.data.twoSided = value; }
238919
- /** Flag indicating if the mesh closure is unknown (0), open sheet (1), closed (2) */
238920
- get expectedClosure() { return this.data.expectedClosure; }
238921
- set expectedClosure(value) { this.data.expectedClosure = value; }
238922
- /**
238923
- * Check validity of indices into a data array.
238924
- * * It is valid to have both indices and data undefined.
238925
- * * It is NOT valid for just one to be defined.
238926
- * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
238927
- * @param indices array of indices.
238928
- * @param indexPositionA first index to test
238929
- * @param indexPositionB one past final index to test
238930
- * @param data data array
238931
- * @param dataLength length of data array
238932
- */
238987
+ get twoSided() {
238988
+ return this.data.twoSided;
238989
+ }
238990
+ set twoSided(value) {
238991
+ this.data.twoSided = value;
238992
+ }
238993
+ /**
238994
+ * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
238995
+ * * A boundary edge of a mesh is defined as an edge with only one connected facet.
238996
+ * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
238997
+ */
238998
+ get expectedClosure() {
238999
+ return this.data.expectedClosure;
239000
+ }
239001
+ set expectedClosure(value) {
239002
+ this.data.expectedClosure = value;
239003
+ }
239004
+ /**
239005
+ * Check validity of indices into a data array.
239006
+ * * It is valid to have both indices and data undefined.
239007
+ * * It is NOT valid for just one to be defined.
239008
+ * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
239009
+ * @param indices array of indices.
239010
+ * @param indexPositionA first index to test.
239011
+ * @param indexPositionB one past final index to test.
239012
+ * @param data data array.
239013
+ * @param dataLength length of data array.
239014
+ */
238933
239015
  static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
238934
239016
  if (indices === undefined && data === undefined)
238935
239017
  return true;
238936
- if (!indices || !data)
239018
+ if (indices === undefined || data === undefined)
238937
239019
  return false;
238938
239020
  if (indexPositionA < 0 || indexPositionA >= indices.length)
238939
239021
  return false;
238940
- if (indexPositionB < indexPositionA || indexPositionB > indices.length)
239022
+ if (indexPositionB <= indexPositionA || indexPositionB > indices.length)
238941
239023
  return false;
238942
239024
  for (let i = indexPositionA; i < indexPositionB; i++)
238943
239025
  if (indices[i] < 0 || indices[i] >= dataLength)
238944
239026
  return false;
238945
239027
  return true;
238946
239028
  }
238947
- /**
238948
- * Returns the number of facets of this polyface. Subclasses should override.
238949
- */
239029
+ /** Returns the number of facets of this polyface. Subclasses should override. */
238950
239030
  get facetCount() {
238951
239031
  return undefined;
238952
239032
  }
238953
239033
  }
238954
239034
  /**
238955
- * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point, normal, param, and color indices.
239035
+ * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,
239036
+ * normal, param, and color indices.
238956
239037
  * @public
238957
239038
  */
238958
239039
  class IndexedPolyface extends Polyface {
239040
+ /**
239041
+ * Constructor for a new polyface.
239042
+ * @param data PolyfaceData arrays to capture.
239043
+ * @param facetStart optional array of facet start indices (e.g. known during clone)
239044
+ * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
239045
+ */
239046
+ constructor(data, facetStart, facetToFaceData) {
239047
+ super(data);
239048
+ if (facetStart)
239049
+ this._facetStart = facetStart.slice(); // deep copy
239050
+ else {
239051
+ this._facetStart = [];
239052
+ this._facetStart.push(0);
239053
+ }
239054
+ if (facetToFaceData)
239055
+ this._facetToFaceData = facetToFaceData.slice(); // deep copy
239056
+ else
239057
+ this._facetToFaceData = [];
239058
+ }
238959
239059
  /** Test if other is an instance of `IndexedPolyface` */
238960
- isSameGeometryClass(other) { return other instanceof IndexedPolyface; }
239060
+ isSameGeometryClass(other) {
239061
+ return other instanceof IndexedPolyface;
239062
+ }
238961
239063
  /** Tests for equivalence between two IndexedPolyfaces. */
238962
239064
  isAlmostEqual(other) {
238963
239065
  if (other instanceof IndexedPolyface) {
238964
- return this.data.isAlmostEqual(other.data) && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
239066
+ return this.data.isAlmostEqual(other.data) &&
239067
+ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
238965
239068
  _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);
238966
239069
  }
238967
239070
  return false;
238968
239071
  }
239072
+ /** Returns true if either the point array or the point index array is empty. */
239073
+ get isEmpty() {
239074
+ return this.data.pointCount === 0 || this.data.pointIndex.length === 0;
239075
+ }
238969
239076
  /**
238970
- * Returns true if either the point array or the point index array is empty.
238971
- */
238972
- get isEmpty() { return this.data.pointCount === 0 || this.data.pointIndex.length === 0; }
238973
- /**
238974
- * * apply the transform to points
238975
- * * apply the (inverse transpose of) the matrix part to normals
238976
- * * If determinant is negative, also
239077
+ * Transform the mesh.
239078
+ * * Apply the transform to points.
239079
+ * * Apply the (inverse transpose of the) matrix part to normals.
239080
+ * * If determinant of the transform matrix is negative, also
238977
239081
  * * negate normals
238978
239082
  * * reverse index order around each facet.
238979
- * @param transform
238980
239083
  */
238981
239084
  tryTransformInPlace(transform) {
238982
239085
  if (!this.data.tryTransformInPlace(transform))
@@ -238997,52 +239100,47 @@ class IndexedPolyface extends Polyface {
238997
239100
  const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
238998
239101
  return result;
238999
239102
  }
239000
- /** Return a deep clone with transformed points and normals */
239103
+ /**
239104
+ * Return a deep clone with transformed points and normals.
239105
+ * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.
239106
+ */
239001
239107
  cloneTransformed(transform) {
239002
239108
  const result = this.clone();
239003
239109
  result.tryTransformInPlace(transform);
239004
239110
  return result;
239005
239111
  }
239006
239112
  /** Reverse the order of indices around all facets. */
239007
- reverseIndices() { this.data.reverseIndices(this._facetStart); }
239113
+ reverseIndices() {
239114
+ this.data.reverseIndices(this._facetStart);
239115
+ }
239008
239116
  /** Reverse the direction of all normal vectors. */
239009
- reverseNormals() { this.data.reverseNormals(); }
239010
- /** return face data using a facet index. This is the REFERENCE to the FacetFaceData, not a copy. Returns undefined if none found. */
239117
+ reverseNormals() {
239118
+ this.data.reverseNormals();
239119
+ }
239120
+ /**
239121
+ * Return face data using a facet index.
239122
+ * * Returns `undefined` if none found.
239123
+ * * This is the REFERENCE to the FacetFaceData not a copy.
239124
+ */
239011
239125
  tryGetFaceData(i) {
239126
+ if (i < 0 || i >= this._facetToFaceData.length)
239127
+ return undefined;
239012
239128
  const faceIndex = this._facetToFaceData[i];
239013
- if (faceIndex >= this.data.face.length)
239129
+ if (faceIndex < 0 || faceIndex >= this.data.face.length)
239014
239130
  return undefined;
239015
239131
  return this.data.face[faceIndex];
239016
239132
  }
239017
239133
  /**
239018
- * Constructor for a new polyface.
239019
- * @param data PolyfaceData arrays to capture.
239020
- * @param facetStart optional array of facet start indices (e.g. known during clone)
239021
- * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
239022
- */
239023
- constructor(data, facetStart, facetToFaceData) {
239024
- super(data);
239025
- if (facetStart)
239026
- this._facetStart = facetStart.slice();
239027
- else {
239028
- this._facetStart = [];
239029
- this._facetStart.push(0);
239030
- }
239031
- if (facetToFaceData)
239032
- this._facetToFaceData = facetToFaceData.slice();
239033
- else
239034
- this._facetToFaceData = [];
239035
- }
239036
- /**
239037
- * * Add facets from source to this polyface.
239038
- * * Optionally reverse facet indices as per PolyfaceData.reverseIndicesSingleFacet() with preserveStart = false, and invert source normals.
239039
- * * Optionally apply a transform to points and normals.
239134
+ * Add facets from `source` to `this` polyface.
239135
+ * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and
239136
+ * invert source normals.
239137
+ * * Optionally apply a `transform` to points and normals.
239040
239138
  * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.
239041
239139
  */
239042
239140
  addIndexedPolyface(source, reversed, transform) {
239043
239141
  const numSourceFacets = source.facetCount;
239044
- // Add point, point index, and edge visibility data
239045
- // Note: there is no need to build an intermediate index map since all points are added
239142
+ // add point, point index, and edge visibility data
239143
+ // note that there is no need to build an intermediate index map since all points are added
239046
239144
  const startOfNewPoints = this.data.point.length;
239047
239145
  const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
239048
239146
  for (let i = 0; i < source.data.point.length; i++) {
@@ -239069,11 +239167,11 @@ class IndexedPolyface extends Polyface {
239069
239167
  }
239070
239168
  this.terminateFacet(false);
239071
239169
  }
239072
- // Add param and param index data
239170
+ // add param and param index data
239073
239171
  if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {
239074
239172
  const startOfNewParams = this.data.param.length;
239075
239173
  this.data.param.pushFromGrowableXYArray(source.data.param);
239076
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
239174
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
239077
239175
  const i0 = source._facetStart[i];
239078
239176
  const i1 = source._facetStart[i + 1];
239079
239177
  if (reversed) {
@@ -239086,7 +239184,7 @@ class IndexedPolyface extends Polyface {
239086
239184
  }
239087
239185
  }
239088
239186
  }
239089
- // Add normal and normal index data
239187
+ // add normal and normal index data
239090
239188
  if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {
239091
239189
  const startOfNewNormals = this.data.normal.length;
239092
239190
  for (let i = 0; i < source.data.normal.length; i++) {
@@ -239097,7 +239195,7 @@ class IndexedPolyface extends Polyface {
239097
239195
  sourceNormal.scaleInPlace(-1.0);
239098
239196
  this.addNormal(sourceNormal);
239099
239197
  }
239100
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
239198
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
239101
239199
  const i0 = source._facetStart[i];
239102
239200
  const i1 = source._facetStart[i + 1];
239103
239201
  if (reversed) {
@@ -239110,12 +239208,12 @@ class IndexedPolyface extends Polyface {
239110
239208
  }
239111
239209
  }
239112
239210
  }
239113
- // Add color and color index data
239211
+ // add color and color index data
239114
239212
  if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {
239115
239213
  const startOfNewColors = this.data.color.length;
239116
239214
  for (const sourceColor of source.data.color)
239117
239215
  this.addColor(sourceColor);
239118
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match colors
239216
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors
239119
239217
  const i0 = source._facetStart[i];
239120
239218
  const i1 = source._facetStart[i + 1];
239121
239219
  if (reversed) {
@@ -239128,7 +239226,7 @@ class IndexedPolyface extends Polyface {
239128
239226
  }
239129
239227
  }
239130
239228
  }
239131
- // Add face and facetToFace index data
239229
+ // add face and facetToFace index data
239132
239230
  if (source.data.face.length !== 0) {
239133
239231
  const startOfNewFaceData = this.data.face.length;
239134
239232
  for (const face of source.data.face) {
@@ -239140,25 +239238,31 @@ class IndexedPolyface extends Polyface {
239140
239238
  }
239141
239239
  }
239142
239240
  }
239143
- /** Return the total number of param indices in zero-terminated style, which includes
239144
- * * all the indices in the packed zero-based table
239241
+ /**
239242
+ * Return the total number of indices in zero-terminated style, which includes
239243
+ * * all the indices in the packed zero-based table.
239145
239244
  * * one additional index for the zero-terminator of each facet.
239146
- * @note Note that all index arrays (point, normal, param, color) have the same counts, so there
239245
+ * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there
239147
239246
  * is not a separate query for each of them.
239148
239247
  */
239149
- get zeroTerminatedIndexCount() { return this.data.pointIndex.length + this._facetStart.length - 1; }
239150
- /** Create an empty facet set, with coordinate and index data to be supplied later.
239151
- * @param needNormals true if normals will be constructed
239152
- * @param needParams true if uv parameters will be constructed
239153
- * @param needColors true if colors will e constructed.
239248
+ get zeroTerminatedIndexCount() {
239249
+ return this.data.pointIndex.length + this._facetStart.length - 1;
239250
+ }
239251
+ /**
239252
+ * Create an empty facet set with coordinate and index data to be supplied later.
239253
+ * @param needNormals true if normals will be constructed.
239254
+ * @param needParams true if uv parameters will be constructed.
239255
+ * @param needColors true if colors will be constructed.
239256
+ * @param twoSided true if the facets are to be considered viewable from the back.
239154
239257
  */
239155
239258
  static create(needNormals = false, needParams = false, needColors = false, twoSided = false) {
239156
239259
  return new IndexedPolyface(new _PolyfaceData__WEBPACK_IMPORTED_MODULE_3__.PolyfaceData(needNormals, needParams, needColors, twoSided));
239157
239260
  }
239158
- /** add (a clone of ) a point. return its 0 based index.
239159
- * @param point point coordinates
239160
- * @param priorIndex optional index of prior point to check for repeated coordinates
239161
- * @returns Returns the zero-based index of the added or reused point.
239261
+ /**
239262
+ * Add (a clone of) a point to point array.
239263
+ * @param point the point.
239264
+ * @param priorIndex (optional) index of prior point to check for possible duplicate value.
239265
+ * @returns the zero-based index of the added or duplicate point.
239162
239266
  */
239163
239267
  addPoint(point, priorIndex) {
239164
239268
  if (priorIndex !== undefined) {
@@ -239169,12 +239273,21 @@ class IndexedPolyface extends Polyface {
239169
239273
  this.data.point.pushXYZ(point.x, point.y, point.z);
239170
239274
  return this.data.point.length - 1;
239171
239275
  }
239172
- /** add a point.
239173
- * @returns Returns the zero-based index of the added point.
239276
+ /**
239277
+ * Add a point to point array.
239278
+ * @param x the x coordinate of point.
239279
+ * @param y the y coordinate of point.
239280
+ * @param z the z coordinate of point.
239281
+ * @returns the zero-based index of the added point.
239174
239282
  */
239175
- addPointXYZ(x, y, z) { this.data.point.pushXYZ(x, y, z); return this.data.point.length - 1; }
239176
- /** Add a uv param.
239177
- * @returns 0-based index of the added param.
239283
+ addPointXYZ(x, y, z) {
239284
+ this.data.point.pushXYZ(x, y, z);
239285
+ return this.data.point.length - 1;
239286
+ }
239287
+ /**
239288
+ * Add (a clone of) a uv parameter to the parameter array.
239289
+ * @param param the parameter.
239290
+ * @returns zero-based index of the added param.
239178
239291
  */
239179
239292
  addParam(param) {
239180
239293
  if (!this.data.param)
@@ -239182,10 +239295,13 @@ class IndexedPolyface extends Polyface {
239182
239295
  this.data.param.push(param);
239183
239296
  return this.data.param.length - 1;
239184
239297
  }
239185
- /** Add a uv parameter to the parameter array.
239298
+ /**
239299
+ * Add a uv parameter to the parameter array.
239300
+ * @param u the u part of parameter.
239301
+ * @param v the v part of parameter.
239186
239302
  * @param priorIndexA first index to check for possible duplicate value.
239187
239303
  * @param priorIndexB second index to check for possible duplicate value.
239188
- * @returns 0-based index of the added or reused param.
239304
+ * @returns zero-based index of the added or duplicate parameter.
239189
239305
  */
239190
239306
  addParamUV(u, v, priorIndexA, priorIndexB) {
239191
239307
  if (!this.data.param)
@@ -239197,37 +239313,39 @@ class IndexedPolyface extends Polyface {
239197
239313
  this.data.param.pushXY(u, v);
239198
239314
  return this.data.param.length - 1;
239199
239315
  }
239200
- /** Add a normal vector
239316
+ /**
239317
+ * Add (a clone of) a normal vector to the normal array.
239318
+ * @param normal the normal vector.
239201
239319
  * @param priorIndexA first index to check for possible duplicate value.
239202
239320
  * @param priorIndexB second index to check for possible duplicate value.
239203
- * @returns 0-based index of the added or reused normal.
239321
+ * @returns zero-based index of the added or duplicate normal.
239204
239322
  */
239205
239323
  addNormal(normal, priorIndexA, priorIndexB) {
239324
+ // check if `normal` is duplicate of `dataNormal` at index `i`
239325
+ const normalIsDuplicate = (dataNormal, i) => {
239326
+ const distance = dataNormal.distanceIndexToPoint(i, normal);
239327
+ return distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance);
239328
+ };
239206
239329
  if (this.data.normal !== undefined) {
239207
- let distance;
239208
- if (priorIndexA !== undefined) {
239209
- distance = this.data.normal.distanceIndexToPoint(priorIndexA, normal);
239210
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
239211
- return priorIndexA;
239212
- }
239213
- if (priorIndexB !== undefined) {
239214
- distance = this.data.normal.distanceIndexToPoint(priorIndexB, normal);
239215
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
239216
- return priorIndexB;
239217
- }
239218
- // Note: Do NOT attempt to chain to tail if no prior indices given.
239219
- // But if they are, look also to the tail.
239330
+ if (priorIndexA !== undefined && normalIsDuplicate(this.data.normal, priorIndexA))
239331
+ return priorIndexA;
239332
+ if (priorIndexB !== undefined && normalIsDuplicate(this.data.normal, priorIndexB))
239333
+ return priorIndexB;
239334
+ // check the tail index for possible duplicate
239220
239335
  if (priorIndexA !== undefined || priorIndexB !== undefined) {
239221
239336
  const tailIndex = this.data.normal.length - 1;
239222
- distance = this.data.normal.distanceIndexToPoint(tailIndex, normal);
239223
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
239337
+ if (normalIsDuplicate(this.data.normal, tailIndex))
239224
239338
  return tailIndex;
239225
239339
  }
239226
239340
  }
239227
239341
  return this.addNormalXYZ(normal.x, normal.y, normal.z);
239228
239342
  }
239229
- /** Add a normal vector given by direct coordinates
239230
- * @returns 0-based index of the added or reused param.
239343
+ /**
239344
+ * Add a normal vector to the normal array.
239345
+ * @param x the x coordinate of normal.
239346
+ * @param y the y coordinate of normal.
239347
+ * @param z the z coordinate of normal.
239348
+ * @returns zero-based index of the added normal vector.
239231
239349
  */
239232
239350
  addNormalXYZ(x, y, z) {
239233
239351
  if (!this.data.normal)
@@ -239235,8 +239353,10 @@ class IndexedPolyface extends Polyface {
239235
239353
  this.data.normal.pushXYZ(x, y, z);
239236
239354
  return this.data.normal.length - 1;
239237
239355
  }
239238
- /** Add a color
239239
- * @returns 0-based index of the added or reused color.
239356
+ /**
239357
+ * Add a color to the color array
239358
+ * @param color the color.
239359
+ * @returns zero-based index of the added color.
239240
239360
  */
239241
239361
  addColor(color) {
239242
239362
  if (!this.data.color)
@@ -239245,46 +239365,54 @@ class IndexedPolyface extends Polyface {
239245
239365
  return this.data.color.length - 1;
239246
239366
  }
239247
239367
  /** Add a point index with edge visibility flag. */
239248
- addPointIndex(index, visible = true) { this.data.pointIndex.push(index); this.data.edgeVisible.push(visible); }
239249
- /** Add a normal index */
239368
+ addPointIndex(index, visible = true) {
239369
+ this.data.pointIndex.push(index);
239370
+ this.data.edgeVisible.push(visible);
239371
+ }
239372
+ /** Add a normal index. */
239250
239373
  addNormalIndex(index) {
239251
239374
  if (!this.data.normalIndex)
239252
239375
  this.data.normalIndex = [];
239253
239376
  this.data.normalIndex.push(index);
239254
239377
  }
239255
- /** Add a param index */
239378
+ /** Add a param index. */
239256
239379
  addParamIndex(index) {
239257
239380
  if (!this.data.paramIndex)
239258
239381
  this.data.paramIndex = [];
239259
239382
  this.data.paramIndex.push(index);
239260
239383
  }
239261
- /** Add a color index */
239384
+ /** Add a color index. */
239262
239385
  addColorIndex(index) {
239263
239386
  if (!this.data.colorIndex)
239264
239387
  this.data.colorIndex = [];
239265
239388
  this.data.colorIndex.push(index);
239266
239389
  }
239267
- /** clean up the open facet. return the returnValue (so caller can easily return cleanupOpenFacet("message")) */
239390
+ /**
239391
+ * Clean up the open facet.
239392
+ * @deprecated in 4.x to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
239393
+ * instead.
239394
+ */
239268
239395
  cleanupOpenFacet() {
239269
239396
  this.data.trimAllIndexArrays(this.data.pointIndex.length);
239270
239397
  }
239271
- /** announce the end of construction of a facet.
239272
- *
239273
- * * The "open" facet is checked for:
239274
- *
239275
- * ** Same number of indices among all active index arrays -- point, normal, param, color
239276
- * ** All indices are within bounds of the respective data arrays.
239277
- * * in error cases, all index arrays are trimmed back to the size when previous facet was terminated.
239278
- * * "undefined" return is normal. Any other return is a description of an error.
239398
+ /**
239399
+ * Announce the end of construction of a facet.
239400
+ * * Optionally check for:
239401
+ * * Same number of indices among all active index arrays -- point, normal, param, color
239402
+ * * All indices are within bounds of the respective data arrays.
239403
+ * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
239404
+ * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
239279
239405
  */
239280
239406
  terminateFacet(validateAllIndices = true) {
239281
239407
  const numFacets = this._facetStart.length - 1;
239282
- const lengthA = this._facetStart[numFacets]; // number of indices in accepted facets
239283
- const lengthB = this.data.pointIndex.length; // number of indices including the open facet
239408
+ // number of indices in accepted facets
239409
+ const lengthA = this._facetStart[numFacets];
239410
+ // number of indices in all facets (accepted facet plus the last facet to be accepted)
239411
+ const lengthB = this.data.pointIndex.length;
239284
239412
  if (validateAllIndices) {
239285
239413
  const messages = [];
239286
239414
  if (lengthB < lengthA + 2)
239287
- messages.push("Less than 3 indices in open facet");
239415
+ messages.push("Less than 3 indices in the last facet");
239288
239416
  if (this.data.normalIndex && this.data.normalIndex.length !== lengthB)
239289
239417
  messages.push("normalIndex count must match pointIndex count");
239290
239418
  if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
@@ -239294,70 +239422,93 @@ class IndexedPolyface extends Polyface {
239294
239422
  if (this.data.edgeVisible.length !== lengthB)
239295
239423
  messages.push("visibleIndex count must equal pointIndex count");
239296
239424
  if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
239297
- messages.push("invalid normal indices in open facet");
239425
+ messages.push("invalid normal indices in the last facet");
239298
239426
  if (messages.length > 0) {
239299
- this.cleanupOpenFacet();
239427
+ this.data.trimAllIndexArrays(lengthB);
239300
239428
  return messages;
239301
239429
  }
239302
239430
  }
239303
- // appending to facetStart accepts the facet !!!
239304
- this._facetStart.push(lengthB);
239431
+ this._facetStart.push(lengthB); // append start index of the future facet
239305
239432
  return undefined;
239306
239433
  }
239307
- /**
239308
- * All terminated facets added since the declaration of the previous face
239309
- * will be grouped into a new face with their own 2D range.
239310
- */
239311
- /** (read-only property) number of facets */
239312
- get facetCount() { return this._facetStart.length - 1; }
239313
- /** (read-only property) number of faces */
239314
- get faceCount() { return this.data.faceCount; }
239315
- /** (read-only property) number of points */
239316
- get pointCount() { return this.data.pointCount; }
239317
- /** (read-only property) number of colors */
239318
- get colorCount() { return this.data.colorCount; }
239319
- /** (read-only property) number of parameters */
239320
- get paramCount() { return this.data.paramCount; }
239321
- /** (read-only property) number of normals */
239322
- get normalCount() { return this.data.normalCount; }
239434
+ /** Number of facets (read-only property). */
239435
+ get facetCount() {
239436
+ return this._facetStart.length - 1;
239437
+ }
239438
+ /** Number of faces (read-only property). */
239439
+ get faceCount() {
239440
+ return this.data.faceCount;
239441
+ }
239442
+ /** Number of points (read-only property). */
239443
+ get pointCount() {
239444
+ return this.data.pointCount;
239445
+ }
239446
+ /** Number of colors (read-only property). */
239447
+ get colorCount() {
239448
+ return this.data.colorCount;
239449
+ }
239450
+ /** Number of parameters (read-only property). */
239451
+ get paramCount() {
239452
+ return this.data.paramCount;
239453
+ }
239454
+ /** Number of normals (read-only property). */
239455
+ get normalCount() {
239456
+ return this.data.normalCount;
239457
+ }
239458
+ /** Test if `index` is a valid facet index. */
239459
+ isValidFacetIndex(index) {
239460
+ return index >= 0 && index < this.facetCount;
239461
+ }
239323
239462
  /** Return the number of edges in a particular facet. */
239324
239463
  numEdgeInFacet(facetIndex) {
239325
239464
  if (this.isValidFacetIndex(facetIndex))
239326
239465
  return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];
239327
239466
  return 0;
239328
239467
  }
239329
- /** test if `index` is a valid facet index. */
239330
- isValidFacetIndex(index) { return index >= 0 && index + 1 < this._facetStart.length; }
239331
- /** ASSUME valid facet index . .. return its start index in index arrays. */
239332
- facetIndex0(index) { return this._facetStart[index]; }
239333
- /** ASSUME valid facet index . .. return its end index in index arrays. */
239334
- facetIndex1(index) { return this._facetStart[index + 1]; }
239335
- /** create a visitor for this polyface */
239336
- createVisitor(numWrap = 0) { return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, numWrap); }
239468
+ /** ASSUME valid facet index. Return start index of facet in pointIndex arrays. */
239469
+ facetIndex0(index) {
239470
+ return this._facetStart[index];
239471
+ }
239472
+ /** ASSUME valid facet index. Return one past end index of facet in pointIndex arrays. */
239473
+ facetIndex1(index) {
239474
+ return this._facetStart[index + 1];
239475
+ }
239476
+ /** Create a visitor for this polyface */
239477
+ createVisitor(numWrap = 0) {
239478
+ return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, numWrap);
239479
+ }
239337
239480
  /** Return the range of (optionally transformed) points in this mesh. */
239338
- range(transform, result) { return this.data.range(result, transform); }
239339
- /** Extend `range` with coordinates from this mesh */
239340
- extendRange(range, transform) { this.data.range(range, transform); }
239341
- /** Given the index of a facet, return the data pertaining to the face it is a part of. */
239481
+ range(transform, result) {
239482
+ return this.data.range(result, transform);
239483
+ }
239484
+ /** Extend `range` with coordinates from this mesh. */
239485
+ extendRange(range, transform) {
239486
+ this.data.range(range, transform);
239487
+ }
239488
+ /**
239489
+ * Given the index of a facet, return the data pertaining to the face it is a part of.
239490
+ * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
239491
+ */
239342
239492
  getFaceDataByFacetIndex(facetIndex) {
239343
239493
  return this.data.face[this._facetToFaceData[facetIndex]];
239344
239494
  }
239345
239495
  /**
239346
- * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object
239347
- * using facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns true if successful, false otherwise.
239496
+ * Set new FacetFaceData.
239497
+ * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using
239498
+ * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.
239348
239499
  */
239349
239500
  setNewFaceData(endFacetIndex = 0) {
239350
239501
  const facetStart = this._facetToFaceData.length;
239351
239502
  if (facetStart >= this._facetStart.length)
239352
239503
  return false;
239353
- if (0 === endFacetIndex) // The default for endFacetIndex is really the last facet
239354
- endFacetIndex = this._facetStart.length; // Last facetStart index corresponds to the next facet if we were to create one
239504
+ if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet
239505
+ endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet
239355
239506
  const faceData = _FacetFaceData__WEBPACK_IMPORTED_MODULE_8__.FacetFaceData.createNull();
239356
239507
  const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, 0);
239357
- if (!visitor.moveToReadIndex(facetStart)) { // Move visitor to first facet of new face
239508
+ if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face
239358
239509
  return false;
239359
239510
  }
239360
- // If parameter range is provided (by the polyface planeSet clipper) then use it
239511
+ // if parameter range is provided (by the polyface planeSet clipper) then use it
239361
239512
  const paramDefined = this.data.param !== undefined;
239362
239513
  const setParamRange = faceData.paramRange.isNull && paramDefined;
239363
239514
  do {
@@ -239372,7 +239523,7 @@ class IndexedPolyface extends Polyface {
239372
239523
  this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);
239373
239524
  return true;
239374
239525
  }
239375
- /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)` */
239526
+ /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */
239376
239527
  dispatchToGeometryHandler(handler) {
239377
239528
  return handler.handleIndexedPolyface(this);
239378
239529
  }
@@ -242051,14 +242202,18 @@ __webpack_require__.r(__webpack_exports__);
242051
242202
  * @public
242052
242203
  */
242053
242204
  class PolyfaceData {
242054
- /** boolean tag indicating if the facets are viewable from the back */
242205
+ /** boolean tag indicating if the facets are to be considered viewable from the back */
242055
242206
  get twoSided() { return this._twoSided; }
242056
242207
  set twoSided(value) { this._twoSided = value; }
242057
242208
  /** set the `taggedNumericData` member */
242058
242209
  setTaggedNumericData(data) {
242059
242210
  this.taggedNumericData = data;
242060
242211
  }
242061
- /** boolean tag indicating if the facets are viewable from the back */
242212
+ /**
242213
+ * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
242214
+ * * A boundary edge of a mesh is defined as an edge with only one connected facet.
242215
+ * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
242216
+ */
242062
242217
  get expectedClosure() { return this._expectedClosure; }
242063
242218
  set expectedClosure(value) { this._expectedClosure = value; }
242064
242219
  /** Constructor for facets.
@@ -242270,10 +242425,13 @@ class PolyfaceData {
242270
242425
  this.auxData.indices[numEdge + i] = this.auxData.indices[i];
242271
242426
  }
242272
242427
  }
242273
- static trimArray(data, length) { if (data && length < data.length)
242274
- data.length = length; }
242275
- /** Trim all index arrays to stated length.
242276
- * * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
242428
+ static trimArray(data, length) {
242429
+ if (data && length < data.length)
242430
+ data.length = length;
242431
+ }
242432
+ /**
242433
+ * Trim all index arrays to the stated length.
242434
+ * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
242277
242435
  */
242278
242436
  trimAllIndexArrays(length) {
242279
242437
  PolyfaceData.trimArray(this.pointIndex, length);
@@ -288593,7 +288751,7 @@ class TestContext {
288593
288751
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
288594
288752
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
288595
288753
  await core_frontend_1.NoRenderApp.startup({
288596
- applicationVersion: "4.5.0-dev.3",
288754
+ applicationVersion: "4.5.0-dev.6",
288597
288755
  applicationId: this.settings.gprid,
288598
288756
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
288599
288757
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -307426,7 +307584,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
307426
307584
  /***/ ((module) => {
307427
307585
 
307428
307586
  "use strict";
307429
- 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"}}');
307587
+ 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"}}');
307430
307588
 
307431
307589
  /***/ }),
307432
307590