Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLViewer_Grid Class Reference

#include <GLViewer_Grid.h>

Public Member Functions

 GLViewer_Grid ()
 A default constructor. More...
 
 GLViewer_Grid (GLfloat width, GLfloat height, GLfloat winW, GLfloat winH, GLfloat xSize, GLfloat ySize, GLfloat xPan, GLfloat yPan, GLfloat xScale, GLfloat yScale)
 A constructor. More...
 
 ~GLViewer_Grid ()
 
void draw ()
 Draws grid. More...
 
void setGridColor (GLfloat r, GLfloat g, GLfloat b)
 Sets color of grid in RGB format. More...
 
void setAxisColor (GLfloat r, GLfloat g, GLfloat b)
 Sets color of grid axes in RGB format. More...
 
void setGridWidth (float)
 
void setCenterRadius (int)
 Sets Radius of center point( begin coords ) More...
 
void setSize (float xs, float ys)
 Sets steps along x and y directions. More...
 
void setPan (float xp, float yp)
 Sets offset along x and y direction. More...
 
bool setZoom (float zoom)
 Sets common scale factor along x and y direction. More...
 
void setResize (float winW, float winH, float Zoom)
 Recomputes grid in new size and scale of view. More...
 
void getSize (float &, float &) const
 
void getPan (float &, float &) const
 
void getScale (float &, float &) const
 
void setScaleFactor (int)
 Sets step of scale. More...
 
int getScaleFactor ()
 

Protected Member Functions

bool initList ()
 Initialize grid display list. More...
 

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
 

Detailed Description

Class GLViewer_Grid 2D rectangular grid for GLViewer Grid is adapt cells for current view

Constructor & Destructor Documentation

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

Parameters
widthand
height- width and height of grid
winWand
winH- width and height of window
xSizeand
ySize- steps along x and y direction
xPanand
yPan- offsets along x and y direction
xScaleand
yScal- scale factors along x and y direction

References myAxisColor, and myGridColor.

GLViewer_Grid::~GLViewer_Grid ( )

Destructor

Member Function Documentation

void GLViewer_Grid::draw ( )

Performs OpenGL drawing

References initList(), myGridList, and myIsUpdate.

void GLViewer_Grid::getPan ( float &  xPan,
float &  yPan 
) const
Returns
panning along x and y axis
Parameters
xPan- for panning along x axis
yPan- for panning along y axis

References myXPan, and myYPan.

void GLViewer_Grid::getScale ( float &  xScale,
float &  yScale 
) const
Returns
scaling along x and y axis
Parameters
xScale- for scaling along x axis
yScale- for scaling along y axis

References myXScale, and myYScale.

int GLViewer_Grid::getScaleFactor ( )
void GLViewer_Grid::getSize ( float &  xSize,
float &  ySize 
) const
Returns
grid size along x and y axis
Parameters
xSize- for size along x axis
ySize- for size along y axis

References myXSize, and myYSize.

bool GLViewer_Grid::initList ( )
protected
void GLViewer_Grid::setAxisColor ( GLfloat  r,
GLfloat  g,
GLfloat  b 
)

Changes color of axis

Parameters
r,g,b- components of color

References myAxisColor, and myIsUpdate.

void GLViewer_Grid::setCenterRadius ( int  r)

Sets Radius of center point( begin coords )

Parameters
r- new radius

References myCenterRadius, and myIsUpdate.

void GLViewer_Grid::setGridColor ( GLfloat  r,
GLfloat  g,
GLfloat  b 
)

Changes color of grid

Parameters
r,g,b- components of color

References myGridColor, and myIsUpdate.

void GLViewer_Grid::setGridWidth ( float  w)

Changes grid width

Parameters
w- new grid width

References myGridWidth, and myIsUpdate.

void GLViewer_Grid::setPan ( float  xPan,
float  yPan 
)

Sets panning of grid

Parameters
xPan- panning along X axis
yPan- panning along Y axis

References myIsUpdate, myXPan, and myYPan.

void GLViewer_Grid::setResize ( float  WinW,
float  WinH,
float  zoom 
)

Sets parameters of grid by zoom coefficient and window size

Parameters
WinW- window width
WinH- window height
zoom- zoom coefficient

References myGridHeight, myGridWidth, myIsUpdate, myWinH, myWinW, myXScale, myYScale, and setZoom().

void GLViewer_Grid::setScaleFactor ( int  )
void GLViewer_Grid::setSize ( float  xSize,
float  ySize 
)

Sets grid size along X and Y axis

Parameters
xSize- size along X axis
ySize- size along Y axis

References myIsUpdate, myXSize, and myYSize.

bool GLViewer_Grid::setZoom ( float  zoom)

Sets zoom

Parameters
zoom- new coefficient of zooming

References myGridHeight, myGridWidth, myIsUpdate, myXScale, and myYScale.

Member Data Documentation

GLfloat GLViewer_Grid::myAxisColor[3]
protected
GLint GLViewer_Grid::myCenterRadius
protected
GLfloat GLViewer_Grid::myCenterWidth
protected
GLfloat GLViewer_Grid::myGridColor[3]
protected
GLfloat GLViewer_Grid::myGridHeight
protected
GLuint GLViewer_Grid::myGridList
protected
GLfloat GLViewer_Grid::myGridWidth
protected
GLboolean GLViewer_Grid::myIsUpdate
protected
GLfloat GLViewer_Grid::myLineWidth
protected
GLint GLViewer_Grid::myScaleFactor
protected
GLfloat GLViewer_Grid::myWinH
protected
GLfloat GLViewer_Grid::myWinW
protected
GLfloat GLViewer_Grid::myXPan
protected
GLfloat GLViewer_Grid::myXScale
protected
GLfloat GLViewer_Grid::myXSize
protected
GLfloat GLViewer_Grid::myYPan
protected
GLfloat GLViewer_Grid::myYScale
protected
GLfloat GLViewer_Grid::myYSize
protected

The documentation for this class was generated from the following files: