@itwin/core-frontend 3.5.0-dev.26 → 3.5.0-dev.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/BriefcaseConnection.d.ts +28 -1
- package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
- package/lib/cjs/BriefcaseConnection.js +23 -2
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/IpcApp.d.ts +6 -0
- package/lib/cjs/IpcApp.d.ts.map +1 -1
- package/lib/cjs/IpcApp.js +12 -0
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/MarginPercent.d.ts +27 -2
- package/lib/cjs/MarginPercent.d.ts.map +1 -1
- package/lib/cjs/MarginPercent.js +8 -2
- package/lib/cjs/MarginPercent.js.map +1 -1
- package/lib/cjs/ViewAnimation.d.ts +10 -2
- package/lib/cjs/ViewAnimation.d.ts.map +1 -1
- package/lib/cjs/ViewAnimation.js.map +1 -1
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +22 -2
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/render/webgl/System.d.ts +1 -1
- package/lib/cjs/tile/RealityTileTree.js +1 -1
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts +5 -2
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.js +17 -2
- package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/BriefcaseConnection.d.ts +28 -1
- package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
- package/lib/esm/BriefcaseConnection.js +24 -3
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/IpcApp.d.ts +6 -0
- package/lib/esm/IpcApp.d.ts.map +1 -1
- package/lib/esm/IpcApp.js +12 -0
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/MarginPercent.d.ts +27 -2
- package/lib/esm/MarginPercent.d.ts.map +1 -1
- package/lib/esm/MarginPercent.js +8 -2
- package/lib/esm/MarginPercent.js.map +1 -1
- package/lib/esm/ViewAnimation.d.ts +10 -2
- package/lib/esm/ViewAnimation.d.ts.map +1 -1
- package/lib/esm/ViewAnimation.js.map +1 -1
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +22 -2
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/render/webgl/System.d.ts +1 -1
- package/lib/esm/tile/RealityTileTree.js +1 -1
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.d.ts +5 -2
- package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.js +18 -3
- package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/package.json +20 -20
|
@@ -6,6 +6,32 @@ import { ChangesetIndex, ChangesetIndexAndId, IModelConnectionProps, OpenBriefca
|
|
|
6
6
|
import { BriefcaseTxns } from "./BriefcaseTxns";
|
|
7
7
|
import { GraphicalEditingScope } from "./GraphicalEditingScope";
|
|
8
8
|
import { IModelConnection } from "./IModelConnection";
|
|
9
|
+
import { ProgressCallback } from "./request/Request";
|
|
10
|
+
/**
|
|
11
|
+
* Partial interface of AbortSignal.
|
|
12
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
export interface GenericAbortSignal {
|
|
16
|
+
/** Add Listener for abort signal. */
|
|
17
|
+
addEventListener: (type: "abort", listener: (this: GenericAbortSignal, ev: any) => any) => void;
|
|
18
|
+
/** Remove Listener for abort signal. */
|
|
19
|
+
removeEventListener: (type: "abort", listener: (this: GenericAbortSignal, ev: any) => any) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options for pulling iModel changes.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export interface PullChangesOptions {
|
|
26
|
+
/** Function called regularly to report progress of changes download. */
|
|
27
|
+
progressCallback?: ProgressCallback;
|
|
28
|
+
/** Interval for calling progress callback (in milliseconds). */
|
|
29
|
+
progressInterval?: number;
|
|
30
|
+
/** Signal for cancelling the download.
|
|
31
|
+
* @alpha
|
|
32
|
+
*/
|
|
33
|
+
abortSignal?: GenericAbortSignal;
|
|
34
|
+
}
|
|
9
35
|
/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].
|
|
10
36
|
* For example, tools that want to create new elements can consult the briefcase's editor tool settings to
|
|
11
37
|
* determine into which model and category to insert the elements.
|
|
@@ -78,9 +104,10 @@ export declare class BriefcaseConnection extends IModelConnection {
|
|
|
78
104
|
saveChanges(description?: string): Promise<void>;
|
|
79
105
|
/** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
|
|
80
106
|
* @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
|
|
107
|
+
* @param options Options for pulling changes.
|
|
81
108
|
* @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.
|
|
82
109
|
*/
|
|
83
|
-
pullChanges(toIndex?: ChangesetIndex): Promise<void>;
|
|
110
|
+
pullChanges(toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<void>;
|
|
84
111
|
/** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.
|
|
85
112
|
* @param description The description for the changeset
|
|
86
113
|
* @returns the changesetId of the pushed changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseConnection.d.ts","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAA2B,UAAU,EAAE,UAAU,EAAgB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/H,OAAO,EACL,cAAc,
|
|
1
|
+
{"version":3,"file":"BriefcaseConnection.d.ts","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAA2B,UAAU,EAAE,UAAU,EAAgB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/H,OAAO,EACL,cAAc,EAAE,mBAAmB,EAA4B,qBAAqB,EACpC,kBAAkB,EAAE,qBAAqB,EAC1F,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,GAAG,KAAK,GAAG,KAAK,IAAI,CAAC;IAChG,wCAAwC;IACxC,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,GAAG,KAAK,GAAG,KAAK,IAAI,CAAC;CACpG;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC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AI,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOzJ,2DAA2D;IAC3D,IAAW,QAAQ,IAAI,OAAO,CAAoC;IAElE;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAanC,OAAO,CAAC,eAAe;IAKvB,2FAA2F;IAC9E,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/C;;OAEG;IACU,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D;;;;OAIG;IACU,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4B/F;;;;OAIG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK3E;;OAEG;IACH,IAAW,YAAY,IAAI,qBAAqB,GAAG,SAAS,CAE3D;IAED;;;OAGG;IACU,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzD;;;;;OAKG;IACU,iBAAiB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAIhE;;OAEG;IACH,SAAgB,sBAAsB,4BAAiC,IAAI,MAAM,CAAC,KAAK,IAAI,EAAI;CAChG"}
|
|
@@ -238,11 +238,32 @@ class BriefcaseConnection extends IModelConnection_1.IModelConnection {
|
|
|
238
238
|
}
|
|
239
239
|
/** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
|
|
240
240
|
* @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
|
|
241
|
+
* @param options Options for pulling changes.
|
|
241
242
|
* @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.
|
|
242
243
|
*/
|
|
243
|
-
async pullChanges(toIndex) {
|
|
244
|
+
async pullChanges(toIndex, options) {
|
|
245
|
+
const removeListeners = [];
|
|
246
|
+
if (options === null || options === void 0 ? void 0 : options.progressCallback) {
|
|
247
|
+
const removeProgressListener = IpcApp_1.IpcApp.addListener((0, core_common_1.getPullChangesIpcChannel)(this.iModelId), (_evt, data) => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.progressCallback) === null || _a === void 0 ? void 0 : _a.call(options, data); });
|
|
248
|
+
removeListeners.push(removeProgressListener);
|
|
249
|
+
}
|
|
250
|
+
if (options === null || options === void 0 ? void 0 : options.abortSignal) {
|
|
251
|
+
const abort = () => void IpcApp_1.IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);
|
|
252
|
+
options === null || options === void 0 ? void 0 : options.abortSignal.addEventListener("abort", abort);
|
|
253
|
+
removeListeners.push(() => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abort); });
|
|
254
|
+
}
|
|
244
255
|
this.requireTimeline();
|
|
245
|
-
|
|
256
|
+
const ipcAppOptions = {
|
|
257
|
+
reportProgress: !!(options === null || options === void 0 ? void 0 : options.progressCallback),
|
|
258
|
+
progressInterval: options === null || options === void 0 ? void 0 : options.progressInterval,
|
|
259
|
+
enableCancellation: !!(options === null || options === void 0 ? void 0 : options.abortSignal),
|
|
260
|
+
};
|
|
261
|
+
try {
|
|
262
|
+
this.changeset = await IpcApp_1.IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);
|
|
263
|
+
}
|
|
264
|
+
finally {
|
|
265
|
+
removeListeners.forEach((remove) => remove());
|
|
266
|
+
}
|
|
246
267
|
}
|
|
247
268
|
/** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.
|
|
248
269
|
* @param description The description for the changeset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseConnection.js","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+H;AAC/H,oDAG4B;AAC5B,mDAAgD;AAChD,mEAAgE;AAChE,2CA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cAAc;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,WAAoB;QAC3C,MAAM,eAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,OAAwB;QAC/C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,MAAM,eAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,WAAmB;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,eAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,wBAAwB;QACnC,OAAO,eAAM,CAAC,cAAc,CAAC,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;CAMF;AAlID,kDAkIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelConnection\r\n */\r\n\r\nimport { assert, BeEvent, CompressedId64Set, Guid, GuidString, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndex,\r\n ChangesetIndexAndId, IModelConnectionProps, IModelError, OpenBriefcaseProps, StandaloneOpenOptions,\r\n} from \"@itwin/core-common\";\r\nimport { BriefcaseTxns } from \"./BriefcaseTxns\";\r\nimport { GraphicalEditingScope } from \"./GraphicalEditingScope\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { IpcApp } from \"./IpcApp\";\r\nimport { disposeTileTreesForGeometricModels } from \"./tile/internal\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/** Keeps track of changes to models, buffering them until synchronization points.\r\n * While a GraphicalEditingScope is open, the changes are buffered until the scope exits, at which point they are processed.\r\n * Otherwise, the buffered changes are processed after undo/redo, commit, or pull+merge changes.\r\n */\r\nclass ModelChangeMonitor {\r\n private _editingScope?: GraphicalEditingScope;\r\n private readonly _briefcase: BriefcaseConnection;\r\n private readonly _deletedModels = new Set<string>();\r\n private readonly _modelIdToGuid = new Map<string, string>();\r\n private readonly _removals: VoidFunction[] = [];\r\n\r\n public constructor(briefcase: BriefcaseConnection) {\r\n this._briefcase = briefcase;\r\n\r\n // Buffer updated geometry guids.\r\n this._removals.push(briefcase.txns.onModelGeometryChanged.addListener((changes) => {\r\n for (const change of changes) {\r\n this._deletedModels.delete(change.id);\r\n this._modelIdToGuid.set(change.id, change.guid);\r\n }\r\n }));\r\n\r\n // Buffer deletions of models.\r\n this._removals.push(briefcase.txns.onModelsChanged.addListener((changes) => {\r\n if (changes.deleted) {\r\n for (const id of CompressedId64Set.iterable(changes.deleted)) {\r\n this._modelIdToGuid.delete(id);\r\n this._deletedModels.add(id);\r\n }\r\n }\r\n }));\r\n\r\n // Outside of an editing scope, we want to update viewport contents after commit, undo/redo, or merging changes.\r\n const maybeProcess = async () => {\r\n if (this.editingScope)\r\n return;\r\n\r\n const modelIds = Array.from(this._modelIdToGuid.keys());\r\n if (modelIds.length > 0)\r\n await IModelApp.tileAdmin.purgeTileTrees(this._briefcase, modelIds);\r\n\r\n this.processBuffered();\r\n };\r\n\r\n this._removals.push(briefcase.txns.onCommitted.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onAfterUndoRedo.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onChangesPulled.addListener(maybeProcess));\r\n }\r\n\r\n public async close(): Promise<void> {\r\n for (const removal of this._removals)\r\n removal();\r\n\r\n this._removals.length = 0;\r\n\r\n if (this._editingScope) {\r\n await this._editingScope.exit();\r\n this._editingScope = undefined;\r\n }\r\n }\r\n\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._editingScope;\r\n }\r\n\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n if (this._editingScope)\r\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\r\n\r\n this._editingScope = await GraphicalEditingScope.enter(this._briefcase);\r\n\r\n const removeGeomListener = this._editingScope.onGeometryChanges.addListener((changes) => {\r\n const modelIds = [];\r\n for (const change of changes)\r\n modelIds.push(change.id);\r\n\r\n this.invalidateScenes(modelIds);\r\n });\r\n\r\n this._editingScope.onExited.addOnce((scope) => {\r\n assert(scope === this._editingScope);\r\n this._editingScope = undefined;\r\n removeGeomListener();\r\n this.processBuffered();\r\n });\r\n\r\n return this._editingScope;\r\n }\r\n\r\n private processBuffered(): void {\r\n const models = this._briefcase.models;\r\n for (const [id, guid] of this._modelIdToGuid) {\r\n const model = models.getLoaded(id)?.asGeometricModel;\r\n if (model)\r\n model.geometryGuid = guid;\r\n }\r\n\r\n const modelIds = new Set<string>(this._modelIdToGuid.keys());\r\n for (const deleted of this._deletedModels) {\r\n modelIds.add(deleted);\r\n models.unload(deleted);\r\n }\r\n\r\n this.invalidateScenes(modelIds);\r\n disposeTileTreesForGeometricModels(modelIds, this._briefcase);\r\n\r\n this._briefcase.onBufferedModelChanges.raiseEvent(modelIds);\r\n\r\n this._modelIdToGuid.clear();\r\n this._deletedModels.clear();\r\n }\r\n\r\n private invalidateScenes(changedModels: Iterable<Id64String>): void {\r\n for (const user of IModelApp.tileAdmin.tileUsers) {\r\n if (user instanceof Viewport && user.iModel === this._briefcase) {\r\n for (const modelId of changedModels) {\r\n if (user.view.viewsModel(modelId)) {\r\n user.invalidateScene();\r\n user.setFeatureOverrideProviderChanged();\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].\r\n * For example, tools that want to create new elements can consult the briefcase's editor tool settings to\r\n * determine into which model and category to insert the elements.\r\n * Specialized tools are free to ignore these settings.\r\n * @see [[BriefcaseConnection.editorToolSettings]] to query or modify the current settings for a briefcase.\r\n * @see [CreateElementTool]($editor-frontend) for an example of a tool that uses these settings.\r\n * @alpha\r\n */\r\nexport class BriefcaseEditorToolSettings {\r\n private _category?: Id64String;\r\n private _model?: Id64String;\r\n\r\n /** An event raised just after the default [[category]] is changed. */\r\n public readonly onCategoryChanged = new BeEvent<(previousCategory: Id64String | undefined) => void>();\r\n\r\n /** An event raised just after the default [[model]] is changed. */\r\n public readonly onModelChanged = new BeEvent<(previousModel: Id64String | undefined) => void>();\r\n\r\n /** The [Category]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate category.\r\n * @see [[onCategoryChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetCategory]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get category(): Id64String | undefined {\r\n return this._category;\r\n }\r\n public set category(category: Id64String | undefined) {\r\n const previousCategory = this.category;\r\n if (category !== this.category) {\r\n this._category = category;\r\n this.onCategoryChanged.raiseEvent(previousCategory);\r\n }\r\n }\r\n\r\n /** The [Model]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate model.\r\n * @see [[onModelChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetModel]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get model(): Id64String | undefined {\r\n return this._model;\r\n }\r\n public set model(model: Id64String | undefined) {\r\n const previousModel = this.model;\r\n if (model !== this.model) {\r\n this._model = model;\r\n this.onModelChanged.raiseEvent(previousModel);\r\n }\r\n }\r\n}\r\n\r\n/** A connection to an editable briefcase on the backend. This class uses [Ipc]($docs/learning/IpcInterface.md) to communicate\r\n * to the backend and may only be used by [[IpcApp]]s.\r\n * @public\r\n */\r\nexport class BriefcaseConnection extends IModelConnection {\r\n protected _isClosed?: boolean;\r\n private readonly _modelsMonitor: ModelChangeMonitor;\r\n /** Default settings that can be used to control the behavior of [[Tool]]s that modify this briefcase.\r\n * @alpha\r\n */\r\n public readonly editorToolSettings = new BriefcaseEditorToolSettings();\r\n\r\n /** Manages local changes to the briefcase via [Txns]($docs/learning/InteractiveEditing.md). */\r\n public readonly txns: BriefcaseTxns;\r\n\r\n /** @internal */\r\n public override isBriefcaseConnection(): this is BriefcaseConnection { return true; }\r\n\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public override get iTwinId(): GuidString { return super.iTwinId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n /** The Guid that identifies this iModel. */\r\n public override get iModelId(): GuidString { return super.iModelId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n protected constructor(props: IModelConnectionProps, openMode: OpenMode) {\r\n super(props);\r\n this._openMode = openMode;\r\n this.txns = new BriefcaseTxns(this);\r\n this._modelsMonitor = new ModelChangeMonitor(this);\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */\r\n public static async openFile(briefcaseProps: OpenBriefcaseProps): Promise<BriefcaseConnection> {\r\n const iModelProps = await IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);\r\n const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? OpenMode.Readonly : OpenMode.ReadWrite);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [StandaloneDb]($backend)\r\n * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.\r\n */\r\n public static async openStandalone(filePath: string, openMode: OpenMode = OpenMode.ReadWrite, opts?: StandaloneOpenOptions): Promise<BriefcaseConnection> {\r\n const openResponse = await IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);\r\n const connection = new this(openResponse, openMode);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Returns `true` if [[close]] has already been called. */\r\n public get isClosed(): boolean { return this._isClosed === true; }\r\n\r\n /**\r\n * Close this BriefcaseConnection.\r\n * @note make sure to call [[saveChanges]] before calling this method. Unsaved local changes are abandoned.\r\n */\r\n public async close(): Promise<void> {\r\n if (this.isClosed)\r\n return;\r\n\r\n await this._modelsMonitor.close();\r\n\r\n this.beforeClose();\r\n this.txns.dispose();\r\n\r\n this._isClosed = true;\r\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\r\n }\r\n\r\n private requireTimeline() {\r\n if (this.iTwinId === Guid.empty)\r\n throw new IModelError(IModelStatus.WrongIModel, \"iModel has no timeline\");\r\n }\r\n\r\n /** Query if there are any pending Txns in this briefcase that are waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return this.txns.hasPendingTxns();\r\n }\r\n\r\n /** Commit pending changes to this briefcase.\r\n * @param description Optional description of the changes.\r\n */\r\n public async saveChanges(description?: string): Promise<void> {\r\n await IpcApp.appFunctionIpc.saveChanges(this.key, description);\r\n }\r\n\r\n /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase\r\n * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.\r\n * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.\r\n */\r\n public async pullChanges(toIndex?: ChangesetIndex): Promise<void> {\r\n this.requireTimeline();\r\n this.changeset = await IpcApp.appFunctionIpc.pullChanges(this.key, toIndex);\r\n }\r\n\r\n /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.\r\n * @param description The description for the changeset\r\n * @returns the changesetId of the pushed changes\r\n * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.\r\n */\r\n public async pushChanges(description: string): Promise<ChangesetIndexAndId> {\r\n this.requireTimeline();\r\n return IpcApp.appFunctionIpc.pushChanges(this.key, description);\r\n }\r\n\r\n /** The current graphical editing scope, if one is in progress.\r\n * @see [[enterEditingScope]] to begin graphical editing.\r\n */\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._modelsMonitor.editingScope;\r\n }\r\n\r\n /** Return whether graphical editing is supported for this briefcase. It is not supported if the briefcase is read-only, or the briefcase contains a version of\r\n * the BisCore ECSchema older than v0.1.11.\r\n * @see [[enterEditingScope]] to enable graphical editing.\r\n */\r\n public async supportsGraphicalEditing(): Promise<boolean> {\r\n return IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);\r\n }\r\n\r\n /** Begin a new graphical editing scope.\r\n * @throws Error if an editing scope already exists or one could not be created.\r\n * @see [[GraphicalEditingScope.exit]] to exit the scope.\r\n * @see [[supportsGraphicalEditing]] to determine whether this method should be expected to succeed.\r\n * @see [[editingScope]] to obtain the current editing scope, if one is in progress.\r\n */\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n return this._modelsMonitor.enterEditingScope();\r\n }\r\n\r\n /** Strictly for tests - dispatched from ModelChangeMonitor.processBuffered.\r\n * @internal\r\n */\r\n public readonly onBufferedModelChanges = new BeEvent<(changedModelIds: Set<string>) => void>();\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BriefcaseConnection.js","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+H;AAC/H,oDAG4B;AAC5B,mDAAgD;AAChD,mEAAgE;AAChE,2CAAwC;AACxC,yDAAsD;AACtD,qCAAkC;AAElC,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,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAA;YAC3C,gBAAgB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB;YAC3C,kBAAkB,EAAE,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAA;SAC3C,CAAC;QACF,IAAI;YACF,IAAI,CAAC,SAAS,GAAG,MAAM,eAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;SAC5F;gBAAS;YACR,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;SAC/C;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,WAAmB;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,eAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,wBAAwB;QACnC,OAAO,eAAM,CAAC,cAAc,CAAC,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;CAMF;AA1JD,kDA0JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelConnection\r\n */\r\n\r\nimport { assert, BeEvent, CompressedId64Set, Guid, GuidString, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndex, ChangesetIndexAndId, getPullChangesIpcChannel, IModelConnectionProps, IModelError,\r\n PullChangesOptions as IpcAppPullChangesOptions, OpenBriefcaseProps, StandaloneOpenOptions,\r\n} from \"@itwin/core-common\";\r\nimport { BriefcaseTxns } from \"./BriefcaseTxns\";\r\nimport { GraphicalEditingScope } from \"./GraphicalEditingScope\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { IpcApp } from \"./IpcApp\";\r\nimport { ProgressCallback } from \"./request/Request\";\r\nimport { disposeTileTreesForGeometricModels } from \"./tile/internal\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/**\r\n * Partial interface of AbortSignal.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\r\n * @alpha\r\n */\r\nexport interface GenericAbortSignal {\r\n /** Add Listener for abort signal. */\r\n addEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\r\n /** Remove Listener for abort signal. */\r\n removeEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\r\n}\r\n\r\n/**\r\n * Options for pulling iModel changes.\r\n * @public\r\n */\r\nexport interface PullChangesOptions {\r\n /** Function called regularly to report progress of changes download. */\r\n progressCallback?: ProgressCallback;\r\n /** Interval for calling progress callback (in milliseconds). */\r\n progressInterval?: number;\r\n /** Signal for cancelling the download.\r\n * @alpha\r\n */\r\n abortSignal?: GenericAbortSignal;\r\n}\r\n\r\n/** Keeps track of changes to models, buffering them until synchronization points.\r\n * While a GraphicalEditingScope is open, the changes are buffered until the scope exits, at which point they are processed.\r\n * Otherwise, the buffered changes are processed after undo/redo, commit, or pull+merge changes.\r\n */\r\nclass ModelChangeMonitor {\r\n private _editingScope?: GraphicalEditingScope;\r\n private readonly _briefcase: BriefcaseConnection;\r\n private readonly _deletedModels = new Set<string>();\r\n private readonly _modelIdToGuid = new Map<string, string>();\r\n private readonly _removals: VoidFunction[] = [];\r\n\r\n public constructor(briefcase: BriefcaseConnection) {\r\n this._briefcase = briefcase;\r\n\r\n // Buffer updated geometry guids.\r\n this._removals.push(briefcase.txns.onModelGeometryChanged.addListener((changes) => {\r\n for (const change of changes) {\r\n this._deletedModels.delete(change.id);\r\n this._modelIdToGuid.set(change.id, change.guid);\r\n }\r\n }));\r\n\r\n // Buffer deletions of models.\r\n this._removals.push(briefcase.txns.onModelsChanged.addListener((changes) => {\r\n if (changes.deleted) {\r\n for (const id of CompressedId64Set.iterable(changes.deleted)) {\r\n this._modelIdToGuid.delete(id);\r\n this._deletedModels.add(id);\r\n }\r\n }\r\n }));\r\n\r\n // Outside of an editing scope, we want to update viewport contents after commit, undo/redo, or merging changes.\r\n const maybeProcess = async () => {\r\n if (this.editingScope)\r\n return;\r\n\r\n const modelIds = Array.from(this._modelIdToGuid.keys());\r\n if (modelIds.length > 0)\r\n await IModelApp.tileAdmin.purgeTileTrees(this._briefcase, modelIds);\r\n\r\n this.processBuffered();\r\n };\r\n\r\n this._removals.push(briefcase.txns.onCommitted.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onAfterUndoRedo.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onChangesPulled.addListener(maybeProcess));\r\n }\r\n\r\n public async close(): Promise<void> {\r\n for (const removal of this._removals)\r\n removal();\r\n\r\n this._removals.length = 0;\r\n\r\n if (this._editingScope) {\r\n await this._editingScope.exit();\r\n this._editingScope = undefined;\r\n }\r\n }\r\n\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._editingScope;\r\n }\r\n\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n if (this._editingScope)\r\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\r\n\r\n this._editingScope = await GraphicalEditingScope.enter(this._briefcase);\r\n\r\n const removeGeomListener = this._editingScope.onGeometryChanges.addListener((changes) => {\r\n const modelIds = [];\r\n for (const change of changes)\r\n modelIds.push(change.id);\r\n\r\n this.invalidateScenes(modelIds);\r\n });\r\n\r\n this._editingScope.onExited.addOnce((scope) => {\r\n assert(scope === this._editingScope);\r\n this._editingScope = undefined;\r\n removeGeomListener();\r\n this.processBuffered();\r\n });\r\n\r\n return this._editingScope;\r\n }\r\n\r\n private processBuffered(): void {\r\n const models = this._briefcase.models;\r\n for (const [id, guid] of this._modelIdToGuid) {\r\n const model = models.getLoaded(id)?.asGeometricModel;\r\n if (model)\r\n model.geometryGuid = guid;\r\n }\r\n\r\n const modelIds = new Set<string>(this._modelIdToGuid.keys());\r\n for (const deleted of this._deletedModels) {\r\n modelIds.add(deleted);\r\n models.unload(deleted);\r\n }\r\n\r\n this.invalidateScenes(modelIds);\r\n disposeTileTreesForGeometricModels(modelIds, this._briefcase);\r\n\r\n this._briefcase.onBufferedModelChanges.raiseEvent(modelIds);\r\n\r\n this._modelIdToGuid.clear();\r\n this._deletedModels.clear();\r\n }\r\n\r\n private invalidateScenes(changedModels: Iterable<Id64String>): void {\r\n for (const user of IModelApp.tileAdmin.tileUsers) {\r\n if (user instanceof Viewport && user.iModel === this._briefcase) {\r\n for (const modelId of changedModels) {\r\n if (user.view.viewsModel(modelId)) {\r\n user.invalidateScene();\r\n user.setFeatureOverrideProviderChanged();\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].\r\n * For example, tools that want to create new elements can consult the briefcase's editor tool settings to\r\n * determine into which model and category to insert the elements.\r\n * Specialized tools are free to ignore these settings.\r\n * @see [[BriefcaseConnection.editorToolSettings]] to query or modify the current settings for a briefcase.\r\n * @see [CreateElementTool]($editor-frontend) for an example of a tool that uses these settings.\r\n * @alpha\r\n */\r\nexport class BriefcaseEditorToolSettings {\r\n private _category?: Id64String;\r\n private _model?: Id64String;\r\n\r\n /** An event raised just after the default [[category]] is changed. */\r\n public readonly onCategoryChanged = new BeEvent<(previousCategory: Id64String | undefined) => void>();\r\n\r\n /** An event raised just after the default [[model]] is changed. */\r\n public readonly onModelChanged = new BeEvent<(previousModel: Id64String | undefined) => void>();\r\n\r\n /** The [Category]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate category.\r\n * @see [[onCategoryChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetCategory]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get category(): Id64String | undefined {\r\n return this._category;\r\n }\r\n public set category(category: Id64String | undefined) {\r\n const previousCategory = this.category;\r\n if (category !== this.category) {\r\n this._category = category;\r\n this.onCategoryChanged.raiseEvent(previousCategory);\r\n }\r\n }\r\n\r\n /** The [Model]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate model.\r\n * @see [[onModelChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetModel]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get model(): Id64String | undefined {\r\n return this._model;\r\n }\r\n public set model(model: Id64String | undefined) {\r\n const previousModel = this.model;\r\n if (model !== this.model) {\r\n this._model = model;\r\n this.onModelChanged.raiseEvent(previousModel);\r\n }\r\n }\r\n}\r\n\r\n/** A connection to an editable briefcase on the backend. This class uses [Ipc]($docs/learning/IpcInterface.md) to communicate\r\n * to the backend and may only be used by [[IpcApp]]s.\r\n * @public\r\n */\r\nexport class BriefcaseConnection extends IModelConnection {\r\n protected _isClosed?: boolean;\r\n private readonly _modelsMonitor: ModelChangeMonitor;\r\n /** Default settings that can be used to control the behavior of [[Tool]]s that modify this briefcase.\r\n * @alpha\r\n */\r\n public readonly editorToolSettings = new BriefcaseEditorToolSettings();\r\n\r\n /** Manages local changes to the briefcase via [Txns]($docs/learning/InteractiveEditing.md). */\r\n public readonly txns: BriefcaseTxns;\r\n\r\n /** @internal */\r\n public override isBriefcaseConnection(): this is BriefcaseConnection { return true; }\r\n\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public override get iTwinId(): GuidString { return super.iTwinId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n /** The Guid that identifies this iModel. */\r\n public override get iModelId(): GuidString { return super.iModelId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n protected constructor(props: IModelConnectionProps, openMode: OpenMode) {\r\n super(props);\r\n this._openMode = openMode;\r\n this.txns = new BriefcaseTxns(this);\r\n this._modelsMonitor = new ModelChangeMonitor(this);\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */\r\n public static async openFile(briefcaseProps: OpenBriefcaseProps): Promise<BriefcaseConnection> {\r\n const iModelProps = await IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);\r\n const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? OpenMode.Readonly : OpenMode.ReadWrite);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [StandaloneDb]($backend)\r\n * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.\r\n */\r\n public static async openStandalone(filePath: string, openMode: OpenMode = OpenMode.ReadWrite, opts?: StandaloneOpenOptions): Promise<BriefcaseConnection> {\r\n const openResponse = await IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);\r\n const connection = new this(openResponse, openMode);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Returns `true` if [[close]] has already been called. */\r\n public get isClosed(): boolean { return this._isClosed === true; }\r\n\r\n /**\r\n * Close this BriefcaseConnection.\r\n * @note make sure to call [[saveChanges]] before calling this method. Unsaved local changes are abandoned.\r\n */\r\n public async close(): Promise<void> {\r\n if (this.isClosed)\r\n return;\r\n\r\n await this._modelsMonitor.close();\r\n\r\n this.beforeClose();\r\n this.txns.dispose();\r\n\r\n this._isClosed = true;\r\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\r\n }\r\n\r\n private requireTimeline() {\r\n if (this.iTwinId === Guid.empty)\r\n throw new IModelError(IModelStatus.WrongIModel, \"iModel has no timeline\");\r\n }\r\n\r\n /** Query if there are any pending Txns in this briefcase that are waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return this.txns.hasPendingTxns();\r\n }\r\n\r\n /** Commit pending changes to this briefcase.\r\n * @param description Optional description of the changes.\r\n */\r\n public async saveChanges(description?: string): Promise<void> {\r\n await IpcApp.appFunctionIpc.saveChanges(this.key, description);\r\n }\r\n\r\n /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase\r\n * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.\r\n * @param options Options for pulling changes.\r\n * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.\r\n */\r\n public async pullChanges(toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<void> {\r\n const removeListeners: VoidFunction[] = [];\r\n if (options?.progressCallback) {\r\n const removeProgressListener = IpcApp.addListener(\r\n getPullChangesIpcChannel(this.iModelId),\r\n (_evt: Event, data: { loaded: number, total: number }) => options?.progressCallback?.(data),\r\n );\r\n removeListeners.push(removeProgressListener);\r\n }\r\n if (options?.abortSignal) {\r\n const abort = () => void IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);\r\n options?.abortSignal.addEventListener(\"abort\", abort);\r\n removeListeners.push(() => options?.abortSignal?.removeEventListener(\"abort\", abort));\r\n }\r\n\r\n this.requireTimeline();\r\n const ipcAppOptions: IpcAppPullChangesOptions = {\r\n reportProgress: !!options?.progressCallback,\r\n progressInterval: options?.progressInterval,\r\n enableCancellation: !!options?.abortSignal,\r\n };\r\n try {\r\n this.changeset = await IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);\r\n } finally {\r\n removeListeners.forEach((remove) => remove());\r\n }\r\n }\r\n\r\n /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.\r\n * @param description The description for the changeset\r\n * @returns the changesetId of the pushed changes\r\n * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.\r\n */\r\n public async pushChanges(description: string): Promise<ChangesetIndexAndId> {\r\n this.requireTimeline();\r\n return IpcApp.appFunctionIpc.pushChanges(this.key, description);\r\n }\r\n\r\n /** The current graphical editing scope, if one is in progress.\r\n * @see [[enterEditingScope]] to begin graphical editing.\r\n */\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._modelsMonitor.editingScope;\r\n }\r\n\r\n /** Return whether graphical editing is supported for this briefcase. It is not supported if the briefcase is read-only, or the briefcase contains a version of\r\n * the BisCore ECSchema older than v0.1.11.\r\n * @see [[enterEditingScope]] to enable graphical editing.\r\n */\r\n public async supportsGraphicalEditing(): Promise<boolean> {\r\n return IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);\r\n }\r\n\r\n /** Begin a new graphical editing scope.\r\n * @throws Error if an editing scope already exists or one could not be created.\r\n * @see [[GraphicalEditingScope.exit]] to exit the scope.\r\n * @see [[supportsGraphicalEditing]] to determine whether this method should be expected to succeed.\r\n * @see [[editingScope]] to obtain the current editing scope, if one is in progress.\r\n */\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n return this._modelsMonitor.enterEditingScope();\r\n }\r\n\r\n /** Strictly for tests - dispatched from ModelChangeMonitor.processBuffered.\r\n * @internal\r\n */\r\n public readonly onBufferedModelChanges = new BeEvent<(changedModelIds: Set<string>) => void>();\r\n}\r\n"]}
|
package/lib/cjs/IpcApp.d.ts
CHANGED
|
@@ -71,6 +71,12 @@ export declare class IpcApp {
|
|
|
71
71
|
* @param channelName the channel registered by the backend handler.
|
|
72
72
|
*/
|
|
73
73
|
static makeIpcProxy<K>(channelName: string): PickAsyncMethods<K>;
|
|
74
|
+
/** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a "methodName" argument followed by optional arguments
|
|
75
|
+
* @param channelName the channel registered by the backend handler.
|
|
76
|
+
* @param functionName the function to call on the handler.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K>;
|
|
74
80
|
/** @deprecated use [[appFunctionIpc]] */
|
|
75
81
|
static callIpcHost<T extends AsyncMethodsOf<IpcAppFunctions>>(methodName: T, ...args: Parameters<IpcAppFunctions[T]>): Promise<PromiseReturnType<IpcAppFunctions[T]>>;
|
|
76
82
|
/** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */
|
package/lib/cjs/IpcApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcApp.d.ts","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EACmD,eAAe,EAAwC,WAAW,EAAE,iBAAiB,EAC/H,cAAc,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAgC;IACnD,qEAAqE;IAErE,OAAO,CAAC,MAAM,KAAK,GAAG,GAA4C;IAElE,iIAAiI;IACjI,WAAkB,OAAO,IAAI,OAAO,CAAoC;IAExE;;;;;;;OAOG;WACW,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,cAAc;IAIhF;;;;OAIG;WACW,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW;IAInE;;;;;;;;;OASG;WACiB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAA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EAAE,IAAI,CAAC,EAAE,aAAa;IAMxE,gBAAgB;WACI,QAAQ;CAI7B;AAED;;;;;;;;;;;;;GAaG;AACH,8BAAsB,mBAAmB;IACvC,wFAAwF;IACxF,aAAoB,WAAW,IAAI,MAAM,CAAC;IAEnC,YAAY,IAAI,cAAc;IAUrC;;;;;OAKG;WACW,QAAQ,IAAI,cAAc;CAGzC"}
|
package/lib/cjs/IpcApp.js
CHANGED
|
@@ -91,6 +91,18 @@ class IpcApp {
|
|
|
91
91
|
},
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
+
/** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a "methodName" argument followed by optional arguments
|
|
95
|
+
* @param channelName the channel registered by the backend handler.
|
|
96
|
+
* @param functionName the function to call on the handler.
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
static makeIpcFunctionProxy(channelName, functionName) {
|
|
100
|
+
return new Proxy({}, {
|
|
101
|
+
get(_target, methodName) {
|
|
102
|
+
return async (...args) => IpcApp.callIpcChannel(channelName, functionName, methodName, ...args);
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
94
106
|
/** @deprecated use [[appFunctionIpc]] */
|
|
95
107
|
static async callIpcHost(methodName, ...args) {
|
|
96
108
|
return this.callIpcChannel(core_common_1.IpcAppChannel.Functions, methodName, ...args);
|
package/lib/cjs/IpcApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAG4B;AAC5B,2CAA0D;AAU1D;;;GAGG;AACH,MAAa,MAAM;IAEjB,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC;IAElE,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAAI,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MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAW,EAAE,QAAgB,EAAE,GAAG,IAAW,EAAE,EAAE;YAC5F,MAAM,IAAI,GAAI,IAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,IAAI,OAAO,IAAI,KAAK,UAAU;gBAC5B,MAAM,IAAI,yBAAW,CAAC,0BAAY,CAAC,gBAAgB,EAAE,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,8DAA8D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAErL,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,2BAAa,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { AsyncMethodsOf, PickAsyncMethods, PromiseReturnType } from \"@itwin/core-bentley\";\r\nimport {\r\n BackendError, IModelError, IModelStatus, IpcAppChannel, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend,\r\n iTwinChannel, RemoveFunction,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\n\r\n/**\r\n * Options for [[IpcApp.startup]]\r\n * @public\r\n */\r\nexport interface IpcAppOptions {\r\n iModelApp?: IModelAppOptions;\r\n}\r\n\r\n/**\r\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\r\n * @public\r\n */\r\nexport class IpcApp {\r\n private static _ipc: IpcSocketFrontend | undefined;\r\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\r\n\r\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\r\n\r\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\r\n public static get isValid(): boolean { return undefined !== this._ipc; }\r\n\r\n /**\r\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\r\n * the channel via [[BackendIpc.send]].\r\n * @param channel the name of the channel\r\n * @param handler the message handler\r\n * @returns A function to remove the handler\r\n * @note Ipc is only supported if [[isValid]] is true.\r\n */\r\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\r\n return this.ipc.addListener(iTwinChannel(channel), handler);\r\n }\r\n\r\n /**\r\n * Remove a previously registered listener\r\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\r\n * @param listener The function passed to [[addListener]]\r\n */\r\n public static removeListener(channel: string, listener: IpcListener) {\r\n this.ipc.removeListener(iTwinChannel(channel), listener);\r\n }\r\n\r\n /**\r\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\r\n * @param channel The name of the channel for the method.\r\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\r\n * Note that this interface may be implemented via Electron for desktop apps, or via\r\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\r\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\r\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\r\n * primitive types and `ArrayBuffers` are allowed.\r\n */\r\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\r\n return this.ipc.invoke(iTwinChannel(channel), ...args);\r\n }\r\n\r\n /**\r\n * Send a message over the socket.\r\n * @param channel The name of the channel for the message.\r\n * @param data The optional data of the message.\r\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\r\n * primitive types and `ArrayBuffers` are allowed.\r\n */\r\n public static send(channel: string, ...data: any[]) {\r\n return this.ipc.send(iTwinChannel(channel), ...data);\r\n }\r\n\r\n /**\r\n * Call a method on the backend through an Ipc channel.\r\n * @param channelName the channel registered by the backend handler.\r\n * @param methodName the name of a method implemented by the backend handler.\r\n * @param args arguments to `methodName`\r\n * @return a Promise with the return value from `methodName`\r\n * @note If the backend implementation throws an exception, this method will throw a [[BackendError]] exception\r\n * with the `errorNumber` and `message` from the backend.\r\n * @note Ipc is only supported if [[isValid]] is true.\r\n * @internal\r\n */\r\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\r\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\r\n if (undefined !== retVal.error) {\r\n const err = new BackendError(retVal.error.errorNumber, retVal.error.name, retVal.error.message);\r\n err.stack = retVal.error.stack;\r\n throw err;\r\n }\r\n return retVal.result;\r\n }\r\n\r\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\r\n * @param channelName the channel registered by the backend handler.\r\n */\r\n public static makeIpcProxy<K>(channelName: string): PickAsyncMethods<K> {\r\n return new Proxy({} as PickAsyncMethods<K>, {\r\n get(_target, methodName: string) {\r\n return async (...args: any[]) =>\r\n IpcApp.callIpcChannel(channelName, methodName, ...args);\r\n },\r\n });\r\n }\r\n\r\n /** @deprecated use [[appFunctionIpc]] */\r\n public static async callIpcHost<T extends AsyncMethodsOf<IpcAppFunctions>>(methodName: T, ...args: Parameters<IpcAppFunctions[T]>) {\r\n return this.callIpcChannel(IpcAppChannel.Functions, methodName, ...args) as PromiseReturnType<IpcAppFunctions[T]>;\r\n }\r\n\r\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\r\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(IpcAppChannel.Functions);\r\n\r\n /** start an IpcApp.\r\n * @note this should not be called directly. It is called by NativeApp.startup */\r\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\r\n this._ipc = ipc;\r\n IpcAppNotifyHandler.register(); // receives notifications from backend\r\n await IModelApp.startup(opts?.iModelApp);\r\n }\r\n\r\n /** @internal */\r\n public static async shutdown() {\r\n this._ipc = undefined;\r\n await IModelApp.shutdown();\r\n }\r\n}\r\n\r\n/**\r\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\r\n * methods to receive notifications from your backend.\r\n *\r\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\r\n * ```ts\r\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\r\n * ```\r\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\r\n *\r\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class NotificationHandler {\r\n /** All subclasses must implement this method to specify their response channel name. */\r\n public abstract get channelName(): string;\r\n\r\n public registerImpl(): RemoveFunction {\r\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\r\n const func = (this as any)[funcName];\r\n if (typeof func !== \"function\")\r\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\r\n\r\n func.call(this, ...args);\r\n });\r\n }\r\n\r\n /**\r\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\r\n * that becomes the notification handler and is `this` when its methods are called.\r\n * @returns A function that can be called to remove the handler.\r\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\r\n */\r\n public static register(): RemoveFunction {\r\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\r\n }\r\n}\r\n\r\n/** IpcApp notifications from backend */\r\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\r\n public get channelName() { return IpcAppChannel.AppNotify; }\r\n public notifyApp() { }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAG4B;AAC5B,2CAA0D;AAU1D;;;GAGG;AACH,MAAa,MAAM;IAEjB,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC;IAElE,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAExE;;;;;;;OAOG;IACI,MAAM,CAAC,WAAW,CAAC,OAAe,EAAE,OAAoB;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,OAAe,EAAE,QAAqB;QACjE,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;;OASG;IACI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,GAAG,IAAW;QACxD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,GAAG,IAAW;QAChD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,0BAAY,E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AG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,2BAAa,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { AsyncMethodsOf, PickAsyncMethods, PromiseReturnType } from \"@itwin/core-bentley\";\r\nimport {\r\n BackendError, IModelError, IModelStatus, IpcAppChannel, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend,\r\n iTwinChannel, RemoveFunction,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\n\r\n/**\r\n * Options for [[IpcApp.startup]]\r\n * @public\r\n */\r\nexport interface IpcAppOptions {\r\n iModelApp?: IModelAppOptions;\r\n}\r\n\r\n/**\r\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\r\n * @public\r\n */\r\nexport class IpcApp {\r\n private static _ipc: IpcSocketFrontend | undefined;\r\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\r\n\r\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\r\n\r\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\r\n public static get isValid(): boolean { return undefined !== this._ipc; }\r\n\r\n /**\r\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\r\n * the channel via [[BackendIpc.send]].\r\n * @param channel the name of the channel\r\n * @param handler the message handler\r\n * @returns A function to remove the handler\r\n * @note Ipc is only supported if [[isValid]] is true.\r\n */\r\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\r\n return this.ipc.addListener(iTwinChannel(channel), handler);\r\n }\r\n\r\n /**\r\n * Remove a previously registered listener\r\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\r\n * @param listener The function passed to [[addListener]]\r\n */\r\n public static removeListener(channel: string, listener: IpcListener) {\r\n this.ipc.removeListener(iTwinChannel(channel), listener);\r\n }\r\n\r\n /**\r\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\r\n * @param channel The name of the channel for the method.\r\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\r\n * Note that this interface may be implemented via Electron for desktop apps, or via\r\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\r\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\r\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\r\n * primitive types and `ArrayBuffers` are allowed.\r\n */\r\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\r\n return this.ipc.invoke(iTwinChannel(channel), ...args);\r\n }\r\n\r\n /**\r\n * Send a message over the socket.\r\n * @param channel The name of the channel for the message.\r\n * @param data The optional data of the message.\r\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\r\n * primitive types and `ArrayBuffers` are allowed.\r\n */\r\n public static send(channel: string, ...data: any[]) {\r\n return this.ipc.send(iTwinChannel(channel), ...data);\r\n }\r\n\r\n /**\r\n * Call a method on the backend through an Ipc channel.\r\n * @param channelName the channel registered by the backend handler.\r\n * @param methodName the name of a method implemented by the backend handler.\r\n * @param args arguments to `methodName`\r\n * @return a Promise with the return value from `methodName`\r\n * @note If the backend implementation throws an exception, this method will throw a [[BackendError]] exception\r\n * with the `errorNumber` and `message` from the backend.\r\n * @note Ipc is only supported if [[isValid]] is true.\r\n * @internal\r\n */\r\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\r\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\r\n if (undefined !== retVal.error) {\r\n const err = new BackendError(retVal.error.errorNumber, retVal.error.name, retVal.error.message);\r\n err.stack = retVal.error.stack;\r\n throw err;\r\n }\r\n return retVal.result;\r\n }\r\n\r\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\r\n * @param channelName the channel registered by the backend handler.\r\n */\r\n public static makeIpcProxy<K>(channelName: string): PickAsyncMethods<K> {\r\n return new Proxy({} as PickAsyncMethods<K>, {\r\n get(_target, methodName: string) {\r\n return async (...args: any[]) =>\r\n IpcApp.callIpcChannel(channelName, methodName, ...args);\r\n },\r\n });\r\n }\r\n\r\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\r\n * @param channelName the channel registered by the backend handler.\r\n * @param functionName the function to call on the handler.\r\n * @internal\r\n */\r\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\r\n return new Proxy({} as PickAsyncMethods<K>, {\r\n get(_target, methodName: string) {\r\n return async (...args: any[]) =>\r\n IpcApp.callIpcChannel(channelName, functionName, methodName, ...args);\r\n },\r\n });\r\n }\r\n\r\n /** @deprecated use [[appFunctionIpc]] */\r\n public static async callIpcHost<T extends AsyncMethodsOf<IpcAppFunctions>>(methodName: T, ...args: Parameters<IpcAppFunctions[T]>) {\r\n return this.callIpcChannel(IpcAppChannel.Functions, methodName, ...args) as PromiseReturnType<IpcAppFunctions[T]>;\r\n }\r\n\r\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\r\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(IpcAppChannel.Functions);\r\n\r\n /** start an IpcApp.\r\n * @note this should not be called directly. It is called by NativeApp.startup */\r\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\r\n this._ipc = ipc;\r\n IpcAppNotifyHandler.register(); // receives notifications from backend\r\n await IModelApp.startup(opts?.iModelApp);\r\n }\r\n\r\n /** @internal */\r\n public static async shutdown() {\r\n this._ipc = undefined;\r\n await IModelApp.shutdown();\r\n }\r\n}\r\n\r\n/**\r\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\r\n * methods to receive notifications from your backend.\r\n *\r\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\r\n * ```ts\r\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\r\n * ```\r\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\r\n *\r\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class NotificationHandler {\r\n /** All subclasses must implement this method to specify their response channel name. */\r\n public abstract get channelName(): string;\r\n\r\n public registerImpl(): RemoveFunction {\r\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\r\n const func = (this as any)[funcName];\r\n if (typeof func !== \"function\")\r\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\r\n\r\n func.call(this, ...args);\r\n });\r\n }\r\n\r\n /**\r\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\r\n * that becomes the notification handler and is `this` when its methods are called.\r\n * @returns A function that can be called to remove the handler.\r\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\r\n */\r\n public static register(): RemoveFunction {\r\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\r\n }\r\n}\r\n\r\n/** IpcApp notifications from backend */\r\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\r\n public get channelName() { return IpcAppChannel.AppNotify; }\r\n public notifyApp() { }\r\n}\r\n"]}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Views
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
4
|
+
/** Specifies margins to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding the
|
|
5
|
+
* viewed volume by a percentage of its original size to add extra space around one or more edges.
|
|
6
|
+
* The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).
|
|
7
|
+
* The values are clamped to the range 0 through 0.25.
|
|
8
|
+
* @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.
|
|
9
|
+
* @note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.
|
|
10
|
+
* @see [[MarginOptions.marginPercent]].
|
|
11
|
+
* @see [[PaddingPercent]] for a more predictable way of adjusting the viewed volume.
|
|
6
12
|
* @public
|
|
7
13
|
* @extensions
|
|
8
14
|
*/
|
|
@@ -13,4 +19,23 @@ export declare class MarginPercent {
|
|
|
13
19
|
bottom: number;
|
|
14
20
|
constructor(left: number, top: number, right: number, bottom: number);
|
|
15
21
|
}
|
|
22
|
+
/** Specifies padding to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding or
|
|
23
|
+
* contracting the viewed volume by a fraction of its original size.
|
|
24
|
+
* The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).
|
|
25
|
+
* Positive values add additional volume along the specified edge, negative values subtract it, and zero values have no effect.
|
|
26
|
+
* All properties default to zero if `undefined`.
|
|
27
|
+
* For example, if the original volume has a width of 100 and the padding is specified as `{ left: 1 }`, the width will be doubled to 200, with 100 padding on the left side of the view.
|
|
28
|
+
* If a padding of 0.25 is specified for each of [[left]], [[right]], [[top]], and [[bottom]], then the final volume will be inset such that 25% of the original volume falls outside
|
|
29
|
+
* of the view on each side.
|
|
30
|
+
* @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.
|
|
31
|
+
* @see [[MarginOptions.paddingPercent]].
|
|
32
|
+
* @public
|
|
33
|
+
* @extensions
|
|
34
|
+
*/
|
|
35
|
+
export interface PaddingPercent {
|
|
36
|
+
left?: number;
|
|
37
|
+
right?: number;
|
|
38
|
+
top?: number;
|
|
39
|
+
bottom?: number;
|
|
40
|
+
}
|
|
16
41
|
//# sourceMappingURL=MarginPercent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarginPercent.d.ts","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"MarginPercent.d.ts","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;;;;;;;;;GAUG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM;IAAS,KAAK,EAAE,MAAM;IAAS,MAAM,EAAE,MAAM;gBAA7E,IAAI,EAAE,MAAM,EAAS,GAAG,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM;CAOjG;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/lib/cjs/MarginPercent.js
CHANGED
|
@@ -9,8 +9,14 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.MarginPercent = void 0;
|
|
11
11
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
12
|
+
/** Specifies margins to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding the
|
|
13
|
+
* viewed volume by a percentage of its original size to add extra space around one or more edges.
|
|
14
|
+
* The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).
|
|
15
|
+
* The values are clamped to the range 0 through 0.25.
|
|
16
|
+
* @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.
|
|
17
|
+
* @note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.
|
|
18
|
+
* @see [[MarginOptions.marginPercent]].
|
|
19
|
+
* @see [[PaddingPercent]] for a more predictable way of adjusting the viewed volume.
|
|
14
20
|
* @public
|
|
15
21
|
* @extensions
|
|
16
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarginPercent.js","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgD;
|
|
1
|
+
{"version":3,"file":"MarginPercent.js","sourceRoot":"","sources":["../../src/MarginPercent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgD;AAEhD;;;;;;;;;;GAUG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAY,EAAS,GAAW,EAAS,KAAa,EAAS,MAAc;QAA7E,SAAI,GAAJ,IAAI,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAQ;QAC9F,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,wBAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF;AARD,sCAQC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\n\r\n/** Specifies margins to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding the\r\n * viewed volume by a percentage of its original size to add extra space around one or more edges.\r\n * The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).\r\n * The values are clamped to the range 0 through 0.25.\r\n * @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.\r\n * @note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.\r\n * @see [[MarginOptions.marginPercent]].\r\n * @see [[PaddingPercent]] for a more predictable way of adjusting the viewed volume.\r\n * @public\r\n * @extensions\r\n */\r\nexport class MarginPercent {\r\n constructor(public left: number, public top: number, public right: number, public bottom: number) {\r\n const limitMargin = (val: number) => Geometry.clamp(val, 0.0, 0.25);\r\n this.left = limitMargin(left);\r\n this.top = limitMargin(top);\r\n this.right = limitMargin(right);\r\n this.bottom = limitMargin(bottom);\r\n }\r\n}\r\n\r\n/** Specifies padding to apply around a view volume for methods like [[ViewState.lookAtVolume]] and [[Viewport.zoomToElements]], expanding or\r\n * contracting the viewed volume by a fraction of its original size.\r\n * The margin values represent a fraction of the view volume's width (for [[left]] and [[right]]) or height (for [[top]] and [[bottom]]).\r\n * Positive values add additional volume along the specified edge, negative values subtract it, and zero values have no effect.\r\n * All properties default to zero if `undefined`.\r\n * For example, if the original volume has a width of 100 and the padding is specified as `{ left: 1 }`, the width will be doubled to 200, with 100 padding on the left side of the view.\r\n * If a padding of 0.25 is specified for each of [[left]], [[right]], [[top]], and [[bottom]], then the final volume will be inset such that 25% of the original volume falls outside\r\n * of the view on each side.\r\n * @note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.\r\n * @see [[MarginOptions.paddingPercent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PaddingPercent {\r\n left?: number;\r\n right?: number;\r\n top?: number;\r\n bottom?: number;\r\n}\r\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { EasingFunction } from "@itwin/core-common";
|
|
5
5
|
import { ViewStatus } from "./ViewStatus";
|
|
6
|
-
import { MarginPercent } from "./MarginPercent";
|
|
6
|
+
import { MarginPercent, PaddingPercent } from "./MarginPercent";
|
|
7
7
|
import { Point3d } from "@itwin/core-geometry";
|
|
8
8
|
/** An object to animate a transition of a [[Viewport]].
|
|
9
9
|
* Only one animator may be associated with a viewport at a time. Registering a new
|
|
@@ -60,8 +60,16 @@ export interface OnViewExtentsError {
|
|
|
60
60
|
* @extensions
|
|
61
61
|
*/
|
|
62
62
|
export interface MarginOptions {
|
|
63
|
-
/**
|
|
63
|
+
/** Margins to apply around the edges of the view.
|
|
64
|
+
* @note This property is ignored if [[paddingPercent]] is specified.
|
|
65
|
+
*/
|
|
64
66
|
marginPercent?: MarginPercent;
|
|
67
|
+
/** Padding to apply around the edges of the view.
|
|
68
|
+
* Individual padding for any or all sides can be specified as a [[PaddingPercent]], or a uniform padding to be applied
|
|
69
|
+
* to all sides can be specified as a single number.
|
|
70
|
+
* @note This property takes precedence over [[marginPercent]].
|
|
71
|
+
*/
|
|
72
|
+
paddingPercent?: PaddingPercent | number;
|
|
65
73
|
}
|
|
66
74
|
/** Options that control how operations that change a viewport behave.
|
|
67
75
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAnimation.d.ts","sourceRoot":"","sources":["../../src/ViewAnimation.ts"],"names":[],"mappings":"AAIA;;GA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C;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB,EAAE,oBAAoB;IACjF,sGAAsG;IACtG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8FAA8F;IAC9F,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0EAA0E;IAC1E,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAnimation.js","sourceRoot":"","sources":["../../src/ViewAnimation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { EasingFunction } from \"@itwin/core-common\";\r\nimport { ViewStatus } from \"./ViewStatus\";\r\nimport { MarginPercent } from \"./MarginPercent\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\n\r\n/** An object to animate a transition of a [[Viewport]].\r\n * Only one animator may be associated with a viewport at a time. Registering a new\r\n * animator interrupts and replaces any existing animator.\r\n * The animator's animate() function will be invoked just prior to the rendering of each frame.\r\n * The animator may be removed in response to certain changes to the viewport - e.g., when\r\n * the viewport is closed, or viewing tools operate on it, etc.\r\n * @see [[Viewport.setAnimator]] to apply an animator to a viewport.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Animator {\r\n /** Apply animation to the viewport. Return true when animation is completed, causing the animator to be removed from the viewport. */\r\n animate(): boolean;\r\n\r\n /** Invoked to abort this Animator. This method is called if [[Viewport.setAnimator]] is called before `animate` returns true */\r\n interrupt(): void;\r\n}\r\n\r\n/** Options that control how an Viewport animation behaves.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewAnimationOptions {\r\n /** Amount of time for animation, in milliseconds. Default is [[ScreenViewport.animation.time.normal]] */\r\n animationTime?: number;\r\n /** if animation is aborted, don't move to end, leave at current point instead. */\r\n cancelOnAbort?: boolean;\r\n /** easing function for animation. Default is Easing.Cubic.Out */\r\n easingFunction?: EasingFunction;\r\n /** Invoked when the animator is finished. didComplete is true only if the animation finished without being interrupted. */\r\n animationFinishedCallback?(didComplete: boolean): void;\r\n}\r\n\r\n/** Options that control how a view is aligned with the globe.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GlobalAlignmentOptions {\r\n /** The target point about which the alignment occurs. This point will remain stationary in the view */\r\n target: Point3d;\r\n /** If defined and true then the alignment rotation is scaled by the [[ViewState.globalViewTransition]]. This is\r\n * typically used when zooming out from is zoomed out from a specific location to a more global representation.\r\n */\r\n transition?: boolean;\r\n}\r\n\r\n/** A method to be called if an error occurs while adjusting a ViewState's extents\r\n * @public\r\n * @extensions\r\n */\r\nexport interface OnViewExtentsError {\r\n /** Function to be called when the extents are adjusted due to a limits error (view too larger or too small) */\r\n onExtentsError?: (status: ViewStatus) => ViewStatus;\r\n}\r\n\r\n/** Options that control the margin around the edges of a volume for lookAt and Fit view operations\r\n * @public\r\n * @extensions\r\n */\r\nexport interface MarginOptions {\r\n /**
|
|
1
|
+
{"version":3,"file":"ViewAnimation.js","sourceRoot":"","sources":["../../src/ViewAnimation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { EasingFunction } from \"@itwin/core-common\";\r\nimport { ViewStatus } from \"./ViewStatus\";\r\nimport { MarginPercent, PaddingPercent } from \"./MarginPercent\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\n\r\n/** An object to animate a transition of a [[Viewport]].\r\n * Only one animator may be associated with a viewport at a time. Registering a new\r\n * animator interrupts and replaces any existing animator.\r\n * The animator's animate() function will be invoked just prior to the rendering of each frame.\r\n * The animator may be removed in response to certain changes to the viewport - e.g., when\r\n * the viewport is closed, or viewing tools operate on it, etc.\r\n * @see [[Viewport.setAnimator]] to apply an animator to a viewport.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Animator {\r\n /** Apply animation to the viewport. Return true when animation is completed, causing the animator to be removed from the viewport. */\r\n animate(): boolean;\r\n\r\n /** Invoked to abort this Animator. This method is called if [[Viewport.setAnimator]] is called before `animate` returns true */\r\n interrupt(): void;\r\n}\r\n\r\n/** Options that control how an Viewport animation behaves.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewAnimationOptions {\r\n /** Amount of time for animation, in milliseconds. Default is [[ScreenViewport.animation.time.normal]] */\r\n animationTime?: number;\r\n /** if animation is aborted, don't move to end, leave at current point instead. */\r\n cancelOnAbort?: boolean;\r\n /** easing function for animation. Default is Easing.Cubic.Out */\r\n easingFunction?: EasingFunction;\r\n /** Invoked when the animator is finished. didComplete is true only if the animation finished without being interrupted. */\r\n animationFinishedCallback?(didComplete: boolean): void;\r\n}\r\n\r\n/** Options that control how a view is aligned with the globe.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GlobalAlignmentOptions {\r\n /** The target point about which the alignment occurs. This point will remain stationary in the view */\r\n target: Point3d;\r\n /** If defined and true then the alignment rotation is scaled by the [[ViewState.globalViewTransition]]. This is\r\n * typically used when zooming out from is zoomed out from a specific location to a more global representation.\r\n */\r\n transition?: boolean;\r\n}\r\n\r\n/** A method to be called if an error occurs while adjusting a ViewState's extents\r\n * @public\r\n * @extensions\r\n */\r\nexport interface OnViewExtentsError {\r\n /** Function to be called when the extents are adjusted due to a limits error (view too larger or too small) */\r\n onExtentsError?: (status: ViewStatus) => ViewStatus;\r\n}\r\n\r\n/** Options that control the margin around the edges of a volume for lookAt and Fit view operations\r\n * @public\r\n * @extensions\r\n */\r\nexport interface MarginOptions {\r\n /** Margins to apply around the edges of the view.\r\n * @note This property is ignored if [[paddingPercent]] is specified.\r\n */\r\n marginPercent?: MarginPercent;\r\n /** Padding to apply around the edges of the view.\r\n * Individual padding for any or all sides can be specified as a [[PaddingPercent]], or a uniform padding to be applied\r\n * to all sides can be specified as a single number.\r\n * @note This property takes precedence over [[marginPercent]].\r\n */\r\n paddingPercent?: PaddingPercent | number;\r\n}\r\n\r\n/** Options that control how operations that change a viewport behave.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewChangeOptions extends OnViewExtentsError, ViewAnimationOptions {\r\n /** Whether to save the result of this change into the view undo stack. Default is to save in undo. */\r\n noSaveInUndo?: boolean;\r\n /** Whether the change should be animated or not. Default is to not animate frustum change. */\r\n animateFrustumChange?: boolean;\r\n /** If defined the controls how the view will be aligned with the globe */\r\n globalAlignment?: GlobalAlignmentOptions;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewState.d.ts","sourceRoot":"","sources":["../../src/ViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAiB,OAAO,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,EAAa,UAAU,EAA+C,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EACzF,OAAO,EAAE,OAAO,EAAW,OAAO,EAAS,SAAS,EAAY,QAAQ,EAAE,KAAK,EAC7G,MAAM,EAAE,GAAG,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAC3H,4BAA4B,EAAE,6BAA6B,EACrC,cAAc,EAAE,mBAAmB,EACzD,qBAAqB,EAAE,qBAAqB,EAAE,mBAAm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,gBAAgB;cACS,QAAQ,CAAC,eAAe,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhG,iEAAiE;IACjE,IAAW,OAAO,IAAI,WAAW,CAEhC;IAEM,oBAAoB,IAAI,OAAO;IAC/B,SAAS;IACT,UAAU;IACV,WAAW;IACX,UAAU,CAAC,KAAK,EAAE,KAAK;IACvB,SAAS,CAAC,MAAM,EAAE,KAAK;IACvB,WAAW,CAAC,GAAG,EAAE,QAAQ;IAKzB,UAAU,CAAC,OAAO,EAAE,UAAU;IAC9B,YAAY,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI;IAM9D,gBAAgB;IACA,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAM1E,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB;CAClE"}
|
package/lib/cjs/ViewState.js
CHANGED
|
@@ -697,6 +697,7 @@ class ViewState extends EntityState_1.ElementState {
|
|
|
697
697
|
* @see lookAtVolume
|
|
698
698
|
*/
|
|
699
699
|
lookAtViewAlignedVolume(volume, aspect, options) {
|
|
700
|
+
var _a, _b, _c, _d;
|
|
700
701
|
if (volume.isNull) // make sure volume is valid
|
|
701
702
|
return;
|
|
702
703
|
const viewRot = this.getRotation();
|
|
@@ -707,14 +708,33 @@ class ViewState extends EntityState_1.ElementState {
|
|
|
707
708
|
newOrigin.z -= (minimumDepth - newDelta.z) / 2.0;
|
|
708
709
|
newDelta.z = minimumDepth;
|
|
709
710
|
}
|
|
710
|
-
const margin = options === null || options === void 0 ? void 0 : options.marginPercent;
|
|
711
711
|
if (this.is3d() && this.isCameraOn) {
|
|
712
712
|
// If the camera is on, the only way to guarantee we can see the entire volume is to set delta at the front plane, not focus plane.
|
|
713
713
|
// That generally causes the view to be too large (objects in it are too small), since we can't tell whether the objects are at
|
|
714
714
|
// the front or back of the view. For this reason, don't attempt to add any "margin" to camera views.
|
|
715
715
|
}
|
|
716
|
-
else if (
|
|
716
|
+
else if (undefined !== (options === null || options === void 0 ? void 0 : options.paddingPercent)) {
|
|
717
|
+
let left, right, top, bottom;
|
|
718
|
+
const padding = options.paddingPercent;
|
|
719
|
+
if (typeof padding === "number") {
|
|
720
|
+
left = right = top = bottom = padding;
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
left = (_a = padding.left) !== null && _a !== void 0 ? _a : 0;
|
|
724
|
+
right = (_b = padding.right) !== null && _b !== void 0 ? _b : 0;
|
|
725
|
+
top = (_c = padding.top) !== null && _c !== void 0 ? _c : 0;
|
|
726
|
+
bottom = (_d = padding.bottom) !== null && _d !== void 0 ? _d : 0;
|
|
727
|
+
}
|
|
728
|
+
const width = newDelta.x;
|
|
729
|
+
const height = newDelta.y;
|
|
730
|
+
newOrigin.x -= left * width;
|
|
731
|
+
newDelta.x += (right + left) * width;
|
|
732
|
+
newOrigin.y -= bottom * height;
|
|
733
|
+
newDelta.y += (top + bottom) * height;
|
|
734
|
+
}
|
|
735
|
+
else if (options === null || options === void 0 ? void 0 : options.marginPercent) {
|
|
717
736
|
// compute how much space we'll need for both of X and Y margins in root coordinates
|
|
737
|
+
const margin = options.marginPercent;
|
|
718
738
|
const wPercent = margin.left + margin.right;
|
|
719
739
|
const hPercent = margin.top + margin.bottom;
|
|
720
740
|
const marginHorizontal = wPercent / (1 - wPercent) * newDelta.x;
|