00001 #ifndef SIGEL_SLAVEGUI_SIG_SIMULATIONVISUALISATIONWIDGET_H
00002 #define SIGEL_SLAVEGUI_SIG_SIMULATIONVISUALISATIONWIDGET_H
00003
00004 #include <qtimer.h>
00005 #include <qcolor.h>
00006
00007 #include "SIGEL_CommonGUI/SIG_VisualisationWidget.h"
00008
00009 #include "SIGEL_Robot/SIG_Robot.h"
00010 #include "SIGEL_Environment/SIG_Environment.h"
00011 #include "SIGEL_Simulation/SIG_SimulationParameters.h"
00012 #include "SIGEL_Program/SIG_Program.h"
00013
00014
00015
00016
00026 class SIG_SimulationVisualisationWidget : public SIGEL_CommonGUI::SIG_VisualisationWidget
00027 {
00028 Q_OBJECT
00029
00030 public:
00031
00039 SIG_SimulationVisualisationWidget( QWidget *parent=0,
00040 char const *name=0,
00041 WFlags f=0 );
00042
00046 ~SIG_SimulationVisualisationWidget();
00047
00058 void visualizeThis(SIGEL_Robot::SIG_Robot const &rrobot,
00059 SIGEL_Environment::SIG_Environment const &eenvironment,
00060 SIGEL_Simulation::SIG_SimulationParameters const &ssimulationParameters,
00061 SIGEL_Program::SIG_Program const &pprogram);
00062
00066 bool simulationRunning();
00067
00068 void resetRecorder();
00069
00070 public slots:
00071
00072 void setShowAncorPoints( int state );
00073
00074 void choosePlaneColor();
00075
00076 void setShowPlane( int state );
00077
00078 void setShowGrid( int state );
00079
00080 void setShowRobotPath( int state );
00081
00085 void slotStartSimulation();
00086
00090 void slotStopSimulation();
00091
00095 void slotStepSimulation();
00096
00100 void slotFForwardSimulation();
00101
00109 void slotSetFrameDelay(int fframeDelay);
00110
00111 void slotSetTraceRobot( bool newValue );
00112
00113 void slotNavigateForward();
00114
00115 void slotNavigateBackward();
00116
00117 void slotNavigateRight();
00118
00119 void slotNavigateLeft();
00120
00121 void slotNavigateDown();
00122
00123 void slotNavigateUp();
00124
00125 void slotNavigateCenter();
00126
00130 void slotRecordClicked();
00131
00135 void slotAlterMovieSettingsClicked();
00136
00137 private:
00138
00142 QTimer *simulationTimer;
00143
00147 int frameDelay;
00148
00152 int noOfFFSteps;
00153
00154 bool traceRobot;
00155
00156 QColor planeColor;
00157
00161 bool record;
00162
00163 bool useLeadingZeros;
00164
00165 int movieWidth;
00166
00167 int movieHeight;
00168
00169 int movieFrequency;
00170
00171 int movieMaxFrames;
00172
00173 int movieQuality;
00174
00180 int currentFrameName;
00181
00187 int currentFrame;
00188
00189 QString movieDirectory;
00190
00191 QString movieFilePrefix;
00192
00193 QString fileFormat;
00194
00195 void paintGL();
00196
00203 void makeTimeSteps(int noOfSteps);
00204
00209 void mousePressEvent( QMouseEvent *event );
00210
00215 void mouseMoveEvent( QMouseEvent *event );
00216
00220 SIGEL_Robot::SIG_Robot const *robot;
00221
00225 SIGEL_Environment::SIG_Environment const *environment;
00226
00230 SIGEL_Simulation::SIG_SimulationParameters const *simulationParameters;
00231
00235 SIGEL_Program::SIG_Program const *program;
00236
00237 private slots:
00238
00246 void slotSimulationProgress();
00247
00248 signals:
00249
00250 void signalSimulationProgress( QTime simulationTime );
00251
00252 void signalPosition( DL_vector position );
00253
00254 void signalSimulationAbort();
00255
00256 void signalRecordingAllowed( bool );
00257 };
00258
00259
00260
00261 #endif // SIGEL_SLAVEGUI_SIG_SIMULATIONVISUALISATIONWIDGET_H