18 #ifndef GZ_SIM_GUI_JOINTPOSITIONCONTROLLER_HH_
19 #define GZ_SIM_GUI_JOINTPOSITIONCONTROLLER_HH_
36 class JointPositionControllerPrivate;
39 class JointsModel :
public QStandardItemModel
44 public:
explicit JointsModel();
47 public: ~JointsModel()
override =
default;
50 public: QHash<int, QByteArray> roleNames()
const override;
54 public:
static QHash<int, QByteArray> RoleNames();
59 public slots: QStandardItem *AddJoint(
Entity _entity);
63 public slots:
void RemoveJoint(
Entity _entity);
66 public slots:
void Clear();
91 class JointPositionController :
public sim::GuiSystem
100 NOTIFY ModelEntityChanged
108 NOTIFY ModelNameChanged
120 public: JointPositionController();
123 public: ~JointPositionController()
override;
126 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
129 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
134 public: Q_INVOKABLE
void OnCommand(
const QString &_jointName,
double _pos);
137 public: Q_INVOKABLE
void OnReset();
141 public: Q_INVOKABLE
Entity ModelEntity()
const;
145 public: Q_INVOKABLE
void SetModelEntity(
Entity _entity);
148 signals:
void ModelEntityChanged();
152 public: Q_INVOKABLE QString ModelName()
const;
156 public: Q_INVOKABLE
void SetModelName(
const QString &_name);
159 signals:
void ModelNameChanged();
163 public: Q_INVOKABLE
bool Locked()
const;
167 public: Q_INVOKABLE
void SetLocked(
bool _locked);
170 signals:
void LockedChanged();
173 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;