Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkStateMachineState.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkStateMachineState_h
14 #define mitkStateMachineState_h
15 
16 #include <MitkCoreExports.h>
18 #include <itkLightObject.h>
19 #include <string>
20 
21 namespace mitk
22 {
32  class MITKCORE_EXPORT StateMachineState : public itk::LightObject
33  {
34  public:
36  mitkNewMacro2Param(Self, const std::string &, const std::string &);
37 
38  typedef std::vector<mitk::StateMachineState::Pointer> StateMap;
39  typedef std::vector<StateMachineTransition::Pointer> TransitionVector;
40 
47  bool AddTransition(StateMachineTransition::Pointer transition);
48 
56  TransitionVector GetTransitionList(const std::string &eventClass, const std::string &eventVariant);
57 
62  std::string GetName() const;
63 
71  std::string GetMode() const;
72 
82  bool ConnectTransitions(StateMap *allStates);
83 
84  protected:
85  StateMachineState(const std::string &name, const std::string &stateMode);
86  ~StateMachineState() override;
87 
88  private:
90  std::string m_Name;
91 
102  std::string m_StateMode;
103 
105  TransitionVector m_Transitions;
106  };
107 } // namespace mitk
108 #endif
#define MITKCORE_EXPORT
Represents a state of a state machine pattern.
std::vector< StateMachineTransition::Pointer > TransitionVector
std::vector< mitk::StateMachineState::Pointer > StateMap
TransitionVector GetTransitionList(const std::string &eventClass, const std::string &eventVariant)
Return all transitions matching the given event description.
std::string GetMode() const
Return the mode of this state.
mitkNewMacro2Param(Self, const std::string &, const std::string &)
StateMachineState(const std::string &name, const std::string &stateMode)
bool ConnectTransitions(StateMap *allStates)
Connect all transitions to their target states by resolving state name references.
mitkClassMacroItkParent(StateMachineState, itk::LightObject)
bool AddTransition(StateMachineTransition::Pointer transition)
Add a transition to this state.
~StateMachineState() override
std::string GetName() const
Return the name of this state.
Find image slices visible on a given plane.