Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::NodeSelectionService Class Reference

#include <mitkNodeSelectionService.h>

Inheritance diagram for mitk::NodeSelectionService:
Collaboration diagram for mitk::NodeSelectionService:

Public Member Functions

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

Detailed Description

Definition at line 23 of file mitkNodeSelectionService.h.

Constructor & Destructor Documentation

◆ NodeSelectionService()

mitk::NodeSelectionService::NodeSelectionService ( )

◆ ~NodeSelectionService()

mitk::NodeSelectionService::~NodeSelectionService ( )
override

Member Function Documentation

◆ AddListener()

bool mitk::NodeSelectionService::AddListener ( const std::string &  context,
INodeSelectionListener listener 
)
overridevirtual

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.

Implements mitk::INodeSelectionService.

◆ RemoveListener() [1/2]

bool mitk::NodeSelectionService::RemoveListener ( const INodeSelectionListener listener)
overridevirtual

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()

Implements mitk::INodeSelectionService.

◆ RemoveListener() [2/2]

bool mitk::NodeSelectionService::RemoveListener ( const std::string &  context,
const INodeSelectionListener listener 
)
overridevirtual

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()

Implements mitk::INodeSelectionService.

◆ SendSelection()

bool mitk::NodeSelectionService::SendSelection ( const std::string &  context,
const std::vector< mitk::DataNode::Pointer > &  selection 
) const
overridevirtual

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()

Implements mitk::INodeSelectionService.


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