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

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

#include <pan-gesture-detector-base.h>

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

Public Member Functions

virtual ~PanGestureDetectorBase ()
 Virtual destructor. 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...
 

Protected Member Functions

 PanGestureDetectorBase (Vector2 screenSize, const Integration::PanGestureRequest &request, EnvironmentOptions *environmentOptions)
 Constructor. More...
 
- Protected Member Functions inherited from Dali::Internal::Adaptor::GestureDetector
 GestureDetector (Vector2 screenSize, Gesture::Type detectorType)
 Protected Constructor. More...
 
virtual ~GestureDetector ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from Dali::RefObject
 RefObject ()
 Default constructor. More...
 
virtual ~RefObject ()
 RefObject is intended as a base class. More...
 
 RefObject (const RefObject &rhs)
 Copy constructor. More...
 
RefObjectoperator= (const RefObject &rhs)
 Assignment operator. More...
 

Private Types

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

Private Member Functions

void SendPan (Gesture::State state, const Integration::TouchEvent &currentEvent)
 Emits the pan gesture event (performs some smoothing operation). More...
 
virtual void EmitPan (const Integration::PanGestureEvent gesture)=0
 Emits the pan gesture event to the core. More...
 

Private Attributes

State mState
 The current state of the detector. More...
 
std::vector
< Integration::TouchEvent > 
mTouchEvents
 A container of all touch events after an initial down event. More...
 
Vector2 mPrimaryTouchDownLocation
 The initial touch down point. More...
 
Vector2 mThresholdAdjustmentPerFrame
 The adjustment per frame at the start of a slow pan. More...
 
Vector2 mPreviousPosition
 The previous position. More...
 
unsigned int mThresholdAdjustmentsRemaining
 No. of threshold adjustments still to apply (for a slow-pan). More...
 
unsigned int mThresholdTotalAdjustments
 The total number of adjustments required. More...
 
unsigned long mPrimaryTouchDownTime
 The initial touch down time. More...
 
unsigned int mMinimumTouchesRequired
 The minimum touches required before a pan should be emitted. More...
 
unsigned int mMaximumTouchesRequired
 The maximum touches after which a pan should not be emitted. More...
 
unsigned int mMinimumDistanceSquared
 The minimum distance squared before pan should start. More...
 
unsigned int mMinimumMotionEvents
 The minimum motion events before pan should start. More...
 
unsigned int mMotionEvents
 The motion events received so far (before pan is emitted). More...
 

Additional Inherited Members

- 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 pan gesture has taken place.

Definition at line 50 of file pan-gesture-detector-base.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.

Finished 

A previously started pan gesture has finished.

Failed 

Current touch event data suggests a pan gesture is not possible.

Definition at line 100 of file pan-gesture-detector-base.h.

Constructor & Destructor Documentation

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

Virtual destructor.

Definition at line 83 of file pan-gesture-detector-base.cpp.

Dali::Internal::Adaptor::PanGestureDetectorBase::PanGestureDetectorBase ( Vector2  screenSize,
const Integration::PanGestureRequest &  request,
EnvironmentOptions environmentOptions 
)
protected

Member Function Documentation

virtual void Dali::Internal::Adaptor::PanGestureDetectorBase::EmitPan ( const Integration::PanGestureEvent  gesture)
privatepure virtual

Emits the pan gesture event to the core.

Parameters
[in]gestureThe pan gesture event.

Implemented in Dali::Internal::Adaptor::AccessibilityGestureDetector, and Dali::Internal::Adaptor::PanGestureDetector.

Referenced by SendPan().

Here is the caller graph for this function:

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

Emits the pan gesture event (performs some smoothing operation).

Parameters
[in]stateThe state of the pan.
[in]currentEventThe latest touch event.

Definition at line 268 of file pan-gesture-detector-base.cpp.

References EmitPan(), Dali::Internal::Adaptor::anonymous_namespace{pan-gesture-detector-base.cpp}::MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS(), mPreviousPosition, mPrimaryTouchDownLocation, mPrimaryTouchDownTime, mThresholdAdjustmentPerFrame, mThresholdAdjustmentsRemaining, mThresholdTotalAdjustments, mTouchEvents, Dali::Gesture::Started, and Dali::Vector2::ZERO.

Referenced by SendEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Member Data Documentation

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mMaximumTouchesRequired
private

The maximum touches after which a pan should not be emitted.

Definition at line 121 of file pan-gesture-detector-base.h.

Referenced by SendEvent(), and Update().

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mMinimumDistanceSquared
private

The minimum distance squared before pan should start.

Definition at line 123 of file pan-gesture-detector-base.h.

Referenced by PanGestureDetectorBase(), and SendEvent().

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mMinimumMotionEvents
private

The minimum motion events before pan should start.

Definition at line 124 of file pan-gesture-detector-base.h.

Referenced by PanGestureDetectorBase(), and SendEvent().

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mMinimumTouchesRequired
private

The minimum touches required before a pan should be emitted.

Definition at line 120 of file pan-gesture-detector-base.h.

Referenced by SendEvent(), and Update().

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mMotionEvents
private

The motion events received so far (before pan is emitted).

Definition at line 125 of file pan-gesture-detector-base.h.

Referenced by SendEvent().

Vector2 Dali::Internal::Adaptor::PanGestureDetectorBase::mPreviousPosition
private

The previous position.

Definition at line 114 of file pan-gesture-detector-base.h.

Referenced by SendPan().

Vector2 Dali::Internal::Adaptor::PanGestureDetectorBase::mPrimaryTouchDownLocation
private

The initial touch down point.

Definition at line 112 of file pan-gesture-detector-base.h.

Referenced by SendEvent(), and SendPan().

unsigned long Dali::Internal::Adaptor::PanGestureDetectorBase::mPrimaryTouchDownTime
private

The initial touch down time.

Definition at line 119 of file pan-gesture-detector-base.h.

Referenced by SendEvent(), and SendPan().

State Dali::Internal::Adaptor::PanGestureDetectorBase::mState
private

The current state of the detector.

Definition at line 109 of file pan-gesture-detector-base.h.

Referenced by SendEvent().

Vector2 Dali::Internal::Adaptor::PanGestureDetectorBase::mThresholdAdjustmentPerFrame
private

The adjustment per frame at the start of a slow pan.

Definition at line 113 of file pan-gesture-detector-base.h.

Referenced by SendPan().

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mThresholdAdjustmentsRemaining
private

No. of threshold adjustments still to apply (for a slow-pan).

Definition at line 116 of file pan-gesture-detector-base.h.

Referenced by SendPan().

unsigned int Dali::Internal::Adaptor::PanGestureDetectorBase::mThresholdTotalAdjustments
private

The total number of adjustments required.

Definition at line 117 of file pan-gesture-detector-base.h.

Referenced by PanGestureDetectorBase(), and SendPan().

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

A container of all touch events after an initial down event.

Definition at line 110 of file pan-gesture-detector-base.h.

Referenced by SendEvent(), and SendPan().


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