@itwin/ecschema-rpcinterface-tests 5.6.1 → 5.6.2
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 +81 -10
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -152020,17 +152020,38 @@ 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
|
|
152035
152056
|
const xForm = tile.reprojectionTransform;
|
|
152036
152057
|
if (tile.tree.reprojectGeometry && geom?.polyfaces && xForm) {
|
|
@@ -160965,7 +160986,7 @@ class GltfReaderProps {
|
|
|
160965
160986
|
}
|
|
160966
160987
|
/** 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
160988
|
* 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
|
|
160989
|
+
* is generated. The MeshPrimitive path is much less efficient but should be rarely used.
|
|
160969
160990
|
*
|
|
160970
160991
|
* @internal
|
|
160971
160992
|
*/
|
|
@@ -161252,7 +161273,8 @@ class GltfReader {
|
|
|
161252
161273
|
}),
|
|
161253
161274
|
};
|
|
161254
161275
|
}
|
|
161255
|
-
readGltfAndCreateGeometry(transformToRoot, needNormals = false, needParams = false) {
|
|
161276
|
+
async readGltfAndCreateGeometry(transformToRoot, needNormals = false, needParams = false) {
|
|
161277
|
+
await this.resolveResources();
|
|
161256
161278
|
const transformStack = new TransformStack(this.getTileTransform(transformToRoot));
|
|
161257
161279
|
const polyfaces = [];
|
|
161258
161280
|
for (const nodeKey of this._sceneNodes) {
|
|
@@ -161487,9 +161509,18 @@ class GltfReader {
|
|
|
161487
161509
|
}
|
|
161488
161510
|
}
|
|
161489
161511
|
polyfaceFromGltfMesh(mesh, transform, needNormals, needParams) {
|
|
161490
|
-
if (
|
|
161512
|
+
if (mesh.pointQParams && mesh.points && mesh.indices)
|
|
161513
|
+
return this.polyfaceFromQuantizedData(mesh.pointQParams, mesh.points, mesh.indices, mesh.normals, mesh.uvQParams, mesh.uvs, transform, needNormals, needParams);
|
|
161514
|
+
const meshPrim = mesh.primitive;
|
|
161515
|
+
const triangles = meshPrim.triangles;
|
|
161516
|
+
const points = meshPrim.points;
|
|
161517
|
+
if (!triangles || triangles.isEmpty || points.length === 0)
|
|
161491
161518
|
return undefined;
|
|
161492
|
-
|
|
161519
|
+
// This will likely only be the case for Draco-compressed meshes-- see where readDracoMeshPrimitive is called within readMeshPrimitive
|
|
161520
|
+
// That is the only case where mesh.primitive is populated but mesh.pointQParams, mesh.points, & mesh.indices are not
|
|
161521
|
+
return this.polyfaceFromMeshPrimitive(triangles, points, meshPrim.normals, meshPrim.uvParams, transform, needNormals, needParams);
|
|
161522
|
+
}
|
|
161523
|
+
polyfaceFromQuantizedData(pointQParams, points, indices, normals, uvQParams, uvs, transform, needNormals, needParams) {
|
|
161493
161524
|
const includeNormals = needNormals && undefined !== normals;
|
|
161494
161525
|
const includeParams = needParams && undefined !== uvQParams && undefined !== uvs;
|
|
161495
161526
|
const polyface = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.IndexedPolyface.create(includeNormals, includeParams);
|
|
@@ -161517,6 +161548,46 @@ class GltfReader {
|
|
|
161517
161548
|
}
|
|
161518
161549
|
return polyface;
|
|
161519
161550
|
}
|
|
161551
|
+
polyfaceFromMeshPrimitive(triangles, points, normals, uvParams, transform, needNormals, needParams) {
|
|
161552
|
+
const includeNormals = needNormals && normals.length > 0;
|
|
161553
|
+
const includeParams = needParams && uvParams.length > 0;
|
|
161554
|
+
const polyface = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.IndexedPolyface.create(includeNormals, includeParams);
|
|
161555
|
+
if (points instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QPoint3dList) {
|
|
161556
|
+
for (let i = 0; i < points.length; i++) {
|
|
161557
|
+
const point = points.unquantize(i);
|
|
161558
|
+
if (transform)
|
|
161559
|
+
transform.multiplyPoint3d(point, point);
|
|
161560
|
+
polyface.addPoint(point);
|
|
161561
|
+
}
|
|
161562
|
+
}
|
|
161563
|
+
else {
|
|
161564
|
+
const center = points.range.center;
|
|
161565
|
+
for (const pt of points) {
|
|
161566
|
+
const point = pt.plus(center);
|
|
161567
|
+
if (transform)
|
|
161568
|
+
transform.multiplyPoint3d(point, point);
|
|
161569
|
+
polyface.addPoint(point);
|
|
161570
|
+
}
|
|
161571
|
+
}
|
|
161572
|
+
if (includeNormals)
|
|
161573
|
+
for (const normal of normals)
|
|
161574
|
+
polyface.addNormal(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.OctEncodedNormal.decodeValue(normal.value));
|
|
161575
|
+
if (includeParams)
|
|
161576
|
+
for (const uv of uvParams)
|
|
161577
|
+
polyface.addParam(uv);
|
|
161578
|
+
const indices = triangles.indices;
|
|
161579
|
+
let j = 0;
|
|
161580
|
+
for (const index of indices) {
|
|
161581
|
+
polyface.addPointIndex(index);
|
|
161582
|
+
if (includeNormals)
|
|
161583
|
+
polyface.addNormalIndex(index);
|
|
161584
|
+
if (includeParams)
|
|
161585
|
+
polyface.addParamIndex(index);
|
|
161586
|
+
if (0 === (++j % 3))
|
|
161587
|
+
polyface.terminateFacet();
|
|
161588
|
+
}
|
|
161589
|
+
return polyface;
|
|
161590
|
+
}
|
|
161520
161591
|
// ###TODO what is the actual type of `json`?
|
|
161521
161592
|
getBufferView(json, accessorName) {
|
|
161522
161593
|
try {
|
|
@@ -321355,7 +321426,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
321355
321426
|
/***/ ((module) => {
|
|
321356
321427
|
|
|
321357
321428
|
"use strict";
|
|
321358
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.6.
|
|
321429
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.6.2","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
321430
|
|
|
321360
321431
|
/***/ })
|
|
321361
321432
|
|