MythTV
master
|
Contains the points in a stroke, and translates them into gestures. More...
#include <mythgesture.h>
Public Member Functions | |
MythGesture (size_t MaxPoints=10000, size_t MinPoints=50, size_t MaxSequence=20, int ScaleRatio=4, float BinPercent=0.07F) | |
Create a new stroke, specifying tuning values. More... | |
void | Start () |
Start recording. More... | |
void | Stop (bool Timeout=false) |
Stop recording. More... | |
bool | Recording () |
Determine if the stroke is being recorded. More... | |
MythGestureEvent * | GetGesture () const |
Complete the gesture event of the last completed stroke. More... | |
bool | Record (QPoint Point, Qt::MouseButton Button) |
Record a point. More... | |
Private Member Functions | |
bool | HasMinimumPoints () const |
Determine if the stroke has the minimum required points. More... | |
QString | Translate (bool Timeout) |
Translate the stroke into a sequence. More... | |
void | AdjustExtremes (int X, int Y) |
Adjust horizontal and vertical extremes. More... | |
Private Attributes | |
bool | m_recording { false } |
int | m_minX { 10000 } |
int | m_maxX { -1 } |
int | m_minY { 10000 } |
int | m_maxY { -1 } |
size_t | m_maxPoints { 10000 } |
size_t | m_minPoints { 50 } |
size_t | m_maxSequence { 20 } |
int | m_scaleRatio { 4 } |
float | m_binPercent { 0.07F } |
MythGestureEvent::Gesture | m_lastGesture { MythGestureEvent::Unknown } |
QList< QPoint > | m_points |
QMutex | m_lock |
Qt::MouseButton | m_lastButton { Qt::NoButton } |
Static Private Attributes | |
static const std::map< QString, MythGestureEvent::Gesture > | kSequences |
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 99 of file mythgesture.h.
|
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 116 of file mythgesture.cpp.
void MythGesture::Start | ( | ) |
Start recording.
Definition at line 151 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter().
Stop recording.
This method stores the gesture, as it is, and resets all information.
Definition at line 163 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter(), and MythMainWindow::MouseTimeout().
bool MythGesture::Recording | ( | ) |
Determine if the stroke is being recorded.
Definition at line 142 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter(), MythMainWindow::MouseTimeout(), and Record().
MythGestureEvent * MythGesture::GetGesture | ( | ) | const |
Complete the gesture event of the last completed stroke.
Definition at line 190 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter(), and MythMainWindow::MouseTimeout().
bool MythGesture::Record | ( | QPoint | Point, |
Qt::MouseButton | Button | ||
) |
Record a point.
Point | The point to record. |
Definition at line 331 of file mythgesture.cpp.
Referenced by MythMainWindow::eventFilter().
|
private |
Determine if the stroke has the minimum required points.
Definition at line 322 of file mythgesture.cpp.
|
private |
Translate the stroke into a sequence.
Definition at line 217 of file mythgesture.cpp.
Referenced by Stop().
|
private |
Adjust horizontal and vertical extremes.
x | The new horizontal extreme. |
y | The new vertical extreme |
Definition at line 131 of file mythgesture.cpp.
Referenced by Record().
Definition at line 119 of file mythgesture.h.
Referenced by Recording(), Start(), and Stop().
|
private |
Definition at line 120 of file mythgesture.h.
Referenced by AdjustExtremes(), Stop(), and Translate().
|
private |
Definition at line 121 of file mythgesture.h.
Referenced by AdjustExtremes(), Stop(), and Translate().
|
private |
Definition at line 122 of file mythgesture.h.
Referenced by AdjustExtremes(), Stop(), and Translate().
|
private |
Definition at line 123 of file mythgesture.h.
Referenced by AdjustExtremes(), Stop(), and Translate().
|
private |
Definition at line 124 of file mythgesture.h.
Referenced by Record(), and Translate().
|
private |
Definition at line 125 of file mythgesture.h.
Referenced by HasMinimumPoints(), and Translate().
|
private |
Definition at line 126 of file mythgesture.h.
Referenced by Translate().
|
private |
Definition at line 127 of file mythgesture.h.
Referenced by Translate().
|
private |
Definition at line 128 of file mythgesture.h.
Referenced by Translate().
|
private |
Definition at line 129 of file mythgesture.h.
Referenced by GetGesture(), and Stop().
|
private |
Definition at line 130 of file mythgesture.h.
Referenced by HasMinimumPoints(), Record(), and Translate().
|
private |
Definition at line 131 of file mythgesture.h.
Referenced by Recording(), Start(), and Stop().
|
staticprivate |
Definition at line 132 of file mythgesture.h.
Referenced by Stop().
|
private |
Definition at line 133 of file mythgesture.h.
Referenced by GetGesture(), and Record().