GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_userinput.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
22 
24 
25 #ifndef GLC_USERINPUT_H_
26 #define GLC_USERINPUT_H_
27 
28 #include "../maths/glc_vector2d.h"
29 
30 #include "../glc_config.h"
31 
33 {
34 public:
35  GLC_UserInput(int x= 0, int y= 0);
36  virtual ~GLC_UserInput();
37 
38 
40 
42 
43 public:
45  inline int x() const
46  {return m_X;}
47 
49  inline int y() const
50  {return m_Y;}
51 
53  inline double normalyzeXTouchCenter() const
54  {return m_NormalyzeX;}
55 
57  inline double normalyzeYTouchCenter() const
58  {return m_NormalyzeX;}
59 
61  inline GLC_Vector2d translation() const
62  {return m_Translation;}
63 
65  inline double rotationAngle() const
66  {return m_Rotation;}
67 
69  inline double scaleFactor() const
70  {return m_ScaleFactor;}
71 
73  inline bool transformationIsSet() const
74  {return m_TransformationIsSet;}
76 
78 
80 
81 public:
83  void setPosition(int x, int y);
84 
86  void setNormalyzeTouchCenterPosition(double x, double y);
87 
89  void setTransformation(const GLC_Vector2d& translation, double rotation= 0.0, double scaleFactor= 1.0);
90 
92  inline void setTranslation(const GLC_Vector2d& translation)
93  {m_Translation= translation;}
94 
96  inline void setRotation(double rotation)
97  {m_Rotation= rotation;}
98 
100  inline void setScaleFactor(double scaleFactor)
101  {m_ScaleFactor= scaleFactor;}
103 
105 // Private Members
107 private:
109  int m_X;
110 
112  int m_Y;
113 
114  //Normalize position of center of touchs
115  double m_NormalyzeX;
116  double m_NormalyzeY;
117 
118  // Transformation data
121 
123  double m_Rotation;
124 
127 
130 
131 };
132 
133 #endif /* GLC_USERINPUT_H_ */

©2005-2013 Laurent Ribon