Gazebo Gui

API Reference

9.0.0~pre1
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#include <gz/utils/ImplPtr.hh>
28
29#ifndef _WIN32
30# define WorldControl_EXPORTS_API __attribute__ ((visibility ("default")))
31#else
32# if (defined(WorldControl_EXPORTS))
33# define WorldControl_EXPORTS_API __declspec(dllexport)
34# else
35# define WorldControl_EXPORTS_API __declspec(dllimport)
36# endif
37#endif
38
39namespace gz::gui::plugins
40{
60 {
61 Q_OBJECT
62
64 public: WorldControl();
65
67 public: ~WorldControl() override;
68
69 // Documentation inherited
70 public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override;
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 GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr)
105 };
106} // namespace gz::gui::plugins
107
108#endif // GZ_GUI_PLUGINS_WORLDCONTROL_HH_