Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitk::INodeSelectionService Class Referenceabstract

A simple messaging service for sending and receiving data node selections for certain contexts. More...

#include <mitkINodeSelectionService.h>

Inheritance diagram for mitk::INodeSelectionService:

Public Member Functions

virtual ~INodeSelectionService ()
 
virtual bool AddListener (const std::string &context, INodeSelectionListener *listener)=0
 Add a listener for selections in a certain selection context. More...
 
virtual bool RemoveListener (const std::string &context, const INodeSelectionListener *listener)=0
 Remove a listener from selections of a certain selection context. More...
 
virtual bool RemoveListener (const INodeSelectionListener *listener)=0
 Remove a listener from selections of all selection contexts. More...
 
virtual bool SendSelection (const std::string &context, const std::vector< mitk::DataNode::Pointer > &selection) const =0
 Send a selection to all listeners of a certain selection context. More...
 

Detailed Description

A simple messaging service for sending and receiving data node selections for certain contexts.

See also
CoreServices::GetPreferencesService()
INodeSelectionListener

Definition at line 31 of file mitkINodeSelectionService.h.

Constructor & Destructor Documentation

◆ ~INodeSelectionService()

virtual mitk::INodeSelectionService::~INodeSelectionService ( )
virtual

Member Function Documentation

◆ AddListener()

virtual bool mitk::INodeSelectionService::AddListener ( const std::string &  context,
INodeSelectionListener listener 
)
pure virtual

Add a listener for selections in a certain selection context.

A selection context is a non-empty, arbitrary and unique string that both sender and receiver agreed upon. A listener must not be nullptr and can be added only once.

Parameters
contextA non-empty, arbitrary and unique string that both sender and receiver agreed upon.
listenerA valid pointer to a class implementing the listener interface.
Returns
true if the listener was successfully added or already has been added before, or false otherwise.

Implemented in mitk::NodeSelectionService.

◆ RemoveListener() [1/2]

virtual bool mitk::INodeSelectionService::RemoveListener ( const INodeSelectionListener listener)
pure virtual

Remove a listener from selections of all selection contexts.

Parameters
listenerA pointer to an already added listener.
Returns
true if the listener was actually found, or false otherwise.
See also
AddListener()

Implemented in mitk::NodeSelectionService.

◆ RemoveListener() [2/2]

virtual bool mitk::INodeSelectionService::RemoveListener ( const std::string &  context,
const INodeSelectionListener listener 
)
pure virtual

Remove a listener from selections of a certain selection context.

Parameters
contextA non-empty, arbitrary and unique string that both sender and receiver agreed upon.
listenerA pointer to an already added listener.
Returns
true if the listener was actually found for the given context, or false otherwise.
See also
AddListener()

Implemented in mitk::NodeSelectionService.

◆ SendSelection()

virtual bool mitk::INodeSelectionService::SendSelection ( const std::string &  context,
const std::vector< mitk::DataNode::Pointer > &  selection 
) const
pure virtual

Send a selection to all listeners of a certain selection context.

Parameters
contextA non-empty, arbitrary and unique string that both sender and receiver agreed upon.
selectionA selection of potentially multiple data nodes to send to any listeners for the given selection context.
See also
AddListener()

Implemented in mitk::NodeSelectionService.


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