![]() |
Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The basic agent visualization class: a selectable cylinder. More...
#include <VisAgent.h>
Public Member Functions | |
| VisAgent (Agents::BaseAgent *agent) | |
| Constructor. More... | |
| virtual void | drawGL (bool select=false) |
| Draw the agent into the 3D world. More... | |
| Agents::BaseAgent * | getAgent () |
| Returns a Agents::BaseAgent pointer of the associated simulation agent. More... | |
| void | setPosition (float x, float y, float z) |
| Set the 3D position of the visual agent. 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 | 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... | |
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 Member Functions | |
| void | getColor (float &r, float &g, float &b) |
| Defines the color of the cylinder. More... | |
Protected Member Functions inherited from Menge::SceneGraph::GLNode | |
| void | setParent (GLDagNode *p) |
| Assigns this node to a parent GLDagNode. More... | |
Protected Attributes | |
| Agents::BaseAgent * | _agent |
| The logical agent being visualized. | |
| Vector3 | _pos |
| The position in R3 of the logical agent. | |
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 Selectable * | getSelectedObject () |
| 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. | |
The basic agent visualization class: a selectable cylinder.
This is the basic visualization of simulation agents in the visualization context. The agents are drawn as 3D cylinders by default. This class can be sub-classed adn the drawGL method can be overridden to provide a different visualization mechanism.
| Menge::VisAgent::VisAgent | ( | Agents::BaseAgent * | agent | ) |
Constructor.
| agent | The agent to be visualized. |
|
virtual |
Draw the agent into the 3D world.
| select | Defines if the drawing is being done for selection purposes (true) or visualization (false). |
Implements Menge::SceneGraph::GLNode.
|
inline |
Returns a Agents::BaseAgent pointer of the associated simulation agent.
|
protected |
Defines the color of the cylinder.
The color is computed and returned via the three floats passed in as parameters.
| r | The red component of the cylinder. |
| g | The green component of the cylinder. |
| b | The blue component of the cylinder. |
|
inline |
Set the 3D position of the visual agent.
| x | The x-position of the agent (in world coordinates). |
| y | The y-position of the agent (in world coordinates). |
| z | The z-position of the agent (in world coordinates). |
1.8.8