17 #ifndef _GAZEBO_MODEL_DATA_HH_
18 #define _GAZEBO_MODEL_DATA_HH_
29 class recursive_mutex;
37 class ModelPluginInspector;
43 public:
static std::string GetTemplateSDFString();
47 public:
static double GetEditTransparency();
61 public:
void SetName(
const std::string &_name);
65 public: std::string Name()
const;
69 public:
void SetPose(
const ignition::math::Pose3d &_pose);
73 public: ignition::math::Pose3d Pose()
const;
77 public:
int Depth()
const;
86 public: std::map<std::string, rendering::VisualWeakPtr>
models;
89 public: std::map<std::string, rendering::VisualWeakPtr>
links;
106 public: std::string Name()
const;
110 public:
void SetName(
const std::string &_name);
114 public: ignition::math::Pose3d Pose()
const;
118 public:
void SetPose(
const ignition::math::Pose3d &_pose3d);
122 public:
void Load(sdf::ElementPtr _sdf);
126 public: ignition::math::Vector3d Scale()
const;
130 public:
void SetScale(
const ignition::math::Vector3d &_scale);
140 const msgs::Collision *_msg =
NULL);
143 public:
void UpdateConfig();
148 public:
LinkData *Clone(
const std::string &_newName);
153 public:
static double ComputeVolume(
const msgs::Collision &_collision);
159 public:
static ignition::math::Vector3d ComputeMomentOfInertia(
160 const msgs::Collision &_collision,
const double _mass);
164 public:
double ComputeVolume()
const;
175 private:
void Update();
179 private:
bool Apply();
183 private slots:
void OnAccept();
187 private slots:
void OnApply();
191 private slots:
void OnAddVisual(
const std::string &_name);
195 private slots:
void OnAddCollision(
const std::string &_name);
199 private slots:
void OnRemoveVisual(
const std::string &_name);
203 private slots:
void OnRemoveCollision(
const std::string &_name);
206 private: std::vector<event::ConnectionPtr> connections;
209 private: boost::recursive_mutex *updateMutex;
215 private:
double mass;
218 private:
double inertiaIxx;
221 private:
double inertiaIyy;
224 private:
double inertiaIzz;
227 public: ignition::math::Vector3d
scale;
233 public: std::map<rendering::VisualPtr, msgs::Visual>
visuals;
242 public: std::map<rendering::VisualPtr, msgs::Collision>
collisions;
264 public:
void Load(sdf::ElementPtr _pluginElem);
Definition: LinkInspector.hh:40
rendering::VisualPtr modelVisual
Visual representing this model.
Definition: ModelData.hh:83
rendering::VisualPtr linkVisual
Visual representing this link.
Definition: ModelData.hh:230
std::map< rendering::VisualPtr, msgs::Visual > visuals
Visuals of the link.
Definition: ModelData.hh:233
sdf::ElementPtr linkSDF
SDF representing the link data.
Definition: ModelData.hh:212
Definition: ModelData.hh:39
std::vector< msgs::Collision * > collisionUpdateMsgs
Msgs for updating collision visuals.
Definition: ModelData.hh:239
ignition::math::Vector3d scale
Scale of link.
Definition: ModelData.hh:227
Helper class to store nested models data.
Definition: ModelData.hh:57
Inspector for model plugin properties.
Definition: ModelPluginInspector.hh:35
std::map< std::string, rendering::VisualWeakPtr > links
Links inside this model.
Definition: ModelData.hh:89
LinkInspector * inspector
Inspector for configuring link properties.
Definition: ModelData.hh:245
ModelPluginInspector * inspector
Inspector for configuring model plugin properties.
Definition: ModelData.hh:267
Helper class to store model plugin data.
Definition: ModelData.hh:252
Helper class to store link data.
Definition: ModelData.hh:94
sdf::ElementPtr modelPluginSDF
SDF representing the model plugin data.
Definition: ModelData.hh:270
#define NULL
Definition: CommonTypes.hh:31
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
std::map< std::string, rendering::VisualWeakPtr > models
Models inside this model.
Definition: ModelData.hh:86
bool nested
Flag set to true if this is a link of a nested model.
Definition: ModelData.hh:248
sdf::ElementPtr modelSDF
SDF representing the model data.
Definition: ModelData.hh:80
std::vector< msgs::Visual * > visualUpdateMsgs
Msgs for updating visuals.
Definition: ModelData.hh:236
std::map< rendering::VisualPtr, msgs::Collision > collisions
Collisions of the link.
Definition: ModelData.hh:242