Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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  protected:
85  ~PointSetDataInteractor() override;
86 
91  void ConnectActionsAndFunctions() override;
92 
98  void DataNodeChanged() override;
99 
107  virtual int GetPointIndexByPosition(Point3D position, unsigned int time = 0, float accuracy = -1);
108 
109  virtual bool CheckSelection(const InteractionEvent *interactionEvent);
110 
115  virtual void AddPoint(StateMachineAction *, InteractionEvent *event);
116 
118  virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
119 
124  virtual void IsClosedContour(StateMachineAction *, InteractionEvent *);
125 
129  virtual void MovePoint(StateMachineAction *, InteractionEvent *);
130 
134  virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent);
135 
139  virtual void FinishMove(StateMachineAction *, InteractionEvent *);
140 
144  virtual void SelectPoint(StateMachineAction *, InteractionEvent *);
145 
149  virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *);
150 
154  virtual void UnSelectAll(StateMachineAction *, InteractionEvent *);
155 
161  virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *);
162 
166  virtual void Abort(StateMachineAction *, InteractionEvent *);
167 
172 
175 
176  // DATA
178  int m_MaxNumberOfPoints; // maximum of allowed number of points
179  float m_SelectionAccuracy; // accuracy that's needed to select a point
180 
181  // FUNCTIONS
182  void UnselectAll(unsigned int timeStep, ScalarType timeInMs);
183  void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS);
184  };
185 }
186 #endif
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::PointSetDataInteractor::m_PointSet
PointSet::Pointer m_PointSet
Definition: mitkPointSetDataInteractor.h:177
itk::SmartPointer< Self >
mitkPointSet.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::Vector< ScalarType, 3 >
MitkCoreExports.h
mitk::Point< ScalarType, 3 >
mitkCommon.h
mitkDataInteractor.h
mitk::PointSetDataInteractor::m_MaxNumberOfPoints
int m_MaxNumberOfPoints
Definition: mitkPointSetDataInteractor.h:178
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitk::PointSetDataInteractor::m_SelectionAccuracy
float m_SelectionAccuracy
Definition: mitkPointSetDataInteractor.h:179
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::DataInteractor
Base class from with interactors that handle DataNodes are to be derived.
Definition: mitkDataInteractor.h:48
mitk::PointSetDataInteractor
Implementation of the PointSetInteractor.
Definition: mitkPointSetDataInteractor.h:63
mitk::PointSetDataInteractor::m_LastPoint
Point3D m_LastPoint
to calculate a direction vector from last point and actual point
Definition: mitkPointSetDataInteractor.h:171
mitk::PointSetDataInteractor::m_SumVec
Vector3D m_SumVec
summ-vector for Movement
Definition: mitkPointSetDataInteractor.h:174
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20