Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CommandHistory.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
24 #ifndef _COMMANDHISTORY_H
25 #define _COMMANDHISTORY_H
26 
27 #include <hugin_shared.h>
28 #include "Command.h"
29 #include <vector>
30 
31 namespace PanoCommand
32 {
39  {
40  public:
41 
45 
48  virtual ~CommandHistory();
49 
55  void clear();
56 
58  void clearRedoQueue();
59 
71  void addCommand(PanoCommand *command, bool execute = true);
72 
76  virtual void undo();
80  virtual void redo();
81 
83  bool canUndo() const;
84 
86  bool canRedo() const;
87 
89  std::string getLastCommandName() const;
90 
92  const PanoCommand* getLastCommand() const;
93  private:
94  // our commands
95  std::vector<PanoCommand*> commands;
96  size_t nextCmd;
97 
98  };
99 
100 
107  {
108  public:
109  static GlobalCmdHist & getInstance();
110  protected:
111  GlobalCmdHist();
112  private:
114  };
115 
116 } // namespace
117 
118 #endif // _COMMANDHISTORY_H
Base class for all panorama commands.
Definition: Command.h:38
A history for Command, provides undo/redo functionality.
Singleton CommandHistory.
#define WXIMPEX
Definition: hugin_shared.h:40
static GlobalCmdHist * instance
std::vector< PanoCommand * > commands