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

The basic shape class - a selectable GLNode. More...

#include <shapes.h>

Inheritance diagram for Menge::SceneGraph::Shape:
Menge::SceneGraph::GLNode Menge::SceneGraph::Selectable Menge::SceneGraph::Circle Menge::SceneGraph::Cylinder

Public Member Functions

 Shape ()
 Default constructor.
 
 Shape (float r, float g, float b, GLenum s=GL_FILL)
 Constructor with color and drawing style. More...
 
void setColor (const Vector3 &vec)
 Set the shape color from a vector. More...
 
void setColor (float r, float g, float b)
 Set the shape color from three separate values. More...
 
void setStyle (GLenum style)
 Set the shape's render style. 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...
 
virtual void drawGL (bool select=false)=0
 Causes this node to draw itself to the scene. More...
 
virtual void newContext ()
 Allows the node to recreate any unique OpenGL objects based on the acquisition of a new OpenGL context. More...
 
GLDagNodegetParent ()
 Returns a pointer to the node's parent (possibly NULL). More...
 
- Public Member Functions inherited from Menge::SceneGraph::Selectable
 Selectable ()
 Constructor.
 
void loadSelectName () const
 Performs the OpenGL task to make this object selectable.
 
unsigned int getID () const
 Returns this object's globally unique selection id. More...
 
virtual void dummy ()
 A dummy function that makes Selectable polymorphic. It enables the use of dynamic_cast. Otherwise, it is a no-op.
 

Protected Attributes

float _r
 The red component of the shape's color.
 
float _g
 The green component of the shape's color.
 
float _b
 The blue component of the shape's color.
 
GLenum _style
 The shape's OpenGL rendering style. Should be one of GL_FILL, GL_LINE, or GL_POINT.
 
- 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.
 
- Protected Attributes inherited from Menge::SceneGraph::Selectable
unsigned int _id
 Globally unique OpenGL name for selection.
 
bool _selected
 Reports if this node is selcted. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Menge::SceneGraph::Selectable
static SelectablegetSelectedObject ()
 Retrives a pointer to the currently selected node. More...
 
static unsigned int getSelectedName ()
 Returns the "name" of the currently selected object. More...
 
static void clearSelectedObject ()
 Clears the current selection.
 
static void setSelectedObject (Selectable *obj)
 Forces an arbitrary selectable to be selected. More...
 
static void selectStart ()
 The selection set up. More...
 
static bool selectEnd ()
 The selection take down. More...
 
static unsigned int nextSelectName ()
 Reports the next available selection name.
 
- Protected Member Functions inherited from Menge::SceneGraph::GLNode
void setParent (GLDagNode *p)
 Assigns this node to a parent GLDagNode. More...
 

Detailed Description

The basic shape class - a selectable GLNode.

Constructor & Destructor Documentation

Menge::SceneGraph::Shape::Shape ( float  r,
float  g,
float  b,
GLenum  s = GL_FILL 
)
inline

Constructor with color and drawing style.

Parameters
rThe red component of the shape's color (in the range [0, 1]).
gThe green component of the shape's color (in the range [0, 1]).
bThe blue component of the shape's color (in the range [0, 1]).
sOpenGL render style: GL_FILL, GL_LINE, or GL_POINT.

Member Function Documentation

void Menge::SceneGraph::Shape::setColor ( const Vector3 vec)
inline

Set the shape color from a vector.

Parameters
vecThe rgb color, where each channel lies in the range [0, 1].
void Menge::SceneGraph::Shape::setColor ( float  r,
float  g,
float  b 
)
inline

Set the shape color from three separate values.

Parameters
rThe red component of the shape's color (in the range [0, 1]).
gThe green component of the shape's color (in the range [0, 1]).
bThe blue component of the shape's color (in the range [0, 1]).
void Menge::SceneGraph::Shape::setStyle ( GLenum  style)
inline

Set the shape's render style.

Parameters
styleThe desired render style. Should be one of GL_FILL, GL_LINE, or GL_POINT.

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