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