Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::nnInteractive::PointInteractor Class Reference

nnInteractive interactor for placing individual points. More...

#include <mitknnInteractivePointInteractor.h>

Inheritance diagram for mitk::nnInteractive::PointInteractor:
Collaboration diagram for mitk::nnInteractive::PointInteractor:

Public Member Functions

 PointInteractor ()
 Constructs a PointInteractor with InteractionType::Point. More...
 
 ~PointInteractor () override
 Destructor. Calls OnReset() to clean up data nodes. More...
 
bool HasInteractions () const override
 Checks whether any points have been placed. More...
 
std::optional< Point3D > GetLastPoint () const
 Returns the most recently placed point for the current prompt type. More...
 
void RemoveLastInteraction (PromptType promptType) override
 Removes the most recently placed point for the given prompt type. More...
 
- Public Member Functions inherited from mitk::nnInteractive::Interactor
virtual ~Interactor ()
 Destructor. More...
 
InteractionType GetType () const
 Returns the interaction type associated with this interactor. More...
 
void SetToolManager (ToolManager *toolManager)
 Sets the ToolManager for this interactor. More...
 
void HandleEvent (InteractionEvent *event)
 Handles an interaction event. More...
 
void Enable (PromptType promptType)
 Enables the interactor for the given prompt type. More...
 
void Disable ()
 Disables the interactor. More...
 
bool IsEnabled () const
 Checks whether the interactor is currently enabled. More...
 
void Reset ()
 Resets the interactor to its initial state. More...
 
std::string GetIcon () const
 Retrieves the SVG icon as a string from module resources. More...
 
std::string GetCursor (PromptType promptType) const
 Retrieves the SVG cursor as a string from module resources based on PromptType. More...
 

Additional Inherited Members

- Public Attributes inherited from mitk::nnInteractive::Interactor
Message1< bool > UpdatePreviewEvent
 Event triggered after an interaction has occurred. More...
 
- Protected Member Functions inherited from mitk::nnInteractive::Interactor
 Interactor (InteractionType type)
 Constructs an interactor with a given type. More...
 
virtual void OnSetToolManager ()
 Called when a ToolManager is assigned. More...
 
virtual void OnHandleEvent (InteractionEvent *event)
 Called when an interaction event is received. More...
 
ToolManager * GetToolManager () const
 Returns the ToolManager associated with this interactor. More...
 
DataStorage * GetDataStorage () const
 Convenience method for accessing the DataStorage. More...
 
PromptType GetCurrentPromptType () const
 Returns the currently active prompt type. More...
 

Detailed Description

nnInteractive interactor for placing individual points.

Points are managed in up to two PointSet data nodes, separated by prompt type. Point placement is restricted to the bounds of the reference image.

Interaction is handled through the PointSetDataInteractor. Left mouse button display interaction (crosshair navigation) is blocked while this interactor is enabled, allowing plain left clicks for point placement.

See also
Interactor, PointSet, nnInteractiveTool

Definition at line 35 of file mitknnInteractivePointInteractor.h.

Constructor & Destructor Documentation

◆ PointInteractor()

mitk::nnInteractive::PointInteractor::PointInteractor ( )

◆ ~PointInteractor()

mitk::nnInteractive::PointInteractor::~PointInteractor ( )
override

Destructor. Calls OnReset() to clean up data nodes.

Member Function Documentation

◆ GetLastPoint()

std::optional<Point3D> mitk::nnInteractive::PointInteractor::GetLastPoint ( ) const

Returns the most recently placed point for the current prompt type.

Returns
The last point's 3D coordinates if at least one point exists for the current prompt type, std::nullopt otherwise.
See also
GetCurrentPromptType()

◆ HasInteractions()

bool mitk::nnInteractive::PointInteractor::HasInteractions ( ) const
overridevirtual

Checks whether any points have been placed.

Returns
true if at least one point exists in any PointSet for any prompt type, false otherwise.

Implements mitk::nnInteractive::Interactor.

◆ RemoveLastInteraction()

void mitk::nnInteractive::PointInteractor::RemoveLastInteraction ( PromptType  promptType)
overridevirtual

Removes the most recently placed point for the given prompt type.

A no-op if no point set exists for promptType or it is already empty. The point set node is left in place (it may be the actively bound node); empty sets are cleaned up by OnDisable() / OnReset() as before.

Parameters
[in]promptTypeThe prompt type whose last point should be removed.

Implements mitk::nnInteractive::Interactor.


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