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.cpp
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 
18 #include "mitkMouseMoveEvent.h"
19 
20 #include "mitkInteractionConst.h" // TODO: refactor file
21 #include "mitkInternalEvent.h"
22 #include "mitkOperationEvent.h"
23 #include "mitkRenderingManager.h"
24 #include <mitkPointOperation.h>
25 //
26 #include "mitkBaseRenderer.h"
27 #include "mitkDispatcher.h"
28 
29 #include "mitkUndoController.h"
30 
32 {
33  // Condition which is evaluated before transition is taken
34  // following actions in the statemachine are only executed if it returns TRUE
35  CONNECT_CONDITION("isoverpoint", CheckSelection);
36  CONNECT_FUNCTION("addpoint", AddPoint);
37  CONNECT_FUNCTION("selectpoint", SelectPoint);
39  CONNECT_FUNCTION("unselectAll", UnSelectAll);
40  CONNECT_FUNCTION("initMove", InitMove);
41  CONNECT_FUNCTION("movePoint", MovePoint);
42  CONNECT_FUNCTION("finishMovement", FinishMove);
43  CONNECT_FUNCTION("removePoint", RemovePoint);
44 }
45 
47 {
48  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
49  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
50 
51  // disallow adding of new points if maximum number of points is reached
52  if (m_MaxNumberOfPoints > 1 && m_PointSet->GetSize(timeStep) >= m_MaxNumberOfPoints)
53  {
54  return;
55  }
56  // To add a point the minimal information is the position, this method accepts all InteractionsPositionEvents
57  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
58  if (positionEvent != NULL)
59  {
60  mitk::Point3D itkPoint = positionEvent->GetPositionInWorld();
61 
62  this->UnselectAll(timeStep, timeInMs);
63 
64  int lastPosition = 0;
66  it = m_PointSet->Begin(timeStep);
67  end = m_PointSet->End(timeStep);
68  while (it != end)
69  {
70  if (!m_PointSet->IndexExists(lastPosition, timeStep))
71  break;
72  ++it;
73  ++lastPosition;
74  }
75 
76  // Insert a Point to the PointSet
77  // 2) Create the Operation inserting the point
78 
79  PointOperation *doOp = new mitk::PointOperation(OpINSERT, timeInMs, itkPoint, lastPosition);
80 
81  // 3) If Undo is enabled, also create the inverse Operation
82  if (m_UndoEnabled)
83  {
84  PointOperation *undoOp = new mitk::PointOperation(OpREMOVE, timeInMs, itkPoint, lastPosition);
85  // 4) Do and Undo Operations are combined in an Operation event which also contains the target of the operations
86  // (here m_PointSet)
87  OperationEvent *operationEvent = new OperationEvent(m_PointSet, doOp, undoOp, "Add point");
88  // 5) Store the Operation in the UndoController
90  m_UndoController->SetOperationEvent(operationEvent);
91  }
92 
93  // 6) Execute the Operation performs the actual insertion of the point into the PointSet
94  m_PointSet->ExecuteOperation(doOp);
95 
96  // 7) If Undo is not enabled the Do-Operation is to be dropped to prevent memory leaks.
97  if (!m_UndoEnabled)
98  delete doOp;
99 
100  // Request update
101  interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
102 
103  // Check if points form a closed contour now, if so fire an InternalEvent
104  IsClosedContour(stateMachineAction, interactionEvent);
105 
106  if (m_MaxNumberOfPoints > 0 && m_PointSet->GetSize(timeStep) >= m_MaxNumberOfPoints)
107  {
108  // Signal that DataNode is fully filled
109  this->NotifyResultReady();
110  // Send internal event that can be used by StateMachines to switch in a different state
111  InternalEvent::Pointer event = InternalEvent::New(NULL, this, "MaximalNumberOfPoints");
112  positionEvent->GetSender()->GetDispatcher()->QueueEvent(event.GetPointer());
113  }
114  }
115 }
116 
118 {
119  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
120  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
121 
122  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
123  if (positionEvent != NULL)
124  {
125  Point3D point = positionEvent->GetPositionInWorld();
126  // iterate over point set and check if it contains a point close enough to the pointer to be selected
127  int index = GetPointIndexByPosition(point, timeStep);
128  if (index != -1)
129  {
130  // first deselect the other points
131  // undoable deselect of all points in the DataList
132  this->UnselectAll(timeStep, timeInMs);
133 
134  PointOperation *doOp = new mitk::PointOperation(OpSELECTPOINT, timeInMs, point, index);
135 
136  /*if (m_UndoEnabled)
137  {
138  PointOperation* undoOp = new mitk::PointOperation(OpDESELECTPOINT,timeInMs,point, index);
139  OperationEvent *operationEvent = new OperationEvent(m_PointSet, doOp, undoOp, "Select Point");
140  OperationEvent::IncCurrObjectEventId();
141  m_UndoController->SetOperationEvent(operationEvent);
142  }*/
143 
144  // execute the Operation
145  m_PointSet->ExecuteOperation(doOp);
146 
147  if (!m_UndoEnabled)
148  delete doOp;
149 
150  interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
151  }
152  }
153 }
154 
155 mitk::PointSetDataInteractor::PointSetDataInteractor() : m_MaxNumberOfPoints(0), m_SelectionAccuracy(3.5)
156 {
157 }
158 
160 {
161 }
162 
164 {
165  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
166  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
167 
168  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
169  if (positionEvent != NULL)
170  {
171  mitk::Point3D itkPoint = positionEvent->GetPositionInWorld();
172 
173  // search the point in the list
174  int position = m_PointSet->SearchPoint(itkPoint, m_SelectionAccuracy, timeStep);
175  if (position >= 0) // found a point
176  {
177  PointSet::PointType pt = m_PointSet->GetPoint(position, timeStep);
178  itkPoint[0] = pt[0];
179  itkPoint[1] = pt[1];
180  itkPoint[2] = pt[2];
181 
182  PointOperation *doOp = new mitk::PointOperation(OpREMOVE, timeInMs, itkPoint, position);
183  if (m_UndoEnabled) // write to UndoMechanism
184  {
185  PointOperation *undoOp = new mitk::PointOperation(OpINSERT, timeInMs, itkPoint, position);
186  OperationEvent *operationEvent = new OperationEvent(m_PointSet, doOp, undoOp, "Remove point");
188  m_UndoController->SetOperationEvent(operationEvent);
189  }
190  // execute the Operation
191  m_PointSet->ExecuteOperation(doOp);
192 
193  if (!m_UndoEnabled)
194  delete doOp;
195 
196  /*now select the point "position-1",
197  and if it is the first in list,
198  then continue at the last in list*/
199  // only then a select of a point is possible!
200  if (m_PointSet->GetSize(timeStep) > 0)
201  {
202  this->SelectPoint(m_PointSet->Begin(timeStep)->Index(), timeStep, timeInMs);
203  }
204  }
205  interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
206  }
207 }
208 
210 {
211  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
212 
213  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
214  if (positionEvent != NULL)
215  {
216  Point3D point = positionEvent->GetPositionInWorld();
217  // iterate over point set and check if it contains a point close enough to the pointer to be selected
218  if (GetPointIndexByPosition(point, timeStep) != -1 && m_PointSet->GetSize(timeStep) >= 3)
219  {
220  InternalEvent::Pointer event = InternalEvent::New(NULL, this, "ClosedContour");
221  positionEvent->GetSender()->GetDispatcher()->QueueEvent(event.GetPointer());
222  }
223  }
224 }
225 
227 {
228  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
229  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
230  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
231  if (positionEvent != NULL)
232  {
233  IsClosedContour(stateMachineAction, interactionEvent);
234  mitk::Point3D newPoint, resultPoint;
235  newPoint = positionEvent->GetPositionInWorld();
236 
237  // search the elements in the list that are selected then calculate the
238  // vector, because only with the vector we can move several elements in
239  // the same direction
240  // newPoint - lastPoint = vector
241  // then move all selected and set the lastPoint = newPoint.
242  // then add all vectors to a summeryVector (to be able to calculate the
243  // startpoint for undoOperation)
244  mitk::Vector3D dirVector = newPoint - m_LastPoint;
245 
246  // sum up all Movement for Undo in FinishMovement
247  m_SumVec = m_SumVec + dirVector;
248 
250  it = m_PointSet->Begin(timeStep);
251  end = m_PointSet->End(timeStep);
252  while (it != end)
253  {
254  int position = it->Index();
255  if (m_PointSet->GetSelectInfo(position, timeStep)) // if selected
256  {
257  PointSet::PointType pt = m_PointSet->GetPoint(position, timeStep);
258  mitk::Point3D sumVec;
259  sumVec[0] = pt[0];
260  sumVec[1] = pt[1];
261  sumVec[2] = pt[2];
262  resultPoint = sumVec + dirVector;
263  PointOperation *doOp = new mitk::PointOperation(OpMOVE, timeInMs, resultPoint, position);
264  // execute the Operation
265  // here no undo is stored, because the movement-steps aren't interesting.
266  // only the start and the end is interisting to store for undo.
267  m_PointSet->ExecuteOperation(doOp);
268  delete doOp;
269  }
270  ++it;
271  }
272  m_LastPoint = newPoint; // for calculation of the direction vector
273  // Update the display
274  interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
275  IsClosedContour(stateMachineAction, interactionEvent);
276  }
277 }
278 
280 {
281  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
282  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
283 
284  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
285  if (positionEvent != NULL)
286  {
287  Point3D point = positionEvent->GetPositionInWorld();
288  // iterate over point set and check if it contains a point close enough to the pointer to be selected
289  int index = GetPointIndexByPosition(point, timeStep);
290  // here it is ensured that we don't switch from one point being selected to another one being selected,
291  // without accepting the unselect of the current point
292  if (index != -1)
293  {
294  PointOperation *doOp = new mitk::PointOperation(OpDESELECTPOINT, timeInMs, point, index);
295 
296  /*if (m_UndoEnabled)
297  {
298  PointOperation* undoOp = new mitk::PointOperation(OpSELECTPOINT,timeInMs, point, index);
299  OperationEvent *operationEvent = new OperationEvent(m_PointSet, doOp, undoOp, "Unselect Point");
300  OperationEvent::IncCurrObjectEventId();
301  m_UndoController->SetOperationEvent(operationEvent);
302  }*/
303 
304  m_PointSet->ExecuteOperation(doOp);
305 
306  if (!m_UndoEnabled)
307  delete doOp;
308  }
309  }
310 }
311 
313 {
314  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
315  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
316 
317  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
318  if (positionEvent != NULL)
319  {
320  Point3D positioninWorld = positionEvent->GetPositionInWorld();
321  PointSet::PointsContainer::Iterator it, end;
322 
323  PointSet::DataType *itkPointSet = m_PointSet->GetPointSet(timeStep);
324 
325  end = itkPointSet->GetPoints()->End();
326 
327  for (it = itkPointSet->GetPoints()->Begin(); it != end; it++)
328  {
329  int position = it->Index();
330  // then declare an operation which unselects this point;
331  // UndoOperation as well!
332  if (m_PointSet->GetSelectInfo(position, timeStep))
333  {
334  float distance = sqrt(positioninWorld.SquaredEuclideanDistanceTo(m_PointSet->GetPoint(position, timeStep)));
335  if (distance > m_SelectionAccuracy)
336  {
337  mitk::Point3D noPoint;
338  noPoint.Fill(0);
339  mitk::PointOperation *doOp = new mitk::PointOperation(OpDESELECTPOINT, timeInMs, noPoint, position);
340 
341  /*if ( m_UndoEnabled )
342  {
343  mitk::PointOperation* undoOp = new mitk::PointOperation(OpSELECTPOINT, timeInMs, noPoint, position);
344  OperationEvent *operationEvent = new OperationEvent( m_PointSet, doOp, undoOp, "Unselect Point" );
345  OperationEvent::IncCurrObjectEventId();
346  m_UndoController->SetOperationEvent( operationEvent );
347  }*/
348 
349  m_PointSet->ExecuteOperation(doOp);
350 
351  if (!m_UndoEnabled)
352  delete doOp;
353  }
354  }
355  }
356  }
357  else
358  {
359  this->UnselectAll(timeStep, timeInMs);
360  }
361 }
362 
364 {
365  mitk::PointSet *pointSet = dynamic_cast<mitk::PointSet *>(this->GetDataNode()->GetData());
366  if (pointSet == NULL)
367  {
368  MITK_ERROR << "PointSetDataInteractor:: No valid point set .";
369  return;
370  }
371 
372  m_PointSet = pointSet;
373 }
374 
376 {
377  InternalEvent::Pointer event = InternalEvent::New(NULL, this, IntDeactivateMe);
378  interactionEvent->GetSender()->GetDispatcher()->QueueEvent(event.GetPointer());
379 }
380 
381 /*
382  * Check whether the DataNode contains a pointset, if not create one and add it.
383  */
385 {
386  if (GetDataNode() != nullptr)
387  {
388  PointSet *points = dynamic_cast<PointSet *>(GetDataNode()->GetData());
389  if (points == NULL)
390  {
391  m_PointSet = PointSet::New();
392  GetDataNode()->SetData(m_PointSet);
393  }
394  else
395  {
396  m_PointSet = points;
397  }
398  // load config file parameter: maximal number of points
399  mitk::PropertyList::Pointer properties = GetAttributes();
400  std::string strNumber;
401  if (properties->GetStringProperty("MaxPoints", strNumber))
402  {
403  m_MaxNumberOfPoints = atoi(strNumber.c_str());
404  }
405  }
406 }
407 
409 {
410  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
411 
412  if (positionEvent == NULL)
413  return;
414 
415  // start of the Movement is stored to calculate the undoKoordinate
416  // in FinishMovement
417  m_LastPoint = positionEvent->GetPositionInWorld();
418 
419  // initialize a value to calculate the movement through all
420  // MouseMoveEvents from MouseClick to MouseRelease
421  m_SumVec.Fill(0);
422 
423  GetDataNode()->SetProperty("contourcolor", ColorProperty::New(1.0, 1.0, 1.0));
424 }
425 
427 {
428  unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
429  ScalarType timeInMs = interactionEvent->GetSender()->GetTime();
430 
431  InteractionPositionEvent *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
432 
433  if (positionEvent != NULL)
434  {
435  // finish the movement:
436  // the final point is m_LastPoint
437  // m_SumVec stores the movement in a vector
438  // the operation would not be necessary, but we need it for the undo Operation.
439  // m_LastPoint is for the Operation
440  // the point for undoOperation calculates from all selected
441  // elements (point) - m_SumVec
442 
443  // search all selected elements and move them with undo-functionality.
444 
446  it = m_PointSet->Begin(timeStep);
447  end = m_PointSet->End(timeStep);
448  while (it != end)
449  {
450  int position = it->Index();
451  if (m_PointSet->GetSelectInfo(position, timeStep)) // if selected
452  {
453  PointSet::PointType pt = m_PointSet->GetPoint(position, timeStep);
454  Point3D itkPoint;
455  itkPoint[0] = pt[0];
456  itkPoint[1] = pt[1];
457  itkPoint[2] = pt[2];
458  PointOperation *doOp = new mitk::PointOperation(OpMOVE, timeInMs, itkPoint, position);
459 
460  if (m_UndoEnabled) //&& (posEvent->GetType() == mitk::Type_MouseButtonRelease)
461  {
462  // set the undo-operation, so the final position is undo-able
463  // calculate the old Position from the already moved position - m_SumVec
464  mitk::Point3D undoPoint = (itkPoint - m_SumVec);
465  PointOperation *undoOp = new mitk::PointOperation(OpMOVE, timeInMs, undoPoint, position);
466  OperationEvent *operationEvent = new OperationEvent(m_PointSet, doOp, undoOp, "Move point");
468  m_UndoController->SetOperationEvent(operationEvent);
469  }
470  // execute the Operation
471  m_PointSet->ExecuteOperation(doOp);
472 
473  if (!m_UndoEnabled)
474  delete doOp;
475  }
476  ++it;
477  }
478 
479  // Update the display
480  interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
481  }
482  else
483  {
484  return;
485  }
486  this->NotifyResultReady();
487 }
488 
490 {
491  m_SelectionAccuracy = accuracy;
492 }
493 
494 void mitk::PointSetDataInteractor::SetMaxPoints(unsigned int maxNumber)
495 {
496  m_MaxNumberOfPoints = maxNumber;
497 }
498 
499 int mitk::PointSetDataInteractor::GetPointIndexByPosition(Point3D position, unsigned int time, float accuracy)
500 {
501  // iterate over point set and check if it contains a point close enough to the pointer to be selected
502  PointSet *points = dynamic_cast<PointSet *>(GetDataNode()->GetData());
503  int index = -1;
504  if (points == NULL)
505  {
506  return index;
507  }
508 
509  if (points->GetPointSet(time) == nullptr)
510  return -1;
511 
512  PointSet::PointsContainer *pointsContainer = points->GetPointSet(time)->GetPoints();
513 
514  float minDistance = m_SelectionAccuracy;
515  if (accuracy != -1)
516  minDistance = accuracy;
517 
518  for (PointSet::PointsIterator it = pointsContainer->Begin(); it != pointsContainer->End(); it++)
519  {
520  float distance = sqrt(position.SquaredEuclideanDistanceTo(points->GetPoint(it->Index(), time)));
521  if (distance <
522  minDistance) // if several points fall within the margin, choose the one with minimal distance to position
523  {
524  index = it->Index();
525  }
526  }
527  return index;
528 }
529 
531 {
532  const InteractionPositionEvent *positionEvent = dynamic_cast<const InteractionPositionEvent *>(interactionEvent);
533  if (positionEvent != NULL)
534  {
535  int timeStep = positionEvent->GetSender()->GetTimeStep();
536  Point3D point = positionEvent->GetPositionInWorld();
537  // iterate over point set and check if it contains a point close enough to the pointer to be selected
538  int index = GetPointIndexByPosition(point, timeStep);
539  if (index != -1)
540  return true;
541  }
542  return false;
543 }
544 
545 void mitk::PointSetDataInteractor::UnselectAll(unsigned int timeStep, ScalarType timeInMs)
546 {
547  mitk::PointSet *pointSet = dynamic_cast<mitk::PointSet *>(GetDataNode()->GetData());
548  if (pointSet == NULL)
549  {
550  return;
551  }
552 
553  mitk::PointSet::DataType *itkPointSet = pointSet->GetPointSet(timeStep);
554  if (itkPointSet == NULL)
555  {
556  return;
557  }
558 
559  mitk::PointSet::PointsContainer::Iterator it, end;
560  end = itkPointSet->GetPoints()->End();
561 
562  for (it = itkPointSet->GetPoints()->Begin(); it != end; it++)
563  {
564  int position = it->Index();
565  PointSet::PointDataType pointData = {0, false, PTUNDEFINED};
566  itkPointSet->GetPointData(position, &pointData);
567 
568  // then declare an operation which unselects this point;
569  // UndoOperation as well!
570  if (pointData.selected)
571  {
572  mitk::Point3D noPoint;
573  noPoint.Fill(0);
574  mitk::PointOperation *doOp = new mitk::PointOperation(OpDESELECTPOINT, timeInMs, noPoint, position);
575 
576  /*if ( m_UndoEnabled )
577  {
578  mitk::PointOperation *undoOp =
579  new mitk::PointOperation(OpSELECTPOINT, timeInMs, noPoint, position);
580  OperationEvent *operationEvent = new OperationEvent( pointSet, doOp, undoOp, "Unselect Point" );
581  OperationEvent::IncCurrObjectEventId();
582  m_UndoController->SetOperationEvent( operationEvent );
583  }*/
584 
585  pointSet->ExecuteOperation(doOp);
586 
587  if (!m_UndoEnabled)
588  delete doOp;
589  }
590  }
591 }
592 
593 void mitk::PointSetDataInteractor::SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS)
594 {
595  mitk::PointSet *pointSet = dynamic_cast<mitk::PointSet *>(this->GetDataNode()->GetData());
596 
597  // if List is empty, then no selection of a point can be done!
598  if ((pointSet == NULL) || (pointSet->GetSize(timeStep) <= 0))
599  {
600  return;
601  }
602 
603  // dummyPoint... not needed anyway
604  mitk::Point3D noPoint;
605  noPoint.Fill(0);
606 
607  mitk::PointOperation *doOp = new mitk::PointOperation(OpSELECTPOINT, timeInMS, noPoint, position);
608 
609  /*if ( m_UndoEnabled )
610  {
611  mitk::PointOperation* undoOp = new mitk::PointOperation(OpDESELECTPOINT,timeInMS, noPoint, position);
612 
613  OperationEvent *operationEvent = new OperationEvent(pointSet, doOp, undoOp, "Select Point");
614  OperationEvent::IncCurrObjectEventId();
615  m_UndoController->SetOperationEvent(operationEvent);
616  }*/
617 
618  pointSet->ExecuteOperation(doOp);
619 
620  if (!m_UndoEnabled)
621  delete doOp;
622 }
void UnselectAll(unsigned int timeStep, ScalarType timeInMs)
MeshType DataType
Definition: mitkPointSet.h:133
DataType::PointsContainerIterator PointsIterator
Definition: mitkPointSet.h:137
Super class for all position events.
BaseRenderer * GetSender() const
virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent)
virtual int GetSize(unsigned int t=0) const
returns the current size of the point-list
#define MITK_ERROR
Definition: mitkLogMacros.h:24
double ScalarType
virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent)
static Pointer New()
static Pointer New()
virtual void ExecuteOperation(Operation *operation) override
executes the given Operation
virtual void MovePoint(StateMachineAction *, InteractionEvent *)
ScalarType GetTime() const
Get the time in ms of the currently displayed content.
virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *)
UpdatePointSet Updates the member variable that holds the point set, evaluating the time step of the ...
struct for data of a point
Definition: mitkPointSet.h:95
void SetMaxPoints(unsigned int maxNumber=0)
SetMaxPoints Sets the maximal number of points for the pointset Default ist zero, which result in inf...
PointType GetPoint(PointIdentifier id, int t=0) const
Get the point with ID id in world coordinates.
virtual void AddPoint(StateMachineAction *, InteractionEvent *event)
Constants for most interaction classes, due to the generic StateMachines.
virtual bool CheckSelection(const InteractionEvent *interactionEvent)
virtual void Abort(StateMachineAction *, InteractionEvent *)
T::Pointer GetData(const std::string &name)
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:79
virtual mitk::RenderingManager * GetRenderingManager() const
Setter for the RenderingManager that handles this instance of BaseRenderer.
virtual DataType::Pointer GetPointSet(int t=0) const
returns the pointset
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
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...
virtual void UnSelectAll(StateMachineAction *, InteractionEvent *)
virtual void SelectPoint(StateMachineAction *, InteractionEvent *)
Operation that handles all actions on one Point.
Dispatcher::Pointer GetDispatcher() const
Returns the Dispatcher which handles Events for this BaseRenderer.
virtual void IsClosedContour(StateMachineAction *, InteractionEvent *)
virtual unsigned int GetTimeStep() const
DataType::PointsContainer PointsContainer
Definition: mitkPointSet.h:136
#define CONNECT_CONDITION(a, f)
virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *)
virtual void FinishMove(StateMachineAction *, InteractionEvent *)
static Pointer New(BaseRenderer *_arga, DataInteractor *_argb, const std::string &_argc)
static void IncCurrObjectEventId()
Increases the current ObjectEventId For example if a button click generates operations the ObjectEven...
#define CONNECT_FUNCTION(a, f)
virtual void ConnectActionsAndFunctions() override
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Represents a pair of operations: undo and the according redo.