#include <GLViewer_Grid.h>
Public Member Functions | |
| GLViewer_Grid () | |
| A default constructor. | |
| GLViewer_Grid (GLfloat width, GLfloat height, GLfloat winW, GLfloat winH, GLfloat xSize, GLfloat ySize, GLfloat xPan, GLfloat yPan, GLfloat xScale, GLfloat yScale) | |
| A constructor. | |
| ~GLViewer_Grid () | |
| void | draw () |
| Draws grid. | |
| void | setGridColor (GLfloat r, GLfloat g, GLfloat b) |
| Sets color of grid in RGB format. | |
| void | setAxisColor (GLfloat r, GLfloat g, GLfloat b) |
| Sets color of grid axes in RGB format. | |
| void | setGridWidth (float) |
| void | setCenterRadius (int) |
| Sets Radius of center point( begin coords ) | |
| void | setSize (float xs, float ys) |
| Sets steps along x and y directions. | |
| void | setPan (float xp, float yp) |
| Sets offset along x and y direction. | |
| bool | setZoom (float zoom) |
| Sets common scale factor along x and y direction. | |
| void | setResize (float winW, float winH, float Zoom) |
| Recomputes grid in new size and scale of view. | |
| void | getSize (float &, float &) const |
| void | getPan (float &, float &) const |
| void | getScale (float &, float &) const |
| void | setScaleFactor (int) |
| Sets step of scale. | |
| int | getScaleFactor () |
Protected Member Functions | |
| bool | initList () |
| Initialize grid display list. | |
Protected Attributes | |
| GLuint | myGridList |
| GLfloat | myGridColor [3] |
| GLfloat | myAxisColor [3] |
| GLfloat | myGridHeight |
| GLfloat | myGridWidth |
| GLfloat | myWinW |
| GLfloat | myWinH |
| GLfloat | myXSize |
| GLfloat | myYSize |
| GLfloat | myXPan |
| GLfloat | myYPan |
| GLfloat | myXScale |
| GLfloat | myYScale |
| GLfloat | myLineWidth |
| GLfloat | myCenterWidth |
| GLint | myCenterRadius |
| GLint | myScaleFactor |
| GLboolean | myIsUpdate |
Class GLViewer_Grid 2D rectangular grid for GLViewer Grid is adapt cells for current view
| GLViewer_Grid::GLViewer_Grid | ( | ) |
Default constructor
References myAxisColor, and myGridColor.
| GLViewer_Grid::GLViewer_Grid | ( | GLfloat | width, |
| GLfloat | height, | ||
| GLfloat | winW, | ||
| GLfloat | winH, | ||
| GLfloat | xSize, | ||
| GLfloat | ySize, | ||
| GLfloat | xPan, | ||
| GLfloat | yPan, | ||
| GLfloat | xScale, | ||
| GLfloat | yScale | ||
| ) |
Constructor
| width | and |
| height | - width and height of grid |
| winW | and |
| winH | - width and height of window |
| xSize | and |
| ySize | - steps along x and y direction |
| xPan | and |
| yPan | - offsets along x and y direction |
| xScale | and |
| yScal | - scale factors along x and y direction |
References myAxisColor, and myGridColor.
| GLViewer_Grid::~GLViewer_Grid | ( | ) |
Destructor
| void GLViewer_Grid::draw | ( | ) |
Performs OpenGL drawing
References initList(), myGridList, and myIsUpdate.
| void GLViewer_Grid::setGridColor | ( | GLfloat | r, |
| GLfloat | g, | ||
| GLfloat | b | ||
| ) |
Changes color of grid
| r,g,b | - components of color |
References myGridColor, and myIsUpdate.
| void GLViewer_Grid::setAxisColor | ( | GLfloat | r, |
| GLfloat | g, | ||
| GLfloat | b | ||
| ) |
Changes color of axis
| r,g,b | - components of color |
References myAxisColor, and myIsUpdate.
| void GLViewer_Grid::setGridWidth | ( | float | w | ) |
| void GLViewer_Grid::setCenterRadius | ( | int | r | ) |
Sets Radius of center point( begin coords )
| r | - new radius |
References myCenterRadius, and myIsUpdate.
| void GLViewer_Grid::setSize | ( | float | xSize, |
| float | ySize | ||
| ) |
Sets grid size along X and Y axis
| xSize | - size along X axis |
| ySize | - size along Y axis |
References myIsUpdate, myXSize, and myYSize.
| void GLViewer_Grid::setPan | ( | float | xPan, |
| float | yPan | ||
| ) |
Sets panning of grid
| xPan | - panning along X axis |
| yPan | - panning along Y axis |
References myIsUpdate, myXPan, and myYPan.
| bool GLViewer_Grid::setZoom | ( | float | zoom | ) |
Sets zoom
| zoom | - new coefficient of zooming |
References myGridHeight, myGridWidth, myIsUpdate, myXScale, and myYScale.
| void GLViewer_Grid::setResize | ( | float | WinW, |
| float | WinH, | ||
| float | zoom | ||
| ) |
Sets parameters of grid by zoom coefficient and window size
| WinW | - window width |
| WinH | - window height |
| zoom | - zoom coefficient |
References myGridHeight, myGridWidth, myIsUpdate, myWinH, myWinW, myXScale, myYScale, and setZoom().
| void GLViewer_Grid::getSize | ( | float & | xSize, |
| float & | ySize | ||
| ) | const |
| void GLViewer_Grid::getPan | ( | float & | xPan, |
| float & | yPan | ||
| ) | const |
| void GLViewer_Grid::getScale | ( | float & | xScale, |
| float & | yScale | ||
| ) | const |
| void GLViewer_Grid.setScaleFactor | ( | int | ) |
| int GLViewer_Grid.getScaleFactor | ( | ) |
| bool GLViewer_Grid::initList | ( | ) | [protected] |
Initialize grid display list
References test_big_table.k, myAxisColor, myCenterRadius, myCenterWidth, myGridColor, myGridHeight, myGridList, myGridWidth, myIsUpdate, myLineWidth, myScaleFactor, myXPan, myXScale, myXSize, myYPan, myYScale, myYSize, SEGMENTS, and STEP.
GLuint GLViewer_Grid.myGridList [protected] |
GLfloat GLViewer_Grid.myGridColor[3] [protected] |
GLfloat GLViewer_Grid.myAxisColor[3] [protected] |
GLfloat GLViewer_Grid.myGridHeight [protected] |
GLfloat GLViewer_Grid.myGridWidth [protected] |
GLfloat GLViewer_Grid.myWinW [protected] |
GLfloat GLViewer_Grid.myWinH [protected] |
GLfloat GLViewer_Grid.myXSize [protected] |
GLfloat GLViewer_Grid.myYSize [protected] |
GLfloat GLViewer_Grid.myXPan [protected] |
GLfloat GLViewer_Grid.myYPan [protected] |
GLfloat GLViewer_Grid.myXScale [protected] |
GLfloat GLViewer_Grid.myYScale [protected] |
GLfloat GLViewer_Grid.myLineWidth [protected] |
GLfloat GLViewer_Grid.myCenterWidth [protected] |
GLint GLViewer_Grid.myCenterRadius [protected] |
GLint GLViewer_Grid.myScaleFactor [protected] |
GLboolean GLViewer_Grid.myIsUpdate [protected] |