mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-28 16:36:32 +02:00
[PanoramaViewer] Refactor downscale code logic
Use signals / slots from c++
This commit is contained in:
parent
a4a86e9656
commit
cf01a2d89c
3 changed files with 8 additions and 24 deletions
|
@ -49,7 +49,6 @@ AliceVision.FloatImageViewer {
|
|||
|
||||
property bool isGridDisplayed : false;
|
||||
property int gridOpacity : 100;
|
||||
property color gridColorQML : "#FF0000";
|
||||
|
||||
property bool isCtrlPointsDisplayed : true;
|
||||
property int subdivisions: 4;
|
||||
|
@ -60,12 +59,6 @@ AliceVision.FloatImageViewer {
|
|||
|
||||
property string sfmPath: ""
|
||||
|
||||
property int downscaleLevel: 0
|
||||
|
||||
onDownscaleLevelChanged: {
|
||||
root.setDownscale(downscaleLevel)
|
||||
}
|
||||
|
||||
function updateSfmPath() {
|
||||
var activeNode = _reconstruction.activeNodes.get('SfMTransform').node;
|
||||
|
||||
|
@ -128,11 +121,7 @@ AliceVision.FloatImageViewer {
|
|||
}
|
||||
|
||||
onGridOpacityChanged: {
|
||||
root.surface.gridColor = Qt.rgba(gridColorQML.r, gridColorQML.g, gridColorQML.b, gridOpacity/100);;
|
||||
}
|
||||
|
||||
onGridColorQMLChanged: {
|
||||
root.surface.gridColor = gridColorQML;
|
||||
root.surface.gridColor = Qt.rgba(root.surface.gridColor.r, root.surface.gridColor.g, root.surface.gridColor.b, gridOpacity/100);;
|
||||
}
|
||||
|
||||
channelMode: {
|
||||
|
|
|
@ -34,11 +34,7 @@ AliceVision.PanoramaViewer {
|
|||
}
|
||||
property var readyToLoad: Image.Null
|
||||
|
||||
// Value from ui button
|
||||
property int downscaleValueQML: 0
|
||||
|
||||
// Value from cpp at initialisation
|
||||
property int downscaleValueCpp: 0
|
||||
property int downscale: 0
|
||||
|
||||
property int subdivisionsPano: 12
|
||||
|
||||
|
@ -61,9 +57,9 @@ AliceVision.PanoramaViewer {
|
|||
}
|
||||
}
|
||||
|
||||
onDownscaleValueQMLChanged: {
|
||||
onDownscaleChanged: {
|
||||
for (var i = 0; i < repeater.model; i++) {
|
||||
repeater.itemAt(i).item.downscaleLevel = downscaleValueQML;
|
||||
repeater.itemAt(i).item.downscaleLevel = downscale;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,7 +235,7 @@ AliceVision.PanoramaViewer {
|
|||
if(active) {
|
||||
setSource("FloatImage.qml", {
|
||||
'isPanoViewer' : true,
|
||||
'downscaleLevel' : root.downscaleValueCpp,
|
||||
'downscaleLevel' : root.downscale,
|
||||
'source': Qt.binding(function() { return cSource; }),
|
||||
'index' : index,
|
||||
'idView': Qt.binding(function() { return cId; }),
|
||||
|
@ -273,8 +269,7 @@ AliceVision.PanoramaViewer {
|
|||
//Iterating through the map
|
||||
for (var path in imagesData) {
|
||||
if (path === "lvl") {
|
||||
root.downscaleValueCpp = imagesData[path];
|
||||
panoramaViewerToolbar.updateDownscaleValue(root.downscaleValueCpp)
|
||||
panoramaViewerToolbar.updateDownscaleValue(imagesData[path])
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ FocusScope {
|
|||
'isCtrlPointsDisplayed' : Qt.binding(function(){ return lensDistortionImageToolbar.displayPoints;}),
|
||||
'isGridDisplayed' : Qt.binding(function(){ return lensDistortionImageToolbar.displayGrid;}),
|
||||
'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
||||
'gridColorQML' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
||||
'surface.gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
||||
'subdivisions' : Qt.binding(function(){ return lensDistortionImageToolbar.subdivisionsValue;}),
|
||||
'isDistoViewer' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}),
|
||||
})
|
||||
|
@ -300,7 +300,7 @@ FocusScope {
|
|||
onActiveChanged: {
|
||||
if(active) {
|
||||
setSource("PanoramaViewer.qml", {
|
||||
'downscaleValueQML': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
|
||||
'downscale': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
|
||||
'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}),
|
||||
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
|
||||
'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue