Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkStateMachineTransition.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 mitkStateMachineTransition_h
14 #define mitkStateMachineTransition_h
15 
16 #include <mitkCommon.h>
17 #include <mitkInteractionEvent.h>
18 #include <mitkStateMachineAction.h>
20 #include <itkLightObject.h>
21 #include <string>
22 
23 #include <MitkCoreExports.h>
24 
25 namespace mitk
26 {
27  class StateMachineState;
28 
29  typedef std::vector<mitk::StateMachineAction::Pointer> ActionVectorType;
30  typedef std::vector<StateMachineCondition> ConditionVectorType;
32 
44  class MITKCORE_EXPORT StateMachineTransition : public itk::LightObject
45  {
46  friend class StateMachineFactory;
47  friend class StateMachineContainer;
48 
49  public:
51  mitkNewMacro3Param(Self, const std::string &, const std::string &, const std::string &);
52 
58 
63  std::string GetNextStateName() const;
64 
76  bool operator==(const StateMachineTransition &transition) const;
77 
83 
89 
95  void SetNextState(const SpStateMachineState &nextState);
96 
97  protected:
98  StateMachineTransition(const std::string &nextStateName,
99  const std::string &eventClass,
100  const std::string &eventVariant);
102 
103  // Triggering Event
104  std::string m_EventClass;
105  std::string m_EventVariant;
106 
107  private:
113  void AddAction(const StateMachineAction::Pointer &action);
114 
120  void AddCondition(const StateMachineCondition &condition);
121 
122  SpStateMachineState m_NextState;
123 
124  std::string m_NextStateName;
125 
126  InteractionEvent::Pointer m_TransitionEvent;
127 
131  std::vector<StateMachineAction::Pointer> m_Actions;
132 
133  ConditionVectorType m_Conditions;
134  };
135 
136 } // namespace mitk
137 
138 #endif
#define MITKCORE_EXPORT
Represents a condition, that has to be fulfilled in order to execute a state machine transition after...
Parses XML state machine descriptions and builds the state machine structure.
Connects two states, and holds references to corresponding actions and conditions.
mitkNewMacro3Param(Self, const std::string &, const std::string &, const std::string &)
StateMachineTransition(const std::string &nextStateName, const std::string &eventClass, const std::string &eventVariant)
std::string GetNextStateName() const
Return the name of the next state that this transition leads to.
void SetNextState(const SpStateMachineState &nextState)
Set the next state of this transition.
bool operator==(const StateMachineTransition &transition) const
Check for equality with another transition.
mitkClassMacroItkParent(StateMachineTransition, itk::LightObject)
const ConditionVectorType & GetConditions() const
Return the list of conditions associated with this transition.
SpStateMachineState GetNextState() const
Return the next state that this transition leads to.
ActionVectorType GetActions() const
Return the list of actions associated with this transition.
Find image slices visible on a given plane.
std::vector< mitk::StateMachineAction::Pointer > ActionVectorType
itk::SmartPointer< StateMachineState > SpStateMachineState
std::vector< StateMachineCondition > ConditionVectorType