RenderWidget.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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_RENDERWIDGET_HH_
18 #define GAZEBO_GUI_RENDERWIDGET_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 
29 namespace gazebo
30 {
31  namespace gui
32  {
33  class TopToolbar;
34  class GLWidget;
35  class TimePanel;
36 
37  class GZ_GUI_VISIBLE RenderWidget : public QWidget
38  {
39  Q_OBJECT
40  public: explicit RenderWidget(QWidget *_parent = 0);
41  public: virtual ~RenderWidget();
42 
43  // \brief Initialization
44  public: void Init();
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 
88  public: bool AddPlugin(const std::string &_filename,
89  sdf::ElementPtr _elem);
90 
97  public: void AddPlugins(const std::vector<std::string> &_pluginFilenames);
98 
101  public: TopToolbar *GetToolbar() const;
102 
105  public: void ShowToolbar(const bool _show);
106 
109  private slots: void OnClearOverlayMsg();
110 
111  private: void OnFullScreen(bool &_value);
112 
115  private: void OnFollow(const std::string &_modelName);
116 
118  private: GLWidget *glWidget;
119 
121  private: QFrame *mainFrame;
122 
124  private: std::vector<event::ConnectionPtr> connections;
125 
127  private: QFrame *bottomFrame;
128 
130  private: TopToolbar *topToolbar;
131 
133  private: QLabel *msgOverlayLabel = nullptr;
134 
136  private: std::string baseOverlayMsg;
137 
139  private: QSplitter *splitter;
140 
142  private: std::vector<gazebo::GUIPluginPtr> plugins;
143 
145  private: TimePanel *timePanel;
146  };
147  }
148 }
149 #endif
Definition: GLWidget.hh:40
Forward declarations for the common classes.
Definition: Animation.hh:26
Definition: RenderWidget.hh:37
Definition: TimePanel.hh:44
boost::shared_ptr< GUIPlugin > GUIPluginPtr
Definition: CommonTypes.hh:62
Toolbar on the top of the main window.
Definition: TopToolbar.hh:32
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.