@itwin/ecschema-rpcinterface-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.
@@ -108410,7 +108410,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108410
108410
  get iModelId() { return super.iModelId; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection
108411
108411
  /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */
108412
108412
  static async openFile(briefcaseProps) {
108413
- const iModelProps = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("openBriefcase", briefcaseProps);
108413
+ const iModelProps = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);
108414
108414
  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);
108415
108415
  _IModelConnection__WEBPACK_IMPORTED_MODULE_5__.IModelConnection.onOpen.raiseEvent(connection);
108416
108416
  return connection;
@@ -108419,7 +108419,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108419
108419
  * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.
108420
108420
  */
108421
108421
  static async openStandalone(filePath, openMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.OpenMode.ReadWrite, opts) {
108422
- const openResponse = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("openStandalone", filePath, openMode, opts);
108422
+ const openResponse = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);
108423
108423
  const connection = new this(openResponse, openMode);
108424
108424
  _IModelConnection__WEBPACK_IMPORTED_MODULE_5__.IModelConnection.onOpen.raiseEvent(connection);
108425
108425
  return connection;
@@ -108437,7 +108437,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108437
108437
  this.beforeClose();
108438
108438
  this.txns.dispose();
108439
108439
  this._isClosed = true;
108440
- await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("closeIModel", this._fileKey);
108440
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.closeIModel(this._fileKey);
108441
108441
  }
108442
108442
  requireTimeline() {
108443
108443
  if (this.iTwinId === _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Guid.empty)
@@ -108451,7 +108451,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108451
108451
  * @param description Optional description of the changes.
108452
108452
  */
108453
108453
  async saveChanges(description) {
108454
- await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("saveChanges", this.key, description);
108454
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.saveChanges(this.key, description);
108455
108455
  }
108456
108456
  /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
108457
108457
  * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
@@ -108459,7 +108459,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108459
108459
  */
108460
108460
  async pullChanges(toIndex) {
108461
108461
  this.requireTimeline();
108462
- this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("pullChanges", this.key, toIndex);
108462
+ this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pullChanges(this.key, toIndex);
108463
108463
  }
108464
108464
  /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.
108465
108465
  * @param description The description for the changeset
@@ -108468,7 +108468,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108468
108468
  */
108469
108469
  async pushChanges(description) {
108470
108470
  this.requireTimeline();
108471
- return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("pushChanges", this.key, description);
108471
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description);
108472
108472
  }
108473
108473
  /** The current graphical editing scope, if one is in progress.
108474
108474
  * @see [[enterEditingScope]] to begin graphical editing.
@@ -108481,7 +108481,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
108481
108481
  * @see [[enterEditingScope]] to enable graphical editing.
108482
108482
  */
108483
108483
  async supportsGraphicalEditing() {
108484
- return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.callIpcHost("isGraphicalEditingSupported", this.key);
108484
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);
108485
108485
  }
108486
108486
  /** Begin a new graphical editing scope.
108487
108487
  * @throws Error if an editing scope already exists or one could not be created.
@@ -108617,31 +108617,31 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
108617
108617
  }
108618
108618
  /** Query if the briefcase has any pending Txns waiting to be pushed. */
108619
108619
  async hasPendingTxns() {
108620
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("hasPendingTxns", this._iModel.key);
108620
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);
108621
108621
  }
108622
108622
  /** Determine if any reversible (undoable) changes exist.
108623
108623
  * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
108624
108624
  */
108625
108625
  async isUndoPossible() {
108626
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("isUndoPossible", this._iModel.key);
108626
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);
108627
108627
  }
108628
108628
  /** Determine if any reinstatable (redoable) changes exist.
108629
108629
  * @see [[reinstateTxn]] to redo changes.
108630
108630
  */
108631
108631
  async isRedoPossible() {
108632
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("isRedoPossible", this._iModel.key);
108632
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);
108633
108633
  }
108634
108634
  /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.
108635
108635
  * This is useful for showing the operation that would be undone, for example in a menu.
108636
108636
  */
108637
108637
  async getUndoString() {
108638
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("getUndoString", this._iModel.key);
108638
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.getUndoString(this._iModel.key);
108639
108639
  }
108640
108640
  /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].
108641
108641
  * This is useful for showing the operation that would be redone, in a pull-down menu for example.
108642
108642
  */
108643
108643
  async getRedoString() {
108644
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("getRedoString", this._iModel.key);
108644
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.getRedoString(this._iModel.key);
108645
108645
  }
108646
108646
  /** Reverse (undo) the most recent operation.
108647
108647
  * @see [[reinstateTxn]] to redo operations.
@@ -108660,7 +108660,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
108660
108660
  * @note If numOperations is too large only the number of reversible operations are reversed.
108661
108661
  */
108662
108662
  async reverseTxns(numOperations) {
108663
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("reverseTxns", this._iModel.key, numOperations);
108663
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);
108664
108664
  }
108665
108665
  /** Reverse (undo) all changes back to the beginning of the session.
108666
108666
  * @see [[reinstateTxn]] to redo changes.
@@ -108668,7 +108668,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
108668
108668
  * @see [[isUndoPossible]] to determine if any reversible operations exist.
108669
108669
  */
108670
108670
  async reverseAll() {
108671
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("reverseAllTxn", this._iModel.key);
108671
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);
108672
108672
  }
108673
108673
  /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it
108674
108674
  * may take multiple calls to this method to reinstate all reversed operations.
@@ -108678,7 +108678,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
108678
108678
  * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
108679
108679
  */
108680
108680
  async reinstateTxn() {
108681
- return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("reinstateTxn", this._iModel.key);
108681
+ return _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);
108682
108682
  }
108683
108683
  /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed
108684
108684
  * and reopened.)
@@ -108687,7 +108687,7 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
108687
108687
  * Probably a good idea to alert the user it happened.
108688
108688
  */
108689
108689
  async restartTxnSession() {
108690
- await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("restartTxnSession", this._iModel.key);
108690
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);
108691
108691
  }
108692
108692
  /** @internal */
108693
108693
  notifyElementsChanged(changed) {
@@ -112964,7 +112964,7 @@ class GraphicalEditingScope extends _BriefcaseTxns__WEBPACK_IMPORTED_MODULE_2__.
112964
112964
  // Register the scope synchronously, in case enter() is called again for same iModel while awaiting asynchronous initialization.
112965
112965
  const scope = new GraphicalEditingScope(imodel);
112966
112966
  try {
112967
- const scopeStarted = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("toggleGraphicalEditingScope", imodel.key, true);
112967
+ const scopeStarted = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.toggleGraphicalEditingScope(imodel.key, true);
112968
112968
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(scopeStarted); // If it didn't, the backend threw an error.
112969
112969
  }
112970
112970
  catch (e) {
@@ -112986,7 +112986,7 @@ class GraphicalEditingScope extends _BriefcaseTxns__WEBPACK_IMPORTED_MODULE_2__.
112986
112986
  this.onExiting.raiseEvent(this);
112987
112987
  }
112988
112988
  finally {
112989
- const scopeExited = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("toggleGraphicalEditingScope", this.iModel.key, false);
112989
+ const scopeExited = await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.toggleGraphicalEditingScope(this.iModel.key, false);
112990
112990
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!scopeExited);
112991
112991
  try {
112992
112992
  this.onExited.raiseEvent(this);
@@ -115787,6 +115787,17 @@ class IpcApp {
115787
115787
  }
115788
115788
  return retVal.result;
115789
115789
  }
115790
+ /** Create a type safe Proxy object to make IPC calls to a registered backend interface.
115791
+ * @param channelName the channel registered by the backend handler.
115792
+ */
115793
+ static makeIpcProxy(channelName) {
115794
+ return new Proxy({}, {
115795
+ get(_target, methodName) {
115796
+ return async (...args) => IpcApp.callIpcChannel(channelName, methodName, ...args);
115797
+ },
115798
+ });
115799
+ }
115800
+ /** @deprecated use [[appFunctionIpc]] */
115790
115801
  static async callIpcHost(methodName, ...args) {
115791
115802
  return this.callIpcChannel(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.IpcAppChannel.Functions, methodName, ...args);
115792
115803
  }
@@ -115803,6 +115814,8 @@ class IpcApp {
115803
115814
  await _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.shutdown();
115804
115815
  }
115805
115816
  }
115817
+ /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */
115818
+ IpcApp.appFunctionIpc = IpcApp.makeIpcProxy(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.IpcAppChannel.Functions);
115806
115819
  /**
115807
115820
  * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply
115808
115821
  * methods to receive notifications from your backend.
@@ -116842,12 +116855,13 @@ class NativeAppNotifyHandler extends _IpcApp__WEBPACK_IMPORTED_MODULE_4__.Notifi
116842
116855
  * @public
116843
116856
  */
116844
116857
  class NativeApp {
116858
+ /** @deprecated use nativeAppIpc */
116845
116859
  static async callNativeHost(methodName, ...args) {
116846
116860
  return _IpcApp__WEBPACK_IMPORTED_MODULE_4__.IpcApp.callIpcChannel(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.nativeAppChannel, methodName, ...args);
116847
116861
  }
116848
116862
  static async setConnectivity(by, status) {
116849
116863
  _request_Request__WEBPACK_IMPORTED_MODULE_2__.RequestGlobalOptions.online = (status === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.InternetConnectivityStatus.Online);
116850
- await this.callNativeHost("overrideInternetConnectivity", by, status);
116864
+ await this.nativeAppIpc.overrideInternetConnectivity(by, status);
116851
116865
  }
116852
116866
  static hookBrowserConnectivityEvents() {
116853
116867
  if (typeof window === "object" && window.ononline && window.onoffline) {
@@ -116863,11 +116877,11 @@ class NativeApp {
116863
116877
  }
116864
116878
  /** determine whether the app currently has internet connectivity, if known */
116865
116879
  static async checkInternetConnectivity() {
116866
- return this.callNativeHost("checkInternetConnectivity");
116880
+ return this.nativeAppIpc.checkInternetConnectivity();
116867
116881
  }
116868
116882
  /** @internal */
116869
116883
  static async overrideInternetConnectivity(status) {
116870
- return this.callNativeHost("overrideInternetConnectivity", _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.OverriddenBy.User, status);
116884
+ return this.nativeAppIpc.overrideInternetConnectivity(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.OverriddenBy.User, status);
116871
116885
  }
116872
116886
  static get isValid() { return this._isValid; }
116873
116887
  /**
@@ -116879,7 +116893,7 @@ class NativeApp {
116879
116893
  if (this._isValid)
116880
116894
  return;
116881
116895
  this._isValid = true;
116882
- NativeAppNotifyHandler.register(); // receives notifications from backend
116896
+ this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend
116883
116897
  NativeApp.hookBrowserConnectivityEvents();
116884
116898
  // initialize current online state.
116885
116899
  if (window.navigator.onLine) {
@@ -116889,6 +116903,8 @@ class NativeApp {
116889
116903
  }
116890
116904
  /** @internal */
116891
116905
  static async shutdown() {
116906
+ var _b;
116907
+ (_b = this._removeAppNotify) === null || _b === void 0 ? void 0 : _b.call(this);
116892
116908
  NativeApp.unhookBrowserConnectivityEvents();
116893
116909
  await _NativeAppLogger__WEBPACK_IMPORTED_MODULE_5__.NativeAppLogger.flush();
116894
116910
  await _IpcApp__WEBPACK_IMPORTED_MODULE_4__.IpcApp.shutdown();
@@ -116903,19 +116919,19 @@ class NativeApp {
116903
116919
  });
116904
116920
  }
116905
116921
  const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :
116906
- (downloadOptions.syncMode === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.SyncMode.PullOnly ? 0 : await this.callNativeHost("acquireNewBriefcaseId", iModelId));
116922
+ (downloadOptions.syncMode === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.SyncMode.PullOnly ? 0 : await this.nativeAppIpc.acquireNewBriefcaseId(iModelId));
116907
116923
  const fileName = (_b = downloadOptions.fileName) !== null && _b !== void 0 ? _b : await this.getBriefcaseFileName({ briefcaseId, iModelId });
116908
116924
  const requestProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };
116909
116925
  const doDownload = async () => {
116910
116926
  try {
116911
- await this.callNativeHost("downloadBriefcase", requestProps, progress !== undefined, downloadOptions.progressInterval);
116927
+ await this.nativeAppIpc.downloadBriefcase(requestProps, progress !== undefined, downloadOptions.progressInterval);
116912
116928
  }
116913
116929
  finally {
116914
116930
  stopProgressEvents();
116915
116931
  }
116916
116932
  };
116917
116933
  const requestCancel = async () => {
116918
- const status = await this.callNativeHost("requestCancelDownloadBriefcase", fileName);
116934
+ const status = await this.nativeAppIpc.requestCancelDownloadBriefcase(fileName);
116919
116935
  if (status)
116920
116936
  stopProgressEvents();
116921
116937
  return status;
@@ -116924,17 +116940,17 @@ class NativeApp {
116924
116940
  }
116925
116941
  /** Get the full path filename for a briefcase within the briefcase cache */
116926
116942
  static async getBriefcaseFileName(props) {
116927
- return this.callNativeHost("getBriefcaseFileName", props);
116943
+ return this.nativeAppIpc.getBriefcaseFileName(props);
116928
116944
  }
116929
116945
  /** Delete an existing briefcase
116930
116946
  * @param fileName the briefcase fileName
116931
116947
  */
116932
116948
  static async deleteBriefcase(fileName) {
116933
- await this.callNativeHost("deleteBriefcaseFiles", fileName);
116949
+ await this.nativeAppIpc.deleteBriefcaseFiles(fileName);
116934
116950
  }
116935
- /** Get a list of all briefcase files held in the local briefcase cache directory */
116951
+ /** Get a list of all briefcase files held in the local briefcase cache directory */
116936
116952
  static async getCachedBriefcases(iModelId) {
116937
- return this.callNativeHost("getCachedBriefcases", iModelId);
116953
+ return this.nativeAppIpc.getCachedBriefcases(iModelId);
116938
116954
  }
116939
116955
  /**
116940
116956
  * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.
@@ -116944,7 +116960,7 @@ class NativeApp {
116944
116960
  static async openStorage(name) {
116945
116961
  if (this._storages.has(name))
116946
116962
  return this._storages.get(name);
116947
- const storage = new Storage(await this.callNativeHost("storageMgrOpen", name));
116963
+ const storage = new Storage(await this.nativeAppIpc.storageMgrOpen(name));
116948
116964
  this._storages.set(storage.id, storage);
116949
116965
  return storage;
116950
116966
  }
@@ -116956,15 +116972,17 @@ class NativeApp {
116956
116972
  static async closeStorage(storage, deleteStorage = false) {
116957
116973
  if (!this._storages.has(storage.id))
116958
116974
  throw new Error(`Storage [Id=${storage.id}] not open`);
116959
- await this.callNativeHost("storageMgrClose", storage.id, deleteStorage);
116975
+ await this.nativeAppIpc.storageMgrClose(storage.id, deleteStorage);
116960
116976
  this._storages.delete(storage.id);
116961
116977
  }
116962
116978
  /** Get the list of existing Storages on the local disk. */
116963
116979
  static async getStorageNames() {
116964
- return NativeApp.callNativeHost("storageMgrNames");
116980
+ return NativeApp.nativeAppIpc.storageMgrNames();
116965
116981
  }
116966
116982
  }
116967
116983
  _a = NativeApp;
116984
+ /** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */
116985
+ NativeApp.nativeAppIpc = _IpcApp__WEBPACK_IMPORTED_MODULE_4__.IpcApp.makeIpcProxy(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.nativeAppChannel);
116968
116986
  NativeApp._storages = new Map();
116969
116987
  NativeApp._onOnline = async () => {
116970
116988
  await NativeApp.setConnectivity(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.OverriddenBy.Browser, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.InternetConnectivityStatus.Online);
@@ -116986,30 +117004,30 @@ class Storage {
116986
117004
  }
116987
117005
  /** get the type of a value for a key, or undefined if not present. */
116988
117006
  async getValueType(key) {
116989
- return NativeApp.callNativeHost("storageGetValueType", this.id, key);
117007
+ return NativeApp.nativeAppIpc.storageGetValueType(this.id, key);
116990
117008
  }
116991
117009
  /** Get the value for a key */
116992
117010
  async getData(key) {
116993
- return NativeApp.callNativeHost("storageGet", this.id, key);
117011
+ return NativeApp.nativeAppIpc.storageGet(this.id, key);
116994
117012
  }
116995
117013
  /** Set value for a key */
116996
117014
  async setData(key, value) {
116997
- return NativeApp.callNativeHost("storageSet", this.id, key, value);
117015
+ return NativeApp.nativeAppIpc.storageSet(this.id, key, value);
116998
117016
  }
116999
117017
  /**
117000
117018
  * Return an array of all keys in this Storage.
117001
117019
  * @note This can be expensive, depending on the number of keys present.
117002
117020
  */
117003
117021
  async getKeys() {
117004
- return NativeApp.callNativeHost("storageKeys", this.id);
117022
+ return NativeApp.nativeAppIpc.storageKeys(this.id);
117005
117023
  }
117006
117024
  /** Remove a key and its data. */
117007
117025
  async removeData(key) {
117008
- return NativeApp.callNativeHost("storageRemove", this.id, key);
117026
+ return NativeApp.nativeAppIpc.storageRemove(this.id, key);
117009
117027
  }
117010
117028
  /** Remove all keys and their data. */
117011
117029
  async removeAll() {
117012
- return NativeApp.callNativeHost("storageRemoveAll", this.id);
117030
+ return NativeApp.nativeAppIpc.storageRemoveAll(this.id);
117013
117031
  }
117014
117032
  }
117015
117033
 
@@ -117055,7 +117073,7 @@ class NativeAppLogger {
117055
117073
  try {
117056
117074
  while (messages.length > 0) {
117057
117075
  const msg = messages.shift();
117058
- await _IpcApp__WEBPACK_IMPORTED_MODULE_1__.IpcApp.callIpcHost("log", msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });
117076
+ await _IpcApp__WEBPACK_IMPORTED_MODULE_1__.IpcApp.appFunctionIpc.log(msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });
117059
117077
  }
117060
117078
  }
117061
117079
  finally {
@@ -136331,7 +136349,6 @@ class MeshParams {
136331
136349
  indices: surfaceIndices,
136332
136350
  fillFlags: args.fillFlags,
136333
136351
  hasBakedLighting: true === args.hasBakedLighting,
136334
- hasFixedNormals: true === args.hasFixedNormals,
136335
136352
  textureMapping: undefined !== args.textureMapping ? { texture: args.textureMapping.texture, alwaysDisplayed: false } : undefined,
136336
136353
  material: (0,_SurfaceParams__WEBPACK_IMPORTED_MODULE_5__.createSurfaceMaterial)(args.material),
136337
136354
  };
@@ -137256,7 +137273,6 @@ function splitMeshParams(args) {
137256
137273
  indices,
137257
137274
  fillFlags: args.params.surface.fillFlags,
137258
137275
  hasBakedLighting: args.params.surface.hasBakedLighting,
137259
- hasFixedNormals: args.params.surface.hasFixedNormals,
137260
137276
  textureMapping: args.params.surface.textureMapping,
137261
137277
  material: material !== undefined ? material : args.params.surface.material,
137262
137278
  }, edges === null || edges === void 0 ? void 0 : edges.get(id), args.params.isPlanar,
@@ -138634,7 +138650,6 @@ var MeshArgs;
138634
138650
  isPlanar: mesh.isPlanar,
138635
138651
  is2d: mesh.is2d,
138636
138652
  hasBakedLighting: true === mesh.hasBakedLighting,
138637
- hasFixedNormals: false,
138638
138653
  isVolumeClassifier: true === mesh.isVolumeClassifier,
138639
138654
  edges,
138640
138655
  auxChannels: mesh.auxChannels,
@@ -145848,7 +145863,6 @@ class MeshData {
145848
145863
  this.fillFlags = params.surface.fillFlags;
145849
145864
  this.isPlanar = params.isPlanar;
145850
145865
  this.hasBakedLighting = params.surface.hasBakedLighting;
145851
- this.hasFixedNormals = params.surface.hasFixedNormals;
145852
145866
  const edges = params.edges;
145853
145867
  this.edgeWidth = undefined !== edges ? edges.weight : 1;
145854
145868
  this.edgeLineCode = _LineCode__WEBPACK_IMPORTED_MODULE_2__.LineCode.valueFromLinePixels(undefined !== edges ? edges.linePixels : _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Solid);
@@ -145924,7 +145938,6 @@ class MeshGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_1__.LUTGeome
145924
145938
  get uniformColor() { return this.colorInfo.isUniform ? this.colorInfo.uniform : undefined; }
145925
145939
  get texture() { return this.mesh.texture; }
145926
145940
  get hasBakedLighting() { return this.mesh.hasBakedLighting; }
145927
- get hasFixedNormals() { return this.mesh.hasFixedNormals; }
145928
145941
  get lut() { return this.mesh.lut; }
145929
145942
  get hasScalarAnimation() { return this.mesh.lut.hasScalarAnimation; }
145930
145943
  computeEdgeWeight(params) {
@@ -153855,7 +153868,6 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
153855
153868
  get techniqueId() { return 0 /* Surface */; }
153856
153869
  get isLitSurface() { return this.isLit; }
153857
153870
  get hasBakedLighting() { return this.mesh.hasBakedLighting; }
153858
- get hasFixedNormals() { return this.mesh.hasFixedNormals; }
153859
153871
  get renderOrder() {
153860
153872
  if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FillFlags.Behind === (this.fillFlags & _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FillFlags.Behind))
153861
153873
  return 2 /* BlankingRegion */;
@@ -153941,15 +153953,12 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
153941
153953
  flags[3 /* IgnoreMaterial */] = useMaterial ? 0 : 1;
153942
153954
  flags[9 /* HasMaterialAtlas */] = useMaterial && this.hasMaterialAtlas ? 1 : 0;
153943
153955
  flags[1 /* ApplyLighting */] = 0;
153944
- flags[8 /* NoFaceFront */] = 0;
153956
+ flags[8 /* HasNormalMap */] = 0;
153945
153957
  flags[6 /* HasColorAndNormal */] = 0;
153946
153958
  if (this.isLit) {
153947
153959
  flags[2 /* HasNormals */] = 1;
153948
- if (wantLighting(vf)) {
153960
+ if (wantLighting(vf))
153949
153961
  flags[1 /* ApplyLighting */] = 1;
153950
- if (this.hasFixedNormals)
153951
- flags[8 /* NoFaceFront */] = 1;
153952
- }
153953
153962
  // Textured meshes store normal in place of color index.
153954
153963
  // Untextured lit meshes store normal where textured meshes would store UV coords.
153955
153964
  // Tell shader where to find normal.
@@ -162522,7 +162531,7 @@ const applyLighting = `
162522
162531
  // Extract surface properties
162523
162532
  vec3 rgb = baseColor.rgb;
162524
162533
  vec3 normal = normalize(v_n.xyz);
162525
- normal *= 2.0 * float(!u_surfaceFlags[kSurfaceBitIndex_NoFaceFront] && gl_FrontFacing) - 1.0;
162534
+ normal *= 2.0 * float(gl_FrontFacing) - 1.0;
162526
162535
  vec3 toEye = kFrustumType_Perspective == u_frustum.z ? normalize(v_eyeSpace.xyz) : vec3(0.0, 0.0, -1.0);
162527
162536
 
162528
162537
  // Extract material properties
@@ -165137,7 +165146,7 @@ function addSurfaceFlagsLookup(builder) {
165137
165146
  builder.addConstant("kSurfaceBitIndex_BackgroundFill", 1 /* Int */, 5 /* BackgroundFill */.toString());
165138
165147
  builder.addConstant("kSurfaceBitIndex_HasColorAndNormal", 1 /* Int */, 6 /* HasColorAndNormal */.toString());
165139
165148
  builder.addConstant("kSurfaceBitIndex_OverrideRgb", 1 /* Int */, 7 /* OverrideRgb */.toString());
165140
- builder.addConstant("kSurfaceBitIndex_NoFaceFront", 1 /* Int */, 8 /* NoFaceFront */.toString());
165149
+ builder.addConstant("kSurfaceBitIndex_HasNormalMap", 1 /* Int */, 8 /* HasNormalMap */.toString());
165141
165150
  builder.addConstant("kSurfaceBitIndex_HasMaterialAtlas", 1 /* Int */, 9 /* HasMaterialAtlas */.toString());
165142
165151
  // Surface flags which get modified in vertex shader are still passed to fragment shader as a single float & are thus
165143
165152
  // used differently there & so require different constants. Unused constants are commented out.
@@ -169796,7 +169805,7 @@ class IModelTileChannel extends _internal__WEBPACK_IMPORTED_MODULE_3__.TileReque
169796
169805
  this._statistics.totalAbortedRequests += contentIds.length;
169797
169806
  }
169798
169807
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
169799
- _IpcApp__WEBPACK_IMPORTED_MODULE_2__.IpcApp.callIpcHost("cancelTileContentRequests", imodel.getRpcProps(), treeContentIds);
169808
+ _IpcApp__WEBPACK_IMPORTED_MODULE_2__.IpcApp.appFunctionIpc.cancelTileContentRequests(imodel.getRpcProps(), treeContentIds);
169800
169809
  }
169801
169810
  this._canceled.clear();
169802
169811
  }
@@ -170834,7 +170843,6 @@ class ImdlReader {
170834
170843
  indices,
170835
170844
  fillFlags: displayParams.fillFlags,
170836
170845
  hasBakedLighting: false,
170837
- hasFixedNormals: false,
170838
170846
  material,
170839
170847
  textureMapping,
170840
170848
  };
@@ -175536,7 +175544,7 @@ class TileAdmin {
175536
175544
  * @returns the TileAdmin
175537
175545
  */
175538
175546
  static async create(props) {
175539
- const rpcConcurrency = _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.isValid ? (await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.callIpcHost("queryConcurrency", "cpu")) : undefined;
175547
+ const rpcConcurrency = _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.isValid ? (await _IpcApp__WEBPACK_IMPORTED_MODULE_3__.IpcApp.appFunctionIpc.queryConcurrency("cpu")) : undefined;
175540
175548
  const isMobile = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ProcessDetector.isMobileBrowser;
175541
175549
  return new TileAdmin(isMobile, rpcConcurrency, props);
175542
175550
  }
@@ -177117,7 +177125,7 @@ class ElementGraphicsChannel extends _internal__WEBPACK_IMPORTED_MODULE_1__.Tile
177117
177125
  processCancellations() {
177118
177126
  for (const [imodel, requestIds] of this._canceled) {
177119
177127
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
177120
- _IpcApp__WEBPACK_IMPORTED_MODULE_0__.IpcApp.callIpcHost("cancelElementGraphicsRequests", imodel.key, requestIds);
177128
+ _IpcApp__WEBPACK_IMPORTED_MODULE_0__.IpcApp.appFunctionIpc.cancelElementGraphicsRequests(imodel.key, requestIds);
177121
177129
  this._statistics.totalAbortedRequests += requestIds.length;
177122
177130
  }
177123
177131
  this._canceled.clear();
@@ -177288,12 +177296,18 @@ class TileStorage {
177288
177296
  const transferConfig = await this.getTransferConfig(tokenProps, iModelId);
177289
177297
  if (transferConfig === undefined)
177290
177298
  return undefined;
177291
- const buffer = await this.storage.download({
177292
- reference: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.getTileObjectReference)(iModelId, changesetId, treeId, contentId, guid),
177293
- transferConfig,
177294
- transferType: "buffer",
177295
- });
177296
- return new Uint8Array(buffer); // should always be Buffer because transferType === "buffer"
177299
+ try {
177300
+ const buffer = await this.storage.download({
177301
+ reference: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.getTileObjectReference)(iModelId, changesetId, treeId, contentId, guid),
177302
+ transferConfig,
177303
+ transferType: "buffer",
177304
+ });
177305
+ return new Uint8Array(buffer); // should always be Buffer because transferType === "buffer"
177306
+ }
177307
+ catch (_) {
177308
+ // @itwin/object-storage re-throws internal implementation-specific errors, so let's treat them all as 404 for now.
177309
+ return undefined;
177310
+ }
177297
177311
  }
177298
177312
  async getTransferConfig(tokenProps, iModelId) {
177299
177313
  if (this._transferConfigs.has(iModelId)) {
@@ -253392,11 +253406,11 @@ class IndexedEdgeMatcher {
253392
253406
  * * caller must allocate all result arrays of interest.
253393
253407
  * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
253394
253408
  * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.
253395
- * * 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
253396
- * `sortAndCollectClusters (undefined, allOther, allOther);`
253409
+ * * 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
253410
+ * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
253397
253411
  * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.
253398
253412
  * @param singletons optional array to receive edges that are simple boundary edges.
253399
- * @param nullEdges clusters with null edges (same start and end vertex)
253413
+ * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
253400
253414
  * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.
253401
253415
  */
253402
253416
  sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
@@ -253755,7 +253769,8 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
253755
253769
  * @param indices array of indices.
253756
253770
  * @param indexPositionA first index to test
253757
253771
  * @param indexPositionB one past final index to test
253758
- * @param data data array. Only its length is referenced.
253772
+ * @param data data array
253773
+ * @param dataLength length of data array
253759
253774
  */
253760
253775
  static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
253761
253776
  if (indices === undefined && data === undefined)
@@ -253771,6 +253786,12 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
253771
253786
  return false;
253772
253787
  return true;
253773
253788
  }
253789
+ /**
253790
+ * Returns the number of facets of this polyface. Subclasses should override.
253791
+ */
253792
+ get facetCount() {
253793
+ return undefined;
253794
+ }
253774
253795
  }
253775
253796
  /**
253776
253797
  * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point, normal, param, and color indices.
@@ -257766,14 +257787,17 @@ class PolyfaceQuery {
257766
257787
  * Return a mesh with
257767
257788
  * * clusters of adjacent, coplanar facets merged into larger facets.
257768
257789
  * * other facets included unchanged.
257769
- * @param mesh existing mesh
257790
+ * @param mesh existing mesh or visitor
257770
257791
  * @returns
257771
257792
  */
257772
257793
  static cloneWithMaximalPlanarFacets(mesh) {
257773
- PolyfaceQuery.markPairedEdgesInvisible(mesh, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_13__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians));
257774
- const partitions = PolyfaceQuery.partitionFacetIndicesByEdgeConnectedComponent(mesh, true);
257794
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface)
257795
+ return this.cloneWithMaximalPlanarFacets(mesh.createVisitor(0));
257796
+ const numFacets = PolyfaceQuery.visitorClientFacetCount(mesh);
257797
+ const smoothEdges = PolyfaceQuery.collectEdgesByDihedralAngle(mesh);
257798
+ const partitions = PolyfaceQuery.partitionFacetIndicesBySortableEdgeClusters(smoothEdges, numFacets);
257775
257799
  const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
257776
- const visitor = mesh.createVisitor(0);
257800
+ const visitor = mesh;
257777
257801
  const planarPartitions = [];
257778
257802
  for (const partition of partitions) {
257779
257803
  if (partition.length === 1) {
@@ -257833,7 +257857,7 @@ class PolyfaceQuery {
257833
257857
  * @returns
257834
257858
  */
257835
257859
  static fillSimpleHoles(mesh, options, unfilledChains) {
257836
- if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.IndexedPolyface)
257860
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface)
257837
257861
  return this.fillSimpleHoles(mesh.createVisitor(0), options, unfilledChains);
257838
257862
  const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
257839
257863
  const chains = [];
@@ -257927,32 +257951,27 @@ class PolyfaceQuery {
257927
257951
  }
257928
257952
  return maxIndex + 1;
257929
257953
  }
257930
- /** Search the facets for facet subsets that are connected with at least edge contact.
257931
- * * Return array of arrays of facet indices.
257954
+ /** If the visitor's client is a polyface, simply return its facet count.
257955
+ * If not a polyface, visit all facets to accumulate a count.
257932
257956
  */
257933
- static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
257934
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface) {
257935
- return this.partitionFacetIndicesByEdgeConnectedComponent(polyface.createVisitor(0), stopAtVisibleEdges);
257936
- }
257937
- polyface.setNumWrap(1);
257938
- const matcher = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_9__.IndexedEdgeMatcher();
257939
- polyface.reset();
257940
- let numFacets = 0;
257941
- while (polyface.moveToNextFacet()) {
257942
- const numEdges = polyface.pointCount - 1;
257943
- numFacets++;
257944
- for (let i = 0; i < numEdges; i++) {
257945
- if (stopAtVisibleEdges && polyface.edgeVisible[i]) {
257946
- }
257947
- else {
257948
- matcher.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
257949
- }
257950
- }
257951
- }
257952
- const allEdges = [];
257953
- matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
257957
+ static visitorClientFacetCount(visitor) {
257958
+ const polyface = visitor.clientPolyface();
257959
+ if (polyface !== undefined && polyface.facetCount !== undefined)
257960
+ return polyface.facetCount;
257961
+ let facetCount = 0;
257962
+ visitor.reset();
257963
+ while (visitor.moveToNextFacet())
257964
+ ++facetCount;
257965
+ return facetCount;
257966
+ }
257967
+ /** 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.
257968
+ * @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
257969
+ * @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
257970
+ * @return collection of facet index arrays, one array per connected component
257971
+ */
257972
+ static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
257954
257973
  const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_12__.UnionFindContext(numFacets);
257955
- for (const cluster of allEdges) {
257974
+ for (const cluster of edgeClusters) {
257956
257975
  if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_9__.SortableEdge) {
257957
257976
  // this edge does not connect anywhere. Ignore it!!
257958
257977
  }
@@ -257979,6 +257998,34 @@ class PolyfaceQuery {
257979
257998
  }
257980
257999
  return facetsInComponent;
257981
258000
  }
258001
+ /** 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).
258002
+ * @param polyface facets to partition
258003
+ * @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface
258004
+ * @return collection of facet index arrays, one per connected component
258005
+ */
258006
+ static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
258007
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface) {
258008
+ return this.partitionFacetIndicesByEdgeConnectedComponent(polyface.createVisitor(0), stopAtVisibleEdges);
258009
+ }
258010
+ polyface.setNumWrap(1);
258011
+ const matcher = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_9__.IndexedEdgeMatcher();
258012
+ polyface.reset();
258013
+ let numFacets = 0;
258014
+ while (polyface.moveToNextFacet()) {
258015
+ const numEdges = polyface.pointCount - 1;
258016
+ numFacets++;
258017
+ for (let i = 0; i < numEdges; i++) {
258018
+ if (stopAtVisibleEdges && polyface.edgeVisible[i]) {
258019
+ }
258020
+ else {
258021
+ matcher.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
258022
+ }
258023
+ }
258024
+ }
258025
+ const allEdges = [];
258026
+ matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
258027
+ return this.partitionFacetIndicesBySortableEdgeClusters(allEdges, numFacets);
258028
+ }
257982
258029
  /** Find segments (within the linestring) which project to facets.
257983
258030
  * * Assemble each segment pair as a facet in a new polyface
257984
258031
  * * Facets are ASSUMED to be convex and planar.
@@ -258270,7 +258317,7 @@ class PolyfaceQuery {
258270
258317
  * Set the visibility of a particular edge of a particular facet.
258271
258318
  * @param polyface containing polyface
258272
258319
  * @param facetIndex facet index
258273
- * @param vertexIndex vertex index (in vertex array)
258320
+ * @param vertexIndex vertex index (in vertex array) at which the edge starts
258274
258321
  * @param value visibility value.
258275
258322
  */
258276
258323
  static setSingleEdgeVisibility(polyface, facetIndex, vertexIndex, value) {
@@ -258279,7 +258326,22 @@ class PolyfaceQuery {
258279
258326
  const index1 = polyface.facetIndex1(facetIndex);
258280
258327
  for (let i = index0; i < index1; i++)
258281
258328
  if (data.pointIndex[i] === vertexIndex)
258282
- data.edgeVisible[i] = value;
258329
+ data.edgeVisible[i] = value; // actually sets visibility on all edges in the face that start at this vertex
258330
+ }
258331
+ /**
258332
+ * Get the visibility of a particular edge of a particular facet.
258333
+ * @param polyface containing polyface
258334
+ * @param facetIndex facet index
258335
+ * @param vertexIndex vertex index (in vertex array) at which the edge starts
258336
+ */
258337
+ static getSingleEdgeVisibility(polyface, facetIndex, vertexIndex) {
258338
+ const data = polyface.data;
258339
+ const index0 = polyface.facetIndex0(facetIndex);
258340
+ const index1 = polyface.facetIndex1(facetIndex);
258341
+ for (let i = index0; i < index1; i++)
258342
+ if (data.pointIndex[i] === vertexIndex)
258343
+ return data.edgeVisible[i]; // return visibility of first edge in the face that starts at this vertex
258344
+ return undefined;
258283
258345
  }
258284
258346
  /** Load all half edges from a mesh to an IndexedEdgeMatcher.
258285
258347
  * @param polyface a mesh, or a visitor assumed to have numWrap === 1
@@ -258297,6 +258359,46 @@ class PolyfaceQuery {
258297
258359
  }
258298
258360
  return edges;
258299
258361
  }
258362
+ /**
258363
+ * Return manifold edge pairs whose dihedral angle is bounded by the given angle.
258364
+ * * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
258365
+ * * Boundary edges are not returned as they are not manifold.
258366
+ * @param mesh existing polyface or visitor
258367
+ * @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If undefined, uses `Geometry.smallAngleRadians`.
258368
+ * @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default)
258369
+ */
258370
+ static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
258371
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_3__.Polyface)
258372
+ return this.collectEdgesByDihedralAngle(mesh.createVisitor(1), maxSmoothEdgeAngle, sharpEdges);
258373
+ mesh.setNumWrap(1);
258374
+ const allEdges = this.createIndexedEdges(mesh);
258375
+ const manifoldEdges = [];
258376
+ allEdges.sortAndCollectClusters(manifoldEdges);
258377
+ if (undefined === maxSmoothEdgeAngle || maxSmoothEdgeAngle.radians < 0)
258378
+ maxSmoothEdgeAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_13__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians);
258379
+ const outEdges = [];
258380
+ const normal0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
258381
+ const normal1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
258382
+ for (const pair of manifoldEdges) {
258383
+ if (Array.isArray(pair) && pair.length === 2) {
258384
+ const e0 = pair[0];
258385
+ const e1 = pair[1];
258386
+ if (undefined !== PolyfaceQuery.computeFacetUnitNormal(mesh, e0.facetIndex, normal0)
258387
+ && undefined !== PolyfaceQuery.computeFacetUnitNormal(mesh, e1.facetIndex, normal1)) {
258388
+ const edgeAngle = normal0.smallerUnorientedAngleTo(normal1);
258389
+ if (sharpEdges) {
258390
+ if (edgeAngle.radians > maxSmoothEdgeAngle.radians)
258391
+ outEdges.push(pair);
258392
+ }
258393
+ else {
258394
+ if (edgeAngle.radians <= maxSmoothEdgeAngle.radians)
258395
+ outEdges.push(pair);
258396
+ }
258397
+ }
258398
+ }
258399
+ }
258400
+ return outEdges;
258401
+ }
258300
258402
  /**
258301
258403
  * * Find mated pairs among facet edges.
258302
258404
  * * Mated pairs have the same vertex indices appearing in opposite order.
@@ -309241,7 +309343,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
309241
309343
  /***/ ((module) => {
309242
309344
 
309243
309345
  "use strict";
309244
- 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"}}]}}');
309346
+ 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"}}]}}');
309245
309347
 
309246
309348
  /***/ })
309247
309349