Gazebo Gui

API Reference

9.0.0~pre1
GridConfig.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 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_GRIDCONFIG_HH_
19#define GZ_GUI_GRIDCONFIG_HH_
20
21#include <memory>
22
23#include <gz/gui/Plugin.hh>
24
25#include <gz/utils/ImplPtr.hh>
26
27namespace gz::gui::plugins
28{
29 class GridConfigPrivate;
30
48 {
49 Q_OBJECT
50
52 Q_PROPERTY(
53 QStringList nameList
54 READ NameList
55 WRITE SetNameList
56 NOTIFY NameListChanged
57 )
58
59
60 public: GridConfig();
61
63 public: ~GridConfig() override;
64
65 // Documentation inherited
66 public: void LoadConfig(const tinyxml2::XMLElement *) override;
67
68 // Documentation inherited
69 protected: bool eventFilter(QObject *_obj, QEvent *_event) override;
70
72 public: void CreateGrids();
73
75 public: void UpdateGrid();
76
78 public: void ConnectToGrid();
79
81 public: void RefreshList();
82
84 public slots: void OnRefresh();
85
88 public slots: void OnName(const QString &_name);
89
92 public slots: QStringList NameList() const;
93
96 public slots: void SetNameList(const QStringList &_nameList);
97
99 signals: void NameListChanged();
100
103 public slots: void UpdateVCellCount(int _cellCount);
104
107 public slots: void UpdateHCellCount(int _cellCount);
108
111 public slots: void UpdateCellLength(double _length);
112
116 public slots: void SetPose(double _x, double _y, double _z,
117 double _roll, double _pitch, double _yaw);
118
121 public slots: void SetColor(double _r, double _g, double _b, double _a);
122
125 public slots: void OnShow(bool _checked);
126
134 signals: void newParams(
135 int _hCellCount,
136 int _vCellCount,
137 double _cellLength,
138 QVector3D _pos,
139 QVector3D _rot,
140 QColor _color);
141
144 private: GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr)
145 };
146} // namespace gz::gui::plugins
147#endif // GZ_GUI_PLUGINS_GRIDCONFIG_HH_