vim-web 0.5.0-dev.17 → 0.5.0-dev.18
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 +37 -7
- package/dist/types/core-viewers/ultra/viewport.d.ts +6 -0
- 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/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/viewport.d.ts +1 -1
- package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
- 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/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 +3 -1
- package/dist/types/react-viewers/ultra/index.d.ts +1 -0
- package/dist/types/react-viewers/ultra/settings.d.ts +10 -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 +1047 -481
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +1047 -481
- 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
|
@@ -48851,19 +48851,38 @@ class InsertableMesh {
|
|
|
48851
48851
|
return new InsertableSubmesh(this, index2);
|
|
48852
48852
|
}
|
|
48853
48853
|
/**
|
|
48854
|
-
|
|
48855
|
-
|
|
48854
|
+
* Sets the material for this mesh.
|
|
48855
|
+
* Set to undefined to reset to original materials.
|
|
48856
|
+
*/
|
|
48856
48857
|
setMaterial(value) {
|
|
48857
|
-
if (this._material === value) return;
|
|
48858
48858
|
if (this.ignoreSceneMaterial) return;
|
|
48859
|
-
|
|
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;
|
|
48860
48867
|
this.mesh.geometry.clearGroups();
|
|
48861
|
-
if (
|
|
48862
|
-
|
|
48868
|
+
if (Array.isArray(mat)) {
|
|
48869
|
+
mat.forEach((_m, i) => {
|
|
48863
48870
|
this.mesh.geometry.addGroup(0, Infinity, i);
|
|
48864
48871
|
});
|
|
48865
48872
|
}
|
|
48866
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
|
+
}
|
|
48867
48886
|
}
|
|
48868
48887
|
class InstancedSubmesh {
|
|
48869
48888
|
constructor(mesh, index2) {
|
|
@@ -48950,17 +48969,39 @@ class InstancedMesh2 {
|
|
|
48950
48969
|
}
|
|
48951
48970
|
return submeshes;
|
|
48952
48971
|
}
|
|
48972
|
+
/**
|
|
48973
|
+
* Sets the material for this mesh.
|
|
48974
|
+
* Set to undefined to reset to original materials.
|
|
48975
|
+
*/
|
|
48953
48976
|
setMaterial(value) {
|
|
48954
|
-
if (this._material === value) return;
|
|
48955
48977
|
if (this.ignoreSceneMaterial) return;
|
|
48956
|
-
|
|
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;
|
|
48957
48986
|
this.mesh.geometry.clearGroups();
|
|
48958
|
-
if (
|
|
48959
|
-
|
|
48987
|
+
if (Array.isArray(mat)) {
|
|
48988
|
+
mat.forEach((_m, i) => {
|
|
48960
48989
|
this.mesh.geometry.addGroup(0, Infinity, i);
|
|
48961
48990
|
});
|
|
48962
48991
|
}
|
|
48963
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
|
+
}
|
|
48964
49005
|
computeBoundingBoxes() {
|
|
48965
49006
|
this.mesh.geometry.computeBoundingBox();
|
|
48966
49007
|
const boxes = new Array(this.mesh.count);
|
|
@@ -50100,6 +50141,9 @@ const _Marker = class _Marker {
|
|
|
50100
50141
|
get index() {
|
|
50101
50142
|
return this._submesh.index;
|
|
50102
50143
|
}
|
|
50144
|
+
get isRoom() {
|
|
50145
|
+
return false;
|
|
50146
|
+
}
|
|
50103
50147
|
/**
|
|
50104
50148
|
* Updates the underlying submesh and rebinds all attributes to the new mesh.
|
|
50105
50149
|
* @param mesh - The new submesh to bind to this marker.
|
|
@@ -55871,7 +55915,7 @@ let Viewport$1 = class Viewport {
|
|
|
55871
55915
|
/**
|
|
55872
55916
|
* Resizes the canvas and updates the camera to match new parent dimensions.
|
|
55873
55917
|
*/
|
|
55874
|
-
|
|
55918
|
+
resizeToParent() {
|
|
55875
55919
|
this._onResize.dispatch();
|
|
55876
55920
|
}
|
|
55877
55921
|
/**
|
|
@@ -56963,6 +57007,10 @@ let Renderer$1 = class Renderer {
|
|
|
56963
57007
|
* Indicates whether the scene should be re-rendered on change only.
|
|
56964
57008
|
*/
|
|
56965
57009
|
__publicField(this, "onDemand");
|
|
57010
|
+
/**
|
|
57011
|
+
* The material that will be used when setting model material to undefined.
|
|
57012
|
+
*/
|
|
57013
|
+
__publicField(this, "defaultModelMaterial");
|
|
56966
57014
|
__publicField(this, "fitViewport", () => {
|
|
56967
57015
|
const size = this._viewport.getParentSize();
|
|
56968
57016
|
this.renderer.setPixelRatio(window.devicePixelRatio);
|
|
@@ -57034,11 +57082,14 @@ let Renderer$1 = class Renderer {
|
|
|
57034
57082
|
this._scene.threeScene.background = color;
|
|
57035
57083
|
this.needsUpdate = true;
|
|
57036
57084
|
}
|
|
57085
|
+
/**
|
|
57086
|
+
* Sets the material used to render models. If set to undefined, the default model or mesh material is used.
|
|
57087
|
+
*/
|
|
57037
57088
|
get modelMaterial() {
|
|
57038
57089
|
return this._scene.modelMaterial;
|
|
57039
57090
|
}
|
|
57040
57091
|
set modelMaterial(material) {
|
|
57041
|
-
this._scene.modelMaterial = material;
|
|
57092
|
+
this._scene.modelMaterial = material ?? this.defaultModelMaterial;
|
|
57042
57093
|
}
|
|
57043
57094
|
/**
|
|
57044
57095
|
* Signal dispatched at the end of each frame if the scene was updated, such as visibility changes.
|
|
@@ -60861,6 +60912,12 @@ class Viewport2 {
|
|
|
60861
60912
|
this._rpc.RPCSetCameraAspectRatio(this.canvas.offsetWidth, this.canvas.offsetHeight);
|
|
60862
60913
|
}
|
|
60863
60914
|
}
|
|
60915
|
+
/**
|
|
60916
|
+
* Resizes the viewport to match its parent's dimensions
|
|
60917
|
+
*/
|
|
60918
|
+
resizeToParent() {
|
|
60919
|
+
this.update();
|
|
60920
|
+
}
|
|
60864
60921
|
/**
|
|
60865
60922
|
* Cleans up resources by removing resize observer and clearing timeouts
|
|
60866
60923
|
*/
|
|
@@ -63668,50 +63725,6 @@ const icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
63668
63725
|
visible,
|
|
63669
63726
|
zoom
|
|
63670
63727
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
63671
|
-
function getDefaultSettings() {
|
|
63672
|
-
return {
|
|
63673
|
-
capacity: {
|
|
63674
|
-
canFollowUrl: true,
|
|
63675
|
-
canGoFullScreen: true,
|
|
63676
|
-
canDownload: true,
|
|
63677
|
-
canReadLocalStorage: true
|
|
63678
|
-
},
|
|
63679
|
-
ui: {
|
|
63680
|
-
logo: true,
|
|
63681
|
-
performance: false,
|
|
63682
|
-
bimTreePanel: true,
|
|
63683
|
-
bimInfoPanel: true,
|
|
63684
|
-
// axesPanel
|
|
63685
|
-
axesPanel: true,
|
|
63686
|
-
orthographic: true,
|
|
63687
|
-
resetCamera: true,
|
|
63688
|
-
// Control bar
|
|
63689
|
-
controlBar: true,
|
|
63690
|
-
// Control bar - cursors
|
|
63691
|
-
orbit: true,
|
|
63692
|
-
lookAround: true,
|
|
63693
|
-
pan: true,
|
|
63694
|
-
zoom: true,
|
|
63695
|
-
zoomWindow: true,
|
|
63696
|
-
// Control bar - camera
|
|
63697
|
-
autoCamera: true,
|
|
63698
|
-
frameScene: true,
|
|
63699
|
-
frameSelection: true,
|
|
63700
|
-
// Control bar - tools
|
|
63701
|
-
sectioningMode: true,
|
|
63702
|
-
measuringMode: true,
|
|
63703
|
-
toggleIsolation: true,
|
|
63704
|
-
// Control bar - settings
|
|
63705
|
-
projectInspector: true,
|
|
63706
|
-
settings: true,
|
|
63707
|
-
help: true,
|
|
63708
|
-
maximise: true
|
|
63709
|
-
}
|
|
63710
|
-
};
|
|
63711
|
-
}
|
|
63712
|
-
function createSettings(settings2) {
|
|
63713
|
-
return settings2 !== void 0 ? deepmerge(getDefaultSettings(), settings2) : getDefaultSettings();
|
|
63714
|
-
}
|
|
63715
63728
|
function getLocalSettings(settings2 = {}) {
|
|
63716
63729
|
try {
|
|
63717
63730
|
const json = localStorage.getItem("viewer.settings");
|
|
@@ -63766,8 +63779,6 @@ function isFalse(value) {
|
|
|
63766
63779
|
}
|
|
63767
63780
|
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
63768
63781
|
__proto__: null,
|
|
63769
|
-
createSettings,
|
|
63770
|
-
getDefaultSettings,
|
|
63771
63782
|
getLocalSettings,
|
|
63772
63783
|
isFalse,
|
|
63773
63784
|
isTrue,
|
|
@@ -67599,7 +67610,7 @@ function getMeasureState(viewer, cursor) {
|
|
|
67599
67610
|
}
|
|
67600
67611
|
const Style = style;
|
|
67601
67612
|
const Ids$2 = controlBarIds;
|
|
67602
|
-
function controlBarSectionBox(section, hasSelection) {
|
|
67613
|
+
function controlBarSectionBox(section, hasSelection, settings2) {
|
|
67603
67614
|
return {
|
|
67604
67615
|
id: Ids$2.sectionSectionBox,
|
|
67605
67616
|
style: section.enable.get() ? Style.sectionNoPadStyle : Style.sectionDefaultStyle,
|
|
@@ -67607,6 +67618,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67607
67618
|
buttons: [
|
|
67608
67619
|
{
|
|
67609
67620
|
id: Ids$2.buttonSectionBoxEnable,
|
|
67621
|
+
enabled: () => isTrue(settings2.sectioningEnable),
|
|
67610
67622
|
tip: "Enable Section Box",
|
|
67611
67623
|
isOn: () => section.enable.get(),
|
|
67612
67624
|
style: (on) => Style.buttonExpandStyle(on),
|
|
@@ -67616,7 +67628,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67616
67628
|
{
|
|
67617
67629
|
id: Ids$2.buttonSectionBoxToSelection,
|
|
67618
67630
|
tip: "Fit Section",
|
|
67619
|
-
enabled: () => section.enable.get(),
|
|
67631
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningFitToSelection),
|
|
67620
67632
|
isOn: () => hasSelection,
|
|
67621
67633
|
style: (on) => Style.buttonDisableStyle(on),
|
|
67622
67634
|
action: () => section.sectionSelection.call(),
|
|
@@ -67625,7 +67637,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67625
67637
|
{
|
|
67626
67638
|
id: Ids$2.buttonSectionBoxToScene,
|
|
67627
67639
|
tip: "Reset Section",
|
|
67628
|
-
enabled: () => section.enable.get(),
|
|
67640
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningReset),
|
|
67629
67641
|
style: (on) => Style.buttonDefaultStyle(on),
|
|
67630
67642
|
action: () => section.sectionScene.call(),
|
|
67631
67643
|
icon: sectionBoxReset
|
|
@@ -67633,7 +67645,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67633
67645
|
{
|
|
67634
67646
|
id: Ids$2.buttonSectionBoxVisible,
|
|
67635
67647
|
tip: "Show Section Box",
|
|
67636
|
-
enabled: () => section.enable.get(),
|
|
67648
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningShow),
|
|
67637
67649
|
isOn: () => section.visible.get(),
|
|
67638
67650
|
style: (on) => Style.buttonDefaultStyle(on),
|
|
67639
67651
|
action: () => section.visible.set(!section.visible.get()),
|
|
@@ -67642,7 +67654,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67642
67654
|
{
|
|
67643
67655
|
id: Ids$2.buttonSectionBoxAuto,
|
|
67644
67656
|
tip: "Auto Section",
|
|
67645
|
-
enabled: () => section.enable.get(),
|
|
67657
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningAuto),
|
|
67646
67658
|
isOn: () => section.auto.get(),
|
|
67647
67659
|
style: (on) => Style.buttonDefaultStyle(on),
|
|
67648
67660
|
action: () => section.auto.set(!section.auto.get()),
|
|
@@ -67651,7 +67663,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67651
67663
|
{
|
|
67652
67664
|
id: Ids$2.buttonSectionBoxSettings,
|
|
67653
67665
|
tip: "Section Settings",
|
|
67654
|
-
enabled: () => section.enable.get(),
|
|
67666
|
+
enabled: () => section.enable.get() && isTrue(settings2.sectioningSettings),
|
|
67655
67667
|
isOn: () => section.showOffsetPanel.get(),
|
|
67656
67668
|
style: (on) => Style.buttonDefaultStyle(on),
|
|
67657
67669
|
action: () => section.showOffsetPanel.set(!section.showOffsetPanel.get()),
|
|
@@ -67669,7 +67681,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67669
67681
|
buttons: [
|
|
67670
67682
|
{
|
|
67671
67683
|
id: Ids$2.buttonCameraOrbit,
|
|
67672
|
-
enabled: () => isTrue(settings2.
|
|
67684
|
+
enabled: () => isTrue(settings2.cursorOrbit),
|
|
67673
67685
|
tip: "Orbit",
|
|
67674
67686
|
action: () => pointer2.onButton(PointerMode$1.ORBIT),
|
|
67675
67687
|
icon: orbit,
|
|
@@ -67678,7 +67690,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67678
67690
|
},
|
|
67679
67691
|
{
|
|
67680
67692
|
id: Ids$2.buttonCameraLook,
|
|
67681
|
-
enabled: () => isTrue(settings2.
|
|
67693
|
+
enabled: () => isTrue(settings2.cursorLookAround),
|
|
67682
67694
|
tip: "Look Around",
|
|
67683
67695
|
action: () => pointer2.onButton(PointerMode$1.LOOK),
|
|
67684
67696
|
icon: look,
|
|
@@ -67687,7 +67699,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67687
67699
|
},
|
|
67688
67700
|
{
|
|
67689
67701
|
id: Ids$2.buttonCameraPan,
|
|
67690
|
-
enabled: () => isTrue(settings2.
|
|
67702
|
+
enabled: () => isTrue(settings2.cursorPan),
|
|
67691
67703
|
tip: "Pan",
|
|
67692
67704
|
action: () => pointer2.onButton(PointerMode$1.PAN),
|
|
67693
67705
|
icon: pan,
|
|
@@ -67696,7 +67708,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67696
67708
|
},
|
|
67697
67709
|
{
|
|
67698
67710
|
id: Ids$2.buttonCameraZoom,
|
|
67699
|
-
enabled: () => isTrue(settings2.
|
|
67711
|
+
enabled: () => isTrue(settings2.cursorZoom),
|
|
67700
67712
|
tip: "Zoom",
|
|
67701
67713
|
action: () => pointer2.onButton(PointerMode$1.ZOOM),
|
|
67702
67714
|
icon: zoom,
|
|
@@ -67706,7 +67718,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67706
67718
|
]
|
|
67707
67719
|
};
|
|
67708
67720
|
}
|
|
67709
|
-
function controlBarMeasure(
|
|
67721
|
+
function controlBarMeasure(measure$1, settings2) {
|
|
67710
67722
|
return {
|
|
67711
67723
|
id: Ids$2.sectionActions,
|
|
67712
67724
|
enable: () => true,
|
|
@@ -67714,7 +67726,7 @@ function controlBarMeasure(settings2, measure$1) {
|
|
|
67714
67726
|
buttons: [
|
|
67715
67727
|
{
|
|
67716
67728
|
id: Ids$2.buttonMeasure,
|
|
67717
|
-
enabled: () => isTrue(settings2.
|
|
67729
|
+
enabled: () => isTrue(settings2.measuringMode),
|
|
67718
67730
|
isOn: () => measure$1.active,
|
|
67719
67731
|
tip: "Measuring Mode",
|
|
67720
67732
|
action: () => measure$1.toggle(),
|
|
@@ -67724,6 +67736,23 @@ function controlBarMeasure(settings2, measure$1) {
|
|
|
67724
67736
|
]
|
|
67725
67737
|
};
|
|
67726
67738
|
}
|
|
67739
|
+
function controlBarSettingsUltra(side, settings$1) {
|
|
67740
|
+
return {
|
|
67741
|
+
id: Ids$2.sectionSettings,
|
|
67742
|
+
enable: () => isTrue(settings$1.ui.settings),
|
|
67743
|
+
style: Style.sectionDefaultStyle,
|
|
67744
|
+
buttons: [
|
|
67745
|
+
{
|
|
67746
|
+
id: Ids$2.buttonSettings,
|
|
67747
|
+
enabled: () => isTrue(settings$1.ui.settings),
|
|
67748
|
+
tip: "Settings",
|
|
67749
|
+
action: () => side.toggleContent("settings"),
|
|
67750
|
+
icon: settings,
|
|
67751
|
+
style: Style.buttonDefaultStyle
|
|
67752
|
+
}
|
|
67753
|
+
]
|
|
67754
|
+
};
|
|
67755
|
+
}
|
|
67727
67756
|
function controlBarSettings(modal, side, settings$1) {
|
|
67728
67757
|
const fullScreen = getFullScreenState();
|
|
67729
67758
|
return {
|
|
@@ -67766,7 +67795,7 @@ function controlBarSettings(modal, side, settings$1) {
|
|
|
67766
67795
|
]
|
|
67767
67796
|
};
|
|
67768
67797
|
}
|
|
67769
|
-
function controlBarCamera(camera2) {
|
|
67798
|
+
function controlBarCamera(camera2, settings2) {
|
|
67770
67799
|
return {
|
|
67771
67800
|
id: Ids$2.sectionCamera,
|
|
67772
67801
|
enable: () => true,
|
|
@@ -67774,6 +67803,7 @@ function controlBarCamera(camera2) {
|
|
|
67774
67803
|
buttons: [
|
|
67775
67804
|
{
|
|
67776
67805
|
id: Ids$2.buttonCameraAuto,
|
|
67806
|
+
enabled: () => isTrue(settings2.cameraAuto),
|
|
67777
67807
|
tip: "Auto Camera",
|
|
67778
67808
|
isOn: () => camera2.autoCamera.get(),
|
|
67779
67809
|
action: () => camera2.autoCamera.set(!camera2.autoCamera.get()),
|
|
@@ -67782,7 +67812,7 @@ function controlBarCamera(camera2) {
|
|
|
67782
67812
|
},
|
|
67783
67813
|
{
|
|
67784
67814
|
id: Ids$2.buttonCameraFrameSelection,
|
|
67785
|
-
|
|
67815
|
+
enabled: () => isTrue(settings2.cameraFrameSelection),
|
|
67786
67816
|
tip: "Frame Selection",
|
|
67787
67817
|
action: () => camera2.frameSelection.call(),
|
|
67788
67818
|
icon: frameSelection,
|
|
@@ -67791,7 +67821,7 @@ function controlBarCamera(camera2) {
|
|
|
67791
67821
|
},
|
|
67792
67822
|
{
|
|
67793
67823
|
id: Ids$2.buttonCameraFrameScene,
|
|
67794
|
-
|
|
67824
|
+
enabled: () => isTrue(settings2.cameraFrameScene),
|
|
67795
67825
|
tip: "Frame All",
|
|
67796
67826
|
action: () => camera2.frameScene.call(),
|
|
67797
67827
|
icon: frameScene,
|
|
@@ -67801,7 +67831,7 @@ function controlBarCamera(camera2) {
|
|
|
67801
67831
|
]
|
|
67802
67832
|
};
|
|
67803
67833
|
}
|
|
67804
|
-
function
|
|
67834
|
+
function controlBarVisibility(isolation, settings2) {
|
|
67805
67835
|
const adapter = isolation.adapter.current;
|
|
67806
67836
|
const someVisible = adapter.hasVisibleSelection() || !adapter.hasHiddenSelection();
|
|
67807
67837
|
return {
|
|
@@ -67811,6 +67841,7 @@ function controlBarSelection(isolation) {
|
|
|
67811
67841
|
buttons: [
|
|
67812
67842
|
{
|
|
67813
67843
|
id: Ids$2.buttonClearSelection,
|
|
67844
|
+
enabled: () => isTrue(settings2.visibilityClearSelection),
|
|
67814
67845
|
tip: "Clear Selection",
|
|
67815
67846
|
action: () => adapter.clearSelection(),
|
|
67816
67847
|
icon: pointer,
|
|
@@ -67820,6 +67851,7 @@ function controlBarSelection(isolation) {
|
|
|
67820
67851
|
{
|
|
67821
67852
|
id: Ids$2.buttonShowAll,
|
|
67822
67853
|
tip: "Show All",
|
|
67854
|
+
enabled: () => isTrue(settings2.visibilityShowAll),
|
|
67823
67855
|
action: () => adapter.showAll(),
|
|
67824
67856
|
icon: showAll,
|
|
67825
67857
|
isOn: () => !isolation.autoIsolate.get() && isolation.visibility.get() !== "all",
|
|
@@ -67827,7 +67859,7 @@ function controlBarSelection(isolation) {
|
|
|
67827
67859
|
},
|
|
67828
67860
|
{
|
|
67829
67861
|
id: Ids$2.buttonHideSelection,
|
|
67830
|
-
enabled: () => someVisible,
|
|
67862
|
+
enabled: () => someVisible && isTrue(settings2.visibilityToggle),
|
|
67831
67863
|
tip: "Hide Selection",
|
|
67832
67864
|
action: () => adapter.hideSelection(),
|
|
67833
67865
|
icon: hideSelection,
|
|
@@ -67836,7 +67868,7 @@ function controlBarSelection(isolation) {
|
|
|
67836
67868
|
},
|
|
67837
67869
|
{
|
|
67838
67870
|
id: Ids$2.buttonShowSelection,
|
|
67839
|
-
enabled: () => !someVisible,
|
|
67871
|
+
enabled: () => !someVisible && isTrue(settings2.visibilityToggle),
|
|
67840
67872
|
tip: "Show Selection",
|
|
67841
67873
|
action: () => adapter.showSelection(),
|
|
67842
67874
|
icon: showSelection,
|
|
@@ -67845,6 +67877,7 @@ function controlBarSelection(isolation) {
|
|
|
67845
67877
|
},
|
|
67846
67878
|
{
|
|
67847
67879
|
id: Ids$2.buttonIsolateSelection,
|
|
67880
|
+
enabled: () => isTrue(settings2.visibilityIsolate),
|
|
67848
67881
|
tip: "Isolate Selection",
|
|
67849
67882
|
action: () => adapter.isolateSelection(),
|
|
67850
67883
|
icon: isolateSelection,
|
|
@@ -67853,6 +67886,7 @@ function controlBarSelection(isolation) {
|
|
|
67853
67886
|
},
|
|
67854
67887
|
{
|
|
67855
67888
|
id: Ids$2.buttonAutoIsolate,
|
|
67889
|
+
enabled: () => isTrue(settings2.visibilityAutoIsolate),
|
|
67856
67890
|
tip: "Auto Isolate",
|
|
67857
67891
|
action: () => isolation.autoIsolate.set(!isolation.autoIsolate.get()),
|
|
67858
67892
|
isOn: () => isolation.autoIsolate.get(),
|
|
@@ -67860,6 +67894,7 @@ function controlBarSelection(isolation) {
|
|
|
67860
67894
|
},
|
|
67861
67895
|
{
|
|
67862
67896
|
id: Ids$2.buttonIsolationSettings,
|
|
67897
|
+
enabled: () => isTrue(settings2.visibilitySettings),
|
|
67863
67898
|
tip: "Isolation Settings",
|
|
67864
67899
|
action: () => isolation.showPanel.set(!isolation.showPanel.get()),
|
|
67865
67900
|
icon: slidersHoriz,
|
|
@@ -67870,25 +67905,19 @@ function controlBarSelection(isolation) {
|
|
|
67870
67905
|
}
|
|
67871
67906
|
function useControlBar(viewer, camera2, modal, side, cursor, settings2, section, isolationRef, customization) {
|
|
67872
67907
|
const measure2 = getMeasureState(viewer, cursor);
|
|
67873
|
-
const pointerSection = controlBarPointer(viewer, camera2, settings2);
|
|
67874
|
-
const actionSection = controlBarMeasure(settings2, measure2);
|
|
67875
|
-
const sectionBoxSection = controlBarSectionBox(section, viewer.selection.any());
|
|
67876
|
-
const settingsSection = controlBarSettings(modal, side, settings2);
|
|
67877
|
-
const cameraSection = controlBarCamera(camera2);
|
|
67878
|
-
const selectionSection = controlBarSelection(isolationRef);
|
|
67879
67908
|
let controlBarSections = [
|
|
67880
|
-
|
|
67881
|
-
|
|
67882
|
-
|
|
67883
|
-
|
|
67884
|
-
|
|
67885
|
-
|
|
67909
|
+
controlBarPointer(viewer, camera2, settings2.ui),
|
|
67910
|
+
controlBarCamera(camera2, settings2.ui),
|
|
67911
|
+
controlBarVisibility(isolationRef, settings2.ui),
|
|
67912
|
+
controlBarMeasure(measure2, settings2.ui),
|
|
67913
|
+
controlBarSectionBox(section, viewer.selection.any(), settings2.ui),
|
|
67914
|
+
controlBarSettings(modal, side, settings2)
|
|
67886
67915
|
];
|
|
67887
67916
|
controlBarSections = (customization == null ? void 0 : customization(controlBarSections)) ?? controlBarSections;
|
|
67888
67917
|
return controlBarSections;
|
|
67889
67918
|
}
|
|
67890
67919
|
function anyUiCursorButton(settings2) {
|
|
67891
|
-
return isTrue(settings2.
|
|
67920
|
+
return isTrue(settings2.cursorOrbit) || isTrue(settings2.cursorLookAround) || isTrue(settings2.cursorPan) || isTrue(settings2.cursorZoom);
|
|
67892
67921
|
}
|
|
67893
67922
|
function anyUiSettingButton(settings2) {
|
|
67894
67923
|
return isTrue(settings2.ui.projectInspector) || isTrue(settings2.ui.settings) || isTrue(settings2.ui.help) || isTrue(settings2.ui.maximise);
|
|
@@ -73903,7 +73932,7 @@ function SidePanel(props) {
|
|
|
73903
73932
|
} else {
|
|
73904
73933
|
props.container.gfx.style.left = "0px";
|
|
73905
73934
|
}
|
|
73906
|
-
props.viewer.viewport.
|
|
73935
|
+
props.viewer.viewport.resizeToParent();
|
|
73907
73936
|
};
|
|
73908
73937
|
const getMaxSize = () => {
|
|
73909
73938
|
return props.container.root.clientWidth * MAX_WIDTH;
|
|
@@ -73962,7 +73991,10 @@ function SidePanel(props) {
|
|
|
73962
73991
|
style: {
|
|
73963
73992
|
position: "absolute"
|
|
73964
73993
|
},
|
|
73965
|
-
className: `vim-side-panel vc-top-0 vc-left-0 vc-z-20
|
|
73994
|
+
className: `vim-side-panel vc-top-0 vc-left-0 vc-z-20
|
|
73995
|
+
vc-bg-gray-lightest vc-text-gray-darker
|
|
73996
|
+
vc-border-r vc-border-gray-light
|
|
73997
|
+
${props.side.getContent() !== "none" ? "" : "vc-hidden"}`,
|
|
73966
73998
|
children: [
|
|
73967
73999
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73968
74000
|
"button",
|
|
@@ -74045,180 +74077,6 @@ function useSideState(useInspector, defaultWidth) {
|
|
|
74045
74077
|
[side, width]
|
|
74046
74078
|
);
|
|
74047
74079
|
}
|
|
74048
|
-
function SettingsPanel(props) {
|
|
74049
|
-
if (!props.visible) return null;
|
|
74050
|
-
const toggleElement = (label, state, action) => {
|
|
74051
|
-
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: [
|
|
74052
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74053
|
-
"input",
|
|
74054
|
-
{
|
|
74055
|
-
type: "checkbox",
|
|
74056
|
-
checked: state,
|
|
74057
|
-
onChange: action,
|
|
74058
|
-
className: "vim-settings-checkbox vc-checked:bg-primary-royal vc-mr-2 vc-rounded vc-border vc-border-gray-medium "
|
|
74059
|
-
}
|
|
74060
|
-
),
|
|
74061
|
-
" ",
|
|
74062
|
-
label
|
|
74063
|
-
] });
|
|
74064
|
-
};
|
|
74065
|
-
const settingsToggle = (label, getter, setter) => {
|
|
74066
|
-
const value = getter(props.settings.value);
|
|
74067
|
-
if (value === "AlwaysTrue" || value === "AlwaysFalse") {
|
|
74068
|
-
return null;
|
|
74069
|
-
}
|
|
74070
|
-
return toggleElement(label, value, () => {
|
|
74071
|
-
const value2 = getter(props.settings.value);
|
|
74072
|
-
props.settings.update((s) => setter(s, !value2));
|
|
74073
|
-
});
|
|
74074
|
-
};
|
|
74075
|
-
const settingsBox = (label, info, transform, getter, setter) => {
|
|
74076
|
-
const ref = React__default.useRef(null);
|
|
74077
|
-
useEffect(() => {
|
|
74078
|
-
ref.current.value = props.viewer.inputs.scrollSpeed.toFixed(2);
|
|
74079
|
-
}, []);
|
|
74080
|
-
getter(props.settings.value).toString();
|
|
74081
|
-
const update = (event) => {
|
|
74082
|
-
const str = event.target.value;
|
|
74083
|
-
const n = Number.parseFloat(str);
|
|
74084
|
-
if (Number.isNaN(n)) {
|
|
74085
|
-
event.target.value = getter(props.settings.value).toString();
|
|
74086
|
-
} else {
|
|
74087
|
-
const value2 = transform(n);
|
|
74088
|
-
event.target.value = value2.toString();
|
|
74089
|
-
props.settings.update((s) => setter(s, value2));
|
|
74090
|
-
}
|
|
74091
|
-
};
|
|
74092
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-box-input vc-my-1", children: [
|
|
74093
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2", children: [
|
|
74094
|
-
label,
|
|
74095
|
-
":"
|
|
74096
|
-
] }),
|
|
74097
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { ref, type: "text", className: "vim-settings-textbox vc-w-14 vc-ml-1 vc-p-1", onBlur: (e) => update(e) }),
|
|
74098
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2 vc-text-gray vc-ml-1", children: info })
|
|
74099
|
-
] });
|
|
74100
|
-
};
|
|
74101
|
-
function settingsSubtitle(title2) {
|
|
74102
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-subtitle", children: title2 });
|
|
74103
|
-
}
|
|
74104
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
74105
|
-
"div",
|
|
74106
|
-
{
|
|
74107
|
-
className: "vc-absolute vc-inset-0",
|
|
74108
|
-
children: [
|
|
74109
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-title", children: "Settings " }),
|
|
74110
|
-
/* @__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: [
|
|
74111
|
-
settingsSubtitle("Inputs"),
|
|
74112
|
-
settingsBox(
|
|
74113
|
-
"Scroll Speed",
|
|
74114
|
-
"[0.1,10]",
|
|
74115
|
-
(n) => MathUtils.clamp(n, 0.1, 10),
|
|
74116
|
-
(s) => props.viewer.inputs.scrollSpeed,
|
|
74117
|
-
(s, v) => {
|
|
74118
|
-
props.viewer.inputs.scrollSpeed = v;
|
|
74119
|
-
}
|
|
74120
|
-
),
|
|
74121
|
-
settingsSubtitle("Panels"),
|
|
74122
|
-
settingsToggle(
|
|
74123
|
-
"Show Logo",
|
|
74124
|
-
(settings2) => settings2.ui.logo,
|
|
74125
|
-
(settings2, value) => settings2.ui.logo = value
|
|
74126
|
-
),
|
|
74127
|
-
settingsToggle(
|
|
74128
|
-
"Show Bim Tree",
|
|
74129
|
-
(settings2) => settings2.ui.bimTreePanel,
|
|
74130
|
-
(settings2, value) => settings2.ui.bimTreePanel = value
|
|
74131
|
-
),
|
|
74132
|
-
settingsToggle(
|
|
74133
|
-
"Show Bim Info",
|
|
74134
|
-
(settings2) => settings2.ui.bimInfoPanel,
|
|
74135
|
-
(settings2, value) => settings2.ui.bimInfoPanel = value
|
|
74136
|
-
),
|
|
74137
|
-
settingsToggle(
|
|
74138
|
-
"Show Axes Panel",
|
|
74139
|
-
(settings2) => settings2.ui.axesPanel,
|
|
74140
|
-
(settings2, value) => settings2.ui.axesPanel = value
|
|
74141
|
-
),
|
|
74142
|
-
settingsToggle(
|
|
74143
|
-
"Show Performance Panel",
|
|
74144
|
-
(settings2) => settings2.ui.performance,
|
|
74145
|
-
(settings2, value) => settings2.ui.performance = value
|
|
74146
|
-
),
|
|
74147
|
-
settingsSubtitle("Axes"),
|
|
74148
|
-
settingsToggle(
|
|
74149
|
-
"Show Orthographic Button",
|
|
74150
|
-
(settings2) => settings2.ui.orthographic,
|
|
74151
|
-
(settings2, value) => settings2.ui.orthographic = value
|
|
74152
|
-
),
|
|
74153
|
-
settingsToggle(
|
|
74154
|
-
"Show Reset Camera Button",
|
|
74155
|
-
(settings2) => settings2.ui.resetCamera,
|
|
74156
|
-
(settings2, value) => settings2.ui.resetCamera = value
|
|
74157
|
-
),
|
|
74158
|
-
settingsSubtitle("Control Bar"),
|
|
74159
|
-
settingsToggle(
|
|
74160
|
-
"Show Control Bar",
|
|
74161
|
-
(settings2) => settings2.ui.controlBar,
|
|
74162
|
-
(settings2, value) => settings2.ui.controlBar = value
|
|
74163
|
-
),
|
|
74164
|
-
settingsSubtitle("Control Bar - Cursors"),
|
|
74165
|
-
settingsToggle(
|
|
74166
|
-
"Show Orbit Button",
|
|
74167
|
-
(settings2) => settings2.ui.orbit,
|
|
74168
|
-
(settings2, value) => settings2.ui.orbit = value
|
|
74169
|
-
),
|
|
74170
|
-
settingsToggle(
|
|
74171
|
-
"Show Look Around Button",
|
|
74172
|
-
(settings2) => settings2.ui.lookAround,
|
|
74173
|
-
(settings2, value) => settings2.ui.lookAround = value
|
|
74174
|
-
),
|
|
74175
|
-
settingsToggle(
|
|
74176
|
-
"Show Pan Button",
|
|
74177
|
-
(settings2) => settings2.ui.pan,
|
|
74178
|
-
(settings2, value) => settings2.ui.pan = value
|
|
74179
|
-
),
|
|
74180
|
-
settingsToggle(
|
|
74181
|
-
"Show Zoom Button",
|
|
74182
|
-
(settings2) => settings2.ui.zoom,
|
|
74183
|
-
(settings2, value) => settings2.ui.zoom = value
|
|
74184
|
-
),
|
|
74185
|
-
settingsToggle(
|
|
74186
|
-
"Show Zoom Window Button",
|
|
74187
|
-
(settings2) => settings2.ui.zoomWindow,
|
|
74188
|
-
(settings2, value) => settings2.ui.zoomWindow = value
|
|
74189
|
-
),
|
|
74190
|
-
settingsSubtitle("Control Bar - Tools"),
|
|
74191
|
-
settingsToggle(
|
|
74192
|
-
"Show Measuring Mode Button",
|
|
74193
|
-
(settings2) => settings2.ui.measuringMode,
|
|
74194
|
-
(settings2, value) => settings2.ui.measuringMode = value
|
|
74195
|
-
),
|
|
74196
|
-
settingsSubtitle("Control Bar - Settings"),
|
|
74197
|
-
settingsToggle(
|
|
74198
|
-
"Show Project Inspector Button",
|
|
74199
|
-
(settings2) => settings2.ui.projectInspector,
|
|
74200
|
-
(settings2, value) => settings2.ui.projectInspector = value
|
|
74201
|
-
),
|
|
74202
|
-
settingsToggle(
|
|
74203
|
-
"Show Settings Button",
|
|
74204
|
-
(settings2) => settings2.ui.settings,
|
|
74205
|
-
(settings2, value) => settings2.ui.settings = value
|
|
74206
|
-
),
|
|
74207
|
-
settingsToggle(
|
|
74208
|
-
"Show Help Button",
|
|
74209
|
-
(settings2) => settings2.ui.help,
|
|
74210
|
-
(settings2, value) => settings2.ui.help = value
|
|
74211
|
-
),
|
|
74212
|
-
settingsToggle(
|
|
74213
|
-
"Show Maximise Button",
|
|
74214
|
-
(settings2) => settings2.ui.maximise,
|
|
74215
|
-
(settings2, value) => settings2.ui.maximise = value
|
|
74216
|
-
)
|
|
74217
|
-
] })
|
|
74218
|
-
]
|
|
74219
|
-
}
|
|
74220
|
-
);
|
|
74221
|
-
}
|
|
74222
74080
|
const MenuToastMemo = React__default.memo(MenuToast);
|
|
74223
74081
|
function MenuToast(props) {
|
|
74224
74082
|
const [visible2, setVisible] = useState();
|
|
@@ -74383,118 +74241,6 @@ function applyWebglBindings(viewer, camera2, isolation, sideState) {
|
|
|
74383
74241
|
}
|
|
74384
74242
|
});
|
|
74385
74243
|
}
|
|
74386
|
-
function useSettings(viewer, value) {
|
|
74387
|
-
const merged = createSettings(value);
|
|
74388
|
-
const [settings2, setSettings] = useState(merged);
|
|
74389
|
-
const onUpdate = useRef();
|
|
74390
|
-
const update = function(updater) {
|
|
74391
|
-
var _a3;
|
|
74392
|
-
const next = { ...settings2 };
|
|
74393
|
-
updater(next);
|
|
74394
|
-
saveSettingsToLocal(next);
|
|
74395
|
-
setSettings(next);
|
|
74396
|
-
(_a3 = onUpdate.current) == null ? void 0 : _a3.call(onUpdate, next);
|
|
74397
|
-
};
|
|
74398
|
-
useEffect(() => {
|
|
74399
|
-
applySettings(viewer, settings2);
|
|
74400
|
-
}, []);
|
|
74401
|
-
useEffect(() => {
|
|
74402
|
-
applySettings(viewer, settings2);
|
|
74403
|
-
}, [settings2]);
|
|
74404
|
-
return useMemo(
|
|
74405
|
-
() => ({
|
|
74406
|
-
value: settings2,
|
|
74407
|
-
update,
|
|
74408
|
-
register: (v) => onUpdate.current = v
|
|
74409
|
-
}),
|
|
74410
|
-
[settings2]
|
|
74411
|
-
);
|
|
74412
|
-
}
|
|
74413
|
-
function applySettings(viewer, settings2) {
|
|
74414
|
-
const performance2 = document.getElementsByClassName("vim-performance-div")[0];
|
|
74415
|
-
if (performance2) {
|
|
74416
|
-
if (isTrue(settings2.ui.performance)) {
|
|
74417
|
-
performance2.classList.remove("vc-hidden");
|
|
74418
|
-
} else {
|
|
74419
|
-
performance2.classList.add("vc-hidden");
|
|
74420
|
-
}
|
|
74421
|
-
}
|
|
74422
|
-
}
|
|
74423
|
-
function createContainer(element) {
|
|
74424
|
-
let root = element;
|
|
74425
|
-
if (root === void 0) {
|
|
74426
|
-
root = document.createElement("div");
|
|
74427
|
-
document.body.append(root);
|
|
74428
|
-
root.classList.add("vc-inset-0");
|
|
74429
|
-
}
|
|
74430
|
-
root.style.position = "absolute";
|
|
74431
|
-
root.classList.add("vim-component");
|
|
74432
|
-
const gfx = document.createElement("div");
|
|
74433
|
-
gfx.className = "vim-gfx vc-absolute vc-inset-0 vc-pointer-events-none";
|
|
74434
|
-
const ui = document.createElement("div");
|
|
74435
|
-
ui.className = "vim-ui vc-absolute vc-inset-0";
|
|
74436
|
-
root.append(gfx);
|
|
74437
|
-
root.append(ui);
|
|
74438
|
-
const dispose = () => {
|
|
74439
|
-
if (element === void 0) {
|
|
74440
|
-
root.remove();
|
|
74441
|
-
} else {
|
|
74442
|
-
root.classList.remove("vim-component");
|
|
74443
|
-
gfx.remove();
|
|
74444
|
-
ui.remove();
|
|
74445
|
-
}
|
|
74446
|
-
};
|
|
74447
|
-
return { root, ui, gfx, dispose };
|
|
74448
|
-
}
|
|
74449
|
-
async function getElements(vim) {
|
|
74450
|
-
var _a3, _b2, _c, _d, _e;
|
|
74451
|
-
if (!vim.bim) return [];
|
|
74452
|
-
const [elements, bimDocument, category, levels, worksets] = await Promise.all(
|
|
74453
|
-
[
|
|
74454
|
-
(_a3 = vim.bim.element) == null ? void 0 : _a3.getAll(),
|
|
74455
|
-
(_b2 = vim.bim.bimDocument) == null ? void 0 : _b2.getAllTitle(),
|
|
74456
|
-
(_c = vim.bim.category) == null ? void 0 : _c.getAllName(),
|
|
74457
|
-
(_d = vim.bim.level) == null ? void 0 : _d.getAllElementIndex(),
|
|
74458
|
-
(_e = vim.bim.workset) == null ? void 0 : _e.getAllName()
|
|
74459
|
-
]
|
|
74460
|
-
);
|
|
74461
|
-
const familyTypeMap = await getFamilyTypeNameMap(vim.bim);
|
|
74462
|
-
if (!elements) return void 0;
|
|
74463
|
-
const result = elements.map((e) => {
|
|
74464
|
-
var _a4;
|
|
74465
|
-
return {
|
|
74466
|
-
...e,
|
|
74467
|
-
bimDocumentName: bimDocument ? bimDocument[e.bimDocumentIndex] : void 0,
|
|
74468
|
-
categoryName: category ? category[e.categoryIndex] : void 0,
|
|
74469
|
-
familyTypeName: familyTypeMap.get(e.index),
|
|
74470
|
-
levelName: levels ? (_a4 = elements[levels[(e == null ? void 0 : e.levelIndex) ?? -1]]) == null ? void 0 : _a4.name : void 0,
|
|
74471
|
-
worksetName: worksets ? worksets[(e == null ? void 0 : e.worksetIndex) ?? -1] : void 0
|
|
74472
|
-
};
|
|
74473
|
-
});
|
|
74474
|
-
const real = result.filter((e) => vim.getElementFromIndex(e.index).hasMesh);
|
|
74475
|
-
return real;
|
|
74476
|
-
}
|
|
74477
|
-
async function getFamilyTypeNameMap(document2) {
|
|
74478
|
-
const [
|
|
74479
|
-
familyInstanceElement,
|
|
74480
|
-
familyInstanceFamilyType,
|
|
74481
|
-
familyTypeElement,
|
|
74482
|
-
elementName
|
|
74483
|
-
] = await Promise.all([
|
|
74484
|
-
document2.familyInstance.getAllElementIndex(),
|
|
74485
|
-
document2.familyInstance.getAllFamilyTypeIndex(),
|
|
74486
|
-
document2.familyType.getAllElementIndex(),
|
|
74487
|
-
document2.element.getAllName()
|
|
74488
|
-
]);
|
|
74489
|
-
return new Map(
|
|
74490
|
-
familyInstanceElement.map((e, i) => {
|
|
74491
|
-
const familyType = familyInstanceFamilyType == null ? void 0 : familyInstanceFamilyType[i];
|
|
74492
|
-
const element = Number.isInteger(familyType) ? familyTypeElement[familyType] : void 0;
|
|
74493
|
-
const name = Number.isInteger(element) ? elementName == null ? void 0 : elementName[element] : void 0;
|
|
74494
|
-
return [e, name];
|
|
74495
|
-
})
|
|
74496
|
-
);
|
|
74497
|
-
}
|
|
74498
74244
|
class MutableState {
|
|
74499
74245
|
constructor(initial) {
|
|
74500
74246
|
__publicField(this, "_value");
|
|
@@ -74523,24 +74269,28 @@ function useRefresher() {
|
|
|
74523
74269
|
}
|
|
74524
74270
|
};
|
|
74525
74271
|
}
|
|
74526
|
-
function useStateRef(initialValue) {
|
|
74527
|
-
const
|
|
74272
|
+
function useStateRef(initialValue, isLazy = false) {
|
|
74273
|
+
const getInitialValue = () => {
|
|
74274
|
+
if (isLazy && typeof initialValue === "function") {
|
|
74275
|
+
return initialValue();
|
|
74276
|
+
}
|
|
74277
|
+
return initialValue;
|
|
74278
|
+
};
|
|
74279
|
+
const [box, setBox] = useState(() => ({
|
|
74280
|
+
current: getInitialValue()
|
|
74281
|
+
}));
|
|
74528
74282
|
const ref = useRef(void 0);
|
|
74529
74283
|
if (ref.current === void 0) {
|
|
74530
|
-
|
|
74531
|
-
ref.current = initialValue();
|
|
74532
|
-
} else {
|
|
74533
|
-
ref.current = initialValue;
|
|
74534
|
-
}
|
|
74284
|
+
ref.current = getInitialValue();
|
|
74535
74285
|
}
|
|
74536
74286
|
const event = useRef(new distExports.SimpleEventDispatcher());
|
|
74537
74287
|
const validate = useRef((next, current) => next);
|
|
74538
|
-
const confirm = useRef((
|
|
74539
|
-
const set3 = (
|
|
74540
|
-
const finalValue = validate.current(
|
|
74288
|
+
const confirm = useRef((value) => value);
|
|
74289
|
+
const set3 = (value) => {
|
|
74290
|
+
const finalValue = validate.current(value, ref.current);
|
|
74541
74291
|
if (finalValue === ref.current) return;
|
|
74542
74292
|
ref.current = finalValue;
|
|
74543
|
-
|
|
74293
|
+
setBox({ current: finalValue });
|
|
74544
74294
|
event.current.dispatch(finalValue);
|
|
74545
74295
|
};
|
|
74546
74296
|
return {
|
|
@@ -74566,8 +74316,8 @@ function useStateRef(initialValue) {
|
|
|
74566
74316
|
*/
|
|
74567
74317
|
useOnChange(on) {
|
|
74568
74318
|
useEffect(() => {
|
|
74569
|
-
return event.current.subscribe((
|
|
74570
|
-
const result = on(
|
|
74319
|
+
return event.current.subscribe((value) => {
|
|
74320
|
+
const result = on(value);
|
|
74571
74321
|
if (result instanceof Promise) {
|
|
74572
74322
|
result.catch(console.error);
|
|
74573
74323
|
}
|
|
@@ -74581,7 +74331,7 @@ function useStateRef(initialValue) {
|
|
|
74581
74331
|
* @returns The memoized value.
|
|
74582
74332
|
*/
|
|
74583
74333
|
useMemo(on, deps) {
|
|
74584
|
-
return useMemo(() => on(
|
|
74334
|
+
return useMemo(() => on(box.current), [...deps || [], box.current]);
|
|
74585
74335
|
},
|
|
74586
74336
|
/**
|
|
74587
74337
|
* Sets a validation function to process any new state value before updating.
|
|
@@ -74758,38 +74508,146 @@ const reactUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
74758
74508
|
useRefresher,
|
|
74759
74509
|
useStateRef
|
|
74760
74510
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
74761
|
-
function
|
|
74762
|
-
|
|
74511
|
+
function useSettings(value, defaultSettings, applySettings = () => {
|
|
74512
|
+
}) {
|
|
74513
|
+
const merged = createSettings(value, defaultSettings);
|
|
74514
|
+
const [settings2, setSettings] = useState(merged);
|
|
74515
|
+
const onUpdate = useRef();
|
|
74516
|
+
const customizer = useStateRef((settings22) => settings22);
|
|
74517
|
+
const update = function(updater) {
|
|
74763
74518
|
var _a3;
|
|
74764
|
-
const
|
|
74765
|
-
|
|
74766
|
-
|
|
74767
|
-
|
|
74768
|
-
|
|
74769
|
-
};
|
|
74770
|
-
const vim = useStateRef(getVim());
|
|
74771
|
-
const selection = useStateRef(getSelection());
|
|
74772
|
-
const allElements = useStateRef([]);
|
|
74773
|
-
const filteredElements = useStateRef([]);
|
|
74774
|
-
const filter2 = useStateRef("");
|
|
74775
|
-
const applyFilter = () => {
|
|
74776
|
-
const filtered = filterElements(allElements.get(), filter2.get());
|
|
74777
|
-
filteredElements.set(filtered);
|
|
74519
|
+
const next = { ...settings2 };
|
|
74520
|
+
updater(next);
|
|
74521
|
+
saveSettingsToLocal(next);
|
|
74522
|
+
setSettings(next);
|
|
74523
|
+
(_a3 = onUpdate.current) == null ? void 0 : _a3.call(onUpdate, next);
|
|
74778
74524
|
};
|
|
74779
|
-
vim.useOnChange(async (v) => {
|
|
74780
|
-
const elements = await getElements(v);
|
|
74781
|
-
allElements.set(elements);
|
|
74782
|
-
});
|
|
74783
|
-
filter2.useOnChange((f) => {
|
|
74784
|
-
applyFilter();
|
|
74785
|
-
});
|
|
74786
|
-
allElements.useOnChange((elements) => {
|
|
74787
|
-
applyFilter();
|
|
74788
|
-
});
|
|
74789
74525
|
useEffect(() => {
|
|
74790
|
-
|
|
74791
|
-
|
|
74792
|
-
|
|
74526
|
+
applySettings(settings2);
|
|
74527
|
+
}, []);
|
|
74528
|
+
useEffect(() => {
|
|
74529
|
+
applySettings(settings2);
|
|
74530
|
+
}, [settings2]);
|
|
74531
|
+
return useMemo(
|
|
74532
|
+
() => ({
|
|
74533
|
+
value: settings2,
|
|
74534
|
+
update,
|
|
74535
|
+
register: (v) => onUpdate.current = v,
|
|
74536
|
+
customizer
|
|
74537
|
+
}),
|
|
74538
|
+
[settings2]
|
|
74539
|
+
);
|
|
74540
|
+
}
|
|
74541
|
+
function createSettings(settings2, defaultSettings) {
|
|
74542
|
+
return settings2 !== void 0 ? deepmerge(defaultSettings, settings2) : defaultSettings;
|
|
74543
|
+
}
|
|
74544
|
+
function createContainer(element) {
|
|
74545
|
+
let root = element;
|
|
74546
|
+
if (root === void 0) {
|
|
74547
|
+
root = document.createElement("div");
|
|
74548
|
+
document.body.append(root);
|
|
74549
|
+
root.classList.add("vc-inset-0");
|
|
74550
|
+
}
|
|
74551
|
+
root.style.position = "absolute";
|
|
74552
|
+
root.classList.add("vim-component");
|
|
74553
|
+
const gfx = document.createElement("div");
|
|
74554
|
+
gfx.className = "vim-gfx vc-absolute vc-inset-0 vc-pointer-events-none";
|
|
74555
|
+
const ui = document.createElement("div");
|
|
74556
|
+
ui.className = "vim-ui vc-absolute vc-inset-0";
|
|
74557
|
+
root.append(gfx);
|
|
74558
|
+
root.append(ui);
|
|
74559
|
+
const dispose = () => {
|
|
74560
|
+
if (element === void 0) {
|
|
74561
|
+
root.remove();
|
|
74562
|
+
} else {
|
|
74563
|
+
root.classList.remove("vim-component");
|
|
74564
|
+
gfx.remove();
|
|
74565
|
+
ui.remove();
|
|
74566
|
+
}
|
|
74567
|
+
};
|
|
74568
|
+
return { root, ui, gfx, dispose };
|
|
74569
|
+
}
|
|
74570
|
+
async function getElements(vim) {
|
|
74571
|
+
var _a3, _b2, _c, _d, _e;
|
|
74572
|
+
if (!vim.bim) return [];
|
|
74573
|
+
const [elements, bimDocument, category, levels, worksets] = await Promise.all(
|
|
74574
|
+
[
|
|
74575
|
+
(_a3 = vim.bim.element) == null ? void 0 : _a3.getAll(),
|
|
74576
|
+
(_b2 = vim.bim.bimDocument) == null ? void 0 : _b2.getAllTitle(),
|
|
74577
|
+
(_c = vim.bim.category) == null ? void 0 : _c.getAllName(),
|
|
74578
|
+
(_d = vim.bim.level) == null ? void 0 : _d.getAllElementIndex(),
|
|
74579
|
+
(_e = vim.bim.workset) == null ? void 0 : _e.getAllName()
|
|
74580
|
+
]
|
|
74581
|
+
);
|
|
74582
|
+
const familyTypeMap = await getFamilyTypeNameMap(vim.bim);
|
|
74583
|
+
if (!elements) return void 0;
|
|
74584
|
+
const result = elements.map((e) => {
|
|
74585
|
+
var _a4;
|
|
74586
|
+
return {
|
|
74587
|
+
...e,
|
|
74588
|
+
bimDocumentName: bimDocument ? bimDocument[e.bimDocumentIndex] : void 0,
|
|
74589
|
+
categoryName: category ? category[e.categoryIndex] : void 0,
|
|
74590
|
+
familyTypeName: familyTypeMap.get(e.index),
|
|
74591
|
+
levelName: levels ? (_a4 = elements[levels[(e == null ? void 0 : e.levelIndex) ?? -1]]) == null ? void 0 : _a4.name : void 0,
|
|
74592
|
+
worksetName: worksets ? worksets[(e == null ? void 0 : e.worksetIndex) ?? -1] : void 0
|
|
74593
|
+
};
|
|
74594
|
+
});
|
|
74595
|
+
const real = result.filter((e) => vim.getElementFromIndex(e.index).hasMesh);
|
|
74596
|
+
return real;
|
|
74597
|
+
}
|
|
74598
|
+
async function getFamilyTypeNameMap(document2) {
|
|
74599
|
+
const [
|
|
74600
|
+
familyInstanceElement,
|
|
74601
|
+
familyInstanceFamilyType,
|
|
74602
|
+
familyTypeElement,
|
|
74603
|
+
elementName
|
|
74604
|
+
] = await Promise.all([
|
|
74605
|
+
document2.familyInstance.getAllElementIndex(),
|
|
74606
|
+
document2.familyInstance.getAllFamilyTypeIndex(),
|
|
74607
|
+
document2.familyType.getAllElementIndex(),
|
|
74608
|
+
document2.element.getAllName()
|
|
74609
|
+
]);
|
|
74610
|
+
return new Map(
|
|
74611
|
+
familyInstanceElement.map((e, i) => {
|
|
74612
|
+
const familyType = familyInstanceFamilyType == null ? void 0 : familyInstanceFamilyType[i];
|
|
74613
|
+
const element = Number.isInteger(familyType) ? familyTypeElement[familyType] : void 0;
|
|
74614
|
+
const name = Number.isInteger(element) ? elementName == null ? void 0 : elementName[element] : void 0;
|
|
74615
|
+
return [e, name];
|
|
74616
|
+
})
|
|
74617
|
+
);
|
|
74618
|
+
}
|
|
74619
|
+
function useViewerState(viewer) {
|
|
74620
|
+
const getVim = () => {
|
|
74621
|
+
var _a3;
|
|
74622
|
+
const v = (_a3 = viewer.vims) == null ? void 0 : _a3[0];
|
|
74623
|
+
return v;
|
|
74624
|
+
};
|
|
74625
|
+
const getSelection = () => {
|
|
74626
|
+
return [...viewer.selection.getAll()].filter((o) => o.type === "Element3D");
|
|
74627
|
+
};
|
|
74628
|
+
const vim = useStateRef(getVim());
|
|
74629
|
+
const selection = useStateRef(getSelection());
|
|
74630
|
+
const allElements = useStateRef([]);
|
|
74631
|
+
const filteredElements = useStateRef([]);
|
|
74632
|
+
const filter2 = useStateRef("");
|
|
74633
|
+
const applyFilter = () => {
|
|
74634
|
+
const filtered = filterElements(allElements.get(), filter2.get());
|
|
74635
|
+
filteredElements.set(filtered);
|
|
74636
|
+
};
|
|
74637
|
+
vim.useOnChange(async (v) => {
|
|
74638
|
+
const elements = await getElements(v);
|
|
74639
|
+
allElements.set(elements);
|
|
74640
|
+
});
|
|
74641
|
+
filter2.useOnChange((f) => {
|
|
74642
|
+
applyFilter();
|
|
74643
|
+
});
|
|
74644
|
+
allElements.useOnChange((elements) => {
|
|
74645
|
+
applyFilter();
|
|
74646
|
+
});
|
|
74647
|
+
useEffect(() => {
|
|
74648
|
+
const subLoad = viewer.onVimLoaded.subscribe(() => {
|
|
74649
|
+
vim.set(getVim());
|
|
74650
|
+
});
|
|
74793
74651
|
const subSelect = viewer.selection.onSelectionChanged.subscribe(() => {
|
|
74794
74652
|
selection.set(getSelection());
|
|
74795
74653
|
});
|
|
@@ -74899,12 +74757,8 @@ const vcColorLink = "vc-text-[#0590CC]";
|
|
|
74899
74757
|
const vcLink = `${vcColorLink} vc-underline`;
|
|
74900
74758
|
const vcLabel = "vc-text-[#3F444F]";
|
|
74901
74759
|
const vcRoboto = "vc-font-['Roboto',sans-serif]";
|
|
74902
|
-
function footer$1(
|
|
74903
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
74904
|
-
"More troubleshooting tips can be found",
|
|
74905
|
-
" ",
|
|
74906
|
-
link(url, "here")
|
|
74907
|
-
] });
|
|
74760
|
+
function footer$1() {
|
|
74761
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
74908
74762
|
}
|
|
74909
74763
|
function mainText(text) {
|
|
74910
74764
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `vim-main-text vc-text-base ${vcColorPrimary} vc-mb-4 vc-font-normal`, children: text });
|
|
@@ -74952,20 +74806,11 @@ const errorStyle = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
74952
74806
|
vcLink,
|
|
74953
74807
|
vcRoboto
|
|
74954
74808
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
74955
|
-
const support = "https://docs.vimaec.com";
|
|
74956
|
-
const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
|
|
74957
|
-
const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
|
|
74958
|
-
const urls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74959
|
-
__proto__: null,
|
|
74960
|
-
support,
|
|
74961
|
-
supportControls,
|
|
74962
|
-
supportUltra
|
|
74963
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
74964
74809
|
function fileOpeningError(url) {
|
|
74965
74810
|
return {
|
|
74966
74811
|
title: "File Opening Error",
|
|
74967
74812
|
body: serverFileOpeningErrorBody(url),
|
|
74968
|
-
footer: footer$1(
|
|
74813
|
+
footer: footer$1(),
|
|
74969
74814
|
canClose: false
|
|
74970
74815
|
};
|
|
74971
74816
|
}
|
|
@@ -74987,7 +74832,7 @@ function serverFileDownloadingError(url, authToken, server) {
|
|
|
74987
74832
|
return {
|
|
74988
74833
|
title: "File Downloading Error",
|
|
74989
74834
|
body: body$5(url, authToken, server),
|
|
74990
|
-
footer: footer$1(
|
|
74835
|
+
footer: footer$1(),
|
|
74991
74836
|
canClose: false
|
|
74992
74837
|
};
|
|
74993
74838
|
}
|
|
@@ -75016,7 +74861,7 @@ function serverFileLoadingError(url) {
|
|
|
75016
74861
|
return {
|
|
75017
74862
|
title: "File Loading Error",
|
|
75018
74863
|
body: body$4(url),
|
|
75019
|
-
footer: footer$1(
|
|
74864
|
+
footer: footer$1(),
|
|
75020
74865
|
canClose: false
|
|
75021
74866
|
};
|
|
75022
74867
|
}
|
|
@@ -75036,11 +74881,18 @@ function body$4(url) {
|
|
|
75036
74881
|
])
|
|
75037
74882
|
] });
|
|
75038
74883
|
}
|
|
74884
|
+
const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
|
|
74885
|
+
const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
|
|
74886
|
+
const urls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74887
|
+
__proto__: null,
|
|
74888
|
+
supportControls,
|
|
74889
|
+
supportUltra
|
|
74890
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
75039
74891
|
function serverConnectionError(url) {
|
|
75040
74892
|
return {
|
|
75041
74893
|
title: "Connection Error",
|
|
75042
74894
|
body: body$3(url, isLocalUrl(url)),
|
|
75043
|
-
footer: footer$1(
|
|
74895
|
+
footer: footer$1(),
|
|
75044
74896
|
canClose: false
|
|
75045
74897
|
};
|
|
75046
74898
|
}
|
|
@@ -75070,7 +74922,7 @@ function serverCompatibilityError(url, localVersion, remoteVersion) {
|
|
|
75070
74922
|
return {
|
|
75071
74923
|
title: "Compatibility Error",
|
|
75072
74924
|
body: body$2(url, localVersion, remoteVersion),
|
|
75073
|
-
footer: footer$1(
|
|
74925
|
+
footer: footer$1(),
|
|
75074
74926
|
canClose: false
|
|
75075
74927
|
};
|
|
75076
74928
|
}
|
|
@@ -75099,7 +74951,7 @@ function serverStreamError(url) {
|
|
|
75099
74951
|
return {
|
|
75100
74952
|
title: "Stream Error",
|
|
75101
74953
|
body: body$1(),
|
|
75102
|
-
footer: footer$1(
|
|
74954
|
+
footer: footer$1(),
|
|
75103
74955
|
canClose: false
|
|
75104
74956
|
};
|
|
75105
74957
|
}
|
|
@@ -75876,7 +75728,8 @@ function useViewerInput(handler, camera2) {
|
|
|
75876
75728
|
}
|
|
75877
75729
|
const Ids = {
|
|
75878
75730
|
showGhost: "isolationPanel.showGhost",
|
|
75879
|
-
ghostOpacity: "isolationPanel.ghostOpacity"
|
|
75731
|
+
ghostOpacity: "isolationPanel.ghostOpacity",
|
|
75732
|
+
transparency: "isolationPanel.transparency"
|
|
75880
75733
|
};
|
|
75881
75734
|
const IsolationPanel$1 = forwardRef(
|
|
75882
75735
|
(props, ref) => {
|
|
@@ -75888,8 +75741,20 @@ const IsolationPanel$1 = forwardRef(
|
|
|
75888
75741
|
anchorElement: document.getElementById("vim-control-bar"),
|
|
75889
75742
|
showPanel: props.state.showPanel,
|
|
75890
75743
|
entries: [
|
|
75891
|
-
{
|
|
75892
|
-
|
|
75744
|
+
{
|
|
75745
|
+
type: "bool",
|
|
75746
|
+
id: Ids.showGhost,
|
|
75747
|
+
label: "Show Ghost",
|
|
75748
|
+
state: props.state.showGhost
|
|
75749
|
+
},
|
|
75750
|
+
/*
|
|
75751
|
+
{
|
|
75752
|
+
type: "bool",
|
|
75753
|
+
id: "showRooms",
|
|
75754
|
+
label: "Show Rooms",
|
|
75755
|
+
state: props.state.showRooms
|
|
75756
|
+
},
|
|
75757
|
+
*/
|
|
75893
75758
|
{
|
|
75894
75759
|
type: "number",
|
|
75895
75760
|
id: Ids.ghostOpacity,
|
|
@@ -75899,6 +75764,13 @@ const IsolationPanel$1 = forwardRef(
|
|
|
75899
75764
|
min: 0,
|
|
75900
75765
|
max: 1,
|
|
75901
75766
|
step: 0.05
|
|
75767
|
+
},
|
|
75768
|
+
{
|
|
75769
|
+
type: "bool",
|
|
75770
|
+
visible: () => props.transparency,
|
|
75771
|
+
id: Ids.transparency,
|
|
75772
|
+
label: "Transparency",
|
|
75773
|
+
state: props.state.transparency
|
|
75902
75774
|
}
|
|
75903
75775
|
]
|
|
75904
75776
|
}
|
|
@@ -75907,12 +75779,13 @@ const IsolationPanel$1 = forwardRef(
|
|
|
75907
75779
|
);
|
|
75908
75780
|
function useSharedIsolation(adapter) {
|
|
75909
75781
|
const _adapter = useRef(adapter);
|
|
75910
|
-
const visibility = useStateRef(() => adapter.computeVisibility());
|
|
75782
|
+
const visibility = useStateRef(() => adapter.computeVisibility(), true);
|
|
75911
75783
|
const autoIsolate2 = useStateRef(false);
|
|
75912
75784
|
const showPanel = useStateRef(false);
|
|
75913
75785
|
const showRooms = useStateRef(false);
|
|
75914
75786
|
const showGhost = useStateRef(false);
|
|
75915
|
-
const ghostOpacity = useStateRef(() => adapter.getGhostOpacity());
|
|
75787
|
+
const ghostOpacity = useStateRef(() => adapter.getGhostOpacity(), true);
|
|
75788
|
+
const transparency = useStateRef(true);
|
|
75916
75789
|
const onAutoIsolate = useFuncRef(() => {
|
|
75917
75790
|
if (adapter.hasSelection()) {
|
|
75918
75791
|
adapter.isolateSelection();
|
|
@@ -75937,6 +75810,7 @@ function useSharedIsolation(adapter) {
|
|
|
75937
75810
|
});
|
|
75938
75811
|
showGhost.useOnChange((v) => adapter.showGhost(v));
|
|
75939
75812
|
showRooms.useOnChange((v) => adapter.setShowRooms(v));
|
|
75813
|
+
transparency.useOnChange((v) => adapter.enableTransparency(v));
|
|
75940
75814
|
ghostOpacity.useValidate((next, current) => {
|
|
75941
75815
|
return next <= 0 ? current : next;
|
|
75942
75816
|
});
|
|
@@ -75950,7 +75824,8 @@ function useSharedIsolation(adapter) {
|
|
|
75950
75824
|
showRooms,
|
|
75951
75825
|
ghostOpacity,
|
|
75952
75826
|
onAutoIsolate,
|
|
75953
|
-
onVisibilityChange
|
|
75827
|
+
onVisibilityChange,
|
|
75828
|
+
transparency
|
|
75954
75829
|
};
|
|
75955
75830
|
}
|
|
75956
75831
|
function useWebglIsolation(viewer) {
|
|
@@ -75958,6 +75833,29 @@ function useWebglIsolation(viewer) {
|
|
|
75958
75833
|
return useSharedIsolation(adapter);
|
|
75959
75834
|
}
|
|
75960
75835
|
function createWebglIsolationAdapter(viewer) {
|
|
75836
|
+
var transparency = true;
|
|
75837
|
+
var ghost2 = false;
|
|
75838
|
+
var rooms = false;
|
|
75839
|
+
function updateMaterials() {
|
|
75840
|
+
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] : (() => {
|
|
75841
|
+
throw new Error("Unreachable state in isolation materials");
|
|
75842
|
+
})();
|
|
75843
|
+
}
|
|
75844
|
+
function updateVisibility(elements, predicate) {
|
|
75845
|
+
if (elements === "all") {
|
|
75846
|
+
for (let v of viewer.vims) {
|
|
75847
|
+
for (let o of v.getAllElements()) {
|
|
75848
|
+
if (o.type === "Element3D") {
|
|
75849
|
+
o.visible = o.isRoom ? rooms : predicate(o);
|
|
75850
|
+
}
|
|
75851
|
+
}
|
|
75852
|
+
}
|
|
75853
|
+
} else {
|
|
75854
|
+
for (let o of elements) {
|
|
75855
|
+
o.visible = o.isRoom ? rooms : predicate(o);
|
|
75856
|
+
}
|
|
75857
|
+
}
|
|
75858
|
+
}
|
|
75961
75859
|
return {
|
|
75962
75860
|
onVisibilityChange: viewer.renderer.onSceneUpdated,
|
|
75963
75861
|
onSelectionChanged: viewer.selection.onSelectionChanged,
|
|
@@ -75966,28 +75864,28 @@ function createWebglIsolationAdapter(viewer) {
|
|
|
75966
75864
|
hasVisibleSelection: () => viewer.selection.any() && viewer.selection.getAll().every((o) => o.visible),
|
|
75967
75865
|
hasHiddenSelection: () => viewer.selection.any() && viewer.selection.getAll().every((o) => !o.visible),
|
|
75968
75866
|
clearSelection: () => viewer.selection.clear(),
|
|
75969
|
-
isolateSelection: () =>
|
|
75867
|
+
isolateSelection: () => updateVisibility("all", (o) => viewer.selection.has(o)),
|
|
75970
75868
|
hideSelection: () => {
|
|
75971
|
-
viewer.selection.getAll()
|
|
75869
|
+
updateVisibility(viewer.selection.getAll(), (o) => false);
|
|
75972
75870
|
},
|
|
75973
75871
|
showSelection: () => {
|
|
75974
|
-
viewer.selection.getAll()
|
|
75872
|
+
updateVisibility(viewer.selection.getAll(), (o) => true);
|
|
75975
75873
|
},
|
|
75976
75874
|
hideAll: () => {
|
|
75977
|
-
|
|
75875
|
+
updateVisibility("all", (o) => false);
|
|
75978
75876
|
},
|
|
75979
75877
|
showAll: () => {
|
|
75980
|
-
|
|
75878
|
+
updateVisibility("all", (o) => true);
|
|
75981
75879
|
},
|
|
75982
75880
|
isolate: (instances) => {
|
|
75983
75881
|
const set3 = new Set(instances);
|
|
75984
|
-
|
|
75882
|
+
updateVisibility("all", (o) => o.instances.some((i) => set3.has(i)));
|
|
75985
75883
|
},
|
|
75986
75884
|
show: (instances) => {
|
|
75987
75885
|
for (let i of instances) {
|
|
75988
75886
|
for (let v of viewer.vims) {
|
|
75989
75887
|
const o = v.getElement(i);
|
|
75990
|
-
o.visible = true;
|
|
75888
|
+
o.visible = o.isRoom ? rooms : true;
|
|
75991
75889
|
}
|
|
75992
75890
|
}
|
|
75993
75891
|
},
|
|
@@ -75995,29 +75893,30 @@ function createWebglIsolationAdapter(viewer) {
|
|
|
75995
75893
|
for (let i of instances) {
|
|
75996
75894
|
for (let v of viewer.vims) {
|
|
75997
75895
|
const o = v.getElement(i);
|
|
75998
|
-
o.visible = false;
|
|
75896
|
+
o.visible = o.isRoom ? rooms : false;
|
|
75999
75897
|
}
|
|
76000
75898
|
}
|
|
76001
75899
|
},
|
|
75900
|
+
enableTransparency: (enable) => {
|
|
75901
|
+
if (transparency !== enable) {
|
|
75902
|
+
transparency = enable;
|
|
75903
|
+
updateMaterials();
|
|
75904
|
+
}
|
|
75905
|
+
},
|
|
76002
75906
|
showGhost: (show) => {
|
|
76003
|
-
|
|
75907
|
+
ghost2 = show;
|
|
75908
|
+
updateMaterials();
|
|
76004
75909
|
},
|
|
76005
75910
|
getGhostOpacity: () => viewer.materials.ghostOpacity,
|
|
76006
75911
|
setGhostOpacity: (opacity) => viewer.materials.ghostOpacity = opacity,
|
|
76007
|
-
getShowRooms: () =>
|
|
75912
|
+
getShowRooms: () => rooms,
|
|
76008
75913
|
setShowRooms: (show) => {
|
|
76009
|
-
|
|
76010
|
-
|
|
76011
|
-
|
|
76012
|
-
}
|
|
76013
|
-
function updateAllVisibility(viewer, predicate) {
|
|
76014
|
-
for (let v of viewer.vims) {
|
|
76015
|
-
for (let o of v.getAllElements()) {
|
|
76016
|
-
if (o.type === "Element3D") {
|
|
76017
|
-
o.visible = predicate(o);
|
|
75914
|
+
if (rooms !== show) {
|
|
75915
|
+
rooms = show;
|
|
75916
|
+
updateVisibility("all", (o) => o.visible);
|
|
76018
75917
|
}
|
|
76019
75918
|
}
|
|
76020
|
-
}
|
|
75919
|
+
};
|
|
76021
75920
|
}
|
|
76022
75921
|
function getVisibilityState$1(viewer) {
|
|
76023
75922
|
let all = true;
|
|
@@ -76043,6 +75942,575 @@ function getVisibilityState$1(viewer) {
|
|
|
76043
75942
|
if (onlySelectionFlag) return "onlySelection";
|
|
76044
75943
|
return "some";
|
|
76045
75944
|
}
|
|
75945
|
+
function getDefaultSettings() {
|
|
75946
|
+
return {
|
|
75947
|
+
capacity: {
|
|
75948
|
+
canFollowUrl: true,
|
|
75949
|
+
canGoFullScreen: true,
|
|
75950
|
+
canDownload: true,
|
|
75951
|
+
canReadLocalStorage: true
|
|
75952
|
+
},
|
|
75953
|
+
ui: {
|
|
75954
|
+
logo: true,
|
|
75955
|
+
performance: false,
|
|
75956
|
+
bimTreePanel: true,
|
|
75957
|
+
bimInfoPanel: true,
|
|
75958
|
+
// axesPanel
|
|
75959
|
+
axesPanel: true,
|
|
75960
|
+
orthographic: true,
|
|
75961
|
+
resetCamera: true,
|
|
75962
|
+
// Control bar
|
|
75963
|
+
controlBar: true,
|
|
75964
|
+
// Control bar - cursors
|
|
75965
|
+
cursorOrbit: true,
|
|
75966
|
+
cursorLookAround: true,
|
|
75967
|
+
cursorPan: true,
|
|
75968
|
+
cursorZoom: true,
|
|
75969
|
+
// Control bar - camera
|
|
75970
|
+
cameraAuto: true,
|
|
75971
|
+
cameraFrameScene: true,
|
|
75972
|
+
cameraFrameSelection: true,
|
|
75973
|
+
// Control bar - tools
|
|
75974
|
+
sectioningEnable: true,
|
|
75975
|
+
sectioningFitToSelection: true,
|
|
75976
|
+
sectioningReset: true,
|
|
75977
|
+
sectioningShow: true,
|
|
75978
|
+
sectioningAuto: true,
|
|
75979
|
+
sectioningSettings: true,
|
|
75980
|
+
measuringMode: true,
|
|
75981
|
+
// Control bar - Visibility
|
|
75982
|
+
visibilityEnable: true,
|
|
75983
|
+
visibilityClearSelection: true,
|
|
75984
|
+
visibilityShowAll: true,
|
|
75985
|
+
visibilityToggle: true,
|
|
75986
|
+
visibilityIsolate: true,
|
|
75987
|
+
visibilityAutoIsolate: true,
|
|
75988
|
+
visibilitySettings: true,
|
|
75989
|
+
// Control bar - settings
|
|
75990
|
+
projectInspector: true,
|
|
75991
|
+
settings: true,
|
|
75992
|
+
help: true,
|
|
75993
|
+
maximise: true
|
|
75994
|
+
}
|
|
75995
|
+
};
|
|
75996
|
+
}
|
|
75997
|
+
function renderSettingsInputBox(settings2, item) {
|
|
75998
|
+
const ref = React__default.useRef(null);
|
|
75999
|
+
useEffect(() => {
|
|
76000
|
+
var _a3;
|
|
76001
|
+
ref.current.value = (_a3 = item.getter(settings2.value)) == null ? void 0 : _a3.toString();
|
|
76002
|
+
}, []);
|
|
76003
|
+
const update = (event) => {
|
|
76004
|
+
const str = event.target.value;
|
|
76005
|
+
const n = Number.parseFloat(str);
|
|
76006
|
+
if (Number.isNaN(n)) {
|
|
76007
|
+
event.target.value = item.getter(settings2.value).toString();
|
|
76008
|
+
} else {
|
|
76009
|
+
const value = item.transform(n);
|
|
76010
|
+
event.target.value = value.toString();
|
|
76011
|
+
settings2.update((s) => item.setter(s, value));
|
|
76012
|
+
}
|
|
76013
|
+
};
|
|
76014
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-box-input vc-my-1 ", children: [
|
|
76015
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2", children: [
|
|
76016
|
+
item.label,
|
|
76017
|
+
":"
|
|
76018
|
+
] }),
|
|
76019
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76020
|
+
"input",
|
|
76021
|
+
{
|
|
76022
|
+
ref,
|
|
76023
|
+
type: "text",
|
|
76024
|
+
className: "vim-settings-textbox vc-border vc-rounded-sm vc-border-gray vc-w-14 vc-ml-1 vc-p-1",
|
|
76025
|
+
onBlur: update
|
|
76026
|
+
}
|
|
76027
|
+
),
|
|
76028
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "textbox", className: "vc-w-3 vc-h-2 vc-text-gray vc-ml-1", children: item.info })
|
|
76029
|
+
] });
|
|
76030
|
+
}
|
|
76031
|
+
function renderSettingsToggle(settings2, item) {
|
|
76032
|
+
const value = item.getter(settings2.value);
|
|
76033
|
+
if (value === "AlwaysTrue" || value === "AlwaysFalse") return null;
|
|
76034
|
+
const handleChange = () => {
|
|
76035
|
+
const current = item.getter(settings2.value);
|
|
76036
|
+
settings2.update((s) => item.setter(s, !current));
|
|
76037
|
+
};
|
|
76038
|
+
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: [
|
|
76039
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76040
|
+
"input",
|
|
76041
|
+
{
|
|
76042
|
+
type: "checkbox",
|
|
76043
|
+
checked: value,
|
|
76044
|
+
onChange: handleChange,
|
|
76045
|
+
className: "vim-settings-checkbox vc-checked:bg-primary-royal vc-mr-2 vc-rounded vc-border vc-border-gray-medium"
|
|
76046
|
+
}
|
|
76047
|
+
),
|
|
76048
|
+
" ",
|
|
76049
|
+
item.label
|
|
76050
|
+
] });
|
|
76051
|
+
}
|
|
76052
|
+
function renderSettingsSubtitle(item) {
|
|
76053
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-subtitle", children: item.title });
|
|
76054
|
+
}
|
|
76055
|
+
function SettingsPanel(props) {
|
|
76056
|
+
if (!props.visible) return null;
|
|
76057
|
+
function renderItem(settings2, item) {
|
|
76058
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: (() => {
|
|
76059
|
+
switch (item.type) {
|
|
76060
|
+
case "subtitle":
|
|
76061
|
+
return renderSettingsSubtitle(item);
|
|
76062
|
+
case "toggle":
|
|
76063
|
+
return renderSettingsToggle(settings2, item);
|
|
76064
|
+
case "box":
|
|
76065
|
+
return renderSettingsInputBox(settings2, item);
|
|
76066
|
+
case "element":
|
|
76067
|
+
return item.element;
|
|
76068
|
+
default:
|
|
76069
|
+
return null;
|
|
76070
|
+
}
|
|
76071
|
+
})() }, item.key);
|
|
76072
|
+
}
|
|
76073
|
+
const customizer = props.settings.customizer.get();
|
|
76074
|
+
const content2 = customizer ? customizer(props.content) : props.content;
|
|
76075
|
+
const sections = buildSections(content2);
|
|
76076
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vc-absolute vc-inset-0", children: [
|
|
76077
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "vc-title vc-mb-2", children: "Settings" }),
|
|
76078
|
+
/* @__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(
|
|
76079
|
+
"details",
|
|
76080
|
+
{
|
|
76081
|
+
open: true,
|
|
76082
|
+
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 ",
|
|
76083
|
+
children: [
|
|
76084
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("summary", { className: "vim-settings-section-title vc-font-medium vc-text-sm vc-cursor-pointer", children: section.title }),
|
|
76085
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-settings-section-content vc-mt-2 vc-space-y-2", children: section.items.map(
|
|
76086
|
+
(item) => renderItem(props.settings, item)
|
|
76087
|
+
) })
|
|
76088
|
+
]
|
|
76089
|
+
},
|
|
76090
|
+
section.key
|
|
76091
|
+
)) })
|
|
76092
|
+
] });
|
|
76093
|
+
}
|
|
76094
|
+
function buildSections(items) {
|
|
76095
|
+
const sections = [];
|
|
76096
|
+
let current = null;
|
|
76097
|
+
for (const item of items) {
|
|
76098
|
+
if (item.type === "subtitle") {
|
|
76099
|
+
current = {
|
|
76100
|
+
key: item.key,
|
|
76101
|
+
title: item.title,
|
|
76102
|
+
items: []
|
|
76103
|
+
};
|
|
76104
|
+
sections.push(current);
|
|
76105
|
+
} else {
|
|
76106
|
+
if (!current) {
|
|
76107
|
+
current = {
|
|
76108
|
+
key: "default",
|
|
76109
|
+
title: "",
|
|
76110
|
+
items: []
|
|
76111
|
+
};
|
|
76112
|
+
sections.push(current);
|
|
76113
|
+
}
|
|
76114
|
+
current.items.push(item);
|
|
76115
|
+
}
|
|
76116
|
+
}
|
|
76117
|
+
return sections;
|
|
76118
|
+
}
|
|
76119
|
+
class SettingsPanelKeys {
|
|
76120
|
+
}
|
|
76121
|
+
// === Inputs ===
|
|
76122
|
+
__publicField(SettingsPanelKeys, "InputsSubtitle", "inputs");
|
|
76123
|
+
__publicField(SettingsPanelKeys, "InputsScrollSpeedBox", "scrollSpeed");
|
|
76124
|
+
// === Panels ===
|
|
76125
|
+
__publicField(SettingsPanelKeys, "PanelsSubtitle", "panels");
|
|
76126
|
+
__publicField(SettingsPanelKeys, "PanelsShowLogoToggle", "logo");
|
|
76127
|
+
__publicField(SettingsPanelKeys, "PanelsShowBimTreeToggle", "bimTree");
|
|
76128
|
+
__publicField(SettingsPanelKeys, "PanelsShowBimInfoToggle", "bimInfo");
|
|
76129
|
+
__publicField(SettingsPanelKeys, "PanelsShowAxesPanelToggle", "axesPanel");
|
|
76130
|
+
__publicField(SettingsPanelKeys, "PanelsShowPerformancePanelToggle", "performance");
|
|
76131
|
+
// === Axes ===
|
|
76132
|
+
__publicField(SettingsPanelKeys, "AxesSubtitle", "axes");
|
|
76133
|
+
__publicField(SettingsPanelKeys, "AxesShowOrthographicButtonToggle", "orthographic");
|
|
76134
|
+
__publicField(SettingsPanelKeys, "AxesShowResetCameraButtonToggle", "resetCamera");
|
|
76135
|
+
// === Control Bar ===
|
|
76136
|
+
__publicField(SettingsPanelKeys, "ControlBarSubtitle", "controlBar");
|
|
76137
|
+
__publicField(SettingsPanelKeys, "ControlBarShowControlBarToggle", "controlBarVisible");
|
|
76138
|
+
// --- Control Bar - Cursors ---
|
|
76139
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsSubtitle", "controlBarCursors");
|
|
76140
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowOrbitButtonToggle", "orbit");
|
|
76141
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowLookAroundButtonToggle", "lookAround");
|
|
76142
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowPanButtonToggle", "pan");
|
|
76143
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowZoomButtonToggle", "zoom");
|
|
76144
|
+
__publicField(SettingsPanelKeys, "ControlBarCursorsShowZoomWindowButtonToggle", "zoomWindow");
|
|
76145
|
+
// --- Control Bar - Tools ---
|
|
76146
|
+
__publicField(SettingsPanelKeys, "ControlBarToolsSubtitle", "controlBarTools");
|
|
76147
|
+
__publicField(SettingsPanelKeys, "ControlBarToolsShowMeasuringModeButtonToggle", "measuringMode");
|
|
76148
|
+
// --- Control Bar Camera ---
|
|
76149
|
+
__publicField(SettingsPanelKeys, "ControlBarCameraSubtitle", "settingsPanel.controlBar.Camera");
|
|
76150
|
+
__publicField(SettingsPanelKeys, "ControlBarAutoCamera", "settingsPanel.controlBar.autoCamera");
|
|
76151
|
+
__publicField(SettingsPanelKeys, "ControlBarFrameSelection", "settingsPanel.controlBar.frameSelection");
|
|
76152
|
+
__publicField(SettingsPanelKeys, "ControlBarFrameAll", "settingsPanel.controlBar.frameAll");
|
|
76153
|
+
// --- Control Bar - Sectioning ---
|
|
76154
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningSubtitle", "settingsPanel.controlBar.sectioning");
|
|
76155
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningEnable", "settingsPanel.controlBar.enableSectioning");
|
|
76156
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningFitToSelection", "settingsPanel.controlBar.fitToSelection");
|
|
76157
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningReset", "settingsPanel.controlBar.reset");
|
|
76158
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningShow", "settingsPanel.controlBar.show");
|
|
76159
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningAuto", "settingsPanel.controlBar.auto");
|
|
76160
|
+
__publicField(SettingsPanelKeys, "ControlBarSectioningSettings", "settingsPanel.controlBar.settings");
|
|
76161
|
+
// --- Control Bar - Visibility ---
|
|
76162
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilitySubtitle", "controlBar.visibility.subtitle");
|
|
76163
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityClearSelection", "controlBar.visibility.clearSelection");
|
|
76164
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityShowAll", "controlBar.visibility.showAll");
|
|
76165
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityToggle", "controlBar.visibility.toggle");
|
|
76166
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityIsolate", "controlBar.visibility.isolate");
|
|
76167
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilityAutoIsolate", "controlBar.visibility.autoIsolate");
|
|
76168
|
+
__publicField(SettingsPanelKeys, "ControlBarVisibilitySettings", "controlBar.visibility.settings");
|
|
76169
|
+
// --- Control Bar - Settings ---
|
|
76170
|
+
__publicField(SettingsPanelKeys, "ControlBarSettingsSubtitle", "controlBarSettings");
|
|
76171
|
+
__publicField(SettingsPanelKeys, "ControlBarSettingsShowProjectInspectorButtonToggle", "projectInspector");
|
|
76172
|
+
__publicField(SettingsPanelKeys, "ControlBarSettingsShowSettingsButtonToggle", "settingsButton");
|
|
76173
|
+
__publicField(SettingsPanelKeys, "ControlBarSettingsShowHelpButtonToggle", "help");
|
|
76174
|
+
__publicField(SettingsPanelKeys, "ControlBarSettingsShowMaximiseButtonToggle", "maximise");
|
|
76175
|
+
function getControlBarCursorSettings() {
|
|
76176
|
+
return [
|
|
76177
|
+
{
|
|
76178
|
+
type: "subtitle",
|
|
76179
|
+
key: SettingsPanelKeys.ControlBarCursorsSubtitle,
|
|
76180
|
+
title: "Control Bar - Cursors"
|
|
76181
|
+
},
|
|
76182
|
+
{
|
|
76183
|
+
type: "toggle",
|
|
76184
|
+
key: SettingsPanelKeys.ControlBarCursorsShowOrbitButtonToggle,
|
|
76185
|
+
label: "Orbit",
|
|
76186
|
+
getter: (s) => s.ui.cursorOrbit,
|
|
76187
|
+
setter: (s, v) => s.ui.cursorOrbit = v
|
|
76188
|
+
},
|
|
76189
|
+
{
|
|
76190
|
+
type: "toggle",
|
|
76191
|
+
key: SettingsPanelKeys.ControlBarCursorsShowLookAroundButtonToggle,
|
|
76192
|
+
label: "Look Around",
|
|
76193
|
+
getter: (s) => s.ui.cursorLookAround,
|
|
76194
|
+
setter: (s, v) => s.ui.cursorLookAround = v
|
|
76195
|
+
},
|
|
76196
|
+
{
|
|
76197
|
+
type: "toggle",
|
|
76198
|
+
key: SettingsPanelKeys.ControlBarCursorsShowPanButtonToggle,
|
|
76199
|
+
label: "Pan",
|
|
76200
|
+
getter: (s) => s.ui.cursorPan,
|
|
76201
|
+
setter: (s, v) => s.ui.cursorPan = v
|
|
76202
|
+
},
|
|
76203
|
+
{
|
|
76204
|
+
type: "toggle",
|
|
76205
|
+
key: SettingsPanelKeys.ControlBarCursorsShowZoomButtonToggle,
|
|
76206
|
+
label: "Zoom",
|
|
76207
|
+
getter: (s) => s.ui.cursorZoom,
|
|
76208
|
+
setter: (s, v) => s.ui.cursorZoom = v
|
|
76209
|
+
}
|
|
76210
|
+
];
|
|
76211
|
+
}
|
|
76212
|
+
function getControlBarCameraSettings() {
|
|
76213
|
+
return [
|
|
76214
|
+
{
|
|
76215
|
+
type: "subtitle",
|
|
76216
|
+
key: SettingsPanelKeys.ControlBarCameraSubtitle,
|
|
76217
|
+
title: "Control Bar - Camera"
|
|
76218
|
+
},
|
|
76219
|
+
{
|
|
76220
|
+
type: "toggle",
|
|
76221
|
+
key: SettingsPanelKeys.ControlBarAutoCamera,
|
|
76222
|
+
label: "Auto Camera",
|
|
76223
|
+
getter: (s) => s.ui.cameraAuto,
|
|
76224
|
+
setter: (s, v) => s.ui.cameraAuto = v
|
|
76225
|
+
},
|
|
76226
|
+
{
|
|
76227
|
+
type: "toggle",
|
|
76228
|
+
key: SettingsPanelKeys.ControlBarFrameSelection,
|
|
76229
|
+
label: "Frame Selection",
|
|
76230
|
+
getter: (s) => s.ui.cameraFrameSelection,
|
|
76231
|
+
setter: (s, v) => s.ui.cameraFrameSelection = v
|
|
76232
|
+
},
|
|
76233
|
+
{
|
|
76234
|
+
type: "toggle",
|
|
76235
|
+
key: SettingsPanelKeys.ControlBarFrameAll,
|
|
76236
|
+
label: "Frame All",
|
|
76237
|
+
getter: (s) => s.ui.cameraFrameScene,
|
|
76238
|
+
setter: (s, v) => s.ui.cameraFrameScene = v
|
|
76239
|
+
}
|
|
76240
|
+
];
|
|
76241
|
+
}
|
|
76242
|
+
function getControlBarSectionBoxSettings() {
|
|
76243
|
+
return [
|
|
76244
|
+
{
|
|
76245
|
+
type: "subtitle",
|
|
76246
|
+
key: SettingsPanelKeys.ControlBarSectioningSubtitle,
|
|
76247
|
+
title: "Control Bar - Sectioning"
|
|
76248
|
+
},
|
|
76249
|
+
{
|
|
76250
|
+
type: "toggle",
|
|
76251
|
+
key: SettingsPanelKeys.ControlBarSectioningEnable,
|
|
76252
|
+
label: "Enable Sectioning",
|
|
76253
|
+
getter: (s) => s.ui.sectioningEnable,
|
|
76254
|
+
setter: (s, v) => s.ui.sectioningEnable = v
|
|
76255
|
+
},
|
|
76256
|
+
{
|
|
76257
|
+
type: "toggle",
|
|
76258
|
+
key: SettingsPanelKeys.ControlBarSectioningFitToSelection,
|
|
76259
|
+
label: "Fit To Selection",
|
|
76260
|
+
getter: (s) => s.ui.sectioningFitToSelection,
|
|
76261
|
+
setter: (s, v) => s.ui.sectioningFitToSelection = v
|
|
76262
|
+
},
|
|
76263
|
+
{
|
|
76264
|
+
type: "toggle",
|
|
76265
|
+
key: SettingsPanelKeys.ControlBarSectioningReset,
|
|
76266
|
+
label: "Reset",
|
|
76267
|
+
getter: (s) => s.ui.sectioningReset,
|
|
76268
|
+
setter: (s, v) => s.ui.sectioningReset = v
|
|
76269
|
+
},
|
|
76270
|
+
{
|
|
76271
|
+
type: "toggle",
|
|
76272
|
+
key: SettingsPanelKeys.ControlBarSectioningShow,
|
|
76273
|
+
label: "Show",
|
|
76274
|
+
getter: (s) => s.ui.sectioningShow,
|
|
76275
|
+
setter: (s, v) => s.ui.sectioningShow = v
|
|
76276
|
+
},
|
|
76277
|
+
{
|
|
76278
|
+
type: "toggle",
|
|
76279
|
+
key: SettingsPanelKeys.ControlBarSectioningAuto,
|
|
76280
|
+
label: "Auto",
|
|
76281
|
+
getter: (s) => s.ui.sectioningAuto,
|
|
76282
|
+
setter: (s, v) => s.ui.sectioningAuto = v
|
|
76283
|
+
},
|
|
76284
|
+
{
|
|
76285
|
+
type: "toggle",
|
|
76286
|
+
key: SettingsPanelKeys.ControlBarSectioningSettings,
|
|
76287
|
+
label: "Settings",
|
|
76288
|
+
getter: (s) => s.ui.sectioningSettings,
|
|
76289
|
+
setter: (s, v) => s.ui.sectioningSettings = v
|
|
76290
|
+
}
|
|
76291
|
+
];
|
|
76292
|
+
}
|
|
76293
|
+
function getControlBarVisibilitySettings() {
|
|
76294
|
+
return [
|
|
76295
|
+
{
|
|
76296
|
+
type: "subtitle",
|
|
76297
|
+
key: SettingsPanelKeys.ControlBarVisibilitySubtitle,
|
|
76298
|
+
title: "Control Bar - Visibility"
|
|
76299
|
+
},
|
|
76300
|
+
{
|
|
76301
|
+
type: "toggle",
|
|
76302
|
+
key: SettingsPanelKeys.ControlBarVisibilityClearSelection,
|
|
76303
|
+
label: "Clear Selection",
|
|
76304
|
+
getter: (s) => s.ui.visibilityClearSelection,
|
|
76305
|
+
setter: (s, v) => s.ui.visibilityClearSelection = v
|
|
76306
|
+
},
|
|
76307
|
+
{
|
|
76308
|
+
type: "toggle",
|
|
76309
|
+
key: SettingsPanelKeys.ControlBarVisibilityShowAll,
|
|
76310
|
+
label: "Show All",
|
|
76311
|
+
getter: (s) => s.ui.visibilityShowAll,
|
|
76312
|
+
setter: (s, v) => s.ui.visibilityShowAll = v
|
|
76313
|
+
},
|
|
76314
|
+
{
|
|
76315
|
+
type: "toggle",
|
|
76316
|
+
key: SettingsPanelKeys.ControlBarVisibilityToggle,
|
|
76317
|
+
label: "Toggle",
|
|
76318
|
+
getter: (s) => s.ui.visibilityToggle,
|
|
76319
|
+
setter: (s, v) => s.ui.visibilityToggle = v
|
|
76320
|
+
},
|
|
76321
|
+
{
|
|
76322
|
+
type: "toggle",
|
|
76323
|
+
key: SettingsPanelKeys.ControlBarVisibilityIsolate,
|
|
76324
|
+
label: "Isolate",
|
|
76325
|
+
getter: (s) => s.ui.visibilityIsolate,
|
|
76326
|
+
setter: (s, v) => s.ui.visibilityIsolate = v
|
|
76327
|
+
},
|
|
76328
|
+
{
|
|
76329
|
+
type: "toggle",
|
|
76330
|
+
key: SettingsPanelKeys.ControlBarVisibilityAutoIsolate,
|
|
76331
|
+
label: "Auto Isolate",
|
|
76332
|
+
getter: (s) => s.ui.visibilityAutoIsolate,
|
|
76333
|
+
setter: (s, v) => s.ui.visibilityAutoIsolate = v
|
|
76334
|
+
},
|
|
76335
|
+
{
|
|
76336
|
+
type: "toggle",
|
|
76337
|
+
key: SettingsPanelKeys.ControlBarVisibilitySettings,
|
|
76338
|
+
label: "Settings",
|
|
76339
|
+
getter: (s) => s.ui.visibilitySettings,
|
|
76340
|
+
setter: (s, v) => s.ui.visibilitySettings = v
|
|
76341
|
+
}
|
|
76342
|
+
];
|
|
76343
|
+
}
|
|
76344
|
+
function getControlBarVariousSettings() {
|
|
76345
|
+
return [
|
|
76346
|
+
{
|
|
76347
|
+
type: "subtitle",
|
|
76348
|
+
key: SettingsPanelKeys.ControlBarSettingsSubtitle,
|
|
76349
|
+
title: "Control Bar - Settings"
|
|
76350
|
+
},
|
|
76351
|
+
{
|
|
76352
|
+
type: "toggle",
|
|
76353
|
+
key: SettingsPanelKeys.ControlBarSettingsShowProjectInspectorButtonToggle,
|
|
76354
|
+
label: "Project Inspector",
|
|
76355
|
+
getter: (s) => s.ui.projectInspector,
|
|
76356
|
+
setter: (s, v) => s.ui.projectInspector = v
|
|
76357
|
+
},
|
|
76358
|
+
{
|
|
76359
|
+
type: "toggle",
|
|
76360
|
+
key: SettingsPanelKeys.ControlBarSettingsShowSettingsButtonToggle,
|
|
76361
|
+
label: "Settings",
|
|
76362
|
+
getter: (s) => s.ui.settings,
|
|
76363
|
+
setter: (s, v) => s.ui.settings = v
|
|
76364
|
+
},
|
|
76365
|
+
{
|
|
76366
|
+
type: "toggle",
|
|
76367
|
+
key: SettingsPanelKeys.ControlBarSettingsShowHelpButtonToggle,
|
|
76368
|
+
label: "Help",
|
|
76369
|
+
getter: (s) => s.ui.help,
|
|
76370
|
+
setter: (s, v) => s.ui.help = v
|
|
76371
|
+
},
|
|
76372
|
+
{
|
|
76373
|
+
type: "toggle",
|
|
76374
|
+
key: SettingsPanelKeys.ControlBarSettingsShowMaximiseButtonToggle,
|
|
76375
|
+
label: "Maximise",
|
|
76376
|
+
getter: (s) => s.ui.maximise,
|
|
76377
|
+
setter: (s, v) => s.ui.maximise = v
|
|
76378
|
+
}
|
|
76379
|
+
];
|
|
76380
|
+
}
|
|
76381
|
+
function getPanelsVisibilitySettings() {
|
|
76382
|
+
return [
|
|
76383
|
+
{
|
|
76384
|
+
type: "subtitle",
|
|
76385
|
+
key: SettingsPanelKeys.PanelsSubtitle,
|
|
76386
|
+
title: "Panels Visibility"
|
|
76387
|
+
},
|
|
76388
|
+
{
|
|
76389
|
+
type: "toggle",
|
|
76390
|
+
key: SettingsPanelKeys.PanelsShowLogoToggle,
|
|
76391
|
+
label: "Logo",
|
|
76392
|
+
getter: (s) => s.ui.logo,
|
|
76393
|
+
setter: (s, v) => s.ui.logo = v
|
|
76394
|
+
},
|
|
76395
|
+
{
|
|
76396
|
+
type: "toggle",
|
|
76397
|
+
key: SettingsPanelKeys.PanelsShowBimTreeToggle,
|
|
76398
|
+
label: "Bim Tree",
|
|
76399
|
+
getter: (s) => s.ui.bimTreePanel,
|
|
76400
|
+
setter: (s, v) => s.ui.bimTreePanel = v
|
|
76401
|
+
},
|
|
76402
|
+
{
|
|
76403
|
+
type: "toggle",
|
|
76404
|
+
key: SettingsPanelKeys.PanelsShowBimInfoToggle,
|
|
76405
|
+
label: "Bim Info",
|
|
76406
|
+
getter: (s) => s.ui.bimInfoPanel,
|
|
76407
|
+
setter: (s, v) => s.ui.bimInfoPanel = v
|
|
76408
|
+
},
|
|
76409
|
+
{
|
|
76410
|
+
type: "toggle",
|
|
76411
|
+
key: SettingsPanelKeys.PanelsShowAxesPanelToggle,
|
|
76412
|
+
label: "Axes",
|
|
76413
|
+
getter: (s) => s.ui.axesPanel,
|
|
76414
|
+
setter: (s, v) => s.ui.axesPanel = v
|
|
76415
|
+
},
|
|
76416
|
+
{
|
|
76417
|
+
type: "toggle",
|
|
76418
|
+
key: SettingsPanelKeys.PanelsShowPerformancePanelToggle,
|
|
76419
|
+
label: "Performance",
|
|
76420
|
+
getter: (s) => s.ui.performance,
|
|
76421
|
+
setter: (s, v) => s.ui.performance = v
|
|
76422
|
+
},
|
|
76423
|
+
{
|
|
76424
|
+
type: "toggle",
|
|
76425
|
+
key: SettingsPanelKeys.ControlBarShowControlBarToggle,
|
|
76426
|
+
label: "Control Bar",
|
|
76427
|
+
getter: (s) => s.ui.controlBar,
|
|
76428
|
+
setter: (s, v) => s.ui.controlBar = v
|
|
76429
|
+
}
|
|
76430
|
+
];
|
|
76431
|
+
}
|
|
76432
|
+
function getInputsSettings(viewer) {
|
|
76433
|
+
return [
|
|
76434
|
+
{
|
|
76435
|
+
type: "subtitle",
|
|
76436
|
+
key: SettingsPanelKeys.InputsSubtitle,
|
|
76437
|
+
title: "Inputs"
|
|
76438
|
+
},
|
|
76439
|
+
{
|
|
76440
|
+
type: "box",
|
|
76441
|
+
key: SettingsPanelKeys.InputsScrollSpeedBox,
|
|
76442
|
+
label: "Scroll Speed",
|
|
76443
|
+
info: "[0.1,10]",
|
|
76444
|
+
transform: (n) => MathUtils.clamp(n, 0.1, 10),
|
|
76445
|
+
getter: (_s) => viewer.inputs.scrollSpeed,
|
|
76446
|
+
setter: (_s, v) => {
|
|
76447
|
+
viewer.inputs.scrollSpeed = v;
|
|
76448
|
+
}
|
|
76449
|
+
}
|
|
76450
|
+
];
|
|
76451
|
+
}
|
|
76452
|
+
function getAxesPanelSettings() {
|
|
76453
|
+
return [
|
|
76454
|
+
{
|
|
76455
|
+
type: "subtitle",
|
|
76456
|
+
key: SettingsPanelKeys.AxesSubtitle,
|
|
76457
|
+
title: "Axes Panel"
|
|
76458
|
+
},
|
|
76459
|
+
{
|
|
76460
|
+
type: "toggle",
|
|
76461
|
+
key: SettingsPanelKeys.AxesShowOrthographicButtonToggle,
|
|
76462
|
+
label: "Orthographic Camera",
|
|
76463
|
+
getter: (s) => s.ui.orthographic,
|
|
76464
|
+
setter: (s, v) => s.ui.orthographic = v
|
|
76465
|
+
},
|
|
76466
|
+
{
|
|
76467
|
+
type: "toggle",
|
|
76468
|
+
key: SettingsPanelKeys.AxesShowResetCameraButtonToggle,
|
|
76469
|
+
label: "Reset Camera",
|
|
76470
|
+
getter: (s) => s.ui.resetCamera,
|
|
76471
|
+
setter: (s, v) => s.ui.resetCamera = v
|
|
76472
|
+
}
|
|
76473
|
+
];
|
|
76474
|
+
}
|
|
76475
|
+
function getControlBarMeasureSettings() {
|
|
76476
|
+
return [
|
|
76477
|
+
{
|
|
76478
|
+
type: "subtitle",
|
|
76479
|
+
key: SettingsPanelKeys.ControlBarToolsSubtitle,
|
|
76480
|
+
title: "Control Bar - Measurement"
|
|
76481
|
+
},
|
|
76482
|
+
{
|
|
76483
|
+
type: "toggle",
|
|
76484
|
+
key: SettingsPanelKeys.ControlBarToolsShowMeasuringModeButtonToggle,
|
|
76485
|
+
label: "Enable",
|
|
76486
|
+
getter: (s) => s.ui.measuringMode,
|
|
76487
|
+
setter: (s, v) => s.ui.measuringMode = v
|
|
76488
|
+
}
|
|
76489
|
+
];
|
|
76490
|
+
}
|
|
76491
|
+
function getWebglSettingsContent(viewer) {
|
|
76492
|
+
return [
|
|
76493
|
+
...getInputsSettings(viewer),
|
|
76494
|
+
...getPanelsVisibilitySettings(),
|
|
76495
|
+
...getAxesPanelSettings(),
|
|
76496
|
+
...getControlBarCursorSettings(),
|
|
76497
|
+
...getControlBarCameraSettings(),
|
|
76498
|
+
...getControlBarVisibilitySettings(),
|
|
76499
|
+
...getControlBarMeasureSettings(),
|
|
76500
|
+
...getControlBarSectionBoxSettings(),
|
|
76501
|
+
...getControlBarVariousSettings()
|
|
76502
|
+
];
|
|
76503
|
+
}
|
|
76504
|
+
function applyWebglSettings(settings2) {
|
|
76505
|
+
const performance2 = document.getElementsByClassName("vim-performance-div")[0];
|
|
76506
|
+
if (performance2) {
|
|
76507
|
+
if (isTrue(settings2.ui.performance)) {
|
|
76508
|
+
performance2.classList.remove("vc-hidden");
|
|
76509
|
+
} else {
|
|
76510
|
+
performance2.classList.add("vc-hidden");
|
|
76511
|
+
}
|
|
76512
|
+
}
|
|
76513
|
+
}
|
|
76046
76514
|
function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
76047
76515
|
const controllablePromise = new ControllablePromise();
|
|
76048
76516
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
@@ -76073,7 +76541,7 @@ function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
|
76073
76541
|
return controllablePromise.promise;
|
|
76074
76542
|
}
|
|
76075
76543
|
function Viewer$1(props) {
|
|
76076
|
-
const settings2 = useSettings(props.
|
|
76544
|
+
const settings2 = useSettings(props.settings ?? {}, getDefaultSettings(), (s) => applyWebglSettings(s));
|
|
76077
76545
|
const modal = useRef(null);
|
|
76078
76546
|
const sectionBoxRef = useWebglSectionBox(props.viewer);
|
|
76079
76547
|
const isolationPanelHandle = useRef(null);
|
|
@@ -76122,7 +76590,11 @@ function Viewer$1(props) {
|
|
|
76122
76590
|
loader: loader.current,
|
|
76123
76591
|
isolation: isolationRef,
|
|
76124
76592
|
camera: camera2,
|
|
76125
|
-
settings:
|
|
76593
|
+
settings: {
|
|
76594
|
+
update: settings2.update,
|
|
76595
|
+
register: settings2.register,
|
|
76596
|
+
customize: (c) => settings2.customizer.set(c)
|
|
76597
|
+
},
|
|
76126
76598
|
get isolationPanel() {
|
|
76127
76599
|
return isolationPanelHandle.current;
|
|
76128
76600
|
},
|
|
@@ -76168,7 +76640,7 @@ function Viewer$1(props) {
|
|
|
76168
76640
|
SettingsPanel,
|
|
76169
76641
|
{
|
|
76170
76642
|
visible: side.getContent() === "settings",
|
|
76171
|
-
|
|
76643
|
+
content: getWebglSettingsContent(props.viewer),
|
|
76172
76644
|
settings: settings2
|
|
76173
76645
|
}
|
|
76174
76646
|
)
|
|
@@ -76197,7 +76669,7 @@ function Viewer$1(props) {
|
|
|
76197
76669
|
}
|
|
76198
76670
|
),
|
|
76199
76671
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel$1, { ref: sectionBoxPanelHandle, state: sectionBoxRef }),
|
|
76200
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef }),
|
|
76672
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef, transparency: true }),
|
|
76201
76673
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76202
76674
|
AxesPanelMemo,
|
|
76203
76675
|
{
|
|
@@ -76236,7 +76708,8 @@ function Viewer$1(props) {
|
|
|
76236
76708
|
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76237
76709
|
__proto__: null,
|
|
76238
76710
|
Viewer: Viewer$1,
|
|
76239
|
-
createViewer: createViewer$1
|
|
76711
|
+
createViewer: createViewer$1,
|
|
76712
|
+
getDefaultSettings
|
|
76240
76713
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76241
76714
|
function getErrorMessage(state) {
|
|
76242
76715
|
if (state.status !== "error") return void 0;
|
|
@@ -76302,11 +76775,13 @@ function useUltraSectionBox(viewer) {
|
|
|
76302
76775
|
};
|
|
76303
76776
|
return useSectionBox(ultraAdapter);
|
|
76304
76777
|
}
|
|
76305
|
-
function useUltraControlBar(viewer, section, isolation, camera2, customization) {
|
|
76306
|
-
|
|
76307
|
-
|
|
76308
|
-
|
|
76309
|
-
|
|
76778
|
+
function useUltraControlBar(viewer, section, isolation, camera2, settings2, side, customization) {
|
|
76779
|
+
let bar = [
|
|
76780
|
+
controlBarCamera(camera2, settings2.ui),
|
|
76781
|
+
controlBarVisibility(isolation, settings2.ui),
|
|
76782
|
+
controlBarSectionBox(section, viewer.selection.any(), settings2.ui),
|
|
76783
|
+
controlBarSettingsUltra(side, settings2)
|
|
76784
|
+
];
|
|
76310
76785
|
bar = (customization == null ? void 0 : customization(bar)) ?? bar;
|
|
76311
76786
|
return bar;
|
|
76312
76787
|
}
|
|
@@ -76410,6 +76885,9 @@ function createAdapter(viewer) {
|
|
|
76410
76885
|
}
|
|
76411
76886
|
}
|
|
76412
76887
|
},
|
|
76888
|
+
enableTransparency: (enable) => {
|
|
76889
|
+
console.log("enableTransparency not implemented");
|
|
76890
|
+
},
|
|
76413
76891
|
getGhostOpacity: () => viewer.renderer.ghostOpacity,
|
|
76414
76892
|
setGhostOpacity: (opacity) => {
|
|
76415
76893
|
viewer.renderer.ghostOpacity = opacity;
|
|
@@ -76451,7 +76929,62 @@ function onlySelection(viewer, vim) {
|
|
|
76451
76929
|
function allButSelection(viewer, vim) {
|
|
76452
76930
|
return false;
|
|
76453
76931
|
}
|
|
76454
|
-
function
|
|
76932
|
+
function getDefaultUltraSettings() {
|
|
76933
|
+
return {
|
|
76934
|
+
ui: {
|
|
76935
|
+
// Control bar - cursors
|
|
76936
|
+
cursorOrbit: true,
|
|
76937
|
+
cursorLookAround: true,
|
|
76938
|
+
cursorPan: true,
|
|
76939
|
+
cursorZoom: true,
|
|
76940
|
+
// Control bar - camera
|
|
76941
|
+
cameraAuto: true,
|
|
76942
|
+
cameraFrameScene: true,
|
|
76943
|
+
cameraFrameSelection: true,
|
|
76944
|
+
// Control bar - tools
|
|
76945
|
+
sectioningEnable: true,
|
|
76946
|
+
sectioningFitToSelection: true,
|
|
76947
|
+
sectioningReset: true,
|
|
76948
|
+
sectioningShow: true,
|
|
76949
|
+
sectioningAuto: true,
|
|
76950
|
+
sectioningSettings: true,
|
|
76951
|
+
// Control bar - Visibility
|
|
76952
|
+
visibilityEnable: true,
|
|
76953
|
+
visibilityClearSelection: true,
|
|
76954
|
+
visibilityShowAll: true,
|
|
76955
|
+
visibilityToggle: true,
|
|
76956
|
+
visibilityIsolate: true,
|
|
76957
|
+
visibilityAutoIsolate: true,
|
|
76958
|
+
visibilitySettings: true,
|
|
76959
|
+
settings: true
|
|
76960
|
+
}
|
|
76961
|
+
};
|
|
76962
|
+
}
|
|
76963
|
+
function getControlBarUltraSettings() {
|
|
76964
|
+
return [
|
|
76965
|
+
{
|
|
76966
|
+
type: "subtitle",
|
|
76967
|
+
key: SettingsPanelKeys.ControlBarSettingsSubtitle,
|
|
76968
|
+
title: "Control Bar - Settings"
|
|
76969
|
+
},
|
|
76970
|
+
{
|
|
76971
|
+
type: "toggle",
|
|
76972
|
+
key: SettingsPanelKeys.ControlBarSettingsShowSettingsButtonToggle,
|
|
76973
|
+
label: "Settings",
|
|
76974
|
+
getter: (s) => s.ui.settings,
|
|
76975
|
+
setter: (s, v) => s.ui.settings = v
|
|
76976
|
+
}
|
|
76977
|
+
];
|
|
76978
|
+
}
|
|
76979
|
+
function getUltraSettingsContent(viewer) {
|
|
76980
|
+
return [
|
|
76981
|
+
...getControlBarCameraSettings(),
|
|
76982
|
+
...getControlBarVisibilitySettings(),
|
|
76983
|
+
...getControlBarSectionBoxSettings(),
|
|
76984
|
+
...getControlBarUltraSettings()
|
|
76985
|
+
];
|
|
76986
|
+
}
|
|
76987
|
+
function createViewer(container, settings2) {
|
|
76455
76988
|
const controllablePromise = new ControllablePromise();
|
|
76456
76989
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76457
76990
|
const core = Viewer$2.createWithCanvas(cmpContainer.gfx);
|
|
@@ -76470,6 +77003,7 @@ function createViewer(container) {
|
|
|
76470
77003
|
{
|
|
76471
77004
|
container: cmpContainer,
|
|
76472
77005
|
core,
|
|
77006
|
+
settings: settings2,
|
|
76473
77007
|
onMount: (cmp) => controllablePromise.resolve(attachDispose(cmp))
|
|
76474
77008
|
}
|
|
76475
77009
|
)
|
|
@@ -76477,6 +77011,7 @@ function createViewer(container) {
|
|
|
76477
77011
|
return controllablePromise.promise;
|
|
76478
77012
|
}
|
|
76479
77013
|
function Viewer3(props) {
|
|
77014
|
+
const settings2 = useSettings(props.settings ?? {}, getDefaultUltraSettings());
|
|
76480
77015
|
const sectionBoxRef = useUltraSectionBox(props.core);
|
|
76481
77016
|
const camera2 = useUltraCamera(props.core, sectionBoxRef);
|
|
76482
77017
|
const isolationPanelHandle = useRef(null);
|
|
@@ -76486,7 +77021,15 @@ function Viewer3(props) {
|
|
|
76486
77021
|
const [_, setSelectState] = useState(0);
|
|
76487
77022
|
const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
|
|
76488
77023
|
const isolationRef = useUltraIsolation(props.core);
|
|
76489
|
-
const controlBar = useUltraControlBar(
|
|
77024
|
+
const controlBar = useUltraControlBar(
|
|
77025
|
+
props.core,
|
|
77026
|
+
sectionBoxRef,
|
|
77027
|
+
isolationRef,
|
|
77028
|
+
camera2,
|
|
77029
|
+
settings2.value,
|
|
77030
|
+
side,
|
|
77031
|
+
(_2) => _2
|
|
77032
|
+
);
|
|
76490
77033
|
useViewerInput(props.core.inputs, camera2);
|
|
76491
77034
|
useEffect(() => {
|
|
76492
77035
|
sectionBoxRef.showOffsetPanel.onChange.subscribe((show) => {
|
|
@@ -76511,6 +77054,11 @@ function Viewer3(props) {
|
|
|
76511
77054
|
isolation: isolationRef,
|
|
76512
77055
|
sectionBox: sectionBoxRef,
|
|
76513
77056
|
camera: camera2,
|
|
77057
|
+
settings: {
|
|
77058
|
+
update: settings2.update,
|
|
77059
|
+
register: settings2.register,
|
|
77060
|
+
customize: (c) => settings2.customizer.set(c)
|
|
77061
|
+
},
|
|
76514
77062
|
get isolationPanel() {
|
|
76515
77063
|
return isolationPanelHandle.current;
|
|
76516
77064
|
},
|
|
@@ -76525,7 +77073,24 @@ function Viewer3(props) {
|
|
|
76525
77073
|
load: patchLoad(props.core, modalHandle)
|
|
76526
77074
|
});
|
|
76527
77075
|
}, []);
|
|
77076
|
+
const sidePanel = () => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77077
|
+
SettingsPanel,
|
|
77078
|
+
{
|
|
77079
|
+
visible: side.getContent() === "settings",
|
|
77080
|
+
content: getUltraSettingsContent(props.core),
|
|
77081
|
+
settings: settings2
|
|
77082
|
+
}
|
|
77083
|
+
) });
|
|
76528
77084
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
77085
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77086
|
+
SidePanelMemo,
|
|
77087
|
+
{
|
|
77088
|
+
container: props.container,
|
|
77089
|
+
viewer: props.core,
|
|
77090
|
+
side,
|
|
77091
|
+
content: sidePanel
|
|
77092
|
+
}
|
|
77093
|
+
),
|
|
76529
77094
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
76530
77095
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76531
77096
|
whenTrue(true, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
|
|
@@ -76538,7 +77103,7 @@ function Viewer3(props) {
|
|
|
76538
77103
|
}
|
|
76539
77104
|
),
|
|
76540
77105
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel$1, { ref: sectionBoxPanelHandle, state: sectionBoxRef }),
|
|
76541
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef })
|
|
77106
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel$1, { ref: isolationPanelHandle, state: isolationRef, transparency: false })
|
|
76542
77107
|
] });
|
|
76543
77108
|
} }),
|
|
76544
77109
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ref: modalHandle, canFollowLinks: true }),
|
|
@@ -76576,7 +77141,8 @@ function patchLoad(viewer, modal) {
|
|
|
76576
77141
|
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76577
77142
|
__proto__: null,
|
|
76578
77143
|
Viewer: Viewer3,
|
|
76579
|
-
createViewer
|
|
77144
|
+
createViewer,
|
|
77145
|
+
getDefaultUltraSettings
|
|
76580
77146
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76581
77147
|
const SectionBoxPanel = {
|
|
76582
77148
|
Ids
|