@inweb/viewer-visualize 26.6.2 → 26.6.3

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.
@@ -3853,7 +3853,54 @@
3853
3853
  // By use of this software, its documentation or related materials, you
3854
3854
  // acknowledge and accept the above terms.
3855
3855
  ///////////////////////////////////////////////////////////////////////////////
3856
- class VSFModelLoader extends Loader {
3856
+ class VSFBufferLoader extends Loader {
3857
+ constructor(viewer) {
3858
+ super();
3859
+ this.viewer = viewer;
3860
+ }
3861
+ isSupport(file, format) {
3862
+ return file instanceof ArrayBuffer && /vsf$/i.test(format);
3863
+ }
3864
+ load(buffer, format) {
3865
+ if (!this.viewer.visualizeJs)
3866
+ return Promise.resolve(this);
3867
+ const visLib = this.viewer.visLib();
3868
+ const visViewer = visLib.getViewer();
3869
+ const data = new Uint8Array(buffer);
3870
+ visViewer.parseFile(data);
3871
+ this.viewer.syncOpenCloudVisualStyle(false);
3872
+ this.viewer.syncOptions();
3873
+ this.viewer.syncOverlay();
3874
+ this.viewer.resize();
3875
+ this.viewer.emitEvent({ type: "geometryprogress", data: 1, file: buffer });
3876
+ this.viewer.emitEvent({ type: "databasechunk", data, file: buffer });
3877
+ return Promise.resolve(this);
3878
+ }
3879
+ }
3880
+
3881
+ ///////////////////////////////////////////////////////////////////////////////
3882
+ // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3883
+ // All rights reserved.
3884
+ //
3885
+ // This software and its documentation and related materials are owned by
3886
+ // the Alliance. The software may only be incorporated into application
3887
+ // programs owned by members of the Alliance, subject to a signed
3888
+ // Membership Agreement and Supplemental Software License Agreement with the
3889
+ // Alliance. The structure and organization of this software are the valuable
3890
+ // trade secrets of the Alliance and its suppliers. The software is also
3891
+ // protected by copyright law and international treaty provisions. Application
3892
+ // programs incorporating this software must include the following statement
3893
+ // with their copyright notices:
3894
+ //
3895
+ // This application incorporates Open Design Alliance software pursuant to a
3896
+ // license agreement with Open Design Alliance.
3897
+ // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
3898
+ // All rights reserved.
3899
+ //
3900
+ // By use of this software, its documentation or related materials, you
3901
+ // acknowledge and accept the above terms.
3902
+ ///////////////////////////////////////////////////////////////////////////////
3903
+ class VSFCloudModelLoader extends Loader {
3857
3904
  constructor(viewer) {
3858
3905
  super();
3859
3906
  this.viewer = viewer;
@@ -3922,13 +3969,13 @@
3922
3969
  // By use of this software, its documentation or related materials, you
3923
3970
  // acknowledge and accept the above terms.
3924
3971
  ///////////////////////////////////////////////////////////////////////////////
3925
- class VSFBufferLoader extends Loader {
3972
+ class VSFXBufferLoader extends Loader {
3926
3973
  constructor(viewer) {
3927
3974
  super();
3928
3975
  this.viewer = viewer;
3929
3976
  }
3930
3977
  isSupport(file, format) {
3931
- return file instanceof ArrayBuffer && /vsf$/i.test(format);
3978
+ return file instanceof ArrayBuffer && /vsfx$/i.test(format);
3932
3979
  }
3933
3980
  load(buffer, format) {
3934
3981
  if (!this.viewer.visualizeJs)
@@ -3936,7 +3983,7 @@
3936
3983
  const visLib = this.viewer.visLib();
3937
3984
  const visViewer = visLib.getViewer();
3938
3985
  const data = new Uint8Array(buffer);
3939
- visViewer.parseFile(data);
3986
+ visViewer.parseVsfx(data);
3940
3987
  this.viewer.syncOpenCloudVisualStyle(false);
3941
3988
  this.viewer.syncOptions();
3942
3989
  this.viewer.syncOverlay();
@@ -3969,7 +4016,7 @@
3969
4016
  // By use of this software, its documentation or related materials, you
3970
4017
  // acknowledge and accept the above terms.
3971
4018
  ///////////////////////////////////////////////////////////////////////////////
3972
- class VSFXModelLoader extends Loader {
4019
+ class VSFXCloudModelLoader extends Loader {
3973
4020
  constructor(viewer) {
3974
4021
  super();
3975
4022
  this.viewer = viewer;
@@ -4077,13 +4124,14 @@
4077
4124
  // By use of this software, its documentation or related materials, you
4078
4125
  // acknowledge and accept the above terms.
4079
4126
  ///////////////////////////////////////////////////////////////////////////////
4080
- class VSFXStreamingLoader extends Loader {
4127
+ class VSFXCloudStreamingLoader extends Loader {
4081
4128
  constructor(viewer) {
4082
4129
  super();
4083
4130
  this.viewer = viewer;
4084
4131
  }
4085
4132
  isSupport(file) {
4086
4133
  return (typeof file === "object" &&
4134
+ typeof file.database === "string" &&
4087
4135
  typeof file.downloadResource === "function" &&
4088
4136
  /.vsfx$/i.test(file.database) &&
4089
4137
  this.viewer.options.enableStreamingMode === true &&
@@ -4154,7 +4202,7 @@
4154
4202
  ///////////////////////////////////////////////////////////////////////////////
4155
4203
  const PENDING_REQUESTS_SIZE = 50;
4156
4204
  const PENDING_REQUESTS_TIMEOUT = 250;
4157
- class VSFXPartialLoader extends Loader {
4205
+ class VSFXCloudPartialLoader extends Loader {
4158
4206
  constructor(viewer) {
4159
4207
  super();
4160
4208
  this.viewer = viewer;
@@ -4162,6 +4210,7 @@
4162
4210
  }
4163
4211
  isSupport(file) {
4164
4212
  return (typeof file === "object" &&
4213
+ typeof file.database === "string" &&
4165
4214
  typeof file.downloadResource === "function" &&
4166
4215
  /.vsfx$/i.test(file.database) &&
4167
4216
  (this.viewer.options.enablePartialMode === true || /.rcs$/i.test(file.name)));
@@ -4310,53 +4359,6 @@
4310
4359
  }
4311
4360
  }
4312
4361
 
4313
- ///////////////////////////////////////////////////////////////////////////////
4314
- // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
4315
- // All rights reserved.
4316
- //
4317
- // This software and its documentation and related materials are owned by
4318
- // the Alliance. The software may only be incorporated into application
4319
- // programs owned by members of the Alliance, subject to a signed
4320
- // Membership Agreement and Supplemental Software License Agreement with the
4321
- // Alliance. The structure and organization of this software are the valuable
4322
- // trade secrets of the Alliance and its suppliers. The software is also
4323
- // protected by copyright law and international treaty provisions. Application
4324
- // programs incorporating this software must include the following statement
4325
- // with their copyright notices:
4326
- //
4327
- // This application incorporates Open Design Alliance software pursuant to a
4328
- // license agreement with Open Design Alliance.
4329
- // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
4330
- // All rights reserved.
4331
- //
4332
- // By use of this software, its documentation or related materials, you
4333
- // acknowledge and accept the above terms.
4334
- ///////////////////////////////////////////////////////////////////////////////
4335
- class VSFXBufferLoader extends Loader {
4336
- constructor(viewer) {
4337
- super();
4338
- this.viewer = viewer;
4339
- }
4340
- isSupport(file, format) {
4341
- return file instanceof ArrayBuffer && /vsfx$/i.test(format);
4342
- }
4343
- load(buffer, format) {
4344
- if (!this.viewer.visualizeJs)
4345
- return Promise.resolve(this);
4346
- const visLib = this.viewer.visLib();
4347
- const visViewer = visLib.getViewer();
4348
- const data = new Uint8Array(buffer);
4349
- visViewer.parseVsfx(data);
4350
- this.viewer.syncOpenCloudVisualStyle(false);
4351
- this.viewer.syncOptions();
4352
- this.viewer.syncOverlay();
4353
- this.viewer.resize();
4354
- this.viewer.emitEvent({ type: "geometryprogress", data: 1, file: buffer });
4355
- this.viewer.emitEvent({ type: "databasechunk", data, file: buffer });
4356
- return Promise.resolve(this);
4357
- }
4358
- }
4359
-
4360
4362
  ///////////////////////////////////////////////////////////////////////////////
4361
4363
  // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
4362
4364
  // All rights reserved.
@@ -4446,12 +4448,12 @@
4446
4448
  */
4447
4449
  const loaders = loadersRegistry("visualizejs");
4448
4450
  // build-in loaders
4449
- loaders.registerLoader("vsf", (viewer) => new VSFModelLoader(viewer));
4450
4451
  loaders.registerLoader("vsf-buffer", (viewer) => new VSFBufferLoader(viewer));
4451
- loaders.registerLoader("vsfx", (viewer) => new VSFXModelLoader(viewer));
4452
- loaders.registerLoader("vsfx-streaming", (viewer) => new VSFXStreamingLoader(viewer));
4453
- loaders.registerLoader("vsfx-partial", (viewer) => new VSFXPartialLoader(viewer));
4452
+ loaders.registerLoader("vsf-cloud-model", (viewer) => new VSFCloudModelLoader(viewer));
4454
4453
  loaders.registerLoader("vsfx-buffer", (viewer) => new VSFXBufferLoader(viewer));
4454
+ loaders.registerLoader("vsfx-cloud-model", (viewer) => new VSFXCloudModelLoader(viewer));
4455
+ loaders.registerLoader("vsfx-cloud-streaming", (viewer) => new VSFXCloudStreamingLoader(viewer));
4456
+ loaders.registerLoader("vsfx-cloud-partial", (viewer) => new VSFXCloudPartialLoader(viewer));
4455
4457
 
4456
4458
  class EventEmitter2 {
4457
4459
  constructor() {
@@ -19449,11 +19451,12 @@
19449
19451
  }
19450
19452
  dispose() {
19451
19453
  this.cancel();
19454
+ this.clear();
19452
19455
  this.emitEvent({ type: "dispose" });
19456
+ this.removeAllListeners();
19457
+ this.setActiveDragger();
19453
19458
  this._components.forEach((component) => component.dispose());
19454
19459
  this._components = [];
19455
- this.setActiveDragger();
19456
- this.removeAllListeners();
19457
19460
  this._markup.dispose();
19458
19461
  if (this.canvas) {
19459
19462
  this.canvasEvents.forEach((x) => this.canvas.removeEventListener(x, this.canvaseventlistener));