MeVisLab Toolbox Reference
|
Class ManagedOffsetTrigger may contain a ManagedMouseButtonTrigger, a ManagedMouseWheelTrigger, or one (or two) ManagedKeyboardShortcut, together with a sensitivity configuration. More...
#include <ManagedOffsetTrigger.h>
Public Types | |
enum | TriggerType { MouseWheel , MouseButton , Keyboard } |
The type of trigger contained in this class. More... | |
![]() | |
enum | { NoModifier = 0 , ShiftModifier = 0x10 , ControlModifier = 0x20 , AltModifier = 0x40 , AllModifiersMask = 0x70 } |
Constants to use where keyboard modifiers must be specified. More... | |
enum | { Button1Mask = 1 , Button2Mask = 2 , Button3Mask = 4 , AllButtonsMask = 0x07 } |
Same for mouse buttons: More... | |
Public Member Functions | |||||||||
ManagedOffsetTrigger () | |||||||||
Default constructor (creates an invalid mouse button trigger). | |||||||||
ManagedOffsetTrigger (const ManagedOffsetTrigger &trigger) | |||||||||
Copy constructor. | |||||||||
~ManagedOffsetTrigger () | |||||||||
TriggerType | getTriggerType () const | ||||||||
Returns the type of this trigger. | |||||||||
const ManagedMouseButtonTrigger * | getMouseButtonTrigger () const | ||||||||
Returns the pointer to the mouse button trigger if the trigger type is MouseButton, else NULL. | |||||||||
const ManagedMouseWheelTrigger * | getMouseWheelTrigger () const | ||||||||
Returns the pointer to the mouse wheel trigger if the trigger type is MouseWheel, else NULL. | |||||||||
const ManagedKeyboardShortcut * | getKeyboardShortcut1 () const | ||||||||
Returns the pointer to the first keyboard shortcut if the trigger type is Keyboard, else NULL. | |||||||||
const ManagedKeyboardShortcut * | getKeyboardShortcut2 () const | ||||||||
Returns the pointer to a possible second keyboard shortcut if the trigger type is Keyboard, else NULL. | |||||||||
bool | isValid () const | ||||||||
Returns whether this is a valid trigger. | |||||||||
std::string | toString () const | ||||||||
Returns a string representation of this trigger (see fromString()). | |||||||||
double | sensitivityX () const | ||||||||
Returns the sensitivity for the x-axis. | |||||||||
double | sensitivityY () const | ||||||||
Returns the sensitivity for the y-axis. | |||||||||
bool | swapAxes () const | ||||||||
Returns whether the axes should be swapped for this trigger. | |||||||||
ManagedOffsetTrigger & | operator= (const ManagedOffsetTrigger &trigger) | ||||||||
Assignment operator. | |||||||||
Creates a mouse button trigger. | |||||||||
Optional parameters:
| |||||||||
ManagedOffsetTrigger (const ManagedMouseButtonTrigger &trigger, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedMouseButtonTrigger &trigger, double sensitivity, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedMouseButtonTrigger &trigger, double sensitivityX, double sensitivityY, bool swapAxes=false) | |||||||||
Creates a mouse button trigger. Optional parameters are the same as above. | |||||||||
ManagedOffsetTrigger (const ManagedMouseWheelTrigger &trigger, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedMouseWheelTrigger &trigger, double sensitivity, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedMouseWheelTrigger &trigger, double sensitivityX, double sensitivityY, bool swapAxes=false) | |||||||||
Creates a single keyboard shortcut. Optional parameters are the same as above. | |||||||||
ManagedOffsetTrigger (const ManagedKeyboardShortcut &shortcut, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedKeyboardShortcut &shortcut, double sensitivity, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedKeyboardShortcut &shortcut, double sensitivityX, double sensitivityY, bool swapAxes=false) | |||||||||
Creates a double keyboard shortcut. | |||||||||
The second shortcut generates the negative offset of the one generated by the first shortcut. Optional parameters are the same as above. | |||||||||
ManagedOffsetTrigger (const ManagedKeyboardShortcut &shortcut1, const ManagedKeyboardShortcut &shortcut2, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedKeyboardShortcut &shortcut1, const ManagedKeyboardShortcut &shortcut2, double sensitivity, bool swapAxes=false) | |||||||||
ManagedOffsetTrigger (const ManagedKeyboardShortcut &shortcut1, const ManagedKeyboardShortcut &shortcut2, double sensitivityX, double sensitivityY, bool swapAxes=false) | |||||||||
Static Public Member Functions | |
static ManagedOffsetTrigger | fromString (const std::string &s) |
Creates a trigger from a string. | |
![]() | |
static std::list< std::string > | splitString (const std::string &s, char c, bool doNotSplitAtLastChar=false) |
static std::string | strip (const std::string &s) |
Strips whitespaces away. | |
template<typename T > | |
static std::string | join (const std::list< T > &l, const std::string &s) |
Joins a list of objects having a .toString() method, using a separator string s . | |
Class ManagedOffsetTrigger may contain a ManagedMouseButtonTrigger, a ManagedMouseWheelTrigger, or one (or two) ManagedKeyboardShortcut, together with a sensitivity configuration.
Definition at line 23 of file ManagedOffsetTrigger.h.
The type of trigger contained in this class.
Enumerator | |
---|---|
MouseWheel | |
MouseButton | |
Keyboard |
Definition at line 27 of file ManagedOffsetTrigger.h.
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | ) |
Default constructor (creates an invalid mouse button trigger).
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedOffsetTrigger & | trigger | ) |
Copy constructor.
ManagedOffsetTrigger::~ManagedOffsetTrigger | ( | ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedMouseButtonTrigger & | trigger, |
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedMouseButtonTrigger & | trigger, |
double | sensitivity, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedMouseButtonTrigger & | trigger, |
double | sensitivityX, | ||
double | sensitivityY, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedMouseWheelTrigger & | trigger, |
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedMouseWheelTrigger & | trigger, |
double | sensitivity, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedMouseWheelTrigger & | trigger, |
double | sensitivityX, | ||
double | sensitivityY, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedKeyboardShortcut & | shortcut, |
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedKeyboardShortcut & | shortcut, |
double | sensitivity, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedKeyboardShortcut & | shortcut, |
double | sensitivityX, | ||
double | sensitivityY, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedKeyboardShortcut & | shortcut1, |
const ManagedKeyboardShortcut & | shortcut2, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedKeyboardShortcut & | shortcut1, |
const ManagedKeyboardShortcut & | shortcut2, | ||
double | sensitivity, | ||
bool | swapAxes = false ) |
ManagedOffsetTrigger::ManagedOffsetTrigger | ( | const ManagedKeyboardShortcut & | shortcut1, |
const ManagedKeyboardShortcut & | shortcut2, | ||
double | sensitivityX, | ||
double | sensitivityY, | ||
bool | swapAxes = false ) |
|
static |
Creates a trigger from a string.
The string must contain a prefix "button:", "wheel:", or "key:" to differentiate between the possible trigger types. Everything after the prefix up to a possible ";" is parsed by the subtype trigger. Two keyboard shortcuts may be separated by a "/".
After the optional ";" may follow configuration settings, separated by further ";":
const ManagedKeyboardShortcut * ManagedOffsetTrigger::getKeyboardShortcut1 | ( | ) | const |
Returns the pointer to the first keyboard shortcut if the trigger type is Keyboard, else NULL.
const ManagedKeyboardShortcut * ManagedOffsetTrigger::getKeyboardShortcut2 | ( | ) | const |
Returns the pointer to a possible second keyboard shortcut if the trigger type is Keyboard, else NULL.
const ManagedMouseButtonTrigger * ManagedOffsetTrigger::getMouseButtonTrigger | ( | ) | const |
Returns the pointer to the mouse button trigger if the trigger type is MouseButton, else NULL.
const ManagedMouseWheelTrigger * ManagedOffsetTrigger::getMouseWheelTrigger | ( | ) | const |
Returns the pointer to the mouse wheel trigger if the trigger type is MouseWheel, else NULL.
|
inline |
Returns the type of this trigger.
Definition at line 82 of file ManagedOffsetTrigger.h.
bool ManagedOffsetTrigger::isValid | ( | ) | const |
Returns whether this is a valid trigger.
ManagedOffsetTrigger & ManagedOffsetTrigger::operator= | ( | const ManagedOffsetTrigger & | trigger | ) |
Assignment operator.
|
inline |
Returns the sensitivity for the x-axis.
Definition at line 116 of file ManagedOffsetTrigger.h.
|
inline |
Returns the sensitivity for the y-axis.
Definition at line 119 of file ManagedOffsetTrigger.h.
|
inline |
Returns whether the axes should be swapped for this trigger.
Definition at line 122 of file ManagedOffsetTrigger.h.
std::string ManagedOffsetTrigger::toString | ( | ) | const |
Returns a string representation of this trigger (see fromString()).
struct { ... } ManagedOffsetTrigger::_keyboard |
ManagedMouseButtonTrigger* ManagedOffsetTrigger::_mouseButtonTrigger |
Definition at line 135 of file ManagedOffsetTrigger.h.
ManagedMouseWheelTrigger* ManagedOffsetTrigger::_mouseWheelTrigger |
Definition at line 136 of file ManagedOffsetTrigger.h.
ManagedKeyboardShortcut* ManagedOffsetTrigger::shortcut1 |
Definition at line 138 of file ManagedOffsetTrigger.h.
ManagedKeyboardShortcut* ManagedOffsetTrigger::shortcut2 |
Definition at line 139 of file ManagedOffsetTrigger.h.