18 #ifndef IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 19 #define IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 25 #include <sdf/Material.hh> 26 #include <sdf/Physics.hh> 43 class ComponentInspectorPrivate;
48 template <
class DataType>
49 void setData(QStandardItem *_item,
const DataType &_data)
57 setData(_item, ss.
str());
61 ignwarn <<
"Attempting to set unsupported data type to item [" 62 << _item->text().toStdString() <<
"]" <<
std::endl;
70 void setData(QStandardItem *_item,
const std::string &_data);
76 void setData(QStandardItem *_item,
const math::Pose3d &_data);
82 void setData(QStandardItem *_item,
const msgs::Light &_data);
94 void setData(QStandardItem *_item,
const sdf::Physics &_data);
106 void setData(QStandardItem *_item,
const bool &_data);
112 void setData(QStandardItem *_item,
const int &_data);
118 void setData(QStandardItem *_item,
const double &_data);
124 void setData(QStandardItem *_item,
const std::ostream &_data);
130 void setData(QStandardItem *_item,
const sdf::Material &_data);
136 void setUnit(QStandardItem *_item,
const std::string &_unit);
140 class ComponentsModel :
public QStandardItemModel
145 public:
explicit ComponentsModel();
148 public: ~ComponentsModel()
override =
default;
151 public: QHash<int, QByteArray> roleNames()
const override;
155 public:
static QHash<int, QByteArray> RoleNames();
160 public slots: QStandardItem *AddComponentType(
165 public slots:
void RemoveComponentType(
176 class ComponentInspector :
public gazebo::GuiSystem
216 NOTIFY NestedModelChanged
220 public: ComponentInspector();
223 public: ~ComponentInspector()
override;
226 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
229 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
238 public: Q_INVOKABLE
void OnPose(
double _x,
double _y,
double _z,
239 double _roll,
double _pitch,
double _yaw);
263 public: Q_INVOKABLE
void OnLight(
264 double _rSpecular,
double _gSpecular,
double _bSpecular,
265 double _aSpecular,
double _rDiffuse,
double _gDiffuse,
266 double _bDiffuse,
double _aDiffuse,
double _attRange,
267 double _attLinear,
double _attConstant,
double _attQuadratic,
268 bool _castShadows,
double _directionX,
double _directionY,
269 double _directionZ,
double _innerAngle,
double _outerAngle,
270 double _falloff,
double _intensity,
int _type);
275 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
276 double _realTimeFactor);
299 public: Q_INVOKABLE
void OnMaterialColor(
300 double _rAmbient,
double _gAmbient,
double _bAmbient,
301 double _aAmbient,
double _rDiffuse,
double _gDiffuse,
302 double _bDiffuse,
double _aDiffuse,
double _rSpecular,
303 double _gSpecular,
double _bSpecular,
double _aSpecular,
304 double _rEmissive,
double _gEmissive,
double _bEmissive,
305 double _aEmissive, QString _type, QColor _currColor);
313 public: Q_INVOKABLE
void OnSphericalCoordinates(QString _surface,
314 double _latitude,
double _longitude,
double _elevation,
319 public: Q_INVOKABLE
bool NestedModel()
const;
322 signals:
void NestedModelChanged();
325 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
329 public: Q_INVOKABLE
Entity GetEntity()
const;
333 public: Q_INVOKABLE
void SetEntity(
const Entity &_entity);
336 signals:
void EntityChanged();
340 public: Q_INVOKABLE QString Type()
const;
344 public: Q_INVOKABLE
void SetType(
const QString &_entity);
347 signals:
void TypeChanged();
351 public: Q_INVOKABLE
bool Locked()
const;
355 public: Q_INVOKABLE
void SetLocked(
bool _locked);
358 signals:
void LockedChanged();
362 public: Q_INVOKABLE
bool Paused()
const;
366 public: Q_INVOKABLE
void SetPaused(
bool _paused);
369 signals:
void PausedChanged();
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: 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:37
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