17 #ifndef IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_POSE3D_HH_ 18 #define IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_POSE3D_HH_ 30 #include <QStandardItem> 36 class ComponentInspector;
49 public:
explicit Pose3d(ComponentInspector *_inspector);
56 template<
typename ComponentType>
63 auto comp = _ecm.
Component<ComponentType>(this->inspector->GetEntity());
67 auto pose = comp->Data();
69 _item->setData(QString(
"Pose3d"),
70 ComponentsModel::RoleNames().key(
"dataType"));
71 _item->setData(QList({
72 QVariant(pose.Pos().X()),
73 QVariant(pose.Pos().Y()),
74 QVariant(pose.Pos().Z()),
75 QVariant(pose.Rot().Roll()),
76 QVariant(pose.Rot().Pitch()),
77 QVariant(pose.Rot().Yaw())
78 }), ComponentsModel::RoleNames().key(
"data"));
88 public: Q_INVOKABLE
void OnPose(
double _x,
double _y,
double _z,
89 double _roll,
double _pitch,
double _yaw);
93 private: ComponentInspector *inspector{
nullptr};
Pose3d(ComponentInspector *_inspector)
Constructor.
const ComponentTypeT * Component(const Entity _entity) const
Get a component assigned to an entity based on a component type.
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:66
void UpdateView(const EntityComponentManager &_ecm, QStandardItem *_item)
Callback when there are ECM updates.
Definition: Pose3d.hh:57
Q_INVOKABLE void OnPose(double _x, double _y, double _z, double _roll, double _pitch, double _yaw)
Callback in Qt thread when pose changes.
Handles components that are displayed as a 3D pose:
Definition: Pose3d.hh:43
This library is part of the Ignition Robotics project.