Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::InteractionEventHandler Class Reference

#include <mitkInteractionEventHandler.h>

Inheritance diagram for mitk::InteractionEventHandler:
Collaboration diagram for mitk::InteractionEventHandler:

Public Types

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
 
virtual const char * GetClassName () const
 
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 ()
 

Protected Member Functions

 InteractionEventHandler ()
 
virtual ~InteractionEventHandler ()
 
PropertyList::Pointer GetAttributes () const
 
std::string MapToEventVariant (InteractionEvent *interactionEvent)
 
virtual void ConfigurationChanged ()
 

Detailed Description

Definition at line 44 of file mitkInteractionEventHandler.h.

Member Typedef Documentation

Definition at line 47 of file mitkInteractionEventHandler.h.

Constructor & Destructor Documentation

mitk::InteractionEventHandler::InteractionEventHandler ( )
protected

Definition at line 20 of file mitkInteractionEventHandler.cpp.

mitk::InteractionEventHandler::~InteractionEventHandler ( )
protectedvirtual

Definition at line 24 of file mitkInteractionEventHandler.cpp.

Member Function Documentation

bool mitk::InteractionEventHandler::AddEventConfig ( const std::string &  filename,
const us::Module module = nullptr 
)

This method extends the configuration.

The configuration from the resource provided is loaded and only the ones conflicting are replaced by the new one. This way several configuration files can be combined.

See also
AddEventConfig(const EventConfig&)
Parameters
filenameThe resource name relative to the Interactions resource folder.
moduleThe module containing the resource. Defaults to the Mitk module.
Returns
true if the configuration was successfully added, false otherwise.

Definition at line 59 of file mitkInteractionEventHandler.cpp.

References MITK_ERROR.

bool mitk::InteractionEventHandler::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.

See also
AddEventConfig(const std::string&, const Module*)
Parameters
configThe EventConfig object whose configuration should be added.
Returns
true if the configuration was successfully added, false otherwise.

Definition at line 75 of file mitkInteractionEventHandler.cpp.

References MITK_ERROR.

void mitk::InteractionEventHandler::ConfigurationChanged ( )
protectedvirtual

Is called whenever a new config object ist set. Overwrite this method e.g. to initialize EventHandler with parameters in configuration file.

Reimplemented in mitk::PlanarFigureInteractor, mitk::DisplayInteractor, and mitk::ExampleInteractor.

Definition at line 116 of file mitkInteractionEventHandler.cpp.

mitk::PropertyList::Pointer mitk::InteractionEventHandler::GetAttributes ( ) const
protected

Returns a PropertyList in which the parameters defined in the config file are listed.

Definition at line 91 of file mitkInteractionEventHandler.cpp.

References MITK_ERROR.

virtual std::vector<std::string> mitk::InteractionEventHandler::GetClassHierarchy ( ) const
inlinevirtual
virtual const char* mitk::InteractionEventHandler::GetClassName ( ) const
virtual
mitk::EventConfig mitk::InteractionEventHandler::GetEventConfig ( ) const

Returns the current configuration.

Returns
A EventConfig object representing the current event configuration.

Definition at line 54 of file mitkInteractionEventHandler.cpp.

Referenced by mitk::Tool::Activated().

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

Definition at line 47 of file mitkInteractionEventHandler.h.

std::string mitk::InteractionEventHandler::MapToEventVariant ( InteractionEvent interactionEvent)
protected

Definition at line 104 of file mitkInteractionEventHandler.cpp.

bool mitk::InteractionEventHandler::SetEventConfig ( const std::string &  filename,
const us::Module module = nullptr 
)

Loads a configuration from an XML resource.

Loads an event configuration from an XML resource file contained in the given module. Default is the Mitk module (core). The files have to be placed in the Resources/Interactions folder of their respective module. This method will remove all existing configuration and replaces it with the new one.

See also
SetEventConfig(const EventConfig&)
Parameters
filenameThe resource name relative to the Interactions resource folder.
moduleThe module containing the resource. Defaults to the Mitk module.
Returns
true if the resource was successfully loaded, false otherwise.

Definition at line 28 of file mitkInteractionEventHandler.cpp.

References mitk::EventConfig::IsValid(), and MITK_ERROR.

Referenced by mitk::Tool::Activated(), and mitk::Tool::Deactivated().

bool mitk::InteractionEventHandler::SetEventConfig ( const EventConfig config)

Loads a configuration from an EventConfig object.

Loads an event configuration from the given EventConfig object. This method will remove all existing configuration and replaces it with the new one.

See also
SetEventConfig(const std::string&, const Module*)
Parameters
configThe EventConfig object containing the new configuration.
Returns
true if the configuration was successfully loaded, false otherwise.

Definition at line 42 of file mitkInteractionEventHandler.cpp.

References mitk::EventConfig::IsValid().


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