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