Medical Imaging Interaction Toolkit  2023.12.99-ed252ae7
Medical Imaging Interaction Toolkit
mitkAffineBaseDataInteractor3D.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 mitkAffineBaseDataInteractor3D_h
14 #define mitkAffineBaseDataInteractor3D_h
15 
17 #include <mitkDataInteractor.h>
18 #include <mitkGeometry3D.h>
19 
20 namespace mitk
21 {
23 #pragma GCC visibility push(default)
24  itkEventMacroDeclaration(AffineInteractionEvent, itk::AnyEvent);
25  itkEventMacroDeclaration(ScaleEvent, AffineInteractionEvent);
26  itkEventMacroDeclaration(RotateEvent, AffineInteractionEvent);
27  itkEventMacroDeclaration(TranslateEvent, AffineInteractionEvent);
28 #pragma GCC visibility pop
29 
35  // Inherit from DataInteractor, this provides functionality of a state machine and configurable inputs.
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
43  void SetDataNode(DataNode *node) override;
44  void TranslateGeometry(mitk::Vector3D translate, mitk::BaseGeometry *geometry);
45  void RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry *geometry);
46  void ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry *geometry);
47  mitk::BaseGeometry *GetUpdatedTimeGeometry(mitk::InteractionEvent *interactionEvent);
48 
49  protected:
51  ~AffineBaseDataInteractor3D() override;
56  void ConnectActionsAndFunctions() override;
60  void DataNodeChanged() override;
61 
65  virtual bool CheckOverObject(const InteractionEvent *);
66  virtual void SelectObject(StateMachineAction *, InteractionEvent *);
67  virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
68  virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
69  virtual void InitRotate(StateMachineAction *, InteractionEvent *);
70  virtual void TranslateObject(StateMachineAction *, InteractionEvent *);
71  virtual void RotateObject(StateMachineAction *, InteractionEvent *);
72  virtual void ScaleObject(StateMachineAction *, InteractionEvent *);
73  virtual void TranslateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
74  virtual void TranslateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
75  virtual void TranslateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
76  virtual void TranslateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
77  virtual void TranslateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
78  virtual void TranslateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
79 
80  virtual void RotateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
81  virtual void RotateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
82  virtual void RotateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
83  virtual void RotateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
84  virtual void RotateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
85  virtual void RotateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
86 
87  virtual void ScaleDownKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
88  virtual void ScaleUpKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
89 
90  virtual void RestoreNodeProperties();
91 
96  bool InitMembers(InteractionEvent *interactionEvent);
97 
98  private:
99  Point3D m_InitialPickedWorldPoint;
100  Point2D m_InitialPickedDisplayPoint;
101 
102  Geometry3D::Pointer m_OriginalGeometry;
103  };
104 }
105 #endif
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::AffineBaseDataInteractor3D
Affine interaction with mitk::BaseGeometry.
Definition: mitkAffineBaseDataInteractor3D.h:36
MitkDataTypesExtExports.h
MITKDATATYPESEXT_EXPORT
#define MITKDATATYPESEXT_EXPORT
Definition: MitkDataTypesExtExports.h:15
itk::SmartPointer< Self >
mitkGeometry3D.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::Vector< ScalarType, 3 >
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
mitk::Point< ScalarType, 3 >
mitkDataInteractor.h
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::DataInteractor
Base class from with interactors that handle DataNodes are to be derived.
Definition: mitkDataInteractor.h:48
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::itkEventMacroDeclaration
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20