Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00031 #ifndef GLVIEWER_COORDSYSTEM_H
00032 #define GLVIEWER_COORDSYSTEM_H
00033
00034 #include "GLViewer.h"
00035
00036 #ifdef WIN32
00037 #pragma warning( disable:4251 )
00038 #endif
00039
00044 class GLVIEWER_API GLViewer_CoordSystem
00045 {
00046 public:
00048 enum CSType
00049 {
00050 Cartesian,
00051 Polar
00052 };
00053
00054 private:
00056 double myX0, myY0;
00058 double myXUnit, myYUnit;
00060 double myRotation;
00061
00063 CSType myType;
00064
00065 public:
00067 GLViewer_CoordSystem( CSType aType, double X0 = 0.0, double Y0 = 0.0,
00068 double XUnit = 1.0, double YUnit = 1.0, double Rotation = 0.0 );
00069
00071 void getOrigin( double& x, double& y ) const;
00073 void setOrigin( double x, double y );
00074
00076 void getUnits( double& x, double& y ) const;
00078 void setUnits( double x, double y );
00079
00081 double getRotation() const;
00083 void setRotation( double rotation );
00084
00086 CSType getType() const;
00088 void setType( CSType type );
00089
00091 void transform( GLViewer_CoordSystem& aSystem, double& x, double& y );
00092
00093
00095 virtual void getStretching( GLViewer_CoordSystem& aSystem, double& theX, double& theY );
00096
00097
00098 protected:
00100 virtual void toReference( double& x, double& y );
00102 virtual void fromReference( double& x, double& y );
00103 };
00104
00105 #ifdef WIN32
00106 #pragma warning ( default:4251 )
00107 #endif
00108
00109 #endif