Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Menge::SceneGraph::GLGroundPlane Class Reference

A ground plane approximation – z = 0, in world space. More...

#include <GLGroundPlane.h>

Inheritance diagram for Menge::SceneGraph::GLGroundPlane:
Menge::SceneGraph::GLNode

Public Member Functions

 GLGroundPlane (float width, float height, float majorDist, int minorCount)
 Constructor. More...
 
 ~GLGroundPlane (void)
 Destructor.
 
void newContext ()
 Updates the OpenGL constructs for the grid when the context changes.
 
float getWidth () const
 Report the width of the ground plane (extent along world x-axis). More...
 
void setWidth (float w)
 Sets the width (the extent along the world's x-axis) of the plane. More...
 
float getHeight () const
 Report the height of the ground plane (extent along world y-axis). More...
 
void setHeight (float h)
 Sets the height (the extent along the world's y-axis) of the plane. More...
 
float getMajorDistance () const
 Report the distance between major lines. More...
 
void setMajorDistance (float dist)
 Sets the distance between major lines. More...
 
int getMinorCount () const
 Report the number of minor lines between major lines. More...
 
void setMinorCount (int count)
 Sets the number of minor lines between major lines. More...
 
void setLineColor (float r, float g, float b)
 Set the main color for the ground's lines. More...
 
void drawGL (bool select=false)
 Causes the plane to be drawn into the current OpenGL context. More...
 
- Public Member Functions inherited from Menge::SceneGraph::GLNode
 GLNode (GLDagNode *parent=0x0)
 Constructor. More...
 
virtual ~GLNode ()
 Virtual destructor.
 
void setVisible (bool state)
 Sets the visible state of the node. More...
 
GLDagNodegetParent ()
 Returns a pointer to the node's parent (possibly NULL). More...
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::SceneGraph::GLNode
void setParent (GLDagNode *p)
 Assigns this node to a parent GLDagNode. More...
 
- Protected Attributes inherited from Menge::SceneGraph::GLNode
GLDagNode_parent
 The GLDagNode that serves as this node's parent.
 
bool _visible
 The visibility state of this node. If visible (true) the node and its children will be drawn into the scene, if invisible (false) it will not be drawn.
 

Detailed Description

A ground plane approximation – z = 0, in world space.

The ground plane is a rectangular piece, centered on the origin, with user-specified finite extent. It is rendered as a grid of lines with a heavy center line, medium major lines, and light minor lines.

Constructor & Destructor Documentation

Menge::SceneGraph::GLGroundPlane::GLGroundPlane ( float  width,
float  height,
float  majorDist,
int  minorCount 
)

Constructor.

Parameters
widthThe extent of the plane along the world's x-axis.
heightThe extent of the plane along the world's y-axis.
majorDistThe distance between major axis lines.
minorCountThe number of minor lines between major axis lines.

Member Function Documentation

void Menge::SceneGraph::GLGroundPlane::drawGL ( bool  select = false)
virtual

Causes the plane to be drawn into the current OpenGL context.

Parameters
selectIndicates if it is being drawn for selection purposes (true) or visualization (false).

Implements Menge::SceneGraph::GLNode.

float Menge::SceneGraph::GLGroundPlane::getHeight ( ) const
inline

Report the height of the ground plane (extent along world y-axis).

Returns
The plane segment's height.
float Menge::SceneGraph::GLGroundPlane::getMajorDistance ( ) const
inline

Report the distance between major lines.

Returns
The distance between major lines on the plane.
int Menge::SceneGraph::GLGroundPlane::getMinorCount ( ) const
inline

Report the number of minor lines between major lines.

Returns
The number of minor lines between major lines.
float Menge::SceneGraph::GLGroundPlane::getWidth ( ) const
inline

Report the width of the ground plane (extent along world x-axis).

Returns
The plane segment's width.
void Menge::SceneGraph::GLGroundPlane::setHeight ( float  h)

Sets the height (the extent along the world's y-axis) of the plane.

Parameters
hThe height, in world space units, of the plane.
void Menge::SceneGraph::GLGroundPlane::setLineColor ( float  r,
float  g,
float  b 
)

Set the main color for the ground's lines.

Parameters
rThe red component of the color (in the range [0, 1] ).
gThe green component of the color (in the range [0, 1] ).
bThe blue component of the color (in the range [0, 1] ).
void Menge::SceneGraph::GLGroundPlane::setMajorDistance ( float  dist)

Sets the distance between major lines.

Parameters
distThe distance between major lines on the plane.
void Menge::SceneGraph::GLGroundPlane::setMinorCount ( int  count)

Sets the number of minor lines between major lines.

Parameters
countThe number of minor lines between major lines.
void Menge::SceneGraph::GLGroundPlane::setWidth ( float  w)

Sets the width (the extent along the world's x-axis) of the plane.

Parameters
wThe width, in world space units, of the plane.

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