Medical Imaging Interaction Toolkit  2025.12.02
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 {
62  // Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
64  {
65  public:
67  itkFactorylessNewMacro(Self);
68  itkCloneMacro(Self);
69 
74  void SetAccuracy(float accuracy);
75 
81  void SetMaxPoints(unsigned int maxNumber = 0);
82 
83  void EnableMovement(bool enabled = true);
84  void EnableRemoval(bool enabled = true);
85  void Enable3DPointPlacement(bool enabled = true);
86 
91  void SetBounds(BaseGeometry* geometry);
92 
93  protected:
96 
101  void ConnectActionsAndFunctions() override;
102 
108  void DataNodeChanged() override;
109 
117  virtual int GetPointIndexByPosition(Point3D position, unsigned int time = 0, float accuracy = -1);
118 
119  virtual bool CheckSelection(const InteractionEvent *interactionEvent);
120  virtual bool CanAddPoint(const InteractionEvent *interactionEvent);
121 
127 
129  virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
130 
136 
141 
145  virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent);
146 
151 
156 
161 
166 
172  virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *);
173 
178 
180 
185 
188 
189  // DATA
190  PointSet::Pointer m_PointSet;
191  int m_MaxNumberOfPoints; // maximum of allowed number of points
192  float m_SelectionAccuracy; // accuracy that's needed to select a point
196  mitk::BaseGeometry::Pointer m_Bounds;
197 
198  // FUNCTIONS
199  void UnselectAll(unsigned int timeStep, ScalarType timeInMs);
200  void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS);
201  };
202 }
203 #endif
#define MITKCORE_EXPORT
BaseGeometry Describes the geometry of a data object.
Base class from with interactors that handle DataNodes are to be derived.
Implementation of the PointSetInteractor.
virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *)
virtual bool CanAddPoint(const InteractionEvent *interactionEvent)
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)
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 *)
UpdatePointSet Updates the member variable that holds the point set, evaluating the time step of the ...
virtual void KeyDelete(StateMachineAction *, InteractionEvent *)
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)
void EnableMovement(bool enabled=true)
void SetBounds(BaseGeometry *geometry)
Sets 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)
void SetMaxPoints(unsigned int maxNumber=0)
SetMaxPoints Sets the maximal number of points for the pointset Default is zero, which result in infi...
void EnableRemoval(bool enabled=true)
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 statemachine-mechanism) TODO: implem...
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Find image slices visible on a given plane.
double ScalarType