Go to the documentation of this file.
18 #ifndef IGNITION_GAZEBO_GUI_COMPONENTINSPECTOREDITOR_HH_
19 #define IGNITION_GAZEBO_GUI_COMPONENTINSPECTOREDITOR_HH_
25 #include <sdf/Material.hh>
26 #include <sdf/Physics.hh>
27 #include <sdf/Joint.hh>
29 #include <gz/math/Vector3.hh>
35 #include <gz/msgs/light.pb.h>
44 class ComponentInspectorEditorPrivate;
49 template <
class DataType>
50 void setData(QStandardItem *_item,
const DataType &_data)
58 setData(_item, ss.
str());
62 ignwarn <<
"Attempting to set unsupported data type to item ["
63 << _item->text().toStdString() <<
"]" <<
std::endl;
70 void setData(QStandardItem *_item,
const std::string &_data);
76 void setData(QStandardItem *_item,
const msgs::Light &_data);
88 void setData(QStandardItem *_item,
const sdf::Physics &_data);
100 void setData(QStandardItem *_item,
const bool &_data);
106 void setData(QStandardItem *_item,
const int &_data);
112 void setData(QStandardItem *_item,
const double &_data);
118 void setData(QStandardItem *_item,
const std::ostream &_data);
124 void setData(QStandardItem *_item,
const sdf::Material &_data);
130 void setUnit(QStandardItem *_item,
const std::string &_unit);
134 class ComponentsModel :
public QStandardItemModel
139 public:
explicit ComponentsModel();
142 public: ~ComponentsModel()
override =
default;
145 public: QHash<int, QByteArray> roleNames()
const override;
149 public:
static QHash<int, QByteArray> RoleNames();
154 public slots: QStandardItem *AddComponentType(
159 public slots:
void RemoveComponentType(
170 class ComponentInspectorEditor :
public gazebo::GuiSystem
192 QStringList modelParentLinks
193 READ ModelParentLinks
194 NOTIFY ModelLinksChanged
199 QStringList modelChildLinks
201 NOTIFY ModelLinksChanged
224 NOTIFY SimPausedChanged
231 NOTIFY NestedModelChanged
235 public: ComponentInspectorEditor();
238 public: ~ComponentInspectorEditor()
override;
241 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
244 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
268 public: Q_INVOKABLE
void OnLight(
269 double _rSpecular,
double _gSpecular,
double _bSpecular,
270 double _aSpecular,
double _rDiffuse,
double _gDiffuse,
271 double _bDiffuse,
double _aDiffuse,
double _attRange,
272 double _attLinear,
double _attConstant,
double _attQuadratic,
273 bool _castShadows,
double _directionX,
double _directionY,
274 double _directionZ,
double _innerAngle,
double _outerAngle,
275 double _falloff,
double _intensity,
int _type);
280 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
281 double _realTimeFactor);
304 public: Q_INVOKABLE
void OnMaterialColor(
305 double _rAmbient,
double _gAmbient,
double _bAmbient,
306 double _aAmbient,
double _rDiffuse,
double _gDiffuse,
307 double _bDiffuse,
double _aDiffuse,
double _rSpecular,
308 double _gSpecular,
double _bSpecular,
double _aSpecular,
309 double _rEmissive,
double _gEmissive,
double _bEmissive,
310 double _aEmissive, QString _type, QColor _currColor);
318 public: Q_INVOKABLE
void OnSphericalCoordinates(QString _surface,
319 double _latitude,
double _longitude,
double _elevation,
324 public: Q_INVOKABLE
bool NestedModel()
const;
327 signals:
void NestedModelChanged();
330 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
334 public: Q_INVOKABLE
Entity GetEntity()
const;
338 public: Q_INVOKABLE
void SetEntity(
const gazebo::Entity &_entity);
341 signals:
void EntityChanged();
345 public: Q_INVOKABLE QString Type()
const;
349 public: Q_INVOKABLE
void SetType(
const QString &_entity);
352 signals:
void TypeChanged();
356 public: Q_INVOKABLE
bool Locked()
const;
360 public: Q_INVOKABLE
void SetLocked(
bool _locked);
363 signals:
void LockedChanged();
367 public: Q_INVOKABLE
bool SimPaused()
const;
370 signals:
void SimPausedChanged();
374 public:
void SetSimPaused(
bool _paused);
378 public: Q_INVOKABLE
bool Paused()
const;
382 public: Q_INVOKABLE
void SetPaused(
bool _paused);
385 signals:
void PausedChanged();
390 public: Q_INVOKABLE
void OnAddEntity(
const QString &_entity,
391 const QString &_type);
397 public: Q_INVOKABLE
void OnAddJoint(
const QString &_jointType,
398 const QString &_parentLink,
399 const QString &_childLink);
404 public: Q_INVOKABLE QStringList ModelParentLinks()
const;
409 public: Q_INVOKABLE QStringList ModelChildLinks()
const;
413 public: Q_INVOKABLE
void SetModelLinks(
const QStringList &_modelLinks);
416 signals:
void ModelLinksChanged();
422 public: Q_INVOKABLE
void OnLoadMesh(
const QString &_entity,
423 const QString &_type,
const QString &_mesh);
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:58
This library is part of the Gazebo project.
std::function< void(EntityComponentManager &)> UpdateCallback
UpdateCallback is a function defition that is used by a component to manage ECM changes.
Definition: src/gui/plugins/component_inspector_editor/Types.hh:35
Component< math::SphericalCoordinates, class SphericalCoordinatesTag, serializers::SphericalCoordinatesSerializer > SphericalCoordinates
This component holds the spherical coordinates of the world origin.
Definition: gz/sim/components/SphericalCoordinates.hh:45
Component< sdf::Light, class LightTag, serializers::LightSerializer > Light
This component contains light source information. For more information on lights, see SDF's Light ele...
Definition: gz/sim/components/Light.hh:48
static constexpr bool value
Definition: gz/sim/components/Component.hh:72
Q_DECLARE_METATYPE(ignition::gazebo::ComponentTypeId) namespace ignition
Definition: ComponentInspectorEditor.hh:38
std::function< void(EntityComponentManager &, Entity, QStandardItem *)> ComponentCreator
Definition: src/gui/plugins/component_inspector_editor/Types.hh:43
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: include/gz/sim/Types.hh:90
Component< sdf::Material, class MaterialTag, serializers::MaterialSerializer > Material
This component holds an entity's material.
Definition: gz/sim/components/Material.hh:44
Component< sdf::Physics, class PhysicsTag, serializers::PhysicsSerializer > Physics
A component type that contains the physics properties of the World entity.
Definition: include/gz/sim/components/Physics.hh:50
Vector3< double > Vector3d