2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/integration-api/events/point.h>
28 : mTouchPoint( 0, TouchPoint::Started, 0.0f, 0.0f ),
36 Point::Point( const TouchPoint& touchPoint )
37 : mTouchPoint( touchPoint ),
49 void Point::SetDeviceId( int deviceId )
51 mTouchPoint.deviceId = deviceId;
54 void Point::SetState( PointState::Type state )
56 mTouchPoint.state = static_cast< TouchPoint::State >( state );
59 void Point::SetScreenPosition( const Vector2& screenPosition )
61 mTouchPoint.screen = screenPosition;
64 void Point::SetRadius( float radius )
66 mRadius = mEllipseRadius.x = mEllipseRadius.y = radius;
69 void Point::SetRadius( float radius, Vector2 ellipseRadius )
72 mEllipseRadius = ellipseRadius;
75 void Point::SetPressure( float pressure )
80 void Point::SetAngle( Degree angle )
85 int Point::GetDeviceId() const
87 return mTouchPoint.deviceId;
90 PointState::Type Point::GetState() const
92 return static_cast< PointState::Type >( mTouchPoint.state );
95 const Vector2& Point::GetScreenPosition() const
97 return mTouchPoint.screen;
100 float Point::GetRadius() const
105 const Vector2& Point::GetEllipseRadius() const
107 return mEllipseRadius;
110 float Point::GetPressure() const
115 Degree Point::GetAngle() const
120 void Point::SetHitActor( Actor hitActor )
122 mTouchPoint.hitActor = hitActor;
125 void Point::SetLocalPosition( const Vector2& localPosition )
127 mTouchPoint.local = localPosition;
130 Actor Point::GetHitActor() const
132 return mTouchPoint.hitActor;
135 const Vector2& Point::GetLocalPosition() const
137 return mTouchPoint.local;
140 const TouchPoint& Point::GetTouchPoint() const
145 } // namespace Integration