Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPointSetDataInteractor.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 mitkPointSetDataInteractor_h
14 #define mitkPointSetDataInteractor_h
15 
16 #include <itkObject.h>
17 #include <itkObjectFactory.h>
18 #include <itkSmartPointer.h>
19 #include <mitkCommon.h>
20 #include <mitkDataInteractor.h>
21 #include <MitkCoreExports.h>
22 #include <mitkPointSet.h>
23 
24 namespace mitk
25 {
60  {
61  public:
63  itkFactorylessNewMacro(Self);
64  itkCloneMacro(Self);
65 
74  void SetAccuracy(float accuracy);
75 
85  void SetMaxPoints(unsigned int maxNumber = 0);
86 
91  void EnableMovement(bool enabled = true);
92 
97  void EnableRemoval(bool enabled = true);
98 
103  void Enable3DPointPlacement(bool enabled = true);
104 
113  void SetBounds(BaseGeometry* geometry);
114 
115  protected:
118 
123  void ConnectActionsAndFunctions() override;
124 
130  void DataNodeChanged() override;
131 
139  virtual int GetPointIndexByPosition(Point3D position, unsigned int time = 0, float accuracy = -1);
140 
145  virtual bool CheckSelection(const InteractionEvent *interactionEvent);
146 
153  virtual bool CanAddPoint(const InteractionEvent *interactionEvent);
154 
160 
162  virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
163 
169 
174 
178  virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent);
179 
184 
189 
194 
199 
205  virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *);
206 
211 
214 
219 
222 
223  // DATA
224  PointSet::Pointer m_PointSet;
225  int m_MaxNumberOfPoints; // maximum of allowed number of points
226  float m_SelectionAccuracy; // accuracy that's needed to select a point
230  mitk::BaseGeometry::Pointer m_Bounds;
231 
232  // FUNCTIONS
233  void UnselectAll(unsigned int timeStep, ScalarType timeInMs);
234  void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS);
235  };
236 }
237 #endif
#define MITKCORE_EXPORT
Abstract base class describing the geometry of a data object.
Base class for interactors that operate on DataNodes.
Base class for all interaction events in MITK.
Implementation of the PointSetInteractor.
virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *)
virtual bool CanAddPoint(const InteractionEvent *interactionEvent)
Check whether a new point can be added.
void DataNodeChanged() override
void ConnectActionsAndFunctions() override
virtual void FinishMove(StateMachineAction *, InteractionEvent *)
virtual int GetPointIndexByPosition(Point3D position, unsigned int time=0, float accuracy=-1)
Return index in PointSet of the point that is within given accuracy to the provided position.
void UnselectAll(unsigned int timeStep, ScalarType timeInMs)
virtual bool CheckSelection(const InteractionEvent *interactionEvent)
Check whether the pointer is over a point in the point set.
virtual void AddPoint(StateMachineAction *, InteractionEvent *event)
Vector3D m_SumVec
summ-vector for Movement
virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *)
Update the member variable that holds the point set.
virtual void KeyDelete(StateMachineAction *, InteractionEvent *)
Delete the currently selected point via keyboard action.
virtual void MovePoint(StateMachineAction *, InteractionEvent *)
void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS)
virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void UnSelectAll(StateMachineAction *, InteractionEvent *)
void Enable3DPointPlacement(bool enabled=true)
Enable or disable point placement in 3D render windows.
void EnableMovement(bool enabled=true)
Enable or disable point movement.
void SetBounds(BaseGeometry *geometry)
Set the boundaries within which points can be placed.
virtual void SelectPoint(StateMachineAction *, InteractionEvent *)
mitk::BaseGeometry::Pointer m_Bounds
virtual void IsClosedContour(StateMachineAction *, InteractionEvent *)
void SetAccuracy(float accuracy)
Set the maximum distance for selecting a point by position.
void SetMaxPoints(unsigned int maxNumber=0)
Set the maximum number of points allowed in the point set.
mitkClassMacro(PointSetDataInteractor, DataInteractor)
void EnableRemoval(bool enabled=true)
Enable or disable point removal.
virtual void Abort(StateMachineAction *, InteractionEvent *)
Point3D m_LastPoint
to calculate a direction vector from last point and actual point
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.