Tizen Native API  5.5
Dali::TouchData Class Reference

Touch events are a collection of points at a specific moment in time. More...

Inheritance diagram for Dali::TouchData:
Dali::BaseHandle

Public Member Functions

 TouchData ()
 An uninitialized TouchData instance.
 TouchData (const TouchData &other)
 Copy constructor.
 ~TouchData ()
 Destructor.
TouchDataoperator= (const TouchData &other)
 Assignment Operator.
unsigned long GetTime () const
 Returns the time (in ms) that the touch event occurred.
std::size_t GetPointCount () const
 Returns the total number of points in this TouchData.
int32_t GetDeviceId (std::size_t point) const
 Returns the ID of the device used for the Point specified.
PointState::Type GetState (std::size_t point) const
 Retrieves the State of the point specified.
Actor GetHitActor (std::size_t point) const
 Retrieves the actor that was underneath the point specified.
const Vector2GetLocalPosition (std::size_t point) const
 Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified.
const Vector2GetScreenPosition (std::size_t point) const
 Retrieves the co-ordinates relative to the top-left of the screen of the point specified.
float GetRadius (std::size_t point) const
 Retrieves the radius of the press point.
const Vector2GetEllipseRadius (std::size_t point) const
 Retrieves BOTH the horizontal and the vertical radii of the press point.
float GetPressure (std::size_t point) const
 Retrieves the touch pressure.
Degree GetAngle (std::size_t point) const
 Retrieves the angle of the press point relative to the Y-Axis.
Device::Class::Type GetDeviceClass (std::size_t point) const
 Gets the device class type from which the mouse/touch event is originated.
Device::Subclass::Type GetDeviceSubclass (std::size_t point) const
 Gets the subclass type of the device from which the mouse/touch event is originated.
MouseButton::Type GetMouseButton (std::size_t point) const
 Gets the value, which indicates a mouse button. (ex: right/left button)

Detailed Description

Touch events are a collection of points at a specific moment in time.

When a multi-touch event occurs, each point represents the points that are currently being touched or the points where a touch has stopped.

The first point is the primary point that's used for hit-testing.

Since:
3.0, DALi version 1.1.37
Note:
As this is a handle to an internal object, it should not be copied (or used in a container) as all that will do is copy the handle to the same object. The internal object can change which may not be what an application writer expects. If data does need to be stored in the application, then only the required data should be saved (retrieved using the methods of this class).

Should not use this in a TouchData container as it is just a handle and the internal object can change.


Constructor & Destructor Documentation

An uninitialized TouchData instance.

Calling member functions with an uninitialized TouchData handle is not allowed.

Since:
3.0, DALi version 1.1.37

Copy constructor.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]otherThe TouchData to copy from

Destructor.

Since:
3.0, DALi version 1.1.37

Member Function Documentation

Degree Dali::TouchData::GetAngle ( std::size_t  point) const

Retrieves the angle of the press point relative to the Y-Axis.

Since:
3.0, DALi version 1.1.39
Parameters:
[in]pointThe point required
Returns:
The angle of the press point
Note:
If point is greater than GetPointCount() then this method will return Degree().

Gets the device class type from which the mouse/touch event is originated.

The device class type is classification type of the input device of event received.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]pointThe point required
Returns:
The type of the device class
int32_t Dali::TouchData::GetDeviceId ( std::size_t  point) const

Returns the ID of the device used for the Point specified.

Each point has a unique device ID which specifies the device used for that point. This is returned by this method.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]pointThe point required
Returns:
The Device ID of this point
Note:
If point is greater than GetPointCount() then this method will return -1.

Gets the subclass type of the device from which the mouse/touch event is originated.

The device subclass type is subclassification type of the input device of event received.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]pointThe point required
Returns:
The type of the device subclass
const Vector2& Dali::TouchData::GetEllipseRadius ( std::size_t  point) const

Retrieves BOTH the horizontal and the vertical radii of the press point.

Since:
3.0, DALi version 1.1.39
Parameters:
[in]pointThe point required
Returns:
The horizontal and vertical radii of the press point
Note:
If point is greater than GetPointCount() then this method will return Vector2::ZERO.
Actor Dali::TouchData::GetHitActor ( std::size_t  point) const

Retrieves the actor that was underneath the point specified.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]pointThe point required
Returns:
The actor that was underneath the point specified
Note:
If point is greater than GetPointCount() then this method will return an empty handle.
const Vector2& Dali::TouchData::GetLocalPosition ( std::size_t  point) const

Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]pointThe point required
Returns:
The co-ordinates relative to the top-left of the hit-actor of the point specified
Note:
The top-left of an actor is (0.0, 0.0, 0.5).
If you require the local coordinates of another actor (e.g the parent of the hit actor), then you should use Actor::ScreenToLocal().
If point is greater than GetPointCount() then this method will return Vector2::ZERO.
MouseButton::Type Dali::TouchData::GetMouseButton ( std::size_t  point) const

Gets the value, which indicates a mouse button. (ex: right/left button)

Since:
5.5, DALi version 1.3.31
Parameters:
[in]pointThe point required
Returns:
The mouse button value
std::size_t Dali::TouchData::GetPointCount ( ) const

Returns the total number of points in this TouchData.

Since:
3.0, DALi version 1.1.37
Returns:
Total number of Points
float Dali::TouchData::GetPressure ( std::size_t  point) const

Retrieves the touch pressure.

The pressure range starts at 0.0f. Normal pressure is defined as 1.0f. A value between 0.0f and 1.0f means light pressure has been applied. A value greater than 1.0f means more pressure than normal has been applied.

Since:
3.0, DALi version 1.1.39
Parameters:
[in]pointThe point required
Returns:
The touch pressure
Note:
If point is greater than GetPointCount() then this method will return 1.0f.
float Dali::TouchData::GetRadius ( std::size_t  point) const

Retrieves the radius of the press point.

This is the average of both the horizontal and vertical radii of the press point.

Since:
3.0, DALi version 1.1.39
Parameters:
[in]pointThe point required
Returns:
The radius of the press point
Note:
If point is greater than GetPointCount() then this method will return 0.0f.
const Vector2& Dali::TouchData::GetScreenPosition ( std::size_t  point) const

Retrieves the co-ordinates relative to the top-left of the screen of the point specified.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]pointThe point required
Returns:
The co-ordinates relative to the top-left of the screen of the point specified
Note:
If point is greater than GetPointCount() then this method will return Vector2::ZERO.
PointState::Type Dali::TouchData::GetState ( std::size_t  point) const

Retrieves the State of the point specified.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]pointThe point required
Returns:
The state of the point specified
Note:
If point is greater than GetPointCount() then this method will return PointState::FINISHED.
See also:
State
unsigned long Dali::TouchData::GetTime ( ) const

Returns the time (in ms) that the touch event occurred.

Since:
3.0, DALi version 1.1.37
Returns:
The time (in ms) that the touch event occurred
TouchData& Dali::TouchData::operator= ( const TouchData other)

Assignment Operator.

Since:
3.0, DALi version 1.1.37
Parameters:
[in]otherThe TouchData to copy from
Returns:
A reference to this