1 // File: GLViewer_Grid.h
2 // Created: November, 2004
4 // Copyright (C) CEA 2004
6 #ifndef GLVIEWER_GRID_H
7 #define GLVIEWER_GRID_H
19 #pragma warning( disable:4251 )
22 /*! Class GLViewer_Grid
23 2D rectangular grid for GLViewer
24 Grid is adapt cells for current view
27 class GLVIEWER_API GLViewer_Grid
30 //! A default constructor
34 * \param width and \param height - width and height of grid
35 * \param winW and \param winH - width and height of window
36 * \param xSize and \param ySize - steps along x and y direction
37 * \param xPan and \param yPan - offsets along x and y direction
38 * \param xScale and \param yScal - scale factors along x and y direction
40 GLViewer_Grid( GLfloat width, GLfloat height,
41 GLfloat winW, GLfloat winH,
42 GLfloat xSize, GLfloat ySize,
43 GLfloat xPan, GLfloat yPan,
44 GLfloat xScale, GLfloat yScale );
50 //! Sets color of grid in RGB format
51 void setGridColor( GLfloat r, GLfloat g, GLfloat b );
52 //! Sets color of grid axes in RGB format
53 void setAxisColor( GLfloat r, GLfloat g, GLfloat b );
54 void setGridWidth( float );
55 //! Sets Radius of center point( begin coords )
56 void setCenterRadius( int );
58 //! Sets steps along x and y directions
59 void setSize( float xs, float ys );
60 //! Sets offset along x and y direction
61 void setPan( float xp, float yp );
62 //! Sets common scale factor along x and y direction
63 bool setZoom( float zoom );
64 //! Recomputes grid in new size and scale of view
65 void setResize( float winW, float winH, float Zoom );
67 void getSize( float&, float& ) const;
68 void getPan( float&, float& ) const;
69 void getScale( float&, float& ) const;
71 //! Sets step of scale
72 void setScaleFactor( int );
76 //! Initialize grid display list
80 GLfloat myGridColor[3];
81 GLfloat myAxisColor[3];
93 GLfloat myCenterWidth;
100 #pragma warning ( default:4251 )