35 m_CurUndoType = undoType;
36 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
40 m_CurUndoType = undoType;
41 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
48 m_CurUndoType = undoType;
49 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
60 m_CurUndoModel->SetOperationEvent(operationEvent);
66 return this->
Undo(
true);
71 bool ret = m_CurUndoModel->Undo(fine);
80 return this->
Redo(
true);
85 bool ret = m_CurUndoModel->Redo(fine);
94 m_CurUndoModel->Clear();
99 m_CurUndoModel->ClearRedoList();
104 return m_CurUndoModel->RedoListEmpty();
112 if (m_CurUndoType == undoType)
117 auto undoModelIter = m_UndoModelList.find(undoType);
118 if (undoModelIter == m_UndoModelList.end())
124 m_CurUndoModel = (undoModelIter)->second;
125 m_CurUndoType = (undoModelIter)->first;
135 if (m_UndoModelList.find(undoType) != m_UndoModelList.end())
144 m_CurUndoType = undoType;
145 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
149 m_CurUndoType = undoType;
150 m_UndoModelList.insert(UndoModelMap::value_type(undoType, m_CurUndoModel));
166 if (m_UndoModelList.size() < 2)
171 int ok = m_UndoModelList.erase(undoType);
178 if (m_CurUndoType == undoType)
183 if (undoModelIter == m_UndoModelList.end())
185 undoModelIter = m_UndoModelList.begin();
187 m_CurUndoModel = (undoModelIter)->second;
188 m_CurUndoType = (undoModelIter)->first;
197 return m_CurUndoModel->GetLastObjectEventIdInList();
202 return m_CurUndoModel->GetLastGroupEventIdInList();
207 return m_CurUndoModel->GetLastOfType(destination, opType);
212 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 ...