Skip to content

Commit

Permalink
[QtAV][Observations] add 2D viewer information for visualization of o…
Browse files Browse the repository at this point in the history
…bservations

- visualizing landmarks observations in 3D is now influenced by the 2D viewer
  • Loading branch information
almarouk committed Sep 26, 2023
1 parent 3fe52f4 commit 6802dda
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions meshroom/ui/qml/Viewer/Viewer2D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
3 changes: 3 additions & 0 deletions meshroom/ui/qml/Viewer3D/MediaLibrary.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Entity {
property Layer frontLayerComponent
property var window

property var viewer2DInfo: null

/// Camera to consider for positioning
property Camera camera: null

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions meshroom/ui/qml/Viewer3D/MediaLoader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 })
});

Expand Down
2 changes: 2 additions & 0 deletions meshroom/ui/qml/Viewer3D/Viewer3D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions meshroom/ui/qml/WorkspaceView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6802dda

Please sign in to comment.