RenderWidget.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 _RENDER_WIDGET_HH_
18 #define _RENDER_WIDGET_HH_
19 
20 #include <string>
21 #include <vector>
22 #include <sdf/sdf.hh>
23 
24 #include "gazebo/gui/qt.h"
25 #include "gazebo/common/Event.hh"
26 #include "gazebo/util/system.hh"
27 
28 class QLineEdit;
29 class QLabel;
30 class QFrame;
31 class QHBoxLayout;
32 
33 namespace gazebo
34 {
35  namespace gui
36  {
37  class GLWidget;
38  class TimePanel;
39 
40  class GAZEBO_VISIBLE RenderWidget : public QWidget
41  {
42  Q_OBJECT
43  public: RenderWidget(QWidget *_parent = 0);
44  public: virtual ~RenderWidget();
45 
46  public: void RemoveScene(const std::string &_name);
47  public: void CreateScene(const std::string &_name);
48 
52  public: void InsertWidget(unsigned int _index, QWidget *_widget);
53 
56  public: void ShowTimePanel(bool _show);
57 
60  public: TimePanel *GetTimePanel() const;
61 
65  public: void DisplayOverlayMsg(const std::string &_msg,
66  int _duration = -1);
67 
70  public: void SetOverlaysVisible(const bool _visible);
71 
74  public: std::string GetOverlayMsg() const;
75 
79  public: void AddPlugin(GUIPluginPtr _plugin, sdf::ElementPtr _elem);
80 
83  public: QToolBar *GetToolbar() const;
84 
87  public: void ShowToolbar(const bool _show);
88 
91  private slots: void OnClearOverlayMsg();
92 
93  private: void OnFullScreen(bool &_value);
94 
97  private: void OnFollow(const std::string &_modelName);
98 
100  private: void OnAlign();
101 
103  private: GLWidget *glWidget;
104 
106  private: QFrame *mainFrame;
107 
109  private: std::vector<event::ConnectionPtr> connections;
110 
112  private: QFrame *bottomFrame;
113 
115  private: QFrame *toolFrame;
116 
117  private: QLabel *xyzLabel;
118  private: QLineEdit *xPosEdit;
119  private: QLineEdit *yPosEdit;
120  private: QLineEdit *zPosEdit;
121 
122  private: QLabel *rpyLabel;
123  private: QLineEdit *rollEdit;
124  private: QLineEdit *pitchEdit;
125  private: QLineEdit *yawEdit;
126  private: QLineEdit *fpsEdit;
127  private: QLineEdit *trianglesEdit;
128 
130  private: QToolBar *toolbar;
131 
132  private: QToolBar *mouseToolbar;
133  private: QToolBar *editToolbar;
134 
136  private: QLabel *msgOverlayLabel;
137 
139  private: std::string baseOverlayMsg;
140 
142  private: QSplitter *splitter;
143 
145  private: std::vector<gazebo::GUIPluginPtr> plugins;
146 
148  private: TimePanel *timePanel;
149  };
150  }
151 }
152 #endif
Definition: GLWidget.hh:52
Definition: RenderWidget.hh:40
Definition: TimePanel.hh:44
boost::shared_ptr< GUIPlugin > GUIPluginPtr
Definition: CommonTypes.hh:80
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66