Interaction with a set of points. More...
#include <mitkDisplayPointSetInteractor.h>
Public Types | |
typedef DisplayPointSetInteractor | Self |
typedef PointSetInteractor | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
Point2D | GetLastDisplayCoordinates () |
BaseRenderer * | GetLastRenderer () |
Static Public Member Functions | |
static Pointer | New (const char *_arga, DataNode *_argb, int _argc) |
static Pointer | New (const char *_arga, DataNode *_argb) |
NewMacro with two parameters for calling itk::Lightobject::New(..) method. | |
Protected Member Functions | |
DisplayPointSetInteractor (const char *type, DataNode *dataNode, int n=-1) | |
Constructor with Param n for limited Set of Points. | |
virtual | ~DisplayPointSetInteractor () |
Default Destructor. | |
virtual bool | ExecuteAction (Action *action, mitk::StateEvent const *stateEvent) |
Convert the given Actions to Operations and send to data and UndoController. | |
Protected Attributes | |
Point2D | m_LastDisplayCoordinates |
last display-coordinates of the point | |
mitk::BaseRenderer * | m_LastRenderer |
Interaction with a set of points.
Points can be added, removed and moved.
Definition at line 39 of file mitkDisplayPointSetInteractor.h.
typedef itk::SmartPointer<const Self> mitk::DisplayPointSetInteractor::ConstPointer |
Reimplemented from mitk::PointSetInteractor.
Definition at line 42 of file mitkDisplayPointSetInteractor.h.
typedef itk::SmartPointer<Self> mitk::DisplayPointSetInteractor::Pointer |
Reimplemented from mitk::PointSetInteractor.
Definition at line 42 of file mitkDisplayPointSetInteractor.h.
Reimplemented from mitk::PointSetInteractor.
Definition at line 42 of file mitkDisplayPointSetInteractor.h.
Reimplemented from mitk::PointSetInteractor.
Definition at line 42 of file mitkDisplayPointSetInteractor.h.
mitk::DisplayPointSetInteractor::DisplayPointSetInteractor | ( | const char * | type, |
DataNode * | dataNode, | ||
int | n = -1 |
||
) | [protected] |
Constructor with Param n for limited Set of Points.
if no n is set, then the number of points is unlimited*
Definition at line 28 of file mitkDisplayPointSetInteractor.cpp.
:PointSetInteractor(type, dataNode, n) { }
mitk::DisplayPointSetInteractor::~DisplayPointSetInteractor | ( | ) | [protected, virtual] |
bool mitk::DisplayPointSetInteractor::ExecuteAction | ( | Action * | action, |
mitk::StateEvent const * | stateEvent | ||
) | [protected, virtual] |
Convert the given Actions to Operations and send to data and UndoController.
Reimplemented from mitk::PointSetInteractor.
Definition at line 41 of file mitkDisplayPointSetInteractor.cpp.
References mitk::AcADDPOINT, mitk::AcFINISHMOVEMENT, mitk::AcREMOVEALL, mitk::AcREMOVEPOINT, mitk::Action::GetActionId(), mitk::DisplayPositionEvent::GetDisplayPosition(), mitk::StateEvent::GetEvent(), and mitk::Event::GetSender().
{ bool ok = false;//for return type bool //get the timestep to also support 3D+T //const mitk::Event *theEvent = stateEvent->GetEvent(); /*Each case must watch the type of the event!*/ /*Each time a Point is added or removed or finished moved, the display-coordinates and the last renderer is stored.*/ switch (action->GetActionId()) { case AcADDPOINT: { mitk::DisplayPositionEvent const *posEvent = dynamic_cast < const mitk::DisplayPositionEvent * > (stateEvent->GetEvent()); if ( posEvent == NULL ) { return false; } m_LastDisplayCoordinates = posEvent->GetDisplayPosition(); m_LastRenderer = posEvent->GetSender(); ok = Superclass::ExecuteAction( action, stateEvent ); break; } case AcREMOVEPOINT://remove the given Point from the list { mitk::DisplayPositionEvent const *posEvent = dynamic_cast < const mitk::DisplayPositionEvent * > (stateEvent->GetEvent()); if ( posEvent == NULL ) { return false; } m_LastDisplayCoordinates = posEvent->GetDisplayPosition(); m_LastRenderer = posEvent->GetSender(); ok = Superclass::ExecuteAction( action, stateEvent ); break; } case AcREMOVEALL: { mitk::DisplayPositionEvent const *posEvent = dynamic_cast < const mitk::DisplayPositionEvent * > (stateEvent->GetEvent()); if ( posEvent == NULL ) { return false; } m_LastDisplayCoordinates = posEvent->GetDisplayPosition(); m_LastRenderer = posEvent->GetSender(); ok = Superclass::ExecuteAction( action, stateEvent ); break; } case AcFINISHMOVEMENT: { mitk::DisplayPositionEvent const *posEvent = dynamic_cast < const mitk::DisplayPositionEvent * > (stateEvent->GetEvent()); if ( posEvent == NULL ) { return false; } m_LastDisplayCoordinates = posEvent->GetDisplayPosition(); m_LastRenderer = posEvent->GetSender(); ok = Superclass::ExecuteAction( action, stateEvent ); break; } default: return Superclass::ExecuteAction( action, stateEvent ); } return ok; }
virtual const char* mitk::DisplayPointSetInteractor::GetClassName | ( | ) | const [virtual] |
Reimplemented from mitk::PointSetInteractor.
mitk::Point2D mitk::DisplayPointSetInteractor::GetLastDisplayCoordinates | ( | ) |
Definition at line 128 of file mitkDisplayPointSetInteractor.cpp.
{ return m_LastDisplayCoordinates; }
mitk::BaseRenderer * mitk::DisplayPointSetInteractor::GetLastRenderer | ( | ) |
Definition at line 133 of file mitkDisplayPointSetInteractor.cpp.
{ return m_LastRenderer; }
static Pointer mitk::DisplayPointSetInteractor::New | ( | const char * | _arga, |
DataNode * | _argb | ||
) | [inline, static] |
NewMacro with two parameters for calling itk::Lightobject::New(..) method.
Reimplemented from mitk::PointSetInteractor.
Definition at line 44 of file mitkDisplayPointSetInteractor.h.
:
static Pointer mitk::DisplayPointSetInteractor::New | ( | const char * | _arga, |
DataNode * | _argb, | ||
int | _argc | ||
) | [inline, static] |
Reimplemented from mitk::PointSetInteractor.
Definition at line 43 of file mitkDisplayPointSetInteractor.h.
Referenced by mitkDataNodeExtTestClass::TestInteractorSetting().
:
Point2D mitk::DisplayPointSetInteractor::m_LastDisplayCoordinates [protected] |
last display-coordinates of the point
Definition at line 71 of file mitkDisplayPointSetInteractor.h.
Definition at line 74 of file mitkDisplayPointSetInteractor.h.