From 73c6e68d0221d93cda75fe3ae8e4da202e2baf78 Mon Sep 17 00:00:00 2001 From: Landrodie Date: Mon, 18 Jan 2021 10:11:10 +0100 Subject: [PATCH] [Lens Distortion] Display points only in distortion viewer --- meshroom/ui/qml/Viewer/FloatImage.qml | 9 ++++----- meshroom/ui/qml/Viewer/Viewer2D.qml | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/meshroom/ui/qml/Viewer/FloatImage.qml b/meshroom/ui/qml/Viewer/FloatImage.qml index 3abec3f8..f07777b7 100644 --- a/meshroom/ui/qml/Viewer/FloatImage.qml +++ b/meshroom/ui/qml/Viewer/FloatImage.qml @@ -33,8 +33,7 @@ AliceVision.FloatImageViewer { property string channelModeString : "rgba" - // rename into distortionView - property bool distortion: false; + property bool isDistoViewer: false; property bool isGridDisplayed : false; property int gridOpacity : 100; @@ -44,8 +43,7 @@ AliceVision.FloatImageViewer { property int subdivisions: 5; property int pointsNumber: (subdivisions + 1) * (subdivisions + 1); - onDistortionChanged: { - console.warn("distortion"); + onIsDistoViewerChanged: { root.hasDistortion(distortion); } @@ -138,7 +136,7 @@ AliceVision.FloatImageViewer { x: root.getVertex(model.index).x - (width / 2) y: root.getVertex(model.index).y - (height / 2) color: Colors.yellow - visible: true + visible: isDistoViewer MouseArea { id: mouseAreaCP anchors.fill : parent; @@ -157,6 +155,7 @@ AliceVision.FloatImageViewer { Repeater { id: repeater model: pointsNumber + visible: false delegate: rectGrid function displayControlPoints() { for (let i = 0; i < model; i++) { diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 995b55f3..9650cb01 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -227,8 +227,8 @@ FocusScope { 'isGridDisplayed' : Qt.binding(function(){ return lensDistortionImageToolbar.displayGrid;}), 'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}), 'gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}), - 'distortion' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}), 'subdivisions' : Qt.binding(function(){ return lensDistortionImageToolbar.subdivisionsValue;}), + 'isDistoViewer' : Qt.binding(function(){ return displayLensDistortionViewer.checked;}), }) } else { // Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14 @@ -732,7 +732,7 @@ FocusScope { id: resolutionLabel Layout.fillWidth: true text: (imgContainer.image && imgContainer.image.sourceSize.width > 0) ? (imgContainer.image.sourceSize.width + "x" + imgContainer.image.sourceSize.height) : "" - + elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter } @@ -745,7 +745,7 @@ FocusScope { Layout.minimumWidth: 0 Layout.preferredWidth: 6.0 * Qt.application.font.pixelSize flat: true - + property var types: ["image", "depth", "sim"] property string type: enabled ? types[currentIndex] : types[0]