@itwin/core-frontend 3.2.0-dev.72 → 3.3.0-dev.0

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.
Files changed (61) hide show
  1. package/lib/cjs/ViewportSync.d.ts +119 -0
  2. package/lib/cjs/ViewportSync.d.ts.map +1 -0
  3. package/lib/cjs/ViewportSync.js +187 -0
  4. package/lib/cjs/ViewportSync.js.map +1 -0
  5. package/lib/cjs/core-frontend.d.ts +1 -1
  6. package/lib/cjs/core-frontend.d.ts.map +1 -1
  7. package/lib/cjs/core-frontend.js +1 -1
  8. package/lib/cjs/core-frontend.js.map +1 -1
  9. package/lib/cjs/tile/ClassifierTileTree.d.ts.map +1 -1
  10. package/lib/cjs/tile/ClassifierTileTree.js +3 -4
  11. package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
  12. package/lib/cjs/tile/DynamicIModelTile.js +4 -2
  13. package/lib/cjs/tile/DynamicIModelTile.js.map +1 -1
  14. package/lib/cjs/tile/IModelTile.js +1 -1
  15. package/lib/cjs/tile/IModelTile.js.map +1 -1
  16. package/lib/cjs/tile/IModelTileTree.d.ts +3 -3
  17. package/lib/cjs/tile/IModelTileTree.d.ts.map +1 -1
  18. package/lib/cjs/tile/IModelTileTree.js +1 -1
  19. package/lib/cjs/tile/IModelTileTree.js.map +1 -1
  20. package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
  21. package/lib/cjs/tile/PrimaryTileTree.js +4 -4
  22. package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
  23. package/lib/cjs/tile/TileAdmin.d.ts +15 -1
  24. package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
  25. package/lib/cjs/tile/TileAdmin.js +25 -14
  26. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  27. package/lib/esm/ViewportSync.d.ts +119 -0
  28. package/lib/esm/ViewportSync.d.ts.map +1 -0
  29. package/lib/esm/ViewportSync.js +177 -0
  30. package/lib/esm/ViewportSync.js.map +1 -0
  31. package/lib/esm/core-frontend.d.ts +1 -1
  32. package/lib/esm/core-frontend.d.ts.map +1 -1
  33. package/lib/esm/core-frontend.js +1 -1
  34. package/lib/esm/core-frontend.js.map +1 -1
  35. package/lib/esm/tile/ClassifierTileTree.d.ts.map +1 -1
  36. package/lib/esm/tile/ClassifierTileTree.js +3 -4
  37. package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
  38. package/lib/esm/tile/DynamicIModelTile.js +4 -2
  39. package/lib/esm/tile/DynamicIModelTile.js.map +1 -1
  40. package/lib/esm/tile/IModelTile.js +1 -1
  41. package/lib/esm/tile/IModelTile.js.map +1 -1
  42. package/lib/esm/tile/IModelTileTree.d.ts +3 -3
  43. package/lib/esm/tile/IModelTileTree.d.ts.map +1 -1
  44. package/lib/esm/tile/IModelTileTree.js +1 -1
  45. package/lib/esm/tile/IModelTileTree.js.map +1 -1
  46. package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
  47. package/lib/esm/tile/PrimaryTileTree.js +5 -5
  48. package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
  49. package/lib/esm/tile/TileAdmin.d.ts +15 -1
  50. package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
  51. package/lib/esm/tile/TileAdmin.js +26 -15
  52. package/lib/esm/tile/TileAdmin.js.map +1 -1
  53. package/package.json +21 -21
  54. package/lib/cjs/TwoWayViewportSync.d.ts +0 -51
  55. package/lib/cjs/TwoWayViewportSync.d.ts.map +0 -1
  56. package/lib/cjs/TwoWayViewportSync.js +0 -87
  57. package/lib/cjs/TwoWayViewportSync.js.map +0 -1
  58. package/lib/esm/TwoWayViewportSync.d.ts +0 -51
  59. package/lib/esm/TwoWayViewportSync.d.ts.map +0 -1
  60. package/lib/esm/TwoWayViewportSync.js +0 -82
  61. package/lib/esm/TwoWayViewportSync.js.map +0 -1
@@ -0,0 +1,119 @@
1
+ /** @packageDocumentation
2
+ * @module Views
3
+ */
4
+ import { Viewport } from "./Viewport";
5
+ /** A function used by [[connectViewports]] that can synchronize the state of a target [[Viewport]] with
6
+ * changes in the state of a source Viewport.
7
+ * The source viewport is the viewport in the connection whose state has changed.
8
+ * The function will be invoked once for each target viewport in the connection.
9
+ * @public
10
+ * @extensions
11
+ */
12
+ export declare type SynchronizeViewports = (source: Viewport, target: Viewport) => void;
13
+ /** Forms a connection between two or more [[Viewport]]s such that a change in any one of the viewports is reflected in all of the others.
14
+ * When the connection is first formed, all of the viewports are synchronized to the current state of the **first** viewport in `viewports`.
15
+ * Thereafter, an event listener registered with each viewport's [[Viewport.onViewChanged]] event is invoked when anything about that viewport's state changes.
16
+ * Each time such an event occurs, the initating ("source") viewport is passed to `sync` to obtain a function that can be invoked to synchronize each of the other
17
+ * ("target") viewports with the source viewport's new state. The function returned by `sync` can choose to synchronize any or all aspects of the viewports' states, such as
18
+ * the viewed volume, display style, viewed categories or models, or anything else.
19
+ *
20
+ * To sever the connection, invoke the function returned by this function. For example:
21
+ * ```ts
22
+ * // set up the connection.
23
+ * const disconnect = connectViewports([viewport0, viewport1, viewport2], (changedViewport) => synchronizeViewportFrusta(changedViewport));
24
+ * // some time later, sever the connection.
25
+ * disconnect();
26
+ * ```
27
+ *
28
+ * @note [[Viewport.onViewChanged]] can be invoked **very** frequently - sometimes multiple times per frame. Try to avoid performing excessive computations within your synchronization functions.
29
+ *
30
+ * @param viewports The viewports to be connected. It should contain at least two viewports and no duplicate viewports. The initial state of each viewport will be synchronized with
31
+ * the state of the first viewport in this iterable.
32
+ * @param sync A function to be invoked whenever the state of any viewport in `viewports` changes, returning a function that can be used to synchronize the
33
+ * state of each viewport.
34
+ * @returns a function that can be invoked to sever the connection between the viewports.
35
+ * @see [[connectViewportFrusta]] to synchronize the [Frustum]($common) of each viewport.
36
+ * @see [[connectViewportViews]] to synchronize every aspect of the viewports.
37
+ * @see [[TwoWayViewportSync]] to synchronize the state of exactly two viewports.
38
+ * @see [Multiple Viewport Sample](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=multi-viewport-sample&imodel=Metrostation+Sample)
39
+ * @public
40
+ * @extensions
41
+ */
42
+ export declare function connectViewports(viewports: Iterable<Viewport>, sync: (changedViewport: Viewport) => SynchronizeViewports): () => void;
43
+ /** A function that returns a [[SynchronizeViewports]] function that synchronizes every aspect of the viewports' states, including
44
+ * display style, model and category selectors, [Frustum]($common), etc.
45
+ * @see [[connectViewportViews]] to establish a connection between viewports using this synchronization strategy.
46
+ * @public
47
+ * @extensions
48
+ */
49
+ export declare function synchronizeViewportViews(source: Viewport): SynchronizeViewports;
50
+ /** A function that returns a [[SynchronizeViewports]] function that synchronizes the viewed volumes of each viewport.
51
+ * @see [[connectViewportFrusta]] to establish a connection between viewports using this synchronization strategy.
52
+ * @public
53
+ * @extensions
54
+ */
55
+ export declare function synchronizeViewportFrusta(source: Viewport): SynchronizeViewports;
56
+ /** Form a connection between two or more [[Viewport]]s such that they all view the same volume. For example, zooming out in one viewport
57
+ * will zoom out by the same distance in all of the other viewports.
58
+ * @see [[connectViewports]] to customize how the viewports are synchronized.
59
+ * @public
60
+ * @extensions
61
+ */
62
+ export declare function connectViewportFrusta(viewports: Iterable<Viewport>): () => void;
63
+ /** Form a connection between two or more [[Viewport]]s such that every aspect of the viewports are kept in sync. For example, if the set of models
64
+ * or categories visible in one viewport is changed, the same set of models and categories will be visible in the other viewports.
65
+ * @see [[connectViewportFrusta]] to synchronize only the [Frustum]($common) of each viewport.
66
+ * @see [[connectViewports]] to customize how the viewports are synchronized.
67
+ * @public
68
+ * @extensions
69
+ */
70
+ export declare function connectViewportViews(viewports: Iterable<Viewport>): () => void;
71
+ /** Forms a bidirectional connection between two [[Viewport]]s such that the [[ViewState]]s of each are synchronized with one another.
72
+ * For example, panning in one viewport will cause the other viewport to pan by the same distance, and changing the [RenderMode]($common) of one viewport
73
+ * will change it in the other viewport.
74
+ * By default, all aspects of the views - display style, category and model selectors, frustum, etc - are synchronized, but this can be customized by
75
+ * subclassing and overriding the [[syncViewports]] and [[connectViewports]] methods.
76
+ * @see [Multiple Viewport Sample](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=multi-viewport-sample&imodel=Metrostation+Sample)
77
+ * for an interactive demonstration.
78
+ * @see [[TwoWayViewportFrustumSync]] to synchronize only the frusta of the viewports.
79
+ * @see [[connectViewportViews]] to synchronize the state of more than two viewports.
80
+ * @public
81
+ * @extensions
82
+ */
83
+ export declare class TwoWayViewportSync {
84
+ protected readonly _disconnect: VoidFunction[];
85
+ /** Invoked from [[connect]] to set up the initial synchronization between the two viewports.
86
+ * `target` should be modified to match `source`.
87
+ * The default implementation applies a clone of `source`'s [[ViewState]] to `target`.
88
+ * @see [[syncViewports]] to customize subsequent synchronization.
89
+ */
90
+ protected connectViewports(source: Viewport, target: Viewport): void;
91
+ /** Invoked each time `source` changes to update `target` to match.
92
+ * The default implementation applies a clone of `source`'s [[ViewState]] to `target`.
93
+ * @param source The viewport that changed
94
+ * @param target The viewport that should be updated to match `source`
95
+ * @see [[connectViewports]] to set up the initial synchronization between the two viewports.
96
+ */
97
+ protected syncViewports(source: Viewport, target: Viewport): void;
98
+ /** Establish the connection between two Viewports. When this method is called, `viewport2` is initialized with the state of `viewport1` via [[connectViewports]].
99
+ * Thereafter, any change to the frustum of either viewport will be reflected in the frustum of the other viewport via [[syncViewports]].
100
+ */
101
+ connect(viewport1: Viewport, viewport2: Viewport): void;
102
+ /** Remove the connection between the two views. */
103
+ disconnect(): void;
104
+ }
105
+ /** Forms a bidirectional connection between two [[Viewport]]s such that the [Frustum]($common)s of each are synchronized with one another.
106
+ * For example, zooming out in one viewport will zoom out by the same distance in the other viewport.
107
+ * No other aspects of the viewports are synchronized - they may have entirely different display styles, category/model selectors, etc.
108
+ * @see [[TwoWayViewportSync]] to synchronize all aspects of the viewports.
109
+ * @see [[connectViewportFrusta]] to synchronize the frusta of more than two viewports.
110
+ * @public
111
+ * @extensions
112
+ */
113
+ export declare class TwoWayViewportFrustumSync extends TwoWayViewportSync {
114
+ /** @internal override */
115
+ protected syncViewports(source: Viewport, target: Viewport): void;
116
+ /** @internal override */
117
+ protected connectViewports(source: Viewport, target: Viewport): void;
118
+ }
119
+ //# sourceMappingURL=ViewportSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewportSync.d.ts","sourceRoot":"","sources":["../../src/ViewportSync.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;GAMG;AACH,oBAAY,oBAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,eAAe,EAAE,QAAQ,KAAK,oBAAoB,GAAG,MAAM,IAAI,CAqCrI;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,QAAQ,GAAG,oBAAoB,CAE/E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,QAAQ,GAAG,oBAAoB,CAMhF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAI,CAE/E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAI,CAE9E;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAC7B,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,YAAY,EAAE,CAAM;IAEpD;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI;IAKpE;;;;;OAKG;IACH,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI;IAIjE;;OAEG;IACI,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;IAQvD,mDAAmD;IAC5C,UAAU;CAIlB;AAED;;;;;;;GAOG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IAC/D,yBAAyB;cACN,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI;IAM1E,yBAAyB;cACN,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI;CAG9E"}
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Views
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.TwoWayViewportFrustumSync = exports.TwoWayViewportSync = exports.connectViewportViews = exports.connectViewportFrusta = exports.synchronizeViewportFrusta = exports.synchronizeViewportViews = exports.connectViewports = void 0;
11
+ /** Forms a connection between two or more [[Viewport]]s such that a change in any one of the viewports is reflected in all of the others.
12
+ * When the connection is first formed, all of the viewports are synchronized to the current state of the **first** viewport in `viewports`.
13
+ * Thereafter, an event listener registered with each viewport's [[Viewport.onViewChanged]] event is invoked when anything about that viewport's state changes.
14
+ * Each time such an event occurs, the initating ("source") viewport is passed to `sync` to obtain a function that can be invoked to synchronize each of the other
15
+ * ("target") viewports with the source viewport's new state. The function returned by `sync` can choose to synchronize any or all aspects of the viewports' states, such as
16
+ * the viewed volume, display style, viewed categories or models, or anything else.
17
+ *
18
+ * To sever the connection, invoke the function returned by this function. For example:
19
+ * ```ts
20
+ * // set up the connection.
21
+ * const disconnect = connectViewports([viewport0, viewport1, viewport2], (changedViewport) => synchronizeViewportFrusta(changedViewport));
22
+ * // some time later, sever the connection.
23
+ * disconnect();
24
+ * ```
25
+ *
26
+ * @note [[Viewport.onViewChanged]] can be invoked **very** frequently - sometimes multiple times per frame. Try to avoid performing excessive computations within your synchronization functions.
27
+ *
28
+ * @param viewports The viewports to be connected. It should contain at least two viewports and no duplicate viewports. The initial state of each viewport will be synchronized with
29
+ * the state of the first viewport in this iterable.
30
+ * @param sync A function to be invoked whenever the state of any viewport in `viewports` changes, returning a function that can be used to synchronize the
31
+ * state of each viewport.
32
+ * @returns a function that can be invoked to sever the connection between the viewports.
33
+ * @see [[connectViewportFrusta]] to synchronize the [Frustum]($common) of each viewport.
34
+ * @see [[connectViewportViews]] to synchronize every aspect of the viewports.
35
+ * @see [[TwoWayViewportSync]] to synchronize the state of exactly two viewports.
36
+ * @see [Multiple Viewport Sample](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=multi-viewport-sample&imodel=Metrostation+Sample)
37
+ * @public
38
+ * @extensions
39
+ */
40
+ function connectViewports(viewports, sync) {
41
+ const disconnect = [];
42
+ let echo = false;
43
+ const synchronize = (source) => {
44
+ if (echo)
45
+ return;
46
+ // Ignore onViewChanged events resulting from synchronization.
47
+ echo = true;
48
+ try {
49
+ const doSync = sync(source);
50
+ for (const vp of viewports)
51
+ if (vp !== source)
52
+ doSync(source, vp);
53
+ }
54
+ finally {
55
+ echo = false;
56
+ }
57
+ };
58
+ let firstViewport;
59
+ for (const vp of viewports) {
60
+ if (!firstViewport)
61
+ firstViewport = vp;
62
+ disconnect.push(vp.onViewChanged.addListener(() => synchronize(vp)));
63
+ }
64
+ if (firstViewport)
65
+ synchronize(firstViewport);
66
+ return () => {
67
+ for (const f of disconnect)
68
+ f();
69
+ disconnect.length = 0;
70
+ };
71
+ }
72
+ exports.connectViewports = connectViewports;
73
+ /** A function that returns a [[SynchronizeViewports]] function that synchronizes every aspect of the viewports' states, including
74
+ * display style, model and category selectors, [Frustum]($common), etc.
75
+ * @see [[connectViewportViews]] to establish a connection between viewports using this synchronization strategy.
76
+ * @public
77
+ * @extensions
78
+ */
79
+ function synchronizeViewportViews(source) {
80
+ return (_source, target) => target.applyViewState(source.view.clone(target.iModel));
81
+ }
82
+ exports.synchronizeViewportViews = synchronizeViewportViews;
83
+ /** A function that returns a [[SynchronizeViewports]] function that synchronizes the viewed volumes of each viewport.
84
+ * @see [[connectViewportFrusta]] to establish a connection between viewports using this synchronization strategy.
85
+ * @public
86
+ * @extensions
87
+ */
88
+ function synchronizeViewportFrusta(source) {
89
+ const pose = source.view.savePose();
90
+ return (_source, target) => {
91
+ const view = target.view.applyPose(pose);
92
+ target.applyViewState(view);
93
+ };
94
+ }
95
+ exports.synchronizeViewportFrusta = synchronizeViewportFrusta;
96
+ /** Form a connection between two or more [[Viewport]]s such that they all view the same volume. For example, zooming out in one viewport
97
+ * will zoom out by the same distance in all of the other viewports.
98
+ * @see [[connectViewports]] to customize how the viewports are synchronized.
99
+ * @public
100
+ * @extensions
101
+ */
102
+ function connectViewportFrusta(viewports) {
103
+ return connectViewports(viewports, (source) => synchronizeViewportFrusta(source));
104
+ }
105
+ exports.connectViewportFrusta = connectViewportFrusta;
106
+ /** Form a connection between two or more [[Viewport]]s such that every aspect of the viewports are kept in sync. For example, if the set of models
107
+ * or categories visible in one viewport is changed, the same set of models and categories will be visible in the other viewports.
108
+ * @see [[connectViewportFrusta]] to synchronize only the [Frustum]($common) of each viewport.
109
+ * @see [[connectViewports]] to customize how the viewports are synchronized.
110
+ * @public
111
+ * @extensions
112
+ */
113
+ function connectViewportViews(viewports) {
114
+ return connectViewports(viewports, (source) => synchronizeViewportViews(source));
115
+ }
116
+ exports.connectViewportViews = connectViewportViews;
117
+ /** Forms a bidirectional connection between two [[Viewport]]s such that the [[ViewState]]s of each are synchronized with one another.
118
+ * For example, panning in one viewport will cause the other viewport to pan by the same distance, and changing the [RenderMode]($common) of one viewport
119
+ * will change it in the other viewport.
120
+ * By default, all aspects of the views - display style, category and model selectors, frustum, etc - are synchronized, but this can be customized by
121
+ * subclassing and overriding the [[syncViewports]] and [[connectViewports]] methods.
122
+ * @see [Multiple Viewport Sample](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=multi-viewport-sample&imodel=Metrostation+Sample)
123
+ * for an interactive demonstration.
124
+ * @see [[TwoWayViewportFrustumSync]] to synchronize only the frusta of the viewports.
125
+ * @see [[connectViewportViews]] to synchronize the state of more than two viewports.
126
+ * @public
127
+ * @extensions
128
+ */
129
+ class TwoWayViewportSync {
130
+ constructor() {
131
+ this._disconnect = [];
132
+ }
133
+ /** Invoked from [[connect]] to set up the initial synchronization between the two viewports.
134
+ * `target` should be modified to match `source`.
135
+ * The default implementation applies a clone of `source`'s [[ViewState]] to `target`.
136
+ * @see [[syncViewports]] to customize subsequent synchronization.
137
+ */
138
+ connectViewports(source, target) {
139
+ const viewState = source.view.clone(target.iModel);
140
+ target.applyViewState(viewState);
141
+ }
142
+ /** Invoked each time `source` changes to update `target` to match.
143
+ * The default implementation applies a clone of `source`'s [[ViewState]] to `target`.
144
+ * @param source The viewport that changed
145
+ * @param target The viewport that should be updated to match `source`
146
+ * @see [[connectViewports]] to set up the initial synchronization between the two viewports.
147
+ */
148
+ syncViewports(source, target) {
149
+ target.applyViewState(source.view.clone(target.iModel));
150
+ }
151
+ /** Establish the connection between two Viewports. When this method is called, `viewport2` is initialized with the state of `viewport1` via [[connectViewports]].
152
+ * Thereafter, any change to the frustum of either viewport will be reflected in the frustum of the other viewport via [[syncViewports]].
153
+ */
154
+ connect(viewport1, viewport2) {
155
+ this.disconnect();
156
+ this.connectViewports(viewport1, viewport2);
157
+ this._disconnect.push(connectViewports([viewport1, viewport2], () => (source, target) => this.syncViewports(source, target)));
158
+ }
159
+ /** Remove the connection between the two views. */
160
+ disconnect() {
161
+ this._disconnect.forEach((f) => f());
162
+ this._disconnect.length = 0;
163
+ }
164
+ }
165
+ exports.TwoWayViewportSync = TwoWayViewportSync;
166
+ /** Forms a bidirectional connection between two [[Viewport]]s such that the [Frustum]($common)s of each are synchronized with one another.
167
+ * For example, zooming out in one viewport will zoom out by the same distance in the other viewport.
168
+ * No other aspects of the viewports are synchronized - they may have entirely different display styles, category/model selectors, etc.
169
+ * @see [[TwoWayViewportSync]] to synchronize all aspects of the viewports.
170
+ * @see [[connectViewportFrusta]] to synchronize the frusta of more than two viewports.
171
+ * @public
172
+ * @extensions
173
+ */
174
+ class TwoWayViewportFrustumSync extends TwoWayViewportSync {
175
+ /** @internal override */
176
+ syncViewports(source, target) {
177
+ const pose = source.view.savePose();
178
+ const view = target.view.applyPose(pose);
179
+ target.applyViewState(view);
180
+ }
181
+ /** @internal override */
182
+ connectViewports(source, target) {
183
+ this.syncViewports(source, target);
184
+ }
185
+ }
186
+ exports.TwoWayViewportFrustumSync = TwoWayViewportFrustumSync;
187
+ //# sourceMappingURL=ViewportSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewportSync.js","sourceRoot":"","sources":["../../src/ViewportSync.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAaH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,gBAAgB,CAAC,SAA6B,EAAE,IAAyD;IACvH,MAAM,UAAU,GAAmB,EAAE,CAAC;IAEtC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,MAAM,WAAW,GAAG,CAAC,MAAgB,EAAE,EAAE;QACvC,IAAI,IAAI;YACN,OAAO;QAET,8DAA8D;QAC9D,IAAI,GAAG,IAAI,CAAC;QACZ,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,KAAK,MAAM,EAAE,IAAI,SAAS;gBACxB,IAAI,EAAE,KAAK,MAAM;oBACf,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACxB;gBAAS;YACR,IAAI,GAAG,KAAK,CAAC;SACd;IACH,CAAC,CAAC;IAEF,IAAI,aAAmC,CA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AAa,yBAA0B,SAAQ,kBAAkB;IAC/D,yBAAyB;IACN,aAAa,CAAC,MAAgB,EAAE,MAAgB;QACjE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,yBAAyB;IACN,gBAAgB,CAAC,MAAgB,EAAE,MAAgB;QACpE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;CACF;AAZD,8DAYC","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 { Viewport } from \"./Viewport\";\r\n\r\n/** A function used by [[connectViewports]] that can synchronize the state of a target [[Viewport]] with\r\n * changes in the state of a source Viewport.\r\n * The source viewport is the viewport in the connection whose state has changed.\r\n * The function will be invoked once for each target viewport in the connection.\r\n * @public\r\n * @extensions\r\n */\r\nexport type SynchronizeViewports = (source: Viewport, target: Viewport) => void;\r\n\r\n/** Forms a connection between two or more [[Viewport]]s such that a change in any one of the viewports is reflected in all of the others.\r\n * When the connection is first formed, all of the viewports are synchronized to the current state of the **first** viewport in `viewports`.\r\n * Thereafter, an event listener registered with each viewport's [[Viewport.onViewChanged]] event is invoked when anything about that viewport's state changes.\r\n * Each time such an event occurs, the initating (\"source\") viewport is passed to `sync` to obtain a function that can be invoked to synchronize each of the other\r\n * (\"target\") viewports with the source viewport's new state. The function returned by `sync` can choose to synchronize any or all aspects of the viewports' states, such as\r\n * the viewed volume, display style, viewed categories or models, or anything else.\r\n *\r\n * To sever the connection, invoke the function returned by this function. For example:\r\n * ```ts\r\n * // set up the connection.\r\n * const disconnect = connectViewports([viewport0, viewport1, viewport2], (changedViewport) => synchronizeViewportFrusta(changedViewport));\r\n * // some time later, sever the connection.\r\n * disconnect();\r\n * ```\r\n *\r\n * @note [[Viewport.onViewChanged]] can be invoked **very** frequently - sometimes multiple times per frame. Try to avoid performing excessive computations within your synchronization functions.\r\n *\r\n * @param viewports The viewports to be connected. It should contain at least two viewports and no duplicate viewports. The initial state of each viewport will be synchronized with\r\n * the state of the first viewport in this iterable.\r\n * @param sync A function to be invoked whenever the state of any viewport in `viewports` changes, returning a function that can be used to synchronize the\r\n * state of each viewport.\r\n * @returns a function that can be invoked to sever the connection between the viewports.\r\n * @see [[connectViewportFrusta]] to synchronize the [Frustum]($common) of each viewport.\r\n * @see [[connectViewportViews]] to synchronize every aspect of the viewports.\r\n * @see [[TwoWayViewportSync]] to synchronize the state of exactly two viewports.\r\n * @see [Multiple Viewport Sample](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=multi-viewport-sample&imodel=Metrostation+Sample)\r\n * @public\r\n * @extensions\r\n */\r\nexport function connectViewports(viewports: Iterable<Viewport>, sync: (changedViewport: Viewport) => SynchronizeViewports): () => void {\r\n const disconnect: VoidFunction[] = [];\r\n\r\n let echo = false;\r\n const synchronize = (source: Viewport) => {\r\n if (echo)\r\n return;\r\n\r\n // Ignore onViewChanged events resulting from synchronization.\r\n echo = true;\r\n try {\r\n const doSync = sync(source);\r\n for (const vp of viewports)\r\n if (vp !== source)\r\n doSync(source, vp);\r\n } finally {\r\n echo = false;\r\n }\r\n };\r\n\r\n let firstViewport: Viewport | undefined;\r\n for (const vp of viewports) {\r\n if (!firstViewport)\r\n firstViewport = vp;\r\n\r\n disconnect.push(vp.onViewChanged.addListener(() => synchronize(vp)));\r\n }\r\n\r\n if (firstViewport)\r\n synchronize(firstViewport);\r\n\r\n return () => {\r\n for (const f of disconnect)\r\n f();\r\n\r\n disconnect.length = 0;\r\n };\r\n}\r\n\r\n/** A function that returns a [[SynchronizeViewports]] function that synchronizes every aspect of the viewports' states, including\r\n * display style, model and category selectors, [Frustum]($common), etc.\r\n * @see [[connectViewportViews]] to establish a connection between viewports using this synchronization strategy.\r\n * @public\r\n * @extensions\r\n */\r\nexport function synchronizeViewportViews(source: Viewport): SynchronizeViewports {\r\n return (_source, target) => target.applyViewState(source.view.clone(target.iModel));\r\n}\r\n\r\n/** A function that returns a [[SynchronizeViewports]] function that synchronizes the viewed volumes of each viewport.\r\n * @see [[connectViewportFrusta]] to establish a connection between viewports using this synchronization strategy.\r\n * @public\r\n * @extensions\r\n */\r\nexport function synchronizeViewportFrusta(source: Viewport): SynchronizeViewports {\r\n const pose = source.view.savePose();\r\n return (_source, target) => {\r\n const view = target.view.applyPose(pose);\r\n target.applyViewState(view);\r\n };\r\n}\r\n\r\n/** Form a connection between two or more [[Viewport]]s such that they all view the same volume. For example, zooming out in one viewport\r\n * will zoom out by the same distance in all of the other viewports.\r\n * @see [[connectViewports]] to customize how the viewports are synchronized.\r\n * @public\r\n * @extensions\r\n */\r\nexport function connectViewportFrusta(viewports: Iterable<Viewport>): () => void {\r\n return connectViewports(viewports, (source) => synchronizeViewportFrusta(source));\r\n}\r\n\r\n/** Form a connection between two or more [[Viewport]]s such that every aspect of the viewports are kept in sync. For example, if the set of models\r\n * or categories visible in one viewport is changed, the same set of models and categories will be visible in the other viewports.\r\n * @see [[connectViewportFrusta]] to synchronize only the [Frustum]($common) of each viewport.\r\n * @see [[connectViewports]] to customize how the viewports are synchronized.\r\n * @public\r\n * @extensions\r\n */\r\nexport function connectViewportViews(viewports: Iterable<Viewport>): () => void {\r\n return connectViewports(viewports, (source) => synchronizeViewportViews(source));\r\n}\r\n\r\n/** Forms a bidirectional connection between two [[Viewport]]s such that the [[ViewState]]s of each are synchronized with one another.\r\n * For example, panning in one viewport will cause the other viewport to pan by the same distance, and changing the [RenderMode]($common) of one viewport\r\n * will change it in the other viewport.\r\n * By default, all aspects of the views - display style, category and model selectors, frustum, etc - are synchronized, but this can be customized by\r\n * subclassing and overriding the [[syncViewports]] and [[connectViewports]] methods.\r\n * @see [Multiple Viewport Sample](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=multi-viewport-sample&imodel=Metrostation+Sample)\r\n * for an interactive demonstration.\r\n * @see [[TwoWayViewportFrustumSync]] to synchronize only the frusta of the viewports.\r\n * @see [[connectViewportViews]] to synchronize the state of more than two viewports.\r\n * @public\r\n * @extensions\r\n */\r\nexport class TwoWayViewportSync {\r\n protected readonly _disconnect: VoidFunction[] = [];\r\n\r\n /** Invoked from [[connect]] to set up the initial synchronization between the two viewports.\r\n * `target` should be modified to match `source`.\r\n * The default implementation applies a clone of `source`'s [[ViewState]] to `target`.\r\n * @see [[syncViewports]] to customize subsequent synchronization.\r\n */\r\n protected connectViewports(source: Viewport, target: Viewport): void {\r\n const viewState = source.view.clone(target.iModel);\r\n target.applyViewState(viewState);\r\n }\r\n\r\n /** Invoked each time `source` changes to update `target` to match.\r\n * The default implementation applies a clone of `source`'s [[ViewState]] to `target`.\r\n * @param source The viewport that changed\r\n * @param target The viewport that should be updated to match `source`\r\n * @see [[connectViewports]] to set up the initial synchronization between the two viewports.\r\n */\r\n protected syncViewports(source: Viewport, target: Viewport): void {\r\n target.applyViewState(source.view.clone(target.iModel));\r\n }\r\n\r\n /** Establish the connection between two Viewports. When this method is called, `viewport2` is initialized with the state of `viewport1` via [[connectViewports]].\r\n * Thereafter, any change to the frustum of either viewport will be reflected in the frustum of the other viewport via [[syncViewports]].\r\n */\r\n public connect(viewport1: Viewport, viewport2: Viewport) {\r\n this.disconnect();\r\n\r\n this.connectViewports(viewport1, viewport2);\r\n\r\n this._disconnect.push(connectViewports([viewport1, viewport2], () => (source, target) => this.syncViewports(source, target)));\r\n }\r\n\r\n /** Remove the connection between the two views. */\r\n public disconnect() {\r\n this._disconnect.forEach((f) => f());\r\n this._disconnect.length = 0;\r\n }\r\n}\r\n\r\n/** Forms a bidirectional connection between two [[Viewport]]s such that the [Frustum]($common)s of each are synchronized with one another.\r\n * For example, zooming out in one viewport will zoom out by the same distance in the other viewport.\r\n * No other aspects of the viewports are synchronized - they may have entirely different display styles, category/model selectors, etc.\r\n * @see [[TwoWayViewportSync]] to synchronize all aspects of the viewports.\r\n * @see [[connectViewportFrusta]] to synchronize the frusta of more than two viewports.\r\n * @public\r\n * @extensions\r\n */\r\nexport class TwoWayViewportFrustumSync extends TwoWayViewportSync {\r\n /** @internal override */\r\n protected override syncViewports(source: Viewport, target: Viewport): void {\r\n const pose = source.view.savePose();\r\n const view = target.view.applyPose(pose);\r\n target.applyViewState(view);\r\n }\r\n\r\n /** @internal override */\r\n protected override connectViewports(source: Viewport, target: Viewport): void {\r\n this.syncViewports(source, target);\r\n }\r\n}\r\n"]}
@@ -53,7 +53,6 @@ export * from "./StandardView";
53
53
  export * from "./SubCategoriesCache";
54
54
  export * from "./TentativePoint";
55
55
  export * from "./Tiles";
56
- export * from "./TwoWayViewportSync";
57
56
  export * from "./UserPreferences";
58
57
  export * from "./ViewAnimation";
59
58
  export * from "./ViewContext";
@@ -61,6 +60,7 @@ export * from "./ViewGlobalLocation";
61
60
  export * from "./ViewingSpace";
62
61
  export * from "./ViewManager";
63
62
  export * from "./Viewport";
63
+ export * from "./ViewportSync";
64
64
  export * from "./ViewPose";
65
65
  export * from "./ViewRect";
66
66
  export * from "./ViewState";
@@ -1 +1 @@
1
- {"version":3,"file":"core-frontend.d.ts","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBA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;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,8BAA8B,CAAC;AAEtC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG"}
1
+ {"version":3,"file":"core-frontend.d.ts","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB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AChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,8BAA8B,CAAC;AAEtC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG"}
@@ -69,7 +69,6 @@ __exportStar(require("./StandardView"), exports);
69
69
  __exportStar(require("./SubCategoriesCache"), exports);
70
70
  __exportStar(require("./TentativePoint"), exports);
71
71
  __exportStar(require("./Tiles"), exports);
72
- __exportStar(require("./TwoWayViewportSync"), exports);
73
72
  __exportStar(require("./UserPreferences"), exports);
74
73
  __exportStar(require("./ViewAnimation"), exports);
75
74
  __exportStar(require("./ViewContext"), exports);
@@ -77,6 +76,7 @@ __exportStar(require("./ViewGlobalLocation"), exports);
77
76
  __exportStar(require("./ViewingSpace"), exports);
78
77
  __exportStar(require("./ViewManager"), exports);
79
78
  __exportStar(require("./Viewport"), exports);
79
+ __exportStar(require("./ViewportSync"), exports);
80
80
  __exportStar(require("./ViewPose"), exports);
81
81
  __exportStar(require("./ViewRect"), exports);
82
82
  __exportStar(require("./ViewState"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,yDAAuC;AACvC,6DAA2C;AAC3C,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,sDAAoC;AACpC,gDAA8B;AAC9B,2DAAyC;AACzC,4DAA0C;AAC1C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,8CAA4B;AAC5B,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,0DAAwC;AACxC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,qDAAmC;AACnC,yDAAuC;AACvC,2CAAyB;AACzB,uDAAqC;AACrC,kDAAgC;AAChC,2CAAyB;AACzB,uDAAqC;AACrC,+CAA6B;AAC7B,8CAA4B;AAC5B,oDAAkC;AAClC,gDAA8B;AAC9B,wDAAsC;AACtC,+DAA6C;AAC7C,wDAAsC;AACtC,wDAAsC;AACtC,iDAA+B;AAC/B,mDAAiC;AACjC,qDAAmC;AACnC,4CAA0B;AAC1B,iDAA+B;AAC/B,uDAAqC;AACrC,mDAAiC;AACjC,0CAAwB;AACxB,uDAAqC;AACrC,oDAAkC;AAClC,kDAAgC;AAChC,gDAA8B;AAC9B,uDAAqC;AACrC,iDAA+B;AAC/B,gDAA8B;AAC9B,6CAA2B;AAC3B,6CAA2B;AAC3B,6CAA2B;AAC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------------------------------------------------------------------------\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\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./RenderScheduleState\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./TwoWayViewportSync\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./extension/Extension\";\r\nexport * from \"./extension/providers/LocalExtensionProvider\";\r\nexport * from \"./extension/providers/RemoteExtensionProvider\";\r\nexport * from \"./extension/providers/ServiceExtensionProvider\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMaterial\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\r\nimport \"./extension/ExtensionRuntime\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing Extensions.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n"]}
1
+ {"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,yDAAuC;AACvC,6DAA2C;AAC3C,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,sDAAoC;AACpC,gDAA8B;AAC9B,2DAAyC;AACzC,4DAA0C;AAC1C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,8CAA4B;AAC5B,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,0DAAwC;AACxC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,qDAAmC;AACnC,yDAAuC;AACvC,2CAAyB;AACzB,uDAAqC;AACrC,kDAAgC;AAChC,2CAAyB;AACzB,uDAAqC;AACrC,+CAA6B;AAC7B,8CAA4B;AAC5B,oDAAkC;AAClC,gDAA8B;AAC9B,wDAAsC;AACtC,+DAA6C;AAC7C,wDAAsC;AACtC,wDAAsC;AACtC,iDAA+B;AAC/B,mDAAiC;AACjC,qDAAmC;AACnC,4CAA0B;AAC1B,iDAA+B;AAC/B,uDAAqC;AACrC,mDAAiC;AACjC,0CAAwB;AACxB,oDAAkC;AAClC,kDAAgC;AAChC,gDAA8B;AAC9B,uDAAqC;AACrC,iDAA+B;AAC/B,gD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;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG","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\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./RenderScheduleState\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewportSync\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./extension/Extension\";\r\nexport * from \"./extension/providers/LocalExtensionProvider\";\r\nexport * from \"./extension/providers/RemoteExtensionProvider\";\r\nexport * from \"./extension/providers/ServiceExtensionProvider\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMaterial\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\r\nimport \"./extension/ExtensionRuntime\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing Extensions.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ClassifierTileTree.d.ts","sourceRoot":"","sources":["../../../src/tile/ClassifierTileTree.ts"],"names":[],"mappings":"AAQA,OAAO,EAAmG,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACjM,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAC4G,iBAAiB,EACnI,MAAM,YAAY,CAAC;AAkEpB,gBAAgB;AAChB,8BAAsB,kCAAmC,SAAQ,iBAAiB;IAChF,aAAoB,QAAQ,IAAI,OAAO,CAAC;IACxC,aAAoB,gBAAgB,IAAI,iBAAiB,GAAG,SAAS,CAAC;IACtE,IAAW,QAAQ,YAAoB,CAAG,6EAA6E;IACvH,aAAoB,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9D,IAAW,YAAY,IAAI,MAAM,GAAG,SAAS,CAAsB;CACpE;AAuFD,gBAAgB;AAChB,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,kCAAkC,CAEzN"}
1
+ {"version":3,"file":"ClassifierTileTree.d.ts","sourceRoot":"","sources":["../../../src/tile/ClassifierTileTree.ts"],"names":[],"mappings":"AAQA,OAAO,EAAmG,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACjM,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAC4G,iBAAiB,EACnI,MAAM,YAAY,CAAC;AAiEpB,gBAAgB;AAChB,8BAAsB,kCAAmC,SAAQ,iBAAiB;IAChF,aAAoB,QAAQ,IAAI,OAAO,CAAC;IACxC,aAAoB,gBAAgB,IAAI,iBAAiB,GAAG,SAAS,CAAC;IACtE,IAAW,QAAQ,YAAoB,CAAG,6EAA6E;IACvH,aAAoB,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9D,IAAW,YAAY,IAAI,MAAM,GAAG,SAAS,CAAsB;CACpE;AAuFD,gBAAgB;AAChB,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,kCAAkC,CAEzN"}
@@ -40,13 +40,12 @@ class ClassifierTreeSupplier {
40
40
  return undefined;
41
41
  const idStr = (0, core_common_1.iModelTileTreeIdToString)(id.modelId, id, IModelApp_1.IModelApp.tileAdmin);
42
42
  const props = await IModelApp_1.IModelApp.tileAdmin.requestTileTreeProps(iModel, idStr);
43
- const options = {
44
- edgesRequired: false,
43
+ const params = (0, internal_1.iModelTileTreeParamsFromJSON)(props, iModel, id.modelId, {
44
+ edges: false,
45
45
  allowInstancing: false,
46
46
  is3d: true,
47
47
  batchType: id.type,
48
- };
49
- const params = (0, internal_1.iModelTileTreeParamsFromJSON)(props, iModel, id.modelId, options);
48
+ });
50
49
  return new internal_1.IModelTileTree(params, id);
51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;KACZ,CAAC;AACJ,CAAC","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 Tiles\r\n */\r\nimport { compareStrings, compareStringsOrUndefined, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { BatchType, ClassifierTileTreeId, compareIModelTileTreeIds, iModelTileTreeIdToString, RenderMode, SpatialClassifier, SpatialClassifiers, ViewFlagsProperties } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"../DisplayStyleState\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { GeometricModelState } from \"../ModelState\";\r\nimport { SceneContext } from \"../ViewContext\";\r\nimport { ViewState } from \"../ViewState\";\r\nimport {\r\n DisclosedTileTreeSet, IModelTileTree, iModelTileTreeParamsFromJSON, TileTree, TileTreeLoadStatus, TileTreeOwner, TileTreeReference, TileTreeSupplier,\r\n} from \"./internal\";\r\n\r\ninterface ClassifierTreeId extends ClassifierTileTreeId {\r\n modelId: Id64String;\r\n}\r\n\r\nfunction compareIds(lhs: ClassifierTreeId, rhs: ClassifierTreeId): number {\r\n let cmp = compareStrings(lhs.modelId, rhs.modelId);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\r\n\r\n return 0 === cmp ? compareIModelTileTreeIds(lhs, rhs) : cmp;\r\n}\r\n\r\nclass ClassifierTreeSupplier implements TileTreeSupplier {\r\n private readonly _nonexistentTreeOwner = {\r\n tileTree: undefined,\r\n loadStatus: TileTreeLoadStatus.NotFound,\r\n load: () => undefined,\r\n dispose: () => undefined,\r\n loadTree: async () => undefined,\r\n iModel: undefined as unknown as IModelConnection,\r\n };\r\n\r\n public compareTileTreeIds(lhs: ClassifierTreeId, rhs: ClassifierTreeId): number {\r\n return compareIds(lhs, rhs);\r\n }\r\n\r\n public async createTileTree(id: ClassifierTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n await iModel.models.load(id.modelId);\r\n const model = iModel.models.getLoaded(id.modelId);\r\n if (undefined === model || !(model instanceof GeometricModelState))\r\n return undefined;\r\n\r\n const idStr = iModelTileTreeIdToString(id.modelId, id, IModelApp.tileAdmin);\r\n const props = await IModelApp.tileAdmin.requestTileTreeProps(iModel, idStr);\r\n\r\n const options = {\r\n edgesRequired: false,\r\n allowInstancing: false,\r\n is3d: true,\r\n batchType: id.type,\r\n };\r\n\r\n const params = iModelTileTreeParamsFromJSON(props, iModel, id.modelId, options);\r\n return new IModelTileTree(params, id);\r\n }\r\n\r\n public getOwner(id: ClassifierTreeId, iModel: IModelConnection): TileTreeOwner {\r\n return Id64.isValid(id.modelId) ? iModel.tiles.getTileTreeOwner(id, this) : this._nonexistentTreeOwner;\r\n }\r\n\r\n public addModelsAnimatedByScript(modelIds: Set<Id64String>, scriptSourceId: Id64String, trees: Iterable<{ id: ClassifierTreeId, owner: TileTreeOwner }>): void {\r\n for (const tree of trees)\r\n if (tree.id.animationId === scriptSourceId)\r\n modelIds.add(tree.id.modelId);\r\n }\r\n\r\n public addSpatialModels(modelIds: Set<Id64String>, trees: Iterable<{ id: ClassifierTreeId, owner: TileTreeOwner }>): void {\r\n for (const tree of trees)\r\n modelIds.add(tree.id.modelId);\r\n }\r\n}\r\n\r\nconst classifierTreeSupplier = new ClassifierTreeSupplier();\r\n\r\n/** @internal */\r\nexport abstract class SpatialClassifierTileTreeReference extends TileTreeReference {\r\n public abstract get isPlanar(): boolean;\r\n public abstract get activeClassifier(): SpatialClassifier | undefined;\r\n public get isOpaque() { return false; } /** When referenced as a map layer reference, BIM models are never opaque. */\r\n public abstract get viewFlags(): Partial<ViewFlagsProperties>;\r\n public get transparency(): number | undefined { return undefined; }\r\n}\r\n\r\n/** @internal */\r\nclass ClassifierTreeReference extends SpatialClassifierTileTreeReference {\r\n private _id: ClassifierTreeId;\r\n private readonly _classifiers: SpatialClassifiers;\r\n private readonly _source: ViewState | DisplayStyleState;\r\n private readonly _iModel: IModelConnection;\r\n private readonly _classifiedTree: TileTreeReference;\r\n private _owner: TileTreeOwner;\r\n\r\n public constructor(classifiers: SpatialClassifiers, classifiedTree: TileTreeReference, iModel: IModelConnection, source: ViewState | DisplayStyleState) {\r\n super();\r\n this._id = createClassifierId(classifiers.active, source);\r\n this._source = source;\r\n this._iModel = iModel;\r\n this._classifiers = classifiers;\r\n this._classifiedTree = classifiedTree;\r\n this._owner = classifierTreeSupplier.getOwner(this._id, iModel);\r\n }\r\n\r\n public get classifiers(): SpatialClassifiers { return this._classifiers; }\r\n public get activeClassifier(): SpatialClassifier | undefined { return this.classifiers.active; }\r\n\r\n public override get castsShadows() {\r\n return false;\r\n }\r\n\r\n public get treeOwner(): TileTreeOwner {\r\n const newId = createClassifierId(this._classifiers.active, this._source);\r\n if (0 !== compareIds(this._id, newId)) {\r\n this._id = newId;\r\n this._owner = classifierTreeSupplier.getOwner(this._id, this._iModel);\r\n }\r\n\r\n return this._owner;\r\n }\r\n\r\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n // NB: We do NOT call super because we don't use our tree if no classifier is active.\r\n trees.disclose(this._classifiedTree);\r\n\r\n const classifier = this.activeClassifier;\r\n const classifierTree = undefined !== classifier ? this.treeOwner.tileTree : undefined;\r\n if (undefined !== classifierTree)\r\n trees.add(classifierTree);\r\n }\r\n public get isPlanar() { return BatchType.PlanarClassifier === this._id.type; }\r\n\r\n public get viewFlags(): Partial<ViewFlagsProperties> {\r\n return {\r\n renderMode: RenderMode.SmoothShade,\r\n transparency: true, // Igored for point clouds as they don't support transparency.\r\n textures: false,\r\n lighting: false,\r\n shadows: false,\r\n monochrome: false,\r\n materials: false,\r\n ambientOcclusion: false,\r\n visibleEdges: false,\r\n hiddenEdges: false,\r\n };\r\n }\r\n\r\n // Add volume classifiers to scene (planar classifiers are added seperately.)\r\n public override addToScene(context: SceneContext): void {\r\n if (this.isPlanar)\r\n return;\r\n\r\n const classifiedTree = this._classifiedTree.treeOwner.load();\r\n if (undefined === classifiedTree)\r\n return;\r\n\r\n const classifier = this._classifiers.active;\r\n if (undefined === classifier)\r\n return;\r\n\r\n const classifierTree = this.treeOwner.load();\r\n if (undefined === classifierTree)\r\n return;\r\n\r\n context.setVolumeClassifier(classifier, classifiedTree.modelId);\r\n super.addToScene(context);\r\n }\r\n\r\n}\r\n\r\n/** @internal */\r\nexport function createClassifierTileTreeReference(classifiers: SpatialClassifiers, classifiedTree: TileTreeReference, iModel: IModelConnection, source: ViewState | DisplayStyleState): SpatialClassifierTileTreeReference {\r\n return new ClassifierTreeReference(classifiers, classifiedTree, iModel, source);\r\n}\r\n\r\nfunction createClassifierId(classifier: SpatialClassifier | undefined, source: ViewState | DisplayStyleState | undefined): ClassifierTreeId {\r\n if (undefined === classifier)\r\n return { modelId: Id64.invalid, type: BatchType.PlanarClassifier, expansion: 0, animationId: undefined };\r\n\r\n const type = classifier.flags.isVolumeClassifier ? BatchType.VolumeClassifier : BatchType.PlanarClassifier;\r\n const script = source?.scheduleState;\r\n const animationId = (undefined !== script) ? script.getModelAnimationId(classifier.modelId) : undefined;\r\n return {\r\n modelId: classifier.modelId,\r\n type,\r\n expansion: classifier.expand,\r\n animationId,\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"ClassifierTileTree.js","sourceRoot":"","sources":["../../../src/tile/ClassifierTileTree.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAkG;AAClG,oDAAiM;AAEjM,4CAAyC;AAEzC,8CAAoD;AAGpD,yCAEoB;AAMpB,SAAS,UAAU,CAAC,GAAqB,EAAE,GAAqB;IAC9D,IAAI,GAAG,GAAG,IAAA,6BAAc,EAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,KAAK,GAAG;QACX,GAAG,GAAG,IAAA,wCAAy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,EAAE,MAAM,CAAC,CAAC;AAClF,CAAC;AAFD,8EAEC;AAED,SAAS,kBAAkB,CAAC,UAAyC,EAAE,MAAiD;IACtH,IAAI,SAAS,KAAK,UAAU;QAC1B,OAAO,EAAE,OAAO,EAAE,mBAAI,CAAC,OAAO,EAAE,IAAI,EAAE,uBAAS,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAE3G,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,uBAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAS,CAAC,gBAAgB,CAAC;IAC3G,MAAM,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC;IACrC,MAAM,WAAW,GAAG,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxG,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI;QACJ,SAAS,EAAE,UAAU,CAAC,MAAM;QAC5B,WAAW;KACZ,CAAC;AACJ,CAAC","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 Tiles\r\n */\r\nimport { compareStrings, compareStringsOrUndefined, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { BatchType, ClassifierTileTreeId, compareIModelTileTreeIds, iModelTileTreeIdToString, RenderMode, SpatialClassifier, SpatialClassifiers, ViewFlagsProperties } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"../DisplayStyleState\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { GeometricModelState } from \"../ModelState\";\r\nimport { SceneContext } from \"../ViewContext\";\r\nimport { ViewState } from \"../ViewState\";\r\nimport {\r\n DisclosedTileTreeSet, IModelTileTree, iModelTileTreeParamsFromJSON, TileTree, TileTreeLoadStatus, TileTreeOwner, TileTreeReference, TileTreeSupplier,\r\n} from \"./internal\";\r\n\r\ninterface ClassifierTreeId extends ClassifierTileTreeId {\r\n modelId: Id64String;\r\n}\r\n\r\nfunction compareIds(lhs: ClassifierTreeId, rhs: ClassifierTreeId): number {\r\n let cmp = compareStrings(lhs.modelId, rhs.modelId);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\r\n\r\n return 0 === cmp ? compareIModelTileTreeIds(lhs, rhs) : cmp;\r\n}\r\n\r\nclass ClassifierTreeSupplier implements TileTreeSupplier {\r\n private readonly _nonexistentTreeOwner = {\r\n tileTree: undefined,\r\n loadStatus: TileTreeLoadStatus.NotFound,\r\n load: () => undefined,\r\n dispose: () => undefined,\r\n loadTree: async () => undefined,\r\n iModel: undefined as unknown as IModelConnection,\r\n };\r\n\r\n public compareTileTreeIds(lhs: ClassifierTreeId, rhs: ClassifierTreeId): number {\r\n return compareIds(lhs, rhs);\r\n }\r\n\r\n public async createTileTree(id: ClassifierTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n await iModel.models.load(id.modelId);\r\n const model = iModel.models.getLoaded(id.modelId);\r\n if (undefined === model || !(model instanceof GeometricModelState))\r\n return undefined;\r\n\r\n const idStr = iModelTileTreeIdToString(id.modelId, id, IModelApp.tileAdmin);\r\n const props = await IModelApp.tileAdmin.requestTileTreeProps(iModel, idStr);\r\n\r\n const params = iModelTileTreeParamsFromJSON(props, iModel, id.modelId, {\r\n edges: false,\r\n allowInstancing: false,\r\n is3d: true,\r\n batchType: id.type,\r\n });\r\n\r\n return new IModelTileTree(params, id);\r\n }\r\n\r\n public getOwner(id: ClassifierTreeId, iModel: IModelConnection): TileTreeOwner {\r\n return Id64.isValid(id.modelId) ? iModel.tiles.getTileTreeOwner(id, this) : this._nonexistentTreeOwner;\r\n }\r\n\r\n public addModelsAnimatedByScript(modelIds: Set<Id64String>, scriptSourceId: Id64String, trees: Iterable<{ id: ClassifierTreeId, owner: TileTreeOwner }>): void {\r\n for (const tree of trees)\r\n if (tree.id.animationId === scriptSourceId)\r\n modelIds.add(tree.id.modelId);\r\n }\r\n\r\n public addSpatialModels(modelIds: Set<Id64String>, trees: Iterable<{ id: ClassifierTreeId, owner: TileTreeOwner }>): void {\r\n for (const tree of trees)\r\n modelIds.add(tree.id.modelId);\r\n }\r\n}\r\n\r\nconst classifierTreeSupplier = new ClassifierTreeSupplier();\r\n\r\n/** @internal */\r\nexport abstract class SpatialClassifierTileTreeReference extends TileTreeReference {\r\n public abstract get isPlanar(): boolean;\r\n public abstract get activeClassifier(): SpatialClassifier | undefined;\r\n public get isOpaque() { return false; } /** When referenced as a map layer reference, BIM models are never opaque. */\r\n public abstract get viewFlags(): Partial<ViewFlagsProperties>;\r\n public get transparency(): number | undefined { return undefined; }\r\n}\r\n\r\n/** @internal */\r\nclass ClassifierTreeReference extends SpatialClassifierTileTreeReference {\r\n private _id: ClassifierTreeId;\r\n private readonly _classifiers: SpatialClassifiers;\r\n private readonly _source: ViewState | DisplayStyleState;\r\n private readonly _iModel: IModelConnection;\r\n private readonly _classifiedTree: TileTreeReference;\r\n private _owner: TileTreeOwner;\r\n\r\n public constructor(classifiers: SpatialClassifiers, classifiedTree: TileTreeReference, iModel: IModelConnection, source: ViewState | DisplayStyleState) {\r\n super();\r\n this._id = createClassifierId(classifiers.active, source);\r\n this._source = source;\r\n this._iModel = iModel;\r\n this._classifiers = classifiers;\r\n this._classifiedTree = classifiedTree;\r\n this._owner = classifierTreeSupplier.getOwner(this._id, iModel);\r\n }\r\n\r\n public get classifiers(): SpatialClassifiers { return this._classifiers; }\r\n public get activeClassifier(): SpatialClassifier | undefined { return this.classifiers.active; }\r\n\r\n public override get castsShadows() {\r\n return false;\r\n }\r\n\r\n public get treeOwner(): TileTreeOwner {\r\n const newId = createClassifierId(this._classifiers.active, this._source);\r\n if (0 !== compareIds(this._id, newId)) {\r\n this._id = newId;\r\n this._owner = classifierTreeSupplier.getOwner(this._id, this._iModel);\r\n }\r\n\r\n return this._owner;\r\n }\r\n\r\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n // NB: We do NOT call super because we don't use our tree if no classifier is active.\r\n trees.disclose(this._classifiedTree);\r\n\r\n const classifier = this.activeClassifier;\r\n const classifierTree = undefined !== classifier ? this.treeOwner.tileTree : undefined;\r\n if (undefined !== classifierTree)\r\n trees.add(classifierTree);\r\n }\r\n public get isPlanar() { return BatchType.PlanarClassifier === this._id.type; }\r\n\r\n public get viewFlags(): Partial<ViewFlagsProperties> {\r\n return {\r\n renderMode: RenderMode.SmoothShade,\r\n transparency: true, // Igored for point clouds as they don't support transparency.\r\n textures: false,\r\n lighting: false,\r\n shadows: false,\r\n monochrome: false,\r\n materials: false,\r\n ambientOcclusion: false,\r\n visibleEdges: false,\r\n hiddenEdges: false,\r\n };\r\n }\r\n\r\n // Add volume classifiers to scene (planar classifiers are added seperately.)\r\n public override addToScene(context: SceneContext): void {\r\n if (this.isPlanar)\r\n return;\r\n\r\n const classifiedTree = this._classifiedTree.treeOwner.load();\r\n if (undefined === classifiedTree)\r\n return;\r\n\r\n const classifier = this._classifiers.active;\r\n if (undefined === classifier)\r\n return;\r\n\r\n const classifierTree = this.treeOwner.load();\r\n if (undefined === classifierTree)\r\n return;\r\n\r\n context.setVolumeClassifier(classifier, classifiedTree.modelId);\r\n super.addToScene(context);\r\n }\r\n\r\n}\r\n\r\n/** @internal */\r\nexport function createClassifierTileTreeReference(classifiers: SpatialClassifiers, classifiedTree: TileTreeReference, iModel: IModelConnection, source: ViewState | DisplayStyleState): SpatialClassifierTileTreeReference {\r\n return new ClassifierTreeReference(classifiers, classifiedTree, iModel, source);\r\n}\r\n\r\nfunction createClassifierId(classifier: SpatialClassifier | undefined, source: ViewState | DisplayStyleState | undefined): ClassifierTreeId {\r\n if (undefined === classifier)\r\n return { modelId: Id64.invalid, type: BatchType.PlanarClassifier, expansion: 0, animationId: undefined };\r\n\r\n const type = classifier.flags.isVolumeClassifier ? BatchType.VolumeClassifier : BatchType.PlanarClassifier;\r\n const script = source?.scheduleState;\r\n const animationId = (undefined !== script) ? script.getModelAnimationId(classifier.modelId) : undefined;\r\n return {\r\n modelId: classifier.modelId,\r\n type,\r\n expansion: classifier.expand,\r\n animationId,\r\n };\r\n}\r\n"]}
@@ -275,7 +275,9 @@ class GraphicsTile extends internal_1.Tile {
275
275
  formatVersion: idProvider.majorFormatVersion,
276
276
  location: this.tree.iModelTransform.toJSON(),
277
277
  contentFlags: idProvider.contentFlags,
278
- omitEdges: !this.tree.hasEdges,
278
+ omitEdges: !this.tree.edgeOptions,
279
+ edgeType: this.tree.edgeOptions && this.tree.edgeOptions.indexed ? 2 : 1,
280
+ smoothPolyfaceEdges: this.tree.edgeOptions && this.tree.edgeOptions.smooth,
279
281
  clipToProjectExtents: true,
280
282
  sectionCut: this.tree.stringifiedSectionClip,
281
283
  };
@@ -297,7 +299,7 @@ class GraphicsTile extends internal_1.Tile {
297
299
  const reader = internal_1.ImdlReader.create({
298
300
  stream, iModel, modelId, is3d, system, isCanceled, containsTransformNodes,
299
301
  type: tree.batchType,
300
- loadEdges: tree.hasEdges,
302
+ loadEdges: false !== tree.edgeOptions,
301
303
  options: { tileId: this.contentId },
302
304
  });
303
305
  let content = { isLeaf: true };