#include <mythgesture.h>
Becase the indended use of the stop method is to be called by either the expiration of a timer or when an event is called (or both at the same time) it must have a mutex.
Definition at line 116 of file mythgesture.h.
Public Member Functions | |
| MythGesture (size_t max_points=10000, size_t min_points=50, size_t max_sequence=20, size_t scale_ratio=4, float bin_percent=0.07) | |
| Create a new stroke, specifying tuning values. | |
| ~MythGesture () | |
| void | start (void) |
| Start recording. | |
| void | stop (void) |
| Stop recording. | |
| bool | recording (void) const |
| Determine if the stroke is being recorded. | |
| MythGestureEvent * | gesture (void) const |
| Complete the gesture event of the last completed stroke. | |
| bool | record (const QPoint &p) |
| Record a point. | |
| bool | hasMinimumPoints (void) const |
| Determine if the stroke has the minimum required points. | |
Protected Member Functions | |
| QString | translate (void) |
| Translate the stroke into a sequence. | |
| void | adjustExtremes (int x, int y) |
| Adjust horizontal and vertical extremes. | |
Private Attributes | |
| bool | m_recording |
| int | min_x |
| int | max_x |
| int | min_y |
| int | max_y |
| size_t | max_points |
| size_t | min_points |
| size_t | max_sequence |
| int | scale_ratio |
| float | bin_percent |
| size_t | last_gesture |
| QValueList< QPoint > | points |
| MythGesturePrivate * | p |
| MythGesture::MythGesture | ( | size_t | max_points = 10000, |
|
| size_t | min_points = 50, |
|||
| size_t | max_sequence = 20, |
|||
| size_t | scale_ratio = 4, |
|||
| float | bin_percent = 0.07 | |||
| ) |
Create a new stroke, specifying tuning values.
| max_points | The maximum number of points to record. | |
| min_points | The minimum number of points to record. | |
| max_sequence | The maximum producible sequence size. | |
| scale_ratio | The stroke scale ratio | |
| bin_percent | The bin count percentage required to add to the sequence. |
Definition at line 56 of file mythgesture.cpp.
| MythGesture::~MythGesture | ( | ) |
Definition at line 95 of file mythgesture.cpp.
| void MythGesture::start | ( | void | ) |
Start recording.
Definition at line 119 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter().
| void MythGesture::stop | ( | void | ) |
Stop recording.
This method stores the gesture, as it is, and resets all information.
Definition at line 127 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter(), and MythMainWindow::mouseTimeout().
| bool MythGesture::recording | ( | void | ) | const |
Determine if the stroke is being recorded.
Definition at line 110 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter(), MythMainWindow::mouseTimeout(), and record().
| MythGestureEvent * MythGesture::gesture | ( | void | ) | const |
Complete the gesture event of the last completed stroke.
Definition at line 145 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter(), and MythMainWindow::mouseTimeout().
| bool MythGesture::record | ( | const QPoint & | p | ) |
Record a point.
| p | The point to record. |
Definition at line 272 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter().
| bool MythGesture::hasMinimumPoints | ( | void | ) | const [inline] |
Determine if the stroke has the minimum required points.
Definition at line 170 of file mythgesture.h.
| QString MythGesture::translate | ( | void | ) | [protected] |
Translate the stroke into a sequence.
Definition at line 167 of file mythgesture.cpp.
Referenced by stop().
| void MythGesture::adjustExtremes | ( | int | x, | |
| int | y | |||
| ) | [protected] |
Adjust horizontal and vertical extremes.
| x | The new horizontal extreme. | |
| y | The new vertical extreme |
Definition at line 102 of file mythgesture.cpp.
Referenced by record().
bool MythGesture::m_recording [private] |
int MythGesture::min_x [private] |
Definition at line 192 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
int MythGesture::max_x [private] |
Definition at line 193 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
int MythGesture::min_y [private] |
Definition at line 194 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
int MythGesture::max_y [private] |
Definition at line 195 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
size_t MythGesture::max_points [private] |
size_t MythGesture::min_points [private] |
size_t MythGesture::max_sequence [private] |
int MythGesture::scale_ratio [private] |
float MythGesture::bin_percent [private] |
size_t MythGesture::last_gesture [private] |
QValueList<QPoint> MythGesture::points [private] |
Definition at line 202 of file mythgesture.h.
Referenced by hasMinimumPoints(), record(), and translate().
MythGesturePrivate* MythGesture::p [private] |
Definition at line 204 of file mythgesture.h.
Referenced by MythGesture(), recording(), start(), stop(), translate(), and ~MythGesture().
1.5.5