Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 {
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 
53  SpStateMachineState GetNextState() const;
54  std::string GetNextStateName() const;
60  bool operator==(const StateMachineTransition &transition) const;
61 
65  ActionVectorType GetActions() const;
66 
67  const ConditionVectorType &GetConditions() const;
68 
72  void SetNextState(const SpStateMachineState &nextState);
73 
74  protected:
75  StateMachineTransition(const std::string &nextStateName,
76  const std::string &eventClass,
77  const std::string &eventVariant);
78  ~StateMachineTransition() override;
79 
80  // Triggering Event
81  std::string m_EventClass;
82  std::string m_EventVariant;
83 
84  private:
85  void AddAction(const StateMachineAction::Pointer &action);
86 
87  void AddCondition(const StateMachineCondition &condition);
88 
89  SpStateMachineState m_NextState;
90 
91  std::string m_NextStateName;
92 
93  InteractionEvent::Pointer m_TransitionEvent;
94 
98  std::vector<StateMachineAction::Pointer> m_Actions;
99 
100  ConditionVectorType m_Conditions;
101  };
102 
103 } // namespace mitk
104 
105 #endif
mitkInteractionEvent.h
mitk::StateMachineTransition::m_EventVariant
std::string m_EventVariant
Definition: mitkStateMachineTransition.h:82
mitkStateMachineAction.h
mitk::StateMachineState
Definition: mitkStateMachineState.h:30
mitkStateMachineCondition.h
itk::SmartPointer< StateMachineState >
mitkNewMacro3Param
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:94
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::StateMachineCondition
Represents a condition, that has to be fulfilled in order to execute a state machine transition after...
Definition: mitkStateMachineCondition.h:47
mitk::StateMachineContainer
Definition: mitkStateMachineContainer.h:39
mitk::ConditionVectorType
std::vector< StateMachineCondition > ConditionVectorType
Definition: mitkStateMachineTransition.h:30
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
MitkCoreExports.h
mitk::StateMachineTransition::m_EventClass
std::string m_EventClass
Definition: mitkStateMachineTransition.h:81
mitkCommon.h
mitk::StateMachineTransition
Connects two states, and holds references to corresponding actions and conditions.
Definition: mitkStateMachineTransition.h:44
mitk::SpStateMachineState
itk::SmartPointer< StateMachineState > SpStateMachineState
Definition: mitkStateMachineTransition.h:31
mitk::ActionVectorType
std::vector< mitk::StateMachineAction::Pointer > ActionVectorType
Definition: mitkStateMachineTransition.h:27
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15