2 * Copyright (c) 2014 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/public-api/events/pan-gesture.h>
22 #include <dali/public-api/common/dali-common.h>
27 PanGesture::PanGesture(Gesture::State state)
28 : Gesture(Gesture::Pan, state),
33 PanGesture::PanGesture( const PanGesture& rhs )
35 velocity( rhs.velocity ),
36 displacement( rhs.displacement ),
37 position( rhs.position ),
38 screenVelocity( rhs.screenVelocity ),
39 screenDisplacement( rhs.screenDisplacement ),
40 screenPosition( rhs.screenPosition ),
41 numberOfTouches( rhs.numberOfTouches )
45 PanGesture& PanGesture::operator=( const PanGesture& rhs )
47 Gesture::operator=(rhs);
48 velocity = rhs.velocity;
49 displacement = rhs.displacement;
50 position = rhs.position;
51 screenVelocity = rhs.screenVelocity;
52 screenDisplacement = rhs.screenDisplacement;
53 screenPosition = rhs.screenPosition;
54 numberOfTouches = rhs.numberOfTouches;
59 PanGesture::~PanGesture()
63 float PanGesture::GetSpeed() const
65 return velocity.Length();
68 float PanGesture::GetDistance() const
70 return displacement.Length();
73 float PanGesture::GetScreenSpeed() const
75 return screenVelocity.Length();
78 float PanGesture::GetScreenDistance() const
80 return screenDisplacement.Length();