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
00027 #ifndef GLVIEWER_GRID_H
00028 #define GLVIEWER_GRID_H
00029
00030 #ifdef WIN32
00031 #include "windows.h"
00032 #endif
00033
00034 #include "GLViewer.h"
00035
00036 #include <GL/gl.h>
00037 #include <GL/glu.h>
00038
00039 #ifdef WIN32
00040 #pragma warning( disable:4251 )
00041 #endif
00042
00048 class GLVIEWER_API GLViewer_Grid
00049 {
00050 public:
00052 GLViewer_Grid();
00054
00055
00056
00057
00058
00059
00060
00061 GLViewer_Grid( GLfloat width, GLfloat height,
00062 GLfloat winW, GLfloat winH,
00063 GLfloat xSize, GLfloat ySize,
00064 GLfloat xPan, GLfloat yPan,
00065 GLfloat xScale, GLfloat yScale );
00066 ~GLViewer_Grid();
00067
00069 void draw();
00070
00072 void setGridColor( GLfloat r, GLfloat g, GLfloat b );
00074 void setAxisColor( GLfloat r, GLfloat g, GLfloat b );
00075 void setGridWidth( float );
00077 void setCenterRadius( int );
00078
00080 void setSize( float xs, float ys );
00082 void setPan( float xp, float yp );
00084 bool setZoom( float zoom );
00086 void setResize( float winW, float winH, float Zoom );
00087
00088 void getSize( float&, float& ) const;
00089 void getPan( float&, float& ) const;
00090 void getScale( float&, float& ) const;
00091
00093 void setScaleFactor( int );
00094 int getScaleFactor();
00095
00096 protected:
00098 bool initList();
00099
00100 GLuint myGridList;
00101 GLfloat myGridColor[3];
00102 GLfloat myAxisColor[3];
00103 GLfloat myGridHeight;
00104 GLfloat myGridWidth;
00105 GLfloat myWinW;
00106 GLfloat myWinH;
00107 GLfloat myXSize;
00108 GLfloat myYSize;
00109 GLfloat myXPan;
00110 GLfloat myYPan;
00111 GLfloat myXScale;
00112 GLfloat myYScale;
00113 GLfloat myLineWidth;
00114 GLfloat myCenterWidth;
00115 GLint myCenterRadius;
00116 GLint myScaleFactor;
00117 GLboolean myIsUpdate;
00118 };
00119
00120 #ifdef WIN32
00121 #pragma warning ( default:4251 )
00122 #endif
00123
00124 #endif