00001 #ifndef SIGEL_VISUALISATION_SIG_SIMULATIONVISUALISATION_H 00002 #define SIGEL_VISUALISATION_SIG_SIMULATIONVISUALISATION_H 00003 00004 #include <qcolor.h> 00005 00006 #include "SIGEL_Visualisation/SIG_Visualisation.h" 00007 #include "SIGEL_Visualisation/SIG_RobotRenderer.h" 00008 #include "SIGEL_Visualisation/SIG_EnvironmentRenderer.h" 00009 #include "SIGEL_Visualisation/SIG_RenderRecorder.h" 00010 #include "SIGEL_Robot/SIG_Robot.h" 00011 #include "SIGEL_Environment/SIG_Environment.h" 00012 #include "SIGEL_Program/SIG_Program.h" 00013 #include "SIGEL_Simulation/SIG_Simulation.h" 00014 #include "SIGEL_Simulation/SIG_SimulationParameters.h" 00015 00016 namespace SIGEL_Visualisation 00017 { 00018 00031 class SIG_SimulationVisualisation : public SIG_Visualisation 00032 { 00033 public: 00034 00048 SIG_SimulationVisualisation(SIGEL_Robot::SIG_Robot const &robot, 00049 SIGEL_Environment::SIG_Environment const &environment, 00050 SIGEL_Simulation::SIG_SimulationParameters const &simulationParameter, 00051 SIGEL_Program::SIG_Program const &program); 00052 00058 ~SIG_SimulationVisualisation(); 00059 00060 void setPointsVisible( bool visible ); 00061 00062 void setPlaneColor( QColor newColor ); 00063 00064 void setShowPlane( bool newShowPlane ); 00065 00066 void setShowGrid( bool newShowGrid ); 00067 00068 void setShowRobotPath( bool newShowRobotPath ); 00069 00079 void visualize(); 00080 00088 void makeTimeSteps(int noOfTimeSteps) 00089 throw (SIGEL_Simulation::SIG_SimulationCannotSolveException); 00090 00091 QTime getSimulationTime() const; 00092 00093 DL_vector getRobotPosition() const; 00094 00095 DL_matrix getRobotRotation() const; 00096 00097 bool exportToPovray( QString includeFilename, 00098 QString fileName ); 00099 00100 bool createPovrayIncludeFile( QString filename, 00101 double aspectRatio ); 00102 00103 private: 00104 00116 SIG_EnvironmentRenderer environmentRenderer; 00117 00129 SIG_RobotRenderer robotRenderer; 00130 00135 SIGEL_Robot::SIG_Robot const &robot; 00136 00141 SIGEL_Environment::SIG_Environment const &environment; 00142 00150 SIG_RenderRecorder *renderRecorder; 00151 00157 SIGEL_Simulation::SIG_Simulation *simulation; 00158 00163 SIGEL_Simulation::SIG_SimulationParameters const simulationParameter; 00164 00169 SIGEL_Program::SIG_Program const &program; 00170 00171 int frameCounter; 00172 00173 int robotPathPointAddingRate; 00174 00183 void updateRobotLinks(); 00184 00192 void updateRobotPoints(); 00193 00194 }; 00195 00196 } 00197 00198 #endif // SIGEL_VISUALISATION_SIG_SIMULATIONVISUALISATION_H