@itwin/core-frontend 3.1.0-dev.7 → 3.1.0-dev.8
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.map +1 -1
- package/lib/cjs/BriefcaseConnection.js +6 -5
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/DrawingViewState.js +3 -3
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/SheetViewState.js +3 -3
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +6 -3
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +16 -9
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/cjs/tile/DynamicIModelTile.js +1 -1
- package/lib/cjs/tile/DynamicIModelTile.js.map +1 -1
- package/lib/cjs/tile/LRUTileList.d.ts +29 -29
- package/lib/cjs/tile/LRUTileList.d.ts.map +1 -1
- package/lib/cjs/tile/LRUTileList.js +50 -50
- package/lib/cjs/tile/LRUTileList.js.map +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.js +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityTile.d.ts +2 -2
- package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTile.js +2 -2
- package/lib/cjs/tile/RealityTile.js.map +1 -1
- package/lib/cjs/tile/RealityTileLoader.d.ts +2 -2
- package/lib/cjs/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileLoader.js +1 -1
- package/lib/cjs/tile/RealityTileLoader.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +1 -1
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/Tile.d.ts +5 -4
- package/lib/cjs/tile/Tile.d.ts.map +1 -1
- package/lib/cjs/tile/Tile.js +3 -2
- package/lib/cjs/tile/Tile.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +43 -45
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +104 -99
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileRequest.d.ts +12 -9
- package/lib/cjs/tile/TileRequest.d.ts.map +1 -1
- package/lib/cjs/tile/TileRequest.js +19 -11
- package/lib/cjs/tile/TileRequest.js.map +1 -1
- package/lib/cjs/tile/TileRequestChannel.js +3 -3
- package/lib/cjs/tile/TileRequestChannel.js.map +1 -1
- package/lib/cjs/tile/TileTree.js +1 -1
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +1 -1
- package/lib/cjs/tile/TileTreeReference.js +1 -1
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/TileUsageMarker.d.ts +9 -9
- package/lib/cjs/tile/TileUsageMarker.d.ts.map +1 -1
- package/lib/cjs/tile/TileUsageMarker.js +9 -9
- package/lib/cjs/tile/TileUsageMarker.js.map +1 -1
- package/lib/cjs/tile/TileUser.d.ts +33 -0
- package/lib/cjs/tile/TileUser.d.ts.map +1 -0
- package/lib/cjs/tile/TileUser.js +28 -0
- package/lib/cjs/tile/TileUser.js.map +1 -0
- package/lib/cjs/tile/TileUserSet.d.ts +28 -0
- package/lib/cjs/tile/TileUserSet.d.ts.map +1 -0
- package/lib/cjs/tile/TileUserSet.js +123 -0
- package/lib/cjs/tile/TileUserSet.js.map +1 -0
- package/lib/cjs/tile/internal.d.ts +2 -0
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +2 -0
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.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/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +1 -2
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -2
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts +3 -3
- package/lib/cjs/tile/map/MapTileTree.js +4 -4
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
- package/lib/esm/BriefcaseConnection.js +6 -5
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/DrawingViewState.js +3 -3
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/SheetViewState.js +3 -3
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/Viewport.d.ts +6 -3
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +17 -10
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/esm/tile/DynamicIModelTile.js +1 -1
- package/lib/esm/tile/DynamicIModelTile.js.map +1 -1
- package/lib/esm/tile/LRUTileList.d.ts +29 -29
- package/lib/esm/tile/LRUTileList.d.ts.map +1 -1
- package/lib/esm/tile/LRUTileList.js +47 -47
- package/lib/esm/tile/LRUTileList.js.map +1 -1
- package/lib/esm/tile/OrbitGtTileTree.js +1 -1
- package/lib/esm/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +1 -1
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/RealityTile.d.ts +2 -2
- package/lib/esm/tile/RealityTile.d.ts.map +1 -1
- package/lib/esm/tile/RealityTile.js +2 -2
- package/lib/esm/tile/RealityTile.js.map +1 -1
- package/lib/esm/tile/RealityTileLoader.d.ts +2 -2
- package/lib/esm/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileLoader.js +1 -1
- package/lib/esm/tile/RealityTileLoader.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +1 -1
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/Tile.d.ts +5 -4
- package/lib/esm/tile/Tile.d.ts.map +1 -1
- package/lib/esm/tile/Tile.js +3 -2
- package/lib/esm/tile/Tile.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +43 -45
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +105 -100
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileRequest.d.ts +12 -9
- package/lib/esm/tile/TileRequest.d.ts.map +1 -1
- package/lib/esm/tile/TileRequest.js +19 -11
- package/lib/esm/tile/TileRequest.js.map +1 -1
- package/lib/esm/tile/TileRequestChannel.js +3 -3
- package/lib/esm/tile/TileRequestChannel.js.map +1 -1
- package/lib/esm/tile/TileTree.js +1 -1
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +1 -1
- package/lib/esm/tile/TileTreeReference.js +1 -1
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/TileUsageMarker.d.ts +9 -9
- package/lib/esm/tile/TileUsageMarker.d.ts.map +1 -1
- package/lib/esm/tile/TileUsageMarker.js +9 -9
- package/lib/esm/tile/TileUsageMarker.js.map +1 -1
- package/lib/esm/tile/TileUser.d.ts +33 -0
- package/lib/esm/tile/TileUser.d.ts.map +1 -0
- package/lib/esm/tile/TileUser.js +25 -0
- package/lib/esm/tile/TileUser.js.map +1 -0
- package/lib/esm/tile/TileUserSet.d.ts +28 -0
- package/lib/esm/tile/TileUserSet.d.ts.map +1 -0
- package/lib/esm/tile/TileUserSet.js +118 -0
- package/lib/esm/tile/TileUserSet.js.map +1 -0
- package/lib/esm/tile/internal.d.ts +2 -0
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +2 -0
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.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/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +1 -2
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -2
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts +3 -3
- package/lib/esm/tile/map/MapTileTree.js +4 -4
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/package.json +20 -20
- package/lib/cjs/ViewportSet.d.ts +0 -28
- package/lib/cjs/ViewportSet.d.ts.map +0 -1
- package/lib/cjs/ViewportSet.js +0 -126
- package/lib/cjs/ViewportSet.js.map +0 -1
- package/lib/esm/ViewportSet.d.ts +0 -28
- package/lib/esm/ViewportSet.d.ts.map +0 -1
- package/lib/esm/ViewportSet.js +0 -121
- package/lib/esm/ViewportSet.js.map +0 -1
|
@@ -5,8 +5,7 @@ import { BeDuration, BeEvent, Id64Array } from "@itwin/core-bentley";
|
|
|
5
5
|
import { ElementGraphicsRequestProps, IModelTileTreeProps, TileVersionInfo } from "@itwin/core-common";
|
|
6
6
|
import { IModelConnection } from "../IModelConnection";
|
|
7
7
|
import { Viewport } from "../Viewport";
|
|
8
|
-
import {
|
|
9
|
-
import { IModelTileTree, Tile, TileRequestChannels, TileTreeOwner, TileUsageMarker } from "./internal";
|
|
8
|
+
import { IModelTileTree, ReadonlyTileUserSet, Tile, TileRequestChannels, TileTreeOwner, TileUsageMarker, TileUser } from "./internal";
|
|
10
9
|
/** Details about any tiles not handled by [[TileAdmin]]. At this time, that means OrbitGT point cloud tiles.
|
|
11
10
|
* Used for bookkeeping by SelectedAndReadyTiles
|
|
12
11
|
* @internal
|
|
@@ -84,11 +83,11 @@ export interface GpuMemoryLimits {
|
|
|
84
83
|
export declare class TileAdmin {
|
|
85
84
|
private _versionInfo?;
|
|
86
85
|
readonly channels: TileRequestChannels;
|
|
87
|
-
private readonly
|
|
88
|
-
private readonly
|
|
89
|
-
private readonly
|
|
86
|
+
private readonly _users;
|
|
87
|
+
private readonly _requestsPerUser;
|
|
88
|
+
private readonly _tileUsagePerUser;
|
|
90
89
|
private readonly _selectedAndReady;
|
|
91
|
-
private readonly
|
|
90
|
+
private readonly _tileUserSetsForRequests;
|
|
92
91
|
private readonly _maxActiveTileTreePropsRequests;
|
|
93
92
|
private _defaultTileSizeModifier;
|
|
94
93
|
private readonly _retryInterval;
|
|
@@ -148,7 +147,7 @@ export declare class TileAdmin {
|
|
|
148
147
|
*/
|
|
149
148
|
static create(props?: TileAdmin.Props): Promise<TileAdmin>;
|
|
150
149
|
/** @internal */
|
|
151
|
-
get
|
|
150
|
+
get emptyTileUserSet(): ReadonlyTileUserSet;
|
|
152
151
|
/** Returns basic statistics about the TileAdmin's current state. */
|
|
153
152
|
get statistics(): TileAdmin.Statistics;
|
|
154
153
|
/** Resets the cumulative (per-session) statistics like totalCompletedRequests, totalEmptyTiles, etc. */
|
|
@@ -197,84 +196,83 @@ export declare class TileAdmin {
|
|
|
197
196
|
* @internal
|
|
198
197
|
*/
|
|
199
198
|
process(): void;
|
|
200
|
-
/** Iterate over the tiles that have content loaded but are not
|
|
199
|
+
/** Iterate over the tiles that have content loaded but are not in use by any [[TileUser]].
|
|
201
200
|
* @alpha
|
|
202
201
|
*/
|
|
203
202
|
get unselectedLoadedTiles(): Iterable<Tile>;
|
|
204
|
-
/** Iterate over the tiles that have content loaded and are
|
|
203
|
+
/** Iterate over the tiles that have content loaded and are in use by any [[TileUser]].
|
|
205
204
|
* @alpha
|
|
206
205
|
*/
|
|
207
206
|
get selectedLoadedTiles(): Iterable<Tile>;
|
|
208
207
|
/** Returns the number of pending and active requests associated with the specified viewport. */
|
|
209
208
|
getNumRequestsForViewport(vp: Viewport): number;
|
|
210
|
-
/** Returns the
|
|
209
|
+
/** Returns the number of pending and active requests associated with the specified user. */
|
|
210
|
+
getNumRequestsForUser(user: TileUser): number;
|
|
211
|
+
/** Returns the current set of Tiles requested by the specified TileUser.
|
|
211
212
|
* Do not modify the set or the Tiles.
|
|
212
213
|
* @internal
|
|
213
214
|
*/
|
|
214
|
-
|
|
215
|
-
/** Specifies the set of tiles currently requested for use by a
|
|
215
|
+
getRequestsForUser(user: TileUser): Set<Tile> | undefined;
|
|
216
|
+
/** Specifies the set of tiles currently requested for use by a TileUser. This set replaces any previously specified for the same user.
|
|
216
217
|
* The requests are not actually processed until the next call to [[TileAdmin.process].
|
|
217
|
-
* This is typically invoked when
|
|
218
|
+
* This is typically invoked when a viewport recreates its scene, e.g. in response to camera movement.
|
|
218
219
|
* @internal
|
|
219
220
|
*/
|
|
220
|
-
requestTiles(
|
|
221
|
-
/** Returns two sets of tiles associated with the specified
|
|
221
|
+
requestTiles(user: TileUser, tiles: Set<Tile>): void;
|
|
222
|
+
/** Returns two sets of tiles associated with the specified user - typically, a viewport's current scene.
|
|
222
223
|
* Do not modify the returned sets.
|
|
223
224
|
* @internal
|
|
224
225
|
*/
|
|
225
|
-
|
|
226
|
-
/** Adds the specified tiles to the sets of selected and ready tiles for the specified
|
|
226
|
+
getTilesForUser(user: TileUser): SelectedAndReadyTiles | undefined;
|
|
227
|
+
/** Adds the specified tiles to the sets of selected and ready tiles for the specified TileUser.
|
|
227
228
|
* The TileAdmin takes ownership of the `ready` set - do not modify it after passing it in.
|
|
228
229
|
* @internal
|
|
229
230
|
*/
|
|
230
|
-
|
|
231
|
+
addTilesForUser(user: TileUser, selected: Tile[], ready: Set<Tile>): void;
|
|
231
232
|
/** Disclose statistics about tiles that are handled externally from TileAdmin. At this time, that means OrbitGT point cloud tiles.
|
|
232
|
-
* These statistics are included in the return value of [[
|
|
233
|
+
* These statistics are included in the return value of [[getTilesForUser]].
|
|
233
234
|
* @internal
|
|
234
235
|
*/
|
|
235
|
-
|
|
236
|
-
/** Clears the sets of tiles associated with a
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
/** Indicates that the TileAdmin should cease tracking the specified viewport, e.g. because it is about to be destroyed.
|
|
241
|
-
* Any requests which are of interest only to the specified viewport will be canceled.
|
|
242
|
-
* @internal
|
|
236
|
+
addExternalTilesForUser(user: TileUser, statistics: ExternalTileStatistics): void;
|
|
237
|
+
/** Clears the sets of tiles associated with a TileUser. */
|
|
238
|
+
clearTilesForUser(user: TileUser): void;
|
|
239
|
+
/** Indicates that the TileAdmin should cease tracking the specified TileUser, e.g. because it is about to be destroyed.
|
|
240
|
+
* Any requests which are of interest only to the specified user will be canceled.
|
|
243
241
|
*/
|
|
244
|
-
|
|
245
|
-
/** Indicates that the TileAdmin should track tile requests for the specified
|
|
246
|
-
* This is invoked by the Viewport constructor and should
|
|
247
|
-
*
|
|
242
|
+
forgetUser(user: TileUser): void;
|
|
243
|
+
/** Indicates that the TileAdmin should track tile requests for the specified TileUser.
|
|
244
|
+
* This is invoked by the Viewport constructor and should be invoked manually for any non-Viewport TileUser.
|
|
245
|
+
* [[forgetUser]] must be later invoked to unregister the user.
|
|
248
246
|
*/
|
|
249
|
-
|
|
250
|
-
/** Iterable over all
|
|
247
|
+
registerUser(user: TileUser): void;
|
|
248
|
+
/** Iterable over all TileUsers registered with TileAdmin. This may include [[OffScreenViewports]].
|
|
251
249
|
* @alpha
|
|
252
250
|
*/
|
|
253
|
-
get
|
|
251
|
+
get tileUsers(): Iterable<TileUser>;
|
|
254
252
|
/** @internal */
|
|
255
253
|
invalidateAllScenes(): void;
|
|
256
254
|
/** @internal */
|
|
257
255
|
onShutDown(): void;
|
|
258
|
-
/** Returns the union of the input set and the input
|
|
256
|
+
/** Returns the union of the input set and the input TileUser, to be associated with a [[TileRequest]].
|
|
259
257
|
* @internal
|
|
260
258
|
*/
|
|
261
|
-
|
|
262
|
-
/** Marks the Tile as "in use" by the specified
|
|
263
|
-
* A tile will not be discarded while it is in use by any
|
|
259
|
+
getTileUserSetForRequest(user: TileUser, users?: ReadonlyTileUserSet): ReadonlyTileUserSet;
|
|
260
|
+
/** Marks the Tile as "in use" by the specified TileUser, where the tile defines what "in use" means.
|
|
261
|
+
* A tile will not be discarded while it is in use by any TileUser.
|
|
264
262
|
* @see [[TileTree.prune]]
|
|
265
263
|
* @internal
|
|
266
264
|
*/
|
|
267
|
-
|
|
268
|
-
/** Returns true if the Tile is currently in use by any
|
|
269
|
-
* @see [[
|
|
265
|
+
markTileUsed(marker: TileUsageMarker, user: TileUser): void;
|
|
266
|
+
/** Returns true if the Tile is currently in use by any TileUser.
|
|
267
|
+
* @see [[markTileUsed]].
|
|
270
268
|
* @internal
|
|
271
269
|
*/
|
|
272
270
|
isTileInUse(marker: TileUsageMarker): boolean;
|
|
273
|
-
/** Indicates that the TileAdmin should reset usage tracking for the specified
|
|
274
|
-
* to recreate its scene. Any tiles currently marked as "in use" by this
|
|
271
|
+
/** Indicates that the TileAdmin should reset usage tracking for the specified TileUser, e.g. because the user is a Viewport about
|
|
272
|
+
* to recreate its scene. Any tiles currently marked as "in use" by this user no longer will be.
|
|
275
273
|
* @internal
|
|
276
274
|
*/
|
|
277
|
-
|
|
275
|
+
clearUsageForUser(user: TileUser): void;
|
|
278
276
|
/** @internal */
|
|
279
277
|
requestTileTreeProps(iModel: IModelConnection, treeId: string): Promise<IModelTileTreeProps>;
|
|
280
278
|
/** Temporary workaround for authoring applications. Usage:
|
|
@@ -345,7 +343,7 @@ export declare class TileAdmin {
|
|
|
345
343
|
freeMemory(): void;
|
|
346
344
|
private pruneAndPurge;
|
|
347
345
|
private processRequests;
|
|
348
|
-
private
|
|
346
|
+
private onUserIModelClosed;
|
|
349
347
|
private onIModelClosed;
|
|
350
348
|
private initializeRpc;
|
|
351
349
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileAdmin.d.ts","sourceRoot":"","sources":["../../../src/tile/TileAdmin.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACG,UAAU,EAAE,OAAO,EAA8B,SAAS,EACnE,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAC8D,2BAA2B,EAC9F,mBAAmB,EAAgF,eAAe,EACnH,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"TileAdmin.d.ts","sourceRoot":"","sources":["../../../src/tile/TileAdmin.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACG,UAAU,EAAE,OAAO,EAA8B,SAAS,EACnE,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAC8D,2BAA2B,EAC9F,mBAAmB,EAAgF,eAAe,EACnH,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACiB,cAAc,EAAe,mBAAmB,EAAE,IAAI,EAA+B,mBAAmB,EAC9H,aAAa,EAAE,eAAe,EAAE,QAAQ,EACzC,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,qBAAq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C;QAEzC;;;;;WAKG;QACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;QAEjC;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;IAED;;;;OAIG;IACI,MAAM,wBAAwB;;;;KAIpC,CAAC;IAEF;;;;OAIG;IACI,MAAM,qBAAqB;;;;KAIjC,CAAC;CACH;AAED;;;;;;;;;GASG;AACH,cAAM,oBAAoB;aAIN,MAAM,EAAE,gBAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,aAAa,CAAS;gBAGZ,MAAM,EAAE,gBAAgB,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,EAC9C,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAGlD,IAAW,YAAY,IAAI,OAAO,CAA+B;IAE1D,QAAQ,IAAI,IAAI;IAevB;;OAEG;IACI,OAAO,IAAI,IAAI;IAOtB,OAAO,CAAC,SAAS;CAGlB;AAED,gBAAgB;AAChB,oBAAY,wBAAwB,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAWlH;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,wBAAwB,GAAG,SAAS,GAAG,IAAI,CAE7F"}
|
|
@@ -13,7 +13,7 @@ const core_common_1 = require("@itwin/core-common");
|
|
|
13
13
|
const IModelApp_1 = require("../IModelApp");
|
|
14
14
|
const IpcApp_1 = require("../IpcApp");
|
|
15
15
|
const IModelConnection_1 = require("../IModelConnection");
|
|
16
|
-
const
|
|
16
|
+
const Viewport_1 = require("../Viewport");
|
|
17
17
|
const internal_1 = require("./internal");
|
|
18
18
|
/** Manages [[Tile]]s and [[TileTree]]s on behalf of [[IModelApp]]. Its responsibilities include scheduling requests for tile content via a priority queue;
|
|
19
19
|
* keeping track of and imposing limits upon the amount of GPU memory consumed by tiles; and notifying listeners of tile-related events.
|
|
@@ -27,11 +27,11 @@ class TileAdmin {
|
|
|
27
27
|
*/
|
|
28
28
|
constructor(isMobile, rpcConcurrency, options) {
|
|
29
29
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
30
|
+
this._users = new Set();
|
|
31
|
+
this._requestsPerUser = new Map();
|
|
32
|
+
this._tileUsagePerUser = new Map();
|
|
33
33
|
this._selectedAndReady = new Map();
|
|
34
|
-
this.
|
|
34
|
+
this._tileUserSetsForRequests = new internal_1.UniqueTileUserSets();
|
|
35
35
|
this._totalElided = 0;
|
|
36
36
|
this._rpcInitialized = false;
|
|
37
37
|
this._tileTreePropsRequests = [];
|
|
@@ -101,7 +101,10 @@ class TileAdmin {
|
|
|
101
101
|
// If unspecified skip one level before preloading of parents of context tiles.
|
|
102
102
|
this.contextPreloadParentSkip = Math.max(0, Math.min((options.contextPreloadParentSkip === undefined ? 1 : options.contextPreloadParentSkip), 5));
|
|
103
103
|
this._cleanup = this.addLoadListener(() => {
|
|
104
|
-
this.
|
|
104
|
+
this._users.forEach((user) => {
|
|
105
|
+
if (user instanceof Viewport_1.Viewport)
|
|
106
|
+
user.invalidateScene();
|
|
107
|
+
});
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
110
|
/** Create a TileAdmin suitable for passing to [[IModelApp.startup]] via [[IModelAppOptions.tileAdmin]] to customize aspects of
|
|
@@ -115,7 +118,7 @@ class TileAdmin {
|
|
|
115
118
|
return new TileAdmin(isMobile, rpcConcurrency, props);
|
|
116
119
|
}
|
|
117
120
|
/** @internal */
|
|
118
|
-
get
|
|
121
|
+
get emptyTileUserSet() { return internal_1.UniqueTileUserSets.emptySet; }
|
|
119
122
|
/** Returns basic statistics about the TileAdmin's current state. */
|
|
120
123
|
get statistics() {
|
|
121
124
|
let numActiveTileTreePropsRequests = 0;
|
|
@@ -221,13 +224,13 @@ class TileAdmin {
|
|
|
221
224
|
// Free up any additional memory as required to keep within our limit.
|
|
222
225
|
this.freeMemory();
|
|
223
226
|
}
|
|
224
|
-
/** Iterate over the tiles that have content loaded but are not
|
|
227
|
+
/** Iterate over the tiles that have content loaded but are not in use by any [[TileUser]].
|
|
225
228
|
* @alpha
|
|
226
229
|
*/
|
|
227
230
|
get unselectedLoadedTiles() {
|
|
228
231
|
return this._lruList.unselectedTiles;
|
|
229
232
|
}
|
|
230
|
-
/** Iterate over the tiles that have content loaded and are
|
|
233
|
+
/** Iterate over the tiles that have content loaded and are in use by any [[TileUser]].
|
|
231
234
|
* @alpha
|
|
232
235
|
*/
|
|
233
236
|
get selectedLoadedTiles() {
|
|
@@ -235,48 +238,52 @@ class TileAdmin {
|
|
|
235
238
|
}
|
|
236
239
|
/** Returns the number of pending and active requests associated with the specified viewport. */
|
|
237
240
|
getNumRequestsForViewport(vp) {
|
|
241
|
+
return this.getNumRequestsForUser(vp);
|
|
242
|
+
}
|
|
243
|
+
/** Returns the number of pending and active requests associated with the specified user. */
|
|
244
|
+
getNumRequestsForUser(user) {
|
|
238
245
|
var _a;
|
|
239
|
-
const requests = this.
|
|
246
|
+
const requests = this.getRequestsForUser(user);
|
|
240
247
|
let count = (_a = requests === null || requests === void 0 ? void 0 : requests.size) !== null && _a !== void 0 ? _a : 0;
|
|
241
|
-
const tiles = this.
|
|
248
|
+
const tiles = this.getTilesForUser(user);
|
|
242
249
|
if (tiles)
|
|
243
250
|
count += tiles.external.requested;
|
|
244
251
|
return count;
|
|
245
252
|
}
|
|
246
|
-
/** Returns the current set of Tiles requested by the specified
|
|
253
|
+
/** Returns the current set of Tiles requested by the specified TileUser.
|
|
247
254
|
* Do not modify the set or the Tiles.
|
|
248
255
|
* @internal
|
|
249
256
|
*/
|
|
250
|
-
|
|
251
|
-
return this.
|
|
257
|
+
getRequestsForUser(user) {
|
|
258
|
+
return this._requestsPerUser.get(user);
|
|
252
259
|
}
|
|
253
|
-
/** Specifies the set of tiles currently requested for use by a
|
|
260
|
+
/** Specifies the set of tiles currently requested for use by a TileUser. This set replaces any previously specified for the same user.
|
|
254
261
|
* The requests are not actually processed until the next call to [[TileAdmin.process].
|
|
255
|
-
* This is typically invoked when
|
|
262
|
+
* This is typically invoked when a viewport recreates its scene, e.g. in response to camera movement.
|
|
256
263
|
* @internal
|
|
257
264
|
*/
|
|
258
|
-
requestTiles(
|
|
259
|
-
this.
|
|
265
|
+
requestTiles(user, tiles) {
|
|
266
|
+
this._requestsPerUser.set(user, tiles);
|
|
260
267
|
}
|
|
261
|
-
/** Returns two sets of tiles associated with the specified
|
|
268
|
+
/** Returns two sets of tiles associated with the specified user - typically, a viewport's current scene.
|
|
262
269
|
* Do not modify the returned sets.
|
|
263
270
|
* @internal
|
|
264
271
|
*/
|
|
265
|
-
|
|
266
|
-
return this._selectedAndReady.get(
|
|
272
|
+
getTilesForUser(user) {
|
|
273
|
+
return this._selectedAndReady.get(user);
|
|
267
274
|
}
|
|
268
|
-
/** Adds the specified tiles to the sets of selected and ready tiles for the specified
|
|
275
|
+
/** Adds the specified tiles to the sets of selected and ready tiles for the specified TileUser.
|
|
269
276
|
* The TileAdmin takes ownership of the `ready` set - do not modify it after passing it in.
|
|
270
277
|
* @internal
|
|
271
278
|
*/
|
|
272
|
-
|
|
279
|
+
addTilesForUser(user, selected, ready) {
|
|
273
280
|
// "selected" are tiles we are drawing.
|
|
274
|
-
this._lruList.
|
|
281
|
+
this._lruList.markUsed(user.tileUserId, selected);
|
|
275
282
|
// "ready" are tiles we want to draw but can't yet because, for example, their siblings are not yet ready to be drawn.
|
|
276
|
-
this._lruList.
|
|
277
|
-
const entry = this.
|
|
283
|
+
this._lruList.markUsed(user.tileUserId, ready);
|
|
284
|
+
const entry = this.getTilesForUser(user);
|
|
278
285
|
if (undefined === entry) {
|
|
279
|
-
this._selectedAndReady.set(
|
|
286
|
+
this._selectedAndReady.set(user, { ready, selected: new Set(selected), external: { selected: 0, requested: 0, ready: 0 } });
|
|
280
287
|
return;
|
|
281
288
|
}
|
|
282
289
|
for (const tile of selected)
|
|
@@ -285,51 +292,49 @@ class TileAdmin {
|
|
|
285
292
|
entry.ready.add(tile);
|
|
286
293
|
}
|
|
287
294
|
/** Disclose statistics about tiles that are handled externally from TileAdmin. At this time, that means OrbitGT point cloud tiles.
|
|
288
|
-
* These statistics are included in the return value of [[
|
|
295
|
+
* These statistics are included in the return value of [[getTilesForUser]].
|
|
289
296
|
* @internal
|
|
290
297
|
*/
|
|
291
|
-
|
|
292
|
-
const entry = this.
|
|
298
|
+
addExternalTilesForUser(user, statistics) {
|
|
299
|
+
const entry = this.getTilesForUser(user);
|
|
293
300
|
if (!entry) {
|
|
294
|
-
this._selectedAndReady.set(
|
|
301
|
+
this._selectedAndReady.set(user, { ready: new Set(), selected: new Set(), external: { ...statistics } });
|
|
295
302
|
return;
|
|
296
303
|
}
|
|
297
304
|
entry.external.requested += statistics.requested;
|
|
298
305
|
entry.external.selected += statistics.selected;
|
|
299
306
|
entry.external.ready += statistics.ready;
|
|
300
307
|
}
|
|
301
|
-
/** Clears the sets of tiles associated with a
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
this._selectedAndReady.delete(vp);
|
|
306
|
-
this._lruList.clearSelectedForViewport(vp.viewportId);
|
|
308
|
+
/** Clears the sets of tiles associated with a TileUser. */
|
|
309
|
+
clearTilesForUser(user) {
|
|
310
|
+
this._selectedAndReady.delete(user);
|
|
311
|
+
this._lruList.clearUsed(user.tileUserId);
|
|
307
312
|
}
|
|
308
|
-
/** Indicates that the TileAdmin should cease tracking the specified
|
|
309
|
-
* Any requests which are of interest only to the specified
|
|
310
|
-
* @internal
|
|
313
|
+
/** Indicates that the TileAdmin should cease tracking the specified TileUser, e.g. because it is about to be destroyed.
|
|
314
|
+
* Any requests which are of interest only to the specified user will be canceled.
|
|
311
315
|
*/
|
|
312
|
-
|
|
313
|
-
this.
|
|
314
|
-
this.
|
|
316
|
+
forgetUser(user) {
|
|
317
|
+
this.onUserIModelClosed(user);
|
|
318
|
+
this._users.delete(user);
|
|
315
319
|
}
|
|
316
|
-
/** Indicates that the TileAdmin should track tile requests for the specified
|
|
317
|
-
* This is invoked by the Viewport constructor and should
|
|
318
|
-
*
|
|
320
|
+
/** Indicates that the TileAdmin should track tile requests for the specified TileUser.
|
|
321
|
+
* This is invoked by the Viewport constructor and should be invoked manually for any non-Viewport TileUser.
|
|
322
|
+
* [[forgetUser]] must be later invoked to unregister the user.
|
|
319
323
|
*/
|
|
320
|
-
|
|
321
|
-
this.
|
|
324
|
+
registerUser(user) {
|
|
325
|
+
this._users.add(user);
|
|
322
326
|
}
|
|
323
|
-
/** Iterable over all
|
|
327
|
+
/** Iterable over all TileUsers registered with TileAdmin. This may include [[OffScreenViewports]].
|
|
324
328
|
* @alpha
|
|
325
329
|
*/
|
|
326
|
-
get
|
|
327
|
-
return this.
|
|
330
|
+
get tileUsers() {
|
|
331
|
+
return this._users;
|
|
328
332
|
}
|
|
329
333
|
/** @internal */
|
|
330
334
|
invalidateAllScenes() {
|
|
331
|
-
for (const
|
|
332
|
-
|
|
335
|
+
for (const user of this.tileUsers)
|
|
336
|
+
if (user instanceof Viewport_1.Viewport)
|
|
337
|
+
user.invalidateScene();
|
|
333
338
|
}
|
|
334
339
|
/** @internal */
|
|
335
340
|
onShutDown() {
|
|
@@ -341,46 +346,46 @@ class TileAdmin {
|
|
|
341
346
|
this.channels.onShutDown();
|
|
342
347
|
for (const req of this._tileTreePropsRequests)
|
|
343
348
|
req.abandon();
|
|
344
|
-
this.
|
|
345
|
-
this.
|
|
346
|
-
this.
|
|
349
|
+
this._requestsPerUser.clear();
|
|
350
|
+
this._tileUserSetsForRequests.clear();
|
|
351
|
+
this._tileUsagePerUser.clear();
|
|
347
352
|
this._tileTreePropsRequests.length = 0;
|
|
348
353
|
this._lruList.dispose();
|
|
349
354
|
}
|
|
350
|
-
/** Returns the union of the input set and the input
|
|
355
|
+
/** Returns the union of the input set and the input TileUser, to be associated with a [[TileRequest]].
|
|
351
356
|
* @internal
|
|
352
357
|
*/
|
|
353
|
-
|
|
354
|
-
return this.
|
|
358
|
+
getTileUserSetForRequest(user, users) {
|
|
359
|
+
return this._tileUserSetsForRequests.getTileUserSet(user, users);
|
|
355
360
|
}
|
|
356
|
-
/** Marks the Tile as "in use" by the specified
|
|
357
|
-
* A tile will not be discarded while it is in use by any
|
|
361
|
+
/** Marks the Tile as "in use" by the specified TileUser, where the tile defines what "in use" means.
|
|
362
|
+
* A tile will not be discarded while it is in use by any TileUser.
|
|
358
363
|
* @see [[TileTree.prune]]
|
|
359
364
|
* @internal
|
|
360
365
|
*/
|
|
361
|
-
|
|
362
|
-
let set = this.
|
|
366
|
+
markTileUsed(marker, user) {
|
|
367
|
+
let set = this._tileUsagePerUser.get(user);
|
|
363
368
|
if (!set)
|
|
364
|
-
this.
|
|
369
|
+
this._tileUsagePerUser.set(user, set = new Set());
|
|
365
370
|
set.add(marker);
|
|
366
371
|
}
|
|
367
|
-
/** Returns true if the Tile is currently in use by any
|
|
368
|
-
* @see [[
|
|
372
|
+
/** Returns true if the Tile is currently in use by any TileUser.
|
|
373
|
+
* @see [[markTileUsed]].
|
|
369
374
|
* @internal
|
|
370
375
|
*/
|
|
371
376
|
isTileInUse(marker) {
|
|
372
377
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
373
|
-
for (const [
|
|
378
|
+
for (const [_user, markers] of this._tileUsagePerUser)
|
|
374
379
|
if (markers.has(marker))
|
|
375
380
|
return true;
|
|
376
381
|
return false;
|
|
377
382
|
}
|
|
378
|
-
/** Indicates that the TileAdmin should reset usage tracking for the specified
|
|
379
|
-
* to recreate its scene. Any tiles currently marked as "in use" by this
|
|
383
|
+
/** Indicates that the TileAdmin should reset usage tracking for the specified TileUser, e.g. because the user is a Viewport about
|
|
384
|
+
* to recreate its scene. Any tiles currently marked as "in use" by this user no longer will be.
|
|
380
385
|
* @internal
|
|
381
386
|
*/
|
|
382
|
-
|
|
383
|
-
this.
|
|
387
|
+
clearUsageForUser(user) {
|
|
388
|
+
this._tileUsagePerUser.delete(user);
|
|
384
389
|
}
|
|
385
390
|
/** @internal */
|
|
386
391
|
async requestTileTreeProps(iModel, treeId) {
|
|
@@ -503,12 +508,12 @@ class TileAdmin {
|
|
|
503
508
|
this._tileTreePropsRequests[i].dispatch();
|
|
504
509
|
}
|
|
505
510
|
processQueue() {
|
|
506
|
-
// Mark all requests as being associated with no
|
|
507
|
-
this.
|
|
511
|
+
// Mark all requests as being associated with no users, indicating they are no longer needed.
|
|
512
|
+
this._tileUserSetsForRequests.clearAll();
|
|
508
513
|
// Notify channels that we are enqueuing new requests.
|
|
509
514
|
this.channels.swapPending();
|
|
510
|
-
// Repopulate pending requests queue from each
|
|
511
|
-
this.
|
|
515
|
+
// Repopulate pending requests queue from each user. We do NOT sort by priority while doing so.
|
|
516
|
+
this._requestsPerUser.forEach((value, key) => this.processRequests(key, value));
|
|
512
517
|
// Ask channels to update their queues and dispatch requests.
|
|
513
518
|
this.channels.process();
|
|
514
519
|
}
|
|
@@ -523,18 +528,18 @@ class TileAdmin {
|
|
|
523
528
|
const needPurge = this._nextPurgeTime.before(now);
|
|
524
529
|
if (!needPrune && !needPurge)
|
|
525
530
|
return;
|
|
526
|
-
// Identify all of the TileTrees
|
|
527
|
-
// A single viewport can display tiles from more than one IModelConnection.
|
|
531
|
+
// Identify all of the TileTrees in use by all of the TileUsers known to the TileAdmin.
|
|
532
|
+
// NOTE: A single viewport can display tiles from more than one IModelConnection.
|
|
528
533
|
// NOTE: A viewport may be displaying no trees - but we need to record its IModel so we can purge those which are NOT being displayed
|
|
529
534
|
// NOTE: That won't catch external tile trees previously used by that viewport.
|
|
530
535
|
const trees = new internal_1.DisclosedTileTreeSet();
|
|
531
536
|
const treesByIModel = needPurge ? new Map() : undefined;
|
|
532
|
-
for (const
|
|
533
|
-
if (!
|
|
537
|
+
for (const user of this._users) {
|
|
538
|
+
if (!user.iModel.isOpen) // case of closing an IModelConnection while keeping the Viewport open, possibly for reuse with a different IModelConnection.
|
|
534
539
|
continue;
|
|
535
|
-
|
|
536
|
-
if (treesByIModel && undefined === treesByIModel.get(
|
|
537
|
-
treesByIModel.set(
|
|
540
|
+
user.discloseTileTrees(trees);
|
|
541
|
+
if (treesByIModel && undefined === treesByIModel.get(user.iModel))
|
|
542
|
+
treesByIModel.set(user.iModel, new Set());
|
|
538
543
|
}
|
|
539
544
|
if (needPrune) {
|
|
540
545
|
// Request that each displayed tile tree discard any tiles and/or tile content that is no longer needed.
|
|
@@ -549,21 +554,21 @@ class TileAdmin {
|
|
|
549
554
|
treesByIModel.set(tree.iModel, set = new Set());
|
|
550
555
|
set.add(tree);
|
|
551
556
|
}
|
|
552
|
-
// Discard any tile trees that are no longer in use by any
|
|
557
|
+
// Discard any tile trees that are no longer in use by any user.
|
|
553
558
|
const olderThan = now.minus(this.tileTreeExpirationTime);
|
|
554
559
|
for (const entry of treesByIModel)
|
|
555
560
|
entry[0].tiles.purge(olderThan, entry[1]);
|
|
556
561
|
this._nextPurgeTime = now.plus(this.tileTreeExpirationTime);
|
|
557
562
|
}
|
|
558
563
|
}
|
|
559
|
-
processRequests(
|
|
564
|
+
processRequests(user, tiles) {
|
|
560
565
|
for (const tile of tiles) {
|
|
561
566
|
if (undefined === tile.request) {
|
|
562
567
|
// ###TODO: This assertion triggers for AttachmentViewports used for rendering 3d sheet attachments.
|
|
563
568
|
// Determine why and fix.
|
|
564
569
|
// assert(tile.loadStatus === Tile.LoadStatus.NotLoaded);
|
|
565
570
|
if (internal_1.TileLoadStatus.NotLoaded === tile.loadStatus) {
|
|
566
|
-
const request = new internal_1.TileRequest(tile,
|
|
571
|
+
const request = new internal_1.TileRequest(tile, user);
|
|
567
572
|
tile.request = request;
|
|
568
573
|
(0, core_bentley_1.assert)(this.channels.has(request.channel));
|
|
569
574
|
request.channel.append(request);
|
|
@@ -574,33 +579,33 @@ class TileAdmin {
|
|
|
574
579
|
(0, core_bentley_1.assert)(undefined !== req);
|
|
575
580
|
if (undefined !== req) {
|
|
576
581
|
// Request may already be dispatched (in channel's active requests) - if so do not re-enqueue!
|
|
577
|
-
if (req.isQueued && 0 === req.
|
|
582
|
+
if (req.isQueued && 0 === req.users.length)
|
|
578
583
|
req.channel.append(req);
|
|
579
|
-
req.
|
|
580
|
-
(0, core_bentley_1.assert)(0 < req.
|
|
584
|
+
req.addUser(user);
|
|
585
|
+
(0, core_bentley_1.assert)(0 < req.users.length);
|
|
581
586
|
}
|
|
582
587
|
}
|
|
583
588
|
}
|
|
584
589
|
}
|
|
585
|
-
// NB: This does *not* remove from this.
|
|
586
|
-
|
|
587
|
-
this.
|
|
588
|
-
this.
|
|
589
|
-
// NB:
|
|
590
|
-
const tiles = this.
|
|
590
|
+
// NB: This does *not* remove from this._users - a viewport could later be reused with a different IModelConnection.
|
|
591
|
+
onUserIModelClosed(user) {
|
|
592
|
+
this.clearUsageForUser(user);
|
|
593
|
+
this.clearTilesForUser(user);
|
|
594
|
+
// NB: user will be removed from TileUserSets in process() - but if we can establish that only this user wants a given tile, cancel its request immediately.
|
|
595
|
+
const tiles = this._requestsPerUser.get(user);
|
|
591
596
|
if (undefined !== tiles) {
|
|
592
597
|
for (const tile of tiles) {
|
|
593
598
|
const request = tile.request;
|
|
594
|
-
if (undefined !== request && 1 === request.
|
|
599
|
+
if (undefined !== request && 1 === request.users.length)
|
|
595
600
|
request.cancel();
|
|
596
601
|
}
|
|
597
|
-
this.
|
|
602
|
+
this._requestsPerUser.delete(user);
|
|
598
603
|
}
|
|
599
604
|
}
|
|
600
605
|
onIModelClosed(iModel) {
|
|
601
|
-
this.
|
|
602
|
-
if (
|
|
603
|
-
this.
|
|
606
|
+
this._requestsPerUser.forEach((_req, user) => {
|
|
607
|
+
if (user.iModel === iModel)
|
|
608
|
+
this.onUserIModelClosed(user);
|
|
604
609
|
});
|
|
605
610
|
// Remove any TileTreeProps requests associated with this iModel.
|
|
606
611
|
this._tileTreePropsRequests = this._tileTreePropsRequests.filter((req) => {
|