@loaders.gl/tile-converter 4.0.0-alpha.6 → 4.0.0-alpha.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/bin/converter.js +1 -1
- package/dist/3d-tiles-attributes-worker.js +2 -2
- package/dist/3d-tiles-attributes-worker.js.map +3 -3
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/3d-tiles-converter.js +4 -3
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -8
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +2 -15
- package/dist/converter.min.js +75 -76
- package/dist/deps-installer/deps-installer.js +4 -4
- package/dist/dist.min.js +2529 -1884
- package/dist/es5/3d-tiles-attributes-worker.js +1 -1
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +0 -3
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +2 -10
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +5 -5
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +1 -1
- package/dist/es5/i3s-attributes-worker.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +4 -4
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +6 -7
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +49 -30
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +46 -16
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/load-3d-tiles.js +82 -0
- package/dist/es5/i3s-converter/helpers/load-3d-tiles.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/node-index-document.js +74 -45
- package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +111 -0
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/tileset-traversal.js +82 -0
- package/dist/es5/i3s-converter/helpers/tileset-traversal.js.map +1 -0
- package/dist/es5/i3s-converter/i3s-converter.js +545 -523
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/types.js +16 -0
- package/dist/es5/i3s-converter/types.js.map +1 -1
- package/dist/es5/i3s-server/README.md +19 -0
- package/dist/es5/i3s-server/app.js +10 -1
- package/dist/es5/i3s-server/app.js.map +1 -1
- package/dist/es5/i3s-server/controllers/slpk-controller.js +84 -0
- package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -0
- package/dist/es5/i3s-server/routes/slpk-router.js +71 -0
- package/dist/es5/i3s-server/routes/slpk-router.js.map +1 -0
- package/dist/es5/i3s-server/utils/create-scene-server.js +17 -0
- package/dist/es5/i3s-server/utils/create-scene-server.js.map +1 -0
- package/dist/es5/lib/utils/file-utils.js +1 -1
- package/dist/es5/lib/utils/file-utils.js.map +1 -1
- package/dist/es5/lib/utils/geometry-utils.js +15 -0
- package/dist/es5/lib/utils/geometry-utils.js.map +1 -0
- package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +0 -3
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +2 -8
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +5 -5
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/i3s-attributes-worker.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +4 -4
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js +6 -7
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +37 -18
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js +50 -16
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/load-3d-tiles.js +35 -0
- package/dist/esm/i3s-converter/helpers/load-3d-tiles.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/node-index-document.js +14 -1
- package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +48 -0
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/tileset-traversal.js +14 -0
- package/dist/esm/i3s-converter/helpers/tileset-traversal.js.map +1 -0
- package/dist/esm/i3s-converter/i3s-converter.js +134 -127
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-converter/types.js +10 -1
- package/dist/esm/i3s-converter/types.js.map +1 -1
- package/dist/esm/i3s-server/README.md +19 -0
- package/dist/esm/i3s-server/app.js +11 -1
- package/dist/esm/i3s-server/app.js.map +1 -1
- package/dist/esm/i3s-server/controllers/slpk-controller.js +36 -0
- package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -0
- package/dist/esm/i3s-server/routes/slpk-router.js +33 -0
- package/dist/esm/i3s-server/routes/slpk-router.js.map +1 -0
- package/dist/esm/i3s-server/utils/create-scene-server.js +16 -0
- package/dist/esm/i3s-server/utils/create-scene-server.js.map +1 -0
- package/dist/esm/lib/utils/file-utils.js +1 -1
- package/dist/esm/lib/utils/file-utils.js.map +1 -1
- package/dist/esm/lib/utils/geometry-utils.js +8 -0
- package/dist/esm/lib/utils/geometry-utils.js.map +1 -0
- package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/i3s-attributes-worker.d.ts +10 -2
- package/dist/i3s-attributes-worker.d.ts.map +1 -1
- package/dist/i3s-attributes-worker.js +2 -2
- package/dist/i3s-attributes-worker.js.map +3 -3
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +4 -2
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +4 -7
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts +3 -4
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/coordinate-converter.js +8 -9
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -4
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +84 -54
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts +22 -3
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/gltf-attributes.js +62 -22
- package/dist/i3s-converter/helpers/load-3d-tiles.d.ts +18 -0
- package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/load-3d-tiles.js +53 -0
- package/dist/i3s-converter/helpers/node-index-document.d.ts +8 -0
- package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/node-index-document.js +20 -2
- package/dist/i3s-converter/helpers/node-pages.js +1 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +23 -0
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +76 -0
- package/dist/i3s-converter/helpers/tileset-traversal.d.ts +25 -0
- package/dist/i3s-converter/helpers/tileset-traversal.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/tileset-traversal.js +29 -0
- package/dist/i3s-converter/i3s-converter.d.ts +40 -40
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +150 -125
- package/dist/i3s-converter/types.d.ts +18 -0
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/i3s-converter/types.js +15 -0
- package/dist/i3s-server/app.d.ts.map +1 -1
- package/dist/i3s-server/app.js +9 -1
- package/dist/i3s-server/controllers/slpk-controller.d.ts +3 -0
- package/dist/i3s-server/controllers/slpk-controller.d.ts.map +1 -0
- package/dist/i3s-server/controllers/slpk-controller.js +32 -0
- package/dist/i3s-server/routes/slpk-router.d.ts +3 -0
- package/dist/i3s-server/routes/slpk-router.d.ts.map +1 -0
- package/dist/i3s-server/routes/slpk-router.js +33 -0
- package/dist/i3s-server/utils/create-scene-server.d.ts +11 -0
- package/dist/i3s-server/utils/create-scene-server.d.ts.map +1 -0
- package/dist/i3s-server/utils/create-scene-server.js +14 -0
- package/dist/lib/utils/file-utils.d.ts.map +1 -1
- package/dist/lib/utils/file-utils.js +2 -1
- package/dist/lib/utils/geometry-utils.d.ts +9 -0
- package/dist/lib/utils/geometry-utils.d.ts.map +1 -0
- package/dist/lib/utils/geometry-utils.js +18 -0
- package/dist/lib/utils/lod-conversion-utils.d.ts +3 -2
- package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -1
- package/dist/lib/utils/lod-conversion-utils.js +1 -1
- package/package.json +15 -16
- package/src/3d-tiles-converter/3d-tiles-converter.ts +9 -8
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +2 -16
- package/src/deps-installer/deps-installer.ts +4 -4
- package/src/i3s-attributes-worker.ts +11 -2
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +15 -19
- package/src/i3s-converter/helpers/coordinate-converter.ts +11 -10
- package/src/i3s-converter/helpers/geometry-converter.ts +154 -95
- package/src/i3s-converter/helpers/gltf-attributes.ts +85 -25
- package/src/i3s-converter/helpers/load-3d-tiles.ts +68 -0
- package/src/i3s-converter/helpers/node-index-document.ts +22 -2
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +81 -0
- package/src/i3s-converter/helpers/tileset-traversal.ts +51 -0
- package/src/i3s-converter/i3s-converter.ts +229 -178
- package/src/i3s-converter/types.ts +20 -0
- package/src/i3s-server/README.md +19 -0
- package/src/i3s-server/app.js +8 -1
- package/src/i3s-server/controllers/slpk-controller.js +38 -0
- package/src/i3s-server/routes/slpk-router.js +33 -0
- package/src/i3s-server/utils/create-scene-server.js +15 -0
- package/src/lib/utils/file-utils.ts +2 -1
- package/src/lib/utils/geometry-utils.ts +14 -0
- package/src/lib/utils/lod-conversion-utils.ts +6 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Tiles3DLoaderOptions, Tiles3DTileContent, Tiles3DTileJSONPostprocessed, Tiles3DTilesetJSONPostprocessed } from '@loaders.gl/3d-tiles';
|
|
2
|
+
/**
|
|
3
|
+
* Load nested 3DTiles tileset. If the sourceTile is not nested tileset - do nothing
|
|
4
|
+
* @param sourceTileset - source root tileset JSON
|
|
5
|
+
* @param sourceTile - source tile JSON that is supposed to has link to nested tileset
|
|
6
|
+
* @param tilesetLoadOptions - load options for Tiles3DLoader
|
|
7
|
+
* @returns nothing
|
|
8
|
+
*/
|
|
9
|
+
export declare const loadNestedTileset: (sourceTileset: Tiles3DTilesetJSONPostprocessed | null, sourceTile: Tiles3DTileJSONPostprocessed, tilesetLoadOptions: Tiles3DLoaderOptions) => Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Load 3DTiles tile content, that includes glTF object
|
|
12
|
+
* @param sourceTileset - source root tileset JSON
|
|
13
|
+
* @param sourceTile - source tile JSON that has link to content data
|
|
14
|
+
* @param tilesetLoadOptions - load options for Tiles3DLoader
|
|
15
|
+
* @returns - 3DTiles tile content or null
|
|
16
|
+
*/
|
|
17
|
+
export declare const loadTile3DContent: (sourceTileset: Tiles3DTilesetJSONPostprocessed | null, sourceTile: Tiles3DTileJSONPostprocessed, tilesetLoadOptions: Tiles3DLoaderOptions) => Promise<Tiles3DTileContent | null>;
|
|
18
|
+
//# sourceMappingURL=load-3d-tiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-3d-tiles.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/load-3d-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,sBAAsB,CAAC;AAG9B;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kBACb,+BAA+B,GAAG,IAAI,cACzC,4BAA4B,sBACpB,oBAAoB,KACvC,QAAQ,IAAI,CAkBd,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kBACb,+BAA+B,GAAG,IAAI,cACzC,4BAA4B,sBACpB,oBAAoB,KACvC,QAAQ,kBAAkB,GAAG,IAAI,CAiBnC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadTile3DContent = exports.loadNestedTileset = void 0;
|
|
4
|
+
const core_1 = require("@loaders.gl/core");
|
|
5
|
+
/**
|
|
6
|
+
* Load nested 3DTiles tileset. If the sourceTile is not nested tileset - do nothing
|
|
7
|
+
* @param sourceTileset - source root tileset JSON
|
|
8
|
+
* @param sourceTile - source tile JSON that is supposed to has link to nested tileset
|
|
9
|
+
* @param tilesetLoadOptions - load options for Tiles3DLoader
|
|
10
|
+
* @returns nothing
|
|
11
|
+
*/
|
|
12
|
+
const loadNestedTileset = async (sourceTileset, sourceTile, tilesetLoadOptions) => {
|
|
13
|
+
const isTileset = sourceTile.type === 'json';
|
|
14
|
+
if (!sourceTileset || !sourceTile.contentUrl || !isTileset) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const loadOptions = {
|
|
18
|
+
...tilesetLoadOptions,
|
|
19
|
+
[sourceTileset.loader.id]: {
|
|
20
|
+
isTileset,
|
|
21
|
+
assetGltfUpAxis: (sourceTileset.asset && sourceTileset.asset.gltfUpAxis) || 'Y'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const tileContent = await (0, core_1.load)(sourceTile.contentUrl, sourceTileset.loader, loadOptions);
|
|
25
|
+
if (tileContent.root) {
|
|
26
|
+
sourceTile.children = [tileContent.root];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.loadNestedTileset = loadNestedTileset;
|
|
30
|
+
/**
|
|
31
|
+
* Load 3DTiles tile content, that includes glTF object
|
|
32
|
+
* @param sourceTileset - source root tileset JSON
|
|
33
|
+
* @param sourceTile - source tile JSON that has link to content data
|
|
34
|
+
* @param tilesetLoadOptions - load options for Tiles3DLoader
|
|
35
|
+
* @returns - 3DTiles tile content or null
|
|
36
|
+
*/
|
|
37
|
+
const loadTile3DContent = async (sourceTileset, sourceTile, tilesetLoadOptions) => {
|
|
38
|
+
const isTileset = sourceTile.type === 'json';
|
|
39
|
+
if (!sourceTileset || !sourceTile.contentUrl || isTileset) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const loadOptions = {
|
|
43
|
+
...tilesetLoadOptions,
|
|
44
|
+
[sourceTileset.loader.id]: {
|
|
45
|
+
...(tilesetLoadOptions[sourceTileset.loader.id] || {}),
|
|
46
|
+
isTileset,
|
|
47
|
+
assetGltfUpAxis: (sourceTileset.asset && sourceTileset.asset.gltfUpAxis) || 'Y'
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const tileContent = await (0, core_1.load)(sourceTile.contentUrl, sourceTileset.loader, loadOptions);
|
|
51
|
+
return tileContent;
|
|
52
|
+
};
|
|
53
|
+
exports.loadTile3DContent = loadTile3DContent;
|
|
@@ -18,6 +18,12 @@ export declare class NodeIndexDocument {
|
|
|
18
18
|
children: NodeIndexDocument[];
|
|
19
19
|
/** converter instance */
|
|
20
20
|
private converter;
|
|
21
|
+
/**
|
|
22
|
+
* Finalized property. It means that all child nodes are saved and their data
|
|
23
|
+
* is unloaded
|
|
24
|
+
*/
|
|
25
|
+
private _finalized;
|
|
26
|
+
get finalized(): boolean;
|
|
21
27
|
/**
|
|
22
28
|
* Constructor
|
|
23
29
|
* @param id - id of the node in node pages
|
|
@@ -41,6 +47,8 @@ export declare class NodeIndexDocument {
|
|
|
41
47
|
addNeighbors(): Promise<void>;
|
|
42
48
|
/** Save 3DNodeIndexDocument in file on disk */
|
|
43
49
|
save(): Promise<void>;
|
|
50
|
+
/** Finalize the node */
|
|
51
|
+
private finalize;
|
|
44
52
|
/**
|
|
45
53
|
* Write 3DNodeIndexDocument https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md
|
|
46
54
|
* @param node - Node3DIndexDocument object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-index-document.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/node-index-document.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAIzB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,cAAc;IACP,EAAE,EAAE,MAAM,CAAC;IAClB,uBAAuB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACxB,+BAA+B;IACxB,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAQ;IAC/C,eAAe;IACR,QAAQ,EAAE,iBAAiB,EAAE,CAAM;IAC1C,yBAAyB;IACzB,OAAO,CAAC,SAAS,CAAe;IAEhC;;;;OAIG;gBACS,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY;IAM/C;;;;OAIG;IACU,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS3E;;;OAGG;IACU,WAAW,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BxE;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"node-index-document.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/node-index-document.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAIzB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,cAAc;IACP,EAAE,EAAE,MAAM,CAAC;IAClB,uBAAuB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACxB,+BAA+B;IACxB,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAQ;IAC/C,eAAe;IACR,QAAQ,EAAE,iBAAiB,EAAE,CAAM;IAC1C,yBAAyB;IACzB,OAAO,CAAC,SAAS,CAAe;IAEhC;;;OAGG;IACH,OAAO,CAAC,UAAU,CAAkB;IACpC,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;OAIG;gBACS,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY;IAM/C;;;;OAIG;IACU,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS3E;;;OAGG;IACU,WAAW,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BxE;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAmC1C,+CAA+C;IAClC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMlC,wBAAwB;IACxB,OAAO,CAAC,QAAQ;IAOhB;;;OAGG;YACW,KAAK;IAyBnB;;;OAGG;YACW,IAAI;IAalB;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;;;;OAKG;WACU,cAAc,CACzB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,iBAAiB,CAAC;IAM7B;;;;;;;;;OASG;WACU,UAAU,CACrB,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,qBAAqB,EAChC,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,iBAAiB,CAAC;IAY7B;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,mBAAmB;IAqBzF;;;;;;;;;;OAUG;WACU,uBAAuB,CAClC,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,qBAAqB,GAC/B,OAAO,CAAC,mBAAmB,CAAC;CA4ChC"}
|
|
@@ -16,6 +16,9 @@ const node_1 = require("../json-templates/node");
|
|
|
16
16
|
* on disk: the data is written on disk in a file. The file can be rewritten when new childrend or neighbors have to be added
|
|
17
17
|
*/
|
|
18
18
|
class NodeIndexDocument {
|
|
19
|
+
get finalized() {
|
|
20
|
+
return this._finalized;
|
|
21
|
+
}
|
|
19
22
|
/**
|
|
20
23
|
* Constructor
|
|
21
24
|
* @param id - id of the node in node pages
|
|
@@ -26,6 +29,11 @@ class NodeIndexDocument {
|
|
|
26
29
|
this.data = null;
|
|
27
30
|
/** children */
|
|
28
31
|
this.children = [];
|
|
32
|
+
/**
|
|
33
|
+
* Finalized property. It means that all child nodes are saved and their data
|
|
34
|
+
* is unloaded
|
|
35
|
+
*/
|
|
36
|
+
this._finalized = false;
|
|
29
37
|
this.inPageId = id;
|
|
30
38
|
this.id = id === 0 ? 'root' : id.toString();
|
|
31
39
|
this.converter = converter;
|
|
@@ -76,6 +84,9 @@ class NodeIndexDocument {
|
|
|
76
84
|
* Add neighbors to child nodes of this node
|
|
77
85
|
*/
|
|
78
86
|
async addNeighbors() {
|
|
87
|
+
if (this.finalized) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
79
90
|
const nodeData = await this.load();
|
|
80
91
|
for (const childNode of this.children) {
|
|
81
92
|
const childNodeData = await childNode.load();
|
|
@@ -98,9 +109,9 @@ class NodeIndexDocument {
|
|
|
98
109
|
await childNode.write(childNodeData);
|
|
99
110
|
}
|
|
100
111
|
await childNode.save();
|
|
101
|
-
// The save after adding neighbors is the last one. Flush the the node
|
|
102
|
-
childNode.flush();
|
|
103
112
|
}
|
|
113
|
+
// The save after adding neighbors is the last one. Finalize the the node
|
|
114
|
+
this.finalize();
|
|
104
115
|
}
|
|
105
116
|
/** Save 3DNodeIndexDocument in file on disk */
|
|
106
117
|
async save() {
|
|
@@ -108,6 +119,13 @@ class NodeIndexDocument {
|
|
|
108
119
|
await this.write(this.data);
|
|
109
120
|
}
|
|
110
121
|
}
|
|
122
|
+
/** Finalize the node */
|
|
123
|
+
finalize() {
|
|
124
|
+
this._finalized = true;
|
|
125
|
+
for (const child of this.children) {
|
|
126
|
+
child.flush();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
111
129
|
/**
|
|
112
130
|
* Write 3DNodeIndexDocument https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md
|
|
113
131
|
* @param node - Node3DIndexDocument object
|
|
@@ -11,7 +11,7 @@ const file_utils_1 = require("../../lib/utils/file-utils");
|
|
|
11
11
|
* class NodePages - wrapper of nodePages array
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* import {writeFile} from './helpers/write-file
|
|
14
|
+
* import {writeFile} from './helpers/write-file';
|
|
15
15
|
*
|
|
16
16
|
* // create an instance of the class
|
|
17
17
|
* const nodePages = new NodePages(writeFile, HARDCODED_NODES_PER_PAGE);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tiles3DTileContent, Tiles3DTileJSONPostprocessed } from '@loaders.gl/3d-tiles';
|
|
2
|
+
import { GltfPrimitiveModeString, PreprocessData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* glTF primitive modes
|
|
5
|
+
* @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
|
|
6
|
+
*/
|
|
7
|
+
export declare const GLTF_PRIMITIVE_MODES: GltfPrimitiveModeString[];
|
|
8
|
+
/**
|
|
9
|
+
* Analyze tile content. This function is used during preprocess stage of
|
|
10
|
+
* conversion
|
|
11
|
+
* @param tile - 3DTiles tile JSON metadata
|
|
12
|
+
* @param tileContent - 3DTiles tile content ArrayBuffer
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const analyzeTileContent: (tile: Tiles3DTileJSONPostprocessed, tileContent: Tiles3DTileContent | null) => Promise<PreprocessData>;
|
|
16
|
+
/**
|
|
17
|
+
* Merge object2 into object1
|
|
18
|
+
* @param object1
|
|
19
|
+
* @param object2
|
|
20
|
+
* @returns nothing
|
|
21
|
+
*/
|
|
22
|
+
export declare const mergePreprocessData: (object1: PreprocessData, object2: PreprocessData) => void;
|
|
23
|
+
//# sourceMappingURL=preprocess-3d-tiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preprocess-3d-tiles.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/preprocess-3d-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,4BAA4B,EAAC,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAC,uBAAuB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAIjE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,2BAQhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SACvB,4BAA4B,eACrB,kBAAkB,GAAG,IAAI,KACrC,QAAQ,cAAc,CAmBxB,CAAC;AAqBF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YAAa,cAAc,WAAW,cAAc,KAAG,IAKtF,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergePreprocessData = exports.analyzeTileContent = exports.GLTF_PRIMITIVE_MODES = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const gltf_1 = require("@loaders.gl/gltf");
|
|
6
|
+
const core_1 = require("@loaders.gl/core");
|
|
7
|
+
/**
|
|
8
|
+
* glTF primitive modes
|
|
9
|
+
* @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
|
|
10
|
+
*/
|
|
11
|
+
exports.GLTF_PRIMITIVE_MODES = [
|
|
12
|
+
types_1.GltfPrimitiveModeString.POINTS,
|
|
13
|
+
types_1.GltfPrimitiveModeString.LINES,
|
|
14
|
+
types_1.GltfPrimitiveModeString.LINE_LOOP,
|
|
15
|
+
types_1.GltfPrimitiveModeString.LINE_STRIP,
|
|
16
|
+
types_1.GltfPrimitiveModeString.TRIANGLES,
|
|
17
|
+
types_1.GltfPrimitiveModeString.TRIANGLE_STRIP,
|
|
18
|
+
types_1.GltfPrimitiveModeString.TRIANGLE_FAN // 6
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Analyze tile content. This function is used during preprocess stage of
|
|
22
|
+
* conversion
|
|
23
|
+
* @param tile - 3DTiles tile JSON metadata
|
|
24
|
+
* @param tileContent - 3DTiles tile content ArrayBuffer
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
const analyzeTileContent = async (tile, tileContent) => {
|
|
28
|
+
const result = {
|
|
29
|
+
meshTopologyTypes: new Set()
|
|
30
|
+
};
|
|
31
|
+
if (!tileContent?.gltfArrayBuffer) {
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
const gltfData = await (0, core_1.parse)(tileContent.gltfArrayBuffer, gltf_1.GLTFLoader, {
|
|
35
|
+
gltf: { normalize: false, loadBuffers: false, loadImages: false, decompressMeshes: false }
|
|
36
|
+
});
|
|
37
|
+
const gltf = gltfData.json;
|
|
38
|
+
if (!gltf) {
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
const meshTypes = getMeshTypesFromGltf(gltf);
|
|
42
|
+
result.meshTopologyTypes = meshTypes;
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
exports.analyzeTileContent = analyzeTileContent;
|
|
46
|
+
/**
|
|
47
|
+
* Get mesh topology types that the glb content has
|
|
48
|
+
* @param gltfJson - JSON part of GLB content
|
|
49
|
+
* @returns array of mesh types found
|
|
50
|
+
*/
|
|
51
|
+
const getMeshTypesFromGltf = (gltfJson) => {
|
|
52
|
+
const result = new Set();
|
|
53
|
+
for (const mesh of gltfJson.meshes || []) {
|
|
54
|
+
for (const primitive of mesh.primitives) {
|
|
55
|
+
let { mode } = primitive;
|
|
56
|
+
if (typeof mode !== 'number') {
|
|
57
|
+
mode = 4; // Default is 4 - TRIANGLES
|
|
58
|
+
}
|
|
59
|
+
result.add(exports.GLTF_PRIMITIVE_MODES[mode]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Merge object2 into object1
|
|
66
|
+
* @param object1
|
|
67
|
+
* @param object2
|
|
68
|
+
* @returns nothing
|
|
69
|
+
*/
|
|
70
|
+
const mergePreprocessData = (object1, object2) => {
|
|
71
|
+
// Merge topology mesh types info
|
|
72
|
+
for (const type of object2.meshTopologyTypes) {
|
|
73
|
+
object1.meshTopologyTypes.add(type);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.mergePreprocessData = mergePreprocessData;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Tiles3DTileJSONPostprocessed } from '@loaders.gl/3d-tiles';
|
|
2
|
+
import { NodeIndexDocument } from './node-index-document';
|
|
3
|
+
import { Matrix4 } from '@math.gl/core';
|
|
4
|
+
/** Traversal props for the conversion stage */
|
|
5
|
+
export type TraversalConversionProps = {
|
|
6
|
+
/** Transformation matrix for the specific tile */
|
|
7
|
+
transform: Matrix4;
|
|
8
|
+
/** Parent nodes of the converted tile. Multiple nodes can be if one tile is converted to multiple nodes*/
|
|
9
|
+
parentNodes: NodeIndexDocument[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Travesal of 3DTile tiles tree with making specific actions with each tile
|
|
13
|
+
* @param tile - 3DTiles tile JSON metadata
|
|
14
|
+
* @param traversalProps - traversal props used to pass data through recursive calls
|
|
15
|
+
* @param processTile - callback to make some actions with the current tile
|
|
16
|
+
* @param postprocessTile - callback to make some action after processing of the current tile and all the subtree
|
|
17
|
+
* @param maxDepth - max recursive calls number the travesal function will do. If not set, the traversal function will
|
|
18
|
+
* go through all the tree.
|
|
19
|
+
* This value is used to limit the convertion with only partial number of levels of the tileset
|
|
20
|
+
* @param level - counter to keep recursive calls number of the tiles tree. This value used to be able to break
|
|
21
|
+
* traversal at the some level of the tree
|
|
22
|
+
* @returns void
|
|
23
|
+
*/
|
|
24
|
+
export declare const traverseDatasetWith: <TProps>(tile: Tiles3DTileJSONPostprocessed, traversalProps: TProps, processTile: (tile: Tiles3DTileJSONPostprocessed, traversalProps: TProps) => Promise<TProps>, postprocessTile?: ((processResults: TProps[], currentTraversalProps: TProps) => Promise<void>) | undefined, maxDepth?: number, level?: number) => Promise<void>;
|
|
25
|
+
//# sourceMappingURL=tileset-traversal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tileset-traversal.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/tileset-traversal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,4BAA4B,EAAC,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAEtC,+CAA+C;AAC/C,MAAM,MAAM,wBAAwB,GAAG;IACrC,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,0GAA0G;IAC1G,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,iBACxB,4BAA4B,8CAEd,4BAA4B,8HAC+B,QAAQ,IAAI,CAAC,0BACjF,MAAM,qBAEhB,QAAQ,IAAI,CAkBd,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.traverseDatasetWith = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Travesal of 3DTile tiles tree with making specific actions with each tile
|
|
6
|
+
* @param tile - 3DTiles tile JSON metadata
|
|
7
|
+
* @param traversalProps - traversal props used to pass data through recursive calls
|
|
8
|
+
* @param processTile - callback to make some actions with the current tile
|
|
9
|
+
* @param postprocessTile - callback to make some action after processing of the current tile and all the subtree
|
|
10
|
+
* @param maxDepth - max recursive calls number the travesal function will do. If not set, the traversal function will
|
|
11
|
+
* go through all the tree.
|
|
12
|
+
* This value is used to limit the convertion with only partial number of levels of the tileset
|
|
13
|
+
* @param level - counter to keep recursive calls number of the tiles tree. This value used to be able to break
|
|
14
|
+
* traversal at the some level of the tree
|
|
15
|
+
* @returns void
|
|
16
|
+
*/
|
|
17
|
+
const traverseDatasetWith = async (tile, traversalProps, processTile, postprocessTile, maxDepth, level = 0) => {
|
|
18
|
+
if (maxDepth && level > maxDepth) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const processResults = [];
|
|
22
|
+
const newTraversalProps = await processTile(tile, traversalProps);
|
|
23
|
+
processResults.push(newTraversalProps);
|
|
24
|
+
for (const childTile of tile.children) {
|
|
25
|
+
await (0, exports.traverseDatasetWith)(childTile, newTraversalProps, processTile, postprocessTile, maxDepth, level + 1);
|
|
26
|
+
}
|
|
27
|
+
postprocessTile && (await postprocessTile(processResults, traversalProps));
|
|
28
|
+
};
|
|
29
|
+
exports.traverseDatasetWith = traverseDatasetWith;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { Tiles3DLoaderOptions, Tiles3DTilesetJSONPostprocessed } from '@loaders.gl/3d-tiles';
|
|
1
2
|
import type { WriteQueueItem } from '../lib/utils/write-queue';
|
|
2
3
|
import type { SceneLayer3D } from '@loaders.gl/i3s';
|
|
3
|
-
import { Tileset3D } from '@loaders.gl/tiles';
|
|
4
4
|
import { Geoid } from '@math.gl/geoid';
|
|
5
5
|
import NodePages from './helpers/node-pages';
|
|
6
6
|
import { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
7
|
-
import { I3SMaterialDefinition } from '@loaders.gl/i3s
|
|
7
|
+
import { I3SMaterialDefinition } from '@loaders.gl/i3s';
|
|
8
|
+
import { PreprocessData } from './types';
|
|
8
9
|
import WriteQueue from '../lib/utils/write-queue';
|
|
9
10
|
/**
|
|
10
11
|
* Converter from 3d-tiles tileset to i3s layer
|
|
@@ -31,7 +32,8 @@ export default class I3SConverter {
|
|
|
31
32
|
boundingVolumeWarnings?: string[];
|
|
32
33
|
conversionStartTime: [number, number];
|
|
33
34
|
refreshTokenTime: [number, number];
|
|
34
|
-
sourceTileset:
|
|
35
|
+
sourceTileset: Tiles3DTilesetJSONPostprocessed | null;
|
|
36
|
+
loadOptions: Tiles3DLoaderOptions;
|
|
35
37
|
geoidHeightModel: Geoid | null;
|
|
36
38
|
Loader: LoaderWithParser;
|
|
37
39
|
generateTextures: boolean;
|
|
@@ -42,6 +44,7 @@ export default class I3SConverter {
|
|
|
42
44
|
};
|
|
43
45
|
writeQueue: WriteQueue<WriteQueueItem>;
|
|
44
46
|
compressList: string[] | null;
|
|
47
|
+
preprocessData: PreprocessData;
|
|
45
48
|
constructor();
|
|
46
49
|
/**
|
|
47
50
|
* Convert a 3d tileset
|
|
@@ -75,7 +78,20 @@ export default class I3SConverter {
|
|
|
75
78
|
generateTextures?: boolean;
|
|
76
79
|
generateBoundingVolumes?: boolean;
|
|
77
80
|
instantNodeWriting?: boolean;
|
|
78
|
-
}): Promise<
|
|
81
|
+
}): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Preprocess stage of the tile converter. Traverse all the tiles tree and
|
|
84
|
+
* check a tile content to be sure that the data is supported
|
|
85
|
+
* @returns true - the conversion is possible, false - the tileset's content is not supported
|
|
86
|
+
*/
|
|
87
|
+
private preprocessConversion;
|
|
88
|
+
/**
|
|
89
|
+
* Analyze a tile content. The callback for preprocess stage.
|
|
90
|
+
* @param sourceTile - 3DTiles tile JSON metadata
|
|
91
|
+
* @param traversalProps - mandatory argument but it is not used for the preprocess stage
|
|
92
|
+
* @returns - nothing
|
|
93
|
+
*/
|
|
94
|
+
private analyzeTile;
|
|
79
95
|
/**
|
|
80
96
|
* Convert and save the layer and embedded tiles
|
|
81
97
|
* @param outputPath - path to save output data
|
|
@@ -84,15 +100,11 @@ export default class I3SConverter {
|
|
|
84
100
|
private _createAndSaveTileset;
|
|
85
101
|
/**
|
|
86
102
|
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
87
|
-
* @param
|
|
103
|
+
* @param tilesetName - Name of layer
|
|
104
|
+
* @param sourceBoundingVolume - initialized bounding volume of the source root tile
|
|
105
|
+
* @param boundingVolumeRegion - region bounding volume of the source root tile
|
|
88
106
|
*/
|
|
89
107
|
private _formLayers0;
|
|
90
|
-
/**
|
|
91
|
-
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
92
|
-
* @param rootNode - 3DNodeIndexDocument of root node https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md
|
|
93
|
-
* @param sourceRootTile - Source (3DTile) tile data
|
|
94
|
-
*/
|
|
95
|
-
private _convertNodesTree;
|
|
96
108
|
/**
|
|
97
109
|
* Write 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md in file
|
|
98
110
|
*/
|
|
@@ -103,47 +115,35 @@ export default class I3SConverter {
|
|
|
103
115
|
*/
|
|
104
116
|
private _createSlpk;
|
|
105
117
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @
|
|
111
|
-
*/
|
|
112
|
-
private _addChildrenWithNeighborsAndWriteFile;
|
|
113
|
-
/**
|
|
114
|
-
* Convert nested subtree of 3DTiles dataset
|
|
115
|
-
* @param param0
|
|
116
|
-
* @param data.parentNode - 3DNodeIndexDocument of parent node
|
|
117
|
-
* @param param0.sourceTile - source 3DTile data
|
|
118
|
-
* @param param0.level - tree level
|
|
119
|
-
*/
|
|
120
|
-
private convertNestedTileset;
|
|
121
|
-
/**
|
|
122
|
-
* Convert 3DTiles tile to I3S node
|
|
123
|
-
* @param param0
|
|
124
|
-
* @param param0.parentNode - 3DNodeIndexDocument of parent node
|
|
125
|
-
* @param param0.sourceTile - source 3DTile data
|
|
126
|
-
* @param param0.level - tree level
|
|
118
|
+
* Convert the specific 3DTiles tile to I3S nodes.
|
|
119
|
+
* This is callback function for the traversal generic function
|
|
120
|
+
* @param sourceTile - current 3DTiles tile JSON metadata
|
|
121
|
+
* @param traversalProps - traversal properties calculated recursively
|
|
122
|
+
* @returns - traversal properties for the child tiles
|
|
127
123
|
*/
|
|
128
|
-
private
|
|
124
|
+
private convertTile;
|
|
129
125
|
/**
|
|
130
|
-
*
|
|
131
|
-
* @param
|
|
132
|
-
* @param
|
|
133
|
-
* @param param0.sourceTile - source 3DTile data
|
|
134
|
-
* @param param0.level - tree level
|
|
126
|
+
* Do final action with nodes after the current node and all child nodes been converted.
|
|
127
|
+
* @param conversionResults - array of conversion results of the current node
|
|
128
|
+
* @param currentTraversalProps - traversal properties of the current node
|
|
135
129
|
*/
|
|
136
|
-
private
|
|
130
|
+
private finalizeTile;
|
|
137
131
|
/**
|
|
138
132
|
* Convert tile to one or more I3S nodes
|
|
139
133
|
* @param parentNode - 3DNodeIndexDocument of parent node
|
|
140
134
|
* @param sourceTile - source 3DTile data
|
|
135
|
+
* @param transformationMatrix - transformation matrix of the current tile, calculated recursively multiplying
|
|
136
|
+
* transform of all parent tiles and transform of the current tile
|
|
141
137
|
* @param level - tree level
|
|
142
138
|
*/
|
|
143
139
|
private _createNode;
|
|
144
140
|
/**
|
|
145
141
|
* Convert tile to one or more I3S nodes
|
|
146
142
|
* @param sourceTile - source tile (3DTile)
|
|
143
|
+
* @param transformationMatrix - transformation matrix of the current tile, calculated recursively multiplying
|
|
144
|
+
* transform of all parent tiles and transform of the current tile
|
|
145
|
+
* @param boundingVolume - initialized bounding volume of the source tile
|
|
146
|
+
* @param tileContent - content of the source tile
|
|
147
147
|
* @param parentId - id of parent node in node pages
|
|
148
148
|
* @param propertyTable - batch table from b3dm / feature properties from EXT_FEATURE_METADATA
|
|
149
149
|
* @returns - converted node resources
|
|
@@ -258,7 +258,7 @@ export default class I3SConverter {
|
|
|
258
258
|
private _checkAddRefinementTypeForTile;
|
|
259
259
|
/**
|
|
260
260
|
* Check if the tile's content format is supported by the converter
|
|
261
|
-
* @param
|
|
261
|
+
* @param sourceTile
|
|
262
262
|
* @returns
|
|
263
263
|
*/
|
|
264
264
|
private isContentSupported;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"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"}
|