Simulation Class Reference

#include <simulation.h>

Inherits Base.

Inheritance diagram for Simulation:

Inheritance graph
[legend]
Collaboration diagram for Simulation:

Collaboration graph
[legend]
List of all members.

Public Types

enum  SimulationState { none, initialised, running, closed }

Public Member Functions

 Simulation ()
virtual ~Simulation ()
bool run (int argc, char **argv)
 starts the Simulation.
virtual void start (const OdeHandle &, const OsgHandle &, GlobalData &globalData)=0
 start() is called at the start and should create all the object (obstacles, agents...).
virtual void end (GlobalData &globalData)
 end() is called at the end and should tidy up
virtual void config (GlobalData &globalData)
 config() is called when the user presses Ctrl-C
virtual bool command (const OdeHandle &, const OsgHandle &, GlobalData &globalData, int key, bool down)
 is called if a key was pressed.
virtual void bindingDescription (osg::ApplicationUsage &au) const
 this can be used to describe the key bindings used by command()
virtual bool collCallback (const OdeHandle &, void *data, dGeomID o1, dGeomID o2)
 collCallback() can be used to overload the standart collision handling.
virtual void addCallback (GlobalData &globalData, bool draw, bool pause)
 addCallback() optional additional callback function.
virtual void operator() (const Producer::Camera &)

Protected Member Functions

virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
virtual void getUsage (osg::ApplicationUsage &au) const
virtual void accept (osgGA::GUIEventHandlerVisitor &v)
virtual bool init (int argc, char **argv)
void setCameraHomePos (const osg::Vec3 &eye, const osg::Vec3 &view)
 define the home position and view orientation of the camera.
bool control_c_pressed ()

Static Protected Member Functions

void nearCallback (void *data, dGeomID o1, dGeomID o2)

Protected Attributes

std::list< PlotOptionplotoptions
std::list< const Configurable * > globalconfigurables
 this list contains by default only the odeconfig. This list os passed to the plotoptions.
GlobalData globalData
VideoStream videostream
int nextLeakAnnounce
int leakAnnCounter
long realtimeoffset
long simtimeoffset
int windowWidth
int windowHeight
bool pause
bool simulation_time_reached
long int simulation_time
long sim_step
int guiloggerinterval
int filelogginginterval
int neuronvizinterval

Private Member Functions

void processCmdLine (int argc, char **argv)
void loop ()
void tidyUp (GlobalData &globalData)
 clears obstacle and agents lists and delete entries
void resetSyncTimer ()
long timeOfDayinMS ()

Static Private Member Functions

void control_c (int i)
 internals
void cmd_handler_exit ()
void cmd_handler_init ()
void cmd_begin_input ()
void cmd_end_input ()
void usage (const char *progname)

Private Attributes

SimulationState state
osg::ArgumentParser * arguments
ExtendedViewerviewer
Producer::Camera * cam

Static Private Attributes

int ctrl_C = 0

Member Enumeration Documentation

enum SimulationState
 

Enumeration values:
none 
initialised 
running 
closed 


Constructor & Destructor Documentation

Simulation  ) 
 

~Simulation  )  [virtual]
 


Member Function Documentation

void accept osgGA::GUIEventHandlerVisitor &  v  )  [protected, virtual]
 

virtual void addCallback GlobalData globalData,
bool  draw,
bool  pause
[inline, virtual]
 

addCallback() optional additional callback function.

virtual void bindingDescription osg::ApplicationUsage &  au  )  const [inline, virtual]
 

this can be used to describe the key bindings used by command()

void cmd_begin_input  )  [static, private]
 

void cmd_end_input  )  [static, private]
 

void cmd_handler_exit  )  [static, private]
 

void cmd_handler_init  )  [static, private]
 

virtual bool collCallback const OdeHandle ,
void *  data,
dGeomID  o1,
dGeomID  o2
[inline, virtual]
 

collCallback() can be used to overload the standart collision handling.

However it is called after the robots collision handling.

Returns:
true if collision is treated, false otherwise

virtual bool command const OdeHandle ,
const OsgHandle ,
GlobalData globalData,
int  key,
bool  down
[inline, virtual]
 

is called if a key was pressed.

For keycodes see: osgGA::GUIEventAdapter

Returns:
true if the key was handled

void config GlobalData globalData  )  [virtual]
 

config() is called when the user presses Ctrl-C

void control_c int  i  )  [static, private]
 

internals

bool control_c_pressed  )  [protected]
 

void end GlobalData globalData  )  [virtual]
 

end() is called at the end and should tidy up

void getUsage osg::ApplicationUsage &  au  )  const [protected, virtual]
 

bool handle const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter & 
[protected, virtual]
 

bool init int  argc,
char **  argv
[protected, virtual]
 

void loop  )  [private]
 

void nearCallback void *  data,
dGeomID  o1,
dGeomID  o2
[static, protected]
 

void operator() const Producer::Camera &   )  [virtual]
 

void processCmdLine int  argc,
char **  argv
[private]
 

void resetSyncTimer  )  [private]
 

bool run int  argc,
char **  argv
 

starts the Simulation.

Do not overload it. This function returns of the simulation is terminated.

Returns:
: true if closed regulary, false on error

void setCameraHomePos const osg::Vec3 eye,
const osg::Vec3 view
[protected]
 

define the home position and view orientation of the camera.

view.x is the heading angle in degree. view.y is the tilt angle in degree (nick), view.z is ignored

virtual void start const OdeHandle ,
const OsgHandle ,
GlobalData globalData
[pure virtual]
 

start() is called at the start and should create all the object (obstacles, agents...).

void tidyUp GlobalData globalData  )  [private]
 

clears obstacle and agents lists and delete entries

long timeOfDayinMS  )  [private]
 

void usage const char *  progname  )  [static, private]
 


Member Data Documentation

osg::ArgumentParser* arguments [private]
 

Producer::Camera* cam [private]
 

int ctrl_C = 0 [static, private]
 

int filelogginginterval [protected]
 

std::list<const Configurable*> globalconfigurables [protected]
 

this list contains by default only the odeconfig. This list os passed to the plotoptions.

GlobalData globalData [protected]
 

int guiloggerinterval [protected]
 

int leakAnnCounter [protected]
 

int neuronvizinterval [protected]
 

int nextLeakAnnounce [protected]
 

bool pause [protected]
 

std::list<PlotOption> plotoptions [protected]
 

long realtimeoffset [protected]
 

long sim_step [protected]
 

long simtimeoffset [protected]
 

long int simulation_time [protected]
 

bool simulation_time_reached [protected]
 

SimulationState state [private]
 

VideoStream videostream [protected]
 

ExtendedViewer* viewer [private]
 

int windowHeight [protected]
 

int windowWidth [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 16 02:14:56 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8