Contains the points in a stroke, and translates them into gestures. More...
#include <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 |
| MythGestureEvent::Gesture | last_gesture |
| QList< QPoint > | points |
| MythGesturePrivate * | p |
Contains the points in a stroke, and translates them into gestures.
Because 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 140 of file mythgesture.h.
| 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 | |||
| ) | [explicit] |
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 55 of file mythgesture.cpp.
| MythGesture::~MythGesture | ( | ) |
Definition at line 94 of file mythgesture.cpp.
| void MythGesture::start | ( | void | ) |
Start recording.
Definition at line 117 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 125 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 108 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 143 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 270 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 193 of file mythgesture.h.
| QString MythGesture::translate | ( | void | ) | [protected] |
Translate the stroke into a sequence.
Definition at line 165 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 100 of file mythgesture.cpp.
Referenced by record().
bool MythGesture::m_recording [private] |
Definition at line 214 of file mythgesture.h.
Referenced by recording(), start(), and stop().
int MythGesture::min_x [private] |
Definition at line 215 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
int MythGesture::max_x [private] |
Definition at line 216 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
int MythGesture::min_y [private] |
Definition at line 217 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
int MythGesture::max_y [private] |
Definition at line 218 of file mythgesture.h.
Referenced by adjustExtremes(), stop(), and translate().
size_t MythGesture::max_points [private] |
Definition at line 219 of file mythgesture.h.
Referenced by record(), and translate().
size_t MythGesture::min_points [private] |
Definition at line 220 of file mythgesture.h.
Referenced by hasMinimumPoints(), and translate().
size_t MythGesture::max_sequence [private] |
Definition at line 221 of file mythgesture.h.
Referenced by translate().
int MythGesture::scale_ratio [private] |
Definition at line 222 of file mythgesture.h.
Referenced by translate().
float MythGesture::bin_percent [private] |
Definition at line 223 of file mythgesture.h.
Referenced by translate().
Definition at line 224 of file mythgesture.h.
Referenced by gesture(), MythGesture(), and stop().
QList<QPoint> MythGesture::points [private] |
Definition at line 225 of file mythgesture.h.
Referenced by hasMinimumPoints(), record(), and translate().
MythGesturePrivate* MythGesture::p [private] |
Definition at line 227 of file mythgesture.h.
Referenced by MythGesture(), recording(), start(), stop(), translate(), and ~MythGesture().
1.6.3