Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/UndoStack.h @ 1020:ac88989817e3 toa2019093001
TrackerCommand --> MeasureCommand + fuse against exception in MeasureTool dtor
+ added DeleteMeasureCommand + moved the various concrete measuring tool-related
classes to their pre-assigned file locations (everything was crammed into
MeasureCommands.* files up to this commit) + added double-click handler to
GuiAdapter (for TOA implementation of "delete measuring tool on double-click")
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 30 Sep 2019 10:41:06 +0200 |
parents | e3c56d4f863f |
children | 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
1019:29f5f2031310 | 1020:ac88989817e3 |
---|---|
24 | 24 |
25 #include <vector> | 25 #include <vector> |
26 | 26 |
27 namespace OrthancStone | 27 namespace OrthancStone |
28 { | 28 { |
29 class TrackerCommand; | 29 class MeasureCommand; |
30 | 30 |
31 class UndoStack | 31 class UndoStack |
32 { | 32 { |
33 public: | 33 public: |
34 UndoStack(); | 34 UndoStack(); |
39 - then it adds the supplied command at the top of the undo stack | 39 - then it adds the supplied command at the top of the undo stack |
40 | 40 |
41 In other words, when a new command is pushed, all the undone (and not | 41 In other words, when a new command is pushed, all the undone (and not |
42 redone) commands are removed. | 42 redone) commands are removed. |
43 */ | 43 */ |
44 void PushCommand(boost::shared_ptr<TrackerCommand> command); | 44 void PushCommand(boost::shared_ptr<MeasureCommand> command); |
45 | 45 |
46 /** | 46 /** |
47 Undoes the command at the top of the undo stack, or throws if there is no | 47 Undoes the command at the top of the undo stack, or throws if there is no |
48 command to undo. | 48 command to undo. |
49 You can check "CanUndo" first to protect against extraneous redo. | 49 You can check "CanUndo" first to protect against extraneous redo. |
62 | 62 |
63 /** selfexpl */ | 63 /** selfexpl */ |
64 bool CanRedo() const; | 64 bool CanRedo() const; |
65 | 65 |
66 private: | 66 private: |
67 std::vector<boost::shared_ptr<TrackerCommand> > commandStack_; | 67 std::vector<boost::shared_ptr<MeasureCommand> > commandStack_; |
68 | 68 |
69 /** | 69 /** |
70 This is always between >= 0 and <= undoStack_.size() and gives the | 70 This is always between >= 0 and <= undoStack_.size() and gives the |
71 position where the controller is in the undo stack. | 71 position where the controller is in the undo stack. |
72 - If numAppliedCommands_ > 0, one can undo | 72 - If numAppliedCommands_ > 0, one can undo |