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

Base class for the different Gesture Processors. More...

#include <gesture-processor.h>

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

Protected Member Functions

 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...
 
- Protected Member Functions inherited from Dali::Internal::Object::Observer
virtual ~Observer ()
 Virtual destructor. More...
 

Private Member Functions

virtual void OnGesturedActorStageDisconnection ()=0
 Called when the gestured actor is removed from the stage. More...
 
virtual bool CheckGestureDetector (GestureDetector *detector, Actor *actor)=0
 Called by the ProcessAndEmit() & GetGesturedActor() methods to check if the provided gesture-detector meets the parameters of the current gesture. More...
 
virtual void EmitGestureSignal (Actor *actor, const GestureDetectorContainer &gestureDetectors, Vector2 actorCoordinates)=0
 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...
 
 GestureProcessor (const GestureProcessor &)
 
GestureProcessoroperator= (const GestureProcessor &)
 
virtual void SceneObjectAdded (Object &object)
 This will never get called as we do not observe objects that have not been added to the scene. More...
 
virtual void SceneObjectRemoved (Object &object)
 This will be called when the actor is removed from the stage, we should clear and stop observing it. More...
 
virtual void ObjectDestroyed (Object &object)
 This will be called when the actor is destroyed. More...
 

Private Attributes

Gesture::Type mType
 Type of GestureProcessor. More...
 
ActormCurrentGesturedActor
 The current actor that has been gestured. More...
 
bool mGesturedActorDisconnected:1
 Indicates whether the gestured actor has been disconnected from the scene. More...
 

Detailed Description

Base class for the different Gesture Processors.

Definition at line 37 of file gesture-processor.h.

Constructor & Destructor Documentation

Dali::Internal::GestureProcessor::GestureProcessor ( Gesture::Type  type)
protected

Protected constructor.

Cannot create an instance of GestureProcessor

Definition at line 71 of file gesture-processor.cpp.

Dali::Internal::GestureProcessor::~GestureProcessor ( )
protectedvirtual

Virtual protected destructor.

Definition at line 78 of file gesture-processor.cpp.

References ResetActor().

Here is the call graph for this function:

Dali::Internal::GestureProcessor::GestureProcessor ( const GestureProcessor )
private

Member Function Documentation

virtual bool Dali::Internal::GestureProcessor::CheckGestureDetector ( GestureDetector detector,
Actor actor 
)
privatepure virtual

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.

Implemented in Dali::Internal::PanGestureProcessor, Dali::Internal::TapGestureProcessor, Dali::Internal::LongPressGestureProcessor, and Dali::Internal::PinchGestureProcessor.

Referenced by GetGesturedActor().

Here is the caller graph for this function:

virtual void Dali::Internal::GestureProcessor::EmitGestureSignal ( Actor actor,
const GestureDetectorContainer gestureDetectors,
Vector2  actorCoordinates 
)
privatepure virtual

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.

Implemented in Dali::Internal::PanGestureProcessor, Dali::Internal::TapGestureProcessor, Dali::Internal::LongPressGestureProcessor, and Dali::Internal::PinchGestureProcessor.

Referenced by ProcessAndEmit().

Here is the caller graph for this function:

Actor * Dali::Internal::GestureProcessor::GetCurrentGesturedActor ( )
protected

Returns the current gestured actor if it is on stage.

Returns
The current gestured actor

Definition at line 205 of file gesture-processor.cpp.

References mCurrentGesturedActor, and mGesturedActorDisconnected.

Referenced by Dali::Internal::LongPressGestureProcessor::Process(), Dali::Internal::TapGestureProcessor::Process(), Dali::Internal::PinchGestureProcessor::Process(), and Dali::Internal::PanGestureProcessor::Process().

Here is the caller graph for this function:

void Dali::Internal::GestureProcessor::GetGesturedActor ( Actor *&  actor,
GestureDetectorContainer gestureDetectors 
)
protected

Given the hit actor, this walks up the actor tree to determine the actor that is connected to one (or several) gesture detectors.

Parameters
[in,out]actorThe gestured actor. When this function returns, this is the actor that has been hit by the gesture.
[out]gestureDetectorsA container containing all the gesture detectors that have the hit actor attached and satisfy the functor parameters.
Note
Uses CheckGestureDetector() to check if a the current gesture matches the criteria the gesture detector requires.
Precondition
gestureDetectors should be empty.

Definition at line 83 of file gesture-processor.cpp.

References CheckGestureDetector(), Dali::Internal::Actor::GetGestureData(), Dali::Internal::ActorGestureData::GetGestureDetectorContainer(), Dali::Internal::Actor::GetParent(), Dali::Internal::Actor::IsGestureRequred(), and mType.

Referenced by ProcessAndEmit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::GestureProcessor::HitTest ( Stage stage,
Vector2  screenCoordinates,
HitTestAlgorithm::Results hitTestResults 
)
protectedvirtual

Hit test the screen coordinates, and place the results in hitTestResults.

Parameters
[in]stageStage.
[in]screenCoordinatesThe screen coordinates to test.
[out]hitTestResultsStructure to write results into.
Returns
false if the system overlay was hit or no actor was hit.

Definition at line 173 of file gesture-processor.cpp.

References Dali::Internal::HitTestAlgorithm::Results::actor, Dali::Internal::HitTestAlgorithm::HitTest(), mType, and Dali::Internal::HitTestAlgorithm::Results::renderTask.

Referenced by Dali::Internal::LongPressGestureProcessor::Process(), Dali::Internal::TapGestureProcessor::Process(), Dali::Internal::PinchGestureProcessor::Process(), and Dali::Internal::PanGestureProcessor::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::GestureProcessor::ObjectDestroyed ( Object object)
privatevirtual

This will be called when the actor is destroyed.

We should clear the actor. No need to stop observing as the object is being destroyed anyway.

See Also
Object::Observer::ObjectDestroyed()

Implements Dali::Internal::Object::Observer.

Definition at line 223 of file gesture-processor.cpp.

References mCurrentGesturedActor, and OnGesturedActorStageDisconnection().

Here is the call graph for this function:

virtual void Dali::Internal::GestureProcessor::OnGesturedActorStageDisconnection ( )
privatepure virtual

Called when the gestured actor is removed from the stage.

Implemented in Dali::Internal::PanGestureProcessor, Dali::Internal::TapGestureProcessor, Dali::Internal::LongPressGestureProcessor, and Dali::Internal::PinchGestureProcessor.

Referenced by ObjectDestroyed(), and SceneObjectRemoved().

Here is the caller graph for this function:

GestureProcessor& Dali::Internal::GestureProcessor::operator= ( const GestureProcessor )
private
void Dali::Internal::GestureProcessor::ProcessAndEmit ( HitTestAlgorithm::Results hitTestResults)
protected

Calls the emission method in the deriving class for matching gesture-detectors with the hit-actor (or one of its parents).

Parameters
[in]hitTestResultsThe Hit Test Results.
Note
Uses the CheckGestureDetector() to check if the gesture matches the criteria of the given gesture detector and EmitGestureSignal() to emit the signal.
Precondition
Hit Testing should already be done.

Definition at line 116 of file gesture-processor.cpp.

References Dali::Internal::HitTestAlgorithm::Results::actor, Dali::Internal::HitTestAlgorithm::Results::actorCoordinates, EmitGestureSignal(), Dali::Internal::Actor::GetCurrentSize(), GetGesturedActor(), Dali::GetImplementation(), Dali::Internal::Actor::GetParent(), Dali::Internal::Actor::IsHittable(), Dali::Internal::Actor::RayActorTest(), Dali::Internal::HitTestAlgorithm::Results::rayDirection, Dali::Internal::HitTestAlgorithm::Results::rayOrigin, Dali::Internal::Actor::RaySphereTest(), Dali::Vector4::x, and Dali::Vector4::y.

Referenced by Dali::Internal::LongPressGestureProcessor::Process(), Dali::Internal::TapGestureProcessor::Process(), Dali::Internal::PinchGestureProcessor::Process(), and Dali::Internal::PanGestureProcessor::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::GestureProcessor::ResetActor ( )
protected
virtual void Dali::Internal::GestureProcessor::SceneObjectAdded ( Object object)
inlineprivatevirtual

This will never get called as we do not observe objects that have not been added to the scene.

Parameters
[in]objectThe object object.
See Also
Object::Observer::SceneObjectAdded()

Implements Dali::Internal::Object::Observer.

Definition at line 147 of file gesture-processor.h.

void Dali::Internal::GestureProcessor::SceneObjectRemoved ( Object object)
privatevirtual

This will be called when the actor is removed from the stage, we should clear and stop observing it.

Parameters
[in]objectThe object object.
See Also
Object::Observer::SceneObjectRemoved()

Implements Dali::Internal::Object::Observer.

Definition at line 210 of file gesture-processor.cpp.

References mCurrentGesturedActor, mGesturedActorDisconnected, and OnGesturedActorStageDisconnection().

Here is the call graph for this function:

void Dali::Internal::GestureProcessor::SetActor ( Actor actor)
protected

Member Data Documentation

Actor* Dali::Internal::GestureProcessor::mCurrentGesturedActor
private

The current actor that has been gestured.

Definition at line 167 of file gesture-processor.h.

Referenced by GetCurrentGesturedActor(), ObjectDestroyed(), ResetActor(), SceneObjectRemoved(), and SetActor().

bool Dali::Internal::GestureProcessor::mGesturedActorDisconnected
private

Indicates whether the gestured actor has been disconnected from the scene.

Definition at line 168 of file gesture-processor.h.

Referenced by GetCurrentGesturedActor(), ResetActor(), SceneObjectRemoved(), and SetActor().

Gesture::Type Dali::Internal::GestureProcessor::mType
private

Type of GestureProcessor.

Definition at line 166 of file gesture-processor.h.

Referenced by GetGesturedActor(), and HitTest().


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