vim-web 0.6.0-dev.0 → 0.6.0-dev.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.
|
@@ -17,11 +17,12 @@ export declare class LoadRequest implements CoreILoadRequest {
|
|
|
17
17
|
private _callbacks;
|
|
18
18
|
private _onLoaded?;
|
|
19
19
|
private _progressQueue;
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
25
|
+
getResult(): Promise<Core.LoadResult<Core.Webgl.Vim>>;
|
|
25
26
|
abort(): void;
|
|
26
27
|
}
|
|
27
28
|
export {};
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -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.
|
|
75161
|
+
this._resultPromise = this.trackAndGetResult();
|
|
75158
75162
|
}
|
|
75159
|
-
async
|
|
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.
|
|
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
|
-
|
|
75334
|
+
await vim.loadAll();
|
|
75328
75335
|
}
|
|
75329
75336
|
}
|
|
75330
75337
|
}
|