[Panorama Viewer] clean up panorama code

This commit is contained in:
Thomas Zorroche 2021-07-16 11:27:46 +02:00 committed by Fabien Castan
parent 4aa5151af3
commit c06273d2cc
3 changed files with 14 additions and 23 deletions

View file

@ -16,12 +16,10 @@ AliceVision.FloatImageViewer {
visible: (status === Image.Ready) visible: (status === Image.Ready)
property var sfmData property var sfmData
onSfmDataChanged: { onSfmDataChanged: {
root.surface.msfmData = sfmData; root.surface.msfmData = sfmData;
} }
// paintedWidth / paintedHeight / status for compatibility with standard Image // paintedWidth / paintedHeight / status for compatibility with standard Image
property int paintedWidth: textureSize.width property int paintedWidth: textureSize.width
property int paintedHeight: textureSize.height property int paintedHeight: textureSize.height
@ -30,7 +28,7 @@ AliceVision.FloatImageViewer {
return Image.Loading; return Image.Loading;
else if((root.source === "") || else if((root.source === "") ||
(root.sourceSize.height <= 0) || (root.sourceSize.height <= 0) ||
(root.sourceSize.height <= 0)) (root.sourceSize.width <= 0))
return Image.Null; return Image.Null;
return Image.Ready; return Image.Ready;
@ -69,18 +67,11 @@ AliceVision.FloatImageViewer {
} }
} }
property bool isPrincipalPointsDisplayed : false;
property int pointsNumber: (surface.subdivisions + 1) * (surface.subdivisions + 1); property int pointsNumber: (surface.subdivisions + 1) * (surface.subdivisions + 1);
property int index: 0; property int index: 0;
property var idView: 0; property var idView: 0;
function updatePrincipalPoint() {
var pp = root.surface.getPrincipalPoint();
ppRect.x = pp.x;
ppRect.y = pp.y;
}
clearBeforeLoad: true clearBeforeLoad: true
property alias containsMouse: mouseArea.containsMouse property alias containsMouse: mouseArea.containsMouse
@ -116,6 +107,15 @@ AliceVision.FloatImageViewer {
/* /*
* Principal Point * Principal Point
*/ */
function updatePrincipalPoint() {
var pp = root.surface.getPrincipalPoint();
ppRect.x = pp.x;
ppRect.y = pp.y;
}
property bool isPrincipalPointsDisplayed : false;
Item { Item {
id: principalPoint id: principalPoint
Rectangle { Rectangle {

View file

@ -59,7 +59,7 @@ AliceVision.PanoramaViewer {
property var activeNode: _reconstruction.activeNodes.get('SfMTransform').node property var activeNode: _reconstruction.activeNodes.get('SfMTransform').node
// Yaw and Pitch in Degrees from SfMTransform sliders // Yaw and Pitch in Degrees from SfMTransform node sliders
property int yawNode: activeNode.attribute("manualTransform.manualRotation.y").value; property int yawNode: activeNode.attribute("manualTransform.manualRotation.y").value;
property int pitchNode: activeNode.attribute("manualTransform.manualRotation.x").value; property int pitchNode: activeNode.attribute("manualTransform.manualRotation.x").value;
@ -181,15 +181,7 @@ AliceVision.PanoramaViewer {
function updateSfmPath() { function updateSfmPath() {
var activeNode = _reconstruction.activeNodes.get('SfMTransform').node; var activeNode = _reconstruction.activeNodes.get('SfMTransform').node;
root.sfmPath = (activeNode) ? activeNode.attribute("input").value : "";
if(!activeNode)
{
root.sfmPath = "";
}
else
{
root.sfmPath = activeNode.attribute("input").value;
}
} }
property var pathList : [] property var pathList : []

View file

@ -311,7 +311,8 @@ FocusScope {
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}), 'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}), 'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}),
'mouseMultiplier': Qt.binding(function(){ return panoramaViewerToolbar.mouseSpeed;}), 'mouseMultiplier': Qt.binding(function(){ return panoramaViewerToolbar.mouseSpeed;}),
'sfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), 'sfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready
&& msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }),
}) })
} else { } else {
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14 // Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
@ -322,8 +323,6 @@ FocusScope {
onLoaded: { onLoaded: {
panoramaViewerLoader.item.updateSfmPath(); panoramaViewerLoader.item.updateSfmPath();
} }
} }
// Simple QML Image Viewer (using Qt or qtOIIO to load images) // Simple QML Image Viewer (using Qt or qtOIIO to load images)