diff --git a/meshroom/ui/qml/Viewer3D/Inspector3D.qml b/meshroom/ui/qml/Viewer3D/Inspector3D.qml index 6674946f35..7455461034 100644 --- a/meshroom/ui/qml/Viewer3D/Inspector3D.qml +++ b/meshroom/ui/qml/Viewer3D/Inspector3D.qml @@ -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 diff --git a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml index 76684272d6..98681c753a 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, @@ -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 { @@ -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 diff --git a/meshroom/ui/qml/Viewer3D/MediaLoader.qml b/meshroom/ui/qml/Viewer3D/MediaLoader.qml index 8c73a8c678..27eec0c448 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 @@ -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 })