[ui] update QML properties after changes in qtAV

This commit is contained in:
Loïc Vital 2023-03-08 08:45:19 +01:00
parent 33def1d6a5
commit 31b04092a0
4 changed files with 36 additions and 12 deletions

View file

@ -157,7 +157,7 @@ FloatingPane {
Layout.alignment: Qt.AlignRight
from: -1
to: 50
value: root.mfeatures.timeWindow
value: root.featuresViewer.timeWindow
stepSize: 1
editable: true
@ -174,7 +174,7 @@ FloatingPane {
}
onValueChanged: {
root.mfeatures.timeWindow = timeWindowSB.value;
root.featuresViewer.timeWindow = timeWindowSB.value;
}
}
}
@ -224,7 +224,7 @@ FloatingPane {
ToolTip.text: "Display Tracks"
onClicked: {
featureType.viewer.displayTracks = tracksVisibilityButton.checked;
root.mfeatures.enableTimeWindow = tracksVisibilityButton.checked;
root.featuresViewer.enableTimeWindow = tracksVisibilityButton.checked;
}
font.pointSize: 10
}
@ -232,7 +232,7 @@ FloatingPane {
MaterialToolButton {
id: matchesVisibilityButton
checkable: true
checked: true
checked: false
text: MaterialIcons.sync
ToolTip.text: "Display Matches"
onClicked: {
@ -244,7 +244,7 @@ FloatingPane {
MaterialToolButton {
id: landmarksVisibilityButton
checkable: true
checked: true
checked: false
text: MaterialIcons.fiber_manual_record
ToolTip.text: "Display Landmarks"
onClicked: {
@ -267,9 +267,7 @@ FloatingPane {
if(featureType.viewer.loadingFeatures)
return featureType.viewer.describerType;
return featureType.viewer.describerType + ": " +
((featureExtractionNode && featureExtractionNode.isComputed) ? root.mfeatures.featuresInfo[featureType.viewer.describerType][root.mfeatures.currentViewId]['nbFeatures'] : " - ") + " / " +
(root.mfeatures.haveValidTracks ? root.mfeatures.featuresInfo[featureType.viewer.describerType][root.mfeatures.currentViewId]['nbTracks'] : " - ") + " / " +
(root.mfeatures.haveValidLandmarks ? root.mfeatures.featuresInfo[featureType.viewer.describerType][root.mfeatures.currentViewId]['nbLandmarks'] : " - ");
((featureExtractionNode && featureExtractionNode.isComputed) ? root.mfeatures.featuresInfo[featureType.viewer.describerType][root.featuresViewer.currentViewId]['nbFeatures'] : " - ");
}
}
// Feature loading status

View file

@ -10,34 +10,53 @@ import Utils 1.0
Repeater {
id: root
/// Features to display
/// Features
property var features
/// Tracks
property var tracks
/// SfMData
property var sfmData
/// The list of describer types to load
property alias describerTypes: root.model
/// List of available feature display modes
readonly property var featureDisplayModes: ['Points', 'Squares', 'Oriented Squares']
/// Current feature display mode index
property int featureDisplayMode: 2
/// List of available track display modes
readonly property var trackDisplayModes: ['Lines Only', 'Current Matches', 'All Matches']
/// Current track display mode index
property int trackDisplayMode: 1
// Minimum feature scale score to display
property real featureMinScaleFilter: 0
// Maximum feature scale score to display
property real featureMaxScaleFilter: 1
/// Display 3d tracks
property bool display3dTracks: false
/// Display only contiguous tracks
property bool trackContiguousFilter: true
/// Display only tracks with at least one inlier
property bool trackInliersFilter: false
/// Display track endpoints
property bool displayTrackEndpoints: true
/// The list of colors used for displaying several describers
property var colors: [Colors.blue, Colors.green, Colors.yellow, Colors.cyan, Colors.pink, Colors.lime] //, Colors.orange, Colors.red
/// Current view ID
property var currentViewId
/// Time window
property bool enableTimeWindow: false
property int timeWindow: 1
model: root.describerTypes
// instantiate one FeaturesViewer by describer type
@ -56,6 +75,11 @@ Repeater {
matchColor: Colors.orange
landmarkColor: Colors.red
describerType: modelData
currentViewId: root.currentViewId
enableTimeWindow: root.enableTimeWindow
timeWindow: root.timeWindow
mfeatures: root.features
mtracks: root.tracks
msfmData: root.sfmData
}
}

View file

@ -548,7 +548,10 @@ FocusScope {
// instantiate and initialize a FeaturesViewer component dynamically using Loader.setSource
setSource("FeaturesViewer.qml", {
'model': Qt.binding(function() { return activeNode ? activeNode.attribute("describerTypes").value : ""; }),
'currentViewId': Qt.binding(function() { return _reconstruction.selectedViewId; }),
'features': Qt.binding(function() { return mfeaturesLoader.status === Loader.Ready ? mfeaturesLoader.item : null; }),
'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 {
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
@ -725,11 +728,9 @@ FocusScope {
// instantiate and initialize a MFeatures component dynamically using Loader.setSource
// so it can fail safely if the c++ plugin is not available
setSource("MFeatures.qml", {
'currentViewId': Qt.binding(function() { return _reconstruction.selectedViewId; }),
'describerTypes': Qt.binding(function() { return activeNode ? activeNode.attribute("describerTypes").value : {}; }),
'featureFolder': Qt.binding(function() { return activeNode ? Filepath.stringToUrl(activeNode.attribute("output").value) : ""; }),
'mtracks': Qt.binding(function() { return mtracksLoader.status === Loader.Ready ? mtracksLoader.item : null; }),
'msfmData': Qt.binding(function() { return msfmDataLoader.status === Loader.Ready ? msfmDataLoader.item : null; }),
'viewIds': Qt.binding(function() { return _reconstruction ? _reconstruction.allViewIds() : {}; }),
})
} else {

View file

@ -692,6 +692,7 @@ class Reconstruction(UIGraph):
""" Get all image paths in the reconstruction. """
return [vp.path.value for node in self._cameraInits for vp in node.viewpoints.value]
@Slot(result="QVariantList")
def allViewIds(self):
""" Get all view Ids involved in the reconstruction. """
return [vp.viewId.value for node in self._cameraInits for vp in node.viewpoints.value]