Skip to content

Commit

Permalink
[Viewer3D] Inspector3D: Replace resectionID-related labels with ToolL…
Browse files Browse the repository at this point in the history
…abels
  • Loading branch information
cbentejac committed Nov 7, 2023
1 parent 45f857c commit 45b267a
Showing 1 changed file with 45 additions and 27 deletions.
72 changes: 45 additions & 27 deletions meshroom/ui/qml/Viewer3D/Inspector3D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ FloatingPane {
Layout.fillWidth: true
title: "CAMERA"


ColumnLayout {
width: parent.width

Expand Down Expand Up @@ -221,37 +220,56 @@ FloatingPane {
}
}

Label {
text: {
var id = Viewer3DSettings.resectionIdCount
if (Viewer3DSettings.resectionId !== undefined)
id = Math.min(Viewer3DSettings.resectionId, Viewer3DSettings.resectionIdCount)
return "Nb Of Cameras In Group " + id + ": " + Viewer3DSettings.resectionGroups[id]
}
font.pointSize: 8
RowLayout {
spacing: 10
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
visible: Viewer3DSettings.displayResectionIds
}
Layout.margins: 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

MaterialToolLabel {
iconText: MaterialIcons.stop
label: {
var id = undefined
// Ensure there are entries in resectionGroups and a valid resectionId before accessing anything
if (Viewer3DSettings.resectionId !== undefined && Viewer3DSettings.resectionGroups.length > 0)
id = Math.min(Viewer3DSettings.resectionId, Viewer3DSettings.resectionIdCount)
if (id !== undefined)
return Viewer3DSettings.resectionGroups[id]
return 0

Label {
text: {
let currentCameras = 0
let totalCameras = 0
for (let i = 0; i <= Viewer3DSettings.resectionIdCount; i++) {
if (i <= Viewer3DSettings.resectionId)
currentCameras += Viewer3DSettings.resectionGroups[i]
totalCameras += Viewer3DSettings.resectionGroups[i]
}
ToolTip.text: "Number Of Cameras In Current Resection Group"
visible: Viewer3DSettings.displayResectionIds
}

MaterialToolLabel {
iconText: MaterialIcons.auto_awesome_motion
label: {
let currentCameras = 0
for (let i = 0; i <= Viewer3DSettings.resectionIdCount; i++) {
if (i <= Viewer3DSettings.resectionId)
currentCameras += Viewer3DSettings.resectionGroups[i]
}

return "Nb Of Cumulated Cameras: " + currentCameras + "/" + totalCameras
return currentCameras
}
ToolTip.text: "Number Of Cumulated Cameras"
visible: Viewer3DSettings.displayResectionIds
}

MaterialToolLabel {
iconText: MaterialIcons.videocam
label: {
let totalCameras = 0
for (let i = 0; i <= Viewer3DSettings.resectionIdCount; i++) {
totalCameras += Viewer3DSettings.resectionGroups[i]
}

return totalCameras
}
ToolTip.text: "Total Number Of Cameras"
visible: Viewer3DSettings.displayResectionIds
}
font.pointSize: 8
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
visible: Viewer3DSettings.displayResectionIds
}
}
}
Expand Down

0 comments on commit 45b267a

Please sign in to comment.