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

View file

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

View file

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

View file

@ -262,9 +262,9 @@ FocusScope {
onActiveChanged: { onActiveChanged: {
if(active) { if(active) {
setSource("PanoramaViewer.qml", { setSource("PanoramaViewer.qml", {
'downscaleValueQML': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}), 'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}),
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}), 'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
'downscaleValue': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}), 'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}),
'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;})