[Panorama Viewer] ensure it fits in RAM memory

This commit is contained in:
Thomas Zorroche 2021-03-03 08:54:00 +01:00 committed by Fabien Castan
parent 1d1d0bb6b7
commit 8fa7f18c54
4 changed files with 34 additions and 15 deletions

View file

@ -31,7 +31,8 @@ AliceVision.FloatImageViewer {
root.updateSubdivisions(12)
}
else{
root.updateSubdivisions(1)
root.updateSubdivisions(1);
root.downscaleLevel = -1;
}
}
@ -61,9 +62,14 @@ AliceVision.FloatImageViewer {
property string sfmPath: ""
function updateSfmPath() {
console.warn("SFM UPDATE - Float IV")
property int downscaleLevel: 0
onDownscaleLevelChanged: {
root.setDownscale(downscaleLevel)
console.warn("VALUE CHANGGGEEEEEEEEEEEEED " + downscaleLevel)
}
function updateSfmPath() {
var activeNode = _reconstruction.activeNodes.get('SfMTransform').node;
if(!activeNode)

View file

@ -16,7 +16,7 @@ FloatingPane {
property bool displayGrid: displayGrid.checked
property int downscaleValue: downscaleSpinBox.value
property int downscaleDefaultValue: 2
property int downscaleDefaultValue: 3
property int subdivisionsDefaultValue: 24
property int subdivisionsValue: subdivisionsCtrl.value
@ -25,6 +25,10 @@ FloatingPane {
background: Rectangle { color: root.palette.window }
function updateDownscaleValue(level) {
downscaleSpinBox.value = level;
}
DoubleValidator {
id: doubleValidator
locale: 'C' // use '.' decimal separator disregarding of the system locale
@ -154,7 +158,7 @@ FloatingPane {
SpinBox {
id: downscaleSpinBox
from: 0
value: 2
value: downscaleDefaultValue
to: 3
stepSize: 1
Layout.fillWidth: false

View file

@ -20,7 +20,11 @@ AliceVision.PanoramaViewer {
property int paintedHeight: textureSize.height
property var status: Image.Null
property int downscaleValue: 2
// Value from ui button
property int downscaleValueQML: 0
// Value from cpp at initialisation
property int downscaleValueCpp: 0
property int subdivisionsPano: 12
@ -35,6 +39,7 @@ AliceVision.PanoramaViewer {
for (var i = 0; i < repeater.model; i++) {
repeater.itemAt(i).item.onChangedHighlightState(isHighlightable);
}
var activeNode = _reconstruction.activeNodes.get('SfMTransform').node;
}
onSubdivisionsPanoChanged:{
@ -43,9 +48,11 @@ AliceVision.PanoramaViewer {
}
}
onDownscaleValueChanged: {
onDownscaleValueQMLChanged: {
console.warn("Downscale")
for (var i = 0; i < repeater.model; i++) {
repeater.itemAt(i).item.setDownscale(downscaleValue);
repeater.itemAt(i).item.downscaleLevel = downscaleValueQML;
}
}
@ -68,7 +75,7 @@ AliceVision.PanoramaViewer {
onYawNodeChanged: {
if (!isRotating) {
for (var i = 0; i < repeater.model; i++) {
repeater.itemAt(i).item.rotatePanoramaDegrees(yawNode, pitchNode);
repeater.itemAt(i).item.rotatePanoramaDegrees(yawNode, pitchNod);
}
}
}
@ -176,7 +183,6 @@ AliceVision.PanoramaViewer {
property string sfmPath: ""
function updateSfmPath() {
console.warn("SFM UPDATE - PANO")
var activeNode = _reconstruction.activeNodes.get('SfMTransform').node;
if(!activeNode)
@ -212,6 +218,7 @@ AliceVision.PanoramaViewer {
if(active) {
setSource("FloatImage.qml", {
'isPanoViewer' : true,
'downscaleLevel' : root.downscaleValueCpp,
'source': Qt.binding(function() { return cSource; }),
'index' : index,
'idView': Qt.binding(function() { return cId; }),
@ -235,16 +242,18 @@ AliceVision.PanoramaViewer {
onImagesDataChanged: {
//We receive the map<ImgPath, idView> from C++
//Resetting arrays to avoid problem with push
pathList = []
idList = []
//Iterating through the map
for (var path in imagesData) {
console.warn("Object item:", path, "=", imagesData[path])
if (path === "lvl") {
root.downscaleValueCpp = imagesData[path];
panoramaViewerToolbar.updateDownscaleValue(root.downscaleValueCpp)
continue;
}
root.pathList.push(path)
root.idList.push(imagesData[path])
}
console.warn(root.pathList.length)
//Changing the repeater model (number of elements)
panoImages.updateRepeater()

View file

@ -262,9 +262,9 @@ FocusScope {
onActiveChanged: {
if(active) {
setSource("PanoramaViewer.qml", {
'downscaleValueQML': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}),
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
'downscaleValue': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}),
'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}),
'mouseMultiplier': Qt.binding(function(){ return panoramaViewerToolbar.mouseSpeed;})