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/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 )
55 Gesture::operator=(rhs);
56 velocity = rhs.velocity;
57 displacement = rhs.displacement;
58 position = rhs.position;
59 screenVelocity = rhs.screenVelocity;
60 screenDisplacement = rhs.screenDisplacement;
61 screenPosition = rhs.screenPosition;
62 numberOfTouches = rhs.numberOfTouches;
68 PanGesture::~PanGesture()
72 float PanGesture::GetSpeed() const
74 return velocity.Length();
77 float PanGesture::GetDistance() const
79 return displacement.Length();
82 float PanGesture::GetScreenSpeed() const
84 return screenVelocity.Length();
87 float PanGesture::GetScreenDistance() const
89 return screenDisplacement.Length();