vim-web 0.6.0-dev.0 → 0.6.0-dev.2

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.
@@ -17,11 +17,12 @@ export declare class LoadRequest implements CoreILoadRequest {
17
17
  private _callbacks;
18
18
  private _onLoaded?;
19
19
  private _progressQueue;
20
- constructor(callbacks: RequestCallbacks, source: Core.Webgl.RequestSource, settings: Core.Webgl.VimPartialSettings, vimIndex: number, onLoaded?: (vim: Core.Webgl.Vim) => void);
21
- private trackRequest;
20
+ private _resultPromise;
21
+ constructor(callbacks: RequestCallbacks, source: Core.Webgl.RequestSource, settings: Core.Webgl.VimPartialSettings, vimIndex: number, onLoaded?: (vim: Core.Webgl.Vim) => Promise<void> | void);
22
+ private trackAndGetResult;
22
23
  get isCompleted(): boolean;
23
24
  getProgress(): AsyncGenerator<IProgress>;
24
- getResult(): Promise<Core.LoadResult<Core.Webgl.Vim, Core.ILoadError>>;
25
+ getResult(): Promise<Core.LoadResult<Core.Webgl.Vim>>;
25
26
  abort(): void;
26
27
  }
27
28
  export {};
@@ -55039,14 +55039,14 @@ void main() {
55039
55039
  selectAtPointer: async (pos, add) => {
55040
55040
  const result = await viewer.raycaster.raycastFromScreen(pos);
55041
55041
  if (add) {
55042
- viewer.selection.add(result.object);
55042
+ viewer.selection.add(result == null ? void 0 : result.object);
55043
55043
  } else {
55044
- viewer.selection.select(result.object);
55044
+ viewer.selection.select(result == null ? void 0 : result.object);
55045
55045
  }
55046
55046
  },
55047
55047
  frameAtPointer: async (pos) => {
55048
55048
  const result = await viewer.raycaster.raycastFromScreen(pos);
55049
- viewer.camera.lerp(0.75).frame(result.object ?? "all");
55049
+ viewer.camera.lerp(0.75).frame((result == null ? void 0 : result.object) ?? "all");
55050
55050
  },
55051
55051
  zoom: async (value, pos) => {
55052
55052
  if (pos) {
@@ -74336,6 +74336,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74336
74336
  if (this._computeBoundingBox) {
74337
74337
  this.geometry.computeBoundingBox();
74338
74338
  this.geometry.computeBoundingSphere();
74339
+ this.boundingBox = this.geometry.boundingBox;
74339
74340
  }
74340
74341
  }
74341
74342
  }
@@ -74392,7 +74393,9 @@ Averrage Date/Second ${avgDataRatePS} kb
74392
74393
  this.geometry.insertFromG3d(g3d2, mesh);
74393
74394
  }
74394
74395
  update() {
74396
+ var _a3;
74395
74397
  this.geometry.update();
74398
+ (_a3 = this.vim) == null ? void 0 : _a3.scene.updateBox(this.geometry.boundingBox);
74396
74399
  }
74397
74400
  clearUpdate() {
74398
74401
  this.geometry.flushUpdate();
@@ -75150,13 +75153,14 @@ Averrage Date/Second ${avgDataRatePS} kb
75150
75153
  __publicField(this, "_callbacks");
75151
75154
  __publicField(this, "_onLoaded");
75152
75155
  __publicField(this, "_progressQueue", new AsyncQueue());
75156
+ __publicField(this, "_resultPromise");
75153
75157
  this._source = source;
75154
75158
  this._callbacks = callbacks;
75155
75159
  this._onLoaded = onLoaded;
75156
75160
  this._request = new LoadRequest$1(source, settings2, vimIndex);
75157
- this.trackRequest();
75161
+ this._resultPromise = this.trackAndGetResult();
75158
75162
  }
75159
- async trackRequest() {
75163
+ async trackAndGetResult() {
75160
75164
  var _a3;
75161
75165
  try {
75162
75166
  for await (const progress of this._request.getProgress()) {
@@ -75167,13 +75171,16 @@ Averrage Date/Second ${avgDataRatePS} kb
75167
75171
  if (result.isSuccess === false) {
75168
75172
  this._callbacks.onError({ url: this._source.url, error: result.error });
75169
75173
  } else {
75170
- (_a3 = this._onLoaded) == null ? void 0 : _a3.call(this, result.vim);
75174
+ await ((_a3 = this._onLoaded) == null ? void 0 : _a3.call(this, result.vim));
75171
75175
  this._callbacks.onDone();
75172
75176
  }
75177
+ this._progressQueue.close();
75178
+ return result;
75173
75179
  } catch (err) {
75174
75180
  this._callbacks.onError({ url: this._source.url, error: String(err) });
75181
+ this._progressQueue.close();
75182
+ throw err;
75175
75183
  }
75176
- this._progressQueue.close();
75177
75184
  }
75178
75185
  get isCompleted() {
75179
75186
  return this._request.isCompleted;
@@ -75182,7 +75189,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75182
75189
  yield* this._progressQueue;
75183
75190
  }
75184
75191
  getResult() {
75185
- return this._request.getResult();
75192
+ return this._resultPromise;
75186
75193
  }
75187
75194
  abort() {
75188
75195
  this._request.abort();
@@ -75314,7 +75321,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75314
75321
  (vim) => this.initVim(vim, settings2, loadGeometry)
75315
75322
  );
75316
75323
  }
75317
- initVim(vim, settings2, loadGeometry) {
75324
+ async initVim(vim, settings2, loadGeometry) {
75318
75325
  this._viewer.add(vim);
75319
75326
  vim.onLoadingUpdate.subscribe(() => {
75320
75327
  this._viewer.gizmos.loading.visible = vim.isLoading;
@@ -75324,7 +75331,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75324
75331
  }
75325
75332
  });
75326
75333
  if (loadGeometry) {
75327
- void vim.loadAll();
75334
+ await vim.loadAll();
75328
75335
  }
75329
75336
  }
75330
75337
  }