Skip to content

Commit 94e8ed3

Browse files
committed
[QtAV][Observations] add option to activate or deactivate observations visualisation
1 parent 7922075 commit 94e8ed3

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

meshroom/ui/qml/Viewer3D/Inspector3D.qml

+16
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,22 @@ FloatingPane {
496496
}
497497
}
498498

499+
// Observations visibility (if Sfm node)
500+
MaterialToolButton {
501+
visible: model.hasObservations
502+
enabled: model.visible
503+
Layout.alignment: Qt.AlignTop
504+
Layout.fillHeight: true
505+
text: MaterialIcons.compare_arrows
506+
font.pointSize: 10
507+
ToolTip.text: model.displayObservations ? "Hide observations" : "Show observations"
508+
flat: true
509+
opacity: model.visible ? (model.displayObservations ? 1.0 : 0.6) : 0.6
510+
onClicked: {
511+
model.displayObservations = !model.displayObservations
512+
}
513+
}
514+
499515
// Media label and info
500516
Item {
501517
implicitHeight: childrenRect.height

meshroom/ui/qml/Viewer3D/MediaLibrary.qml

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Entity {
5252
"displayBoundingBox": true, // for Meshing node only
5353
"hasTransform": false, // for SfMTransform node only
5454
"displayTransform": true, // for SfMTransform node only
55+
"hasObservations": false, // for nodes with Sfm data only
56+
"displayObservations": false, // for nodes with Sfm data only
5557
"section": "",
5658
"attribute": null,
5759
"entity": null,
@@ -185,6 +187,9 @@ Entity {
185187
onHasTransformChanged: model.hasTransform = hasTransform
186188
property bool displayTransform: model.displayTransform
187189

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

189194
// Create the medias
190195
MediaLoader {
@@ -230,6 +235,7 @@ Entity {
230235
renderMode: root.renderMode
231236
enabled: visible
232237
viewer2DInfo: root.viewer2DInfo
238+
displayObservations: model.displayObservations
233239

234240
// QObject.destroyed signal is not accessible
235241
// Use the object as NodeInstantiator model to be notified of its deletion

meshroom/ui/qml/Viewer3D/MediaLoader.qml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import Utils 1.0
2121
property int renderMode
2222

2323
property var viewer2DInfo: null
24+
property bool displayObservations: false
2425

2526
/// Scene's current camera
2627
property Camera camera: null
@@ -103,6 +104,7 @@ import Utils 1.0
103104
'locatorScale': Qt.binding(function() { return Viewer3DSettings.cameraScale }),
104105
'viewId': Qt.binding(function() { return _reconstruction.selectedViewId }),
105106
'viewer2DInfo': Qt.binding(function() {return root.viewer2DInfo}),
107+
'displayObservations': Qt.binding(function() {return root.displayObservations}),
106108
'cameraPickingEnabled': Qt.binding(function() { return root.enabled }),
107109
'resectionId': Qt.binding(function() { return Viewer3DSettings.resectionId }),
108110
'displayResections': Qt.binding(function() { return Viewer3DSettings.displayResectionIds })

0 commit comments

Comments
 (0)