Interaction with a single point by mouse movement. More...
#include <mitkMouseMovePointSetInteractor.h>
Public Types | |
typedef MouseMovePointSetInteractor | Self |
typedef Interactor | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
virtual float | CanHandleEvent (StateEvent const *stateEvent) const |
calculates how good the data, this statemachine handles, is hit by the event. | |
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 | |
MouseMovePointSetInteractor (const char *type, DataNode *dataNode, int n=-1) | |
Constructor with Param n for limited Set of Points. | |
virtual | ~MouseMovePointSetInteractor () |
Default Destructor. |
Interaction with a single point by mouse movement.
A new point is added by mouse movement, an existing point will be removed before adding a new one.
Definition at line 36 of file mitkMouseMovePointSetInteractor.h.
typedef itk::SmartPointer<const Self> mitk::MouseMovePointSetInteractor::ConstPointer |
Reimplemented from mitk::PointSetInteractor.
Definition at line 39 of file mitkMouseMovePointSetInteractor.h.
typedef itk::SmartPointer<Self> mitk::MouseMovePointSetInteractor::Pointer |
Reimplemented from mitk::PointSetInteractor.
Definition at line 39 of file mitkMouseMovePointSetInteractor.h.
Reimplemented from mitk::PointSetInteractor.
Definition at line 39 of file mitkMouseMovePointSetInteractor.h.
Reimplemented from mitk::PointSetInteractor.
Definition at line 39 of file mitkMouseMovePointSetInteractor.h.
mitk::MouseMovePointSetInteractor::MouseMovePointSetInteractor | ( | 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 25 of file mitkMouseMovePointSetInteractor.cpp.
:PointSetInteractor(type, dataNode, n) { }
mitk::MouseMovePointSetInteractor::~MouseMovePointSetInteractor | ( | ) | [protected, virtual] |
float mitk::MouseMovePointSetInteractor::CanHandleEvent | ( | StateEvent const * | stateEvent ) | const [virtual] |
calculates how good the data, this statemachine handles, is hit by the event.
overwritten, cause we don't look at the boundingbox, we look at each point and want to accept mouse movement for setting points
overwritten cause this class can handle mouse move events!
Reimplemented from mitk::PointSetInteractor.
Definition at line 36 of file mitkMouseMovePointSetInteractor.cpp.
References mitk::StateEvent::GetEvent(), mitk::StateEvent::GetId(), mitk::Event::GetSender(), mitk::BaseRenderer::GetTimeStep(), and mitk::State::GetTransition().
{ float returnValue = 0.0; //if it is a key event that can be handled in the current state, then return 0.5 mitk::DisplayPositionEvent const *disPosEvent = dynamic_cast <const mitk::DisplayPositionEvent *> (stateEvent->GetEvent()); //Key event handling: if (disPosEvent == NULL) { //check, if the current state has a transition waiting for that key event. if (this->GetCurrentState()->GetTransition(stateEvent->GetId())!=NULL) { return 0.5; } else { return 0; } } //get the time of the sender to look for the right transition. mitk::BaseRenderer* sender = stateEvent->GetEvent()->GetSender(); if (sender != NULL) { unsigned int timeStep = sender->GetTimeStep(m_DataNode->GetData()); //if the event can be understood and if there is a transition waiting for that event mitk::State const* state = this->GetCurrentState(timeStep); if (state!= NULL) if (state->GetTransition(stateEvent->GetId())!=NULL) returnValue = 0.5;//it can be understood } return returnValue; }
virtual const char* mitk::MouseMovePointSetInteractor::GetClassName | ( | ) | const [virtual] |
Reimplemented from mitk::PointSetInteractor.
static Pointer mitk::MouseMovePointSetInteractor::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 41 of file mitkMouseMovePointSetInteractor.h.
:
static Pointer mitk::MouseMovePointSetInteractor::New | ( | const char * | _arga, |
DataNode * | _argb, | ||
int | _argc | ||
) | [inline, static] |
Reimplemented from mitk::PointSetInteractor.
Definition at line 40 of file mitkMouseMovePointSetInteractor.h.
: