@loaders.gl/i3s 3.4.13 → 3.4.15
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/dist.min.js +124 -111
- package/dist/es5/arcgis-webscene-loader.js +5 -22
- package/dist/es5/arcgis-webscene-loader.js.map +1 -1
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/i3s-attribute-loader.js +58 -123
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +8 -28
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +16 -35
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +49 -148
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +8 -39
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/i3s-slpk-loader.js +2 -2
- package/dist/es5/i3s-slpk-loader.js.map +1 -1
- package/dist/es5/index.js +8 -8
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +161 -267
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/constants.js +6 -6
- package/dist/es5/lib/parsers/constants.js.map +1 -1
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js +64 -146
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-attribute.js +26 -55
- package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js +27 -47
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +278 -347
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js +55 -79
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js +30 -81
- package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
- package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js +44 -90
- package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
- package/dist/es5/lib/parsers/parse-zip/cd-file-header.js +17 -17
- package/dist/es5/lib/parsers/parse-zip/cd-file-header.js.map +1 -1
- package/dist/es5/lib/parsers/parse-zip/local-file-header.js +10 -10
- package/dist/es5/lib/parsers/parse-zip/local-file-header.js.map +1 -1
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +4 -6
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
- package/dist/es5/lib/utils/customizeColors.js +79 -140
- package/dist/es5/lib/utils/customizeColors.js.map +1 -1
- package/dist/es5/lib/utils/url-utils.js +14 -11
- package/dist/es5/lib/utils/url-utils.js.map +1 -1
- package/dist/es5/types.js +2 -2
- package/dist/esm/arcgis-webscene-loader.js +1 -1
- package/dist/esm/i3s-attribute-loader.js +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
- package/dist/esm/i3s-content-loader.js +1 -1
- package/dist/esm/i3s-loader.js +1 -1
- package/dist/esm/i3s-node-page-loader.js +1 -1
- package/dist/esm/i3s-slpk-loader.js +1 -1
- package/dist/i3s-content-nodejs-worker.js +61 -59
- package/dist/i3s-content-nodejs-worker.js.map +3 -3
- package/dist/i3s-content-worker.js +69 -81
- package/package.json +9 -9
|
@@ -5,25 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
9
|
var _core = require("@loaders.gl/core");
|
|
14
10
|
var _textures = require("@loaders.gl/textures");
|
|
15
11
|
var _i3sNodePageLoader = require("../../i3s-node-page-loader");
|
|
16
12
|
var _parseI3s = require("../parsers/parse-i3s");
|
|
17
13
|
var _urlUtils = require("../utils/url-utils");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
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; }
|
|
23
|
-
var I3SNodePagesTiles = function () {
|
|
24
|
-
function I3SNodePagesTiles(tileset, options) {
|
|
14
|
+
class I3SNodePagesTiles {
|
|
15
|
+
constructor(tileset, options) {
|
|
25
16
|
var _tileset$nodePages, _tileset$nodePages2;
|
|
26
|
-
(0, _classCallCheck2.default)(this, I3SNodePagesTiles);
|
|
27
17
|
(0, _defineProperty2.default)(this, "tileset", void 0);
|
|
28
18
|
(0, _defineProperty2.default)(this, "nodePages", []);
|
|
29
19
|
(0, _defineProperty2.default)(this, "pendingNodePages", []);
|
|
@@ -33,280 +23,184 @@ var I3SNodePagesTiles = function () {
|
|
|
33
23
|
(0, _defineProperty2.default)(this, "textureDefinitionsSelectedFormats", []);
|
|
34
24
|
(0, _defineProperty2.default)(this, "nodesInNodePages", void 0);
|
|
35
25
|
(0, _defineProperty2.default)(this, "textureLoaderOptions", {});
|
|
36
|
-
this.tileset =
|
|
26
|
+
this.tileset = {
|
|
27
|
+
...tileset
|
|
28
|
+
};
|
|
37
29
|
this.nodesPerPage = ((_tileset$nodePages = tileset.nodePages) === null || _tileset$nodePages === void 0 ? void 0 : _tileset$nodePages.nodesPerPage) || 64;
|
|
38
30
|
this.lodSelectionMetricType = (_tileset$nodePages2 = tileset.nodePages) === null || _tileset$nodePages2 === void 0 ? void 0 : _tileset$nodePages2.lodSelectionMetricType;
|
|
39
31
|
this.options = options;
|
|
40
32
|
this.nodesInNodePages = 0;
|
|
41
33
|
this.initSelectedFormatsForTextureDefinitions(tileset);
|
|
42
34
|
}
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return this.getNodeById(id);
|
|
100
|
-
case 2:
|
|
101
|
-
node = _context2.sent;
|
|
102
|
-
children = [];
|
|
103
|
-
childNodesPromises = [];
|
|
104
|
-
_iterator = _createForOfIteratorHelper(node.children || []);
|
|
105
|
-
try {
|
|
106
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
107
|
-
child = _step.value;
|
|
108
|
-
childNodesPromises.push(this.getNodeById(child));
|
|
109
|
-
}
|
|
110
|
-
} catch (err) {
|
|
111
|
-
_iterator.e(err);
|
|
112
|
-
} finally {
|
|
113
|
-
_iterator.f();
|
|
114
|
-
}
|
|
115
|
-
_context2.next = 9;
|
|
116
|
-
return Promise.all(childNodesPromises);
|
|
117
|
-
case 9:
|
|
118
|
-
childNodes = _context2.sent;
|
|
119
|
-
_iterator2 = _createForOfIteratorHelper(childNodes);
|
|
120
|
-
try {
|
|
121
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
122
|
-
childNode = _step2.value;
|
|
123
|
-
children.push({
|
|
124
|
-
id: childNode.index.toString(),
|
|
125
|
-
obb: childNode.obb
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
} catch (err) {
|
|
129
|
-
_iterator2.e(err);
|
|
130
|
-
} finally {
|
|
131
|
-
_iterator2.f();
|
|
132
|
-
}
|
|
133
|
-
textureFormat = 'jpg';
|
|
134
|
-
attributeUrls = [];
|
|
135
|
-
isDracoGeometry = false;
|
|
136
|
-
if (node && node.mesh) {
|
|
137
|
-
_ref = node.mesh.geometry && this.getContentUrl(node.mesh.geometry) || {
|
|
138
|
-
isDracoGeometry: false
|
|
139
|
-
}, url = _ref.url, isDracoGeometryResult = _ref.isDracoGeometry;
|
|
140
|
-
contentUrl = url;
|
|
141
|
-
isDracoGeometry = isDracoGeometryResult;
|
|
142
|
-
_this$getInformationF = this.getInformationFromMaterial(node.mesh.material), textureData = _this$getInformationF.textureData, nodeMaterialDefinition = _this$getInformationF.materialDefinition;
|
|
143
|
-
materialDefinition = nodeMaterialDefinition;
|
|
144
|
-
textureFormat = textureData.format || textureFormat;
|
|
145
|
-
if (textureData.name) {
|
|
146
|
-
textureUrl = "".concat(this.tileset.url, "/nodes/").concat(node.mesh.material.resource, "/textures/").concat(textureData.name);
|
|
147
|
-
}
|
|
148
|
-
if (this.tileset.attributeStorageInfo) {
|
|
149
|
-
attributeUrls = (0, _urlUtils.generateTilesetAttributeUrls)(this.tileset, node.mesh.attribute.resource);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
lodSelection = this.getLodSelection(node);
|
|
153
|
-
return _context2.abrupt("return", (0, _parseI3s.normalizeTileNonUrlData)({
|
|
154
|
-
id: id.toString(),
|
|
155
|
-
lodSelection: lodSelection,
|
|
156
|
-
obb: node.obb,
|
|
157
|
-
contentUrl: contentUrl,
|
|
158
|
-
textureUrl: textureUrl,
|
|
159
|
-
attributeUrls: attributeUrls,
|
|
160
|
-
materialDefinition: materialDefinition,
|
|
161
|
-
textureFormat: textureFormat,
|
|
162
|
-
textureLoaderOptions: this.textureLoaderOptions,
|
|
163
|
-
children: children,
|
|
164
|
-
isDracoGeometry: isDracoGeometry
|
|
165
|
-
}));
|
|
166
|
-
case 18:
|
|
167
|
-
case "end":
|
|
168
|
-
return _context2.stop();
|
|
169
|
-
}
|
|
170
|
-
}, _callee2, this);
|
|
171
|
-
}));
|
|
172
|
-
function formTileFromNodePages(_x2) {
|
|
173
|
-
return _formTileFromNodePages.apply(this, arguments);
|
|
174
|
-
}
|
|
175
|
-
return formTileFromNodePages;
|
|
176
|
-
}()
|
|
177
|
-
}, {
|
|
178
|
-
key: "getContentUrl",
|
|
179
|
-
value: function getContentUrl(meshGeometryData) {
|
|
180
|
-
var result = null;
|
|
181
|
-
var geometryDefinition = this.tileset.geometryDefinitions[meshGeometryData.definition];
|
|
182
|
-
var geometryIndex = -1;
|
|
183
|
-
if (this.options.i3s && this.options.i3s.useDracoGeometry) {
|
|
184
|
-
geometryIndex = geometryDefinition.geometryBuffers.findIndex(function (buffer) {
|
|
185
|
-
return buffer.compressedAttributes && buffer.compressedAttributes.encoding === 'draco';
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
if (geometryIndex === -1) {
|
|
189
|
-
geometryIndex = geometryDefinition.geometryBuffers.findIndex(function (buffer) {
|
|
190
|
-
return !buffer.compressedAttributes;
|
|
191
|
-
});
|
|
35
|
+
async getNodeById(id) {
|
|
36
|
+
const pageIndex = Math.floor(id / this.nodesPerPage);
|
|
37
|
+
if (!this.nodePages[pageIndex] && !this.pendingNodePages[pageIndex]) {
|
|
38
|
+
var _this$options$i3s;
|
|
39
|
+
const nodePageUrl = (0, _urlUtils.getUrlWithToken)("".concat(this.tileset.url, "/nodepages/").concat(pageIndex), (_this$options$i3s = this.options.i3s) === null || _this$options$i3s === void 0 ? void 0 : _this$options$i3s.token);
|
|
40
|
+
this.pendingNodePages[pageIndex] = {
|
|
41
|
+
status: 'Pending',
|
|
42
|
+
promise: (0, _core.load)(nodePageUrl, _i3sNodePageLoader.I3SNodePageLoader, this.options)
|
|
43
|
+
};
|
|
44
|
+
this.nodePages[pageIndex] = await this.pendingNodePages[pageIndex].promise;
|
|
45
|
+
this.nodesInNodePages += this.nodePages[pageIndex].nodes.length;
|
|
46
|
+
this.pendingNodePages[pageIndex].status = 'Done';
|
|
47
|
+
}
|
|
48
|
+
if (this.pendingNodePages[pageIndex].status === 'Pending') {
|
|
49
|
+
this.nodePages[pageIndex] = await this.pendingNodePages[pageIndex].promise;
|
|
50
|
+
}
|
|
51
|
+
const nodeIndex = id % this.nodesPerPage;
|
|
52
|
+
return this.nodePages[pageIndex].nodes[nodeIndex];
|
|
53
|
+
}
|
|
54
|
+
async formTileFromNodePages(id) {
|
|
55
|
+
const node = await this.getNodeById(id);
|
|
56
|
+
const children = [];
|
|
57
|
+
const childNodesPromises = [];
|
|
58
|
+
for (const child of node.children || []) {
|
|
59
|
+
childNodesPromises.push(this.getNodeById(child));
|
|
60
|
+
}
|
|
61
|
+
const childNodes = await Promise.all(childNodesPromises);
|
|
62
|
+
for (const childNode of childNodes) {
|
|
63
|
+
children.push({
|
|
64
|
+
id: childNode.index.toString(),
|
|
65
|
+
obb: childNode.obb
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
let contentUrl;
|
|
69
|
+
let textureUrl;
|
|
70
|
+
let materialDefinition;
|
|
71
|
+
let textureFormat = 'jpg';
|
|
72
|
+
let attributeUrls = [];
|
|
73
|
+
let isDracoGeometry = false;
|
|
74
|
+
if (node && node.mesh) {
|
|
75
|
+
const {
|
|
76
|
+
url,
|
|
77
|
+
isDracoGeometry: isDracoGeometryResult
|
|
78
|
+
} = node.mesh.geometry && this.getContentUrl(node.mesh.geometry) || {
|
|
79
|
+
isDracoGeometry: false
|
|
80
|
+
};
|
|
81
|
+
contentUrl = url;
|
|
82
|
+
isDracoGeometry = isDracoGeometryResult;
|
|
83
|
+
const {
|
|
84
|
+
textureData,
|
|
85
|
+
materialDefinition: nodeMaterialDefinition
|
|
86
|
+
} = this.getInformationFromMaterial(node.mesh.material);
|
|
87
|
+
materialDefinition = nodeMaterialDefinition;
|
|
88
|
+
textureFormat = textureData.format || textureFormat;
|
|
89
|
+
if (textureData.name) {
|
|
90
|
+
textureUrl = "".concat(this.tileset.url, "/nodes/").concat(node.mesh.material.resource, "/textures/").concat(textureData.name);
|
|
192
91
|
}
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
result = {
|
|
196
|
-
url: "".concat(this.tileset.url, "/nodes/").concat(meshGeometryData.resource, "/geometries/").concat(geometryIndex),
|
|
197
|
-
isDracoGeometry: isDracoGeometry
|
|
198
|
-
};
|
|
92
|
+
if (this.tileset.attributeStorageInfo) {
|
|
93
|
+
attributeUrls = (0, _urlUtils.generateTilesetAttributeUrls)(this.tileset, node.mesh.attribute.resource);
|
|
199
94
|
}
|
|
200
|
-
return result;
|
|
201
95
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
96
|
+
const lodSelection = this.getLodSelection(node);
|
|
97
|
+
return (0, _parseI3s.normalizeTileNonUrlData)({
|
|
98
|
+
id: id.toString(),
|
|
99
|
+
lodSelection,
|
|
100
|
+
obb: node.obb,
|
|
101
|
+
contentUrl,
|
|
102
|
+
textureUrl,
|
|
103
|
+
attributeUrls,
|
|
104
|
+
materialDefinition,
|
|
105
|
+
textureFormat,
|
|
106
|
+
textureLoaderOptions: this.textureLoaderOptions,
|
|
107
|
+
children,
|
|
108
|
+
isDracoGeometry
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
getContentUrl(meshGeometryData) {
|
|
112
|
+
let result = null;
|
|
113
|
+
const geometryDefinition = this.tileset.geometryDefinitions[meshGeometryData.definition];
|
|
114
|
+
let geometryIndex = -1;
|
|
115
|
+
if (this.options.i3s && this.options.i3s.useDracoGeometry) {
|
|
116
|
+
geometryIndex = geometryDefinition.geometryBuffers.findIndex(buffer => buffer.compressedAttributes && buffer.compressedAttributes.encoding === 'draco');
|
|
117
|
+
}
|
|
118
|
+
if (geometryIndex === -1) {
|
|
119
|
+
geometryIndex = geometryDefinition.geometryBuffers.findIndex(buffer => !buffer.compressedAttributes);
|
|
120
|
+
}
|
|
121
|
+
if (geometryIndex !== -1) {
|
|
122
|
+
const isDracoGeometry = Boolean(geometryDefinition.geometryBuffers[geometryIndex].compressedAttributes);
|
|
123
|
+
result = {
|
|
124
|
+
url: "".concat(this.tileset.url, "/nodes/").concat(meshGeometryData.resource, "/geometries/").concat(geometryIndex),
|
|
125
|
+
isDracoGeometry
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
getLodSelection(node) {
|
|
131
|
+
const lodSelection = [];
|
|
132
|
+
if (this.lodSelectionMetricType === 'maxScreenThresholdSQ') {
|
|
212
133
|
lodSelection.push({
|
|
213
|
-
metricType:
|
|
214
|
-
maxError: node.lodThreshold
|
|
134
|
+
metricType: 'maxScreenThreshold',
|
|
135
|
+
maxError: Math.sqrt(node.lodThreshold / (Math.PI * 0.25))
|
|
215
136
|
});
|
|
216
|
-
return lodSelection;
|
|
217
137
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
138
|
+
lodSelection.push({
|
|
139
|
+
metricType: this.lodSelectionMetricType,
|
|
140
|
+
maxError: node.lodThreshold
|
|
141
|
+
});
|
|
142
|
+
return lodSelection;
|
|
143
|
+
}
|
|
144
|
+
getInformationFromMaterial(material) {
|
|
145
|
+
const informationFromMaterial = {
|
|
146
|
+
textureData: {
|
|
147
|
+
name: null
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
if (material) {
|
|
151
|
+
var _this$tileset$materia;
|
|
152
|
+
const materialDefinition = (_this$tileset$materia = this.tileset.materialDefinitions) === null || _this$tileset$materia === void 0 ? void 0 : _this$tileset$materia[material.definition];
|
|
153
|
+
if (materialDefinition) {
|
|
154
|
+
var _materialDefinition$p, _materialDefinition$p2;
|
|
155
|
+
informationFromMaterial.materialDefinition = materialDefinition;
|
|
156
|
+
const textureSetDefinitionIndex = materialDefinition === null || materialDefinition === void 0 ? void 0 : (_materialDefinition$p = materialDefinition.pbrMetallicRoughness) === null || _materialDefinition$p === void 0 ? void 0 : (_materialDefinition$p2 = _materialDefinition$p.baseColorTexture) === null || _materialDefinition$p2 === void 0 ? void 0 : _materialDefinition$p2.textureSetDefinitionId;
|
|
157
|
+
if (typeof textureSetDefinitionIndex === 'number') {
|
|
158
|
+
informationFromMaterial.textureData = this.textureDefinitionsSelectedFormats[textureSetDefinitionIndex] || informationFromMaterial.textureData;
|
|
236
159
|
}
|
|
237
160
|
}
|
|
238
|
-
return informationFromMaterial;
|
|
239
161
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
_step4;
|
|
255
|
-
try {
|
|
256
|
-
var _loop = function _loop() {
|
|
257
|
-
var i3sFormat = _step4.value;
|
|
258
|
-
var format = formats.find(function (value) {
|
|
259
|
-
return value.format === i3sFormat;
|
|
260
|
-
});
|
|
261
|
-
if (format) {
|
|
262
|
-
selectedFormat = format;
|
|
263
|
-
return "break";
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
267
|
-
var _ret = _loop();
|
|
268
|
-
if (_ret === "break") break;
|
|
269
|
-
}
|
|
270
|
-
} catch (err) {
|
|
271
|
-
_iterator4.e(err);
|
|
272
|
-
} finally {
|
|
273
|
-
_iterator4.f();
|
|
274
|
-
}
|
|
275
|
-
if (selectedFormat && selectedFormat.format === 'ktx2') {
|
|
276
|
-
this.textureLoaderOptions.basis = {
|
|
277
|
-
format: (0, _textures.selectSupportedBasisFormat)(),
|
|
278
|
-
containerFormat: 'ktx2',
|
|
279
|
-
module: 'encoder'
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
this.textureDefinitionsSelectedFormats.push(selectedFormat);
|
|
162
|
+
return informationFromMaterial;
|
|
163
|
+
}
|
|
164
|
+
initSelectedFormatsForTextureDefinitions(tileset) {
|
|
165
|
+
this.textureDefinitionsSelectedFormats = [];
|
|
166
|
+
const possibleI3sFormats = this.getSupportedTextureFormats();
|
|
167
|
+
const textureSetDefinitions = tileset.textureSetDefinitions || [];
|
|
168
|
+
for (const textureSetDefinition of textureSetDefinitions) {
|
|
169
|
+
const formats = textureSetDefinition && textureSetDefinition.formats || [];
|
|
170
|
+
let selectedFormat = null;
|
|
171
|
+
for (const i3sFormat of possibleI3sFormats) {
|
|
172
|
+
const format = formats.find(value => value.format === i3sFormat);
|
|
173
|
+
if (format) {
|
|
174
|
+
selectedFormat = format;
|
|
175
|
+
break;
|
|
283
176
|
}
|
|
284
|
-
} catch (err) {
|
|
285
|
-
_iterator3.e(err);
|
|
286
|
-
} finally {
|
|
287
|
-
_iterator3.f();
|
|
288
177
|
}
|
|
178
|
+
if (selectedFormat && selectedFormat.format === 'ktx2') {
|
|
179
|
+
this.textureLoaderOptions.basis = {
|
|
180
|
+
format: (0, _textures.selectSupportedBasisFormat)(),
|
|
181
|
+
containerFormat: 'ktx2',
|
|
182
|
+
module: 'encoder'
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
this.textureDefinitionsSelectedFormats.push(selectedFormat);
|
|
289
186
|
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
formats.push('dds');
|
|
301
|
-
}
|
|
302
|
-
formats.push('ktx2');
|
|
187
|
+
}
|
|
188
|
+
getSupportedTextureFormats() {
|
|
189
|
+
const formats = [];
|
|
190
|
+
if (!this.options.i3s || this.options.i3s.useCompressedTextures) {
|
|
191
|
+
const supportedCompressedFormats = (0, _textures.getSupportedGPUTextureFormats)();
|
|
192
|
+
if (supportedCompressedFormats.has('etc2')) {
|
|
193
|
+
formats.push('ktx-etc2');
|
|
194
|
+
}
|
|
195
|
+
if (supportedCompressedFormats.has('dxt')) {
|
|
196
|
+
formats.push('dds');
|
|
303
197
|
}
|
|
304
|
-
formats.push('
|
|
305
|
-
formats.push('png');
|
|
306
|
-
return formats;
|
|
198
|
+
formats.push('ktx2');
|
|
307
199
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
200
|
+
formats.push('jpg');
|
|
201
|
+
formats.push('png');
|
|
202
|
+
return formats;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
311
205
|
exports.default = I3SNodePagesTiles;
|
|
312
206
|
//# sourceMappingURL=i3s-nodepages-tiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-nodepages-tiles.js","names":["_core","require","_textures","_i3sNodePageLoader","_parseI3s","_urlUtils","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","arguments","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","I3SNodePagesTiles","tileset","options","_tileset$nodePages","_tileset$nodePages2","_classCallCheck2","nodesPerPage","nodePages","lodSelectionMetricType","nodesInNodePages","initSelectedFormatsForTextureDefinitions","_createClass2","_getNodeById","_asyncToGenerator2","_regenerator","mark","_callee","id","pageIndex","_this$options$i3s","nodePageUrl","nodeIndex","wrap","_callee$","_context","prev","Math","floor","pendingNodePages","getUrlWithToken","concat","url","i3s","token","status","promise","load","I3SNodePageLoader","sent","nodes","abrupt","stop","getNodeById","_x","_formTileFromNodePages","_callee2","node","children","childNodesPromises","_iterator","_step","child","childNodes","_iterator2","_step2","childNode","contentUrl","textureUrl","materialDefinition","textureFormat","attributeUrls","isDracoGeometry","_ref","isDracoGeometryResult","_this$getInformationF","textureData","nodeMaterialDefinition","lodSelection","_callee2$","_context2","Promise","all","index","obb","mesh","geometry","getContentUrl","getInformationFromMaterial","material","format","resource","attributeStorageInfo","generateTilesetAttributeUrls","attribute","getLodSelection","normalizeTileNonUrlData","textureLoaderOptions","formTileFromNodePages","_x2","meshGeometryData","result","geometryDefinition","geometryDefinitions","definition","geometryIndex","useDracoGeometry","geometryBuffers","findIndex","buffer","compressedAttributes","encoding","Boolean","metricType","maxError","sqrt","lodThreshold","PI","informationFromMaterial","_this$tileset$materia","materialDefinitions","_materialDefinition$p","_materialDefinition$p2","textureSetDefinitionIndex","pbrMetallicRoughness","baseColorTexture","textureSetDefinitionId","textureDefinitionsSelectedFormats","possibleI3sFormats","getSupportedTextureFormats","textureSetDefinitions","_iterator3","_step3","textureSetDefinition","formats","selectedFormat","_iterator4","_step4","_loop","i3sFormat","find","_ret","basis","selectSupportedBasisFormat","containerFormat","module","useCompressedTextures","supportedCompressedFormats","getSupportedGPUTextureFormats","has","exports"],"sources":["../../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"sourcesContent":["import {load} from '@loaders.gl/core';\nimport {getSupportedGPUTextureFormats, selectSupportedBasisFormat} from '@loaders.gl/textures';\nimport {I3SNodePageLoader} from '../../i3s-node-page-loader';\nimport {normalizeTileNonUrlData} from '../parsers/parse-i3s';\nimport {getUrlWithToken, generateTilesetAttributeUrls} from '../utils/url-utils';\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\nimport {\n I3STilesetHeader,\n LodSelection,\n NodePage,\n NodeInPage,\n Obb,\n MeshMaterial,\n I3SMaterialDefinition,\n I3STextureFormat,\n MeshGeometry,\n I3STileHeader\n} from '../../types';\n\n/**\n * class I3SNodePagesTiles - loads nodePages and form i3s tiles from them\n */\nexport default class I3SNodePagesTiles {\n tileset: I3STilesetHeader;\n nodePages: NodePage[] = [];\n pendingNodePages: {promise: Promise<NodePage>; status: 'Pending' | 'Done'}[] = [];\n nodesPerPage: number;\n options: LoaderOptions;\n lodSelectionMetricType?: string;\n textureDefinitionsSelectedFormats: ({format: I3STextureFormat; name: string} | null)[] = [];\n nodesInNodePages: number;\n private textureLoaderOptions: {[key: string]: any} = {};\n\n /**\n * @constructs\n * Create a I3SNodePagesTiles instance.\n * @param tileset - i3s tileset header ('layers/0')\n * @param options - i3s loader options\n */\n constructor(tileset: I3STilesetHeader, options: LoaderOptions) {\n this.tileset = {...tileset}; // spread the tileset to avoid circular reference\n this.nodesPerPage = tileset.nodePages?.nodesPerPage || 64;\n this.lodSelectionMetricType = tileset.nodePages?.lodSelectionMetricType;\n this.options = options;\n this.nodesInNodePages = 0;\n\n this.initSelectedFormatsForTextureDefinitions(tileset);\n }\n\n /**\n * Loads some nodePage and return a particular node from it\n * @param id - id of node through all node pages\n */\n async getNodeById(id: number): Promise<NodeInPage> {\n const pageIndex = Math.floor(id / this.nodesPerPage);\n if (!this.nodePages[pageIndex] && !this.pendingNodePages[pageIndex]) {\n const nodePageUrl = getUrlWithToken(\n `${this.tileset.url}/nodepages/${pageIndex}`,\n // @ts-expect-error this.options is not properly typed\n this.options.i3s?.token\n );\n this.pendingNodePages[pageIndex] = {\n status: 'Pending',\n promise: load(nodePageUrl, I3SNodePageLoader, this.options)\n };\n this.nodePages[pageIndex] = await this.pendingNodePages[pageIndex].promise;\n this.nodesInNodePages += this.nodePages[pageIndex].nodes.length;\n this.pendingNodePages[pageIndex].status = 'Done';\n }\n if (this.pendingNodePages[pageIndex].status === 'Pending') {\n this.nodePages[pageIndex] = await this.pendingNodePages[pageIndex].promise;\n }\n const nodeIndex = id % this.nodesPerPage;\n return this.nodePages[pageIndex].nodes[nodeIndex];\n }\n\n /**\n * Forms tile header using node and tileset data\n * @param id - id of node through all node pages\n */\n // eslint-disable-next-line complexity, max-statements\n async formTileFromNodePages(id: number): Promise<I3STileHeader> {\n const node: NodeInPage = await this.getNodeById(id);\n const children: {id: string; obb: Obb}[] = [];\n const childNodesPromises: Promise<NodeInPage>[] = [];\n for (const child of node.children || []) {\n childNodesPromises.push(this.getNodeById(child));\n }\n\n const childNodes = await Promise.all(childNodesPromises);\n for (const childNode of childNodes) {\n children.push({\n id: childNode.index.toString(),\n obb: childNode.obb\n });\n }\n\n let contentUrl: string | undefined;\n let textureUrl: string | undefined;\n let materialDefinition: I3SMaterialDefinition | undefined;\n let textureFormat: I3STextureFormat = 'jpg';\n let attributeUrls: string[] = [];\n let isDracoGeometry: boolean = false;\n\n if (node && node.mesh) {\n // Get geometry resource URL and type (compressed / non-compressed)\n const {url, isDracoGeometry: isDracoGeometryResult} = (node.mesh.geometry &&\n this.getContentUrl(node.mesh.geometry)) || {isDracoGeometry: false};\n contentUrl = url;\n isDracoGeometry = isDracoGeometryResult;\n\n const {textureData, materialDefinition: nodeMaterialDefinition} =\n this.getInformationFromMaterial(node.mesh.material);\n materialDefinition = nodeMaterialDefinition;\n textureFormat = textureData.format || textureFormat;\n if (textureData.name) {\n textureUrl = `${this.tileset.url}/nodes/${node.mesh.material.resource}/textures/${textureData.name}`;\n }\n\n if (this.tileset.attributeStorageInfo) {\n attributeUrls = generateTilesetAttributeUrls(this.tileset, node.mesh.attribute.resource);\n }\n }\n\n const lodSelection = this.getLodSelection(node);\n\n return normalizeTileNonUrlData({\n id: id.toString(),\n lodSelection,\n obb: node.obb,\n contentUrl,\n textureUrl,\n attributeUrls,\n materialDefinition,\n textureFormat,\n textureLoaderOptions: this.textureLoaderOptions,\n children,\n isDracoGeometry\n });\n }\n\n /**\n * Forms url and type of geometry resource by nodepage's data and `geometryDefinitions` in the tileset\n * @param - data about the node's mesh from the nodepage\n * @returns -\n * {string} url - url to the geometry resource\n * {boolean} isDracoGeometry - whether the geometry resource contain DRACO compressed geometry\n */\n private getContentUrl(meshGeometryData: MeshGeometry) {\n let result: {url: string; isDracoGeometry: boolean} | null = null;\n // @ts-ignore\n const geometryDefinition = this.tileset.geometryDefinitions[meshGeometryData.definition];\n let geometryIndex = -1;\n // Try to find DRACO geometryDefinition of `useDracoGeometry` option is set\n // @ts-expect-error this.options is not properly typed\n if (this.options.i3s && this.options.i3s.useDracoGeometry) {\n geometryIndex = geometryDefinition.geometryBuffers.findIndex(\n (buffer) => buffer.compressedAttributes && buffer.compressedAttributes.encoding === 'draco'\n );\n }\n // If DRACO geometry is not applicable try to select non-compressed geometry\n if (geometryIndex === -1) {\n geometryIndex = geometryDefinition.geometryBuffers.findIndex(\n (buffer) => !buffer.compressedAttributes\n );\n }\n if (geometryIndex !== -1) {\n const isDracoGeometry = Boolean(\n geometryDefinition.geometryBuffers[geometryIndex].compressedAttributes\n );\n result = {\n url: `${this.tileset.url}/nodes/${meshGeometryData.resource}/geometries/${geometryIndex}`,\n isDracoGeometry\n };\n }\n return result;\n }\n\n /**\n * Forms 1.6 compatible LOD selection object from a nodepage's node data\n * @param node - a node from nodepage\n * @returns- Array of LodSelection\n */\n private getLodSelection(node: NodeInPage): LodSelection[] {\n const lodSelection: LodSelection[] = [];\n if (this.lodSelectionMetricType === 'maxScreenThresholdSQ') {\n lodSelection.push({\n metricType: 'maxScreenThreshold',\n // @ts-ignore\n maxError: Math.sqrt(node.lodThreshold / (Math.PI * 0.25))\n });\n }\n lodSelection.push({\n metricType: this.lodSelectionMetricType,\n // @ts-ignore\n maxError: node.lodThreshold\n });\n return lodSelection;\n }\n\n /**\n * Returns information about texture and material from `materialDefinitions`\n * @param material - material data from nodepage\n * @returns - Couple {textureData, materialDefinition}\n * {string} textureData.name - path name of the texture\n * {string} textureData.format - format of the texture\n * materialDefinition - PBR-like material definition from `materialDefinitions`\n */\n private getInformationFromMaterial(material: MeshMaterial) {\n const informationFromMaterial: {\n textureData: {name: string | null; format?: I3STextureFormat};\n materialDefinition?: I3SMaterialDefinition;\n } = {textureData: {name: null}};\n\n if (material) {\n const materialDefinition = this.tileset.materialDefinitions?.[material.definition];\n if (materialDefinition) {\n informationFromMaterial.materialDefinition = materialDefinition;\n const textureSetDefinitionIndex =\n materialDefinition?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;\n\n if (typeof textureSetDefinitionIndex === 'number') {\n informationFromMaterial.textureData =\n this.textureDefinitionsSelectedFormats[textureSetDefinitionIndex] ||\n informationFromMaterial.textureData;\n }\n }\n }\n return informationFromMaterial;\n }\n\n /**\n * Sets preferable and supported format for each textureDefinition of the tileset\n * @param tileset - I3S layer data\n * @returns\n */\n private initSelectedFormatsForTextureDefinitions(tileset: I3STilesetHeader): void {\n this.textureDefinitionsSelectedFormats = [];\n const possibleI3sFormats = this.getSupportedTextureFormats();\n const textureSetDefinitions = tileset.textureSetDefinitions || [];\n for (const textureSetDefinition of textureSetDefinitions) {\n const formats = (textureSetDefinition && textureSetDefinition.formats) || [];\n let selectedFormat: {name: string; format: I3STextureFormat} | null = null;\n for (const i3sFormat of possibleI3sFormats) {\n const format = formats.find((value) => value.format === i3sFormat);\n if (format) {\n selectedFormat = format;\n break;\n }\n }\n // For I3S 1.8 need to define basis target format to decode\n if (selectedFormat && selectedFormat.format === 'ktx2') {\n this.textureLoaderOptions.basis = {\n format: selectSupportedBasisFormat(),\n containerFormat: 'ktx2',\n module: 'encoder'\n };\n }\n\n this.textureDefinitionsSelectedFormats.push(selectedFormat);\n }\n }\n\n /**\n * Returns the array of supported texture format\n * @returns list of format strings\n */\n private getSupportedTextureFormats(): I3STextureFormat[] {\n const formats: I3STextureFormat[] = [];\n // @ts-expect-error this.options is not properly typed\n if (!this.options.i3s || this.options.i3s.useCompressedTextures) {\n // I3S 1.7 selection\n const supportedCompressedFormats = getSupportedGPUTextureFormats();\n // List of possible in i3s formats:\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/textureSetDefinitionFormat.cmn.md\n if (supportedCompressedFormats.has('etc2')) {\n formats.push('ktx-etc2');\n }\n if (supportedCompressedFormats.has('dxt')) {\n formats.push('dds');\n }\n\n // I3S 1.8 selection\n // ktx2 wraps basis texture which at the edge case can be decoded as uncompressed image\n formats.push('ktx2');\n }\n\n formats.push('jpg');\n formats.push('png');\n return formats;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA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I,IAAI,CAACyI,cAAc,CAAC;QAC7D;MAAC,SAAAtK,GAAA;QAAAkK,UAAA,CAAAxK,CAAA,CAAAM,GAAA;MAAA;QAAAkK,UAAA,CAAAtK,CAAA;MAAA;IACH;EAAC;IAAAwC,GAAA;IAAA3C,KAAA,EAMD,SAAAuK,2BAAA,EAAyD;MACvD,IAAMK,OAA2B,GAAG,EAAE;MAEtC,IAAI,CAAC,IAAI,CAACzH,OAAO,CAAC8B,GAAG,IAAI,IAAI,CAAC9B,OAAO,CAAC8B,GAAG,CAACuG,qBAAqB,EAAE;QAE/D,IAAMC,0BAA0B,GAAG,IAAAC,uCAA6B,EAAC,CAAC;QAGlE,IAAID,0BAA0B,CAACE,GAAG,CAAC,MAAM,CAAC,EAAE;UAC1Cf,OAAO,CAACxI,IAAI,CAAC,UAAU,CAAC;QAC1B;QACA,IAAIqJ,0BAA0B,CAACE,GAAG,CAAC,KAAK,CAAC,EAAE;UACzCf,OAAO,CAACxI,IAAI,CAAC,KAAK,CAAC;QACrB;QAIAwI,OAAO,CAACxI,IAAI,CAAC,MAAM,CAAC;MACtB;MAEAwI,OAAO,CAACxI,IAAI,CAAC,KAAK,CAAC;MACnBwI,OAAO,CAACxI,IAAI,CAAC,KAAK,CAAC;MACnB,OAAOwI,OAAO;IAChB;EAAC;EAAA,OAAA3H,iBAAA;AAAA;AAAA2I,OAAA,CAAA/I,OAAA,GAAAI,iBAAA"}
|
|
1
|
+
{"version":3,"file":"i3s-nodepages-tiles.js","names":["_core","require","_textures","_i3sNodePageLoader","_parseI3s","_urlUtils","I3SNodePagesTiles","constructor","tileset","options","_tileset$nodePages","_tileset$nodePages2","_defineProperty2","default","nodesPerPage","nodePages","lodSelectionMetricType","nodesInNodePages","initSelectedFormatsForTextureDefinitions","getNodeById","id","pageIndex","Math","floor","pendingNodePages","_this$options$i3s","nodePageUrl","getUrlWithToken","concat","url","i3s","token","status","promise","load","I3SNodePageLoader","nodes","length","nodeIndex","formTileFromNodePages","node","children","childNodesPromises","child","push","childNodes","Promise","all","childNode","index","toString","obb","contentUrl","textureUrl","materialDefinition","textureFormat","attributeUrls","isDracoGeometry","mesh","isDracoGeometryResult","geometry","getContentUrl","textureData","nodeMaterialDefinition","getInformationFromMaterial","material","format","name","resource","attributeStorageInfo","generateTilesetAttributeUrls","attribute","lodSelection","getLodSelection","normalizeTileNonUrlData","textureLoaderOptions","meshGeometryData","result","geometryDefinition","geometryDefinitions","definition","geometryIndex","useDracoGeometry","geometryBuffers","findIndex","buffer","compressedAttributes","encoding","Boolean","metricType","maxError","sqrt","lodThreshold","PI","informationFromMaterial","_this$tileset$materia","materialDefinitions","_materialDefinition$p","_materialDefinition$p2","textureSetDefinitionIndex","pbrMetallicRoughness","baseColorTexture","textureSetDefinitionId","textureDefinitionsSelectedFormats","possibleI3sFormats","getSupportedTextureFormats","textureSetDefinitions","textureSetDefinition","formats","selectedFormat","i3sFormat","find","value","basis","selectSupportedBasisFormat","containerFormat","module","useCompressedTextures","supportedCompressedFormats","getSupportedGPUTextureFormats","has","exports"],"sources":["../../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"sourcesContent":["import {load} from '@loaders.gl/core';\nimport {getSupportedGPUTextureFormats, selectSupportedBasisFormat} from '@loaders.gl/textures';\nimport {I3SNodePageLoader} from '../../i3s-node-page-loader';\nimport {normalizeTileNonUrlData} from '../parsers/parse-i3s';\nimport {getUrlWithToken, generateTilesetAttributeUrls} from '../utils/url-utils';\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\nimport {\n I3STilesetHeader,\n LodSelection,\n NodePage,\n NodeInPage,\n Obb,\n MeshMaterial,\n I3SMaterialDefinition,\n I3STextureFormat,\n MeshGeometry,\n I3STileHeader\n} from '../../types';\n\n/**\n * class I3SNodePagesTiles - loads nodePages and form i3s tiles from them\n */\nexport default class I3SNodePagesTiles {\n tileset: I3STilesetHeader;\n nodePages: NodePage[] = [];\n pendingNodePages: {promise: Promise<NodePage>; status: 'Pending' | 'Done'}[] = [];\n nodesPerPage: number;\n options: LoaderOptions;\n lodSelectionMetricType?: string;\n textureDefinitionsSelectedFormats: ({format: I3STextureFormat; name: string} | null)[] = [];\n nodesInNodePages: number;\n private textureLoaderOptions: {[key: string]: any} = {};\n\n /**\n * @constructs\n * Create a I3SNodePagesTiles instance.\n * @param tileset - i3s tileset header ('layers/0')\n * @param options - i3s loader options\n */\n constructor(tileset: I3STilesetHeader, options: LoaderOptions) {\n this.tileset = {...tileset}; // spread the tileset to avoid circular reference\n this.nodesPerPage = tileset.nodePages?.nodesPerPage || 64;\n this.lodSelectionMetricType = tileset.nodePages?.lodSelectionMetricType;\n this.options = options;\n this.nodesInNodePages = 0;\n\n this.initSelectedFormatsForTextureDefinitions(tileset);\n }\n\n /**\n * Loads some nodePage and return a particular node from it\n * @param id - id of node through all node pages\n */\n async getNodeById(id: number): Promise<NodeInPage> {\n const pageIndex = Math.floor(id / this.nodesPerPage);\n if (!this.nodePages[pageIndex] && !this.pendingNodePages[pageIndex]) {\n const nodePageUrl = getUrlWithToken(\n `${this.tileset.url}/nodepages/${pageIndex}`,\n // @ts-expect-error this.options is not properly typed\n this.options.i3s?.token\n );\n this.pendingNodePages[pageIndex] = {\n status: 'Pending',\n promise: load(nodePageUrl, I3SNodePageLoader, this.options)\n };\n this.nodePages[pageIndex] = await this.pendingNodePages[pageIndex].promise;\n this.nodesInNodePages += this.nodePages[pageIndex].nodes.length;\n this.pendingNodePages[pageIndex].status = 'Done';\n }\n if (this.pendingNodePages[pageIndex].status === 'Pending') {\n this.nodePages[pageIndex] = await this.pendingNodePages[pageIndex].promise;\n }\n const nodeIndex = id % this.nodesPerPage;\n return this.nodePages[pageIndex].nodes[nodeIndex];\n }\n\n /**\n * Forms tile header using node and tileset data\n * @param id - id of node through all node pages\n */\n // eslint-disable-next-line complexity, max-statements\n async formTileFromNodePages(id: number): Promise<I3STileHeader> {\n const node: NodeInPage = await this.getNodeById(id);\n const children: {id: string; obb: Obb}[] = [];\n const childNodesPromises: Promise<NodeInPage>[] = [];\n for (const child of node.children || []) {\n childNodesPromises.push(this.getNodeById(child));\n }\n\n const childNodes = await Promise.all(childNodesPromises);\n for (const childNode of childNodes) {\n children.push({\n id: childNode.index.toString(),\n obb: childNode.obb\n });\n }\n\n let contentUrl: string | undefined;\n let textureUrl: string | undefined;\n let materialDefinition: I3SMaterialDefinition | undefined;\n let textureFormat: I3STextureFormat = 'jpg';\n let attributeUrls: string[] = [];\n let isDracoGeometry: boolean = false;\n\n if (node && node.mesh) {\n // Get geometry resource URL and type (compressed / non-compressed)\n const {url, isDracoGeometry: isDracoGeometryResult} = (node.mesh.geometry &&\n this.getContentUrl(node.mesh.geometry)) || {isDracoGeometry: false};\n contentUrl = url;\n isDracoGeometry = isDracoGeometryResult;\n\n const {textureData, materialDefinition: nodeMaterialDefinition} =\n this.getInformationFromMaterial(node.mesh.material);\n materialDefinition = nodeMaterialDefinition;\n textureFormat = textureData.format || textureFormat;\n if (textureData.name) {\n textureUrl = `${this.tileset.url}/nodes/${node.mesh.material.resource}/textures/${textureData.name}`;\n }\n\n if (this.tileset.attributeStorageInfo) {\n attributeUrls = generateTilesetAttributeUrls(this.tileset, node.mesh.attribute.resource);\n }\n }\n\n const lodSelection = this.getLodSelection(node);\n\n return normalizeTileNonUrlData({\n id: id.toString(),\n lodSelection,\n obb: node.obb,\n contentUrl,\n textureUrl,\n attributeUrls,\n materialDefinition,\n textureFormat,\n textureLoaderOptions: this.textureLoaderOptions,\n children,\n isDracoGeometry\n });\n }\n\n /**\n * Forms url and type of geometry resource by nodepage's data and `geometryDefinitions` in the tileset\n * @param - data about the node's mesh from the nodepage\n * @returns -\n * {string} url - url to the geometry resource\n * {boolean} isDracoGeometry - whether the geometry resource contain DRACO compressed geometry\n */\n private getContentUrl(meshGeometryData: MeshGeometry) {\n let result: {url: string; isDracoGeometry: boolean} | null = null;\n // @ts-ignore\n const geometryDefinition = this.tileset.geometryDefinitions[meshGeometryData.definition];\n let geometryIndex = -1;\n // Try to find DRACO geometryDefinition of `useDracoGeometry` option is set\n // @ts-expect-error this.options is not properly typed\n if (this.options.i3s && this.options.i3s.useDracoGeometry) {\n geometryIndex = geometryDefinition.geometryBuffers.findIndex(\n (buffer) => buffer.compressedAttributes && buffer.compressedAttributes.encoding === 'draco'\n );\n }\n // If DRACO geometry is not applicable try to select non-compressed geometry\n if (geometryIndex === -1) {\n geometryIndex = geometryDefinition.geometryBuffers.findIndex(\n (buffer) => !buffer.compressedAttributes\n );\n }\n if (geometryIndex !== -1) {\n const isDracoGeometry = Boolean(\n geometryDefinition.geometryBuffers[geometryIndex].compressedAttributes\n );\n result = {\n url: `${this.tileset.url}/nodes/${meshGeometryData.resource}/geometries/${geometryIndex}`,\n isDracoGeometry\n };\n }\n return result;\n }\n\n /**\n * Forms 1.6 compatible LOD selection object from a nodepage's node data\n * @param node - a node from nodepage\n * @returns- Array of LodSelection\n */\n private getLodSelection(node: NodeInPage): LodSelection[] {\n const lodSelection: LodSelection[] = [];\n if (this.lodSelectionMetricType === 'maxScreenThresholdSQ') {\n lodSelection.push({\n metricType: 'maxScreenThreshold',\n // @ts-ignore\n maxError: Math.sqrt(node.lodThreshold / (Math.PI * 0.25))\n });\n }\n lodSelection.push({\n metricType: this.lodSelectionMetricType,\n // @ts-ignore\n maxError: node.lodThreshold\n });\n return lodSelection;\n }\n\n /**\n * Returns information about texture and material from `materialDefinitions`\n * @param material - material data from nodepage\n * @returns - Couple {textureData, materialDefinition}\n * {string} textureData.name - path name of the texture\n * {string} textureData.format - format of the texture\n * materialDefinition - PBR-like material definition from `materialDefinitions`\n */\n private getInformationFromMaterial(material: MeshMaterial) {\n const informationFromMaterial: {\n textureData: {name: string | null; format?: I3STextureFormat};\n materialDefinition?: I3SMaterialDefinition;\n } = {textureData: {name: null}};\n\n if (material) {\n const materialDefinition = this.tileset.materialDefinitions?.[material.definition];\n if (materialDefinition) {\n informationFromMaterial.materialDefinition = materialDefinition;\n const textureSetDefinitionIndex =\n materialDefinition?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;\n\n if (typeof textureSetDefinitionIndex === 'number') {\n informationFromMaterial.textureData =\n this.textureDefinitionsSelectedFormats[textureSetDefinitionIndex] ||\n informationFromMaterial.textureData;\n }\n }\n }\n return informationFromMaterial;\n }\n\n /**\n * Sets preferable and supported format for each textureDefinition of the tileset\n * @param tileset - I3S layer data\n * @returns\n */\n private initSelectedFormatsForTextureDefinitions(tileset: I3STilesetHeader): void {\n this.textureDefinitionsSelectedFormats = [];\n const possibleI3sFormats = this.getSupportedTextureFormats();\n const textureSetDefinitions = tileset.textureSetDefinitions || [];\n for (const textureSetDefinition of textureSetDefinitions) {\n const formats = (textureSetDefinition && textureSetDefinition.formats) || [];\n let selectedFormat: {name: string; format: I3STextureFormat} | null = null;\n for (const i3sFormat of possibleI3sFormats) {\n const format = formats.find((value) => value.format === i3sFormat);\n if (format) {\n selectedFormat = format;\n break;\n }\n }\n // For I3S 1.8 need to define basis target format to decode\n if (selectedFormat && selectedFormat.format === 'ktx2') {\n this.textureLoaderOptions.basis = {\n format: selectSupportedBasisFormat(),\n containerFormat: 'ktx2',\n module: 'encoder'\n };\n }\n\n this.textureDefinitionsSelectedFormats.push(selectedFormat);\n }\n }\n\n /**\n * Returns the array of supported texture format\n * @returns list of format strings\n */\n private getSupportedTextureFormats(): I3STextureFormat[] {\n const formats: I3STextureFormat[] = [];\n // @ts-expect-error this.options is not properly typed\n if (!this.options.i3s || this.options.i3s.useCompressedTextures) {\n // I3S 1.7 selection\n const supportedCompressedFormats = getSupportedGPUTextureFormats();\n // List of possible in i3s formats:\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/textureSetDefinitionFormat.cmn.md\n if (supportedCompressedFormats.has('etc2')) {\n formats.push('ktx-etc2');\n }\n if (supportedCompressedFormats.has('dxt')) {\n formats.push('dds');\n }\n\n // I3S 1.8 selection\n // ktx2 wraps basis texture which at the edge case can be decoded as uncompressed image\n formats.push('ktx2');\n }\n\n formats.push('jpg');\n formats.push('png');\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AAE;QACtD,IAAI,CAACS,oBAAoB,CAACsC,KAAK,GAAG;UAChC/C,MAAM,EAAE,IAAAgD,oCAA0B,EAAC,CAAC;UACpCC,eAAe,EAAE,MAAM;UACvBC,MAAM,EAAE;QACV,CAAC;MACH;MAEA,IAAI,CAACb,iCAAiC,CAAC3D,IAAI,CAACiE,cAAc,CAAC;IAC7D;EACF;EAMQJ,0BAA0BA,CAAA,EAAuB;IACvD,MAAMG,OAA2B,GAAG,EAAE;IAEtC,IAAI,CAAC,IAAI,CAACnG,OAAO,CAACqB,GAAG,IAAI,IAAI,CAACrB,OAAO,CAACqB,GAAG,CAACuF,qBAAqB,EAAE;MAE/D,MAAMC,0BAA0B,GAAG,IAAAC,uCAA6B,EAAC,CAAC;MAGlE,IAAID,0BAA0B,CAACE,GAAG,CAAC,MAAM,CAAC,EAAE;QAC1CZ,OAAO,CAAChE,IAAI,CAAC,UAAU,CAAC;MAC1B;MACA,IAAI0E,0BAA0B,CAACE,GAAG,CAAC,KAAK,CAAC,EAAE;QACzCZ,OAAO,CAAChE,IAAI,CAAC,KAAK,CAAC;MACrB;MAIAgE,OAAO,CAAChE,IAAI,CAAC,MAAM,CAAC;IACtB;IAEAgE,OAAO,CAAChE,IAAI,CAAC,KAAK,CAAC;IACnBgE,OAAO,CAAChE,IAAI,CAAC,KAAK,CAAC;IACnB,OAAOgE,OAAO;EAChB;AACF;AAACa,OAAA,CAAA5G,OAAA,GAAAP,iBAAA"}
|
|
@@ -25,7 +25,7 @@ function getConstructorForDataFormat(dataType) {
|
|
|
25
25
|
throw new Error("parse i3s tile content: unknown type of data: ".concat(dataType));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
const GL_TYPE_MAP = {
|
|
29
29
|
UInt8: _constants.default.UNSIGNED_BYTE,
|
|
30
30
|
UInt16: _constants.default.UNSIGNED_SHORT,
|
|
31
31
|
Float32: _constants.default.FLOAT,
|
|
@@ -52,15 +52,15 @@ function sizeOf(dataType) {
|
|
|
52
52
|
throw new Error("parse i3s tile content: unknown size of data: ".concat(dataType));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
const STRING_ATTRIBUTE_TYPE = 'String';
|
|
56
56
|
exports.STRING_ATTRIBUTE_TYPE = STRING_ATTRIBUTE_TYPE;
|
|
57
|
-
|
|
57
|
+
const OBJECT_ID_ATTRIBUTE_TYPE = 'Oid32';
|
|
58
58
|
exports.OBJECT_ID_ATTRIBUTE_TYPE = OBJECT_ID_ATTRIBUTE_TYPE;
|
|
59
|
-
|
|
59
|
+
const FLOAT_64_TYPE = 'Float64';
|
|
60
60
|
exports.FLOAT_64_TYPE = FLOAT_64_TYPE;
|
|
61
|
-
|
|
61
|
+
const INT_16_ATTRIBUTE_TYPE = 'Int16';
|
|
62
62
|
exports.INT_16_ATTRIBUTE_TYPE = INT_16_ATTRIBUTE_TYPE;
|
|
63
|
-
|
|
63
|
+
let COORDINATE_SYSTEM = function (COORDINATE_SYSTEM) {
|
|
64
64
|
COORDINATE_SYSTEM[COORDINATE_SYSTEM["DEFAULT"] = -1] = "DEFAULT";
|
|
65
65
|
COORDINATE_SYSTEM[COORDINATE_SYSTEM["LNGLAT"] = 1] = "LNGLAT";
|
|
66
66
|
COORDINATE_SYSTEM[COORDINATE_SYSTEM["METER_OFFSETS"] = 2] = "METER_OFFSETS";
|