@inweb/viewer-visualize 26.3.2 → 26.3.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.
|
@@ -14,7 +14,7 @@ class OdaGeAction {
|
|
|
14
14
|
var _a;
|
|
15
15
|
const extView = this.m_module.getViewer().getActiveTvExtendedView();
|
|
16
16
|
extView.setView(params.position, params.target, params.upVector, params.viewFieldWidth, params.viewFieldHeight, params.perspective);
|
|
17
|
-
(_a = extView.delete) === null || _a ===
|
|
17
|
+
(_a = extView.delete) === null || _a === void 0 ? void 0 : _a.call(extView);
|
|
18
18
|
};
|
|
19
19
|
this.getViewParams = () => {
|
|
20
20
|
var _a;
|
|
@@ -27,7 +27,7 @@ class OdaGeAction {
|
|
|
27
27
|
viewFieldHeight: view.viewFieldHeight,
|
|
28
28
|
perspective: view.perspective
|
|
29
29
|
};
|
|
30
|
-
(_a = view.delete) === null || _a ===
|
|
30
|
+
(_a = view.delete) === null || _a === void 0 ? void 0 : _a.call(view);
|
|
31
31
|
return obj;
|
|
32
32
|
};
|
|
33
33
|
this.m_module = module;
|
|
@@ -249,7 +249,7 @@ class OdBaseDragger extends OdaGeAction {
|
|
|
249
249
|
deleteAll(objects) {
|
|
250
250
|
var _a;
|
|
251
251
|
for (const obj of objects) {
|
|
252
|
-
(_a = obj === null || obj ===
|
|
252
|
+
(_a = obj === null || obj === void 0 ? void 0 : obj.delete) === null || _a === void 0 ? void 0 : _a.call(obj);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
updatePreview() {}
|
|
@@ -618,7 +618,7 @@ class MeasureLineDragger extends OdBaseDragger {
|
|
|
618
618
|
};
|
|
619
619
|
this.items = [];
|
|
620
620
|
this.canvasEvents.push("resize");
|
|
621
|
-
this.oldRulerUnit = (_a = subject.options.rulerUnit) !== null && _a !==
|
|
621
|
+
this.oldRulerUnit = (_a = subject.options.rulerUnit) !== null && _a !== void 0 ? _a : "Default";
|
|
622
622
|
this.optionsChange = this.optionsChange.bind(this);
|
|
623
623
|
}
|
|
624
624
|
initialize() {
|
|
@@ -727,7 +727,7 @@ class MeasureLineDragger extends OdBaseDragger {
|
|
|
727
727
|
optionsChange(event) {
|
|
728
728
|
var _a;
|
|
729
729
|
const options = event.data;
|
|
730
|
-
const toUnitName = (_a = options.rulerUnit) !== null && _a !==
|
|
730
|
+
const toUnitName = (_a = options.rulerUnit) !== null && _a !== void 0 ? _a : "Default";
|
|
731
731
|
if (this.oldRulerUnit === toUnitName) return;
|
|
732
732
|
this.oldRulerUnit = toUnitName;
|
|
733
733
|
const drawingUnit = this.m_module.getViewer().getUnit();
|
|
@@ -852,7 +852,7 @@ class OdaWalkDragger extends OdBaseDragger {
|
|
|
852
852
|
const model = this.viewer.getActiveModel();
|
|
853
853
|
model.removeEntity(this.cameraId);
|
|
854
854
|
model.delete();
|
|
855
|
-
(_a = this.cameraWalker) === null || _a ===
|
|
855
|
+
(_a = this.cameraWalker) === null || _a === void 0 ? void 0 : _a.delete();
|
|
856
856
|
}
|
|
857
857
|
if (this.viewParams) {
|
|
858
858
|
this.setViewParams(this.viewParams);
|
|
@@ -1207,7 +1207,7 @@ class OrbitAction {
|
|
|
1207
1207
|
const extView = this.getViewer().getActiveTvExtendedView();
|
|
1208
1208
|
extView.setView(viewParams.position, viewParams.target, viewParams.upVector, viewParams.viewFieldWidth, viewParams.viewFieldHeight, viewParams.perspective);
|
|
1209
1209
|
extView.delete();
|
|
1210
|
-
(_b = (_a = this._subject.activeDragger()) === null || _a ===
|
|
1210
|
+
(_b = (_a = this._subject.activeDragger()) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1211
1211
|
}
|
|
1212
1212
|
endAction() {
|
|
1213
1213
|
this._endInteractivity();
|
|
@@ -1312,7 +1312,7 @@ class OrbitAction {
|
|
|
1312
1312
|
deleteAll(objects) {
|
|
1313
1313
|
var _a;
|
|
1314
1314
|
for (const obj of objects) {
|
|
1315
|
-
(_a = obj === null || obj ===
|
|
1315
|
+
(_a = obj === null || obj === void 0 ? void 0 : obj.delete) === null || _a === void 0 ? void 0 : _a.call(obj);
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
@@ -1379,7 +1379,7 @@ class PanAction {
|
|
|
1379
1379
|
targetWithDelta.delete();
|
|
1380
1380
|
position.delete();
|
|
1381
1381
|
positionWithDelta.delete();
|
|
1382
|
-
(_b = (_a = this._subject.activeDragger()) === null || _a ===
|
|
1382
|
+
(_b = (_a = this._subject.activeDragger()) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1383
1383
|
this._subject.emitEvent({
|
|
1384
1384
|
type: "pan",
|
|
1385
1385
|
x: absoluteX,
|
|
@@ -1432,7 +1432,7 @@ class ZoomAction {
|
|
|
1432
1432
|
const viewer = this._m_module.getViewer();
|
|
1433
1433
|
viewer.zoomAt(zoomFactor, x, y);
|
|
1434
1434
|
this._subject.deviceAutoRegeneration();
|
|
1435
|
-
(_b = (_a = this._subject.activeDragger()) === null || _a ===
|
|
1435
|
+
(_b = (_a = this._subject.activeDragger()) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1436
1436
|
this._subject.emitEvent({
|
|
1437
1437
|
type: "zoomat",
|
|
1438
1438
|
data: zoomFactor,
|
|
@@ -1794,7 +1794,7 @@ function applyModelTransform(viewer, model) {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
modelItr.delete();
|
|
1797
|
-
(_a = visViewer.clearViewExtentsCache) === null || _a ===
|
|
1797
|
+
(_a = visViewer.clearViewExtentsCache) === null || _a === void 0 ? void 0 : _a.call(visViewer);
|
|
1798
1798
|
viewer.update();
|
|
1799
1799
|
}
|
|
1800
1800
|
|
|
@@ -1821,7 +1821,7 @@ function clearSlices(viewer) {
|
|
|
1821
1821
|
function createPreview(viewer, type = "image/jpeg", encoderOptions = .25) {
|
|
1822
1822
|
var _a;
|
|
1823
1823
|
if (!viewer.visualizeJs) return "";
|
|
1824
|
-
return ((_a = viewer.canvas) === null || _a ===
|
|
1824
|
+
return ((_a = viewer.canvas) === null || _a === void 0 ? void 0 : _a.toDataURL(type, encoderOptions)) || "";
|
|
1825
1825
|
}
|
|
1826
1826
|
|
|
1827
1827
|
function explode(viewer, index = 0) {
|
|
@@ -1981,7 +1981,7 @@ function setSelected(viewer, handles = []) {
|
|
|
1981
1981
|
const visLib = viewer.visLib();
|
|
1982
1982
|
const visViewer = visLib.getViewer();
|
|
1983
1983
|
const selectionSet = new visLib.OdTvSelectionSet;
|
|
1984
|
-
handles === null || handles ===
|
|
1984
|
+
handles === null || handles === void 0 ? void 0 : handles.forEach((handle => {
|
|
1985
1985
|
const entityId = visViewer.getEntityByOriginalHandle(handle + "");
|
|
1986
1986
|
if (!entityId.isNull()) selectionSet.appendEntity(entityId);
|
|
1987
1987
|
}));
|
|
@@ -2030,7 +2030,7 @@ function zoomToObjects(viewer, handles = []) {
|
|
|
2030
2030
|
const entityId = visViewer.getEntityByOriginalHandle(handle + "");
|
|
2031
2031
|
if (!entityId.isNull()) selectionSet.appendEntity(entityId);
|
|
2032
2032
|
}));
|
|
2033
|
-
(_a = visViewer.zoomToObjects) === null || _a ===
|
|
2033
|
+
(_a = visViewer.zoomToObjects) === null || _a === void 0 ? void 0 : _a.call(visViewer, selectionSet);
|
|
2034
2034
|
viewer.deviceAutoRegeneration();
|
|
2035
2035
|
viewer.update();
|
|
2036
2036
|
viewer.emitEvent({
|
|
@@ -2044,7 +2044,7 @@ function zoomToSelected(viewer) {
|
|
|
2044
2044
|
if (!viewer.visualizeJs) return;
|
|
2045
2045
|
const visViewer = viewer.visViewer();
|
|
2046
2046
|
const selectionSet = visViewer.getSelected();
|
|
2047
|
-
(_a = visViewer.zoomToObjects) === null || _a ===
|
|
2047
|
+
(_a = visViewer.zoomToObjects) === null || _a === void 0 ? void 0 : _a.call(visViewer, selectionSet);
|
|
2048
2048
|
viewer.deviceAutoRegeneration();
|
|
2049
2049
|
viewer.update();
|
|
2050
2050
|
viewer.emitEvent({
|
|
@@ -2102,7 +2102,7 @@ async function autoTransformAllModelsToCentralPoint(viewer, model) {
|
|
|
2102
2102
|
modelPtr.delete();
|
|
2103
2103
|
}
|
|
2104
2104
|
modelItr.delete();
|
|
2105
|
-
(_a = visViewer.clearViewExtentsCache) === null || _a ===
|
|
2105
|
+
(_a = visViewer.clearViewExtentsCache) === null || _a === void 0 ? void 0 : _a.call(visViewer);
|
|
2106
2106
|
viewer.update();
|
|
2107
2107
|
}
|
|
2108
2108
|
|
|
@@ -2946,7 +2946,7 @@ class OdaTextDragger extends OdBaseDragger {
|
|
|
2946
2946
|
dispose() {
|
|
2947
2947
|
var _a;
|
|
2948
2948
|
super.dispose();
|
|
2949
|
-
(_a = this.textRef) === null || _a ===
|
|
2949
|
+
(_a = this.textRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
2950
2950
|
this.textRef = null;
|
|
2951
2951
|
}
|
|
2952
2952
|
_finishInput() {
|
|
@@ -2954,7 +2954,7 @@ class OdaTextDragger extends OdBaseDragger {
|
|
|
2954
2954
|
if (this.textRef && this.textRef.value.trimLeft()) {
|
|
2955
2955
|
this._updateFrame();
|
|
2956
2956
|
}
|
|
2957
|
-
(_a = this.textRef) === null || _a ===
|
|
2957
|
+
(_a = this.textRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
2958
2958
|
this.textRef = null;
|
|
2959
2959
|
}
|
|
2960
2960
|
start(x, y, absoluteX, absoluteY) {
|
|
@@ -3233,7 +3233,7 @@ class Viewer extends EventEmitter2 {
|
|
|
3233
3233
|
this._renderTime = 0;
|
|
3234
3234
|
this.canvasEvents = CANVAS_EVENTS.slice();
|
|
3235
3235
|
this.canvaseventlistener = event => this.emit(event);
|
|
3236
|
-
this._enableAutoUpdate = (_a = params.enableAutoUpdate) !== null && _a !==
|
|
3236
|
+
this._enableAutoUpdate = (_a = params.enableAutoUpdate) !== null && _a !== void 0 ? _a : true;
|
|
3237
3237
|
this._isNeedRender = false;
|
|
3238
3238
|
this._isRunAsyncUpdate = false;
|
|
3239
3239
|
this.render = this.render.bind(this);
|
|
@@ -3250,7 +3250,7 @@ class Viewer extends EventEmitter2 {
|
|
|
3250
3250
|
return this._markup;
|
|
3251
3251
|
}
|
|
3252
3252
|
configure(params) {
|
|
3253
|
-
this._visualizeJsUrl = params.visualizeJsUrl || "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/
|
|
3253
|
+
this._visualizeJsUrl = params.visualizeJsUrl || "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/26.3/Visualize.js";
|
|
3254
3254
|
this._crossOrigin = params.crossOrigin;
|
|
3255
3255
|
return this;
|
|
3256
3256
|
}
|
|
@@ -3332,7 +3332,7 @@ class Viewer extends EventEmitter2 {
|
|
|
3332
3332
|
const visViewer = this.visualizeJs.getViewer();
|
|
3333
3333
|
if (visViewer.isRunningAnimation() || this._isNeedRender) {
|
|
3334
3334
|
visViewer.update();
|
|
3335
|
-
(_b = (_a = this._activeDragger) === null || _a ===
|
|
3335
|
+
(_b = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3336
3336
|
this._isNeedRender = !visViewer.getActiveDevice().isValid();
|
|
3337
3337
|
const deltaTime = (time - this._renderTime) / 1e3;
|
|
3338
3338
|
this._renderTime = time;
|
|
@@ -3363,8 +3363,8 @@ class Viewer extends EventEmitter2 {
|
|
|
3363
3363
|
var _a, _b, _c;
|
|
3364
3364
|
if (this._enableAutoUpdate) {
|
|
3365
3365
|
if (force) {
|
|
3366
|
-
(_a = this.visViewer()) === null || _a ===
|
|
3367
|
-
(_c = (_b = this._activeDragger) === null || _b ===
|
|
3366
|
+
(_a = this.visViewer()) === null || _a === void 0 ? void 0 : _a.update();
|
|
3367
|
+
(_c = (_b = this._activeDragger) === null || _b === void 0 ? void 0 : _b.updatePreview) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
3368
3368
|
} else {
|
|
3369
3369
|
this._isNeedRender = true;
|
|
3370
3370
|
}
|
|
@@ -3417,7 +3417,7 @@ class Viewer extends EventEmitter2 {
|
|
|
3417
3417
|
}
|
|
3418
3418
|
visViewer() {
|
|
3419
3419
|
var _a;
|
|
3420
|
-
return (_a = this.visualizeJs) === null || _a ===
|
|
3420
|
+
return (_a = this.visualizeJs) === null || _a === void 0 ? void 0 : _a.getViewer();
|
|
3421
3421
|
}
|
|
3422
3422
|
syncOpenCloudVisualStyle(isInitializing) {
|
|
3423
3423
|
if (!this.visualizeJs) return this;
|
|
@@ -3568,7 +3568,7 @@ class Viewer extends EventEmitter2 {
|
|
|
3568
3568
|
newDragger = draggers.createDragger(name, this);
|
|
3569
3569
|
if (newDragger) {
|
|
3570
3570
|
this._activeDragger = newDragger;
|
|
3571
|
-
(_b = (_a = this._activeDragger).initialize) === null || _b ===
|
|
3571
|
+
(_b = (_a = this._activeDragger).initialize) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3572
3572
|
}
|
|
3573
3573
|
}
|
|
3574
3574
|
const canvas = this.canvas;
|
|
@@ -3715,14 +3715,14 @@ class Viewer extends EventEmitter2 {
|
|
|
3715
3715
|
if (!this.visualizeJs) return this;
|
|
3716
3716
|
if (!this.client) return this;
|
|
3717
3717
|
const abortController = new AbortController;
|
|
3718
|
-
(_a = this._abortControllerForReferences) === null || _a ===
|
|
3718
|
+
(_a = this._abortControllerForReferences) === null || _a === void 0 ? void 0 : _a.abort();
|
|
3719
3719
|
this._abortControllerForReferences = abortController;
|
|
3720
3720
|
let references = [];
|
|
3721
3721
|
await model.getReferences(abortController.signal).then((data => references = data.references)).catch((e => console.error("Cannot load model references.", e)));
|
|
3722
3722
|
for (const file of references) {
|
|
3723
3723
|
await this.client.downloadFile(file.id, undefined, abortController.signal).then((arrayBuffer => {
|
|
3724
3724
|
var _a;
|
|
3725
|
-
return (_a = this.visualizeJs) === null || _a ===
|
|
3725
|
+
return (_a = this.visualizeJs) === null || _a === void 0 ? void 0 : _a.getViewer().addEmbeddedFile(file.name, new Uint8Array(arrayBuffer));
|
|
3726
3726
|
})).catch((e => console.error(`Cannot load reference file ${file.name}.`, e)));
|
|
3727
3727
|
}
|
|
3728
3728
|
return this;
|
|
@@ -3865,11 +3865,11 @@ class Viewer extends EventEmitter2 {
|
|
|
3865
3865
|
}
|
|
3866
3866
|
cancel() {
|
|
3867
3867
|
var _a, _b, _c;
|
|
3868
|
-
(_a = this._abortControllerForReferences) === null || _a ===
|
|
3868
|
+
(_a = this._abortControllerForReferences) === null || _a === void 0 ? void 0 : _a.abort();
|
|
3869
3869
|
this._abortControllerForReferences = undefined;
|
|
3870
|
-
(_b = this._abortController) === null || _b ===
|
|
3870
|
+
(_b = this._abortController) === null || _b === void 0 ? void 0 : _b.abort();
|
|
3871
3871
|
this._abortController = undefined;
|
|
3872
|
-
(_c = this._abortControllerForRequestMap) === null || _c ===
|
|
3872
|
+
(_c = this._abortControllerForRequestMap) === null || _c === void 0 ? void 0 : _c.forEach((controller => controller.abort()));
|
|
3873
3873
|
this._abortControllerForRequestMap = undefined;
|
|
3874
3874
|
this.emitEvent({
|
|
3875
3875
|
type: "cancel"
|
|
@@ -3927,7 +3927,7 @@ class Viewer extends EventEmitter2 {
|
|
|
3927
3927
|
drawViewpoint(viewpoint) {
|
|
3928
3928
|
var _a;
|
|
3929
3929
|
if (!this.visualizeJs) return;
|
|
3930
|
-
const draggerName = (_a = this._activeDragger) === null || _a ===
|
|
3930
|
+
const draggerName = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.name;
|
|
3931
3931
|
this.setActiveDragger();
|
|
3932
3932
|
this.clearSlices();
|
|
3933
3933
|
this.clearOverlay();
|
|
@@ -4021,7 +4021,7 @@ class Viewer extends EventEmitter2 {
|
|
|
4021
4021
|
})));
|
|
4022
4022
|
}
|
|
4023
4023
|
setSelection(selection) {
|
|
4024
|
-
this.setSelected(selection === null || selection ===
|
|
4024
|
+
this.setSelected(selection === null || selection === void 0 ? void 0 : selection.map((component => component.handle)));
|
|
4025
4025
|
}
|
|
4026
4026
|
executeCommand(id, ...args) {
|
|
4027
4027
|
return commands.executeCommand(id, this, ...args);
|