Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visualisation mode for landmarks observations #2177

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 16 additions & 0 deletions meshroom/ui/qml/Viewer3D/Inspector3D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,22 @@ FloatingPane {
}
}

// Observations visibility (if Sfm node)
MaterialToolButton {
visible: model.hasObservations
enabled: model.visible
Layout.alignment: Qt.AlignTop
Layout.fillHeight: true
text: MaterialIcons.compare_arrows
font.pointSize: 10
ToolTip.text: model.displayObservations ? "Hide observations" : "Show observations"
flat: true
opacity: model.visible ? (model.displayObservations ? 1.0 : 0.6) : 0.6
onClicked: {
model.displayObservations = !model.displayObservations
}
}

// Media label and info
Item {
implicitHeight: childrenRect.height
Expand Down
9 changes: 9 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 @@ -50,6 +52,8 @@ Entity {
"displayBoundingBox": true, // for Meshing node only
"hasTransform": false, // for SfMTransform node only
"displayTransform": true, // for SfMTransform node only
"hasObservations": false, // for nodes with Sfm data only
"displayObservations": false, // for nodes with Sfm data only
"section": "",
"attribute": null,
"entity": null,
Expand Down Expand Up @@ -183,6 +187,9 @@ Entity {
onHasTransformChanged: model.hasTransform = hasTransform
property bool displayTransform: model.displayTransform

// Specific properties to nodes with Sfm data (declared and initialized for every Entity anyway)
property bool hasObservations: nodeType === "SfMFilter" || nodeType === "StructureFromMotion"
onHasObservationsChanged: model.hasObservations = hasObservations

// Create the medias
MediaLoader {
Expand Down Expand Up @@ -227,6 +234,8 @@ Entity {
camera: root.camera
renderMode: root.renderMode
enabled: visible
viewer2DInfo: root.viewer2DInfo
displayObservations: model.displayObservations

// QObject.destroyed signal is not accessible
// Use the object as NodeInstantiator model to be notified of its deletion
Expand Down
6 changes: 6 additions & 0 deletions meshroom/ui/qml/Viewer3D/MediaLoader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import Utils 1.0
property var object: null
property int renderMode

property var viewer2DInfo: null
property bool displayObservations: false

/// Scene's current camera
property Camera camera: null

Expand Down Expand Up @@ -99,6 +102,9 @@ import Utils 1.0
'source': source,
'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}),
'displayObservations': Qt.binding(function() {return root.displayObservations}),
'cameraPickingEnabled': Qt.binding(function() { return root.enabled }),
'resectionId': Qt.binding(function() { return Viewer3DSettings.resectionId }),
'displayResections': Qt.binding(function() { return Viewer3DSettings.displayResectionIds })
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
Loading