@itwin/frontend-tiles 4.1.0-dev.2 → 4.1.0-dev.21
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/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/package-deps_build.json +5 -5
- package/CHANGELOG.json +36 -0
- package/CHANGELOG.md +22 -1
- package/lib/cjs/BatchedTile.d.ts +1 -1
- package/lib/cjs/BatchedTile.d.ts.map +1 -1
- package/lib/cjs/BatchedTile.js +12 -32
- package/lib/cjs/BatchedTile.js.map +1 -1
- package/lib/cjs/BatchedTileTree.d.ts +3 -1
- package/lib/cjs/BatchedTileTree.d.ts.map +1 -1
- package/lib/cjs/BatchedTileTree.js +13 -0
- package/lib/cjs/BatchedTileTree.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/BatchedTile.d.ts +1 -1
- package/lib/esm/BatchedTile.d.ts.map +1 -1
- package/lib/esm/BatchedTile.js +13 -33
- package/lib/esm/BatchedTile.js.map +1 -1
- package/lib/esm/BatchedTileTree.d.ts +3 -1
- package/lib/esm/BatchedTileTree.d.ts.map +1 -1
- package/lib/esm/BatchedTileTree.js +15 -2
- package/lib/esm/BatchedTileTree.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/BatchedTile.ts +12 -36
- package/src/BatchedTileTree.ts +18 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/frontend-tiles",
|
|
3
|
-
"version": "4.1.0-dev.
|
|
3
|
+
"version": "4.1.0-dev.21",
|
|
4
4
|
"description": "Experimental alternative technique for visualizing the contents of iModels",
|
|
5
5
|
"main": "lib/cjs/frontend-tiles.js",
|
|
6
6
|
"module": "lib/esm/frontend-tiles.js",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"url": "http://www.bentley.com"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@itwin/core-bentley": "4.1.0-dev.
|
|
27
|
-
"@itwin/core-
|
|
28
|
-
"@itwin/core-
|
|
29
|
-
"@itwin/core-geometry": "4.1.0-dev.
|
|
26
|
+
"@itwin/core-bentley": "4.1.0-dev.21",
|
|
27
|
+
"@itwin/core-frontend": "4.1.0-dev.21",
|
|
28
|
+
"@itwin/core-common": "4.1.0-dev.21",
|
|
29
|
+
"@itwin/core-geometry": "4.1.0-dev.21"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@itwin/eslint-plugin": "^4.0.0-dev.33",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"eslint": "^8.36.0",
|
|
35
35
|
"rimraf": "^3.0.2",
|
|
36
36
|
"typescript": "~5.0.2",
|
|
37
|
-
"@itwin/build-tools": "4.1.0-dev.
|
|
38
|
-
"@itwin/core-
|
|
39
|
-
"@itwin/core-
|
|
40
|
-
"@itwin/core-
|
|
41
|
-
"@itwin/core-
|
|
37
|
+
"@itwin/build-tools": "4.1.0-dev.21",
|
|
38
|
+
"@itwin/core-geometry": "4.1.0-dev.21",
|
|
39
|
+
"@itwin/core-bentley": "4.1.0-dev.21",
|
|
40
|
+
"@itwin/core-frontend": "4.1.0-dev.21",
|
|
41
|
+
"@itwin/core-common": "4.1.0-dev.21"
|
|
42
42
|
},
|
|
43
43
|
"eslintConfig": {
|
|
44
44
|
"plugins": [
|
package/src/BatchedTile.ts
CHANGED
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
import { assert, BeTimePoint, ByteStream, Logger } from "@itwin/core-bentley";
|
|
7
7
|
import { ColorDef, Tileset3dSchema } from "@itwin/core-common";
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
GraphicBuilder, IModelApp, RealityTileLoader, RenderSystem, Tile, TileBoundingBoxes, TileContent,
|
|
10
10
|
TileDrawArgs, TileParams, TileRequest, TileRequestChannel, TileTreeLoadStatus, TileUser, TileVisibility, Viewport,
|
|
11
11
|
} from "@itwin/core-frontend";
|
|
12
12
|
import { loggerCategory } from "./LoggerCategory";
|
|
13
13
|
import { BatchedTileTree } from "./BatchedTileTree";
|
|
14
|
-
import { BatchedTileContentReader } from "./BatchedTileContentReader";
|
|
15
14
|
import { getMaxLevelsToSkip } from "./FrontendTiles";
|
|
16
15
|
|
|
17
16
|
/** @internal */
|
|
@@ -128,45 +127,22 @@ export class BatchedTile extends Tile {
|
|
|
128
127
|
return response.arrayBuffer();
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
public override async readContent(data: TileRequest.ResponseData, system: RenderSystem,
|
|
130
|
+
public override async readContent(data: TileRequest.ResponseData, system: RenderSystem, isCanceled?: () => boolean): Promise<TileContent> {
|
|
132
131
|
assert(data instanceof Uint8Array);
|
|
133
132
|
if (!(data instanceof Uint8Array))
|
|
134
133
|
return { };
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
tileId: this.contentId,
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
if (!reader) {
|
|
151
|
-
const gltfProps = GltfReaderProps.create(data, false, this.batchedTree.reader.baseUrl);
|
|
152
|
-
if (gltfProps) {
|
|
153
|
-
reader = new BatchedTileContentReader({
|
|
154
|
-
props: gltfProps,
|
|
155
|
-
iModel: this.tree.iModel,
|
|
156
|
-
system,
|
|
157
|
-
shouldAbort,
|
|
158
|
-
vertexTableRequired: true,
|
|
159
|
-
modelId: this.tree.modelId,
|
|
160
|
-
isLeaf: this.isLeaf,
|
|
161
|
-
range: this.range,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
135
|
+
try {
|
|
136
|
+
return await this.batchedTree.decoder.decode({
|
|
137
|
+
stream: ByteStream.fromUint8Array(data),
|
|
138
|
+
options: { tileId: this.contentId },
|
|
139
|
+
system,
|
|
140
|
+
isCanceled,
|
|
141
|
+
isLeaf: this.isLeaf,
|
|
142
|
+
});
|
|
143
|
+
} catch {
|
|
144
|
+
return { isLeaf: true };
|
|
164
145
|
}
|
|
165
|
-
|
|
166
|
-
if (!reader)
|
|
167
|
-
return { };
|
|
168
|
-
|
|
169
|
-
return reader.read();
|
|
170
146
|
}
|
|
171
147
|
|
|
172
148
|
protected override addRangeGraphic(builder: GraphicBuilder, type: TileBoundingBoxes): void {
|
package/src/BatchedTileTree.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
import { BeTimePoint } from "@itwin/core-bentley";
|
|
7
|
-
import { RenderMode, RenderSchedule, ViewFlagOverrides } from "@itwin/core-common";
|
|
7
|
+
import { BatchType, RenderMode, RenderSchedule, ViewFlagOverrides } from "@itwin/core-common";
|
|
8
8
|
import {
|
|
9
|
-
Tile, TileDrawArgs, TileTree, TileTreeParams,
|
|
9
|
+
acquireImdlDecoder, ImdlDecoder, IModelApp, Tile, TileDrawArgs, TileTree, TileTreeParams,
|
|
10
10
|
} from "@itwin/core-frontend";
|
|
11
11
|
import { BatchedTile, BatchedTileParams } from "./BatchedTile";
|
|
12
12
|
import { BatchedTilesetReader } from "./BatchedTilesetReader";
|
|
@@ -28,12 +28,28 @@ export class BatchedTileTree extends TileTree {
|
|
|
28
28
|
private readonly _rootTile: BatchedTile;
|
|
29
29
|
public readonly reader: BatchedTilesetReader;
|
|
30
30
|
public readonly scheduleScript?: RenderSchedule.Script;
|
|
31
|
+
public readonly decoder: ImdlDecoder;
|
|
31
32
|
|
|
32
33
|
public constructor(params: BatchedTileTreeParams) {
|
|
33
34
|
super(params);
|
|
34
35
|
this._rootTile = new BatchedTile(params.rootTile, this);
|
|
35
36
|
this.reader = params.reader;
|
|
36
37
|
this.scheduleScript = params.script;
|
|
38
|
+
|
|
39
|
+
this.decoder = acquireImdlDecoder({
|
|
40
|
+
type: BatchType.Primary,
|
|
41
|
+
timeline: this.scheduleScript,
|
|
42
|
+
iModel: this.iModel,
|
|
43
|
+
batchModelId: this.modelId,
|
|
44
|
+
is3d: true,
|
|
45
|
+
containsTransformNodes: false,
|
|
46
|
+
noWorker: !IModelApp.tileAdmin.decodeImdlInWorker,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public override dispose(): void {
|
|
51
|
+
this.decoder.release();
|
|
52
|
+
super.dispose();
|
|
37
53
|
}
|
|
38
54
|
|
|
39
55
|
public override get rootTile(): BatchedTile {
|