Version: 6.3.1
Public Member Functions | Protected Member Functions | Protected Attributes

GLViewer_Grid Class Reference

#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

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::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::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::setGridWidth ( float  w)

Changes grid width

Parameters:
w- new grid width

References myGridWidth, 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::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.

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.

bool GLViewer_Grid::setZoom ( float  zoom)

Sets zoom

Parameters:
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

Parameters:
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
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.

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.

void GLViewer_Grid.setScaleFactor ( int  )
int GLViewer_Grid.getScaleFactor ( )
bool GLViewer_Grid::initList ( ) [protected]

Field Documentation

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]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS