Gazebo Gui

API Reference

7.2.2
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 #include <gz/msgs/world_stats.pb.h>
24 
25 #include "gz/gui/Plugin.hh"
26 
27 #ifndef _WIN32
28 # define WorldControl_EXPORTS_API
29 #else
30 # if (defined(WorldControl_EXPORTS))
31 # define WorldControl_EXPORTS_API __declspec(dllexport)
32 # else
33 # define WorldControl_EXPORTS_API __declspec(dllimport)
34 # endif
35 #endif
36 
37 namespace gz::gui::plugins
38 {
39  class WorldControlPrivate;
40 
60  {
61  Q_OBJECT
62 
64  public: WorldControl();
65 
67  public: virtual ~WorldControl();
68 
69  // Documentation inherited
70  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
71 
73  public slots: void ProcessMsg();
74 
76  public slots: void OnPlay();
77 
79  public slots: void OnPause();
80 
82  public slots: void OnReset();
83 
85  public slots: void OnStep();
86 
89  public slots: void OnStepCount(const unsigned int _steps);
90 
92  signals: void playing();
93 
95  signals: void paused();
96 
98  signals: void reset();
99 
101  private: void OnWorldStatsMsg(const gz::msgs::WorldStatistics &_msg);
102 
103  // Private data
104  private: std::unique_ptr<WorldControlPrivate> dataPtr;
105  };
106 } // namespace gz::gui::plugins
107 
108 #endif // GZ_GUI_PLUGINS_WORLDCONTROL_HH_