Simulation Class Reference

#include <simulation.h>

Inheritance diagram for Simulation:

Inheritance graph
[legend]
Collaboration diagram for Simulation:

Collaboration graph
[legend]
List of all members.

Detailed Description

Examples:

main.cpp.

Definition at line 161 of file simulation.h.

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)
 command() is called if a key was pressed keycodes see: osgGA::GUIEventAdapter return true if the key was handled
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

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

Protected Attributes

GlobalData globalData
VideoStream videostream
int nextLeakAnnounce
int leakAnnCounter
long realtimeoffset
long simtimeoffset
int windowWidth
int windowHeight
bool pause
long sim_step


Member Enumeration Documentation

enum SimulationState
 

Enumerator:
none 
initialised 
running 
closed 

Definition at line 163 of file simulation.h.


Constructor & Destructor Documentation

Simulation  ) 
 

Definition at line 267 of file simulation.cpp.

~Simulation  )  [virtual]
 

Definition at line 278 of file simulation.cpp.


Member Function Documentation

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

Definition at line 612 of file simulation.cpp.

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

addCallback() optional additional callback function.

Reimplemented in CompatSim.

Definition at line 203 of file simulation.h.

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

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

Definition at line 195 of file simulation.h.

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

Reimplemented in CompatSim.

Definition at line 201 of file simulation.h.

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

command() is called if a key was pressed keycodes see: osgGA::GUIEventAdapter return true if the key was handled

Definition at line 190 of file simulation.h.

void config GlobalData globalData  )  [virtual]
 

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

Default: Call changeParams(globalData.configs)

Reimplemented in CompatSim.

Definition at line 469 of file simulation.cpp.

bool control_c_pressed  )  [protected]
 

Definition at line 734 of file simulation.cpp.

void end GlobalData globalData  )  [virtual]
 

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

Reimplemented in CompatSim.

Definition at line 473 of file simulation.cpp.

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

Definition at line 606 of file simulation.cpp.

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

Definition at line 566 of file simulation.cpp.

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

Definition at line 294 of file simulation.cpp.

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

Definition at line 676 of file simulation.cpp.

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

Definition at line 617 of file simulation.cpp.

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
Examples:
main.cpp.

Definition at line 409 of file simulation.cpp.

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

Definition at line 814 of file simulation.cpp.

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...).

Implemented in CompatSim, ThisSim, ThisSim, ThisSim, and ThisSim.


Member Data Documentation

GlobalData globalData [protected]
 

Definition at line 244 of file simulation.h.

int leakAnnCounter [protected]
 

Definition at line 248 of file simulation.h.

int nextLeakAnnounce [protected]
 

Definition at line 247 of file simulation.h.

bool pause [protected]
 

Definition at line 254 of file simulation.h.

long realtimeoffset [protected]
 

Definition at line 249 of file simulation.h.

long sim_step [protected]
 

Definition at line 256 of file simulation.h.

long simtimeoffset [protected]
 

Definition at line 250 of file simulation.h.

VideoStream videostream [protected]
 

Definition at line 245 of file simulation.h.

int windowHeight [protected]
 

Definition at line 253 of file simulation.h.

int windowWidth [protected]
 

Definition at line 252 of file simulation.h.


Generated on Tue Apr 4 19:05:27 2006 for Robotsystem from Robot Group Leipzig by  doxygen 1.4.5