[ui] Reconstruction: add 'setActiveNodeOfType' method

Helper method to set a node as the active one of its type.
This commit is contained in:
Yann Lanthony 2019-09-11 10:18:08 +02:00
parent 03e91bea49
commit f870e252b4
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642
2 changed files with 16 additions and 16 deletions

View file

@ -552,6 +552,8 @@ ApplicationWindow {
font.pointSize: 11
padding: 2
onClicked: graphEditorMenu.open()
checkable: true
checked: graphEditorMenu.visible
Menu {
id: graphEditorMenu
y: parent.height
@ -591,22 +593,8 @@ ApplicationWindow {
readOnly: graphLocked
onNodeDoubleClicked: {
if(node.nodeType === "StructureFromMotion")
{
_reconstruction.sfm = node;
}
else if(node.nodeType === "FeatureExtraction")
{
_reconstruction.featureExtraction = node;
}
else if(node.nodeType === "CameraInit")
{
_reconstruction.cameraInit = node;
}
else if(node.nodeType === "PrepareDenseScene")
{
_reconstruction.prepareDenseScene = node;
}
_reconstruction.setActiveNodeOfType(node);
for(var i=0; i < node.attributes.count; ++i)
{
var attr = node.attributes.at(i)

View file

@ -666,6 +666,18 @@ class Reconstruction(UIGraph):
buildingIntrinsics = Property(bool, lambda self: self._buildingIntrinsics, notify=buildingIntrinsicsChanged)
liveSfmManager = Property(QObject, lambda self: self._liveSfmManager, constant=True)
@Slot(QObject)
def setActiveNodeOfType(self, node):
""" Set node as the active node of its type. """
if node.nodeType == "StructureFromMotion":
self.sfm = node
elif node.nodeType == "FeatureExtraction":
self.featureExtraction = node
elif node.nodeType == "CameraInit":
self.cameraInit = node
elif node.nodeType == "PrepareDenseScene":
self.prepareDenseScene = node
def updateSfMResults(self):
"""
Update internal views, poses and solved intrinsics based on the current SfM node.