Skip to content

Commit fb604bb

Browse files
authored
Merge pull request #2720 from alicevision/dev/tracks
[ui] Viewer2D can display the content of tracks files
2 parents 37264bc + 7d3cf68 commit fb604bb

3 files changed

Lines changed: 52 additions & 7 deletions

File tree

meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,31 @@ FloatingPane {
1919
property var mfeatures: null
2020
property var mtracks: null
2121
property var msfmdata: null
22+
property var featuresNodeName: ""
23+
property var tracksNodeName: ""
24+
property var sfmdataNodeName: ""
2225

2326
ColumnLayout {
2427
// Header
2528
RowLayout {
29+
ColumnLayout {
2630
// Node used to read features
27-
Label {
28-
text: _reconstruction && _reconstruction.activeNodes.get("featureProvider").node ? _reconstruction.activeNodes.get("featureProvider").node.label : ""
29-
Layout.fillWidth: true
31+
Label {
32+
text: "Features Provider: " + featuresNodeName
33+
Layout.fillWidth: true
34+
}
35+
Label {
36+
text: "Tracks Provider: " + tracksNodeName
37+
Layout.fillWidth: true
38+
}
39+
Label {
40+
text: "SfMData Provider: " + sfmdataNodeName
41+
Layout.fillWidth: true
42+
}
3043
}
3144
// Settings menu
3245
Loader {
46+
Layout.alignment: Qt.AlignTop
3347
active: root.pluginStatus === Loader.Ready
3448
sourceComponent: MaterialToolButton {
3549
text: MaterialIcons.settings

meshroom/ui/qml/Viewer/Viewer2D.qml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,16 +1194,30 @@ FocusScope {
11941194
if (!root.aliceVisionPluginAvailable) {
11951195
return null
11961196
}
1197-
return _reconstruction ? _reconstruction.activeNodes.get("matchProvider").node : null
1197+
1198+
if (_reconstruction)
1199+
{
1200+
//Try first to use tracks
1201+
if (_reconstruction.activeNodes.get("trackProvider").node)
1202+
{
1203+
return _reconstruction.activeNodes.get("trackProvider").node
1204+
}
1205+
1206+
return _reconstruction.activeNodes.get("matchProvider").node
1207+
}
1208+
1209+
return null
11981210
}
1211+
11991212
property bool isComputed: activeNode && activeNode.isComputed
12001213

12011214
active: isUsed && isComputed
12021215

12031216
onActiveChanged: {
12041217
if (active) {
1205-
// instantiate and initialize a SfmStatsView component dynamically using Loader.setSource
1206-
// so it can fail safely if the c++ plugin is not available
1218+
// instantiate and initialize a mTracks component
1219+
// dynamically using Loader.setSource so it can fail safely
1220+
// if the c++ plugin is not available
12071221
setSource("MTracks.qml", {
12081222
"matchingFolders": Qt.binding(function() {
12091223
let result = []
@@ -1219,6 +1233,18 @@ FocusScope {
12191233
}
12201234
return result
12211235
}),
1236+
"tracksFile": Qt.binding(function() {
1237+
let result = ""
1238+
if (activeNode) {
1239+
if (activeNode.nodeType == "TracksBuilding" && isComputed) {
1240+
result = activeNode.attribute("output").value
1241+
}
1242+
else if (activeNode.hasAttribute("tracksFilename")) {
1243+
result = activeNode.attribute("tracksFilename").value
1244+
}
1245+
}
1246+
return result
1247+
})
12221248
})
12231249
} else {
12241250
// Forcing the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
@@ -1282,6 +1308,9 @@ FocusScope {
12821308
mfeatures: mfeaturesLoader.item
12831309
mtracks: mtracksLoader.item
12841310
msfmdata: msfmDataLoader.item
1311+
featuresNodeName: (mfeaturesLoader.activeNode) ? mfeaturesLoader.activeNode.label : "None"
1312+
tracksNodeName: (mtracksLoader.activeNode) ? mtracksLoader.activeNode.label : "None"
1313+
sfmdataNodeName: (msfmDataLoader.activeNode) ? msfmDataLoader.activeNode.label : "None"
12851314
}
12861315
}
12871316

meshroom/ui/reconstruction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ class Reconstruction(UIGraph):
453453
# Nodes that can be used to provide features folders to the UI
454454
"featureProvider": ["FeatureExtraction", "FeatureMatching", "StructureFromMotion"],
455455
# Nodes that can be used to provide matches folders to the UI
456-
"matchProvider": ["FeatureMatching", "StructureFromMotion"]
456+
"matchProvider": ["FeatureMatching", "StructureFromMotion"],
457+
# Nodes that can be used to provide tracks files to the UI
458+
"trackProvider": ["TracksBuilding", "SfMBootstraping", "SfMExpanding"]
457459
}
458460
# Nodes accessed from the UI
459461
uiNodes = [

0 commit comments

Comments
 (0)