39 m_CurUndoType = undoType;
40 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
44 m_CurUndoType = undoType;
45 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
52 m_CurUndoType = undoType;
53 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
64 m_CurUndoModel->SetOperationEvent(operationEvent);
70 return this->Undo(
true);
75 bool ret = m_CurUndoModel->Undo(fine);
84 return this->Redo(
true);
89 bool ret = m_CurUndoModel->Redo(fine);
98 m_CurUndoModel->Clear();
103 m_CurUndoModel->ClearRedoList();
108 return m_CurUndoModel->RedoListEmpty();
116 if (m_CurUndoType == undoType)
121 auto undoModelIter = m_UndoModelList.find(undoType);
122 if (undoModelIter == m_UndoModelList.end())
128 m_CurUndoModel = (undoModelIter)->second;
129 m_CurUndoType = (undoModelIter)->first;
139 if (m_UndoModelList.find(undoType) != m_UndoModelList.end())
146 case LIMITEDLINEARUNDO:
148 m_CurUndoType = undoType;
149 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
151 case VERBOSE_LIMITEDLINEARUNDO:
153 m_CurUndoType = undoType;
154 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
170 if (m_UndoModelList.size() < 2)
175 int ok = m_UndoModelList.erase(undoType);
182 if (m_CurUndoType == undoType)
186 auto undoModelIter = m_UndoModelList.find(DEFAULTUNDOMODEL);
187 if (undoModelIter == m_UndoModelList.end())
189 undoModelIter = m_UndoModelList.begin();
191 m_CurUndoModel = (undoModelIter)->second;
192 m_CurUndoType = (undoModelIter)->first;
201 return m_CurUndoModel->GetLastObjectEventIdInList();
206 return m_CurUndoModel->GetLastGroupEventIdInList();
211 return m_CurUndoModel->GetLastOfType(destination, opType);
216 return m_CurUndoModel;
bool Undo()
calls the UndoMechanism to undo the last change
bool Redo()
calls the RedoMechanism to redo the operations undone
std::map< UndoType, UndoModel::Pointer > UndoModelMap
bool RemoveUndoModel(UndoType undoType)
bool SwitchUndoModel(UndoType undoType)
Constants for most interaction classes, due to the generic StateMachines.
bool SetOperationEvent(UndoStackItem *operationEvent)
abstract class, that can be used by Undo to undo an operation.
OperationEvent * GetLastOfType(OperationActor *destination, OperationType opType)
returns the last specified OperationEvent in Undo-list corresponding to the given value; if nothing f...
UndoController(UndoType undoType=DEFAULTUNDOMODEL)
static const UndoType DEFAULTUNDOMODEL
Default UndoModel to use.
void Clear()
Clears the Undo and the RedoList.
bool RedoListEmpty()
returns true, if the RedoList is empty
static RenderingManager * GetInstance()
bool AddUndoModel(UndoType undoType)
Represents an entry of the undo or redo stack.
superclass for all UndoModels
static UndoModel * GetCurrentUndoModel()
gives access to the currently used UndoModel Introduced to access special functions of more specific ...
virtual ~UndoController()
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Represents a pair of operations: undo and the according redo.
int GetLastObjectEventIdInList()
returns the ObjectEventId of the top Element in the OperationHistory of the selected UndoModel ...
void ClearRedoList()
Clears the RedoList.
int GetLastGroupEventIdInList()
returns the GroupEventId of the top Element in the OperationHistory of the selected UndoModel ...