Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
Configuration Object for Statemachines. More...
#include <mitkEventConfig.h>
Public Types | |
typedef itk::SmartPointer< InteractionEvent > | EventType |
Public Member Functions | |
EventConfig () | |
Constructs an invalid EventConfig object. More... | |
EventConfig (const EventConfig &other) | |
EventConfig (const std::string &filename, const us::Module *module=nullptr) | |
Construct an EventConfig object based on a XML configuration file. More... | |
EventConfig (std::istream &inputStream) | |
Construct an EventConfig object based on a XML configuration file. More... | |
EventConfig (const std::vector< PropertyList::Pointer > &configDescription) | |
Construct an EventConfig object based on a vector of mitk::PropertyLists. More... | |
EventConfig & | operator= (const EventConfig &other) |
~EventConfig () | |
bool | IsValid () const |
Checks whether this EventConfig object is valid. More... | |
bool | AddConfig (const std::string &filename, const us::Module *module=nullptr) |
This method extends this configuration. More... | |
bool | AddConfig (const EventConfig &config) |
This method extends this 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... | |
void | ClearConfig () |
Reset this EventConfig object, rendering it invalid. More... | |
PropertyList::Pointer | GetAttributes () const |
std::string | GetMappedEvent (const EventType &interactionEvent) const |
Configuration Object for Statemachines.
Reads given config file, which translates specific user inputs (InteractionEvents) into EventVariants that can be processed by the StateMachine. Refer to How to create a Config-File .
Definition at line 44 of file mitkEventConfig.h.
Definition at line 47 of file mitkEventConfig.h.
mitk::EventConfig::EventConfig | ( | ) |
Constructs an invalid EventConfig object.
Call LoadConfig to create a valid configuration object.
mitk::EventConfig::EventConfig | ( | const EventConfig & | other | ) |
mitk::EventConfig::EventConfig | ( | const std::string & | filename, |
const us::Module * | module = nullptr |
||
) |
Construct an EventConfig object based on a XML configuration file.
Uses the specified resource file containing an XML event configuration to construct an EventConfig object. If the resource is invalid, the created EventConfig object will also be invalid.
filename | The resource name relative to the Interactions resource folder. |
module |
mitk::EventConfig::EventConfig | ( | std::istream & | inputStream | ) |
Construct an EventConfig object based on a XML configuration file.
Uses the specified istream referring to a file containing an XML event configuration to construct an EventConfig object. If the resource is invalid, the created EventConfig object will also be invalid.
inputStream | std::ifstream to XML configuration file |
mitk::EventConfig::EventConfig | ( | const std::vector< PropertyList::Pointer > & | configDescription | ) |
Construct an EventConfig object based on a vector of mitk::PropertyLists.
Constructs the EventObject based on a description provided by vector of property values, where each mitk::PropertyList describes one Event. Example
mitk::EventConfig::~EventConfig | ( | ) |
bool mitk::EventConfig::AddConfig | ( | const EventConfig & | config | ) |
This method extends this 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.
config | The EventConfig object whose configuration should be added. |
true
if the configuration was successfully added, false
otherwise. bool mitk::EventConfig::AddConfig | ( | const std::string & | filename, |
const us::Module * | module = nullptr |
||
) |
This method extends this 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.
filename | The resource name relative to the Interactions resource folder. |
module | The module containing the resource. Defaults to the Mitk module. |
true
if the configuration was successfully added, false
otherwise. void mitk::EventConfig::ClearConfig | ( | ) |
Reset this EventConfig object, rendering it invalid.
PropertyList::Pointer mitk::EventConfig::GetAttributes | ( | ) | const |
Returns a PropertyList that contains the properties set in the configuration file. All properties are stored as strings.
std::string mitk::EventConfig::GetMappedEvent | ( | const EventType & | interactionEvent | ) | const |
Checks if the config object has a definition for the given event. If it has, the corresponding variant name is returned, else an empty string is returned.
bool mitk::EventConfig::IsValid | ( | ) | const |
Checks whether this EventConfig object is valid.
true
if a configuration was successfully loaded, false
otherwise. EventConfig& mitk::EventConfig::operator= | ( | const EventConfig & | other | ) |