@loaders.gl/tile-converter 4.0.0-alpha.19 → 4.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/converter-cli.js +10 -2
- package/dist/converter.min.js +172 -103
- package/dist/dist.min.js +33357 -33374
- package/dist/es5/constants.js +5 -1
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/converter-cli.js +7 -2
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +21 -8
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +7 -6
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +67 -59
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +38 -9
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +55 -13
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/types.js +11 -11
- package/dist/es5/i3s-converter/types.js.map +1 -1
- package/dist/es5/i3s-server/controllers/slpk-controller.js +2 -2
- package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/es5/index.js +0 -7
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/es5/slpk-extractor/slpk-extractor.js +10 -11
- package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -1
- package/dist/esm/constants.js +2 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/converter-cli.js +7 -2
- package/dist/esm/converter-cli.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +18 -6
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +7 -6
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +28 -20
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +28 -9
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +39 -9
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-converter/types.js +9 -9
- package/dist/esm/i3s-converter/types.js.map +1 -1
- package/dist/esm/i3s-server/bin/i3s-server.min.js +69 -69
- package/dist/esm/i3s-server/controllers/slpk-controller.js +2 -2
- package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/esm/slpk-extractor/slpk-extractor.js +3 -4
- package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +11 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +33 -13
- package/dist/i3s-converter/helpers/geometry-attributes.js +7 -6
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +6 -3
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +42 -35
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +2 -2
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +39 -14
- package/dist/i3s-converter/i3s-converter.d.ts +2 -0
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +40 -10
- package/dist/i3s-converter/types.d.ts +4 -2
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/i3s-converter/types.js +11 -11
- package/dist/i3s-server/controllers/slpk-controller.js +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/slpk-extractor/slpk-extractor.d.ts +1 -1
- package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -1
- package/dist/slpk-extractor/slpk-extractor.js +6 -7
- package/dist/slpk-extractor.min.js +42 -42
- package/package.json +15 -14
- package/src/constants.ts +3 -0
- package/src/converter-cli.ts +9 -2
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +39 -12
- package/src/i3s-converter/helpers/geometry-attributes.ts +15 -8
- package/src/i3s-converter/helpers/geometry-converter.ts +66 -35
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +48 -18
- package/src/i3s-converter/i3s-converter.ts +54 -12
- package/src/i3s-converter/types.ts +4 -2
- package/src/i3s-server/controllers/slpk-controller.ts +2 -2
- package/src/index.ts +0 -1
- package/src/slpk-extractor/slpk-extractor.ts +3 -4
- package/dist/es5/slpk-extractor/helpers/file-handle-provider.js +0 -214
- package/dist/es5/slpk-extractor/helpers/file-handle-provider.js.map +0 -1
- package/dist/es5/slpk-extractor/helpers/fs-promises.js +0 -77
- package/dist/es5/slpk-extractor/helpers/fs-promises.js.map +0 -1
- package/dist/esm/slpk-extractor/helpers/file-handle-provider.js +0 -54
- package/dist/esm/slpk-extractor/helpers/file-handle-provider.js.map +0 -1
- package/dist/esm/slpk-extractor/helpers/fs-promises.js +0 -32
- package/dist/esm/slpk-extractor/helpers/fs-promises.js.map +0 -1
- package/dist/slpk-extractor/helpers/file-handle-provider.d.ts +0 -51
- package/dist/slpk-extractor/helpers/file-handle-provider.d.ts.map +0 -1
- package/dist/slpk-extractor/helpers/file-handle-provider.js +0 -86
- package/dist/slpk-extractor/helpers/fs-promises.d.ts +0 -38
- package/dist/slpk-extractor/helpers/fs-promises.d.ts.map +0 -1
- package/dist/slpk-extractor/helpers/fs-promises.js +0 -51
- package/src/slpk-extractor/helpers/file-handle-provider.ts +0 -109
- package/src/slpk-extractor/helpers/fs-promises.ts +0 -66
|
@@ -25,6 +25,7 @@ var _batchIdsExtensions = require("./batch-ids-extensions");
|
|
|
25
25
|
var _featureAttributes = require("./feature-attributes");
|
|
26
26
|
var _math = require("@loaders.gl/math");
|
|
27
27
|
var _geometryUtils = require("../../lib/utils/geometry-utils");
|
|
28
|
+
var _constants = require("../../constants");
|
|
28
29
|
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); }
|
|
29
30
|
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; }
|
|
30
31
|
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; }
|
|
@@ -42,16 +43,14 @@ var SHORT_INT_TYPE = 'Int32';
|
|
|
42
43
|
var DOUBLE_TYPE = 'Float64';
|
|
43
44
|
var OBJECT_ID_TYPE = 'Oid32';
|
|
44
45
|
var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ['CUSTOM_ATTRIBUTE_2', '_BATCHID', 'BATCHID'];
|
|
45
|
-
var EXT_FEATURE_METADATA = 'EXT_feature_metadata';
|
|
46
|
-
var EXT_MESH_FEATURES = 'EXT_mesh_features';
|
|
47
46
|
var scratchVector = new _core.Vector3();
|
|
48
|
-
function convertB3dmToI3sGeometry(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12) {
|
|
47
|
+
function convertB3dmToI3sGeometry(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12, _x13) {
|
|
49
48
|
return _convertB3dmToI3sGeometry.apply(this, arguments);
|
|
50
49
|
}
|
|
51
50
|
function _convertB3dmToI3sGeometry() {
|
|
52
|
-
_convertB3dmToI3sGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, libraries) {
|
|
51
|
+
_convertB3dmToI3sGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, libraries, metadataClass) {
|
|
53
52
|
var _tileContent$gltf4;
|
|
54
|
-
var useCartesianPositions, materialAndTextureList, dataForAttributesConversion, convertedAttributesMap, result, _iterator6, _step6, materialAndTexture, originarMaterialId, convertedAttributes, material, texture, nodeId;
|
|
53
|
+
var useCartesianPositions, materialAndTextureList, dataForAttributesConversion, featureTexture, convertedAttributesMap, result, _iterator6, _step6, materialAndTexture, originarMaterialId, convertedAttributes, material, texture, nodeId;
|
|
55
54
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
56
55
|
while (1) switch (_context.prev = _context.next) {
|
|
57
56
|
case 0:
|
|
@@ -61,44 +60,45 @@ function _convertB3dmToI3sGeometry() {
|
|
|
61
60
|
case 3:
|
|
62
61
|
materialAndTextureList = _context.sent;
|
|
63
62
|
dataForAttributesConversion = (0, _gltfAttributes.prepareDataForAttributesConversion)(tileContent, tileTransform, tileBoundingVolume);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
featureTexture = (0, _batchIdsExtensions.getTextureByMetadataClass)(tileContent, metadataClass);
|
|
64
|
+
_context.next = 8;
|
|
65
|
+
return convertAttributes(dataForAttributesConversion, materialAndTextureList, useCartesianPositions, featureTexture);
|
|
66
|
+
case 8:
|
|
67
67
|
convertedAttributesMap = _context.sent;
|
|
68
68
|
if (generateBoundingVolumes) {
|
|
69
69
|
_generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeightModel);
|
|
70
70
|
}
|
|
71
71
|
result = [];
|
|
72
72
|
_iterator6 = _createForOfIteratorHelper(materialAndTextureList);
|
|
73
|
-
_context.prev =
|
|
73
|
+
_context.prev = 12;
|
|
74
74
|
_iterator6.s();
|
|
75
|
-
case
|
|
75
|
+
case 14:
|
|
76
76
|
if ((_step6 = _iterator6.n()).done) {
|
|
77
|
-
_context.next =
|
|
77
|
+
_context.next = 33;
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
80
80
|
materialAndTexture = _step6.value;
|
|
81
81
|
originarMaterialId = materialAndTexture.mergedMaterials[0].originalMaterialId;
|
|
82
82
|
if (convertedAttributesMap.has(originarMaterialId)) {
|
|
83
|
-
_context.next =
|
|
83
|
+
_context.next = 19;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
|
-
return _context.abrupt("continue",
|
|
87
|
-
case
|
|
86
|
+
return _context.abrupt("continue", 31);
|
|
87
|
+
case 19:
|
|
88
88
|
convertedAttributes = convertedAttributesMap.get(originarMaterialId);
|
|
89
89
|
if (convertedAttributes) {
|
|
90
|
-
_context.next =
|
|
90
|
+
_context.next = 22;
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
|
-
return _context.abrupt("continue",
|
|
94
|
-
case
|
|
93
|
+
return _context.abrupt("continue", 31);
|
|
94
|
+
case 22:
|
|
95
95
|
material = materialAndTexture.material, texture = materialAndTexture.texture;
|
|
96
|
-
_context.next =
|
|
96
|
+
_context.next = 25;
|
|
97
97
|
return addNodeToNodePage();
|
|
98
|
-
case
|
|
98
|
+
case 25:
|
|
99
99
|
nodeId = _context.sent;
|
|
100
100
|
_context.t0 = result;
|
|
101
|
-
_context.next =
|
|
101
|
+
_context.next = 29;
|
|
102
102
|
return _makeNodeResources({
|
|
103
103
|
convertedAttributes: convertedAttributes,
|
|
104
104
|
material: material,
|
|
@@ -111,36 +111,36 @@ function _convertB3dmToI3sGeometry() {
|
|
|
111
111
|
draco: draco,
|
|
112
112
|
libraries: libraries
|
|
113
113
|
});
|
|
114
|
-
case
|
|
114
|
+
case 29:
|
|
115
115
|
_context.t1 = _context.sent;
|
|
116
116
|
_context.t0.push.call(_context.t0, _context.t1);
|
|
117
|
-
case
|
|
118
|
-
_context.next =
|
|
117
|
+
case 31:
|
|
118
|
+
_context.next = 14;
|
|
119
119
|
break;
|
|
120
|
-
case
|
|
121
|
-
_context.next =
|
|
120
|
+
case 33:
|
|
121
|
+
_context.next = 38;
|
|
122
122
|
break;
|
|
123
|
-
case
|
|
124
|
-
_context.prev =
|
|
125
|
-
_context.t2 = _context["catch"](
|
|
123
|
+
case 35:
|
|
124
|
+
_context.prev = 35;
|
|
125
|
+
_context.t2 = _context["catch"](12);
|
|
126
126
|
_iterator6.e(_context.t2);
|
|
127
|
-
case
|
|
128
|
-
_context.prev =
|
|
127
|
+
case 38:
|
|
128
|
+
_context.prev = 38;
|
|
129
129
|
_iterator6.f();
|
|
130
|
-
return _context.finish(
|
|
131
|
-
case
|
|
130
|
+
return _context.finish(38);
|
|
131
|
+
case 41:
|
|
132
132
|
if (result.length) {
|
|
133
|
-
_context.next =
|
|
133
|
+
_context.next = 43;
|
|
134
134
|
break;
|
|
135
135
|
}
|
|
136
136
|
return _context.abrupt("return", null);
|
|
137
|
-
case 42:
|
|
138
|
-
return _context.abrupt("return", result);
|
|
139
137
|
case 43:
|
|
138
|
+
return _context.abrupt("return", result);
|
|
139
|
+
case 44:
|
|
140
140
|
case "end":
|
|
141
141
|
return _context.stop();
|
|
142
142
|
}
|
|
143
|
-
}, _callee, null, [[
|
|
143
|
+
}, _callee, null, [[12, 35, 38, 41]]);
|
|
144
144
|
}));
|
|
145
145
|
return _convertB3dmToI3sGeometry.apply(this, arguments);
|
|
146
146
|
}
|
|
@@ -167,7 +167,7 @@ function _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeigh
|
|
|
167
167
|
_iterator.f();
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
function _makeNodeResources(
|
|
170
|
+
function _makeNodeResources(_x14) {
|
|
171
171
|
return _makeNodeResources2.apply(this, arguments);
|
|
172
172
|
}
|
|
173
173
|
function _makeNodeResources2() {
|
|
@@ -222,11 +222,11 @@ function _makeNodeResources2() {
|
|
|
222
222
|
}));
|
|
223
223
|
return _makeNodeResources2.apply(this, arguments);
|
|
224
224
|
}
|
|
225
|
-
function convertAttributes(
|
|
225
|
+
function convertAttributes(_x15, _x16, _x17, _x18) {
|
|
226
226
|
return _convertAttributes.apply(this, arguments);
|
|
227
227
|
}
|
|
228
228
|
function _convertAttributes() {
|
|
229
|
-
_convertAttributes = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(attributesData, materialAndTextureList, useCartesianPositions) {
|
|
229
|
+
_convertAttributes = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(attributesData, materialAndTextureList, useCartesianPositions, featureTexture) {
|
|
230
230
|
var nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, _iterator7, _step7, materialAndTexture, attributes, _iterator9, _step9, mergedMaterial, _iterator8, _step8, attrKey, _attributes;
|
|
231
231
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
232
232
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -265,7 +265,7 @@ function _convertAttributes() {
|
|
|
265
265
|
} finally {
|
|
266
266
|
_iterator7.f();
|
|
267
267
|
}
|
|
268
|
-
convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions);
|
|
268
|
+
convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, undefined, featureTexture);
|
|
269
269
|
_iterator8 = _createForOfIteratorHelper(attributesMap.keys());
|
|
270
270
|
_context3.prev = 6;
|
|
271
271
|
_iterator8.s();
|
|
@@ -321,13 +321,14 @@ function _convertAttributes() {
|
|
|
321
321
|
}
|
|
322
322
|
function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
|
|
323
323
|
var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
324
|
+
var featureTexture = arguments.length > 7 ? arguments[7] : undefined;
|
|
324
325
|
if (nodes) {
|
|
325
326
|
var _iterator2 = _createForOfIteratorHelper(nodes),
|
|
326
327
|
_step2;
|
|
327
328
|
try {
|
|
328
329
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
329
330
|
var node = _step2.value;
|
|
330
|
-
convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
|
|
331
|
+
convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix, featureTexture);
|
|
331
332
|
}
|
|
332
333
|
} catch (err) {
|
|
333
334
|
_iterator2.e(err);
|
|
@@ -358,16 +359,18 @@ function getCompositeTransformationMatrix(node, matrix) {
|
|
|
358
359
|
}
|
|
359
360
|
function convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
|
|
360
361
|
var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
362
|
+
var featureTexture = arguments.length > 7 ? arguments[7] : undefined;
|
|
361
363
|
var transformationMatrix = getCompositeTransformationMatrix(node, matrix);
|
|
362
364
|
var mesh = node.mesh;
|
|
363
365
|
if (mesh) {
|
|
364
|
-
convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
366
|
+
convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix, featureTexture);
|
|
365
367
|
}
|
|
366
|
-
convertNodes(node.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
368
|
+
convertNodes(node.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix, featureTexture);
|
|
367
369
|
}
|
|
368
370
|
function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap) {
|
|
369
371
|
var useCartesianPositions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
370
372
|
var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
373
|
+
var featureTexture = arguments.length > 7 ? arguments[7] : undefined;
|
|
371
374
|
var _iterator3 = _createForOfIteratorHelper(mesh.primitives),
|
|
372
375
|
_step3;
|
|
373
376
|
try {
|
|
@@ -417,7 +420,7 @@ function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, att
|
|
|
417
420
|
outputAttributes.uvRegions = (0, _loaderUtils.concatenateTypedArrays)(outputAttributes.uvRegions, createUvRegion(materialUvRegion, indices));
|
|
418
421
|
}
|
|
419
422
|
outputAttributes.featureIndicesGroups = outputAttributes.featureIndicesGroups || [];
|
|
420
|
-
outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images), indices));
|
|
423
|
+
outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images, featureTexture), indices));
|
|
421
424
|
};
|
|
422
425
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
423
426
|
var _ret = _loop();
|
|
@@ -550,8 +553,8 @@ function flattenBatchIds(batchedIds, indices) {
|
|
|
550
553
|
}
|
|
551
554
|
return newBatchIds;
|
|
552
555
|
}
|
|
553
|
-
function getBatchIds(attributes, primitive, images) {
|
|
554
|
-
var batchIds = (0, _batchIdsExtensions.handleBatchIdsExtensions)(attributes, primitive, images);
|
|
556
|
+
function getBatchIds(attributes, primitive, images, featureTexture) {
|
|
557
|
+
var batchIds = (0, _batchIdsExtensions.handleBatchIdsExtensions)(attributes, primitive, images, featureTexture);
|
|
555
558
|
if (batchIds.length) {
|
|
556
559
|
return batchIds;
|
|
557
560
|
}
|
|
@@ -610,7 +613,7 @@ function _convertMaterials() {
|
|
|
610
613
|
}));
|
|
611
614
|
return _convertMaterials.apply(this, arguments);
|
|
612
615
|
}
|
|
613
|
-
function mergeAllMaterials(
|
|
616
|
+
function mergeAllMaterials(_x19) {
|
|
614
617
|
return _mergeAllMaterials.apply(this, arguments);
|
|
615
618
|
}
|
|
616
619
|
function _mergeAllMaterials() {
|
|
@@ -708,7 +711,7 @@ function _mergeAllMaterials() {
|
|
|
708
711
|
}));
|
|
709
712
|
return _mergeAllMaterials.apply(this, arguments);
|
|
710
713
|
}
|
|
711
|
-
function mergeMaterials(
|
|
714
|
+
function mergeMaterials(_x20, _x21) {
|
|
712
715
|
return _mergeMaterials.apply(this, arguments);
|
|
713
716
|
}
|
|
714
717
|
function _mergeMaterials() {
|
|
@@ -1035,7 +1038,7 @@ function generateBigUint64Array(featureIds) {
|
|
|
1035
1038
|
}
|
|
1036
1039
|
return typedFeatureIds;
|
|
1037
1040
|
}
|
|
1038
|
-
function generateCompressedGeometry(
|
|
1041
|
+
function generateCompressedGeometry(_x22, _x23, _x24, _x25) {
|
|
1039
1042
|
return _generateCompressedGeometry.apply(this, arguments);
|
|
1040
1043
|
}
|
|
1041
1044
|
function _generateCompressedGeometry() {
|
|
@@ -1107,7 +1110,7 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
|
|
|
1107
1110
|
}
|
|
1108
1111
|
return orderedFeatureIndices;
|
|
1109
1112
|
}
|
|
1110
|
-
function getPropertyTable(tileContent) {
|
|
1113
|
+
function getPropertyTable(tileContent, metadataClass) {
|
|
1111
1114
|
if (!tileContent) {
|
|
1112
1115
|
return null;
|
|
1113
1116
|
}
|
|
@@ -1119,14 +1122,14 @@ function getPropertyTable(tileContent) {
|
|
|
1119
1122
|
extensionName = _getPropertyTableExte.extensionName,
|
|
1120
1123
|
extension = _getPropertyTableExte.extension;
|
|
1121
1124
|
switch (extensionName) {
|
|
1122
|
-
case EXT_MESH_FEATURES:
|
|
1125
|
+
case _constants.EXT_MESH_FEATURES:
|
|
1123
1126
|
{
|
|
1124
1127
|
console.warn('The I3S converter does not yet support the EXT_mesh_features extension');
|
|
1125
1128
|
return null;
|
|
1126
1129
|
}
|
|
1127
|
-
case EXT_FEATURE_METADATA:
|
|
1130
|
+
case _constants.EXT_FEATURE_METADATA:
|
|
1128
1131
|
{
|
|
1129
|
-
return getPropertyTableFromExtFeatureMetadata(extension);
|
|
1132
|
+
return getPropertyTableFromExtFeatureMetadata(extension, metadataClass);
|
|
1130
1133
|
}
|
|
1131
1134
|
default:
|
|
1132
1135
|
return null;
|
|
@@ -1134,7 +1137,7 @@ function getPropertyTable(tileContent) {
|
|
|
1134
1137
|
}
|
|
1135
1138
|
function getPropertyTableExtension(tileContent) {
|
|
1136
1139
|
var _tileContent$gltf, _tileContent$gltf2, _tileContent$gltf2$ex, _tileContent$gltf3;
|
|
1137
|
-
var extensionsWithPropertyTables = [EXT_FEATURE_METADATA, EXT_MESH_FEATURES];
|
|
1140
|
+
var extensionsWithPropertyTables = [_constants.EXT_FEATURE_METADATA, _constants.EXT_MESH_FEATURES];
|
|
1138
1141
|
var extensionsUsed = tileContent === null || tileContent === void 0 ? void 0 : (_tileContent$gltf = tileContent.gltf) === null || _tileContent$gltf === void 0 ? void 0 : _tileContent$gltf.extensionsUsed;
|
|
1139
1142
|
if (!extensionsUsed) {
|
|
1140
1143
|
return {
|
|
@@ -1170,7 +1173,7 @@ function getPropertyTableExtension(tileContent) {
|
|
|
1170
1173
|
extension: extension
|
|
1171
1174
|
};
|
|
1172
1175
|
}
|
|
1173
|
-
function getPropertyTableFromExtFeatureMetadata(extension) {
|
|
1176
|
+
function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
1174
1177
|
if (extension !== null && extension !== void 0 && extension.featureTables) {
|
|
1175
1178
|
var _Object$keys;
|
|
1176
1179
|
var firstFeatureTableName = (_Object$keys = Object.keys(extension.featureTables)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0];
|
|
@@ -1184,10 +1187,15 @@ function getPropertyTableFromExtFeatureMetadata(extension) {
|
|
|
1184
1187
|
}
|
|
1185
1188
|
}
|
|
1186
1189
|
if (extension !== null && extension !== void 0 && extension.featureTextures) {
|
|
1187
|
-
var
|
|
1188
|
-
var
|
|
1189
|
-
|
|
1190
|
-
|
|
1190
|
+
var featureTexture;
|
|
1191
|
+
for (var textureKey in extension.featureTextures) {
|
|
1192
|
+
var texture = extension.featureTextures[textureKey];
|
|
1193
|
+
if (texture.class === metadataClass) {
|
|
1194
|
+
featureTexture = textureKey;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
if (typeof featureTexture === 'string') {
|
|
1198
|
+
var _featureTable = extension === null || extension === void 0 ? void 0 : extension.featureTextures[featureTexture];
|
|
1191
1199
|
var _propertyTable = {};
|
|
1192
1200
|
for (var _propertyName in _featureTable.properties) {
|
|
1193
1201
|
_propertyTable[_propertyName] = _featureTable.properties[_propertyName].data;
|