#include <CommandHistory.h>
Inheritance diagram for CommandHistory:

Public Member Functions | |
| CommandHistory () | |
| ctor. | |
| virtual | ~CommandHistory () |
| dtor. | |
| void | clear () |
| Erases all the undo/redo history. | |
| void | addCommand (Command *command, bool execute=true) |
| Adds a command to the history. | |
| virtual void | undo () |
| Undoes the last action. | |
| virtual void | redo () |
| Redoes the last undone action. | |
| bool | canUndo () |
| Return true iff there is a command to undo. | |
| bool | canRedo () |
| Return true iff there is a command to redo. | |
Private Attributes | |
| std::vector< Command * > | commands |
| size_t | nextCmd |
To use this, all modifications to the model have to be done through commands that are executed with addCommand();
Definition at line 34 of file CommandHistory.h.
|
|
ctor.
Definition at line 36 of file CommandHistory.cpp. |
|
|
dtor.
Definition at line 41 of file CommandHistory.cpp. References commands. |
|
||||||||||||
|
|
Return true iff there is a command to redo.
Definition at line 141 of file CommandHistory.cpp. References commands, and nextCmd. Referenced by PreviewFrame::OnRedo(), MainFrame::OnRedo(), and MainFrame::panoramaChanged(). |
|
|
Return true iff there is a command to undo.
Definition at line 136 of file CommandHistory.cpp. References nextCmd. Referenced by PreviewFrame::OnUndo(), MainFrame::OnUndo(), and MainFrame::panoramaChanged(). |
|
|
Erases all the undo/redo history. Use this when reloading the data, for instance, since this invalidates all the commands. Definition at line 50 of file CommandHistory.cpp. References commands, and nextCmd. Referenced by MainFrame::LoadProjectFile(), DragTool::MouseButtonEvent(), ImagesTreeCtrl::OnEndDrag(), huginApp::OnInit(), and MainFrame::OnNewProject(). |
|
|
Redoes the last undone action.
Definition at line 116 of file CommandHistory.cpp. References commands, DEBUG_DEBUG, DEBUG_ERROR, AppBase::Command< StringType >::execute(), HUGIN_SMART_UNDO, and nextCmd. Referenced by MainFrame::OnRedo(). |
|
|
Undoes the last action.
Definition at line 91 of file CommandHistory.cpp. References commands, DEBUG_DEBUG, DEBUG_ERROR, HUGIN_SMART_UNDO, nextCmd, and AppBase::Command< StringType >::undo(). Referenced by MainFrame::OnUndo(). |
|
|
Definition at line 82 of file CommandHistory.h. Referenced by addCommand(), canRedo(), clear(), redo(), undo(), and ~CommandHistory(). |
|
|
Definition at line 83 of file CommandHistory.h. Referenced by addCommand(), canRedo(), canUndo(), clear(), redo(), and undo(). |
1.3.9.1