18 #ifndef IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 19 #define IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 25 #include <sdf/Material.hh> 26 #include <sdf/Physics.hh> 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(
172 class ComponentInspector :
public gazebo::GuiSystem
212 NOTIFY NestedModelChanged
216 public: ComponentInspector();
219 public: ~ComponentInspector()
override;
222 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
225 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
258 public: Q_INVOKABLE
void OnLight(
259 double _rSpecular,
double _gSpecular,
double _bSpecular,
260 double _aSpecular,
double _rDiffuse,
double _gDiffuse,
261 double _bDiffuse,
double _aDiffuse,
double _attRange,
262 double _attLinear,
double _attConstant,
double _attQuadratic,
263 bool _castShadows,
double _directionX,
double _directionY,
264 double _directionZ,
double _innerAngle,
double _outerAngle,
265 double _falloff,
double _intensity,
int _type,
bool _isLightOn,
266 bool _visualizeVisual);
271 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
272 double _realTimeFactor);
295 public: Q_INVOKABLE
void OnMaterialColor(
296 double _rAmbient,
double _gAmbient,
double _bAmbient,
297 double _aAmbient,
double _rDiffuse,
double _gDiffuse,
298 double _bDiffuse,
double _aDiffuse,
double _rSpecular,
299 double _gSpecular,
double _bSpecular,
double _aSpecular,
300 double _rEmissive,
double _gEmissive,
double _bEmissive,
301 double _aEmissive, QString _type, QColor _currColor);
309 public: Q_INVOKABLE
void OnSphericalCoordinates(QString _surface,
310 double _latitude,
double _longitude,
double _elevation,
315 public: Q_INVOKABLE
bool NestedModel()
const;
318 signals:
void NestedModelChanged();
321 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
325 public: Q_INVOKABLE
Entity GetEntity()
const;
329 public: Q_INVOKABLE
void SetEntity(
const Entity &_entity);
332 signals:
void EntityChanged();
336 public: Q_INVOKABLE QString Type()
const;
340 public: Q_INVOKABLE
void SetType(
const QString &_entity);
343 signals:
void TypeChanged();
347 public: Q_INVOKABLE
bool Locked()
const;
351 public: Q_INVOKABLE
void SetLocked(
bool _locked);
354 signals:
void LockedChanged();
358 public: Q_INVOKABLE
bool Paused()
const;
362 public: Q_INVOKABLE
void SetPaused(
bool _paused);
365 signals:
void PausedChanged();
373 public: transport::Node &TransportNode();
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
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: include/ignition/gazebo/Types.hh:90
Component< math::SphericalCoordinates, class SphericalCoordinatesTag, serializers::SphericalCoordinatesSerializer > SphericalCoordinates
This component holds the spherical coordinates of the world origin.
Definition: SphericalCoordinates.hh:45
Component< sdf::Material, class MaterialTag, serializers::MaterialSerializer > Material
This component holds an entity's material.
Definition: Material.hh:44
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: Light.hh:48
Vector3< double > Vector3d
Q_DECLARE_METATYPE(ComponentTypeId) namespace ignition
Definition: ComponentInspector.hh:39
This library is part of the Ignition Robotics project.
static constexpr bool value
Definition: Component.hh:72
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light. At its core, an Entity is just an identifier.
Definition: Entity.hh:59
Component< sdf::Physics, class PhysicsTag, serializers::PhysicsSerializer > Physics
A component type that contains the physics properties of the World entity.
Definition: include/ignition/gazebo/components/Physics.hh:50