vim-web 0.5.0-dev.9 → 0.5.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.
- package/dist/style.css +34 -7
- package/dist/types/core-viewers/shared/inputAdapter.d.ts +1 -0
- package/dist/types/core-viewers/shared/keyboardHandler.d.ts +1 -1
- package/dist/types/core-viewers/shared/mouseHandler.d.ts +3 -0
- package/dist/types/core-viewers/ultra/viewer.d.ts +5 -0
- package/dist/types/core-viewers/ultra/viewport.d.ts +6 -0
- package/dist/types/core-viewers/ultra/vim.d.ts +3 -1
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +3 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +4 -2
- package/dist/types/core-viewers/webgl/loader/progressive/instancedMesh.d.ts +5 -0
- package/dist/types/core-viewers/webgl/loader/vim.d.ts +5 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/markers/gizmoMarker.d.ts +1 -0
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +7 -0
- package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +5 -0
- package/dist/types/core-viewers/webgl/viewer/viewport.d.ts +1 -1
- package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
- package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +32 -36
- package/dist/types/react-viewers/errors/errorStyle.d.ts +1 -1
- package/dist/types/react-viewers/helpers/reactUtils.d.ts +2 -1
- package/dist/types/react-viewers/helpers/utils.d.ts +8 -0
- package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -1
- package/dist/types/react-viewers/panels/index.d.ts +1 -0
- package/dist/types/react-viewers/panels/isolationPanel.d.ts +2 -0
- package/dist/types/react-viewers/panels/messageBox.d.ts +2 -0
- package/dist/types/react-viewers/panels/sidePanel.d.ts +1 -1
- package/dist/types/react-viewers/settings/anySettings.d.ts +7 -0
- package/dist/types/react-viewers/settings/index.d.ts +1 -1
- package/dist/types/react-viewers/settings/settingsInputBox.d.ts +4 -0
- package/dist/types/react-viewers/settings/settingsItem.d.ts +30 -0
- package/dist/types/react-viewers/settings/settingsKeys.d.ts +46 -0
- package/dist/types/react-viewers/settings/settingsPanel.d.ts +5 -4
- package/dist/types/react-viewers/settings/settingsPanelContent.d.ts +6 -0
- package/dist/types/react-viewers/settings/settingsState.d.ts +11 -11
- package/dist/types/react-viewers/settings/settingsStorage.d.ts +3 -3
- package/dist/types/react-viewers/settings/settingsSubtitle.d.ts +2 -0
- package/dist/types/react-viewers/settings/settingsToggle.d.ts +11 -0
- package/dist/types/react-viewers/state/controlBarState.d.ts +41 -7
- package/dist/types/react-viewers/state/sharedIsolation.d.ts +2 -0
- package/dist/types/react-viewers/ultra/controlBar.d.ts +4 -1
- package/dist/types/react-viewers/ultra/index.d.ts +1 -0
- package/dist/types/react-viewers/ultra/settings.d.ts +13 -0
- package/dist/types/react-viewers/ultra/settingsPanel.d.ts +5 -0
- package/dist/types/react-viewers/ultra/viewer.d.ts +3 -1
- package/dist/types/react-viewers/ultra/viewerRef.d.ts +3 -0
- package/dist/types/react-viewers/urls.d.ts +0 -1
- package/dist/types/react-viewers/webgl/index.d.ts +1 -0
- package/dist/types/react-viewers/webgl/loading.d.ts +2 -2
- package/dist/types/react-viewers/webgl/settings.d.ts +36 -0
- package/dist/types/react-viewers/webgl/settingsPanel.d.ts +12 -0
- package/dist/types/react-viewers/webgl/viewer.d.ts +3 -3
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +12 -5
- package/dist/vim-web.iife.js +1384 -728
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +1384 -728
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/settings/settings.d.ts +0 -61
package/dist/vim-web.js
CHANGED
|
@@ -46769,6 +46769,11 @@ let Vim$1 = class Vim {
|
|
|
46769
46769
|
* @param {boolean} isLegacy - Indicates whether the Vim object uses a legacy loading pipeline.
|
|
46770
46770
|
*/
|
|
46771
46771
|
constructor(header, document2, g3d2, scene, settings2, map, builder, source, format) {
|
|
46772
|
+
/**
|
|
46773
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
46774
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
46775
|
+
*/
|
|
46776
|
+
__publicField(this, "type", "webgl");
|
|
46772
46777
|
/**
|
|
46773
46778
|
* Indicates whether the vim was opened from a vim or vimx file.
|
|
46774
46779
|
*/
|
|
@@ -48846,19 +48851,38 @@ class InsertableMesh {
|
|
|
48846
48851
|
return new InsertableSubmesh(this, index2);
|
|
48847
48852
|
}
|
|
48848
48853
|
/**
|
|
48849
|
-
|
|
48850
|
-
|
|
48854
|
+
* Sets the material for this mesh.
|
|
48855
|
+
* Set to undefined to reset to original materials.
|
|
48856
|
+
*/
|
|
48851
48857
|
setMaterial(value) {
|
|
48852
|
-
if (this._material === value) return;
|
|
48853
48858
|
if (this.ignoreSceneMaterial) return;
|
|
48854
|
-
|
|
48859
|
+
const base = this._material;
|
|
48860
|
+
let mat;
|
|
48861
|
+
if (Array.isArray(value)) {
|
|
48862
|
+
mat = this._mergeMaterials(value, base);
|
|
48863
|
+
} else {
|
|
48864
|
+
mat = value ?? base;
|
|
48865
|
+
}
|
|
48866
|
+
this.mesh.material = mat;
|
|
48855
48867
|
this.mesh.geometry.clearGroups();
|
|
48856
|
-
if (
|
|
48857
|
-
|
|
48868
|
+
if (Array.isArray(mat)) {
|
|
48869
|
+
mat.forEach((_m, i) => {
|
|
48858
48870
|
this.mesh.geometry.addGroup(0, Infinity, i);
|
|
48859
48871
|
});
|
|
48860
48872
|
}
|
|
48861
48873
|
}
|
|
48874
|
+
_mergeMaterials(value, base) {
|
|
48875
|
+
const baseArr = Array.isArray(base) ? base : [base];
|
|
48876
|
+
const result = [];
|
|
48877
|
+
for (const v of value) {
|
|
48878
|
+
if (v === void 0) {
|
|
48879
|
+
result.push(...baseArr);
|
|
48880
|
+
} else {
|
|
48881
|
+
result.push(v);
|
|
48882
|
+
}
|
|
48883
|
+
}
|
|
48884
|
+
return result;
|
|
48885
|
+
}
|
|
48862
48886
|
}
|
|
48863
48887
|
class InstancedSubmesh {
|
|
48864
48888
|
constructor(mesh, index2) {
|
|
@@ -48945,17 +48969,39 @@ class InstancedMesh2 {
|
|
|
48945
48969
|
}
|
|
48946
48970
|
return submeshes;
|
|
48947
48971
|
}
|
|
48972
|
+
/**
|
|
48973
|
+
* Sets the material for this mesh.
|
|
48974
|
+
* Set to undefined to reset to original materials.
|
|
48975
|
+
*/
|
|
48948
48976
|
setMaterial(value) {
|
|
48949
|
-
if (this._material === value) return;
|
|
48950
48977
|
if (this.ignoreSceneMaterial) return;
|
|
48951
|
-
|
|
48978
|
+
const base = this._material;
|
|
48979
|
+
let mat;
|
|
48980
|
+
if (Array.isArray(value)) {
|
|
48981
|
+
mat = this._mergeMaterials(value, base);
|
|
48982
|
+
} else {
|
|
48983
|
+
mat = value ?? base;
|
|
48984
|
+
}
|
|
48985
|
+
this.mesh.material = mat;
|
|
48952
48986
|
this.mesh.geometry.clearGroups();
|
|
48953
|
-
if (
|
|
48954
|
-
|
|
48987
|
+
if (Array.isArray(mat)) {
|
|
48988
|
+
mat.forEach((_m, i) => {
|
|
48955
48989
|
this.mesh.geometry.addGroup(0, Infinity, i);
|
|
48956
48990
|
});
|
|
48957
48991
|
}
|
|
48958
48992
|
}
|
|
48993
|
+
_mergeMaterials(value, base) {
|
|
48994
|
+
const baseArr = Array.isArray(base) ? base : [base];
|
|
48995
|
+
const result = [];
|
|
48996
|
+
for (const v of value) {
|
|
48997
|
+
if (v === void 0) {
|
|
48998
|
+
result.push(...baseArr);
|
|
48999
|
+
} else {
|
|
49000
|
+
result.push(v);
|
|
49001
|
+
}
|
|
49002
|
+
}
|
|
49003
|
+
return result;
|
|
49004
|
+
}
|
|
48959
49005
|
computeBoundingBoxes() {
|
|
48960
49006
|
this.mesh.geometry.computeBoundingBox();
|
|
48961
49007
|
const boxes = new Array(this.mesh.count);
|
|
@@ -50095,6 +50141,9 @@ const _Marker = class _Marker {
|
|
|
50095
50141
|
get index() {
|
|
50096
50142
|
return this._submesh.index;
|
|
50097
50143
|
}
|
|
50144
|
+
get isRoom() {
|
|
50145
|
+
return false;
|
|
50146
|
+
}
|
|
50098
50147
|
/**
|
|
50099
50148
|
* Updates the underlying submesh and rebinds all attributes to the new mesh.
|
|
50100
50149
|
* @param mesh - The new submesh to bind to this marker.
|
|
@@ -52581,7 +52630,11 @@ class KeyboardHandler extends BaseInputHandler {
|
|
|
52581
52630
|
* @param handler Callback invoked on key up.
|
|
52582
52631
|
*/
|
|
52583
52632
|
registerKeyUp(code, mode, handler) {
|
|
52584
|
-
|
|
52633
|
+
if (Array.isArray(code)) {
|
|
52634
|
+
code.forEach((c) => this.registerKey(this.keyUpHandlers, c, mode, handler));
|
|
52635
|
+
} else {
|
|
52636
|
+
this.registerKey(this.keyUpHandlers, code, mode, handler);
|
|
52637
|
+
}
|
|
52585
52638
|
}
|
|
52586
52639
|
registerKey(map, code, mode, callback) {
|
|
52587
52640
|
mode = map.has(code) ? mode : "replace";
|
|
@@ -52619,6 +52672,7 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52619
52672
|
__publicField(this, "_capture");
|
|
52620
52673
|
__publicField(this, "_dragHandler");
|
|
52621
52674
|
__publicField(this, "_doubleClickHandler", new DoubleClickHandler());
|
|
52675
|
+
__publicField(this, "_clickHandler", new ClickHandler());
|
|
52622
52676
|
__publicField(this, "onButtonDown");
|
|
52623
52677
|
__publicField(this, "onButtonUp");
|
|
52624
52678
|
__publicField(this, "onMouseMove");
|
|
@@ -52627,6 +52681,7 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52627
52681
|
__publicField(this, "onClick");
|
|
52628
52682
|
__publicField(this, "onDoubleClick");
|
|
52629
52683
|
__publicField(this, "onWheel");
|
|
52684
|
+
__publicField(this, "onContextMenu");
|
|
52630
52685
|
this._capture = new CaptureHandler(canvas);
|
|
52631
52686
|
this._dragHandler = new DragHandler((delta, button) => this.onDrag(delta, button));
|
|
52632
52687
|
}
|
|
@@ -52654,22 +52709,28 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52654
52709
|
(_a3 = this.onButtonDown) == null ? void 0 : _a3.call(this, pos, event.button);
|
|
52655
52710
|
this._lastMouseDownPosition = pos;
|
|
52656
52711
|
this._dragHandler.onPointerDown(pos, event.button);
|
|
52712
|
+
this._clickHandler.onPointerDown(pos);
|
|
52657
52713
|
this._capture.onPointerDown(event);
|
|
52658
52714
|
event.preventDefault();
|
|
52659
52715
|
}
|
|
52660
52716
|
handlePointerUp(event) {
|
|
52661
52717
|
var _a3;
|
|
52662
52718
|
if (event.pointerType !== "mouse") return;
|
|
52719
|
+
event.preventDefault();
|
|
52663
52720
|
const pos = this.relativePosition(event);
|
|
52664
52721
|
(_a3 = this.onButtonUp) == null ? void 0 : _a3.call(this, pos, event.button);
|
|
52665
52722
|
this._capture.onPointerUp(event);
|
|
52666
52723
|
this._dragHandler.onPointerUp();
|
|
52667
|
-
|
|
52724
|
+
this._clickHandler.onPointerUp();
|
|
52725
|
+
if (this._doubleClickHandler.isDoubleClick(event)) {
|
|
52668
52726
|
this.handleDoubleClick(event);
|
|
52669
|
-
|
|
52727
|
+
return;
|
|
52728
|
+
}
|
|
52729
|
+
if (this._clickHandler.isClick(event)) {
|
|
52670
52730
|
this.handleMouseClick(event);
|
|
52731
|
+
return;
|
|
52671
52732
|
}
|
|
52672
|
-
|
|
52733
|
+
this.handleContextMenu(event);
|
|
52673
52734
|
}
|
|
52674
52735
|
async handleMouseClick(event) {
|
|
52675
52736
|
var _a3;
|
|
@@ -52682,12 +52743,23 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52682
52743
|
const modif = event.getModifierState("Shift") || event.getModifierState("Control");
|
|
52683
52744
|
(_a3 = this.onClick) == null ? void 0 : _a3.call(this, pos, modif);
|
|
52684
52745
|
}
|
|
52746
|
+
async handleContextMenu(event) {
|
|
52747
|
+
var _a3;
|
|
52748
|
+
if (event.pointerType !== "mouse") return;
|
|
52749
|
+
if (event.button !== 2) return;
|
|
52750
|
+
const pos = this.relativePosition(event);
|
|
52751
|
+
if (!almostEqual(this._lastMouseDownPosition, pos, 0.01)) {
|
|
52752
|
+
return;
|
|
52753
|
+
}
|
|
52754
|
+
(_a3 = this.onContextMenu) == null ? void 0 : _a3.call(this, new Vector2(event.clientX, event.clientY));
|
|
52755
|
+
}
|
|
52685
52756
|
handlePointerMove(event) {
|
|
52686
52757
|
var _a3;
|
|
52687
52758
|
if (event.pointerType !== "mouse") return;
|
|
52688
52759
|
this._canvas.focus();
|
|
52689
52760
|
const pos = this.relativePosition(event);
|
|
52690
52761
|
this._dragHandler.onPointerMove(pos);
|
|
52762
|
+
this._clickHandler.onPointerMove(pos);
|
|
52691
52763
|
(_a3 = this.onMouseMove) == null ? void 0 : _a3.call(this, pos);
|
|
52692
52764
|
}
|
|
52693
52765
|
async handleDoubleClick(event) {
|
|
@@ -52731,17 +52803,46 @@ class CaptureHandler {
|
|
|
52731
52803
|
}
|
|
52732
52804
|
}
|
|
52733
52805
|
}
|
|
52806
|
+
class ClickHandler {
|
|
52807
|
+
constructor() {
|
|
52808
|
+
__publicField(this, "_moved", false);
|
|
52809
|
+
__publicField(this, "_startPosition", new Vector2());
|
|
52810
|
+
__publicField(this, "_clickThreshold", 3e-3);
|
|
52811
|
+
}
|
|
52812
|
+
onPointerDown(pos) {
|
|
52813
|
+
this._moved = false;
|
|
52814
|
+
this._startPosition.copy(pos);
|
|
52815
|
+
}
|
|
52816
|
+
onPointerMove(pos) {
|
|
52817
|
+
if (pos.distanceTo(this._startPosition) > this._clickThreshold) {
|
|
52818
|
+
this._moved = true;
|
|
52819
|
+
}
|
|
52820
|
+
}
|
|
52821
|
+
onPointerUp() {
|
|
52822
|
+
}
|
|
52823
|
+
isClick(event) {
|
|
52824
|
+
if (event.button !== 0) return false;
|
|
52825
|
+
return !this._moved;
|
|
52826
|
+
}
|
|
52827
|
+
}
|
|
52734
52828
|
class DoubleClickHandler {
|
|
52735
52829
|
constructor() {
|
|
52736
52830
|
__publicField(this, "_lastClickTime", 0);
|
|
52737
52831
|
__publicField(this, "_clickDelay", 300);
|
|
52832
|
+
// Max time between clicks for double-click
|
|
52833
|
+
__publicField(this, "_lastClickPosition", null);
|
|
52834
|
+
__publicField(this, "_positionThreshold", 5);
|
|
52738
52835
|
}
|
|
52739
|
-
//
|
|
52740
|
-
|
|
52836
|
+
// Max pixel distance between clicks
|
|
52837
|
+
isDoubleClick(event) {
|
|
52741
52838
|
const currentTime = Date.now();
|
|
52839
|
+
const currentPosition = new Vector2(event.clientX, event.clientY);
|
|
52742
52840
|
const timeDiff = currentTime - this._lastClickTime;
|
|
52841
|
+
const isClose = this._lastClickPosition !== null && this._lastClickPosition.distanceTo(currentPosition) < this._positionThreshold;
|
|
52842
|
+
const isWithinTime = timeDiff < this._clickDelay;
|
|
52743
52843
|
this._lastClickTime = currentTime;
|
|
52744
|
-
|
|
52844
|
+
this._lastClickPosition = currentPosition;
|
|
52845
|
+
return isClose && isWithinTime;
|
|
52745
52846
|
}
|
|
52746
52847
|
}
|
|
52747
52848
|
class DragHandler {
|
|
@@ -52981,23 +53082,15 @@ class InputHandler extends BaseInputHandler {
|
|
|
52981
53082
|
this._moveSpeed = settings2.moveSpeed ?? 1;
|
|
52982
53083
|
this.rotateSpeed = settings2.rotateSpeed ?? 1;
|
|
52983
53084
|
this.orbitSpeed = settings2.orbitSpeed ?? 1;
|
|
52984
|
-
this.reg(document, "contextmenu", (e) => {
|
|
52985
|
-
this._onContextMenu.dispatch(new Vector2(e.clientX, e.clientY));
|
|
52986
|
-
e.preventDefault();
|
|
52987
|
-
});
|
|
52988
53085
|
this.keyboard = new KeyboardHandler(canvas);
|
|
52989
53086
|
this.mouse = new MouseHandler(canvas);
|
|
52990
53087
|
this.touch = new TouchHandler(canvas);
|
|
52991
53088
|
this.keyboard.onKeyDown = (key) => adapter.keyDown(key);
|
|
52992
53089
|
this.keyboard.onKeyUp = (key) => adapter.keyUp(key);
|
|
52993
53090
|
this.keyboard.registerKeyUp("KeyP", "replace", () => adapter.toggleOrthographic());
|
|
52994
|
-
this.keyboard.registerKeyUp("Equal", "replace", () => this.moveSpeed++);
|
|
52995
|
-
this.keyboard.registerKeyUp("Minus", "replace", () => this.moveSpeed--);
|
|
52996
|
-
this.keyboard.registerKeyUp("Space", "replace", () =>
|
|
52997
|
-
this._pointerActive = this._pointerActive === "orbit" ? "look" : "orbit";
|
|
52998
|
-
this._pointerFallback = this._pointerActive;
|
|
52999
|
-
this._onPointerModeChanged.dispatch();
|
|
53000
|
-
});
|
|
53091
|
+
this.keyboard.registerKeyUp(["Equal", "NumpadAdd"], "replace", () => this.moveSpeed++);
|
|
53092
|
+
this.keyboard.registerKeyUp(["Minus", "NumpadSubtract"], "replace", () => this.moveSpeed--);
|
|
53093
|
+
this.keyboard.registerKeyUp("Space", "replace", () => adapter.toggleCameraOrbitMode());
|
|
53001
53094
|
this.keyboard.registerKeyUp("Home", "replace", () => adapter.resetCamera());
|
|
53002
53095
|
this.keyboard.registerKeyUp("Escape", "replace", () => adapter.clearSelection());
|
|
53003
53096
|
this.keyboard.registerKeyUp("KeyF", "replace", () => {
|
|
@@ -53007,18 +53100,28 @@ class InputHandler extends BaseInputHandler {
|
|
|
53007
53100
|
const mul = Math.pow(1.25, this._moveSpeed);
|
|
53008
53101
|
adapter.moveCamera(value.multiplyScalar(mul));
|
|
53009
53102
|
};
|
|
53103
|
+
this.mouse.onContextMenu = (pos) => this._onContextMenu.dispatch(pos);
|
|
53010
53104
|
this.mouse.onButtonDown = adapter.mouseDown;
|
|
53011
53105
|
this.mouse.onMouseMove = adapter.mouseMove;
|
|
53012
|
-
this.mouse.onButtonUp =
|
|
53106
|
+
this.mouse.onButtonUp = (pos, button) => {
|
|
53107
|
+
this.pointerOverride = void 0;
|
|
53108
|
+
adapter.mouseUp(pos, button);
|
|
53109
|
+
};
|
|
53013
53110
|
this.mouse.onDrag = (delta, button) => {
|
|
53014
53111
|
if (button === 0) {
|
|
53015
|
-
if (this.
|
|
53016
|
-
if (this.
|
|
53017
|
-
if (this.
|
|
53018
|
-
if (this.
|
|
53112
|
+
if (this.pointerActive === "orbit") adapter.orbitCamera(toRotation(delta, this.orbitSpeed));
|
|
53113
|
+
if (this.pointerActive === "look") adapter.rotateCamera(toRotation(delta, this.rotateSpeed));
|
|
53114
|
+
if (this.pointerActive === "pan") adapter.panCamera(delta);
|
|
53115
|
+
if (this.pointerActive === "zoom") adapter.dollyCamera(delta);
|
|
53116
|
+
}
|
|
53117
|
+
if (button === 2) {
|
|
53118
|
+
this.pointerOverride = "look";
|
|
53119
|
+
adapter.rotateCamera(toRotation(delta, 1));
|
|
53120
|
+
}
|
|
53121
|
+
if (button === 1) {
|
|
53122
|
+
this.pointerOverride = "pan";
|
|
53123
|
+
adapter.panCamera(delta);
|
|
53019
53124
|
}
|
|
53020
|
-
if (button === 2) adapter.rotateCamera(toRotation(delta, 1));
|
|
53021
|
-
if (button === 1) adapter.panCamera(delta);
|
|
53022
53125
|
};
|
|
53023
53126
|
this.mouse.onClick = (pos, modif) => adapter.selectAtPointer(pos, modif);
|
|
53024
53127
|
this.mouse.onDoubleClick = adapter.frameAtPointer;
|
|
@@ -55316,7 +55419,7 @@ class RenderScene {
|
|
|
55316
55419
|
}
|
|
55317
55420
|
unparent2dObjects(target) {
|
|
55318
55421
|
if (target instanceof Group) {
|
|
55319
|
-
for (const child of target.children) {
|
|
55422
|
+
for (const child of [...target.children]) {
|
|
55320
55423
|
if (child instanceof CSS2DObject) {
|
|
55321
55424
|
target.remove(child);
|
|
55322
55425
|
}
|
|
@@ -55491,6 +55594,7 @@ class Selection {
|
|
|
55491
55594
|
}
|
|
55492
55595
|
add(objectOrObjects) {
|
|
55493
55596
|
if (!this.enabled) return;
|
|
55597
|
+
if (!objectOrObjects) return;
|
|
55494
55598
|
const objects = this.toArray(objectOrObjects);
|
|
55495
55599
|
let changed = false;
|
|
55496
55600
|
for (const obj of objects) {
|
|
@@ -55841,7 +55945,7 @@ let Viewport$1 = class Viewport {
|
|
|
55841
55945
|
/**
|
|
55842
55946
|
* Resizes the canvas and updates the camera to match new parent dimensions.
|
|
55843
55947
|
*/
|
|
55844
|
-
|
|
55948
|
+
resizeToParent() {
|
|
55845
55949
|
this._onResize.dispatch();
|
|
55846
55950
|
}
|
|
55847
55951
|
/**
|
|
@@ -55895,6 +55999,9 @@ function createAdapter$2(viewer) {
|
|
|
55895
55999
|
toggleOrthographic: () => {
|
|
55896
56000
|
viewer.camera.orthographic = !viewer.camera.orthographic;
|
|
55897
56001
|
},
|
|
56002
|
+
toggleCameraOrbitMode: () => {
|
|
56003
|
+
viewer.inputs.pointerActive = viewer.inputs.pointerActive === PointerMode$1.ORBIT ? PointerMode$1.LOOK : PointerMode$1.ORBIT;
|
|
56004
|
+
},
|
|
55898
56005
|
resetCamera: () => {
|
|
55899
56006
|
viewer.camera.lerp(0.75).reset();
|
|
55900
56007
|
},
|
|
@@ -55919,7 +56026,7 @@ function createAdapter$2(viewer) {
|
|
|
55919
56026
|
},
|
|
55920
56027
|
frameAtPointer: async (pos) => {
|
|
55921
56028
|
const result = await viewer.raycaster.raycastFromScreen(pos);
|
|
55922
|
-
viewer.camera.lerp(0.75).frame(result.object);
|
|
56029
|
+
viewer.camera.lerp(0.75).frame(result.object ?? "all");
|
|
55923
56030
|
},
|
|
55924
56031
|
zoom: (value) => {
|
|
55925
56032
|
viewer.camera.lerp(0.75).zoom(value);
|
|
@@ -56930,6 +57037,10 @@ let Renderer$1 = class Renderer {
|
|
|
56930
57037
|
* Indicates whether the scene should be re-rendered on change only.
|
|
56931
57038
|
*/
|
|
56932
57039
|
__publicField(this, "onDemand");
|
|
57040
|
+
/**
|
|
57041
|
+
* The material that will be used when setting model material to undefined.
|
|
57042
|
+
*/
|
|
57043
|
+
__publicField(this, "defaultModelMaterial");
|
|
56933
57044
|
__publicField(this, "fitViewport", () => {
|
|
56934
57045
|
const size = this._viewport.getParentSize();
|
|
56935
57046
|
this.renderer.setPixelRatio(window.devicePixelRatio);
|
|
@@ -57001,11 +57112,14 @@ let Renderer$1 = class Renderer {
|
|
|
57001
57112
|
this._scene.threeScene.background = color;
|
|
57002
57113
|
this.needsUpdate = true;
|
|
57003
57114
|
}
|
|
57115
|
+
/**
|
|
57116
|
+
* Sets the material used to render models. If set to undefined, the default model or mesh material is used.
|
|
57117
|
+
*/
|
|
57004
57118
|
get modelMaterial() {
|
|
57005
57119
|
return this._scene.modelMaterial;
|
|
57006
57120
|
}
|
|
57007
57121
|
set modelMaterial(material) {
|
|
57008
|
-
this._scene.modelMaterial = material;
|
|
57122
|
+
this._scene.modelMaterial = material ?? this.defaultModelMaterial;
|
|
57009
57123
|
}
|
|
57010
57124
|
/**
|
|
57011
57125
|
* Signal dispatched at the end of each frame if the scene was updated, such as visibility changes.
|
|
@@ -57141,6 +57255,11 @@ let Renderer$1 = class Renderer {
|
|
|
57141
57255
|
};
|
|
57142
57256
|
let Viewer$3 = class Viewer {
|
|
57143
57257
|
constructor(settings2) {
|
|
57258
|
+
/**
|
|
57259
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
57260
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
57261
|
+
*/
|
|
57262
|
+
__publicField(this, "type", "webgl");
|
|
57144
57263
|
/**
|
|
57145
57264
|
* The settings configuration used by the viewer.
|
|
57146
57265
|
*/
|
|
@@ -58818,6 +58937,7 @@ class Decoder {
|
|
|
58818
58937
|
}
|
|
58819
58938
|
}
|
|
58820
58939
|
const CODE_TO_KEYCODE = {
|
|
58940
|
+
"Space": 32,
|
|
58821
58941
|
"ArrowUp": 38,
|
|
58822
58942
|
"ArrowDown": 40,
|
|
58823
58943
|
"ArrowLeft": 37,
|
|
@@ -58838,7 +58958,6 @@ function ultraInputAdapter(viewer) {
|
|
|
58838
58958
|
function createAdapter$1(viewer) {
|
|
58839
58959
|
return {
|
|
58840
58960
|
init: () => {
|
|
58841
|
-
viewer.rpc.RPCSetCameraSpeed(10);
|
|
58842
58961
|
},
|
|
58843
58962
|
orbitCamera: (value) => {
|
|
58844
58963
|
},
|
|
@@ -58851,6 +58970,9 @@ function createAdapter$1(viewer) {
|
|
|
58851
58970
|
toggleOrthographic: () => {
|
|
58852
58971
|
console.log("toggleOrthographic. Not supported yet");
|
|
58853
58972
|
},
|
|
58973
|
+
toggleCameraOrbitMode: () => {
|
|
58974
|
+
viewer.rpc.RPCKeyEvent(CODE_TO_KEYCODE["Space"], true);
|
|
58975
|
+
},
|
|
58854
58976
|
resetCamera: () => {
|
|
58855
58977
|
viewer.camera.restoreSavedPosition();
|
|
58856
58978
|
},
|
|
@@ -60819,6 +60941,12 @@ class Viewport2 {
|
|
|
60819
60941
|
this._rpc.RPCSetCameraAspectRatio(this.canvas.offsetWidth, this.canvas.offsetHeight);
|
|
60820
60942
|
}
|
|
60821
60943
|
}
|
|
60944
|
+
/**
|
|
60945
|
+
* Resizes the viewport to match its parent's dimensions
|
|
60946
|
+
*/
|
|
60947
|
+
resizeToParent() {
|
|
60948
|
+
this.update();
|
|
60949
|
+
}
|
|
60822
60950
|
/**
|
|
60823
60951
|
* Cleans up resources by removing resize observer and clearing timeouts
|
|
60824
60952
|
*/
|
|
@@ -60877,11 +61005,12 @@ class Element3D2 {
|
|
|
60877
61005
|
* @returns A promise resolving to the element's bounding box.
|
|
60878
61006
|
*/
|
|
60879
61007
|
async getBoundingBox() {
|
|
60880
|
-
return this.vim.
|
|
61008
|
+
return this.vim.getBoundingBoxForElements([this.element]);
|
|
60881
61009
|
}
|
|
60882
61010
|
}
|
|
60883
61011
|
class Vim2 {
|
|
60884
61012
|
constructor(rpc, color, renderer, source, logger) {
|
|
61013
|
+
__publicField(this, "type", "ultra");
|
|
60885
61014
|
__publicField(this, "source");
|
|
60886
61015
|
__publicField(this, "_handle", -1);
|
|
60887
61016
|
__publicField(this, "_request");
|
|
@@ -60895,6 +61024,7 @@ class Vim2 {
|
|
|
60895
61024
|
// Color tracking remains unchanged.
|
|
60896
61025
|
__publicField(this, "_elementColors", /* @__PURE__ */ new Map());
|
|
60897
61026
|
__publicField(this, "_updatedColors", /* @__PURE__ */ new Set());
|
|
61027
|
+
__publicField(this, "_removedColors", /* @__PURE__ */ new Set());
|
|
60898
61028
|
// Delayed update flag.
|
|
60899
61029
|
__publicField(this, "_updateScheduled", false);
|
|
60900
61030
|
__publicField(this, "_elementCount", 0);
|
|
@@ -61032,14 +61162,14 @@ class Vim2 {
|
|
|
61032
61162
|
}
|
|
61033
61163
|
return handle;
|
|
61034
61164
|
}
|
|
61035
|
-
async
|
|
61036
|
-
if (!this.connected ||
|
|
61165
|
+
async getBoundingBoxForElements(elements) {
|
|
61166
|
+
if (!this.connected || elements !== "all" && elements.length === 0) {
|
|
61037
61167
|
return Promise.resolve(void 0);
|
|
61038
61168
|
}
|
|
61039
|
-
if (
|
|
61169
|
+
if (elements === "all") {
|
|
61040
61170
|
return await this._rpc.RPCGetAABBForVim(this._handle);
|
|
61041
61171
|
}
|
|
61042
|
-
return await this._rpc.RPCGetAABBForElements(this._handle,
|
|
61172
|
+
return await this._rpc.RPCGetAABBForElements(this._handle, elements);
|
|
61043
61173
|
}
|
|
61044
61174
|
async getBoundingBox() {
|
|
61045
61175
|
if (!this.connected) {
|
|
@@ -61060,16 +61190,18 @@ class Vim2 {
|
|
|
61060
61190
|
}
|
|
61061
61191
|
this.applyColor(elements, color);
|
|
61062
61192
|
}
|
|
61063
|
-
applyColor(elements,
|
|
61064
|
-
for (let i = 0; i <
|
|
61065
|
-
const
|
|
61193
|
+
applyColor(elements, colors) {
|
|
61194
|
+
for (let i = 0; i < colors.length; i++) {
|
|
61195
|
+
const color = colors[i];
|
|
61066
61196
|
const element = elements[i];
|
|
61067
|
-
|
|
61197
|
+
const existingColor = this._elementColors.get(element);
|
|
61198
|
+
if (color === void 0 && existingColor !== void 0) {
|
|
61068
61199
|
this._elementColors.delete(element);
|
|
61069
|
-
|
|
61070
|
-
|
|
61200
|
+
this._removedColors.add(element);
|
|
61201
|
+
} else if (color !== existingColor) {
|
|
61202
|
+
this._elementColors.set(element, color);
|
|
61203
|
+
this._updatedColors.add(element);
|
|
61071
61204
|
}
|
|
61072
|
-
this._updatedColors.add(element);
|
|
61073
61205
|
}
|
|
61074
61206
|
this.scheduleColorUpdate();
|
|
61075
61207
|
}
|
|
@@ -61089,6 +61221,7 @@ class Vim2 {
|
|
|
61089
61221
|
}
|
|
61090
61222
|
reapplyColors() {
|
|
61091
61223
|
this._updatedColors.clear();
|
|
61224
|
+
this._removedColors.clear();
|
|
61092
61225
|
this._elementColors.forEach((c, n) => this._updatedColors.add(n));
|
|
61093
61226
|
this.scheduleColorUpdate();
|
|
61094
61227
|
}
|
|
@@ -61105,12 +61238,15 @@ class Vim2 {
|
|
|
61105
61238
|
this._renderer.notifySceneUpdated();
|
|
61106
61239
|
}
|
|
61107
61240
|
async updateRemoteColors() {
|
|
61108
|
-
const
|
|
61109
|
-
const
|
|
61241
|
+
const updatedElement = Array.from(this._updatedColors);
|
|
61242
|
+
const removedElement = Array.from(this._removedColors);
|
|
61243
|
+
const colors = updatedElement.map((n) => this._elementColors.get(n));
|
|
61110
61244
|
const remoteColors = await this._colors.getColors(colors);
|
|
61111
61245
|
const colorIds = remoteColors.map((c) => (c == null ? void 0 : c.id) ?? -1);
|
|
61112
|
-
this._rpc.
|
|
61246
|
+
this._rpc.RPCClearMaterialOverridesForElements(this._handle, removedElement);
|
|
61247
|
+
this._rpc.RPCSetMaterialOverridesForElements(this._handle, updatedElement, colorIds);
|
|
61113
61248
|
this._updatedColors.clear();
|
|
61249
|
+
this._removedColors.clear();
|
|
61114
61250
|
}
|
|
61115
61251
|
}
|
|
61116
61252
|
function wait(ms) {
|
|
@@ -61187,6 +61323,11 @@ let Viewer$2 = class Viewer2 {
|
|
|
61187
61323
|
* @param logger - Optional logger for logging messages.
|
|
61188
61324
|
*/
|
|
61189
61325
|
constructor(canvas, logger) {
|
|
61326
|
+
/**
|
|
61327
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
61328
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
61329
|
+
*/
|
|
61330
|
+
__publicField(this, "type", "ultra");
|
|
61190
61331
|
__publicField(this, "_decoder");
|
|
61191
61332
|
__publicField(this, "_socketClient");
|
|
61192
61333
|
__publicField(this, "_input");
|
|
@@ -61447,80 +61588,72 @@ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
61447
61588
|
Ultra: index$7,
|
|
61448
61589
|
Webgl: index$8
|
|
61449
61590
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
61450
|
-
const
|
|
61451
|
-
const
|
|
61452
|
-
const
|
|
61453
|
-
const
|
|
61454
|
-
const
|
|
61455
|
-
const
|
|
61456
|
-
const
|
|
61457
|
-
const
|
|
61458
|
-
const
|
|
61459
|
-
const
|
|
61460
|
-
const
|
|
61461
|
-
const
|
|
61462
|
-
const
|
|
61463
|
-
const
|
|
61464
|
-
const
|
|
61465
|
-
const
|
|
61466
|
-
const
|
|
61467
|
-
const
|
|
61468
|
-
const
|
|
61469
|
-
const
|
|
61470
|
-
const
|
|
61471
|
-
const
|
|
61472
|
-
const
|
|
61473
|
-
const
|
|
61474
|
-
const
|
|
61475
|
-
const
|
|
61476
|
-
const
|
|
61477
|
-
const
|
|
61478
|
-
const
|
|
61479
|
-
const
|
|
61480
|
-
const
|
|
61481
|
-
const
|
|
61482
|
-
const buttonSectionBoxToSelection = "controlBar.sectionBox.sectionSelection";
|
|
61483
|
-
const buttonSectionBoxToScene = "controlBar.sectionBox.sectionScene";
|
|
61484
|
-
const buttonSectionBoxAuto = "controlBar.sectionBox.auto";
|
|
61485
|
-
const buttonSectionBoxSettings = "controlBar.sectionBox.settings";
|
|
61591
|
+
const cameraSpan = "controlBar.cameraSpan";
|
|
61592
|
+
const cameraFrameSelection = "controlBar.cameraFrameSelection";
|
|
61593
|
+
const cameraFrameScene = "controlBar.cameraFrameScene";
|
|
61594
|
+
const cameraAuto = "controlBar.cameraAuto";
|
|
61595
|
+
const cursorSpan = "controlBar.cursorSpan";
|
|
61596
|
+
const cursorOrbit = "controlBar.cursorOrbit";
|
|
61597
|
+
const cursorLook = "controlBar.cursorLook";
|
|
61598
|
+
const cursorPan = "controlBar.cursorPan";
|
|
61599
|
+
const cursorZoom = "controlBar.cursorZoom";
|
|
61600
|
+
const cursorZoomWindow = "controlBar.cursorZoomWindow";
|
|
61601
|
+
const visibilitySpan = "controlBar.visibilitySpan";
|
|
61602
|
+
const visibilityClearSelection = "controlBar.visibilityClearSelection";
|
|
61603
|
+
const visibilityShowAll = "controlBar.visibilityShowAll";
|
|
61604
|
+
const visibilityIsolateSelection = "controlBar.visibilityIsolateSelection";
|
|
61605
|
+
const visibilityHideSelection = "controlBar.visibilityHideSelection";
|
|
61606
|
+
const visibilityShowSelection = "controlBar.visibilityShowSelection";
|
|
61607
|
+
const visibilityAutoIsolate = "controlBar.visibilityAutoIsolate";
|
|
61608
|
+
const visibilitySettings = "controlBar.visibilitySettings";
|
|
61609
|
+
const sectioningSpan = "controlBar.sectioningSpan";
|
|
61610
|
+
const sectioningEnable = "controlBar.sectioningEnable";
|
|
61611
|
+
const sectioningVisible = "controlBar.sectioningVisible";
|
|
61612
|
+
const sectioningFitSelection = "controlBar.sectioningFitSelection";
|
|
61613
|
+
const sectioningFitScene = "controlBar.sectioningFitScene";
|
|
61614
|
+
const sectioningAuto = "controlBar.sectioningAuto";
|
|
61615
|
+
const sectioningSettings = "controlBar.sectioningSettings";
|
|
61616
|
+
const measureSpan = "controlBar.measureSpan";
|
|
61617
|
+
const measureEnable = "controlBar.measureEnable";
|
|
61618
|
+
const miscSpan = "controlBar.miscSpan";
|
|
61619
|
+
const miscInspector = "controlBar.miscInspector";
|
|
61620
|
+
const miscSettings = "controlBar.miscSettings";
|
|
61621
|
+
const miscHelp = "controlBar.miscHelp";
|
|
61622
|
+
const miscMaximize = "controlBar.miscMaximize";
|
|
61486
61623
|
const controlBarIds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
61487
61624
|
__proto__: null,
|
|
61488
|
-
|
|
61489
|
-
|
|
61490
|
-
|
|
61491
|
-
|
|
61492
|
-
|
|
61493
|
-
|
|
61494
|
-
|
|
61495
|
-
|
|
61496
|
-
|
|
61497
|
-
|
|
61498
|
-
|
|
61499
|
-
|
|
61500
|
-
|
|
61501
|
-
|
|
61502
|
-
|
|
61503
|
-
|
|
61504
|
-
|
|
61505
|
-
|
|
61506
|
-
|
|
61507
|
-
|
|
61508
|
-
|
|
61509
|
-
|
|
61510
|
-
|
|
61511
|
-
|
|
61512
|
-
|
|
61513
|
-
|
|
61514
|
-
|
|
61515
|
-
|
|
61516
|
-
|
|
61517
|
-
|
|
61518
|
-
|
|
61519
|
-
|
|
61520
|
-
sectionSectionBox,
|
|
61521
|
-
sectionSelection,
|
|
61522
|
-
sectionSettings,
|
|
61523
|
-
sectionTools
|
|
61625
|
+
cameraAuto,
|
|
61626
|
+
cameraFrameScene,
|
|
61627
|
+
cameraFrameSelection,
|
|
61628
|
+
cameraSpan,
|
|
61629
|
+
cursorLook,
|
|
61630
|
+
cursorOrbit,
|
|
61631
|
+
cursorPan,
|
|
61632
|
+
cursorSpan,
|
|
61633
|
+
cursorZoom,
|
|
61634
|
+
cursorZoomWindow,
|
|
61635
|
+
measureEnable,
|
|
61636
|
+
measureSpan,
|
|
61637
|
+
miscHelp,
|
|
61638
|
+
miscInspector,
|
|
61639
|
+
miscMaximize,
|
|
61640
|
+
miscSettings,
|
|
61641
|
+
miscSpan,
|
|
61642
|
+
sectioningAuto,
|
|
61643
|
+
sectioningEnable,
|
|
61644
|
+
sectioningFitScene,
|
|
61645
|
+
sectioningFitSelection,
|
|
61646
|
+
sectioningSettings,
|
|
61647
|
+
sectioningSpan,
|
|
61648
|
+
sectioningVisible,
|
|
61649
|
+
visibilityAutoIsolate,
|
|
61650
|
+
visibilityClearSelection,
|
|
61651
|
+
visibilityHideSelection,
|
|
61652
|
+
visibilityIsolateSelection,
|
|
61653
|
+
visibilitySettings,
|
|
61654
|
+
visibilityShowAll,
|
|
61655
|
+
visibilityShowSelection,
|
|
61656
|
+
visibilitySpan
|
|
61524
61657
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
61525
61658
|
const baseSectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-shadow-md";
|
|
61526
61659
|
const sectionDefaultStyle = baseSectionStyle + " vc-bg-white";
|
|
@@ -63613,50 +63746,6 @@ const icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
63613
63746
|
visible,
|
|
63614
63747
|
zoom
|
|
63615
63748
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
63616
|
-
function getDefaultSettings() {
|
|
63617
|
-
return {
|
|
63618
|
-
capacity: {
|
|
63619
|
-
canFollowUrl: true,
|
|
63620
|
-
canGoFullScreen: true,
|
|
63621
|
-
canDownload: true,
|
|
63622
|
-
canReadLocalStorage: true
|
|
63623
|
-
},
|
|
63624
|
-
ui: {
|
|
63625
|
-
logo: true,
|
|
63626
|
-
performance: false,
|
|
63627
|
-
bimTreePanel: true,
|
|
63628
|
-
bimInfoPanel: true,
|
|
63629
|
-
// axesPanel
|
|
63630
|
-
axesPanel: true,
|
|
63631
|
-
orthographic: true,
|
|
63632
|
-
resetCamera: true,
|
|
63633
|
-
// Control bar
|
|
63634
|
-
controlBar: true,
|
|
63635
|
-
// Control bar - cursors
|
|
63636
|
-
orbit: true,
|
|
63637
|
-
lookAround: true,
|
|
63638
|
-
pan: true,
|
|
63639
|
-
zoom: true,
|
|
63640
|
-
zoomWindow: true,
|
|
63641
|
-
// Control bar - camera
|
|
63642
|
-
autoCamera: true,
|
|
63643
|
-
frameScene: true,
|
|
63644
|
-
frameSelection: true,
|
|
63645
|
-
// Control bar - tools
|
|
63646
|
-
sectioningMode: true,
|
|
63647
|
-
measuringMode: true,
|
|
63648
|
-
toggleIsolation: true,
|
|
63649
|
-
// Control bar - settings
|
|
63650
|
-
projectInspector: true,
|
|
63651
|
-
settings: true,
|
|
63652
|
-
help: true,
|
|
63653
|
-
maximise: true
|
|
63654
|
-
}
|
|
63655
|
-
};
|
|
63656
|
-
}
|
|
63657
|
-
function createSettings(settings2) {
|
|
63658
|
-
return settings2 !== void 0 ? deepmerge(getDefaultSettings(), settings2) : getDefaultSettings();
|
|
63659
|
-
}
|
|
63660
63749
|
function getLocalSettings(settings2 = {}) {
|
|
63661
63750
|
try {
|
|
63662
63751
|
const json = localStorage.getItem("viewer.settings");
|
|
@@ -63711,8 +63800,6 @@ function isFalse(value) {
|
|
|
63711
63800
|
}
|
|
63712
63801
|
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
63713
63802
|
__proto__: null,
|
|
63714
|
-
createSettings,
|
|
63715
|
-
getDefaultSettings,
|
|
63716
63803
|
getLocalSettings,
|
|
63717
63804
|
isFalse,
|
|
63718
63805
|
isTrue,
|
|
@@ -67248,7 +67335,7 @@ function whenSomeTrue(value, element) {
|
|
|
67248
67335
|
return value.some(isTrue) ? element : null;
|
|
67249
67336
|
}
|
|
67250
67337
|
function anyUiAxesButton(settings2) {
|
|
67251
|
-
return settings2.ui.
|
|
67338
|
+
return settings2.ui.axesOrthographic || settings2.ui.axesHome;
|
|
67252
67339
|
}
|
|
67253
67340
|
const AxesPanelMemo = React__default.memo(AxesPanel);
|
|
67254
67341
|
function AxesPanel(props) {
|
|
@@ -67308,15 +67395,15 @@ function AxesPanel(props) {
|
|
|
67308
67395
|
children: ortho ? /* @__PURE__ */ jsxRuntimeExports.jsx(orthographic, { height: 20, width: 20, fill: "currentColor" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(perspective, { height: 20, width: 20, fill: "currentColor" })
|
|
67309
67396
|
}
|
|
67310
67397
|
);
|
|
67311
|
-
const hidden2 = isTrue(props.settings.value.ui.
|
|
67398
|
+
const hidden2 = isTrue(props.settings.value.ui.panelAxes) ? "" : " vc-hidden";
|
|
67312
67399
|
const empty2 = !anyUiAxesButton(props.settings.value);
|
|
67313
67400
|
const createBar = () => {
|
|
67314
67401
|
if (empty2) return null;
|
|
67315
67402
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-axes-panel-buttons vc-absolute vc-inset-0 vc-pointer-events-auto vc-order-2 vc-flex vc-items-center vc-justify-evenly vc-bg-white", children: [
|
|
67316
67403
|
whenAllTrue([
|
|
67317
|
-
props.settings.value.ui.
|
|
67404
|
+
props.settings.value.ui.axesOrthographic
|
|
67318
67405
|
], btnOrtho),
|
|
67319
|
-
whenTrue(props.settings.value.ui.
|
|
67406
|
+
whenTrue(props.settings.value.ui.axesHome, btnHome)
|
|
67320
67407
|
] }) });
|
|
67321
67408
|
};
|
|
67322
67409
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -67544,77 +67631,78 @@ function getMeasureState(viewer, cursor) {
|
|
|
67544
67631
|
}
|
|
67545
67632
|
const Style = style;
|
|
67546
67633
|
const Ids$2 = controlBarIds;
|
|
67547
|
-
function controlBarSectionBox(section, hasSelection) {
|
|
67634
|
+
function controlBarSectionBox(section, hasSelection, settings2) {
|
|
67548
67635
|
return {
|
|
67549
|
-
id: Ids$2.
|
|
67636
|
+
id: Ids$2.sectioningSpan,
|
|
67550
67637
|
style: section.enable.get() ? Style.sectionNoPadStyle : Style.sectionDefaultStyle,
|
|
67551
67638
|
//enable: () => section.getEnable(),
|
|
67552
67639
|
buttons: [
|
|
67553
67640
|
{
|
|
67554
|
-
id: Ids$2.
|
|
67641
|
+
id: Ids$2.sectioningEnable,
|
|
67642
|
+
enabled: () => isTrue(settings2.sectioningEnable),
|
|
67555
67643
|
tip: "Enable Section Box",
|
|
67556
67644
|
isOn: () => section.enable.get(),
|
|
67557
|
-
style:
|
|
67645
|
+
style: Style.buttonExpandStyle,
|
|
67558
67646
|
action: () => section.enable.set(!section.enable.get()),
|
|
67559
67647
|
icon: sectionBox
|
|
67560
67648
|
},
|
|
67561
67649
|
{
|
|
67562
|
-
id: Ids$2.
|
|
67650
|
+
id: Ids$2.sectioningFitSelection,
|
|
67563
67651
|
tip: "Fit Section",
|
|
67564
|
-
enabled: () => section.enable.get(),
|
|
67652
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningFitToSelection),
|
|
67565
67653
|
isOn: () => hasSelection,
|
|
67566
|
-
style:
|
|
67654
|
+
style: Style.buttonDisableStyle,
|
|
67567
67655
|
action: () => section.sectionSelection.call(),
|
|
67568
67656
|
icon: sectionBoxShrink
|
|
67569
67657
|
},
|
|
67570
67658
|
{
|
|
67571
|
-
id: Ids$2.
|
|
67659
|
+
id: Ids$2.sectioningFitScene,
|
|
67572
67660
|
tip: "Reset Section",
|
|
67573
|
-
enabled: () => section.enable.get(),
|
|
67574
|
-
style:
|
|
67661
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningReset),
|
|
67662
|
+
style: Style.buttonDefaultStyle,
|
|
67575
67663
|
action: () => section.sectionScene.call(),
|
|
67576
67664
|
icon: sectionBoxReset
|
|
67577
67665
|
},
|
|
67578
67666
|
{
|
|
67579
|
-
id: Ids$2.
|
|
67667
|
+
id: Ids$2.sectioningVisible,
|
|
67580
67668
|
tip: "Show Section Box",
|
|
67581
|
-
enabled: () => section.enable.get(),
|
|
67669
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningShow),
|
|
67582
67670
|
isOn: () => section.visible.get(),
|
|
67583
|
-
style:
|
|
67671
|
+
style: Style.buttonDefaultStyle,
|
|
67584
67672
|
action: () => section.visible.set(!section.visible.get()),
|
|
67585
67673
|
icon: visible
|
|
67586
67674
|
},
|
|
67587
67675
|
{
|
|
67588
|
-
id: Ids$2.
|
|
67676
|
+
id: Ids$2.sectioningAuto,
|
|
67589
67677
|
tip: "Auto Section",
|
|
67590
|
-
enabled: () => section.enable.get(),
|
|
67678
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningAuto),
|
|
67591
67679
|
isOn: () => section.auto.get(),
|
|
67592
|
-
style:
|
|
67680
|
+
style: Style.buttonDefaultStyle,
|
|
67593
67681
|
action: () => section.auto.set(!section.auto.get()),
|
|
67594
67682
|
icon: sectionBoxAuto
|
|
67595
67683
|
},
|
|
67596
67684
|
{
|
|
67597
|
-
id: Ids$2.
|
|
67685
|
+
id: Ids$2.sectioningSettings,
|
|
67598
67686
|
tip: "Section Settings",
|
|
67599
|
-
enabled: () => section.enable.get(),
|
|
67687
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningSettings),
|
|
67600
67688
|
isOn: () => section.showOffsetPanel.get(),
|
|
67601
|
-
style:
|
|
67689
|
+
style: Style.buttonDefaultStyle,
|
|
67602
67690
|
action: () => section.showOffsetPanel.set(!section.showOffsetPanel.get()),
|
|
67603
67691
|
icon: slidersHoriz
|
|
67604
67692
|
}
|
|
67605
67693
|
]
|
|
67606
67694
|
};
|
|
67607
67695
|
}
|
|
67608
|
-
function controlBarPointer(viewer,
|
|
67696
|
+
function controlBarPointer(viewer, settings2) {
|
|
67609
67697
|
const pointer2 = getPointerState(viewer);
|
|
67610
67698
|
return {
|
|
67611
|
-
id: Ids$2.
|
|
67699
|
+
id: Ids$2.cursorSpan,
|
|
67612
67700
|
enable: () => anyUiCursorButton(settings2),
|
|
67613
67701
|
style: Style.sectionDefaultStyle,
|
|
67614
67702
|
buttons: [
|
|
67615
67703
|
{
|
|
67616
|
-
id: Ids$2.
|
|
67617
|
-
enabled: () => isTrue(settings2.
|
|
67704
|
+
id: Ids$2.cursorOrbit,
|
|
67705
|
+
enabled: () => isTrue(settings2.cursorOrbit),
|
|
67618
67706
|
tip: "Orbit",
|
|
67619
67707
|
action: () => pointer2.onButton(PointerMode$1.ORBIT),
|
|
67620
67708
|
icon: orbit,
|
|
@@ -67622,8 +67710,8 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67622
67710
|
style: Style.buttonDefaultStyle
|
|
67623
67711
|
},
|
|
67624
67712
|
{
|
|
67625
|
-
id: Ids$2.
|
|
67626
|
-
enabled: () => isTrue(settings2.
|
|
67713
|
+
id: Ids$2.cursorLook,
|
|
67714
|
+
enabled: () => isTrue(settings2.cursorLookAround),
|
|
67627
67715
|
tip: "Look Around",
|
|
67628
67716
|
action: () => pointer2.onButton(PointerMode$1.LOOK),
|
|
67629
67717
|
icon: look,
|
|
@@ -67631,8 +67719,8 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67631
67719
|
style: Style.buttonDefaultStyle
|
|
67632
67720
|
},
|
|
67633
67721
|
{
|
|
67634
|
-
id: Ids$2.
|
|
67635
|
-
enabled: () => isTrue(settings2.
|
|
67722
|
+
id: Ids$2.cursorPan,
|
|
67723
|
+
enabled: () => isTrue(settings2.cursorPan),
|
|
67636
67724
|
tip: "Pan",
|
|
67637
67725
|
action: () => pointer2.onButton(PointerMode$1.PAN),
|
|
67638
67726
|
icon: pan,
|
|
@@ -67640,8 +67728,8 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67640
67728
|
style: Style.buttonDefaultStyle
|
|
67641
67729
|
},
|
|
67642
67730
|
{
|
|
67643
|
-
id: Ids$2.
|
|
67644
|
-
enabled: () => isTrue(settings2.
|
|
67731
|
+
id: Ids$2.cursorZoom,
|
|
67732
|
+
enabled: () => isTrue(settings2.cursorZoom),
|
|
67645
67733
|
tip: "Zoom",
|
|
67646
67734
|
action: () => pointer2.onButton(PointerMode$1.ZOOM),
|
|
67647
67735
|
icon: zoom,
|
|
@@ -67651,15 +67739,15 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67651
67739
|
]
|
|
67652
67740
|
};
|
|
67653
67741
|
}
|
|
67654
|
-
function controlBarMeasure(
|
|
67742
|
+
function controlBarMeasure(measure$1, settings2) {
|
|
67655
67743
|
return {
|
|
67656
|
-
id: Ids$2.
|
|
67744
|
+
id: Ids$2.measureSpan,
|
|
67657
67745
|
enable: () => true,
|
|
67658
67746
|
style: Style.sectionDefaultStyle,
|
|
67659
67747
|
buttons: [
|
|
67660
67748
|
{
|
|
67661
|
-
id: Ids$2.
|
|
67662
|
-
enabled: () => isTrue(settings2.
|
|
67749
|
+
id: Ids$2.measureEnable,
|
|
67750
|
+
enabled: () => isTrue(settings2.measureEnable),
|
|
67663
67751
|
isOn: () => measure$1.active,
|
|
67664
67752
|
tip: "Measuring Mode",
|
|
67665
67753
|
action: () => measure$1.toggle(),
|
|
@@ -67669,40 +67757,57 @@ function controlBarMeasure(settings2, measure$1) {
|
|
|
67669
67757
|
]
|
|
67670
67758
|
};
|
|
67671
67759
|
}
|
|
67672
|
-
function
|
|
67760
|
+
function createMiscSettingsButton(side, settings$1) {
|
|
67761
|
+
return {
|
|
67762
|
+
id: Ids$2.miscSettings,
|
|
67763
|
+
enabled: () => isTrue(settings$1.ui.miscSettings),
|
|
67764
|
+
tip: "Settings",
|
|
67765
|
+
action: () => side.toggleContent("settings"),
|
|
67766
|
+
icon: settings,
|
|
67767
|
+
style: Style.buttonDefaultStyle
|
|
67768
|
+
};
|
|
67769
|
+
}
|
|
67770
|
+
function createMiscHelpButton(modal, settings2) {
|
|
67771
|
+
return {
|
|
67772
|
+
id: Ids$2.miscHelp,
|
|
67773
|
+
enabled: () => isTrue(settings2.ui.miscHelp),
|
|
67774
|
+
tip: "Help",
|
|
67775
|
+
action: () => modal.help(true),
|
|
67776
|
+
icon: help,
|
|
67777
|
+
style: Style.buttonDefaultStyle
|
|
67778
|
+
};
|
|
67779
|
+
}
|
|
67780
|
+
function controlBarMiscUltra(modal, side, settings2) {
|
|
67781
|
+
return {
|
|
67782
|
+
id: Ids$2.miscSpan,
|
|
67783
|
+
enable: () => anyUltraMiscButton(settings2),
|
|
67784
|
+
style: Style.sectionDefaultStyle,
|
|
67785
|
+
buttons: [
|
|
67786
|
+
createMiscSettingsButton(side, settings2),
|
|
67787
|
+
createMiscHelpButton(modal, settings2)
|
|
67788
|
+
]
|
|
67789
|
+
};
|
|
67790
|
+
}
|
|
67791
|
+
function controlBarMisc(modal, side, settings2) {
|
|
67673
67792
|
const fullScreen = getFullScreenState();
|
|
67674
67793
|
return {
|
|
67675
|
-
id: Ids$2.
|
|
67676
|
-
enable: () =>
|
|
67794
|
+
id: Ids$2.miscSpan,
|
|
67795
|
+
enable: () => anyWebglMiscButton(settings2),
|
|
67677
67796
|
style: Style.sectionDefaultStyle,
|
|
67678
67797
|
buttons: [
|
|
67679
67798
|
{
|
|
67680
|
-
id: Ids$2.
|
|
67681
|
-
enabled: () =>
|
|
67799
|
+
id: Ids$2.miscInspector,
|
|
67800
|
+
enabled: () => showBimButton(settings2),
|
|
67682
67801
|
tip: "Project Inspector",
|
|
67683
67802
|
action: () => side.toggleContent("bim"),
|
|
67684
67803
|
icon: treeView,
|
|
67685
67804
|
style: Style.buttonDefaultStyle
|
|
67686
67805
|
},
|
|
67806
|
+
createMiscSettingsButton(side, settings2),
|
|
67807
|
+
createMiscHelpButton(modal, settings2),
|
|
67687
67808
|
{
|
|
67688
|
-
id: Ids$2.
|
|
67689
|
-
enabled: () => isTrue(
|
|
67690
|
-
tip: "Settings",
|
|
67691
|
-
action: () => side.toggleContent("settings"),
|
|
67692
|
-
icon: settings,
|
|
67693
|
-
style: Style.buttonDefaultStyle
|
|
67694
|
-
},
|
|
67695
|
-
{
|
|
67696
|
-
id: Ids$2.buttonHelp,
|
|
67697
|
-
enabled: () => isTrue(settings$1.ui.help),
|
|
67698
|
-
tip: "Help",
|
|
67699
|
-
action: () => modal.help(true),
|
|
67700
|
-
icon: help,
|
|
67701
|
-
style: Style.buttonDefaultStyle
|
|
67702
|
-
},
|
|
67703
|
-
{
|
|
67704
|
-
id: Ids$2.buttonMaximize,
|
|
67705
|
-
enabled: () => isTrue(settings$1.ui.maximise) && settings$1.capacity.canGoFullScreen,
|
|
67809
|
+
id: Ids$2.miscMaximize,
|
|
67810
|
+
enabled: () => isTrue(settings2.ui.miscMaximise) && settings2.capacity.canGoFullScreen,
|
|
67706
67811
|
tip: fullScreen.get() ? "Minimize" : "Fullscreen",
|
|
67707
67812
|
action: () => fullScreen.toggle(),
|
|
67708
67813
|
icon: fullScreen.get() ? minimize : fullsScreen,
|
|
@@ -67711,14 +67816,15 @@ function controlBarSettings(modal, side, settings$1) {
|
|
|
67711
67816
|
]
|
|
67712
67817
|
};
|
|
67713
67818
|
}
|
|
67714
|
-
function controlBarCamera(camera2) {
|
|
67819
|
+
function controlBarCamera(camera2, settings2) {
|
|
67715
67820
|
return {
|
|
67716
|
-
id: Ids$2.
|
|
67821
|
+
id: Ids$2.cameraSpan,
|
|
67717
67822
|
enable: () => true,
|
|
67718
67823
|
style: Style.sectionDefaultStyle,
|
|
67719
67824
|
buttons: [
|
|
67720
67825
|
{
|
|
67721
|
-
id: Ids$2.
|
|
67826
|
+
id: Ids$2.cameraAuto,
|
|
67827
|
+
enabled: () => isTrue(settings2.cameraAuto),
|
|
67722
67828
|
tip: "Auto Camera",
|
|
67723
67829
|
isOn: () => camera2.autoCamera.get(),
|
|
67724
67830
|
action: () => camera2.autoCamera.set(!camera2.autoCamera.get()),
|
|
@@ -67726,8 +67832,8 @@ function controlBarCamera(camera2) {
|
|
|
67726
67832
|
style: Style.buttonDefaultStyle
|
|
67727
67833
|
},
|
|
67728
67834
|
{
|
|
67729
|
-
id: Ids$2.
|
|
67730
|
-
|
|
67835
|
+
id: Ids$2.cameraFrameSelection,
|
|
67836
|
+
enabled: () => isTrue(settings2.cameraFrameSelection),
|
|
67731
67837
|
tip: "Frame Selection",
|
|
67732
67838
|
action: () => camera2.frameSelection.call(),
|
|
67733
67839
|
icon: frameSelection,
|
|
@@ -67735,8 +67841,8 @@ function controlBarCamera(camera2) {
|
|
|
67735
67841
|
style: Style.buttonDefaultStyle
|
|
67736
67842
|
},
|
|
67737
67843
|
{
|
|
67738
|
-
id: Ids$2.
|
|
67739
|
-
|
|
67844
|
+
id: Ids$2.cameraFrameScene,
|
|
67845
|
+
enabled: () => isTrue(settings2.cameraFrameScene),
|
|
67740
67846
|
tip: "Frame All",
|
|
67741
67847
|
action: () => camera2.frameScene.call(),
|
|
67742
67848
|
icon: frameScene,
|
|
@@ -67746,16 +67852,17 @@ function controlBarCamera(camera2) {
|
|
|
67746
67852
|
]
|
|
67747
67853
|
};
|
|
67748
67854
|
}
|
|
67749
|
-
function
|
|
67855
|
+
function controlBarVisibility(isolation, settings2) {
|
|
67750
67856
|
const adapter = isolation.adapter.current;
|
|
67751
67857
|
const someVisible = adapter.hasVisibleSelection() || !adapter.hasHiddenSelection();
|
|
67752
67858
|
return {
|
|
67753
|
-
id: Ids$2.
|
|
67859
|
+
id: Ids$2.visibilitySpan,
|
|
67754
67860
|
enable: () => true,
|
|
67755
|
-
style:
|
|
67861
|
+
style: Style.sectionDefaultStyle,
|
|
67756
67862
|
buttons: [
|
|
67757
67863
|
{
|
|
67758
|
-
id: Ids$2.
|
|
67864
|
+
id: Ids$2.visibilityClearSelection,
|
|
67865
|
+
enabled: () => isTrue(settings2.visibilityClearSelection),
|
|
67759
67866
|
tip: "Clear Selection",
|
|
67760
67867
|
action: () => adapter.clearSelection(),
|
|
67761
67868
|
icon: pointer,
|
|
@@ -67763,16 +67870,17 @@ function controlBarSelection(isolation) {
|
|
|
67763
67870
|
style: Style.buttonDisableDefaultStyle
|
|
67764
67871
|
},
|
|
67765
67872
|
{
|
|
67766
|
-
id: Ids$2.
|
|
67873
|
+
id: Ids$2.visibilityShowAll,
|
|
67767
67874
|
tip: "Show All",
|
|
67875
|
+
enabled: () => isTrue(settings2.visibilityShowAll),
|
|
67768
67876
|
action: () => adapter.showAll(),
|
|
67769
67877
|
icon: showAll,
|
|
67770
67878
|
isOn: () => !isolation.autoIsolate.get() && isolation.visibility.get() !== "all",
|
|
67771
67879
|
style: Style.buttonDisableStyle
|
|
67772
67880
|
},
|
|
67773
67881
|
{
|
|
67774
|
-
id: Ids$2.
|
|
67775
|
-
enabled: () => someVisible,
|
|
67882
|
+
id: Ids$2.visibilityHideSelection,
|
|
67883
|
+
enabled: () => someVisible && isTrue(settings2.visibilityToggle),
|
|
67776
67884
|
tip: "Hide Selection",
|
|
67777
67885
|
action: () => adapter.hideSelection(),
|
|
67778
67886
|
icon: hideSelection,
|
|
@@ -67780,8 +67888,8 @@ function controlBarSelection(isolation) {
|
|
|
67780
67888
|
style: Style.buttonDisableStyle
|
|
67781
67889
|
},
|
|
67782
67890
|
{
|
|
67783
|
-
id: Ids$2.
|
|
67784
|
-
enabled: () => !someVisible,
|
|
67891
|
+
id: Ids$2.visibilityShowSelection,
|
|
67892
|
+
enabled: () => !someVisible && isTrue(settings2.visibilityToggle),
|
|
67785
67893
|
tip: "Show Selection",
|
|
67786
67894
|
action: () => adapter.showSelection(),
|
|
67787
67895
|
icon: showSelection,
|
|
@@ -67789,7 +67897,8 @@ function controlBarSelection(isolation) {
|
|
|
67789
67897
|
style: Style.buttonDisableStyle
|
|
67790
67898
|
},
|
|
67791
67899
|
{
|
|
67792
|
-
id: Ids$2.
|
|
67900
|
+
id: Ids$2.visibilityIsolateSelection,
|
|
67901
|
+
enabled: () => isTrue(settings2.visibilityIsolate),
|
|
67793
67902
|
tip: "Isolate Selection",
|
|
67794
67903
|
action: () => adapter.isolateSelection(),
|
|
67795
67904
|
icon: isolateSelection,
|
|
@@ -67797,14 +67906,16 @@ function controlBarSelection(isolation) {
|
|
|
67797
67906
|
style: Style.buttonDisableStyle
|
|
67798
67907
|
},
|
|
67799
67908
|
{
|
|
67800
|
-
id: Ids$2.
|
|
67909
|
+
id: Ids$2.visibilityAutoIsolate,
|
|
67910
|
+
enabled: () => isTrue(settings2.visibilityAutoIsolate),
|
|
67801
67911
|
tip: "Auto Isolate",
|
|
67802
67912
|
action: () => isolation.autoIsolate.set(!isolation.autoIsolate.get()),
|
|
67803
67913
|
isOn: () => isolation.autoIsolate.get(),
|
|
67804
67914
|
icon: autoIsolate
|
|
67805
67915
|
},
|
|
67806
67916
|
{
|
|
67807
|
-
id: Ids$2.
|
|
67917
|
+
id: Ids$2.visibilitySettings,
|
|
67918
|
+
enabled: () => isTrue(settings2.visibilitySettings),
|
|
67808
67919
|
tip: "Isolation Settings",
|
|
67809
67920
|
action: () => isolation.showPanel.set(!isolation.showPanel.get()),
|
|
67810
67921
|
icon: slidersHoriz,
|
|
@@ -67815,28 +67926,31 @@ function controlBarSelection(isolation) {
|
|
|
67815
67926
|
}
|
|
67816
67927
|
function useControlBar(viewer, camera2, modal, side, cursor, settings2, section, isolationRef, customization) {
|
|
67817
67928
|
const measure2 = getMeasureState(viewer, cursor);
|
|
67818
|
-
const pointerSection = controlBarPointer(viewer, camera2, settings2);
|
|
67819
|
-
const actionSection = controlBarMeasure(settings2, measure2);
|
|
67820
|
-
const sectionBoxSection = controlBarSectionBox(section, viewer.selection.any());
|
|
67821
|
-
const settingsSection = controlBarSettings(modal, side, settings2);
|
|
67822
|
-
const cameraSection = controlBarCamera(camera2);
|
|
67823
|
-
const selectionSection = controlBarSelection(isolationRef);
|
|
67824
67929
|
let controlBarSections = [
|
|
67825
|
-
|
|
67826
|
-
|
|
67827
|
-
|
|
67828
|
-
|
|
67829
|
-
|
|
67830
|
-
|
|
67930
|
+
controlBarPointer(viewer, settings2.ui),
|
|
67931
|
+
controlBarCamera(camera2, settings2.ui),
|
|
67932
|
+
controlBarVisibility(isolationRef, settings2.ui),
|
|
67933
|
+
controlBarMeasure(measure2, settings2.ui),
|
|
67934
|
+
controlBarSectionBox(section, viewer.selection.any(), settings2.ui),
|
|
67935
|
+
controlBarMisc(modal, side, settings2)
|
|
67831
67936
|
];
|
|
67832
67937
|
controlBarSections = (customization == null ? void 0 : customization(controlBarSections)) ?? controlBarSections;
|
|
67833
67938
|
return controlBarSections;
|
|
67834
67939
|
}
|
|
67940
|
+
function showBimButton(settings2) {
|
|
67941
|
+
if (isFalse(settings2.ui.miscProjectInspector)) return false;
|
|
67942
|
+
if (isTrue(settings2.ui.panelBimTree)) return true;
|
|
67943
|
+
if (isTrue(settings2.ui.panelBimInfo)) return true;
|
|
67944
|
+
return false;
|
|
67945
|
+
}
|
|
67835
67946
|
function anyUiCursorButton(settings2) {
|
|
67836
|
-
return isTrue(settings2.
|
|
67947
|
+
return isTrue(settings2.cursorOrbit) || isTrue(settings2.cursorLookAround) || isTrue(settings2.cursorPan) || isTrue(settings2.cursorZoom);
|
|
67837
67948
|
}
|
|
67838
|
-
function
|
|
67839
|
-
return isTrue(settings2.ui.
|
|
67949
|
+
function anyWebglMiscButton(settings2) {
|
|
67950
|
+
return isTrue(settings2.ui.miscProjectInspector) || isTrue(settings2.ui.miscSettings) || isTrue(settings2.ui.miscHelp) || isTrue(settings2.ui.miscMaximise);
|
|
67951
|
+
}
|
|
67952
|
+
function anyUltraMiscButton(settings2) {
|
|
67953
|
+
return isTrue(settings2.ui.miscSettings) || isTrue(settings2.ui.miscHelp);
|
|
67840
67954
|
}
|
|
67841
67955
|
function RestOfScreen(props) {
|
|
67842
67956
|
const [, setVersion] = useState(0);
|
|
@@ -72737,7 +72851,7 @@ function scrollToSelection(div) {
|
|
|
72737
72851
|
return;
|
|
72738
72852
|
}
|
|
72739
72853
|
if (rectElem.top < rectContainer.top || rectElem.top < 0) {
|
|
72740
|
-
selection.scrollIntoView();
|
|
72854
|
+
selection.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
72741
72855
|
}
|
|
72742
72856
|
}
|
|
72743
72857
|
const isControlKey = (e) => {
|
|
@@ -72942,8 +73056,8 @@ function range(size, startAt = 0) {
|
|
|
72942
73056
|
function OptionalBimPanel(props) {
|
|
72943
73057
|
return whenSomeTrue(
|
|
72944
73058
|
[
|
|
72945
|
-
props.settings.ui.
|
|
72946
|
-
props.settings.ui.
|
|
73059
|
+
props.settings.ui.panelBimTree,
|
|
73060
|
+
props.settings.ui.panelBimInfo
|
|
72947
73061
|
],
|
|
72948
73062
|
React__default.createElement(BimPanel, props)
|
|
72949
73063
|
);
|
|
@@ -72956,11 +73070,11 @@ function BimPanel(props) {
|
|
|
72956
73070
|
}, [props.viewerState.vim.get(), props.viewerState.elements.get()]);
|
|
72957
73071
|
const selection = props.viewerState.selection.get();
|
|
72958
73072
|
const last = selection[selection.length - 1];
|
|
72959
|
-
const fullTree = isFalse(props.settings.ui.
|
|
72960
|
-
const fullInfo = isFalse(props.settings.ui.
|
|
73073
|
+
const fullTree = isFalse(props.settings.ui.panelBimInfo);
|
|
73074
|
+
const fullInfo = isFalse(props.settings.ui.panelBimTree);
|
|
72961
73075
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `vim-bim-panel vc-inset-0 vc-absolute vc-h-full vc-w-full ${fullTree ? "full-tree" : ""} ${props.visible ? "" : "vc-hidden"}`, children: [
|
|
72962
73076
|
whenTrue(
|
|
72963
|
-
props.settings.ui.
|
|
73077
|
+
props.settings.ui.panelBimTree,
|
|
72964
73078
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `vim-bim-upper vc-flex vc-flex-col vc-absolute vc-w-full ${fullTree ? "vc-h-full" : "vc-h-[49%]"} `, children: [
|
|
72965
73079
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72966
73080
|
"h2",
|
|
@@ -72994,21 +73108,21 @@ function BimPanel(props) {
|
|
|
72994
73108
|
// Divider if needed.
|
|
72995
73109
|
whenAllTrue(
|
|
72996
73110
|
[
|
|
72997
|
-
props.settings.ui.
|
|
72998
|
-
props.settings.ui.
|
|
73111
|
+
props.settings.ui.panelBimTree,
|
|
73112
|
+
props.settings.ui.panelBimInfo,
|
|
72999
73113
|
((_b2 = props.viewerState.elements.get()) == null ? void 0 : _b2.length) > 0
|
|
73000
73114
|
],
|
|
73001
73115
|
divider$1()
|
|
73002
73116
|
),
|
|
73003
73117
|
whenTrue(
|
|
73004
|
-
props.settings.ui.
|
|
73118
|
+
props.settings.ui.panelBimInfo,
|
|
73005
73119
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-bim-lower-container vc-absolute ${fullInfo ? "vc-top-0" : "vc-top-[50%]"} vc-bottom-0 vc-bottom vc-left-0 vc-right-0`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73006
73120
|
BimInfoPanel,
|
|
73007
73121
|
{
|
|
73008
73122
|
object: last,
|
|
73009
73123
|
vim: props.viewerState.vim.get(),
|
|
73010
73124
|
elements: props.viewerState.elements.get(),
|
|
73011
|
-
full: isFalse(props.settings.ui.
|
|
73125
|
+
full: isFalse(props.settings.ui.panelBimTree),
|
|
73012
73126
|
bimInfoRef: props.bimInfoRef
|
|
73013
73127
|
}
|
|
73014
73128
|
) })
|
|
@@ -73848,7 +73962,7 @@ function SidePanel(props) {
|
|
|
73848
73962
|
} else {
|
|
73849
73963
|
props.container.gfx.style.left = "0px";
|
|
73850
73964
|
}
|
|
73851
|
-
props.viewer.viewport.
|
|
73965
|
+
props.viewer.viewport.resizeToParent();
|
|
73852
73966
|
};
|
|
73853
73967
|
const getMaxSize = () => {
|
|
73854
73968
|
return props.container.root.clientWidth * MAX_WIDTH;
|
|
@@ -73907,7 +74021,10 @@ function SidePanel(props) {
|
|
|
73907
74021
|
style: {
|
|
73908
74022
|
position: "absolute"
|
|
73909
74023
|
},
|
|
73910
|
-
className: `vim-side-panel vc-top-0 vc-left-0 vc-z-20
|
|
74024
|
+
className: `vim-side-panel vc-top-0 vc-left-0 vc-z-20
|
|
74025
|
+
vc-bg-gray-lightest vc-text-gray-darker
|
|
74026
|
+
vc-border-r vc-border-gray-light
|
|
74027
|
+
${props.side.getContent() !== "none" ? "" : "vc-hidden"}`,
|
|
73911
74028
|
children: [
|
|
73912
74029
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73913
74030
|
"button",
|
|
@@ -73990,180 +74107,6 @@ function useSideState(useInspector, defaultWidth) {
|
|
|
73990
74107
|
[side, width]
|
|
73991
74108
|
);
|
|
73992
74109
|
}
|
|
73993
|
-
function SettingsPanel(props) {
|
|
73994
|
-
if (!props.visible) return null;
|
|
73995
|
-
const toggleElement = (label, state, action) => {
|
|
73996
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "vc-m-1 vc-block vc-select-none vc-items-center vc-py-1 vc-text-gray-warm", children: [
|
|
73997
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73998
|
-
"input",
|
|
73999
|
-
{
|
|
74000
|
-
type: "checkbox",
|
|
74001
|
-
checked: state,
|
|
74002
|
-
onChange: action,
|
|
74003
|
-
className: "vim-settings-checkbox vc-checked:bg-primary-royal vc-mr-2 vc-rounded vc-border vc-border-gray-medium "
|
|
74004
|
-
}
|
|
74005
|
-
),
|
|
74006
|
-
" ",
|
|
74007
|
-
label
|
|
74008
|
-
] });
|
|
74009
|
-
};
|
|
74010
|
-
const settingsToggle = (label, getter, setter) => {
|
|
74011
|
-
const value = getter(props.settings.value);
|
|
74012
|
-
if (value === "AlwaysTrue" || value === "AlwaysFalse") {
|
|
74013
|
-
return null;
|
|
74014
|
-
}
|
|
74015
|
-
return toggleElement(label, value, () => {
|
|
74016
|
-
const value2 = getter(props.settings.value);
|
|
74017
|
-
props.settings.update((s) => setter(s, !value2));
|
|
74018
|
-
});
|
|
74019
|
-
};
|
|
74020
|
-
const settingsBox = (label, info, transform, getter, setter) => {
|
|
74021
|
-
const ref = React__default.useRef(null);
|
|
74022
|
-
useEffect(() => {
|
|
74023
|
-
ref.current.value = props.viewer.inputs.scrollSpeed.toFixed(2);
|
|
74024
|
-
}, []);
|
|
74025
|
-
getter(props.settings.value).toString();
|
|
74026
|
-
const update = (event) => {
|
|
74027
|
-
const str = event.target.value;
|
|
74028
|
-
const n = Number.parseFloat(str);
|
|
74029
|
-
if (Number.isNaN(n)) {
|
|
74030
|
-
event.target.value = getter(props.settings.value).toString();
|
|
74031
|
-
} else {
|
|
74032
|
-
const value2 = transform(n);
|
|
74033
|
-
event.target.value = value2.toString();
|
|
74034
|
-
props.settings.update((s) => setter(s, value2));
|
|
74035
|
-
}
|
|
74036
|
-
};
|
|
74037
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-box-input vc-my-1", children: [
|
|
74038
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2", children: [
|
|
74039
|
-
label,
|
|
74040
|
-
":"
|
|
74041
|
-
] }),
|
|
74042
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { ref, type: "text", className: "vim-settings-textbox vc-w-14 vc-ml-1 vc-p-1", onBlur: (e) => update(e) }),
|
|
74043
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2 vc-text-gray vc-ml-1", children: info })
|
|
74044
|
-
] });
|
|
74045
|
-
};
|
|
74046
|
-
function settingsSubtitle(title2) {
|
|
74047
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-subtitle", children: title2 });
|
|
74048
|
-
}
|
|
74049
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
74050
|
-
"div",
|
|
74051
|
-
{
|
|
74052
|
-
className: "vc-absolute vc-inset-0",
|
|
74053
|
-
children: [
|
|
74054
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-title", children: "Settings " }),
|
|
74055
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-settings vc-absolute vc-top-6 vc-left-0 vc-bottom-0 vc-right-0 vc-overflow-y-auto", children: [
|
|
74056
|
-
settingsSubtitle("Inputs"),
|
|
74057
|
-
settingsBox(
|
|
74058
|
-
"Scroll Speed",
|
|
74059
|
-
"[0.1,10]",
|
|
74060
|
-
(n) => MathUtils.clamp(n, 0.1, 10),
|
|
74061
|
-
(s) => props.viewer.inputs.scrollSpeed,
|
|
74062
|
-
(s, v) => {
|
|
74063
|
-
props.viewer.inputs.scrollSpeed = v;
|
|
74064
|
-
}
|
|
74065
|
-
),
|
|
74066
|
-
settingsSubtitle("Panels"),
|
|
74067
|
-
settingsToggle(
|
|
74068
|
-
"Show Logo",
|
|
74069
|
-
(settings2) => settings2.ui.logo,
|
|
74070
|
-
(settings2, value) => settings2.ui.logo = value
|
|
74071
|
-
),
|
|
74072
|
-
settingsToggle(
|
|
74073
|
-
"Show Bim Tree",
|
|
74074
|
-
(settings2) => settings2.ui.bimTreePanel,
|
|
74075
|
-
(settings2, value) => settings2.ui.bimTreePanel = value
|
|
74076
|
-
),
|
|
74077
|
-
settingsToggle(
|
|
74078
|
-
"Show Bim Info",
|
|
74079
|
-
(settings2) => settings2.ui.bimInfoPanel,
|
|
74080
|
-
(settings2, value) => settings2.ui.bimInfoPanel = value
|
|
74081
|
-
),
|
|
74082
|
-
settingsToggle(
|
|
74083
|
-
"Show Axes Panel",
|
|
74084
|
-
(settings2) => settings2.ui.axesPanel,
|
|
74085
|
-
(settings2, value) => settings2.ui.axesPanel = value
|
|
74086
|
-
),
|
|
74087
|
-
settingsToggle(
|
|
74088
|
-
"Show Performance Panel",
|
|
74089
|
-
(settings2) => settings2.ui.performance,
|
|
74090
|
-
(settings2, value) => settings2.ui.performance = value
|
|
74091
|
-
),
|
|
74092
|
-
settingsSubtitle("Axes"),
|
|
74093
|
-
settingsToggle(
|
|
74094
|
-
"Show Orthographic Button",
|
|
74095
|
-
(settings2) => settings2.ui.orthographic,
|
|
74096
|
-
(settings2, value) => settings2.ui.orthographic = value
|
|
74097
|
-
),
|
|
74098
|
-
settingsToggle(
|
|
74099
|
-
"Show Reset Camera Button",
|
|
74100
|
-
(settings2) => settings2.ui.resetCamera,
|
|
74101
|
-
(settings2, value) => settings2.ui.resetCamera = value
|
|
74102
|
-
),
|
|
74103
|
-
settingsSubtitle("Control Bar"),
|
|
74104
|
-
settingsToggle(
|
|
74105
|
-
"Show Control Bar",
|
|
74106
|
-
(settings2) => settings2.ui.controlBar,
|
|
74107
|
-
(settings2, value) => settings2.ui.controlBar = value
|
|
74108
|
-
),
|
|
74109
|
-
settingsSubtitle("Control Bar - Cursors"),
|
|
74110
|
-
settingsToggle(
|
|
74111
|
-
"Show Orbit Button",
|
|
74112
|
-
(settings2) => settings2.ui.orbit,
|
|
74113
|
-
(settings2, value) => settings2.ui.orbit = value
|
|
74114
|
-
),
|
|
74115
|
-
settingsToggle(
|
|
74116
|
-
"Show Look Around Button",
|
|
74117
|
-
(settings2) => settings2.ui.lookAround,
|
|
74118
|
-
(settings2, value) => settings2.ui.lookAround = value
|
|
74119
|
-
),
|
|
74120
|
-
settingsToggle(
|
|
74121
|
-
"Show Pan Button",
|
|
74122
|
-
(settings2) => settings2.ui.pan,
|
|
74123
|
-
(settings2, value) => settings2.ui.pan = value
|
|
74124
|
-
),
|
|
74125
|
-
settingsToggle(
|
|
74126
|
-
"Show Zoom Button",
|
|
74127
|
-
(settings2) => settings2.ui.zoom,
|
|
74128
|
-
(settings2, value) => settings2.ui.zoom = value
|
|
74129
|
-
),
|
|
74130
|
-
settingsToggle(
|
|
74131
|
-
"Show Zoom Window Button",
|
|
74132
|
-
(settings2) => settings2.ui.zoomWindow,
|
|
74133
|
-
(settings2, value) => settings2.ui.zoomWindow = value
|
|
74134
|
-
),
|
|
74135
|
-
settingsSubtitle("Control Bar - Tools"),
|
|
74136
|
-
settingsToggle(
|
|
74137
|
-
"Show Measuring Mode Button",
|
|
74138
|
-
(settings2) => settings2.ui.measuringMode,
|
|
74139
|
-
(settings2, value) => settings2.ui.measuringMode = value
|
|
74140
|
-
),
|
|
74141
|
-
settingsSubtitle("Control Bar - Settings"),
|
|
74142
|
-
settingsToggle(
|
|
74143
|
-
"Show Project Inspector Button",
|
|
74144
|
-
(settings2) => settings2.ui.projectInspector,
|
|
74145
|
-
(settings2, value) => settings2.ui.projectInspector = value
|
|
74146
|
-
),
|
|
74147
|
-
settingsToggle(
|
|
74148
|
-
"Show Settings Button",
|
|
74149
|
-
(settings2) => settings2.ui.settings,
|
|
74150
|
-
(settings2, value) => settings2.ui.settings = value
|
|
74151
|
-
),
|
|
74152
|
-
settingsToggle(
|
|
74153
|
-
"Show Help Button",
|
|
74154
|
-
(settings2) => settings2.ui.help,
|
|
74155
|
-
(settings2, value) => settings2.ui.help = value
|
|
74156
|
-
),
|
|
74157
|
-
settingsToggle(
|
|
74158
|
-
"Show Maximise Button",
|
|
74159
|
-
(settings2) => settings2.ui.maximise,
|
|
74160
|
-
(settings2, value) => settings2.ui.maximise = value
|
|
74161
|
-
)
|
|
74162
|
-
] })
|
|
74163
|
-
]
|
|
74164
|
-
}
|
|
74165
|
-
);
|
|
74166
|
-
}
|
|
74167
74110
|
const MenuToastMemo = React__default.memo(MenuToast);
|
|
74168
74111
|
function MenuToast(props) {
|
|
74169
74112
|
const [visible2, setVisible] = useState();
|
|
@@ -74328,118 +74271,6 @@ function applyWebglBindings(viewer, camera2, isolation, sideState) {
|
|
|
74328
74271
|
}
|
|
74329
74272
|
});
|
|
74330
74273
|
}
|
|
74331
|
-
function useSettings(viewer, value) {
|
|
74332
|
-
const merged = createSettings(value);
|
|
74333
|
-
const [settings2, setSettings] = useState(merged);
|
|
74334
|
-
const onUpdate = useRef();
|
|
74335
|
-
const update = function(updater) {
|
|
74336
|
-
var _a3;
|
|
74337
|
-
const next = { ...settings2 };
|
|
74338
|
-
updater(next);
|
|
74339
|
-
saveSettingsToLocal(next);
|
|
74340
|
-
setSettings(next);
|
|
74341
|
-
(_a3 = onUpdate.current) == null ? void 0 : _a3.call(onUpdate, next);
|
|
74342
|
-
};
|
|
74343
|
-
useEffect(() => {
|
|
74344
|
-
applySettings(viewer, settings2);
|
|
74345
|
-
}, []);
|
|
74346
|
-
useEffect(() => {
|
|
74347
|
-
applySettings(viewer, settings2);
|
|
74348
|
-
}, [settings2]);
|
|
74349
|
-
return useMemo(
|
|
74350
|
-
() => ({
|
|
74351
|
-
value: settings2,
|
|
74352
|
-
update,
|
|
74353
|
-
register: (v) => onUpdate.current = v
|
|
74354
|
-
}),
|
|
74355
|
-
[settings2]
|
|
74356
|
-
);
|
|
74357
|
-
}
|
|
74358
|
-
function applySettings(viewer, settings2) {
|
|
74359
|
-
const performance2 = document.getElementsByClassName("vim-performance-div")[0];
|
|
74360
|
-
if (performance2) {
|
|
74361
|
-
if (isTrue(settings2.ui.performance)) {
|
|
74362
|
-
performance2.classList.remove("vc-hidden");
|
|
74363
|
-
} else {
|
|
74364
|
-
performance2.classList.add("vc-hidden");
|
|
74365
|
-
}
|
|
74366
|
-
}
|
|
74367
|
-
}
|
|
74368
|
-
function createContainer(element) {
|
|
74369
|
-
let root = element;
|
|
74370
|
-
if (root === void 0) {
|
|
74371
|
-
root = document.createElement("div");
|
|
74372
|
-
document.body.append(root);
|
|
74373
|
-
root.classList.add("vc-inset-0");
|
|
74374
|
-
}
|
|
74375
|
-
root.style.position = "absolute";
|
|
74376
|
-
root.classList.add("vim-component");
|
|
74377
|
-
const gfx = document.createElement("div");
|
|
74378
|
-
gfx.className = "vim-gfx vc-absolute vc-inset-0 vc-pointer-events-none";
|
|
74379
|
-
const ui = document.createElement("div");
|
|
74380
|
-
ui.className = "vim-ui vc-absolute vc-inset-0";
|
|
74381
|
-
root.append(gfx);
|
|
74382
|
-
root.append(ui);
|
|
74383
|
-
const dispose = () => {
|
|
74384
|
-
if (element === void 0) {
|
|
74385
|
-
root.remove();
|
|
74386
|
-
} else {
|
|
74387
|
-
root.classList.remove("vim-component");
|
|
74388
|
-
gfx.remove();
|
|
74389
|
-
ui.remove();
|
|
74390
|
-
}
|
|
74391
|
-
};
|
|
74392
|
-
return { root, ui, gfx, dispose };
|
|
74393
|
-
}
|
|
74394
|
-
async function getElements(vim) {
|
|
74395
|
-
var _a3, _b2, _c, _d, _e;
|
|
74396
|
-
if (!vim.bim) return [];
|
|
74397
|
-
const [elements, bimDocument, category, levels, worksets] = await Promise.all(
|
|
74398
|
-
[
|
|
74399
|
-
(_a3 = vim.bim.element) == null ? void 0 : _a3.getAll(),
|
|
74400
|
-
(_b2 = vim.bim.bimDocument) == null ? void 0 : _b2.getAllTitle(),
|
|
74401
|
-
(_c = vim.bim.category) == null ? void 0 : _c.getAllName(),
|
|
74402
|
-
(_d = vim.bim.level) == null ? void 0 : _d.getAllElementIndex(),
|
|
74403
|
-
(_e = vim.bim.workset) == null ? void 0 : _e.getAllName()
|
|
74404
|
-
]
|
|
74405
|
-
);
|
|
74406
|
-
const familyTypeMap = await getFamilyTypeNameMap(vim.bim);
|
|
74407
|
-
if (!elements) return void 0;
|
|
74408
|
-
const result = elements.map((e) => {
|
|
74409
|
-
var _a4;
|
|
74410
|
-
return {
|
|
74411
|
-
...e,
|
|
74412
|
-
bimDocumentName: bimDocument ? bimDocument[e.bimDocumentIndex] : void 0,
|
|
74413
|
-
categoryName: category ? category[e.categoryIndex] : void 0,
|
|
74414
|
-
familyTypeName: familyTypeMap.get(e.index),
|
|
74415
|
-
levelName: levels ? (_a4 = elements[levels[(e == null ? void 0 : e.levelIndex) ?? -1]]) == null ? void 0 : _a4.name : void 0,
|
|
74416
|
-
worksetName: worksets ? worksets[(e == null ? void 0 : e.worksetIndex) ?? -1] : void 0
|
|
74417
|
-
};
|
|
74418
|
-
});
|
|
74419
|
-
const real = result.filter((e) => vim.getElementFromIndex(e.index).hasMesh);
|
|
74420
|
-
return real;
|
|
74421
|
-
}
|
|
74422
|
-
async function getFamilyTypeNameMap(document2) {
|
|
74423
|
-
const [
|
|
74424
|
-
familyInstanceElement,
|
|
74425
|
-
familyInstanceFamilyType,
|
|
74426
|
-
familyTypeElement,
|
|
74427
|
-
elementName
|
|
74428
|
-
] = await Promise.all([
|
|
74429
|
-
document2.familyInstance.getAllElementIndex(),
|
|
74430
|
-
document2.familyInstance.getAllFamilyTypeIndex(),
|
|
74431
|
-
document2.familyType.getAllElementIndex(),
|
|
74432
|
-
document2.element.getAllName()
|
|
74433
|
-
]);
|
|
74434
|
-
return new Map(
|
|
74435
|
-
familyInstanceElement.map((e, i) => {
|
|
74436
|
-
const familyType = familyInstanceFamilyType == null ? void 0 : familyInstanceFamilyType[i];
|
|
74437
|
-
const element = Number.isInteger(familyType) ? familyTypeElement[familyType] : void 0;
|
|
74438
|
-
const name = Number.isInteger(element) ? elementName == null ? void 0 : elementName[element] : void 0;
|
|
74439
|
-
return [e, name];
|
|
74440
|
-
})
|
|
74441
|
-
);
|
|
74442
|
-
}
|
|
74443
74274
|
class MutableState {
|
|
74444
74275
|
constructor(initial) {
|
|
74445
74276
|
__publicField(this, "_value");
|
|
@@ -74468,24 +74299,28 @@ function useRefresher() {
|
|
|
74468
74299
|
}
|
|
74469
74300
|
};
|
|
74470
74301
|
}
|
|
74471
|
-
function useStateRef(initialValue) {
|
|
74472
|
-
const
|
|
74302
|
+
function useStateRef(initialValue, isLazy = false) {
|
|
74303
|
+
const getInitialValue = () => {
|
|
74304
|
+
if (isLazy && typeof initialValue === "function") {
|
|
74305
|
+
return initialValue();
|
|
74306
|
+
}
|
|
74307
|
+
return initialValue;
|
|
74308
|
+
};
|
|
74309
|
+
const [box, setBox] = useState(() => ({
|
|
74310
|
+
current: getInitialValue()
|
|
74311
|
+
}));
|
|
74473
74312
|
const ref = useRef(void 0);
|
|
74474
74313
|
if (ref.current === void 0) {
|
|
74475
|
-
|
|
74476
|
-
ref.current = initialValue();
|
|
74477
|
-
} else {
|
|
74478
|
-
ref.current = initialValue;
|
|
74479
|
-
}
|
|
74314
|
+
ref.current = getInitialValue();
|
|
74480
74315
|
}
|
|
74481
74316
|
const event = useRef(new distExports.SimpleEventDispatcher());
|
|
74482
74317
|
const validate = useRef((next, current) => next);
|
|
74483
|
-
const confirm = useRef((
|
|
74484
|
-
const set3 = (
|
|
74485
|
-
const finalValue = validate.current(
|
|
74318
|
+
const confirm = useRef((value) => value);
|
|
74319
|
+
const set3 = (value) => {
|
|
74320
|
+
const finalValue = validate.current(value, ref.current);
|
|
74486
74321
|
if (finalValue === ref.current) return;
|
|
74487
74322
|
ref.current = finalValue;
|
|
74488
|
-
|
|
74323
|
+
setBox({ current: finalValue });
|
|
74489
74324
|
event.current.dispatch(finalValue);
|
|
74490
74325
|
};
|
|
74491
74326
|
return {
|
|
@@ -74511,8 +74346,8 @@ function useStateRef(initialValue) {
|
|
|
74511
74346
|
*/
|
|
74512
74347
|
useOnChange(on) {
|
|
74513
74348
|
useEffect(() => {
|
|
74514
|
-
return event.current.subscribe((
|
|
74515
|
-
const result = on(
|
|
74349
|
+
return event.current.subscribe((value) => {
|
|
74350
|
+
const result = on(value);
|
|
74516
74351
|
if (result instanceof Promise) {
|
|
74517
74352
|
result.catch(console.error);
|
|
74518
74353
|
}
|
|
@@ -74526,7 +74361,7 @@ function useStateRef(initialValue) {
|
|
|
74526
74361
|
* @returns The memoized value.
|
|
74527
74362
|
*/
|
|
74528
74363
|
useMemo(on, deps) {
|
|
74529
|
-
return useMemo(() => on(
|
|
74364
|
+
return useMemo(() => on(box.current), [...deps || [], box.current]);
|
|
74530
74365
|
},
|
|
74531
74366
|
/**
|
|
74532
74367
|
* Sets a validation function to process any new state value before updating.
|
|
@@ -74703,8 +74538,116 @@ const reactUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
74703
74538
|
useRefresher,
|
|
74704
74539
|
useStateRef
|
|
74705
74540
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
74706
|
-
function
|
|
74707
|
-
|
|
74541
|
+
function useSettings(value, defaultSettings, applySettings = () => {
|
|
74542
|
+
}) {
|
|
74543
|
+
const merged = createSettings(value, defaultSettings);
|
|
74544
|
+
const [settings2, setSettings] = useState(merged);
|
|
74545
|
+
const onUpdate = useRef();
|
|
74546
|
+
const customizer = useStateRef((settings22) => settings22);
|
|
74547
|
+
const update = function(updater) {
|
|
74548
|
+
var _a3;
|
|
74549
|
+
const next = { ...settings2 };
|
|
74550
|
+
updater(next);
|
|
74551
|
+
saveSettingsToLocal(next);
|
|
74552
|
+
setSettings(next);
|
|
74553
|
+
(_a3 = onUpdate.current) == null ? void 0 : _a3.call(onUpdate, next);
|
|
74554
|
+
};
|
|
74555
|
+
useEffect(() => {
|
|
74556
|
+
applySettings(settings2);
|
|
74557
|
+
}, []);
|
|
74558
|
+
useEffect(() => {
|
|
74559
|
+
applySettings(settings2);
|
|
74560
|
+
}, [settings2]);
|
|
74561
|
+
return useMemo(
|
|
74562
|
+
() => ({
|
|
74563
|
+
value: settings2,
|
|
74564
|
+
update,
|
|
74565
|
+
register: (v) => onUpdate.current = v,
|
|
74566
|
+
customizer
|
|
74567
|
+
}),
|
|
74568
|
+
[settings2]
|
|
74569
|
+
);
|
|
74570
|
+
}
|
|
74571
|
+
function createSettings(settings2, defaultSettings) {
|
|
74572
|
+
return settings2 !== void 0 ? deepmerge(defaultSettings, settings2) : defaultSettings;
|
|
74573
|
+
}
|
|
74574
|
+
function createContainer(element) {
|
|
74575
|
+
let root = element;
|
|
74576
|
+
if (root === void 0) {
|
|
74577
|
+
root = document.createElement("div");
|
|
74578
|
+
document.body.append(root);
|
|
74579
|
+
root.classList.add("vc-inset-0");
|
|
74580
|
+
}
|
|
74581
|
+
root.style.position = "absolute";
|
|
74582
|
+
root.classList.add("vim-component");
|
|
74583
|
+
const gfx = document.createElement("div");
|
|
74584
|
+
gfx.className = "vim-gfx vc-absolute vc-inset-0 vc-pointer-events-none";
|
|
74585
|
+
const ui = document.createElement("div");
|
|
74586
|
+
ui.className = "vim-ui vc-absolute vc-inset-0";
|
|
74587
|
+
root.append(gfx);
|
|
74588
|
+
root.append(ui);
|
|
74589
|
+
const dispose = () => {
|
|
74590
|
+
if (element === void 0) {
|
|
74591
|
+
root.remove();
|
|
74592
|
+
} else {
|
|
74593
|
+
root.classList.remove("vim-component");
|
|
74594
|
+
gfx.remove();
|
|
74595
|
+
ui.remove();
|
|
74596
|
+
}
|
|
74597
|
+
};
|
|
74598
|
+
return { root, ui, gfx, dispose };
|
|
74599
|
+
}
|
|
74600
|
+
async function getElements(vim) {
|
|
74601
|
+
var _a3, _b2, _c, _d, _e;
|
|
74602
|
+
if (!vim.bim) return [];
|
|
74603
|
+
const [elements, bimDocument, category, levels, worksets] = await Promise.all(
|
|
74604
|
+
[
|
|
74605
|
+
(_a3 = vim.bim.element) == null ? void 0 : _a3.getAll(),
|
|
74606
|
+
(_b2 = vim.bim.bimDocument) == null ? void 0 : _b2.getAllTitle(),
|
|
74607
|
+
(_c = vim.bim.category) == null ? void 0 : _c.getAllName(),
|
|
74608
|
+
(_d = vim.bim.level) == null ? void 0 : _d.getAllElementIndex(),
|
|
74609
|
+
(_e = vim.bim.workset) == null ? void 0 : _e.getAllName()
|
|
74610
|
+
]
|
|
74611
|
+
);
|
|
74612
|
+
const familyTypeMap = await getFamilyTypeNameMap(vim.bim);
|
|
74613
|
+
if (!elements) return void 0;
|
|
74614
|
+
const result = elements.map((e) => {
|
|
74615
|
+
var _a4;
|
|
74616
|
+
return {
|
|
74617
|
+
...e,
|
|
74618
|
+
bimDocumentName: bimDocument ? bimDocument[e.bimDocumentIndex] : void 0,
|
|
74619
|
+
categoryName: category ? category[e.categoryIndex] : void 0,
|
|
74620
|
+
familyTypeName: familyTypeMap.get(e.index),
|
|
74621
|
+
levelName: levels ? (_a4 = elements[levels[(e == null ? void 0 : e.levelIndex) ?? -1]]) == null ? void 0 : _a4.name : void 0,
|
|
74622
|
+
worksetName: worksets ? worksets[(e == null ? void 0 : e.worksetIndex) ?? -1] : void 0
|
|
74623
|
+
};
|
|
74624
|
+
});
|
|
74625
|
+
const real = result.filter((e) => vim.getElementFromIndex(e.index).hasMesh);
|
|
74626
|
+
return real;
|
|
74627
|
+
}
|
|
74628
|
+
async function getFamilyTypeNameMap(document2) {
|
|
74629
|
+
const [
|
|
74630
|
+
familyInstanceElement,
|
|
74631
|
+
familyInstanceFamilyType,
|
|
74632
|
+
familyTypeElement,
|
|
74633
|
+
elementName
|
|
74634
|
+
] = await Promise.all([
|
|
74635
|
+
document2.familyInstance.getAllElementIndex(),
|
|
74636
|
+
document2.familyInstance.getAllFamilyTypeIndex(),
|
|
74637
|
+
document2.familyType.getAllElementIndex(),
|
|
74638
|
+
document2.element.getAllName()
|
|
74639
|
+
]);
|
|
74640
|
+
return new Map(
|
|
74641
|
+
familyInstanceElement.map((e, i) => {
|
|
74642
|
+
const familyType = familyInstanceFamilyType == null ? void 0 : familyInstanceFamilyType[i];
|
|
74643
|
+
const element = Number.isInteger(familyType) ? familyTypeElement[familyType] : void 0;
|
|
74644
|
+
const name = Number.isInteger(element) ? elementName == null ? void 0 : elementName[element] : void 0;
|
|
74645
|
+
return [e, name];
|
|
74646
|
+
})
|
|
74647
|
+
);
|
|
74648
|
+
}
|
|
74649
|
+
function useViewerState(viewer) {
|
|
74650
|
+
const getVim = () => {
|
|
74708
74651
|
var _a3;
|
|
74709
74652
|
const v = (_a3 = viewer.vims) == null ? void 0 : _a3[0];
|
|
74710
74653
|
return v;
|
|
@@ -74844,12 +74787,8 @@ const vcColorLink = "vc-text-[#0590CC]";
|
|
|
74844
74787
|
const vcLink = `${vcColorLink} vc-underline`;
|
|
74845
74788
|
const vcLabel = "vc-text-[#3F444F]";
|
|
74846
74789
|
const vcRoboto = "vc-font-['Roboto',sans-serif]";
|
|
74847
|
-
function footer$1(
|
|
74848
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
74849
|
-
"More troubleshooting tips can be found",
|
|
74850
|
-
" ",
|
|
74851
|
-
link(url, "here")
|
|
74852
|
-
] });
|
|
74790
|
+
function footer$1() {
|
|
74791
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
74853
74792
|
}
|
|
74854
74793
|
function mainText(text) {
|
|
74855
74794
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `vim-main-text vc-text-base ${vcColorPrimary} vc-mb-4 vc-font-normal`, children: text });
|
|
@@ -74897,31 +74836,18 @@ const errorStyle = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
74897
74836
|
vcLink,
|
|
74898
74837
|
vcRoboto
|
|
74899
74838
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
74900
|
-
const support = "https://docs.vimaec.com";
|
|
74901
|
-
const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
|
|
74902
|
-
const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
|
|
74903
|
-
const urls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74904
|
-
__proto__: null,
|
|
74905
|
-
support,
|
|
74906
|
-
supportControls,
|
|
74907
|
-
supportUltra
|
|
74908
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
74909
74839
|
function fileOpeningError(url) {
|
|
74910
74840
|
return {
|
|
74911
|
-
title: "File
|
|
74841
|
+
title: "VIM Ultra File Error",
|
|
74912
74842
|
body: serverFileOpeningErrorBody(url),
|
|
74913
|
-
footer: footer$1(
|
|
74843
|
+
footer: footer$1(),
|
|
74914
74844
|
canClose: false
|
|
74915
74845
|
};
|
|
74916
74846
|
}
|
|
74917
74847
|
function serverFileOpeningErrorBody(url) {
|
|
74918
74848
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
|
|
74919
|
-
mainText(/* @__PURE__ */ jsxRuntimeExports.
|
|
74920
|
-
|
|
74921
|
-
bold("error opening the VIM file"),
|
|
74922
|
-
". Please check the file exists at the path noted below."
|
|
74923
|
-
] })),
|
|
74924
|
-
subTitle("Error details:"),
|
|
74849
|
+
mainText(/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "We encountered an error opening the VIM file in VIM Ultra." })),
|
|
74850
|
+
subTitle("Details"),
|
|
74925
74851
|
dotList([bullet("File path:", url)])
|
|
74926
74852
|
] });
|
|
74927
74853
|
}
|
|
@@ -74930,136 +74856,110 @@ function serverFileDownloadingError(url, authToken, server) {
|
|
|
74930
74856
|
return fileOpeningError(url);
|
|
74931
74857
|
}
|
|
74932
74858
|
return {
|
|
74933
|
-
title: "
|
|
74859
|
+
title: "VIM Ultra Download Error",
|
|
74934
74860
|
body: body$5(url, authToken, server),
|
|
74935
|
-
footer: footer$1(
|
|
74861
|
+
footer: footer$1(),
|
|
74936
74862
|
canClose: false
|
|
74937
74863
|
};
|
|
74938
74864
|
}
|
|
74939
74865
|
function body$5(url, authToken, server) {
|
|
74940
74866
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
|
|
74941
|
-
mainText(/* @__PURE__ */ jsxRuntimeExports.
|
|
74942
|
-
|
|
74943
|
-
bold("error downloading the VIM file"),
|
|
74944
|
-
". Please check the following conditions to get back up and running quickly."
|
|
74945
|
-
] })),
|
|
74946
|
-
subTitle("Error details:"),
|
|
74867
|
+
mainText(/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "We encountered an error downloading the VIM file in VIM Ultra." })),
|
|
74868
|
+
subTitle("Details"),
|
|
74947
74869
|
dotList([
|
|
74948
|
-
server ? bullet("VIM
|
|
74949
|
-
bullet("
|
|
74950
|
-
authToken ? bullet("
|
|
74870
|
+
server ? bullet("VIM Ultra:", server) : null,
|
|
74871
|
+
bullet("VIM URL:", url),
|
|
74872
|
+
authToken ? bullet("Access Token:", authToken) : null
|
|
74951
74873
|
]),
|
|
74952
|
-
subTitle("
|
|
74874
|
+
subTitle("Tips"),
|
|
74953
74875
|
numList([
|
|
74954
|
-
"
|
|
74955
|
-
"
|
|
74956
|
-
server ? "Check network access policies to allow the VIM Ultra Server access to the VIM File url." : ""
|
|
74876
|
+
"Ensure the VIM URL is valid",
|
|
74877
|
+
"Check your network connection and access policies"
|
|
74957
74878
|
])
|
|
74958
74879
|
] });
|
|
74959
74880
|
}
|
|
74960
74881
|
function serverFileLoadingError(url) {
|
|
74961
74882
|
return {
|
|
74962
|
-
title: "
|
|
74883
|
+
title: "VIM Ultra Loading Error",
|
|
74963
74884
|
body: body$4(url),
|
|
74964
|
-
footer: footer$1(
|
|
74885
|
+
footer: footer$1(),
|
|
74965
74886
|
canClose: false
|
|
74966
74887
|
};
|
|
74967
74888
|
}
|
|
74968
74889
|
function body$4(url) {
|
|
74969
74890
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
|
|
74970
|
-
mainText(/* @__PURE__ */ jsxRuntimeExports.
|
|
74971
|
-
|
|
74972
|
-
bold("couldn’t load the VIM file"),
|
|
74973
|
-
". This could be due to a couple of reasons, including that the file could be corrupt or not recognizable."
|
|
74974
|
-
] })),
|
|
74975
|
-
subTitle("Error details:"),
|
|
74891
|
+
mainText(/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "We encountered an error loading the VIM file in VIM Ultra." })),
|
|
74892
|
+
subTitle("Details"),
|
|
74976
74893
|
dotList([bullet("File path:", url)]),
|
|
74977
|
-
subTitle("
|
|
74894
|
+
subTitle("Tips"),
|
|
74978
74895
|
numList([
|
|
74979
|
-
"Reload
|
|
74980
|
-
"
|
|
74896
|
+
"Reload the page",
|
|
74897
|
+
"Ensure the VIM URL points to a valid VIM file",
|
|
74898
|
+
"Clear your VIM Ultra download cache"
|
|
74981
74899
|
])
|
|
74982
74900
|
] });
|
|
74983
74901
|
}
|
|
74984
74902
|
function serverConnectionError(url) {
|
|
74985
74903
|
return {
|
|
74986
|
-
title: "Connection
|
|
74904
|
+
title: "VIM Ultra Connection",
|
|
74987
74905
|
body: body$3(url, isLocalUrl(url)),
|
|
74988
|
-
footer: footer$1(
|
|
74906
|
+
footer: footer$1(),
|
|
74989
74907
|
canClose: false
|
|
74990
74908
|
};
|
|
74991
74909
|
}
|
|
74992
74910
|
function body$3(url, local) {
|
|
74993
74911
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
|
|
74994
|
-
mainText(/* @__PURE__ */ jsxRuntimeExports.
|
|
74995
|
-
|
|
74996
|
-
bold("error connecting to the ULTRA server"),
|
|
74997
|
-
". Please check the following conditions to get back up and running quickly."
|
|
74998
|
-
] })),
|
|
74999
|
-
subTitle("Troubleshooting tips:"),
|
|
74912
|
+
mainText(/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "We encountered an error connecting to VIM Ultra." })),
|
|
74913
|
+
subTitle("Tips"),
|
|
75000
74914
|
numList([
|
|
75001
74915
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
75002
|
-
"Ensure that VIM Ultra",
|
|
75003
|
-
" ",
|
|
75004
|
-
link(supportUltra, "process is running"),
|
|
75005
|
-
" ",
|
|
75006
|
-
"at ",
|
|
74916
|
+
"Ensure that VIM Ultra is running at ",
|
|
75007
74917
|
detailText(url)
|
|
75008
74918
|
] }),
|
|
75009
|
-
"Check your
|
|
75010
|
-
"Check firewall permissions."
|
|
74919
|
+
"Check your network connection and access policies"
|
|
75011
74920
|
])
|
|
75012
74921
|
] });
|
|
75013
74922
|
}
|
|
75014
74923
|
function serverCompatibilityError(url, localVersion, remoteVersion) {
|
|
75015
74924
|
return {
|
|
75016
|
-
title: "Compatibility
|
|
74925
|
+
title: "VIM Ultra Compatibility",
|
|
75017
74926
|
body: body$2(url, localVersion, remoteVersion),
|
|
75018
|
-
footer: footer$1(
|
|
74927
|
+
footer: footer$1(),
|
|
75019
74928
|
canClose: false
|
|
75020
74929
|
};
|
|
75021
74930
|
}
|
|
75022
74931
|
function body$2(url, localVersion, remoteVersion) {
|
|
75023
74932
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
|
|
75024
|
-
mainText(/* @__PURE__ */ jsxRuntimeExports.
|
|
75025
|
-
|
|
75026
|
-
" ",
|
|
75027
|
-
bold("version of VIM Ultra Server that isn’t compatible with this visual"),
|
|
75028
|
-
". Please check the following conditions to get back up and running quickly."
|
|
75029
|
-
] })),
|
|
75030
|
-
subTitle("Error details:"),
|
|
74933
|
+
mainText(/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "The VIM Ultra version is incompatible with this visual." })),
|
|
74934
|
+
subTitle("Details"),
|
|
75031
74935
|
dotList([
|
|
75032
74936
|
bullet("Url:", url),
|
|
75033
74937
|
bullet("Local Version:", localVersion),
|
|
75034
74938
|
bullet("Remote Version:", remoteVersion)
|
|
75035
74939
|
]),
|
|
75036
|
-
subTitle("
|
|
74940
|
+
subTitle("Tips"),
|
|
75037
74941
|
numList([
|
|
75038
|
-
"Update
|
|
75039
|
-
"
|
|
74942
|
+
"Update this visual to a compatible version.",
|
|
74943
|
+
"Start a compatible version of VIM Ultra."
|
|
75040
74944
|
])
|
|
75041
74945
|
] });
|
|
75042
74946
|
}
|
|
75043
74947
|
function serverStreamError(url) {
|
|
75044
74948
|
return {
|
|
75045
|
-
title: "Stream Error",
|
|
74949
|
+
title: "VIM Ultra Stream Error",
|
|
75046
74950
|
body: body$1(),
|
|
75047
|
-
footer: footer$1(
|
|
74951
|
+
footer: footer$1(),
|
|
75048
74952
|
canClose: false
|
|
75049
74953
|
};
|
|
75050
74954
|
}
|
|
75051
74955
|
function body$1(url) {
|
|
75052
74956
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: vcRoboto, children: [
|
|
75053
|
-
mainText(/* @__PURE__ */ jsxRuntimeExports.
|
|
75054
|
-
|
|
75055
|
-
bold("error starting a stream on the VIM Ultra Server"),
|
|
75056
|
-
". Please check the following conditions to get back up and running quickly."
|
|
75057
|
-
] })),
|
|
75058
|
-
subTitle("Troubleshooting tips:"),
|
|
74957
|
+
mainText(/* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "We encountered a streaming error with VIM Ultra." })),
|
|
74958
|
+
subTitle("Tips"),
|
|
75059
74959
|
numList([
|
|
75060
|
-
"
|
|
75061
|
-
"
|
|
75062
|
-
"Restart
|
|
74960
|
+
"Reload the page",
|
|
74961
|
+
"Close other applications that may be using VIM Ultra",
|
|
74962
|
+
"Restart VIM Ultra"
|
|
75063
74963
|
])
|
|
75064
74964
|
] });
|
|
75065
74965
|
}
|
|
@@ -75291,16 +75191,19 @@ class ComponentLoader {
|
|
|
75291
75191
|
}
|
|
75292
75192
|
}
|
|
75293
75193
|
function MessageBox(props) {
|
|
75194
|
+
const [minimized, setMinimized] = React__default.useState(props.value.minimize ?? false);
|
|
75294
75195
|
const p = props.value;
|
|
75295
75196
|
if (!p.title || !p.body) return null;
|
|
75296
75197
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-message-box vc-p-6 vc-max-h-[80%] vc-max-w-[80%] vc-w-[424px] vc-bg-white vc-rounded-md vc-shadow-message vc-shadow-[0px_4px_16px_rgba(33,39,51,0.5)] vc-font-roboto", children: [
|
|
75297
75198
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-flex vc-justify-between vc-items-center", children: [
|
|
75199
|
+
props.value.icon,
|
|
75298
75200
|
title(p.title),
|
|
75299
|
-
closeBtn(p.onClose)
|
|
75201
|
+
props.value.canClose && closeBtn(p.onClose),
|
|
75202
|
+
props.value.minimize && minimizeButton(minimized, setMinimized)
|
|
75300
75203
|
] }),
|
|
75301
|
-
divider(),
|
|
75302
|
-
body(p.body),
|
|
75303
|
-
footer(p.footer)
|
|
75204
|
+
!minimized && divider(),
|
|
75205
|
+
!minimized && body(p.body),
|
|
75206
|
+
!minimized && footer(p.footer)
|
|
75304
75207
|
] });
|
|
75305
75208
|
}
|
|
75306
75209
|
function title(title2) {
|
|
@@ -75310,6 +75213,9 @@ function closeBtn(onClose) {
|
|
|
75310
75213
|
if (!onClose) return null;
|
|
75311
75214
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "vc-text-[#212733] vc-text-xl", children: "×" });
|
|
75312
75215
|
}
|
|
75216
|
+
function minimizeButton(minimized, setMinimized) {
|
|
75217
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setMinimized(!minimized), className: "vc-text-[#212733] vc-text-xl", children: minimized ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "▼" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "▲" }) });
|
|
75218
|
+
}
|
|
75313
75219
|
function body(content2) {
|
|
75314
75220
|
if (content2 === void 0) return null;
|
|
75315
75221
|
if (typeof content2 === "string") {
|
|
@@ -75668,7 +75574,7 @@ function useSectionBox(adapter) {
|
|
|
75668
75574
|
adapter.setVisible(false);
|
|
75669
75575
|
adapter.setClip(false);
|
|
75670
75576
|
return adapter.onSelectionChanged.sub(() => {
|
|
75671
|
-
if (auto.get() && enable.get())
|
|
75577
|
+
if (auto.get() && enable.get()) sectionSelection.call();
|
|
75672
75578
|
});
|
|
75673
75579
|
}, []);
|
|
75674
75580
|
enable.useOnChange((v) => {
|
|
@@ -75676,7 +75582,7 @@ function useSectionBox(adapter) {
|
|
|
75676
75582
|
visible2.set(v);
|
|
75677
75583
|
showOffsetPanel.set(false);
|
|
75678
75584
|
if (v && auto.get()) {
|
|
75679
|
-
|
|
75585
|
+
sectionSelection.call();
|
|
75680
75586
|
} else {
|
|
75681
75587
|
sectionScene.call();
|
|
75682
75588
|
}
|
|
@@ -75687,7 +75593,7 @@ function useSectionBox(adapter) {
|
|
|
75687
75593
|
sideOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75688
75594
|
bottomOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75689
75595
|
auto.useOnChange((v) => {
|
|
75690
|
-
if (v)
|
|
75596
|
+
if (v) sectionSelection.call();
|
|
75691
75597
|
});
|
|
75692
75598
|
visible2.useOnChange((v) => adapter.setVisible(v));
|
|
75693
75599
|
const sectionBox2 = useArgActionRef((box) => {
|
|
@@ -75697,7 +75603,7 @@ function useSectionBox(adapter) {
|
|
|
75697
75603
|
const newBox = addBox(box, offsetsToBox3_(topOffset.get(), sideOffset.get(), bottomOffset.get()));
|
|
75698
75604
|
adapter.setBox(newBox);
|
|
75699
75605
|
});
|
|
75700
|
-
const
|
|
75606
|
+
const sectionSelection = useFuncRef(async () => {
|
|
75701
75607
|
const id2 = requestId.current;
|
|
75702
75608
|
const box = await getSelectionBox.call() ?? await getSceneBox.call();
|
|
75703
75609
|
if (requestId.current !== id2) return;
|
|
@@ -75717,7 +75623,7 @@ function useSectionBox(adapter) {
|
|
|
75717
75623
|
topOffset,
|
|
75718
75624
|
sideOffset,
|
|
75719
75625
|
bottomOffset,
|
|
75720
|
-
sectionSelection
|
|
75626
|
+
sectionSelection,
|
|
75721
75627
|
sectionScene,
|
|
75722
75628
|
sectionBox: sectionBox2,
|
|
75723
75629
|
getBox: () => adapter.getBox(),
|
|
@@ -75815,7 +75721,8 @@ function useViewerInput(handler, camera2) {
|
|
|
75815
75721
|
}
|
|
75816
75722
|
const Ids = {
|
|
75817
75723
|
showGhost: "isolationPanel.showGhost",
|
|
75818
|
-
ghostOpacity: "isolationPanel.ghostOpacity"
|
|
75724
|
+
ghostOpacity: "isolationPanel.ghostOpacity",
|
|
75725
|
+
transparency: "isolationPanel.transparency"
|
|
75819
75726
|
};
|
|
75820
75727
|
const IsolationPanel$1 = forwardRef(
|
|
75821
75728
|
(props, ref) => {
|
|
@@ -75827,8 +75734,20 @@ const IsolationPanel$1 = forwardRef(
|
|
|
75827
75734
|
anchorElement: document.getElementById("vim-control-bar"),
|
|
75828
75735
|
showPanel: props.state.showPanel,
|
|
75829
75736
|
entries: [
|
|
75830
|
-
{
|
|
75831
|
-
|
|
75737
|
+
{
|
|
75738
|
+
type: "bool",
|
|
75739
|
+
id: Ids.showGhost,
|
|
75740
|
+
label: "Show Ghost",
|
|
75741
|
+
state: props.state.showGhost
|
|
75742
|
+
},
|
|
75743
|
+
/*
|
|
75744
|
+
{
|
|
75745
|
+
type: "bool",
|
|
75746
|
+
id: "showRooms",
|
|
75747
|
+
label: "Show Rooms",
|
|
75748
|
+
state: props.state.showRooms
|
|
75749
|
+
},
|
|
75750
|
+
*/
|
|
75832
75751
|
{
|
|
75833
75752
|
type: "number",
|
|
75834
75753
|
id: Ids.ghostOpacity,
|
|
@@ -75838,6 +75757,13 @@ const IsolationPanel$1 = forwardRef(
|
|
|
75838
75757
|
min: 0,
|
|
75839
75758
|
max: 1,
|
|
75840
75759
|
step: 0.05
|
|
75760
|
+
},
|
|
75761
|
+
{
|
|
75762
|
+
type: "bool",
|
|
75763
|
+
visible: () => props.transparency,
|
|
75764
|
+
id: Ids.transparency,
|
|
75765
|
+
label: "Transparency",
|
|
75766
|
+
state: props.state.transparency
|
|
75841
75767
|
}
|
|
75842
75768
|
]
|
|
75843
75769
|
}
|
|
@@ -75846,12 +75772,13 @@ const IsolationPanel$1 = forwardRef(
|
|
|
75846
75772
|
);
|
|
75847
75773
|
function useSharedIsolation(adapter) {
|
|
75848
75774
|
const _adapter = useRef(adapter);
|
|
75849
|
-
const visibility = useStateRef(() => adapter.computeVisibility());
|
|
75775
|
+
const visibility = useStateRef(() => adapter.computeVisibility(), true);
|
|
75850
75776
|
const autoIsolate2 = useStateRef(false);
|
|
75851
75777
|
const showPanel = useStateRef(false);
|
|
75852
75778
|
const showRooms = useStateRef(false);
|
|
75853
75779
|
const showGhost = useStateRef(false);
|
|
75854
|
-
const ghostOpacity = useStateRef(() => adapter.getGhostOpacity());
|
|
75780
|
+
const ghostOpacity = useStateRef(() => adapter.getGhostOpacity(), true);
|
|
75781
|
+
const transparency = useStateRef(true);
|
|
75855
75782
|
const onAutoIsolate = useFuncRef(() => {
|
|
75856
75783
|
if (adapter.hasSelection()) {
|
|
75857
75784
|
adapter.isolateSelection();
|
|
@@ -75876,6 +75803,7 @@ function useSharedIsolation(adapter) {
|
|
|
75876
75803
|
});
|
|
75877
75804
|
showGhost.useOnChange((v) => adapter.showGhost(v));
|
|
75878
75805
|
showRooms.useOnChange((v) => adapter.setShowRooms(v));
|
|
75806
|
+
transparency.useOnChange((v) => adapter.enableTransparency(v));
|
|
75879
75807
|
ghostOpacity.useValidate((next, current) => {
|
|
75880
75808
|
return next <= 0 ? current : next;
|
|
75881
75809
|
});
|
|
@@ -75889,7 +75817,8 @@ function useSharedIsolation(adapter) {
|
|
|
75889
75817
|
showRooms,
|
|
75890
75818
|
ghostOpacity,
|
|
75891
75819
|
onAutoIsolate,
|
|
75892
|
-
onVisibilityChange
|
|
75820
|
+
onVisibilityChange,
|
|
75821
|
+
transparency
|
|
75893
75822
|
};
|
|
75894
75823
|
}
|
|
75895
75824
|
function useWebglIsolation(viewer) {
|
|
@@ -75897,6 +75826,29 @@ function useWebglIsolation(viewer) {
|
|
|
75897
75826
|
return useSharedIsolation(adapter);
|
|
75898
75827
|
}
|
|
75899
75828
|
function createWebglIsolationAdapter(viewer) {
|
|
75829
|
+
var transparency = true;
|
|
75830
|
+
var ghost2 = false;
|
|
75831
|
+
var rooms = false;
|
|
75832
|
+
function updateMaterials() {
|
|
75833
|
+
viewer.renderer.modelMaterial = !ghost2 && transparency ? void 0 : ghost2 && transparency ? [void 0, viewer.materials.ghost] : !ghost2 && !transparency ? viewer.materials.simple : ghost2 && !transparency ? [viewer.materials.simple, viewer.materials.ghost] : (() => {
|
|
75834
|
+
throw new Error("Unreachable state in isolation materials");
|
|
75835
|
+
})();
|
|
75836
|
+
}
|
|
75837
|
+
function updateVisibility(elements, predicate) {
|
|
75838
|
+
if (elements === "all") {
|
|
75839
|
+
for (let v of viewer.vims) {
|
|
75840
|
+
for (let o of v.getAllElements()) {
|
|
75841
|
+
if (o.type === "Element3D") {
|
|
75842
|
+
o.visible = o.isRoom ? rooms : predicate(o);
|
|
75843
|
+
}
|
|
75844
|
+
}
|
|
75845
|
+
}
|
|
75846
|
+
} else {
|
|
75847
|
+
for (let o of elements) {
|
|
75848
|
+
o.visible = o.isRoom ? rooms : predicate(o);
|
|
75849
|
+
}
|
|
75850
|
+
}
|
|
75851
|
+
}
|
|
75900
75852
|
return {
|
|
75901
75853
|
onVisibilityChange: viewer.renderer.onSceneUpdated,
|
|
75902
75854
|
onSelectionChanged: viewer.selection.onSelectionChanged,
|
|
@@ -75905,28 +75857,28 @@ function createWebglIsolationAdapter(viewer) {
|
|
|
75905
75857
|
hasVisibleSelection: () => viewer.selection.any() && viewer.selection.getAll().every((o) => o.visible),
|
|
75906
75858
|
hasHiddenSelection: () => viewer.selection.any() && viewer.selection.getAll().every((o) => !o.visible),
|
|
75907
75859
|
clearSelection: () => viewer.selection.clear(),
|
|
75908
|
-
isolateSelection: () =>
|
|
75860
|
+
isolateSelection: () => updateVisibility("all", (o) => viewer.selection.has(o)),
|
|
75909
75861
|
hideSelection: () => {
|
|
75910
|
-
viewer.selection.getAll()
|
|
75862
|
+
updateVisibility(viewer.selection.getAll(), (o) => false);
|
|
75911
75863
|
},
|
|
75912
75864
|
showSelection: () => {
|
|
75913
|
-
viewer.selection.getAll()
|
|
75865
|
+
updateVisibility(viewer.selection.getAll(), (o) => true);
|
|
75914
75866
|
},
|
|
75915
75867
|
hideAll: () => {
|
|
75916
|
-
|
|
75868
|
+
updateVisibility("all", (o) => false);
|
|
75917
75869
|
},
|
|
75918
75870
|
showAll: () => {
|
|
75919
|
-
|
|
75871
|
+
updateVisibility("all", (o) => true);
|
|
75920
75872
|
},
|
|
75921
75873
|
isolate: (instances) => {
|
|
75922
75874
|
const set3 = new Set(instances);
|
|
75923
|
-
|
|
75875
|
+
updateVisibility("all", (o) => o.instances.some((i) => set3.has(i)));
|
|
75924
75876
|
},
|
|
75925
75877
|
show: (instances) => {
|
|
75926
75878
|
for (let i of instances) {
|
|
75927
75879
|
for (let v of viewer.vims) {
|
|
75928
75880
|
const o = v.getElement(i);
|
|
75929
|
-
o.visible = true;
|
|
75881
|
+
o.visible = o.isRoom ? rooms : true;
|
|
75930
75882
|
}
|
|
75931
75883
|
}
|
|
75932
75884
|
},
|
|
@@ -75934,29 +75886,30 @@ function createWebglIsolationAdapter(viewer) {
|
|
|
75934
75886
|
for (let i of instances) {
|
|
75935
75887
|
for (let v of viewer.vims) {
|
|
75936
75888
|
const o = v.getElement(i);
|
|
75937
|
-
o.visible = false;
|
|
75889
|
+
o.visible = o.isRoom ? rooms : false;
|
|
75938
75890
|
}
|
|
75939
75891
|
}
|
|
75940
75892
|
},
|
|
75893
|
+
enableTransparency: (enable) => {
|
|
75894
|
+
if (transparency !== enable) {
|
|
75895
|
+
transparency = enable;
|
|
75896
|
+
updateMaterials();
|
|
75897
|
+
}
|
|
75898
|
+
},
|
|
75941
75899
|
showGhost: (show) => {
|
|
75942
|
-
|
|
75900
|
+
ghost2 = show;
|
|
75901
|
+
updateMaterials();
|
|
75943
75902
|
},
|
|
75944
75903
|
getGhostOpacity: () => viewer.materials.ghostOpacity,
|
|
75945
75904
|
setGhostOpacity: (opacity) => viewer.materials.ghostOpacity = opacity,
|
|
75946
|
-
getShowRooms: () =>
|
|
75905
|
+
getShowRooms: () => rooms,
|
|
75947
75906
|
setShowRooms: (show) => {
|
|
75948
|
-
|
|
75949
|
-
|
|
75950
|
-
|
|
75951
|
-
}
|
|
75952
|
-
function updateAllVisibility(viewer, predicate) {
|
|
75953
|
-
for (let v of viewer.vims) {
|
|
75954
|
-
for (let o of v.getAllElements()) {
|
|
75955
|
-
if (o.type === "Element3D") {
|
|
75956
|
-
o.visible = predicate(o);
|
|
75907
|
+
if (rooms !== show) {
|
|
75908
|
+
rooms = show;
|
|
75909
|
+
updateVisibility("all", (o) => o.visible);
|
|
75957
75910
|
}
|
|
75958
75911
|
}
|
|
75959
|
-
}
|
|
75912
|
+
};
|
|
75960
75913
|
}
|
|
75961
75914
|
function getVisibilityState$1(viewer) {
|
|
75962
75915
|
let all = true;
|
|
@@ -75982,6 +75935,572 @@ function getVisibilityState$1(viewer) {
|
|
|
75982
75935
|
if (onlySelectionFlag) return "onlySelection";
|
|
75983
75936
|
return "some";
|
|
75984
75937
|
}
|
|
75938
|
+
function getDefaultSettings() {
|
|
75939
|
+
return {
|
|
75940
|
+
capacity: {
|
|
75941
|
+
canFollowUrl: true,
|
|
75942
|
+
canGoFullScreen: true,
|
|
75943
|
+
canDownload: true,
|
|
75944
|
+
canReadLocalStorage: true
|
|
75945
|
+
},
|
|
75946
|
+
ui: {
|
|
75947
|
+
panelLogo: true,
|
|
75948
|
+
panelPerformance: false,
|
|
75949
|
+
panelBimTree: true,
|
|
75950
|
+
panelBimInfo: true,
|
|
75951
|
+
panelAxes: true,
|
|
75952
|
+
panelControlBar: true,
|
|
75953
|
+
axesOrthographic: true,
|
|
75954
|
+
axesHome: true,
|
|
75955
|
+
// Control bar - cursors
|
|
75956
|
+
cursorOrbit: true,
|
|
75957
|
+
cursorLookAround: true,
|
|
75958
|
+
cursorPan: true,
|
|
75959
|
+
cursorZoom: true,
|
|
75960
|
+
// Control bar - camera
|
|
75961
|
+
cameraAuto: true,
|
|
75962
|
+
cameraFrameScene: true,
|
|
75963
|
+
cameraFrameSelection: true,
|
|
75964
|
+
// Control bar - tools
|
|
75965
|
+
sectioningEnable: true,
|
|
75966
|
+
sectioningFitToSelection: true,
|
|
75967
|
+
sectioningReset: true,
|
|
75968
|
+
sectioningShow: true,
|
|
75969
|
+
sectioningAuto: true,
|
|
75970
|
+
sectioningSettings: true,
|
|
75971
|
+
measureEnable: true,
|
|
75972
|
+
// Control bar - Visibility
|
|
75973
|
+
visibilityClearSelection: true,
|
|
75974
|
+
visibilityShowAll: true,
|
|
75975
|
+
visibilityToggle: true,
|
|
75976
|
+
visibilityIsolate: true,
|
|
75977
|
+
visibilityAutoIsolate: true,
|
|
75978
|
+
visibilitySettings: true,
|
|
75979
|
+
// Control bar - settings
|
|
75980
|
+
miscProjectInspector: true,
|
|
75981
|
+
miscSettings: true,
|
|
75982
|
+
miscHelp: true,
|
|
75983
|
+
miscMaximise: true
|
|
75984
|
+
}
|
|
75985
|
+
};
|
|
75986
|
+
}
|
|
75987
|
+
function renderSettingsInputBox(settings2, item) {
|
|
75988
|
+
const ref = React__default.useRef(null);
|
|
75989
|
+
useEffect(() => {
|
|
75990
|
+
var _a3;
|
|
75991
|
+
ref.current.value = (_a3 = item.getter(settings2.value)) == null ? void 0 : _a3.toString();
|
|
75992
|
+
}, []);
|
|
75993
|
+
const update = (event) => {
|
|
75994
|
+
const str = event.target.value;
|
|
75995
|
+
const n = Number.parseFloat(str);
|
|
75996
|
+
if (Number.isNaN(n)) {
|
|
75997
|
+
event.target.value = item.getter(settings2.value).toString();
|
|
75998
|
+
} else {
|
|
75999
|
+
const value = item.transform(n);
|
|
76000
|
+
event.target.value = value.toString();
|
|
76001
|
+
settings2.update((s) => item.setter(s, value));
|
|
76002
|
+
}
|
|
76003
|
+
};
|
|
76004
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-box-input vc-my-1 ", children: [
|
|
76005
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2", children: [
|
|
76006
|
+
item.label,
|
|
76007
|
+
":"
|
|
76008
|
+
] }),
|
|
76009
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76010
|
+
"input",
|
|
76011
|
+
{
|
|
76012
|
+
ref,
|
|
76013
|
+
type: "text",
|
|
76014
|
+
className: "vim-settings-textbox vc-border vc-rounded-sm vc-border-gray vc-w-14 vc-ml-1 vc-p-1",
|
|
76015
|
+
onBlur: update
|
|
76016
|
+
}
|
|
76017
|
+
),
|
|
76018
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2 vc-text-gray vc-ml-1", children: item.info })
|
|
76019
|
+
] });
|
|
76020
|
+
}
|
|
76021
|
+
function renderSettingsToggle(settings2, item) {
|
|
76022
|
+
const value = item.getter(settings2.value);
|
|
76023
|
+
if (value === "AlwaysTrue" || value === "AlwaysFalse") return null;
|
|
76024
|
+
const handleChange = () => {
|
|
76025
|
+
const current = item.getter(settings2.value);
|
|
76026
|
+
settings2.update((s) => item.setter(s, !current));
|
|
76027
|
+
};
|
|
76028
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "vc-m-1 vc-block vc-select-none vc-items-center vc-py-1 vc-text-gray-warm", children: [
|
|
76029
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76030
|
+
"input",
|
|
76031
|
+
{
|
|
76032
|
+
type: "checkbox",
|
|
76033
|
+
checked: value,
|
|
76034
|
+
onChange: handleChange,
|
|
76035
|
+
className: "vim-settings-checkbox vc-checked:bg-primary-royal vc-mr-2 vc-rounded vc-border vc-border-gray-medium"
|
|
76036
|
+
}
|
|
76037
|
+
),
|
|
76038
|
+
" ",
|
|
76039
|
+
item.label
|
|
76040
|
+
] });
|
|
76041
|
+
}
|
|
76042
|
+
function renderSettingsSubtitle(item) {
|
|
76043
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-subtitle", children: item.title });
|
|
76044
|
+
}
|
|
76045
|
+
function SettingsPanel(props) {
|
|
76046
|
+
if (!props.visible) return null;
|
|
76047
|
+
function renderItem(settings2, item) {
|
|
76048
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: (() => {
|
|
76049
|
+
switch (item.type) {
|
|
76050
|
+
case "subtitle":
|
|
76051
|
+
return renderSettingsSubtitle(item);
|
|
76052
|
+
case "toggle":
|
|
76053
|
+
return renderSettingsToggle(settings2, item);
|
|
76054
|
+
case "box":
|
|
76055
|
+
return renderSettingsInputBox(settings2, item);
|
|
76056
|
+
case "element":
|
|
76057
|
+
return item.element;
|
|
76058
|
+
default:
|
|
76059
|
+
return null;
|
|
76060
|
+
}
|
|
76061
|
+
})() }, item.key);
|
|
76062
|
+
}
|
|
76063
|
+
const customizer = props.settings.customizer.get();
|
|
76064
|
+
const content2 = customizer ? customizer(props.content) : props.content;
|
|
76065
|
+
const sections = buildSections(content2);
|
|
76066
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-absolute vc-inset-0", children: [
|
|
76067
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-title vc-mb-2", children: "Settings" }),
|
|
76068
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "\r\n vim-settings\r\n vc-absolute vc-top-8 vc-left-0 vc-right-0 vc-bottom-0\r\n vc-overflow-y-auto\r\n vc-pr-2\r\n vc-space-y-2\r\n vc-box-border\r\n ", children: sections.map((section) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
76069
|
+
"details",
|
|
76070
|
+
{
|
|
76071
|
+
open: true,
|
|
76072
|
+
className: "\r\n vim-settings-section\r\n vc-bg-white\r\n vc-rounded-md\r\n vc-shadow-sm\r\n vc-border\r\n vc-border-slate-200\r\n vc-p-2\r\n vc-space-y-2\r\n ",
|
|
76073
|
+
children: [
|
|
76074
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("summary", { className: "vim-settings-section-title vc-font-medium vc-text-sm vc-cursor-pointer", children: section.title }),
|
|
76075
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-settings-section-content vc-mt-2 vc-space-y-2", children: section.items.map(
|
|
76076
|
+
(item) => renderItem(props.settings, item)
|
|
76077
|
+
) })
|
|
76078
|
+
]
|
|
76079
|
+
},
|
|
76080
|
+
section.key
|
|
76081
|
+
)) })
|
|
76082
|
+
] });
|
|
76083
|
+
}
|
|
76084
|
+
function buildSections(items) {
|
|
76085
|
+
const sections = [];
|
|
76086
|
+
let current = null;
|
|
76087
|
+
for (const item of items) {
|
|
76088
|
+
if (item.type === "subtitle") {
|
|
76089
|
+
current = {
|
|
76090
|
+
key: item.key,
|
|
76091
|
+
title: item.title,
|
|
76092
|
+
items: []
|
|
76093
|
+
};
|
|
76094
|
+
sections.push(current);
|
|
76095
|
+
} else {
|
|
76096
|
+
if (!current) {
|
|
76097
|
+
current = {
|
|
76098
|
+
key: "default",
|
|
76099
|
+
title: "",
|
|
76100
|
+
items: []
|
|
76101
|
+
};
|
|
76102
|
+
sections.push(current);
|
|
76103
|
+
}
|
|
76104
|
+
current.items.push(item);
|
|
76105
|
+
}
|
|
76106
|
+
}
|
|
76107
|
+
return sections;
|
|
76108
|
+
}
|
|
76109
|
+
class SettingsPanelKeys {
|
|
76110
|
+
}
|
|
76111
|
+
// === Inputs ===
|
|
76112
|
+
__publicField(SettingsPanelKeys, "InputsSubtitle", "inputs");
|
|
76113
|
+
__publicField(SettingsPanelKeys, "InputsScrollSpeedBox", "scrollSpeed");
|
|
76114
|
+
// === Panels ===
|
|
76115
|
+
__publicField(SettingsPanelKeys, "PanelsSubtitle", "panels");
|
|
76116
|
+
__publicField(SettingsPanelKeys, "PanelsShowLogoToggle", "logo");
|
|
76117
|
+
__publicField(SettingsPanelKeys, "PanelsShowBimTreeToggle", "bimTree");
|
|
76118
|
+
__publicField(SettingsPanelKeys, "PanelsShowBimInfoToggle", "bimInfo");
|
|
76119
|
+
__publicField(SettingsPanelKeys, "PanelsShowAxesPanelToggle", "axesPanel");
|
|
76120
|
+
__publicField(SettingsPanelKeys, "PanelsShowPerformancePanelToggle", "performance");
|
|
76121
|
+
// === Axes ===
|
|
76122
|
+
__publicField(SettingsPanelKeys, "AxesSubtitle", "axes");
|
|
76123
|
+
__publicField(SettingsPanelKeys, "AxesShowOrthographicButtonToggle", "orthographic");
|
|
76124
|
+
__publicField(SettingsPanelKeys, "AxesShowResetCameraButtonToggle", "resetCamera");
|
|
76125
|
+
// === Control Bar ===
|
|
76126
|
+
__publicField(SettingsPanelKeys, "ControlBarSubtitle", "controlBar");
|
|
76127
|
+
__publicField(SettingsPanelKeys, "ControlBarShowControlBarToggle", "controlBarVisible");
|
|
76128
|
+
// --- Control Bar - Cursors ---
|
|
76129
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsSubtitle", "controlBarCursors");
|
|
76130
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowOrbitButtonToggle", "orbit");
|
|
76131
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowLookAroundButtonToggle", "lookAround");
|
|
76132
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowPanButtonToggle", "pan");
|
|
76133
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowZoomButtonToggle", "zoom");
|
|
76134
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowZoomWindowButtonToggle", "zoomWindow");
|
|
76135
|
+
// --- Control Bar - Tools ---
|
|
76136
|
+
__publicField(SettingsPanelKeys, "ControlBarToolsSubtitle", "controlBarTools");
|
|
76137
|
+
__publicField(SettingsPanelKeys, "ControlBarToolsShowMeasuringModeButtonToggle", "measuringMode");
|
|
76138
|
+
// --- Control Bar Camera ---
|
|
76139
|
+
__publicField(SettingsPanelKeys, "ControlBarCameraSubtitle", "settingsPanel.controlBar.Camera");
|
|
76140
|
+
__publicField(SettingsPanelKeys, "ControlBarAutoCamera", "settingsPanel.controlBar.autoCamera");
|
|
76141
|
+
__publicField(SettingsPanelKeys, "ControlBarFrameSelection", "settingsPanel.controlBar.frameSelection");
|
|
76142
|
+
__publicField(SettingsPanelKeys, "ControlBarFrameAll", "settingsPanel.controlBar.frameAll");
|
|
76143
|
+
// --- Control Bar - Sectioning ---
|
|
76144
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningSubtitle", "settingsPanel.controlBar.sectioning");
|
|
76145
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningEnable", "settingsPanel.controlBar.enableSectioning");
|
|
76146
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningFitToSelection", "settingsPanel.controlBar.fitToSelection");
|
|
76147
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningReset", "settingsPanel.controlBar.reset");
|
|
76148
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningShow", "settingsPanel.controlBar.show");
|
|
76149
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningAuto", "settingsPanel.controlBar.auto");
|
|
76150
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningSettings", "settingsPanel.controlBar.settings");
|
|
76151
|
+
// --- Control Bar - Visibility ---
|
|
76152
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilitySubtitle", "controlBar.visibility.subtitle");
|
|
76153
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityClearSelection", "controlBar.visibility.clearSelection");
|
|
76154
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityShowAll", "controlBar.visibility.showAll");
|
|
76155
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityToggle", "controlBar.visibility.toggle");
|
|
76156
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityIsolate", "controlBar.visibility.isolate");
|
|
76157
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityAutoIsolate", "controlBar.visibility.autoIsolate");
|
|
76158
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilitySettings", "controlBar.visibility.settings");
|
|
76159
|
+
// --- Control Bar - Settings ---
|
|
76160
|
+
__publicField(SettingsPanelKeys, "ControlBarMiscSubtitle", "controlBarSettings");
|
|
76161
|
+
__publicField(SettingsPanelKeys, "ControlBarMiscShowProjectInspectorButtonToggle", "projectInspector");
|
|
76162
|
+
__publicField(SettingsPanelKeys, "ControlBarMiscShowSettingsButtonToggle", "settingsButton");
|
|
76163
|
+
__publicField(SettingsPanelKeys, "ControlBarMiscShowHelpButtonToggle", "help");
|
|
76164
|
+
__publicField(SettingsPanelKeys, "ControlBarMiscShowMaximiseButtonToggle", "maximise");
|
|
76165
|
+
function getControlBarCursorSettings() {
|
|
76166
|
+
return [
|
|
76167
|
+
{
|
|
76168
|
+
type: "subtitle",
|
|
76169
|
+
key: SettingsPanelKeys.ControlBarCursorsSubtitle,
|
|
76170
|
+
title: "Control Bar - Cursors"
|
|
76171
|
+
},
|
|
76172
|
+
{
|
|
76173
|
+
type: "toggle",
|
|
76174
|
+
key: SettingsPanelKeys.ControlBarCursorsShowOrbitButtonToggle,
|
|
76175
|
+
label: "Orbit",
|
|
76176
|
+
getter: (s) => s.ui.cursorOrbit,
|
|
76177
|
+
setter: (s, v) => s.ui.cursorOrbit = v
|
|
76178
|
+
},
|
|
76179
|
+
{
|
|
76180
|
+
type: "toggle",
|
|
76181
|
+
key: SettingsPanelKeys.ControlBarCursorsShowLookAroundButtonToggle,
|
|
76182
|
+
label: "Look Around",
|
|
76183
|
+
getter: (s) => s.ui.cursorLookAround,
|
|
76184
|
+
setter: (s, v) => s.ui.cursorLookAround = v
|
|
76185
|
+
},
|
|
76186
|
+
{
|
|
76187
|
+
type: "toggle",
|
|
76188
|
+
key: SettingsPanelKeys.ControlBarCursorsShowPanButtonToggle,
|
|
76189
|
+
label: "Pan",
|
|
76190
|
+
getter: (s) => s.ui.cursorPan,
|
|
76191
|
+
setter: (s, v) => s.ui.cursorPan = v
|
|
76192
|
+
},
|
|
76193
|
+
{
|
|
76194
|
+
type: "toggle",
|
|
76195
|
+
key: SettingsPanelKeys.ControlBarCursorsShowZoomButtonToggle,
|
|
76196
|
+
label: "Zoom",
|
|
76197
|
+
getter: (s) => s.ui.cursorZoom,
|
|
76198
|
+
setter: (s, v) => s.ui.cursorZoom = v
|
|
76199
|
+
}
|
|
76200
|
+
];
|
|
76201
|
+
}
|
|
76202
|
+
function getControlBarCameraSettings() {
|
|
76203
|
+
return [
|
|
76204
|
+
{
|
|
76205
|
+
type: "subtitle",
|
|
76206
|
+
key: SettingsPanelKeys.ControlBarCameraSubtitle,
|
|
76207
|
+
title: "Control Bar - Camera"
|
|
76208
|
+
},
|
|
76209
|
+
{
|
|
76210
|
+
type: "toggle",
|
|
76211
|
+
key: SettingsPanelKeys.ControlBarAutoCamera,
|
|
76212
|
+
label: "Auto Camera",
|
|
76213
|
+
getter: (s) => s.ui.cameraAuto,
|
|
76214
|
+
setter: (s, v) => s.ui.cameraAuto = v
|
|
76215
|
+
},
|
|
76216
|
+
{
|
|
76217
|
+
type: "toggle",
|
|
76218
|
+
key: SettingsPanelKeys.ControlBarFrameSelection,
|
|
76219
|
+
label: "Frame Selection",
|
|
76220
|
+
getter: (s) => s.ui.cameraFrameSelection,
|
|
76221
|
+
setter: (s, v) => s.ui.cameraFrameSelection = v
|
|
76222
|
+
},
|
|
76223
|
+
{
|
|
76224
|
+
type: "toggle",
|
|
76225
|
+
key: SettingsPanelKeys.ControlBarFrameAll,
|
|
76226
|
+
label: "Frame All",
|
|
76227
|
+
getter: (s) => s.ui.cameraFrameScene,
|
|
76228
|
+
setter: (s, v) => s.ui.cameraFrameScene = v
|
|
76229
|
+
}
|
|
76230
|
+
];
|
|
76231
|
+
}
|
|
76232
|
+
function getControlBarSectionBoxSettings() {
|
|
76233
|
+
return [
|
|
76234
|
+
{
|
|
76235
|
+
type: "subtitle",
|
|
76236
|
+
key: SettingsPanelKeys.ControlBarSectioningSubtitle,
|
|
76237
|
+
title: "Control Bar - Sectioning"
|
|
76238
|
+
},
|
|
76239
|
+
{
|
|
76240
|
+
type: "toggle",
|
|
76241
|
+
key: SettingsPanelKeys.ControlBarSectioningEnable,
|
|
76242
|
+
label: "Enable Sectioning",
|
|
76243
|
+
getter: (s) => s.ui.sectioningEnable,
|
|
76244
|
+
setter: (s, v) => s.ui.sectioningEnable = v
|
|
76245
|
+
},
|
|
76246
|
+
{
|
|
76247
|
+
type: "toggle",
|
|
76248
|
+
key: SettingsPanelKeys.ControlBarSectioningFitToSelection,
|
|
76249
|
+
label: "Fit To Selection",
|
|
76250
|
+
getter: (s) => s.ui.sectioningFitToSelection,
|
|
76251
|
+
setter: (s, v) => s.ui.sectioningFitToSelection = v
|
|
76252
|
+
},
|
|
76253
|
+
{
|
|
76254
|
+
type: "toggle",
|
|
76255
|
+
key: SettingsPanelKeys.ControlBarSectioningReset,
|
|
76256
|
+
label: "Reset",
|
|
76257
|
+
getter: (s) => s.ui.sectioningReset,
|
|
76258
|
+
setter: (s, v) => s.ui.sectioningReset = v
|
|
76259
|
+
},
|
|
76260
|
+
{
|
|
76261
|
+
type: "toggle",
|
|
76262
|
+
key: SettingsPanelKeys.ControlBarSectioningShow,
|
|
76263
|
+
label: "Show",
|
|
76264
|
+
getter: (s) => s.ui.sectioningShow,
|
|
76265
|
+
setter: (s, v) => s.ui.sectioningShow = v
|
|
76266
|
+
},
|
|
76267
|
+
{
|
|
76268
|
+
type: "toggle",
|
|
76269
|
+
key: SettingsPanelKeys.ControlBarSectioningAuto,
|
|
76270
|
+
label: "Auto",
|
|
76271
|
+
getter: (s) => s.ui.sectioningAuto,
|
|
76272
|
+
setter: (s, v) => s.ui.sectioningAuto = v
|
|
76273
|
+
},
|
|
76274
|
+
{
|
|
76275
|
+
type: "toggle",
|
|
76276
|
+
key: SettingsPanelKeys.ControlBarSectioningSettings,
|
|
76277
|
+
label: "Settings",
|
|
76278
|
+
getter: (s) => s.ui.sectioningSettings,
|
|
76279
|
+
setter: (s, v) => s.ui.sectioningSettings = v
|
|
76280
|
+
}
|
|
76281
|
+
];
|
|
76282
|
+
}
|
|
76283
|
+
function getControlBarVisibilitySettings() {
|
|
76284
|
+
return [
|
|
76285
|
+
{
|
|
76286
|
+
type: "subtitle",
|
|
76287
|
+
key: SettingsPanelKeys.ControlBarVisibilitySubtitle,
|
|
76288
|
+
title: "Control Bar - Visibility"
|
|
76289
|
+
},
|
|
76290
|
+
{
|
|
76291
|
+
type: "toggle",
|
|
76292
|
+
key: SettingsPanelKeys.ControlBarVisibilityClearSelection,
|
|
76293
|
+
label: "Clear Selection",
|
|
76294
|
+
getter: (s) => s.ui.visibilityClearSelection,
|
|
76295
|
+
setter: (s, v) => s.ui.visibilityClearSelection = v
|
|
76296
|
+
},
|
|
76297
|
+
{
|
|
76298
|
+
type: "toggle",
|
|
76299
|
+
key: SettingsPanelKeys.ControlBarVisibilityShowAll,
|
|
76300
|
+
label: "Show All",
|
|
76301
|
+
getter: (s) => s.ui.visibilityShowAll,
|
|
76302
|
+
setter: (s, v) => s.ui.visibilityShowAll = v
|
|
76303
|
+
},
|
|
76304
|
+
{
|
|
76305
|
+
type: "toggle",
|
|
76306
|
+
key: SettingsPanelKeys.ControlBarVisibilityToggle,
|
|
76307
|
+
label: "Toggle",
|
|
76308
|
+
getter: (s) => s.ui.visibilityToggle,
|
|
76309
|
+
setter: (s, v) => s.ui.visibilityToggle = v
|
|
76310
|
+
},
|
|
76311
|
+
{
|
|
76312
|
+
type: "toggle",
|
|
76313
|
+
key: SettingsPanelKeys.ControlBarVisibilityIsolate,
|
|
76314
|
+
label: "Isolate",
|
|
76315
|
+
getter: (s) => s.ui.visibilityIsolate,
|
|
76316
|
+
setter: (s, v) => s.ui.visibilityIsolate = v
|
|
76317
|
+
},
|
|
76318
|
+
{
|
|
76319
|
+
type: "toggle",
|
|
76320
|
+
key: SettingsPanelKeys.ControlBarVisibilityAutoIsolate,
|
|
76321
|
+
label: "Auto Isolate",
|
|
76322
|
+
getter: (s) => s.ui.visibilityAutoIsolate,
|
|
76323
|
+
setter: (s, v) => s.ui.visibilityAutoIsolate = v
|
|
76324
|
+
},
|
|
76325
|
+
{
|
|
76326
|
+
type: "toggle",
|
|
76327
|
+
key: SettingsPanelKeys.ControlBarVisibilitySettings,
|
|
76328
|
+
label: "Settings",
|
|
76329
|
+
getter: (s) => s.ui.visibilitySettings,
|
|
76330
|
+
setter: (s, v) => s.ui.visibilitySettings = v
|
|
76331
|
+
}
|
|
76332
|
+
];
|
|
76333
|
+
}
|
|
76334
|
+
function getControlBarVariousSettings() {
|
|
76335
|
+
return [
|
|
76336
|
+
{
|
|
76337
|
+
type: "subtitle",
|
|
76338
|
+
key: SettingsPanelKeys.ControlBarMiscSubtitle,
|
|
76339
|
+
title: "Control Bar - Settings"
|
|
76340
|
+
},
|
|
76341
|
+
{
|
|
76342
|
+
type: "toggle",
|
|
76343
|
+
key: SettingsPanelKeys.ControlBarMiscShowProjectInspectorButtonToggle,
|
|
76344
|
+
label: "Project Inspector",
|
|
76345
|
+
getter: (s) => s.ui.miscProjectInspector,
|
|
76346
|
+
setter: (s, v) => s.ui.miscProjectInspector = v
|
|
76347
|
+
},
|
|
76348
|
+
{
|
|
76349
|
+
type: "toggle",
|
|
76350
|
+
key: SettingsPanelKeys.ControlBarMiscShowSettingsButtonToggle,
|
|
76351
|
+
label: "Settings",
|
|
76352
|
+
getter: (s) => s.ui.miscSettings,
|
|
76353
|
+
setter: (s, v) => s.ui.miscSettings = v
|
|
76354
|
+
},
|
|
76355
|
+
{
|
|
76356
|
+
type: "toggle",
|
|
76357
|
+
key: SettingsPanelKeys.ControlBarMiscShowHelpButtonToggle,
|
|
76358
|
+
label: "Help",
|
|
76359
|
+
getter: (s) => s.ui.miscHelp,
|
|
76360
|
+
setter: (s, v) => s.ui.miscHelp = v
|
|
76361
|
+
},
|
|
76362
|
+
{
|
|
76363
|
+
type: "toggle",
|
|
76364
|
+
key: SettingsPanelKeys.ControlBarMiscShowMaximiseButtonToggle,
|
|
76365
|
+
label: "Maximise",
|
|
76366
|
+
getter: (s) => s.ui.miscMaximise,
|
|
76367
|
+
setter: (s, v) => s.ui.miscMaximise = v
|
|
76368
|
+
}
|
|
76369
|
+
];
|
|
76370
|
+
}
|
|
76371
|
+
function getPanelsVisibilitySettings() {
|
|
76372
|
+
return [
|
|
76373
|
+
{
|
|
76374
|
+
type: "subtitle",
|
|
76375
|
+
key: SettingsPanelKeys.PanelsSubtitle,
|
|
76376
|
+
title: "Panels Visibility"
|
|
76377
|
+
},
|
|
76378
|
+
{
|
|
76379
|
+
type: "toggle",
|
|
76380
|
+
key: SettingsPanelKeys.PanelsShowLogoToggle,
|
|
76381
|
+
label: "Logo",
|
|
76382
|
+
getter: (s) => s.ui.panelLogo,
|
|
76383
|
+
setter: (s, v) => s.ui.panelLogo = v
|
|
76384
|
+
},
|
|
76385
|
+
{
|
|
76386
|
+
type: "toggle",
|
|
76387
|
+
key: SettingsPanelKeys.PanelsShowBimTreeToggle,
|
|
76388
|
+
label: "Bim Tree",
|
|
76389
|
+
getter: (s) => s.ui.panelBimTree,
|
|
76390
|
+
setter: (s, v) => s.ui.panelBimTree = v
|
|
76391
|
+
},
|
|
76392
|
+
{
|
|
76393
|
+
type: "toggle",
|
|
76394
|
+
key: SettingsPanelKeys.PanelsShowBimInfoToggle,
|
|
76395
|
+
label: "Bim Info",
|
|
76396
|
+
getter: (s) => s.ui.panelBimInfo,
|
|
76397
|
+
setter: (s, v) => s.ui.panelBimInfo = v
|
|
76398
|
+
},
|
|
76399
|
+
{
|
|
76400
|
+
type: "toggle",
|
|
76401
|
+
key: SettingsPanelKeys.PanelsShowAxesPanelToggle,
|
|
76402
|
+
label: "Axes",
|
|
76403
|
+
getter: (s) => s.ui.panelAxes,
|
|
76404
|
+
setter: (s, v) => s.ui.panelAxes = v
|
|
76405
|
+
},
|
|
76406
|
+
{
|
|
76407
|
+
type: "toggle",
|
|
76408
|
+
key: SettingsPanelKeys.PanelsShowPerformancePanelToggle,
|
|
76409
|
+
label: "Performance",
|
|
76410
|
+
getter: (s) => s.ui.panelPerformance,
|
|
76411
|
+
setter: (s, v) => s.ui.panelPerformance = v
|
|
76412
|
+
},
|
|
76413
|
+
{
|
|
76414
|
+
type: "toggle",
|
|
76415
|
+
key: SettingsPanelKeys.ControlBarShowControlBarToggle,
|
|
76416
|
+
label: "Control Bar",
|
|
76417
|
+
getter: (s) => s.ui.panelControlBar,
|
|
76418
|
+
setter: (s, v) => s.ui.panelControlBar = v
|
|
76419
|
+
}
|
|
76420
|
+
];
|
|
76421
|
+
}
|
|
76422
|
+
function getInputsSettings(viewer) {
|
|
76423
|
+
return [
|
|
76424
|
+
{
|
|
76425
|
+
type: "subtitle",
|
|
76426
|
+
key: SettingsPanelKeys.InputsSubtitle,
|
|
76427
|
+
title: "Inputs"
|
|
76428
|
+
},
|
|
76429
|
+
{
|
|
76430
|
+
type: "box",
|
|
76431
|
+
key: SettingsPanelKeys.InputsScrollSpeedBox,
|
|
76432
|
+
label: "Scroll Speed",
|
|
76433
|
+
info: "[0.1,10]",
|
|
76434
|
+
transform: (n) => MathUtils.clamp(n, 0.1, 10),
|
|
76435
|
+
getter: (_s) => viewer.inputs.scrollSpeed,
|
|
76436
|
+
setter: (_s, v) => {
|
|
76437
|
+
viewer.inputs.scrollSpeed = v;
|
|
76438
|
+
}
|
|
76439
|
+
}
|
|
76440
|
+
];
|
|
76441
|
+
}
|
|
76442
|
+
function getAxesPanelSettings() {
|
|
76443
|
+
return [
|
|
76444
|
+
{
|
|
76445
|
+
type: "subtitle",
|
|
76446
|
+
key: SettingsPanelKeys.AxesSubtitle,
|
|
76447
|
+
title: "Axes Panel"
|
|
76448
|
+
},
|
|
76449
|
+
{
|
|
76450
|
+
type: "toggle",
|
|
76451
|
+
key: SettingsPanelKeys.AxesShowOrthographicButtonToggle,
|
|
76452
|
+
label: "Orthographic Camera",
|
|
76453
|
+
getter: (s) => s.ui.axesOrthographic,
|
|
76454
|
+
setter: (s, v) => s.ui.axesOrthographic = v
|
|
76455
|
+
},
|
|
76456
|
+
{
|
|
76457
|
+
type: "toggle",
|
|
76458
|
+
key: SettingsPanelKeys.AxesShowResetCameraButtonToggle,
|
|
76459
|
+
label: "Reset Camera",
|
|
76460
|
+
getter: (s) => s.ui.axesHome,
|
|
76461
|
+
setter: (s, v) => s.ui.axesHome = v
|
|
76462
|
+
}
|
|
76463
|
+
];
|
|
76464
|
+
}
|
|
76465
|
+
function getControlBarMeasureSettings() {
|
|
76466
|
+
return [
|
|
76467
|
+
{
|
|
76468
|
+
type: "subtitle",
|
|
76469
|
+
key: SettingsPanelKeys.ControlBarToolsSubtitle,
|
|
76470
|
+
title: "Control Bar - Measurement"
|
|
76471
|
+
},
|
|
76472
|
+
{
|
|
76473
|
+
type: "toggle",
|
|
76474
|
+
key: SettingsPanelKeys.ControlBarToolsShowMeasuringModeButtonToggle,
|
|
76475
|
+
label: "Enable",
|
|
76476
|
+
getter: (s) => s.ui.measureEnable,
|
|
76477
|
+
setter: (s, v) => s.ui.measureEnable = v
|
|
76478
|
+
}
|
|
76479
|
+
];
|
|
76480
|
+
}
|
|
76481
|
+
function getWebglSettingsContent(viewer) {
|
|
76482
|
+
return [
|
|
76483
|
+
...getInputsSettings(viewer),
|
|
76484
|
+
...getPanelsVisibilitySettings(),
|
|
76485
|
+
...getAxesPanelSettings(),
|
|
76486
|
+
...getControlBarCursorSettings(),
|
|
76487
|
+
...getControlBarCameraSettings(),
|
|
76488
|
+
...getControlBarVisibilitySettings(),
|
|
76489
|
+
...getControlBarMeasureSettings(),
|
|
76490
|
+
...getControlBarSectionBoxSettings(),
|
|
76491
|
+
...getControlBarVariousSettings()
|
|
76492
|
+
];
|
|
76493
|
+
}
|
|
76494
|
+
function applyWebglSettings(settings2) {
|
|
76495
|
+
const performance2 = document.getElementsByClassName("vim-performance-div")[0];
|
|
76496
|
+
if (performance2) {
|
|
76497
|
+
if (isTrue(settings2.ui.panelPerformance)) {
|
|
76498
|
+
performance2.classList.remove("vc-hidden");
|
|
76499
|
+
} else {
|
|
76500
|
+
performance2.classList.add("vc-hidden");
|
|
76501
|
+
}
|
|
76502
|
+
}
|
|
76503
|
+
}
|
|
75985
76504
|
function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
75986
76505
|
const controllablePromise = new ControllablePromise();
|
|
75987
76506
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
@@ -76012,7 +76531,7 @@ function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
|
76012
76531
|
return controllablePromise.promise;
|
|
76013
76532
|
}
|
|
76014
76533
|
function Viewer$1(props) {
|
|
76015
|
-
const settings2 = useSettings(props.
|
|
76534
|
+
const settings2 = useSettings(props.settings ?? {}, getDefaultSettings(), (s) => applyWebglSettings(s));
|
|
76016
76535
|
const modal = useRef(null);
|
|
76017
76536
|
const sectionBoxRef = useWebglSectionBox(props.viewer);
|
|
76018
76537
|
const isolationPanelHandle = useRef(null);
|
|
@@ -76022,7 +76541,7 @@ function Viewer$1(props) {
|
|
|
76022
76541
|
const loader = useRef(new ComponentLoader(props.viewer, modal, settings2.value));
|
|
76023
76542
|
useViewerInput(props.viewer.inputs, camera2);
|
|
76024
76543
|
const side = useSideState(
|
|
76025
|
-
isTrue(settings2.value.ui.
|
|
76544
|
+
isTrue(settings2.value.ui.panelBimTree) || isTrue(settings2.value.ui.panelBimInfo),
|
|
76026
76545
|
Math.min(props.container.root.clientWidth * 0.25, 340)
|
|
76027
76546
|
);
|
|
76028
76547
|
const [contextMenu2, setcontextMenu] = useState();
|
|
@@ -76038,6 +76557,16 @@ function Viewer$1(props) {
|
|
|
76038
76557
|
side.setHasBim(((_a3 = viewerState.vim.get()) == null ? void 0 : _a3.bim) !== void 0);
|
|
76039
76558
|
});
|
|
76040
76559
|
useEffect(() => {
|
|
76560
|
+
sectionBoxRef.showOffsetPanel.onChange.subscribe((show) => {
|
|
76561
|
+
if (show) {
|
|
76562
|
+
isolationRef.showPanel.set(false);
|
|
76563
|
+
}
|
|
76564
|
+
});
|
|
76565
|
+
isolationRef.showPanel.onChange.subscribe((show) => {
|
|
76566
|
+
if (show) {
|
|
76567
|
+
sectionBoxRef.showOffsetPanel.set(false);
|
|
76568
|
+
}
|
|
76569
|
+
});
|
|
76041
76570
|
if (performanceRef.current) {
|
|
76042
76571
|
addPerformanceCounter(performanceRef.current);
|
|
76043
76572
|
}
|
|
@@ -76051,7 +76580,11 @@ function Viewer$1(props) {
|
|
|
76051
76580
|
loader: loader.current,
|
|
76052
76581
|
isolation: isolationRef,
|
|
76053
76582
|
camera: camera2,
|
|
76054
|
-
settings:
|
|
76583
|
+
settings: {
|
|
76584
|
+
update: settings2.update,
|
|
76585
|
+
register: settings2.register,
|
|
76586
|
+
customize: (c) => settings2.customizer.set(c)
|
|
76587
|
+
},
|
|
76055
76588
|
get isolationPanel() {
|
|
76056
76589
|
return isolationPanelHandle.current;
|
|
76057
76590
|
},
|
|
@@ -76097,7 +76630,7 @@ function Viewer$1(props) {
|
|
|
76097
76630
|
SettingsPanel,
|
|
76098
76631
|
{
|
|
76099
76632
|
visible: side.getContent() === "settings",
|
|
76100
|
-
|
|
76633
|
+
content: getWebglSettingsContent(props.viewer),
|
|
76101
76634
|
settings: settings2
|
|
76102
76635
|
}
|
|
76103
76636
|
)
|
|
@@ -76117,16 +76650,16 @@ function Viewer$1(props) {
|
|
|
76117
76650
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
76118
76651
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76119
76652
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.viewer.viewport.canvas }),
|
|
76120
|
-
whenTrue(settings2.value.ui.
|
|
76653
|
+
whenTrue(settings2.value.ui.panelLogo, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
|
|
76121
76654
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76122
76655
|
ControlBar,
|
|
76123
76656
|
{
|
|
76124
76657
|
content: controlBar,
|
|
76125
|
-
show: isTrue(settings2.value.ui.
|
|
76658
|
+
show: isTrue(settings2.value.ui.panelControlBar)
|
|
76126
76659
|
}
|
|
76127
76660
|
),
|
|
76128
76661
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel$1, { ref: sectionBoxPanelHandle, state: sectionBoxRef }),
|
|
76129
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef }),
|
|
76662
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef, transparency: true }),
|
|
76130
76663
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76131
76664
|
AxesPanelMemo,
|
|
76132
76665
|
{
|
|
@@ -76165,7 +76698,8 @@ function Viewer$1(props) {
|
|
|
76165
76698
|
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76166
76699
|
__proto__: null,
|
|
76167
76700
|
Viewer: Viewer$1,
|
|
76168
|
-
createViewer: createViewer$1
|
|
76701
|
+
createViewer: createViewer$1,
|
|
76702
|
+
getDefaultSettings
|
|
76169
76703
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76170
76704
|
function getErrorMessage(state) {
|
|
76171
76705
|
if (state.status !== "error") return void 0;
|
|
@@ -76231,11 +76765,13 @@ function useUltraSectionBox(viewer) {
|
|
|
76231
76765
|
};
|
|
76232
76766
|
return useSectionBox(ultraAdapter);
|
|
76233
76767
|
}
|
|
76234
|
-
function useUltraControlBar(viewer, section, isolation, camera2, customization) {
|
|
76235
|
-
|
|
76236
|
-
|
|
76237
|
-
|
|
76238
|
-
|
|
76768
|
+
function useUltraControlBar(viewer, section, isolation, camera2, settings2, side, modal, customization) {
|
|
76769
|
+
let bar = [
|
|
76770
|
+
controlBarCamera(camera2, settings2.ui),
|
|
76771
|
+
controlBarVisibility(isolation, settings2.ui),
|
|
76772
|
+
controlBarSectionBox(section, viewer.selection.any(), settings2.ui),
|
|
76773
|
+
controlBarMiscUltra(modal, side, settings2)
|
|
76774
|
+
];
|
|
76239
76775
|
bar = (customization == null ? void 0 : customization(bar)) ?? bar;
|
|
76240
76776
|
return bar;
|
|
76241
76777
|
}
|
|
@@ -76339,6 +76875,9 @@ function createAdapter(viewer) {
|
|
|
76339
76875
|
}
|
|
76340
76876
|
}
|
|
76341
76877
|
},
|
|
76878
|
+
enableTransparency: (enable) => {
|
|
76879
|
+
console.log("enableTransparency not implemented");
|
|
76880
|
+
},
|
|
76342
76881
|
getGhostOpacity: () => viewer.renderer.ghostOpacity,
|
|
76343
76882
|
setGhostOpacity: (opacity) => {
|
|
76344
76883
|
viewer.renderer.ghostOpacity = opacity;
|
|
@@ -76380,7 +76919,73 @@ function onlySelection(viewer, vim) {
|
|
|
76380
76919
|
function allButSelection(viewer, vim) {
|
|
76381
76920
|
return false;
|
|
76382
76921
|
}
|
|
76383
|
-
function
|
|
76922
|
+
function getDefaultUltraSettings() {
|
|
76923
|
+
return {
|
|
76924
|
+
ui: {
|
|
76925
|
+
// panels
|
|
76926
|
+
panelLogo: true,
|
|
76927
|
+
panelControlBar: true,
|
|
76928
|
+
// Control bar - cursors
|
|
76929
|
+
cursorOrbit: true,
|
|
76930
|
+
cursorLookAround: true,
|
|
76931
|
+
cursorPan: true,
|
|
76932
|
+
cursorZoom: true,
|
|
76933
|
+
// Control bar - camera
|
|
76934
|
+
cameraAuto: true,
|
|
76935
|
+
cameraFrameScene: true,
|
|
76936
|
+
cameraFrameSelection: true,
|
|
76937
|
+
// Control bar - tools
|
|
76938
|
+
sectioningEnable: true,
|
|
76939
|
+
sectioningFitToSelection: true,
|
|
76940
|
+
sectioningReset: true,
|
|
76941
|
+
sectioningShow: true,
|
|
76942
|
+
sectioningAuto: true,
|
|
76943
|
+
sectioningSettings: true,
|
|
76944
|
+
// Control bar - Visibility
|
|
76945
|
+
visibilityClearSelection: true,
|
|
76946
|
+
visibilityShowAll: true,
|
|
76947
|
+
visibilityToggle: true,
|
|
76948
|
+
visibilityIsolate: true,
|
|
76949
|
+
visibilityAutoIsolate: true,
|
|
76950
|
+
visibilitySettings: true,
|
|
76951
|
+
// Control bar - misc
|
|
76952
|
+
miscSettings: true,
|
|
76953
|
+
miscHelp: true
|
|
76954
|
+
}
|
|
76955
|
+
};
|
|
76956
|
+
}
|
|
76957
|
+
function getControlBarUltraSettings() {
|
|
76958
|
+
return [
|
|
76959
|
+
{
|
|
76960
|
+
type: "subtitle",
|
|
76961
|
+
key: SettingsPanelKeys.ControlBarMiscSubtitle,
|
|
76962
|
+
title: "Control Bar - Settings"
|
|
76963
|
+
},
|
|
76964
|
+
{
|
|
76965
|
+
type: "toggle",
|
|
76966
|
+
key: SettingsPanelKeys.ControlBarMiscShowSettingsButtonToggle,
|
|
76967
|
+
label: "Settings",
|
|
76968
|
+
getter: (s) => s.ui.miscSettings,
|
|
76969
|
+
setter: (s, v) => s.ui.miscSettings = v
|
|
76970
|
+
},
|
|
76971
|
+
{
|
|
76972
|
+
type: "toggle",
|
|
76973
|
+
key: SettingsPanelKeys.ControlBarMiscShowHelpButtonToggle,
|
|
76974
|
+
label: "Help",
|
|
76975
|
+
getter: (s) => s.ui.miscHelp,
|
|
76976
|
+
setter: (s, v) => s.ui.miscHelp = v
|
|
76977
|
+
}
|
|
76978
|
+
];
|
|
76979
|
+
}
|
|
76980
|
+
function getUltraSettingsContent(viewer) {
|
|
76981
|
+
return [
|
|
76982
|
+
...getControlBarCameraSettings(),
|
|
76983
|
+
...getControlBarVisibilitySettings(),
|
|
76984
|
+
...getControlBarSectionBoxSettings(),
|
|
76985
|
+
...getControlBarUltraSettings()
|
|
76986
|
+
];
|
|
76987
|
+
}
|
|
76988
|
+
function createViewer(container, settings2) {
|
|
76384
76989
|
const controllablePromise = new ControllablePromise();
|
|
76385
76990
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76386
76991
|
const core = Viewer$2.createWithCanvas(cmpContainer.gfx);
|
|
@@ -76399,6 +77004,7 @@ function createViewer(container) {
|
|
|
76399
77004
|
{
|
|
76400
77005
|
container: cmpContainer,
|
|
76401
77006
|
core,
|
|
77007
|
+
settings: settings2,
|
|
76402
77008
|
onMount: (cmp) => controllablePromise.resolve(attachDispose(cmp))
|
|
76403
77009
|
}
|
|
76404
77010
|
)
|
|
@@ -76406,18 +77012,38 @@ function createViewer(container) {
|
|
|
76406
77012
|
return controllablePromise.promise;
|
|
76407
77013
|
}
|
|
76408
77014
|
function Viewer3(props) {
|
|
76409
|
-
const
|
|
76410
|
-
const
|
|
77015
|
+
const settings2 = useSettings(props.settings ?? {}, getDefaultUltraSettings());
|
|
77016
|
+
const sectionBoxRef = useUltraSectionBox(props.core);
|
|
77017
|
+
const camera2 = useUltraCamera(props.core, sectionBoxRef);
|
|
76411
77018
|
const isolationPanelHandle = useRef(null);
|
|
76412
77019
|
const sectionBoxPanelHandle = useRef(null);
|
|
76413
77020
|
const modalHandle = useRef(null);
|
|
76414
77021
|
const side = useSideState(true, 400);
|
|
76415
77022
|
const [_, setSelectState] = useState(0);
|
|
76416
77023
|
const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
|
|
76417
|
-
const
|
|
76418
|
-
const controlBar = useUltraControlBar(
|
|
77024
|
+
const isolationRef = useUltraIsolation(props.core);
|
|
77025
|
+
const controlBar = useUltraControlBar(
|
|
77026
|
+
props.core,
|
|
77027
|
+
sectionBoxRef,
|
|
77028
|
+
isolationRef,
|
|
77029
|
+
camera2,
|
|
77030
|
+
settings2.value,
|
|
77031
|
+
side,
|
|
77032
|
+
modalHandle.current,
|
|
77033
|
+
(_2) => _2
|
|
77034
|
+
);
|
|
76419
77035
|
useViewerInput(props.core.inputs, camera2);
|
|
76420
77036
|
useEffect(() => {
|
|
77037
|
+
sectionBoxRef.showOffsetPanel.onChange.subscribe((show) => {
|
|
77038
|
+
if (show) {
|
|
77039
|
+
isolationRef.showPanel.set(false);
|
|
77040
|
+
}
|
|
77041
|
+
});
|
|
77042
|
+
isolationRef.showPanel.onChange.subscribe((show) => {
|
|
77043
|
+
if (show) {
|
|
77044
|
+
sectionBoxRef.showOffsetPanel.set(false);
|
|
77045
|
+
}
|
|
77046
|
+
});
|
|
76421
77047
|
props.core.onStateChanged.subscribe((state) => updateModal(modalHandle, state));
|
|
76422
77048
|
props.core.selection.onSelectionChanged.subscribe(() => {
|
|
76423
77049
|
setSelectState((i) => (i + 1) % 2);
|
|
@@ -76427,9 +77053,14 @@ function Viewer3(props) {
|
|
|
76427
77053
|
get modal() {
|
|
76428
77054
|
return modalHandle.current;
|
|
76429
77055
|
},
|
|
76430
|
-
isolation,
|
|
76431
|
-
sectionBox:
|
|
77056
|
+
isolation: isolationRef,
|
|
77057
|
+
sectionBox: sectionBoxRef,
|
|
76432
77058
|
camera: camera2,
|
|
77059
|
+
settings: {
|
|
77060
|
+
update: settings2.update,
|
|
77061
|
+
register: settings2.register,
|
|
77062
|
+
customize: (c) => settings2.customizer.set(c)
|
|
77063
|
+
},
|
|
76433
77064
|
get isolationPanel() {
|
|
76434
77065
|
return isolationPanelHandle.current;
|
|
76435
77066
|
},
|
|
@@ -76444,20 +77075,37 @@ function Viewer3(props) {
|
|
|
76444
77075
|
load: patchLoad(props.core, modalHandle)
|
|
76445
77076
|
});
|
|
76446
77077
|
}, []);
|
|
77078
|
+
const sidePanel = () => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77079
|
+
SettingsPanel,
|
|
77080
|
+
{
|
|
77081
|
+
visible: side.getContent() === "settings",
|
|
77082
|
+
content: getUltraSettingsContent(props.core),
|
|
77083
|
+
settings: settings2
|
|
77084
|
+
}
|
|
77085
|
+
) });
|
|
76447
77086
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
77087
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77088
|
+
SidePanelMemo,
|
|
77089
|
+
{
|
|
77090
|
+
container: props.container,
|
|
77091
|
+
viewer: props.core,
|
|
77092
|
+
side,
|
|
77093
|
+
content: sidePanel
|
|
77094
|
+
}
|
|
77095
|
+
),
|
|
76448
77096
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
76449
77097
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76450
|
-
whenTrue(
|
|
77098
|
+
whenTrue(settings2.value.ui.panelLogo, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
|
|
76451
77099
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.core.viewport.canvas }),
|
|
76452
77100
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76453
77101
|
ControlBar,
|
|
76454
77102
|
{
|
|
76455
77103
|
content: controlBarCustom(controlBar),
|
|
76456
|
-
show:
|
|
77104
|
+
show: isTrue(settings2.value.ui.panelControlBar)
|
|
76457
77105
|
}
|
|
76458
77106
|
),
|
|
76459
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel$1, { ref: sectionBoxPanelHandle, state:
|
|
76460
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state:
|
|
77107
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel$1, { ref: sectionBoxPanelHandle, state: sectionBoxRef }),
|
|
77108
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef, transparency: false })
|
|
76461
77109
|
] });
|
|
76462
77110
|
} }),
|
|
76463
77111
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ref: modalHandle, canFollowLinks: true }),
|
|
@@ -76495,7 +77143,15 @@ function patchLoad(viewer, modal) {
|
|
|
76495
77143
|
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76496
77144
|
__proto__: null,
|
|
76497
77145
|
Viewer: Viewer3,
|
|
76498
|
-
createViewer
|
|
77146
|
+
createViewer,
|
|
77147
|
+
getDefaultUltraSettings
|
|
77148
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
77149
|
+
const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
|
|
77150
|
+
const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
|
|
77151
|
+
const urls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
77152
|
+
__proto__: null,
|
|
77153
|
+
supportControls,
|
|
77154
|
+
supportUltra
|
|
76499
77155
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76500
77156
|
const SectionBoxPanel = {
|
|
76501
77157
|
Ids
|