[ui] ImageGallery: add SensorDBDialog + 'rebuild intrinsics' feature

* add SensorDBDialog explaining how to add a new entry in the sensor DB and ease the access to the sensor database
* enable intrinsics rebuild at user level from this dialog
* MessageDialog: react to clicks on hyperlinks
This commit is contained in:
Yann Lanthony 2019-01-23 18:52:59 +01:00
parent 6c9ed42736
commit 49e809df2b
3 changed files with 94 additions and 0 deletions

View file

@ -83,17 +83,20 @@ Dialog {
id: textLabel id: textLabel
font.bold: true font.bold: true
visible: text != "" visible: text != ""
onLinkActivated: Qt.openUrlExternally(link)
} }
// Detailed text // Detailed text
Label { Label {
id: detailedLabel id: detailedLabel
text: text text: text
visible: text != "" visible: text != ""
onLinkActivated: Qt.openUrlExternally(link)
} }
// Additional helper text // Additional helper text
Label { Label {
id: helperLabel id: helperLabel
visible: text != "" visible: text != ""
onLinkActivated: Qt.openUrlExternally(link)
} }
} }

View file

@ -40,6 +40,13 @@ Panel {
id: graphEditorMenu id: graphEditorMenu
y: parent.height y: parent.height
x: -width + parent.width x: -width + parent.width
MenuItem {
text: "Edit Sensor Database..."
onTriggered: {
sensorDBDialog.open()
}
}
Menu { Menu {
title: "Advanced" title: "Advanced"
Action { Action {
@ -51,6 +58,14 @@ Panel {
} }
} }
} }
SensorDBDialog {
id: sensorDBDialog
sensorDatabase: Filepath.stringToUrl(cameraInit.attribute("sensorDatabase").value)
readOnly: _reconstruction.computing
onUpdateIntrinsicsRequest: _reconstruction.rebuildIntrinsics(cameraInit)
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 4 spacing: 4

View file

@ -0,0 +1,76 @@
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import MaterialIcons 2.2
import Controls 1.0
MessageDialog {
id: root
property url sensorDatabase
property bool readOnly: false
signal updateIntrinsicsRequest()
icon.text: MaterialIcons.camera
icon.font.pointSize: 10
modal: true
parent: Overlay.overlay
canCopy: false
title: "Sensor Database"
text: "Add missing Camera Models to the Sensor Database to improve your results."
detailedText: "If a warning is displayed on your images, adding your Camera Model to the Sensor Database\n"+
"can help fix it and improve your reconstruction results."
helperText: 'To update the Sensor Database (<a href="https://github.com/alicevision/meshroom/wiki/Add-Camera-to-database">complete guide</a>):<br>' +
' - Look for the "sensor width" in millimeters of your Camera Model<br>' +
' - Add a new line in the Database following this pattern: Make;Model;SensorWidthInMM<br>' +
' - Click on "' + rebuildIntrinsics.text + '" once the Database has been saved<br>' +
' - Contribute to the <a href="https://github.com/alicevision/AliceVision/blob/develop/src/aliceVision/sensorDB/cameraSensors.db">online Database</a>'
ColumnLayout {
RowLayout {
Layout.fillWidth: true
spacing: 2
Label {
text: "Sensor Database:"
}
TextField {
id: sensorDBTextField
Layout.fillWidth: true
text: Filepath.normpath(sensorDatabase)
selectByMouse: true
readOnly: true
}
MaterialToolButton {
text: MaterialIcons.assignment
ToolTip.text: "Copy Path"
onClicked: {
sensorDBTextField.selectAll();
sensorDBTextField.copy();
ToolTip.text = "Path has been copied!"
}
onHoveredChanged: if(!hovered) ToolTip.text = "Copy Path"
}
MaterialToolButton {
text: MaterialIcons.open_in_new
ToolTip.text: "Open in External Editor"
onClicked: Qt.openUrlExternally(sensorDatabase)
}
}
}
Button {
id: rebuildIntrinsics
text: "Update Intrinsics"
enabled: !readOnly
onClicked: updateIntrinsicsRequest()
Layout.alignment: Qt.AlignCenter
}
standardButtons: Dialog.Close
onAccepted: close()
}