mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-07 13:21:56 +02:00
Merge pull request #1852 from alicevision/mug/improveLoadDepthMap3D
[ui] Load 3D Depth Map: minor improvements
This commit is contained in:
commit
27ce3df5cb
4 changed files with 23 additions and 12 deletions
|
@ -258,7 +258,8 @@ FocusScope {
|
||||||
onDisplayedNodeChanged: {
|
onDisplayedNodeChanged: {
|
||||||
// clear metadata if no displayed node
|
// clear metadata if no displayed node
|
||||||
if (!displayedNode) {
|
if (!displayedNode) {
|
||||||
metadata = {};
|
root.source = "";
|
||||||
|
root.metadata = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// update output attribute names
|
// update output attribute names
|
||||||
|
@ -274,6 +275,9 @@ FocusScope {
|
||||||
}
|
}
|
||||||
names.push("gallery");
|
names.push("gallery");
|
||||||
outputAttribute.names = names;
|
outputAttribute.names = names;
|
||||||
|
|
||||||
|
root.source = getImageFile();
|
||||||
|
root.metadata = getMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -1163,18 +1167,26 @@ FocusScope {
|
||||||
id: fontMetrics
|
id: fontMetrics
|
||||||
}
|
}
|
||||||
Layout.preferredWidth: model.reduce((acc, label) => Math.max(acc, fontMetrics.boundingRect(label).width), 0) + 3.0 * Qt.application.font.pixelSize
|
Layout.preferredWidth: model.reduce((acc, label) => Math.max(acc, fontMetrics.boundingRect(label).width), 0) + 3.0 * Qt.application.font.pixelSize
|
||||||
|
|
||||||
|
onNameChanged: {
|
||||||
|
root.source = getImageFile();
|
||||||
|
root.metadata = getMetadata();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialToolButton {
|
MaterialToolButton {
|
||||||
property var activeNode: root.aliceVisionPluginAvailable && _reconstruction ? _reconstruction.activeNodes.get('allDepthMap').node : null
|
id: displayImageOutputIn3D
|
||||||
enabled: activeNode
|
enabled: root.aliceVisionPluginAvailable && _reconstruction && displayedNode && Filepath.basename(root.source).includes("depthMap")
|
||||||
ToolTip.text: "View Depth Map in 3D (" + (activeNode ? activeNode.label : "No DepthMap Node Selected") + ")"
|
ToolTip.text: "View Depth Map in 3D"
|
||||||
text: MaterialIcons.input
|
text: MaterialIcons.input
|
||||||
font.pointSize: 11
|
font.pointSize: 11
|
||||||
Layout.minimumWidth: 0
|
Layout.minimumWidth: 0
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.viewIn3D(root.getFileAttributePath(activeNode, "depth", _reconstruction.selectedViewId));
|
root.viewIn3D(
|
||||||
|
root.source,
|
||||||
|
displayedNode.name + ":" + outputAttribute.name + " " + String(_reconstruction.selectedViewId)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ Entity {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function load(filepath) {
|
function load(filepath, label = undefined) {
|
||||||
var pathStr = Filepath.urlToString(filepath);
|
var pathStr = Filepath.urlToString(filepath);
|
||||||
if(!Filepath.exists(pathStr))
|
if(!Filepath.exists(pathStr))
|
||||||
{
|
{
|
||||||
|
@ -99,12 +99,11 @@ Entity {
|
||||||
// add file to the internal ListModel
|
// add file to the internal ListModel
|
||||||
m.mediaModel.append(makeElement({
|
m.mediaModel.append(makeElement({
|
||||||
"source": pathStr,
|
"source": pathStr,
|
||||||
"label": Filepath.basename(pathStr),
|
"label": label ? label : Filepath.basename(pathStr),
|
||||||
"section": "External"
|
"section": "External"
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function view(attribute) {
|
function view(attribute) {
|
||||||
if(m.sourceToEntity[attribute]) {
|
if(m.sourceToEntity[attribute]) {
|
||||||
ensureVisible(attribute);
|
ensureVisible(attribute);
|
||||||
|
|
|
@ -36,8 +36,8 @@ FocusScope {
|
||||||
mainCamera.viewCenter = defaultCamViewCenter;
|
mainCamera.viewCenter = defaultCamViewCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
function load(filepath) {
|
function load(filepath, label = undefined) {
|
||||||
mediaLibrary.load(filepath);
|
mediaLibrary.load(filepath, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// View 'attribute' in the 3D Viewer. Media will be loaded if needed.
|
/// View 'attribute' in the 3D Viewer. Media will be loaded if needed.
|
||||||
|
|
|
@ -30,9 +30,9 @@ Item {
|
||||||
|
|
||||||
|
|
||||||
// Load a 3D media file in the 3D viewer
|
// Load a 3D media file in the 3D viewer
|
||||||
function load3DMedia(filepath) {
|
function load3DMedia(filepath, label = undefined) {
|
||||||
if(panel3dViewerLoader.active) {
|
if(panel3dViewerLoader.active) {
|
||||||
panel3dViewerLoader.item.viewer3D.load(filepath);
|
panel3dViewerLoader.item.viewer3D.load(filepath, label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue