Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkBoundingShapeInteractor.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 mitkBoundingShapeInteractor_h
14 #define mitkBoundingShapeInteractor_h
15 
16 #include <mitkDataInteractor.h>
17 #include <mitkEventConfig.h>
18 #include <mitkGeometry3D.h>
19 
20 #include <usServiceRegistration.h>
21 
23 
24 namespace mitk
25 {
26 // create events for interactions
27 #pragma GCC visibility push(default)
28  itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent);
29 #pragma GCC visibility pop
30 
39  {
40  public:
42  itkFactorylessNewMacro(Self);
43  itkCloneMacro(Self);
44 
45  void SetDataNode(DataNode *dataNode) override;
46  void SetRotationEnabled(bool rotationEnabled);
47 
48  protected:
51 
56  void ConnectActionsAndFunctions() override;
57 
61  void DataNodeChanged() override;
62 
63  void HandlePositionChanged(const InteractionEvent *interactionEvent, Point3D &center);
64 
68  virtual bool CheckOverObject(const InteractionEvent *);
69 
73  virtual bool CheckOverHandles(const InteractionEvent *interactionEvent);
74 
79 
84 
89 
94 
99 
104  virtual void InitInteraction(StateMachineAction *, InteractionEvent *interactionEvent);
105 
109  virtual void DeselectHandles(StateMachineAction *, InteractionEvent *interactionEvent);
110 
114  virtual void RestoreNodeProperties();
115 
119  bool InitMembers(InteractionEvent *interactionEvent);
120 
121  private:
125  void EnableOriginalInteraction();
126 
130  void DisableOriginalInteraction();
131 
132  class Impl;
133  Impl *m_Impl;
134  };
135 }
136 #endif
#define MITKBOUNDINGSHAPE_EXPORT
Basic interaction methods for mitk::GeometryData.
virtual void DeselectHandles(StateMachineAction *, InteractionEvent *interactionEvent)
Deselects all Handles at the end of interaction.
virtual void SelectHandle(StateMachineAction *, InteractionEvent *)
Called if the mouse pointer is over one of the handles indicated by a color change.
void DataNodeChanged() override
Called when a DataNode has been set/changed.
virtual bool CheckOverObject(const InteractionEvent *)
Checks if the mouse pointer is over the object.
mitkClassMacro(BoundingShapeInteractor, DataInteractor)
void SetDataNode(DataNode *dataNode) override
void HandlePositionChanged(const InteractionEvent *interactionEvent, Point3D &center)
void SetRotationEnabled(bool rotationEnabled)
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.
virtual bool CheckOverHandles(const InteractionEvent *interactionEvent)
Checks if the mouse pointer is over one of the assigned handles.
bool InitMembers(InteractionEvent *interactionEvent)
Initializes member variables.
virtual void InitInteraction(StateMachineAction *, InteractionEvent *interactionEvent)
Initializes the movement, stores starting position.
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.
virtual void ScaleObject(StateMachineAction *, InteractionEvent *)
Performs a object shape change by influencing the scaling of the initial bounding box.
void ConnectActionsAndFunctions() override
Base class from with interactors that handle DataNodes are to be derived.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Find image slices visible on a given plane.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)