WebCore::RotateRecognizer Class Reference

Rotate gesture recognizer. More...

#include <RotateRecognizer.h>

Inheritance diagram for WebCore::RotateRecognizer:
Inheritance graph
[legend]
Collaboration diagram for WebCore::RotateRecognizer:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Rotate gesture recognizer.

Definition at line 29 of file RotateRecognizer.h.


Member Function Documentation

float WebCore::RotateRecognizer::calcAngle ( const IntPoint &  p1,
const IntPoint &  p2 
) const [private]

Calculate angle.

Calculates the angle between two points.

Returns:
angle in radians.
Parameters:
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.

Returns:
the difference angle in radians, between -pi and pi.
Parameters:
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().

Here is the call graph for this function:

void WebCore::RotateRecognizer::touchEvent ( const PlatformTouchEvent &  ev  )  [virtual]

Feed new data.

Processes the touch event and calculates new data for the rotate gesture.

Parameters:
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().

Here is the call graph for this function:


Member Data Documentation

Definition at line 47 of file RotateRecognizer.h.

Definition at line 46 of file RotateRecognizer.h.

Definition at line 48 of file RotateRecognizer.h.


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208