Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

mitk::DisplayPointSetInteractor Class Reference
[Interaction Classes]

Interaction with a set of points. More...

#include <mitkDisplayPointSetInteractor.h>

Inheritance diagram for mitk::DisplayPointSetInteractor:
Inheritance graph
[legend]
Collaboration diagram for mitk::DisplayPointSetInteractor:
Collaboration graph
[legend]

List of all members.

Public Types

typedef DisplayPointSetInteractor Self
typedef PointSetInteractor Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
Point2D GetLastDisplayCoordinates ()
BaseRendererGetLastRenderer ()

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::BaseRendererm_LastRenderer

Detailed Description

Interaction with a set of points.

Points can be added, removed and moved.

Definition at line 39 of file mitkDisplayPointSetInteractor.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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]

Default Destructor.

Definition at line 35 of file mitkDisplayPointSetInteractor.cpp.

{
}

Member Function Documentation

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.

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]

Member Data Documentation

last display-coordinates of the point

Definition at line 71 of file mitkDisplayPointSetInteractor.h.

Definition at line 74 of file mitkDisplayPointSetInteractor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines