Gazebo Gui

API Reference

3.12.1
WorldControl.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
18 #ifndef GZ_GUI_PLUGINS_WORLDCONTROL_HH_
19 #define GZ_GUI_PLUGINS_WORLDCONTROL_HH_
20 
21 #include <memory>
22 
23 #ifdef _MSC_VER
24 #pragma warning(push, 0)
25 #endif
26 #include <ignition/msgs.hh>
27 #ifdef _MSC_VER
28 #pragma warning(pop)
29 #endif
30 #include <gz/transport.hh>
31 
32 #include "gz/gui/Plugin.hh"
33 
34 #ifndef _WIN32
35 # define WorldControl_EXPORTS_API
36 #else
37 # if (defined(WorldControl_EXPORTS))
38 # define WorldControl_EXPORTS_API __declspec(dllexport)
39 # else
40 # define WorldControl_EXPORTS_API __declspec(dllimport)
41 # endif
42 #endif
43 
44 namespace ignition
45 {
46 namespace gui
47 {
48 namespace plugins
49 {
50  class WorldControlPrivate;
51 
70  class WorldControl_EXPORTS_API WorldControl: public gz::gui::Plugin
71  {
72  Q_OBJECT
73 
75  public: WorldControl();
76 
78  public: virtual ~WorldControl();
79 
80  // Documentation inherited
81  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
82 
84  public slots: void ProcessMsg();
85 
87  public slots: void OnPlay();
88 
90  public slots: void OnPause();
91 
93  public slots: void OnStep();
94 
97  public slots: void OnStepCount(const unsigned int _steps);
98 
100  signals: void playing();
101 
103  signals: void paused();
104 
106  private: void OnWorldStatsMsg(const gz::msgs::WorldStatistics &_msg);
107 
108  // Private data
109  private: std::unique_ptr<WorldControlPrivate> dataPtr;
110  };
111 }
112 }
113 }
114 
115 #endif
This plugin provides a world control panel which may have a play / pause and step buttons.
Definition: WorldControl.hh:70
Base class for Gazebo GUI plugins.
Definition: gz/gui/Plugin.hh:54
#define WorldControl_EXPORTS_API
Definition: WorldControl.hh:35