Salome HOME
PAL10125 - by double click on reference original object becomes selected
[modules/gui.git] / src / GLViewer / GLViewer_Grid.h
index 7cdd6bd227f5a3d7167ceea65c61e1f9c9026ea5..4440802d0ef336160e2d1366f16368910a1d5f13 100644 (file)
 #pragma warning( disable:4251 )
 #endif
 
+/*! Class GLViewer_Grid
+  2D rectangular grid for GLViewer
+  Grid is adapt cells for current view
+*/
+
 class GLVIEWER_API GLViewer_Grid 
 {
 public:
+  //! A default constructor
   GLViewer_Grid();
-  GLViewer_Grid( float, float, float, float, float, float, float, float, float, float );
+  //! A constructor
+  /*
+  * \param  width and \param height - width and height of grid 
+  * \param winW and \param winH     - width and height of window 
+  * \param xSize and \param ySize   - steps along x and y direction
+  * \param xPan and \param yPan     - offsets along x and y direction
+  * \param xScale and \param yScal  - scale factors along x and y direction
+  */
+  GLViewer_Grid( GLfloat width, GLfloat height,
+                GLfloat winW, GLfloat winH,
+                GLfloat xSize, GLfloat ySize,
+                GLfloat xPan, GLfloat yPan,
+                GLfloat xScale, GLfloat yScale );
   ~GLViewer_Grid();
 
+  //! Draws grid
   void                   draw();
 
-  void                   setGridColor( GLfloat, GLfloat, GLfloat );
-  void                   setAxisColor( GLfloat, GLfloat, GLfloat );
+  //! Sets color of grid in RGB format
+  void                   setGridColor( GLfloat r, GLfloat g, GLfloat b );
+  //! Sets color of grid axes in RGB format
+  void                   setAxisColor( GLfloat r, GLfloat g, GLfloat b );
   void                   setGridWidth( float );
+  //! Sets Radius of center point( begin coords )
   void                   setCenterRadius( int );
 
-  void                   setSize( float, float );
-  void                   setPan( float, float );
-  bool                   setZoom( float );
-  void                   setResize( float, float, float );
+  //! Sets steps along x and y directions
+  void                   setSize( float xs, float ys );
+  //! Sets offset along x and y direction
+  void                   setPan( float xp, float yp );
+  //! Sets common scale factor along x and y direction
+  bool                   setZoom( float zoom );
+  //! Recomputes grid in new size and scale of view
+  void                   setResize( float winW, float winH, float Zoom );
 
   void                   getSize( float&, float& ) const;
   void                   getPan( float&, float& ) const;
   void                   getScale( float&, float& ) const;
 
+  //! Sets step of scale
   void                   setScaleFactor( int );
   int                    getScaleFactor();
 
 protected:
+  //! Initialize grid display list
   bool                   initList();
 
   GLuint                 myGridList;