Go to the documentation of this file.
18 #ifndef GZ_GAZEBO_GUI_COMPONENTINSPECTOR_HH_
19 #define GZ_GAZEBO_GUI_COMPONENTINSPECTOR_HH_
24 #include <gz/math/Vector3.hh>
25 #include <gz/transport/Node.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);
80 void setData(QStandardItem *_item,
const sdf::Physics &_data);
86 void setData(QStandardItem *_item,
const bool &_data);
92 void setData(QStandardItem *_item,
const int &_data);
98 void setData(QStandardItem *_item,
const double &_data);
104 void setData(QStandardItem *_item,
const std::ostream &_data);
109 void setUnit(QStandardItem *_item,
const std::string &_unit);
113 class ComponentsModel :
public QStandardItemModel
118 public:
explicit ComponentsModel();
121 public: ~ComponentsModel()
override =
default;
124 public: QHash<int, QByteArray> roleNames()
const override;
128 public:
static QHash<int, QByteArray> RoleNames();
133 public slots: QStandardItem *AddComponentType(
138 public slots:
void RemoveComponentType(
189 NOTIFY NestedModelChanged
193 public: ComponentInspector();
196 public: ~ComponentInspector()
override;
199 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
202 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
214 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
215 double _realTimeFactor);
219 public: Q_INVOKABLE
bool NestedModel()
const;
222 signals:
void NestedModelChanged();
225 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
229 public: Q_INVOKABLE
Entity GetEntity()
const;
233 public: Q_INVOKABLE
void SetEntity(
const Entity &_entity);
236 signals:
void EntityChanged();
240 public: Q_INVOKABLE QString Type()
const;
244 public: Q_INVOKABLE
void SetType(
const QString &_entity);
247 signals:
void TypeChanged();
251 public: Q_INVOKABLE
bool Locked()
const;
255 public: Q_INVOKABLE
void SetLocked(
bool _locked);
258 signals:
void LockedChanged();
262 public: Q_INVOKABLE
bool Paused()
const;
266 public: Q_INVOKABLE
void SetPaused(
bool _paused);
269 signals:
void PausedChanged();
277 public: transport::Node &TransportNode();
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:59
This library is part of the Ignition Robotics 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
Q_DECLARE_METATYPE(ignition::gazebo::ComponentTypeId) namespace ignition
Definition: ComponentInspector.hh:35
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:87
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:48
Vector3< double > Vector3d