@inweb/viewer-visualize 26.12.7 → 27.1.1
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/dist/viewer-visualize.js +128 -71
- package/dist/viewer-visualize.js.map +1 -1
- package/dist/viewer-visualize.min.js +1 -1
- package/dist/viewer-visualize.module.js +128 -71
- package/dist/viewer-visualize.module.js.map +1 -1
- package/lib/Viewer/Components/InfoComponent.d.ts +22 -0
- package/lib/Viewer/Components/RenderLoopComponent.d.ts +1 -1
- package/lib/Viewer/Loaders/index.d.ts +2 -1
- package/lib/Viewer/Viewer.d.ts +1 -0
- package/package.json +5 -5
- package/src/Viewer/Components/InfoComponent.ts +139 -0
- package/src/Viewer/Components/RenderLoopComponent.ts +2 -2
- package/src/Viewer/Components/index.ts +2 -0
- package/src/Viewer/Loaders/VSFCloudLoader.ts +2 -6
- package/src/Viewer/Loaders/VSFFileLoader.ts +1 -1
- package/src/Viewer/Loaders/VSFXCloudLoader.ts +1 -5
- package/src/Viewer/Loaders/VSFXCloudPartialLoader.ts +7 -12
- package/src/Viewer/Loaders/VSFXCloudStreamingLoader.ts +6 -15
- package/src/Viewer/Loaders/VSFXFileLoader.ts +1 -1
- package/src/Viewer/Loaders/index.ts +2 -1
- package/src/Viewer/Viewer.ts +22 -15
- package/lib/Viewer/Loaders/UpdateController.d.ts +0 -14
- package/src/Viewer/Loaders/UpdateController.ts +0 -60
package/dist/viewer-visualize.js
CHANGED
|
@@ -3336,15 +3336,108 @@
|
|
|
3336
3336
|
}
|
|
3337
3337
|
}
|
|
3338
3338
|
|
|
3339
|
+
class InfoComponent {
|
|
3340
|
+
constructor(viewer) {
|
|
3341
|
+
this.initialize = () => {
|
|
3342
|
+
this.resize();
|
|
3343
|
+
this.optionsChange({ data: this.viewer.options });
|
|
3344
|
+
};
|
|
3345
|
+
this.clear = () => {
|
|
3346
|
+
this.viewer.info.performance.timeToFirstRender = 0;
|
|
3347
|
+
this.viewer.info.performance.loadTime = 0;
|
|
3348
|
+
this.viewer.info.scene.objects = 0;
|
|
3349
|
+
this.viewer.info.scene.triangles = 0;
|
|
3350
|
+
this.viewer.info.scene.points = 0;
|
|
3351
|
+
this.viewer.info.scene.lines = 0;
|
|
3352
|
+
this.viewer.info.scene.edges = 0;
|
|
3353
|
+
this.viewer.info.optimizedScene.objects = 0;
|
|
3354
|
+
this.viewer.info.optimizedScene.triangles = 0;
|
|
3355
|
+
this.viewer.info.optimizedScene.points = 0;
|
|
3356
|
+
this.viewer.info.optimizedScene.lines = 0;
|
|
3357
|
+
this.viewer.info.optimizedScene.edges = 0;
|
|
3358
|
+
this.viewer.info.memory.geometries = 0;
|
|
3359
|
+
this.viewer.info.memory.geometryBytes = 0;
|
|
3360
|
+
this.viewer.info.memory.textures = 0;
|
|
3361
|
+
this.viewer.info.memory.textureBytes = 0;
|
|
3362
|
+
this.viewer.info.memory.materials = 0;
|
|
3363
|
+
this.viewer.info.memory.totalEstimatedGpuBytes = 0;
|
|
3364
|
+
this.viewer.info.memory.usedJSHeapSize = 0;
|
|
3365
|
+
};
|
|
3366
|
+
this.optionsChange = ({ data: options }) => {
|
|
3367
|
+
const antialiasing = options.antialiasing === true || options.antialiasing === "fxaa";
|
|
3368
|
+
if (antialiasing)
|
|
3369
|
+
this.viewer.info.render.antialiasing = "fxaa";
|
|
3370
|
+
else
|
|
3371
|
+
this.viewer.info.render.antialiasing = "";
|
|
3372
|
+
};
|
|
3373
|
+
this.geometryStart = () => {
|
|
3374
|
+
this.startTime = performance.now();
|
|
3375
|
+
};
|
|
3376
|
+
this.databaseChunk = () => {
|
|
3377
|
+
this.viewer.info.performance.timeToFirstRender += performance.now() - this.startTime;
|
|
3378
|
+
console.log("Time to first render:", this.viewer.info.performance.timeToFirstRender, "ms");
|
|
3379
|
+
};
|
|
3380
|
+
this.geometryEnd = () => {
|
|
3381
|
+
const memory = performance["memory"];
|
|
3382
|
+
if (memory)
|
|
3383
|
+
this.viewer.info.memory.usedJSHeapSize = memory.usedJSHeapSize;
|
|
3384
|
+
this.viewer.info.performance.loadTime += performance.now() - this.startTime;
|
|
3385
|
+
console.log("File load time:", this.viewer.info.performance.loadTime, "ms");
|
|
3386
|
+
};
|
|
3387
|
+
this.resize = () => {
|
|
3388
|
+
const { width, height } = this.viewer.canvas;
|
|
3389
|
+
this.viewer.info.render.viewport.width = width;
|
|
3390
|
+
this.viewer.info.render.viewport.height = height;
|
|
3391
|
+
};
|
|
3392
|
+
this.render = () => { };
|
|
3393
|
+
this.animate = () => {
|
|
3394
|
+
const time = performance.now();
|
|
3395
|
+
this.viewer.info.performance.frameTime = Math.round(time - this.beginTime);
|
|
3396
|
+
this.beginTime = time;
|
|
3397
|
+
this.frames++;
|
|
3398
|
+
if (time - this.prevTime >= 1000) {
|
|
3399
|
+
this.viewer.info.performance.fps = Math.round((this.frames * 1000) / (time - this.prevTime));
|
|
3400
|
+
this.prevTime = time;
|
|
3401
|
+
this.frames = 0;
|
|
3402
|
+
}
|
|
3403
|
+
};
|
|
3404
|
+
this.viewer = viewer;
|
|
3405
|
+
this.startTime = 0;
|
|
3406
|
+
this.beginTime = performance.now();
|
|
3407
|
+
this.prevTime = performance.now();
|
|
3408
|
+
this.frames = 0;
|
|
3409
|
+
this.viewer.addEventListener("initialize", this.initialize);
|
|
3410
|
+
this.viewer.addEventListener("clear", this.clear);
|
|
3411
|
+
this.viewer.addEventListener("optionschange", this.optionsChange);
|
|
3412
|
+
this.viewer.addEventListener("geometrystart", this.geometryStart);
|
|
3413
|
+
this.viewer.addEventListener("databasechunk", this.databaseChunk);
|
|
3414
|
+
this.viewer.addEventListener("geometryend", this.geometryEnd);
|
|
3415
|
+
this.viewer.addEventListener("resize", this.resize);
|
|
3416
|
+
this.viewer.addEventListener("render", this.render);
|
|
3417
|
+
this.viewer.addEventListener("animate", this.animate);
|
|
3418
|
+
}
|
|
3419
|
+
dispose() {
|
|
3420
|
+
this.viewer.removeEventListener("initialize", this.initialize);
|
|
3421
|
+
this.viewer.removeEventListener("clear", this.clear);
|
|
3422
|
+
this.viewer.removeEventListener("optionschange", this.optionsChange);
|
|
3423
|
+
this.viewer.removeEventListener("geometrystart", this.geometryStart);
|
|
3424
|
+
this.viewer.removeEventListener("databasechunk", this.databaseChunk);
|
|
3425
|
+
this.viewer.removeEventListener("geometryend", this.geometryEnd);
|
|
3426
|
+
this.viewer.removeEventListener("resize", this.resize);
|
|
3427
|
+
this.viewer.removeEventListener("render", this.render);
|
|
3428
|
+
this.viewer.addEventListener("animate", this.animate);
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3339
3432
|
class RenderLoopComponent {
|
|
3340
3433
|
constructor(viewer) {
|
|
3341
|
-
this.animate = (time
|
|
3434
|
+
this.animate = (time) => {
|
|
3342
3435
|
this.requestId = requestAnimationFrame(this.animate);
|
|
3343
3436
|
this.viewer.render(time);
|
|
3344
3437
|
this.viewer.emitEvent({ type: "animate", time });
|
|
3345
3438
|
};
|
|
3346
3439
|
this.viewer = viewer;
|
|
3347
|
-
this.animate
|
|
3440
|
+
this.requestId = requestAnimationFrame(this.animate);
|
|
3348
3441
|
}
|
|
3349
3442
|
dispose() {
|
|
3350
3443
|
cancelAnimationFrame(this.requestId);
|
|
@@ -3621,6 +3714,7 @@
|
|
|
3621
3714
|
|
|
3622
3715
|
const components = componentsRegistry("visualizejs");
|
|
3623
3716
|
components.registerComponent("CameraComponent", (viewer) => new CameraComponent(viewer));
|
|
3717
|
+
components.registerComponent("InfoComponent", (viewer) => new InfoComponent(viewer));
|
|
3624
3718
|
components.registerComponent("ResizeCanvasComponent", (viewer) => new ResizeCanvasComponent(viewer));
|
|
3625
3719
|
components.registerComponent("RenderLoopComponent", (viewer) => new RenderLoopComponent(viewer));
|
|
3626
3720
|
components.registerComponent("ZoomWheelComponent", (viewer) => new ZoomWheelComponent(viewer));
|
|
@@ -3743,8 +3837,8 @@
|
|
|
3743
3837
|
this.viewer.models.push(modelImpl);
|
|
3744
3838
|
this.viewer.syncOptions();
|
|
3745
3839
|
this.viewer.syncOverlay();
|
|
3746
|
-
this.viewer.update(true);
|
|
3747
3840
|
this.viewer.emitEvent({ type: "databasechunk", data, file });
|
|
3841
|
+
this.viewer.update(true);
|
|
3748
3842
|
return this;
|
|
3749
3843
|
}
|
|
3750
3844
|
}
|
|
@@ -3765,7 +3859,6 @@
|
|
|
3765
3859
|
return this;
|
|
3766
3860
|
const visViewer = this.viewer.visViewer();
|
|
3767
3861
|
const filesToDownload = [model.database, ...model.geometry];
|
|
3768
|
-
console.time("File load time");
|
|
3769
3862
|
for (let i = 0; i < filesToDownload.length; i++) {
|
|
3770
3863
|
const dataId = filesToDownload[i];
|
|
3771
3864
|
const progress = (progress) => {
|
|
@@ -3789,15 +3882,14 @@
|
|
|
3789
3882
|
this.viewer.models.push(modelImpl);
|
|
3790
3883
|
this.viewer.syncOptions();
|
|
3791
3884
|
this.viewer.syncOverlay();
|
|
3792
|
-
this.viewer.update(true);
|
|
3793
3885
|
this.viewer.emitEvent({ type: "databasechunk", data, file: model.file, model });
|
|
3886
|
+
this.viewer.update(true);
|
|
3794
3887
|
}
|
|
3795
3888
|
else {
|
|
3796
|
-
this.viewer.update();
|
|
3797
3889
|
this.viewer.emitEvent({ type: "geometrychunk", data, file: model.file, model });
|
|
3890
|
+
this.viewer.update();
|
|
3798
3891
|
}
|
|
3799
3892
|
}
|
|
3800
|
-
console.timeEnd("File load time");
|
|
3801
3893
|
return this;
|
|
3802
3894
|
}
|
|
3803
3895
|
}
|
|
@@ -3840,8 +3932,8 @@
|
|
|
3840
3932
|
this.viewer.models.push(modelImpl);
|
|
3841
3933
|
this.viewer.syncOptions();
|
|
3842
3934
|
this.viewer.syncOverlay();
|
|
3843
|
-
this.viewer.update(true);
|
|
3844
3935
|
this.viewer.emitEvent({ type: "databasechunk", data, file });
|
|
3936
|
+
this.viewer.update(true);
|
|
3845
3937
|
return this;
|
|
3846
3938
|
}
|
|
3847
3939
|
}
|
|
@@ -3865,7 +3957,6 @@
|
|
|
3865
3957
|
const progress = (progress) => {
|
|
3866
3958
|
this.viewer.emitEvent({ type: "geometryprogress", data: progress, file: model.file, model });
|
|
3867
3959
|
};
|
|
3868
|
-
console.time("File load time");
|
|
3869
3960
|
const arrayBuffer = await model.downloadResource(model.database, progress, this.abortController.signal);
|
|
3870
3961
|
const data = new Uint8Array(arrayBuffer);
|
|
3871
3962
|
if (!this.viewer.visualizeJs)
|
|
@@ -3882,41 +3973,12 @@
|
|
|
3882
3973
|
this.viewer.models.push(modelImpl);
|
|
3883
3974
|
this.viewer.syncOptions();
|
|
3884
3975
|
this.viewer.syncOverlay();
|
|
3885
|
-
this.viewer.update(true);
|
|
3886
3976
|
this.viewer.emitEvent({ type: "databasechunk", data, file: model.file, model });
|
|
3887
|
-
|
|
3977
|
+
this.viewer.update(true);
|
|
3888
3978
|
return this;
|
|
3889
3979
|
}
|
|
3890
3980
|
}
|
|
3891
3981
|
|
|
3892
|
-
const DELAY_TIME_MULTIPLEXER = 2.0;
|
|
3893
|
-
const START_UPDATE_TIME = 1000;
|
|
3894
|
-
var UpdateType;
|
|
3895
|
-
(function (UpdateType) {
|
|
3896
|
-
UpdateType[UpdateType["kDelay"] = 0] = "kDelay";
|
|
3897
|
-
UpdateType[UpdateType["kNormal"] = 1] = "kNormal";
|
|
3898
|
-
UpdateType[UpdateType["kForce"] = 2] = "kForce";
|
|
3899
|
-
})(UpdateType || (UpdateType = {}));
|
|
3900
|
-
class UpdateController {
|
|
3901
|
-
constructor() {
|
|
3902
|
-
this.lastUpdate = 0;
|
|
3903
|
-
this.delayUpdateTime = START_UPDATE_TIME;
|
|
3904
|
-
}
|
|
3905
|
-
initialize(viewer) {
|
|
3906
|
-
this.viewer = viewer;
|
|
3907
|
-
this.lastUpdate = performance.now();
|
|
3908
|
-
}
|
|
3909
|
-
update(type) {
|
|
3910
|
-
const isNeedUpdate = type !== UpdateType.kDelay || performance.now() - this.lastUpdate >= this.delayUpdateTime;
|
|
3911
|
-
const isForce = type === UpdateType.kForce;
|
|
3912
|
-
if (isNeedUpdate) {
|
|
3913
|
-
this.viewer.update(isForce);
|
|
3914
|
-
this.lastUpdate = performance.now();
|
|
3915
|
-
this.delayUpdateTime *= DELAY_TIME_MULTIPLEXER;
|
|
3916
|
-
}
|
|
3917
|
-
}
|
|
3918
|
-
}
|
|
3919
|
-
|
|
3920
3982
|
class VSFXCloudStreamingLoader extends Loader {
|
|
3921
3983
|
constructor(viewer) {
|
|
3922
3984
|
super();
|
|
@@ -3936,9 +3998,7 @@
|
|
|
3936
3998
|
return this;
|
|
3937
3999
|
const visLib = this.viewer.visLib();
|
|
3938
4000
|
const visViewer = this.viewer.visViewer();
|
|
3939
|
-
|
|
3940
|
-
updateController.initialize(this.viewer);
|
|
3941
|
-
let isFireDatabaseChunk = false;
|
|
4001
|
+
let isServiceDataReady = false;
|
|
3942
4002
|
const chunkLoadHandler = (progress, chunk) => {
|
|
3943
4003
|
if (!this.viewer.visualizeJs)
|
|
3944
4004
|
return;
|
|
@@ -3953,8 +4013,8 @@
|
|
|
3953
4013
|
this.viewer.emitEvent({ type: "geometryprogress", data: progress, file: model.file, model });
|
|
3954
4014
|
let isDatabaseChunk = false;
|
|
3955
4015
|
if (status === visLib.DatabaseStreamStatus.ReadyServiceData ||
|
|
3956
|
-
(status === visLib.DatabaseStreamStatus.Complete && !
|
|
3957
|
-
|
|
4016
|
+
(status === visLib.DatabaseStreamStatus.Complete && !isServiceDataReady)) {
|
|
4017
|
+
isServiceDataReady = true;
|
|
3958
4018
|
isDatabaseChunk = true;
|
|
3959
4019
|
}
|
|
3960
4020
|
if (isDatabaseChunk) {
|
|
@@ -3963,19 +4023,16 @@
|
|
|
3963
4023
|
this.viewer.models.push(modelImpl);
|
|
3964
4024
|
this.viewer.syncOptions();
|
|
3965
4025
|
this.viewer.syncOverlay();
|
|
3966
|
-
updateController.update(UpdateType.kForce);
|
|
3967
4026
|
this.viewer.emitEvent({ type: "databasechunk", data: chunk, file: model.file, model });
|
|
4027
|
+
this.viewer.update(true);
|
|
3968
4028
|
}
|
|
3969
4029
|
else {
|
|
3970
|
-
updateController.update(UpdateType.kDelay);
|
|
3971
4030
|
this.viewer.emitEvent({ type: "geometrychunk", data: chunk, file: model.file, model });
|
|
4031
|
+
this.viewer.update();
|
|
3972
4032
|
}
|
|
3973
4033
|
};
|
|
3974
|
-
console.time("File load time");
|
|
3975
4034
|
await model.downloadResource(model.database, chunkLoadHandler, this.abortController.signal);
|
|
3976
|
-
|
|
3977
|
-
console.timeEnd("File load time");
|
|
3978
|
-
return Promise.resolve(this);
|
|
4035
|
+
return this;
|
|
3979
4036
|
}
|
|
3980
4037
|
}
|
|
3981
4038
|
|
|
@@ -3999,15 +4056,13 @@
|
|
|
3999
4056
|
if (!this.viewer.visualizeJs)
|
|
4000
4057
|
return this;
|
|
4001
4058
|
const visViewer = this.viewer.visViewer();
|
|
4059
|
+
visViewer.memoryLimit = this.viewer.options.memoryLimit;
|
|
4002
4060
|
let servicePartAborted = false;
|
|
4003
4061
|
const pendingRequestsMap = new Map();
|
|
4004
4062
|
let pendingRequestsTimerId = 0;
|
|
4005
4063
|
const pendingRequestsAbortHandler = () => clearTimeout(pendingRequestsTimerId);
|
|
4006
4064
|
const pendingRequestsAbortController = new AbortController();
|
|
4007
4065
|
this.abortControllerForRequestMap.set(0, pendingRequestsAbortController);
|
|
4008
|
-
const updateController = new UpdateController();
|
|
4009
|
-
updateController.initialize(this.viewer);
|
|
4010
|
-
visViewer.memoryLimit = this.viewer.options.memoryLimit;
|
|
4011
4066
|
const chunkLoadHandler = (progress, chunk, requestId = 0) => {
|
|
4012
4067
|
if (!this.viewer.visualizeJs)
|
|
4013
4068
|
return;
|
|
@@ -4026,12 +4081,12 @@
|
|
|
4026
4081
|
this.viewer.models.push(modelImpl);
|
|
4027
4082
|
this.viewer.syncOptions();
|
|
4028
4083
|
this.viewer.syncOverlay();
|
|
4029
|
-
updateController.update(UpdateType.kForce);
|
|
4030
4084
|
this.viewer.emitEvent({ type: "databasechunk", data: chunk, file: model.file, model });
|
|
4085
|
+
this.viewer.update(true);
|
|
4031
4086
|
}
|
|
4032
4087
|
else {
|
|
4033
|
-
updateController.update(UpdateType.kDelay);
|
|
4034
4088
|
this.viewer.emitEvent({ type: "geometrychunk", data: chunk, file: model.file, model });
|
|
4089
|
+
this.viewer.update();
|
|
4035
4090
|
}
|
|
4036
4091
|
};
|
|
4037
4092
|
const downloadResourceRange = async (dataId, requestId, ranges) => {
|
|
@@ -4046,7 +4101,6 @@
|
|
|
4046
4101
|
finally {
|
|
4047
4102
|
ranges.forEach((range) => visViewer.onRequestResponseComplete(range.requestId));
|
|
4048
4103
|
this.abortControllerForRequestMap.delete(requestId);
|
|
4049
|
-
updateController.update(UpdateType.kNormal);
|
|
4050
4104
|
}
|
|
4051
4105
|
};
|
|
4052
4106
|
const requestRecordsToRanges = (requestId, records) => {
|
|
@@ -4074,11 +4128,10 @@
|
|
|
4074
4128
|
downloadResourceRange(model.database, requestId, ranges);
|
|
4075
4129
|
},
|
|
4076
4130
|
onFullLoaded: () => {
|
|
4077
|
-
|
|
4131
|
+
this.viewer.update(true);
|
|
4078
4132
|
},
|
|
4079
4133
|
onRequestResponseParsed: (requestId) => {
|
|
4080
4134
|
this.abortControllerForRequestMap.delete(requestId);
|
|
4081
|
-
updateController.update(UpdateType.kNormal);
|
|
4082
4135
|
},
|
|
4083
4136
|
onRequestAborted: (requestId) => {
|
|
4084
4137
|
const abortCtrl = this.abortControllerForRequestMap.get(requestId);
|
|
@@ -18049,6 +18102,7 @@ js: import "konva/skia-backend";
|
|
|
18049
18102
|
this.canvaseventlistener = (event) => this.emit(event);
|
|
18050
18103
|
this._activeDragger = null;
|
|
18051
18104
|
this._components = [];
|
|
18105
|
+
this._updateDelay = 1000;
|
|
18052
18106
|
this._renderNeeded = false;
|
|
18053
18107
|
this._renderTime = 0;
|
|
18054
18108
|
this._enableAutoUpdate = (_a = params.enableAutoUpdate) !== null && _a !== void 0 ? _a : true;
|
|
@@ -18118,8 +18172,8 @@ js: import "konva/skia-backend";
|
|
|
18118
18172
|
this.syncOptions();
|
|
18119
18173
|
this.syncOverlay();
|
|
18120
18174
|
this._renderTime = performance.now();
|
|
18121
|
-
this.render(this._renderTime);
|
|
18122
18175
|
this.emitEvent({ type: "initialize" });
|
|
18176
|
+
this.update(true);
|
|
18123
18177
|
return this;
|
|
18124
18178
|
}
|
|
18125
18179
|
dispose() {
|
|
@@ -18155,8 +18209,8 @@ js: import "konva/skia-backend";
|
|
|
18155
18209
|
this.canvas.style.height = height + "px";
|
|
18156
18210
|
}
|
|
18157
18211
|
this._viewer.resize(0, this.canvas.width, this.canvas.height, 0);
|
|
18158
|
-
this.update(true);
|
|
18159
18212
|
this.emitEvent({ type: "resize", width, height });
|
|
18213
|
+
this.update(true);
|
|
18160
18214
|
}
|
|
18161
18215
|
resize() {
|
|
18162
18216
|
console.warn("Viewer.resize() has been deprecated since 26.9 and will be removed in a future release, use Viewer.setSize() instead.");
|
|
@@ -18171,12 +18225,14 @@ js: import "konva/skia-backend";
|
|
|
18171
18225
|
return this;
|
|
18172
18226
|
}
|
|
18173
18227
|
update(force = false) {
|
|
18228
|
+
const time = performance.now();
|
|
18229
|
+
force = force || time - this._renderTime >= this._updateDelay;
|
|
18174
18230
|
if (this._enableAutoUpdate) {
|
|
18175
18231
|
this._renderNeeded = true;
|
|
18176
18232
|
if (force)
|
|
18177
|
-
this.render();
|
|
18233
|
+
this.render(time);
|
|
18178
18234
|
}
|
|
18179
|
-
this.emitEvent({ type: "update",
|
|
18235
|
+
this.emitEvent({ type: "update", force });
|
|
18180
18236
|
}
|
|
18181
18237
|
render(time) {
|
|
18182
18238
|
var _a, _b;
|
|
@@ -18221,6 +18277,8 @@ js: import "konva/skia-backend";
|
|
|
18221
18277
|
return this;
|
|
18222
18278
|
}
|
|
18223
18279
|
applyModelTransformMatrix(model) {
|
|
18280
|
+
if (!this.visualizeJs)
|
|
18281
|
+
return;
|
|
18224
18282
|
this.executeCommand("applyModelTransform", model);
|
|
18225
18283
|
}
|
|
18226
18284
|
applySceneGraphSettings(options = this.options) {
|
|
@@ -18266,16 +18324,15 @@ js: import "konva/skia-backend";
|
|
|
18266
18324
|
try {
|
|
18267
18325
|
await this.loadReferences(model);
|
|
18268
18326
|
await loader.load(model, format, params);
|
|
18327
|
+
this.applyModelTransformMatrix(model);
|
|
18328
|
+
this.applySceneGraphSettings();
|
|
18269
18329
|
}
|
|
18270
18330
|
catch (error) {
|
|
18271
18331
|
this.emitEvent({ type: "geometryerror", data: error, file, model });
|
|
18272
18332
|
throw error;
|
|
18273
18333
|
}
|
|
18274
18334
|
this.emitEvent({ type: "geometryend", file, model });
|
|
18275
|
-
|
|
18276
|
-
this.applyModelTransformMatrix(model);
|
|
18277
|
-
this.applySceneGraphSettings();
|
|
18278
|
-
}
|
|
18335
|
+
this.update(true);
|
|
18279
18336
|
return this;
|
|
18280
18337
|
}
|
|
18281
18338
|
openVsfFile(buffer) {
|
|
@@ -18292,7 +18349,6 @@ js: import "konva/skia-backend";
|
|
|
18292
18349
|
visViewer.parseFile(data);
|
|
18293
18350
|
this.syncOptions();
|
|
18294
18351
|
this.syncOverlay();
|
|
18295
|
-
this.update(true);
|
|
18296
18352
|
this.emitEvent({ type: "geometryprogress", data: 1, file: "", buffer });
|
|
18297
18353
|
this.emitEvent({ type: "databasechunk", data, file: "", buffer });
|
|
18298
18354
|
}
|
|
@@ -18301,6 +18357,7 @@ js: import "konva/skia-backend";
|
|
|
18301
18357
|
throw error;
|
|
18302
18358
|
}
|
|
18303
18359
|
this.emitEvent({ type: "geometryend", file: "", buffer });
|
|
18360
|
+
this.update(true);
|
|
18304
18361
|
return this;
|
|
18305
18362
|
}
|
|
18306
18363
|
openVsfxFile(buffer) {
|
|
@@ -18317,7 +18374,6 @@ js: import "konva/skia-backend";
|
|
|
18317
18374
|
visViewer.parseVsfx(data);
|
|
18318
18375
|
this.syncOptions();
|
|
18319
18376
|
this.syncOverlay();
|
|
18320
|
-
this.update(true);
|
|
18321
18377
|
this.emitEvent({ type: "geometryprogress", data: 1, file: "", buffer });
|
|
18322
18378
|
this.emitEvent({ type: "databasechunk", data, file: "", buffer });
|
|
18323
18379
|
}
|
|
@@ -18326,6 +18382,7 @@ js: import "konva/skia-backend";
|
|
|
18326
18382
|
throw error;
|
|
18327
18383
|
}
|
|
18328
18384
|
this.emitEvent({ type: "geometryend", file: "", buffer });
|
|
18385
|
+
this.update(true);
|
|
18329
18386
|
return this;
|
|
18330
18387
|
}
|
|
18331
18388
|
cancel() {
|
|
@@ -18352,8 +18409,8 @@ js: import "konva/skia-backend";
|
|
|
18352
18409
|
visViewer.createLocalDatabase();
|
|
18353
18410
|
this.syncOptions();
|
|
18354
18411
|
this.syncOverlay();
|
|
18355
|
-
this.update(true);
|
|
18356
18412
|
this.emitEvent({ type: "clear" });
|
|
18413
|
+
this.update(true);
|
|
18357
18414
|
return this;
|
|
18358
18415
|
}
|
|
18359
18416
|
is3D() {
|
|
@@ -18646,7 +18703,7 @@ js: import "konva/skia-backend";
|
|
|
18646
18703
|
this.syncOverlay();
|
|
18647
18704
|
this.setActiveDragger(draggerName);
|
|
18648
18705
|
this.emitEvent({ type: "drawviewpoint", data: viewpoint });
|
|
18649
|
-
this.update();
|
|
18706
|
+
this.update(true);
|
|
18650
18707
|
}
|
|
18651
18708
|
createViewpoint() {
|
|
18652
18709
|
if (!this.visualizeJs)
|
|
@@ -18793,7 +18850,7 @@ js: import "konva/skia-backend";
|
|
|
18793
18850
|
(_a = this.visViewer()) === null || _a === void 0 ? void 0 : _a.update(maxScheduleUpdateTimeInMs);
|
|
18794
18851
|
(_c = (_b = this._activeDragger) === null || _b === void 0 ? void 0 : _b.updatePreview) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
18795
18852
|
}
|
|
18796
|
-
this.emitEvent({ type: "update",
|
|
18853
|
+
this.emitEvent({ type: "update", force: false });
|
|
18797
18854
|
resolve();
|
|
18798
18855
|
}
|
|
18799
18856
|
catch (e) {
|