Medical Imaging Interaction Toolkit  2026.06.00
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 
22 #include <array>
23 
25 
26 namespace mitk
27 {
28 // create events for interactions
29 #ifdef __GNUC__
30 #pragma GCC visibility push(default)
31 #endif
32  itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent);
33 #ifdef __GNUC__
34 #pragma GCC visibility pop
35 #endif
36 
51  {
52  public:
54  itkFactorylessNewMacro(Self);
55  itkCloneMacro(Self);
56 
64  void SetDataNode(DataNode *dataNode) override;
65 
66  protected:
69 
74  void ConnectActionsAndFunctions() override;
75 
79  void DataNodeChanged() override;
80 
89  void HandlePositionChanged(const InteractionEvent *interactionEvent,
90  Point3D &center,
91  std::array<bool, 6> &handleVisible);
92 
96  virtual bool CheckOverObject(const InteractionEvent *);
97 
101  virtual bool CheckOverHandles(const InteractionEvent *interactionEvent);
102 
107 
112 
117 
122 
127 
132  virtual void InitInteraction(StateMachineAction *, InteractionEvent *interactionEvent);
133 
137  virtual void DeselectHandles(StateMachineAction *, InteractionEvent *interactionEvent);
138 
142  virtual void RestoreNodeProperties();
143 
147  bool InitMembers(InteractionEvent *interactionEvent);
148 
149  private:
153  void EnableOriginalInteraction();
154 
158  void DisableOriginalInteraction();
159 
160  class Impl;
161  Impl *m_Impl;
162  };
163 }
164 #endif
#define MITKBOUNDINGSHAPE_EXPORT
Interactor for manipulating bounding shapes (GeometryData).
virtual void DeselectHandles(StateMachineAction *, InteractionEvent *interactionEvent)
Deselects all Handles at the end of interaction.
void HandlePositionChanged(const InteractionEvent *interactionEvent, Point3D &center, std::array< bool, 6 > &handleVisible)
Updates the handle positions for the renderer of the given event and reports which handles are visibl...
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
Set the data node this interactor operates on.
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 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.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)