@inweb/viewer-visualize 27.1.0 → 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.
@@ -2876,13 +2876,13 @@ class InfoComponent {
2876
2876
 
2877
2877
  class RenderLoopComponent {
2878
2878
  constructor(viewer) {
2879
- this.animate = (time = 0) => {
2879
+ this.animate = (time) => {
2880
2880
  this.requestId = requestAnimationFrame(this.animate);
2881
2881
  this.viewer.render(time);
2882
2882
  this.viewer.emitEvent({ type: "animate", time });
2883
2883
  };
2884
2884
  this.viewer = viewer;
2885
- this.animate();
2885
+ this.requestId = requestAnimationFrame(this.animate);
2886
2886
  }
2887
2887
  dispose() {
2888
2888
  cancelAnimationFrame(this.requestId);
@@ -3282,8 +3282,8 @@ class VSFFileLoader extends Loader {
3282
3282
  this.viewer.models.push(modelImpl);
3283
3283
  this.viewer.syncOptions();
3284
3284
  this.viewer.syncOverlay();
3285
- this.viewer.update(true);
3286
3285
  this.viewer.emitEvent({ type: "databasechunk", data, file });
3286
+ this.viewer.update(true);
3287
3287
  return this;
3288
3288
  }
3289
3289
  }
@@ -3327,12 +3327,12 @@ class VSFCloudLoader extends Loader {
3327
3327
  this.viewer.models.push(modelImpl);
3328
3328
  this.viewer.syncOptions();
3329
3329
  this.viewer.syncOverlay();
3330
- this.viewer.update(true);
3331
3330
  this.viewer.emitEvent({ type: "databasechunk", data, file: model.file, model });
3331
+ this.viewer.update(true);
3332
3332
  }
3333
3333
  else {
3334
- this.viewer.update();
3335
3334
  this.viewer.emitEvent({ type: "geometrychunk", data, file: model.file, model });
3335
+ this.viewer.update();
3336
3336
  }
3337
3337
  }
3338
3338
  return this;
@@ -3377,8 +3377,8 @@ class VSFXFileLoader extends Loader {
3377
3377
  this.viewer.models.push(modelImpl);
3378
3378
  this.viewer.syncOptions();
3379
3379
  this.viewer.syncOverlay();
3380
- this.viewer.update(true);
3381
3380
  this.viewer.emitEvent({ type: "databasechunk", data, file });
3381
+ this.viewer.update(true);
3382
3382
  return this;
3383
3383
  }
3384
3384
  }
@@ -3418,8 +3418,8 @@ class VSFXCloudLoader extends Loader {
3418
3418
  this.viewer.models.push(modelImpl);
3419
3419
  this.viewer.syncOptions();
3420
3420
  this.viewer.syncOverlay();
3421
- this.viewer.update(true);
3422
3421
  this.viewer.emitEvent({ type: "databasechunk", data, file: model.file, model });
3422
+ this.viewer.update(true);
3423
3423
  return this;
3424
3424
  }
3425
3425
  }
@@ -3468,12 +3468,12 @@ class VSFXCloudStreamingLoader extends Loader {
3468
3468
  this.viewer.models.push(modelImpl);
3469
3469
  this.viewer.syncOptions();
3470
3470
  this.viewer.syncOverlay();
3471
- this.viewer.update(true);
3472
3471
  this.viewer.emitEvent({ type: "databasechunk", data: chunk, file: model.file, model });
3472
+ this.viewer.update(true);
3473
3473
  }
3474
3474
  else {
3475
- this.viewer.update();
3476
3475
  this.viewer.emitEvent({ type: "geometrychunk", data: chunk, file: model.file, model });
3476
+ this.viewer.update();
3477
3477
  }
3478
3478
  };
3479
3479
  await model.downloadResource(model.database, chunkLoadHandler, this.abortController.signal);
@@ -3526,12 +3526,12 @@ class VSFXCloudPartialLoader extends Loader {
3526
3526
  this.viewer.models.push(modelImpl);
3527
3527
  this.viewer.syncOptions();
3528
3528
  this.viewer.syncOverlay();
3529
- this.viewer.update(true);
3530
3529
  this.viewer.emitEvent({ type: "databasechunk", data: chunk, file: model.file, model });
3530
+ this.viewer.update(true);
3531
3531
  }
3532
3532
  else {
3533
- this.viewer.update();
3534
3533
  this.viewer.emitEvent({ type: "geometrychunk", data: chunk, file: model.file, model });
3534
+ this.viewer.update();
3535
3535
  }
3536
3536
  };
3537
3537
  const downloadResourceRange = async (dataId, requestId, ranges) => {
@@ -4085,8 +4085,8 @@ class Viewer extends EventEmitter2 {
4085
4085
  this.syncOptions();
4086
4086
  this.syncOverlay();
4087
4087
  this._renderTime = performance.now();
4088
- this.render(this._renderTime);
4089
4088
  this.emitEvent({ type: "initialize" });
4089
+ this.update(true);
4090
4090
  return this;
4091
4091
  }
4092
4092
  dispose() {
@@ -4122,8 +4122,8 @@ class Viewer extends EventEmitter2 {
4122
4122
  this.canvas.style.height = height + "px";
4123
4123
  }
4124
4124
  this._viewer.resize(0, this.canvas.width, this.canvas.height, 0);
4125
- this.update(true);
4126
4125
  this.emitEvent({ type: "resize", width, height });
4126
+ this.update(true);
4127
4127
  }
4128
4128
  resize() {
4129
4129
  console.warn("Viewer.resize() has been deprecated since 26.9 and will be removed in a future release, use Viewer.setSize() instead.");
@@ -4190,6 +4190,8 @@ class Viewer extends EventEmitter2 {
4190
4190
  return this;
4191
4191
  }
4192
4192
  applyModelTransformMatrix(model) {
4193
+ if (!this.visualizeJs)
4194
+ return;
4193
4195
  this.executeCommand("applyModelTransform", model);
4194
4196
  }
4195
4197
  applySceneGraphSettings(options = this.options) {
@@ -4235,16 +4237,15 @@ class Viewer extends EventEmitter2 {
4235
4237
  try {
4236
4238
  await this.loadReferences(model);
4237
4239
  await loader.load(model, format, params);
4240
+ this.applyModelTransformMatrix(model);
4241
+ this.applySceneGraphSettings();
4238
4242
  }
4239
4243
  catch (error) {
4240
4244
  this.emitEvent({ type: "geometryerror", data: error, file, model });
4241
4245
  throw error;
4242
4246
  }
4243
4247
  this.emitEvent({ type: "geometryend", file, model });
4244
- if (this.visualizeJs) {
4245
- this.applyModelTransformMatrix(model);
4246
- this.applySceneGraphSettings();
4247
- }
4248
+ this.update(true);
4248
4249
  return this;
4249
4250
  }
4250
4251
  openVsfFile(buffer) {
@@ -4261,7 +4262,6 @@ class Viewer extends EventEmitter2 {
4261
4262
  visViewer.parseFile(data);
4262
4263
  this.syncOptions();
4263
4264
  this.syncOverlay();
4264
- this.update(true);
4265
4265
  this.emitEvent({ type: "geometryprogress", data: 1, file: "", buffer });
4266
4266
  this.emitEvent({ type: "databasechunk", data, file: "", buffer });
4267
4267
  }
@@ -4270,6 +4270,7 @@ class Viewer extends EventEmitter2 {
4270
4270
  throw error;
4271
4271
  }
4272
4272
  this.emitEvent({ type: "geometryend", file: "", buffer });
4273
+ this.update(true);
4273
4274
  return this;
4274
4275
  }
4275
4276
  openVsfxFile(buffer) {
@@ -4286,7 +4287,6 @@ class Viewer extends EventEmitter2 {
4286
4287
  visViewer.parseVsfx(data);
4287
4288
  this.syncOptions();
4288
4289
  this.syncOverlay();
4289
- this.update(true);
4290
4290
  this.emitEvent({ type: "geometryprogress", data: 1, file: "", buffer });
4291
4291
  this.emitEvent({ type: "databasechunk", data, file: "", buffer });
4292
4292
  }
@@ -4295,6 +4295,7 @@ class Viewer extends EventEmitter2 {
4295
4295
  throw error;
4296
4296
  }
4297
4297
  this.emitEvent({ type: "geometryend", file: "", buffer });
4298
+ this.update(true);
4298
4299
  return this;
4299
4300
  }
4300
4301
  cancel() {
@@ -4321,8 +4322,8 @@ class Viewer extends EventEmitter2 {
4321
4322
  visViewer.createLocalDatabase();
4322
4323
  this.syncOptions();
4323
4324
  this.syncOverlay();
4324
- this.update(true);
4325
4325
  this.emitEvent({ type: "clear" });
4326
+ this.update(true);
4326
4327
  return this;
4327
4328
  }
4328
4329
  is3D() {
@@ -4615,7 +4616,7 @@ class Viewer extends EventEmitter2 {
4615
4616
  this.syncOverlay();
4616
4617
  this.setActiveDragger(draggerName);
4617
4618
  this.emitEvent({ type: "drawviewpoint", data: viewpoint });
4618
- this.update();
4619
+ this.update(true);
4619
4620
  }
4620
4621
  createViewpoint() {
4621
4622
  if (!this.visualizeJs)