Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6  Division of Medical and Biological Informatics.
7  All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without
10  even the implied warranty of MERCHANTABILITY or FITNESS FOR
11  A PARTICULAR PURPOSE.
12 
13  See LICENSE.txt or http://www.mitk.org for details.
14 
15  ===================================================================*/
16 
17 #ifndef mitkPointSetDataInteractor_h_
18 #define mitkPointSetDataInteractor_h_
19 
20 #include "itkObject.h"
21 #include "itkObjectFactory.h"
22 #include "itkSmartPointer.h"
23 #include "mitkCommon.h"
24 #include "mitkDataInteractor.h"
25 #include <MitkCoreExports.h>
26 #include <mitkPointSet.h>
27 
28 namespace mitk
29 {
66  // Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
68  {
69  public:
70  mitkClassMacro(PointSetDataInteractor, DataInteractor) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
71 
76  void SetAccuracy(float accuracy);
77 
83  void SetMaxPoints(unsigned int maxNumber = 0);
84 
85  protected:
87  virtual ~PointSetDataInteractor();
88 
93  virtual void ConnectActionsAndFunctions() override;
94 
100  virtual void DataNodeChanged() override;
101 
109  virtual int GetPointIndexByPosition(Point3D position, unsigned int time = 0, float accuracy = -1);
110 
111  virtual bool CheckSelection(const InteractionEvent *interactionEvent);
112 
117  virtual void AddPoint(StateMachineAction *, InteractionEvent *event);
118 
120  virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
121 
126  virtual void IsClosedContour(StateMachineAction *, InteractionEvent *);
127 
131  virtual void MovePoint(StateMachineAction *, InteractionEvent *);
132 
136  virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent);
137 
141  virtual void FinishMove(StateMachineAction *, InteractionEvent *);
142 
146  virtual void SelectPoint(StateMachineAction *, InteractionEvent *);
147 
151  virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *);
152 
156  virtual void UnSelectAll(StateMachineAction *, InteractionEvent *);
157 
163  virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *);
164 
168  virtual void Abort(StateMachineAction *, InteractionEvent *);
169 
173  Point3D m_LastPoint;
174 
176  Vector3D m_SumVec;
177 
178  // DATA
179  PointSet::Pointer m_PointSet;
180  int m_MaxNumberOfPoints; // maximum of allowed number of points
181  float m_SelectionAccuracy; // accuracy that's needed to select a point
182 
183  // FUNCTIONS
184  void UnselectAll(unsigned int timeStep, ScalarType timeInMs);
185  void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS);
186  };
187 }
188 #endif
#define MITKCORE_EXPORT
double ScalarType
virtual void DataNodeChanged() override
Called when a DataNode has been set/changed.
DataCollection - Class to facilitate loading/accessing structured data.
Implementation of the PointSetInteractor.
Base class from with interactors that handle DataNodes are to be derived.
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:79
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44