@loaders.gl/i3s 3.1.8 → 3.2.0-alpha.3
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 +130 -64
- package/dist/es5/i3s-attribute-loader.js +1 -1
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +1 -1
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +1 -1
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +1 -1
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +43 -52
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +56 -51
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js +8 -12
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/i3s-attribute-loader.js +1 -1
- package/dist/esm/i3s-attribute-loader.js.map +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/esm/i3s-content-loader.js +1 -1
- package/dist/esm/i3s-content-loader.js.map +1 -1
- package/dist/esm/i3s-loader.js +1 -1
- package/dist/esm/i3s-loader.js.map +1 -1
- package/dist/esm/i3s-node-page-loader.js +1 -1
- package/dist/esm/i3s-node-page-loader.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +8 -2
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js +35 -30
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s-content-loader.js +1 -1
- package/dist/i3s-content-worker.js +154 -71
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +7 -3
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +35 -30
- package/dist/lib/parsers/parse-i3s.js +1 -1
- package/dist/types.d.ts +100 -34
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/i3s-building-scene-layer-loader.ts +1 -1
- package/src/i3s-content-loader.ts +1 -1
- package/src/index.ts +4 -1
- package/src/lib/helpers/i3s-nodepages-tiles.ts +8 -3
- package/src/lib/parsers/parse-i3s-tile-content.ts +39 -33
- package/src/lib/parsers/parse-i3s.ts +1 -1
- package/src/types.ts +97 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i3s-loader.ts"],"names":["VERSION","TILESET_REGEX","TILE_HEADER_REGEX","SLPK_HEX","I3SLoader","name","id","module","version","mimeTypes","parse","parseI3S","extensions","options","i3s","loadContent","token","isTileset","isTileHeader","tile","tileset","useDracoGeometry","useCompressedTextures","decodeTextures","coordinateSystem","COORDINATE_SYSTEM","METER_OFFSETS","data","context","url","magicNumber","getMagicNumber","Error","test","parseTileset","parseTile","contentUrl","parseTileContent","arrayBuffer","I3SContentLoader","tilesetJson","JSON","TextDecoder","decode","loader","ArrayBuffer","Uint8Array","map","value","toString","padStart","join"],"mappings":";;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAIA,IAAMA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../src/i3s-loader.ts"],"names":["VERSION","TILESET_REGEX","TILE_HEADER_REGEX","SLPK_HEX","I3SLoader","name","id","module","version","mimeTypes","parse","parseI3S","extensions","options","i3s","loadContent","token","isTileset","isTileHeader","tile","tileset","useDracoGeometry","useCompressedTextures","decodeTextures","coordinateSystem","COORDINATE_SYSTEM","METER_OFFSETS","data","context","url","magicNumber","getMagicNumber","Error","test","parseTileset","parseTile","contentUrl","parseTileContent","arrayBuffer","I3SContentLoader","tilesetJson","JSON","TextDecoder","decode","loader","ArrayBuffer","Uint8Array","map","value","toString","padStart","join"],"mappings":";;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAEA,IAAMC,aAAa,GAAG,iBAAtB;AACA,IAAMC,iBAAiB,GAAG,wBAA1B;AACA,IAAMC,QAAQ,GAAG,UAAjB;AAKO,IAAMC,SAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,4BADmC;AAEzCC,EAAAA,EAAE,EAAE,KAFqC;AAGzCC,EAAAA,MAAM,EAAE,KAHiC;AAIzCC,EAAAA,OAAO,EAAER,OAJgC;AAKzCS,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAL8B;AAMzCC,EAAAA,KAAK,EAAEC,QANkC;AAOzCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAP6B;AAQzCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,WAAW,EAAE,IADV;AAEHC,MAAAA,KAAK,EAAE,IAFJ;AAGHC,MAAAA,SAAS,EAAE,MAHR;AAIHC,MAAAA,YAAY,EAAE,MAJX;AAKHC,MAAAA,IAAI,EAAE,IALH;AAMHC,MAAAA,OAAO,EAAE,IANN;AAOHC,MAAAA,gBAAgB,EAAE,IAPf;AAQHC,MAAAA,qBAAqB,EAAE,IARpB;AASHC,MA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MAAlB,CAAyBhB,IAAzB,CAAX,CAAP;AADF,8CAES,iCAAkBA,IAAlB,EAAwBd,OAAxB,EAAiCe,OAAjC,CAFT;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AAKA,SAASG,cAAT,CAAwBJ,IAAxB,EAA8B;AAC5B,MAAIA,IAAI,YAAYkB,WAApB,EAAiC;AAE/B,WAAO,iCAAI,IAAIC,UAAJ,CAAenB,IAAf,EAAqB,CAArB,EAAwB,CAAxB,CAAJ,EACJoB,GADI,CACA,UAACC,KAAD;AAAA,aAAWA,KAAK,CAACC,QAAN,CAAe,EAAf,EAAmBC,QAAnB,CAA4B,CAA5B,EAA+B,GAA/B,CAAX;AAAA,KADA,EAEJC,IAFI,CAEC,EAFD,CAAP;AAGD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load, parse} from '@loaders.gl/core';\nimport {I3SContentLoader} from './i3s-content-loader';\nimport {normalizeTileData, normalizeTilesetData} from './lib/parsers/parse-i3s';\nimport {COORDINATE_SYSTEM} from './lib/parsers/constants';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nconst TILESET_REGEX = /layers\\/[0-9]+$/;\nconst TILE_HEADER_REGEX = /nodes\\/([0-9-]+|root)$/;\nconst SLPK_HEX = '504b0304';\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SLoader: LoaderWithParser = {\n name: 'I3S (Indexed Scene Layers)',\n id: 'i3s',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse: parseI3S,\n extensions: ['bin'],\n options: {\n i3s: {\n loadContent: true,\n token: null,\n isTileset: 'auto',\n isTileHeader: 'auto',\n tile: null,\n tileset: null,\n useDracoGeometry: true,\n useCompressedTextures: true,\n decodeTextures: true,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS\n }\n }\n};\n\nasync function parseI3S(data, options, context) {\n const url = context.url;\n options.i3s = options.i3s || {};\n const magicNumber = getMagicNumber(data);\n\n // check if file is slpk\n if (magicNumber === SLPK_HEX) {\n throw new Error('Files with .slpk extention currently are not supported by I3SLoader');\n }\n\n // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(url);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(url);\n } else {\n isTileHeader = options.i3s.isTileHeader;\n }\n\n if (isTileset) {\n data = await parseTileset(data, options, context);\n } else if (isTileHeader) {\n data = await parseTile(data, options, context);\n if (options.i3s.loadContent) {\n options.i3s.tile = data;\n await load(data.contentUrl, I3SLoader, options);\n }\n } else {\n data = await parseTileContent(data, options);\n }\n\n return data;\n}\n\nasync function parseTileContent(arrayBuffer, options) {\n return await parse(arrayBuffer, I3SContentLoader, options);\n}\n\nasync function parseTileset(data, options, context) {\n const tilesetJson = JSON.parse(new TextDecoder().decode(data));\n // eslint-disable-next-line no-use-before-define\n tilesetJson.loader = I3SLoader;\n await normalizeTilesetData(tilesetJson, options, context);\n\n return tilesetJson;\n}\n\nasync function parseTile(data, options, context) {\n data = JSON.parse(new TextDecoder().decode(data));\n return normalizeTileData(data, options, context);\n}\n\nfunction getMagicNumber(data) {\n if (data instanceof ArrayBuffer) {\n // slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system\n return [...new Uint8Array(data, 0, 4)]\n .map((value) => value.toString(16).padStart(2, '0'))\n .join('');\n }\n return null;\n}\n"],"file":"i3s-loader.js"}
|
|
@@ -11,7 +11,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
11
11
|
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
13
|
|
|
14
|
-
var VERSION = typeof "3.
|
|
14
|
+
var VERSION = typeof "3.2.0-alpha.3" !== 'undefined' ? "3.2.0-alpha.3" : 'latest';
|
|
15
15
|
|
|
16
16
|
function parseNodePage(_x) {
|
|
17
17
|
return _parseNodePage.apply(this, arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i3s-node-page-loader.ts"],"names":["VERSION","parseNodePage","data","JSON","parse","TextDecoder","decode","I3SNodePageLoader","name","id","module","version","mimeTypes","extensions","options"],"mappings":";;;;;;;;;;;;;AAIA,IAAMA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../src/i3s-node-page-loader.ts"],"names":["VERSION","parseNodePage","data","JSON","parse","TextDecoder","decode","I3SNodePageLoader","name","id","module","version","mimeTypes","extensions","options"],"mappings":";;;;;;;;;;;;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;;SAEeC,a;;;;;6EAAf,iBAA6BC,IAA7B;AAAA;AAAA;AAAA;AAAA;AAAA,6CACSC,IAAI,CAACC,KAAL,CAAW,IAAIC,WAAJ,GAAkBC,MAAlB,CAAyBJ,IAAzB,CAAX,CADT;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AAOO,IAAMK,iBAAmC,GAAG;AACjDC,EAAAA,IAAI,EAAE,eAD2C;AAEjDC,EAAAA,EAAE,EAAE,eAF6C;AAGjDC,EAAAA,MAAM,EAAE,KAHyC;AAIjDC,EAAAA,OAAO,EAAEX,OAJwC;AAKjDY,EAAAA,SAAS,EAAE,CAAC,kBAAD,CALsC;AAMjDR,EAAAA,KAAK,EAALA,KANiD;AAOjDS,EAAAA,UAAU,EAAE,CAAC,MAAD,CAPqC;AAQjDC,EAAAA,OAAO,EAAE;AARwC,CAA5C;;;SAWQV,K;;;;;qEAAf,kBAAqBF,IAArB;AAAA;AAAA;AAAA;AAAA;AACEA,YAAAA,IAAI,GAAGD,aAAa,CAACC,IAAD,CAApB;AADF,8CAESA,IAFT;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nasync function parseNodePage(data) {\n return JSON.parse(new TextDecoder().decode(data));\n}\n\n/**\n * Loader for I3S node pages\n */\nexport const I3SNodePageLoader: LoaderWithParser = {\n name: 'I3S Node Page',\n id: 'i3s-node-page',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(data) {\n data = parseNodePage(data);\n return data;\n}\n"],"file":"i3s-node-page-loader.js"}
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AA0BA","sourcesContent":["export {I3SLoader} from './i3s-loader';\nexport {I3SContentLoader} from './i3s-content-loader';\nexport {I3SAttributeLoader, loadFeatureAttributes} from './i3s-attribute-loader';\nexport {I3SBuildingSceneLayerLoader} from './i3s-building-scene-layer-loader';\nexport type {\n BoundingVolumes,\n Mbs,\n Obb,\n SceneLayer3D,\n AttributeStorageInfo,\n Field,\n ESRIField,\n PopupInfo,\n Node3DIndexDocument,\n LodSelection,\n NodeReference,\n Resource,\n MaxScreenThresholdSQ,\n NodeInPage,\n SharedResources,\n Attribute,\n Extent,\n FeatureAttribute,\n FieldInfo,\n I3SMaterialDefinition,\n TextureDefinitionInfo,\n MaterialDefinitionInfo,\n FullExtent\n} from './types';\nexport {COORDINATE_SYSTEM} from './lib/parsers/constants';\n"],"file":"index.js"}
|
|
@@ -120,7 +120,7 @@ var I3SNodePagesTiles = function () {
|
|
|
120
120
|
key: "formTileFromNodePages",
|
|
121
121
|
value: function () {
|
|
122
122
|
var _formTileFromNodePages = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(id) {
|
|
123
|
-
var node, children, _iterator, _step, child, childNode, contentUrl, textureUrl, materialDefinition, textureFormat, attributeUrls, isDracoGeometry, _ref, url, isDracoGeometryResult, _this$getInformationF, textureData, nodeMaterialDefinition, lodSelection;
|
|
123
|
+
var node, children, childNodesPromises, _iterator, _step, child, childNodes, _iterator2, _step2, childNode, contentUrl, textureUrl, materialDefinition, textureFormat, attributeUrls, isDracoGeometry, _ref, url, isDracoGeometryResult, _this$getInformationF, textureData, nodeMaterialDefinition, lodSelection;
|
|
124
124
|
|
|
125
125
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
126
126
|
while (1) {
|
|
@@ -132,50 +132,41 @@ var I3SNodePagesTiles = function () {
|
|
|
132
132
|
case 2:
|
|
133
133
|
node = _context2.sent;
|
|
134
134
|
children = [];
|
|
135
|
+
childNodesPromises = [];
|
|
135
136
|
_iterator = _createForOfIteratorHelper(node.children || []);
|
|
136
|
-
_context2.prev = 5;
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
try {
|
|
139
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
140
|
+
child = _step.value;
|
|
141
|
+
childNodesPromises.push(this.getNodeById(child));
|
|
142
|
+
}
|
|
143
|
+
} catch (err) {
|
|
144
|
+
_iterator.e(err);
|
|
145
|
+
} finally {
|
|
146
|
+
_iterator.f();
|
|
144
147
|
}
|
|
145
148
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return this.getNodeById(child);
|
|
149
|
-
|
|
150
|
-
case 11:
|
|
151
|
-
childNode = _context2.sent;
|
|
152
|
-
children.push({
|
|
153
|
-
id: child.toString(),
|
|
154
|
-
obb: childNode.obb
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
case 13:
|
|
158
|
-
_context2.next = 7;
|
|
159
|
-
break;
|
|
149
|
+
_context2.next = 9;
|
|
150
|
+
return Promise.all(childNodesPromises);
|
|
160
151
|
|
|
161
|
-
case
|
|
162
|
-
|
|
163
|
-
|
|
152
|
+
case 9:
|
|
153
|
+
childNodes = _context2.sent;
|
|
154
|
+
_iterator2 = _createForOfIteratorHelper(childNodes);
|
|
164
155
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
156
|
+
try {
|
|
157
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
158
|
+
childNode = _step2.value;
|
|
159
|
+
children.push({
|
|
160
|
+
id: childNode.index.toString(),
|
|
161
|
+
obb: childNode.obb
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
} catch (err) {
|
|
165
|
+
_iterator2.e(err);
|
|
166
|
+
} finally {
|
|
167
|
+
_iterator2.f();
|
|
168
|
+
}
|
|
177
169
|
|
|
178
|
-
case 23:
|
|
179
170
|
textureFormat = 'jpg';
|
|
180
171
|
attributeUrls = [];
|
|
181
172
|
isDracoGeometry = false;
|
|
@@ -214,12 +205,12 @@ var I3SNodePagesTiles = function () {
|
|
|
214
205
|
isDracoGeometry: isDracoGeometry
|
|
215
206
|
}));
|
|
216
207
|
|
|
217
|
-
case
|
|
208
|
+
case 18:
|
|
218
209
|
case "end":
|
|
219
210
|
return _context2.stop();
|
|
220
211
|
}
|
|
221
212
|
}
|
|
222
|
-
}, _callee2, this
|
|
213
|
+
}, _callee2, this);
|
|
223
214
|
}));
|
|
224
215
|
|
|
225
216
|
function formTileFromNodePages(_x2) {
|
|
@@ -310,21 +301,21 @@ var I3SNodePagesTiles = function () {
|
|
|
310
301
|
var possibleI3sFormats = this.getSupportedTextureFormats();
|
|
311
302
|
var textureSetDefinitions = tileset.textureSetDefinitions || [];
|
|
312
303
|
|
|
313
|
-
var
|
|
314
|
-
|
|
304
|
+
var _iterator3 = _createForOfIteratorHelper(textureSetDefinitions),
|
|
305
|
+
_step3;
|
|
315
306
|
|
|
316
307
|
try {
|
|
317
|
-
for (
|
|
318
|
-
var textureSetDefinition =
|
|
308
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
309
|
+
var textureSetDefinition = _step3.value;
|
|
319
310
|
var formats = textureSetDefinition && textureSetDefinition.formats || [];
|
|
320
311
|
var selectedFormat = null;
|
|
321
312
|
|
|
322
|
-
var
|
|
323
|
-
|
|
313
|
+
var _iterator4 = _createForOfIteratorHelper(possibleI3sFormats),
|
|
314
|
+
_step4;
|
|
324
315
|
|
|
325
316
|
try {
|
|
326
317
|
var _loop = function _loop() {
|
|
327
|
-
var i3sFormat =
|
|
318
|
+
var i3sFormat = _step4.value;
|
|
328
319
|
var format = formats.find(function (value) {
|
|
329
320
|
return value.format === i3sFormat;
|
|
330
321
|
});
|
|
@@ -335,15 +326,15 @@ var I3SNodePagesTiles = function () {
|
|
|
335
326
|
}
|
|
336
327
|
};
|
|
337
328
|
|
|
338
|
-
for (
|
|
329
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
339
330
|
var _ret = _loop();
|
|
340
331
|
|
|
341
332
|
if (_ret === "break") break;
|
|
342
333
|
}
|
|
343
334
|
} catch (err) {
|
|
344
|
-
|
|
335
|
+
_iterator4.e(err);
|
|
345
336
|
} finally {
|
|
346
|
-
|
|
337
|
+
_iterator4.f();
|
|
347
338
|
}
|
|
348
339
|
|
|
349
340
|
if (selectedFormat && selectedFormat.format === 'ktx2') {
|
|
@@ -357,9 +348,9 @@ var I3SNodePagesTiles = function () {
|
|
|
357
348
|
this.textureDefinitionsSelectedFormats.push(selectedFormat);
|
|
358
349
|
}
|
|
359
350
|
} catch (err) {
|
|
360
|
-
|
|
351
|
+
_iterator3.e(err);
|
|
361
352
|
} finally {
|
|
362
|
-
|
|
353
|
+
_iterator3.f();
|
|
363
354
|
}
|
|
364
355
|
}
|
|
365
356
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"names":["I3SNodePagesTiles","tileset","options","nodesPerPage","nodePages","lodSelectionMetricType","initSelectedFormatsForTextureDefinitions","id","pageIndex","Math","floor","pendingNodePages","nodePageUrl","url","i3s","token","status","promise","I3SNodePageLoader","nodeIndex","nodes","getNodeById","node","children","child","childNode","push","toString","obb","textureFormat","attributeUrls","isDracoGeometry","mesh","geometry","getContentUrl","isDracoGeometryResult","contentUrl","getInformationFromMaterial","material","textureData","nodeMaterialDefinition","materialDefinition","format","name","textureUrl","resource","attributeStorageInfo","attribute","lodSelection","getLodSelection","textureLoaderOptions","meshGeometryData","result","geometryDefinition","geometryDefinitions","definition","geometryIndex","useDracoGeometry","geometryBuffers","findIndex","buffer","compressedAttributes","encoding","Boolean","metricType","maxError","sqrt","lodThreshold","PI","informationFromMaterial","materialDefinitions","textureSetDefinitionIndex","pbrMetallicRoughness","baseColorTexture","textureSetDefinitionId","textureDefinitionsSelectedFormats","possibleI3sFormats","getSupportedTextureFormats","textureSetDefinitions","textureSetDefinition","formats","selectedFormat","i3sFormat","find","value","basis","containerFormat","module","useCompressedTextures","supportedCompressedFormats","has"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;IAkBqBA,iB;AAgBnB,6BAAYC,OAAZ,EAAuCC,OAAvC,EAA+D;AAAA;;AAAA;AAAA;AAAA,qDAdvC,EAcuC;AAAA,4DAbgB,EAahB;AAAA;AAAA;AAAA;AAAA,6EAT0B,EAS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V,UAAAA,OAAO,CAACtD,IAAR,CAAa,UAAb;AACD;;AACD,YAAI+D,0BAA0B,CAACC,GAA3B,CAA+B,KAA/B,CAAJ,EAA2C;AACzCV,UAAAA,OAAO,CAACtD,IAAR,CAAa,KAAb;AACD;;AAIDsD,QAAAA,OAAO,CAACtD,IAAR,CAAa,MAAb;AACD;;AAEDsD,MAAAA,OAAO,CAACtD,IAAR,CAAa,KAAb;AACAsD,MAAAA,OAAO,CAACtD,IAAR,CAAa,KAAb;AACA,aAAOsD,OAAP;AACD","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 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\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 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.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\n async formTileFromNodePages(id: number): Promise<I3STileHeader> {\n const node: NodeInPage = await this.getNodeById(id);\n const children: {id: string; obb: Obb}[] = [];\n for (const child of node.children || []) {\n const childNode = await this.getNodeById(child);\n children.push({\n id: child.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 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 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"],"file":"i3s-nodepages-tiles.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"names":["I3SNodePagesTiles","tileset","options","nodesPerPage","nodePages","lodSelectionMetricType","initSelectedFormatsForTextureDefinitions","id","pageIndex","Math","floor","pendingNodePages","nodePageUrl","url","i3s","token","status","promise","I3SNodePageLoader","nodeIndex","nodes","getNodeById","node","children","childNodesPromises","child","push","Promise","all","childNodes","childNode","index","toString","obb","textureFormat","attributeUrls","isDracoGeometry","mesh","geometry","getContentUrl","isDracoGeometryResult","contentUrl","getInformationFromMaterial","material","textureData","nodeMaterialDefinition","materialDefinition","format","name","textureUrl","resource","attributeStorageInfo","attribute","lodSelection","getLodSelection","textureLoaderOptions","meshGeometryData","result","geometryDefinition","geometryDefinitions","definition","geometryIndex","useDracoGeometry","geometryBuffers","findIndex","buffer","compressedAttributes","encoding","Boolean","metricType","maxError","sqrt","lodThreshold","PI","informationFromMaterial","materialDefinitions","textureSetDefinitionIndex","pbrMetallicRoughness","baseColorTexture","textureSetDefinitionId","textureDefinitionsSelectedFormats","possibleI3sFormats","getSupportedTextureFormats","textureSetDefinitions","textureSetDefinition","formats","selectedFormat","i3sFormat","find","value","basis","containerFormat","module","useCompressedTextures","supportedCompressedFormats","has"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;IAkBqBA,iB;AAgBnB,6BAAYC,OAAZ,EAAuCC,OAAvC,EAA+D;AAAA;;AAAA;AAAA;AAAA,qDAdvC,EAcuC;AAAA,4DAbgB,EAahB;AAAA;AAAA;AAAA;AAAA,6EAT0B,EAS1B;AAAA,gEARV,EAQU;AAC7D,SAAKD,OAAL,qBAAmBA,OAAnB;AACA,SAAKE,YAAL,GAAoB,uBAAAF,OAAO,CAACG,SAAR,0EAAmBD,YAAnB,KAAmC,EAAvD;AACA,SAAKE,sBAAL,0BAA8BJ,OAAO,CAACG,SAAtC,wDAA8B,oBAAmBC,sBAAjD;AACA,SAAKH,OAAL,GAAeA,OAAf;AAEA,SAAKI,wCAAL,CAA8CL,OAA9C;AACD;;;;;mFAMD,iBAAkBM,EAAlB;AAAA;;AAAA;AAAA;AAAA;AAAA;AACQC,gBAAAA,SADR,GACoBC,IAAI,CAACC,KAAL,CAAWH,EAAE,GAAG,KAAKJ,YAArB,CADpB;;AAAA,sBAEM,CAAC,KAAKC,SAAL,CAAeI,SAAf,CAAD,IAA8B,CAAC,KAAKG,gBAAL,CAAsBH,SAAtB,CAFrC;AAAA;AAAA;AAAA;;AAGUI,gBAAAA,WAHV,GAGwB,yCACf,KAAKX,OAAL,CAAaY,GADE,wBACeL,SADf,wBAElB,KAAKN,OAAL,CAAaY,GAFK,sDAElB,kBAAkBC,KAFA,CAHxB;AAOI,qBAAKJ,gBAAL,CAAsBH,SAAtB,IAAmC;AACjCQ,kBAAAA,MAAM,EAAE,SADyB;AAEjCC,kBAAAA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AAA;;AAWxD,cAAIuC,cAAc,IAAIA,cAAc,CAACvC,MAAf,KAA0B,MAAhD,EAAwD;AACtD,iBAAKQ,oBAAL,CAA0BmC,KAA1B,GAAkC;AAChC3C,cAAAA,MAAM,EAAE,2CADwB;AAEhC4C,cAAAA,eAAe,EAAE,MAFe;AAGhCC,cAAAA,MAAM,EAAE;AAHwB,aAAlC;AAKD;;AAED,eAAKZ,iCAAL,CAAuCtD,IAAvC,CAA4C4D,cAA5C;AACD;AAxB+E;AAAA;AAAA;AAAA;AAAA;AAyBjF;;;WAMD,sCAAyD;AACvD,UAAMD,OAA2B,GAAG,EAApC;;AACA,UAAI,CAAC,KAAKnF,OAAL,CAAaY,GAAd,IAAqB,KAAKZ,OAAL,CAAaY,GAAb,CAAiB+E,qBAA1C,EAAiE;AAE/D,YAAMC,0BAA0B,GAAG,8CAAnC;;AAGA,YAAIA,0BAA0B,CAACC,GAA3B,CAA+B,MAA/B,CAAJ,EAA4C;AAC1CV,UAAAA,OAAO,CAAC3D,IAAR,CAAa,UAAb;AACD;;AACD,YAAIoE,0BAA0B,CAACC,GAA3B,CAA+B,KAA/B,CAAJ,EAA2C;AACzCV,UAAAA,OAAO,CAAC3D,IAAR,CAAa,KAAb;AACD;;AAID2D,QAAAA,OAAO,CAAC3D,IAAR,CAAa,MAAb;AACD;;AAED2D,MAAAA,OAAO,CAAC3D,IAAR,CAAa,KAAb;AACA2D,MAAAA,OAAO,CAAC3D,IAAR,CAAa,KAAb;AACA,aAAO2D,OAAP;AACD","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 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\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 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.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 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 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"],"file":"i3s-nodepages-tiles.js"}
|
|
@@ -80,7 +80,7 @@ function _parseI3STileContent() {
|
|
|
80
80
|
tile.content.attributes = {};
|
|
81
81
|
|
|
82
82
|
if (!tile.textureUrl) {
|
|
83
|
-
_context.next =
|
|
83
|
+
_context.next = 37;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -98,7 +98,7 @@ function _parseI3STileContent() {
|
|
|
98
98
|
_arrayBuffer = _context.sent;
|
|
99
99
|
|
|
100
100
|
if (!(options !== null && options !== void 0 && options.i3s.decodeTextures)) {
|
|
101
|
-
_context.next =
|
|
101
|
+
_context.next = 36;
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -131,12 +131,12 @@ function _parseI3STileContent() {
|
|
|
131
131
|
tile.content.texture = _context.sent;
|
|
132
132
|
|
|
133
133
|
case 26:
|
|
134
|
-
_context.next =
|
|
134
|
+
_context.next = 34;
|
|
135
135
|
break;
|
|
136
136
|
|
|
137
137
|
case 28:
|
|
138
138
|
if (!(loader === _textures.CompressedTextureLoader || loader === _textures.BasisLoader)) {
|
|
139
|
-
_context.next =
|
|
139
|
+
_context.next = 34;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -145,6 +145,11 @@ function _parseI3STileContent() {
|
|
|
145
145
|
|
|
146
146
|
case 31:
|
|
147
147
|
texture = _context.sent;
|
|
148
|
+
|
|
149
|
+
if (loader === _textures.BasisLoader) {
|
|
150
|
+
texture = texture[0];
|
|
151
|
+
}
|
|
152
|
+
|
|
148
153
|
tile.content.texture = {
|
|
149
154
|
compressed: true,
|
|
150
155
|
mipmaps: false,
|
|
@@ -153,27 +158,27 @@ function _parseI3STileContent() {
|
|
|
153
158
|
data: texture
|
|
154
159
|
};
|
|
155
160
|
|
|
156
|
-
case
|
|
157
|
-
_context.next =
|
|
161
|
+
case 34:
|
|
162
|
+
_context.next = 37;
|
|
158
163
|
break;
|
|
159
164
|
|
|
160
|
-
case
|
|
165
|
+
case 36:
|
|
161
166
|
tile.content.texture = _arrayBuffer;
|
|
162
167
|
|
|
163
|
-
case
|
|
168
|
+
case 37:
|
|
164
169
|
tile.content.material = makePbrMaterial(tile.materialDefinition, tile.content.texture);
|
|
165
170
|
|
|
166
171
|
if (tile.content.material) {
|
|
167
172
|
tile.content.texture = null;
|
|
168
173
|
}
|
|
169
174
|
|
|
170
|
-
_context.next =
|
|
175
|
+
_context.next = 41;
|
|
171
176
|
return parseI3SNodeGeometry(arrayBuffer, tile, tileset, options);
|
|
172
177
|
|
|
173
|
-
case
|
|
178
|
+
case 41:
|
|
174
179
|
return _context.abrupt("return", _context.sent);
|
|
175
180
|
|
|
176
|
-
case
|
|
181
|
+
case 42:
|
|
177
182
|
case "end":
|
|
178
183
|
return _context.stop();
|
|
179
184
|
}
|
|
@@ -191,7 +196,7 @@ function _parseI3SNodeGeometry() {
|
|
|
191
196
|
_parseI3SNodeGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(arrayBuffer, tile, tileset, options) {
|
|
192
197
|
var _options$i3s2;
|
|
193
198
|
|
|
194
|
-
var content, attributes, vertexCount, byteOffset, featureCount, indices, _decompressedGeometry, decompressedGeometry, _decompressedGeometry2, POSITION, NORMAL, COLOR_0, TEXCOORD_0, featureIndex, uvRegion, featureIds, _tileset$store$defaul, vertexAttributes, attributesOrder, featureAttributes, featureAttributeOrder, headers, _normalizeAttributes, normalizedVertexAttributes, offset, _normalizeAttributes2, normalizedFeatureAttributes, enuMatrix, attributeIndex;
|
|
199
|
+
var content, contentByteLength, attributes, vertexCount, byteOffset, featureCount, indices, _decompressedGeometry, decompressedGeometry, _decompressedGeometry2, POSITION, NORMAL, COLOR_0, TEXCOORD_0, featureIndex, uvRegion, featureIds, _tileset$store$defaul, vertexAttributes, attributesOrder, featureAttributes, featureAttributeOrder, headers, _normalizeAttributes, normalizedVertexAttributes, offset, _normalizeAttributes2, normalizedFeatureAttributes, enuMatrix, attributeIndex;
|
|
195
200
|
|
|
196
201
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
197
202
|
while (1) {
|
|
@@ -206,22 +211,23 @@ function _parseI3SNodeGeometry() {
|
|
|
206
211
|
|
|
207
212
|
case 2:
|
|
208
213
|
content = tile.content;
|
|
214
|
+
contentByteLength = arrayBuffer.byteLength;
|
|
209
215
|
byteOffset = 0;
|
|
210
216
|
featureCount = 0;
|
|
211
217
|
|
|
212
218
|
if (!tile.isDracoGeometry) {
|
|
213
|
-
_context2.next =
|
|
219
|
+
_context2.next = 19;
|
|
214
220
|
break;
|
|
215
221
|
}
|
|
216
222
|
|
|
217
|
-
_context2.next =
|
|
223
|
+
_context2.next = 9;
|
|
218
224
|
return (0, _core.parse)(arrayBuffer, _draco.DracoLoader, {
|
|
219
225
|
draco: {
|
|
220
226
|
attributeNameEntry: I3S_ATTRIBUTE_TYPE
|
|
221
227
|
}
|
|
222
228
|
});
|
|
223
229
|
|
|
224
|
-
case
|
|
230
|
+
case 9:
|
|
225
231
|
decompressedGeometry = _context2.sent;
|
|
226
232
|
vertexCount = decompressedGeometry.header.vertexCount;
|
|
227
233
|
indices = (_decompressedGeometry = decompressedGeometry.indices) === null || _decompressedGeometry === void 0 ? void 0 : _decompressedGeometry.value;
|
|
@@ -241,10 +247,10 @@ function _parseI3SNodeGeometry() {
|
|
|
241
247
|
flattenFeatureIdsByFeatureIndices(attributes, featureIds);
|
|
242
248
|
}
|
|
243
249
|
|
|
244
|
-
_context2.next =
|
|
250
|
+
_context2.next = 28;
|
|
245
251
|
break;
|
|
246
252
|
|
|
247
|
-
case
|
|
253
|
+
case 19:
|
|
248
254
|
_tileset$store$defaul = tileset.store.defaultGeometrySchema, vertexAttributes = _tileset$store$defaul.vertexAttributes, attributesOrder = _tileset$store$defaul.ordering, featureAttributes = _tileset$store$defaul.featureAttributes, featureAttributeOrder = _tileset$store$defaul.featureAttributeOrder;
|
|
249
255
|
headers = parseHeaders(tileset, arrayBuffer);
|
|
250
256
|
byteOffset = headers.byteOffset;
|
|
@@ -255,7 +261,7 @@ function _parseI3SNodeGeometry() {
|
|
|
255
261
|
flattenFeatureIdsByFaceRanges(normalizedFeatureAttributes);
|
|
256
262
|
attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
|
|
257
263
|
|
|
258
|
-
case
|
|
264
|
+
case 28:
|
|
259
265
|
if (!(options !== null && options !== void 0 && (_options$i3s2 = options.i3s) !== null && _options$i3s2 !== void 0 && _options$i3s2.coordinateSystem) || options.i3s.coordinateSystem === _constants.COORDINATE_SYSTEM.METER_OFFSETS) {
|
|
260
266
|
enuMatrix = parsePositions(attributes.position, tile);
|
|
261
267
|
content.modelMatrix = enuMatrix.invert();
|
|
@@ -285,10 +291,10 @@ function _parseI3SNodeGeometry() {
|
|
|
285
291
|
}
|
|
286
292
|
|
|
287
293
|
content.vertexCount = vertexCount;
|
|
288
|
-
content.byteLength =
|
|
294
|
+
content.byteLength = contentByteLength;
|
|
289
295
|
return _context2.abrupt("return", tile);
|
|
290
296
|
|
|
291
|
-
case
|
|
297
|
+
case 36:
|
|
292
298
|
case "end":
|
|
293
299
|
return _context2.stop();
|
|
294
300
|
}
|
|
@@ -373,7 +379,7 @@ function parseHeaders(tileset, arrayBuffer) {
|
|
|
373
379
|
};
|
|
374
380
|
}
|
|
375
381
|
|
|
376
|
-
function normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes,
|
|
382
|
+
function normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes, attributeCount, attributesOrder) {
|
|
377
383
|
var attributes = {};
|
|
378
384
|
|
|
379
385
|
var _iterator2 = _createForOfIteratorHelper(attributesOrder),
|
|
@@ -387,40 +393,39 @@ function normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes, vertexCo
|
|
|
387
393
|
var _vertexAttributes$att = vertexAttributes[attribute],
|
|
388
394
|
valueType = _vertexAttributes$att.valueType,
|
|
389
395
|
valuesPerElement = _vertexAttributes$att.valuesPerElement;
|
|
390
|
-
var count = vertexCount;
|
|
391
|
-
|
|
392
|
-
if (byteOffset + count * valuesPerElement > arrayBuffer.byteLength) {
|
|
393
|
-
break;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
var buffer = arrayBuffer.slice(byteOffset);
|
|
397
|
-
var value = void 0;
|
|
398
396
|
|
|
399
|
-
if (valueType
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
397
|
+
if (byteOffset + attributeCount * valuesPerElement * (0, _constants.sizeOf)(valueType) <= arrayBuffer.byteLength) {
|
|
398
|
+
var buffer = arrayBuffer.slice(byteOffset);
|
|
399
|
+
var value = void 0;
|
|
400
|
+
|
|
401
|
+
if (valueType === 'UInt64') {
|
|
402
|
+
value = parseUint64Values(buffer, attributeCount * valuesPerElement, (0, _constants.sizeOf)(valueType));
|
|
403
|
+
} else {
|
|
404
|
+
var TypedArrayType = (0, _constants.getConstructorForDataFormat)(valueType);
|
|
405
|
+
value = new TypedArrayType(buffer, 0, attributeCount * valuesPerElement);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
attributes[attribute] = {
|
|
409
|
+
value: value,
|
|
410
|
+
type: _constants.GL_TYPE_MAP[valueType],
|
|
411
|
+
size: valuesPerElement
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
switch (attribute) {
|
|
415
|
+
case 'color':
|
|
416
|
+
attributes.color.normalized = true;
|
|
417
|
+
break;
|
|
411
418
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
419
|
+
case 'position':
|
|
420
|
+
case 'region':
|
|
421
|
+
case 'normal':
|
|
422
|
+
default:
|
|
423
|
+
}
|
|
416
424
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
default:
|
|
425
|
+
byteOffset = byteOffset + attributeCount * valuesPerElement * (0, _constants.sizeOf)(valueType);
|
|
426
|
+
} else if (attribute !== 'uv0') {
|
|
427
|
+
break;
|
|
421
428
|
}
|
|
422
|
-
|
|
423
|
-
byteOffset = byteOffset + count * valuesPerElement * (0, _constants.sizeOf)(valueType);
|
|
424
429
|
}
|
|
425
430
|
}
|
|
426
431
|
} catch (err) {
|