Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::SinglePointDataInteractor Class Reference

Implementation of the single point interaction. More...

#include <mitkSinglePointDataInteractor.h>

Inheritance diagram for mitk::SinglePointDataInteractor:
Collaboration diagram for mitk::SinglePointDataInteractor:

Public Member Functions

 mitkClassMacro (SinglePointDataInteractor, PointSetDataInteractor)
 
Pointer Clone () const
 
- Public Member Functions inherited from mitk::PointSetDataInteractor
 mitkClassMacro (PointSetDataInteractor, DataInteractor)
 
Pointer Clone () const
 
void SetAccuracy (float accuracy)
 Set the maximum distance for selecting a point by position. More...
 
void SetMaxPoints (unsigned int maxNumber=0)
 Set the maximum number of points allowed in the point set. More...
 
void EnableMovement (bool enabled=true)
 Enable or disable point movement. More...
 
void EnableRemoval (bool enabled=true)
 Enable or disable point removal. More...
 
void Enable3DPointPlacement (bool enabled=true)
 Enable or disable point placement in 3D render windows. More...
 
void SetBounds (BaseGeometry *geometry)
 Set the boundaries within which points can be placed. More...
 
- Public Member Functions inherited from mitk::DataInteractor
 mitkClassMacro (DataInteractor, EventStateMachine)
 
Pointer Clone () const
 
DataNode * GetDataNode () const
 Get the DataNode associated with this interactor. More...
 
virtual void SetDataNode (DataNode *dataNode)
 Set the DataNode that this interactor operates on. More...
 
int GetLayer () const
 Get the rendering layer of the associated DataNode. More...
 
ProcessEventMode GetMode () const
 Get the current event processing mode from the state machine's current state. More...
 
- Public Member Functions inherited from mitk::EventStateMachine
 mitkClassMacro (EventStateMachine, InteractionEventHandler)
 
bool LoadStateMachine (const std::string &filename, const us::Module *module=nullptr)
 Load a state machine pattern from an XML resource file. More...
 
bool HandleEvent (InteractionEvent *event, DataNode *dataNode)
 Process an incoming interaction event. More...
 
void EnableUndo (bool enable)
 Enable or disable the undo mechanism for this state machine. More...
 
void EnableInteraction (bool enable)
 Enable or disable the state machine. More...
 
- Public Member Functions inherited from mitk::InteractionEventHandler
 mitkClassMacroItkParent (InteractionEventHandler, itk::Object)
 
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 Pointer New ()
 
- Static Public Member Functions inherited from mitk::PointSetDataInteractor
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::DataInteractor
static Pointer New ()
 

Protected Member Functions

 SinglePointDataInteractor ()
 
 ~SinglePointDataInteractor () override
 
void AddPoint (StateMachineAction *, InteractionEvent *event) override
 Add or move the single point at the given coordinates. More...
 
virtual void SetMaxPoints (unsigned int maxNumber=0)
 Overridden to enforce a maximum of one point. More...
 
void DataNodeChanged () override
 Called when the data node changes. More...
 
- Protected Member Functions inherited from mitk::PointSetDataInteractor
 PointSetDataInteractor ()
 
 ~PointSetDataInteractor () override
 
void ConnectActionsAndFunctions () override
 
virtual int GetPointIndexByPosition (Point3D position, unsigned int time=0, float accuracy=-1)
 Return index in PointSet of the point that is within given accuracy to the provided position. More...
 
virtual bool CheckSelection (const InteractionEvent *interactionEvent)
 Check whether the pointer is over a point in the point set. More...
 
virtual bool CanAddPoint (const InteractionEvent *interactionEvent)
 Check whether a new point can be added. More...
 
virtual void RemovePoint (StateMachineAction *, InteractionEvent *interactionEvent)
 
virtual void IsClosedContour (StateMachineAction *, InteractionEvent *)
 
virtual void MovePoint (StateMachineAction *, InteractionEvent *)
 
virtual void InitMove (StateMachineAction *, InteractionEvent *interactionEvent)
 
virtual void FinishMove (StateMachineAction *, InteractionEvent *)
 
virtual void SelectPoint (StateMachineAction *, InteractionEvent *)
 
virtual void UnSelectPointAtPosition (StateMachineAction *, InteractionEvent *)
 
virtual void UnSelectAll (StateMachineAction *, InteractionEvent *)
 
virtual void UpdatePointSet (StateMachineAction *stateMachineAction, InteractionEvent *)
 Update the member variable that holds the point set. More...
 
virtual void Abort (StateMachineAction *, InteractionEvent *)
 
virtual void KeyDelete (StateMachineAction *, InteractionEvent *)
 Delete the currently selected point via keyboard action. More...
 
void UnselectAll (unsigned int timeStep, ScalarType timeInMs)
 
void SelectPoint (int position, unsigned int timeStep, ScalarType timeInMS)
 
- Protected Member Functions inherited from mitk::DataInteractor
 DataInteractor ()
 
 ~DataInteractor () override
 
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, const ActionFunctionDelegate &delegate)
 
void AddConditionFunction (const std::string &condition, const ConditionFunctionDelegate &delegate)
 
StateMachineState * GetCurrentState () 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 to its original state. More...
 
StateMachineTransition * GetExecutableTransition (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

- Public Types inherited from mitk::EventStateMachine
typedef itk::SmartPointer< StateMachineState > StateMachineStateType
 
- Static Public Attributes inherited from mitk::DataInteractor
static const std::string IntDeactivateMe
 Internal signal name to request deactivation of this interactor. More...
 
static const std::string IntLeaveWidget
 Internal signal name indicating the pointer left the widget area. More...
 
static const std::string IntEnterWidget
 Internal signal name indicating the pointer entered the widget area. More...
 
- Protected Types inherited from mitk::EventStateMachine
typedef MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > ActionFunctionDelegate
 
typedef MessageAbstractDelegate1< const InteractionEvent *, bool > ConditionFunctionDelegate
 
- Protected Attributes inherited from mitk::PointSetDataInteractor
Point3D m_LastPoint
 to calculate a direction vector from last point and actual point More...
 
Vector3D m_SumVec
 summ-vector for Movement More...
 
PointSet::Pointer m_PointSet
 
int m_MaxNumberOfPoints
 
float m_SelectionAccuracy
 
bool m_IsMovementEnabled
 
bool m_IsRemovalEnabled
 
bool m_Is3DPointPlacementEnabled
 
mitk::BaseGeometry::Pointer m_Bounds
 
- Protected Attributes inherited from mitk::EventStateMachine
bool m_IsActive
 
UndoController * m_UndoController
 
bool m_UndoEnabled
 

Detailed Description

Implementation of the single point interaction.

Interactor operates on a single point set. When a data node is set, its containing point set is cleared for initialization. Instead of adding new points, the first point's position is updated. All other interaction (move, delete) is handled by the base class PointSetDataInteractor.

See also
PointSetDataInteractor

Definition at line 36 of file mitkSinglePointDataInteractor.h.

Constructor & Destructor Documentation

◆ SinglePointDataInteractor()

mitk::SinglePointDataInteractor::SinglePointDataInteractor ( )
protected

◆ ~SinglePointDataInteractor()

mitk::SinglePointDataInteractor::~SinglePointDataInteractor ( )
overrideprotected

Member Function Documentation

◆ AddPoint()

void mitk::SinglePointDataInteractor::AddPoint ( StateMachineAction *  ,
InteractionEvent *  event 
)
overrideprotectedvirtual

Add or move the single point at the given coordinates.

Overwrites PointSetDataInteractor::AddPoint() so that instead of adding new points, the first point's position is updated. All other interaction (move, delete) is still handled by PointSetDataInteractor.

Reimplemented from mitk::PointSetDataInteractor.

◆ Clone()

Pointer mitk::SinglePointDataInteractor::Clone ( ) const

◆ DataNodeChanged()

void mitk::SinglePointDataInteractor::DataNodeChanged ( )
overrideprotectedvirtual

Called when the data node changes.

Ensures the data node contains a point set. If one exists, it is cleared; otherwise a new empty PointSet is created and assigned.

Reimplemented from mitk::PointSetDataInteractor.

◆ mitkClassMacro()

mitk::SinglePointDataInteractor::mitkClassMacro ( SinglePointDataInteractor  ,
PointSetDataInteractor   
)

◆ New()

static Pointer mitk::SinglePointDataInteractor::New ( )
static

◆ SetMaxPoints()

virtual void mitk::SinglePointDataInteractor::SetMaxPoints ( unsigned int  maxNumber = 0)
protectedvirtual

Overridden to enforce a maximum of one point.

This method is a no-op by design, since this class always operates on exactly one point.


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