Warning: include(php/utility.php): Failed to open stream: No such file or directory in /home/argos/argos3/doc/api/embedded/a00876_source.php on line 2

Warning: include(): Failed opening 'php/utility.php' for inclusion (include_path='.:/usr/lib64/php') in /home/argos/argos3/doc/api/embedded/a00876_source.php on line 2
The ARGoS Website

qtopengl_main_window.h
Go to the documentation of this file.
1 
7 #ifndef QTOPENGL_MAIN_WINDOW_H
8 #define QTOPENGL_MAIN_WINDOW_H
9 
10 namespace argos {
11  class CQTOpenGLMainWindow;
12  class CQTOpenGLWidget;
13  class CQTOpenGLLogStream;
14  class CQTOpenGLUserFunctions;
15 }
16 
17 class QMainWindow;
18 class QWidget;
19 class QHBoxLayout;
20 class QPushButton;
21 class QLCDNumber;
22 class QStatusBar;
23 class QDockWidget;
24 class QTextEdit;
25 class QButtonGroup;
26 class QSpinBox;
27 class QDoubleSpinBox;
28 class QActionGroup;
29 
30 #include <argos3/core/utility/configuration/argos_configuration.h>
31 #include <argos3/core/simulator/visualization/visualization.h>
32 #include <QMainWindow>
33 
34 namespace argos {
35 
36  class CQTOpenGLMainWindow : public QMainWindow {
37 
38  Q_OBJECT
39 
40  public:
41 
43  virtual ~CQTOpenGLMainWindow();
44 
46  return *m_pcOpenGLWidget;
47  }
48 
49  inline const CQTOpenGLWidget& GetOpenGLWidget() const {
50  return *m_pcOpenGLWidget;
51  }
52 
54  return *m_pcUserFunctions;
55  }
56 
57  inline const CQTOpenGLUserFunctions& GetUserFunctions() const {
58  return *m_pcUserFunctions;
59  }
60 
61  inline const QString& GetIconDir() const {
62  return m_strIconDir;
63  }
64 
65  inline const QString& GetTextureDir() const {
66  return m_strTextureDir;
67  }
68 
69  private:
70 
71  void ReadSettingsPreCreation();
72  void ReadSettingsPostCreation();
73  void WriteSettings();
74 
75  void CreateExperimentActions();
76  void CreateCameraActions();
77  void CreatePOVRayActions();
78  void CreateHelpActions();
79 
80  void CreateExperimentToolBar();
81  void CreateExperimentMenu();
82  void CreateCameraToolBar();
83  void CreateCameraMenu();
84  void CreatePOVRayMenu();
85  void CreateHelpMenu();
86 
87  void CreateOpenGLWidget(TConfigurationNode& t_tree);
88  void CreateLogMessageDock();
89  void CreateConnections();
90 
91  void CreateUserFunctions(TConfigurationNode& t_tree);
92 
93  virtual void closeEvent(QCloseEvent* pc_event);
94 
95  signals:
96 
101  void CameraSwitched(int n_camera);
102 
106  void ExperimentStarted();
107 
111  void ExperimentPlaying();
112 
117 
125  void ExperimentPaused();
126 
134  void ExperimentSuspended();
135 
140  void ExperimentResumed();
141 
147  void ExperimentDone();
148 
152  void ExperimentReset();
153 
154  public slots:
155 
161  void PlayExperiment();
162 
167  void FastForwardExperiment();
168 
172  void StepExperiment();
173 
179  void PauseExperiment();
180 
184  void TerminateExperiment();
185 
190  void ResetExperiment();
191 
195  void SuspendExperiment();
196 
200  void ResumeExperiment();
201 
202  void CameraXMLPopUp();
203 
204  QString GetCameraXMLData();
205 
206  void SwitchCamera(QAction*);
207 
208  // void POVRaySceneXMLPopUp();
209  // QString GetPOVRaySceneXMLData();
210  // void POVRayScenePreview();
211 
212  private:
213 
214  enum EExperimentState {
215  EXPERIMENT_INITIALIZED = 0,
216  EXPERIMENT_PLAYING,
217  EXPERIMENT_FAST_FORWARDING,
218  EXPERIMENT_PAUSED,
219  EXPERIMENT_SUSPENDED,
220  EXPERIMENT_DONE
221  };
222 
223  private:
224 
225  CQTOpenGLWidget* m_pcOpenGLWidget;
226  QString m_strIconDir;
227  QString m_strTextureDir;
228 
229  EExperimentState m_eExperimentState;
230 
231  QAction* m_pcPlayAction;
232  QAction* m_pcFastForwardAction;
233  QAction* m_pcStepAction;
234  QAction* m_pcResetAction;
235  QAction* m_pcTerminateAction;
236  QAction* m_pcPauseAction;
237  QAction* m_pcCaptureAction;
238  QAction* m_pcQuitAction;
239  QSpinBox* m_pcDrawFrameEvery;
240  QLCDNumber* m_pcCurrentStepLCD;
241  QToolBar* m_pcExperimentToolBar;
242  QMenu* m_pcExperimentMenu;
243 
244  QAction* m_pcShowCameraXMLAction;
245  QList<QAction*> m_pcSwitchCameraActions;
246  QActionGroup* m_pcSwitchCameraActionGroup;
247  QDoubleSpinBox* m_pcFocalLength;
248  QToolBar* m_pcCameraToolBar;
249  QMenu* m_pcCameraMenu;
250 
251  QAction* m_pcPOVRayXMLAction;
252  QAction* m_pcPOVRayPreviewAction;
253  QMenu* m_pcPOVRayMenu;
254 
255  QAction* m_pcAboutQTAction;
256  QMenu* m_pcHelpMenu;
257 
258  QStatusBar* m_pcStatusbar;
259 
260  QDockWidget* m_pcLogDock;
261  QDockWidget* m_pcLogErrDock;
262  QTextEdit* m_pcDockLogBuffer;
263  QTextEdit* m_pcDockLogErrBuffer;
264  CQTOpenGLLogStream* m_pcLogStream;
265  CQTOpenGLLogStream* m_pcLogErrStream;
266 
267  bool m_bWasLogColored;
268 
269  CQTOpenGLUserFunctions* m_pcUserFunctions;
270  };
271 
272 }
273 
274 #endif
The QTOpenGL user functions.
CQTOpenGLWidget & GetOpenGLWidget()
CQTOpenGLUserFunctions & GetUserFunctions()
void ExperimentResumed()
Emitted when the experiment has just been resumed.
void ExperimentDone()
Emitted when the experiment is finished.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
void ResetExperiment()
Resets the state of the experiment to its state right after initialization.
CQTOpenGLMainWindow(TConfigurationNode &t_tree)
void ExperimentSuspended()
Emitted when the experiment has been suspended.
void FastForwardExperiment()
Fast forwards the experiment.
void TerminateExperiment()
Terminates the execution of the experiment.
void PauseExperiment()
Pauses the experiment.
void StepExperiment()
Executes one experiment time step.
const CQTOpenGLUserFunctions & GetUserFunctions() const
void ExperimentPaused()
Emitted when the experiment has been paused.
void CameraSwitched(int n_camera)
Emitted whenever the user presses a camera button to switch camera.
const CQTOpenGLWidget & GetOpenGLWidget() const
void ExperimentStarted()
Emitted when the experiment has just been started.
void ExperimentPlaying()
Emitted when the experiment has (re)started playing.
void ExperimentReset()
Emitted when the experiment has been reset.
void ResumeExperiment()
Resumes a suspended experiment.
void SuspendExperiment()
Suspends an experiment due to an error.
const QString & GetTextureDir() const
void ExperimentFastForwarding()
Emitted when the experiment has (re)started fast-forwarding.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
const QString & GetIconDir() const
void PlayExperiment()
Plays the experiment.