made node edge changes undoable

This commit is contained in:
itsmattkc
2019-07-17 00:14:49 -04:00
parent a78cc3950a
commit 39256fd6f9
15 changed files with 318 additions and 12 deletions
+38
View File
@@ -0,0 +1,38 @@
#ifndef NODEVIEWUNDO_H
#define NODEVIEWUNDO_H
#include <QUndoCommand>
#include "node/node.h"
class NodeEdgeAddCommand : public QUndoCommand {
public:
NodeEdgeAddCommand(NodeOutput* output, NodeInput* input, QUndoCommand* parent = nullptr);
virtual void redo() override;
virtual void undo() override;
private:
NodeOutput* output_;
NodeInput* input_;
NodeEdgePtr old_edge_;
bool done_;
};
class NodeEdgeRemoveCommand : public QUndoCommand {
public:
NodeEdgeRemoveCommand(NodeOutput* output, NodeInput* input, QUndoCommand* parent = nullptr);
virtual void redo() override;
virtual void undo() override;
private:
NodeOutput* output_;
NodeInput* input_;
bool done_;
};
#endif // NODEVIEWUNDO_H