From f25b5fe7552cae23ab47f975b9a6cd7551c8f12b Mon Sep 17 00:00:00 2001 From: Nils Landrodie Date: Fri, 27 Aug 2021 18:37:34 +0200 Subject: [PATCH] [Panorama Viewer] Change the method to get the fisheye circle parameters --- meshroom/ui/qml/Viewer/PanoramaViewer.qml | 7 ++----- meshroom/ui/qml/Viewer/Viewer2D.qml | 16 ++++------------ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/meshroom/ui/qml/Viewer/PanoramaViewer.qml b/meshroom/ui/qml/Viewer/PanoramaViewer.qml index 198af364..2cacbd0d 100644 --- a/meshroom/ui/qml/Viewer/PanoramaViewer.qml +++ b/meshroom/ui/qml/Viewer/PanoramaViewer.qml @@ -40,9 +40,7 @@ AliceVision.PanoramaViewer { property int mouseMultiplier: 1 - property bool isFisheyePano: false - - property vector3d fisheyeCircleParametersPano + property bool cropFisheyePano: false property var idSelected : -1 @@ -250,8 +248,7 @@ AliceVision.PanoramaViewer { 'surface.viewerType': AliceVision.Surface.EViewerType.PANORAMA, 'viewerTypeString': 'panorama', 'surface.subdivisions': Qt.binding(function() { return subdivisionsPano; }), - 'surface.isFisheye' : Qt.binding(function(){ return isFisheyePano; }), - 'fisheyeCircleParameters': Qt.binding(function(){ return fisheyeCircleParametersPano; }), + 'cropFisheye' : Qt.binding(function(){ return cropFisheyePano; }), 'surface.pitch': Qt.binding(function() { return root.pitch; }), 'surface.yaw': Qt.binding(function() { return root.yaw; }), 'surface.roll': Qt.binding(function() { return root.roll; }), diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index ceec4900..7e163066 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -20,15 +20,7 @@ FocusScope { property alias usePanoramaViewer: displayPanoramaViewer.checked property var activeNodeFisheye: _reconstruction.activeNodes.get("PanoramaInit").node - property bool isFisheye : activeNodeFisheye ? activeNodeFisheye.attribute("useFisheye").value : false - property bool useAutoFisheye: activeNodeFisheye ? activeNodeFisheye.attribute("estimateFisheyeCircle").value : true - property real userFisheyeRadius: activeNodeFisheye ? activeNodeFisheye.attribute("fisheyeRadius").value : 0 - property variant fisheyeAutoParams: activeNodeFisheye ? _reconstruction.getAutoFisheyeCircle(activeNodeFisheye) : null - - property real fisheyeCircleX: useAutoFisheye ? (fisheyeAutoParams ? (fisheyeAutoParams.x) : 0) : activeNodeFisheye.attribute("fisheyeCenterOffset.fisheyeCenterOffset_x").value - property real fisheyeCircleY: useAutoFisheye ? (fisheyeAutoParams ? (fisheyeAutoParams.y) : 0) : activeNodeFisheye.attribute("fisheyeCenterOffset.fisheyeCenterOffset_y").value - - property vector3d fisheyeCircleParametersVec: Qt.vector3d(fisheyeCircleX, fisheyeCircleY, userFisheyeRadius) + property bool cropFisheye : activeNodeFisheye ? activeNodeFisheye.attribute("useFisheye").value : false QtObject { id: m @@ -297,7 +289,8 @@ FocusScope { 'sfmRequired': Qt.binding(function(){ return displayLensDistortionViewer.checked ? true : false;}), 'surface.msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), 'canBeHovered': false, - 'idView': Qt.binding(function() { return _reconstruction.selectedViewId; }) + 'idView': Qt.binding(function() { return _reconstruction.selectedViewId; }), + 'cropFisheye': false }) } else { // Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14 @@ -318,8 +311,7 @@ FocusScope { if(active) { setSource("PanoramaViewer.qml", { 'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}), - 'isFisheyePano': Qt.binding(function(){ return root.isFisheye;}), - 'fisheyeCircleParametersPano' : Qt.binding(function(){ return root.fisheyeCircleParametersVec;}), + 'cropFisheyePano': Qt.binding(function(){ return root.cropFisheye;}), 'downscale': Qt.binding(function(){ return panoramaViewerToolbar.downscaleValue;}), 'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}), 'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),