@itwin/rpcinterface-full-stack-tests 4.6.0-dev.3 → 4.6.0-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +280 -98
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js +698 -0
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js.map +1 -0
- package/package.json +14 -14
|
@@ -28384,10 +28384,12 @@ class BeEventList {
|
|
|
28384
28384
|
"use strict";
|
|
28385
28385
|
__webpack_require__.r(__webpack_exports__);
|
|
28386
28386
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
28387
|
+
/* harmony export */ "DbChangeStage": () => (/* binding */ DbChangeStage),
|
|
28387
28388
|
/* harmony export */ "DbConflictCause": () => (/* binding */ DbConflictCause),
|
|
28388
28389
|
/* harmony export */ "DbConflictResolution": () => (/* binding */ DbConflictResolution),
|
|
28389
28390
|
/* harmony export */ "DbOpcode": () => (/* binding */ DbOpcode),
|
|
28390
28391
|
/* harmony export */ "DbResult": () => (/* binding */ DbResult),
|
|
28392
|
+
/* harmony export */ "DbValueType": () => (/* binding */ DbValueType),
|
|
28391
28393
|
/* harmony export */ "OpenMode": () => (/* binding */ OpenMode)
|
|
28392
28394
|
/* harmony export */ });
|
|
28393
28395
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -28417,6 +28419,25 @@ var DbOpcode;
|
|
|
28417
28419
|
/** Some columns of an existing row were updated. */
|
|
28418
28420
|
DbOpcode[DbOpcode["Update"] = 23] = "Update";
|
|
28419
28421
|
})(DbOpcode || (DbOpcode = {}));
|
|
28422
|
+
/** Change value stage.
|
|
28423
|
+
* @internal
|
|
28424
|
+
*/
|
|
28425
|
+
var DbChangeStage;
|
|
28426
|
+
(function (DbChangeStage) {
|
|
28427
|
+
DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
|
|
28428
|
+
DbChangeStage[DbChangeStage["New"] = 1] = "New";
|
|
28429
|
+
})(DbChangeStage || (DbChangeStage = {}));
|
|
28430
|
+
/** Change value type.
|
|
28431
|
+
* @internal
|
|
28432
|
+
*/
|
|
28433
|
+
var DbValueType;
|
|
28434
|
+
(function (DbValueType) {
|
|
28435
|
+
DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
|
|
28436
|
+
DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
|
|
28437
|
+
DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
|
|
28438
|
+
DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
|
|
28439
|
+
DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
|
|
28440
|
+
})(DbValueType || (DbValueType = {}));
|
|
28420
28441
|
/** Cause of conflict when applying a changeset
|
|
28421
28442
|
* @internal
|
|
28422
28443
|
*/
|
|
@@ -34581,10 +34602,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34581
34602
|
/* harmony export */ "ByteStream": () => (/* reexport safe */ _ByteStream__WEBPACK_IMPORTED_MODULE_7__.ByteStream),
|
|
34582
34603
|
/* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.ChangeSetStatus),
|
|
34583
34604
|
/* harmony export */ "CompressedId64Set": () => (/* reexport safe */ _CompressedId64Set__WEBPACK_IMPORTED_MODULE_10__.CompressedId64Set),
|
|
34605
|
+
/* harmony export */ "DbChangeStage": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbChangeStage),
|
|
34584
34606
|
/* harmony export */ "DbConflictCause": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbConflictCause),
|
|
34585
34607
|
/* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbConflictResolution),
|
|
34586
34608
|
/* harmony export */ "DbOpcode": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbOpcode),
|
|
34587
34609
|
/* harmony export */ "DbResult": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbResult),
|
|
34610
|
+
/* harmony export */ "DbValueType": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbValueType),
|
|
34588
34611
|
/* harmony export */ "Dictionary": () => (/* reexport safe */ _Dictionary__WEBPACK_IMPORTED_MODULE_11__.Dictionary),
|
|
34589
34612
|
/* harmony export */ "DisposableList": () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.DisposableList),
|
|
34590
34613
|
/* harmony export */ "DuplicatePolicy": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.DuplicatePolicy),
|
|
@@ -106874,6 +106897,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106874
106897
|
/* harmony export */ "createSurfaceMaterial": () => (/* reexport safe */ _common_render_primitives_SurfaceParams__WEBPACK_IMPORTED_MODULE_26__.createSurfaceMaterial),
|
|
106875
106898
|
/* harmony export */ "createWorkerProxy": () => (/* reexport safe */ _common_WorkerProxy__WEBPACK_IMPORTED_MODULE_32__.createWorkerProxy),
|
|
106876
106899
|
/* harmony export */ "decodeImdlGraphics": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.decodeImdlGraphics),
|
|
106900
|
+
/* harmony export */ "decodeMeshoptBuffer": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.decodeMeshoptBuffer),
|
|
106877
106901
|
/* harmony export */ "disposeTileTreesForGeometricModels": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.disposeTileTreesForGeometricModels),
|
|
106878
106902
|
/* harmony export */ "edgeParamsFromImdl": () => (/* reexport safe */ _common_imdl_ParseImdlDocument__WEBPACK_IMPORTED_MODULE_16__.edgeParamsFromImdl),
|
|
106879
106903
|
/* harmony export */ "extractImageSourceDimensions": () => (/* reexport safe */ _common_ImageUtil__WEBPACK_IMPORTED_MODULE_13__.extractImageSourceDimensions),
|
|
@@ -145571,11 +145595,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
145571
145595
|
/* harmony import */ var _render_RealityMeshParams__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../render/RealityMeshParams */ "../../core/frontend/lib/esm/render/RealityMeshParams.js");
|
|
145572
145596
|
/* harmony import */ var _render_primitives_mesh_MeshPrimitives__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../render/primitives/mesh/MeshPrimitives */ "../../core/frontend/lib/esm/render/primitives/mesh/MeshPrimitives.js");
|
|
145573
145597
|
/* harmony import */ var _render_primitives_Primitives__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/primitives/Primitives */ "../../core/frontend/lib/esm/render/primitives/Primitives.js");
|
|
145574
|
-
/* harmony import */ var
|
|
145575
|
-
/* harmony import */ var
|
|
145576
|
-
/* harmony import */ var
|
|
145577
|
-
/* harmony import */ var
|
|
145578
|
-
/* harmony import */ var
|
|
145598
|
+
/* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internal */ "../../core/frontend/lib/esm/tile/internal.js");
|
|
145599
|
+
/* harmony import */ var _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/render/primitives/DisplayParams */ "../../core/frontend/lib/esm/common/render/primitives/DisplayParams.js");
|
|
145600
|
+
/* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
|
|
145601
|
+
/* harmony import */ var _common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/ImageUtil */ "../../core/frontend/lib/esm/common/ImageUtil.js");
|
|
145602
|
+
/* harmony import */ var _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/render/primitives/MeshPrimitive */ "../../core/frontend/lib/esm/common/render/primitives/MeshPrimitive.js");
|
|
145603
|
+
/* harmony import */ var _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/gltf/GltfSchema */ "../../core/frontend/lib/esm/common/gltf/GltfSchema.js");
|
|
145579
145604
|
/*---------------------------------------------------------------------------------------------
|
|
145580
145605
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
145581
145606
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -145596,6 +145621,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
145596
145621
|
|
|
145597
145622
|
|
|
145598
145623
|
|
|
145624
|
+
|
|
145599
145625
|
/**
|
|
145600
145626
|
* A chunk of binary data exposed as a typed array.
|
|
145601
145627
|
* The count member indicates how many elements exist. This may be less than this.buffer.length due to padding added to the
|
|
@@ -145616,15 +145642,15 @@ class GltfBufferData {
|
|
|
145616
145642
|
if (expectedType !== actualType) {
|
|
145617
145643
|
// Some data is stored in smaller data types to save space if no values exceed the maximum of the smaller type.
|
|
145618
145644
|
switch (expectedType) {
|
|
145619
|
-
case
|
|
145620
|
-
case
|
|
145645
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
|
|
145646
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
145621
145647
|
return undefined;
|
|
145622
|
-
case
|
|
145623
|
-
if (
|
|
145648
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
|
|
145649
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== actualType)
|
|
145624
145650
|
return undefined;
|
|
145625
145651
|
break;
|
|
145626
|
-
case
|
|
145627
|
-
if (
|
|
145652
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
|
|
145653
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== actualType && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort !== actualType)
|
|
145628
145654
|
return undefined;
|
|
145629
145655
|
break;
|
|
145630
145656
|
}
|
|
@@ -145636,13 +145662,13 @@ class GltfBufferData {
|
|
|
145636
145662
|
// NB: Endianness of typed array data is determined by the 'platform byte order'. Actual data is always little-endian.
|
|
145637
145663
|
// We are assuming little-endian platform. If we find a big-endian platform, we'll need to use a DataView instead.
|
|
145638
145664
|
switch (actualType) {
|
|
145639
|
-
case
|
|
145665
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
145640
145666
|
return bytes;
|
|
145641
|
-
case
|
|
145667
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
|
|
145642
145668
|
return new Uint16Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 2);
|
|
145643
|
-
case
|
|
145669
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
|
|
145644
145670
|
return new Uint32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
|
|
145645
|
-
case
|
|
145671
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
|
|
145646
145672
|
return new Float32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
|
|
145647
145673
|
default:
|
|
145648
145674
|
return undefined;
|
|
@@ -145769,7 +145795,7 @@ function colorFromJson(values) {
|
|
|
145769
145795
|
}
|
|
145770
145796
|
function colorFromMaterial(material, isTransparent) {
|
|
145771
145797
|
let color = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white;
|
|
145772
|
-
if ((0,
|
|
145798
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material)) {
|
|
145773
145799
|
if (material.values?.color && Array.isArray(material.values.color))
|
|
145774
145800
|
color = colorFromJson(material.values.color);
|
|
145775
145801
|
}
|
|
@@ -145860,7 +145886,7 @@ class GltfReader {
|
|
|
145860
145886
|
* @throws Error if a node appears more than once during traversal
|
|
145861
145887
|
*/
|
|
145862
145888
|
traverseNodes(nodeIds) {
|
|
145863
|
-
return (0,
|
|
145889
|
+
return (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.traverseGltfNodes)(nodeIds, this._nodes, new Set());
|
|
145864
145890
|
}
|
|
145865
145891
|
/** Traverse the nodes specified by their scene, recursing into their child nodes.
|
|
145866
145892
|
* @throws Error if a node appears more than once during traversal
|
|
@@ -145985,9 +146011,9 @@ class GltfReader {
|
|
|
145985
146011
|
return undefined;
|
|
145986
146012
|
}
|
|
145987
146013
|
const translationsView = this.getBufferView(ext.attributes, "TRANSLATION");
|
|
145988
|
-
const translations = translationsView?.toBufferData(
|
|
145989
|
-
const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(
|
|
145990
|
-
const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(
|
|
146014
|
+
const translations = translationsView?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146015
|
+
const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146016
|
+
const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
145991
146017
|
// All attributes must specify the same count, count must be greater than zero, and at least one attribute must be specified.
|
|
145992
146018
|
const count = translations?.count ?? rotations?.count ?? scales?.count;
|
|
145993
146019
|
if (!count || (rotations && rotations.count !== count) || (scales && scales.count !== count)) {
|
|
@@ -146060,7 +146086,7 @@ class GltfReader {
|
|
|
146060
146086
|
let thisBias;
|
|
146061
146087
|
if (undefined !== pseudoRtcBias)
|
|
146062
146088
|
thisBias = (undefined === thisTransform) ? pseudoRtcBias : thisTransform.matrix.multiplyInverse(pseudoRtcBias);
|
|
146063
|
-
for (const meshKey of (0,
|
|
146089
|
+
for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
|
|
146064
146090
|
const nodeMesh = this._meshes[meshKey];
|
|
146065
146091
|
if (nodeMesh?.primitives) {
|
|
146066
146092
|
const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias, nodeInstances);
|
|
@@ -146159,23 +146185,28 @@ class GltfReader {
|
|
|
146159
146185
|
return undefined;
|
|
146160
146186
|
const bufferViewAccessorValue = accessor.bufferView;
|
|
146161
146187
|
const bufferView = undefined !== bufferViewAccessorValue ? this._bufferViews[bufferViewAccessorValue] : undefined;
|
|
146162
|
-
if (!bufferView
|
|
146188
|
+
if (!bufferView)
|
|
146163
146189
|
return undefined;
|
|
146164
|
-
|
|
146165
|
-
|
|
146190
|
+
let bufferData = bufferView.resolvedBuffer;
|
|
146191
|
+
if (!bufferData) {
|
|
146192
|
+
if (undefined === bufferView.buffer)
|
|
146193
|
+
return undefined;
|
|
146194
|
+
const buffer = this._buffers[bufferView.buffer];
|
|
146195
|
+
bufferData = buffer?.resolvedBuffer;
|
|
146196
|
+
}
|
|
146166
146197
|
if (!bufferData)
|
|
146167
146198
|
return undefined;
|
|
146168
146199
|
const type = accessor.componentType;
|
|
146169
146200
|
let dataSize = 0;
|
|
146170
146201
|
switch (type) {
|
|
146171
|
-
case
|
|
146202
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
146172
146203
|
dataSize = 1;
|
|
146173
146204
|
break;
|
|
146174
|
-
case
|
|
146205
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
|
|
146175
146206
|
dataSize = 2;
|
|
146176
146207
|
break;
|
|
146177
|
-
case
|
|
146178
|
-
case
|
|
146208
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
|
|
146209
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
|
|
146179
146210
|
dataSize = 4;
|
|
146180
146211
|
break;
|
|
146181
146212
|
default:
|
|
@@ -146205,10 +146236,10 @@ class GltfReader {
|
|
|
146205
146236
|
return undefined;
|
|
146206
146237
|
}
|
|
146207
146238
|
}
|
|
146208
|
-
readBufferData32(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
146209
|
-
readBufferData16(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
146210
|
-
readBufferData8(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
146211
|
-
readBufferDataFloat(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
146239
|
+
readBufferData32(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32); }
|
|
146240
|
+
readBufferData16(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort); }
|
|
146241
|
+
readBufferData8(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte); }
|
|
146242
|
+
readBufferDataFloat(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float); }
|
|
146212
146243
|
constructor(args) {
|
|
146213
146244
|
this._resolvedTextures = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Dictionary((lhs, rhs) => compareTextureKeys(lhs, rhs));
|
|
146214
146245
|
this._dracoMeshes = new Map();
|
|
@@ -146218,7 +146249,7 @@ class GltfReader {
|
|
|
146218
146249
|
* (We also don't want to produce mip-maps for them, which is determined indirectly from the wrap mode).
|
|
146219
146250
|
* Allow the default to be optionally overridden.
|
|
146220
146251
|
*/
|
|
146221
|
-
this.defaultWrapMode =
|
|
146252
|
+
this.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.Repeat;
|
|
146222
146253
|
this._glTF = args.props.glTF;
|
|
146223
146254
|
this._version = args.props.version;
|
|
146224
146255
|
this._yAxisUp = args.props.yAxisUp;
|
|
@@ -146270,7 +146301,7 @@ class GltfReader {
|
|
|
146270
146301
|
if (typeof material !== "object")
|
|
146271
146302
|
return undefined;
|
|
146272
146303
|
// Bimium's shader value...almost certainly obsolete at this point.
|
|
146273
|
-
if ((0,
|
|
146304
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
|
|
146274
146305
|
return material.diffuse ?? this.extractId(material.values?.tex);
|
|
146275
146306
|
// KHR_techniques_webgl extension
|
|
146276
146307
|
const techniques = this._glTF.extensions?.KHR_techniques_webgl?.techniques;
|
|
@@ -146280,7 +146311,7 @@ class GltfReader {
|
|
|
146280
146311
|
if (typeof uniforms === "object") {
|
|
146281
146312
|
for (const uniformName of Object.keys(uniforms)) {
|
|
146282
146313
|
const uniform = uniforms[uniformName];
|
|
146283
|
-
if (typeof uniform === "object" && uniform.type ===
|
|
146314
|
+
if (typeof uniform === "object" && uniform.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Sampler2d)
|
|
146284
146315
|
return this.extractId(ext.values[uniformName]?.index);
|
|
146285
146316
|
}
|
|
146286
146317
|
}
|
|
@@ -146291,15 +146322,15 @@ class GltfReader {
|
|
|
146291
146322
|
extractNormalMapId(material) {
|
|
146292
146323
|
if (typeof material !== "object")
|
|
146293
146324
|
return undefined;
|
|
146294
|
-
if ((0,
|
|
146325
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
|
|
146295
146326
|
return undefined;
|
|
146296
146327
|
return this.extractId(material.normalTexture?.index);
|
|
146297
146328
|
}
|
|
146298
146329
|
isMaterialTransparent(material) {
|
|
146299
|
-
if ((0,
|
|
146330
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material)) {
|
|
146300
146331
|
if (this._glTF.techniques && undefined !== material.technique) {
|
|
146301
146332
|
const technique = this._glTF.techniques[material.technique];
|
|
146302
|
-
if (technique?.states?.enable?.some((state) => state ===
|
|
146333
|
+
if (technique?.states?.enable?.some((state) => state === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfTechniqueState.Blend))
|
|
146303
146334
|
return true;
|
|
146304
146335
|
}
|
|
146305
146336
|
return false;
|
|
@@ -146323,11 +146354,11 @@ class GltfReader {
|
|
|
146323
146354
|
// DisplayParams doesn't want a separate texture mapping if the material already has one.
|
|
146324
146355
|
textureMapping = undefined;
|
|
146325
146356
|
}
|
|
146326
|
-
return new
|
|
146357
|
+
return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_9__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_9__.DisplayParams.Type.Mesh, color, color, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.None, renderMaterial, undefined, hasBakedLighting, textureMapping);
|
|
146327
146358
|
}
|
|
146328
146359
|
readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
|
|
146329
146360
|
const meshes = [];
|
|
146330
|
-
for (const meshKey of (0,
|
|
146361
|
+
for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
|
|
146331
146362
|
const nodeMesh = this._meshes[meshKey];
|
|
146332
146363
|
if (nodeMesh?.primitives) {
|
|
146333
146364
|
for (const primitive of nodeMesh.primitives) {
|
|
@@ -146367,9 +146398,9 @@ class GltfReader {
|
|
|
146367
146398
|
return meshes;
|
|
146368
146399
|
}
|
|
146369
146400
|
readMeshPrimitive(primitive, featureTable, pseudoRtcBias) {
|
|
146370
|
-
const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode,
|
|
146371
|
-
if (meshMode ===
|
|
146372
|
-
const pointCloud = this.
|
|
146401
|
+
const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Triangles);
|
|
146402
|
+
if (meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Points /* && !this._vertexTableRequired */) {
|
|
146403
|
+
const pointCloud = this.readPointCloud2(primitive, undefined !== featureTable);
|
|
146373
146404
|
if (pointCloud)
|
|
146374
146405
|
return pointCloud;
|
|
146375
146406
|
}
|
|
@@ -146383,14 +146414,14 @@ class GltfReader {
|
|
|
146383
146414
|
return undefined;
|
|
146384
146415
|
let primitiveType = -1;
|
|
146385
146416
|
switch (meshMode) {
|
|
146386
|
-
case
|
|
146387
|
-
primitiveType =
|
|
146417
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Lines:
|
|
146418
|
+
primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Polyline;
|
|
146388
146419
|
break;
|
|
146389
|
-
case
|
|
146390
|
-
primitiveType =
|
|
146420
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Points:
|
|
146421
|
+
primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point;
|
|
146391
146422
|
break;
|
|
146392
|
-
case
|
|
146393
|
-
primitiveType =
|
|
146423
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Triangles:
|
|
146424
|
+
primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Mesh;
|
|
146394
146425
|
break;
|
|
146395
146426
|
default:
|
|
146396
146427
|
return undefined;
|
|
@@ -146418,7 +146449,7 @@ class GltfReader {
|
|
|
146418
146449
|
const colorIndices = this.readBufferData16(primitive.attributes, "_COLORINDEX");
|
|
146419
146450
|
if (undefined !== colorIndices && material) {
|
|
146420
146451
|
let texStep;
|
|
146421
|
-
if ((0,
|
|
146452
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
|
|
146422
146453
|
texStep = material.values?.texStep;
|
|
146423
146454
|
else
|
|
146424
146455
|
texStep = material.extensions?.KHR_techniques_webgl?.values?.u_texStep;
|
|
@@ -146448,14 +146479,14 @@ class GltfReader {
|
|
|
146448
146479
|
if (!this.readVertices(mesh, primitive, pseudoRtcBias))
|
|
146449
146480
|
return undefined;
|
|
146450
146481
|
switch (primitiveType) {
|
|
146451
|
-
case
|
|
146482
|
+
case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Mesh: {
|
|
146452
146483
|
if (!this.readMeshIndices(mesh, primitive))
|
|
146453
146484
|
return undefined;
|
|
146454
146485
|
if (!displayParams.ignoreLighting && !this.readNormals(mesh, primitive.attributes, "NORMAL"))
|
|
146455
146486
|
return undefined;
|
|
146456
146487
|
if (!mesh.uvs) {
|
|
146457
146488
|
let texCoordIndex = 0;
|
|
146458
|
-
if (!(0,
|
|
146489
|
+
if (!(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material) && undefined !== material.pbrMetallicRoughness?.baseColorTexture?.texCoord)
|
|
146459
146490
|
texCoordIndex = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(material.pbrMetallicRoughness.baseColorTexture.texCoord);
|
|
146460
146491
|
this.readUVParams(mesh, primitive.attributes, `TEXCOORD_${texCoordIndex}`);
|
|
146461
146492
|
}
|
|
@@ -146463,9 +146494,9 @@ class GltfReader {
|
|
|
146463
146494
|
return undefined;
|
|
146464
146495
|
break;
|
|
146465
146496
|
}
|
|
146466
|
-
case
|
|
146467
|
-
case
|
|
146468
|
-
if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices",
|
|
146497
|
+
case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Polyline:
|
|
146498
|
+
case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point: {
|
|
146499
|
+
if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices", _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point === primitiveType))
|
|
146469
146500
|
return undefined;
|
|
146470
146501
|
break;
|
|
146471
146502
|
}
|
|
@@ -146487,23 +146518,60 @@ class GltfReader {
|
|
|
146487
146518
|
}
|
|
146488
146519
|
return mesh;
|
|
146489
146520
|
}
|
|
146490
|
-
|
|
146521
|
+
readPointCloud2(primitive, hasFeatures) {
|
|
146522
|
+
let pointRange;
|
|
146523
|
+
let positions;
|
|
146524
|
+
let qparams;
|
|
146491
146525
|
const posView = this.getBufferView(primitive.attributes, "POSITION");
|
|
146492
|
-
|
|
146493
|
-
|
|
146494
|
-
|
|
146495
|
-
|
|
146496
|
-
|
|
146526
|
+
switch (posView?.type) {
|
|
146527
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
|
|
146528
|
+
const posData = posView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146529
|
+
if (!(posData?.buffer instanceof Float32Array)) {
|
|
146530
|
+
return undefined;
|
|
146531
|
+
}
|
|
146532
|
+
positions = posData.buffer;
|
|
146533
|
+
const strideSkip = posView.stride - 3;
|
|
146534
|
+
pointRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
|
|
146535
|
+
for (let i = 0; i < positions.length; i += strideSkip) {
|
|
146536
|
+
pointRange.extendXYZ(positions[i++], positions[i++], positions[i++]);
|
|
146537
|
+
}
|
|
146538
|
+
qparams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QParams3d.fromOriginAndScale(new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(0, 0, 0), new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(1, 1, 1));
|
|
146539
|
+
break;
|
|
146540
|
+
}
|
|
146541
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
146542
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort: {
|
|
146543
|
+
const posData = posView.toBufferData(posView.type);
|
|
146544
|
+
if (!(posData?.buffer instanceof Uint8Array || posData?.buffer instanceof Uint16Array)) {
|
|
146545
|
+
return undefined;
|
|
146546
|
+
}
|
|
146547
|
+
positions = posData.buffer;
|
|
146548
|
+
let min, max;
|
|
146549
|
+
const ext = posView.accessor.extensions?.WEB3D_quantized_attributes;
|
|
146550
|
+
if (ext) {
|
|
146551
|
+
min = ext.decodedMin;
|
|
146552
|
+
max = ext.decodedMax;
|
|
146553
|
+
}
|
|
146554
|
+
else {
|
|
146555
|
+
// Assume KHR_mesh_quantization...
|
|
146556
|
+
min = posView.accessor.min;
|
|
146557
|
+
max = posView.accessor.max;
|
|
146558
|
+
}
|
|
146559
|
+
if (undefined === min || undefined === max) {
|
|
146560
|
+
return undefined;
|
|
146561
|
+
}
|
|
146562
|
+
pointRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d.createXYZXYZ(min[0], min[1], min[2], max[0], max[1], max[2]);
|
|
146563
|
+
qparams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QParams3d.fromRange(pointRange);
|
|
146564
|
+
break;
|
|
146565
|
+
}
|
|
146566
|
+
default:
|
|
146567
|
+
return undefined;
|
|
146568
|
+
}
|
|
146497
146569
|
const colorView = this.getBufferView(primitive.attributes, "COLOR_0");
|
|
146498
|
-
if (!colorView ||
|
|
146570
|
+
if (!colorView || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== colorView.type)
|
|
146499
146571
|
return undefined;
|
|
146500
|
-
const colorData = colorView.toBufferData(
|
|
146572
|
+
const colorData = colorView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte);
|
|
146501
146573
|
if (!(colorData?.buffer instanceof Uint8Array))
|
|
146502
146574
|
return undefined;
|
|
146503
|
-
const strideSkip = posView.stride - 3;
|
|
146504
|
-
const pointRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
|
|
146505
|
-
for (let i = 0; i < posData.buffer.length; i += strideSkip)
|
|
146506
|
-
pointRange.extendXYZ(posData.buffer[i++], posData.buffer[i++], posData.buffer[i++]);
|
|
146507
146575
|
let colors = colorData.buffer;
|
|
146508
146576
|
if ("VEC4" === colorView.accessor.type) {
|
|
146509
146577
|
// ###TODO support transparent point clouds
|
|
@@ -146516,13 +146584,14 @@ class GltfReader {
|
|
|
146516
146584
|
}
|
|
146517
146585
|
}
|
|
146518
146586
|
const features = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FeatureIndex();
|
|
146519
|
-
if (hasFeatures)
|
|
146587
|
+
if (hasFeatures) {
|
|
146520
146588
|
features.type = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FeatureIndexType.Uniform;
|
|
146589
|
+
}
|
|
146521
146590
|
this._containsPointCloud = true;
|
|
146522
146591
|
return {
|
|
146523
146592
|
type: "pointcloud",
|
|
146524
|
-
positions
|
|
146525
|
-
qparams
|
|
146593
|
+
positions,
|
|
146594
|
+
qparams,
|
|
146526
146595
|
pointRange,
|
|
146527
146596
|
colors,
|
|
146528
146597
|
colorFormat: "rgb",
|
|
@@ -146629,8 +146698,8 @@ class GltfReader {
|
|
|
146629
146698
|
const view = this.getBufferView(primitive.attributes, "POSITION");
|
|
146630
146699
|
if (undefined === view)
|
|
146631
146700
|
return false;
|
|
146632
|
-
if (
|
|
146633
|
-
const buffer = view.toBufferData(
|
|
146701
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float === view.type) {
|
|
146702
|
+
const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146634
146703
|
if (undefined === buffer)
|
|
146635
146704
|
return false;
|
|
146636
146705
|
const strideSkip = view.stride - 3;
|
|
@@ -146649,15 +146718,23 @@ class GltfReader {
|
|
|
146649
146718
|
mesh.points = positions.toTypedArray();
|
|
146650
146719
|
}
|
|
146651
146720
|
else {
|
|
146652
|
-
if (
|
|
146721
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort !== view.type)
|
|
146653
146722
|
return false;
|
|
146723
|
+
let rangeMin, rangeMax;
|
|
146654
146724
|
const quantized = view.accessor.extensions?.WEB3D_quantized_attributes;
|
|
146655
|
-
|
|
146656
|
-
|
|
146657
|
-
|
|
146725
|
+
if (quantized) {
|
|
146726
|
+
rangeMin = quantized.decodedMin;
|
|
146727
|
+
rangeMax = quantized.decodedMax;
|
|
146728
|
+
}
|
|
146729
|
+
else {
|
|
146730
|
+
// Assume KHR_mesh_quantization...
|
|
146731
|
+
rangeMin = view.accessor.min;
|
|
146732
|
+
rangeMax = view.accessor.max;
|
|
146733
|
+
}
|
|
146734
|
+
if (undefined === rangeMin || undefined === rangeMax) // required by spec...
|
|
146658
146735
|
return false;
|
|
146659
146736
|
// ###TODO apply WEB3D_quantized_attributes.decodeMatrix? Have not encountered in the wild; glTF 1.0 only.
|
|
146660
|
-
const buffer = view.toBufferData(
|
|
146737
|
+
const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort);
|
|
146661
146738
|
if (undefined === buffer || !(buffer.buffer instanceof Uint16Array))
|
|
146662
146739
|
return false;
|
|
146663
146740
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(buffer.buffer instanceof Uint16Array);
|
|
@@ -146719,8 +146796,8 @@ class GltfReader {
|
|
|
146719
146796
|
if (undefined === view)
|
|
146720
146797
|
return false;
|
|
146721
146798
|
switch (view.type) {
|
|
146722
|
-
case
|
|
146723
|
-
const data = view.toBufferData(
|
|
146799
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
|
|
146800
|
+
const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146724
146801
|
if (undefined === data)
|
|
146725
146802
|
return false;
|
|
146726
146803
|
mesh.normals = new Uint16Array(data.count);
|
|
@@ -146732,8 +146809,8 @@ class GltfReader {
|
|
|
146732
146809
|
}
|
|
146733
146810
|
return true;
|
|
146734
146811
|
}
|
|
146735
|
-
case
|
|
146736
|
-
const data = view.toBufferData(
|
|
146812
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte: {
|
|
146813
|
+
const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte);
|
|
146737
146814
|
if (undefined === data)
|
|
146738
146815
|
return false;
|
|
146739
146816
|
// ###TODO: we shouldn't have to allocate OctEncodedNormal objects...just use uint16s / numbers...
|
|
@@ -146752,13 +146829,13 @@ class GltfReader {
|
|
|
146752
146829
|
}
|
|
146753
146830
|
readColors(mesh, attribute, accessorName) {
|
|
146754
146831
|
const view = this.getBufferView(attribute, accessorName);
|
|
146755
|
-
if (!view || (
|
|
146832
|
+
if (!view || (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float !== view.type && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== view.type && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.SignedByte !== view.type))
|
|
146756
146833
|
return false;
|
|
146757
146834
|
const data = view.toBufferData(view.type);
|
|
146758
146835
|
if (!data)
|
|
146759
146836
|
return false;
|
|
146760
146837
|
const hasAlpha = "VEC4" === view.accessor.type;
|
|
146761
|
-
const factor = view.type ===
|
|
146838
|
+
const factor = view.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float ? 255 : 1;
|
|
146762
146839
|
const rgbt = new Uint8Array(4);
|
|
146763
146840
|
const color = new Uint32Array(rgbt.buffer);
|
|
146764
146841
|
for (let i = 0; i < data.count; i++) {
|
|
@@ -146776,7 +146853,7 @@ class GltfReader {
|
|
|
146776
146853
|
if (view === undefined)
|
|
146777
146854
|
return false;
|
|
146778
146855
|
switch (view.type) {
|
|
146779
|
-
case
|
|
146856
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
|
|
146780
146857
|
const data = this.readBufferDataFloat(json, accessorName);
|
|
146781
146858
|
if (!data)
|
|
146782
146859
|
return false;
|
|
@@ -146794,13 +146871,13 @@ class GltfReader {
|
|
|
146794
146871
|
}
|
|
146795
146872
|
return true;
|
|
146796
146873
|
}
|
|
146797
|
-
case
|
|
146874
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort: {
|
|
146798
146875
|
const quantized = view.accessor.extensions?.WEB3D_quantized_attributes;
|
|
146799
146876
|
const rangeMin = quantized?.decodedMin;
|
|
146800
146877
|
const rangeMax = quantized?.decodedMax;
|
|
146801
146878
|
if (undefined === rangeMin || undefined === rangeMax)
|
|
146802
146879
|
return false;
|
|
146803
|
-
const qData = view.toBufferData(
|
|
146880
|
+
const qData = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort);
|
|
146804
146881
|
if (undefined === qData || !(qData.buffer instanceof Uint16Array))
|
|
146805
146882
|
return false;
|
|
146806
146883
|
mesh.uvRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range2d.createXYXY(rangeMin[0], rangeMin[1], rangeMax[0], rangeMax[1]);
|
|
@@ -146854,10 +146931,30 @@ class GltfReader {
|
|
|
146854
146931
|
async resolveResources() {
|
|
146855
146932
|
// Load any external images and buffers.
|
|
146856
146933
|
await this._resolveResources();
|
|
146934
|
+
// Decompress any meshopt-compressed buffer views
|
|
146935
|
+
const decodeMeshoptBuffers = [];
|
|
146936
|
+
for (const bv of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._bufferViews)) {
|
|
146937
|
+
const ext = bv.extensions?.EXT_meshopt_compression;
|
|
146938
|
+
if (ext) {
|
|
146939
|
+
const bufferData = this._buffers[ext.buffer]?.resolvedBuffer;
|
|
146940
|
+
if (bufferData) {
|
|
146941
|
+
const source = new Uint8Array(bufferData.buffer, bufferData.byteOffset + (ext.byteOffset ?? 0), ext.byteLength ?? 0);
|
|
146942
|
+
const decode = async () => {
|
|
146943
|
+
bv.resolvedBuffer = await (0,_internal__WEBPACK_IMPORTED_MODULE_8__.decodeMeshoptBuffer)(source, ext);
|
|
146944
|
+
if (bv.resolvedBuffer) {
|
|
146945
|
+
bv.byteLength = bv.resolvedBuffer.byteLength;
|
|
146946
|
+
bv.byteOffset = 0;
|
|
146947
|
+
}
|
|
146948
|
+
};
|
|
146949
|
+
decodeMeshoptBuffers.push(decode());
|
|
146950
|
+
}
|
|
146951
|
+
}
|
|
146952
|
+
}
|
|
146953
|
+
await Promise.all(decodeMeshoptBuffers);
|
|
146857
146954
|
// If any meshes are draco-compressed, dynamically load the decoder module and then decode the meshes.
|
|
146858
146955
|
const dracoMeshes = [];
|
|
146859
146956
|
for (const node of this.traverseScene()) {
|
|
146860
|
-
for (const meshId of (0,
|
|
146957
|
+
for (const meshId of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
|
|
146861
146958
|
const mesh = this._meshes[meshId];
|
|
146862
146959
|
if (mesh?.primitives)
|
|
146863
146960
|
for (const primitive of mesh.primitives)
|
|
@@ -146872,8 +146969,8 @@ class GltfReader {
|
|
|
146872
146969
|
await Promise.all(dracoMeshes.map(async (x) => this.decodeDracoMesh(x, dracoLoader)));
|
|
146873
146970
|
}
|
|
146874
146971
|
catch (err) {
|
|
146875
|
-
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(
|
|
146876
|
-
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(
|
|
146972
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory.Render, "Failed to decode draco-encoded glTF mesh");
|
|
146973
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory.Render, err);
|
|
146877
146974
|
}
|
|
146878
146975
|
}
|
|
146879
146976
|
async _resolveResources() {
|
|
@@ -146881,14 +146978,14 @@ class GltfReader {
|
|
|
146881
146978
|
// be required for the scene.
|
|
146882
146979
|
const promises = [];
|
|
146883
146980
|
try {
|
|
146884
|
-
for (const buffer of (0,
|
|
146981
|
+
for (const buffer of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._buffers))
|
|
146885
146982
|
if (!buffer.resolvedBuffer)
|
|
146886
146983
|
promises.push(this.resolveBuffer(buffer));
|
|
146887
146984
|
await Promise.all(promises);
|
|
146888
146985
|
if (this._isCanceled)
|
|
146889
146986
|
return;
|
|
146890
146987
|
promises.length = 0;
|
|
146891
|
-
for (const image of (0,
|
|
146988
|
+
for (const image of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._images))
|
|
146892
146989
|
if (!image.resolvedImage)
|
|
146893
146990
|
promises.push(this.resolveImage(image));
|
|
146894
146991
|
await Promise.all(promises);
|
|
@@ -146942,7 +147039,7 @@ class GltfReader {
|
|
|
146942
147039
|
return;
|
|
146943
147040
|
const bvSrc = undefined !== image.bufferView ? image : image.extensions?.KHR_binary_glTF;
|
|
146944
147041
|
if (undefined !== bvSrc?.bufferView) {
|
|
146945
|
-
const format = undefined !== bvSrc.mimeType ? (0,
|
|
147042
|
+
const format = undefined !== bvSrc.mimeType ? (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.getImageSourceFormatForMimeType)(bvSrc.mimeType) : undefined;
|
|
146946
147043
|
const bufferView = this._bufferViews[bvSrc.bufferView];
|
|
146947
147044
|
if (undefined === format || !bufferView || !bufferView.byteLength || bufferView.byteLength < 0)
|
|
146948
147045
|
return;
|
|
@@ -146954,9 +147051,9 @@ class GltfReader {
|
|
|
146954
147051
|
try {
|
|
146955
147052
|
const imageSource = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ImageSource(bytes, format);
|
|
146956
147053
|
if (this._system.supportsCreateImageBitmap)
|
|
146957
|
-
image.resolvedImage = await (0,
|
|
147054
|
+
image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.imageBitmapFromImageSource)(imageSource);
|
|
146958
147055
|
else
|
|
146959
|
-
image.resolvedImage = await (0,
|
|
147056
|
+
image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.imageElementFromImageSource)(imageSource);
|
|
146960
147057
|
}
|
|
146961
147058
|
catch (_) {
|
|
146962
147059
|
//
|
|
@@ -146965,7 +147062,7 @@ class GltfReader {
|
|
|
146965
147062
|
}
|
|
146966
147063
|
const url = undefined !== image.uri ? this.resolveUrl(image.uri) : undefined;
|
|
146967
147064
|
if (undefined !== url)
|
|
146968
|
-
image.resolvedImage = await (0,
|
|
147065
|
+
image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.tryImageElementFromUrl)(url);
|
|
146969
147066
|
}
|
|
146970
147067
|
/** Exposed strictly for testing. */
|
|
146971
147068
|
getTextureType(sampler) {
|
|
@@ -146974,7 +147071,7 @@ class GltfReader {
|
|
|
146974
147071
|
let wrapT = sampler?.wrapT;
|
|
146975
147072
|
if (undefined === wrapS && undefined === wrapT)
|
|
146976
147073
|
wrapS = wrapT = this.defaultWrapMode;
|
|
146977
|
-
if (
|
|
147074
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.ClampToEdge === wrapS || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.ClampToEdge === wrapT)
|
|
146978
147075
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.TileSection;
|
|
146979
147076
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.Normal;
|
|
146980
147077
|
}
|
|
@@ -149110,6 +149207,88 @@ class LRUTileList {
|
|
|
149110
149207
|
}
|
|
149111
149208
|
|
|
149112
149209
|
|
|
149210
|
+
/***/ }),
|
|
149211
|
+
|
|
149212
|
+
/***/ "../../core/frontend/lib/esm/tile/MeshoptCompression.js":
|
|
149213
|
+
/*!**************************************************************!*\
|
|
149214
|
+
!*** ../../core/frontend/lib/esm/tile/MeshoptCompression.js ***!
|
|
149215
|
+
\**************************************************************/
|
|
149216
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
149217
|
+
|
|
149218
|
+
"use strict";
|
|
149219
|
+
__webpack_require__.r(__webpack_exports__);
|
|
149220
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
149221
|
+
/* harmony export */ "decodeMeshoptBuffer": () => (/* binding */ decodeMeshoptBuffer)
|
|
149222
|
+
/* harmony export */ });
|
|
149223
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
149224
|
+
/* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
|
|
149225
|
+
/*---------------------------------------------------------------------------------------------
|
|
149226
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
149227
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
149228
|
+
*--------------------------------------------------------------------------------------------*/
|
|
149229
|
+
/** @packageDocumentation
|
|
149230
|
+
* @module Tiles
|
|
149231
|
+
*/
|
|
149232
|
+
|
|
149233
|
+
|
|
149234
|
+
/** Loads and configures the MeshoptDecoder module on demand. */
|
|
149235
|
+
class Loader {
|
|
149236
|
+
constructor() {
|
|
149237
|
+
this._status = "uninitialized";
|
|
149238
|
+
}
|
|
149239
|
+
async getDecoder() {
|
|
149240
|
+
const status = this._status;
|
|
149241
|
+
switch (status) {
|
|
149242
|
+
case "failed":
|
|
149243
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._decoder);
|
|
149244
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
|
|
149245
|
+
return undefined;
|
|
149246
|
+
case "ready":
|
|
149247
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._decoder);
|
|
149248
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
|
|
149249
|
+
return this._decoder;
|
|
149250
|
+
case "loading":
|
|
149251
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._promise);
|
|
149252
|
+
await this._promise;
|
|
149253
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)("failed" === this._status || "ready" === this._status);
|
|
149254
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
|
|
149255
|
+
return this._decoder;
|
|
149256
|
+
}
|
|
149257
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)("uninitialized" === status);
|
|
149258
|
+
this._status = "loading";
|
|
149259
|
+
this._promise = this.load();
|
|
149260
|
+
return this.getDecoder();
|
|
149261
|
+
}
|
|
149262
|
+
async load() {
|
|
149263
|
+
try {
|
|
149264
|
+
// Import the module on first use.
|
|
149265
|
+
const decoder = (await __webpack_require__.e(/*! import() */ "vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61").then(__webpack_require__.bind(__webpack_require__, /*! meshoptimizer */ "../../common/temp/node_modules/.pnpm/meshoptimizer@0.20.0/node_modules/meshoptimizer/index.module.js"))).MeshoptDecoder;
|
|
149266
|
+
await decoder.ready;
|
|
149267
|
+
// Configure it to do the decoding outside of the main thread. No compelling reason to use more than one worker.
|
|
149268
|
+
decoder.useWorkers(1);
|
|
149269
|
+
this._status = "ready";
|
|
149270
|
+
this._decoder = decoder;
|
|
149271
|
+
}
|
|
149272
|
+
catch (err) {
|
|
149273
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.FrontendLoggerCategory.Render, err);
|
|
149274
|
+
this._status = "failed";
|
|
149275
|
+
}
|
|
149276
|
+
finally {
|
|
149277
|
+
this._promise = undefined;
|
|
149278
|
+
}
|
|
149279
|
+
}
|
|
149280
|
+
}
|
|
149281
|
+
const loader = new Loader();
|
|
149282
|
+
/** @internal */
|
|
149283
|
+
async function decodeMeshoptBuffer(source, args) {
|
|
149284
|
+
const decoder = await loader.getDecoder();
|
|
149285
|
+
if (!decoder) {
|
|
149286
|
+
return undefined;
|
|
149287
|
+
}
|
|
149288
|
+
return decoder.decodeGltfBufferAsync(args.count, args.byteStride, source, args.mode, args.filter);
|
|
149289
|
+
}
|
|
149290
|
+
|
|
149291
|
+
|
|
149113
149292
|
/***/ }),
|
|
149114
149293
|
|
|
149115
149294
|
/***/ "../../core/frontend/lib/esm/tile/OPCFormatInterpreter.js":
|
|
@@ -156283,6 +156462,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
156283
156462
|
/* harmony export */ "createRealityTileTreeReference": () => (/* reexport safe */ _RealityModelTileTree__WEBPACK_IMPORTED_MODULE_73__.createRealityTileTreeReference),
|
|
156284
156463
|
/* harmony export */ "createSpatialTileTreeReferences": () => (/* reexport safe */ _PrimaryTileTree__WEBPACK_IMPORTED_MODULE_78__.createSpatialTileTreeReferences),
|
|
156285
156464
|
/* harmony export */ "decodeImdlGraphics": () => (/* reexport safe */ _ImdlGraphicsCreator__WEBPACK_IMPORTED_MODULE_35__.decodeImdlGraphics),
|
|
156465
|
+
/* harmony export */ "decodeMeshoptBuffer": () => (/* reexport safe */ _MeshoptCompression__WEBPACK_IMPORTED_MODULE_89__.decodeMeshoptBuffer),
|
|
156286
156466
|
/* harmony export */ "disposeTileTreesForGeometricModels": () => (/* reexport safe */ _PrimaryTileTree__WEBPACK_IMPORTED_MODULE_78__.disposeTileTreesForGeometricModels),
|
|
156287
156467
|
/* harmony export */ "getCesiumAccessTokenAndEndpointUrl": () => (/* reexport safe */ _map_CesiumTerrainProvider__WEBPACK_IMPORTED_MODULE_64__.getCesiumAccessTokenAndEndpointUrl),
|
|
156288
156468
|
/* harmony export */ "getCesiumAssetUrl": () => (/* reexport safe */ _map_CesiumTerrainProvider__WEBPACK_IMPORTED_MODULE_64__.getCesiumAssetUrl),
|
|
@@ -156389,6 +156569,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
156389
156569
|
/* harmony import */ var _ThreeDTileFormatInterpreter__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./ThreeDTileFormatInterpreter */ "../../core/frontend/lib/esm/tile/ThreeDTileFormatInterpreter.js");
|
|
156390
156570
|
/* harmony import */ var _OPCFormatInterpreter__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./OPCFormatInterpreter */ "../../core/frontend/lib/esm/tile/OPCFormatInterpreter.js");
|
|
156391
156571
|
/* harmony import */ var _FetchCloudStorage__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./FetchCloudStorage */ "../../core/frontend/lib/esm/tile/FetchCloudStorage.js");
|
|
156572
|
+
/* harmony import */ var _MeshoptCompression__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./MeshoptCompression */ "../../core/frontend/lib/esm/tile/MeshoptCompression.js");
|
|
156392
156573
|
/*---------------------------------------------------------------------------------------------
|
|
156393
156574
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
156394
156575
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -156494,6 +156675,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
156494
156675
|
|
|
156495
156676
|
|
|
156496
156677
|
|
|
156678
|
+
|
|
156497
156679
|
|
|
156498
156680
|
|
|
156499
156681
|
/***/ }),
|
|
@@ -290505,7 +290687,7 @@ class TestContext {
|
|
|
290505
290687
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
290506
290688
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
290507
290689
|
await core_frontend_1.NoRenderApp.startup({
|
|
290508
|
-
applicationVersion: "4.6.0-dev.
|
|
290690
|
+
applicationVersion: "4.6.0-dev.6",
|
|
290509
290691
|
applicationId: this.settings.gprid,
|
|
290510
290692
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
290511
290693
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -310423,7 +310605,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
310423
310605
|
/***/ ((module) => {
|
|
310424
310606
|
|
|
310425
310607
|
"use strict";
|
|
310426
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.6.0-dev.
|
|
310608
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.6.0-dev.6","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.6.0-dev.6","@itwin/core-bentley":"workspace:^4.6.0-dev.6","@itwin/core-common":"workspace:^4.6.0-dev.6","@itwin/core-geometry":"workspace:^4.6.0-dev.6","@itwin/core-orbitgt":"workspace:^4.6.0-dev.6","@itwin/core-quantity":"workspace:^4.6.0-dev.6"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
310427
310609
|
|
|
310428
310610
|
/***/ }),
|
|
310429
310611
|
|