Medical Imaging Interaction Toolkit  2026.06.00
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 #ifdef __GNUC__
24 #pragma GCC visibility push(default)
25 #endif
26  itkEventMacroDeclaration(AffineInteractionEvent, itk::AnyEvent);
28  itkEventMacroDeclaration(ScaleEvent, AffineInteractionEvent);
30  itkEventMacroDeclaration(RotateEvent, AffineInteractionEvent);
32  itkEventMacroDeclaration(TranslateEvent, AffineInteractionEvent);
33 #ifdef __GNUC__
34 #pragma GCC visibility pop
35 #endif
36 
55  {
56  public:
58  itkFactorylessNewMacro(Self);
59  itkCloneMacro(Self);
60 
69  void SetDataNode(DataNode *node) override;
70 
80 
91  void RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry *geometry);
92 
102  void ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry *geometry);
103 
112 
113  protected:
120  void ConnectActionsAndFunctions() override;
124  void DataNodeChanged() override;
125 
129  virtual bool CheckOverObject(const InteractionEvent *);
137  virtual void TranslateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
138  virtual void TranslateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
139  virtual void TranslateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
140  virtual void TranslateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
141  virtual void TranslateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
143 
144  virtual void RotateUpKey(StateMachineAction *, InteractionEvent *interactionEvent);
145  virtual void RotateDownKey(StateMachineAction *, InteractionEvent *interactionEvent);
146  virtual void RotateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent);
147  virtual void RotateRightKey(StateMachineAction *, InteractionEvent *interactionEvent);
148  virtual void RotateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
149  virtual void RotateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent);
150 
152  virtual void ScaleUpKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent);
153 
154  virtual void RestoreNodeProperties();
155 
160  bool InitMembers(InteractionEvent *interactionEvent);
161 
162  private:
163  Point3D m_InitialPickedWorldPoint;
164  Point2D m_InitialPickedDisplayPoint;
165 
166  Geometry3D::Pointer m_OriginalGeometry;
167  };
168 }
169 #endif
#define MITKDATATYPESEXT_EXPORT
Affine interaction with mitk::BaseGeometry.
virtual void RotateObject(StateMachineAction *, InteractionEvent *)
virtual bool CheckOverObject(const InteractionEvent *)
virtual void ScaleDownKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent)
mitkClassMacro(AffineBaseDataInteractor3D, DataInteractor)
virtual void TranslateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent)
mitk::BaseGeometry * GetUpdatedTimeGeometry(mitk::InteractionEvent *interactionEvent)
Retrieve the geometry for the current time step from the interaction event.
virtual void RotateUpModifierKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void RotateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void ScaleObject(StateMachineAction *, InteractionEvent *)
virtual void RotateUpKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void InitTranslate(StateMachineAction *, InteractionEvent *)
virtual void RotateDownKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void RotateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent)
void RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry *geometry)
Rotate the given geometry around one of its principal axes.
bool InitMembers(InteractionEvent *interactionEvent)
InitMembers convenience method to avoid code duplication between InitRotate() and InitTranslate().
virtual void DeselectObject(StateMachineAction *, InteractionEvent *)
virtual void TranslateUpKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void TranslateDownKey(StateMachineAction *, InteractionEvent *interactionEvent)
void TranslateGeometry(mitk::Vector3D translate, mitk::BaseGeometry *geometry)
Translate the given geometry by the specified vector.
void ConnectActionsAndFunctions() override
virtual void TranslateObject(StateMachineAction *, InteractionEvent *)
virtual void RotateRightKey(StateMachineAction *, InteractionEvent *interactionEvent)
void ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry *geometry)
Scale the given geometry by the specified factors.
virtual void ScaleUpKey(mitk::StateMachineAction *, mitk::InteractionEvent *interactionEvent)
virtual void TranslateRightKey(StateMachineAction *, InteractionEvent *interactionEvent)
void SetDataNode(DataNode *node) override
Set the DataNode for this interactor.
virtual void TranslateLeftKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void InitRotate(StateMachineAction *, InteractionEvent *)
virtual void TranslateDownModifierKey(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void SelectObject(StateMachineAction *, InteractionEvent *)
Abstract base class describing the geometry of a data object.
Base class for interactors that operate on DataNodes.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
Base class for all interaction events in MITK.
Represents an action that is executed after a certain event in the state machine mechanism.
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)