@itwin/rpcinterface-full-stack-tests 4.6.0-dev.1 → 4.6.0-dev.5
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/backend/BackendInit.js.map +1 -1
- package/lib/common/Settings.js +12 -12
- package/lib/common/Settings.js.map +1 -1
- package/lib/common/SideChannels.js.map +1 -1
- package/lib/dist/bundled-tests.js +1180 -219
- package/lib/dist/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/lib/frontend/CodeSpecs.test.js.map +1 -1
- package/lib/frontend/DevToolsRpc.test.js.map +1 -1
- package/lib/frontend/Elements.test.js.map +1 -1
- package/lib/frontend/IModel.test.js.map +1 -1
- package/lib/frontend/IModelConnection.test.js.map +1 -1
- package/lib/frontend/Models.test.js.map +1 -1
- package/lib/frontend/PresentationRpc.test.js.map +1 -1
- package/lib/frontend/Views.test.js.map +1 -1
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/lib/frontend/workflows/BasicScenarios.test.js.map +1 -1
- package/package.json +13 -13
|
@@ -3223,6 +3223,467 @@ __exportStar(__webpack_require__(/*! ./TestFrontendAuthorizationClient */ "../..
|
|
|
3223
3223
|
__exportStar(__webpack_require__(/*! ./certa/certaCommon */ "../../common/temp/node_modules/.pnpm/@itwin+oidc-signin-tool@3.6.0_mdtbcqczpmeuv6yjzfaigjndwi/node_modules/@itwin/oidc-signin-tool/lib/cjs/certa/certaCommon.js"), exports);
|
|
3224
3224
|
//# sourceMappingURL=frontend.js.map
|
|
3225
3225
|
|
|
3226
|
+
/***/ }),
|
|
3227
|
+
|
|
3228
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js":
|
|
3229
|
+
/*!**********************************************************************************************************************************************!*\
|
|
3230
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js ***!
|
|
3231
|
+
\**********************************************************************************************************************************************/
|
|
3232
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3233
|
+
|
|
3234
|
+
"use strict";
|
|
3235
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3236
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3237
|
+
/* harmony export */ "Selectable": () => (/* reexport safe */ _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectable),
|
|
3238
|
+
/* harmony export */ "Selectables": () => (/* reexport safe */ _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables),
|
|
3239
|
+
/* harmony export */ "createStorage": () => (/* reexport safe */ _unified_selection_SelectionStorage__WEBPACK_IMPORTED_MODULE_1__.createStorage)
|
|
3240
|
+
/* harmony export */ });
|
|
3241
|
+
/* harmony import */ var _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./unified-selection/Selectable */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js");
|
|
3242
|
+
/* harmony import */ var _unified_selection_SelectionStorage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unified-selection/SelectionStorage */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js");
|
|
3243
|
+
/*---------------------------------------------------------------------------------------------
|
|
3244
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3245
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3246
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3247
|
+
/**
|
|
3248
|
+
* @module UnifiedSelection
|
|
3249
|
+
*
|
|
3250
|
+
* @docs-group-description UnifiedSelection
|
|
3251
|
+
* API for working with unified selection.
|
|
3252
|
+
*/
|
|
3253
|
+
|
|
3254
|
+
|
|
3255
|
+
|
|
3256
|
+
|
|
3257
|
+
/***/ }),
|
|
3258
|
+
|
|
3259
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js":
|
|
3260
|
+
/*!*********************************************************************************************************************************************************!*\
|
|
3261
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js ***!
|
|
3262
|
+
\*********************************************************************************************************************************************************/
|
|
3263
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3264
|
+
|
|
3265
|
+
"use strict";
|
|
3266
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3267
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3268
|
+
/* harmony export */ "Selectable": () => (/* binding */ Selectable),
|
|
3269
|
+
/* harmony export */ "Selectables": () => (/* binding */ Selectables)
|
|
3270
|
+
/* harmony export */ });
|
|
3271
|
+
/*---------------------------------------------------------------------------------------------
|
|
3272
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3273
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3274
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3275
|
+
/** @beta */
|
|
3276
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
3277
|
+
var Selectable;
|
|
3278
|
+
(function (Selectable) {
|
|
3279
|
+
/** Check if the supplied selectable is a `SelectableInstanceKey` */
|
|
3280
|
+
function isInstanceKey(selectable) {
|
|
3281
|
+
const instanceKey = selectable;
|
|
3282
|
+
return !!instanceKey.className && !!instanceKey.id;
|
|
3283
|
+
}
|
|
3284
|
+
Selectable.isInstanceKey = isInstanceKey;
|
|
3285
|
+
/** Check if the supplied selectable is a `CustomSelectable` */
|
|
3286
|
+
function isCustom(selectable) {
|
|
3287
|
+
return !!selectable.identifier;
|
|
3288
|
+
}
|
|
3289
|
+
Selectable.isCustom = isCustom;
|
|
3290
|
+
})(Selectable || (Selectable = {}));
|
|
3291
|
+
/** @beta */
|
|
3292
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
3293
|
+
var Selectables;
|
|
3294
|
+
(function (Selectables) {
|
|
3295
|
+
/**
|
|
3296
|
+
* Creates `Selectables` from array of selectable
|
|
3297
|
+
* @param source Source to create selectables from
|
|
3298
|
+
* @beta
|
|
3299
|
+
*/
|
|
3300
|
+
function create(source) {
|
|
3301
|
+
const newSelectables = {
|
|
3302
|
+
instanceKeys: new Map(),
|
|
3303
|
+
custom: new Map(),
|
|
3304
|
+
};
|
|
3305
|
+
Selectables.add(newSelectables, source);
|
|
3306
|
+
return newSelectables;
|
|
3307
|
+
}
|
|
3308
|
+
Selectables.create = create;
|
|
3309
|
+
/**
|
|
3310
|
+
* Get the number of selectables stored in a `Selectables` object.
|
|
3311
|
+
* @param selectables `Selectables` object to get size for
|
|
3312
|
+
* @beta
|
|
3313
|
+
*/
|
|
3314
|
+
function size(selectables) {
|
|
3315
|
+
let insatanceCount = 0;
|
|
3316
|
+
selectables.instanceKeys.forEach((set) => (insatanceCount += set.size));
|
|
3317
|
+
return insatanceCount + selectables.custom.size;
|
|
3318
|
+
}
|
|
3319
|
+
Selectables.size = size;
|
|
3320
|
+
/**
|
|
3321
|
+
* Is a `Selectables` object currently empty.
|
|
3322
|
+
* @param selectables `Selectables` object to check
|
|
3323
|
+
* @beta
|
|
3324
|
+
*/
|
|
3325
|
+
function isEmpty(selectables) {
|
|
3326
|
+
return Selectables.size(selectables) === 0;
|
|
3327
|
+
}
|
|
3328
|
+
Selectables.isEmpty = isEmpty;
|
|
3329
|
+
/**
|
|
3330
|
+
* Check if a `Selectables` object contains the specified selectable.
|
|
3331
|
+
* @param selectables `Selectables` object to check
|
|
3332
|
+
* @param value The selectable to check for.
|
|
3333
|
+
* @beta
|
|
3334
|
+
*/
|
|
3335
|
+
function has(selectables, value) {
|
|
3336
|
+
if (Selectable.isInstanceKey(value)) {
|
|
3337
|
+
const normalizedClassName = normalizeClassName(value.className);
|
|
3338
|
+
const set = selectables.instanceKeys.get(normalizedClassName);
|
|
3339
|
+
return !!(set && set.has(value.id));
|
|
3340
|
+
}
|
|
3341
|
+
return selectables.custom.has(value.identifier);
|
|
3342
|
+
}
|
|
3343
|
+
Selectables.has = has;
|
|
3344
|
+
/**
|
|
3345
|
+
* Check if a `Selectables` object contains all the specified selectables.
|
|
3346
|
+
* @param selectables `Selectables` object to check
|
|
3347
|
+
* @param values The selectables to check for.
|
|
3348
|
+
* @beta
|
|
3349
|
+
*/
|
|
3350
|
+
function hasAll(selectables, values) {
|
|
3351
|
+
if (Selectables.size(selectables) < values.length) {
|
|
3352
|
+
return false;
|
|
3353
|
+
}
|
|
3354
|
+
for (const selectable of values) {
|
|
3355
|
+
if (!Selectables.has(selectables, selectable)) {
|
|
3356
|
+
return false;
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
return true;
|
|
3360
|
+
}
|
|
3361
|
+
Selectables.hasAll = hasAll;
|
|
3362
|
+
/**
|
|
3363
|
+
* Check if a `Selectables` object contains any of the specified selectables.
|
|
3364
|
+
* @param selectables `Selectables` object to check
|
|
3365
|
+
* @param values The selectables to check for.
|
|
3366
|
+
* @beta
|
|
3367
|
+
*/
|
|
3368
|
+
function hasAny(selectables, values) {
|
|
3369
|
+
for (const selectable of values) {
|
|
3370
|
+
if (Selectables.has(selectables, selectable)) {
|
|
3371
|
+
return true;
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
return false;
|
|
3375
|
+
}
|
|
3376
|
+
Selectables.hasAny = hasAny;
|
|
3377
|
+
/**
|
|
3378
|
+
* Add a one or more selectables to a `Selectables`
|
|
3379
|
+
* @param selectables `Selectables` object to add selectables for
|
|
3380
|
+
* @param values Selectables to add.
|
|
3381
|
+
* @beta
|
|
3382
|
+
*/
|
|
3383
|
+
function add(selectables, values) {
|
|
3384
|
+
let hasChanged = false;
|
|
3385
|
+
for (const selectable of values) {
|
|
3386
|
+
if (Selectable.isInstanceKey(selectable)) {
|
|
3387
|
+
const normalizedClassName = normalizeClassName(selectable.className);
|
|
3388
|
+
let set = selectables.instanceKeys.get(normalizedClassName);
|
|
3389
|
+
if (!set) {
|
|
3390
|
+
set = new Set();
|
|
3391
|
+
}
|
|
3392
|
+
if (!set.has(selectable.id)) {
|
|
3393
|
+
set.add(selectable.id);
|
|
3394
|
+
selectables.instanceKeys.set(normalizedClassName, set);
|
|
3395
|
+
hasChanged = true;
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
else if (!selectables.custom.has(selectable.identifier)) {
|
|
3399
|
+
selectables.custom.set(selectable.identifier, selectable);
|
|
3400
|
+
hasChanged = true;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
return hasChanged;
|
|
3404
|
+
}
|
|
3405
|
+
Selectables.add = add;
|
|
3406
|
+
/**
|
|
3407
|
+
* Removes one or more selectables from a `Selectables` object.
|
|
3408
|
+
* @param selectables `Selectables` object to remove selectables for
|
|
3409
|
+
* @param values Selectables to remove.
|
|
3410
|
+
* @beta
|
|
3411
|
+
*/
|
|
3412
|
+
function remove(selectables, values) {
|
|
3413
|
+
let hasChanged = false;
|
|
3414
|
+
for (const selectable of values) {
|
|
3415
|
+
if (Selectable.isInstanceKey(selectable)) {
|
|
3416
|
+
const normalizedClassName = normalizeClassName(selectable.className);
|
|
3417
|
+
const set = selectables.instanceKeys.get(normalizedClassName);
|
|
3418
|
+
if (set && set.has(selectable.id)) {
|
|
3419
|
+
set.delete(selectable.id);
|
|
3420
|
+
hasChanged = true;
|
|
3421
|
+
if (set.size === 0) {
|
|
3422
|
+
selectables.instanceKeys.delete(normalizedClassName);
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
else if (selectables.custom.has(selectable.identifier)) {
|
|
3427
|
+
selectables.custom.delete(selectable.identifier);
|
|
3428
|
+
hasChanged = true;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
return hasChanged;
|
|
3432
|
+
}
|
|
3433
|
+
Selectables.remove = remove;
|
|
3434
|
+
/**
|
|
3435
|
+
* Clear a `Selectables` object.
|
|
3436
|
+
* @param selectables `Selectables` object to clear selectables for
|
|
3437
|
+
* @beta
|
|
3438
|
+
*/
|
|
3439
|
+
function clear(selectables) {
|
|
3440
|
+
if (Selectables.size(selectables) === 0) {
|
|
3441
|
+
return false;
|
|
3442
|
+
}
|
|
3443
|
+
selectables.instanceKeys = new Map();
|
|
3444
|
+
selectables.custom = new Map();
|
|
3445
|
+
return true;
|
|
3446
|
+
}
|
|
3447
|
+
Selectables.clear = clear;
|
|
3448
|
+
/**
|
|
3449
|
+
* Check whether at least one selectable passes a condition in a `Selectables` object.
|
|
3450
|
+
* @param selectables `Selectables` object to check
|
|
3451
|
+
* @beta
|
|
3452
|
+
*/
|
|
3453
|
+
function some(selectables, callback) {
|
|
3454
|
+
for (const entry of selectables.instanceKeys) {
|
|
3455
|
+
for (const item of entry[1]) {
|
|
3456
|
+
if (callback({ className: entry[0], id: item })) {
|
|
3457
|
+
return true;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
for (const entry of selectables.custom) {
|
|
3462
|
+
if (callback(entry[1])) {
|
|
3463
|
+
return true;
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
return false;
|
|
3467
|
+
}
|
|
3468
|
+
Selectables.some = some;
|
|
3469
|
+
/**
|
|
3470
|
+
* Iterate over all keys in a `Selectables` object.
|
|
3471
|
+
* @param selectables `Selectables` object to iterate over
|
|
3472
|
+
* @beta
|
|
3473
|
+
*/
|
|
3474
|
+
function forEach(selectables, callback) {
|
|
3475
|
+
let index = 0;
|
|
3476
|
+
selectables.instanceKeys.forEach((ids, className) => {
|
|
3477
|
+
ids.forEach((id) => callback({ className, id }, index++));
|
|
3478
|
+
});
|
|
3479
|
+
selectables.custom.forEach((data) => {
|
|
3480
|
+
callback(data, index++);
|
|
3481
|
+
});
|
|
3482
|
+
}
|
|
3483
|
+
Selectables.forEach = forEach;
|
|
3484
|
+
function normalizeClassName(className) {
|
|
3485
|
+
return className.replace(".", ":");
|
|
3486
|
+
}
|
|
3487
|
+
})(Selectables || (Selectables = {}));
|
|
3488
|
+
|
|
3489
|
+
|
|
3490
|
+
/***/ }),
|
|
3491
|
+
|
|
3492
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js":
|
|
3493
|
+
/*!*******************************************************************************************************************************************************************!*\
|
|
3494
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js ***!
|
|
3495
|
+
\*******************************************************************************************************************************************************************/
|
|
3496
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3497
|
+
|
|
3498
|
+
"use strict";
|
|
3499
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3500
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3501
|
+
/* harmony export */ "SelectionChangeEventImpl": () => (/* binding */ SelectionChangeEventImpl)
|
|
3502
|
+
/* harmony export */ });
|
|
3503
|
+
/*---------------------------------------------------------------------------------------------
|
|
3504
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3505
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3506
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3507
|
+
/**
|
|
3508
|
+
* An event broadcasted on selection changes
|
|
3509
|
+
* @internal
|
|
3510
|
+
*/
|
|
3511
|
+
class SelectionChangeEventImpl {
|
|
3512
|
+
_listeners = [];
|
|
3513
|
+
/**
|
|
3514
|
+
* Registers a Listener to be executed whenever this event is raised
|
|
3515
|
+
* @param listener The function to be executed when the event is raised
|
|
3516
|
+
* @returns A function that will remove this event listener
|
|
3517
|
+
* @beta
|
|
3518
|
+
*/
|
|
3519
|
+
addListener(listener) {
|
|
3520
|
+
this._listeners.push(listener);
|
|
3521
|
+
return () => this.removeListener(listener);
|
|
3522
|
+
}
|
|
3523
|
+
/**
|
|
3524
|
+
* Un-register a previously registered listener
|
|
3525
|
+
* @param listener The listener to be unregistered
|
|
3526
|
+
* @beta
|
|
3527
|
+
*/
|
|
3528
|
+
removeListener(listener) {
|
|
3529
|
+
this._listeners = this._listeners.filter((x) => x !== listener);
|
|
3530
|
+
}
|
|
3531
|
+
/**
|
|
3532
|
+
* Raises the event by calling each registered listener with the supplied arguments
|
|
3533
|
+
* @param args Event arguments
|
|
3534
|
+
* @param storage Storage that the selection changed in
|
|
3535
|
+
* @beta
|
|
3536
|
+
*/
|
|
3537
|
+
raiseEvent(args, storage) {
|
|
3538
|
+
this._listeners.forEach((listener) => listener(args, storage));
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
|
|
3543
|
+
/***/ }),
|
|
3544
|
+
|
|
3545
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js":
|
|
3546
|
+
/*!***************************************************************************************************************************************************************!*\
|
|
3547
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js ***!
|
|
3548
|
+
\***************************************************************************************************************************************************************/
|
|
3549
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3550
|
+
|
|
3551
|
+
"use strict";
|
|
3552
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3553
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3554
|
+
/* harmony export */ "createStorage": () => (/* binding */ createStorage)
|
|
3555
|
+
/* harmony export */ });
|
|
3556
|
+
/* harmony import */ var _Selectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Selectable */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js");
|
|
3557
|
+
/* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js");
|
|
3558
|
+
/*---------------------------------------------------------------------------------------------
|
|
3559
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3560
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3561
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3562
|
+
/** @packageDocumentation
|
|
3563
|
+
* @module UnifiedSelection
|
|
3564
|
+
*/
|
|
3565
|
+
|
|
3566
|
+
|
|
3567
|
+
/**
|
|
3568
|
+
* Creates a selection storage. When an iModel is closed `SelectionStorage.clearSelection` function should be called.
|
|
3569
|
+
* @beta
|
|
3570
|
+
*/
|
|
3571
|
+
function createStorage() {
|
|
3572
|
+
return new SelectionStorageImpl();
|
|
3573
|
+
}
|
|
3574
|
+
class SelectionStorageImpl {
|
|
3575
|
+
_storage = new Map();
|
|
3576
|
+
selectionChangeEvent;
|
|
3577
|
+
constructor() {
|
|
3578
|
+
this.selectionChangeEvent = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_1__.SelectionChangeEventImpl();
|
|
3579
|
+
}
|
|
3580
|
+
getSelectionLevels({ iModelKey }) {
|
|
3581
|
+
return this.getContainer(iModelKey).getSelectionLevels();
|
|
3582
|
+
}
|
|
3583
|
+
getSelection(props) {
|
|
3584
|
+
const { iModelKey, level } = props;
|
|
3585
|
+
return this.getContainer(iModelKey).getSelection(level ?? 0);
|
|
3586
|
+
}
|
|
3587
|
+
addToSelection(props) {
|
|
3588
|
+
this.handleChange({ ...props, changeType: "add" });
|
|
3589
|
+
}
|
|
3590
|
+
removeFromSelection(props) {
|
|
3591
|
+
this.handleChange({ ...props, changeType: "remove" });
|
|
3592
|
+
}
|
|
3593
|
+
replaceSelection(props) {
|
|
3594
|
+
this.handleChange({ ...props, changeType: "replace" });
|
|
3595
|
+
}
|
|
3596
|
+
clearSelection(props) {
|
|
3597
|
+
this.handleChange({ ...props, changeType: "clear", selectables: [] });
|
|
3598
|
+
}
|
|
3599
|
+
clearStorage({ iModelKey }) {
|
|
3600
|
+
this.clearSelection({ source: "Clear iModel storage", iModelKey });
|
|
3601
|
+
this._storage.delete(iModelKey);
|
|
3602
|
+
}
|
|
3603
|
+
getContainer(iModelKey) {
|
|
3604
|
+
let selectionContainer = this._storage.get(iModelKey);
|
|
3605
|
+
if (!selectionContainer) {
|
|
3606
|
+
selectionContainer = new MultiLevelSelectablesContainer();
|
|
3607
|
+
this._storage.set(iModelKey, selectionContainer);
|
|
3608
|
+
}
|
|
3609
|
+
return selectionContainer;
|
|
3610
|
+
}
|
|
3611
|
+
handleChange(props) {
|
|
3612
|
+
const { iModelKey, source, level: inLevel, changeType, selectables: change } = props;
|
|
3613
|
+
const container = this.getContainer(iModelKey);
|
|
3614
|
+
const level = inLevel ?? 0;
|
|
3615
|
+
const selectables = container.getSelection(level);
|
|
3616
|
+
const selected = _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.create(change);
|
|
3617
|
+
switch (changeType) {
|
|
3618
|
+
case "add":
|
|
3619
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.add(selectables, change)) {
|
|
3620
|
+
return;
|
|
3621
|
+
}
|
|
3622
|
+
break;
|
|
3623
|
+
case "remove":
|
|
3624
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.remove(selectables, change)) {
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
break;
|
|
3628
|
+
case "replace":
|
|
3629
|
+
if (_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.size(selectables) === _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.size(selected) && _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.hasAll(selectables, change)) {
|
|
3630
|
+
return;
|
|
3631
|
+
}
|
|
3632
|
+
_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables);
|
|
3633
|
+
_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.add(selectables, change);
|
|
3634
|
+
break;
|
|
3635
|
+
case "clear":
|
|
3636
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables)) {
|
|
3637
|
+
return;
|
|
3638
|
+
}
|
|
3639
|
+
break;
|
|
3640
|
+
}
|
|
3641
|
+
container.clear(level + 1);
|
|
3642
|
+
const event = {
|
|
3643
|
+
source,
|
|
3644
|
+
level,
|
|
3645
|
+
iModelKey,
|
|
3646
|
+
changeType,
|
|
3647
|
+
selectables: selected,
|
|
3648
|
+
timestamp: new Date(),
|
|
3649
|
+
};
|
|
3650
|
+
this.selectionChangeEvent.raiseEvent(event, this);
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
class MultiLevelSelectablesContainer {
|
|
3654
|
+
_selectablesContainers;
|
|
3655
|
+
constructor() {
|
|
3656
|
+
this._selectablesContainers = new Map();
|
|
3657
|
+
}
|
|
3658
|
+
getSelection(level) {
|
|
3659
|
+
let selectables = this._selectablesContainers.get(level);
|
|
3660
|
+
if (!selectables) {
|
|
3661
|
+
selectables = _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.create([]);
|
|
3662
|
+
this._selectablesContainers.set(level, selectables);
|
|
3663
|
+
}
|
|
3664
|
+
return selectables;
|
|
3665
|
+
}
|
|
3666
|
+
getSelectionLevels() {
|
|
3667
|
+
const levels = new Array();
|
|
3668
|
+
for (const entry of this._selectablesContainers.entries()) {
|
|
3669
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.isEmpty(entry[1])) {
|
|
3670
|
+
levels.push(entry[0]);
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
return levels.sort();
|
|
3674
|
+
}
|
|
3675
|
+
clear(level) {
|
|
3676
|
+
const storedLevels = this._selectablesContainers.keys();
|
|
3677
|
+
for (const storedLevel of storedLevels) {
|
|
3678
|
+
if (storedLevel >= level) {
|
|
3679
|
+
const selectables = this._selectablesContainers.get(storedLevel);
|
|
3680
|
+
_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables);
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
|
|
3226
3687
|
/***/ }),
|
|
3227
3688
|
|
|
3228
3689
|
/***/ "../../common/temp/node_modules/.pnpm/almost-equal@1.1.0/node_modules/almost-equal/almost_equal.js":
|
|
@@ -25420,6 +25881,30 @@ function concat() {
|
|
|
25420
25881
|
}
|
|
25421
25882
|
|
|
25422
25883
|
|
|
25884
|
+
/***/ }),
|
|
25885
|
+
|
|
25886
|
+
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js":
|
|
25887
|
+
/*!****************************************************************************************************************!*\
|
|
25888
|
+
!*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js ***!
|
|
25889
|
+
\****************************************************************************************************************/
|
|
25890
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25891
|
+
|
|
25892
|
+
"use strict";
|
|
25893
|
+
__webpack_require__.r(__webpack_exports__);
|
|
25894
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
25895
|
+
/* harmony export */ "defer": () => (/* binding */ defer)
|
|
25896
|
+
/* harmony export */ });
|
|
25897
|
+
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Observable.js");
|
|
25898
|
+
/* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./innerFrom */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js");
|
|
25899
|
+
|
|
25900
|
+
|
|
25901
|
+
function defer(observableFactory) {
|
|
25902
|
+
return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(function (subscriber) {
|
|
25903
|
+
(0,_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(observableFactory()).subscribe(subscriber);
|
|
25904
|
+
});
|
|
25905
|
+
}
|
|
25906
|
+
|
|
25907
|
+
|
|
25423
25908
|
/***/ }),
|
|
25424
25909
|
|
|
25425
25910
|
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/empty.js":
|
|
@@ -26230,6 +26715,93 @@ function subscribeOn(scheduler, delay) {
|
|
|
26230
26715
|
}
|
|
26231
26716
|
|
|
26232
26717
|
|
|
26718
|
+
/***/ }),
|
|
26719
|
+
|
|
26720
|
+
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js":
|
|
26721
|
+
/*!*******************************************************************************************************************!*\
|
|
26722
|
+
!*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js ***!
|
|
26723
|
+
\*******************************************************************************************************************/
|
|
26724
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
26725
|
+
|
|
26726
|
+
"use strict";
|
|
26727
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26728
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26729
|
+
/* harmony export */ "takeUntil": () => (/* binding */ takeUntil)
|
|
26730
|
+
/* harmony export */ });
|
|
26731
|
+
/* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js");
|
|
26732
|
+
/* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js");
|
|
26733
|
+
/* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/innerFrom */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js");
|
|
26734
|
+
/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/noop */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/noop.js");
|
|
26735
|
+
|
|
26736
|
+
|
|
26737
|
+
|
|
26738
|
+
|
|
26739
|
+
function takeUntil(notifier) {
|
|
26740
|
+
return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)(function (source, subscriber) {
|
|
26741
|
+
(0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(notifier).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, function () { return subscriber.complete(); }, _util_noop__WEBPACK_IMPORTED_MODULE_3__.noop));
|
|
26742
|
+
!subscriber.closed && source.subscribe(subscriber);
|
|
26743
|
+
});
|
|
26744
|
+
}
|
|
26745
|
+
|
|
26746
|
+
|
|
26747
|
+
/***/ }),
|
|
26748
|
+
|
|
26749
|
+
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js":
|
|
26750
|
+
/*!*************************************************************************************************************!*\
|
|
26751
|
+
!*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js ***!
|
|
26752
|
+
\*************************************************************************************************************/
|
|
26753
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
26754
|
+
|
|
26755
|
+
"use strict";
|
|
26756
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26757
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26758
|
+
/* harmony export */ "tap": () => (/* binding */ tap)
|
|
26759
|
+
/* harmony export */ });
|
|
26760
|
+
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isFunction */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isFunction.js");
|
|
26761
|
+
/* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js");
|
|
26762
|
+
/* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js");
|
|
26763
|
+
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/identity */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/identity.js");
|
|
26764
|
+
|
|
26765
|
+
|
|
26766
|
+
|
|
26767
|
+
|
|
26768
|
+
function tap(observerOrNext, error, complete) {
|
|
26769
|
+
var tapObserver = (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(observerOrNext) || error || complete
|
|
26770
|
+
?
|
|
26771
|
+
{ next: observerOrNext, error: error, complete: complete }
|
|
26772
|
+
: observerOrNext;
|
|
26773
|
+
return tapObserver
|
|
26774
|
+
? (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)(function (source, subscriber) {
|
|
26775
|
+
var _a;
|
|
26776
|
+
(_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
26777
|
+
var isUnsub = true;
|
|
26778
|
+
source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, function (value) {
|
|
26779
|
+
var _a;
|
|
26780
|
+
(_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);
|
|
26781
|
+
subscriber.next(value);
|
|
26782
|
+
}, function () {
|
|
26783
|
+
var _a;
|
|
26784
|
+
isUnsub = false;
|
|
26785
|
+
(_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
26786
|
+
subscriber.complete();
|
|
26787
|
+
}, function (err) {
|
|
26788
|
+
var _a;
|
|
26789
|
+
isUnsub = false;
|
|
26790
|
+
(_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);
|
|
26791
|
+
subscriber.error(err);
|
|
26792
|
+
}, function () {
|
|
26793
|
+
var _a, _b;
|
|
26794
|
+
if (isUnsub) {
|
|
26795
|
+
(_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
26796
|
+
}
|
|
26797
|
+
(_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
|
|
26798
|
+
}));
|
|
26799
|
+
})
|
|
26800
|
+
:
|
|
26801
|
+
_util_identity__WEBPACK_IMPORTED_MODULE_3__.identity;
|
|
26802
|
+
}
|
|
26803
|
+
|
|
26804
|
+
|
|
26233
26805
|
/***/ }),
|
|
26234
26806
|
|
|
26235
26807
|
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js":
|
|
@@ -106302,6 +106874,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106302
106874
|
/* harmony export */ "createSurfaceMaterial": () => (/* reexport safe */ _common_render_primitives_SurfaceParams__WEBPACK_IMPORTED_MODULE_26__.createSurfaceMaterial),
|
|
106303
106875
|
/* harmony export */ "createWorkerProxy": () => (/* reexport safe */ _common_WorkerProxy__WEBPACK_IMPORTED_MODULE_32__.createWorkerProxy),
|
|
106304
106876
|
/* harmony export */ "decodeImdlGraphics": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.decodeImdlGraphics),
|
|
106877
|
+
/* harmony export */ "decodeMeshoptBuffer": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.decodeMeshoptBuffer),
|
|
106305
106878
|
/* harmony export */ "disposeTileTreesForGeometricModels": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.disposeTileTreesForGeometricModels),
|
|
106306
106879
|
/* harmony export */ "edgeParamsFromImdl": () => (/* reexport safe */ _common_imdl_ParseImdlDocument__WEBPACK_IMPORTED_MODULE_16__.edgeParamsFromImdl),
|
|
106307
106880
|
/* harmony export */ "extractImageSourceDimensions": () => (/* reexport safe */ _common_ImageUtil__WEBPACK_IMPORTED_MODULE_13__.extractImageSourceDimensions),
|
|
@@ -144999,11 +145572,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
144999
145572
|
/* harmony import */ var _render_RealityMeshParams__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../render/RealityMeshParams */ "../../core/frontend/lib/esm/render/RealityMeshParams.js");
|
|
145000
145573
|
/* 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");
|
|
145001
145574
|
/* harmony import */ var _render_primitives_Primitives__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/primitives/Primitives */ "../../core/frontend/lib/esm/render/primitives/Primitives.js");
|
|
145002
|
-
/* harmony import */ var
|
|
145003
|
-
/* harmony import */ var
|
|
145004
|
-
/* harmony import */ var
|
|
145005
|
-
/* harmony import */ var
|
|
145006
|
-
/* harmony import */ var
|
|
145575
|
+
/* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internal */ "../../core/frontend/lib/esm/tile/internal.js");
|
|
145576
|
+
/* 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");
|
|
145577
|
+
/* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
|
|
145578
|
+
/* harmony import */ var _common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/ImageUtil */ "../../core/frontend/lib/esm/common/ImageUtil.js");
|
|
145579
|
+
/* 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");
|
|
145580
|
+
/* harmony import */ var _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/gltf/GltfSchema */ "../../core/frontend/lib/esm/common/gltf/GltfSchema.js");
|
|
145007
145581
|
/*---------------------------------------------------------------------------------------------
|
|
145008
145582
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
145009
145583
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -145024,6 +145598,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
145024
145598
|
|
|
145025
145599
|
|
|
145026
145600
|
|
|
145601
|
+
|
|
145027
145602
|
/**
|
|
145028
145603
|
* A chunk of binary data exposed as a typed array.
|
|
145029
145604
|
* The count member indicates how many elements exist. This may be less than this.buffer.length due to padding added to the
|
|
@@ -145044,15 +145619,15 @@ class GltfBufferData {
|
|
|
145044
145619
|
if (expectedType !== actualType) {
|
|
145045
145620
|
// Some data is stored in smaller data types to save space if no values exceed the maximum of the smaller type.
|
|
145046
145621
|
switch (expectedType) {
|
|
145047
|
-
case
|
|
145048
|
-
case
|
|
145622
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
|
|
145623
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
145049
145624
|
return undefined;
|
|
145050
|
-
case
|
|
145051
|
-
if (
|
|
145625
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
|
|
145626
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== actualType)
|
|
145052
145627
|
return undefined;
|
|
145053
145628
|
break;
|
|
145054
|
-
case
|
|
145055
|
-
if (
|
|
145629
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
|
|
145630
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== actualType && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort !== actualType)
|
|
145056
145631
|
return undefined;
|
|
145057
145632
|
break;
|
|
145058
145633
|
}
|
|
@@ -145064,13 +145639,13 @@ class GltfBufferData {
|
|
|
145064
145639
|
// NB: Endianness of typed array data is determined by the 'platform byte order'. Actual data is always little-endian.
|
|
145065
145640
|
// We are assuming little-endian platform. If we find a big-endian platform, we'll need to use a DataView instead.
|
|
145066
145641
|
switch (actualType) {
|
|
145067
|
-
case
|
|
145642
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
145068
145643
|
return bytes;
|
|
145069
|
-
case
|
|
145644
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
|
|
145070
145645
|
return new Uint16Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 2);
|
|
145071
|
-
case
|
|
145646
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
|
|
145072
145647
|
return new Uint32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
|
|
145073
|
-
case
|
|
145648
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
|
|
145074
145649
|
return new Float32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
|
|
145075
145650
|
default:
|
|
145076
145651
|
return undefined;
|
|
@@ -145197,7 +145772,7 @@ function colorFromJson(values) {
|
|
|
145197
145772
|
}
|
|
145198
145773
|
function colorFromMaterial(material, isTransparent) {
|
|
145199
145774
|
let color = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white;
|
|
145200
|
-
if ((0,
|
|
145775
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material)) {
|
|
145201
145776
|
if (material.values?.color && Array.isArray(material.values.color))
|
|
145202
145777
|
color = colorFromJson(material.values.color);
|
|
145203
145778
|
}
|
|
@@ -145288,7 +145863,7 @@ class GltfReader {
|
|
|
145288
145863
|
* @throws Error if a node appears more than once during traversal
|
|
145289
145864
|
*/
|
|
145290
145865
|
traverseNodes(nodeIds) {
|
|
145291
|
-
return (0,
|
|
145866
|
+
return (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.traverseGltfNodes)(nodeIds, this._nodes, new Set());
|
|
145292
145867
|
}
|
|
145293
145868
|
/** Traverse the nodes specified by their scene, recursing into their child nodes.
|
|
145294
145869
|
* @throws Error if a node appears more than once during traversal
|
|
@@ -145413,9 +145988,9 @@ class GltfReader {
|
|
|
145413
145988
|
return undefined;
|
|
145414
145989
|
}
|
|
145415
145990
|
const translationsView = this.getBufferView(ext.attributes, "TRANSLATION");
|
|
145416
|
-
const translations = translationsView?.toBufferData(
|
|
145417
|
-
const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(
|
|
145418
|
-
const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(
|
|
145991
|
+
const translations = translationsView?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
145992
|
+
const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
145993
|
+
const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
145419
145994
|
// All attributes must specify the same count, count must be greater than zero, and at least one attribute must be specified.
|
|
145420
145995
|
const count = translations?.count ?? rotations?.count ?? scales?.count;
|
|
145421
145996
|
if (!count || (rotations && rotations.count !== count) || (scales && scales.count !== count)) {
|
|
@@ -145488,7 +146063,7 @@ class GltfReader {
|
|
|
145488
146063
|
let thisBias;
|
|
145489
146064
|
if (undefined !== pseudoRtcBias)
|
|
145490
146065
|
thisBias = (undefined === thisTransform) ? pseudoRtcBias : thisTransform.matrix.multiplyInverse(pseudoRtcBias);
|
|
145491
|
-
for (const meshKey of (0,
|
|
146066
|
+
for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
|
|
145492
146067
|
const nodeMesh = this._meshes[meshKey];
|
|
145493
146068
|
if (nodeMesh?.primitives) {
|
|
145494
146069
|
const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias, nodeInstances);
|
|
@@ -145587,23 +146162,28 @@ class GltfReader {
|
|
|
145587
146162
|
return undefined;
|
|
145588
146163
|
const bufferViewAccessorValue = accessor.bufferView;
|
|
145589
146164
|
const bufferView = undefined !== bufferViewAccessorValue ? this._bufferViews[bufferViewAccessorValue] : undefined;
|
|
145590
|
-
if (!bufferView
|
|
146165
|
+
if (!bufferView)
|
|
145591
146166
|
return undefined;
|
|
145592
|
-
|
|
145593
|
-
|
|
146167
|
+
let bufferData = bufferView.resolvedBuffer;
|
|
146168
|
+
if (!bufferData) {
|
|
146169
|
+
if (undefined === bufferView.buffer)
|
|
146170
|
+
return undefined;
|
|
146171
|
+
const buffer = this._buffers[bufferView.buffer];
|
|
146172
|
+
bufferData = buffer?.resolvedBuffer;
|
|
146173
|
+
}
|
|
145594
146174
|
if (!bufferData)
|
|
145595
146175
|
return undefined;
|
|
145596
146176
|
const type = accessor.componentType;
|
|
145597
146177
|
let dataSize = 0;
|
|
145598
146178
|
switch (type) {
|
|
145599
|
-
case
|
|
146179
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
145600
146180
|
dataSize = 1;
|
|
145601
146181
|
break;
|
|
145602
|
-
case
|
|
146182
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
|
|
145603
146183
|
dataSize = 2;
|
|
145604
146184
|
break;
|
|
145605
|
-
case
|
|
145606
|
-
case
|
|
146185
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
|
|
146186
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
|
|
145607
146187
|
dataSize = 4;
|
|
145608
146188
|
break;
|
|
145609
146189
|
default:
|
|
@@ -145633,10 +146213,10 @@ class GltfReader {
|
|
|
145633
146213
|
return undefined;
|
|
145634
146214
|
}
|
|
145635
146215
|
}
|
|
145636
|
-
readBufferData32(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
145637
|
-
readBufferData16(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
145638
|
-
readBufferData8(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
145639
|
-
readBufferDataFloat(json, accessorName) { return this.readBufferData(json, accessorName,
|
|
146216
|
+
readBufferData32(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32); }
|
|
146217
|
+
readBufferData16(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort); }
|
|
146218
|
+
readBufferData8(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte); }
|
|
146219
|
+
readBufferDataFloat(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float); }
|
|
145640
146220
|
constructor(args) {
|
|
145641
146221
|
this._resolvedTextures = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Dictionary((lhs, rhs) => compareTextureKeys(lhs, rhs));
|
|
145642
146222
|
this._dracoMeshes = new Map();
|
|
@@ -145646,7 +146226,7 @@ class GltfReader {
|
|
|
145646
146226
|
* (We also don't want to produce mip-maps for them, which is determined indirectly from the wrap mode).
|
|
145647
146227
|
* Allow the default to be optionally overridden.
|
|
145648
146228
|
*/
|
|
145649
|
-
this.defaultWrapMode =
|
|
146229
|
+
this.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.Repeat;
|
|
145650
146230
|
this._glTF = args.props.glTF;
|
|
145651
146231
|
this._version = args.props.version;
|
|
145652
146232
|
this._yAxisUp = args.props.yAxisUp;
|
|
@@ -145698,7 +146278,7 @@ class GltfReader {
|
|
|
145698
146278
|
if (typeof material !== "object")
|
|
145699
146279
|
return undefined;
|
|
145700
146280
|
// Bimium's shader value...almost certainly obsolete at this point.
|
|
145701
|
-
if ((0,
|
|
146281
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
|
|
145702
146282
|
return material.diffuse ?? this.extractId(material.values?.tex);
|
|
145703
146283
|
// KHR_techniques_webgl extension
|
|
145704
146284
|
const techniques = this._glTF.extensions?.KHR_techniques_webgl?.techniques;
|
|
@@ -145708,7 +146288,7 @@ class GltfReader {
|
|
|
145708
146288
|
if (typeof uniforms === "object") {
|
|
145709
146289
|
for (const uniformName of Object.keys(uniforms)) {
|
|
145710
146290
|
const uniform = uniforms[uniformName];
|
|
145711
|
-
if (typeof uniform === "object" && uniform.type ===
|
|
146291
|
+
if (typeof uniform === "object" && uniform.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Sampler2d)
|
|
145712
146292
|
return this.extractId(ext.values[uniformName]?.index);
|
|
145713
146293
|
}
|
|
145714
146294
|
}
|
|
@@ -145719,15 +146299,15 @@ class GltfReader {
|
|
|
145719
146299
|
extractNormalMapId(material) {
|
|
145720
146300
|
if (typeof material !== "object")
|
|
145721
146301
|
return undefined;
|
|
145722
|
-
if ((0,
|
|
146302
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
|
|
145723
146303
|
return undefined;
|
|
145724
146304
|
return this.extractId(material.normalTexture?.index);
|
|
145725
146305
|
}
|
|
145726
146306
|
isMaterialTransparent(material) {
|
|
145727
|
-
if ((0,
|
|
146307
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material)) {
|
|
145728
146308
|
if (this._glTF.techniques && undefined !== material.technique) {
|
|
145729
146309
|
const technique = this._glTF.techniques[material.technique];
|
|
145730
|
-
if (technique?.states?.enable?.some((state) => state ===
|
|
146310
|
+
if (technique?.states?.enable?.some((state) => state === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfTechniqueState.Blend))
|
|
145731
146311
|
return true;
|
|
145732
146312
|
}
|
|
145733
146313
|
return false;
|
|
@@ -145751,11 +146331,11 @@ class GltfReader {
|
|
|
145751
146331
|
// DisplayParams doesn't want a separate texture mapping if the material already has one.
|
|
145752
146332
|
textureMapping = undefined;
|
|
145753
146333
|
}
|
|
145754
|
-
return new
|
|
146334
|
+
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);
|
|
145755
146335
|
}
|
|
145756
146336
|
readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
|
|
145757
146337
|
const meshes = [];
|
|
145758
|
-
for (const meshKey of (0,
|
|
146338
|
+
for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
|
|
145759
146339
|
const nodeMesh = this._meshes[meshKey];
|
|
145760
146340
|
if (nodeMesh?.primitives) {
|
|
145761
146341
|
for (const primitive of nodeMesh.primitives) {
|
|
@@ -145795,9 +146375,9 @@ class GltfReader {
|
|
|
145795
146375
|
return meshes;
|
|
145796
146376
|
}
|
|
145797
146377
|
readMeshPrimitive(primitive, featureTable, pseudoRtcBias) {
|
|
145798
|
-
const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode,
|
|
145799
|
-
if (meshMode ===
|
|
145800
|
-
const pointCloud = this.
|
|
146378
|
+
const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Triangles);
|
|
146379
|
+
if (meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Points /* && !this._vertexTableRequired */) {
|
|
146380
|
+
const pointCloud = this.readPointCloud2(primitive, undefined !== featureTable);
|
|
145801
146381
|
if (pointCloud)
|
|
145802
146382
|
return pointCloud;
|
|
145803
146383
|
}
|
|
@@ -145811,14 +146391,14 @@ class GltfReader {
|
|
|
145811
146391
|
return undefined;
|
|
145812
146392
|
let primitiveType = -1;
|
|
145813
146393
|
switch (meshMode) {
|
|
145814
|
-
case
|
|
145815
|
-
primitiveType =
|
|
146394
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Lines:
|
|
146395
|
+
primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Polyline;
|
|
145816
146396
|
break;
|
|
145817
|
-
case
|
|
145818
|
-
primitiveType =
|
|
146397
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Points:
|
|
146398
|
+
primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point;
|
|
145819
146399
|
break;
|
|
145820
|
-
case
|
|
145821
|
-
primitiveType =
|
|
146400
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Triangles:
|
|
146401
|
+
primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Mesh;
|
|
145822
146402
|
break;
|
|
145823
146403
|
default:
|
|
145824
146404
|
return undefined;
|
|
@@ -145846,7 +146426,7 @@ class GltfReader {
|
|
|
145846
146426
|
const colorIndices = this.readBufferData16(primitive.attributes, "_COLORINDEX");
|
|
145847
146427
|
if (undefined !== colorIndices && material) {
|
|
145848
146428
|
let texStep;
|
|
145849
|
-
if ((0,
|
|
146429
|
+
if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
|
|
145850
146430
|
texStep = material.values?.texStep;
|
|
145851
146431
|
else
|
|
145852
146432
|
texStep = material.extensions?.KHR_techniques_webgl?.values?.u_texStep;
|
|
@@ -145876,14 +146456,14 @@ class GltfReader {
|
|
|
145876
146456
|
if (!this.readVertices(mesh, primitive, pseudoRtcBias))
|
|
145877
146457
|
return undefined;
|
|
145878
146458
|
switch (primitiveType) {
|
|
145879
|
-
case
|
|
146459
|
+
case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Mesh: {
|
|
145880
146460
|
if (!this.readMeshIndices(mesh, primitive))
|
|
145881
146461
|
return undefined;
|
|
145882
146462
|
if (!displayParams.ignoreLighting && !this.readNormals(mesh, primitive.attributes, "NORMAL"))
|
|
145883
146463
|
return undefined;
|
|
145884
146464
|
if (!mesh.uvs) {
|
|
145885
146465
|
let texCoordIndex = 0;
|
|
145886
|
-
if (!(0,
|
|
146466
|
+
if (!(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material) && undefined !== material.pbrMetallicRoughness?.baseColorTexture?.texCoord)
|
|
145887
146467
|
texCoordIndex = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(material.pbrMetallicRoughness.baseColorTexture.texCoord);
|
|
145888
146468
|
this.readUVParams(mesh, primitive.attributes, `TEXCOORD_${texCoordIndex}`);
|
|
145889
146469
|
}
|
|
@@ -145891,9 +146471,9 @@ class GltfReader {
|
|
|
145891
146471
|
return undefined;
|
|
145892
146472
|
break;
|
|
145893
146473
|
}
|
|
145894
|
-
case
|
|
145895
|
-
case
|
|
145896
|
-
if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices",
|
|
146474
|
+
case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Polyline:
|
|
146475
|
+
case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point: {
|
|
146476
|
+
if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices", _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point === primitiveType))
|
|
145897
146477
|
return undefined;
|
|
145898
146478
|
break;
|
|
145899
146479
|
}
|
|
@@ -145915,23 +146495,60 @@ class GltfReader {
|
|
|
145915
146495
|
}
|
|
145916
146496
|
return mesh;
|
|
145917
146497
|
}
|
|
145918
|
-
|
|
146498
|
+
readPointCloud2(primitive, hasFeatures) {
|
|
146499
|
+
let pointRange;
|
|
146500
|
+
let positions;
|
|
146501
|
+
let qparams;
|
|
145919
146502
|
const posView = this.getBufferView(primitive.attributes, "POSITION");
|
|
145920
|
-
|
|
145921
|
-
|
|
145922
|
-
|
|
145923
|
-
|
|
145924
|
-
|
|
146503
|
+
switch (posView?.type) {
|
|
146504
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
|
|
146505
|
+
const posData = posView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146506
|
+
if (!(posData?.buffer instanceof Float32Array)) {
|
|
146507
|
+
return undefined;
|
|
146508
|
+
}
|
|
146509
|
+
positions = posData.buffer;
|
|
146510
|
+
const strideSkip = posView.stride - 3;
|
|
146511
|
+
pointRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
|
|
146512
|
+
for (let i = 0; i < positions.length; i += strideSkip) {
|
|
146513
|
+
pointRange.extendXYZ(positions[i++], positions[i++], positions[i++]);
|
|
146514
|
+
}
|
|
146515
|
+
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));
|
|
146516
|
+
break;
|
|
146517
|
+
}
|
|
146518
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
|
|
146519
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort: {
|
|
146520
|
+
const posData = posView.toBufferData(posView.type);
|
|
146521
|
+
if (!(posData?.buffer instanceof Uint8Array || posData?.buffer instanceof Uint16Array)) {
|
|
146522
|
+
return undefined;
|
|
146523
|
+
}
|
|
146524
|
+
positions = posData.buffer;
|
|
146525
|
+
let min, max;
|
|
146526
|
+
const ext = posView.accessor.extensions?.WEB3D_quantized_attributes;
|
|
146527
|
+
if (ext) {
|
|
146528
|
+
min = ext.decodedMin;
|
|
146529
|
+
max = ext.decodedMax;
|
|
146530
|
+
}
|
|
146531
|
+
else {
|
|
146532
|
+
// Assume KHR_mesh_quantization...
|
|
146533
|
+
min = posView.accessor.min;
|
|
146534
|
+
max = posView.accessor.max;
|
|
146535
|
+
}
|
|
146536
|
+
if (undefined === min || undefined === max) {
|
|
146537
|
+
return undefined;
|
|
146538
|
+
}
|
|
146539
|
+
pointRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d.createXYZXYZ(min[0], min[1], min[2], max[0], max[1], max[2]);
|
|
146540
|
+
qparams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QParams3d.fromRange(pointRange);
|
|
146541
|
+
break;
|
|
146542
|
+
}
|
|
146543
|
+
default:
|
|
146544
|
+
return undefined;
|
|
146545
|
+
}
|
|
145925
146546
|
const colorView = this.getBufferView(primitive.attributes, "COLOR_0");
|
|
145926
|
-
if (!colorView ||
|
|
146547
|
+
if (!colorView || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== colorView.type)
|
|
145927
146548
|
return undefined;
|
|
145928
|
-
const colorData = colorView.toBufferData(
|
|
146549
|
+
const colorData = colorView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte);
|
|
145929
146550
|
if (!(colorData?.buffer instanceof Uint8Array))
|
|
145930
146551
|
return undefined;
|
|
145931
|
-
const strideSkip = posView.stride - 3;
|
|
145932
|
-
const pointRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
|
|
145933
|
-
for (let i = 0; i < posData.buffer.length; i += strideSkip)
|
|
145934
|
-
pointRange.extendXYZ(posData.buffer[i++], posData.buffer[i++], posData.buffer[i++]);
|
|
145935
146552
|
let colors = colorData.buffer;
|
|
145936
146553
|
if ("VEC4" === colorView.accessor.type) {
|
|
145937
146554
|
// ###TODO support transparent point clouds
|
|
@@ -145944,13 +146561,14 @@ class GltfReader {
|
|
|
145944
146561
|
}
|
|
145945
146562
|
}
|
|
145946
146563
|
const features = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FeatureIndex();
|
|
145947
|
-
if (hasFeatures)
|
|
146564
|
+
if (hasFeatures) {
|
|
145948
146565
|
features.type = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FeatureIndexType.Uniform;
|
|
146566
|
+
}
|
|
145949
146567
|
this._containsPointCloud = true;
|
|
145950
146568
|
return {
|
|
145951
146569
|
type: "pointcloud",
|
|
145952
|
-
positions
|
|
145953
|
-
qparams
|
|
146570
|
+
positions,
|
|
146571
|
+
qparams,
|
|
145954
146572
|
pointRange,
|
|
145955
146573
|
colors,
|
|
145956
146574
|
colorFormat: "rgb",
|
|
@@ -146057,8 +146675,8 @@ class GltfReader {
|
|
|
146057
146675
|
const view = this.getBufferView(primitive.attributes, "POSITION");
|
|
146058
146676
|
if (undefined === view)
|
|
146059
146677
|
return false;
|
|
146060
|
-
if (
|
|
146061
|
-
const buffer = view.toBufferData(
|
|
146678
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float === view.type) {
|
|
146679
|
+
const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146062
146680
|
if (undefined === buffer)
|
|
146063
146681
|
return false;
|
|
146064
146682
|
const strideSkip = view.stride - 3;
|
|
@@ -146077,15 +146695,23 @@ class GltfReader {
|
|
|
146077
146695
|
mesh.points = positions.toTypedArray();
|
|
146078
146696
|
}
|
|
146079
146697
|
else {
|
|
146080
|
-
if (
|
|
146698
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort !== view.type)
|
|
146081
146699
|
return false;
|
|
146700
|
+
let rangeMin, rangeMax;
|
|
146082
146701
|
const quantized = view.accessor.extensions?.WEB3D_quantized_attributes;
|
|
146083
|
-
|
|
146084
|
-
|
|
146085
|
-
|
|
146702
|
+
if (quantized) {
|
|
146703
|
+
rangeMin = quantized.decodedMin;
|
|
146704
|
+
rangeMax = quantized.decodedMax;
|
|
146705
|
+
}
|
|
146706
|
+
else {
|
|
146707
|
+
// Assume KHR_mesh_quantization...
|
|
146708
|
+
rangeMin = view.accessor.min;
|
|
146709
|
+
rangeMax = view.accessor.max;
|
|
146710
|
+
}
|
|
146711
|
+
if (undefined === rangeMin || undefined === rangeMax) // required by spec...
|
|
146086
146712
|
return false;
|
|
146087
146713
|
// ###TODO apply WEB3D_quantized_attributes.decodeMatrix? Have not encountered in the wild; glTF 1.0 only.
|
|
146088
|
-
const buffer = view.toBufferData(
|
|
146714
|
+
const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort);
|
|
146089
146715
|
if (undefined === buffer || !(buffer.buffer instanceof Uint16Array))
|
|
146090
146716
|
return false;
|
|
146091
146717
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(buffer.buffer instanceof Uint16Array);
|
|
@@ -146147,8 +146773,8 @@ class GltfReader {
|
|
|
146147
146773
|
if (undefined === view)
|
|
146148
146774
|
return false;
|
|
146149
146775
|
switch (view.type) {
|
|
146150
|
-
case
|
|
146151
|
-
const data = view.toBufferData(
|
|
146776
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
|
|
146777
|
+
const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
|
|
146152
146778
|
if (undefined === data)
|
|
146153
146779
|
return false;
|
|
146154
146780
|
mesh.normals = new Uint16Array(data.count);
|
|
@@ -146160,8 +146786,8 @@ class GltfReader {
|
|
|
146160
146786
|
}
|
|
146161
146787
|
return true;
|
|
146162
146788
|
}
|
|
146163
|
-
case
|
|
146164
|
-
const data = view.toBufferData(
|
|
146789
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte: {
|
|
146790
|
+
const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte);
|
|
146165
146791
|
if (undefined === data)
|
|
146166
146792
|
return false;
|
|
146167
146793
|
// ###TODO: we shouldn't have to allocate OctEncodedNormal objects...just use uint16s / numbers...
|
|
@@ -146180,13 +146806,13 @@ class GltfReader {
|
|
|
146180
146806
|
}
|
|
146181
146807
|
readColors(mesh, attribute, accessorName) {
|
|
146182
146808
|
const view = this.getBufferView(attribute, accessorName);
|
|
146183
|
-
if (!view || (
|
|
146809
|
+
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))
|
|
146184
146810
|
return false;
|
|
146185
146811
|
const data = view.toBufferData(view.type);
|
|
146186
146812
|
if (!data)
|
|
146187
146813
|
return false;
|
|
146188
146814
|
const hasAlpha = "VEC4" === view.accessor.type;
|
|
146189
|
-
const factor = view.type ===
|
|
146815
|
+
const factor = view.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float ? 255 : 1;
|
|
146190
146816
|
const rgbt = new Uint8Array(4);
|
|
146191
146817
|
const color = new Uint32Array(rgbt.buffer);
|
|
146192
146818
|
for (let i = 0; i < data.count; i++) {
|
|
@@ -146204,7 +146830,7 @@ class GltfReader {
|
|
|
146204
146830
|
if (view === undefined)
|
|
146205
146831
|
return false;
|
|
146206
146832
|
switch (view.type) {
|
|
146207
|
-
case
|
|
146833
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
|
|
146208
146834
|
const data = this.readBufferDataFloat(json, accessorName);
|
|
146209
146835
|
if (!data)
|
|
146210
146836
|
return false;
|
|
@@ -146222,13 +146848,13 @@ class GltfReader {
|
|
|
146222
146848
|
}
|
|
146223
146849
|
return true;
|
|
146224
146850
|
}
|
|
146225
|
-
case
|
|
146851
|
+
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort: {
|
|
146226
146852
|
const quantized = view.accessor.extensions?.WEB3D_quantized_attributes;
|
|
146227
146853
|
const rangeMin = quantized?.decodedMin;
|
|
146228
146854
|
const rangeMax = quantized?.decodedMax;
|
|
146229
146855
|
if (undefined === rangeMin || undefined === rangeMax)
|
|
146230
146856
|
return false;
|
|
146231
|
-
const qData = view.toBufferData(
|
|
146857
|
+
const qData = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort);
|
|
146232
146858
|
if (undefined === qData || !(qData.buffer instanceof Uint16Array))
|
|
146233
146859
|
return false;
|
|
146234
146860
|
mesh.uvRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range2d.createXYXY(rangeMin[0], rangeMin[1], rangeMax[0], rangeMax[1]);
|
|
@@ -146282,10 +146908,30 @@ class GltfReader {
|
|
|
146282
146908
|
async resolveResources() {
|
|
146283
146909
|
// Load any external images and buffers.
|
|
146284
146910
|
await this._resolveResources();
|
|
146911
|
+
// Decompress any meshopt-compressed buffer views
|
|
146912
|
+
const decodeMeshoptBuffers = [];
|
|
146913
|
+
for (const bv of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._bufferViews)) {
|
|
146914
|
+
const ext = bv.extensions?.EXT_meshopt_compression;
|
|
146915
|
+
if (ext) {
|
|
146916
|
+
const bufferData = this._buffers[ext.buffer]?.resolvedBuffer;
|
|
146917
|
+
if (bufferData) {
|
|
146918
|
+
const source = new Uint8Array(bufferData.buffer, bufferData.byteOffset + (ext.byteOffset ?? 0), ext.byteLength ?? 0);
|
|
146919
|
+
const decode = async () => {
|
|
146920
|
+
bv.resolvedBuffer = await (0,_internal__WEBPACK_IMPORTED_MODULE_8__.decodeMeshoptBuffer)(source, ext);
|
|
146921
|
+
if (bv.resolvedBuffer) {
|
|
146922
|
+
bv.byteLength = bv.resolvedBuffer.byteLength;
|
|
146923
|
+
bv.byteOffset = 0;
|
|
146924
|
+
}
|
|
146925
|
+
};
|
|
146926
|
+
decodeMeshoptBuffers.push(decode());
|
|
146927
|
+
}
|
|
146928
|
+
}
|
|
146929
|
+
}
|
|
146930
|
+
await Promise.all(decodeMeshoptBuffers);
|
|
146285
146931
|
// If any meshes are draco-compressed, dynamically load the decoder module and then decode the meshes.
|
|
146286
146932
|
const dracoMeshes = [];
|
|
146287
146933
|
for (const node of this.traverseScene()) {
|
|
146288
|
-
for (const meshId of (0,
|
|
146934
|
+
for (const meshId of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
|
|
146289
146935
|
const mesh = this._meshes[meshId];
|
|
146290
146936
|
if (mesh?.primitives)
|
|
146291
146937
|
for (const primitive of mesh.primitives)
|
|
@@ -146300,8 +146946,8 @@ class GltfReader {
|
|
|
146300
146946
|
await Promise.all(dracoMeshes.map(async (x) => this.decodeDracoMesh(x, dracoLoader)));
|
|
146301
146947
|
}
|
|
146302
146948
|
catch (err) {
|
|
146303
|
-
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(
|
|
146304
|
-
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(
|
|
146949
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory.Render, "Failed to decode draco-encoded glTF mesh");
|
|
146950
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory.Render, err);
|
|
146305
146951
|
}
|
|
146306
146952
|
}
|
|
146307
146953
|
async _resolveResources() {
|
|
@@ -146309,14 +146955,14 @@ class GltfReader {
|
|
|
146309
146955
|
// be required for the scene.
|
|
146310
146956
|
const promises = [];
|
|
146311
146957
|
try {
|
|
146312
|
-
for (const buffer of (0,
|
|
146958
|
+
for (const buffer of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._buffers))
|
|
146313
146959
|
if (!buffer.resolvedBuffer)
|
|
146314
146960
|
promises.push(this.resolveBuffer(buffer));
|
|
146315
146961
|
await Promise.all(promises);
|
|
146316
146962
|
if (this._isCanceled)
|
|
146317
146963
|
return;
|
|
146318
146964
|
promises.length = 0;
|
|
146319
|
-
for (const image of (0,
|
|
146965
|
+
for (const image of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._images))
|
|
146320
146966
|
if (!image.resolvedImage)
|
|
146321
146967
|
promises.push(this.resolveImage(image));
|
|
146322
146968
|
await Promise.all(promises);
|
|
@@ -146370,7 +147016,7 @@ class GltfReader {
|
|
|
146370
147016
|
return;
|
|
146371
147017
|
const bvSrc = undefined !== image.bufferView ? image : image.extensions?.KHR_binary_glTF;
|
|
146372
147018
|
if (undefined !== bvSrc?.bufferView) {
|
|
146373
|
-
const format = undefined !== bvSrc.mimeType ? (0,
|
|
147019
|
+
const format = undefined !== bvSrc.mimeType ? (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.getImageSourceFormatForMimeType)(bvSrc.mimeType) : undefined;
|
|
146374
147020
|
const bufferView = this._bufferViews[bvSrc.bufferView];
|
|
146375
147021
|
if (undefined === format || !bufferView || !bufferView.byteLength || bufferView.byteLength < 0)
|
|
146376
147022
|
return;
|
|
@@ -146382,9 +147028,9 @@ class GltfReader {
|
|
|
146382
147028
|
try {
|
|
146383
147029
|
const imageSource = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ImageSource(bytes, format);
|
|
146384
147030
|
if (this._system.supportsCreateImageBitmap)
|
|
146385
|
-
image.resolvedImage = await (0,
|
|
147031
|
+
image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.imageBitmapFromImageSource)(imageSource);
|
|
146386
147032
|
else
|
|
146387
|
-
image.resolvedImage = await (0,
|
|
147033
|
+
image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.imageElementFromImageSource)(imageSource);
|
|
146388
147034
|
}
|
|
146389
147035
|
catch (_) {
|
|
146390
147036
|
//
|
|
@@ -146393,7 +147039,7 @@ class GltfReader {
|
|
|
146393
147039
|
}
|
|
146394
147040
|
const url = undefined !== image.uri ? this.resolveUrl(image.uri) : undefined;
|
|
146395
147041
|
if (undefined !== url)
|
|
146396
|
-
image.resolvedImage = await (0,
|
|
147042
|
+
image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.tryImageElementFromUrl)(url);
|
|
146397
147043
|
}
|
|
146398
147044
|
/** Exposed strictly for testing. */
|
|
146399
147045
|
getTextureType(sampler) {
|
|
@@ -146402,7 +147048,7 @@ class GltfReader {
|
|
|
146402
147048
|
let wrapT = sampler?.wrapT;
|
|
146403
147049
|
if (undefined === wrapS && undefined === wrapT)
|
|
146404
147050
|
wrapS = wrapT = this.defaultWrapMode;
|
|
146405
|
-
if (
|
|
147051
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.ClampToEdge === wrapS || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.ClampToEdge === wrapT)
|
|
146406
147052
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.TileSection;
|
|
146407
147053
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.Normal;
|
|
146408
147054
|
}
|
|
@@ -148538,6 +149184,88 @@ class LRUTileList {
|
|
|
148538
149184
|
}
|
|
148539
149185
|
|
|
148540
149186
|
|
|
149187
|
+
/***/ }),
|
|
149188
|
+
|
|
149189
|
+
/***/ "../../core/frontend/lib/esm/tile/MeshoptCompression.js":
|
|
149190
|
+
/*!**************************************************************!*\
|
|
149191
|
+
!*** ../../core/frontend/lib/esm/tile/MeshoptCompression.js ***!
|
|
149192
|
+
\**************************************************************/
|
|
149193
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
149194
|
+
|
|
149195
|
+
"use strict";
|
|
149196
|
+
__webpack_require__.r(__webpack_exports__);
|
|
149197
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
149198
|
+
/* harmony export */ "decodeMeshoptBuffer": () => (/* binding */ decodeMeshoptBuffer)
|
|
149199
|
+
/* harmony export */ });
|
|
149200
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
149201
|
+
/* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
|
|
149202
|
+
/*---------------------------------------------------------------------------------------------
|
|
149203
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
149204
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
149205
|
+
*--------------------------------------------------------------------------------------------*/
|
|
149206
|
+
/** @packageDocumentation
|
|
149207
|
+
* @module Tiles
|
|
149208
|
+
*/
|
|
149209
|
+
|
|
149210
|
+
|
|
149211
|
+
/** Loads and configures the MeshoptDecoder module on demand. */
|
|
149212
|
+
class Loader {
|
|
149213
|
+
constructor() {
|
|
149214
|
+
this._status = "uninitialized";
|
|
149215
|
+
}
|
|
149216
|
+
async getDecoder() {
|
|
149217
|
+
const status = this._status;
|
|
149218
|
+
switch (status) {
|
|
149219
|
+
case "failed":
|
|
149220
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._decoder);
|
|
149221
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
|
|
149222
|
+
return undefined;
|
|
149223
|
+
case "ready":
|
|
149224
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._decoder);
|
|
149225
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
|
|
149226
|
+
return this._decoder;
|
|
149227
|
+
case "loading":
|
|
149228
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._promise);
|
|
149229
|
+
await this._promise;
|
|
149230
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)("failed" === this._status || "ready" === this._status);
|
|
149231
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
|
|
149232
|
+
return this._decoder;
|
|
149233
|
+
}
|
|
149234
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)("uninitialized" === status);
|
|
149235
|
+
this._status = "loading";
|
|
149236
|
+
this._promise = this.load();
|
|
149237
|
+
return this.getDecoder();
|
|
149238
|
+
}
|
|
149239
|
+
async load() {
|
|
149240
|
+
try {
|
|
149241
|
+
// Import the module on first use.
|
|
149242
|
+
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;
|
|
149243
|
+
await decoder.ready;
|
|
149244
|
+
// Configure it to do the decoding outside of the main thread. No compelling reason to use more than one worker.
|
|
149245
|
+
decoder.useWorkers(1);
|
|
149246
|
+
this._status = "ready";
|
|
149247
|
+
this._decoder = decoder;
|
|
149248
|
+
}
|
|
149249
|
+
catch (err) {
|
|
149250
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.FrontendLoggerCategory.Render, err);
|
|
149251
|
+
this._status = "failed";
|
|
149252
|
+
}
|
|
149253
|
+
finally {
|
|
149254
|
+
this._promise = undefined;
|
|
149255
|
+
}
|
|
149256
|
+
}
|
|
149257
|
+
}
|
|
149258
|
+
const loader = new Loader();
|
|
149259
|
+
/** @internal */
|
|
149260
|
+
async function decodeMeshoptBuffer(source, args) {
|
|
149261
|
+
const decoder = await loader.getDecoder();
|
|
149262
|
+
if (!decoder) {
|
|
149263
|
+
return undefined;
|
|
149264
|
+
}
|
|
149265
|
+
return decoder.decodeGltfBufferAsync(args.count, args.byteStride, source, args.mode, args.filter);
|
|
149266
|
+
}
|
|
149267
|
+
|
|
149268
|
+
|
|
148541
149269
|
/***/ }),
|
|
148542
149270
|
|
|
148543
149271
|
/***/ "../../core/frontend/lib/esm/tile/OPCFormatInterpreter.js":
|
|
@@ -155711,6 +156439,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
155711
156439
|
/* harmony export */ "createRealityTileTreeReference": () => (/* reexport safe */ _RealityModelTileTree__WEBPACK_IMPORTED_MODULE_73__.createRealityTileTreeReference),
|
|
155712
156440
|
/* harmony export */ "createSpatialTileTreeReferences": () => (/* reexport safe */ _PrimaryTileTree__WEBPACK_IMPORTED_MODULE_78__.createSpatialTileTreeReferences),
|
|
155713
156441
|
/* harmony export */ "decodeImdlGraphics": () => (/* reexport safe */ _ImdlGraphicsCreator__WEBPACK_IMPORTED_MODULE_35__.decodeImdlGraphics),
|
|
156442
|
+
/* harmony export */ "decodeMeshoptBuffer": () => (/* reexport safe */ _MeshoptCompression__WEBPACK_IMPORTED_MODULE_89__.decodeMeshoptBuffer),
|
|
155714
156443
|
/* harmony export */ "disposeTileTreesForGeometricModels": () => (/* reexport safe */ _PrimaryTileTree__WEBPACK_IMPORTED_MODULE_78__.disposeTileTreesForGeometricModels),
|
|
155715
156444
|
/* harmony export */ "getCesiumAccessTokenAndEndpointUrl": () => (/* reexport safe */ _map_CesiumTerrainProvider__WEBPACK_IMPORTED_MODULE_64__.getCesiumAccessTokenAndEndpointUrl),
|
|
155716
156445
|
/* harmony export */ "getCesiumAssetUrl": () => (/* reexport safe */ _map_CesiumTerrainProvider__WEBPACK_IMPORTED_MODULE_64__.getCesiumAssetUrl),
|
|
@@ -155817,6 +156546,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
155817
156546
|
/* harmony import */ var _ThreeDTileFormatInterpreter__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./ThreeDTileFormatInterpreter */ "../../core/frontend/lib/esm/tile/ThreeDTileFormatInterpreter.js");
|
|
155818
156547
|
/* harmony import */ var _OPCFormatInterpreter__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./OPCFormatInterpreter */ "../../core/frontend/lib/esm/tile/OPCFormatInterpreter.js");
|
|
155819
156548
|
/* harmony import */ var _FetchCloudStorage__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./FetchCloudStorage */ "../../core/frontend/lib/esm/tile/FetchCloudStorage.js");
|
|
156549
|
+
/* harmony import */ var _MeshoptCompression__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./MeshoptCompression */ "../../core/frontend/lib/esm/tile/MeshoptCompression.js");
|
|
155820
156550
|
/*---------------------------------------------------------------------------------------------
|
|
155821
156551
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
155822
156552
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -155922,6 +156652,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
155922
156652
|
|
|
155923
156653
|
|
|
155924
156654
|
|
|
156655
|
+
|
|
155925
156656
|
|
|
155926
156657
|
|
|
155927
156658
|
/***/ }),
|
|
@@ -159806,8 +160537,11 @@ class WmtsMapLayerFormat extends ImageryMapLayerFormat {
|
|
|
159806
160537
|
return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.Valid, subLayers };
|
|
159807
160538
|
}
|
|
159808
160539
|
catch (err) {
|
|
159809
|
-
|
|
159810
|
-
|
|
160540
|
+
let status = _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidUrl;
|
|
160541
|
+
if (err?.status === 401) {
|
|
160542
|
+
status = ((userName && password) ? _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidCredentials : _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.RequireAuth);
|
|
160543
|
+
}
|
|
160544
|
+
return { status };
|
|
159811
160545
|
}
|
|
159812
160546
|
}
|
|
159813
160547
|
}
|
|
@@ -189801,7 +190535,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
189801
190535
|
/* harmony export */ "BSplineWrapMode": () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.BSplineWrapMode),
|
|
189802
190536
|
/* harmony export */ "BagOfCurves": () => (/* reexport safe */ _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_64__.BagOfCurves),
|
|
189803
190537
|
/* harmony export */ "BarycentricTriangle": () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.BarycentricTriangle),
|
|
189804
|
-
/* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */
|
|
190538
|
+
/* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_130__.BentleyGeometryFlatBuffer),
|
|
189805
190539
|
/* harmony export */ "Bezier1dNd": () => (/* reexport safe */ _bspline_Bezier1dNd__WEBPACK_IMPORTED_MODULE_98__.Bezier1dNd),
|
|
189806
190540
|
/* harmony export */ "BezierCoffs": () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.BezierCoffs),
|
|
189807
190541
|
/* harmony export */ "BezierCurve3d": () => (/* reexport safe */ _bspline_BezierCurve3d__WEBPACK_IMPORTED_MODULE_100__.BezierCurve3d),
|
|
@@ -189965,6 +190699,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
189965
190699
|
/* harmony export */ "RuledSweep": () => (/* reexport safe */ _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_92__.RuledSweep),
|
|
189966
190700
|
/* harmony export */ "Sample": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__.Sample),
|
|
189967
190701
|
/* harmony export */ "Segment1d": () => (/* reexport safe */ _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_31__.Segment1d),
|
|
190702
|
+
/* harmony export */ "SerializationHelpers": () => (/* reexport safe */ _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_129__.SerializationHelpers),
|
|
189968
190703
|
/* harmony export */ "SineCosinePolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SineCosinePolynomial),
|
|
189969
190704
|
/* harmony export */ "SmallSystem": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SmallSystem),
|
|
189970
190705
|
/* harmony export */ "SmoothTransformBetweenFrusta": () => (/* reexport safe */ _geometry3d_FrustumAnimation__WEBPACK_IMPORTED_MODULE_7__.SmoothTransformBetweenFrusta),
|
|
@@ -190133,7 +190868,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
190133
190868
|
/* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
|
|
190134
190869
|
/* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
|
|
190135
190870
|
/* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
|
|
190136
|
-
/* harmony import */ var
|
|
190871
|
+
/* harmony import */ var _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
190872
|
+
/* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
|
|
190137
190873
|
/*---------------------------------------------------------------------------------------------
|
|
190138
190874
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
190139
190875
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -190385,6 +191121,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
190385
191121
|
|
|
190386
191122
|
|
|
190387
191123
|
|
|
191124
|
+
|
|
190388
191125
|
|
|
190389
191126
|
|
|
190390
191127
|
/***/ }),
|
|
@@ -260465,22 +261202,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
260465
261202
|
|
|
260466
261203
|
|
|
260467
261204
|
/**
|
|
260468
|
-
* `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.
|
|
260469
|
-
* @
|
|
261205
|
+
* The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.
|
|
261206
|
+
* @public
|
|
260470
261207
|
*/
|
|
260471
261208
|
var SerializationHelpers;
|
|
260472
261209
|
(function (SerializationHelpers) {
|
|
260473
|
-
/** Constructor
|
|
261210
|
+
/** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */
|
|
260474
261211
|
function createBSplineCurveData(poles, dim, knots, numPoles, order) {
|
|
260475
261212
|
return { poles, dim, params: { numPoles, order, knots } };
|
|
260476
261213
|
}
|
|
260477
261214
|
SerializationHelpers.createBSplineCurveData = createBSplineCurveData;
|
|
260478
|
-
/** Constructor
|
|
261215
|
+
/** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */
|
|
260479
261216
|
function createBSplineSurfaceData(poles, dim, uKnots, uNumPoles, uOrder, vKnots, vNumPoles, vOrder) {
|
|
260480
261217
|
return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };
|
|
260481
261218
|
}
|
|
260482
261219
|
SerializationHelpers.createBSplineSurfaceData = createBSplineSurfaceData;
|
|
260483
|
-
/** Clone curve data */
|
|
261220
|
+
/** Clone B-spline curve data */
|
|
260484
261221
|
function cloneBSplineCurveData(source) {
|
|
260485
261222
|
return {
|
|
260486
261223
|
poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.copy2d(source.poles),
|
|
@@ -260496,7 +261233,7 @@ var SerializationHelpers;
|
|
|
260496
261233
|
};
|
|
260497
261234
|
}
|
|
260498
261235
|
SerializationHelpers.cloneBSplineCurveData = cloneBSplineCurveData;
|
|
260499
|
-
/** Clone surface data */
|
|
261236
|
+
/** Clone B-spline surface data */
|
|
260500
261237
|
function cloneBSplineSurfaceData(source) {
|
|
260501
261238
|
return {
|
|
260502
261239
|
poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.copy3d(source.poles),
|
|
@@ -260519,7 +261256,7 @@ var SerializationHelpers;
|
|
|
260519
261256
|
};
|
|
260520
261257
|
}
|
|
260521
261258
|
SerializationHelpers.cloneBSplineSurfaceData = cloneBSplineSurfaceData;
|
|
260522
|
-
/** Copy from source to dest */
|
|
261259
|
+
/** Copy B-spline curve data from source to dest */
|
|
260523
261260
|
function copyBSplineCurveDataPoles(source) {
|
|
260524
261261
|
let nPole = 0;
|
|
260525
261262
|
let nCoordPerPole = 0;
|
|
@@ -260566,7 +261303,7 @@ var SerializationHelpers;
|
|
|
260566
261303
|
weights = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.create(source.weights);
|
|
260567
261304
|
return { poles, weights };
|
|
260568
261305
|
}
|
|
260569
|
-
/** Copy from source to dest */
|
|
261306
|
+
/** Copy B-spline surface data from source to dest */
|
|
260570
261307
|
function copyBSplineSurfaceDataPoles(source) {
|
|
260571
261308
|
let nPoleRow = 0;
|
|
260572
261309
|
let nPolePerRow = 0;
|
|
@@ -260625,7 +261362,7 @@ var SerializationHelpers;
|
|
|
260625
261362
|
}
|
|
260626
261363
|
return { poles, weights };
|
|
260627
261364
|
}
|
|
260628
|
-
/** Convert data arrays to the types specified by options. */
|
|
261365
|
+
/** Convert B-spline curve data arrays to the types specified by options. */
|
|
260629
261366
|
function convertBSplineCurveDataArrays(data, options) {
|
|
260630
261367
|
if (undefined !== options?.jsonPoles) {
|
|
260631
261368
|
const packedPoles = data.poles instanceof Float64Array;
|
|
@@ -260649,7 +261386,7 @@ var SerializationHelpers;
|
|
|
260649
261386
|
data.params.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.params.knots);
|
|
260650
261387
|
}
|
|
260651
261388
|
}
|
|
260652
|
-
/** Convert data arrays to the types specified by options. */
|
|
261389
|
+
/** Convert B-spline surface data arrays to the types specified by options. */
|
|
260653
261390
|
function convertBSplineSurfaceDataArrays(data, options) {
|
|
260654
261391
|
if (undefined !== options?.jsonPoles) {
|
|
260655
261392
|
const packedPoles = data.poles instanceof Float64Array;
|
|
@@ -260678,6 +261415,7 @@ var SerializationHelpers;
|
|
|
260678
261415
|
data.vParams.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.vParams.knots);
|
|
260679
261416
|
}
|
|
260680
261417
|
}
|
|
261418
|
+
/** Helper class for preparing geometry data for import. */
|
|
260681
261419
|
class Import {
|
|
260682
261420
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
260683
261421
|
static copyKnots(knots, options, iStart, iEnd) {
|
|
@@ -260874,6 +261612,7 @@ var SerializationHelpers;
|
|
|
260874
261612
|
}
|
|
260875
261613
|
}
|
|
260876
261614
|
SerializationHelpers.Import = Import;
|
|
261615
|
+
/** Helper class for preparing geometry data for export. */
|
|
260877
261616
|
class Export {
|
|
260878
261617
|
/**
|
|
260879
261618
|
* Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.
|
|
@@ -289709,18 +290448,18 @@ class Settings {
|
|
|
289709
290448
|
}
|
|
289710
290449
|
}
|
|
289711
290450
|
toString() {
|
|
289712
|
-
return `Configurations:
|
|
289713
|
-
backend location: ${this.Backend.location},
|
|
289714
|
-
backend name: ${this.Backend.name},
|
|
289715
|
-
backend version: ${this.Backend.version},
|
|
289716
|
-
oidc client id: ${this.oidcClientId},
|
|
289717
|
-
oidc scopes: ${this.oidcScopes},
|
|
289718
|
-
applicationId: ${this.gprid},
|
|
289719
|
-
log level: ${this.logLevel},
|
|
289720
|
-
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
289721
|
-
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
289722
|
-
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
289723
|
-
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
290451
|
+
return `Configurations:
|
|
290452
|
+
backend location: ${this.Backend.location},
|
|
290453
|
+
backend name: ${this.Backend.name},
|
|
290454
|
+
backend version: ${this.Backend.version},
|
|
290455
|
+
oidc client id: ${this.oidcClientId},
|
|
290456
|
+
oidc scopes: ${this.oidcScopes},
|
|
290457
|
+
applicationId: ${this.gprid},
|
|
290458
|
+
log level: ${this.logLevel},
|
|
290459
|
+
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
290460
|
+
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
290461
|
+
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
290462
|
+
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
289724
290463
|
testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;
|
|
289725
290464
|
}
|
|
289726
290465
|
}
|
|
@@ -289925,7 +290664,7 @@ class TestContext {
|
|
|
289925
290664
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
289926
290665
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
289927
290666
|
await core_frontend_1.NoRenderApp.startup({
|
|
289928
|
-
applicationVersion: "4.6.0-dev.
|
|
290667
|
+
applicationVersion: "4.6.0-dev.5",
|
|
289929
290668
|
applicationId: this.settings.gprid,
|
|
289930
290669
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
289931
290670
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -291016,7 +291755,7 @@ class KeySet {
|
|
|
291016
291755
|
this._nodeKeys.add(JSON.stringify(key));
|
|
291017
291756
|
}
|
|
291018
291757
|
for (const entry of keyset.instanceKeys) {
|
|
291019
|
-
const lcClassName = entry["0"]
|
|
291758
|
+
const lcClassName = normalizeClassName(entry["0"]);
|
|
291020
291759
|
const idsJson = entry["1"];
|
|
291021
291760
|
const ids = typeof idsJson === "string" ? (idsJson === _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid ? new Set([_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid]) : _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressSet(idsJson)) : new Set(idsJson);
|
|
291022
291761
|
this._instanceKeys.set(lcClassName, ids);
|
|
@@ -291045,7 +291784,7 @@ class KeySet {
|
|
|
291045
291784
|
this.add({ className: value.classFullName, id: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromJSON(value.id) });
|
|
291046
291785
|
}
|
|
291047
291786
|
else if (Key.isInstanceKey(value)) {
|
|
291048
|
-
const lcClassName = value.className
|
|
291787
|
+
const lcClassName = normalizeClassName(value.className);
|
|
291049
291788
|
if (!this._instanceKeys.has(lcClassName)) {
|
|
291050
291789
|
this._instanceKeys.set(lcClassName, new Set());
|
|
291051
291790
|
this._lowerCaseMap.set(lcClassName, value.className);
|
|
@@ -291070,7 +291809,7 @@ class KeySet {
|
|
|
291070
291809
|
this._nodeKeys.delete(key);
|
|
291071
291810
|
}
|
|
291072
291811
|
for (const entry of keyset._instanceKeys) {
|
|
291073
|
-
const set = this._instanceKeys.get(entry["0"]
|
|
291812
|
+
const set = this._instanceKeys.get(entry["0"]);
|
|
291074
291813
|
if (set) {
|
|
291075
291814
|
entry["1"].forEach((key) => {
|
|
291076
291815
|
set.delete(key);
|
|
@@ -291100,7 +291839,7 @@ class KeySet {
|
|
|
291100
291839
|
this.delete({ className: value.classFullName, id: value.id });
|
|
291101
291840
|
}
|
|
291102
291841
|
else if (Key.isInstanceKey(value)) {
|
|
291103
|
-
const set = this._instanceKeys.get(value.className
|
|
291842
|
+
const set = this._instanceKeys.get(normalizeClassName(value.className));
|
|
291104
291843
|
if (set) {
|
|
291105
291844
|
set.delete(value.id);
|
|
291106
291845
|
}
|
|
@@ -291128,7 +291867,7 @@ class KeySet {
|
|
|
291128
291867
|
return this.has({ className: value.classFullName, id: value.id });
|
|
291129
291868
|
}
|
|
291130
291869
|
if (Key.isInstanceKey(value)) {
|
|
291131
|
-
const set = this._instanceKeys.get(value.className
|
|
291870
|
+
const set = this._instanceKeys.get(normalizeClassName(value.className));
|
|
291132
291871
|
return !!(set && set.has(value.id));
|
|
291133
291872
|
}
|
|
291134
291873
|
if (Key.isNodeKey(value)) {
|
|
@@ -291147,7 +291886,7 @@ class KeySet {
|
|
|
291147
291886
|
return false;
|
|
291148
291887
|
}
|
|
291149
291888
|
for (const otherEntry of keys._instanceKeys) {
|
|
291150
|
-
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]
|
|
291889
|
+
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]);
|
|
291151
291890
|
if (!thisEntryKeys || thisEntryKeys.size < otherEntry["1"].size) {
|
|
291152
291891
|
return false;
|
|
291153
291892
|
}
|
|
@@ -291162,7 +291901,7 @@ class KeySet {
|
|
|
291162
291901
|
return true;
|
|
291163
291902
|
}
|
|
291164
291903
|
for (const otherEntry of keys._instanceKeys) {
|
|
291165
|
-
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]
|
|
291904
|
+
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]);
|
|
291166
291905
|
if (thisEntryKeys && [...otherEntry["1"]].some((key) => thisEntryKeys.has(key))) {
|
|
291167
291906
|
return true;
|
|
291168
291907
|
}
|
|
@@ -291315,6 +292054,9 @@ class KeySet {
|
|
|
291315
292054
|
return keyset;
|
|
291316
292055
|
}
|
|
291317
292056
|
}
|
|
292057
|
+
function normalizeClassName(className) {
|
|
292058
|
+
return className.replace(".", ":").toLowerCase();
|
|
292059
|
+
}
|
|
291318
292060
|
const some = (set, cb) => {
|
|
291319
292061
|
for (const item of set) {
|
|
291320
292062
|
if (cb(item)) {
|
|
@@ -296916,11 +297658,13 @@ class Presentation {
|
|
|
296916
297658
|
presentationManager = _PresentationManager__WEBPACK_IMPORTED_MODULE_5__.PresentationManager.create(managerProps);
|
|
296917
297659
|
}
|
|
296918
297660
|
if (!selectionManager) {
|
|
296919
|
-
selectionManager = new _selection_SelectionManager__WEBPACK_IMPORTED_MODULE_6__.SelectionManager(
|
|
296920
|
-
|
|
296921
|
-
|
|
296922
|
-
|
|
296923
|
-
|
|
297661
|
+
selectionManager = new _selection_SelectionManager__WEBPACK_IMPORTED_MODULE_6__.SelectionManager({
|
|
297662
|
+
...props?.selection,
|
|
297663
|
+
scopes: props?.selection?.scopes ??
|
|
297664
|
+
new _selection_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.SelectionScopesManager({
|
|
297665
|
+
rpcRequestsHandler: presentationManager.rpcRequestsHandler,
|
|
297666
|
+
localeProvider: () => this.presentation.activeLocale,
|
|
297667
|
+
}),
|
|
296924
297668
|
});
|
|
296925
297669
|
}
|
|
296926
297670
|
if (!favoritePropertiesManager) {
|
|
@@ -296956,6 +297700,9 @@ class Presentation {
|
|
|
296956
297700
|
favoritePropertiesManager.dispose();
|
|
296957
297701
|
}
|
|
296958
297702
|
favoritePropertiesManager = undefined;
|
|
297703
|
+
if (selectionManager) {
|
|
297704
|
+
selectionManager.dispose();
|
|
297705
|
+
}
|
|
296959
297706
|
selectionManager = undefined;
|
|
296960
297707
|
localization = undefined;
|
|
296961
297708
|
}
|
|
@@ -298194,13 +298941,13 @@ class FavoritePropertiesManager {
|
|
|
298194
298941
|
if (missingClasses.size === 0) {
|
|
298195
298942
|
return baseClasses;
|
|
298196
298943
|
}
|
|
298197
|
-
const query = `
|
|
298198
|
-
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
298199
|
-
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
298200
|
-
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
298201
|
-
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
298202
|
-
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
298203
|
-
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
298944
|
+
const query = `
|
|
298945
|
+
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
298946
|
+
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
298947
|
+
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
298948
|
+
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
298949
|
+
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
298950
|
+
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
298204
298951
|
WHERE (derivedSchema.Name || ':' || derivedClass.Name) IN (${[...missingClasses].map((className) => `'${className}'`).join(",")})`;
|
|
298205
298952
|
const reader = imodel.createQueryReader(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames });
|
|
298206
298953
|
while (await reader.step()) {
|
|
@@ -299469,12 +300216,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
299469
300216
|
/* harmony export */ "TRANSIENT_ELEMENT_CLASSNAME": () => (/* binding */ TRANSIENT_ELEMENT_CLASSNAME),
|
|
299470
300217
|
/* harmony export */ "ToolSelectionSyncHandler": () => (/* binding */ ToolSelectionSyncHandler)
|
|
299471
300218
|
/* harmony export */ });
|
|
300219
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subject.js");
|
|
300220
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js");
|
|
300221
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/empty.js");
|
|
300222
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/of.js");
|
|
300223
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js");
|
|
300224
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js");
|
|
300225
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js");
|
|
299472
300226
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
299473
300227
|
/* harmony import */ var _itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-frontend */ "../../core/frontend/lib/esm/core-frontend.js");
|
|
299474
300228
|
/* harmony import */ var _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @itwin/presentation-common */ "../../presentation/common/lib/esm/presentation-common.js");
|
|
299475
|
-
/* harmony import */ var
|
|
299476
|
-
/* harmony import */ var
|
|
299477
|
-
/* harmony import */ var
|
|
300229
|
+
/* harmony import */ var _itwin_unified_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/unified-selection */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js");
|
|
300230
|
+
/* harmony import */ var _Presentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Presentation */ "../../presentation/frontend/lib/esm/presentation-frontend/Presentation.js");
|
|
300231
|
+
/* harmony import */ var _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HiliteSetProvider */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/HiliteSetProvider.js");
|
|
300232
|
+
/* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js");
|
|
300233
|
+
/* harmony import */ var _SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectionScopesManager */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionScopesManager.js");
|
|
299478
300234
|
/*---------------------------------------------------------------------------------------------
|
|
299479
300235
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
299480
300236
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -299488,6 +300244,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
299488
300244
|
|
|
299489
300245
|
|
|
299490
300246
|
|
|
300247
|
+
|
|
300248
|
+
|
|
300249
|
+
|
|
299491
300250
|
/**
|
|
299492
300251
|
* The selection manager which stores the overall selection.
|
|
299493
300252
|
* @public
|
|
@@ -299497,27 +300256,37 @@ class SelectionManager {
|
|
|
299497
300256
|
* Creates an instance of SelectionManager.
|
|
299498
300257
|
*/
|
|
299499
300258
|
constructor(props) {
|
|
299500
|
-
this._selectionContainerMap = new Map();
|
|
299501
300259
|
this._imodelToolSelectionSyncHandlers = new Map();
|
|
299502
300260
|
this._hiliteSetProviders = new Map();
|
|
299503
|
-
this.
|
|
300261
|
+
this._knownIModels = new Map();
|
|
300262
|
+
this._currentSelection = new CurrentSelectionStorage();
|
|
300263
|
+
this._selectionChanges = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
|
|
300264
|
+
this._listeners = [];
|
|
300265
|
+
this.selectionChange = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeEvent();
|
|
299504
300266
|
this.scopes = props.scopes;
|
|
299505
|
-
|
|
300267
|
+
this._selectionStorage = props.selectionStorage ?? (0,_itwin_unified_selection__WEBPACK_IMPORTED_MODULE_3__.createStorage)();
|
|
300268
|
+
this._ownsStorage = props.selectionStorage === undefined;
|
|
300269
|
+
this._selectionStorage.selectionChangeEvent.addListener((args) => this._selectionChanges.next(args));
|
|
300270
|
+
this._selectionEventsSubscription = this.streamSelectionEvents();
|
|
300271
|
+
this._listeners.push(_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onOpen.addListener((imodel) => {
|
|
300272
|
+
this._knownIModels.set(imodel.key, imodel);
|
|
300273
|
+
}));
|
|
300274
|
+
this._listeners.push(_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onClose.addListener((imodel) => {
|
|
299506
300275
|
this.onConnectionClose(imodel);
|
|
299507
|
-
});
|
|
300276
|
+
}));
|
|
300277
|
+
}
|
|
300278
|
+
dispose() {
|
|
300279
|
+
this._selectionEventsSubscription.unsubscribe();
|
|
300280
|
+
this._listeners.forEach((dispose) => dispose());
|
|
299508
300281
|
}
|
|
299509
300282
|
onConnectionClose(imodel) {
|
|
299510
|
-
this.clearSelection("Connection Close Event", imodel);
|
|
299511
|
-
this._selectionContainerMap.delete(imodel);
|
|
299512
300283
|
this._hiliteSetProviders.delete(imodel);
|
|
299513
|
-
|
|
299514
|
-
|
|
299515
|
-
|
|
299516
|
-
|
|
299517
|
-
|
|
299518
|
-
this._selectionContainerMap.set(imodel, selectionContainer);
|
|
300284
|
+
this._knownIModels.delete(imodel.key);
|
|
300285
|
+
this._currentSelection.clear(imodel.key);
|
|
300286
|
+
if (this._ownsStorage) {
|
|
300287
|
+
this.clearSelection("Connection Close Event", imodel);
|
|
300288
|
+
this._selectionStorage.clearStorage({ iModelKey: imodel.key });
|
|
299519
300289
|
}
|
|
299520
|
-
return selectionContainer;
|
|
299521
300290
|
}
|
|
299522
300291
|
/** @internal */
|
|
299523
300292
|
// istanbul ignore next
|
|
@@ -299565,39 +300334,48 @@ class SelectionManager {
|
|
|
299565
300334
|
}
|
|
299566
300335
|
/** Get the selection levels currently stored in this manager for the specified imodel */
|
|
299567
300336
|
getSelectionLevels(imodel) {
|
|
299568
|
-
return this.
|
|
300337
|
+
return this._selectionStorage.getSelectionLevels({ iModelKey: imodel.key });
|
|
299569
300338
|
}
|
|
299570
|
-
/**
|
|
300339
|
+
/**
|
|
300340
|
+
* Get the selection currently stored in this manager
|
|
300341
|
+
*
|
|
300342
|
+
* @note Calling immediately after `add*`|`replace*`|`remove*`|`clear*` method call does not guarantee
|
|
300343
|
+
* that returned `KeySet` will include latest changes. Listen for `selectionChange` event to get the
|
|
300344
|
+
* latest selection after changes.
|
|
300345
|
+
*/
|
|
299571
300346
|
getSelection(imodel, level = 0) {
|
|
299572
|
-
return this.
|
|
300347
|
+
return this._currentSelection.getSelection(imodel.key, level);
|
|
299573
300348
|
}
|
|
299574
300349
|
handleEvent(evt) {
|
|
299575
|
-
const container = this.getContainer(evt.imodel);
|
|
299576
|
-
const selectedItemsSet = container.getSelection(evt.level);
|
|
299577
|
-
const guidBefore = selectedItemsSet.guid;
|
|
299578
300350
|
switch (evt.changeType) {
|
|
299579
|
-
case
|
|
299580
|
-
|
|
300351
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add:
|
|
300352
|
+
this._selectionStorage.addToSelection({
|
|
300353
|
+
iModelKey: evt.imodel.key,
|
|
300354
|
+
source: evt.source,
|
|
300355
|
+
level: evt.level,
|
|
300356
|
+
selectables: keysToSelectable(evt.imodel, evt.keys),
|
|
300357
|
+
});
|
|
299581
300358
|
break;
|
|
299582
|
-
case
|
|
299583
|
-
|
|
300359
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove:
|
|
300360
|
+
this._selectionStorage.removeFromSelection({
|
|
300361
|
+
iModelKey: evt.imodel.key,
|
|
300362
|
+
source: evt.source,
|
|
300363
|
+
level: evt.level,
|
|
300364
|
+
selectables: keysToSelectable(evt.imodel, evt.keys),
|
|
300365
|
+
});
|
|
299584
300366
|
break;
|
|
299585
|
-
case
|
|
299586
|
-
|
|
299587
|
-
|
|
299588
|
-
|
|
299589
|
-
|
|
299590
|
-
|
|
300367
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace:
|
|
300368
|
+
this._selectionStorage.replaceSelection({
|
|
300369
|
+
iModelKey: evt.imodel.key,
|
|
300370
|
+
source: evt.source,
|
|
300371
|
+
level: evt.level,
|
|
300372
|
+
selectables: keysToSelectable(evt.imodel, evt.keys),
|
|
300373
|
+
});
|
|
299591
300374
|
break;
|
|
299592
|
-
case
|
|
299593
|
-
|
|
300375
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear:
|
|
300376
|
+
this._selectionStorage.clearSelection({ iModelKey: evt.imodel.key, source: evt.source, level: evt.level });
|
|
299594
300377
|
break;
|
|
299595
300378
|
}
|
|
299596
|
-
if (selectedItemsSet.guid === guidBefore) {
|
|
299597
|
-
return;
|
|
299598
|
-
}
|
|
299599
|
-
container.clear(evt.level + 1);
|
|
299600
|
-
this.selectionChange.raiseEvent(evt, this);
|
|
299601
300379
|
}
|
|
299602
300380
|
/**
|
|
299603
300381
|
* Add keys to the selection
|
|
@@ -299612,7 +300390,7 @@ class SelectionManager {
|
|
|
299612
300390
|
source,
|
|
299613
300391
|
level,
|
|
299614
300392
|
imodel,
|
|
299615
|
-
changeType:
|
|
300393
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add,
|
|
299616
300394
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
|
|
299617
300395
|
timestamp: new Date(),
|
|
299618
300396
|
rulesetId,
|
|
@@ -299632,7 +300410,7 @@ class SelectionManager {
|
|
|
299632
300410
|
source,
|
|
299633
300411
|
level,
|
|
299634
300412
|
imodel,
|
|
299635
|
-
changeType:
|
|
300413
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove,
|
|
299636
300414
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
|
|
299637
300415
|
timestamp: new Date(),
|
|
299638
300416
|
rulesetId,
|
|
@@ -299652,7 +300430,7 @@ class SelectionManager {
|
|
|
299652
300430
|
source,
|
|
299653
300431
|
level,
|
|
299654
300432
|
imodel,
|
|
299655
|
-
changeType:
|
|
300433
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace,
|
|
299656
300434
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
|
|
299657
300435
|
timestamp: new Date(),
|
|
299658
300436
|
rulesetId,
|
|
@@ -299671,7 +300449,7 @@ class SelectionManager {
|
|
|
299671
300449
|
source,
|
|
299672
300450
|
level,
|
|
299673
300451
|
imodel,
|
|
299674
|
-
changeType:
|
|
300452
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear,
|
|
299675
300453
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(),
|
|
299676
300454
|
timestamp: new Date(),
|
|
299677
300455
|
rulesetId,
|
|
@@ -299734,42 +300512,35 @@ class SelectionManager {
|
|
|
299734
300512
|
getHiliteSetProvider(imodel) {
|
|
299735
300513
|
let provider = this._hiliteSetProviders.get(imodel);
|
|
299736
300514
|
if (!provider) {
|
|
299737
|
-
provider =
|
|
300515
|
+
provider = _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_5__.HiliteSetProvider.create({ imodel });
|
|
299738
300516
|
this._hiliteSetProviders.set(imodel, provider);
|
|
299739
300517
|
}
|
|
299740
300518
|
return provider;
|
|
299741
300519
|
}
|
|
299742
|
-
|
|
299743
|
-
|
|
299744
|
-
|
|
299745
|
-
|
|
299746
|
-
|
|
299747
|
-
|
|
299748
|
-
|
|
299749
|
-
|
|
299750
|
-
|
|
299751
|
-
|
|
299752
|
-
|
|
299753
|
-
|
|
299754
|
-
|
|
299755
|
-
|
|
299756
|
-
|
|
299757
|
-
|
|
299758
|
-
|
|
299759
|
-
|
|
299760
|
-
|
|
299761
|
-
|
|
299762
|
-
|
|
299763
|
-
|
|
299764
|
-
|
|
299765
|
-
|
|
299766
|
-
const keys = this._selectedItemsSetMap.keys();
|
|
299767
|
-
for (const key of keys) {
|
|
299768
|
-
if (key >= level) {
|
|
299769
|
-
const selectedItemsSet = this._selectedItemsSetMap.get(key);
|
|
299770
|
-
selectedItemsSet.clear();
|
|
299771
|
-
}
|
|
299772
|
-
}
|
|
300520
|
+
streamSelectionEvents() {
|
|
300521
|
+
return this._selectionChanges
|
|
300522
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_9__.mergeMap)((args) => {
|
|
300523
|
+
const currentSelectables = this._selectionStorage.getSelection({ iModelKey: args.iModelKey, level: args.level });
|
|
300524
|
+
return this._currentSelection.computeSelection(args.iModelKey, args.level, currentSelectables, args.selectables).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_9__.mergeMap)(({ level, changedSelection }) => {
|
|
300525
|
+
const imodel = this._knownIModels.get(args.iModelKey);
|
|
300526
|
+
if (!imodel) {
|
|
300527
|
+
return rxjs__WEBPACK_IMPORTED_MODULE_10__.EMPTY;
|
|
300528
|
+
}
|
|
300529
|
+
return (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)({
|
|
300530
|
+
imodel,
|
|
300531
|
+
keys: changedSelection,
|
|
300532
|
+
level,
|
|
300533
|
+
source: args.source,
|
|
300534
|
+
timestamp: args.timestamp,
|
|
300535
|
+
changeType: getChangeType(args.changeType),
|
|
300536
|
+
});
|
|
300537
|
+
}));
|
|
300538
|
+
}))
|
|
300539
|
+
.subscribe({
|
|
300540
|
+
next: (args) => {
|
|
300541
|
+
this.selectionChange.raiseEvent(args, this);
|
|
300542
|
+
},
|
|
300543
|
+
});
|
|
299773
300544
|
}
|
|
299774
300545
|
}
|
|
299775
300546
|
/** @internal */
|
|
@@ -299809,7 +300580,7 @@ class ToolSelectionSyncHandler {
|
|
|
299809
300580
|
// makes sure we're adding to selection keys with concrete classes and not "BisCore:Element", which
|
|
299810
300581
|
// we can't because otherwise our keys compare fails (presentation components load data with
|
|
299811
300582
|
// concrete classes)
|
|
299812
|
-
const changer = new ScopedSelectionChanger(this._selectionSourceName, this._imodel, this._logicalSelection, (0,
|
|
300583
|
+
const changer = new ScopedSelectionChanger(this._selectionSourceName, this._imodel, this._logicalSelection, (0,_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.createSelectionScopeProps)(this._logicalSelection.scopes.activeScope));
|
|
299813
300584
|
// we know what to do immediately on `clear` events
|
|
299814
300585
|
if (_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.SelectionSetEventType.Clear === ev.type) {
|
|
299815
300586
|
await changer.clear(selectionLevel);
|
|
@@ -299909,6 +300680,196 @@ class ScopedSelectionChanger {
|
|
|
299909
300680
|
this.manager.replaceSelection(this.name, this.imodel, keys, level);
|
|
299910
300681
|
}
|
|
299911
300682
|
}
|
|
300683
|
+
/** Stores current selection in `KeySet` format per iModel. */
|
|
300684
|
+
class CurrentSelectionStorage {
|
|
300685
|
+
constructor() {
|
|
300686
|
+
this._currentSelection = new Map();
|
|
300687
|
+
}
|
|
300688
|
+
getCurrentSelectionStorage(imodelKey) {
|
|
300689
|
+
let storage = this._currentSelection.get(imodelKey);
|
|
300690
|
+
if (!storage) {
|
|
300691
|
+
storage = new IModelSelectionStorage();
|
|
300692
|
+
this._currentSelection.set(imodelKey, storage);
|
|
300693
|
+
}
|
|
300694
|
+
return storage;
|
|
300695
|
+
}
|
|
300696
|
+
getSelection(imodelKey, level) {
|
|
300697
|
+
return this.getCurrentSelectionStorage(imodelKey).getSelection(level);
|
|
300698
|
+
}
|
|
300699
|
+
clear(imodelKey) {
|
|
300700
|
+
this._currentSelection.delete(imodelKey);
|
|
300701
|
+
}
|
|
300702
|
+
computeSelection(imodelKey, level, currSelectables, changedSelectables) {
|
|
300703
|
+
return this.getCurrentSelectionStorage(imodelKey).computeSelection(level, currSelectables, changedSelectables);
|
|
300704
|
+
}
|
|
300705
|
+
}
|
|
300706
|
+
/**
|
|
300707
|
+
* Computes and stores current selection in `KeySet` format.
|
|
300708
|
+
* It always stores result of latest resolved call to `computeSelection`.
|
|
300709
|
+
*/
|
|
300710
|
+
class IModelSelectionStorage {
|
|
300711
|
+
constructor() {
|
|
300712
|
+
this._currentSelection = new Map();
|
|
300713
|
+
}
|
|
300714
|
+
getSelection(level) {
|
|
300715
|
+
let entry = this._currentSelection.get(level);
|
|
300716
|
+
if (!entry) {
|
|
300717
|
+
entry = { value: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(), ongoingComputationDisposers: new Set() };
|
|
300718
|
+
this._currentSelection.set(level, entry);
|
|
300719
|
+
}
|
|
300720
|
+
return entry.value;
|
|
300721
|
+
}
|
|
300722
|
+
clearSelections(level) {
|
|
300723
|
+
const clearedLevels = [];
|
|
300724
|
+
for (const [storedLevel] of this._currentSelection.entries()) {
|
|
300725
|
+
if (storedLevel > level) {
|
|
300726
|
+
clearedLevels.push(storedLevel);
|
|
300727
|
+
}
|
|
300728
|
+
}
|
|
300729
|
+
clearedLevels.forEach((storedLevel) => {
|
|
300730
|
+
const entry = this._currentSelection.get(storedLevel);
|
|
300731
|
+
// istanbul ignore if
|
|
300732
|
+
if (!entry) {
|
|
300733
|
+
return;
|
|
300734
|
+
}
|
|
300735
|
+
for (const disposer of entry.ongoingComputationDisposers) {
|
|
300736
|
+
disposer.next();
|
|
300737
|
+
}
|
|
300738
|
+
this._currentSelection.delete(storedLevel);
|
|
300739
|
+
});
|
|
300740
|
+
}
|
|
300741
|
+
addDisposer(level, disposer) {
|
|
300742
|
+
const entry = this._currentSelection.get(level);
|
|
300743
|
+
if (!entry) {
|
|
300744
|
+
this._currentSelection.set(level, { value: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(), ongoingComputationDisposers: new Set([disposer]) });
|
|
300745
|
+
return;
|
|
300746
|
+
}
|
|
300747
|
+
entry.ongoingComputationDisposers.add(disposer);
|
|
300748
|
+
}
|
|
300749
|
+
setSelection(level, keys, disposer) {
|
|
300750
|
+
const currEntry = this._currentSelection.get(level);
|
|
300751
|
+
// istanbul ignore else
|
|
300752
|
+
if (currEntry) {
|
|
300753
|
+
currEntry.ongoingComputationDisposers.delete(disposer);
|
|
300754
|
+
}
|
|
300755
|
+
this._currentSelection.set(level, {
|
|
300756
|
+
value: keys,
|
|
300757
|
+
ongoingComputationDisposers: currEntry?.ongoingComputationDisposers ?? /* istanbul ignore next */ new Set(),
|
|
300758
|
+
});
|
|
300759
|
+
}
|
|
300760
|
+
computeSelection(level, currSelectables, changedSelectables) {
|
|
300761
|
+
this.clearSelections(level);
|
|
300762
|
+
const prevComputationsDisposers = [...(this._currentSelection.get(level)?.ongoingComputationDisposers ?? [])];
|
|
300763
|
+
const currDisposer = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
|
|
300764
|
+
this.addDisposer(level, currDisposer);
|
|
300765
|
+
return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.defer)(async () => {
|
|
300766
|
+
const convertedSelectables = [];
|
|
300767
|
+
const [current, changed] = await Promise.all([
|
|
300768
|
+
selectablesToKeys(currSelectables, convertedSelectables),
|
|
300769
|
+
selectablesToKeys(changedSelectables, convertedSelectables),
|
|
300770
|
+
]);
|
|
300771
|
+
const currentSelection = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([...current.keys, ...current.selectableKeys.flatMap((selectable) => selectable.keys)]);
|
|
300772
|
+
const changedSelection = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([...changed.keys, ...changed.selectableKeys.flatMap((selectable) => selectable.keys)]);
|
|
300773
|
+
return {
|
|
300774
|
+
level,
|
|
300775
|
+
currentSelection,
|
|
300776
|
+
changedSelection,
|
|
300777
|
+
};
|
|
300778
|
+
}).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(currDisposer), (0,rxjs__WEBPACK_IMPORTED_MODULE_14__.tap)({
|
|
300779
|
+
next: (val) => {
|
|
300780
|
+
prevComputationsDisposers.forEach((disposer) => disposer.next());
|
|
300781
|
+
this.setSelection(val.level, val.currentSelection, currDisposer);
|
|
300782
|
+
},
|
|
300783
|
+
}));
|
|
300784
|
+
}
|
|
300785
|
+
}
|
|
300786
|
+
function keysToSelectable(imodel, keys) {
|
|
300787
|
+
const selectables = [];
|
|
300788
|
+
keys.forEach((key) => {
|
|
300789
|
+
if ("id" in key) {
|
|
300790
|
+
selectables.push(key);
|
|
300791
|
+
return;
|
|
300792
|
+
}
|
|
300793
|
+
const customSelectable = {
|
|
300794
|
+
identifier: key.pathFromRoot.join("/"),
|
|
300795
|
+
data: key,
|
|
300796
|
+
loadInstanceKeys: () => createInstanceKeysIterator(imodel, key),
|
|
300797
|
+
};
|
|
300798
|
+
selectables.push(customSelectable);
|
|
300799
|
+
});
|
|
300800
|
+
return selectables;
|
|
300801
|
+
}
|
|
300802
|
+
async function selectablesToKeys(selectables, convertedList) {
|
|
300803
|
+
const keys = [];
|
|
300804
|
+
const selectableKeys = [];
|
|
300805
|
+
for (const [className, ids] of selectables.instanceKeys) {
|
|
300806
|
+
for (const id of ids) {
|
|
300807
|
+
keys.push({ id, className });
|
|
300808
|
+
}
|
|
300809
|
+
}
|
|
300810
|
+
for (const [_, selectable] of selectables.custom) {
|
|
300811
|
+
if (isNodeKey(selectable.data)) {
|
|
300812
|
+
selectableKeys.push({ identifier: selectable.identifier, keys: [selectable.data] });
|
|
300813
|
+
continue;
|
|
300814
|
+
}
|
|
300815
|
+
const converted = convertedList.find((con) => con.identifier === selectable.identifier);
|
|
300816
|
+
if (converted) {
|
|
300817
|
+
selectableKeys.push(converted);
|
|
300818
|
+
continue;
|
|
300819
|
+
}
|
|
300820
|
+
const newConverted = { identifier: selectable.identifier, keys: [] };
|
|
300821
|
+
convertedList.push(newConverted);
|
|
300822
|
+
for await (const instanceKey of selectable.loadInstanceKeys()) {
|
|
300823
|
+
newConverted.keys.push(instanceKey);
|
|
300824
|
+
}
|
|
300825
|
+
selectableKeys.push(newConverted);
|
|
300826
|
+
}
|
|
300827
|
+
return { keys, selectableKeys };
|
|
300828
|
+
}
|
|
300829
|
+
async function* createInstanceKeysIterator(imodel, nodeKey) {
|
|
300830
|
+
if (_itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.NodeKey.isInstancesNodeKey(nodeKey)) {
|
|
300831
|
+
for (const key of nodeKey.instanceKeys) {
|
|
300832
|
+
yield key;
|
|
300833
|
+
}
|
|
300834
|
+
return;
|
|
300835
|
+
}
|
|
300836
|
+
const content = await _Presentation__WEBPACK_IMPORTED_MODULE_4__.Presentation.presentation.getContentInstanceKeys({
|
|
300837
|
+
imodel,
|
|
300838
|
+
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([nodeKey]),
|
|
300839
|
+
rulesetOrId: {
|
|
300840
|
+
id: "grouped-instances",
|
|
300841
|
+
rules: [
|
|
300842
|
+
{
|
|
300843
|
+
ruleType: "Content",
|
|
300844
|
+
specifications: [
|
|
300845
|
+
{
|
|
300846
|
+
specType: "SelectedNodeInstances",
|
|
300847
|
+
},
|
|
300848
|
+
],
|
|
300849
|
+
},
|
|
300850
|
+
],
|
|
300851
|
+
},
|
|
300852
|
+
});
|
|
300853
|
+
for await (const key of content.items()) {
|
|
300854
|
+
yield key;
|
|
300855
|
+
}
|
|
300856
|
+
}
|
|
300857
|
+
function isNodeKey(data) {
|
|
300858
|
+
const key = data;
|
|
300859
|
+
return key.pathFromRoot !== undefined && key.type !== undefined;
|
|
300860
|
+
}
|
|
300861
|
+
function getChangeType(type) {
|
|
300862
|
+
switch (type) {
|
|
300863
|
+
case "add":
|
|
300864
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add;
|
|
300865
|
+
case "remove":
|
|
300866
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove;
|
|
300867
|
+
case "replace":
|
|
300868
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace;
|
|
300869
|
+
case "clear":
|
|
300870
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear;
|
|
300871
|
+
}
|
|
300872
|
+
}
|
|
299912
300873
|
|
|
299913
300874
|
|
|
299914
300875
|
/***/ }),
|
|
@@ -309621,7 +310582,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
309621
310582
|
/***/ ((module) => {
|
|
309622
310583
|
|
|
309623
310584
|
"use strict";
|
|
309624
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.6.0-dev.
|
|
310585
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.6.0-dev.5","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.5","@itwin/core-bentley":"workspace:^4.6.0-dev.5","@itwin/core-common":"workspace:^4.6.0-dev.5","@itwin/core-geometry":"workspace:^4.6.0-dev.5","@itwin/core-orbitgt":"workspace:^4.6.0-dev.5","@itwin/core-quantity":"workspace:^4.6.0-dev.5"},"//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"}}');
|
|
309625
310586
|
|
|
309626
310587
|
/***/ }),
|
|
309627
310588
|
|