Grip-Reloaded
Grip version visualizaiton interface for DART (DynamicAnimationandRoboticsToolkits)
|
Class for creating an OpenSceneGraph osg::Geomtry grid of user-specified width, depth and grid square size. More...
#include <Grid.h>
Public Member Functions | |
Grid (uint width, uint depth, uint gridSize, const osg::Vec4 &color) | |
Constructor for Grid class. | |
~Grid () | |
Destructor for Grid classs. | |
void | setGridColor (const osg::Vec4 &color) |
Protected Member Functions | |
void | _createVertices (uint width, uint depth, uint gridSize) |
Creates vertices around the perimeter of the grid according to the width, depth and grid size specified by the user. | |
void | _drawGrid (const osg::Vec4 &color) |
Draw the lines in between the previously created vertices. | |
uint | _makeEven (uint num) |
Makes input number even if odd and does nothing if number is even. It modifies the input number by reference. | |
Protected Attributes | |
osg::ref_ptr< osg::Vec3Array > | _verts |
Array of vertices corresponding to grid line endpoints. | |
osg::ref_ptr< osg::Vec4Array > | _colors |
Array of colors corresponding to grid line colors. | |
Static Protected Attributes | |
static const uint | maxLength = 500 |
Maximum grid perimeter side length. |
Class for creating an OpenSceneGraph osg::Geomtry grid of user-specified width, depth and grid square size.
Grid::Grid | ( | uint | width, |
uint | depth, | ||
uint | gridSize, | ||
const osg::Vec4 & | color | ||
) |
Constructor for Grid class.
width | Width of the grid. |
depth | Depth of the grid. |
gridSize | Length of a side of each grid square. |
color | Color of the grid lines |
void Grid::_createVertices | ( | uint | width, |
uint | depth, | ||
uint | gridSize | ||
) | [protected] |
Creates vertices around the perimeter of the grid according to the width, depth and grid size specified by the user.
width | Width of the grid. |
depth | Depth of the grid. |
gridSize | Length of a side of each grid square. |
void Grid::_drawGrid | ( | const osg::Vec4 & | color | ) | [protected] |
Draw the lines in between the previously created vertices.
uint Grid::_makeEven | ( | uint | num | ) | [protected] |
Makes input number even if odd and does nothing if number is even. It modifies the input number by reference.
num | Integer to make even. |