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

Method LoadStateMachine

Modules/Core/src/Interactions/mitkEventStateMachine.cpp:41–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool mitk::EventStateMachine::LoadStateMachine(const std::string &filename, const us::Module *module)
42{
43 if (m_StateMachineContainer != nullptr)
44 {
45 m_StateMachineContainer->Delete();
46 }
47 m_StateMachineContainer = StateMachineContainer::New();
48
49 if (m_StateMachineContainer->LoadBehavior(filename, module))
50 {
51 m_CurrentState = m_StateMachineContainer->GetStartState();
52
53 for (auto i = m_ConditionDelegatesMap.begin(); i != m_ConditionDelegatesMap.end();
54 ++i)
55 {
56 delete i->second;
57 }
58 m_ConditionDelegatesMap.clear();
59
60 // clear actions map ,and connect all actions as declared in sub-class
61 for (auto i = m_ActionDelegatesMap.begin(); i != m_ActionDelegatesMap.end(); ++i)
62 {
63 delete i->second;
64 }
65 m_ActionDelegatesMap.clear();
66
67 ConnectActionsAndFunctions();
68 return true;
69 }
70 else
71 {
72 MITK_WARN << "Unable to load StateMachine from file: " << filename;
73 return false;
74 }
75}
76
77mitk::EventStateMachine::~EventStateMachine()
78{

Callers 15

mainFunction · 0.80
InitializeMethod · 0.80
mainFunction · 0.80
OnSelectionChangedMethod · 0.80
RunTestMethod · 0.80
AddGizmoToNodeMethod · 0.80
SelectionChangedMethod · 0.80
OnBtnAddPointMethod · 0.80
ImplMethod · 0.80
ImplMethod · 0.80
ImplMethod · 0.80

Calls 7

LoadBehaviorMethod · 0.80
GetStartStateMethod · 0.80
NewFunction · 0.50
DeleteMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by 4

RunTestMethod · 0.64
setUpMethod · 0.64
SetupInteractorMethod · 0.64