diff --git a/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml b/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml index e18b8b1e..7ea8724f 100644 --- a/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml +++ b/meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml @@ -18,7 +18,6 @@ FloatingPane { property var featureExtractionNode: null ColumnLayout { - // Header RowLayout { // FeatureExtraction node name @@ -77,12 +76,12 @@ FloatingPane { spacing: 4 - // Features visibility toogle (features) + // Features visibility toogle MaterialToolButton { id: featuresVisibilityButton checkable: true checked: true - text: featuresVisibilityButton.checked ? MaterialIcons.visibility : MaterialIcons.visibility_off + text: MaterialIcons.center_focus_strong onClicked: { console.warn("featuresVisibilityButton.checked: " + featuresVisibilityButton.checked) featureType.viewer.displayfeatures = featuresVisibilityButton.checked; @@ -91,20 +90,30 @@ FloatingPane { opacity: featureType.viewer.visible ? 1.0 : 0.6 } - // Landmarks visibility toogle (sfmData) + // Tracks visibility toogle + MaterialToolButton { + id: tracksVisibilityButton + checkable: true + checked: true + text: MaterialIcons.timeline + onClicked: { + console.warn("tracksVisibilityButton.checked: " + tracksVisibilityButton.checked) + featureType.viewer.displayTracks = tracksVisibilityButton.checked; + } + font.pointSize: 10 + } + + // Landmarks visibility toogle MaterialToolButton { id: landmarksVisibilityButton checkable: true checked: true - text: checked ? MaterialIcons.location_on : MaterialIcons.location_off + text: MaterialIcons.fiber_manual_record onClicked: { console.warn("landmarksVisibilityButton.checked: " + landmarksVisibilityButton.checked) featureType.viewer.displayLandmarks = landmarksVisibilityButton.checked; } font.pointSize: 10 - // checkable: enabled - // enabled: landmarks !== false - // opacity: featureType.viewer.visible ? 1.0 : 0.6 } // ColorChart picker @@ -118,7 +127,7 @@ FloatingPane { } // Feature type name Label { - text: featureType.viewer.describerType + (featureType.viewer.loadingFeatures ? "" : ": " + featureType.viewer.features.length) + text: featureType.viewer.describerType + (featureType.viewer.loadingFeatures ? "" : ": " + featureType.viewer.features.length + " / " + featureType.viewer.nbTracks + " / " + featureType.viewer.nbLandmarks ) } // Feature loading status Loader { diff --git a/meshroom/ui/qml/Viewer/FeaturesViewer.qml b/meshroom/ui/qml/Viewer/FeaturesViewer.qml index 7209b9df..83b796cc 100644 --- a/meshroom/ui/qml/Viewer/FeaturesViewer.qml +++ b/meshroom/ui/qml/Viewer/FeaturesViewer.qml @@ -15,7 +15,9 @@ Repeater { /// SfMData to display the data of SfM property var sfmData /// Folder containing the features files - property string folder + property string featureFolder + /// Folder containing the matches files + property var tracks /// The list of describer types to load property alias describerTypes: root.model /// List of available display modes @@ -32,7 +34,8 @@ Repeater { readonly property int colorIndex: (index + colorOffset) % root.colors.length property int colorOffset: 0 describerType: modelData - folder: root.folder + featureFolder: root.featureFolder + mtracks: root.tracks viewId: root.viewId color: root.colors[colorIndex] landmarkColor: Colors.red diff --git a/meshroom/ui/qml/Viewer/MTracks.qml b/meshroom/ui/qml/Viewer/MTracks.qml new file mode 100644 index 00000000..9b5afd08 --- /dev/null +++ b/meshroom/ui/qml/Viewer/MTracks.qml @@ -0,0 +1,6 @@ +import QtQuick 2.11 +import AliceVision 1.0 as AliceVision + +AliceVision.MTracks { + id: root +} diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 202fe8e9..d9bfb72b 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -231,7 +231,8 @@ FocusScope { setSource("FeaturesViewer.qml", { 'viewId': Qt.binding(function() { return _reconstruction.selectedViewId; }), 'model': Qt.binding(function() { return _reconstruction.featureExtraction.attribute("describerTypes").value; }), - 'folder': Qt.binding(function() { return Filepath.stringToUrl(_reconstruction.featureExtraction.attribute("output").value); }), + 'featureFolder': Qt.binding(function() { return Filepath.stringToUrl(_reconstruction.featureExtraction.attribute("output").value); }), + 'tracks': Qt.binding(function() { return mtracksLoader.status === Loader.Ready ? mtracksLoader.item : null; }), 'sfmData': Qt.binding(function() { return msfmDataLoader.status === Loader.Ready ? msfmDataLoader.item : null; }), }) } else { @@ -314,6 +315,18 @@ FocusScope { }) } } + Loader { + id: mtracksLoader + active: displayFeatures.checked // || displaySfmStatsView.checked || displaySfmDataGlobalStats.checked + + Component.onCompleted: { + // instantiate and initialize a SfmStatsView component dynamically using Loader.setSource + // so it can fail safely if the c++ plugin is not available + setSource("MTracks.qml", { + 'matchingFolder': Qt.binding(function() { return Filepath.stringToUrl(_reconstruction.featureMatching.attribute("output").value); }), + }) + } + } Loader { id: sfmStatsView anchors.fill: parent