Rotate gesture recognizer. More...
#include <RotateRecognizer.h>


Public Member Functions | |
| float | rotation () const |
| Get current rotation in radians. | |
| float | rotationSpeed () const |
| Get current rotation speed in radians per second. | |
| virtual void | reset () |
| Reset the gesture data. | |
| virtual void | touchEvent (const PlatformTouchEvent &ev) |
| Feed new data. | |
Private Member Functions | |
| float | calcAngle (const IntPoint &p1, const IntPoint &p2) const |
| Calculate angle. | |
| float | diffAngle (float alpha, float beta) const |
| Calculate angle difference. | |
Private Attributes | |
| float | m_rotation |
| float | m_angle |
| GestureSpeedCalc | m_speed |
Rotate gesture recognizer.
Definition at line 29 of file RotateRecognizer.h.
| float WebCore::RotateRecognizer::calcAngle | ( | const IntPoint & | p1, | |
| const IntPoint & | p2 | |||
| ) | const [private] |
Calculate angle.
Calculates the angle between two points.
| p1 | First point. | |
| p2 | Second point. |
Definition at line 107 of file RotateRecognizer.cpp.
| float WebCore::RotateRecognizer::diffAngle | ( | float | alpha, | |
| float | beta | |||
| ) | const [private] |
Calculate angle difference.
Calculates the difference between two angles.
| alpha | first angle. | |
| beta | second angle. |
Definition at line 123 of file RotateRecognizer.cpp.
| void WebCore::RotateRecognizer::reset | ( | ) | [virtual] |
Reset the gesture data.
Resets the gesture data e.g. when the rotate gesture starts over.
Reimplemented from WebCore::GestureRecognizer.
Definition at line 52 of file RotateRecognizer.cpp.
References m_angle, WebCore::GestureRecognizer::m_refresh, and m_rotation.
| float WebCore::RotateRecognizer::rotation | ( | ) | const [inline] |
Get current rotation in radians.
Definition at line 33 of file RotateRecognizer.h.
References m_rotation.
| float WebCore::RotateRecognizer::rotationSpeed | ( | ) | const [inline] |
Get current rotation speed in radians per second.
Definition at line 34 of file RotateRecognizer.h.
References m_speed, and WebCore::GestureSpeedCalc::speed().

| void WebCore::RotateRecognizer::touchEvent | ( | const PlatformTouchEvent & | ev | ) | [virtual] |
Feed new data.
Processes the touch event and calculates new data for the rotate gesture.
| ev | Platform touch event. |
Implements WebCore::GestureRecognizer.
Definition at line 65 of file RotateRecognizer.cpp.
References calcAngle(), diffAngle(), WebCore::GestureSpeedCalc::firstSample(), WebCore::GestureSpeedCalc::insertSample(), m_angle, WebCore::GestureRecognizer::m_id1i, WebCore::GestureRecognizer::m_id2i, WebCore::GestureRecognizer::m_refresh, m_rotation, m_speed, WebCore::GestureRecognizer::selectValidPoints(), and WebCore::GestureRecognizer::updateRefreshState().

float WebCore::RotateRecognizer::m_angle [private] |
Definition at line 47 of file RotateRecognizer.h.
float WebCore::RotateRecognizer::m_rotation [private] |
Definition at line 46 of file RotateRecognizer.h.
Definition at line 48 of file RotateRecognizer.h.
1.6.2-20100208