@loaders.gl/tile-converter 3.3.0-alpha.4 → 3.3.0-alpha.6
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/dist/3d-tiles-attributes-worker.d.ts +1 -1
- package/dist/3d-tiles-attributes-worker.js +2 -3
- package/dist/3d-tiles-attributes-worker.js.map +3 -3
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +5 -5
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +21 -17
- package/dist/converter.min.js +23 -20
- package/dist/dist.min.js +38223 -46900
- package/dist/es5/3d-tiles-attributes-worker.js +4 -7
- package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +12 -111
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +53 -85
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -8
- package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js +0 -5
- package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
- package/dist/es5/3d-tiles-converter/json-templates/tileset.js +0 -6
- package/dist/es5/3d-tiles-converter/json-templates/tileset.js.map +1 -1
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/converter-cli.js +2 -53
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +5 -35
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +3 -6
- package/dist/es5/i3s-attributes-worker.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +2 -28
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +2 -20
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/create-scene-server-path.js +0 -11
- package/dist/es5/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +5 -34
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +13 -45
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +26 -221
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +2 -16
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-debug.js +4 -23
- package/dist/es5/i3s-converter/helpers/node-debug.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-pages.js +50 -86
- package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +43 -360
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/layers.js +1 -15
- package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/metadata.js +0 -2
- package/dist/es5/i3s-converter/json-templates/metadata.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/node.js +2 -12
- package/dist/es5/i3s-converter/json-templates/node.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/scene-server.js +0 -2
- package/dist/es5/i3s-converter/json-templates/scene-server.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/shared-resources.js +6 -29
- package/dist/es5/i3s-converter/json-templates/shared-resources.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/store.js.map +1 -1
- package/dist/es5/i3s-converter/types.js.map +1 -1
- package/dist/es5/i3s-server/app.js +0 -5
- package/dist/es5/i3s-server/app.js.map +1 -1
- package/dist/es5/i3s-server/controllers/index-controller.js +0 -16
- package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
- package/dist/es5/i3s-server/routes/index.js +1 -10
- package/dist/es5/i3s-server/routes/index.js.map +1 -1
- package/dist/es5/index.js +0 -3
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/utils/compress-util.js +19 -74
- package/dist/es5/lib/utils/compress-util.js.map +1 -1
- package/dist/es5/lib/utils/file-utils.js +10 -38
- package/dist/es5/lib/utils/file-utils.js.map +1 -1
- package/dist/es5/lib/utils/lod-conversion-utils.js +0 -7
- package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/es5/lib/utils/queue.js +0 -14
- package/dist/es5/lib/utils/queue.js.map +1 -1
- package/dist/es5/lib/utils/statistic-utills.js +1 -46
- package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
- package/dist/es5/lib/utils/write-queue.js +0 -52
- package/dist/es5/lib/utils/write-queue.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -8
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/es5/workers/3d-tiles-attributes-worker.js +2 -9
- package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/es5/workers/i3s-attributes-worker.js +1 -9
- package/dist/es5/workers/i3s-attributes-worker.js.map +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +4 -2
- package/dist/esm/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +8 -40
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +29 -50
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +1 -0
- package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js +1 -4
- package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
- package/dist/esm/3d-tiles-converter/json-templates/tileset.js +0 -3
- package/dist/esm/3d-tiles-converter/json-templates/tileset.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/converter-cli.js +3 -38
- package/dist/esm/converter-cli.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +6 -7
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +3 -1
- package/dist/esm/i3s-attributes-worker.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +4 -23
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js +4 -6
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/create-scene-server-path.js +1 -0
- package/dist/esm/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/feature-attributes.js +6 -20
- package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +3 -22
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +28 -139
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js +7 -12
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/node-debug.js +3 -13
- package/dist/esm/i3s-converter/helpers/node-debug.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/node-pages.js +2 -21
- package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +49 -137
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-converter/json-templates/layers.js +1 -11
- package/dist/esm/i3s-converter/json-templates/layers.js.map +1 -1
- package/dist/esm/i3s-converter/json-templates/metadata.js.map +1 -1
- package/dist/esm/i3s-converter/json-templates/node.js +0 -4
- package/dist/esm/i3s-converter/json-templates/node.js.map +1 -1
- package/dist/esm/i3s-converter/json-templates/scene-server.js.map +1 -1
- package/dist/esm/i3s-converter/json-templates/shared-resources.js +0 -12
- package/dist/esm/i3s-converter/json-templates/shared-resources.js.map +1 -1
- package/dist/esm/i3s-converter/json-templates/store.js.map +1 -1
- package/dist/esm/i3s-converter/types.js.map +1 -1
- package/dist/esm/i3s-server/app.js +0 -5
- package/dist/esm/i3s-server/app.js.map +1 -1
- package/dist/esm/i3s-server/controllers/index-controller.js +0 -5
- package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -1
- package/dist/esm/i3s-server/routes/index.js +0 -3
- package/dist/esm/i3s-server/routes/index.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/utils/compress-util.js +19 -12
- package/dist/esm/lib/utils/compress-util.js.map +1 -1
- package/dist/esm/lib/utils/file-utils.js +10 -8
- package/dist/esm/lib/utils/file-utils.js.map +1 -1
- package/dist/esm/lib/utils/lod-conversion-utils.js +2 -6
- package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/esm/lib/utils/queue.js +0 -4
- package/dist/esm/lib/utils/queue.js.map +1 -1
- package/dist/esm/lib/utils/statistic-utills.js +0 -11
- package/dist/esm/lib/utils/statistic-utills.js.map +1 -1
- package/dist/esm/lib/utils/write-queue.js +5 -23
- package/dist/esm/lib/utils/write-queue.js.map +1 -1
- package/dist/esm/pgm-loader.js +3 -1
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/esm/workers/3d-tiles-attributes-worker.js +4 -1
- package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/esm/workers/i3s-attributes-worker.js +4 -1
- package/dist/esm/workers/i3s-attributes-worker.js.map +1 -1
- package/dist/i3s-attributes-worker.js +2 -3
- package/dist/i3s-attributes-worker.js.map +3 -3
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +2 -0
- package/dist/i3s-converter/i3s-converter.js +5 -1
- package/dist/pgm-loader.d.ts.map +1 -1
- package/dist/pgm-loader.js +2 -1
- package/dist/workers/3d-tiles-attributes-worker.js +1 -1
- package/package.json +15 -15
- package/src/3d-tiles-attributes-worker.ts +1 -1
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +25 -18
- package/src/i3s-converter/helpers/geometry-converter.ts +2 -0
- package/src/pgm-loader.ts +2 -2
- package/src/workers/3d-tiles-attributes-worker.ts +1 -1
|
@@ -1,103 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
-
|
|
16
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
|
|
22
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
-
|
|
24
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
16
|
var _core = require("@loaders.gl/core");
|
|
27
|
-
|
|
28
17
|
var _tiles = require("@loaders.gl/tiles");
|
|
29
|
-
|
|
30
18
|
var _dTiles = require("@loaders.gl/3d-tiles");
|
|
31
|
-
|
|
32
19
|
var _path = require("path");
|
|
33
|
-
|
|
34
20
|
var _uuid = require("uuid");
|
|
35
|
-
|
|
36
21
|
var _process = _interopRequireDefault(require("process"));
|
|
37
|
-
|
|
38
22
|
var _jsonMapTransform = _interopRequireDefault(require("json-map-transform"));
|
|
39
|
-
|
|
40
23
|
var _md = _interopRequireDefault(require("md5"));
|
|
41
|
-
|
|
42
24
|
var _nodePages = _interopRequireDefault(require("./helpers/node-pages"));
|
|
43
|
-
|
|
44
25
|
var _fileUtils = require("../lib/utils/file-utils");
|
|
45
|
-
|
|
46
26
|
var _compressUtil = require("../lib/utils/compress-util");
|
|
47
|
-
|
|
48
27
|
var _statisticUtills = require("../lib/utils/statistic-utills");
|
|
49
|
-
|
|
50
28
|
var _geometryConverter = _interopRequireWildcard(require("./helpers/geometry-converter"));
|
|
51
|
-
|
|
52
29
|
var _coordinateConverter = require("./helpers/coordinate-converter");
|
|
53
|
-
|
|
54
30
|
var _createSceneServerPath = require("./helpers/create-scene-server-path");
|
|
55
|
-
|
|
56
31
|
var _lodConversionUtils = require("../lib/utils/lod-conversion-utils");
|
|
57
|
-
|
|
58
32
|
var _pgmLoader = require("../pgm-loader");
|
|
59
|
-
|
|
60
33
|
var _layers = require("./json-templates/layers");
|
|
61
|
-
|
|
62
34
|
var _node = require("./json-templates/node");
|
|
63
|
-
|
|
64
35
|
var _sharedResources = require("./json-templates/shared-resources");
|
|
65
|
-
|
|
66
36
|
var _nodeDebug = require("./helpers/node-debug");
|
|
67
|
-
|
|
68
37
|
var _textures = require("@loaders.gl/textures");
|
|
69
|
-
|
|
70
38
|
var _images = require("@loaders.gl/images");
|
|
71
|
-
|
|
72
39
|
var _workerUtils = require("@loaders.gl/worker-utils");
|
|
73
|
-
|
|
74
40
|
var _draco = require("@loaders.gl/draco");
|
|
75
|
-
|
|
76
41
|
var _writeQueue = _interopRequireDefault(require("../lib/utils/write-queue"));
|
|
77
|
-
|
|
78
42
|
var _i3sAttributesWorker = require("../i3s-attributes-worker");
|
|
79
|
-
|
|
80
43
|
var _constants = require("../constants");
|
|
81
|
-
|
|
82
44
|
var _featureAttributes = require("./helpers/feature-attributes");
|
|
83
|
-
|
|
84
45
|
var _process$env;
|
|
85
|
-
|
|
86
46
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
87
|
-
|
|
88
47
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
89
|
-
|
|
90
48
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
91
|
-
|
|
92
49
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
93
|
-
|
|
94
50
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var ION_DEFAULT_TOKEN = ((_process$env = _process.default.env) === null || _process$env === void 0 ? void 0 : _process$env.IonToken) || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ';
|
|
51
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
52
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
53
|
+
var ION_DEFAULT_TOKEN = ((_process$env = _process.default.env) === null || _process$env === void 0 ? void 0 : _process$env.IonToken) ||
|
|
54
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ';
|
|
101
55
|
var HARDCODED_NODES_PER_PAGE = 64;
|
|
102
56
|
var _3D_TILES = '3DTILES';
|
|
103
57
|
var _3D_OBJECT_LAYER_TYPE = '3DObject';
|
|
@@ -159,10 +113,8 @@ var I3SConverter = function () {
|
|
|
159
113
|
_context.next = 3;
|
|
160
114
|
break;
|
|
161
115
|
}
|
|
162
|
-
|
|
163
116
|
console.log(_constants.BROWSER_ERROR_MESSAGE);
|
|
164
117
|
return _context.abrupt("return", _constants.BROWSER_ERROR_MESSAGE);
|
|
165
|
-
|
|
166
118
|
case 3:
|
|
167
119
|
this.conversionStartTime = _process.default.hrtime();
|
|
168
120
|
tilesetName = options.tilesetName, slpk = options.slpk, egmFilePath = options.egmFilePath, inputUrl = options.inputUrl, validate = options.validate, outputPath = options.outputPath, draco = options.draco, sevenZipExe = options.sevenZipExe, maxDepth = options.maxDepth, token = options.token, generateTextures = options.generateTextures, generateBoundingVolumes = options.generateBoundingVolumes;
|
|
@@ -184,7 +136,6 @@ var I3SConverter = function () {
|
|
|
184
136
|
console.log('Loading egm file...');
|
|
185
137
|
_context.next = 15;
|
|
186
138
|
return (0, _core.load)(egmFilePath, _pgmLoader.PGMLoader);
|
|
187
|
-
|
|
188
139
|
case 15:
|
|
189
140
|
this.geoidHeightModel = _context.sent;
|
|
190
141
|
console.log('Loading egm file completed!');
|
|
@@ -192,15 +143,12 @@ var I3SConverter = function () {
|
|
|
192
143
|
if (slpk) {
|
|
193
144
|
this.nodePages.useWriteFunction(_fileUtils.writeFileForSlpk);
|
|
194
145
|
}
|
|
195
|
-
|
|
196
146
|
_context.next = 20;
|
|
197
147
|
return this.loadWorkers();
|
|
198
|
-
|
|
199
148
|
case 20:
|
|
200
149
|
_context.prev = 20;
|
|
201
150
|
_context.next = 23;
|
|
202
151
|
return this._fetchPreloadOptions();
|
|
203
|
-
|
|
204
152
|
case 23:
|
|
205
153
|
preloadOptions = _context.sent;
|
|
206
154
|
tilesetOptions = {
|
|
@@ -219,23 +167,19 @@ var I3SConverter = function () {
|
|
|
219
167
|
}
|
|
220
168
|
}
|
|
221
169
|
};
|
|
222
|
-
|
|
223
170
|
if (preloadOptions.headers) {
|
|
224
171
|
tilesetOptions.loadOptions.fetch = {
|
|
225
172
|
headers: preloadOptions.headers
|
|
226
173
|
};
|
|
227
174
|
}
|
|
228
|
-
|
|
229
175
|
Object.assign(tilesetOptions, preloadOptions);
|
|
230
176
|
_context.next = 29;
|
|
231
177
|
return (0, _core.load)(inputUrl, this.Loader, tilesetOptions.loadOptions);
|
|
232
|
-
|
|
233
178
|
case 29:
|
|
234
179
|
sourceTilesetJson = _context.sent;
|
|
235
180
|
this.sourceTileset = new _tiles.Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
236
181
|
_context.next = 33;
|
|
237
182
|
return this._createAndSaveTileset(outputPath, tilesetName);
|
|
238
|
-
|
|
239
183
|
case 33:
|
|
240
184
|
_context.next = 35;
|
|
241
185
|
return this._finishConversion({
|
|
@@ -243,21 +187,17 @@ var I3SConverter = function () {
|
|
|
243
187
|
outputPath: outputPath,
|
|
244
188
|
tilesetName: tilesetName
|
|
245
189
|
});
|
|
246
|
-
|
|
247
190
|
case 35:
|
|
248
191
|
return _context.abrupt("return", sourceTilesetJson);
|
|
249
|
-
|
|
250
192
|
case 38:
|
|
251
193
|
_context.prev = 38;
|
|
252
194
|
_context.t0 = _context["catch"](20);
|
|
253
195
|
throw _context.t0;
|
|
254
|
-
|
|
255
196
|
case 41:
|
|
256
197
|
_context.prev = 41;
|
|
257
198
|
workerFarm = _workerUtils.WorkerFarm.getWorkerFarm({});
|
|
258
199
|
workerFarm.destroy();
|
|
259
200
|
return _context.finish(41);
|
|
260
|
-
|
|
261
201
|
case 45:
|
|
262
202
|
case "end":
|
|
263
203
|
return _context.stop();
|
|
@@ -265,11 +205,9 @@ var I3SConverter = function () {
|
|
|
265
205
|
}
|
|
266
206
|
}, _callee, this, [[20, 38, 41, 45]]);
|
|
267
207
|
}));
|
|
268
|
-
|
|
269
208
|
function convert(_x) {
|
|
270
209
|
return _convert.apply(this, arguments);
|
|
271
210
|
}
|
|
272
|
-
|
|
273
211
|
return convert;
|
|
274
212
|
}()
|
|
275
213
|
}, {
|
|
@@ -285,20 +223,15 @@ var I3SConverter = function () {
|
|
|
285
223
|
_context2.prev = 1;
|
|
286
224
|
_context2.next = 4;
|
|
287
225
|
return (0, _fileUtils.removeDir)(tilesetPath);
|
|
288
|
-
|
|
289
226
|
case 4:
|
|
290
227
|
_context2.next = 8;
|
|
291
228
|
break;
|
|
292
|
-
|
|
293
229
|
case 6:
|
|
294
230
|
_context2.prev = 6;
|
|
295
231
|
_context2.t0 = _context2["catch"](1);
|
|
296
|
-
|
|
297
232
|
case 8:
|
|
298
233
|
this.layers0Path = (0, _path.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
299
|
-
|
|
300
234
|
this._formLayers0(tilesetName);
|
|
301
|
-
|
|
302
235
|
this.materialDefinitions = [];
|
|
303
236
|
this.materialMap = new Map();
|
|
304
237
|
sourceRootTile = this.sourceTileset.root;
|
|
@@ -313,36 +246,28 @@ var I3SConverter = function () {
|
|
|
313
246
|
root0 = this._formRootNodeIndexDocument(boundingVolumes);
|
|
314
247
|
_context2.next = 19;
|
|
315
248
|
return this._convertNodesTree(root0, sourceRootTile, parentId, boundingVolumes);
|
|
316
|
-
|
|
317
249
|
case 19:
|
|
318
250
|
this.layers0.materialDefinitions = this.materialDefinitions;
|
|
319
|
-
|
|
320
251
|
if (this.layersHasTexture === false) {
|
|
321
252
|
this.layers0.store.defaultGeometrySchema.ordering = this.layers0.store.defaultGeometrySchema.ordering.filter(function (attribute) {
|
|
322
253
|
return attribute !== 'uv0';
|
|
323
254
|
});
|
|
324
255
|
}
|
|
325
|
-
|
|
326
256
|
_context2.next = 23;
|
|
327
257
|
return this._writeLayers0();
|
|
328
|
-
|
|
329
258
|
case 23:
|
|
330
259
|
(0, _createSceneServerPath.createSceneServerPath)(tilesetName, this.layers0, tilesetPath);
|
|
331
260
|
_context2.next = 26;
|
|
332
261
|
return this._writeNodeIndexDocument(root0, 'root', (0, _path.join)(this.layers0Path, 'nodes', 'root'));
|
|
333
|
-
|
|
334
262
|
case 26:
|
|
335
263
|
_context2.next = 28;
|
|
336
264
|
return this.nodePages.save(this.layers0Path, this.writeQueue, isCreateSlpk);
|
|
337
|
-
|
|
338
265
|
case 28:
|
|
339
266
|
_context2.next = 30;
|
|
340
267
|
return this.writeQueue.finalize();
|
|
341
|
-
|
|
342
268
|
case 30:
|
|
343
269
|
_context2.next = 32;
|
|
344
270
|
return this._createSlpk(tilesetPath);
|
|
345
|
-
|
|
346
271
|
case 32:
|
|
347
272
|
case "end":
|
|
348
273
|
return _context2.stop();
|
|
@@ -350,18 +275,16 @@ var I3SConverter = function () {
|
|
|
350
275
|
}
|
|
351
276
|
}, _callee2, this, [[1, 6]]);
|
|
352
277
|
}));
|
|
353
|
-
|
|
354
278
|
function _createAndSaveTileset(_x2, _x3) {
|
|
355
279
|
return _createAndSaveTileset2.apply(this, arguments);
|
|
356
280
|
}
|
|
357
|
-
|
|
358
281
|
return _createAndSaveTileset;
|
|
359
282
|
}()
|
|
360
283
|
}, {
|
|
361
284
|
key: "_formLayers0",
|
|
362
|
-
value:
|
|
285
|
+
value:
|
|
286
|
+
function _formLayers0(tilesetName) {
|
|
363
287
|
var _this$sourceTileset, _this$sourceTileset2, _this$sourceTileset2$;
|
|
364
|
-
|
|
365
288
|
var fullExtent = (0, _coordinateConverter.convertBoundingVolumeToI3SFullExtent)(((_this$sourceTileset = this.sourceTileset) === null || _this$sourceTileset === void 0 ? void 0 : _this$sourceTileset.boundingVolume) || ((_this$sourceTileset2 = this.sourceTileset) === null || _this$sourceTileset2 === void 0 ? void 0 : (_this$sourceTileset2$ = _this$sourceTileset2.root) === null || _this$sourceTileset2$ === void 0 ? void 0 : _this$sourceTileset2$.boundingVolume));
|
|
366
289
|
var extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
367
290
|
var layers0data = {
|
|
@@ -381,9 +304,11 @@ var I3SConverter = function () {
|
|
|
381
304
|
};
|
|
382
305
|
this.layers0 = (0, _jsonMapTransform.default)(layers0data, (0, _layers.LAYERS)());
|
|
383
306
|
}
|
|
307
|
+
|
|
384
308
|
}, {
|
|
385
309
|
key: "_formRootNodeIndexDocument",
|
|
386
|
-
value:
|
|
310
|
+
value:
|
|
311
|
+
function _formRootNodeIndexDocument(boundingVolumes) {
|
|
387
312
|
var root0data = _objectSpread(_objectSpread({
|
|
388
313
|
version: "{".concat((0, _uuid.v4)().toUpperCase(), "}"),
|
|
389
314
|
id: 'root',
|
|
@@ -398,28 +323,25 @@ var I3SConverter = function () {
|
|
|
398
323
|
}, boundingVolumes), {}, {
|
|
399
324
|
children: []
|
|
400
325
|
});
|
|
401
|
-
|
|
402
326
|
return (0, _jsonMapTransform.default)(root0data, (0, _node.NODE)());
|
|
403
327
|
}
|
|
328
|
+
|
|
404
329
|
}, {
|
|
405
330
|
key: "_convertNodesTree",
|
|
406
331
|
value: function () {
|
|
407
332
|
var _convertNodesTree2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(root0, sourceRootTile, parentId, boundingVolumes) {
|
|
408
333
|
var _yield$this$_createNo, _yield$this$_createNo2, child, childPath;
|
|
409
|
-
|
|
410
334
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
411
335
|
while (1) {
|
|
412
336
|
switch (_context3.prev = _context3.next) {
|
|
413
337
|
case 0:
|
|
414
338
|
_context3.next = 2;
|
|
415
339
|
return this.sourceTileset._loadTile(sourceRootTile);
|
|
416
|
-
|
|
417
340
|
case 2:
|
|
418
341
|
if (!this.isContentSupported(sourceRootTile)) {
|
|
419
342
|
_context3.next = 20;
|
|
420
343
|
break;
|
|
421
344
|
}
|
|
422
|
-
|
|
423
345
|
root0.children = root0.children || [];
|
|
424
346
|
root0.children.push(_objectSpread({
|
|
425
347
|
id: '1',
|
|
@@ -427,38 +349,31 @@ var I3SConverter = function () {
|
|
|
427
349
|
}, boundingVolumes));
|
|
428
350
|
_context3.next = 7;
|
|
429
351
|
return this._createNode(root0, sourceRootTile, parentId, 0);
|
|
430
|
-
|
|
431
352
|
case 7:
|
|
432
353
|
_yield$this$_createNo = _context3.sent;
|
|
433
354
|
_yield$this$_createNo2 = (0, _slicedToArray2.default)(_yield$this$_createNo, 1);
|
|
434
355
|
child = _yield$this$_createNo2[0];
|
|
435
356
|
childPath = (0, _path.join)(this.layers0Path, 'nodes', child.path);
|
|
436
|
-
|
|
437
357
|
if (!this.options.slpk) {
|
|
438
358
|
_context3.next = 16;
|
|
439
359
|
break;
|
|
440
360
|
}
|
|
441
|
-
|
|
442
361
|
_context3.next = 14;
|
|
443
362
|
return this.writeQueue.enqueue({
|
|
444
363
|
archiveKey: 'nodes/1/3dNodeIndexDocument.json.gz',
|
|
445
364
|
writePromise: (0, _fileUtils.writeFileForSlpk)(childPath, JSON.stringify(child), '3dNodeIndexDocument.json')
|
|
446
365
|
});
|
|
447
|
-
|
|
448
366
|
case 14:
|
|
449
367
|
_context3.next = 18;
|
|
450
368
|
break;
|
|
451
|
-
|
|
452
369
|
case 16:
|
|
453
370
|
_context3.next = 18;
|
|
454
371
|
return this.writeQueue.enqueue({
|
|
455
372
|
writePromise: (0, _fileUtils.writeFile)(childPath, JSON.stringify(child))
|
|
456
373
|
});
|
|
457
|
-
|
|
458
374
|
case 18:
|
|
459
375
|
_context3.next = 22;
|
|
460
376
|
break;
|
|
461
|
-
|
|
462
377
|
case 20:
|
|
463
378
|
_context3.next = 22;
|
|
464
379
|
return this._addChildrenWithNeighborsAndWriteFile({
|
|
@@ -467,11 +382,9 @@ var I3SConverter = function () {
|
|
|
467
382
|
parentId: parentId,
|
|
468
383
|
level: 1
|
|
469
384
|
});
|
|
470
|
-
|
|
471
385
|
case 22:
|
|
472
386
|
_context3.next = 24;
|
|
473
387
|
return sourceRootTile.unloadContent();
|
|
474
|
-
|
|
475
388
|
case 24:
|
|
476
389
|
case "end":
|
|
477
390
|
return _context3.stop();
|
|
@@ -479,11 +392,9 @@ var I3SConverter = function () {
|
|
|
479
392
|
}
|
|
480
393
|
}, _callee3, this);
|
|
481
394
|
}));
|
|
482
|
-
|
|
483
395
|
function _convertNodesTree(_x4, _x5, _x6, _x7) {
|
|
484
396
|
return _convertNodesTree2.apply(this, arguments);
|
|
485
397
|
}
|
|
486
|
-
|
|
487
398
|
return _convertNodesTree;
|
|
488
399
|
}()
|
|
489
400
|
}, {
|
|
@@ -498,23 +409,19 @@ var I3SConverter = function () {
|
|
|
498
409
|
_context4.next = 5;
|
|
499
410
|
break;
|
|
500
411
|
}
|
|
501
|
-
|
|
502
412
|
_context4.next = 3;
|
|
503
413
|
return this.writeQueue.enqueue({
|
|
504
414
|
archiveKey: '3dSceneLayer.json.gz',
|
|
505
415
|
writePromise: (0, _fileUtils.writeFileForSlpk)(this.layers0Path, JSON.stringify(this.layers0), '3dSceneLayer.json')
|
|
506
416
|
});
|
|
507
|
-
|
|
508
417
|
case 3:
|
|
509
418
|
_context4.next = 7;
|
|
510
419
|
break;
|
|
511
|
-
|
|
512
420
|
case 5:
|
|
513
421
|
_context4.next = 7;
|
|
514
422
|
return this.writeQueue.enqueue({
|
|
515
423
|
writePromise: (0, _fileUtils.writeFile)(this.layers0Path, JSON.stringify(this.layers0))
|
|
516
424
|
});
|
|
517
|
-
|
|
518
425
|
case 7:
|
|
519
426
|
case "end":
|
|
520
427
|
return _context4.stop();
|
|
@@ -522,11 +429,9 @@ var I3SConverter = function () {
|
|
|
522
429
|
}
|
|
523
430
|
}, _callee4, this);
|
|
524
431
|
}));
|
|
525
|
-
|
|
526
432
|
function _writeLayers0() {
|
|
527
433
|
return _writeLayers.apply(this, arguments);
|
|
528
434
|
}
|
|
529
|
-
|
|
530
435
|
return _writeLayers0;
|
|
531
436
|
}()
|
|
532
437
|
}, {
|
|
@@ -541,23 +446,19 @@ var I3SConverter = function () {
|
|
|
541
446
|
_context5.next = 5;
|
|
542
447
|
break;
|
|
543
448
|
}
|
|
544
|
-
|
|
545
449
|
_context5.next = 3;
|
|
546
450
|
return this.writeQueue.enqueue({
|
|
547
451
|
archiveKey: "nodes/".concat(nodePath, "/3dNodeIndexDocument.json.gz"),
|
|
548
452
|
writePromise: (0, _fileUtils.writeFileForSlpk)(rootPath, JSON.stringify(root0), '3dNodeIndexDocument.json')
|
|
549
453
|
});
|
|
550
|
-
|
|
551
454
|
case 3:
|
|
552
455
|
_context5.next = 7;
|
|
553
456
|
break;
|
|
554
|
-
|
|
555
457
|
case 5:
|
|
556
458
|
_context5.next = 7;
|
|
557
459
|
return this.writeQueue.enqueue({
|
|
558
460
|
writePromise: (0, _fileUtils.writeFile)(rootPath, JSON.stringify(root0))
|
|
559
461
|
});
|
|
560
|
-
|
|
561
462
|
case 7:
|
|
562
463
|
case "end":
|
|
563
464
|
return _context5.stop();
|
|
@@ -565,11 +466,9 @@ var I3SConverter = function () {
|
|
|
565
466
|
}
|
|
566
467
|
}, _callee5, this);
|
|
567
468
|
}));
|
|
568
|
-
|
|
569
469
|
function _writeNodeIndexDocument(_x8, _x9, _x10) {
|
|
570
470
|
return _writeNodeIndexDocument2.apply(this, arguments);
|
|
571
471
|
}
|
|
572
|
-
|
|
573
472
|
return _writeNodeIndexDocument;
|
|
574
473
|
}()
|
|
575
474
|
}, {
|
|
@@ -585,25 +484,20 @@ var I3SConverter = function () {
|
|
|
585
484
|
_context6.next = 12;
|
|
586
485
|
break;
|
|
587
486
|
}
|
|
588
|
-
|
|
589
487
|
slpkTilesetPath = (0, _path.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
590
488
|
slpkFileName = "".concat(tilesetPath, ".slpk");
|
|
591
489
|
_context6.next = 5;
|
|
592
490
|
return (0, _compressUtil.compressWithChildProcess)(slpkTilesetPath, slpkFileName, 0, '.', this.options.sevenZipExe);
|
|
593
|
-
|
|
594
491
|
case 5:
|
|
595
492
|
_context6.prev = 5;
|
|
596
493
|
_context6.next = 8;
|
|
597
494
|
return (0, _fileUtils.removeDir)(tilesetPath);
|
|
598
|
-
|
|
599
495
|
case 8:
|
|
600
496
|
_context6.next = 12;
|
|
601
497
|
break;
|
|
602
|
-
|
|
603
498
|
case 10:
|
|
604
499
|
_context6.prev = 10;
|
|
605
500
|
_context6.t0 = _context6["catch"](5);
|
|
606
|
-
|
|
607
501
|
case 12:
|
|
608
502
|
case "end":
|
|
609
503
|
return _context6.stop();
|
|
@@ -611,11 +505,9 @@ var I3SConverter = function () {
|
|
|
611
505
|
}
|
|
612
506
|
}, _callee6, this, [[5, 10]]);
|
|
613
507
|
}));
|
|
614
|
-
|
|
615
508
|
function _createSlpk(_x11) {
|
|
616
509
|
return _createSlpk2.apply(this, arguments);
|
|
617
510
|
}
|
|
618
|
-
|
|
619
511
|
return _createSlpk;
|
|
620
512
|
}()
|
|
621
513
|
}, {
|
|
@@ -632,11 +524,9 @@ var I3SConverter = function () {
|
|
|
632
524
|
return this._addChildren(_objectSpread(_objectSpread({}, data), {}, {
|
|
633
525
|
childNodes: childNodes
|
|
634
526
|
}));
|
|
635
|
-
|
|
636
527
|
case 3:
|
|
637
528
|
_context7.next = 5;
|
|
638
529
|
return this._addNeighborsAndWriteFile(data.parentNode, childNodes);
|
|
639
|
-
|
|
640
530
|
case 5:
|
|
641
531
|
case "end":
|
|
642
532
|
return _context7.stop();
|
|
@@ -644,11 +534,9 @@ var I3SConverter = function () {
|
|
|
644
534
|
}
|
|
645
535
|
}, _callee7, this);
|
|
646
536
|
}));
|
|
647
|
-
|
|
648
537
|
function _addChildrenWithNeighborsAndWriteFile(_x12) {
|
|
649
538
|
return _addChildrenWithNeighborsAndWriteFile2.apply(this, arguments);
|
|
650
539
|
}
|
|
651
|
-
|
|
652
540
|
return _addChildrenWithNeighborsAndWriteFile;
|
|
653
541
|
}()
|
|
654
542
|
}, {
|
|
@@ -663,7 +551,6 @@ var I3SConverter = function () {
|
|
|
663
551
|
sourceTile = _ref.sourceTile, parentNode = _ref.parentNode, childNodes = _ref.childNodes, parentId = _ref.parentId, level = _ref.level;
|
|
664
552
|
_context8.next = 3;
|
|
665
553
|
return this.sourceTileset._loadTile(sourceTile);
|
|
666
|
-
|
|
667
554
|
case 3:
|
|
668
555
|
_context8.next = 5;
|
|
669
556
|
return this._addChildren({
|
|
@@ -673,11 +560,9 @@ var I3SConverter = function () {
|
|
|
673
560
|
parentId: parentId,
|
|
674
561
|
level: level + 1
|
|
675
562
|
});
|
|
676
|
-
|
|
677
563
|
case 5:
|
|
678
564
|
_context8.next = 7;
|
|
679
565
|
return sourceTile.unloadContent();
|
|
680
|
-
|
|
681
566
|
case 7:
|
|
682
567
|
case "end":
|
|
683
568
|
return _context8.stop();
|
|
@@ -685,11 +570,9 @@ var I3SConverter = function () {
|
|
|
685
570
|
}
|
|
686
571
|
}, _callee8, this);
|
|
687
572
|
}));
|
|
688
|
-
|
|
689
573
|
function convertNestedTileset(_x13) {
|
|
690
574
|
return _convertNestedTileset.apply(this, arguments);
|
|
691
575
|
}
|
|
692
|
-
|
|
693
576
|
return convertNestedTileset;
|
|
694
577
|
}()
|
|
695
578
|
}, {
|
|
@@ -697,7 +580,6 @@ var I3SConverter = function () {
|
|
|
697
580
|
value: function () {
|
|
698
581
|
var _convertNode = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(_ref2) {
|
|
699
582
|
var sourceTile, parentNode, childNodes, parentId, level, children, _iterator, _step, child;
|
|
700
|
-
|
|
701
583
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
702
584
|
while (1) {
|
|
703
585
|
switch (_context9.prev = _context9.next) {
|
|
@@ -705,12 +587,10 @@ var I3SConverter = function () {
|
|
|
705
587
|
sourceTile = _ref2.sourceTile, parentNode = _ref2.parentNode, childNodes = _ref2.childNodes, parentId = _ref2.parentId, level = _ref2.level;
|
|
706
588
|
_context9.next = 3;
|
|
707
589
|
return this._createNode(parentNode, sourceTile, parentId, level);
|
|
708
|
-
|
|
709
590
|
case 3:
|
|
710
591
|
children = _context9.sent;
|
|
711
592
|
parentNode.children = parentNode.children || [];
|
|
712
593
|
_iterator = _createForOfIteratorHelper(children);
|
|
713
|
-
|
|
714
594
|
try {
|
|
715
595
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
716
596
|
child = _step.value;
|
|
@@ -727,7 +607,6 @@ var I3SConverter = function () {
|
|
|
727
607
|
} finally {
|
|
728
608
|
_iterator.f();
|
|
729
609
|
}
|
|
730
|
-
|
|
731
610
|
case 7:
|
|
732
611
|
case "end":
|
|
733
612
|
return _context9.stop();
|
|
@@ -735,11 +614,9 @@ var I3SConverter = function () {
|
|
|
735
614
|
}
|
|
736
615
|
}, _callee9, this);
|
|
737
616
|
}));
|
|
738
|
-
|
|
739
617
|
function convertNode(_x14) {
|
|
740
618
|
return _convertNode.apply(this, arguments);
|
|
741
619
|
}
|
|
742
|
-
|
|
743
620
|
return convertNode;
|
|
744
621
|
}()
|
|
745
622
|
}, {
|
|
@@ -747,35 +624,27 @@ var I3SConverter = function () {
|
|
|
747
624
|
value: function () {
|
|
748
625
|
var _addChildren2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee10(data) {
|
|
749
626
|
var childNodes, sourceTiles, parentNode, parentId, level, promises, _iterator2, _step2, sourceTile;
|
|
750
|
-
|
|
751
627
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
752
628
|
while (1) {
|
|
753
629
|
switch (_context10.prev = _context10.next) {
|
|
754
630
|
case 0:
|
|
755
631
|
childNodes = data.childNodes, sourceTiles = data.sourceTiles, parentNode = data.parentNode, parentId = data.parentId, level = data.level;
|
|
756
|
-
|
|
757
632
|
if (!(this.options.maxDepth && level > this.options.maxDepth)) {
|
|
758
633
|
_context10.next = 3;
|
|
759
634
|
break;
|
|
760
635
|
}
|
|
761
|
-
|
|
762
636
|
return _context10.abrupt("return");
|
|
763
|
-
|
|
764
637
|
case 3:
|
|
765
638
|
promises = [];
|
|
766
639
|
_iterator2 = _createForOfIteratorHelper(sourceTiles);
|
|
767
640
|
_context10.prev = 5;
|
|
768
|
-
|
|
769
641
|
_iterator2.s();
|
|
770
|
-
|
|
771
642
|
case 7:
|
|
772
643
|
if ((_step2 = _iterator2.n()).done) {
|
|
773
644
|
_context10.next = 15;
|
|
774
645
|
break;
|
|
775
646
|
}
|
|
776
|
-
|
|
777
647
|
sourceTile = _step2.value;
|
|
778
|
-
|
|
779
648
|
if (sourceTile.type === 'json') {
|
|
780
649
|
promises.push(this.convertNestedTileset({
|
|
781
650
|
sourceTile: sourceTile,
|
|
@@ -793,36 +662,26 @@ var I3SConverter = function () {
|
|
|
793
662
|
level: level
|
|
794
663
|
}));
|
|
795
664
|
}
|
|
796
|
-
|
|
797
665
|
_context10.next = 12;
|
|
798
666
|
return Promise.all(promises);
|
|
799
|
-
|
|
800
667
|
case 12:
|
|
801
668
|
if (sourceTile.id) {
|
|
802
669
|
console.log(sourceTile.id);
|
|
803
670
|
}
|
|
804
|
-
|
|
805
671
|
case 13:
|
|
806
672
|
_context10.next = 7;
|
|
807
673
|
break;
|
|
808
|
-
|
|
809
674
|
case 15:
|
|
810
675
|
_context10.next = 20;
|
|
811
676
|
break;
|
|
812
|
-
|
|
813
677
|
case 17:
|
|
814
678
|
_context10.prev = 17;
|
|
815
679
|
_context10.t0 = _context10["catch"](5);
|
|
816
|
-
|
|
817
680
|
_iterator2.e(_context10.t0);
|
|
818
|
-
|
|
819
681
|
case 20:
|
|
820
682
|
_context10.prev = 20;
|
|
821
|
-
|
|
822
683
|
_iterator2.f();
|
|
823
|
-
|
|
824
684
|
return _context10.finish(20);
|
|
825
|
-
|
|
826
685
|
case 23:
|
|
827
686
|
case "end":
|
|
828
687
|
return _context10.stop();
|
|
@@ -830,11 +689,9 @@ var I3SConverter = function () {
|
|
|
830
689
|
}
|
|
831
690
|
}, _callee10, this, [[5, 17, 20, 23]]);
|
|
832
691
|
}));
|
|
833
|
-
|
|
834
692
|
function _addChildren(_x15) {
|
|
835
693
|
return _addChildren2.apply(this, arguments);
|
|
836
694
|
}
|
|
837
|
-
|
|
838
695
|
return _addChildren;
|
|
839
696
|
}()
|
|
840
697
|
}, {
|
|
@@ -842,22 +699,18 @@ var I3SConverter = function () {
|
|
|
842
699
|
value: function () {
|
|
843
700
|
var _addNeighborsAndWriteFile2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee11(parentNode, childNodes) {
|
|
844
701
|
var _iterator3, _step3, _parentNode$children, node, childPath, nodePath, _iterator4, _step4, neighbor;
|
|
845
|
-
|
|
846
702
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
847
703
|
while (1) {
|
|
848
704
|
switch (_context11.prev = _context11.next) {
|
|
849
705
|
case 0:
|
|
850
706
|
_iterator3 = _createForOfIteratorHelper(childNodes);
|
|
851
707
|
_context11.prev = 1;
|
|
852
|
-
|
|
853
708
|
_iterator3.s();
|
|
854
|
-
|
|
855
709
|
case 3:
|
|
856
710
|
if ((_step3 = _iterator3.n()).done) {
|
|
857
711
|
_context11.next = 36;
|
|
858
712
|
break;
|
|
859
713
|
}
|
|
860
|
-
|
|
861
714
|
node = _step3.value;
|
|
862
715
|
childPath = (0, _path.join)(this.layers0Path, 'nodes', node.path);
|
|
863
716
|
nodePath = node.path;
|
|
@@ -867,89 +720,63 @@ var I3SConverter = function () {
|
|
|
867
720
|
_context11.next = 29;
|
|
868
721
|
break;
|
|
869
722
|
}
|
|
870
|
-
|
|
871
723
|
_iterator4 = _createForOfIteratorHelper(parentNode.children || []);
|
|
872
724
|
_context11.prev = 10;
|
|
873
|
-
|
|
874
725
|
_iterator4.s();
|
|
875
|
-
|
|
876
726
|
case 12:
|
|
877
727
|
if ((_step4 = _iterator4.n()).done) {
|
|
878
728
|
_context11.next = 19;
|
|
879
729
|
break;
|
|
880
730
|
}
|
|
881
|
-
|
|
882
731
|
neighbor = _step4.value;
|
|
883
|
-
|
|
884
732
|
if (!(node.id === neighbor.id)) {
|
|
885
733
|
_context11.next = 16;
|
|
886
734
|
break;
|
|
887
735
|
}
|
|
888
|
-
|
|
889
736
|
return _context11.abrupt("continue", 17);
|
|
890
|
-
|
|
891
737
|
case 16:
|
|
892
738
|
if (node.neighbors) {
|
|
893
739
|
node.neighbors.push(_objectSpread({}, neighbor));
|
|
894
740
|
}
|
|
895
|
-
|
|
896
741
|
case 17:
|
|
897
742
|
_context11.next = 12;
|
|
898
743
|
break;
|
|
899
|
-
|
|
900
744
|
case 19:
|
|
901
745
|
_context11.next = 24;
|
|
902
746
|
break;
|
|
903
|
-
|
|
904
747
|
case 21:
|
|
905
748
|
_context11.prev = 21;
|
|
906
749
|
_context11.t0 = _context11["catch"](10);
|
|
907
|
-
|
|
908
750
|
_iterator4.e(_context11.t0);
|
|
909
|
-
|
|
910
751
|
case 24:
|
|
911
752
|
_context11.prev = 24;
|
|
912
|
-
|
|
913
753
|
_iterator4.f();
|
|
914
|
-
|
|
915
754
|
return _context11.finish(24);
|
|
916
|
-
|
|
917
755
|
case 27:
|
|
918
756
|
_context11.next = 31;
|
|
919
757
|
break;
|
|
920
|
-
|
|
921
758
|
case 29:
|
|
922
759
|
console.warn("Node ".concat(node.id, ": neighbors attribute is omited because of large number of neigbors"));
|
|
923
760
|
delete node.neighbors;
|
|
924
|
-
|
|
925
761
|
case 31:
|
|
926
762
|
_context11.next = 33;
|
|
927
763
|
return this._writeNodeIndexDocument(node, nodePath, childPath);
|
|
928
|
-
|
|
929
764
|
case 33:
|
|
930
765
|
node.neighbors = [];
|
|
931
|
-
|
|
932
766
|
case 34:
|
|
933
767
|
_context11.next = 3;
|
|
934
768
|
break;
|
|
935
|
-
|
|
936
769
|
case 36:
|
|
937
770
|
_context11.next = 41;
|
|
938
771
|
break;
|
|
939
|
-
|
|
940
772
|
case 38:
|
|
941
773
|
_context11.prev = 38;
|
|
942
774
|
_context11.t1 = _context11["catch"](1);
|
|
943
|
-
|
|
944
775
|
_iterator3.e(_context11.t1);
|
|
945
|
-
|
|
946
776
|
case 41:
|
|
947
777
|
_context11.prev = 41;
|
|
948
|
-
|
|
949
778
|
_iterator3.f();
|
|
950
|
-
|
|
951
779
|
return _context11.finish(41);
|
|
952
|
-
|
|
953
780
|
case 44:
|
|
954
781
|
case "end":
|
|
955
782
|
return _context11.stop();
|
|
@@ -957,11 +784,9 @@ var I3SConverter = function () {
|
|
|
957
784
|
}
|
|
958
785
|
}, _callee11, this, [[1, 38, 41, 44], [10, 21, 24, 27]]);
|
|
959
786
|
}));
|
|
960
|
-
|
|
961
787
|
function _addNeighborsAndWriteFile(_x16, _x17) {
|
|
962
788
|
return _addNeighborsAndWriteFile2.apply(this, arguments);
|
|
963
789
|
}
|
|
964
|
-
|
|
965
790
|
return _addNeighborsAndWriteFile;
|
|
966
791
|
}()
|
|
967
792
|
}, {
|
|
@@ -969,9 +794,7 @@ var I3SConverter = function () {
|
|
|
969
794
|
value: function () {
|
|
970
795
|
var _createNode2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee12(parentTile, sourceTile, parentId, level) {
|
|
971
796
|
var _this$layers, _this$layers$attribut;
|
|
972
|
-
|
|
973
797
|
var boundingVolumes, propertyTable, resourcesData, nodes, nodesInPage, emptyResources, _iterator5, _step5, resources, lodSelection, maxScreenThresholdSQ, nodeInPage, node, _console;
|
|
974
|
-
|
|
975
798
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
976
799
|
while (1) {
|
|
977
800
|
switch (_context12.prev = _context12.next) {
|
|
@@ -979,25 +802,19 @@ var I3SConverter = function () {
|
|
|
979
802
|
if (this.validate) {
|
|
980
803
|
this._checkAddRefinementTypeForTile(sourceTile);
|
|
981
804
|
}
|
|
982
|
-
|
|
983
805
|
_context12.next = 3;
|
|
984
806
|
return this._updateTilesetOptions();
|
|
985
|
-
|
|
986
807
|
case 3:
|
|
987
808
|
_context12.next = 5;
|
|
988
809
|
return this.sourceTileset._loadTile(sourceTile);
|
|
989
|
-
|
|
990
810
|
case 5:
|
|
991
811
|
boundingVolumes = (0, _coordinateConverter.createBoundingVolumes)(sourceTile, this.geoidHeightModel);
|
|
992
812
|
propertyTable = (0, _geometryConverter.getPropertyTable)(sourceTile.content);
|
|
993
|
-
|
|
994
813
|
if (propertyTable && !((_this$layers = this.layers0) !== null && _this$layers !== void 0 && (_this$layers$attribut = _this$layers.attributeStorageInfo) !== null && _this$layers$attribut !== void 0 && _this$layers$attribut.length)) {
|
|
995
814
|
this._convertPropertyTableToNodeAttributes(propertyTable);
|
|
996
815
|
}
|
|
997
|
-
|
|
998
816
|
_context12.next = 10;
|
|
999
817
|
return this._convertResources(sourceTile, parentId, propertyTable);
|
|
1000
|
-
|
|
1001
818
|
case 10:
|
|
1002
819
|
resourcesData = _context12.sent;
|
|
1003
820
|
nodes = [];
|
|
@@ -1015,22 +832,17 @@ var I3SConverter = function () {
|
|
|
1015
832
|
};
|
|
1016
833
|
_iterator5 = _createForOfIteratorHelper(resourcesData || [emptyResources]);
|
|
1017
834
|
_context12.prev = 15;
|
|
1018
|
-
|
|
1019
835
|
_iterator5.s();
|
|
1020
|
-
|
|
1021
836
|
case 17:
|
|
1022
837
|
if ((_step5 = _iterator5.n()).done) {
|
|
1023
838
|
_context12.next = 33;
|
|
1024
839
|
break;
|
|
1025
840
|
}
|
|
1026
|
-
|
|
1027
841
|
resources = _step5.value;
|
|
1028
842
|
this.layersHasTexture = this.layersHasTexture || Boolean(resources.texture);
|
|
1029
|
-
|
|
1030
843
|
if (this.generateBoundingVolumes && resources.boundingVolumes) {
|
|
1031
844
|
boundingVolumes = resources.boundingVolumes;
|
|
1032
845
|
}
|
|
1033
|
-
|
|
1034
846
|
lodSelection = (0, _lodConversionUtils.convertGeometricErrorToScreenThreshold)(sourceTile, boundingVolumes);
|
|
1035
847
|
maxScreenThresholdSQ = lodSelection.find(function (val) {
|
|
1036
848
|
return val.metricType === 'maxScreenThresholdSQ';
|
|
@@ -1039,19 +851,15 @@ var I3SConverter = function () {
|
|
|
1039
851
|
};
|
|
1040
852
|
nodeInPage = this._updateNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources);
|
|
1041
853
|
node = this._createNodeIndexDocument(parentTile, boundingVolumes, lodSelection, nodeInPage, resources);
|
|
1042
|
-
|
|
1043
854
|
if (!nodeInPage.mesh) {
|
|
1044
855
|
_context12.next = 28;
|
|
1045
856
|
break;
|
|
1046
857
|
}
|
|
1047
|
-
|
|
1048
858
|
_context12.next = 28;
|
|
1049
859
|
return this._writeResources(resources, node.path);
|
|
1050
|
-
|
|
1051
860
|
case 28:
|
|
1052
861
|
if (this.validate) {
|
|
1053
862
|
this.boundingVolumeWarnings = (0, _nodeDebug.validateNodeBoundingVolumes)(node);
|
|
1054
|
-
|
|
1055
863
|
if (this.boundingVolumeWarnings && this.boundingVolumeWarnings.length) {
|
|
1056
864
|
(_console = console).warn.apply(_console, ['Bounding Volume Warnings: '].concat((0, _toConsumableArray2.default)(this.boundingVolumeWarnings)));
|
|
1057
865
|
}
|
|
@@ -1059,28 +867,20 @@ var I3SConverter = function () {
|
|
|
1059
867
|
|
|
1060
868
|
nodes.push(node);
|
|
1061
869
|
nodesInPage.push(nodeInPage);
|
|
1062
|
-
|
|
1063
870
|
case 31:
|
|
1064
871
|
_context12.next = 17;
|
|
1065
872
|
break;
|
|
1066
|
-
|
|
1067
873
|
case 33:
|
|
1068
874
|
_context12.next = 38;
|
|
1069
875
|
break;
|
|
1070
|
-
|
|
1071
876
|
case 35:
|
|
1072
877
|
_context12.prev = 35;
|
|
1073
878
|
_context12.t0 = _context12["catch"](15);
|
|
1074
|
-
|
|
1075
879
|
_iterator5.e(_context12.t0);
|
|
1076
|
-
|
|
1077
880
|
case 38:
|
|
1078
881
|
_context12.prev = 38;
|
|
1079
|
-
|
|
1080
882
|
_iterator5.f();
|
|
1081
|
-
|
|
1082
883
|
return _context12.finish(38);
|
|
1083
|
-
|
|
1084
884
|
case 41:
|
|
1085
885
|
sourceTile.unloadContent();
|
|
1086
886
|
_context12.next = 44;
|
|
@@ -1090,10 +890,8 @@ var I3SConverter = function () {
|
|
|
1090
890
|
parentId: nodesInPage[0].index,
|
|
1091
891
|
level: level + 1
|
|
1092
892
|
});
|
|
1093
|
-
|
|
1094
893
|
case 44:
|
|
1095
894
|
return _context12.abrupt("return", nodes);
|
|
1096
|
-
|
|
1097
895
|
case 45:
|
|
1098
896
|
case "end":
|
|
1099
897
|
return _context12.stop();
|
|
@@ -1101,11 +899,9 @@ var I3SConverter = function () {
|
|
|
1101
899
|
}
|
|
1102
900
|
}, _callee12, this, [[15, 35, 38, 41]]);
|
|
1103
901
|
}));
|
|
1104
|
-
|
|
1105
902
|
function _createNode(_x18, _x19, _x20, _x21) {
|
|
1106
903
|
return _createNode2.apply(this, arguments);
|
|
1107
904
|
}
|
|
1108
|
-
|
|
1109
905
|
return _createNode;
|
|
1110
906
|
}()
|
|
1111
907
|
}, {
|
|
@@ -1113,8 +909,7 @@ var I3SConverter = function () {
|
|
|
1113
909
|
value: function () {
|
|
1114
910
|
var _convertResources2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee13(sourceTile, parentId, propertyTable) {
|
|
1115
911
|
var _this = this,
|
|
1116
|
-
|
|
1117
|
-
|
|
912
|
+
_this$layers2;
|
|
1118
913
|
var draftObb, resourcesData;
|
|
1119
914
|
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1120
915
|
while (1) {
|
|
@@ -1124,9 +919,7 @@ var I3SConverter = function () {
|
|
|
1124
919
|
_context13.next = 2;
|
|
1125
920
|
break;
|
|
1126
921
|
}
|
|
1127
|
-
|
|
1128
922
|
return _context13.abrupt("return", null);
|
|
1129
|
-
|
|
1130
923
|
case 2:
|
|
1131
924
|
draftObb = {
|
|
1132
925
|
center: [],
|
|
@@ -1140,11 +933,9 @@ var I3SConverter = function () {
|
|
|
1140
933
|
obb: draftObb
|
|
1141
934
|
}, parentId);
|
|
1142
935
|
}, propertyTable, this.featuresHashArray, (_this$layers2 = this.layers0) === null || _this$layers2 === void 0 ? void 0 : _this$layers2.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.geoidHeightModel, this.workerSource);
|
|
1143
|
-
|
|
1144
936
|
case 5:
|
|
1145
937
|
resourcesData = _context13.sent;
|
|
1146
938
|
return _context13.abrupt("return", resourcesData);
|
|
1147
|
-
|
|
1148
939
|
case 7:
|
|
1149
940
|
case "end":
|
|
1150
941
|
return _context13.stop();
|
|
@@ -1152,28 +943,26 @@ var I3SConverter = function () {
|
|
|
1152
943
|
}
|
|
1153
944
|
}, _callee13, this);
|
|
1154
945
|
}));
|
|
1155
|
-
|
|
1156
946
|
function _convertResources(_x22, _x23, _x24) {
|
|
1157
947
|
return _convertResources2.apply(this, arguments);
|
|
1158
948
|
}
|
|
1159
|
-
|
|
1160
949
|
return _convertResources;
|
|
1161
950
|
}()
|
|
1162
951
|
}, {
|
|
1163
952
|
key: "_updateNodeInNodePages",
|
|
1164
|
-
value:
|
|
953
|
+
value:
|
|
954
|
+
function _updateNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
|
|
1165
955
|
var meshMaterial = resources.meshMaterial,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
956
|
+
texture = resources.texture,
|
|
957
|
+
vertexCount = resources.vertexCount,
|
|
958
|
+
featureCount = resources.featureCount,
|
|
959
|
+
geometry = resources.geometry;
|
|
1170
960
|
var nodeInPage = {
|
|
1171
961
|
index: 0,
|
|
1172
962
|
lodThreshold: maxScreenThresholdSQ.maxError,
|
|
1173
963
|
obb: boundingVolumes.obb,
|
|
1174
964
|
children: []
|
|
1175
965
|
};
|
|
1176
|
-
|
|
1177
966
|
if (geometry && this.isContentSupported(sourceTile)) {
|
|
1178
967
|
nodeInPage.mesh = {
|
|
1179
968
|
geometry: {
|
|
@@ -1188,9 +977,7 @@ var I3SConverter = function () {
|
|
|
1188
977
|
}
|
|
1189
978
|
};
|
|
1190
979
|
}
|
|
1191
|
-
|
|
1192
980
|
var nodeId = resources.nodeId;
|
|
1193
|
-
|
|
1194
981
|
if (nodeId) {
|
|
1195
982
|
this.nodePages.updateAll(nodeId, nodeInPage);
|
|
1196
983
|
var node = this.nodePages.getNodeById(nodeId);
|
|
@@ -1198,36 +985,31 @@ var I3SConverter = function () {
|
|
|
1198
985
|
} else {
|
|
1199
986
|
nodeId = this.nodePages.push(nodeInPage, parentId);
|
|
1200
987
|
}
|
|
1201
|
-
|
|
1202
988
|
if (meshMaterial) {
|
|
1203
989
|
this.nodePages.updateMaterialByNodeId(nodeId, this._findOrCreateMaterial(meshMaterial));
|
|
1204
990
|
}
|
|
1205
|
-
|
|
1206
991
|
if (texture) {
|
|
1207
992
|
var texelCountHint = texture.image.height * texture.image.width;
|
|
1208
993
|
this.nodePages.updateTexelCountHintByNodeId(nodeId, texelCountHint);
|
|
1209
994
|
}
|
|
1210
|
-
|
|
1211
995
|
if (vertexCount) {
|
|
1212
996
|
this.vertexCounter += vertexCount;
|
|
1213
997
|
this.nodePages.updateVertexCountByNodeId(nodeId, vertexCount);
|
|
1214
998
|
}
|
|
1215
|
-
|
|
1216
999
|
this.nodePages.updateNodeAttributeByNodeId(nodeId);
|
|
1217
|
-
|
|
1218
1000
|
if (featureCount) {
|
|
1219
1001
|
this.nodePages.updateFeatureCountByNodeId(nodeId, featureCount);
|
|
1220
1002
|
}
|
|
1221
|
-
|
|
1222
1003
|
return this.nodePages.getNodeById(nodeId);
|
|
1223
1004
|
}
|
|
1005
|
+
|
|
1224
1006
|
}, {
|
|
1225
1007
|
key: "_createNodeIndexDocument",
|
|
1226
|
-
value:
|
|
1008
|
+
value:
|
|
1009
|
+
function _createNodeIndexDocument(parentNode, boundingVolumes, lodSelection, nodeInPage, resources) {
|
|
1227
1010
|
var texture = resources.texture,
|
|
1228
|
-
|
|
1011
|
+
attributes = resources.attributes;
|
|
1229
1012
|
var nodeId = nodeInPage.index;
|
|
1230
|
-
|
|
1231
1013
|
var nodeData = _objectSpread(_objectSpread({
|
|
1232
1014
|
version: parentNode.version,
|
|
1233
1015
|
id: nodeId.toString(),
|
|
@@ -1244,19 +1026,15 @@ var I3SConverter = function () {
|
|
|
1244
1026
|
children: [],
|
|
1245
1027
|
neighbors: []
|
|
1246
1028
|
});
|
|
1247
|
-
|
|
1248
1029
|
var node = (0, _jsonMapTransform.default)(nodeData, (0, _node.NODE)());
|
|
1249
|
-
|
|
1250
1030
|
if (nodeInPage.mesh) {
|
|
1251
1031
|
var _this$layers3, _this$layers3$attribu;
|
|
1252
|
-
|
|
1253
1032
|
node.geometryData = [{
|
|
1254
1033
|
href: './geometries/0'
|
|
1255
1034
|
}];
|
|
1256
1035
|
node.sharedResource = {
|
|
1257
1036
|
href: './shared'
|
|
1258
1037
|
};
|
|
1259
|
-
|
|
1260
1038
|
if (texture) {
|
|
1261
1039
|
node.textureData = [{
|
|
1262
1040
|
href: './textures/0'
|
|
@@ -1264,10 +1042,8 @@ var I3SConverter = function () {
|
|
|
1264
1042
|
href: './textures/1'
|
|
1265
1043
|
}];
|
|
1266
1044
|
}
|
|
1267
|
-
|
|
1268
1045
|
if (attributes && attributes.length && (_this$layers3 = this.layers0) !== null && _this$layers3 !== void 0 && (_this$layers3$attribu = _this$layers3.attributeStorageInfo) !== null && _this$layers3$attribu !== void 0 && _this$layers3$attribu.length) {
|
|
1269
1046
|
node.attributeData = [];
|
|
1270
|
-
|
|
1271
1047
|
for (var index = 0; index < attributes.length; index++) {
|
|
1272
1048
|
var folderName = this.layers0.attributeStorageInfo[index].key;
|
|
1273
1049
|
node.attributeData.push({
|
|
@@ -1276,9 +1052,9 @@ var I3SConverter = function () {
|
|
|
1276
1052
|
}
|
|
1277
1053
|
}
|
|
1278
1054
|
}
|
|
1279
|
-
|
|
1280
1055
|
return node;
|
|
1281
1056
|
}
|
|
1057
|
+
|
|
1282
1058
|
}, {
|
|
1283
1059
|
key: "_writeResources",
|
|
1284
1060
|
value: function () {
|
|
@@ -1293,19 +1069,15 @@ var I3SConverter = function () {
|
|
|
1293
1069
|
slpkChildPath = (0, _path.join)('nodes', nodePath);
|
|
1294
1070
|
_context14.next = 5;
|
|
1295
1071
|
return this._writeGeometries(geometryBuffer, compressedGeometry, childPath, slpkChildPath);
|
|
1296
|
-
|
|
1297
1072
|
case 5:
|
|
1298
1073
|
_context14.next = 7;
|
|
1299
1074
|
return this._writeShared(sharedResources, childPath, slpkChildPath, nodePath);
|
|
1300
|
-
|
|
1301
1075
|
case 7:
|
|
1302
1076
|
_context14.next = 9;
|
|
1303
1077
|
return this._writeTexture(texture, childPath, slpkChildPath);
|
|
1304
|
-
|
|
1305
1078
|
case 9:
|
|
1306
1079
|
_context14.next = 11;
|
|
1307
1080
|
return this._writeAttributes(attributes, childPath, slpkChildPath);
|
|
1308
|
-
|
|
1309
1081
|
case 11:
|
|
1310
1082
|
case "end":
|
|
1311
1083
|
return _context14.stop();
|
|
@@ -1313,11 +1085,9 @@ var I3SConverter = function () {
|
|
|
1313
1085
|
}
|
|
1314
1086
|
}, _callee14, this);
|
|
1315
1087
|
}));
|
|
1316
|
-
|
|
1317
1088
|
function _writeResources(_x25, _x26) {
|
|
1318
1089
|
return _writeResources2.apply(this, arguments);
|
|
1319
1090
|
}
|
|
1320
|
-
|
|
1321
1091
|
return _writeResources;
|
|
1322
1092
|
}()
|
|
1323
1093
|
}, {
|
|
@@ -1333,54 +1103,45 @@ var I3SConverter = function () {
|
|
|
1333
1103
|
_context15.next = 6;
|
|
1334
1104
|
break;
|
|
1335
1105
|
}
|
|
1336
|
-
|
|
1337
1106
|
slpkGeometryPath = (0, _path.join)(childPath, 'geometries');
|
|
1338
1107
|
_context15.next = 4;
|
|
1339
1108
|
return this.writeQueue.enqueue({
|
|
1340
1109
|
archiveKey: "".concat(slpkChildPath, "/geometries/0.bin.gz"),
|
|
1341
1110
|
writePromise: (0, _fileUtils.writeFileForSlpk)(slpkGeometryPath, geometryBuffer, '0.bin')
|
|
1342
1111
|
});
|
|
1343
|
-
|
|
1344
1112
|
case 4:
|
|
1345
1113
|
_context15.next = 9;
|
|
1346
1114
|
break;
|
|
1347
|
-
|
|
1348
1115
|
case 6:
|
|
1349
1116
|
geometryPath = (0, _path.join)(childPath, 'geometries/0/');
|
|
1350
1117
|
_context15.next = 9;
|
|
1351
1118
|
return this.writeQueue.enqueue({
|
|
1352
1119
|
writePromise: (0, _fileUtils.writeFile)(geometryPath, geometryBuffer, 'index.bin')
|
|
1353
1120
|
});
|
|
1354
|
-
|
|
1355
1121
|
case 9:
|
|
1356
1122
|
if (!this.options.draco) {
|
|
1357
1123
|
_context15.next = 19;
|
|
1358
1124
|
break;
|
|
1359
1125
|
}
|
|
1360
|
-
|
|
1361
1126
|
if (!this.options.slpk) {
|
|
1362
1127
|
_context15.next = 16;
|
|
1363
1128
|
break;
|
|
1364
1129
|
}
|
|
1365
|
-
|
|
1366
1130
|
slpkCompressedGeometryPath = (0, _path.join)(childPath, 'geometries');
|
|
1367
1131
|
_context15.next = 14;
|
|
1368
1132
|
return this.writeQueue.enqueue({
|
|
1369
1133
|
archiveKey: "".concat(slpkChildPath, "/geometries/1.bin.gz"),
|
|
1370
1134
|
writePromise: (0, _fileUtils.writeFileForSlpk)(slpkCompressedGeometryPath, compressedGeometry, '1.bin')
|
|
1371
1135
|
});
|
|
1372
|
-
|
|
1373
1136
|
case 14:
|
|
1374
1137
|
_context15.next = 19;
|
|
1375
1138
|
break;
|
|
1376
|
-
|
|
1377
1139
|
case 16:
|
|
1378
1140
|
compressedGeometryPath = (0, _path.join)(childPath, 'geometries/1/');
|
|
1379
1141
|
_context15.next = 19;
|
|
1380
1142
|
return this.writeQueue.enqueue({
|
|
1381
1143
|
writePromise: (0, _fileUtils.writeFile)(compressedGeometryPath, compressedGeometry, 'index.bin')
|
|
1382
1144
|
});
|
|
1383
|
-
|
|
1384
1145
|
case 19:
|
|
1385
1146
|
case "end":
|
|
1386
1147
|
return _context15.stop();
|
|
@@ -1388,11 +1149,9 @@ var I3SConverter = function () {
|
|
|
1388
1149
|
}
|
|
1389
1150
|
}, _callee15, this);
|
|
1390
1151
|
}));
|
|
1391
|
-
|
|
1392
1152
|
function _writeGeometries(_x27, _x28, _x29, _x30) {
|
|
1393
1153
|
return _writeGeometries2.apply(this, arguments);
|
|
1394
1154
|
}
|
|
1395
|
-
|
|
1396
1155
|
return _writeGeometries;
|
|
1397
1156
|
}()
|
|
1398
1157
|
}, {
|
|
@@ -1408,37 +1167,30 @@ var I3SConverter = function () {
|
|
|
1408
1167
|
_context16.next = 2;
|
|
1409
1168
|
break;
|
|
1410
1169
|
}
|
|
1411
|
-
|
|
1412
1170
|
return _context16.abrupt("return");
|
|
1413
|
-
|
|
1414
1171
|
case 2:
|
|
1415
1172
|
sharedResources.nodePath = nodePath;
|
|
1416
1173
|
sharedData = (0, _jsonMapTransform.default)(sharedResources, (0, _sharedResources.SHARED_RESOURCES)());
|
|
1417
1174
|
sharedDataStr = JSON.stringify(sharedData);
|
|
1418
|
-
|
|
1419
1175
|
if (!this.options.slpk) {
|
|
1420
1176
|
_context16.next = 11;
|
|
1421
1177
|
break;
|
|
1422
1178
|
}
|
|
1423
|
-
|
|
1424
1179
|
slpkSharedPath = (0, _path.join)(childPath, 'shared');
|
|
1425
1180
|
_context16.next = 9;
|
|
1426
1181
|
return this.writeQueue.enqueue({
|
|
1427
1182
|
archiveKey: "".concat(slpkChildPath, "/shared/sharedResource.json.gz"),
|
|
1428
1183
|
writePromise: (0, _fileUtils.writeFileForSlpk)(slpkSharedPath, sharedDataStr, 'sharedResource.json')
|
|
1429
1184
|
});
|
|
1430
|
-
|
|
1431
1185
|
case 9:
|
|
1432
1186
|
_context16.next = 14;
|
|
1433
1187
|
break;
|
|
1434
|
-
|
|
1435
1188
|
case 11:
|
|
1436
1189
|
sharedPath = (0, _path.join)(childPath, 'shared/');
|
|
1437
1190
|
_context16.next = 14;
|
|
1438
1191
|
return this.writeQueue.enqueue({
|
|
1439
1192
|
writePromise: (0, _fileUtils.writeFile)(sharedPath, sharedDataStr)
|
|
1440
1193
|
});
|
|
1441
|
-
|
|
1442
1194
|
case 14:
|
|
1443
1195
|
case "end":
|
|
1444
1196
|
return _context16.stop();
|
|
@@ -1446,11 +1198,9 @@ var I3SConverter = function () {
|
|
|
1446
1198
|
}
|
|
1447
1199
|
}, _callee16, this);
|
|
1448
1200
|
}));
|
|
1449
|
-
|
|
1450
1201
|
function _writeShared(_x31, _x32, _x33, _x34) {
|
|
1451
1202
|
return _writeShared2.apply(this, arguments);
|
|
1452
1203
|
}
|
|
1453
|
-
|
|
1454
1204
|
return _writeShared;
|
|
1455
1205
|
}()
|
|
1456
1206
|
}, {
|
|
@@ -1466,14 +1216,12 @@ var I3SConverter = function () {
|
|
|
1466
1216
|
_context17.next = 27;
|
|
1467
1217
|
break;
|
|
1468
1218
|
}
|
|
1469
|
-
|
|
1470
1219
|
format = this._getFormatByMimeType(texture === null || texture === void 0 ? void 0 : texture.mimeType);
|
|
1471
1220
|
formats = [];
|
|
1472
1221
|
textureData = texture.bufferView.data;
|
|
1473
1222
|
_context17.t0 = format;
|
|
1474
1223
|
_context17.next = _context17.t0 === 'jpg' ? 7 : _context17.t0 === 'png' ? 7 : _context17.t0 === 'ktx2' ? 18 : 26;
|
|
1475
1224
|
break;
|
|
1476
|
-
|
|
1477
1225
|
case 7:
|
|
1478
1226
|
formats.push({
|
|
1479
1227
|
name: '0',
|
|
@@ -1481,13 +1229,11 @@ var I3SConverter = function () {
|
|
|
1481
1229
|
});
|
|
1482
1230
|
_context17.next = 10;
|
|
1483
1231
|
return this.writeTextureFile(textureData, '0', format, childPath, slpkChildPath);
|
|
1484
|
-
|
|
1485
1232
|
case 10:
|
|
1486
1233
|
if (!this.generateTextures) {
|
|
1487
1234
|
_context17.next = 17;
|
|
1488
1235
|
break;
|
|
1489
1236
|
}
|
|
1490
|
-
|
|
1491
1237
|
formats.push({
|
|
1492
1238
|
name: '1',
|
|
1493
1239
|
format: 'ktx2'
|
|
@@ -1503,10 +1249,8 @@ var I3SConverter = function () {
|
|
|
1503
1249
|
}));
|
|
1504
1250
|
_context17.next = 17;
|
|
1505
1251
|
return this.writeTextureFile(ktx2TextureData, '1', 'ktx2', childPath, slpkChildPath);
|
|
1506
|
-
|
|
1507
1252
|
case 17:
|
|
1508
1253
|
return _context17.abrupt("break", 26);
|
|
1509
|
-
|
|
1510
1254
|
case 18:
|
|
1511
1255
|
formats.push({
|
|
1512
1256
|
name: '1',
|
|
@@ -1514,13 +1258,11 @@ var I3SConverter = function () {
|
|
|
1514
1258
|
});
|
|
1515
1259
|
_context17.next = 21;
|
|
1516
1260
|
return this.writeTextureFile(textureData, '1', format, childPath, slpkChildPath);
|
|
1517
|
-
|
|
1518
1261
|
case 21:
|
|
1519
1262
|
if (!this.generateTextures) {
|
|
1520
1263
|
_context17.next = 26;
|
|
1521
1264
|
break;
|
|
1522
1265
|
}
|
|
1523
|
-
|
|
1524
1266
|
formats.push({
|
|
1525
1267
|
name: '0',
|
|
1526
1268
|
format: 'jpg'
|
|
@@ -1528,14 +1270,12 @@ var I3SConverter = function () {
|
|
|
1528
1270
|
decodedFromKTX2TextureData = (0, _core.encode)(texture.image.data[0], _images.ImageWriter);
|
|
1529
1271
|
_context17.next = 26;
|
|
1530
1272
|
return this.writeTextureFile(decodedFromKTX2TextureData, '0', 'jpg', childPath, slpkChildPath);
|
|
1531
|
-
|
|
1532
1273
|
case 26:
|
|
1533
1274
|
if (!this.layers0.textureSetDefinitions.length) {
|
|
1534
1275
|
this.layers0.textureSetDefinitions.push({
|
|
1535
1276
|
formats: formats
|
|
1536
1277
|
});
|
|
1537
1278
|
}
|
|
1538
|
-
|
|
1539
1279
|
case 27:
|
|
1540
1280
|
case "end":
|
|
1541
1281
|
return _context17.stop();
|
|
@@ -1543,11 +1283,9 @@ var I3SConverter = function () {
|
|
|
1543
1283
|
}
|
|
1544
1284
|
}, _callee17, this);
|
|
1545
1285
|
}));
|
|
1546
|
-
|
|
1547
1286
|
function _writeTexture(_x35, _x36, _x37) {
|
|
1548
1287
|
return _writeTexture2.apply(this, arguments);
|
|
1549
1288
|
}
|
|
1550
|
-
|
|
1551
1289
|
return _writeTexture;
|
|
1552
1290
|
}()
|
|
1553
1291
|
}, {
|
|
@@ -1563,7 +1301,6 @@ var I3SConverter = function () {
|
|
|
1563
1301
|
_context18.next = 7;
|
|
1564
1302
|
break;
|
|
1565
1303
|
}
|
|
1566
|
-
|
|
1567
1304
|
slpkTexturePath = (0, _path.join)(childPath, 'textures');
|
|
1568
1305
|
compress = false;
|
|
1569
1306
|
_context18.next = 5;
|
|
@@ -1571,18 +1308,15 @@ var I3SConverter = function () {
|
|
|
1571
1308
|
archiveKey: "".concat(slpkChildPath, "/textures/").concat(name, ".").concat(format),
|
|
1572
1309
|
writePromise: (0, _fileUtils.writeFileForSlpk)(slpkTexturePath, textureData, "".concat(name, ".").concat(format), compress)
|
|
1573
1310
|
});
|
|
1574
|
-
|
|
1575
1311
|
case 5:
|
|
1576
1312
|
_context18.next = 10;
|
|
1577
1313
|
break;
|
|
1578
|
-
|
|
1579
1314
|
case 7:
|
|
1580
1315
|
texturePath = (0, _path.join)(childPath, "textures/".concat(name, "/"));
|
|
1581
1316
|
_context18.next = 10;
|
|
1582
1317
|
return this.writeQueue.enqueue({
|
|
1583
1318
|
writePromise: (0, _fileUtils.writeFile)(texturePath, textureData, "index.".concat(format))
|
|
1584
1319
|
});
|
|
1585
|
-
|
|
1586
1320
|
case 10:
|
|
1587
1321
|
case "end":
|
|
1588
1322
|
return _context18.stop();
|
|
@@ -1590,11 +1324,9 @@ var I3SConverter = function () {
|
|
|
1590
1324
|
}
|
|
1591
1325
|
}, _callee18, this);
|
|
1592
1326
|
}));
|
|
1593
|
-
|
|
1594
1327
|
function writeTextureFile(_x38, _x39, _x40, _x41, _x42) {
|
|
1595
1328
|
return _writeTextureFile.apply(this, arguments);
|
|
1596
1329
|
}
|
|
1597
|
-
|
|
1598
1330
|
return writeTextureFile;
|
|
1599
1331
|
}()
|
|
1600
1332
|
}, {
|
|
@@ -1602,16 +1334,15 @@ var I3SConverter = function () {
|
|
|
1602
1334
|
value: function () {
|
|
1603
1335
|
var _writeAttributes2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee19() {
|
|
1604
1336
|
var _this$layers4, _this$layers4$attribu;
|
|
1605
|
-
|
|
1606
1337
|
var attributes,
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1338
|
+
childPath,
|
|
1339
|
+
slpkChildPath,
|
|
1340
|
+
index,
|
|
1341
|
+
folderName,
|
|
1342
|
+
fileBuffer,
|
|
1343
|
+
slpkAttributesPath,
|
|
1344
|
+
attributesPath,
|
|
1345
|
+
_args19 = arguments;
|
|
1615
1346
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1616
1347
|
while (1) {
|
|
1617
1348
|
switch (_context19.prev = _context19.next) {
|
|
@@ -1619,51 +1350,41 @@ var I3SConverter = function () {
|
|
|
1619
1350
|
attributes = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : [];
|
|
1620
1351
|
childPath = _args19.length > 1 ? _args19[1] : undefined;
|
|
1621
1352
|
slpkChildPath = _args19.length > 2 ? _args19[2] : undefined;
|
|
1622
|
-
|
|
1623
1353
|
if (!(attributes !== null && attributes !== void 0 && attributes.length && (_this$layers4 = this.layers0) !== null && _this$layers4 !== void 0 && (_this$layers4$attribu = _this$layers4.attributeStorageInfo) !== null && _this$layers4$attribu !== void 0 && _this$layers4$attribu.length)) {
|
|
1624
1354
|
_context19.next = 20;
|
|
1625
1355
|
break;
|
|
1626
1356
|
}
|
|
1627
|
-
|
|
1628
1357
|
index = 0;
|
|
1629
|
-
|
|
1630
1358
|
case 5:
|
|
1631
1359
|
if (!(index < attributes.length)) {
|
|
1632
1360
|
_context19.next = 20;
|
|
1633
1361
|
break;
|
|
1634
1362
|
}
|
|
1635
|
-
|
|
1636
1363
|
folderName = this.layers0.attributeStorageInfo[index].key;
|
|
1637
1364
|
fileBuffer = new Uint8Array(attributes[index]);
|
|
1638
|
-
|
|
1639
1365
|
if (!this.options.slpk) {
|
|
1640
1366
|
_context19.next = 14;
|
|
1641
1367
|
break;
|
|
1642
1368
|
}
|
|
1643
|
-
|
|
1644
1369
|
slpkAttributesPath = (0, _path.join)(childPath, 'attributes', folderName);
|
|
1645
1370
|
_context19.next = 12;
|
|
1646
1371
|
return this.writeQueue.enqueue({
|
|
1647
1372
|
archiveKey: "".concat(slpkChildPath, "/attributes/").concat(folderName, ".bin.gz"),
|
|
1648
1373
|
writePromise: (0, _fileUtils.writeFileForSlpk)(slpkAttributesPath, fileBuffer, '0.bin')
|
|
1649
1374
|
});
|
|
1650
|
-
|
|
1651
1375
|
case 12:
|
|
1652
1376
|
_context19.next = 17;
|
|
1653
1377
|
break;
|
|
1654
|
-
|
|
1655
1378
|
case 14:
|
|
1656
1379
|
attributesPath = (0, _path.join)(childPath, "attributes/".concat(folderName, "/0"));
|
|
1657
1380
|
_context19.next = 17;
|
|
1658
1381
|
return this.writeQueue.enqueue({
|
|
1659
1382
|
writePromise: (0, _fileUtils.writeFile)(attributesPath, fileBuffer, 'index.bin')
|
|
1660
1383
|
});
|
|
1661
|
-
|
|
1662
1384
|
case 17:
|
|
1663
1385
|
index++;
|
|
1664
1386
|
_context19.next = 5;
|
|
1665
1387
|
break;
|
|
1666
|
-
|
|
1667
1388
|
case 20:
|
|
1668
1389
|
case "end":
|
|
1669
1390
|
return _context19.stop();
|
|
@@ -1671,52 +1392,48 @@ var I3SConverter = function () {
|
|
|
1671
1392
|
}
|
|
1672
1393
|
}, _callee19, this);
|
|
1673
1394
|
}));
|
|
1674
|
-
|
|
1675
1395
|
function _writeAttributes() {
|
|
1676
1396
|
return _writeAttributes2.apply(this, arguments);
|
|
1677
1397
|
}
|
|
1678
|
-
|
|
1679
1398
|
return _writeAttributes;
|
|
1680
1399
|
}()
|
|
1681
1400
|
}, {
|
|
1682
1401
|
key: "_getFormatByMimeType",
|
|
1683
|
-
value:
|
|
1402
|
+
value:
|
|
1403
|
+
function _getFormatByMimeType(mimeType) {
|
|
1684
1404
|
switch (mimeType) {
|
|
1685
1405
|
case 'image/jpeg':
|
|
1686
1406
|
return 'jpg';
|
|
1687
|
-
|
|
1688
1407
|
case 'image/png':
|
|
1689
1408
|
return 'png';
|
|
1690
|
-
|
|
1691
1409
|
case 'image/ktx2':
|
|
1692
1410
|
return 'ktx2';
|
|
1693
|
-
|
|
1694
1411
|
default:
|
|
1695
1412
|
return 'jpg';
|
|
1696
1413
|
}
|
|
1697
1414
|
}
|
|
1415
|
+
|
|
1698
1416
|
}, {
|
|
1699
1417
|
key: "_findOrCreateMaterial",
|
|
1700
|
-
value:
|
|
1418
|
+
value:
|
|
1419
|
+
function _findOrCreateMaterial(material) {
|
|
1701
1420
|
var hash = (0, _md.default)(JSON.stringify(material));
|
|
1702
|
-
|
|
1703
1421
|
if (this.materialMap.has(hash)) {
|
|
1704
1422
|
return this.materialMap.get(hash);
|
|
1705
1423
|
}
|
|
1706
|
-
|
|
1707
1424
|
var newMaterialId = this.materialDefinitions.push(material) - 1;
|
|
1708
1425
|
this.materialMap.set(hash, newMaterialId);
|
|
1709
1426
|
return newMaterialId;
|
|
1710
1427
|
}
|
|
1428
|
+
|
|
1711
1429
|
}, {
|
|
1712
1430
|
key: "_convertPropertyTableToNodeAttributes",
|
|
1713
|
-
value:
|
|
1431
|
+
value:
|
|
1432
|
+
function _convertPropertyTableToNodeAttributes(propertyTable) {
|
|
1714
1433
|
var attributeIndex = 0;
|
|
1715
|
-
|
|
1716
1434
|
var propertyTableWithObjectId = _objectSpread({
|
|
1717
1435
|
OBJECTID: [0]
|
|
1718
1436
|
}, propertyTable);
|
|
1719
|
-
|
|
1720
1437
|
for (var _key in propertyTableWithObjectId) {
|
|
1721
1438
|
var firstAttribute = propertyTableWithObjectId[_key][0];
|
|
1722
1439
|
var attributeType = (0, _featureAttributes.getAttributeType)(_key, firstAttribute);
|
|
@@ -1731,12 +1448,12 @@ var I3SConverter = function () {
|
|
|
1731
1448
|
attributeIndex += 1;
|
|
1732
1449
|
}
|
|
1733
1450
|
}
|
|
1451
|
+
|
|
1734
1452
|
}, {
|
|
1735
1453
|
key: "_finishConversion",
|
|
1736
1454
|
value: function () {
|
|
1737
1455
|
var _finishConversion2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee20(params) {
|
|
1738
1456
|
var _this$refinementCount, tilesCount, tilesWithAddRefineCount, addRefinementPercentage, filesSize, diff, conversionTime;
|
|
1739
|
-
|
|
1740
1457
|
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1741
1458
|
while (1) {
|
|
1742
1459
|
switch (_context20.prev = _context20.next) {
|
|
@@ -1745,7 +1462,6 @@ var I3SConverter = function () {
|
|
|
1745
1462
|
addRefinementPercentage = tilesWithAddRefineCount ? tilesWithAddRefineCount / tilesCount * 100 : 0;
|
|
1746
1463
|
_context20.next = 4;
|
|
1747
1464
|
return (0, _statisticUtills.calculateFilesSize)(params);
|
|
1748
|
-
|
|
1749
1465
|
case 4:
|
|
1750
1466
|
filesSize = _context20.sent;
|
|
1751
1467
|
diff = _process.default.hrtime(this.conversionStartTime);
|
|
@@ -1757,7 +1473,6 @@ var I3SConverter = function () {
|
|
|
1757
1473
|
console.log("File(s) size: ", filesSize, ' bytes');
|
|
1758
1474
|
console.log("Percentage of tiles with \"ADD\" refinement type:", addRefinementPercentage, '%');
|
|
1759
1475
|
console.log("------------------------------------------------");
|
|
1760
|
-
|
|
1761
1476
|
case 14:
|
|
1762
1477
|
case "end":
|
|
1763
1478
|
return _context20.stop();
|
|
@@ -1765,11 +1480,9 @@ var I3SConverter = function () {
|
|
|
1765
1480
|
}
|
|
1766
1481
|
}, _callee20, this);
|
|
1767
1482
|
}));
|
|
1768
|
-
|
|
1769
1483
|
function _finishConversion(_x43) {
|
|
1770
1484
|
return _finishConversion2.apply(this, arguments);
|
|
1771
1485
|
}
|
|
1772
|
-
|
|
1773
1486
|
return _finishConversion;
|
|
1774
1487
|
}()
|
|
1775
1488
|
}, {
|
|
@@ -1785,9 +1498,7 @@ var I3SConverter = function () {
|
|
|
1785
1498
|
_context21.next = 2;
|
|
1786
1499
|
break;
|
|
1787
1500
|
}
|
|
1788
|
-
|
|
1789
1501
|
return _context21.abrupt("return", {});
|
|
1790
|
-
|
|
1791
1502
|
case 2:
|
|
1792
1503
|
options = {
|
|
1793
1504
|
'cesium-ion': {
|
|
@@ -1796,12 +1507,10 @@ var I3SConverter = function () {
|
|
|
1796
1507
|
};
|
|
1797
1508
|
_context21.next = 5;
|
|
1798
1509
|
return this.Loader.preload(this.options.inputUrl, options);
|
|
1799
|
-
|
|
1800
1510
|
case 5:
|
|
1801
1511
|
preloadOptions = _context21.sent;
|
|
1802
1512
|
this.refreshTokenTime = _process.default.hrtime();
|
|
1803
1513
|
return _context21.abrupt("return", _objectSpread(_objectSpread({}, options), preloadOptions));
|
|
1804
|
-
|
|
1805
1514
|
case 8:
|
|
1806
1515
|
case "end":
|
|
1807
1516
|
return _context21.stop();
|
|
@@ -1809,11 +1518,9 @@ var I3SConverter = function () {
|
|
|
1809
1518
|
}
|
|
1810
1519
|
}, _callee21, this);
|
|
1811
1520
|
}));
|
|
1812
|
-
|
|
1813
1521
|
function _fetchPreloadOptions() {
|
|
1814
1522
|
return _fetchPreloadOptions2.apply(this, arguments);
|
|
1815
1523
|
}
|
|
1816
|
-
|
|
1817
1524
|
return _fetchPreloadOptions;
|
|
1818
1525
|
}()
|
|
1819
1526
|
}, {
|
|
@@ -1826,30 +1533,24 @@ var I3SConverter = function () {
|
|
|
1826
1533
|
switch (_context22.prev = _context22.next) {
|
|
1827
1534
|
case 0:
|
|
1828
1535
|
diff = _process.default.hrtime(this.refreshTokenTime);
|
|
1829
|
-
|
|
1830
1536
|
if (!(diff[0] < REFRESH_TOKEN_TIMEOUT)) {
|
|
1831
1537
|
_context22.next = 3;
|
|
1832
1538
|
break;
|
|
1833
1539
|
}
|
|
1834
|
-
|
|
1835
1540
|
return _context22.abrupt("return");
|
|
1836
|
-
|
|
1837
1541
|
case 3:
|
|
1838
1542
|
this.refreshTokenTime = _process.default.hrtime();
|
|
1839
1543
|
_context22.next = 6;
|
|
1840
1544
|
return this._fetchPreloadOptions();
|
|
1841
|
-
|
|
1842
1545
|
case 6:
|
|
1843
1546
|
preloadOptions = _context22.sent;
|
|
1844
1547
|
this.sourceTileset.options = _objectSpread(_objectSpread({}, this.sourceTileset.options), preloadOptions);
|
|
1845
|
-
|
|
1846
1548
|
if (preloadOptions.headers) {
|
|
1847
1549
|
this.sourceTileset.loadOptions.fetch = _objectSpread(_objectSpread({}, this.sourceTileset.loadOptions.fetch), {}, {
|
|
1848
1550
|
headers: preloadOptions.headers
|
|
1849
1551
|
});
|
|
1850
1552
|
console.log('Authorization Bearer token has been updated');
|
|
1851
1553
|
}
|
|
1852
|
-
|
|
1853
1554
|
case 9:
|
|
1854
1555
|
case "end":
|
|
1855
1556
|
return _context22.stop();
|
|
@@ -1857,18 +1558,16 @@ var I3SConverter = function () {
|
|
|
1857
1558
|
}
|
|
1858
1559
|
}, _callee22, this);
|
|
1859
1560
|
}));
|
|
1860
|
-
|
|
1861
1561
|
function _updateTilesetOptions() {
|
|
1862
1562
|
return _updateTilesetOptions2.apply(this, arguments);
|
|
1863
1563
|
}
|
|
1864
|
-
|
|
1865
1564
|
return _updateTilesetOptions;
|
|
1866
1565
|
}()
|
|
1867
1566
|
}, {
|
|
1868
1567
|
key: "_checkAddRefinementTypeForTile",
|
|
1869
|
-
value:
|
|
1568
|
+
value:
|
|
1569
|
+
function _checkAddRefinementTypeForTile(tile) {
|
|
1870
1570
|
var ADD_TILE_REFINEMENT = 1;
|
|
1871
|
-
|
|
1872
1571
|
if (tile.refine === ADD_TILE_REFINEMENT) {
|
|
1873
1572
|
this.refinementCounter.tilesWithAddRefineCount += 1;
|
|
1874
1573
|
console.warn('This tile uses "ADD" type of refinement');
|
|
@@ -1878,9 +1577,9 @@ var I3SConverter = function () {
|
|
|
1878
1577
|
}
|
|
1879
1578
|
}, {
|
|
1880
1579
|
key: "isContentSupported",
|
|
1881
|
-
value:
|
|
1580
|
+
value:
|
|
1581
|
+
function isContentSupported(sourceRootTile) {
|
|
1882
1582
|
var _sourceRootTile$conte;
|
|
1883
|
-
|
|
1884
1583
|
return ['b3dm', 'glTF'].includes(sourceRootTile === null || sourceRootTile === void 0 ? void 0 : (_sourceRootTile$conte = sourceRootTile.content) === null || _sourceRootTile$conte === void 0 ? void 0 : _sourceRootTile$conte.type);
|
|
1885
1584
|
}
|
|
1886
1585
|
}, {
|
|
@@ -1888,65 +1587,52 @@ var I3SConverter = function () {
|
|
|
1888
1587
|
value: function () {
|
|
1889
1588
|
var _loadWorkers = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee23() {
|
|
1890
1589
|
var url, _sourceResponse, _source, _url, _sourceResponse2, _source2, i3sAttributesWorkerUrl, sourceResponse, source;
|
|
1891
|
-
|
|
1892
1590
|
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
1893
1591
|
while (1) {
|
|
1894
1592
|
switch (_context23.prev = _context23.next) {
|
|
1895
1593
|
case 0:
|
|
1896
1594
|
console.log("Loading workers source...");
|
|
1897
|
-
|
|
1898
1595
|
if (!this.options.draco) {
|
|
1899
1596
|
_context23.next = 10;
|
|
1900
1597
|
break;
|
|
1901
1598
|
}
|
|
1902
|
-
|
|
1903
1599
|
url = (0, _workerUtils.getWorkerURL)(_draco.DracoWriterWorker, _objectSpread({}, (0, _core.getLoaderOptions)()));
|
|
1904
1600
|
_context23.next = 5;
|
|
1905
1601
|
return (0, _core.fetchFile)(url);
|
|
1906
|
-
|
|
1907
1602
|
case 5:
|
|
1908
1603
|
_sourceResponse = _context23.sent;
|
|
1909
1604
|
_context23.next = 8;
|
|
1910
1605
|
return _sourceResponse.text();
|
|
1911
|
-
|
|
1912
1606
|
case 8:
|
|
1913
1607
|
_source = _context23.sent;
|
|
1914
1608
|
this.workerSource.draco = _source;
|
|
1915
|
-
|
|
1916
1609
|
case 10:
|
|
1917
1610
|
if (!this.generateTextures) {
|
|
1918
1611
|
_context23.next = 19;
|
|
1919
1612
|
break;
|
|
1920
1613
|
}
|
|
1921
|
-
|
|
1922
1614
|
_url = (0, _workerUtils.getWorkerURL)(_textures.KTX2BasisWriterWorker, _objectSpread({}, (0, _core.getLoaderOptions)()));
|
|
1923
1615
|
_context23.next = 14;
|
|
1924
1616
|
return (0, _core.fetchFile)(_url);
|
|
1925
|
-
|
|
1926
1617
|
case 14:
|
|
1927
1618
|
_sourceResponse2 = _context23.sent;
|
|
1928
1619
|
_context23.next = 17;
|
|
1929
1620
|
return _sourceResponse2.text();
|
|
1930
|
-
|
|
1931
1621
|
case 17:
|
|
1932
1622
|
_source2 = _context23.sent;
|
|
1933
1623
|
this.workerSource.ktx2 = _source2;
|
|
1934
|
-
|
|
1935
1624
|
case 19:
|
|
1936
1625
|
i3sAttributesWorkerUrl = (0, _workerUtils.getWorkerURL)(_i3sAttributesWorker.I3SAttributesWorker, _objectSpread({}, (0, _core.getLoaderOptions)()));
|
|
1937
1626
|
_context23.next = 22;
|
|
1938
1627
|
return (0, _core.fetchFile)(i3sAttributesWorkerUrl);
|
|
1939
|
-
|
|
1940
1628
|
case 22:
|
|
1941
1629
|
sourceResponse = _context23.sent;
|
|
1942
1630
|
_context23.next = 25;
|
|
1943
1631
|
return sourceResponse.text();
|
|
1944
|
-
|
|
1945
1632
|
case 25:
|
|
1946
1633
|
source = _context23.sent;
|
|
1947
1634
|
this.workerSource.I3SAttributes = source;
|
|
1948
1635
|
console.log("Loading workers source completed!");
|
|
1949
|
-
|
|
1950
1636
|
case 28:
|
|
1951
1637
|
case "end":
|
|
1952
1638
|
return _context23.stop();
|
|
@@ -1954,16 +1640,13 @@ var I3SConverter = function () {
|
|
|
1954
1640
|
}
|
|
1955
1641
|
}, _callee23, this);
|
|
1956
1642
|
}));
|
|
1957
|
-
|
|
1958
1643
|
function loadWorkers() {
|
|
1959
1644
|
return _loadWorkers.apply(this, arguments);
|
|
1960
1645
|
}
|
|
1961
|
-
|
|
1962
1646
|
return loadWorkers;
|
|
1963
1647
|
}()
|
|
1964
1648
|
}]);
|
|
1965
1649
|
return I3SConverter;
|
|
1966
1650
|
}();
|
|
1967
|
-
|
|
1968
1651
|
exports.default = I3SConverter;
|
|
1969
1652
|
//# sourceMappingURL=i3s-converter.js.map
|