Base class for all objects that handle mitk::InteractionEvents.
More...
#include <mitkInteractionEventHandler.h>
Base class for all objects that handle mitk::InteractionEvents.
Provides an interface to load event configuration objects (EventConfig) that map raw interaction events to named event variants. These variant names are then matched against state machine transitions.
Configuration can be loaded from XML resource files or from pre-built EventConfig objects. Multiple configurations can be combined via AddEventConfig().
- See also
- EventStateMachine
-
EventConfig
Definition at line 50 of file mitkInteractionEventHandler.h.
◆ InteractionEventHandler()
| mitk::InteractionEventHandler::InteractionEventHandler |
( |
| ) |
|
|
protected |
◆ ~InteractionEventHandler()
| mitk::InteractionEventHandler::~InteractionEventHandler |
( |
| ) |
|
|
overrideprotected |
◆ AddEventConfig() [1/2]
| 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
-
| config | The EventConfig object whose configuration should be added. |
- Returns
true if the configuration was successfully added, false otherwise.
◆ AddEventConfig() [2/2]
| 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
-
| filename | The resource name relative to the Interactions resource folder. |
| module | The module containing the resource. Defaults to the Mitk module. |
- Returns
true if the configuration was successfully added, false otherwise.
◆ ConfigurationChanged()
| virtual void mitk::InteractionEventHandler::ConfigurationChanged |
( |
| ) |
|
|
protectedvirtual |
◆ GetAttributes()
| PropertyList::Pointer mitk::InteractionEventHandler::GetAttributes |
( |
| ) |
const |
|
protected |
Returns a PropertyList in which the parameters defined in the config file are listed.
◆ GetEventConfig()
| EventConfig mitk::InteractionEventHandler::GetEventConfig |
( |
| ) |
const |
Returns the current configuration.
- Returns
- A EventConfig object representing the current event configuration.
◆ MapToEventVariant()
| std::string mitk::InteractionEventHandler::MapToEventVariant |
( |
InteractionEvent * |
interactionEvent | ) |
|
|
protected |
◆ mitkClassMacroItkParent()
◆ SetEventConfig() [1/2]
| 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
-
| config | The EventConfig object containing the new configuration. |
- Returns
true if the configuration was successfully loaded, false otherwise.
◆ SetEventConfig() [2/2]
| 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
-
| filename | The resource name relative to the Interactions resource folder. |
| module | The module containing the resource. Defaults to the Mitk module. |
- Returns
true if the resource was successfully loaded, false otherwise.
The documentation for this class was generated from the following file: