Go to the documentation of this file.
18 #ifndef GZ_GAZEBO_GUI_COMPONENTINSPECTOR_HH_
19 #define GZ_GAZEBO_GUI_COMPONENTINSPECTOR_HH_
25 #include <sdf/Material.hh>
26 #include <sdf/Physics.hh>
28 #include <gz/math/Vector3.hh>
29 #include <gz/transport/Node.hh>
37 #include <gz/msgs/light.pb.h>
45 class ComponentInspectorPrivate;
50 template <
class DataType>
51 void setData(QStandardItem *_item,
const DataType &_data)
59 setData(_item, ss.
str());
63 ignwarn <<
"Attempting to set unsupported data type to item ["
64 << _item->text().toStdString() <<
"]" <<
std::endl;
72 void setData(QStandardItem *_item,
const std::string &_data);
78 void setData(QStandardItem *_item,
const msgs::Light &_data);
90 void setData(QStandardItem *_item,
const sdf::Physics &_data);
102 void setData(QStandardItem *_item,
const bool &_data);
108 void setData(QStandardItem *_item,
const int &_data);
114 void setData(QStandardItem *_item,
const double &_data);
120 void setData(QStandardItem *_item,
const std::ostream &_data);
126 void setData(QStandardItem *_item,
const sdf::Material &_data);
132 void setUnit(QStandardItem *_item,
const std::string &_unit);
136 class ComponentsModel :
public QStandardItemModel
141 public:
explicit ComponentsModel();
144 public: ~ComponentsModel()
override =
default;
147 public: QHash<int, QByteArray> roleNames()
const override;
151 public:
static QHash<int, QByteArray> RoleNames();
156 public slots: QStandardItem *AddComponentType(
161 public slots:
void RemoveComponentType(
212 NOTIFY NestedModelChanged
217 QStringList systemNameList
219 WRITE SetSystemNameList
220 NOTIFY SystemNameListChanged
224 public: ComponentInspector();
227 public: ~ComponentInspector()
override;
230 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
233 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
266 public: Q_INVOKABLE
void OnLight(
267 double _rSpecular,
double _gSpecular,
double _bSpecular,
268 double _aSpecular,
double _rDiffuse,
double _gDiffuse,
269 double _bDiffuse,
double _aDiffuse,
double _attRange,
270 double _attLinear,
double _attConstant,
double _attQuadratic,
271 bool _castShadows,
double _directionX,
double _directionY,
272 double _directionZ,
double _innerAngle,
double _outerAngle,
273 double _falloff,
double _intensity,
int _type,
bool _isLightOn,
274 bool _visualizeVisual);
279 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
280 double _realTimeFactor);
303 public: Q_INVOKABLE
void OnMaterialColor(
304 double _rAmbient,
double _gAmbient,
double _bAmbient,
305 double _aAmbient,
double _rDiffuse,
double _gDiffuse,
306 double _bDiffuse,
double _aDiffuse,
double _rSpecular,
307 double _gSpecular,
double _bSpecular,
double _aSpecular,
308 double _rEmissive,
double _gEmissive,
double _bEmissive,
309 double _aEmissive, QString _type, QColor _currColor);
317 public: Q_INVOKABLE
void OnSphericalCoordinates(QString _surface,
318 double _latitude,
double _longitude,
double _elevation,
323 public: Q_INVOKABLE
bool NestedModel()
const;
326 signals:
void NestedModelChanged();
329 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
333 public: Q_INVOKABLE
Entity GetEntity()
const;
337 public: Q_INVOKABLE
void SetEntity(
const Entity &_entity);
340 signals:
void EntityChanged();
344 public: Q_INVOKABLE QString Type()
const;
348 public: Q_INVOKABLE
void SetType(
const QString &_entity);
351 signals:
void TypeChanged();
355 public: Q_INVOKABLE
bool Locked()
const;
359 public: Q_INVOKABLE
void SetLocked(
bool _locked);
362 signals:
void LockedChanged();
366 public: Q_INVOKABLE
bool Paused()
const;
370 public: Q_INVOKABLE
void SetPaused(
bool _paused);
373 signals:
void PausedChanged();
381 public: transport::Node &TransportNode();
384 public: Q_INVOKABLE
void QuerySystems();
388 public: Q_INVOKABLE QStringList SystemNameList()
const;
392 public: Q_INVOKABLE
void SetSystemNameList(
393 const QStringList &_systemNameList);
396 signals:
void SystemNameListChanged();
402 public: Q_INVOKABLE
void OnAddSystem(
const QString &_name,
403 const QString &_filename,
const QString &_innerxml);
Base class for a GUI System.
Definition: gz/sim/gui/GuiSystem.hh:44
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(const EntityComponentManager &_ecm, QStandardItem *_item)> UpdateViewCb
Function definition that a component can use to update its UI elements based on changes from the ECM.
Definition: src/gui/plugins/component_inspector/Types.hh:37
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
Q_DECLARE_METATYPE(ignition::gazebo::ComponentTypeId) namespace ignition
Definition: ComponentInspector.hh:39
static constexpr bool value
Definition: gz/sim/components/Component.hh:72
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