MeVisLab Toolbox Reference
ManagedOffsetTrigger Class Reference

Class ManagedOffsetTrigger may contain a ManagedMouseButtonTrigger, a ManagedMouseWheelTrigger, or one (or two) ManagedKeyboardShortcut, together with a sensitivity configuration. More...

#include <ManagedOffsetTrigger.h>

Inheritance diagram for ManagedOffsetTrigger:
ManagedActionTrigger

Public Types

enum  TriggerType { MouseWheel , MouseButton , Keyboard }
 The type of trigger contained in this class. More...
 
- Public Types inherited from ManagedActionTrigger
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
 
const ManagedMouseButtonTriggergetMouseButtonTrigger () const
 
const ManagedMouseWheelTriggergetMouseWheelTrigger () const
 
const ManagedKeyboardShortcutgetKeyboardShortcut1 () const
 
const ManagedKeyboardShortcutgetKeyboardShortcut2 () const
 
bool isValid () const
 
std::string toString () const
 Returns a string representation of this trigger (see fromString()).
 
double sensitivityX () const
 
double sensitivityY () const
 
bool swapAxes () const
 
ManagedOffsetTriggeroperator= (const ManagedOffsetTrigger &trigger)
 Assignment operator.
 
Create a mouse button trigger.

Optional parameters:

Parameters
swapAxesswaps the assignment of the x- and y-axis.
sensitivitysets the sensitivity for both axes.
sensitivityXsets the sensitivity for the x-axis (after possibly swaping the axes)
sensitivityYsets the sensitivity for the y-axis (after possibly swaping the axes)
 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)
 
Create 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)
 
Create 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)
 
Create 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 Public Member Functions inherited from ManagedActionTrigger
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.
 

Detailed Description

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.

Member Enumeration Documentation

◆ TriggerType

The type of trigger contained in this class.

Enumerator
MouseWheel 
MouseButton 
Keyboard 

Definition at line 27 of file ManagedOffsetTrigger.h.

Constructor & Destructor Documentation

◆ ManagedOffsetTrigger() [1/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( )

Default constructor (creates an invalid mouse button trigger).

◆ ManagedOffsetTrigger() [2/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedOffsetTrigger & trigger)

Copy constructor.

◆ ~ManagedOffsetTrigger()

ManagedOffsetTrigger::~ManagedOffsetTrigger ( )

◆ ManagedOffsetTrigger() [3/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedMouseButtonTrigger & trigger,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [4/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedMouseButtonTrigger & trigger,
double sensitivity,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [5/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedMouseButtonTrigger & trigger,
double sensitivityX,
double sensitivityY,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [6/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedMouseWheelTrigger & trigger,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [7/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedMouseWheelTrigger & trigger,
double sensitivity,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [8/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedMouseWheelTrigger & trigger,
double sensitivityX,
double sensitivityY,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [9/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedKeyboardShortcut & shortcut,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [10/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedKeyboardShortcut & shortcut,
double sensitivity,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [11/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedKeyboardShortcut & shortcut,
double sensitivityX,
double sensitivityY,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [12/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedKeyboardShortcut & shortcut1,
const ManagedKeyboardShortcut & shortcut2,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [13/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedKeyboardShortcut & shortcut1,
const ManagedKeyboardShortcut & shortcut2,
double sensitivity,
bool swapAxes = false )

◆ ManagedOffsetTrigger() [14/14]

ManagedOffsetTrigger::ManagedOffsetTrigger ( const ManagedKeyboardShortcut & shortcut1,
const ManagedKeyboardShortcut & shortcut2,
double sensitivityX,
double sensitivityY,
bool swapAxes = false )

Member Function Documentation

◆ fromString()

static ManagedOffsetTrigger ManagedOffsetTrigger::fromString ( const std::string & s)
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 sub-type trigger. Two keyboard shortcuts may be separated by a "/".

After the optional ";" may follow configuration settings, separated by further ";":

  • The keyword "swap" will swap offset axes.
  • A single floating point number will set the sensitivity of both axes (default is 1).
  • Two numbers will set the sensitivity of both axes separately (applied after swapping).

◆ getKeyboardShortcut1()

const ManagedKeyboardShortcut * ManagedOffsetTrigger::getKeyboardShortcut1 ( ) const
Returns
the pointer to the first keyboard shortcut if the trigger type is Keyboard, else NULL.

◆ getKeyboardShortcut2()

const ManagedKeyboardShortcut * ManagedOffsetTrigger::getKeyboardShortcut2 ( ) const
Returns
the pointer to a possible second keyboard shortcut if the trigger type is Keyboard, else NULL.

◆ getMouseButtonTrigger()

const ManagedMouseButtonTrigger * ManagedOffsetTrigger::getMouseButtonTrigger ( ) const
Returns
the pointer to the mouse button trigger if the trigger type is MouseButton, else NULL.

◆ getMouseWheelTrigger()

const ManagedMouseWheelTrigger * ManagedOffsetTrigger::getMouseWheelTrigger ( ) const
Returns
the pointer to the mouse wheel trigger if the trigger type is MouseWheel, else NULL.

◆ getTriggerType()

TriggerType ManagedOffsetTrigger::getTriggerType ( ) const
inline
Returns
the type of this trigger.

Definition at line 82 of file ManagedOffsetTrigger.h.

◆ isValid()

bool ManagedOffsetTrigger::isValid ( ) const
Returns
if this is a valid trigger

◆ operator=()

ManagedOffsetTrigger & ManagedOffsetTrigger::operator= ( const ManagedOffsetTrigger & trigger)

Assignment operator.

◆ sensitivityX()

double ManagedOffsetTrigger::sensitivityX ( ) const
inline
Returns
the sensitivity for the x-axis

Definition at line 116 of file ManagedOffsetTrigger.h.

◆ sensitivityY()

double ManagedOffsetTrigger::sensitivityY ( ) const
inline
Returns
the sensitivity for the y-axis

Definition at line 119 of file ManagedOffsetTrigger.h.

◆ swapAxes()

bool ManagedOffsetTrigger::swapAxes ( ) const
inline
Returns
if the axes should be swapped for this trigger

Definition at line 122 of file ManagedOffsetTrigger.h.

◆ toString()

std::string ManagedOffsetTrigger::toString ( ) const

Returns a string representation of this trigger (see fromString()).

Member Data Documentation

◆ [struct]

struct { ... } ManagedOffsetTrigger::_keyboard

◆ _mouseButtonTrigger

ManagedMouseButtonTrigger* ManagedOffsetTrigger::_mouseButtonTrigger

Definition at line 135 of file ManagedOffsetTrigger.h.

◆ _mouseWheelTrigger

ManagedMouseWheelTrigger* ManagedOffsetTrigger::_mouseWheelTrigger

Definition at line 136 of file ManagedOffsetTrigger.h.

◆ shortcut1

ManagedKeyboardShortcut* ManagedOffsetTrigger::shortcut1

Definition at line 138 of file ManagedOffsetTrigger.h.

◆ shortcut2

ManagedKeyboardShortcut* ManagedOffsetTrigger::shortcut2

Definition at line 139 of file ManagedOffsetTrigger.h.


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