mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 00:38:41 +02:00
[wip] Add table view to display intrinsics infos
This commit is contained in:
parent
212d8178c0
commit
88cd6fb85a
3 changed files with 201 additions and 6 deletions
|
@ -50,31 +50,87 @@ Panel {
|
|||
|
||||
property variant parsedIntrinsic
|
||||
|
||||
|
||||
// function populate_model()
|
||||
// {
|
||||
// for (var property in parsedIntrinsic) {
|
||||
// console.warn(property + ': ' + parsedIntrinsic[property]+'; ')
|
||||
// intrinsicModel.append({'name' : property, 'value' : parsedIntrinsic[property]})
|
||||
// }
|
||||
// }
|
||||
|
||||
// function populate_model()
|
||||
// {
|
||||
// intrinsicModel.clear()
|
||||
// for (var intr in parsedIntrinsic) {
|
||||
// intrinsicModel.append(parsedIntrinsic[intr])
|
||||
// }
|
||||
// }
|
||||
|
||||
function populate_model()
|
||||
{
|
||||
intrinsicModel.clear()
|
||||
for (var intr in parsedIntrinsic) {
|
||||
intrinsicModel.appendRow(parsedIntrinsic[intr])
|
||||
}
|
||||
}
|
||||
|
||||
// function populate_model()
|
||||
// {
|
||||
// intrinsicModel.clear()
|
||||
// let CurrentIntrinsic = {}
|
||||
// console.warn("Populate Model")
|
||||
// for (var intr in parsedIntrinsic) {
|
||||
// for (var property in parsedIntrinsic[intr]) {
|
||||
// if(property.localeCompare("Locked") === 0){
|
||||
// CurrentIntrinsic[property] = {'label' : property, 'value' : parsedIntrinsic[intr][property]}
|
||||
// intrinsicModel.append(CurrentIntrinsic)
|
||||
// console.warn("Append to Model")
|
||||
// for (var prop in CurrentIntrinsic) {
|
||||
// delete CurrentIntrinsic[prop];
|
||||
// }
|
||||
// }else{
|
||||
// CurrentIntrinsic[property] = {'label' : property, 'value' : parsedIntrinsic[intr][property]}
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// console.warn(intrinsicModel.count)
|
||||
// }
|
||||
|
||||
//Parse
|
||||
// Id : value
|
||||
function parseIntr(){
|
||||
parsedIntrinsic = {}
|
||||
|
||||
for(var i = 0; i < m.intrinsics.count; i++){
|
||||
parsedIntrinsic[i] = {}
|
||||
for(var j=0; j < m.intrinsics.at(i).value.count; j++){
|
||||
var currentAttribute = m.intrinsics.at(i).value.at(j)
|
||||
if(currentAttribute.type === "GroupAttribute" || currentAttribute.type === "ListAttribute"){
|
||||
parsedIntrinsic[currentAttribute.name] = {}
|
||||
parsedIntrinsic[i][currentAttribute.label] = {}
|
||||
for(var k=0; k < currentAttribute.value.count; k++){
|
||||
parsedIntrinsic[currentAttribute.name][currentAttribute.value.at(k).name] = currentAttribute.value.at(k).value
|
||||
parsedIntrinsic[i][currentAttribute.label][currentAttribute.value.at(k).label] = currentAttribute.value.at(k).value
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
parsedIntrinsic[currentAttribute.name] = currentAttribute.value
|
||||
parsedIntrinsic[i][currentAttribute.label] = currentAttribute.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for (var property in parsedIntrinsic) {
|
||||
// console.warn(property + ': ' + parsedIntrinsic[property]+'; ')
|
||||
// }
|
||||
for (var intr in parsedIntrinsic) {
|
||||
for (var property in parsedIntrinsic[intr]) {
|
||||
console.warn(property + ': ' + parsedIntrinsic[intr][property] +'; ')
|
||||
}
|
||||
}
|
||||
|
||||
populate_model()
|
||||
//console.warn(parsedIntrinsic.count)
|
||||
}
|
||||
|
||||
|
||||
|
||||
headerBar: RowLayout {
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.more_vert
|
||||
|
@ -400,6 +456,59 @@ Panel {
|
|||
interactive: intrinsicsFilterButton.checked
|
||||
}
|
||||
|
||||
RowLayout{
|
||||
anchors.fill: parent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
// ListView{
|
||||
// Layout.fillHeight: true
|
||||
// Layout.fillWidth: true
|
||||
// orientation: ListView.Vertical
|
||||
|
||||
|
||||
// model: intrinsicModel
|
||||
|
||||
// delegate: IntrinsicDisplayDelegate{
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// ListModel{
|
||||
// id : intrinsicModel
|
||||
// dynamicRoles:true
|
||||
|
||||
// }
|
||||
|
||||
TableView{
|
||||
id : intrinsicTable
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
model: intrinsicModel
|
||||
|
||||
delegate: IntrinsicDisplayDelegate{}
|
||||
}
|
||||
|
||||
TableModel{
|
||||
id : intrinsicModel
|
||||
|
||||
TableModelColumn { display: "Id" }
|
||||
TableModelColumn { display: "Sensor Width" }
|
||||
TableModelColumn { display: "Focal Length"}
|
||||
|
||||
}
|
||||
|
||||
// HorizontalHeaderView {
|
||||
// id: horizontalHeader
|
||||
// syncView: tableView
|
||||
// anchors.left: tableView.left
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ListView {
|
||||
// id: listView
|
||||
|
|
85
meshroom/ui/qml/ImageGallery/IntrinsicDisplayDelegate.qml
Normal file
85
meshroom/ui/qml/ImageGallery/IntrinsicDisplayDelegate.qml
Normal file
|
@ -0,0 +1,85 @@
|
|||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.2
|
||||
import MaterialIcons 2.2
|
||||
import Utils 1.0
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
property variant attribute: null
|
||||
property bool readOnly: false
|
||||
Loader {
|
||||
Layout.fillWidth: true
|
||||
|
||||
sourceComponent: {
|
||||
console.warn("keys " + Object.keys(model.model))
|
||||
console.warn("Object " + model.model.objectName)
|
||||
switch(Object.keys(model)[model.index])
|
||||
{
|
||||
//case "ChoiceParam": return attribute.desc.exclusive ? comboBox_component : multiChoice_component
|
||||
case "object": return object_component
|
||||
case "FloatParam": return slider_component
|
||||
case "BoolParam": return checkbox_component
|
||||
case "ListAttribute": return listAttribute_component
|
||||
case "GroupAttribute": return groupAttribute_component
|
||||
default: return textField_component
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Component {
|
||||
id: textField_component
|
||||
TextInput{
|
||||
text: model.display
|
||||
padding: 12
|
||||
selectByMouse: true
|
||||
|
||||
onAccepted: model.display = text
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#efefef"
|
||||
z: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: focal_length_component
|
||||
RowLayout{
|
||||
TextInput{
|
||||
text: model.display.x
|
||||
padding: 12
|
||||
selectByMouse: true
|
||||
|
||||
onAccepted: model.display = text
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: model.index%2 ? parent.palette.window : Qt.darker(parent.palette.window, 1.1)
|
||||
z: -1
|
||||
}
|
||||
}
|
||||
TextInput{
|
||||
text: model.display.y
|
||||
padding: 12
|
||||
selectByMouse: true
|
||||
|
||||
onAccepted: model.display = text
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: model.index%2 ? parent.palette.window : Qt.darker(parent.palette.window, 1.1)
|
||||
z: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -4,3 +4,4 @@ ImageGallery 1.0 ImageGallery.qml
|
|||
ImageDelegate 1.0 ImageDelegate.qml
|
||||
ImageIntrinsicDelegate 1.0 ImageIntrinsicDelegate.qml
|
||||
ImageIntrinsicViewer 1.0 ImageIntrinsicViewer.qml
|
||||
IntrinsicDisplayDelegate 1.0 IntrinsicDisplayDelegate.qml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue