Gazebo Sim

API Reference

9.0.0~pre1
Plot3D.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 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_3DPLOT_HH_
19#define GZ_SIM_GUI_3DPLOT_HH_
20
21#include <memory>
22
24
25#include "gz/gui/qt.h"
26
27#ifndef _WIN32
28# define Plot3D_EXPORTS_API __attribute__ ((visibility ("default")))
29#else
30# if (defined(Plot3D_EXPORTS))
31# define Plot3D_EXPORTS_API __declspec(dllexport)
32# else
33# define Plot3D_EXPORTS_API __declspec(dllimport)
34# endif
35#endif
36
37namespace gz
38{
39namespace sim
40{
41namespace gui
42{
43 class Plot3DPrivate;
44
73 {
74 Q_OBJECT
75
77 Q_PROPERTY(
78 Entity targetEntity
79 READ TargetEntity
80 WRITE SetTargetEntity
81 NOTIFY TargetEntityChanged
82 )
83
84
85 Q_PROPERTY(
86 QString targetName
87 READ TargetName
88 WRITE SetTargetName
89 NOTIFY TargetNameChanged
90 )
91
93 Q_PROPERTY(
94 bool locked
95 READ Locked
96 WRITE SetLocked
97 NOTIFY LockedChanged
98 )
99
101 Q_PROPERTY(
102 QVector3D offset
103 READ Offset
104 WRITE SetOffset
105 NOTIFY OffsetChanged
106 )
107
109 Q_PROPERTY(
110 QVector3D color
111 READ Color
112 WRITE SetColor
113 NOTIFY ColorChanged
114 )
115
117 Q_PROPERTY(
118 double minDistance
119 READ MinDistance
120 WRITE SetMinDistance
121 NOTIFY MinDistanceChanged
122 )
123
125 Q_PROPERTY(
126 int maxPoints
127 READ MaxPoints
128 WRITE SetMaxPoints
129 NOTIFY MaxPointsChanged
130 )
131
133 public: Plot3D();
134
136 public: ~Plot3D() override;
137
138 // Documentation inherited
139 public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override;
140
141 // Documentation inherited
142 public: void Update(const UpdateInfo &_info,
143 EntityComponentManager &_ecm) override;
144
147 public: Q_INVOKABLE Entity TargetEntity() const;
148
151 public: Q_INVOKABLE void SetTargetEntity(Entity _entity);
152
154 signals: void TargetEntityChanged();
155
158 public: Q_INVOKABLE QString TargetName() const;
159
162 public: Q_INVOKABLE void SetTargetName(const QString &_name);
163
165 signals: void TargetNameChanged();
166
169 public: Q_INVOKABLE bool Locked() const;
170
173 public: Q_INVOKABLE void SetLocked(bool _locked);
174
176 signals: void LockedChanged();
177
180 public: Q_INVOKABLE QVector3D Offset() const;
181
184 public: Q_INVOKABLE void SetOffset(const QVector3D &_offset);
185
187 signals: void OffsetChanged();
188
191 public: Q_INVOKABLE QVector3D Color() const;
192
195 public: Q_INVOKABLE void SetColor(const QVector3D &_color);
196
198 signals: void ColorChanged();
199
202 public: Q_INVOKABLE double MinDistance() const;
203
207 public: Q_INVOKABLE void SetMinDistance(double _minDistance);
208
210 signals: void MinDistanceChanged();
211
214 public: Q_INVOKABLE int MaxPoints() const;
215
219 public: Q_INVOKABLE void SetMaxPoints(int _maxPoints);
220
222 signals: void MaxPointsChanged();
223
224 // Documentation inherited
225 protected: bool eventFilter(QObject *_obj, QEvent *_event) override;
226
228 private: void ClearPlot();
229
232 private: std::unique_ptr<Plot3DPrivate> dataPtr;
233 };
234}
235}
236}
237
238#endif