MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::USZonesInteractor Class Reference

DataInteractor for creating a sphere at a specific coordinate. The origin is set by mitk::USZonesInteractor::AddCenter() and then the radius can be updated by mitk::USZonesInteractor::ChangeRadius(). An updated sphere is rendered every time the radius changes. More...

#include <mitkUSZonesInteractor.h>

Inheritance diagram for mitk::USZonesInteractor:

Public Member Functions

 mitkClassMacro (USZonesInteractor, DataInteractor)
 
 itkNewMacro (Self)
 

Static Public Member Functions

static void UpdateSurface (itk::SmartPointer< mitk::DataNode >)
 Creates Vtk Sphere according to current radius. The radius is gotten from the float property "zone.size" of the data node.
 

Static Public Attributes

static const char * DATANODE_PROPERTY_SIZE = "zone.size"
 
static const char * DATANODE_PROPERTY_CREATED = "zone.created"
 

Protected Member Functions

 USZonesInteractor ()
 
 ~USZonesInteractor () override
 
void ConnectActionsAndFunctions () override
 Connects the functions from the state machine to methods of this class.
 
void DataNodeChanged () override
 Sets empty surface as data for the new data node. This is necessary as data nodes without data do not work with data interactors.
 
void AddCenter (StateMachineAction *, InteractionEvent *)
 Sets origin of the data node to the coordinates of the position event.
 
void ChangeRadius (StateMachineAction *, InteractionEvent *)
 Updates radius attribute according to position event. Calculates distance between the data node origin and the current position event and updates the data node attribute "zone.size" accordingly. The mitk::USZonesInteractor::UpdateSurface() function is called then.
 
void EndCreation (StateMachineAction *, InteractionEvent *)
 Sets the property "zone.created" of the data node to true.
 
void AbortCreation (StateMachineAction *, InteractionEvent *)
 Removes Vtk Sphere from data node.
 

Detailed Description

DataInteractor for creating a sphere at a specific coordinate. The origin is set by mitk::USZonesInteractor::AddCenter() and then the radius can be updated by mitk::USZonesInteractor::ChangeRadius(). An updated sphere is rendered every time the radius changes.

DataNode attributes set by this class:

  • zone.size (float) - the radius of the sphere
  • zone.created (bool) - determines if the interactor reached its final state

Two state machines for this interactor are available as resources of the USNavigation module.

  • USZoneInteractions.xml: Create a sphere by clicking left, moving the mouse and clicking left againg. Aborting is possible by right mouse click.
  • USZoneInteractionsHold.xml: Create a sphere by pressing the left mouse button, moving the mouse while holding it pressed and finally release the button. Aborting is possible by right mouse click.

Definition at line 45 of file mitkUSZonesInteractor.h.

Constructor & Destructor Documentation

◆ USZonesInteractor()

mitk::USZonesInteractor::USZonesInteractor ( )
protected

Definition at line 63 of file mitkUSZonesInteractor.cpp.

◆ ~USZonesInteractor()

mitk::USZonesInteractor::~USZonesInteractor ( )
overrideprotected

Definition at line 67 of file mitkUSZonesInteractor.cpp.

Member Function Documentation

◆ AbortCreation()

void mitk::USZonesInteractor::AbortCreation ( StateMachineAction * ,
InteractionEvent *  )
protected

Removes Vtk Sphere from data node.

Returns
always true

Definition at line 134 of file mitkUSZonesInteractor.cpp.

◆ AddCenter()

void mitk::USZonesInteractor::AddCenter ( StateMachineAction * ,
InteractionEvent *  )
protected

Sets origin of the data node to the coordinates of the position event.

Returns
false if interaction event isn't a position event, true otherwise

Definition at line 88 of file mitkUSZonesInteractor.cpp.

◆ ChangeRadius()

void mitk::USZonesInteractor::ChangeRadius ( StateMachineAction * ,
InteractionEvent *  )
protected

Updates radius attribute according to position event. Calculates distance between the data node origin and the current position event and updates the data node attribute "zone.size" accordingly. The mitk::USZonesInteractor::UpdateSurface() function is called then.

Returns
false if interaction event isn't a position event, true otherwise

Definition at line 113 of file mitkUSZonesInteractor.cpp.

◆ ConnectActionsAndFunctions()

void mitk::USZonesInteractor::ConnectActionsAndFunctions ( )
overrideprotected

Connects the functions from the state machine to methods of this class.

Definition at line 71 of file mitkUSZonesInteractor.cpp.

◆ DataNodeChanged()

void mitk::USZonesInteractor::DataNodeChanged ( )
overrideprotected

Sets empty surface as data for the new data node. This is necessary as data nodes without data do not work with data interactors.

Definition at line 79 of file mitkUSZonesInteractor.cpp.

◆ EndCreation()

void mitk::USZonesInteractor::EndCreation ( StateMachineAction * ,
InteractionEvent *  )
protected

Sets the property "zone.created" of the data node to true.

Returns
always true

Definition at line 128 of file mitkUSZonesInteractor.cpp.

◆ itkNewMacro()

mitk::USZonesInteractor::itkNewMacro ( Self )

◆ mitkClassMacro()

mitk::USZonesInteractor::mitkClassMacro ( USZonesInteractor ,
DataInteractor  )

◆ UpdateSurface()

void mitk::USZonesInteractor::UpdateSurface ( itk::SmartPointer< mitk::DataNode > )
static

Creates Vtk Sphere according to current radius. The radius is gotten from the float property "zone.size" of the data node.

Definition at line 24 of file mitkUSZonesInteractor.cpp.

Member Data Documentation

◆ DATANODE_PROPERTY_CREATED

const char * mitk::USZonesInteractor::DATANODE_PROPERTY_CREATED = "zone.created"
static

Definition at line 49 of file mitkUSZonesInteractor.h.

◆ DATANODE_PROPERTY_SIZE

const char * mitk::USZonesInteractor::DATANODE_PROPERTY_SIZE = "zone.size"
static

Definition at line 48 of file mitkUSZonesInteractor.h.


The documentation for this class was generated from the following files: