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>
|
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.
|
|
|
| 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.
|
|
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.
◆ USZonesInteractor()
mitk::USZonesInteractor::USZonesInteractor |
( |
| ) |
|
|
protected |
◆ ~USZonesInteractor()
mitk::USZonesInteractor::~USZonesInteractor |
( |
| ) |
|
|
overrideprotected |
◆ AbortCreation()
void mitk::USZonesInteractor::AbortCreation |
( |
StateMachineAction * | , |
|
|
InteractionEvent * | ) |
|
protected |
◆ 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 |
◆ 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 |
◆ itkNewMacro()
mitk::USZonesInteractor::itkNewMacro |
( |
Self | | ) |
|
◆ mitkClassMacro()
◆ UpdateSurface()
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.
◆ DATANODE_PROPERTY_CREATED
const char * mitk::USZonesInteractor::DATANODE_PROPERTY_CREATED = "zone.created" |
|
static |
◆ DATANODE_PROPERTY_SIZE
const char * mitk::USZonesInteractor::DATANODE_PROPERTY_SIZE = "zone.size" |
|
static |
The documentation for this class was generated from the following files: