@itwin/rpcinterface-full-stack-tests 3.5.0-dev.24 → 3.5.0-dev.26

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.
@@ -99063,7 +99063,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99063
99063
  get iModelId() { return super.iModelId; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection
99064
99064
  /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */
99065
99065
  static async openFile(briefcaseProps) {
99066
- const iModelProps = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("openBriefcase", briefcaseProps);
99066
+ const iModelProps = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);
99067
99067
  const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.OpenMode.Readonly : _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.OpenMode.ReadWrite);
99068
99068
  _IModelConnection__WEBPACK_IMPORTED_MODULE_5__.IModelConnection.onOpen.raiseEvent(connection);
99069
99069
  return connection;
@@ -99072,7 +99072,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99072
99072
  * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.
99073
99073
  */
99074
99074
  static async openStandalone(filePath, openMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.OpenMode.ReadWrite, opts) {
99075
- const openResponse = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("openStandalone", filePath, openMode, opts);
99075
+ const openResponse = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);
99076
99076
  const connection = new this(openResponse, openMode);
99077
99077
  _IModelConnection__WEBPACK_IMPORTED_MODULE_5__.IModelConnection.onOpen.raiseEvent(connection);
99078
99078
  return connection;
@@ -99090,7 +99090,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99090
99090
  this.beforeClose();
99091
99091
  this.txns.dispose();
99092
99092
  this._isClosed = true;
99093
- await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("closeIModel", this._fileKey);
99093
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.closeIModel(this._fileKey);
99094
99094
  }
99095
99095
  requireTimeline() {
99096
99096
  if (this.iTwinId === _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Guid.empty)
@@ -99104,7 +99104,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99104
99104
  * @param description Optional description of the changes.
99105
99105
  */
99106
99106
  async saveChanges(description) {
99107
- await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("saveChanges", this.key, description);
99107
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.saveChanges(this.key, description);
99108
99108
  }
99109
99109
  /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
99110
99110
  * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
@@ -99112,7 +99112,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99112
99112
  */
99113
99113
  async pullChanges(toIndex) {
99114
99114
  this.requireTimeline();
99115
- this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("pullChanges", this.key, toIndex);
99115
+ this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pullChanges(this.key, toIndex);
99116
99116
  }
99117
99117
  /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.
99118
99118
  * @param description The description for the changeset
@@ -99121,7 +99121,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99121
99121
  */
99122
99122
  async pushChanges(description) {
99123
99123
  this.requireTimeline();
99124
- return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("pushChanges", this.key, description);
99124
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description);
99125
99125
  }
99126
99126
  /** The current graphical editing scope, if one is in progress.
99127
99127
  * @see [[enterEditingScope]] to begin graphical editing.
@@ -99134,7 +99134,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
99134
99134
  * @see [[enterEditingScope]] to enable graphical editing.
99135
99135
  */
99136
99136
  async supportsGraphicalEditing() {
99137
- return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("isGraphicalEditingSupported", this.key);
99137
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);
99138
99138
  }
99139
99139
  /** Begin a new graphical editing scope.
99140
99140
  * @throws Error if an editing scope already exists or one could not be created.
@@ -99270,31 +99270,31 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
99270
99270
  }
99271
99271
  /** Query if the briefcase has any pending Txns waiting to be pushed. */
99272
99272
  async hasPendingTxns() {
99273
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("hasPendingTxns", this._iModel.key);
99273
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);
99274
99274
  }
99275
99275
  /** Determine if any reversible (undoable) changes exist.
99276
99276
  * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
99277
99277
  */
99278
99278
  async isUndoPossible() {
99279
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("isUndoPossible", this._iModel.key);
99279
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);
99280
99280
  }
99281
99281
  /** Determine if any reinstatable (redoable) changes exist.
99282
99282
  * @see [[reinstateTxn]] to redo changes.
99283
99283
  */
99284
99284
  async isRedoPossible() {
99285
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("isRedoPossible", this._iModel.key);
99285
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);
99286
99286
  }
99287
99287
  /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.
99288
99288
  * This is useful for showing the operation that would be undone, for example in a menu.
99289
99289
  */
99290
99290
  async getUndoString() {
99291
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("getUndoString", this._iModel.key);
99291
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.getUndoString(this._iModel.key);
99292
99292
  }
99293
99293
  /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].
99294
99294
  * This is useful for showing the operation that would be redone, in a pull-down menu for example.
99295
99295
  */
99296
99296
  async getRedoString() {
99297
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("getRedoString", this._iModel.key);
99297
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.getRedoString(this._iModel.key);
99298
99298
  }
99299
99299
  /** Reverse (undo) the most recent operation.
99300
99300
  * @see [[reinstateTxn]] to redo operations.
@@ -99313,7 +99313,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
99313
99313
  * @note If numOperations is too large only the number of reversible operations are reversed.
99314
99314
  */
99315
99315
  async reverseTxns(numOperations) {
99316
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("reverseTxns", this._iModel.key, numOperations);
99316
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);
99317
99317
  }
99318
99318
  /** Reverse (undo) all changes back to the beginning of the session.
99319
99319
  * @see [[reinstateTxn]] to redo changes.
@@ -99321,7 +99321,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
99321
99321
  * @see [[isUndoPossible]] to determine if any reversible operations exist.
99322
99322
  */
99323
99323
  async reverseAll() {
99324
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("reverseAllTxn", this._iModel.key);
99324
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);
99325
99325
  }
99326
99326
  /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it
99327
99327
  * may take multiple calls to this method to reinstate all reversed operations.
@@ -99331,7 +99331,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
99331
99331
  * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
99332
99332
  */
99333
99333
  async reinstateTxn() {
99334
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("reinstateTxn", this._iModel.key);
99334
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);
99335
99335
  }
99336
99336
  /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed
99337
99337
  * and reopened.)
@@ -99340,7 +99340,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
99340
99340
  * Probably a good idea to alert the user it happened.
99341
99341
  */
99342
99342
  async restartTxnSession() {
99343
- await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("restartTxnSession", this._iModel.key);
99343
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);
99344
99344
  }
99345
99345
  /** @internal */
99346
99346
  notifyElementsChanged(changed) {
@@ -103617,7 +103617,7 @@ class GraphicalEditingScope extends _BriefcaseTxns__WEBPACK_IMPORTED_MODULE_2__.
103617
103617
  // Register the scope synchronously, in case enter() is called again for same iModel while awaiting asynchronous initialization.
103618
103618
  const scope = new GraphicalEditingScope(imodel);
103619
103619
  try {
103620
- const scopeStarted = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("toggleGraphicalEditingScope", imodel.key, true);
103620
+ const scopeStarted = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.toggleGraphicalEditingScope(imodel.key, true);
103621
103621
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(scopeStarted); // If it didn't, the backend threw an error.
103622
103622
  }
103623
103623
  catch (e) {
@@ -103639,7 +103639,7 @@ class GraphicalEditingScope extends _BriefcaseTxns__WEBPACK_IMPORTED_MODULE_2__.
103639
103639
  this.onExiting.raiseEvent(this);
103640
103640
  }
103641
103641
  finally {
103642
- const scopeExited = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("toggleGraphicalEditingScope", this.iModel.key, false);
103642
+ const scopeExited = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.toggleGraphicalEditingScope(this.iModel.key, false);
103643
103643
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!scopeExited);
103644
103644
  try {
103645
103645
  this.onExited.raiseEvent(this);
@@ -106440,6 +106440,17 @@ class IpcApp {
106440
106440
  }
106441
106441
  return retVal.result;
106442
106442
  }
106443
+ /** Create a type safe Proxy object to make IPC calls to a registered backend interface.
106444
+ * @param channelName the channel registered by the backend handler.
106445
+ */
106446
+ static makeIpcProxy(channelName) {
106447
+ return new Proxy({}, {
106448
+ get(_target, methodName) {
106449
+ return async (...args) => IpcApp.callIpcChannel(channelName, methodName, ...args);
106450
+ },
106451
+ });
106452
+ }
106453
+ /** @deprecated use [[appFunctionIpc]] */
106443
106454
  static async callIpcHost(methodName, ...args) {
106444
106455
  return this.callIpcChannel(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.IpcAppChannel.Functions, methodName, ...args);
106445
106456
  }
@@ -106456,6 +106467,8 @@ class IpcApp {
106456
106467
  await _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.shutdown();
106457
106468
  }
106458
106469
  }
106470
+ /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */
106471
+ IpcApp.appFunctionIpc = IpcApp.makeIpcProxy(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.IpcAppChannel.Functions);
106459
106472
  /**
106460
106473
  * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply
106461
106474
  * methods to receive notifications from your backend.
@@ -107495,12 +107508,13 @@ class NativeAppNotifyHandler extends _IpcApp__WEBPACK_IMPORTED_MODULE_4__.Notifi
107495
107508
  * @public
107496
107509
  */
107497
107510
  class NativeApp {
107511
+ /** @deprecated use nativeAppIpc */
107498
107512
  static async callNativeHost(methodName, ...args) {
107499
107513
  return _IpcApp__WEBPACK_IMPORTED_MODULE_4__.IpcApp.callIpcChannel(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.nativeAppChannel, methodName, ...args);
107500
107514
  }
107501
107515
  static async setConnectivity(by, status) {
107502
107516
  _request_Request__WEBPACK_IMPORTED_MODULE_2__.RequestGlobalOptions.online = (status === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.InternetConnectivityStatus.Online);
107503
- await this.callNativeHost("overrideInternetConnectivity", by, status);
107517
+ await this.nativeAppIpc.overrideInternetConnectivity(by, status);
107504
107518
  }
107505
107519
  static hookBrowserConnectivityEvents() {
107506
107520
  if (typeof window === "object" && window.ononline && window.onoffline) {
@@ -107516,11 +107530,11 @@ class NativeApp {
107516
107530
  }
107517
107531
  /** determine whether the app currently has internet connectivity, if known */
107518
107532
  static async checkInternetConnectivity() {
107519
- return this.callNativeHost("checkInternetConnectivity");
107533
+ return this.nativeAppIpc.checkInternetConnectivity();
107520
107534
  }
107521
107535
  /** @internal */
107522
107536
  static async overrideInternetConnectivity(status) {
107523
- return this.callNativeHost("overrideInternetConnectivity", _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.OverriddenBy.User, status);
107537
+ return this.nativeAppIpc.overrideInternetConnectivity(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.OverriddenBy.User, status);
107524
107538
  }
107525
107539
  static get isValid() { return this._isValid; }
107526
107540
  /**
@@ -107532,7 +107546,7 @@ class NativeApp {
107532
107546
  if (this._isValid)
107533
107547
  return;
107534
107548
  this._isValid = true;
107535
- NativeAppNotifyHandler.register(); // receives notifications from backend
107549
+ this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend
107536
107550
  NativeApp.hookBrowserConnectivityEvents();
107537
107551
  // initialize current online state.
107538
107552
  if (window.navigator.onLine) {
@@ -107542,6 +107556,8 @@ class NativeApp {
107542
107556
  }
107543
107557
  /** @internal */
107544
107558
  static async shutdown() {
107559
+ var _b;
107560
+ (_b = this._removeAppNotify) === null || _b === void 0 ? void 0 : _b.call(this);
107545
107561
  NativeApp.unhookBrowserConnectivityEvents();
107546
107562
  await _NativeAppLogger__WEBPACK_IMPORTED_MODULE_5__.NativeAppLogger.flush();
107547
107563
  await _IpcApp__WEBPACK_IMPORTED_MODULE_4__.IpcApp.shutdown();
@@ -107556,19 +107572,19 @@ class NativeApp {
107556
107572
  });
107557
107573
  }
107558
107574
  const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :
107559
- (downloadOptions.syncMode === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.SyncMode.PullOnly ? 0 : await this.callNativeHost("acquireNewBriefcaseId", iModelId));
107575
+ (downloadOptions.syncMode === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.SyncMode.PullOnly ? 0 : await this.nativeAppIpc.acquireNewBriefcaseId(iModelId));
107560
107576
  const fileName = (_b = downloadOptions.fileName) !== null && _b !== void 0 ? _b : await this.getBriefcaseFileName({ briefcaseId, iModelId });
107561
107577
  const requestProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };
107562
107578
  const doDownload = async () => {
107563
107579
  try {
107564
- await this.callNativeHost("downloadBriefcase", requestProps, progress !== undefined, downloadOptions.progressInterval);
107580
+ await this.nativeAppIpc.downloadBriefcase(requestProps, progress !== undefined, downloadOptions.progressInterval);
107565
107581
  }
107566
107582
  finally {
107567
107583
  stopProgressEvents();
107568
107584
  }
107569
107585
  };
107570
107586
  const requestCancel = async () => {
107571
- const status = await this.callNativeHost("requestCancelDownloadBriefcase", fileName);
107587
+ const status = await this.nativeAppIpc.requestCancelDownloadBriefcase(fileName);
107572
107588
  if (status)
107573
107589
  stopProgressEvents();
107574
107590
  return status;
@@ -107577,17 +107593,17 @@ class NativeApp {
107577
107593
  }
107578
107594
  /** Get the full path filename for a briefcase within the briefcase cache */
107579
107595
  static async getBriefcaseFileName(props) {
107580
- return this.callNativeHost("getBriefcaseFileName", props);
107596
+ return this.nativeAppIpc.getBriefcaseFileName(props);
107581
107597
  }
107582
107598
  /** Delete an existing briefcase
107583
107599
  * @param fileName the briefcase fileName
107584
107600
  */
107585
107601
  static async deleteBriefcase(fileName) {
107586
- await this.callNativeHost("deleteBriefcaseFiles", fileName);
107602
+ await this.nativeAppIpc.deleteBriefcaseFiles(fileName);
107587
107603
  }
107588
- /** Get a list of all briefcase files held in the local briefcase cache directory */
107604
+ /** Get a list of all briefcase files held in the local briefcase cache directory */
107589
107605
  static async getCachedBriefcases(iModelId) {
107590
- return this.callNativeHost("getCachedBriefcases", iModelId);
107606
+ return this.nativeAppIpc.getCachedBriefcases(iModelId);
107591
107607
  }
107592
107608
  /**
107593
107609
  * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.
@@ -107597,7 +107613,7 @@ class NativeApp {
107597
107613
  static async openStorage(name) {
107598
107614
  if (this._storages.has(name))
107599
107615
  return this._storages.get(name);
107600
- const storage = new Storage(await this.callNativeHost("storageMgrOpen", name));
107616
+ const storage = new Storage(await this.nativeAppIpc.storageMgrOpen(name));
107601
107617
  this._storages.set(storage.id, storage);
107602
107618
  return storage;
107603
107619
  }
@@ -107609,15 +107625,17 @@ class NativeApp {
107609
107625
  static async closeStorage(storage, deleteStorage = false) {
107610
107626
  if (!this._storages.has(storage.id))
107611
107627
  throw new Error(`Storage [Id=${storage.id}] not open`);
107612
- await this.callNativeHost("storageMgrClose", storage.id, deleteStorage);
107628
+ await this.nativeAppIpc.storageMgrClose(storage.id, deleteStorage);
107613
107629
  this._storages.delete(storage.id);
107614
107630
  }
107615
107631
  /** Get the list of existing Storages on the local disk. */
107616
107632
  static async getStorageNames() {
107617
- return NativeApp.callNativeHost("storageMgrNames");
107633
+ return NativeApp.nativeAppIpc.storageMgrNames();
107618
107634
  }
107619
107635
  }
107620
107636
  _a = NativeApp;
107637
+ /** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */
107638
+ NativeApp.nativeAppIpc = _IpcApp__WEBPACK_IMPORTED_MODULE_4__.IpcApp.makeIpcProxy(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.nativeAppChannel);
107621
107639
  NativeApp._storages = new Map();
107622
107640
  NativeApp._onOnline = async () => {
107623
107641
  await NativeApp.setConnectivity(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.OverriddenBy.Browser, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.InternetConnectivityStatus.Online);
@@ -107639,30 +107657,30 @@ class Storage {
107639
107657
  }
107640
107658
  /** get the type of a value for a key, or undefined if not present. */
107641
107659
  async getValueType(key) {
107642
- return NativeApp.callNativeHost("storageGetValueType", this.id, key);
107660
+ return NativeApp.nativeAppIpc.storageGetValueType(this.id, key);
107643
107661
  }
107644
107662
  /** Get the value for a key */
107645
107663
  async getData(key) {
107646
- return NativeApp.callNativeHost("storageGet", this.id, key);
107664
+ return NativeApp.nativeAppIpc.storageGet(this.id, key);
107647
107665
  }
107648
107666
  /** Set value for a key */
107649
107667
  async setData(key, value) {
107650
- return NativeApp.callNativeHost("storageSet", this.id, key, value);
107668
+ return NativeApp.nativeAppIpc.storageSet(this.id, key, value);
107651
107669
  }
107652
107670
  /**
107653
107671
  * Return an array of all keys in this Storage.
107654
107672
  * @note This can be expensive, depending on the number of keys present.
107655
107673
  */
107656
107674
  async getKeys() {
107657
- return NativeApp.callNativeHost("storageKeys", this.id);
107675
+ return NativeApp.nativeAppIpc.storageKeys(this.id);
107658
107676
  }
107659
107677
  /** Remove a key and its data. */
107660
107678
  async removeData(key) {
107661
- return NativeApp.callNativeHost("storageRemove", this.id, key);
107679
+ return NativeApp.nativeAppIpc.storageRemove(this.id, key);
107662
107680
  }
107663
107681
  /** Remove all keys and their data. */
107664
107682
  async removeAll() {
107665
- return NativeApp.callNativeHost("storageRemoveAll", this.id);
107683
+ return NativeApp.nativeAppIpc.storageRemoveAll(this.id);
107666
107684
  }
107667
107685
  }
107668
107686
 
@@ -107708,7 +107726,7 @@ class NativeAppLogger {
107708
107726
  try {
107709
107727
  while (messages.length > 0) {
107710
107728
  const msg = messages.shift();
107711
- await _IpcApp__WEBPACK_IMPORTED_MODULE_1__.IpcApp.callIpcHost("log", msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });
107729
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_1__.IpcApp.appFunctionIpc.log(msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });
107712
107730
  }
107713
107731
  }
107714
107732
  finally {
@@ -126984,7 +127002,6 @@ class MeshParams {
126984
127002
  indices: surfaceIndices,
126985
127003
  fillFlags: args.fillFlags,
126986
127004
  hasBakedLighting: true === args.hasBakedLighting,
126987
- hasFixedNormals: true === args.hasFixedNormals,
126988
127005
  textureMapping: undefined !== args.textureMapping ? { texture: args.textureMapping.texture, alwaysDisplayed: false } : undefined,
126989
127006
  material: (0,_SurfaceParams__WEBPACK_IMPORTED_MODULE_5__.createSurfaceMaterial)(args.material),
126990
127007
  };
@@ -127909,7 +127926,6 @@ function splitMeshParams(args) {
127909
127926
  indices,
127910
127927
  fillFlags: args.params.surface.fillFlags,
127911
127928
  hasBakedLighting: args.params.surface.hasBakedLighting,
127912
- hasFixedNormals: args.params.surface.hasFixedNormals,
127913
127929
  textureMapping: args.params.surface.textureMapping,
127914
127930
  material: material !== undefined ? material : args.params.surface.material,
127915
127931
  }, edges === null || edges === void 0 ? void 0 : edges.get(id), args.params.isPlanar,
@@ -129287,7 +129303,6 @@ var MeshArgs;
129287
129303
  isPlanar: mesh.isPlanar,
129288
129304
  is2d: mesh.is2d,
129289
129305
  hasBakedLighting: true === mesh.hasBakedLighting,
129290
- hasFixedNormals: false,
129291
129306
  isVolumeClassifier: true === mesh.isVolumeClassifier,
129292
129307
  edges,
129293
129308
  auxChannels: mesh.auxChannels,
@@ -136501,7 +136516,6 @@ class MeshData {
136501
136516
  this.fillFlags = params.surface.fillFlags;
136502
136517
  this.isPlanar = params.isPlanar;
136503
136518
  this.hasBakedLighting = params.surface.hasBakedLighting;
136504
- this.hasFixedNormals = params.surface.hasFixedNormals;
136505
136519
  const edges = params.edges;
136506
136520
  this.edgeWidth = undefined !== edges ? edges.weight : 1;
136507
136521
  this.edgeLineCode = _LineCode__WEBPACK_IMPORTED_MODULE_2__.LineCode.valueFromLinePixels(undefined !== edges ? edges.linePixels : _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Solid);
@@ -136577,7 +136591,6 @@ class MeshGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_1__.LUTGeome
136577
136591
  get uniformColor() { return this.colorInfo.isUniform ? this.colorInfo.uniform : undefined; }
136578
136592
  get texture() { return this.mesh.texture; }
136579
136593
  get hasBakedLighting() { return this.mesh.hasBakedLighting; }
136580
- get hasFixedNormals() { return this.mesh.hasFixedNormals; }
136581
136594
  get lut() { return this.mesh.lut; }
136582
136595
  get hasScalarAnimation() { return this.mesh.lut.hasScalarAnimation; }
136583
136596
  computeEdgeWeight(params) {
@@ -144508,7 +144521,6 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
144508
144521
  get techniqueId() { return 0 /* Surface */; }
144509
144522
  get isLitSurface() { return this.isLit; }
144510
144523
  get hasBakedLighting() { return this.mesh.hasBakedLighting; }
144511
- get hasFixedNormals() { return this.mesh.hasFixedNormals; }
144512
144524
  get renderOrder() {
144513
144525
  if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FillFlags.Behind === (this.fillFlags & _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FillFlags.Behind))
144514
144526
  return 2 /* BlankingRegion */;
@@ -144594,15 +144606,12 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
144594
144606
  flags[3 /* IgnoreMaterial */] = useMaterial ? 0 : 1;
144595
144607
  flags[9 /* HasMaterialAtlas */] = useMaterial && this.hasMaterialAtlas ? 1 : 0;
144596
144608
  flags[1 /* ApplyLighting */] = 0;
144597
- flags[8 /* NoFaceFront */] = 0;
144609
+ flags[8 /* HasNormalMap */] = 0;
144598
144610
  flags[6 /* HasColorAndNormal */] = 0;
144599
144611
  if (this.isLit) {
144600
144612
  flags[2 /* HasNormals */] = 1;
144601
- if (wantLighting(vf)) {
144613
+ if (wantLighting(vf))
144602
144614
  flags[1 /* ApplyLighting */] = 1;
144603
- if (this.hasFixedNormals)
144604
- flags[8 /* NoFaceFront */] = 1;
144605
- }
144606
144615
  // Textured meshes store normal in place of color index.
144607
144616
  // Untextured lit meshes store normal where textured meshes would store UV coords.
144608
144617
  // Tell shader where to find normal.
@@ -153175,7 +153184,7 @@ const applyLighting = `
153175
153184
  // Extract surface properties
153176
153185
  vec3 rgb = baseColor.rgb;
153177
153186
  vec3 normal = normalize(v_n.xyz);
153178
- normal *= 2.0 * float(!u_surfaceFlags[kSurfaceBitIndex_NoFaceFront] && gl_FrontFacing) - 1.0;
153187
+ normal *= 2.0 * float(gl_FrontFacing) - 1.0;
153179
153188
  vec3 toEye = kFrustumType_Perspective == u_frustum.z ? normalize(v_eyeSpace.xyz) : vec3(0.0, 0.0, -1.0);
153180
153189
 
153181
153190
  // Extract material properties
@@ -155790,7 +155799,7 @@ function addSurfaceFlagsLookup(builder) {
155790
155799
  builder.addConstant("kSurfaceBitIndex_BackgroundFill", 1 /* Int */, 5 /* BackgroundFill */.toString());
155791
155800
  builder.addConstant("kSurfaceBitIndex_HasColorAndNormal", 1 /* Int */, 6 /* HasColorAndNormal */.toString());
155792
155801
  builder.addConstant("kSurfaceBitIndex_OverrideRgb", 1 /* Int */, 7 /* OverrideRgb */.toString());
155793
- builder.addConstant("kSurfaceBitIndex_NoFaceFront", 1 /* Int */, 8 /* NoFaceFront */.toString());
155802
+ builder.addConstant("kSurfaceBitIndex_HasNormalMap", 1 /* Int */, 8 /* HasNormalMap */.toString());
155794
155803
  builder.addConstant("kSurfaceBitIndex_HasMaterialAtlas", 1 /* Int */, 9 /* HasMaterialAtlas */.toString());
155795
155804
  // Surface flags which get modified in vertex shader are still passed to fragment shader as a single float & are thus
155796
155805
  // used differently there & so require different constants. Unused constants are commented out.
@@ -160449,7 +160458,7 @@ class IModelTileChannel extends _internal__WEBPACK_IMPORTED_MODULE_3__.TileReque
160449
160458
  this._statistics.totalAbortedRequests += contentIds.length;
160450
160459
  }
160451
160460
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
160452
- _IpcApp__WEBPACK_IMPORTED_MODULE_2__.IpcApp.callIpcHost("cancelTileContentRequests", imodel.getRpcProps(), treeContentIds);
160461
+ _IpcApp__WEBPACK_IMPORTED_MODULE_2__.IpcApp.appFunctionIpc.cancelTileContentRequests(imodel.getRpcProps(), treeContentIds);
160453
160462
  }
160454
160463
  this._canceled.clear();
160455
160464
  }
@@ -161487,7 +161496,6 @@ class ImdlReader {
161487
161496
  indices,
161488
161497
  fillFlags: displayParams.fillFlags,
161489
161498
  hasBakedLighting: false,
161490
- hasFixedNormals: false,
161491
161499
  material,
161492
161500
  textureMapping,
161493
161501
  };
@@ -166189,7 +166197,7 @@ class TileAdmin {
166189
166197
  * @returns the TileAdmin
166190
166198
  */
166191
166199
  static async create(props) {
166192
- const rpcConcurrency = _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.isValid ? (await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("queryConcurrency", "cpu")) : undefined;
166200
+ const rpcConcurrency = _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.isValid ? (await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.queryConcurrency("cpu")) : undefined;
166193
166201
  const isMobile = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ProcessDetector.isMobileBrowser;
166194
166202
  return new TileAdmin(isMobile, rpcConcurrency, props);
166195
166203
  }
@@ -167770,7 +167778,7 @@ class ElementGraphicsChannel extends _internal__WEBPACK_IMPORTED_MODULE_1__.Tile
167770
167778
  processCancellations() {
167771
167779
  for (const [imodel, requestIds] of this._canceled) {
167772
167780
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
167773
- _IpcApp__WEBPACK_IMPORTED_MODULE_0__.IpcApp.callIpcHost("cancelElementGraphicsRequests", imodel.key, requestIds);
167781
+ _IpcApp__WEBPACK_IMPORTED_MODULE_0__.IpcApp.appFunctionIpc.cancelElementGraphicsRequests(imodel.key, requestIds);
167774
167782
  this._statistics.totalAbortedRequests += requestIds.length;
167775
167783
  }
167776
167784
  this._canceled.clear();
@@ -167941,12 +167949,18 @@ class TileStorage {
167941
167949
  const transferConfig = await this.getTransferConfig(tokenProps, iModelId);
167942
167950
  if (transferConfig === undefined)
167943
167951
  return undefined;
167944
- const buffer = await this.storage.download({
167945
- reference: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.getTileObjectReference)(iModelId, changesetId, treeId, contentId, guid),
167946
- transferConfig,
167947
- transferType: "buffer",
167948
- });
167949
- return new Uint8Array(buffer); // should always be Buffer because transferType === "buffer"
167952
+ try {
167953
+ const buffer = await this.storage.download({
167954
+ reference: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.getTileObjectReference)(iModelId, changesetId, treeId, contentId, guid),
167955
+ transferConfig,
167956
+ transferType: "buffer",
167957
+ });
167958
+ return new Uint8Array(buffer); // should always be Buffer because transferType === "buffer"
167959
+ }
167960
+ catch (_) {
167961
+ // @itwin/object-storage re-throws internal implementation-specific errors, so let's treat them all as 404 for now.
167962
+ return undefined;
167963
+ }
167950
167964
  }
167951
167965
  async getTransferConfig(tokenProps, iModelId) {
167952
167966
  if (this._transferConfigs.has(iModelId)) {
@@ -244045,11 +244059,11 @@ class IndexedEdgeMatcher {
244045
244059
  * * caller must allocate all result arrays of interest.
244046
244060
  * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
244047
244061
  * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.
244048
- * * For instance, to ignore manifold pairs and collect all others (singleton and other) as a single array `allOther`, create `const allOther = []` as an empty array and call
244049
- * `sortAndCollectClusters (undefined, allOther, allOther);`
244062
+ * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `allOther`, create `const allOther = []` as an empty array and call
244063
+ * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
244050
244064
  * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.
244051
244065
  * @param singletons optional array to receive edges that are simple boundary edges.
244052
- * @param nullEdges clusters with null edges (same start and end vertex)
244066
+ * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
244053
244067
  * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.
244054
244068
  */
244055
244069
  sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
@@ -244408,7 +244422,8 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
244408
244422
  * @param indices array of indices.
244409
244423
  * @param indexPositionA first index to test
244410
244424
  * @param indexPositionB one past final index to test
244411
- * @param data data array. Only its length is referenced.
244425
+ * @param data data array
244426
+ * @param dataLength length of data array
244412
244427
  */
244413
244428
  static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
244414
244429
  if (indices === undefined && data === undefined)
@@ -244424,6 +244439,12 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
244424
244439
  return false;
244425
244440
  return true;
244426
244441
  }
244442
+ /**
244443
+ * Returns the number of facets of this polyface. Subclasses should override.
244444
+ */
244445
+ get facetCount() {
244446
+ return undefined;
244447
+ }
244427
244448
  }
244428
244449
  /**
244429
244450
  * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point, normal, param, and color indices.
@@ -248419,14 +248440,17 @@ class PolyfaceQuery {
248419
248440
  * Return a mesh with
248420
248441
  * * clusters of adjacent, coplanar facets merged into larger facets.
248421
248442
  * * other facets included unchanged.
248422
- * @param mesh existing mesh
248443
+ * @param mesh existing mesh or visitor
248423
248444
  * @returns
248424
248445
  */
248425
248446
  static cloneWithMaximalPlanarFacets(mesh) {
248426
- PolyfaceQuery.markPairedEdgesInvisible(mesh, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_13__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians));
248427
- const partitions = PolyfaceQuery.partitionFacetIndicesByEdgeConnectedComponent(mesh, true);
248447
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface)
248448
+ return this.cloneWithMaximalPlanarFacets(mesh.createVisitor(0));
248449
+ const numFacets = PolyfaceQuery.visitorClientFacetCount(mesh);
248450
+ const smoothEdges = PolyfaceQuery.collectEdgesByDihedralAngle(mesh);
248451
+ const partitions = PolyfaceQuery.partitionFacetIndicesBySortableEdgeClusters(smoothEdges, numFacets);
248428
248452
  const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248429
- const visitor = mesh.createVisitor(0);
248453
+ const visitor = mesh;
248430
248454
  const planarPartitions = [];
248431
248455
  for (const partition of partitions) {
248432
248456
  if (partition.length === 1) {
@@ -248486,7 +248510,7 @@ class PolyfaceQuery {
248486
248510
  * @returns
248487
248511
  */
248488
248512
  static fillSimpleHoles(mesh, options, unfilledChains) {
248489
- if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.IndexedPolyface)
248513
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface)
248490
248514
  return this.fillSimpleHoles(mesh.createVisitor(0), options, unfilledChains);
248491
248515
  const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248492
248516
  const chains = [];
@@ -248580,32 +248604,27 @@ class PolyfaceQuery {
248580
248604
  }
248581
248605
  return maxIndex + 1;
248582
248606
  }
248583
- /** Search the facets for facet subsets that are connected with at least edge contact.
248584
- * * Return array of arrays of facet indices.
248607
+ /** If the visitor's client is a polyface, simply return its facet count.
248608
+ * If not a polyface, visit all facets to accumulate a count.
248585
248609
  */
248586
- static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
248587
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface) {
248588
- return this.partitionFacetIndicesByEdgeConnectedComponent(polyface.createVisitor(0), stopAtVisibleEdges);
248589
- }
248590
- polyface.setNumWrap(1);
248591
- const matcher = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_9__.IndexedEdgeMatcher();
248592
- polyface.reset();
248593
- let numFacets = 0;
248594
- while (polyface.moveToNextFacet()) {
248595
- const numEdges = polyface.pointCount - 1;
248596
- numFacets++;
248597
- for (let i = 0; i < numEdges; i++) {
248598
- if (stopAtVisibleEdges && polyface.edgeVisible[i]) {
248599
- }
248600
- else {
248601
- matcher.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
248602
- }
248603
- }
248604
- }
248605
- const allEdges = [];
248606
- matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
248610
+ static visitorClientFacetCount(visitor) {
248611
+ const polyface = visitor.clientPolyface();
248612
+ if (polyface !== undefined && polyface.facetCount !== undefined)
248613
+ return polyface.facetCount;
248614
+ let facetCount = 0;
248615
+ visitor.reset();
248616
+ while (visitor.moveToNextFacet())
248617
+ ++facetCount;
248618
+ return facetCount;
248619
+ }
248620
+ /** Partition the facet set into connected components such that two adjacent facets are in the same component if and only if they are adjacent across a clustered edge.
248621
+ * @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
248622
+ * @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
248623
+ * @return collection of facet index arrays, one array per connected component
248624
+ */
248625
+ static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
248607
248626
  const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_12__.UnionFindContext(numFacets);
248608
- for (const cluster of allEdges) {
248627
+ for (const cluster of edgeClusters) {
248609
248628
  if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_9__.SortableEdge) {
248610
248629
  // this edge does not connect anywhere. Ignore it!!
248611
248630
  }
@@ -248632,6 +248651,34 @@ class PolyfaceQuery {
248632
248651
  }
248633
248652
  return facetsInComponent;
248634
248653
  }
248654
+ /** Partition the facet set into connected components. Each facet in a given component shares an edge only with other facets in the component (or is a boundary edge).
248655
+ * @param polyface facets to partition
248656
+ * @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface
248657
+ * @return collection of facet index arrays, one per connected component
248658
+ */
248659
+ static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
248660
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface) {
248661
+ return this.partitionFacetIndicesByEdgeConnectedComponent(polyface.createVisitor(0), stopAtVisibleEdges);
248662
+ }
248663
+ polyface.setNumWrap(1);
248664
+ const matcher = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_9__.IndexedEdgeMatcher();
248665
+ polyface.reset();
248666
+ let numFacets = 0;
248667
+ while (polyface.moveToNextFacet()) {
248668
+ const numEdges = polyface.pointCount - 1;
248669
+ numFacets++;
248670
+ for (let i = 0; i < numEdges; i++) {
248671
+ if (stopAtVisibleEdges && polyface.edgeVisible[i]) {
248672
+ }
248673
+ else {
248674
+ matcher.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
248675
+ }
248676
+ }
248677
+ }
248678
+ const allEdges = [];
248679
+ matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
248680
+ return this.partitionFacetIndicesBySortableEdgeClusters(allEdges, numFacets);
248681
+ }
248635
248682
  /** Find segments (within the linestring) which project to facets.
248636
248683
  * * Assemble each segment pair as a facet in a new polyface
248637
248684
  * * Facets are ASSUMED to be convex and planar.
@@ -248923,7 +248970,7 @@ class PolyfaceQuery {
248923
248970
  * Set the visibility of a particular edge of a particular facet.
248924
248971
  * @param polyface containing polyface
248925
248972
  * @param facetIndex facet index
248926
- * @param vertexIndex vertex index (in vertex array)
248973
+ * @param vertexIndex vertex index (in vertex array) at which the edge starts
248927
248974
  * @param value visibility value.
248928
248975
  */
248929
248976
  static setSingleEdgeVisibility(polyface, facetIndex, vertexIndex, value) {
@@ -248932,7 +248979,22 @@ class PolyfaceQuery {
248932
248979
  const index1 = polyface.facetIndex1(facetIndex);
248933
248980
  for (let i = index0; i < index1; i++)
248934
248981
  if (data.pointIndex[i] === vertexIndex)
248935
- data.edgeVisible[i] = value;
248982
+ data.edgeVisible[i] = value; // actually sets visibility on all edges in the face that start at this vertex
248983
+ }
248984
+ /**
248985
+ * Get the visibility of a particular edge of a particular facet.
248986
+ * @param polyface containing polyface
248987
+ * @param facetIndex facet index
248988
+ * @param vertexIndex vertex index (in vertex array) at which the edge starts
248989
+ */
248990
+ static getSingleEdgeVisibility(polyface, facetIndex, vertexIndex) {
248991
+ const data = polyface.data;
248992
+ const index0 = polyface.facetIndex0(facetIndex);
248993
+ const index1 = polyface.facetIndex1(facetIndex);
248994
+ for (let i = index0; i < index1; i++)
248995
+ if (data.pointIndex[i] === vertexIndex)
248996
+ return data.edgeVisible[i]; // return visibility of first edge in the face that starts at this vertex
248997
+ return undefined;
248936
248998
  }
248937
248999
  /** Load all half edges from a mesh to an IndexedEdgeMatcher.
248938
249000
  * @param polyface a mesh, or a visitor assumed to have numWrap === 1
@@ -248950,6 +249012,46 @@ class PolyfaceQuery {
248950
249012
  }
248951
249013
  return edges;
248952
249014
  }
249015
+ /**
249016
+ * Return manifold edge pairs whose dihedral angle is bounded by the given angle.
249017
+ * * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
249018
+ * * Boundary edges are not returned as they are not manifold.
249019
+ * @param mesh existing polyface or visitor
249020
+ * @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If undefined, uses `Geometry.smallAngleRadians`.
249021
+ * @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default)
249022
+ */
249023
+ static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
249024
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface)
249025
+ return this.collectEdgesByDihedralAngle(mesh.createVisitor(1), maxSmoothEdgeAngle, sharpEdges);
249026
+ mesh.setNumWrap(1);
249027
+ const allEdges = this.createIndexedEdges(mesh);
249028
+ const manifoldEdges = [];
249029
+ allEdges.sortAndCollectClusters(manifoldEdges);
249030
+ if (undefined === maxSmoothEdgeAngle || maxSmoothEdgeAngle.radians < 0)
249031
+ maxSmoothEdgeAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_13__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians);
249032
+ const outEdges = [];
249033
+ const normal0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
249034
+ const normal1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
249035
+ for (const pair of manifoldEdges) {
249036
+ if (Array.isArray(pair) && pair.length === 2) {
249037
+ const e0 = pair[0];
249038
+ const e1 = pair[1];
249039
+ if (undefined !== PolyfaceQuery.computeFacetUnitNormal(mesh, e0.facetIndex, normal0)
249040
+ && undefined !== PolyfaceQuery.computeFacetUnitNormal(mesh, e1.facetIndex, normal1)) {
249041
+ const edgeAngle = normal0.smallerUnorientedAngleTo(normal1);
249042
+ if (sharpEdges) {
249043
+ if (edgeAngle.radians > maxSmoothEdgeAngle.radians)
249044
+ outEdges.push(pair);
249045
+ }
249046
+ else {
249047
+ if (edgeAngle.radians <= maxSmoothEdgeAngle.radians)
249048
+ outEdges.push(pair);
249049
+ }
249050
+ }
249051
+ }
249052
+ }
249053
+ return outEdges;
249054
+ }
248953
249055
  /**
248954
249056
  * * Find mated pairs among facet edges.
248955
249057
  * * Mated pairs have the same vertex indices appearing in opposite order.
@@ -290430,7 +290532,7 @@ class TestContext {
290430
290532
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
290431
290533
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_a = process.env.IMJS_URL_PREFIX) !== null && _a !== void 0 ? _a : ""}api.bentley.com/imodels` } });
290432
290534
  await core_frontend_1.NoRenderApp.startup({
290433
- applicationVersion: "3.5.0-dev.24",
290535
+ applicationVersion: "3.5.0-dev.26",
290434
290536
  applicationId: this.settings.gprid,
290435
290537
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
290436
290538
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -309563,7 +309665,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
309563
309665
  /***/ ((module) => {
309564
309666
 
309565
309667
  "use strict";
309566
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.24","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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 --no-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^3.5.0-dev.24","@itwin/core-bentley":"workspace:^3.5.0-dev.24","@itwin/core-common":"workspace:^3.5.0-dev.24","@itwin/core-geometry":"workspace:^3.5.0-dev.24","@itwin/core-orbitgt":"workspace:^3.5.0-dev.24","@itwin/core-quantity":"workspace:^3.5.0-dev.24","@itwin/webgl-compatibility":"workspace:^3.5.0-dev.24"},"//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":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/lodash":"^4.14.0","@types/mocha":"^8.2.2","@types/node":"16.11.59","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"~1.4.0","@itwin/cloud-agnostic-core":"~1.4.0","@itwin/object-storage-core":"~1.4.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","lodash":"^4.17.10","qs":"^6.5.1","semver":"^7.3.5","superagent":"7.1.3","wms-capabilities":"0.4.0","xml-js":"~1.6.11","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
309668
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.26","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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 --no-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^3.5.0-dev.26","@itwin/core-bentley":"workspace:^3.5.0-dev.26","@itwin/core-common":"workspace:^3.5.0-dev.26","@itwin/core-geometry":"workspace:^3.5.0-dev.26","@itwin/core-orbitgt":"workspace:^3.5.0-dev.26","@itwin/core-quantity":"workspace:^3.5.0-dev.26","@itwin/webgl-compatibility":"workspace:^3.5.0-dev.26"},"//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":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/lodash":"^4.14.0","@types/mocha":"^8.2.2","@types/node":"16.11.59","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"~1.4.0","@itwin/cloud-agnostic-core":"~1.4.0","@itwin/object-storage-core":"~1.4.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","lodash":"^4.17.10","qs":"^6.5.1","semver":"^7.3.5","superagent":"7.1.3","wms-capabilities":"0.4.0","xml-js":"~1.6.11","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
309567
309669
 
309568
309670
  /***/ }),
309569
309671