@itwin/ecschema-rpcinterface-tests 5.6.1 → 5.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/bundled-tests.js +109 -26
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -152020,26 +152020,53 @@ class RealityTileLoader {
|
|
|
152020
152020
|
}
|
|
152021
152021
|
async loadGeometryFromStream(tile, streamBuffer, system) {
|
|
152022
152022
|
const format = this._getFormat(streamBuffer);
|
|
152023
|
-
if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.B3dm)
|
|
152023
|
+
if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.B3dm && format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.Gltf) {
|
|
152024
152024
|
return {};
|
|
152025
|
+
}
|
|
152025
152026
|
const { is3d, yAxisUp, iModel, modelId } = tile.realityRoot;
|
|
152026
|
-
|
|
152027
|
-
|
|
152028
|
-
reader.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_6__.GltfWrapMode.ClampToEdge;
|
|
152027
|
+
let reader;
|
|
152028
|
+
// Create final transform from tree's iModelTransform and transformToRoot
|
|
152029
152029
|
let transform = tile.tree.iModelTransform;
|
|
152030
152030
|
if (tile.transformToRoot) {
|
|
152031
152031
|
transform = transform.multiplyTransformTransform(tile.transformToRoot);
|
|
152032
152032
|
}
|
|
152033
|
-
|
|
152033
|
+
switch (format) {
|
|
152034
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.Gltf:
|
|
152035
|
+
const props = createReaderPropsWithBaseUrl(streamBuffer, yAxisUp, tile.tree.baseUrl);
|
|
152036
|
+
if (props) {
|
|
152037
|
+
reader = new _tile_internal__WEBPACK_IMPORTED_MODULE_7__.GltfGraphicsReader(props, {
|
|
152038
|
+
iModel,
|
|
152039
|
+
gltf: props.glTF,
|
|
152040
|
+
contentRange: tile.contentRange,
|
|
152041
|
+
transform: tile.transformToRoot,
|
|
152042
|
+
hasChildren: !tile.isLeaf,
|
|
152043
|
+
pickableOptions: { id: modelId },
|
|
152044
|
+
idMap: this.getBatchIdMap()
|
|
152045
|
+
});
|
|
152046
|
+
}
|
|
152047
|
+
break;
|
|
152048
|
+
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.B3dm:
|
|
152049
|
+
reader = _tile_internal__WEBPACK_IMPORTED_MODULE_7__.B3dmReader.create(streamBuffer, iModel, modelId, is3d, tile.contentRange, system, yAxisUp, tile.isLeaf, tile.center, tile.transformToRoot, undefined, this.getBatchIdMap());
|
|
152050
|
+
if (reader)
|
|
152051
|
+
reader.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_6__.GltfWrapMode.ClampToEdge;
|
|
152052
|
+
break;
|
|
152053
|
+
}
|
|
152054
|
+
const geom = await reader?.readGltfAndCreateGeometry(transform);
|
|
152034
152055
|
// See RealityTileTree.reprojectAndResolveChildren for how reprojectionTransform is calculated
|
|
152056
|
+
// xForm is defined in root tile CRS, while geom is defined in iModel CRS
|
|
152035
152057
|
const xForm = tile.reprojectionTransform;
|
|
152036
|
-
if (tile.tree.reprojectGeometry && geom?.polyfaces && xForm) {
|
|
152037
|
-
|
|
152038
|
-
|
|
152039
|
-
|
|
152040
|
-
|
|
152041
|
-
|
|
152058
|
+
if (tile.tree.reprojectGeometry && geom?.polyfaces?.length && xForm) {
|
|
152059
|
+
// Transform from iModel/Db CRS -> root tile CRS
|
|
152060
|
+
const dbToRoot = tile.tree.iModelTransform.inverse();
|
|
152061
|
+
if (dbToRoot) {
|
|
152062
|
+
// Conjugate xForm to apply it to polyfaces in iModel CRS:
|
|
152063
|
+
// dbToRoot converts to root tile CRS, xForm applies reprojection, iModelTransform converts back
|
|
152064
|
+
const polyfaceReprojectionTransform = tile.tree.iModelTransform.multiplyTransformTransform(xForm).multiplyTransformTransform(dbToRoot);
|
|
152065
|
+
const polyfaces = geom.polyfaces.map((pf) => pf.cloneTransformed(polyfaceReprojectionTransform));
|
|
152066
|
+
return { geometry: { polyfaces } };
|
|
152067
|
+
}
|
|
152042
152068
|
}
|
|
152069
|
+
return { geometry: geom };
|
|
152043
152070
|
}
|
|
152044
152071
|
async loadGraphicsFromStream(tile, streamBuffer, system, isCanceled) {
|
|
152045
152072
|
const format = this._getFormat(streamBuffer);
|
|
@@ -154928,7 +154955,13 @@ class WmtsMapLayerImageryProvider extends _tile_internal__WEBPACK_IMPORTED_MODUL
|
|
|
154928
154955
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false); // Must always hava a matrix set.
|
|
154929
154956
|
return;
|
|
154930
154957
|
}
|
|
154931
|
-
const
|
|
154958
|
+
const childLevel = quadId.level + 1;
|
|
154959
|
+
const childMatrixId = matrixSetAndLimits.tileMatrixSet.tileMatrix.length > childLevel
|
|
154960
|
+
? matrixSetAndLimits.tileMatrixSet.tileMatrix[childLevel].identifier
|
|
154961
|
+
: undefined;
|
|
154962
|
+
const limits = childMatrixId !== undefined
|
|
154963
|
+
? matrixSetAndLimits.limits?.find((l) => l.tileMatrix === childMatrixId)?.limits
|
|
154964
|
+
: undefined;
|
|
154932
154965
|
if (!limits) {
|
|
154933
154966
|
resolveChildren(childIds);
|
|
154934
154967
|
return;
|
|
@@ -155961,7 +155994,7 @@ var WmtsCapability;
|
|
|
155961
155994
|
this.tileMatrixSet = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.expectDefined)(getElementTextContent(elem, "TileMatrixSet", ""));
|
|
155962
155995
|
const tileMatrixLimitsRoot = elem.getElementsByTagName("TileMatrixSetLimits");
|
|
155963
155996
|
if (tileMatrixLimitsRoot.length > 0) {
|
|
155964
|
-
const tileMatrixLimits = tileMatrixLimitsRoot[0].getElementsByTagName("
|
|
155997
|
+
const tileMatrixLimits = tileMatrixLimitsRoot[0].getElementsByTagName("TileMatrixLimits");
|
|
155965
155998
|
for (const tmsl of tileMatrixLimits) {
|
|
155966
155999
|
this.tileMatrixSetLimits.push(new TileMatrixSetLimits(tmsl));
|
|
155967
156000
|
}
|
|
@@ -156988,7 +157021,7 @@ class QuantityTypeFormatsProvider {
|
|
|
156988
157021
|
["DefaultToolsUnits.VOLUME", QuantityType.Volume],
|
|
156989
157022
|
["DefaultToolsUnits.LENGTH_COORDINATE", QuantityType.Coordinate],
|
|
156990
157023
|
["CivilUnits.STATION", QuantityType.Stationing],
|
|
156991
|
-
["CivilUnits.LENGTH", QuantityType.
|
|
157024
|
+
["CivilUnits.LENGTH", QuantityType.LengthEngineering],
|
|
156992
157025
|
["AecUnits.LENGTH", QuantityType.LengthEngineering]
|
|
156993
157026
|
]);
|
|
156994
157027
|
async getFormat(name) {
|
|
@@ -160965,7 +160998,7 @@ class GltfReaderProps {
|
|
|
160965
160998
|
}
|
|
160966
160999
|
/** The GltfMeshData contains the raw GLTF mesh data. If the data is suitable to create a [[RealityMesh]] directly, basically in the quantized format produced by
|
|
160967
161000
|
* ContextCapture, then a RealityMesh is created directly from this data. Otherwise, the mesh primitive is populated from the raw data and a MeshPrimitive
|
|
160968
|
-
* is generated. The
|
|
161001
|
+
* is generated. The MeshPrimitive path is much less efficient but should be rarely used.
|
|
160969
161002
|
*
|
|
160970
161003
|
* @internal
|
|
160971
161004
|
*/
|
|
@@ -161252,7 +161285,8 @@ class GltfReader {
|
|
|
161252
161285
|
}),
|
|
161253
161286
|
};
|
|
161254
161287
|
}
|
|
161255
|
-
readGltfAndCreateGeometry(transformToRoot, needNormals = false, needParams = false) {
|
|
161288
|
+
async readGltfAndCreateGeometry(transformToRoot, needNormals = false, needParams = false) {
|
|
161289
|
+
await this.resolveResources();
|
|
161256
161290
|
const transformStack = new TransformStack(this.getTileTransform(transformToRoot));
|
|
161257
161291
|
const polyfaces = [];
|
|
161258
161292
|
for (const nodeKey of this._sceneNodes) {
|
|
@@ -161487,9 +161521,18 @@ class GltfReader {
|
|
|
161487
161521
|
}
|
|
161488
161522
|
}
|
|
161489
161523
|
polyfaceFromGltfMesh(mesh, transform, needNormals, needParams) {
|
|
161490
|
-
if (
|
|
161524
|
+
if (mesh.pointQParams && mesh.points && mesh.indices)
|
|
161525
|
+
return this.polyfaceFromQuantizedData(mesh.pointQParams, mesh.points, mesh.indices, mesh.normals, mesh.uvQParams, mesh.uvs, transform, needNormals, needParams);
|
|
161526
|
+
const meshPrim = mesh.primitive;
|
|
161527
|
+
const triangles = meshPrim.triangles;
|
|
161528
|
+
const points = meshPrim.points;
|
|
161529
|
+
if (!triangles || triangles.isEmpty || points.length === 0)
|
|
161491
161530
|
return undefined;
|
|
161492
|
-
|
|
161531
|
+
// This will likely only be the case for Draco-compressed meshes-- see where readDracoMeshPrimitive is called within readMeshPrimitive
|
|
161532
|
+
// That is the only case where mesh.primitive is populated but mesh.pointQParams, mesh.points, & mesh.indices are not
|
|
161533
|
+
return this.polyfaceFromMeshPrimitive(triangles, points, meshPrim.normals, meshPrim.uvParams, transform, needNormals, needParams);
|
|
161534
|
+
}
|
|
161535
|
+
polyfaceFromQuantizedData(pointQParams, points, indices, normals, uvQParams, uvs, transform, needNormals, needParams) {
|
|
161493
161536
|
const includeNormals = needNormals && undefined !== normals;
|
|
161494
161537
|
const includeParams = needParams && undefined !== uvQParams && undefined !== uvs;
|
|
161495
161538
|
const polyface = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.IndexedPolyface.create(includeNormals, includeParams);
|
|
@@ -161517,6 +161560,46 @@ class GltfReader {
|
|
|
161517
161560
|
}
|
|
161518
161561
|
return polyface;
|
|
161519
161562
|
}
|
|
161563
|
+
polyfaceFromMeshPrimitive(triangles, points, normals, uvParams, transform, needNormals, needParams) {
|
|
161564
|
+
const includeNormals = needNormals && normals.length > 0;
|
|
161565
|
+
const includeParams = needParams && uvParams.length > 0;
|
|
161566
|
+
const polyface = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.IndexedPolyface.create(includeNormals, includeParams);
|
|
161567
|
+
if (points instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QPoint3dList) {
|
|
161568
|
+
for (let i = 0; i < points.length; i++) {
|
|
161569
|
+
const point = points.unquantize(i);
|
|
161570
|
+
if (transform)
|
|
161571
|
+
transform.multiplyPoint3d(point, point);
|
|
161572
|
+
polyface.addPoint(point);
|
|
161573
|
+
}
|
|
161574
|
+
}
|
|
161575
|
+
else {
|
|
161576
|
+
const center = points.range.center;
|
|
161577
|
+
for (const pt of points) {
|
|
161578
|
+
const point = pt.plus(center);
|
|
161579
|
+
if (transform)
|
|
161580
|
+
transform.multiplyPoint3d(point, point);
|
|
161581
|
+
polyface.addPoint(point);
|
|
161582
|
+
}
|
|
161583
|
+
}
|
|
161584
|
+
if (includeNormals)
|
|
161585
|
+
for (const normal of normals)
|
|
161586
|
+
polyface.addNormal(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.OctEncodedNormal.decodeValue(normal.value));
|
|
161587
|
+
if (includeParams)
|
|
161588
|
+
for (const uv of uvParams)
|
|
161589
|
+
polyface.addParam(uv);
|
|
161590
|
+
const indices = triangles.indices;
|
|
161591
|
+
let j = 0;
|
|
161592
|
+
for (const index of indices) {
|
|
161593
|
+
polyface.addPointIndex(index);
|
|
161594
|
+
if (includeNormals)
|
|
161595
|
+
polyface.addNormalIndex(index);
|
|
161596
|
+
if (includeParams)
|
|
161597
|
+
polyface.addParamIndex(index);
|
|
161598
|
+
if (0 === (++j % 3))
|
|
161599
|
+
polyface.terminateFacet();
|
|
161600
|
+
}
|
|
161601
|
+
return polyface;
|
|
161602
|
+
}
|
|
161520
161603
|
// ###TODO what is the actual type of `json`?
|
|
161521
161604
|
getBufferView(json, accessorName) {
|
|
161522
161605
|
try {
|
|
@@ -168895,20 +168978,19 @@ class ImageryMapTile extends _internal__WEBPACK_IMPORTED_MODULE_4__.RealityTile
|
|
|
168895
168978
|
setContent(content) {
|
|
168896
168979
|
this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.
|
|
168897
168980
|
if (undefined === content.imageryTexture)
|
|
168898
|
-
|
|
168981
|
+
this.setLeaf(); // No imagery here — don't traverse deeper, but leave siblings unaffected.
|
|
168899
168982
|
this.setIsReady();
|
|
168900
168983
|
}
|
|
168901
168984
|
selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, rectangleToDrape, drapePixelSize, args) {
|
|
168902
168985
|
// Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.
|
|
168903
168986
|
const isSmallerThanDrape = (this.rectangle.xLength() / this.maximumSize) < drapePixelSize;
|
|
168904
|
-
if ((this.isLeaf) // Include leaves so tiles get stretched past max LOD levels. (Only for base imagery layer)
|
|
168905
|
-
|| isSmallerThanDrape
|
|
168906
|
-
|| this._anyChildNotFound) {
|
|
168987
|
+
if ((this.isLeaf && !this.isNotFound) // Include leaves so tiles get stretched past max LOD levels. (Only for base imagery layer)
|
|
168988
|
+
|| isSmallerThanDrape) {
|
|
168907
168989
|
if (this.isOutOfLodRange) {
|
|
168908
168990
|
drapeTiles.push(this);
|
|
168909
168991
|
this.setIsReady();
|
|
168910
168992
|
}
|
|
168911
|
-
else if (this.isLeaf && !isSmallerThanDrape
|
|
168993
|
+
else if (this.isLeaf && !isSmallerThanDrape) {
|
|
168912
168994
|
// These tiles are selected because we are beyond the max LOD of the tile tree,
|
|
168913
168995
|
// might be used to display "stretched" tiles instead of having blank.
|
|
168914
168996
|
highResolutionReplacementTiles.push(this);
|
|
@@ -168926,8 +169008,9 @@ class ImageryMapTile extends _internal__WEBPACK_IMPORTED_MODULE_4__.RealityTile
|
|
|
168926
169008
|
if (undefined !== this.children) {
|
|
168927
169009
|
for (const child of this.children) {
|
|
168928
169010
|
const mapChild = child;
|
|
168929
|
-
if (mapChild.rectangle.intersectsRange(rectangleToDrape))
|
|
168930
|
-
|
|
169011
|
+
if (!mapChild.rectangle.intersectsRange(rectangleToDrape))
|
|
169012
|
+
continue;
|
|
169013
|
+
status = mapChild.selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, rectangleToDrape, drapePixelSize, args);
|
|
168931
169014
|
if (_internal__WEBPACK_IMPORTED_MODULE_4__.TileTreeLoadStatus.Loaded !== status)
|
|
168932
169015
|
break;
|
|
168933
169016
|
}
|
|
@@ -321355,7 +321438,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
321355
321438
|
/***/ ((module) => {
|
|
321356
321439
|
|
|
321357
321440
|
"use strict";
|
|
321358
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.6.
|
|
321441
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.6.3","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","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":{"@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","typemoq":"^2.1.0","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"}}');
|
|
321359
321442
|
|
|
321360
321443
|
/***/ })
|
|
321361
321444
|
|