reimplemented node positioning and deleting

This commit is contained in:
itsmattkc
2021-11-17 12:09:41 -08:00
parent b850a550bd
commit a6af473f53
13 changed files with 255 additions and 137 deletions
+36
View File
@@ -363,6 +363,42 @@ private:
};
class NodeViewDeleteCommand : public UndoCommand
{
public:
NodeViewDeleteCommand();
void AddNode(Node *node, Node *context);
void AddEdge(Node *output, const NodeInput &input);
virtual Project * GetRelevantProject() const override;
protected:
virtual void redo() override;
virtual void undo() override;
private:
using NodePair = QPair<Node *, Node*>;
QVector<NodePair> nodes_;
QVector<Node::OutputConnection> edges_;
struct RemovedNode {
Node *node;
Node *context;
QPointF pos;
NodeGraph *removed_from_graph;
};
QVector<RemovedNode> removed_nodes_;
QObject memory_manager_;
};
}
#endif // NODEVIEWUNDO_H