18 #ifndef IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 19 #define IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 41 class ComponentInspectorPrivate;
46 template <
class DataType>
47 void setData(QStandardItem *_item,
const DataType &_data)
55 setData(_item, ss.
str());
59 ignwarn <<
"Attempting to set unsupported data type to item [" 60 << _item->text().toStdString() <<
"]" <<
std::endl;
68 void setData(QStandardItem *_item,
const std::string &_data);
74 void setData(QStandardItem *_item,
const math::Pose3d &_data);
80 void setData(QStandardItem *_item,
const msgs::Light &_data);
92 void setData(QStandardItem *_item,
const sdf::Physics &_data);
98 void setData(QStandardItem *_item,
const bool &_data);
104 void setData(QStandardItem *_item,
const int &_data);
110 void setData(QStandardItem *_item,
const double &_data);
116 void setData(QStandardItem *_item,
const std::ostream &_data);
121 void setUnit(QStandardItem *_item,
const std::string &_unit);
125 class ComponentsModel :
public QStandardItemModel
130 public:
explicit ComponentsModel();
133 public: ~ComponentsModel()
override =
default;
136 public: QHash<int, QByteArray> roleNames()
const override;
140 public:
static QHash<int, QByteArray> RoleNames();
145 public slots: QStandardItem *AddComponentType(
150 public slots:
void RemoveComponentType(
161 class ComponentInspector :
public gazebo::GuiSystem
201 NOTIFY NestedModelChanged
205 public: ComponentInspector();
208 public: ~ComponentInspector()
override;
211 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
214 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
223 public: Q_INVOKABLE
void OnPose(
double _x,
double _y,
double _z,
224 double _roll,
double _pitch,
double _yaw);
248 public: Q_INVOKABLE
void OnLight(
249 double _rSpecular,
double _gSpecular,
double _bSpecular,
250 double _aSpecular,
double _rDiffuse,
double _gDiffuse,
251 double _bDiffuse,
double _aDiffuse,
double _attRange,
252 double _attLinear,
double _attConstant,
double _attQuadratic,
253 bool _castShadows,
double _directionX,
double _directionY,
254 double _directionZ,
double _innerAngle,
double _outerAngle,
255 double _falloff,
double _intensity,
int _type);
260 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
261 double _realTimeFactor);
265 public: Q_INVOKABLE
bool NestedModel()
const;
268 signals:
void NestedModelChanged();
271 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
275 public: Q_INVOKABLE
int Entity()
const;
279 public: Q_INVOKABLE
void SetEntity(
const int &_entity);
282 signals:
void EntityChanged();
286 public: Q_INVOKABLE QString Type()
const;
290 public: Q_INVOKABLE
void SetType(
const QString &_entity);
293 signals:
void TypeChanged();
297 public: Q_INVOKABLE
bool Locked()
const;
301 public: Q_INVOKABLE
void SetLocked(
bool _locked);
304 signals:
void LockedChanged();
308 public: Q_INVOKABLE
bool Paused()
const;
312 public: Q_INVOKABLE
void SetPaused(
bool _paused);
315 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:86
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:35
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