Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Simulation.h

Go to the documentation of this file.
00001 
00009 #ifndef SIMULATION_H
00010 #define SIMULATION_H
00011 
00012 #include <vector>
00013 #include <list>
00014 
00015 #include "Workspace.h"
00016 #include "Roadmap.h"
00017 #include "robot.h"
00018 #include "config.h"
00019 #include "entity.h"
00020 #include "camera.h"
00021 #include "io.h"
00022 #include "gui.h"
00023 #include "point.h"
00024 #include "Arbitrator.h"
00025 #include "ui.h"
00026 
00030 class Simulation{
00031  public:
00033   typedef enum{
00034         SIMULATION_STOPPED,
00035         SIMULATION_RUNNING
00036   } State;
00037 
00038   Simulation(const ConStruct& init);
00039   ~Simulation();
00040 
00041   void TimeSlice(const double ms);
00042 
00043   void Render(const IO_Window *win);
00044   void Update (IO_Window *win);
00045 
00046   void OnPress (IO_Window *win, const IO_Key &k);
00047   void OnRelease (IO_Window *win, const IO_Key &k);
00048 
00049   
00050   const Roadmap* getRoadmap(const int i) const;
00051 
00052   //the Simulation's camera determines the POV of the main window
00053   //therefore, in order to incorporate views from the 3rd person/robot
00054   //these functions are provided to switch the camera
00055   void SetCamera(const Camera* cam);
00056   const Camera* GetCamera() const;
00057 
00058 private:
00060   Workspace *workspace;   
00061 
00063   const Camera *camera;
00064 
00066   GUI gui;
00067 
00069   Vector background_color;
00070 
00072   std::vector<Roadmap*> roadmaps;
00073 
00075   UI ui;
00076 
00078   enum { UI_IDLE = 0, UI_REMOVE, UI_START, UI_GOAL } ui_state;
00079 
00081   State state;
00082 
00084   std::vector<Arbitrator*> arbitrators;
00085 
00090   class SimulationFactory {
00091   public:
00095     SimulationFactory(Simulation* sim);
00096 
00104     virtual Arbitrator* BuildArbitrator(const ConStruct& ArbitratorStruct);
00105 
00113     virtual Workspace*  BuildWorkspace(const ConStruct& WorkspaceStruct);
00121     virtual Roadmap*    BuildRoadmap(const ConStruct&   RoadmapStruct);
00122   private:
00124     Simulation* sim;
00125   };
00126 public:
00127   /* settings */
00128 
00130   bool wireframe;
00131 
00133   bool show_fps;
00134 
00135   friend class SimulationFactory;
00136 };
00137 
00138 #endif

Generated on Fri Jan 12 14:15:02 2007 for Construct by  doxygen 1.4.3-20050530