The context for displaying the computational aspects of the Zanlungo model (see Agents::Helbing::Agent).
More...
#include <HelbingAgentContext.h>
|
| AgentContext (VisAgent **agents, unsigned int agtCount) |
| Constructor. More...
|
|
virtual std::string | contextName () const |
| Returns the name of the context for display. More...
|
|
virtual SceneGraph::ContextResult | handleKeyboard (SDL_Event &e) |
| Give the context the opportunity to respond to a keyboard event. More...
|
|
virtual void | update () |
| Allow the context to update any time-dependent state it might have to the given global time.
|
|
virtual bool | selectGL (const GLScene *scene, const GLCamera &camera, int vWidth, int vHeight, int *selectPoint) |
|
|
virtual void | draw3DGL (bool select=false) |
| Draw context elements into the 3D world. More...
|
|
virtual std::string | agentText (const Agents::BaseAgent *agent) const |
| Creates a formatted string to be printed in the context for a particular agent. More...
|
|
void | drawForce (const Agent *agt) |
| Function for drawing the force vectors acting on agt. More...
|
|
void | singleAgentForce (const Agent *agt, const Agent *other, float thresh=0.5f) |
| Draw the force vector from srcAgent acting on agt. More...
|
|
void | singleObstacleForce (const Agent *agt, const Agents::Obstacle *obst, float thresh=0.5f) |
| Draw the force vector from an obstacle acting on agt. More...
|
|
void | drawForce (const Agent *agt, const Vector2 &force, const std::string &label) |
| Draws the given force on the given agent It assumes the force color has already been set. More...
|
|
virtual std::string | agentText (const Agents::BaseAgent *agent) const |
|
|
bool | _showForce |
| Determines if the force vectors are drawn.
|
|
int | _forceObject |
| The id of the forceObject to display. If zero, all agents, if positive, a single agent if negative, an obstacle.
|
|
The context for displaying the computational aspects of the Zanlungo model (see Agents::Helbing::Agent).
Helbing::AgentContext::AgentContext |
( |
VisAgent ** |
agents, |
|
|
unsigned int |
agtCount |
|
) |
| |
Constructor.
- Parameters
-
agents | An array of pointers to VisAgent instances for Helbing agents. |
agtCount | The number of agents contained in the array. |
std::string Helbing::AgentContext::agentText |
( |
const Agents::BaseAgent * |
agent | ) |
const |
|
protectedvirtual |
Creates a formatted string to be printed in the context for a particular agent.
- Parameters
-
agent | The agent whose data is to be displayed. |
- Returns
- A formatted string for display in the context's 2D gui.
virtual std::string Helbing::AgentContext::contextName |
( |
| ) |
const |
|
inlinevirtual |
Returns the name of the context for display.
- Returns
- The name of this context.
Reimplemented from Menge::BaseAgentContext.
void Helbing::AgentContext::draw3DGL |
( |
bool |
select = false | ) |
|
|
protectedvirtual |
Draw context elements into the 3D world.
- Parameters
-
select | Defines if the drawing is being done for selection purposes (true) or visualization (false). |
Reimplemented from Menge::BaseAgentContext.
void Helbing::AgentContext::drawForce |
( |
const Agent * |
agt | ) |
|
|
protected |
Function for drawing the force vectors acting on agt.
- Parameters
-
agt | The agent whose forces are displayed. |
void Helbing::AgentContext::drawForce |
( |
const Agent * |
agt, |
|
|
const Vector2 & |
force, |
|
|
const std::string & |
label |
|
) |
| |
|
protected |
Draws the given force on the given agent It assumes the force color has already been set.
- Parameters
-
agt | A pointer to the agent on which the force is acting |
force | The force vector to draw |
label | The label to apply to the force. |
SceneGraph::ContextResult Helbing::AgentContext::handleKeyboard |
( |
SDL_Event & |
e | ) |
|
|
virtual |
Give the context the opportunity to respond to a keyboard event.
- Parameters
-
e | The SDL event with the keyboard event data. |
- Returns
- A ContextResult instance reporting if the event was handled and if redrawing is necessary.
Reimplemented from Menge::BaseAgentContext.
void Helbing::AgentContext::singleAgentForce |
( |
const Agent * |
agt, |
|
|
const Agent * |
other, |
|
|
float |
thresh = 0.5f |
|
) |
| |
|
protected |
Draw the force vector from srcAgent acting on agt.
- Parameters
-
agt | The agent on which the force is acting |
other | The agent imparting the force |
thresh | The minimum force magnitude required to draw |
void Helbing::AgentContext::singleObstacleForce |
( |
const Agent * |
agt, |
|
|
const Agents::Obstacle * |
obst, |
|
|
float |
thresh = 0.5f |
|
) |
| |
|
protected |
Draw the force vector from an obstacle acting on agt.
- Parameters
-
agt | The agent on which the force is acting |
obst | The obstacle imparting the force |
thresh | The minimum force magnitude required to draw |
The documentation for this class was generated from the following files: