18 #ifndef IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 19 #define IGNITION_GAZEBO_GUI_COMPONENTINSPECTOR_HH_ 25 #include <sdf/Physics.hh> 42 class ComponentInspectorPrivate;
47 template <
class DataType>
48 void setData(QStandardItem *_item,
const DataType &_data)
56 setData(_item, ss.
str());
60 ignwarn <<
"Attempting to set unsupported data type to item [" 61 << _item->text().toStdString() <<
"]" <<
std::endl;
69 void setData(QStandardItem *_item,
const std::string &_data);
75 void setData(QStandardItem *_item,
const math::Pose3d &_data);
81 void setData(QStandardItem *_item,
const msgs::Light &_data);
93 void setData(QStandardItem *_item,
const sdf::Physics &_data);
105 void setData(QStandardItem *_item,
const bool &_data);
111 void setData(QStandardItem *_item,
const int &_data);
117 void setData(QStandardItem *_item,
const double &_data);
123 void setData(QStandardItem *_item,
const std::ostream &_data);
128 void setUnit(QStandardItem *_item,
const std::string &_unit);
132 class ComponentsModel :
public QStandardItemModel
137 public:
explicit ComponentsModel();
140 public: ~ComponentsModel()
override =
default;
143 public: QHash<int, QByteArray> roleNames()
const override;
147 public:
static QHash<int, QByteArray> RoleNames();
152 public slots: QStandardItem *AddComponentType(
157 public slots:
void RemoveComponentType(
168 class ComponentInspector :
public gazebo::GuiSystem
208 NOTIFY NestedModelChanged
212 public: ComponentInspector();
215 public: ~ComponentInspector()
override;
218 public:
void LoadConfig(
const tinyxml2::XMLElement *_pluginElem)
override;
221 public:
void Update(
const UpdateInfo &, EntityComponentManager &)
override;
230 public: Q_INVOKABLE
void OnPose(
double _x,
double _y,
double _z,
231 double _roll,
double _pitch,
double _yaw);
255 public: Q_INVOKABLE
void OnLight(
256 double _rSpecular,
double _gSpecular,
double _bSpecular,
257 double _aSpecular,
double _rDiffuse,
double _gDiffuse,
258 double _bDiffuse,
double _aDiffuse,
double _attRange,
259 double _attLinear,
double _attConstant,
double _attQuadratic,
260 bool _castShadows,
double _directionX,
double _directionY,
261 double _directionZ,
double _innerAngle,
double _outerAngle,
262 double _falloff,
double _intensity,
int _type);
267 public: Q_INVOKABLE
void OnPhysics(
double _stepSize,
268 double _realTimeFactor);
276 public: Q_INVOKABLE
void OnSphericalCoordinates(QString _surface,
277 double _latitude,
double _longitude,
double _elevation,
282 public: Q_INVOKABLE
bool NestedModel()
const;
285 signals:
void NestedModelChanged();
288 protected:
bool eventFilter(QObject *_obj, QEvent *_event)
override;
292 public: Q_INVOKABLE
int Entity()
const;
296 public: Q_INVOKABLE
void SetEntity(
const int &_entity);
299 signals:
void EntityChanged();
303 public: Q_INVOKABLE QString Type()
const;
307 public: Q_INVOKABLE
void SetType(
const QString &_entity);
310 signals:
void TypeChanged();
314 public: Q_INVOKABLE
bool Locked()
const;
318 public: Q_INVOKABLE
void SetLocked(
bool _locked);
321 signals:
void LockedChanged();
325 public: Q_INVOKABLE
bool Paused()
const;
329 public: Q_INVOKABLE
void SetPaused(
bool _paused);
332 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::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:36
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