glc_userinput.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021  *****************************************************************************/
00022 
00024 
00025 #ifndef GLC_USERINPUT_H_
00026 #define GLC_USERINPUT_H_
00027 
00028 #include "../maths/glc_vector2d.h"
00029 
00030 #include "../glc_config.h"
00031 
00032 class GLC_LIB_EXPORT GLC_UserInput
00033 {
00034 public:
00035         GLC_UserInput(int x= 0, int y= 0);
00036         virtual ~GLC_UserInput();
00037 
00038 
00040 
00042 
00043 public:
00045         inline int x() const
00046         {return m_X;}
00047 
00049         inline int y() const
00050         {return m_Y;}
00051 
00053         inline double normalyzeXTouchCenter() const
00054         {return m_NormalyzeX;}
00055 
00057         inline double normalyzeYTouchCenter() const
00058         {return m_NormalyzeX;}
00059 
00061         inline GLC_Vector2d translation() const
00062         {return m_Translation;}
00063 
00065         inline double rotationAngle() const
00066         {return m_Rotation;}
00067 
00069         inline double scaleFactor() const
00070         {return m_ScaleFactor;}
00071 
00073         inline bool transformationIsSet() const
00074         {return m_TransformationIsSet;}
00076 
00078 
00080 
00081 public:
00083         void setPosition(int x, int y);
00084 
00086         void setNormalyzeTouchCenterPosition(double x, double y);
00087 
00089         void setTransformation(const GLC_Vector2d& translation, double rotation= 0.0, double scaleFactor= 1.0);
00090 
00092         inline void setTranslation(const GLC_Vector2d& translation)
00093         {m_Translation= translation;}
00094 
00096         inline void setRotation(double rotation)
00097         {m_Rotation= rotation;}
00098 
00100         inline void setScaleFactor(double scaleFactor)
00101         {m_ScaleFactor= scaleFactor;}
00103 
00105 // Private Members
00107 private:
00109         int m_X;
00110 
00112         int m_Y;
00113 
00114         //Normalize position of center of touchs
00115         double m_NormalyzeX;
00116         double m_NormalyzeY;
00117 
00118         // Transformation data
00120         GLC_Vector2d m_Translation;
00121 
00123         double m_Rotation;
00124 
00126         double m_ScaleFactor;
00127 
00129         bool m_TransformationIsSet;
00130 
00131 };
00132 
00133 #endif /* GLC_USERINPUT_H_ */

SourceForge.net Logo

©2005-2011 Laurent Ribon