mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-04 11:51:58 +02:00
[PanoramaViewer] add grid opacity slider
This commit is contained in:
parent
41a5e5c171
commit
8dc30a9db1
3 changed files with 58 additions and 4 deletions
|
@ -10,9 +10,11 @@ FloatingPane {
|
||||||
padding: 5
|
padding: 5
|
||||||
radius: 0
|
radius: 0
|
||||||
|
|
||||||
|
property int opacityDefaultValue: 100
|
||||||
property real gainDefaultValue: 1
|
property real gainDefaultValue: 1
|
||||||
property real gammaDefaultValue: 1
|
property real gammaDefaultValue: 1
|
||||||
property real slidersPowerValue: 4
|
property real slidersPowerValue: 4
|
||||||
|
property int opacityValue: Math.pow(opacityCtrl.value, 1)
|
||||||
property real gainValue: Math.pow(gainCtrl.value, slidersPowerValue)
|
property real gainValue: Math.pow(gainCtrl.value, slidersPowerValue)
|
||||||
property real gammaValue: Math.pow(gammaCtrl.value, slidersPowerValue)
|
property real gammaValue: Math.pow(gammaCtrl.value, slidersPowerValue)
|
||||||
property string channelModeValue: channelsCtrl.value
|
property string channelModeValue: channelsCtrl.value
|
||||||
|
@ -56,6 +58,46 @@ FloatingPane {
|
||||||
checked: false
|
checked: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grid opacity slider
|
||||||
|
RowLayout {
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
ToolButton {
|
||||||
|
text: "Grid Opacity"
|
||||||
|
|
||||||
|
ToolTip.visible: ToolTip.text && hovered
|
||||||
|
ToolTip.delay: 100
|
||||||
|
ToolTip.text: "Reset Opacity"
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
opacityCtrl.value = opacityDefaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TextField {
|
||||||
|
id: opacityLabel
|
||||||
|
|
||||||
|
ToolTip.visible: ToolTip.text && hovered
|
||||||
|
ToolTip.delay: 100
|
||||||
|
ToolTip.text: "Grid opacity"
|
||||||
|
|
||||||
|
text: opacityValue.toFixed(1)
|
||||||
|
Layout.preferredWidth: textMetrics_opacityValue.width
|
||||||
|
selectByMouse: true
|
||||||
|
validator: doubleValidator
|
||||||
|
onAccepted: {
|
||||||
|
opacityCtrl.value = Number(opacityLabel.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Slider {
|
||||||
|
id: opacityCtrl
|
||||||
|
Layout.fillWidth: true
|
||||||
|
from: 0
|
||||||
|
to: 100
|
||||||
|
value: opacityDefaultValue
|
||||||
|
stepSize: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// gain slider
|
// gain slider
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
@ -142,4 +184,9 @@ FloatingPane {
|
||||||
font: gainLabel.font
|
font: gainLabel.font
|
||||||
text: "1.2345"
|
text: "1.2345"
|
||||||
}
|
}
|
||||||
|
TextMetrics {
|
||||||
|
id: textMetrics_opacityValue
|
||||||
|
font: opacityLabel.font
|
||||||
|
text: "100.000"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,16 @@ AliceVision.PanoramaViewer {
|
||||||
property bool isGridDisplayed : false;
|
property bool isGridDisplayed : false;
|
||||||
property string channelModeString : "rgba"
|
property string channelModeString : "rgba"
|
||||||
|
|
||||||
|
property int gridOpacity : 100;
|
||||||
|
|
||||||
onIsGridDisplayedChanged: {
|
onIsGridDisplayedChanged: {
|
||||||
root.displayGrid()
|
root.displayGrid()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onGridOpacityChanged: {
|
||||||
|
root.setGridColorQML(Qt.rgba(255, 0, 0, gridOpacity/100));
|
||||||
|
}
|
||||||
|
|
||||||
channelMode: {
|
channelMode: {
|
||||||
switch(channelModeString)
|
switch(channelModeString)
|
||||||
{
|
{
|
||||||
|
@ -101,8 +107,8 @@ AliceVision.PanoramaViewer {
|
||||||
id: rectGrid
|
id: rectGrid
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rect
|
id: rect
|
||||||
width: 20; height: width
|
width: root.sourceSize.width/100; height: width
|
||||||
radius: 10
|
radius: width/2
|
||||||
x: root.getVertex(model.index).x - (width / 2)
|
x: root.getVertex(model.index).x - (width / 2)
|
||||||
y: root.getVertex(model.index).y - (height / 2)
|
y: root.getVertex(model.index).y - (height / 2)
|
||||||
color: "yellow"
|
color: "yellow"
|
||||||
|
@ -116,7 +122,7 @@ AliceVision.PanoramaViewer {
|
||||||
drag.smoothed: false
|
drag.smoothed: false
|
||||||
drag.axis: Drag.XAndYAxis
|
drag.axis: Drag.XAndYAxis
|
||||||
onReleased: {
|
onReleased: {
|
||||||
root.setVertex(index, rect.x + (20 / 2), rect.y + (20 / 2))
|
root.setVertex(index, rect.x + (width / 2), rect.y + (height / 2))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,8 @@ FocusScope {
|
||||||
'gamma': Qt.binding(function() { return panoramaImageToolbar.gammaValue; }),
|
'gamma': Qt.binding(function() { return panoramaImageToolbar.gammaValue; }),
|
||||||
'gain': Qt.binding(function() { return panoramaImageToolbar.gainValue; }),
|
'gain': Qt.binding(function() { return panoramaImageToolbar.gainValue; }),
|
||||||
'channelModeString': Qt.binding(function() { return panoramaImageToolbar.channelModeValue; }),
|
'channelModeString': Qt.binding(function() { return panoramaImageToolbar.channelModeValue; }),
|
||||||
'isGridDisplayed' : Qt.binding(function(){ return panoramaImageToolbar.displayGrid;})
|
'isGridDisplayed' : Qt.binding(function(){ return panoramaImageToolbar.displayGrid;}),
|
||||||
|
'gridOpacity' : Qt.binding(function(){ return panoramaImageToolbar.opacityValue;})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue