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

View file

@ -59,7 +59,7 @@ AliceVision.PanoramaViewer {
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 pitchNode: activeNode.attribute("manualTransform.manualRotation.x").value;
@ -181,15 +181,7 @@ AliceVision.PanoramaViewer {
function updateSfmPath() {
var activeNode = _reconstruction.activeNodes.get('SfMTransform').node;
if(!activeNode)
{
root.sfmPath = "";
}
else
{
root.sfmPath = activeNode.attribute("input").value;
}
root.sfmPath = (activeNode) ? activeNode.attribute("input").value : "";
}
property var pathList : []

View file

@ -311,7 +311,8 @@ FocusScope {
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}),
'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 {
// 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: {
panoramaViewerLoader.item.updateSfmPath();
}
}
// Simple QML Image Viewer (using Qt or qtOIIO to load images)