Command.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00024 #ifndef _COMMAND_H
00025 #define _COMMAND_H
00026 
00027 #include <string>
00028 #include <hugin_shared.h>
00029 #include <panodata/Panorama.h>
00030 
00031 namespace PanoCommand
00032 {
00033 
00038 class WXIMPEX PanoCommand
00039 {
00040     public:
00042         explicit PanoCommand(HuginBase::Panorama& pano)
00043             : m_pano(pano), m_memento(NULL), m_redoMemento(NULL), m_clearDirty(false), m_successful(false)
00044         {};
00045         PanoCommand(HuginBase::Panorama& pano, const std::string& commandName)
00046             : m_pano(pano), m_memento(NULL), m_redoMemento(NULL), m_clearDirty(false), m_successful(false)
00047         {};
00048 
00050         virtual ~PanoCommand();
00051 
00058         virtual void execute();
00059         
00065         virtual void undo();
00066         
00072         virtual void redo();
00074         virtual std::string getName() const;
00076         virtual void setName(const std::string& newName);
00078         virtual bool wasSuccessful();
00083         virtual bool processPanorama(HuginBase::Panorama& pano);
00084 
00085     protected:
00087         virtual void setSuccessful(bool success = true);
00088         
00090         virtual void saveMemento();
00092         virtual void saveRedoMemento();
00093 
00095         HuginBase::Panorama& m_pano;
00096         HuginBase::PanoramaDataMemento* m_memento;
00097         HuginBase::PanoramaDataMemento* m_redoMemento;
00098 
00099             // if true, the dirty tag is cleared, otherwise it is keep
00100         bool m_clearDirty;
00101     private:
00102         bool m_successful;
00103         std::string m_name;
00104 };
00105 
00106 } //namespace
00107 
00108 #endif // _H

Generated on 22 Jan 2018 for Hugintrunk by  doxygen 1.4.7