Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Base context for finite state machine states. More...
#include <StateContext.h>
Public Member Functions | |
StateContext (State *state) | |
Constructor. More... | |
virtual | ~StateContext () |
Destructor. | |
virtual SceneGraph::ContextResult | handleKeyboard (SDL_Event &e) |
Give the context the opportunity to respond to a keyboard event. More... | |
std::string | getUIText (const std::string &indent="") const |
Provides a string to be printed in the display as a UI element detailing state information. More... | |
virtual void | draw3DGL (const Agents::BaseAgent *agt, bool drawVC, bool drawTrans) |
Draw context elements into the 3D world. More... | |
Public Member Functions inherited from Menge::SceneGraph::Context | |
Context () | |
Constructor. | |
virtual | ~Context () |
Virtual destructor. | |
virtual void | drawGL (int vWidth, int vHeight) |
The draw function for the context. More... | |
virtual bool | selectGL (const GLScene *scene, const GLCamera &camera, int vWidth, int vHeight, int *selectPoint) |
Performs selection based on a click on screen space. Uses the OpenGL selection mechanism. More... | |
virtual ContextResult | handleMouse (SDL_Event &e) |
Give the context the opportunity to respond to a mouse event. More... | |
virtual void | update () |
Allow the context to update any time-dependent state it might have to the given global time. | |
virtual void | newGLContext () |
Callback for when the OpenGL context is changed. | |
virtual void | activate () |
Called when the context is activated. | |
virtual void | deactivate () |
Called when the context is deactivated. | |
Protected Attributes | |
State * | _state |
The underlying finite state machine state. | |
VelCompContext * | _vcContext |
The velocity component context for this state. | |
size_t | _activeTransition |
The id of the "active" transition. More... | |
Protected Attributes inherited from Menge::SceneGraph::Context | |
double | _modViewMat [16] |
The current model view matrix. | |
double | _projMat [16] |
The current projection matrix. | |
int | _viewMat [4] |
The current viewport parameters. | |
Static Protected Attributes | |
static size_t | NO_ACTIVE_ID = std::numeric_limits< size_t >::max() |
The value used to indicate that no id is selected. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Menge::SceneGraph::Context | |
void | uiSetup (int vWidth, int vHeight) |
UI setup - handles the configuration of the opengl context for orthographic rendering. More... | |
void | uiShutdown () |
Cleans up the OpenGL state after having drawn the UI elements of the context. | |
virtual void | drawUIGL (int vWidth, int vHeight, bool select=false) |
Draw UI elements into the context. More... | |
virtual void | draw3DGL (bool select=false) |
Draw context elements into the 3D world. More... | |
void | getOpenGLView () |
Updates the various view matrices: modelview, projection, and view. | |
void | writeText (const std::string &txt, const Vector2 &pos, bool currColor=false) const |
Writes the given text at the given location. More... | |
void | writeText (const std::string &txt, const Vector3 &pos, bool currColor=false) const |
Writes the given text at the given 3D location. More... | |
void | writeTextRadially (const std::string &txt, const Vector2 &pos, const Vector2 &dir, bool currColor=false) const |
Writes the given text at the given location, but anchored based on the radial direction given. More... | |
void | writeAlignedText (const std::string &txt, const Vector2 &pos, TextWriter::Alignment align, bool currColor=false) const |
Writes the given text aligned to the given location. More... | |
void | writeToScreen (const std::string &txt, TextWriter::Alignment align, int fontSize, float hPad=0.f, float vPad=0.f, bool currColor=false, bool trans=true) const |
Writes the given text to the screen based on the given alignment. More... | |
Base context for finite state machine states.
This differs from the standard scene graph context by being dependent on an input agent.
Menge::BFSM::StateContext::StateContext | ( | State * | state | ) |
Constructor.
state | A pointer to the underlying fsm state. The context will not delete the state. |
|
virtual |
Draw context elements into the 3D world.
agt | The particular agent for which the FSM is being visualized. |
drawVC | Draw the velocity component |
drawTrans | Draw the transition |
std::string Menge::BFSM::StateContext::getUIText | ( | const std::string & | indent = "" | ) | const |
Provides a string to be printed in the display as a UI element detailing state information.
indent | An optional string representing indentation to be applied to the text. It is prefixed at the start of each line. |
|
virtual |
Give the context the opportunity to respond to a keyboard event.
e | The SDL event with the keyboard event data. |
Reimplemented from Menge::SceneGraph::Context.
|
protected |
The id of the "active" transition.
This is the index of the transition which is currently being visualized in the context.
|
staticprotected |
The value used to indicate that no id is selected.
Used in conjunction with the _activeVC and _activeTransition