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  class GLWidget;
36 
37  namespace gui
38  {
39  class BuildingEditorWidget;
40 
41  class GAZEBO_VISIBLE RenderWidget : public QWidget
42  {
43  Q_OBJECT
44  public: RenderWidget(QWidget *_parent = 0);
45  public: virtual ~RenderWidget();
46 
47  public: void RemoveScene(const std::string &_name);
48  public: void CreateScene(const std::string &_name);
49 
52  public: void ShowEditor(bool _show);
53 
57  public: void DisplayOverlayMsg(const std::string &_msg,
58  int _duration = -1);
59 
62  public: std::string GetOverlayMsg() const;
63 
67  public: void AddPlugin(GUIPluginPtr _plugin, sdf::ElementPtr _elem);
68 
71  public: QToolBar *GetToolbar() const;
72 
75  public: void ShowToolbar(const bool _show);
76 
77  private slots: virtual void update();
78 
81  private slots: void OnClearOverlayMsg();
82 
83  private: void OnFullScreen(bool &_value);
84 
87  private: void OnFollow(const std::string &_modelName);
88 
90  private: void OnAlign();
91 
93  private: GLWidget *glWidget;
94 
96  private: BuildingEditorWidget *buildingEditorWidget;
97 
99  private: QFrame *mainFrame;
100 
102  private: std::vector<event::ConnectionPtr> connections;
103 
105  private: QFrame *bottomFrame;
106  private: QLabel *xyzLabel;
107  private: QLineEdit *xPosEdit;
108  private: QLineEdit *yPosEdit;
109  private: QLineEdit *zPosEdit;
110 
111  private: QLabel *rpyLabel;
112  private: QLineEdit *rollEdit;
113  private: QLineEdit *pitchEdit;
114  private: QLineEdit *yawEdit;
115  private: QLineEdit *fpsEdit;
116  private: QLineEdit *trianglesEdit;
117 
119  private: QToolBar *toolbar;
120  private: QToolBar *mouseToolbar;
121  private: QToolBar *editToolbar;
122 
124  private: QLabel *msgOverlayLabel;
125 
126  private: bool clear;
127  private: std::string clearName;
128 
129  private: bool create;
130  private: std::string createName;
131  private: QTimer *timer;
132 
134  private: std::string baseOverlayMsg;
135 
137  private: std::vector<gazebo::GUIPluginPtr> plugins;
138  };
139  }
140 }
141 #endif
Definition: GLWidget.hh:50
void create()
Create SkyX.
Definition: RenderWidget.hh:41
boost::shared_ptr< GUIPlugin > GUIPluginPtr
Definition: CommonTypes.hh:77
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
The parent widget of the building editor, level widget and scale widget.
Definition: BuildingEditorWidget.hh:37
class __declspec(dllimport) BasicController void update(const Ogre::Real &simDeltaTime)
Basic controller class.