Skip to content

Commit

Permalink
[QtAV][Observations] add option to activate or deactivate observation…
Browse files Browse the repository at this point in the history
…s visualisation
  • Loading branch information
almarouk committed Sep 22, 2023
1 parent be53ea3 commit 268b6bd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions meshroom/ui/qml/Viewer3D/Inspector3D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,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
6 changes: 6 additions & 0 deletions meshroom/ui/qml/Viewer3D/MediaLibrary.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,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 +185,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 media
MediaLoader {
Expand Down Expand Up @@ -228,6 +233,7 @@ Entity {
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
2 changes: 2 additions & 0 deletions meshroom/ui/qml/Viewer3D/MediaLoader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Utils 1.0
property int renderMode

property var viewer2DInfo: null
property bool displayObservations: false

/// Scene's current camera
property Camera camera: null
Expand Down Expand Up @@ -94,6 +95,7 @@ import Utils 1.0
'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 })
});

Expand Down

0 comments on commit 268b6bd

Please sign in to comment.