Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96
00020 #define LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96
00021
00022
00023 #include "mitkCommon.h"
00024 #include "mitkOperationEvent.h"
00025 #include "mitkUndoModel.h"
00026
00027 #include <vector>
00028
00029 #include<itkEventObject.h>
00030
00031 namespace mitk {
00032
00033
00034
00035
00036
00037
00038 class MITK_CORE_EXPORT LimitedLinearUndo : public UndoModel
00039 {
00040 public:
00041 typedef std::vector<UndoStackItem*> UndoContainer;
00042 typedef std::vector<UndoStackItem*>::reverse_iterator UndoContainerRevIter;
00043
00044 mitkClassMacro(LimitedLinearUndo, UndoModel);
00045 itkNewMacro(Self);
00046
00047 virtual bool SetOperationEvent(UndoStackItem* stackItem);
00048
00049
00050
00051
00052
00053
00054
00055
00056 virtual bool Undo();
00057 virtual bool Undo(bool);
00058
00059
00060
00061 virtual bool Undo(int oeid);
00062
00063
00064
00065
00066
00067
00068
00069
00070 virtual bool Redo();
00071 virtual bool Redo(bool);
00072
00073
00074
00075 virtual bool Redo(int oeid);
00076
00077
00078
00079 virtual void Clear();
00080
00081
00082
00083 virtual void ClearRedoList();
00084
00085
00086
00087 virtual bool RedoListEmpty();
00088
00089
00090
00091
00092 virtual int GetLastObjectEventIdInList();
00093
00094
00095
00096
00097 virtual int GetLastGroupEventIdInList();
00098
00099
00100
00101
00102 virtual OperationEvent* GetLastOfType(OperationActor* destination, OperationType opType);
00103
00104 protected:
00105
00106
00107 LimitedLinearUndo();
00108
00109
00110
00111 virtual ~LimitedLinearUndo();
00112
00113
00114
00115 void ClearList(UndoContainer* list);
00116
00117 UndoContainer m_UndoList;
00118
00119 UndoContainer m_RedoList;
00120
00121 private:
00122 int FirstObjectEventIdOfCurrentGroup(UndoContainer& stack);
00123
00124 };
00125
00128 itkEventMacro( UndoStackEvent, itk::ModifiedEvent );
00129 itkEventMacro( UndoEmptyEvent, UndoStackEvent );
00130 itkEventMacro( RedoEmptyEvent, UndoStackEvent );
00131 itkEventMacro( UndoNotEmptyEvent, UndoStackEvent );
00132 itkEventMacro( RedoNotEmptyEvent, UndoStackEvent );
00134 itkEventMacro( UndoFullEvent, UndoStackEvent );
00135 itkEventMacro( RedoFullEvent, UndoStackEvent );
00136
00137 }
00138
00139 #endif