MainWindow.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_GUI_MAINWINDOW_HH_
18 #define _GAZEBO_GUI_MAINWINDOW_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include "gazebo/gazebo_config.h"
25 #include "gazebo/msgs/MessageTypes.hh"
26 #include "gazebo/gui/qt.h"
27 #include "gazebo/util/system.hh"
28 
29 #ifdef HAVE_OCULUS
31 #endif
32 
33 namespace gazebo
34 {
35  namespace gui
36  {
37  class Editor;
38  class RenderWidget;
39 
40  // Forward declare private data
41  class MainWindowPrivate;
42 
43  class GZ_GUI_VISIBLE MainWindow : public QMainWindow
44  {
45  Q_OBJECT
46 
48  public: MainWindow();
49 
51  public: virtual ~MainWindow();
52 
54  public: void Load();
55 
57  public: void Init();
58 
62  public: unsigned int EntityId(const std::string &_name);
63 
67  public: bool HasEntityName(const std::string &_name);
68 
72  public: void AddToLeftColumn(const std::string &_name, QWidget *_widget);
73 
79  public: void ShowLeftColumnWidget(const std::string &_name = "default");
80 
81 
85  public: gui::RenderWidget *GetRenderWidget() const GAZEBO_DEPRECATED(7.0);
86 
89  public: gui::RenderWidget *RenderWidget() const;
90 
93  public: bool IsPaused() const;
94 
96  public slots: void Play();
97 
99  public slots: void Pause();
100 
103  public: void SetLeftPaneVisibility(bool _on);
104 
107  public: void AddMenu(QMenu *_menu);
108 
113  public: void ShowMenuBar(QMenuBar *_bar = NULL);
114 
123  public: QAction *CloneAction(QAction *_action, QObject *_parent);
124 
129  public: gui::Editor *GetEditor(
130  const std::string &_name) const GAZEBO_DEPRECATED(7.0);
131 
135  public: gui::Editor *Editor(const std::string &_name) const;
136 
138  signals: void AddPlugins();
139 
142  signals: void TrackVisual(const std::string &_visualName);
143 
145  signals: void Close();
146 
147  protected: void closeEvent(QCloseEvent *_event);
148 
149  private: void OnGUI(ConstGUIPtr &_msg);
150 
151  private slots: void ItemSelected(QTreeWidgetItem *, int);
152  private slots: void New();
153  private slots: void Open();
154  private slots: void Save();
155  private slots: void SaveAs();
156 
158  private slots: void SaveINI();
159 
161  private slots: void Clone();
162 
164  private slots: void HotkeyChart();
165 
167  private slots: void About();
168 
169  private slots: void Step();
170 
172  private slots: void Arrow();
173 
175  private slots: void Translate();
176 
178  private slots: void Rotate();
179 
181  private slots: void Scale();
182 
185  private slots: void Align();
186 
188  private slots: void Snap();
189 
190  private slots: void CreateBox();
191  private slots: void CreateSphere();
192  private slots: void CreateCylinder();
193  private slots: void CreateMesh();
194  private slots: void CreatePointLight();
195  private slots: void CreateSpotLight();
196  private slots: void CreateDirectionalLight();
197 
199  private slots: void CaptureScreenshot();
200 
201  private slots: void InsertModel();
202 
204  private slots: void ShowGrid();
205 
207  private slots: void ShowOrigin();
208 
210  private slots: void ShowCollisions();
211 
213  private slots: void ShowJoints();
214 
216  private slots: void ShowContacts();
217 
219  private slots: void ShowCOM();
220 
222  private slots: void ShowInertia();
223 
225  private slots: void ShowLinkFrame();
226 
228  private slots: void ShowSkeleton();
229 
231  private slots: void FullScreen();
232 
234  private slots: void ShowToolbars();
235 
236  private slots: void FPS();
237  private slots: void Orbit();
238  private slots: void ViewOculus();
239  private slots: void OnResetModelOnly();
240  private slots: void OnResetWorld();
241  private slots: void SetTransparent();
242  private slots: void SetWireframe();
243 
245  private slots: void ShowGUIOverlays();
246 
248  private slots: void DataLogger();
249 
251  private slots: void OnDataLoggerClosed();
252 
254  private slots: void SelectTopic();
255 
257  private slots: void Diagnostics();
258 
260  private slots: void OnAddPlugins();
261 
264  private slots: void OnTrackVisual(const std::string &_visualName);
265 
268  private slots: void OnEditorGroup(QAction *_action);
269 
272  private: void OnFullScreen(bool _value);
273 
276  private: void OnShowToolbars(bool _value);
277 
278  private: void OnMoveMode(bool _mode);
279 
281  private: void CreateActions();
282 
284  private: void DeleteActions();
285 
287  private: void CreateMenus();
288 
290  private: void CreateMenuBar();
291 
293  private: void CreateEditors();
294 
295  private: void OnModel(ConstModelPtr &_msg);
296 
299  private: void OnLight(ConstLightPtr &_msg);
300 
301  private: void OnResponse(ConstResponsePtr &_msg);
302  private: void OnWorldModify(ConstWorldModifyPtr &_msg);
303  private: void OnManipMode(const std::string &_mode);
304  private: void OnSetSelectedEntity(const std::string &_name,
305  const std::string &_mode);
306 
309  private: void OnInputStepSizeChanged(int _value);
310 
313  private: void OnFollow(const std::string &_modelName);
314 
319  private: void CreateDisabledIcon(const std::string &_pixmap,
320  QAction *_act);
321 
324  private: void OnWindowMode(const std::string &_mode);
325 
328  private: std::unique_ptr<MainWindowPrivate> dataPtr;
329  };
330  }
331 }
332 #endif
A widget that provides data logging functionality.
Definition: DataLogger.hh:37
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
Plot diagnostic information.
Definition: gui/Diagnostics.hh:34
Definition: RenderWidget.hh:37
#define NULL
Definition: CommonTypes.hh:31
Definition: MainWindow.hh:43
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Base class for editors, such as BuildingEditor and TerrainEditor.
Definition: Editor.hh:35