Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
Medical Imaging Interaction Toolkit
mitk::DataInteractor Class Reference

Base class from with interactors that handle DataNodes are to be derived. More...

#include <mitkDataInteractor.h>

Inheritance diagram for mitk::DataInteractor:
Collaboration diagram for mitk::DataInteractor:

Public Types

typedef DataInteractor Self
 
typedef EventStateMachine Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::EventStateMachine
typedef EventStateMachine Self
 
typedef InteractionEventHandler Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< std::string, TActionFunctor * > ActionFunctionsMapType
 
typedef itk::SmartPointer< StateMachineStateStateMachineStateType
 
- Public Types inherited from mitk::InteractionEventHandler
typedef InteractionEventHandler Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
DataNodeGetDataNode () const
 
virtual void SetDataNode (DataNode *dataNode)
 
int GetLayer () const
 
ProcessEventMode GetMode () const
 
- Public Member Functions inherited from mitk::EventStateMachine
bool LoadStateMachine (const std::string &filename, const us::Module *module=nullptr)
 Loads XML resource. More...
 
bool HandleEvent (InteractionEvent *event, DataNode *dataNode)
 
void EnableUndo (bool enable)
 Enables or disabled Undo. More...
 
void EnableInteraction (bool enable)
 Enables/disables the state machine. In un-enabled state it won't react to any events. More...
 
- Public Member Functions inherited from mitk::InteractionEventHandler
bool SetEventConfig (const std::string &filename, const us::Module *module=nullptr)
 Loads a configuration from an XML resource. More...
 
bool SetEventConfig (const EventConfig &config)
 Loads a configuration from an EventConfig object. More...
 
EventConfig GetEventConfig () const
 Returns the current configuration. More...
 
bool AddEventConfig (const std::string &filename, const us::Module *module=nullptr)
 This method extends the configuration. More...
 
bool AddEventConfig (const EventConfig &config)
 This method extends the configuration. The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new one. This way several configurations can be combined. More...
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::EventStateMachine
static const char * GetStaticNameOfClass ()
 
- Static Public Member Functions inherited from mitk::InteractionEventHandler
static const char * GetStaticNameOfClass ()
 

Static Public Attributes

static const std::string IntDeactivateMe
 
static const std::string IntLeaveWidget
 
static const std::string IntEnterWidget
 

Protected Member Functions

 DataInteractor ()
 
 ~DataInteractor () override
 
void ConnectActionsAndFunctions () override
 Overwrite this function to connect actions from StateMachine description with functions. More...
 
virtual void DataNodeChanged ()
 Is called when a DataNode is initially set or changed To be implemented by sub-classes for initialization code which require a DataNode. More...
 
virtual void NotifyStart ()
 Sends StartInteraction event via the mitk::DataNode. More...
 
virtual void NotifyResultReady ()
 NotifyResultReady Sends ResultReady event via the mitk::DataNode. More...
 
- Protected Member Functions inherited from mitk::EventStateMachine
 EventStateMachine ()
 
 ~EventStateMachine () override
 
void AddActionFunction (const std::string &action, TActionFunctor *functor)
 
void AddActionFunction (const std::string &action, const ActionFunctionDelegate &delegate)
 
void AddConditionFunction (const std::string &condition, const ConditionFunctionDelegate &delegate)
 
StateMachineStateGetCurrentState () const
 
void ResetToStartState ()
 ResetToStartState Reset state machine to it initial starting state. More...
 
virtual bool CheckCondition (const StateMachineCondition &condition, const InteractionEvent *interactionEvent)
 
virtual void ExecuteAction (StateMachineAction *action, InteractionEvent *interactionEvent)
 
virtual bool FilterEvents (InteractionEvent *interactionEvent, DataNode *dataNode)
 
void SetMouseCursor (const char *xpm[], int hotspotX, int hotspotY)
 Sets the specified mouse cursor. More...
 
void ResetMouseCursor ()
 Resets the mouse cursor (if modified by the SlicesCoordinator) to its original state. More...
 
StateMachineTransitionGetExecutableTransition (InteractionEvent *event)
 Returns the executable transition for the given event. More...
 
- Protected Member Functions inherited from mitk::InteractionEventHandler
 InteractionEventHandler ()
 
 ~InteractionEventHandler () override
 
PropertyList::Pointer GetAttributes () const
 
std::string MapToEventVariant (InteractionEvent *interactionEvent)
 
virtual void ConfigurationChanged ()
 

Additional Inherited Members

- Protected Types inherited from mitk::EventStateMachine
typedef MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > ActionFunctionDelegate
 
typedef MessageAbstractDelegate1< const InteractionEvent *, bool > ConditionFunctionDelegate
 
- Protected Attributes inherited from mitk::EventStateMachine
bool m_IsActive
 
UndoControllerm_UndoController
 
bool m_UndoEnabled
 

Detailed Description

Base class from with interactors that handle DataNodes are to be derived.

Base class from with interactors that handle DataNodes are to be derived. Provides an interface that is relevant for the interactor to work together with the dispatcher. To implement a new interactor overwrite the ConnectActionsAndFunctions to connect the actions.

Definition at line 48 of file mitkDataInteractor.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

Constructor & Destructor Documentation

◆ DataInteractor()

mitk::DataInteractor::DataInteractor ( )
protected

Definition at line 22 of file mitkDataInteractor.cpp.

◆ ~DataInteractor()

mitk::DataInteractor::~DataInteractor ( )
overrideprotected

Definition at line 26 of file mitkDataInteractor.cpp.

Member Function Documentation

◆ Clone()

Pointer mitk::DataInteractor::Clone ( ) const

◆ ConnectActionsAndFunctions()

void mitk::DataInteractor::ConnectActionsAndFunctions ( )
overrideprotectedvirtual

Overwrite this function to connect actions from StateMachine description with functions.

Following example shows how to connect the 'addpoint' action from the StateMachine XML description using the CONNECT_FUNCTION macro with the AddPoint() function in the TestInteractor.

void mitk::TestInteractor::ConnectActionsAndFunctions()
{
CONNECT_FUNCTION("addpoint", AddPoint);
}

Reimplemented from mitk::EventStateMachine.

Reimplemented in mitk::PointSetDataInteractor, mitk::TubeGraphDataInteractor, mitk::PlanarFigureInteractor, mitk::AffineBaseDataInteractor3D, mitk::ContourModelLiveWireInteractor, mitk::ContourModelInteractor, mitk::AffineImageCropperInteractor, mitk::ClippingPlaneInteractor3D, and mitk::SurfaceDeformationDataInteractor3D.

Definition at line 68 of file mitkDataInteractor.cpp.

References MITK_WARN.

◆ DataNodeChanged()

void mitk::DataInteractor::DataNodeChanged ( )
protectedvirtual

Is called when a DataNode is initially set or changed To be implemented by sub-classes for initialization code which require a DataNode.

Note
New DataInteractors usually are expected to have the focus, but this only works if they have the highest Layer, since empty DataNodes have a layer of -1, the DataNode must be filled here in order to get a layer assigned.
Is also called when the DataNode is set to nullptr.

Reimplemented in mitk::PointSetDataInteractor, mitk::TubeGraphDataInteractor, mitk::AffineBaseDataInteractor3D, mitk::SinglePointDataInteractor, mitk::AffineImageCropperInteractor, mitk::ClippingPlaneInteractor3D, and mitk::SurfaceDeformationDataInteractor3D.

Definition at line 96 of file mitkDataInteractor.cpp.

Referenced by SetDataNode().

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::DataInteractor::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::EventStateMachine.

Reimplemented in mitk::PointSetDataInteractor, and mitk::SinglePointDataInteractor.

Definition at line 56 of file mitkDataInteractor.h.

◆ GetClassName()

virtual const char* mitk::DataInteractor::GetClassName ( ) const
virtual

◆ GetDataNode()

mitk::DataNode * mitk::DataInteractor::GetDataNode ( ) const

Definition at line 37 of file mitkDataInteractor.cpp.

Referenced by mitk::PlanarFigureInteractor::AddInitialPoint(), mitk::SinglePointDataInteractor::AddPoint(), mitk::PlanarFigureInteractor::AddPoint(), mitk::PointSetDataInteractor::AddPoint(), mitk::PlanarFigureInteractor::CheckControlPointHovering(), mitk::PlanarFigureInteractor::CheckFigureFinished(), mitk::PlanarFigureInteractor::CheckFigureHovering(), mitk::PlanarFigureInteractor::CheckFigureIsDeletable(), mitk::PlanarFigureInteractor::CheckFigureIsEditable(), mitk::PlanarFigureInteractor::CheckFigureIsExtendable(), mitk::PlanarFigureInteractor::CheckFigureOnRenderingGeometry(), mitk::PlanarFigureInteractor::CheckFigurePlaced(), mitk::PlanarFigureInteractor::CheckMinimalFigureFinished(), mitk::SurfaceDeformationDataInteractor3D::CheckOverObject(), mitk::ClippingPlaneInteractor3D::CheckOverObject(), mitk::AffineImageCropperInteractor::CheckOverObject(), mitk::AffineBaseDataInteractor3D::CheckOverObject(), mitk::PlanarFigureInteractor::CheckPointValidity(), mitk::PlanarFigureInteractor::CheckResetOnPointSelect(), mitk::PlanarFigureInteractor::CheckSelection(), mitk::ExampleInteractor::ConnectActionsAndFunctions(), mitk::SurfaceDeformationDataInteractor3D::DataNodeChanged(), mitk::SinglePointDataInteractor::DataNodeChanged(), mitk::AffineBaseDataInteractor3D::DataNodeChanged(), mitk::TubeGraphDataInteractor::DataNodeChanged(), mitk::PointSetDataInteractor::DataNodeChanged(), mitk::SurfaceDeformationDataInteractor3D::DeformObject(), mitk::PlanarFigureInteractor::DeleteFigure(), mitk::SurfaceDeformationDataInteractor3D::DeselectObject(), mitk::ClippingPlaneInteractor3D::DeselectObject(), mitk::AffineBaseDataInteractor3D::DeselectObject(), mitk::PlanarFigureInteractor::DeselectPoint(), mitk::PlanarFigureInteractor::EndHovering(), mitk::PlanarFigureInteractor::EndInteraction(), mitk::PlanarFigureInteractor::FinalizeFigure(), mitk::PointSetDataInteractor::FinishMove(), mitk::PointSetDataInteractor::GetPointIndexByPosition(), mitk::AffineBaseDataInteractor3D::GetUpdatedTimeGeometry(), mitk::PlanarFigureInteractor::HideControlPoints(), mitk::PlanarFigureInteractor::HidePreviewPoint(), mitk::SurfaceDeformationDataInteractor3D::InitDeformation(), mitk::AffineBaseDataInteractor3D::InitMembers(), mitk::PointSetDataInteractor::InitMove(), mitk::ClippingPlaneInteractor3D::InitRotate(), mitk::ClippingPlaneInteractor3D::InitTranslate(), mitk::PointSetDataInteractor::IsClosedContour(), mitk::ContourModelInteractor::IsHovering(), mitk::ContourModelLiveWireInteractor::IsHovering(), mitk::PlanarFigureInteractor::MoveCurrentPoint(), mitk::PointSetDataInteractor::MovePoint(), NotifyResultReady(), NotifyStart(), mitk::ContourModelInteractor::OnCheckPointClick(), mitk::ContourModelLiveWireInteractor::OnCheckPointClick(), mitk::ContourModelInteractor::OnDeletePoint(), mitk::ContourModelLiveWireInteractor::OnDeletePoint(), mitk::ContourModelInteractor::OnFinishEditing(), mitk::ContourModelInteractor::OnMoveContour(), mitk::ContourModelInteractor::OnMovePoint(), mitk::ContourModelLiveWireInteractor::OnMovePoint(), mitk::PlanarFigureInteractor::PerformPointResetOnSelect(), mitk::Dispatcher::QueueEvent(), mitk::PointSetDataInteractor::RemovePoint(), mitk::PlanarFigureInteractor::RemoveSelectedPoint(), mitk::PlanarFigureInteractor::RequestContextMenu(), mitk::AffineBaseDataInteractor3D::RestoreNodeProperties(), mitk::AffineBaseDataInteractor3D::RotateDownKey(), mitk::AffineBaseDataInteractor3D::RotateDownModifierKey(), mitk::AffineBaseDataInteractor3D::RotateGeometry(), mitk::AffineBaseDataInteractor3D::RotateLeftKey(), mitk::ClippingPlaneInteractor3D::RotateObject(), mitk::AffineBaseDataInteractor3D::RotateObject(), mitk::AffineBaseDataInteractor3D::RotateRightKey(), mitk::AffineBaseDataInteractor3D::RotateUpKey(), mitk::AffineBaseDataInteractor3D::RotateUpModifierKey(), mitk::AffineBaseDataInteractor3D::ScaleDownKey(), mitk::AffineBaseDataInteractor3D::ScaleGeometry(), mitk::SurfaceDeformationDataInteractor3D::ScaleRadius(), mitk::AffineBaseDataInteractor3D::ScaleUpKey(), mitk::PlanarFigureInteractor::SelectFigure(), mitk::SurfaceDeformationDataInteractor3D::SelectObject(), mitk::ClippingPlaneInteractor3D::SelectObject(), mitk::AffineImageCropperInteractor::SelectObject(), mitk::AffineBaseDataInteractor3D::SelectObject(), mitk::PlanarFigureInteractor::SelectPoint(), mitk::PointSetDataInteractor::SelectPoint(), mitk::GizmoInteractor::SetManipulatedObjectNode(), mitk::PlanarFigureInteractor::SetPreviewPointPosition(), mitk::PlanarFigureInteractor::StartHovering(), mitk::AffineBaseDataInteractor3D::TranslateDownKey(), mitk::AffineBaseDataInteractor3D::TranslateDownModifierKey(), mitk::AffineBaseDataInteractor3D::TranslateGeometry(), mitk::AffineBaseDataInteractor3D::TranslateLeftKey(), mitk::ClippingPlaneInteractor3D::TranslateObject(), mitk::AffineBaseDataInteractor3D::TranslateObject(), mitk::AffineBaseDataInteractor3D::TranslateRightKey(), mitk::AffineBaseDataInteractor3D::TranslateUpKey(), mitk::AffineBaseDataInteractor3D::TranslateUpModifierKey(), mitk::PointSetDataInteractor::UnSelectAll(), mitk::PointSetDataInteractor::UnselectAll(), mitk::PointSetDataInteractor::UnSelectPointAtPosition(), and mitk::PointSetDataInteractor::UpdatePointSet().

◆ GetLayer()

int mitk::DataInteractor::GetLayer ( ) const

Definition at line 58 of file mitkDataInteractor.cpp.

◆ GetMode()

mitk::ProcessEventMode mitk::DataInteractor::GetMode ( ) const

◆ GetStaticNameOfClass()

static const char* mitk::DataInteractor::GetStaticNameOfClass ( )
inlinestatic

Definition at line 56 of file mitkDataInteractor.h.

◆ New()

static Pointer mitk::DataInteractor::New ( )
static

◆ NotifyResultReady()

void mitk::DataInteractor::NotifyResultReady ( )
protectedvirtual

NotifyResultReady Sends ResultReady event via the mitk::DataNode.

Use to get notfied when the mitk::DataNode is in a ready state for further processing.

Definition at line 91 of file mitkDataInteractor.cpp.

References GetDataNode().

Referenced by mitk::PointSetDataInteractor::AddPoint(), and mitk::PointSetDataInteractor::FinishMove().

◆ NotifyStart()

void mitk::DataInteractor::NotifyStart ( )
protectedvirtual

Sends StartInteraction event via the mitk::DataNode.

Definition at line 86 of file mitkDataInteractor.cpp.

References GetDataNode().

◆ SetDataNode()

void mitk::DataInteractor::SetDataNode ( DataNode dataNode)
virtual

Member Data Documentation

◆ IntDeactivateMe

const std::string mitk::DataInteractor::IntDeactivateMe
static

◆ IntEnterWidget

const std::string mitk::DataInteractor::IntEnterWidget
static

Definition at line 54 of file mitkDataInteractor.h.

◆ IntLeaveWidget

const std::string mitk::DataInteractor::IntLeaveWidget
static

Definition at line 53 of file mitkDataInteractor.h.


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