Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkAffineBaseDataInteractor3D_h
18 #define mitkAffineBaseDataInteractor3D_h
19 
21 #include <mitkDataInteractor.h>
22 #include <mitkGeometry3D.h>
23 
24 namespace mitk
25 {
27 #pragma GCC visibility push(default)
28  itkEventMacro(AffineInteractionEvent, itk::AnyEvent) itkEventMacro(ScaleEvent, AffineInteractionEvent)
29  itkEventMacro(RotateEvent, AffineInteractionEvent) itkEventMacro(TranslateEvent, AffineInteractionEvent)
30 #pragma GCC visibility pop
31 
37  // Inherit from DataInteractor, this provides functionality of a state machine and configurable inputs.
39  {
40  public:
42  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
43 
44  virtual void SetDataNode(DataNode *node);
45  void TranslateGeometry(mitk::Vector3D translate, mitk::BaseGeometry *geometry);
46  void RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry *geometry);
47  void ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry *geometry);
48  mitk::BaseGeometry *GetUpdatedTimeGeometry(mitk::InteractionEvent *interactionEvent);
49 
50  protected:
52  virtual ~AffineBaseDataInteractor3D();
57  virtual void ConnectActionsAndFunctions() override;
61  virtual void DataNodeChanged() override;
62 
66  virtual bool CheckOverObject(const InteractionEvent *);
69  virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
70  virtual void InitRotate(StateMachineAction *, InteractionEvent *);
72  virtual void RotateObject(StateMachineAction *, InteractionEvent *);
74  virtual void TranslateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
75  virtual void TranslateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
76  virtual void TranslateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
77  virtual void TranslateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
78  virtual void TranslateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
79  virtual void TranslateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
80 
81  virtual void RotateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
82  virtual void RotateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
83  virtual void RotateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
84  virtual void RotateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
85  virtual void RotateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
86  virtual void RotateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
87 
88  virtual void ScaleDownKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
89  virtual void ScaleUpKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
90 
91  virtual void RestoreNodeProperties();
92 
97  bool InitMembers(InteractionEvent *interactionEvent);
98 
99  private:
100  Point3D m_InitialPickedWorldPoint;
101  Point2D m_InitialPickedDisplayPoint;
102 
103  Geometry3D::Pointer m_OriginalGeometry;
104  };
105 }
106 #endif
bool InitMembers(InteractionEvent *interactionEvent)
Initializes member variables.
virtual bool CheckOverObject(const InteractionEvent *)
Checks if the mouse pointer is over the object.
#define MITKDATATYPESEXT_EXPORT
double ScalarType
virtual void DataNodeChanged() override
Called when a DataNode has been set/changed.
DataCollection - Class to facilitate loading/accessing structured data.
virtual void DeselectObject(StateMachineAction *, InteractionEvent *)
Called if the mouse pointer leaves the area of the object.
virtual void SelectObject(StateMachineAction *, InteractionEvent *)
Called if the mouse pointer is over the object indicated by a color change.
Base class from with interactors that handle DataNodes are to be derived.
virtual void RestoreNodeProperties()
Restore default properties of bounding box and handles.
virtual void TranslateObject(StateMachineAction *, InteractionEvent *)
Performs a translation of the object relative to the mouse movement.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
itkEventMacro(ContourModelEvent, itk::AnyEvent)
virtual void SetDataNode(DataNode *dataNode) override
Affine interaction with mitk::BaseGeometry.
virtual void ScaleObject(StateMachineAction *, InteractionEvent *)
Performs a object shape change by influencing the scaling of the initial bounding box...
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66