Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

UserInterface Class Reference

User Interface functions and functionality. More...

#include <UserInterface.h>

Collaboration diagram for UserInterface:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UserInterface (StateControl *st)
 ~UserInterface ()
osg::Node * createHud ()
osg::AutoTransform * createHUDObject (string text, bool pickable, int xpos, int ypos)
void setHUDText (string t)
void rmHUDText (string rt)
bool buttonAction (string buttonName)
bool selectionAction (osg::Node *selected)
void updateClock ()

Private Attributes

StateControls
osg::Node * hud
osg::CameraNode * hudCam
osgText::Text * clock

Friends

bool UserEventHandler::handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)

Detailed Description

User Interface functions and functionality.

This class handles the user interface, keyboard and mouse callbacks and the menu/hud layouts.

Definition at line 117 of file UserInterface.h.


Constructor & Destructor Documentation

UserInterface::UserInterface StateControl st  ) 
 

Constructor.

Parameters:
st Reference to statecontrol.

Definition at line 103 of file UserInterface.cpp.

References clock, hud, hudCam, and s.

UserInterface::~UserInterface  )  [inline]
 

Definition at line 125 of file UserInterface.h.


Member Function Documentation

bool UserInterface::buttonAction string  buttonName  ) 
 

Button event handler.

Returns:
true if succesfull, false if there was an error.

Definition at line 289 of file UserInterface.cpp.

References StateControl::adjustTimeFlow(), StateControl::pause(), and s.

Referenced by UserEventHandler::pick().

Here is the call graph for this function:

osg::Node * UserInterface::createHud  ) 
 

Sets up the HUD and camera for the hud.

Returns:
CameraNode with the HUD that can be added to the scene root.

Definition at line 111 of file UserInterface.cpp.

References clock, createHUDObject(), StateControl::getTime(), StateControl::getTimeFlow(), hud, hudCam, and s.

Referenced by go().

Here is the call graph for this function:

osg::AutoTransform * UserInterface::createHUDObject string  text,
bool  pickable,
int  xpos,
int  ypos
 

Creates text on the hud.

Parameters:
text The text to set on the HUD.
xpos X-coordinate of the button.
ypos Y-coordinate of the button.
pickable True if the event handler should do something when this text is clicked.
Returns:
the transform node with a geode containing text as a child..

Definition at line 211 of file UserInterface.cpp.

References FONTSIZE_HUD, and s.

Referenced by createHud(), and setHUDText().

void UserInterface::rmHUDText string  rt  ) 
 

Removes text from the HUD.

Parameters:
rt Text to remove. Matches until the first '
' character.

Definition at line 267 of file UserInterface.cpp.

References hudCam.

Referenced by StateControl::clearSelection(), StateControl::deselectObject(), and StateControl::updateHudText().

bool UserInterface::selectionAction osg::Node *  selected  ) 
 

Selection event handler.

Parameters:
selected Name of the object that has been picked.
Returns:
True if succesfull, false if there was an error.

Definition at line 313 of file UserInterface.cpp.

References StateControl::clearSelection(), StateControl::deselectObject(), TraplasObject::isSelected(), s, and StateControl::selectObject().

Referenced by UserEventHandler::pick().

Here is the call graph for this function:

void UserInterface::setHUDText string  t  ) 
 

Sets text in the HUD.

Parameters:
t Text to set in the hud. Can use regular formatting, i.e. '/n', '/t' etc.

Definition at line 262 of file UserInterface.cpp.

References createHUDObject(), and hudCam.

Referenced by StateControl::selectObject(), and StateControl::updateHudText().

Here is the call graph for this function:

void UserInterface::updateClock  ) 
 

Updates the clock on the Heads up display.

Definition at line 331 of file UserInterface.cpp.

References clock, StateControl::getTime(), StateControl::getTimeFlow(), and s.

Referenced by UserEventHandler::handle().

Here is the call graph for this function:


Friends And Related Function Documentation

bool UserEventHandler::handle const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  us
[friend]
 


Member Data Documentation

osgText::Text* UserInterface::clock [private]
 

Definition at line 172 of file UserInterface.h.

Referenced by createHud(), updateClock(), and UserInterface().

osg::Node* UserInterface::hud [private]
 

Definition at line 170 of file UserInterface.h.

Referenced by createHud(), and UserInterface().

osg::CameraNode* UserInterface::hudCam [private]
 

Definition at line 171 of file UserInterface.h.

Referenced by createHud(), rmHUDText(), setHUDText(), and UserInterface().

StateControl* UserInterface::s [private]
 

Definition at line 169 of file UserInterface.h.

Referenced by buttonAction(), createHud(), createHUDObject(), UserEventHandler::handle(), selectionAction(), updateClock(), and UserInterface().


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 10:22:25 2006 for TraplasVisualisation by  doxygen 1.4.4