reimplemented adding/removing/connecting/disconnecting
This commit is contained in:
@@ -84,7 +84,9 @@ NodeViewItem::NodeViewItem(Node* n, Node *context, QGraphicsItem *parent) :
|
||||
connect(node_, &Node::LabelChanged, this, &NodeViewItem::NodeAppearanceChanged);
|
||||
connect(node_, &Node::ColorChanged, this, &NodeViewItem::NodeAppearanceChanged);
|
||||
|
||||
SetNodePosition(context_->GetNodePositionInContext(node_));
|
||||
if (context_) {
|
||||
SetNodePosition(context_->GetNodePositionInContext(node_));
|
||||
}
|
||||
|
||||
SetExpanded(node_->property("expanded").toBool());
|
||||
}
|
||||
@@ -493,6 +495,17 @@ void NodeViewItem::SetLabelAsOutput(bool e)
|
||||
update();
|
||||
}
|
||||
|
||||
NodeInput NodeViewItem::GetInputFromInputConnector(NodeViewItemConnector *connector)
|
||||
{
|
||||
for (int i=0; i<int(input_connectors_.size()); i++) {
|
||||
if (input_connectors_[i].get() == connector) {
|
||||
return NodeInput(node_, node_inputs_.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
return NodeInput();
|
||||
}
|
||||
|
||||
NodeViewEdge *NodeViewItem::GetEdgeFromInputConnector(NodeViewItemConnector *connector)
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
Reference in New Issue
Block a user