@itwin/rpcinterface-full-stack-tests 5.8.0-dev.13 → 5.8.0-dev.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/bundled-tests.js +516 -120
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_4_3_4__loaders_gl_core_4_3_4_node_modu-4c1fc9.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -142113,6 +142113,7 @@ class Parser {
|
|
|
142113
142113
|
prevIndices: p.polyline.prevIndices.data,
|
|
142114
142114
|
nextIndicesAndParams: p.polyline.nextIndicesAndParams,
|
|
142115
142115
|
},
|
|
142116
|
+
hasCumulativeDistances: p.hasCumulativeDistances,
|
|
142116
142117
|
},
|
|
142117
142118
|
});
|
|
142118
142119
|
}
|
|
@@ -142328,6 +142329,7 @@ class Parser {
|
|
|
142328
142329
|
type,
|
|
142329
142330
|
weight: displayParams.width,
|
|
142330
142331
|
linePixels: displayParams.linePixels,
|
|
142332
|
+
hasCumulativeDistances: false,
|
|
142331
142333
|
},
|
|
142332
142334
|
};
|
|
142333
142335
|
}
|
|
@@ -144615,9 +144617,17 @@ class InstancedGraphicPropsBuilder {
|
|
|
144615
144617
|
"use strict";
|
|
144616
144618
|
__webpack_require__.r(__webpack_exports__);
|
|
144617
144619
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
144618
|
-
/* harmony export */
|
|
144620
|
+
/* harmony export */ getLineCodePatterns: () => (/* binding */ getLineCodePatterns),
|
|
144621
|
+
/* harmony export */ initializeDefaultPatterns: () => (/* binding */ initializeDefaultPatterns),
|
|
144622
|
+
/* harmony export */ initializeLineCodeCapacity: () => (/* binding */ initializeLineCodeCapacity),
|
|
144623
|
+
/* harmony export */ lineCodeFromLinePixels: () => (/* binding */ lineCodeFromLinePixels),
|
|
144624
|
+
/* harmony export */ lineCodeTextureCapacity: () => (/* binding */ lineCodeTextureCapacity),
|
|
144625
|
+
/* harmony export */ lineCodeTextureSize: () => (/* binding */ lineCodeTextureSize),
|
|
144626
|
+
/* harmony export */ onLineCodeAssigned: () => (/* binding */ onLineCodeAssigned),
|
|
144627
|
+
/* harmony export */ resetLineCodeState: () => (/* binding */ resetLineCodeState)
|
|
144619
144628
|
/* harmony export */ });
|
|
144620
|
-
/* harmony import */ var
|
|
144629
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
144630
|
+
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
144621
144631
|
/*---------------------------------------------------------------------------------------------
|
|
144622
144632
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
144623
144633
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -144626,24 +144636,108 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
144626
144636
|
* @module WebGL
|
|
144627
144637
|
*/
|
|
144628
144638
|
|
|
144629
|
-
|
|
144630
|
-
|
|
144639
|
+
|
|
144640
|
+
const textureSize = 32;
|
|
144641
|
+
// Initial capacity - will be updated to System.maxTextureSize in initializeLineCodeCapacity().
|
|
144642
|
+
// This value is used only for tests that don't initialize the full System.
|
|
144643
|
+
let maxLineCodeSlots = 16384;
|
|
144644
|
+
const patternToCode = new Map();
|
|
144645
|
+
const patterns = [];
|
|
144646
|
+
const assignmentEvent = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
144647
|
+
let defaultPatternsInitialized = false;
|
|
144648
|
+
/** Initialize the maximum line code slots based on System's maxTextureSize.
|
|
144649
|
+
* Must be called before initializeDefaultPatterns().
|
|
144650
|
+
* @internal
|
|
144631
144651
|
*/
|
|
144632
|
-
function
|
|
144652
|
+
function initializeLineCodeCapacity(maxTexSize) {
|
|
144653
|
+
// Cap at the smaller of maxTextureSize or theoretical maximum (65,536)
|
|
144654
|
+
maxLineCodeSlots = Math.min(maxTexSize, 65536);
|
|
144655
|
+
}
|
|
144656
|
+
const defaultPatterns = [
|
|
144657
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Solid,
|
|
144658
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code1,
|
|
144659
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code2,
|
|
144660
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code3,
|
|
144661
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code4,
|
|
144662
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code5,
|
|
144663
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code6,
|
|
144664
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code7,
|
|
144665
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.HiddenLine,
|
|
144666
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Invisible,
|
|
144667
|
+
];
|
|
144668
|
+
function normalizePatternValue(pixels) {
|
|
144633
144669
|
switch (pixels) {
|
|
144634
|
-
case
|
|
144635
|
-
|
|
144636
|
-
case
|
|
144637
|
-
case
|
|
144638
|
-
|
|
144639
|
-
|
|
144640
|
-
|
|
144641
|
-
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.LinePixels.Code7: return 7;
|
|
144642
|
-
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.LinePixels.HiddenLine: return 8;
|
|
144643
|
-
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.LinePixels.Invisible: return 9;
|
|
144644
|
-
default: return 0;
|
|
144670
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Invalid:
|
|
144671
|
+
return normalizePatternValue(_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Solid);
|
|
144672
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Solid:
|
|
144673
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.LinePixels.Code0:
|
|
144674
|
+
return 0xffffffff;
|
|
144675
|
+
default:
|
|
144676
|
+
return pixels >>> 0;
|
|
144645
144677
|
}
|
|
144646
144678
|
}
|
|
144679
|
+
function assignCodeForPattern(pattern) {
|
|
144680
|
+
const normalized = pattern >>> 0;
|
|
144681
|
+
const existing = patternToCode.get(normalized);
|
|
144682
|
+
if (undefined !== existing)
|
|
144683
|
+
return existing;
|
|
144684
|
+
if (patterns.length >= maxLineCodeSlots) {
|
|
144685
|
+
// Exceeded maximum supported line patterns
|
|
144686
|
+
return 0;
|
|
144687
|
+
}
|
|
144688
|
+
const code = patterns.length;
|
|
144689
|
+
patterns.push(normalized);
|
|
144690
|
+
patternToCode.set(normalized, code);
|
|
144691
|
+
assignmentEvent.raiseEvent({ code, pattern: normalized });
|
|
144692
|
+
return code;
|
|
144693
|
+
}
|
|
144694
|
+
/** Initialize default line patterns. Called when System is ready.
|
|
144695
|
+
* @internal
|
|
144696
|
+
*/
|
|
144697
|
+
function initializeDefaultPatterns() {
|
|
144698
|
+
if (defaultPatternsInitialized)
|
|
144699
|
+
return;
|
|
144700
|
+
defaultPatternsInitialized = true;
|
|
144701
|
+
for (const pattern of defaultPatterns) {
|
|
144702
|
+
const normalized = normalizePatternValue(pattern);
|
|
144703
|
+
if (undefined !== normalized)
|
|
144704
|
+
assignCodeForPattern(normalized);
|
|
144705
|
+
}
|
|
144706
|
+
}
|
|
144707
|
+
/** Reset initialization state - used when System reinitializes.
|
|
144708
|
+
* @internal
|
|
144709
|
+
*/
|
|
144710
|
+
function resetLineCodeState() {
|
|
144711
|
+
patternToCode.clear();
|
|
144712
|
+
patterns.length = 0;
|
|
144713
|
+
defaultPatternsInitialized = false;
|
|
144714
|
+
}
|
|
144715
|
+
/** Map a LinePixels value to a texture row index that identifies the corresponding pattern. */
|
|
144716
|
+
function lineCodeFromLinePixels(pixels) {
|
|
144717
|
+
// Ensure default patterns are initialized (for tests that don't call System.onInitialized)
|
|
144718
|
+
initializeDefaultPatterns();
|
|
144719
|
+
const normalized = normalizePatternValue(pixels);
|
|
144720
|
+
if (undefined === normalized)
|
|
144721
|
+
return 0;
|
|
144722
|
+
return assignCodeForPattern(normalized);
|
|
144723
|
+
}
|
|
144724
|
+
/** @internal */
|
|
144725
|
+
function onLineCodeAssigned(listener) {
|
|
144726
|
+
assignmentEvent.addListener(listener);
|
|
144727
|
+
return () => assignmentEvent.removeListener(listener);
|
|
144728
|
+
}
|
|
144729
|
+
/** @internal */
|
|
144730
|
+
function getLineCodePatterns() {
|
|
144731
|
+
return patterns;
|
|
144732
|
+
}
|
|
144733
|
+
/** @internal */
|
|
144734
|
+
const lineCodeTextureSize = textureSize;
|
|
144735
|
+
/** Get the current capacity of the line code texture.
|
|
144736
|
+
* @internal
|
|
144737
|
+
*/
|
|
144738
|
+
function lineCodeTextureCapacity() {
|
|
144739
|
+
return maxLineCodeSlots;
|
|
144740
|
+
}
|
|
144647
144741
|
|
|
144648
144742
|
|
|
144649
144743
|
/***/ }),
|
|
@@ -145298,6 +145392,7 @@ function createPolylineArgs(mesh) {
|
|
|
145298
145392
|
points: mesh.points,
|
|
145299
145393
|
colors,
|
|
145300
145394
|
features,
|
|
145395
|
+
cumulativeDistances: mesh.cumulativeDistances,
|
|
145301
145396
|
};
|
|
145302
145397
|
}
|
|
145303
145398
|
/** The vertices of the edges are shared with those of the surface. */
|
|
@@ -145362,6 +145457,7 @@ class Mesh {
|
|
|
145362
145457
|
uvParams = [];
|
|
145363
145458
|
colorMap = new _ColorMap__WEBPACK_IMPORTED_MODULE_3__.ColorMap(); // used to be called ColorTable
|
|
145364
145459
|
colors = [];
|
|
145460
|
+
cumulativeDistances;
|
|
145365
145461
|
edges;
|
|
145366
145462
|
features;
|
|
145367
145463
|
type;
|
|
@@ -145854,6 +145950,7 @@ function createPolylineParams(args, maxDimension) {
|
|
|
145854
145950
|
type: args.flags.type ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.PolylineTypeFlags.Normal,
|
|
145855
145951
|
weight: args.width,
|
|
145856
145952
|
linePixels: args.linePixels,
|
|
145953
|
+
hasCumulativeDistances: (args.cumulativeDistances?.length ?? 0) > 0,
|
|
145857
145954
|
};
|
|
145858
145955
|
}
|
|
145859
145956
|
/** @internal */
|
|
@@ -146413,6 +146510,50 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
146413
146510
|
|
|
146414
146511
|
|
|
146415
146512
|
|
|
146513
|
+
const scratchU32 = new Uint32Array(1);
|
|
146514
|
+
const scratchF32 = new Float32Array(scratchU32.buffer);
|
|
146515
|
+
function floatToUint32(val) {
|
|
146516
|
+
scratchF32[0] = val;
|
|
146517
|
+
return scratchU32[0];
|
|
146518
|
+
}
|
|
146519
|
+
function computePolylineCumulativeDistances(args) {
|
|
146520
|
+
if (args.cumulativeDistances !== undefined)
|
|
146521
|
+
return args.cumulativeDistances;
|
|
146522
|
+
const positions = [];
|
|
146523
|
+
if (args.points instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QPoint3dList) {
|
|
146524
|
+
positions.length = args.points.length;
|
|
146525
|
+
for (let i = 0; i < args.points.length; i++)
|
|
146526
|
+
positions[i] = args.points.list[i].unquantize(args.points.params);
|
|
146527
|
+
}
|
|
146528
|
+
else {
|
|
146529
|
+
positions.length = args.points.length;
|
|
146530
|
+
for (let i = 0; i < args.points.length; i++)
|
|
146531
|
+
positions[i] = args.points[i];
|
|
146532
|
+
}
|
|
146533
|
+
const cumulativeDistances = new Float32Array(positions.length);
|
|
146534
|
+
cumulativeDistances.fill(Number.NaN);
|
|
146535
|
+
for (const line of args.polylines) {
|
|
146536
|
+
if (line.length < 2)
|
|
146537
|
+
continue;
|
|
146538
|
+
let dist = 0.0;
|
|
146539
|
+
for (let i = 0; i < line.length; i++) {
|
|
146540
|
+
const idx = line[i];
|
|
146541
|
+
if (i > 0) {
|
|
146542
|
+
const p0 = positions[line[i - 1]];
|
|
146543
|
+
const p1 = positions[idx];
|
|
146544
|
+
dist += p0.distance(p1);
|
|
146545
|
+
}
|
|
146546
|
+
// Preserve the first assignment if a vertex is shared across lines.
|
|
146547
|
+
if (Number.isNaN(cumulativeDistances[idx]))
|
|
146548
|
+
cumulativeDistances[idx] = dist;
|
|
146549
|
+
}
|
|
146550
|
+
}
|
|
146551
|
+
for (let i = 0; i < cumulativeDistances.length; i++) {
|
|
146552
|
+
if (Number.isNaN(cumulativeDistances[i]))
|
|
146553
|
+
cumulativeDistances[i] = 0.0;
|
|
146554
|
+
}
|
|
146555
|
+
return cumulativeDistances;
|
|
146556
|
+
}
|
|
146416
146557
|
/** @internal */
|
|
146417
146558
|
function createMeshParams(args, maxDimension, enableIndexedEdges) {
|
|
146418
146559
|
const builder = createMeshBuilder(args);
|
|
@@ -146583,6 +146724,23 @@ var Quantized;
|
|
|
146583
146724
|
}
|
|
146584
146725
|
}
|
|
146585
146726
|
Quantized.SimpleBuilder = SimpleBuilder;
|
|
146727
|
+
class PolylineBuilder extends SimpleBuilder {
|
|
146728
|
+
_cumDist;
|
|
146729
|
+
constructor(args) {
|
|
146730
|
+
super(args);
|
|
146731
|
+
this._cumDist = computePolylineCumulativeDistances(args);
|
|
146732
|
+
}
|
|
146733
|
+
get numRgbaPerVertex() { return 4; }
|
|
146734
|
+
appendVertex(vertIndex) {
|
|
146735
|
+
super.appendVertex(vertIndex);
|
|
146736
|
+
this.appendCumulativeDistance(vertIndex);
|
|
146737
|
+
}
|
|
146738
|
+
appendCumulativeDistance(vertIndex) {
|
|
146739
|
+
const dist = vertIndex < this._cumDist.length ? this._cumDist[vertIndex] : 0.0;
|
|
146740
|
+
this.append32(floatToUint32(dist));
|
|
146741
|
+
}
|
|
146742
|
+
}
|
|
146743
|
+
Quantized.PolylineBuilder = PolylineBuilder;
|
|
146586
146744
|
/** Supplies vertex data from a MeshArgs. */
|
|
146587
146745
|
class MeshBuilder extends SimpleBuilder {
|
|
146588
146746
|
type;
|
|
@@ -146761,6 +146919,23 @@ var Unquantized;
|
|
|
146761
146919
|
}
|
|
146762
146920
|
}
|
|
146763
146921
|
Unquantized.SimpleBuilder = SimpleBuilder;
|
|
146922
|
+
class PolylineBuilder extends SimpleBuilder {
|
|
146923
|
+
_cumDist;
|
|
146924
|
+
constructor(args) {
|
|
146925
|
+
super(args);
|
|
146926
|
+
this._cumDist = computePolylineCumulativeDistances(args);
|
|
146927
|
+
}
|
|
146928
|
+
get numRgbaPerVertex() { return 6; }
|
|
146929
|
+
appendVertex(vertIndex) {
|
|
146930
|
+
super.appendVertex(vertIndex);
|
|
146931
|
+
this.appendCumulativeDistance(vertIndex);
|
|
146932
|
+
}
|
|
146933
|
+
appendCumulativeDistance(vertIndex) {
|
|
146934
|
+
const dist = vertIndex < this._cumDist.length ? this._cumDist[vertIndex] : 0.0;
|
|
146935
|
+
this.append32(floatToUint32(dist));
|
|
146936
|
+
}
|
|
146937
|
+
}
|
|
146938
|
+
Unquantized.PolylineBuilder = PolylineBuilder;
|
|
146764
146939
|
class MeshBuilder extends SimpleBuilder {
|
|
146765
146940
|
type;
|
|
146766
146941
|
constructor(args, type) {
|
|
@@ -146851,10 +147026,15 @@ function createMeshBuilder(args) {
|
|
|
146851
147026
|
return Unquantized.MeshBuilder.create(args);
|
|
146852
147027
|
}
|
|
146853
147028
|
function createPolylineBuilder(args) {
|
|
146854
|
-
|
|
146855
|
-
|
|
146856
|
-
|
|
146857
|
-
|
|
147029
|
+
const quantized = args.points instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QPoint3dList;
|
|
147030
|
+
if (args.flags.isDisjoint) {
|
|
147031
|
+
return quantized
|
|
147032
|
+
? new Quantized.SimpleBuilder(args)
|
|
147033
|
+
: new Unquantized.SimpleBuilder(args);
|
|
147034
|
+
}
|
|
147035
|
+
return quantized
|
|
147036
|
+
? new Quantized.PolylineBuilder(args)
|
|
147037
|
+
: new Unquantized.PolylineBuilder(args);
|
|
146858
147038
|
}
|
|
146859
147039
|
|
|
146860
147040
|
|
|
@@ -154236,6 +154416,7 @@ class CachedGeometry {
|
|
|
154236
154416
|
get viewIndependentOrigin() { return undefined; }
|
|
154237
154417
|
get isViewIndependent() { return undefined !== this.viewIndependentOrigin; }
|
|
154238
154418
|
get supportsThematicDisplay() { return false; }
|
|
154419
|
+
get hasCumulativeDistances() { return false; }
|
|
154239
154420
|
get isEdge() {
|
|
154240
154421
|
switch (this.renderOrder) {
|
|
154241
154422
|
case 6 /* RenderOrder.Edge */:
|
|
@@ -159972,7 +160153,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
159972
160153
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
159973
160154
|
/* harmony export */ LineCode: () => (/* binding */ LineCode)
|
|
159974
160155
|
/* harmony export */ });
|
|
159975
|
-
/* harmony import */ var
|
|
160156
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
160157
|
+
/* harmony import */ var _common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/internal/render/LineCode */ "../../core/frontend/lib/esm/common/internal/render/LineCode.js");
|
|
159976
160158
|
/*---------------------------------------------------------------------------------------------
|
|
159977
160159
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
159978
160160
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -159981,38 +160163,71 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
159981
160163
|
* @module WebGL
|
|
159982
160164
|
*/
|
|
159983
160165
|
|
|
160166
|
+
|
|
159984
160167
|
/** Describes one of the pre-defined line patterns. See Render.LinePixels.
|
|
159985
160168
|
* @internal
|
|
159986
160169
|
*/
|
|
159987
160170
|
var LineCode;
|
|
159988
160171
|
(function (LineCode) {
|
|
159989
160172
|
function valueFromLinePixels(pixels) {
|
|
159990
|
-
return (0,
|
|
160173
|
+
return (0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.lineCodeFromLinePixels)(pixels);
|
|
159991
160174
|
}
|
|
159992
160175
|
LineCode.valueFromLinePixels = valueFromLinePixels;
|
|
160176
|
+
function initializeCapacity(maxTexSize) {
|
|
160177
|
+
(0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.initializeLineCodeCapacity)(maxTexSize);
|
|
160178
|
+
// Recreate texture data array with the new capacity
|
|
160179
|
+
textureData = new Uint8Array(LineCode.size * capacity());
|
|
160180
|
+
// Reset and reassign default patterns with new capacity
|
|
160181
|
+
isInitializing = true;
|
|
160182
|
+
(0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.resetLineCodeState)();
|
|
160183
|
+
(0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.initializeDefaultPatterns)();
|
|
160184
|
+
isInitializing = false;
|
|
160185
|
+
}
|
|
160186
|
+
LineCode.initializeCapacity = initializeCapacity;
|
|
159993
160187
|
LineCode.solid = 0;
|
|
159994
|
-
LineCode.
|
|
159995
|
-
|
|
159996
|
-
|
|
159997
|
-
|
|
159998
|
-
LineCode.
|
|
159999
|
-
|
|
160000
|
-
|
|
160001
|
-
|
|
160002
|
-
|
|
160003
|
-
|
|
160004
|
-
|
|
160005
|
-
|
|
160006
|
-
|
|
160007
|
-
|
|
160008
|
-
|
|
160009
|
-
|
|
160010
|
-
|
|
160011
|
-
|
|
160012
|
-
|
|
160013
|
-
|
|
160014
|
-
|
|
160015
|
-
|
|
160188
|
+
LineCode.size = _common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.lineCodeTextureSize;
|
|
160189
|
+
function capacity() {
|
|
160190
|
+
return (0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.lineCodeTextureCapacity)();
|
|
160191
|
+
}
|
|
160192
|
+
LineCode.capacity = capacity;
|
|
160193
|
+
let textureData;
|
|
160194
|
+
const textureUpdated = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
160195
|
+
// Initialize with default capacity for tests that don't create a full System
|
|
160196
|
+
function ensureTextureData() {
|
|
160197
|
+
if (undefined === textureData) {
|
|
160198
|
+
textureData = new Uint8Array(LineCode.size * capacity());
|
|
160199
|
+
(0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.initializeDefaultPatterns)();
|
|
160200
|
+
}
|
|
160201
|
+
}
|
|
160202
|
+
function writeRow(code, pattern) {
|
|
160203
|
+
ensureTextureData();
|
|
160204
|
+
if (code < 0 || code >= capacity())
|
|
160205
|
+
return;
|
|
160206
|
+
const offset = code * LineCode.size;
|
|
160207
|
+
for (let i = 0; i < LineCode.size; i++) {
|
|
160208
|
+
const bit = (pattern >>> i) & 0x1;
|
|
160209
|
+
const data = textureData;
|
|
160210
|
+
if (data)
|
|
160211
|
+
data[offset + i] = bit ? 0xff : 0x00;
|
|
160212
|
+
}
|
|
160213
|
+
}
|
|
160214
|
+
let isInitializing = false;
|
|
160215
|
+
(0,_common_internal_render_LineCode__WEBPACK_IMPORTED_MODULE_1__.onLineCodeAssigned)((args) => {
|
|
160216
|
+
writeRow(args.code, args.pattern);
|
|
160217
|
+
if (!isInitializing)
|
|
160218
|
+
textureUpdated.raiseEvent();
|
|
160219
|
+
});
|
|
160220
|
+
function getTextureData() {
|
|
160221
|
+
ensureTextureData();
|
|
160222
|
+
// textureData is guaranteed to be defined after ensureTextureData()
|
|
160223
|
+
return textureData ?? new Uint8Array(0);
|
|
160224
|
+
}
|
|
160225
|
+
LineCode.getTextureData = getTextureData;
|
|
160226
|
+
function onTextureUpdated(listener) {
|
|
160227
|
+
textureUpdated.addListener(listener);
|
|
160228
|
+
return () => textureUpdated.removeListener(listener);
|
|
160229
|
+
}
|
|
160230
|
+
LineCode.onTextureUpdated = onTextureUpdated;
|
|
160016
160231
|
})(LineCode || (LineCode = {}));
|
|
160017
160232
|
|
|
160018
160233
|
|
|
@@ -162363,6 +162578,7 @@ class PolylineGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_3__.LUTG
|
|
|
162363
162578
|
lut;
|
|
162364
162579
|
numIndices;
|
|
162365
162580
|
_buffers;
|
|
162581
|
+
_hasCumulativeDistances;
|
|
162366
162582
|
get lutBuffers() { return this._buffers.buffers; }
|
|
162367
162583
|
constructor(lut, buffers, params, viOrigin) {
|
|
162368
162584
|
super(viOrigin);
|
|
@@ -162376,6 +162592,7 @@ class PolylineGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_3__.LUTG
|
|
|
162376
162592
|
this.lut = lut;
|
|
162377
162593
|
this.numIndices = params.polyline.indices.length;
|
|
162378
162594
|
this._buffers = buffers;
|
|
162595
|
+
this._hasCumulativeDistances = params.hasCumulativeDistances;
|
|
162379
162596
|
}
|
|
162380
162597
|
get isDisposed() { return this._buffers.isDisposed && this.lut.isDisposed; }
|
|
162381
162598
|
[Symbol.dispose]() {
|
|
@@ -162426,6 +162643,7 @@ class PolylineGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_3__.LUTG
|
|
|
162426
162643
|
get qScale() { return this.lut.qScale; }
|
|
162427
162644
|
get numRgbaPerVertex() { return this.lut.numRgbaPerVertex; }
|
|
162428
162645
|
get hasFeatures() { return this._hasFeatures; }
|
|
162646
|
+
get hasCumulativeDistances() { return this._hasCumulativeDistances; }
|
|
162429
162647
|
_getLineWeight(params) {
|
|
162430
162648
|
return this.isEdge ? params.target.computeEdgeWeight(params.renderPass, this.lineWeight) : this.lineWeight;
|
|
162431
162649
|
}
|
|
@@ -169604,6 +169822,7 @@ class System extends _render_RenderSystem__WEBPACK_IMPORTED_MODULE_9__.RenderSys
|
|
|
169604
169822
|
];
|
|
169605
169823
|
// The following are initialized immediately after the System is constructed.
|
|
169606
169824
|
_lineCodeTexture;
|
|
169825
|
+
_lineCodeTextureListener;
|
|
169607
169826
|
_noiseTexture;
|
|
169608
169827
|
_techniques;
|
|
169609
169828
|
_screenSpaceEffects;
|
|
@@ -169694,6 +169913,10 @@ class System extends _render_RenderSystem__WEBPACK_IMPORTED_MODULE_9__.RenderSys
|
|
|
169694
169913
|
this._techniques = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._techniques);
|
|
169695
169914
|
this._screenSpaceEffects = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._screenSpaceEffects);
|
|
169696
169915
|
this._lineCodeTexture = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._lineCodeTexture);
|
|
169916
|
+
if (this._lineCodeTextureListener) {
|
|
169917
|
+
this._lineCodeTextureListener();
|
|
169918
|
+
this._lineCodeTextureListener = undefined;
|
|
169919
|
+
}
|
|
169697
169920
|
this._noiseTexture = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._noiseTexture);
|
|
169698
169921
|
// We must attempt to dispose of each idmap in the resourceCache (if idmap is already disposed, has no effect)
|
|
169699
169922
|
this.resourceCache.forEach((idMap) => {
|
|
@@ -169705,14 +169928,23 @@ class System extends _render_RenderSystem__WEBPACK_IMPORTED_MODULE_9__.RenderSys
|
|
|
169705
169928
|
this._removeEventListener = undefined;
|
|
169706
169929
|
}
|
|
169707
169930
|
}
|
|
169931
|
+
reloadLineCodeTexture() {
|
|
169932
|
+
if (!this._lineCodeTexture)
|
|
169933
|
+
return;
|
|
169934
|
+
const params = _Texture__WEBPACK_IMPORTED_MODULE_36__.Texture2DCreateParams.createForData(_LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.size, _LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.capacity(), _LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.getTextureData(), true, _GL__WEBPACK_IMPORTED_MODULE_16__.GL.Texture.WrapMode.Repeat, _GL__WEBPACK_IMPORTED_MODULE_16__.GL.Texture.Format.Luminance);
|
|
169935
|
+
this._lineCodeTexture.reload(params);
|
|
169936
|
+
}
|
|
169708
169937
|
onInitialized() {
|
|
169938
|
+
// Initialize LineCode capacity BEFORE creating techniques (which compile shaders that use the capacity)
|
|
169939
|
+
_LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.initializeCapacity(this.maxTextureSize);
|
|
169709
169940
|
this._techniques = _Technique__WEBPACK_IMPORTED_MODULE_35__.Techniques.create(this.context);
|
|
169710
169941
|
const noiseDim = 4;
|
|
169711
169942
|
const noiseArr = new Uint8Array([152, 235, 94, 173, 219, 215, 115, 176, 73, 205, 43, 201, 10, 81, 205, 198]);
|
|
169712
169943
|
this._noiseTexture = _Texture__WEBPACK_IMPORTED_MODULE_36__.TextureHandle.createForData(noiseDim, noiseDim, noiseArr, false, _GL__WEBPACK_IMPORTED_MODULE_16__.GL.Texture.WrapMode.Repeat, _GL__WEBPACK_IMPORTED_MODULE_16__.GL.Texture.Format.Luminance);
|
|
169713
169944
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._noiseTexture, "System.noiseTexture not created.");
|
|
169714
|
-
this._lineCodeTexture = _Texture__WEBPACK_IMPORTED_MODULE_36__.TextureHandle.createForData(_LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.size, _LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.
|
|
169945
|
+
this._lineCodeTexture = _Texture__WEBPACK_IMPORTED_MODULE_36__.TextureHandle.createForData(_LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.size, _LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.capacity(), _LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.getTextureData(), true, _GL__WEBPACK_IMPORTED_MODULE_16__.GL.Texture.WrapMode.Repeat, _GL__WEBPACK_IMPORTED_MODULE_16__.GL.Texture.Format.Luminance);
|
|
169715
169946
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._lineCodeTexture, "System.lineCodeTexture not created.");
|
|
169947
|
+
this._lineCodeTextureListener = _LineCode__WEBPACK_IMPORTED_MODULE_21__.LineCode.onTextureUpdated(() => this.reloadLineCodeTexture());
|
|
169716
169948
|
this._screenSpaceEffects = new _ScreenSpaceEffect__WEBPACK_IMPORTED_MODULE_33__.ScreenSpaceEffects();
|
|
169717
169949
|
}
|
|
169718
169950
|
createTarget(canvas) {
|
|
@@ -172955,6 +173187,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
172955
173187
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
172956
173188
|
/* harmony export */ ExternalTextureLoader: () => (/* binding */ ExternalTextureLoader),
|
|
172957
173189
|
/* harmony export */ Texture: () => (/* binding */ Texture),
|
|
173190
|
+
/* harmony export */ Texture2DCreateParams: () => (/* binding */ Texture2DCreateParams),
|
|
172958
173191
|
/* harmony export */ Texture2DDataUpdater: () => (/* binding */ Texture2DDataUpdater),
|
|
172959
173192
|
/* harmony export */ Texture2DHandle: () => (/* binding */ Texture2DHandle),
|
|
172960
173193
|
/* harmony export */ TextureCubeHandle: () => (/* binding */ TextureCubeHandle),
|
|
@@ -177611,7 +177844,7 @@ const computePosition = `
|
|
|
177611
177844
|
|
|
177612
177845
|
return pos;
|
|
177613
177846
|
`;
|
|
177614
|
-
const lineCodeArgs = "g_windowDir, g_windowPos, 0.0";
|
|
177847
|
+
const lineCodeArgs = "g_windowDir, g_windowPos, 0.0, 0.0";
|
|
177615
177848
|
const adjustContrast = `
|
|
177616
177849
|
float bgi = u_bgIntensity;
|
|
177617
177850
|
if (bgi < 0.0)
|
|
@@ -179948,14 +180181,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
179948
180181
|
/* harmony import */ var _RenderFlags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../RenderFlags */ "../../core/frontend/lib/esm/internal/render/webgl/RenderFlags.js");
|
|
179949
180182
|
/* harmony import */ var _ShaderBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ShaderBuilder */ "../../core/frontend/lib/esm/internal/render/webgl/ShaderBuilder.js");
|
|
179950
180183
|
/* harmony import */ var _System__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../System */ "../../core/frontend/lib/esm/internal/render/webgl/System.js");
|
|
179951
|
-
/* harmony import */ var
|
|
179952
|
-
/* harmony import */ var
|
|
179953
|
-
/* harmony import */ var
|
|
179954
|
-
/* harmony import */ var
|
|
179955
|
-
/* harmony import */ var
|
|
179956
|
-
/* harmony import */ var
|
|
179957
|
-
/* harmony import */ var
|
|
179958
|
-
/* harmony import */ var
|
|
180184
|
+
/* harmony import */ var _LineCode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../LineCode */ "../../core/frontend/lib/esm/internal/render/webgl/LineCode.js");
|
|
180185
|
+
/* harmony import */ var _Color__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Color */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Color.js");
|
|
180186
|
+
/* harmony import */ var _Edge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Edge */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Edge.js");
|
|
180187
|
+
/* harmony import */ var _Common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Common */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Common.js");
|
|
180188
|
+
/* harmony import */ var _Decode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Decode */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Decode.js");
|
|
180189
|
+
/* harmony import */ var _FeatureSymbology__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./FeatureSymbology */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/FeatureSymbology.js");
|
|
180190
|
+
/* harmony import */ var _Fragment__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Fragment */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Fragment.js");
|
|
180191
|
+
/* harmony import */ var _Vertex__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Vertex */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Vertex.js");
|
|
180192
|
+
/* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Viewport */ "../../core/frontend/lib/esm/internal/render/webgl/glsl/Viewport.js");
|
|
179959
180193
|
/*---------------------------------------------------------------------------------------------
|
|
179960
180194
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
179961
180195
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -179976,6 +180210,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
179976
180210
|
|
|
179977
180211
|
|
|
179978
180212
|
|
|
180213
|
+
|
|
179979
180214
|
const checkForDiscard = "return discardByLineCode;";
|
|
179980
180215
|
const applyLineCode = `
|
|
179981
180216
|
if (v_texc.x >= 0.0) { // v_texc = (-1,-1) for solid lines - don't bother with any of this
|
|
@@ -179998,7 +180233,7 @@ const applyLineCode = `
|
|
|
179998
180233
|
return baseColor;
|
|
179999
180234
|
`;
|
|
180000
180235
|
const computeTextureCoord = `
|
|
180001
|
-
vec2 computeLineCodeTextureCoords(vec2 windowDir, vec4 projPos, float adjust) {
|
|
180236
|
+
vec2 computeLineCodeTextureCoords(vec2 windowDir, vec4 projPos, float adjust, float patternDist) {
|
|
180002
180237
|
vec2 texc;
|
|
180003
180238
|
float lineCode = computeLineCode();
|
|
180004
180239
|
if (0.0 == lineCode) {
|
|
@@ -180008,22 +180243,65 @@ vec2 computeLineCodeTextureCoords(vec2 windowDir, vec4 projPos, float adjust) {
|
|
|
180008
180243
|
const float imagesPerPixel = 1.0/32.0;
|
|
180009
180244
|
const float textureCoordinateBase = 8192.0; // Temp workardound for clipping problem in perspective views (negative values don't seem to interpolate correctly).
|
|
180010
180245
|
|
|
180011
|
-
|
|
180012
|
-
|
|
180013
|
-
|
|
180014
|
-
|
|
180246
|
+
float patternDistPixels;
|
|
180247
|
+
if (u_useCumDist > 0.5) {
|
|
180248
|
+
patternDistPixels = patternDist * u_pixelsPerWorld;
|
|
180249
|
+
} else {
|
|
180250
|
+
if (abs(windowDir.x) > abs(windowDir.y))
|
|
180251
|
+
patternDistPixels = projPos.x + adjust * windowDir.x;
|
|
180252
|
+
else
|
|
180253
|
+
patternDistPixels = projPos.y + adjust * windowDir.y;
|
|
180254
|
+
}
|
|
180255
|
+
texc.x = textureCoordinateBase + imagesPerPixel * patternDistPixels;
|
|
180015
180256
|
|
|
180016
|
-
|
|
180017
|
-
|
|
180018
|
-
|
|
180019
|
-
|
|
180020
|
-
const float stepY = rowsPerCode/numRows;
|
|
180257
|
+
// Use uniform to support dynamic capacity based on System.maxTextureSize
|
|
180258
|
+
float numRows = u_numLineCodes;
|
|
180259
|
+
float centerY = 0.5 / numRows;
|
|
180260
|
+
float stepY = 1.0 / numRows;
|
|
180021
180261
|
texc.y = stepY * lineCode + centerY;
|
|
180022
180262
|
}
|
|
180023
180263
|
|
|
180024
180264
|
return texc;
|
|
180025
180265
|
}
|
|
180026
180266
|
`;
|
|
180267
|
+
function addPixelsPerWorldUniform(prog) {
|
|
180268
|
+
const addUniform = (shader) => {
|
|
180269
|
+
shader.addUniform("u_pixelsPerWorld", 2 /* VariableType.Float */, (prg) => {
|
|
180270
|
+
prg.addProgramUniform("u_pixelsPerWorld", (uniform, params) => {
|
|
180271
|
+
// Calculate pixels per world unit from viewport
|
|
180272
|
+
// For orthographic views this is constant and provides stable pattern scaling
|
|
180273
|
+
const vp = params.target.viewRect;
|
|
180274
|
+
// Default to 1.0 if we can't calculate (will use world units directly)
|
|
180275
|
+
let pixelsPerWorld = 1.0;
|
|
180276
|
+
// Get frustum planes: { top, bottom, left, right }
|
|
180277
|
+
const planes = params.target.uniforms.frustum.planes;
|
|
180278
|
+
const worldWidth = planes[3] - planes[2]; // right - left
|
|
180279
|
+
if (worldWidth > 0) {
|
|
180280
|
+
// worldWidth is the view width in world units
|
|
180281
|
+
pixelsPerWorld = vp.width / worldWidth;
|
|
180282
|
+
}
|
|
180283
|
+
uniform.setUniform1f(pixelsPerWorld);
|
|
180284
|
+
});
|
|
180285
|
+
});
|
|
180286
|
+
};
|
|
180287
|
+
addUniform(prog.vert);
|
|
180288
|
+
addUniform(prog.frag);
|
|
180289
|
+
}
|
|
180290
|
+
function addUseCumulativeDistanceUniform(prog) {
|
|
180291
|
+
prog.vert.addUniform("u_useCumDist", 2 /* VariableType.Float */, (prg) => {
|
|
180292
|
+
prg.addGraphicUniform("u_useCumDist", (uniform, params) => {
|
|
180293
|
+
uniform.setUniform1f(params.geometry.hasCumulativeDistances ? 1.0 : 0.0);
|
|
180294
|
+
});
|
|
180295
|
+
});
|
|
180296
|
+
}
|
|
180297
|
+
function addNumLineCodesUniform(prog) {
|
|
180298
|
+
prog.vert.addUniform("u_numLineCodes", 2 /* VariableType.Float */, (prg) => {
|
|
180299
|
+
prg.addProgramUniform("u_numLineCodes", (uniform, _params) => {
|
|
180300
|
+
// Pass the current LineCode capacity to the shader
|
|
180301
|
+
uniform.setUniform1f(_LineCode__WEBPACK_IMPORTED_MODULE_5__.LineCode.capacity());
|
|
180302
|
+
});
|
|
180303
|
+
});
|
|
180304
|
+
}
|
|
180027
180305
|
/** @internal */
|
|
180028
180306
|
const adjustWidth = `
|
|
180029
180307
|
void adjustWidth(inout float width, vec2 d2, vec2 org) {
|
|
@@ -180105,10 +180383,13 @@ function addLineCodeTexture(frag) {
|
|
|
180105
180383
|
function addLineCode(prog, args) {
|
|
180106
180384
|
const vert = prog.vert;
|
|
180107
180385
|
const frag = prog.frag;
|
|
180108
|
-
(0,
|
|
180386
|
+
(0,_Vertex__WEBPACK_IMPORTED_MODULE_12__.addLineCode)(vert);
|
|
180387
|
+
addPixelsPerWorldUniform(prog);
|
|
180388
|
+
addUseCumulativeDistanceUniform(prog);
|
|
180389
|
+
addNumLineCodesUniform(prog); // Add uniform for dynamic capacity
|
|
180109
180390
|
const funcCall = `computeLineCodeTextureCoords(${args})`;
|
|
180110
180391
|
prog.addFunctionComputedVaryingWithArgs("v_texc", 3 /* VariableType.Vec2 */, funcCall, computeTextureCoord);
|
|
180111
|
-
(0,
|
|
180392
|
+
(0,_Common__WEBPACK_IMPORTED_MODULE_8__.addFrustum)(prog);
|
|
180112
180393
|
addLineCodeTexture(prog.frag);
|
|
180113
180394
|
frag.set(3 /* FragmentShaderComponent.FinalizeBaseColor */, applyLineCode);
|
|
180114
180395
|
frag.set(4 /* FragmentShaderComponent.CheckForDiscard */, checkForDiscard);
|
|
@@ -180116,28 +180397,30 @@ function addLineCode(prog, args) {
|
|
|
180116
180397
|
}
|
|
180117
180398
|
function polylineAddLineCode(prog) {
|
|
180118
180399
|
addLineCode(prog, lineCodeArgs);
|
|
180119
|
-
(0,
|
|
180400
|
+
(0,_Vertex__WEBPACK_IMPORTED_MODULE_12__.addModelViewMatrix)(prog.vert);
|
|
180120
180401
|
}
|
|
180121
180402
|
function addCommon(prog) {
|
|
180122
180403
|
const vert = prog.vert;
|
|
180123
|
-
(0,
|
|
180124
|
-
(0,
|
|
180125
|
-
(0,
|
|
180126
|
-
(0,
|
|
180404
|
+
(0,_Viewport__WEBPACK_IMPORTED_MODULE_13__.addModelToWindowCoordinates)(vert); // adds u_mvp, u_viewportTransformation
|
|
180405
|
+
(0,_Vertex__WEBPACK_IMPORTED_MODULE_12__.addProjectionMatrix)(vert);
|
|
180406
|
+
(0,_Vertex__WEBPACK_IMPORTED_MODULE_12__.addModelViewMatrix)(vert);
|
|
180407
|
+
(0,_Viewport__WEBPACK_IMPORTED_MODULE_13__.addViewport)(vert);
|
|
180127
180408
|
vert.addGlobal("g_windowPos", 5 /* VariableType.Vec4 */);
|
|
180128
180409
|
vert.addGlobal("g_prevPos", 5 /* VariableType.Vec4 */);
|
|
180129
180410
|
vert.addGlobal("g_nextPos", 5 /* VariableType.Vec4 */);
|
|
180130
180411
|
vert.addGlobal("g_windowDir", 3 /* VariableType.Vec2 */);
|
|
180131
180412
|
vert.addInitializer(decodeAdjacentPositions);
|
|
180132
|
-
vert.addFunction(
|
|
180133
|
-
(0,
|
|
180413
|
+
vert.addFunction(_Decode__WEBPACK_IMPORTED_MODULE_9__.unquantize2d);
|
|
180414
|
+
(0,_Vertex__WEBPACK_IMPORTED_MODULE_12__.addLineWeight)(vert);
|
|
180134
180415
|
vert.addGlobal("miterAdjust", 2 /* VariableType.Float */, "0.0");
|
|
180416
|
+
prog.addVarying("v_patternDistance", 2 /* VariableType.Float */);
|
|
180135
180417
|
prog.addVarying("v_eyeSpace", 4 /* VariableType.Vec3 */);
|
|
180136
|
-
vert.set(10 /* VertexShaderComponent.ComputePosition */,
|
|
180418
|
+
vert.set(10 /* VertexShaderComponent.ComputePosition */, buildComputePosition(vert.positionType));
|
|
180137
180419
|
prog.addVarying("v_lnInfo", 5 /* VariableType.Vec4 */);
|
|
180138
180420
|
addAdjustWidth(vert);
|
|
180139
|
-
(0,
|
|
180421
|
+
(0,_Vertex__WEBPACK_IMPORTED_MODULE_12__.addSamplePosition)(vert);
|
|
180140
180422
|
vert.addFunction(decodePosition);
|
|
180423
|
+
vert.addFunction(decodeFloatFromBytes);
|
|
180141
180424
|
}
|
|
180142
180425
|
const decodePosition = `
|
|
180143
180426
|
vec4 decodePosition(vec3 baseIndex) {
|
|
@@ -180149,7 +180432,18 @@ const decodeAdjacentPositions = `
|
|
|
180149
180432
|
g_prevPos = decodePosition(a_prevIndex);
|
|
180150
180433
|
g_nextPos = decodePosition(a_nextIndex);
|
|
180151
180434
|
`;
|
|
180152
|
-
const
|
|
180435
|
+
const decodeFloatFromBytes = `
|
|
180436
|
+
float decodeFloatFromBytes(vec4 bytes) {
|
|
180437
|
+
uvec4 b = uvec4(bytes);
|
|
180438
|
+
uint u = b.x | (b.y << 8) | (b.z << 16) | (b.w << 24);
|
|
180439
|
+
return uintBitsToFloat(u);
|
|
180440
|
+
}
|
|
180441
|
+
`;
|
|
180442
|
+
function buildComputePosition(positionType) {
|
|
180443
|
+
const cumDistExpr = positionType === "unquantized"
|
|
180444
|
+
? "((u_vertParams.z > 5.0) ? decodeFloatFromBytes(g_vertLutData5) : 0.0)"
|
|
180445
|
+
: "((u_vertParams.z > 3.0) ? decodeFloatFromBytes(g_vertLutData3) : 0.0)";
|
|
180446
|
+
return `
|
|
180153
180447
|
const float kNone = 0.0,
|
|
180154
180448
|
kSquare = 1.0*3.0,
|
|
180155
180449
|
kMiter = 2.0*3.0,
|
|
@@ -180174,9 +180468,11 @@ const computePosition = `
|
|
|
180174
180468
|
if (param >= kNoneAdjWt)
|
|
180175
180469
|
param -= kNoneAdjWt;
|
|
180176
180470
|
|
|
180471
|
+
bool isSegmentStart = true;
|
|
180177
180472
|
if (param >= kNegateAlong) {
|
|
180178
180473
|
directionScale = -directionScale;
|
|
180179
180474
|
param -= kNegateAlong;
|
|
180475
|
+
isSegmentStart = false;
|
|
180180
180476
|
}
|
|
180181
180477
|
|
|
180182
180478
|
if (param >= kNegatePerp) {
|
|
@@ -180189,6 +180485,11 @@ const computePosition = `
|
|
|
180189
180485
|
vec4 projNext = modelToWindowCoordinates(next, rawPos, otherPos, otherMvPos);
|
|
180190
180486
|
g_windowDir = projNext.xy - g_windowPos.xy;
|
|
180191
180487
|
|
|
180488
|
+
if (u_useCumDist > 0.5)
|
|
180489
|
+
v_patternDistance = ${cumDistExpr};
|
|
180490
|
+
else
|
|
180491
|
+
v_patternDistance = 0.0;
|
|
180492
|
+
|
|
180192
180493
|
if (param < kJointBase) {
|
|
180193
180494
|
vec2 dir = (directionScale > 0.0) ? g_windowDir : -g_windowDir;
|
|
180194
180495
|
vec2 pos = (directionScale > 0.0) ? g_windowPos.xy : projNext.xy;
|
|
@@ -180256,18 +180557,19 @@ const computePosition = `
|
|
|
180256
180557
|
|
|
180257
180558
|
return pos;
|
|
180258
180559
|
`;
|
|
180259
|
-
|
|
180560
|
+
}
|
|
180561
|
+
const lineCodeArgs = "g_windowDir, g_windowPos, miterAdjust, v_patternDistance";
|
|
180260
180562
|
/** @internal */
|
|
180261
180563
|
function createPolylineBuilder(isInstanced, positionType) {
|
|
180262
180564
|
const instanced = 1 /* IsInstanced.Yes */ === isInstanced;
|
|
180263
180565
|
const attrMap = _AttributeMap__WEBPACK_IMPORTED_MODULE_1__.AttributeMap.findAttributeMap(1 /* TechniqueId.Polyline */, instanced);
|
|
180264
180566
|
const builder = new _ShaderBuilder__WEBPACK_IMPORTED_MODULE_3__.ProgramBuilder(attrMap, { positionType, instanced });
|
|
180265
|
-
(0,
|
|
180567
|
+
(0,_Common__WEBPACK_IMPORTED_MODULE_8__.addShaderFlags)(builder);
|
|
180266
180568
|
addCommon(builder);
|
|
180267
180569
|
polylineAddLineCode(builder);
|
|
180268
|
-
(0,
|
|
180269
|
-
(0,
|
|
180270
|
-
(0,
|
|
180570
|
+
(0,_Color__WEBPACK_IMPORTED_MODULE_6__.addColor)(builder);
|
|
180571
|
+
(0,_Edge__WEBPACK_IMPORTED_MODULE_7__.addEdgeContrast)(builder.vert);
|
|
180572
|
+
(0,_Fragment__WEBPACK_IMPORTED_MODULE_11__.addWhiteOnWhiteReversal)(builder.frag);
|
|
180271
180573
|
return builder;
|
|
180272
180574
|
}
|
|
180273
180575
|
/** @internal */
|
|
@@ -180276,8 +180578,9 @@ function createPolylineHiliter(isInstanced, positionType) {
|
|
|
180276
180578
|
const attrMap = _AttributeMap__WEBPACK_IMPORTED_MODULE_1__.AttributeMap.findAttributeMap(1 /* TechniqueId.Polyline */, instanced);
|
|
180277
180579
|
const builder = new _ShaderBuilder__WEBPACK_IMPORTED_MODULE_3__.ProgramBuilder(attrMap, { positionType, instanced });
|
|
180278
180580
|
addCommon(builder);
|
|
180279
|
-
(
|
|
180280
|
-
(0,
|
|
180581
|
+
addUseCumulativeDistanceUniform(builder);
|
|
180582
|
+
(0,_Common__WEBPACK_IMPORTED_MODULE_8__.addFrustum)(builder);
|
|
180583
|
+
(0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_10__.addHiliter)(builder, true);
|
|
180281
180584
|
return builder;
|
|
180282
180585
|
}
|
|
180283
180586
|
|
|
@@ -185337,6 +185640,7 @@ function createPrimitiveGeometry(primitive, options, viOrigin) {
|
|
|
185337
185640
|
indices: new _common_internal_render_VertexIndices__WEBPACK_IMPORTED_MODULE_6__.VertexIndices(primitive.params.polyline.indices),
|
|
185338
185641
|
prevIndices: new _common_internal_render_VertexIndices__WEBPACK_IMPORTED_MODULE_6__.VertexIndices(primitive.params.polyline.prevIndices),
|
|
185339
185642
|
},
|
|
185643
|
+
hasCumulativeDistances: primitive.params.hasCumulativeDistances,
|
|
185340
185644
|
}, viOrigin);
|
|
185341
185645
|
case "mesh": {
|
|
185342
185646
|
const surf = primitive.params.surface;
|
|
@@ -194113,6 +194417,11 @@ class QuantityFormatter {
|
|
|
194113
194417
|
* @internal
|
|
194114
194418
|
*/
|
|
194115
194419
|
async onInitialized() {
|
|
194420
|
+
// Remove any existing listener before re-registering to avoid duplicates when called via setUnitsProvider.
|
|
194421
|
+
if (this._removeFormatsProviderListener) {
|
|
194422
|
+
this._removeFormatsProviderListener();
|
|
194423
|
+
this._removeFormatsProviderListener = undefined;
|
|
194424
|
+
}
|
|
194116
194425
|
await this.initializeQuantityTypesRegistry();
|
|
194117
194426
|
const initialKoQs = [["DefaultToolsUnits.LENGTH", "Units.M"], ["DefaultToolsUnits.ANGLE", "Units.RAD"], ["DefaultToolsUnits.AREA", "Units.SQ_M"], ["DefaultToolsUnits.VOLUME", "Units.CUB_M"], ["DefaultToolsUnits.LENGTH_COORDINATE", "Units.M"], ["CivilUnits.STATION", "Units.M"], ["CivilUnits.LENGTH", "Units.M"], ["AecUnits.LENGTH", "Units.M"]];
|
|
194118
194427
|
for (const entry of initialKoQs) {
|
|
@@ -194181,7 +194490,11 @@ class QuantityFormatter {
|
|
|
194181
194490
|
set unitsProvider(unitsProvider) {
|
|
194182
194491
|
this.setUnitsProvider(unitsProvider); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
194183
194492
|
}
|
|
194184
|
-
/**
|
|
194493
|
+
/**
|
|
194494
|
+
* Async method to set a units provider and reload caches.
|
|
194495
|
+
* @note If the active primitive tool may be holding stale unit data, callers should follow this with
|
|
194496
|
+
* `IModelApp.toolAdmin.restartPrimitiveTool()` to allow the tool to reinitialize itself.
|
|
194497
|
+
*/
|
|
194185
194498
|
async setUnitsProvider(unitsProvider) {
|
|
194186
194499
|
this._unitsProvider = unitsProvider;
|
|
194187
194500
|
try {
|
|
@@ -194195,12 +194508,14 @@ class QuantityFormatter {
|
|
|
194195
194508
|
await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.resetToUseInternalUnitsProvider();
|
|
194196
194509
|
return;
|
|
194197
194510
|
}
|
|
194198
|
-
// force default tool to start so any tool that may be using cached data will not be using bad data.
|
|
194199
|
-
if (_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin)
|
|
194200
|
-
await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin.startDefaultTool();
|
|
194201
194511
|
this.onUnitsProviderChanged.emit();
|
|
194202
194512
|
}
|
|
194203
|
-
/**
|
|
194513
|
+
/**
|
|
194514
|
+
* Async call typically used after an iModel is closed to reset the UnitsProvider to the default one
|
|
194515
|
+
* that does not require a Units schema.
|
|
194516
|
+
* @note If the active primitive tool may be holding stale unit data, callers should follow this with
|
|
194517
|
+
* `IModelApp.toolAdmin.restartPrimitiveTool()` to allow the tool to reinitialize itself.
|
|
194518
|
+
*/
|
|
194204
194519
|
async resetToUseInternalUnitsProvider() {
|
|
194205
194520
|
if (this._unitsProvider instanceof _BasicUnitsProvider__WEBPACK_IMPORTED_MODULE_4__.BasicUnitsProvider)
|
|
194206
194521
|
return;
|
|
@@ -194570,7 +194885,7 @@ const DEFAULT_FORMATKEY_BY_UNIT_SYSTEM = [
|
|
|
194570
194885
|
{ type: getQuantityTypeKey(QuantityType.Coordinate), formatKey: "[units:length]meter2" },
|
|
194571
194886
|
{ type: getQuantityTypeKey(QuantityType.Stationing), formatKey: "[units:length]m-sta2" },
|
|
194572
194887
|
{ type: getQuantityTypeKey(QuantityType.LengthSurvey), formatKey: "[units:length]meter4" },
|
|
194573
|
-
{ type: getQuantityTypeKey(QuantityType.LengthEngineering), formatKey: "[units:length]
|
|
194888
|
+
{ type: getQuantityTypeKey(QuantityType.LengthEngineering), formatKey: "[units:length]meter4" },
|
|
194574
194889
|
],
|
|
194575
194890
|
},
|
|
194576
194891
|
{
|
|
@@ -194632,20 +194947,6 @@ const DEFAULT_FORMATPROPS = [
|
|
|
194632
194947
|
type: "Decimal",
|
|
194633
194948
|
},
|
|
194634
194949
|
},
|
|
194635
|
-
{
|
|
194636
|
-
key: "[units:length]millimeter3",
|
|
194637
|
-
description: "millimeters (labeled) 3 decimal places",
|
|
194638
|
-
format: {
|
|
194639
|
-
composite: {
|
|
194640
|
-
includeZero: true,
|
|
194641
|
-
spacer: "",
|
|
194642
|
-
units: [{ label: "mm", name: "Units.MM" }],
|
|
194643
|
-
},
|
|
194644
|
-
formatTraits: ["keepSingleZero", "showUnitLabel"],
|
|
194645
|
-
precision: 3,
|
|
194646
|
-
type: "Decimal",
|
|
194647
|
-
},
|
|
194648
|
-
},
|
|
194649
194950
|
{
|
|
194650
194951
|
key: "[units:length]meter2",
|
|
194651
194952
|
description: "meters (labeled) 2 decimal places",
|
|
@@ -197890,12 +198191,26 @@ class GltfMeshData {
|
|
|
197890
198191
|
uvs;
|
|
197891
198192
|
uvRange;
|
|
197892
198193
|
indices;
|
|
198194
|
+
cumulativeDistances;
|
|
197893
198195
|
type = "mesh";
|
|
197894
198196
|
constructor(props) {
|
|
197895
198197
|
this.primitive = props;
|
|
197896
198198
|
}
|
|
197897
198199
|
}
|
|
197898
198200
|
const emptyDict = {};
|
|
198201
|
+
function linePixelsFromGltfPattern(pattern) {
|
|
198202
|
+
if (undefined === pattern)
|
|
198203
|
+
return undefined;
|
|
198204
|
+
const normalized = pattern >>> 0;
|
|
198205
|
+
if (0 === normalized)
|
|
198206
|
+
return undefined;
|
|
198207
|
+
if (normalized <= 0xffff) {
|
|
198208
|
+
const mask16 = normalized & 0xffff;
|
|
198209
|
+
const repeated = ((mask16 << 16) | mask16) >>> 0;
|
|
198210
|
+
return repeated;
|
|
198211
|
+
}
|
|
198212
|
+
return normalized;
|
|
198213
|
+
}
|
|
197899
198214
|
function colorFromJson(values) {
|
|
197900
198215
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.from(values[0] * 255, values[1] * 255, values[2] * 255, (1.0 - values[3]) * 255);
|
|
197901
198216
|
}
|
|
@@ -198195,6 +198510,8 @@ class GltfReader {
|
|
|
198195
198510
|
const pointCount = gltfMesh.points.length / 3;
|
|
198196
198511
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(mesh.points instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QPoint3dList);
|
|
198197
198512
|
mesh.points.fromTypedArray(gltfMesh.pointRange, gltfMesh.points);
|
|
198513
|
+
if (gltfMesh.cumulativeDistances)
|
|
198514
|
+
mesh.cumulativeDistances = gltfMesh.cumulativeDistances;
|
|
198198
198515
|
if (mesh.triangles && gltfMesh.indices)
|
|
198199
198516
|
mesh.triangles.addFromTypedArray(gltfMesh.indices);
|
|
198200
198517
|
if (gltfMesh.uvs && gltfMesh.uvRange && gltfMesh.uvQParams) {
|
|
@@ -198637,7 +198954,69 @@ class GltfReader {
|
|
|
198637
198954
|
return "BLEND" === material.alphaMode;
|
|
198638
198955
|
}
|
|
198639
198956
|
}
|
|
198640
|
-
|
|
198957
|
+
getMaterialLineStyle(material) {
|
|
198958
|
+
const ext = material.extensions?.BENTLEY_materials_line_style;
|
|
198959
|
+
if (!ext)
|
|
198960
|
+
return undefined;
|
|
198961
|
+
let width = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(ext.width);
|
|
198962
|
+
if (undefined !== width)
|
|
198963
|
+
width = Math.max(1, width);
|
|
198964
|
+
const patternValue = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(ext.pattern);
|
|
198965
|
+
const linePixels = linePixelsFromGltfPattern(patternValue);
|
|
198966
|
+
if (undefined === width && undefined === linePixels)
|
|
198967
|
+
return undefined;
|
|
198968
|
+
return { width, linePixels };
|
|
198969
|
+
}
|
|
198970
|
+
readCumulativeDistances(mesh, primitive) {
|
|
198971
|
+
const positionView = this.getBufferView(primitive.attributes, "POSITION");
|
|
198972
|
+
const pointCount = positionView?.count ?? 0;
|
|
198973
|
+
const semantic = "BENTLEY_materials_line_style:CUMULATIVE_DISTANCE";
|
|
198974
|
+
const attrView = this.getBufferView(primitive.attributes, semantic);
|
|
198975
|
+
if (attrView) {
|
|
198976
|
+
if ("SCALAR" !== attrView.accessor.type || (0 !== pointCount && attrView.count !== pointCount)) {
|
|
198977
|
+
mesh.cumulativeDistances = new Float32Array(0);
|
|
198978
|
+
return;
|
|
198979
|
+
}
|
|
198980
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float === attrView.type) {
|
|
198981
|
+
const data = attrView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
|
|
198982
|
+
if (!data || !(data.buffer instanceof Float32Array)) {
|
|
198983
|
+
mesh.cumulativeDistances = new Float32Array(0);
|
|
198984
|
+
return;
|
|
198985
|
+
}
|
|
198986
|
+
mesh.cumulativeDistances = data.buffer.subarray(0, data.count);
|
|
198987
|
+
return;
|
|
198988
|
+
}
|
|
198989
|
+
if (attrView.accessor.normalized) {
|
|
198990
|
+
const maxDistance = Array.isArray(attrView.accessor.max) && attrView.accessor.max.length > 0 ? attrView.accessor.max[0] : 1.0;
|
|
198991
|
+
const count = attrView.count;
|
|
198992
|
+
let data;
|
|
198993
|
+
let denom = 1;
|
|
198994
|
+
if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort === attrView.type) {
|
|
198995
|
+
data = attrView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort);
|
|
198996
|
+
denom = 65535;
|
|
198997
|
+
}
|
|
198998
|
+
else if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte === attrView.type) {
|
|
198999
|
+
data = attrView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte);
|
|
199000
|
+
denom = 255;
|
|
199001
|
+
}
|
|
199002
|
+
if (!data || !data.buffer) {
|
|
199003
|
+
mesh.cumulativeDistances = new Float32Array(0);
|
|
199004
|
+
return;
|
|
199005
|
+
}
|
|
199006
|
+
const out = new Float32Array(count);
|
|
199007
|
+
const scale = maxDistance / denom;
|
|
199008
|
+
const src = data.buffer;
|
|
199009
|
+
for (let i = 0; i < count; i++)
|
|
199010
|
+
out[i] = src[i] * scale;
|
|
199011
|
+
mesh.cumulativeDistances = out;
|
|
199012
|
+
return;
|
|
199013
|
+
}
|
|
199014
|
+
mesh.cumulativeDistances = new Float32Array(0);
|
|
199015
|
+
return;
|
|
199016
|
+
}
|
|
199017
|
+
mesh.cumulativeDistances = new Float32Array(0);
|
|
199018
|
+
}
|
|
199019
|
+
createDisplayParams(material, hasBakedLighting, isPointPrimitive = false, lineStyle) {
|
|
198641
199020
|
let constantLodParamProps;
|
|
198642
199021
|
let normalMapUseConstantLod = false;
|
|
198643
199022
|
if (!(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material)) {
|
|
@@ -198683,13 +199062,14 @@ class GltfReader {
|
|
|
198683
199062
|
// DisplayParams doesn't want a separate texture mapping if the material already has one.
|
|
198684
199063
|
textureMapping = undefined;
|
|
198685
199064
|
}
|
|
198686
|
-
|
|
198687
|
-
|
|
199065
|
+
const overrides = lineStyle ?? this.getMaterialLineStyle(material);
|
|
199066
|
+
let width = overrides?.width ?? 1;
|
|
199067
|
+
if (undefined === overrides?.width && isPointPrimitive && !(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material)) {
|
|
198688
199068
|
const pointStyle = material.extensions?.BENTLEY_materials_point_style;
|
|
198689
|
-
if (pointStyle && pointStyle.diameter > 0 && Math.floor(pointStyle.diameter) === pointStyle.diameter)
|
|
199069
|
+
if (pointStyle?.diameter && pointStyle.diameter > 0 && Math.floor(pointStyle.diameter) === pointStyle.diameter)
|
|
198690
199070
|
width = pointStyle.diameter;
|
|
198691
|
-
}
|
|
198692
199071
|
}
|
|
199072
|
+
const linePixels = overrides?.linePixels ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid;
|
|
198693
199073
|
// Process BENTLEY_materials_planar_fill extension
|
|
198694
199074
|
let fillFlags = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.None;
|
|
198695
199075
|
if (!(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material)) {
|
|
@@ -198713,7 +199093,7 @@ class GltfReader {
|
|
|
198713
199093
|
}
|
|
198714
199094
|
}
|
|
198715
199095
|
}
|
|
198716
|
-
return new _common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.Type.Mesh, color, color, width,
|
|
199096
|
+
return new _common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.Type.Mesh, color, color, width, linePixels, fillFlags, renderMaterial, undefined, hasBakedLighting, textureMapping);
|
|
198717
199097
|
}
|
|
198718
199098
|
readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
|
|
198719
199099
|
const meshes = [];
|
|
@@ -198759,7 +199139,7 @@ class GltfReader {
|
|
|
198759
199139
|
}
|
|
198760
199140
|
readMeshPrimitive(primitive, featureTable, pseudoRtcBias) {
|
|
198761
199141
|
const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Triangles);
|
|
198762
|
-
if (meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Points
|
|
199142
|
+
if (meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Points && !this._vertexTableRequired) {
|
|
198763
199143
|
const pointCloud = this.readPointCloud2(primitive, undefined !== featureTable);
|
|
198764
199144
|
if (pointCloud)
|
|
198765
199145
|
return pointCloud;
|
|
@@ -198768,6 +199148,7 @@ class GltfReader {
|
|
|
198768
199148
|
const material = 0 < materialName.length ? this._materials[materialName] : {};
|
|
198769
199149
|
if (!material)
|
|
198770
199150
|
return undefined;
|
|
199151
|
+
const hasBakedLighting = undefined === primitive.attributes.NORMAL || undefined !== material.extensions?.KHR_materials_unlit;
|
|
198771
199152
|
let primitiveType = -1;
|
|
198772
199153
|
switch (meshMode) {
|
|
198773
199154
|
case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Lines:
|
|
@@ -198783,8 +199164,10 @@ class GltfReader {
|
|
|
198783
199164
|
default:
|
|
198784
199165
|
return undefined;
|
|
198785
199166
|
}
|
|
198786
|
-
|
|
198787
|
-
const
|
|
199167
|
+
// Only extract line style for line primitives or meshes with edges
|
|
199168
|
+
const hasEdges = primitive.extensions?.EXT_mesh_primitive_edge_visibility || primitive.extensions?.CESIUM_primitive_outline;
|
|
199169
|
+
const lineStyle = (primitiveType === _common_internal_render_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Polyline || hasEdges) ? this.getMaterialLineStyle(material) : undefined;
|
|
199170
|
+
const displayParams = this.createDisplayParams(material, hasBakedLighting, primitiveType === _common_internal_render_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Point, lineStyle);
|
|
198788
199171
|
if (!displayParams)
|
|
198789
199172
|
return undefined;
|
|
198790
199173
|
const isVolumeClassifier = this._isVolumeClassifier;
|
|
@@ -198858,6 +199241,7 @@ class GltfReader {
|
|
|
198858
199241
|
case _common_internal_render_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Polyline:
|
|
198859
199242
|
case _common_internal_render_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Point: {
|
|
198860
199243
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Points || meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Lines || meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.LineStrip);
|
|
199244
|
+
this.readCumulativeDistances(mesh, primitive);
|
|
198861
199245
|
if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices", meshMode))
|
|
198862
199246
|
return undefined;
|
|
198863
199247
|
break;
|
|
@@ -198941,11 +199325,18 @@ class GltfReader {
|
|
|
198941
199325
|
}
|
|
198942
199326
|
getEdgeAppearance(materialId) {
|
|
198943
199327
|
const material = undefined !== materialId ? this._materials[materialId] : undefined;
|
|
198944
|
-
|
|
198945
|
-
|
|
198946
|
-
|
|
198947
|
-
|
|
198948
|
-
|
|
199328
|
+
if (!material)
|
|
199329
|
+
return undefined;
|
|
199330
|
+
const lineStyle = this.getMaterialLineStyle(material);
|
|
199331
|
+
const displayParams = this.createDisplayParams(material, false, false, lineStyle);
|
|
199332
|
+
if (!displayParams)
|
|
199333
|
+
return undefined;
|
|
199334
|
+
const appearance = {
|
|
199335
|
+
color: displayParams.lineColor,
|
|
199336
|
+
width: lineStyle?.width,
|
|
199337
|
+
linePixels: lineStyle?.linePixels,
|
|
199338
|
+
};
|
|
199339
|
+
return appearance;
|
|
198949
199340
|
}
|
|
198950
199341
|
readPointCloud2(primitive, hasFeatures) {
|
|
198951
199342
|
let pointRange;
|
|
@@ -220351,7 +220742,12 @@ class ToolAdmin {
|
|
|
220351
220742
|
await this.setPrimitiveTool(newTool);
|
|
220352
220743
|
}
|
|
220353
220744
|
// it is important to raise event after setPrimitiveTool is called
|
|
220354
|
-
|
|
220745
|
+
const activeTool = newTool ?? this._idleTool;
|
|
220746
|
+
// _idleTool is cleared during onShutDown(); skip the event if shutdown has already run
|
|
220747
|
+
// to avoid emitting activeToolChanged with an undefined tool.
|
|
220748
|
+
if (undefined === activeTool)
|
|
220749
|
+
return;
|
|
220750
|
+
this.onActiveToolChanged(activeTool, StartOrResume.Start);
|
|
220355
220751
|
}
|
|
220356
220752
|
finally {
|
|
220357
220753
|
if (resolveStarting)
|
|
@@ -348184,7 +348580,7 @@ class TestContext {
|
|
|
348184
348580
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
348185
348581
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
348186
348582
|
await core_frontend_1.NoRenderApp.startup({
|
|
348187
|
-
applicationVersion: "5.8.0-dev.
|
|
348583
|
+
applicationVersion: "5.8.0-dev.15",
|
|
348188
348584
|
applicationId: this.settings.gprid,
|
|
348189
348585
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
348190
348586
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -375361,7 +375757,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
375361
375757
|
/***/ ((module) => {
|
|
375362
375758
|
|
|
375363
375759
|
"use strict";
|
|
375364
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.8.0-dev.
|
|
375760
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.8.0-dev.15","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 && npm run -s copy:draco","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 ES2022 --outDir lib/esm","clean":"rimraf -g 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","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","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:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//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":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.9","@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/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.5.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
375365
375761
|
|
|
375366
375762
|
/***/ }),
|
|
375367
375763
|
|