mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-19 12:06:28 +02:00
[core] Change attribute name and label properties
Adding new properties and updating the call to previous ones. Properties are now : * label : getLabel * fullLabel : getFullLabel * fullLabelToNode : getFullLabelToNode * fullLabelToGraph : getFullLabelToGraph Same for the name.
This commit is contained in:
parent
2eb8783c95
commit
79955ddae6
4 changed files with 58 additions and 33 deletions
|
@ -197,10 +197,10 @@ class DuplicateNodesCommand(GraphCommand):
|
|||
class SetAttributeCommand(GraphCommand):
|
||||
def __init__(self, graph, attribute, value, parent=None):
|
||||
super(SetAttributeCommand, self).__init__(graph, parent)
|
||||
self.attrName = attribute.getFullName()
|
||||
self.attrName = attribute.getFullNameToNode()
|
||||
self.value = value
|
||||
self.oldValue = attribute.getExportValue()
|
||||
self.setText("Set Attribute '{}'".format(attribute.getFullName()))
|
||||
self.setText("Set Attribute '{}'".format(attribute.getFullNameToNode()))
|
||||
|
||||
def redoImpl(self):
|
||||
if self.value == self.oldValue:
|
||||
|
@ -215,8 +215,8 @@ class SetAttributeCommand(GraphCommand):
|
|||
class AddEdgeCommand(GraphCommand):
|
||||
def __init__(self, graph, src, dst, parent=None):
|
||||
super(AddEdgeCommand, self).__init__(graph, parent)
|
||||
self.srcAttr = src.getFullName()
|
||||
self.dstAttr = dst.getFullName()
|
||||
self.srcAttr = src.getFullNameToNode()
|
||||
self.dstAttr = dst.getFullNameToNode()
|
||||
self.setText("Connect '{}'->'{}'".format(self.srcAttr, self.dstAttr))
|
||||
|
||||
if src.baseType != dst.baseType:
|
||||
|
@ -233,8 +233,8 @@ class AddEdgeCommand(GraphCommand):
|
|||
class RemoveEdgeCommand(GraphCommand):
|
||||
def __init__(self, graph, edge, parent=None):
|
||||
super(RemoveEdgeCommand, self).__init__(graph, parent)
|
||||
self.srcAttr = edge.src.getFullName()
|
||||
self.dstAttr = edge.dst.getFullName()
|
||||
self.srcAttr = edge.src.getFullNameToNode()
|
||||
self.dstAttr = edge.dst.getFullNameToNode()
|
||||
self.setText("Disconnect '{}'->'{}'".format(self.srcAttr, self.dstAttr))
|
||||
|
||||
def redoImpl(self):
|
||||
|
@ -250,7 +250,7 @@ class ListAttributeAppendCommand(GraphCommand):
|
|||
def __init__(self, graph, listAttribute, value, parent=None):
|
||||
super(ListAttributeAppendCommand, self).__init__(graph, parent)
|
||||
assert isinstance(listAttribute, ListAttribute)
|
||||
self.attrName = listAttribute.getFullName()
|
||||
self.attrName = listAttribute.getFullNameToNode()
|
||||
self.index = None
|
||||
self.count = 1
|
||||
self.value = value if value else None
|
||||
|
@ -276,10 +276,10 @@ class ListAttributeRemoveCommand(GraphCommand):
|
|||
super(ListAttributeRemoveCommand, self).__init__(graph, parent)
|
||||
listAttribute = attribute.root
|
||||
assert isinstance(listAttribute, ListAttribute)
|
||||
self.listAttrName = listAttribute.getFullName()
|
||||
self.listAttrName = listAttribute.getFullNameToNode()
|
||||
self.index = listAttribute.index(attribute)
|
||||
self.value = attribute.getExportValue()
|
||||
self.setText("Remove {}".format(attribute.getFullName()))
|
||||
self.setText("Remove {}".format(attribute.getFullNameToNode()))
|
||||
|
||||
def redoImpl(self):
|
||||
listAttribute = self.graph.attribute(self.listAttrName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue