Dali 3D User Interface Engine
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Dali::Internal::Adaptor::PinchGestureDetector Class Reference

When given a set of touch events, this detector attempts to determine if a pinch gesture has taken place. More...

#include <pinch-gesture-detector.h>

Inheritance diagram for Dali::Internal::Adaptor::PinchGestureDetector:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::Adaptor::PinchGestureDetector:
Collaboration graph
[legend]

Public Member Functions

 PinchGestureDetector (CoreEventInterface &coreEventInterface, Vector2 screenSize, float minimumPinchDistance)
 Constructor. More...
 
virtual ~PinchGestureDetector ()
 Virtual destructor. More...
 
void SetMinimumPinchDistance (float distance)
 Sets minimum distance in pixels that the fingers must move towards/away from each other in order to trigger a pinch gesture. More...
 
virtual void SendEvent (const Integration::TouchEvent &event)
  More...
 
virtual void Update (const Integration::GestureRequest &request)
  More...
 
- Public Member Functions inherited from Dali::Internal::Adaptor::GestureDetector
Gesture::Type GetType () const
 Returns the type of gesture detector. More...
 
- Public Member Functions inherited from Dali::RefObject
void Reference ()
 Increment the object's reference count. More...
 
void Unreference ()
 Decrement the object's reference count. More...
 
int ReferenceCount ()
 Retrieve the object's reference count. More...
 

Private Types

enum  State { Clear, Possible, Started }
 Internal state machine. More...
 

Private Member Functions

void SendPinch (Gesture::State state, const Integration::TouchEvent &currentEvent)
 Emits the pinch gesture event to the core. More...
 

Private Attributes

CoreEventInterfacemCoreEventInterface
 Used to send events to Core. More...
 
State mState
 The current state of the detector. More...
 
std::vector
< Integration::TouchEvent > 
mTouchEvents
 The touch events since initial touch down. More...
 
float mMinimumDistanceDelta
 The minimum distance before a pinch is applicable. More...
 
float mStartingDistance
 The distance between the two touch points when the pinch is first detected. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::Internal::Adaptor::GestureDetector
 GestureDetector (Vector2 screenSize, Gesture::Type detectorType)
 Protected Constructor. More...
 
virtual ~GestureDetector ()
 Virtual destructor. More...
 
- Protected Attributes inherited from Dali::Internal::Adaptor::GestureDetector
Vector2 mScreenSize
 
Gesture::Type mType
 

Detailed Description

When given a set of touch events, this detector attempts to determine if a pinch gesture has taken place.

Definition at line 46 of file pinch-gesture-detector.h.

Member Enumeration Documentation

Internal state machine.

Enumerator
Clear 

No gesture detected.

Possible 

The current touch event data suggests that a gesture is possible.

Started 

A gesture has been detected.

Definition at line 96 of file pinch-gesture-detector.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::PinchGestureDetector::PinchGestureDetector ( CoreEventInterface coreEventInterface,
Vector2  screenSize,
float  minimumPinchDistance 
)

Constructor.

Parameters
[in]coreEventInterfaceUsed to send events to Core.
[in]screenSizeThe size of the screen.

Definition at line 67 of file pinch-gesture-detector.cpp.

Dali::Internal::Adaptor::PinchGestureDetector::~PinchGestureDetector ( )
virtual

Virtual destructor.

Definition at line 77 of file pinch-gesture-detector.cpp.

Member Function Documentation

void Dali::Internal::Adaptor::PinchGestureDetector::SendEvent ( const Integration::TouchEvent &  event)
virtual
void Dali::Internal::Adaptor::PinchGestureDetector::SendPinch ( Gesture::State  state,
const Integration::TouchEvent &  currentEvent 
)
private

Emits the pinch gesture event to the core.

Parameters
[in]stateThe state of the pinch (whether it's starting, continuing or finished).
[in]currentEventThe latest touch event.

Definition at line 214 of file pinch-gesture-detector.cpp.

References Dali::Gesture::Cancelled, DALI_ASSERT_DEBUG, Dali::Internal::Adaptor::anonymous_namespace{pinch-gesture-detector.cpp}::GetCenterPoint(), Dali::Internal::Adaptor::anonymous_namespace{pinch-gesture-detector.cpp}::GetDistance(), mCoreEventInterface, mStartingDistance, mTouchEvents, and Dali::Internal::Adaptor::CoreEventInterface::QueueCoreEvent().

Referenced by SendEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::PinchGestureDetector::SetMinimumPinchDistance ( float  distance)

Sets minimum distance in pixels that the fingers must move towards/away from each other in order to trigger a pinch gesture.

Parameters
[in]distanceThe minimum pinch distance in pixels

Definition at line 81 of file pinch-gesture-detector.cpp.

References mMinimumDistanceDelta.

Referenced by Dali::Internal::Adaptor::GestureManager::SetMinimumPinchDistance().

Here is the caller graph for this function:

void Dali::Internal::Adaptor::PinchGestureDetector::Update ( const Integration::GestureRequest &  request)
virtual

Member Data Documentation

CoreEventInterface& Dali::Internal::Adaptor::PinchGestureDetector::mCoreEventInterface
private

Used to send events to Core.

Definition at line 103 of file pinch-gesture-detector.h.

Referenced by SendPinch().

float Dali::Internal::Adaptor::PinchGestureDetector::mMinimumDistanceDelta
private

The minimum distance before a pinch is applicable.

Definition at line 107 of file pinch-gesture-detector.h.

Referenced by SendEvent(), and SetMinimumPinchDistance().

float Dali::Internal::Adaptor::PinchGestureDetector::mStartingDistance
private

The distance between the two touch points when the pinch is first detected.

Definition at line 109 of file pinch-gesture-detector.h.

Referenced by SendEvent(), and SendPinch().

State Dali::Internal::Adaptor::PinchGestureDetector::mState
private

The current state of the detector.

Definition at line 104 of file pinch-gesture-detector.h.

Referenced by SendEvent().

std::vector<Integration::TouchEvent> Dali::Internal::Adaptor::PinchGestureDetector::mTouchEvents
private

The touch events since initial touch down.

Definition at line 105 of file pinch-gesture-detector.h.

Referenced by SendEvent(), and SendPinch().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali