From e907498f64716553ea4dea6277aac5dda41f77dd Mon Sep 17 00:00:00 2001 From: Abdelrahman AL MAROUK Date: Sun, 20 Aug 2023 11:01:10 +0200 Subject: [PATCH] [QtAV][Observations] add 2D viewer information for visualization of observations - visualizing landmarks observations in 3D is now influenced by the 2D viewer --- meshroom/ui/qml/Viewer/Viewer2D.qml | 3 +++ meshroom/ui/qml/Viewer3D/MediaLibrary.qml | 3 +++ meshroom/ui/qml/Viewer3D/MediaLoader.qml | 3 +++ meshroom/ui/qml/Viewer3D/Viewer3D.qml | 2 ++ meshroom/ui/qml/WorkspaceView.qml | 8 ++++++++ 5 files changed, 19 insertions(+) diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 9dfc0ad6bc..af328cd259 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -28,6 +28,9 @@ FocusScope { property bool enable8bitViewer: enable8bitViewerAction.checked property bool enableSequencePlayer: enableSequencePlayerAction.checked + readonly property alias imgContainer: imgContainer + readonly property alias imgLayout: imgLayout + QtObject { id: m property variant viewpointMetadata: { diff --git a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml index 0b5d49bffa..9ad9c8fe67 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml @@ -21,6 +21,8 @@ Entity { property Layer frontLayerComponent property var window + property var viewer2DInfo: null + /// Camera to consider for positioning property Camera camera: null @@ -225,6 +227,7 @@ Entity { camera: root.camera renderMode: root.renderMode enabled: visible + viewer2DInfo: root.viewer2DInfo // QObject.destroyed signal is not accessible // Use the object as NodeInstantiator model to be notified of its deletion diff --git a/meshroom/ui/qml/Viewer3D/MediaLoader.qml b/meshroom/ui/qml/Viewer3D/MediaLoader.qml index e56a18ba4a..c28d9e4d4f 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLoader.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLoader.qml @@ -20,6 +20,8 @@ import Utils 1.0 property var object: null property int renderMode + property var viewer2DInfo: null + /// Scene's current camera property Camera camera: null @@ -91,6 +93,7 @@ import Utils 1.0 'pointSize': Qt.binding(function() { return 0.01 * Viewer3DSettings.pointSize }), 'locatorScale': Qt.binding(function() { return Viewer3DSettings.cameraScale }), 'viewId': Qt.binding(function() { return _reconstruction.selectedViewId }), + 'viewer2DInfo': Qt.binding(function() {return root.viewer2DInfo}), 'cameraPickingEnabled': Qt.binding(function() { return root.enabled }) }); diff --git a/meshroom/ui/qml/Viewer3D/Viewer3D.qml b/meshroom/ui/qml/Viewer3D/Viewer3D.qml index e8be470650..5f09f901f5 100644 --- a/meshroom/ui/qml/Viewer3D/Viewer3D.qml +++ b/meshroom/ui/qml/Viewer3D/Viewer3D.qml @@ -29,6 +29,8 @@ FocusScope { readonly property var viewpoint: _reconstruction ? _reconstruction.selectedViewpoint : null readonly property bool doSyncViewpointCamera: Viewer3DSettings.syncViewpointCamera && (viewpoint && viewpoint.isReconstructed) + property alias viewer2DInfo: mediaLibrary.viewer2DInfo + // functions function resetCameraPosition() { mainCamera.position = defaultCamPosition; diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index 24d948313c..af794fd877 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -206,6 +206,14 @@ Item { Viewer3D { id: c_viewer3D + viewer2DInfo: { + "x": viewer2D.imgContainer.x, + "y": viewer2D.imgContainer.y, + "width": viewer2D.imgLayout.width, + "height": viewer2D.imgLayout.height, + "scale": viewer2D.imgContainer.scale + } + Layout.fillWidth: true Layout.fillHeight: true Layout.minimumWidth: 20