@itwin/ecschema-rpcinterface-tests 4.4.0-dev.7 → 4.4.0-dev.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"_bea9.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\17\\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":""}
1
+ {"version":3,"file":"_bea9.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_b\\10\\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":""}
@@ -37043,6 +37043,8 @@ class EcefLocation {
37043
37043
  getTransform() { return this._transform; }
37044
37044
  /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */
37045
37045
  constructor(props) {
37046
+ /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */
37047
+ this._transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
37046
37048
  this.origin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(props.origin).freeze();
37047
37049
  this.orientation = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.YawPitchRollAngles.fromJSON(props.orientation).freeze();
37048
37050
  if (props.cartographicOrigin)
@@ -37051,16 +37053,22 @@ class EcefLocation {
37051
37053
  this.xVector = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.fromJSON(props.xVector).freeze();
37052
37054
  this.yVector = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.fromJSON(props.yVector).freeze();
37053
37055
  }
37054
- let matrix;
37055
- if (this.xVector && this.yVector) {
37056
- const zVector = this.xVector.crossProduct(this.yVector);
37057
- if (zVector.normalizeInPlace())
37058
- matrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createColumns(this.xVector, this.yVector, zVector);
37056
+ if (props.transform) {
37057
+ this._transform.setFromJSON(props.transform);
37058
+ this._transform.freeze();
37059
+ }
37060
+ else {
37061
+ let matrix;
37062
+ if (this.xVector && this.yVector) {
37063
+ const zVector = this.xVector.crossProduct(this.yVector);
37064
+ if (zVector.normalizeInPlace())
37065
+ matrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createColumns(this.xVector, this.yVector, zVector);
37066
+ }
37067
+ if (!matrix)
37068
+ matrix = this.orientation.toMatrix3d();
37069
+ this._transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(this.origin, matrix);
37070
+ this._transform.freeze();
37059
37071
  }
37060
- if (!matrix)
37061
- matrix = this.orientation.toMatrix3d();
37062
- this._transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(this.origin, matrix);
37063
- this._transform.freeze();
37064
37072
  }
37065
37073
  /** Returns true if this EcefLocation is not located at the center of the Earth.
37066
37074
  * @alpha are locations very close to the center considered valid? What are the specific criteria?
@@ -37089,6 +37097,14 @@ class EcefLocation {
37089
37097
  }
37090
37098
  return new EcefLocation({ origin: ecefOrigin, orientation: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.YawPitchRollAngles.createFromMatrix3d(matrix), cartographicOrigin: origin });
37091
37099
  }
37100
+ /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */
37101
+ static createFromTransform(transform) {
37102
+ const ecefOrigin = transform.getOrigin();
37103
+ const angleFromInput = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.YawPitchRollAngles.createDegrees(0, 0, 0);
37104
+ const locationOrientationFromInputT = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);
37105
+ const transformProps = transform.toJSON();
37106
+ return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });
37107
+ }
37092
37108
  /** Get the location center of the earth in the iModel coordinate system. */
37093
37109
  get earthCenter() {
37094
37110
  const matrix = this.orientation.toMatrix3d();
@@ -37104,6 +37120,8 @@ class EcefLocation {
37104
37120
  return false;
37105
37121
  if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))
37106
37122
  return false;
37123
+ if (!this.getTransform().isAlmostEqual(other.getTransform()))
37124
+ return false;
37107
37125
  const thisCarto = this.cartographicOrigin;
37108
37126
  const otherCarto = other.cartographicOrigin;
37109
37127
  if (undefined === thisCarto || undefined === otherCarto)
@@ -37114,6 +37132,7 @@ class EcefLocation {
37114
37132
  const props = {
37115
37133
  origin: this.origin.toJSON(),
37116
37134
  orientation: this.orientation.toJSON(),
37135
+ transform: this.getTransform().toJSON(),
37117
37136
  };
37118
37137
  if (this.cartographicOrigin)
37119
37138
  props.cartographicOrigin = this.cartographicOrigin.toJSON();
@@ -47934,8 +47953,28 @@ var ElementGeometry;
47934
47953
  return textString.toJSON();
47935
47954
  }
47936
47955
  ElementGeometry.toTextString = toTextString;
47956
+ /** Returns only the [[TextStringGlyphData]] embedded in the [[TextString]] flatbuffer. This data is only internal to the native display libaries. */
47957
+ function toTextStringGlyphData(entry) {
47958
+ if (ElementGeometryOpcode.TextString !== entry.opcode)
47959
+ return undefined;
47960
+ const buffer = new flatbuffers__WEBPACK_IMPORTED_MODULE_0__.flatbuffers.ByteBuffer(entry.data);
47961
+ const ppfb = _ElementGeometryFB__WEBPACK_IMPORTED_MODULE_3__.EGFBAccessors.TextString.getRootAsTextString(buffer);
47962
+ const glyphOriginToPoint2d = (origin) => {
47963
+ if (!origin)
47964
+ throw new Error("Value cannot be null.");
47965
+ return new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point2d(origin.x(), origin.y());
47966
+ };
47967
+ const textStringRangeToRange2d = (r) => r ? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range2d(r.lowx(), r.lowy(), r.highx(), r.highy()) : null;
47968
+ const range = textStringRangeToRange2d(ppfb.range());
47969
+ const glyphIds = Array.from({ length: ppfb.glyphIdsLength() }, (_, i) => ppfb.glyphIds(i) ?? 0);
47970
+ const glyphOrigins = Array.from({ length: ppfb.glyphOriginsLength() }, (_, i) => glyphOriginToPoint2d(ppfb.glyphOrigins(i)));
47971
+ if (!range || range.isNull || glyphIds.length === 0 || glyphOrigins.length === 0)
47972
+ return undefined;
47973
+ return { glyphIds, glyphOrigins, range };
47974
+ }
47975
+ ElementGeometry.toTextStringGlyphData = toTextStringGlyphData;
47937
47976
  /** Create entry from a [[TextString]] */
47938
- function fromTextString(text, worldToLocal) {
47977
+ function fromTextString(text, worldToLocal, glyphs) {
47939
47978
  if (undefined !== worldToLocal) {
47940
47979
  const localText = new _TextString__WEBPACK_IMPORTED_MODULE_5__.TextString(text);
47941
47980
  if (!localText.transformInPlace(worldToLocal))
@@ -47946,6 +47985,17 @@ var ElementGeometry;
47946
47985
  const builder = _ElementGeometryFB__WEBPACK_IMPORTED_MODULE_3__.EGFBAccessors.TextString;
47947
47986
  const textOffset = fbb.createString(text.text);
47948
47987
  const styleOffset = _ElementGeometryFB__WEBPACK_IMPORTED_MODULE_3__.EGFBAccessors.TextStringStyle.createTextStringStyle(fbb, 1, 0, text.font, undefined === text.bold ? false : text.bold, undefined === text.italic ? false : text.italic, undefined === text.underline ? false : text.underline, text.height, undefined === text.widthFactor ? 1.0 : text.widthFactor);
47988
+ const fbbGlyphs = (() => {
47989
+ if (!glyphs || glyphs.range.isNull)
47990
+ return undefined;
47991
+ const glyphIdsOffset = builder.createGlyphIdsVector(fbb, glyphs.glyphIds);
47992
+ builder.startGlyphOriginsVector(fbb, glyphs.glyphOrigins.length);
47993
+ for (const origin of [...glyphs.glyphOrigins].reverse()) {
47994
+ _ElementGeometryFB__WEBPACK_IMPORTED_MODULE_3__.EGFBAccessors.TextStringGlyphOrigin.createTextStringGlyphOrigin(fbb, origin.x, origin.y);
47995
+ }
47996
+ const glyphOriginsOffset = fbb.endVector();
47997
+ return { glyphIdsOffset, glyphOriginsOffset, range: glyphs.range };
47998
+ })();
47949
47999
  builder.startTextString(fbb);
47950
48000
  builder.addMajorVersion(fbb, 1);
47951
48001
  builder.addMinorVersion(fbb, 0);
@@ -47959,6 +48009,11 @@ var ElementGeometry;
47959
48009
  const transformOffset = _ElementGeometryFB__WEBPACK_IMPORTED_MODULE_3__.EGFBAccessors.TextStringTransform.createTextStringTransform(fbb, coffs[0], coffs[1], coffs[2], origin.x, coffs[3], coffs[4], coffs[5], origin.y, coffs[6], coffs[7], coffs[8], origin.z);
47960
48010
  builder.addTransform(fbb, transformOffset);
47961
48011
  }
48012
+ if (fbbGlyphs) {
48013
+ builder.addRange(fbb, _ElementGeometryFB__WEBPACK_IMPORTED_MODULE_3__.EGFBAccessors.TextStringRange.createTextStringRange(fbb, fbbGlyphs.range.low.x, fbbGlyphs.range.low.y, fbbGlyphs.range.high.x, fbbGlyphs.range.high.y));
48014
+ builder.addGlyphIds(fbb, fbbGlyphs.glyphIdsOffset);
48015
+ builder.addGlyphOrigins(fbb, fbbGlyphs.glyphOriginsOffset);
48016
+ }
47962
48017
  const mLoc = builder.endTextString(fbb);
47963
48018
  fbb.finish(mLoc);
47964
48019
  const data = fbb.asUint8Array();
@@ -145715,14 +145770,16 @@ class ThreeDTileFormatInterpreter {
145715
145770
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(loggerCategory, "RealityData NOT Geolocated", () => ({ ...location }));
145716
145771
  }
145717
145772
  else {
145718
- let ecefLocation;
145719
- const locationOrientation = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.YawPitchRollAngles.tryFromTransform(worldToEcefTransform);
145773
+ let ecefLocation = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.EcefLocation.createFromTransform(worldToEcefTransform);
145720
145774
  // Fix Bug 445630: [RDV][Regression] Orientation of georeferenced Reality Mesh is wrong.
145721
145775
  // Use json.root.transform only if defined and not identity -> otherwise will use a transform computed from cartographic center.
145722
- if (!worldToEcefTransform.matrix.isIdentity && locationOrientation !== undefined && locationOrientation.angles !== undefined)
145723
- ecefLocation = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.EcefLocation({ origin: locationOrientation.origin, orientation: locationOrientation.angles.toJSON() });
145724
- else
145725
- ecefLocation = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.EcefLocation.createFromCartographicOrigin(cartoCenter);
145776
+ if (worldToEcefTransform.matrix.isIdentity) {
145777
+ // For georeferenced Reality Meshes, its origin is translated to model origin (0,0,0).
145778
+ // Apply range center to translate it back to its original position.
145779
+ const worldCenter = !worldToEcefTransform.matrix.isIdentity ? range.center : undefined;
145780
+ if (cartoCenter)
145781
+ ecefLocation = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.EcefLocation.createFromCartographicOrigin(cartoCenter, worldCenter);
145782
+ }
145726
145783
  location = ecefLocation;
145727
145784
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(loggerCategory, "RealityData is worldToEcefTransform.matrix.isIdentity", () => ({ isIdentity: worldToEcefTransform.matrix.isIdentity }));
145728
145785
  // iModelDb.setEcefLocation(ecefLocation);
@@ -290116,7 +290173,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
290116
290173
  /***/ ((module) => {
290117
290174
 
290118
290175
  "use strict";
290119
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.7","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","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.7","@itwin/core-bentley":"workspace:^4.4.0-dev.7","@itwin/core-common":"workspace:^4.4.0-dev.7","@itwin/core-geometry":"workspace:^4.4.0-dev.7","@itwin/core-orbitgt":"workspace:^4.4.0-dev.7","@itwin/core-quantity":"workspace:^4.4.0-dev.7"},"//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.1.0","@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"}}');
290176
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.9","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","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.9","@itwin/core-bentley":"workspace:^4.4.0-dev.9","@itwin/core-common":"workspace:^4.4.0-dev.9","@itwin/core-geometry":"workspace:^4.4.0-dev.9","@itwin/core-orbitgt":"workspace:^4.4.0-dev.9","@itwin/core-quantity":"workspace:^4.4.0-dev.9"},"//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.1.0","@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"}}');
290120
290177
 
290121
290178
  /***/ })
290122
290179