Gazebo Sim

API Reference

8.7.0
EnvironmentLoader.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 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_SIM_GUI_ENVIRONMENTLOADER_HH_
19 #define GZ_SIM_GUI_ENVIRONMENTLOADER_HH_
20 
21 #include <memory>
22 
23 #include "gz/sim/gui/GuiSystem.hh"
24 #include "gz/gui/qt.h"
25 
26 namespace gz
27 {
28 namespace sim
29 {
30 // Inline bracket to help doxygen filtering.
31 inline namespace GZ_SIM_VERSION_NAMESPACE
32 {
33  class EnvironmentLoaderPrivate;
34 
40  {
41  Q_OBJECT
42 
44  Q_PROPERTY(
45  QString dataPath
46  READ DataPath
47  WRITE SetDataPath
48  NOTIFY DataPathChanged
49  )
50 
51 
52  Q_PROPERTY(
53  QStringList dimensionList
54  READ DimensionList
56  )
57 
58 
59  Q_PROPERTY(
60  QStringList unitList
61  READ UnitList
62  )
63 
64 
65  Q_PROPERTY(
66  QString unit
67  READ Unit
68  WRITE SetUnit
69  NOTIFY UnitChanged
70  )
71 
72 
73  Q_PROPERTY(
74  int timeIndex
75  READ TimeIndex
76  WRITE SetTimeIndex
77  NOTIFY TimeIndexChanged
78  )
79 
80 
81  Q_PROPERTY(
82  int xIndex
83  READ XIndex
84  WRITE SetXIndex
85  NOTIFY XIndexChanged
86  )
87 
88 
89  Q_PROPERTY(
90  int yIndex
91  READ YIndex
92  WRITE SetYIndex
93  NOTIFY YIndexChanged
94  )
95 
96 
97  Q_PROPERTY(
98  int zIndex
99  READ ZIndex
100  WRITE SetZIndex
101  NOTIFY ZIndexChanged
102  )
103 
104 
105  Q_PROPERTY(
106  QStringList referenceList
107  READ ReferenceList
108  )
109 
110 
111  Q_PROPERTY(
112  QString reference
113  READ Reference
114  WRITE SetReference
115  NOTIFY ReferenceChanged
116  )
117 
118 
119  Q_PROPERTY(
120  bool configured
121  READ IsConfigured
122  NOTIFY IsConfiguredChanged
123  )
124 
125 
126  public: EnvironmentLoader();
127 
129  public: ~EnvironmentLoader() override;
130 
131  // Documentation inherited
132  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override;
133 
134  // Documentation inherited
135  public: void Update(const UpdateInfo &,
136  EntityComponentManager &_ecm) override;
137 
139  public: Q_INVOKABLE QString DataPath() const;
140 
142  signals: void DataPathChanged();
143 
145  public: Q_INVOKABLE void SetDataPath(QString _dataPath);
146 
148  public: Q_INVOKABLE void SetDataUrl(QUrl _dataUrl);
149 
151  public: Q_INVOKABLE QStringList DimensionList() const;
152 
154  public: Q_INVOKABLE QStringList UnitList() const;
155 
157  signals: void DimensionListChanged();
158 
160  public: Q_INVOKABLE int TimeIndex() const;
161 
163  public: Q_INVOKABLE void SetTimeIndex(int _timeIndex);
164 
166  signals: void TimeIndexChanged() const;
167 
169  public: Q_INVOKABLE int XIndex() const;
170 
172  public: Q_INVOKABLE void SetXIndex(int _xIndex);
173 
175  signals: void XIndexChanged() const;
176 
178  public: Q_INVOKABLE int YIndex() const;
179 
181  signals: void YIndexChanged() const;
182 
184  public: Q_INVOKABLE void SetYIndex(int _yIndex);
185 
187  public: Q_INVOKABLE int ZIndex() const;
188 
190  public: Q_INVOKABLE void SetZIndex(int _zIndex);
191 
193  signals: void ZIndexChanged() const;
194 
196  public: Q_INVOKABLE QStringList ReferenceList() const;
197 
199  public: Q_INVOKABLE QString Reference() const;
200 
202  public: Q_INVOKABLE void SetReference(QString _reference);
203 
205  signals: void ReferenceChanged() const;
206 
208  public: Q_INVOKABLE QString Unit() const;
209 
211  public: Q_INVOKABLE void SetUnit(QString _unit);
212 
214  signals: void UnitChanged() const;
215 
217  public: Q_INVOKABLE bool IsConfigured() const;
218 
220  signals: void IsConfiguredChanged();
221 
223  public: Q_INVOKABLE void ScheduleLoad();
224 
227  private: std::unique_ptr<EnvironmentLoaderPrivate> dataPtr;
228  };
229 }
230 }
231 }
232 #endif