Menge
Modular Pedestrian Simulation Framework for Research and Development
|
An abstact class – a generic, scene graph node. More...
#include <GLNode.h>
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... | |
GLDagNode * | getParent () |
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 |
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.
Menge::SceneGraph::GLNode::GLNode | ( | GLDagNode * | parent = 0x0 | ) |
Constructor.
parent | A pointer to the optional parent node in the graph. |
|
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.
select | Determines 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.
|
inline |
Returns a pointer to the node's parent (possibly NULL).
|
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.
|
inlineprotected |
Assigns this node to a parent GLDagNode.
Nodes should be linked by calling GLDagNode::addChild.
p | The pointer to the new parent node. |
|
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.
state | The desired visible state. True for a visible node that will be drawn, false for invisible. |