[Panorama Viewer] Simplify use of mSfMData object for pano viewer

This commit is contained in:
Landrodie 2021-07-21 15:08:11 +02:00 committed by Fabien Castan
parent 188d91453b
commit f37166dae6

View file

@ -590,20 +590,24 @@ FocusScope {
property bool isUsed: displayFeatures.checked || displaySfmStatsView.checked || displaySfmDataGlobalStats.checked
|| displayPanoramaViewer.checked || displayLensDistortionViewer.checked
property var activeNode: root.aliceVisionPluginAvailable ? _reconstruction.activeNodes.get('sfm').node : null
property bool isComputed: {
if (usePanoramaViewer || useLensDistortionViewer)
return activeNode
else
return activeNode && activeNode.isComputed
}
property string filepath: {
if (usePanoramaViewer || useLensDistortionViewer)
return Filepath.stringToUrl(activeNode.attribute("input").value)
else
return Filepath.stringToUrl(isComputed ? activeNode.attribute("output").value : "")
property var activeNode: {
if(! root.aliceVisionPluginAvailable){
return null
}
var sfmNode = _reconstruction.activeNodes.get('sfm').node
if(sfmNode === null){
return null
}
if(displayPanoramaViewer.checked){
var previousNode = sfmNode.attribute("input").rootLinkParam.node
return previousNode
}
else{
return sfmNode
}
}
property bool isComputed: activeNode && activeNode.isComputed
property string filepath: Filepath.stringToUrl(isComputed ? activeNode.attribute("output").value : "")
active: false
// It takes time to load tracks, so keep them looaded, if we may use it again.
@ -615,9 +619,6 @@ FocusScope {
}
}
onIsComputedChanged: {
if (usePanoramaViewer || useLensDistortionViewer)
return;
if(!isComputed)
{
active = false;