2 * Copyright (c) 2015 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()
28 : Gesture(Gesture::Pan, Gesture::Clear),
33 PanGesture::PanGesture(Gesture::State state)
34 : Gesture(Gesture::Pan, state),
39 PanGesture::PanGesture( const PanGesture& rhs )
41 velocity( rhs.velocity ),
42 displacement( rhs.displacement ),
43 position( rhs.position ),
44 screenVelocity( rhs.screenVelocity ),
45 screenDisplacement( rhs.screenDisplacement ),
46 screenPosition( rhs.screenPosition ),
47 numberOfTouches( rhs.numberOfTouches )
51 PanGesture& PanGesture::operator=( const PanGesture& rhs )
53 Gesture::operator=(rhs);
54 velocity = rhs.velocity;
55 displacement = rhs.displacement;
56 position = rhs.position;
57 screenVelocity = rhs.screenVelocity;
58 screenDisplacement = rhs.screenDisplacement;
59 screenPosition = rhs.screenPosition;
60 numberOfTouches = rhs.numberOfTouches;
65 PanGesture::~PanGesture()
69 float PanGesture::GetSpeed() const
71 return velocity.Length();
74 float PanGesture::GetDistance() const
76 return displacement.Length();
79 float PanGesture::GetScreenSpeed() const
81 return screenVelocity.Length();
84 float PanGesture::GetScreenDistance() const
86 return screenDisplacement.Length();