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

Pinch Gesture Event Processing: More...

#include <pinch-gesture-processor.h>

Inheritance diagram for Dali::Internal::PinchGestureProcessor:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::PinchGestureProcessor:
Collaboration graph
[legend]

Public Member Functions

 PinchGestureProcessor (Stage &stage, Integration::GestureManager &gestureManager)
 Create a pinch gesture processor. More...
 
 ~PinchGestureProcessor ()
 Non-virtual destructor; PinchGestureProcessor is not a base class. More...
 
void Process (const Integration::PinchGestureEvent &pinchEvent)
 This method is called whenever a pinch gesture event occurs. More...
 
void AddGestureDetector (PinchGestureDetector *gestureDetector)
 Adds a gesture detector to this gesture processor. More...
 
void RemoveGestureDetector (PinchGestureDetector *gestureDetector)
 Removes the specified gesture detector from this gesture processor. More...
 
void GestureDetectorUpdated (PinchGestureDetector *gestureDetector)
 This method updates the gesture detection parameters. More...
 

Private Member Functions

 PinchGestureProcessor (const PinchGestureProcessor &)
 
PinchGestureProcessoroperator= (const PinchGestureProcessor &rhs)
 
void OnGesturedActorStageDisconnection ()
 Called when the gestured actor is removed from the stage. More...
 
bool CheckGestureDetector (GestureDetector *detector, Actor *actor)
 Called by the ProcessAndEmit() & GetGesturedActor() methods to check if the provided gesture-detector meets the parameters of the current gesture. More...
 
void EmitGestureSignal (Actor *actor, const GestureDetectorContainer &gestureDetectors, Vector2 actorCoordinates)
 Called by the ProcessAndEmit() method when the gesture meets all applicable criteria and should be overridden by deriving classes to emit the gesture signal on gesture-detectors provided for the actor the gesture has occurred on. More...
 

Private Attributes

StagemStage
 
Integration::GestureManagermGestureManager
 
PinchGestureDetectorContainer mGestureDetectors
 
GestureDetectorContainer mCurrentPinchEmitters
 
Dali::RenderTask mCurrentRenderTask
 
const
Integration::PinchGestureEvent * 
mCurrentPinchEvent
 Pointer to current PinchEvent, used when calling ProcessAndEmit() More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::Internal::GestureProcessor
 GestureProcessor (Gesture::Type type)
 Protected constructor. More...
 
virtual ~GestureProcessor ()
 Virtual protected destructor. More...
 
void GetGesturedActor (Actor *&actor, GestureDetectorContainer &gestureDetectors)
 Given the hit actor, this walks up the actor tree to determine the actor that is connected to one (or several) gesture detectors. More...
 
void ProcessAndEmit (HitTestAlgorithm::Results &hitTestResults)
 Calls the emission method in the deriving class for matching gesture-detectors with the hit-actor (or one of its parents). More...
 
virtual bool HitTest (Stage &stage, Vector2 screenCoordinates, HitTestAlgorithm::Results &hitTestResults)
 Hit test the screen coordinates, and place the results in hitTestResults. More...
 
void SetActor (Actor *actor)
 Sets the mCurrentGesturedActor and connects to the required signals. More...
 
void ResetActor ()
 Resets the set actor and disconnects any connected signals. More...
 
ActorGetCurrentGesturedActor ()
 Returns the current gestured actor if it is on stage. More...
 

Detailed Description

Pinch Gesture Event Processing:

When we receive a pinch gesture event, we do the following:

The above is only checked when our gesture starts. We continue sending the pinch gesture to this detector until the pinch ends or is cancelled.

Definition at line 51 of file pinch-gesture-processor.h.

Constructor & Destructor Documentation

Dali::Internal::PinchGestureProcessor::PinchGestureProcessor ( Stage stage,
Integration::GestureManager gestureManager 
)

Create a pinch gesture processor.

Parameters
[in]stageThe stage.
[in]gestureManagerThe gesture manager

Definition at line 103 of file pinch-gesture-processor.cpp.

Dali::Internal::PinchGestureProcessor::~PinchGestureProcessor ( )

Non-virtual destructor; PinchGestureProcessor is not a base class.

Definition at line 113 of file pinch-gesture-processor.cpp.

Dali::Internal::PinchGestureProcessor::PinchGestureProcessor ( const PinchGestureProcessor )
private

Member Function Documentation

void Dali::Internal::PinchGestureProcessor::AddGestureDetector ( PinchGestureDetector gestureDetector)

Adds a gesture detector to this gesture processor.

If this is the first gesture detector being added, then this method registers the required gesture with the adaptor.

Parameters
[in]gestureDetectorThe gesture detector being added.

Definition at line 199 of file pinch-gesture-processor.cpp.

References mGestureDetectors, mGestureManager, Dali::Gesture::Pinch, and Dali::Integration::GestureManager::Register().

Referenced by Dali::Internal::GestureEventProcessor::AddGestureDetector().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::PinchGestureProcessor::CheckGestureDetector ( GestureDetector detector,
Actor actor 
)
privatevirtual

Called by the ProcessAndEmit() & GetGesturedActor() methods to check if the provided gesture-detector meets the parameters of the current gesture.

Parameters
[in]detectorThe gesture detector to check.
[in]actorThe actor that has been gestured.
Returns
true, if the detector meets the parameters, false otherwise.

Implements Dali::Internal::GestureProcessor.

Definition at line 251 of file pinch-gesture-processor.cpp.

void Dali::Internal::PinchGestureProcessor::EmitGestureSignal ( Actor actor,
const GestureDetectorContainer gestureDetectors,
Vector2  actorCoordinates 
)
privatevirtual

Called by the ProcessAndEmit() method when the gesture meets all applicable criteria and should be overridden by deriving classes to emit the gesture signal on gesture-detectors provided for the actor the gesture has occurred on.

Parameters
[in]actorThe actor which has been gestured.
[in]gestureDetectorsThe detectors that should emit the signal.
[in]actorCoordinatesThe local actor coordinates where the gesture took place.

Implements Dali::Internal::GestureProcessor.

Definition at line 257 of file pinch-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::anonymous_namespace{pinch-gesture-processor.cpp}::EmitPinchSignal(), mCurrentPinchEmitters, mCurrentPinchEvent, Dali::Internal::Actor::OnStage(), and Dali::Internal::GestureProcessor::SetActor().

Here is the call graph for this function:

void Dali::Internal::PinchGestureProcessor::GestureDetectorUpdated ( PinchGestureDetector gestureDetector)

This method updates the gesture detection parameters.

Parameters
[in]gestureDetectorThe gesture detector that has been updated.

Definition at line 241 of file pinch-gesture-processor.cpp.

Referenced by Dali::Internal::GestureEventProcessor::GestureDetectorUpdated().

Here is the caller graph for this function:

void Dali::Internal::PinchGestureProcessor::OnGesturedActorStageDisconnection ( )
privatevirtual

Called when the gestured actor is removed from the stage.

Implements Dali::Internal::GestureProcessor.

Definition at line 246 of file pinch-gesture-processor.cpp.

References mCurrentPinchEmitters.

PinchGestureProcessor& Dali::Internal::PinchGestureProcessor::operator= ( const PinchGestureProcessor rhs)
private
void Dali::Internal::PinchGestureProcessor::Process ( const Integration::PinchGestureEvent &  pinchEvent)
void Dali::Internal::PinchGestureProcessor::RemoveGestureDetector ( PinchGestureDetector gestureDetector)

Removes the specified gesture detector from this gesture processor.

If, after removing this gesture detector, there are no more gesture detectors registered, then this method unregisters the gesture from the adaptor.

Parameters
[in]gestureDetectorThe gesture detector being removed.

Definition at line 212 of file pinch-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, mCurrentPinchEmitters, mGestureDetectors, mGestureManager, Dali::Gesture::Pinch, Dali::Internal::GestureProcessor::ResetActor(), and Dali::Integration::GestureManager::Unregister().

Referenced by Dali::Internal::GestureEventProcessor::RemoveGestureDetector().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

GestureDetectorContainer Dali::Internal::PinchGestureProcessor::mCurrentPinchEmitters
private
const Integration::PinchGestureEvent* Dali::Internal::PinchGestureProcessor::mCurrentPinchEvent
private

Pointer to current PinchEvent, used when calling ProcessAndEmit()

Definition at line 130 of file pinch-gesture-processor.h.

Referenced by EmitGestureSignal(), and Process().

Dali::RenderTask Dali::Internal::PinchGestureProcessor::mCurrentRenderTask
private

Definition at line 128 of file pinch-gesture-processor.h.

Referenced by Process().

PinchGestureDetectorContainer Dali::Internal::PinchGestureProcessor::mGestureDetectors
private

Definition at line 126 of file pinch-gesture-processor.h.

Referenced by AddGestureDetector(), and RemoveGestureDetector().

Integration::GestureManager& Dali::Internal::PinchGestureProcessor::mGestureManager
private

Definition at line 125 of file pinch-gesture-processor.h.

Referenced by AddGestureDetector(), and RemoveGestureDetector().

Stage& Dali::Internal::PinchGestureProcessor::mStage
private

Definition at line 124 of file pinch-gesture-processor.h.

Referenced by Process().


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