mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-18 19:46:26 +02:00
add ComboBox to select depth map file
This commit is contained in:
parent
978f4a9b00
commit
5652770a42
1 changed files with 40 additions and 2 deletions
|
@ -9,7 +9,9 @@ FocusScope {
|
|||
id: root
|
||||
|
||||
clip: true
|
||||
|
||||
property url source
|
||||
property url realSource
|
||||
property var metadata
|
||||
|
||||
function clear()
|
||||
|
@ -26,6 +28,18 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
onSourceChanged: {
|
||||
realSource = getImageFile(imageType.type)
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: _reconstruction.onDepthMapChanged
|
||||
|
||||
value: {
|
||||
realSource = getImageFile(imageType.type)
|
||||
}
|
||||
}
|
||||
|
||||
// functions
|
||||
function fit() {
|
||||
if(image.status != Image.Ready)
|
||||
|
@ -35,6 +49,18 @@ FocusScope {
|
|||
image.y = Math.max((root.height-image.height*image.scale)*0.5, 0)
|
||||
}
|
||||
|
||||
function getImageFile(type) {
|
||||
var withExtension
|
||||
if (type == "nmodMap") {
|
||||
withExtension = type + ".png";
|
||||
} else if (type == "image") {
|
||||
return root.source;
|
||||
} else {
|
||||
withExtension = type + ".exr";
|
||||
}
|
||||
return "file:///"+_reconstruction.depthMap.internalFolder+"/"+_reconstruction.selectedViewId+"_"+withExtension;
|
||||
}
|
||||
|
||||
// context menu
|
||||
property Component contextMenu: Menu {
|
||||
MenuItem {
|
||||
|
@ -56,7 +82,7 @@ FocusScope {
|
|||
fillMode: Image.PreserveAspectFit
|
||||
autoTransform: true
|
||||
onWidthChanged: if(status==Image.Ready) fit()
|
||||
source: root.source
|
||||
source: root.realSource
|
||||
onStatusChanged: {
|
||||
// update cache source when image is loaded
|
||||
if(status === Image.Ready)
|
||||
|
@ -160,7 +186,7 @@ FocusScope {
|
|||
font.pointSize: 8
|
||||
readOnly: true
|
||||
selectByMouse: true
|
||||
text: Filepath.urlToString(source)
|
||||
text: Filepath.urlToString(realSource)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,6 +253,18 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: imageType
|
||||
|
||||
property var types: ["image", "depthMap", "simMap", "nmodMap"]
|
||||
property string type: types[currentIndex]
|
||||
|
||||
model: types
|
||||
onCurrentIndexChanged: {
|
||||
root.realSource = root.getImageFile(type)
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: metadataCB
|
||||
padding: 3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue