Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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  itkEventMacro(AffineInteractionEvent, itk::AnyEvent);
25  itkEventMacro(ScaleEvent, AffineInteractionEvent);
26  itkEventMacro(RotateEvent, AffineInteractionEvent);
27  itkEventMacro(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
itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent)
#define MITKDATATYPESEXT_EXPORT
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
Base class from with interactors that handle DataNodes are to be derived.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Affine interaction with mitk::BaseGeometry.
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57