MCPcopy Create free account
hub / github.com/MITK/MITK / SwitchUndoModel

Method SwitchUndoModel

Modules/Core/src/Controllers/mitkUndoController.cpp:112–130  ·  view source on GitHub ↗

#Documentation #Switches the UndoModel to the given Type #if there is no equal Type in List, then return false

Source from the content-addressed store, hash-verified

110//##Switches the UndoModel to the given Type
111//##if there is no equal Type in List, then return false
112bool mitk::UndoController::SwitchUndoModel(UndoType undoType)
113{
114 if (m_CurUndoType == undoType)
115 {
116 return true; // already switched, don't need to be switched!
117 }
118
119 auto undoModelIter = m_UndoModelList.find(undoType);
120 if (undoModelIter == m_UndoModelList.end())
121 { // undoType not found in List
122 return false;
123 }
124
125 // found-> switch to UndoModel
126 m_CurUndoModel = (undoModelIter)->second;
127 m_CurUndoType = (undoModelIter)->first;
128 m_CurUndoModel->SetUndoLimit(static_cast<std::size_t>(mitk::UndoRedoPreferenceHelper::GetActiveLimit()));
129 return true;
130}
131
132//##Documentation
133//##adds a new kind of UndoModel to the set of UndoModels

Callers 2

mitkUndoControllerTestFunction · 0.80

Calls 3

SetUndoLimitMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by 2

mitkUndoControllerTestFunction · 0.64