Fix various reported SVACE errors
[platform/core/uifw/dali-core.git] / dali / public-api / events / pan-gesture.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/events/pan-gesture.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23
24 namespace Dali
25 {
26
27 PanGesture::PanGesture()
28 : Gesture(Gesture::Pan, Gesture::Clear),
29   numberOfTouches(1)
30 {
31 }
32
33 PanGesture::PanGesture(Gesture::State state)
34 : Gesture(Gesture::Pan, state),
35   numberOfTouches(1)
36 {
37 }
38
39 PanGesture::PanGesture( const PanGesture& rhs )
40 : Gesture( 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 )
48 {
49 }
50
51 PanGesture& PanGesture::operator=( const PanGesture& rhs )
52 {
53   if( this != &rhs )
54   {
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;
63   }
64
65   return *this;
66 }
67
68 PanGesture::~PanGesture()
69 {
70 }
71
72 float PanGesture::GetSpeed() const
73 {
74   return velocity.Length();
75 }
76
77 float PanGesture::GetDistance() const
78 {
79   return displacement.Length();
80 }
81
82 float PanGesture::GetScreenSpeed() const
83 {
84   return screenVelocity.Length();
85 }
86
87 float PanGesture::GetScreenDistance() const
88 {
89   return screenDisplacement.Length();
90 }
91
92 } // namespace Dali