05Robot 3.0

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
cGestureDirectoryEntry Class Reference
Eyetracker module

The class represents single entry describing complex gesture. More...

`#include <ceyetrackerfilter.h>`

## Public Types

## Public Member Functions
| cGestureDirectoryEntry ()
| The default constructor, should not be used, it sets event ID to -1. IDs<0 are ignored. More...
| cGestureDirectoryEntry (int _ID, const QString &_name, const QVector< sAtomGesture::eGestureType > &_chain, eConditionType _conditopnType, Qt::MouseButton clickEvent, int keyboardShortcut, Qt::KeyboardModifier keyboardModifiers=Qt::NoModifier, int max_duration=-1)
| The preferred constructor for cGestureDirectoryEntry. More...
bool | compare (QVector< sAtomGesture > atomGestures, double tolerance)
| Compares set of atom gestures with cGestureDirectoryEntry. More...
QString | getName () const
| Gets the complex gesture name. More...
int | getID () const
| Gets the complex gesture ID. More...
QPoint | getPoint () const
| Gets the complex gesture characteristic point, the point localization is dependent on eConditionType. The value is set by compare function. More...
QRect | getBoundingBox () const
| Gets the bounding box of whole complex gesture trace of the last compared trace. More...
Qt::MouseButton | getMouseButton () const
| Gets the mouse button to used in QMouseEvent message. More...
void | setMouseButton (const Qt::MouseButton &mouseButton)
| Sets the mouse button to be used in QMouseEvent message, if Qt::NoButton is set than no QMouseEvent is generated. More...
int | getKeyboardShortcut () const
| Gets the key to be used in QKeyEvent message. More...
Qt::KeyboardModifier | getKeyboardModifiers () const
| Gets the modifier key (such as shift, alt, ctrl) to be used in QKeyEvent message. More...
void | setKeyboardShortcut (int keyboardShortcut, const Qt::KeyboardModifier &keyboardModifiers)
| Sets keyboard shortcut data for QKeyEvent message emitted when the condition is true. More...

## Detailed Description

The class represents single entry describing complex gesture.

The QVector<cGestureDirectoryEntry> can be passed to cEyeTrackerFilter constructor.

QVector<cGestureDirectoryEntry> v = {cGestureDirectoryEntry(0,"horizontal move left right",{sAtomGesture::H_LINE_LEFT,sAtomGesture::H_LINE_RIGHT},cGestureDirectoryEntry::SAME_BUTTON_END, Qt::LeftButton, 'a', Qt::ControlModifier, 5000),\
cGestureDirectoryEntry(1,"vertical down up",{sAtomGesture::V_LINE_DOWN,sAtomGesture::V_LINE_UP},cGestureDirectoryEntry::EQUAL_START_END, Qt::LeftButton, 0, Qt::NoModifier, 5000),\
cGestureDirectoryEntry(2,"rectangle clockwise",{sAtomGesture::H_LINE_RIGHT,sAtomGesture::V_LINE_DOWN,sAtomGesture::H_LINE_LEFT, sAtomGesture::V_LINE_UP},cGestureDirectoryEntry::EQUAL_START_END, Qt::NoButton, 'z',Qt::ControlModifier)};
cEyeTrackerFilter* flt= new cEyeTrackerFilter(v,pMainWindow);

## Member Enumeration Documentation

enum eConditionType

The enumerator of additional condition checked when proper atom gestures chain is detected.

Enumerator
NONE | No additional condition defined (only chain of atom gestures signature has to match). The center of bounding box is assumed to be characteristic point.
EQUAL_SIZE | All segments (bounding boxes) has to have similar length. The maximum difference has to be lower than tolerance (cEyeTrackerFilter::gesture_tolerance). The center of bounding box is used as characteristic pint.
EQUAL_START_END | The distance between first point and the last point of the complex gesture should be below be lower than tolerance (cEyeTrackerFilter::gesture_tolerance). The start point is used as characteristic point.
SAME_BUTTON_END | The distance between first point and the last point of the complex gesture should be in the same QAbstractButtonWidget* (sMousePos::button). The start point is used as characteristic point.

## Constructor & Destructor Documentation

cGestureDirectoryEntry | ( |  | ) |
| inline

The default constructor, should not be used, it sets event ID to -1. IDs<0 are ignored.

cGestureDirectoryEntry | ( | int | _ID,
|  | const QString & | _name,
|  | const QVector< sAtomGesture::eGestureType > & | _chain,
|  | eConditionType | _conditopnType,
|  | Qt::MouseButton | clickEvent,
|  | int | keyboardShortcut,
|  | Qt::KeyboardModifier | keyboardModifiers = `Qt::NoModifier`,
|  | int | max_duration = `-1`
| ) |  |

The preferred constructor for cGestureDirectoryEntry.

Parameters

  _ID | The complex gesture ID, if value <0 the entry will be ignored. The number should be unique, otherwise several gesture will generate the same notification. This value is returned by cEyeTrackerFilter::complexGesture signal and cComplexGestureEvent::gestureID())
  _name | The descriptive name of gesture. It is returned by cEyeTrackerFilter::complexGesture signal and cComplexGestureEvent::gestureName())
  _chain | The vector of atom gesture signatures (sAtomGesture::eGestureType)
  _conditopnType | The additional condition which has to be meet to recognize complex gesture as matching (eConditionType)
  clickEvent | The QMouseEvent type to be generated when gesture match. If set to Qt::NoButton no mouse event is generated. To generate mouse click can be set to Qt::LeftButton or Qt::RightButton
  keyboardShortcut | The Key (character) to send by QKeyEvent. If set to 0 no event is generated. can be ASCII symbol or Qt defines such as Qt::Key_F1,Qt::Key_Home etc.
  keyboardModifiers | The Key modifier to send in QKeyEvent (can be i.e Qt::NoModifier, Qt::Qt::ShiftModifier, Qt::ControlModifier)
  max_duration | The maximum complex gesture duration in (ms). If negative the condition is skipped

cGestureDirectoryEntry(1,"vertical down up",{sAtomGesture::V_LINE_DOWN,sAtomGesture::V_LINE_UP},cGestureDirectoryEntry::EQUAL_START_END, Qt::LeftButton, 0, Qt::NoModifier, 5000)

## Member Function Documentation

bool compare | ( | QVector< sAtomGesture > | atomGestures,
|  | double | tolerance
| ) |  |

Compares set of atom gestures with cGestureDirectoryEntry.

Parameters

  atomGestures | Set of atom gestures
  tolerance | Value in (px) used to check additional condition (eConditionType)

Returns
  Return true if the pattern match atomGestures subset

QRect getBoundingBox | ( |  | ) | const
| inline

Gets the bounding box of whole complex gesture trace of the last compared trace.

int getID | ( |  | ) | const

Gets the complex gesture ID.

Qt::KeyboardModifier getKeyboardModifiers | ( |  | ) | const

Gets the modifier key (such as shift, alt, ctrl) to be used in QKeyEvent message.

int getKeyboardShortcut | ( |  | ) | const

Gets the key to be used in QKeyEvent message.

Returns
  The key value, can be ASCII or extended character, in predefined labels can be used ie. Qt::Key_F1, Qt::Key_Delete etc.

Qt::MouseButton getMouseButton | ( |  | ) | const

Gets the mouse button to used in QMouseEvent message.

QString getName | ( |  | ) | const

Gets the complex gesture name.

QPoint getPoint | ( |  | ) | const

Gets the complex gesture characteristic point, the point localization is dependent on eConditionType. The value is set by compare function.

void setKeyboardShortcut | ( | int | keyboardShortcut,
|  | const Qt::KeyboardModifier & | keyboardModifiers
| ) |  |

Sets keyboard shortcut data for QKeyEvent message emitted when the condition is true.

Parameters

  keyboardShortcut | Can be ASCII symbol or Qt defines such as Qt::Key_F1,Qt::Key_Home etc.
  keyboardModifiers | Modifier keys (such as shift, alt, ctrl) to be used in QKeyEvent message

void setMouseButton | ( | const Qt::MouseButton & | mouseButton | ) |

Sets the mouse button to be used in QMouseEvent message, if Qt::NoButton is set than no QMouseEvent is generated.

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

- eyetracker/ceyetrackerfilter.h