Skip to content

Commit a1e1621

Browse files
committed
[QtAV][Observations] add option to activate or deactivate observations visualisation
1 parent 8e503a6 commit a1e1621

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
@@ -339,6 +339,22 @@ FloatingPane {
339339
}
340340
}
341341

342+
// Observations visibility (if Sfm node)
343+
MaterialToolButton {
344+
visible: model.hasObservations
345+
enabled: model.visible
346+
Layout.alignment: Qt.AlignTop
347+
Layout.fillHeight: true
348+
text: MaterialIcons.compare_arrows
349+
font.pointSize: 10
350+
ToolTip.text: model.displayObservations ? "Hide observations" : "Show observations"
351+
flat: true
352+
opacity: model.visible ? (model.displayObservations ? 1.0 : 0.6) : 0.6
353+
onClicked: {
354+
model.displayObservations = !model.displayObservations
355+
}
356+
}
357+
342358
// Media label and info
343359
Item {
344360
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,
@@ -183,6 +185,9 @@ Entity {
183185
onHasTransformChanged: model.hasTransform = hasTransform
184186
property bool displayTransform: model.displayTransform
185187

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

187192
// Create the media
188193
MediaLoader {
@@ -228,6 +233,7 @@ Entity {
228233
renderMode: root.renderMode
229234
enabled: visible
230235
viewer2DInfo: root.viewer2DInfo
236+
displayObservations: model.displayObservations
231237

232238
// QObject.destroyed signal is not accessible
233239
// 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
@@ -94,6 +95,7 @@ import Utils 1.0
9495
'locatorScale': Qt.binding(function() { return Viewer3DSettings.cameraScale }),
9596
'viewId': Qt.binding(function() { return _reconstruction.selectedViewId }),
9697
'viewer2DInfo': Qt.binding(function() {return root.viewer2DInfo}),
98+
'displayObservations': Qt.binding(function() {return root.displayObservations}),
9799
'cameraPickingEnabled': Qt.binding(function() { return root.enabled })
98100
});
99101

0 commit comments

Comments
 (0)