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 Mar 18, 2024
1 parent bd8af38 commit 23540dc
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 @@ -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
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 @@ -185,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 @@ -230,6 +235,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 @@ -103,6 +104,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 }),
'resectionId': Qt.binding(function() { return Viewer3DSettings.resectionId }),
'displayResections': Qt.binding(function() { return Viewer3DSettings.displayResectionIds })
Expand Down

0 comments on commit 23540dc

Please sign in to comment.