diff --git a/meshroom/ui/qml/Viewer3D/Inspector3D.qml b/meshroom/ui/qml/Viewer3D/Inspector3D.qml index 5b03ad209ae..f621a7392fc 100644 --- a/meshroom/ui/qml/Viewer3D/Inspector3D.qml +++ b/meshroom/ui/qml/Viewer3D/Inspector3D.qml @@ -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 diff --git a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml index 9ad9c8fe67c..a2ed70e4be4 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml @@ -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, @@ -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 { @@ -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 diff --git a/meshroom/ui/qml/Viewer3D/MediaLoader.qml b/meshroom/ui/qml/Viewer3D/MediaLoader.qml index c28d9e4d4f1..3c51d236056 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLoader.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLoader.qml @@ -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 @@ -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 }) });