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

Method ConnectTransitions

Modules/Core/src/Interactions/mitkStateMachineState.cpp:63–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61//## Parse all transitions and find the State that matches the String-Name.
62
63bool mitk::StateMachineState::ConnectTransitions(StateMap *allStates)
64{
65 for (auto transIt = m_Transitions.begin(); transIt != m_Transitions.end(); ++transIt)
66 {
67 bool found = false;
68 for (auto stateIt = allStates->begin(); stateIt != allStates->end(); ++stateIt)
69 {
70 if ((*stateIt)->GetName() == (*transIt)->GetNextStateName())
71 {
72 (*transIt)->SetNextState(*stateIt);
73 found = true;
74 break;
75 }
76 }
77 if (!found)
78 {
79 MITK_WARN << "Target State not found in StateMachine.";
80 return false; // only reached if no state matching the string is found
81 }
82 }
83 return true;
84}

Callers 1

ConnectStatesMethod · 0.80

Calls 5

GetNextStateNameMethod · 0.80
SetNextStateMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected