24 #ifndef _TASKEDSIMULATION_H_
25 #define _TASKEDSIMULATION_H_
30 #include <selforg/quickmp.h>
90 this->taskId = taskId;
109 this->simTaskHandle = &simTaskHandle;
117 bool processCmdLine(
int argc,
char** argv) {
135 virtual bool storeCfg(
const char* filenamestem,
const std::list<std::string>& comments = std::list<std::string>()) {
143 bool restoreCfg(
const char* filenamestem) {
158 SimulationTaskHandle* simTaskHandle;
159 std::string nameSuffix;
163 start(odeHandle, osgHandle, globalData, *simTaskHandle, taskId);
170 doRestart =
restart(odeHandle, osgHandle, globalData, *simTaskHandle, taskId);
177 addCallback(globalData, draw, pause, control, *simTaskHandle, taskId);
183 return command(odeHandle, osgHandle, globalData, key, down, *simTaskHandle, taskId);
virtual bool restoreCfg(const char *filenamestem)
restores the key values paires from the file : filenamestem.cfg
Definition: configurable.cpp:53
parambool useOsgThread
Definition: simulation.h:260
Data structure for accessing the ODE.
Definition: odehandle.h:44
void setSimTaskHandle(SimulationTaskHandle &simTaskHandle)
Sets the global SimulationTaskHandle.
Definition: taskedsimulation.h:108
bool noGraphics
Definition: osghandle.h:49
void setTaskId(int taskId)
Sets the taskId of the associated SimulationTask.
Definition: taskedsimulation.h:89
virtual bool processCmdLine(int argc, char **argv)
returns false if the program is to exit
Definition: simulation.cpp:1156
Definition: taskedsimulation.h:34
virtual void addCallback(GlobalData &globalData, bool draw, bool pause, bool control, SimulationTaskHandle &, int taskId)
optional additional callback function which is called every simulation step.
Definition: taskedsimulation.h:71
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
std::string windowName
Definition: simulation.h:264
virtual void start(const OdeHandle &, const OsgHandle &, GlobalData &globalData, SimulationTaskHandle &simTaskHandle, int taskId)
start() is called at the first start of the cycles and should create all the object (obstacles...
Definition: taskedsimulation.h:48
parambool useQMPThreads
Definition: simulation.h:261
virtual bool command(const OdeHandle &, const OsgHandle &, GlobalData &globalData, int key, bool down, SimulationTaskHandle &, int taskId)
is called if a key was pressed.
Definition: taskedsimulation.h:79
Data structure holding all essential global information.
Definition: globaldata.h:57
parambool useOdeThread
Definition: simulation.h:259
struct which holds all structural data for the simulations.
Definition: simulationtaskhandle.h:37
Definition: simulation.h:58
void setTaskNameSuffix(std::string nameSuffix)
Definition: taskedsimulation.h:99
OdeHandle odeHandle
Definition: base.h:149
GlobalData globalData
Definition: simulation.h:219
parambool inTaskedMode
Definition: simulation.h:262
virtual bool restart(const OdeHandle &, const OsgHandle &, GlobalData &globalData, SimulationTaskHandle &, int taskId)
restart() is called at the second and all following starts of the cylce The end of a cycle is determi...
Definition: taskedsimulation.h:60
TaskedSimulation()
Definition: taskedsimulation.h:36
OsgHandle osgHandle
Definition: base.h:147
bool pause
Definition: simulation.h:233
#define QMP_END_CRITICAL
Defines the beginning of a critical section used for synchronization.
Definition: quickmp.h:138
OsgConfig * cfg
Definition: osghandle.h:98
bool noGraphics
Definition: simulation.h:236
virtual ~TaskedSimulation()
Definition: taskedsimulation.h:44
#define QMP_CRITICAL
Defines the beginning of a critical section used for synchronization.
Definition: quickmp.h:131