diff options
Diffstat (limited to 'src/gui/undocommands.h')
-rw-r--r-- | src/gui/undocommands.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 40f0a3b..c10eecc 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -255,4 +255,35 @@ private: QVector<Edge*> _newEdgeOrder; }; +class MakePathCommand : public GraphUpdateCommand +{ +public: + explicit MakePathCommand(TikzScene *scene, + const QVector<Edge*> &edgeList, + const QMap<Edge*,GraphElementData*> &oldEdgeData, + QUndoCommand *parent = nullptr); + void undo() override; + void redo() override; +private: + QVector<Edge*> _edgeList; + + // creating path clobbers data on all but first edge + QMap<Edge*,GraphElementData*> _oldEdgeData; +}; + +class SplitPathCommand : public GraphUpdateCommand +{ +public: + explicit SplitPathCommand(TikzScene *scene, + const QSet<Path*> &paths, + QUndoCommand *parent = nullptr); + void undo() override; + void redo() override; +private: + QSet<Path*> _paths; + + // keep a copy of the edge lists so they can be added back to each path in undo() + QMap<Path*,QVector<Edge*>> _edgeLists; +}; + #endif // UNDOCOMMANDS_H |