20 : m_Name(stateName), m_StateMode(stateMode)
31 m_Transitions.clear();
36 for (TransitionVector::iterator it = m_Transitions.begin(); it != m_Transitions.end(); ++it)
38 if (transition.GetPointer() == (*it).GetPointer())
41 m_Transitions.push_back(transition);
46 const std::string &eventVariant)
48 TransitionVector transitions = this->GetTransitionList(eventClass, eventVariant);
50 if (transitions.size() > 1)
52 MITK_WARN <<
"Multiple transitions have been found for event. Use non-deprecated method "
53 "StateMachineState::GetTransitionList() instead!";
56 if (transitions.empty())
62 return transitions.at(0);
67 const std::string &eventVariant)
71 for (TransitionVector::iterator it = m_Transitions.begin(); it != m_Transitions.end(); ++it)
74 transitions.push_back(*it);
90 for (TransitionVector::iterator transIt = m_Transitions.begin(); transIt != m_Transitions.end(); ++transIt)
93 for (StateMap::iterator stateIt = allStates->begin(); stateIt != allStates->end(); ++stateIt)
95 if ((*stateIt)->GetName() == (*transIt)->GetNextStateName())
97 (*transIt)->SetNextState(*stateIt);
104 MITK_WARN <<
"Target State not found in StateMachine.";
StateMachineState(const std::string &name, const std::string &stateMode)
std::string GetMode() const
bool AddTransition(StateMachineTransition::Pointer transition)
TransitionVector GetTransitionList(const std::string &eventClass, const std::string &eventVariant)
Return Transitions that match given event description.
std::string GetName() const
Returns the name.
std::vector< mitk::StateMachineState::Pointer > StateMap
static Pointer New(const std::string &_arga, const std::string &_argb, const std::string &_argc)
bool ConnectTransitions(StateMap *allStates)
Searches dedicated States of all Transitions and sets *nextState of these Transitions. Required for this is a List of all build States of that StateMachine (allStates). This way the StateMachine can be build up.
std::vector< StateMachineTransition::Pointer > TransitionVector
StateMachineTransition::Pointer GetTransition(const std::string &eventClass, const std::string &eventVariant)
Return Transition which matches given event description.