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 Member Functions | Protected Attributes | Friends | List of all members
Menge::SceneGraph::GLNode Class Referenceabstract

An abstact class – a generic, scene graph node. More...

#include <GLNode.h>

Inheritance diagram for Menge::SceneGraph::GLNode:
Menge::SceneGraph::GLDagNode Menge::SceneGraph::GLGroundPlane Menge::SceneGraph::Shape Menge::VisAgent Menge::VisObstacle Menge::SceneGraph::Transform Menge::SceneGraph::Circle Menge::SceneGraph::Cylinder

Public Member Functions

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

Protected Member Functions

void setParent (GLDagNode *p)
 Assigns this node to a parent GLDagNode. More...
 

Protected Attributes

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.
 

Friends

class GLDagNode
 

Detailed Description

An abstact class – a generic, scene graph node.

A GLNode can be included in a hierarchy, but cannot take children. It is the basic entity that forms the "graph" of the scene graph. It cannot be added to the scene but must be sub-classed.

Constructor & Destructor Documentation

Menge::SceneGraph::GLNode::GLNode ( GLDagNode parent = 0x0)

Constructor.

Parameters
parentA pointer to the optional parent node in the graph.

Member Function Documentation

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

Causes this node to draw itself to the scene.

This is a purely virtual function. Every node in the graph must implement this function.

Parameters
selectDetermines if the draw call is being performed for the purpose of selection (true) or for visualization (false).

Implemented in Menge::SceneGraph::Cylinder, Menge::SceneGraph::Transform, Menge::SceneGraph::GLDagNode, Menge::SceneGraph::Circle, Menge::SceneGraph::GLGroundPlane, Menge::VisAgent, and Menge::VisObstacle.

GLDagNode* Menge::SceneGraph::GLNode::getParent ( )
inline

Returns a pointer to the node's parent (possibly NULL).

Returns
A pointer to a parent node – if no parent, it returns NULL (0x0).
virtual void Menge::SceneGraph::GLNode::newContext ( )
inlinevirtual

Allows the node to recreate any unique OpenGL objects based on the acquisition of a new OpenGL context.

This should be over-ridden by nodes that have their own unique OpenGL constructs (display lists, textures, etc.)

Reimplemented in Menge::SceneGraph::GLDagNode, and Menge::SceneGraph::GLGroundPlane.

void Menge::SceneGraph::GLNode::setParent ( GLDagNode p)
inlineprotected

Assigns this node to a parent GLDagNode.

Nodes should be linked by calling GLDagNode::addChild.

Parameters
pThe pointer to the new parent node.
void Menge::SceneGraph::GLNode::setVisible ( bool  state)
inline

Sets the visible state of the node.

A node which is not visible does not draw in the scene. Nor does any child or child-tree that the node has.

Parameters
stateThe desired visible state. True for a visible node that will be drawn, false for invisible.

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