@itwin/ecschema-rpcinterface-tests 3.6.0-dev.3 → 3.6.0-dev.5
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 +84 -64
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -112518,13 +112518,13 @@ class EnvironmentDecorations {
|
|
|
112518
112518
|
this._onLoaded = onLoaded;
|
|
112519
112519
|
this._onDispose = onDispose;
|
|
112520
112520
|
this._sky = {};
|
|
112521
|
-
this.
|
|
112521
|
+
this.loadSkyBox();
|
|
112522
112522
|
if (this._environment.displayGround)
|
|
112523
112523
|
this.loadGround();
|
|
112524
112524
|
}
|
|
112525
112525
|
dispose() {
|
|
112526
112526
|
this._ground = undefined;
|
|
112527
|
-
this._sky.
|
|
112527
|
+
this._sky.params = this._sky.promise = undefined;
|
|
112528
112528
|
this._onDispose();
|
|
112529
112529
|
}
|
|
112530
112530
|
setEnvironment(env) {
|
|
@@ -112539,7 +112539,7 @@ class EnvironmentDecorations {
|
|
|
112539
112539
|
this.loadGround();
|
|
112540
112540
|
// Update sky box
|
|
112541
112541
|
if (env.sky !== prev.sky)
|
|
112542
|
-
this.
|
|
112542
|
+
this.loadSkyBox();
|
|
112543
112543
|
}
|
|
112544
112544
|
decorate(context) {
|
|
112545
112545
|
const env = this._environment;
|
|
@@ -112608,82 +112608,99 @@ class EnvironmentDecorations {
|
|
|
112608
112608
|
params.material = material;
|
|
112609
112609
|
return params;
|
|
112610
112610
|
}
|
|
112611
|
-
|
|
112612
|
-
const
|
|
112611
|
+
loadSkyBox() {
|
|
112612
|
+
const loader = this.loadSkyBoxParams();
|
|
112613
|
+
if (undefined === loader.preload) {
|
|
112614
|
+
this.setSky(loader.load());
|
|
112615
|
+
return;
|
|
112616
|
+
}
|
|
112617
|
+
const promise = loader.preload;
|
|
112613
112618
|
this._sky.promise = promise;
|
|
112614
|
-
|
|
112615
|
-
promise.then((params) => {
|
|
112619
|
+
loader.preload.then((loaded) => {
|
|
112616
112620
|
if (promise === this._sky.promise)
|
|
112617
|
-
this.setSky(
|
|
112618
|
-
})
|
|
112619
|
-
|
|
112620
|
-
|
|
112621
|
-
this.setSky(this.createSkyGradientParams());
|
|
112621
|
+
this.setSky(loaded ? loader.load() : undefined);
|
|
112622
|
+
}).catch(() => {
|
|
112623
|
+
if (promise === this._sky.promise)
|
|
112624
|
+
this.setSky(undefined);
|
|
112622
112625
|
});
|
|
112623
112626
|
}
|
|
112624
112627
|
setSky(params) {
|
|
112625
112628
|
this._sky.promise = undefined;
|
|
112626
|
-
this._sky.params = params;
|
|
112629
|
+
this._sky.params = params !== null && params !== void 0 ? params : this.createSkyGradientParams();
|
|
112627
112630
|
this._onLoaded();
|
|
112628
112631
|
}
|
|
112629
|
-
|
|
112632
|
+
loadSkyBoxParams() {
|
|
112633
|
+
let load;
|
|
112634
|
+
let preload;
|
|
112630
112635
|
const sky = this._environment.sky;
|
|
112631
112636
|
if (sky instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.SkyCube) {
|
|
112632
112637
|
const key = this.createCubeImageKey(sky);
|
|
112633
|
-
|
|
112634
|
-
|
|
112635
|
-
return { type: "cube", texture: existingTexture };
|
|
112636
|
-
// Some faces may use the same image. Only request each image once.
|
|
112637
|
-
const specs = new Set([sky.images.front, sky.images.back, sky.images.left, sky.images.right, sky.images.top, sky.images.bottom]);
|
|
112638
|
-
const promises = [];
|
|
112639
|
-
for (const spec of specs)
|
|
112640
|
-
promises.push(this.imageFromSpec(spec));
|
|
112641
|
-
return Promise.all(promises).then((images) => {
|
|
112642
|
-
const idToImage = new Map();
|
|
112643
|
-
let index = 0;
|
|
112644
|
-
for (const spec of specs) {
|
|
112645
|
-
const image = images[index++];
|
|
112646
|
-
if (!image)
|
|
112647
|
-
return undefined;
|
|
112648
|
-
else
|
|
112649
|
-
idToImage.set(spec, image);
|
|
112650
|
-
}
|
|
112651
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
112652
|
-
const params = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Params(key, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.SkyBox);
|
|
112653
|
-
const txImgs = [
|
|
112654
|
-
idToImage.get(sky.images.front), idToImage.get(sky.images.back), idToImage.get(sky.images.top),
|
|
112655
|
-
idToImage.get(sky.images.bottom), idToImage.get(sky.images.right), idToImage.get(sky.images.left),
|
|
112656
|
-
];
|
|
112657
|
-
const texture = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.createTextureFromCubeImages(txImgs[0], txImgs[1], txImgs[2], txImgs[3], txImgs[4], txImgs[5], this._view.iModel, params);
|
|
112638
|
+
load = () => {
|
|
112639
|
+
const texture = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.findTexture(key, this._view.iModel);
|
|
112658
112640
|
return texture ? { type: "cube", texture } : undefined;
|
|
112659
|
-
}
|
|
112641
|
+
};
|
|
112642
|
+
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.findTexture(key, this._view.iModel)) {
|
|
112643
|
+
// Some faces may use the same image. Only request each image once.
|
|
112644
|
+
const promises = [];
|
|
112645
|
+
const specs = new Set([sky.images.front, sky.images.back, sky.images.left, sky.images.right, sky.images.top, sky.images.bottom]);
|
|
112646
|
+
for (const spec of specs)
|
|
112647
|
+
promises.push(this.imageFromSpec(spec));
|
|
112648
|
+
preload = Promise.all(promises).then((images) => {
|
|
112649
|
+
const idToImage = new Map();
|
|
112650
|
+
let index = 0;
|
|
112651
|
+
for (const spec of specs) {
|
|
112652
|
+
const image = images[index++];
|
|
112653
|
+
if (!image)
|
|
112654
|
+
return false;
|
|
112655
|
+
else
|
|
112656
|
+
idToImage.set(spec, image);
|
|
112657
|
+
}
|
|
112658
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
112659
|
+
const params = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Params(key, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.SkyBox);
|
|
112660
|
+
const txImgs = [
|
|
112661
|
+
idToImage.get(sky.images.front), idToImage.get(sky.images.back), idToImage.get(sky.images.top),
|
|
112662
|
+
idToImage.get(sky.images.bottom), idToImage.get(sky.images.right), idToImage.get(sky.images.left),
|
|
112663
|
+
];
|
|
112664
|
+
return undefined !== _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.createTextureFromCubeImages(txImgs[0], txImgs[1], txImgs[2], txImgs[3], txImgs[4], txImgs[5], this._view.iModel, params);
|
|
112665
|
+
});
|
|
112666
|
+
}
|
|
112660
112667
|
}
|
|
112661
112668
|
else if (sky instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.SkySphere) {
|
|
112662
|
-
|
|
112663
|
-
|
|
112664
|
-
|
|
112665
|
-
|
|
112666
|
-
|
|
112667
|
-
|
|
112669
|
+
load = () => {
|
|
112670
|
+
const texture = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.findTexture(sky.image, this._view.iModel);
|
|
112671
|
+
return texture ? {
|
|
112672
|
+
type: "sphere",
|
|
112673
|
+
texture,
|
|
112674
|
+
rotation: 0,
|
|
112675
|
+
zOffset: this._view.iModel.globalOrigin.z,
|
|
112676
|
+
} : undefined;
|
|
112677
|
+
};
|
|
112678
|
+
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.findTexture(sky.image, this._view.iModel)) {
|
|
112679
|
+
preload = this.imageFromSpec(sky.image).then((image) => {
|
|
112680
|
+
if (!image)
|
|
112681
|
+
return false;
|
|
112682
|
+
return undefined !== _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.createTexture({
|
|
112668
112683
|
image: { source: image },
|
|
112669
112684
|
ownership: { iModel: this._view.iModel, key: sky.image },
|
|
112670
112685
|
});
|
|
112671
|
-
}
|
|
112686
|
+
});
|
|
112672
112687
|
}
|
|
112673
|
-
if (!texture)
|
|
112674
|
-
return undefined;
|
|
112675
|
-
return { type: "sphere", texture, rotation, zOffset: this._view.iModel.globalOrigin.z };
|
|
112676
112688
|
}
|
|
112677
112689
|
else {
|
|
112678
|
-
|
|
112690
|
+
load = () => this.createSkyGradientParams();
|
|
112679
112691
|
}
|
|
112692
|
+
return { load, preload };
|
|
112680
112693
|
}
|
|
112681
112694
|
createCubeImageKey(sky) {
|
|
112682
112695
|
const i = sky.images;
|
|
112683
112696
|
return `skycube:${i.front}:${i.back}:${i.left}:${i.right}:${i.top}:${i.bottom}`;
|
|
112684
112697
|
}
|
|
112685
112698
|
createSkyGradientParams() {
|
|
112686
|
-
return {
|
|
112699
|
+
return {
|
|
112700
|
+
type: "gradient",
|
|
112701
|
+
gradient: this._environment.sky.gradient,
|
|
112702
|
+
zOffset: this._view.iModel.globalOrigin.z,
|
|
112703
|
+
};
|
|
112687
112704
|
}
|
|
112688
112705
|
async imageFromSpec(spec) {
|
|
112689
112706
|
var _a;
|
|
@@ -127674,17 +127691,20 @@ class Viewport {
|
|
|
127674
127691
|
if (undefined === view)
|
|
127675
127692
|
return _ViewStatus__WEBPACK_IMPORTED_MODULE_27__.ViewStatus.InvalidViewport;
|
|
127676
127693
|
if (view.is3d() && view.isCameraOn) {
|
|
127677
|
-
const
|
|
127678
|
-
const
|
|
127679
|
-
|
|
127680
|
-
|
|
127681
|
-
|
|
127682
|
-
|
|
127683
|
-
|
|
127684
|
-
|
|
127685
|
-
|
|
127686
|
-
|
|
127687
|
-
|
|
127694
|
+
const eyePoint = view.getEyePoint().clone();
|
|
127695
|
+
const targetPoint = view.getTargetPoint();
|
|
127696
|
+
if (newCenter) {
|
|
127697
|
+
const dir = eyePoint.vectorTo(targetPoint);
|
|
127698
|
+
newCenter.plusScaled(dir, -0.5, eyePoint);
|
|
127699
|
+
newCenter.plusScaled(dir, 0.5, targetPoint);
|
|
127700
|
+
}
|
|
127701
|
+
const transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(targetPoint, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createScale(factor, factor, factor));
|
|
127702
|
+
const zDir = view.getZVector();
|
|
127703
|
+
transform.multiplyPoint3d(eyePoint, eyePoint);
|
|
127704
|
+
targetPoint.setFrom(eyePoint.plusScaled(zDir, zDir.dotProduct(eyePoint.vectorTo(targetPoint))));
|
|
127705
|
+
const status = view.lookAt({ eyePoint, targetPoint, upVector: view.getYVector(), lensAngle: view.camera.lens });
|
|
127706
|
+
if (_ViewStatus__WEBPACK_IMPORTED_MODULE_27__.ViewStatus.Success !== status)
|
|
127707
|
+
return status;
|
|
127688
127708
|
}
|
|
127689
127709
|
else {
|
|
127690
127710
|
// for non-camera views, do the zooming by adjusting the origin and delta directly so there can be no
|
|
@@ -311675,7 +311695,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
311675
311695
|
/***/ ((module) => {
|
|
311676
311696
|
|
|
311677
311697
|
"use strict";
|
|
311678
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.6.0-dev.
|
|
311698
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.6.0-dev.5","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^3.6.0-dev.5","@itwin/core-bentley":"workspace:^3.6.0-dev.5","@itwin/core-common":"workspace:^3.6.0-dev.5","@itwin/core-geometry":"workspace:^3.6.0-dev.5","@itwin/core-orbitgt":"workspace:^3.6.0-dev.5","@itwin/core-quantity":"workspace:^3.6.0-dev.5","@itwin/webgl-compatibility":"workspace:^3.6.0-dev.5"},"//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":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/lodash":"^4.14.0","@types/mocha":"^8.2.2","@types/node":"18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"~1.4.0","@itwin/cloud-agnostic-core":"~1.4.0","@itwin/object-storage-core":"~1.4.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","lodash":"^4.17.10","qs":"^6.5.1","semver":"^7.3.5","superagent":"7.1.3","wms-capabilities":"0.4.0","xml-js":"~1.6.11","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
|
|
311679
311699
|
|
|
311680
311700
|
/***/ })
|
|
311681
311701
|
|