@itwin/rpcinterface-full-stack-tests 4.4.0-dev.24 → 4.4.0-dev.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +229 -31
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_bea9.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\
|
|
1
|
+
{"version":3,"file":"_bea9.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\7\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.1.6\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
|
|
@@ -144332,6 +144332,17 @@ function colorFromMaterial(material, isTransparent) {
|
|
|
144332
144332
|
color = color.withTransparency(0);
|
|
144333
144333
|
return color;
|
|
144334
144334
|
}
|
|
144335
|
+
function trsMatrix(translation, rotation, scale, result) {
|
|
144336
|
+
// SPEC: To compose the local transformation matrix, TRS properties MUST be converted to matrices and postmultiplied in the T * R * S order;
|
|
144337
|
+
// first the scale is applied to the vertices, then the rotation, and then the translation.
|
|
144338
|
+
const scaleTf = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, scale ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createScale(scale[0], scale[1], scale[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
|
|
144339
|
+
const rotTf = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, rotation ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createFromQuaternion(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point4d.create(rotation[0], rotation[1], rotation[2], rotation[3])) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
|
|
144340
|
+
rotTf.matrix.transposeInPlace(); // See comment on Matrix3d.createFromQuaternion
|
|
144341
|
+
const transTf = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslation(translation ? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(translation[0], translation[1], translation[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero());
|
|
144342
|
+
const tf = scaleTf.multiplyTransformTransform(rotTf, result);
|
|
144343
|
+
transTf.multiplyTransformTransform(tf, tf);
|
|
144344
|
+
return tf;
|
|
144345
|
+
}
|
|
144335
144346
|
class TransformStack {
|
|
144336
144347
|
constructor(transform) {
|
|
144337
144348
|
this._stack = [];
|
|
@@ -144352,14 +144363,7 @@ class TransformStack {
|
|
|
144352
144363
|
nodeTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(origin, matrix);
|
|
144353
144364
|
}
|
|
144354
144365
|
else if (node.rotation || node.scale || node.translation) {
|
|
144355
|
-
|
|
144356
|
-
// first the scale is applied to the vertices, then the rotation, and then the translation.
|
|
144357
|
-
const scale = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, node.scale ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createScale(node.scale[0], node.scale[1], node.scale[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
|
|
144358
|
-
const rot = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, node.rotation ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createFromQuaternion(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point4d.create(node.rotation[0], node.rotation[1], node.rotation[2], node.rotation[3])) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
|
|
144359
|
-
rot.matrix.transposeInPlace(); // See comment on Matrix3d.createFromQuaternion
|
|
144360
|
-
const trans = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslation(node.translation ? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(node.translation[0], node.translation[1], node.translation[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero());
|
|
144361
|
-
nodeTransform = scale.multiplyTransformTransform(rot);
|
|
144362
|
-
trans.multiplyTransformTransform(nodeTransform, nodeTransform);
|
|
144366
|
+
nodeTransform = trsMatrix(node.translation, node.rotation, node.scale);
|
|
144363
144367
|
}
|
|
144364
144368
|
const top = this.transform;
|
|
144365
144369
|
if (!top)
|
|
@@ -144412,6 +144416,9 @@ class GltfReader {
|
|
|
144412
144416
|
traverseScene() {
|
|
144413
144417
|
return this.traverseNodes(this._sceneNodes);
|
|
144414
144418
|
}
|
|
144419
|
+
get viewFlagOverrides() {
|
|
144420
|
+
return undefined;
|
|
144421
|
+
}
|
|
144415
144422
|
getTileTransform(transformToRoot, pseudoRtcBias) {
|
|
144416
144423
|
let transform;
|
|
144417
144424
|
if (this._returnToCenter || pseudoRtcBias || this._yAxisUp || transformToRoot) {
|
|
@@ -144455,18 +144462,19 @@ class GltfReader {
|
|
|
144455
144462
|
renderGraphic = renderGraphicList[0];
|
|
144456
144463
|
else
|
|
144457
144464
|
renderGraphic = this._system.createGraphicList(renderGraphicList);
|
|
144458
|
-
const transform = this.getTileTransform(transformToRoot, pseudoRtcBias);
|
|
144459
|
-
let range = contentRange;
|
|
144460
|
-
const invTransform = transform?.inverse();
|
|
144461
|
-
if (invTransform)
|
|
144462
|
-
range = invTransform.multiplyRange(contentRange);
|
|
144463
144465
|
if (featureTable)
|
|
144464
|
-
renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable),
|
|
144465
|
-
|
|
144466
|
+
renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), contentRange);
|
|
144467
|
+
const transform = this.getTileTransform(transformToRoot, pseudoRtcBias);
|
|
144468
|
+
const viewFlagOverrides = this.viewFlagOverrides;
|
|
144469
|
+
if (transform || viewFlagOverrides) {
|
|
144466
144470
|
const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_4__.GraphicBranch(true);
|
|
144471
|
+
if (viewFlagOverrides)
|
|
144472
|
+
branch.setViewFlagOverrides(viewFlagOverrides);
|
|
144467
144473
|
branch.add(renderGraphic);
|
|
144468
|
-
renderGraphic = this._system.createBranch(branch, transform);
|
|
144474
|
+
renderGraphic = this._system.createBranch(branch, transform ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity());
|
|
144469
144475
|
}
|
|
144476
|
+
const invTransform = transform?.inverse();
|
|
144477
|
+
const range = invTransform ? invTransform.multiplyRange(contentRange) : contentRange;
|
|
144470
144478
|
return {
|
|
144471
144479
|
readStatus,
|
|
144472
144480
|
isLeaf,
|
|
@@ -144513,12 +144521,76 @@ class GltfReader {
|
|
|
144513
144521
|
mesh.normals.push(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.OctEncodedNormal(normal));
|
|
144514
144522
|
return mesh.getGraphics(this._system, instances);
|
|
144515
144523
|
}
|
|
144516
|
-
|
|
144524
|
+
readInstanceAttributes(node, featureTable) {
|
|
144525
|
+
const ext = node.extensions?.EXT_mesh_gpu_instancing;
|
|
144526
|
+
if (!ext || !ext.attributes) {
|
|
144527
|
+
return undefined;
|
|
144528
|
+
}
|
|
144529
|
+
const translationsView = this.getBufferView(ext.attributes, "TRANSLATION");
|
|
144530
|
+
const translations = translationsView?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
|
|
144531
|
+
const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
|
|
144532
|
+
const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
|
|
144533
|
+
// All attributes must specify the same count, count must be greater than zero, and at least one attribute must be specified.
|
|
144534
|
+
const count = translations?.count ?? rotations?.count ?? scales?.count;
|
|
144535
|
+
if (!count || (rotations && rotations.count !== count) || (scales && scales.count !== count)) {
|
|
144536
|
+
return undefined;
|
|
144537
|
+
}
|
|
144538
|
+
const transformCenter = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d();
|
|
144539
|
+
const trMin = translationsView?.accessor.min;
|
|
144540
|
+
const trMax = translationsView?.accessor.max;
|
|
144541
|
+
if (trMin && trMax) {
|
|
144542
|
+
const half = (idx) => trMin[idx] + (trMax[idx] - trMin[idx]) / 2;
|
|
144543
|
+
transformCenter.set(half(0), half(1), half(2));
|
|
144544
|
+
}
|
|
144545
|
+
const getTranslation = (index) => {
|
|
144546
|
+
if (!translations) {
|
|
144547
|
+
return undefined;
|
|
144548
|
+
}
|
|
144549
|
+
index *= 3;
|
|
144550
|
+
return [
|
|
144551
|
+
translations.buffer[index + 0] - transformCenter.x,
|
|
144552
|
+
translations.buffer[index + 1] - transformCenter.y,
|
|
144553
|
+
translations.buffer[index + 2] - transformCenter.z,
|
|
144554
|
+
];
|
|
144555
|
+
};
|
|
144556
|
+
const getRotation = (index) => {
|
|
144557
|
+
index *= 4;
|
|
144558
|
+
return rotations ? [rotations.buffer[index], rotations.buffer[index + 1], rotations.buffer[index + 2], rotations.buffer[index + 3]] : undefined;
|
|
144559
|
+
};
|
|
144560
|
+
const getScale = (index) => {
|
|
144561
|
+
index *= 3;
|
|
144562
|
+
return scales ? [scales.buffer[index], scales.buffer[index + 1], scales.buffer[index + 2]] : undefined;
|
|
144563
|
+
};
|
|
144564
|
+
const transforms = new Float32Array(3 * 4 * count);
|
|
144565
|
+
const transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
144566
|
+
for (let i = 0; i < count; i++) {
|
|
144567
|
+
const tf = trsMatrix(getTranslation(i), getRotation(i), getScale(i), transform);
|
|
144568
|
+
const idx = i * 3 * 4;
|
|
144569
|
+
transforms[idx + 0] = tf.matrix.coffs[0];
|
|
144570
|
+
transforms[idx + 1] = tf.matrix.coffs[1];
|
|
144571
|
+
transforms[idx + 2] = tf.matrix.coffs[2];
|
|
144572
|
+
transforms[idx + 3] = tf.origin.x;
|
|
144573
|
+
transforms[idx + 4] = tf.matrix.coffs[3];
|
|
144574
|
+
transforms[idx + 5] = tf.matrix.coffs[4];
|
|
144575
|
+
transforms[idx + 6] = tf.matrix.coffs[5];
|
|
144576
|
+
transforms[idx + 7] = tf.origin.y;
|
|
144577
|
+
transforms[idx + 8] = tf.matrix.coffs[6];
|
|
144578
|
+
transforms[idx + 9] = tf.matrix.coffs[7];
|
|
144579
|
+
transforms[idx + 10] = tf.matrix.coffs[8];
|
|
144580
|
+
transforms[idx + 11] = tf.origin.z;
|
|
144581
|
+
}
|
|
144582
|
+
// ###TODO? The extension currently provides no way of specifying per-instance feature Ids.
|
|
144583
|
+
// For now, assume that if the feature table contains exactly one feature, all the instances belong to that feature.
|
|
144584
|
+
const featureIds = featureTable && featureTable.isUniform ? new Uint8Array(3 * count) : undefined;
|
|
144585
|
+
return { count, transforms, transformCenter, featureIds };
|
|
144586
|
+
}
|
|
144587
|
+
readNodeAndCreateGraphics(renderGraphicList, node, featureTable, transformStack, batchInstances, pseudoRtcBias) {
|
|
144517
144588
|
if (undefined === node)
|
|
144518
144589
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileReadStatus.InvalidTileData;
|
|
144519
144590
|
// IMPORTANT: Do not return without popping this node from the stack.
|
|
144520
144591
|
transformStack.push(node);
|
|
144521
144592
|
const thisTransform = transformStack.transform;
|
|
144593
|
+
const nodeInstances = !batchInstances && undefined !== node.mesh ? this.readInstanceAttributes(node, featureTable) : undefined;
|
|
144522
144594
|
/**
|
|
144523
144595
|
* This is a workaround for tiles generated by
|
|
144524
144596
|
* context capture which have a large offset from the tileset origin that exceeds the
|
|
@@ -144533,16 +144605,16 @@ class GltfReader {
|
|
|
144533
144605
|
for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
|
|
144534
144606
|
const nodeMesh = this._meshes[meshKey];
|
|
144535
144607
|
if (nodeMesh?.primitives) {
|
|
144536
|
-
const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias);
|
|
144608
|
+
const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias, nodeInstances);
|
|
144537
144609
|
let renderGraphic;
|
|
144538
144610
|
if (0 !== meshes.length) {
|
|
144539
144611
|
if (1 === meshes.length) {
|
|
144540
|
-
renderGraphic = this.graphicFromMeshData(meshes[0],
|
|
144612
|
+
renderGraphic = this.graphicFromMeshData(meshes[0], batchInstances ?? nodeInstances);
|
|
144541
144613
|
}
|
|
144542
144614
|
else {
|
|
144543
144615
|
const thisList = [];
|
|
144544
144616
|
for (const mesh of meshes) {
|
|
144545
|
-
renderGraphic = this.graphicFromMeshData(mesh,
|
|
144617
|
+
renderGraphic = this.graphicFromMeshData(mesh, batchInstances ?? nodeInstances);
|
|
144546
144618
|
if (undefined !== renderGraphic)
|
|
144547
144619
|
thisList.push(renderGraphic);
|
|
144548
144620
|
}
|
|
@@ -144564,7 +144636,7 @@ class GltfReader {
|
|
|
144564
144636
|
for (const childId of node.children) {
|
|
144565
144637
|
const child = this._nodes[childId];
|
|
144566
144638
|
if (child)
|
|
144567
|
-
this.readNodeAndCreateGraphics(renderGraphicList, child, featureTable, transformStack,
|
|
144639
|
+
this.readNodeAndCreateGraphics(renderGraphicList, child, featureTable, transformStack, batchInstances ?? nodeInstances);
|
|
144568
144640
|
}
|
|
144569
144641
|
}
|
|
144570
144642
|
transformStack.pop();
|
|
@@ -144793,9 +144865,9 @@ class GltfReader {
|
|
|
144793
144865
|
// DisplayParams doesn't want a separate texture mapping if the material already has one.
|
|
144794
144866
|
textureMapping = undefined;
|
|
144795
144867
|
}
|
|
144796
|
-
return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.Type.Mesh, color, color, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.
|
|
144868
|
+
return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.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);
|
|
144797
144869
|
}
|
|
144798
|
-
readMeshPrimitives(node, featureTable, thisTransform, thisBias) {
|
|
144870
|
+
readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
|
|
144799
144871
|
const meshes = [];
|
|
144800
144872
|
for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
|
|
144801
144873
|
const nodeMesh = this._meshes[meshKey];
|
|
@@ -144805,9 +144877,30 @@ class GltfReader {
|
|
|
144805
144877
|
if (mesh) {
|
|
144806
144878
|
meshes.push(mesh);
|
|
144807
144879
|
if (this._computedContentRange && mesh.pointRange) {
|
|
144808
|
-
const
|
|
144809
|
-
|
|
144810
|
-
|
|
144880
|
+
const meshRange = thisTransform ? thisTransform.multiplyRange(mesh.pointRange) : mesh.pointRange;
|
|
144881
|
+
if (!instances) {
|
|
144882
|
+
this._computedContentRange.extendRange(meshRange);
|
|
144883
|
+
}
|
|
144884
|
+
else {
|
|
144885
|
+
const tfs = instances.transforms;
|
|
144886
|
+
const nodeRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
|
|
144887
|
+
const extendTransformedRange = (i, x, y, z) => {
|
|
144888
|
+
nodeRange.extendXYZ(tfs[i + 3] + tfs[i + 0] * x + tfs[i + 1] * y + tfs[i + 2] * z, tfs[i + 7] + tfs[i + 4] * x + tfs[i + 5] * y + tfs[i + 6] * z, tfs[i + 11] + tfs[i + 8] * x + tfs[i + 9] * y + tfs[i + 10] * z);
|
|
144889
|
+
};
|
|
144890
|
+
for (let i = 0; i < tfs.length; i += 3 * 4) {
|
|
144891
|
+
extendTransformedRange(i, meshRange.low.x, meshRange.low.y, meshRange.low.z);
|
|
144892
|
+
extendTransformedRange(i, meshRange.low.x, meshRange.low.y, meshRange.high.z);
|
|
144893
|
+
extendTransformedRange(i, meshRange.low.x, meshRange.high.y, meshRange.low.z);
|
|
144894
|
+
extendTransformedRange(i, meshRange.low.x, meshRange.high.y, meshRange.high.z);
|
|
144895
|
+
extendTransformedRange(i, meshRange.high.x, meshRange.low.y, meshRange.low.z);
|
|
144896
|
+
extendTransformedRange(i, meshRange.high.x, meshRange.low.y, meshRange.high.z);
|
|
144897
|
+
extendTransformedRange(i, meshRange.high.x, meshRange.high.y, meshRange.low.z);
|
|
144898
|
+
extendTransformedRange(i, meshRange.high.x, meshRange.high.y, meshRange.high.z);
|
|
144899
|
+
}
|
|
144900
|
+
nodeRange.low.addInPlace(instances.transformCenter);
|
|
144901
|
+
nodeRange.high.addInPlace(instances.transformCenter);
|
|
144902
|
+
this._computedContentRange.extendRange(nodeRange);
|
|
144903
|
+
}
|
|
144811
144904
|
}
|
|
144812
144905
|
}
|
|
144813
144906
|
}
|
|
@@ -145542,6 +145635,12 @@ class GltfGraphicsReader extends GltfReader {
|
|
|
145542
145635
|
this._featureTable.insert(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Feature(pickableId));
|
|
145543
145636
|
}
|
|
145544
145637
|
}
|
|
145638
|
+
get viewFlagOverrides() {
|
|
145639
|
+
return {
|
|
145640
|
+
whiteOnWhiteReversal: false,
|
|
145641
|
+
renderMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderMode.SmoothShade,
|
|
145642
|
+
};
|
|
145643
|
+
}
|
|
145545
145644
|
async read() {
|
|
145546
145645
|
await this.resolveResources();
|
|
145547
145646
|
return this.readGltfAndCreateGraphics(this._isLeaf, this._featureTable, this._contentRange, this._transform);
|
|
@@ -196136,7 +196235,7 @@ class Loop extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveChain {
|
|
|
196136
196235
|
dgnBoundaryType() {
|
|
196137
196236
|
/**
|
|
196138
196237
|
* All "Loop" become "outer". TypeScript Loop object is equivalent to a native CurveVector with
|
|
196139
|
-
* boundaryType = BOUNDARY_TYPE_Outer.
|
|
196238
|
+
* boundaryType = BOUNDARY_TYPE_Outer. In other words, TypeScript has no flavor of Loop that
|
|
196140
196239
|
* carries "hole" semantics.
|
|
196141
196240
|
*/
|
|
196142
196241
|
return 2;
|
|
@@ -263503,7 +263602,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
263503
263602
|
|
|
263504
263603
|
|
|
263505
263604
|
|
|
263506
|
-
/**
|
|
263605
|
+
/**
|
|
263606
|
+
* Class to test match of half edge mask.
|
|
263607
|
+
* @internal
|
|
263608
|
+
*/
|
|
263507
263609
|
class HalfEdgeMaskTester {
|
|
263508
263610
|
/**
|
|
263509
263611
|
* Constructor
|
|
@@ -263519,7 +263621,10 @@ class HalfEdgeMaskTester {
|
|
|
263519
263621
|
return edge.isMaskSet(this._targetMask) === this._targetValue;
|
|
263520
263622
|
}
|
|
263521
263623
|
}
|
|
263522
|
-
/**
|
|
263624
|
+
/**
|
|
263625
|
+
* Class for different types of searches for HalfEdgeGraph.
|
|
263626
|
+
* @internal
|
|
263627
|
+
*/
|
|
263523
263628
|
class HalfEdgeGraphSearch {
|
|
263524
263629
|
/**
|
|
263525
263630
|
* Static method for face area computation -- useful as function parameter in `collectFaceAreaSummary`.
|
|
@@ -263711,6 +263816,99 @@ class HalfEdgeGraphSearch {
|
|
|
263711
263816
|
HalfEdgeGraphSearch.correctParityInComponentArrays(parityMask, components);
|
|
263712
263817
|
return components;
|
|
263713
263818
|
}
|
|
263819
|
+
/**
|
|
263820
|
+
* Breadth First Search through connected component of a graph.
|
|
263821
|
+
* @param component vector of nodes, one per face.
|
|
263822
|
+
* @param seed seed node in component.
|
|
263823
|
+
* @param visitMask mask to apply to visited nodes. Assumed cleared throughout component.
|
|
263824
|
+
* @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to
|
|
263825
|
+
* ignore exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.
|
|
263826
|
+
* @param maxFaceCount (optional) maximum number of faces in the component. Should be positive; otherwise
|
|
263827
|
+
* `Infinity` is used.
|
|
263828
|
+
* @returns node at which to start next component if maximum face count exceeded, or undefined.
|
|
263829
|
+
*/
|
|
263830
|
+
static exploreComponent(component, seed, visitMask, ignoreMask = _Graph__WEBPACK_IMPORTED_MODULE_1__.HalfEdgeMask.EXTERIOR, maxFaceCount = Infinity) {
|
|
263831
|
+
if (maxFaceCount <= 0)
|
|
263832
|
+
maxFaceCount = Infinity;
|
|
263833
|
+
const boundaryMask = visitMask | ignoreMask;
|
|
263834
|
+
let numFaces = 0;
|
|
263835
|
+
const candidates = []; // the queue
|
|
263836
|
+
candidates.push(seed);
|
|
263837
|
+
while (candidates.length !== 0 && numFaces < maxFaceCount) {
|
|
263838
|
+
// shift is O(n) and may be inefficient for large queues; if needed, we can replace
|
|
263839
|
+
// queue by circular array or implement the queue using 2 stacks; both are O(1)
|
|
263840
|
+
const node = candidates.shift();
|
|
263841
|
+
if (node.isMaskSet(boundaryMask))
|
|
263842
|
+
continue;
|
|
263843
|
+
component.push(node);
|
|
263844
|
+
++numFaces;
|
|
263845
|
+
const enqueueNeighboringFaces = (heNode) => {
|
|
263846
|
+
heNode.setMask(visitMask);
|
|
263847
|
+
const neighbor = heNode.vertexSuccessor;
|
|
263848
|
+
if (!neighbor.isMaskSet(boundaryMask))
|
|
263849
|
+
candidates.push(neighbor);
|
|
263850
|
+
};
|
|
263851
|
+
node.collectAroundFace(enqueueNeighboringFaces);
|
|
263852
|
+
}
|
|
263853
|
+
if (candidates.length === 0)
|
|
263854
|
+
return undefined;
|
|
263855
|
+
else {
|
|
263856
|
+
const front = candidates[0];
|
|
263857
|
+
while (candidates.length !== 0) {
|
|
263858
|
+
// try to find a node at the boundary of both the geometry and previous component
|
|
263859
|
+
const node = candidates.shift(); // shift may be inefficient for large queues
|
|
263860
|
+
if (node.vertexSuccessor.isMaskSet(ignoreMask))
|
|
263861
|
+
return node;
|
|
263862
|
+
if (node.edgeMate.isMaskSet(ignoreMask))
|
|
263863
|
+
return node;
|
|
263864
|
+
}
|
|
263865
|
+
return front;
|
|
263866
|
+
}
|
|
263867
|
+
}
|
|
263868
|
+
/**
|
|
263869
|
+
* Collect connected components of the graph (via Breadth First Search).
|
|
263870
|
+
* @param graph graph to inspect.
|
|
263871
|
+
* @param maxFaceCount (optional) maximum number of faces in each component. Should be positive; otherwise
|
|
263872
|
+
* `Infinity` is used.
|
|
263873
|
+
* @param ignoreMask (optional) mask preset on faces to ignore. Default value is `HalfEdgeMask.EXTERIOR` to ignore
|
|
263874
|
+
* exterior faces. Pass `HalfEdgeMask.NULL_MASK` to process all faces.
|
|
263875
|
+
* @returns the components of the graph, each component represented by an array of nodes, one node per face
|
|
263876
|
+
* of the component. In other words, entry [i][j] is a HalfEdge in the j_th face loop of the i_th component.
|
|
263877
|
+
*/
|
|
263878
|
+
static collectConnectedComponents(graph, maxFaceCount = Infinity, ignoreMask = _Graph__WEBPACK_IMPORTED_MODULE_1__.HalfEdgeMask.EXTERIOR) {
|
|
263879
|
+
const components = [];
|
|
263880
|
+
if (graph.countMask(ignoreMask) === 0)
|
|
263881
|
+
ignoreMask = _Graph__WEBPACK_IMPORTED_MODULE_1__.HalfEdgeMask.NULL_MASK;
|
|
263882
|
+
const visitMask = _Graph__WEBPACK_IMPORTED_MODULE_1__.HalfEdgeMask.VISITED;
|
|
263883
|
+
const boundaryMask = visitMask | ignoreMask;
|
|
263884
|
+
// Starting with the input node, look ahead for a boundary face. Failing that, return the input node.
|
|
263885
|
+
// Starting all floods at the boundary reduces the chance of ending up with a ring-shaped component at the boundary.
|
|
263886
|
+
const findNextFloodSeed = (index) => {
|
|
263887
|
+
for (let i = index; i < graph.countNodes(); ++i) {
|
|
263888
|
+
if (!graph.allHalfEdges[i].isMaskSet(boundaryMask)
|
|
263889
|
+
&& graph.allHalfEdges[i].edgeMate.isMaskSet(boundaryMask)) {
|
|
263890
|
+
index = i;
|
|
263891
|
+
break;
|
|
263892
|
+
}
|
|
263893
|
+
}
|
|
263894
|
+
return index;
|
|
263895
|
+
};
|
|
263896
|
+
for (let i = 0; i < graph.countNodes(); ++i) {
|
|
263897
|
+
if (graph.allHalfEdges[i].isMaskSet(boundaryMask))
|
|
263898
|
+
continue;
|
|
263899
|
+
const i0 = findNextFloodSeed(i);
|
|
263900
|
+
let seed = graph.allHalfEdges[i0];
|
|
263901
|
+
do { // flood this component
|
|
263902
|
+
const component = [];
|
|
263903
|
+
seed = HalfEdgeGraphSearch.exploreComponent(component, seed, visitMask, ignoreMask, maxFaceCount);
|
|
263904
|
+
if (component.length !== 0)
|
|
263905
|
+
components.push(component);
|
|
263906
|
+
} while (seed !== undefined);
|
|
263907
|
+
if (!graph.allHalfEdges[i].isMaskSet(visitMask))
|
|
263908
|
+
--i; // reprocess this node
|
|
263909
|
+
}
|
|
263910
|
+
return components;
|
|
263911
|
+
}
|
|
263714
263912
|
/**
|
|
263715
263913
|
* Test if test point (xTest,yTest) is inside/outside a face or on an edge.
|
|
263716
263914
|
* @param seedNode any node on the face loop.
|
|
@@ -288215,7 +288413,7 @@ class TestContext {
|
|
|
288215
288413
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
288216
288414
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
288217
288415
|
await core_frontend_1.NoRenderApp.startup({
|
|
288218
|
-
applicationVersion: "4.4.0-dev.
|
|
288416
|
+
applicationVersion: "4.4.0-dev.26",
|
|
288219
288417
|
applicationId: this.settings.gprid,
|
|
288220
288418
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
288221
288419
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -307027,7 +307225,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
307027
307225
|
/***/ ((module) => {
|
|
307028
307226
|
|
|
307029
307227
|
"use strict";
|
|
307030
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.
|
|
307228
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.26","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.4.0-dev.26","@itwin/core-bentley":"workspace:^4.4.0-dev.26","@itwin/core-common":"workspace:^4.4.0-dev.26","@itwin/core-geometry":"workspace:^4.4.0-dev.26","@itwin/core-orbitgt":"workspace:^4.4.0-dev.26","@itwin/core-quantity":"workspace:^4.4.0-dev.26"},"//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","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
307031
307229
|
|
|
307032
307230
|
/***/ }),
|
|
307033
307231
|
|