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:
const std::map<std::string, ignition::math::Vector3d> &Scales()
134 public:
void UpdateInspectorScale();
140 public:
void SetScales(
141 const std::map<std::string, ignition::math::Vector3d> &_scales);
151 const msgs::Collision *_msg =
NULL);
154 public:
void UpdateConfig();
159 public:
LinkData *Clone(
const std::string &_newName);
163 public slots:
void ShowCollisions(
const bool _show);
167 public slots:
void ShowVisuals(
const bool _show);
171 public slots:
void ShowLinkFrame(
const bool _show);
176 public:
static double ComputeVolume(
const msgs::Collision &_collision);
182 public:
static ignition::math::Vector3d ComputeMomentOfInertia(
183 const msgs::Collision &_collision,
const double _mass);
187 public:
double ComputeVolume()
const;
198 private:
void Update();
202 private:
bool Apply();
206 private slots:
void OnAccept();
210 private slots:
void OnApply();
214 private slots:
void OnAddVisual(
const std::string &_name);
218 private slots:
void OnAddCollision(
const std::string &_name);
222 private slots:
void OnRemoveVisual(
const std::string &_name);
226 private slots:
void OnRemoveCollision(
const std::string &_name);
231 private slots:
void OnShowCollision(
const bool _show,
232 const std::string &_name);
237 private slots:
void OnShowVisual(
const bool _show,
238 const std::string &_name);
241 private slots:
void OnInspectorOpened();
244 private: std::vector<event::ConnectionPtr> connections;
247 private: boost::recursive_mutex *updateMutex;
253 private:
double mass;
256 private:
double inertiaIxx;
259 private:
double inertiaIyy;
262 private:
double inertiaIzz;
266 public: std::map<std::string, ignition::math::Vector3d>
scales;
272 public: std::map<rendering::VisualPtr, msgs::Visual>
visuals;
284 public: std::map<rendering::VisualPtr, msgs::Collision>
collisions;
299 public:
bool showCollisions =
true;
302 public:
bool showVisuals =
true;
305 public:
bool showLinkFrame =
true;
321 public:
void Load(sdf::ElementPtr _pluginElem);
std::map< std::string, ignition::math::Vector3d > scales
Scale of all collisions and visuals in the link, indexed by their visual's names. ...
Definition: ModelData.hh:266
Definition: LinkInspector.hh:39
rendering::VisualPtr modelVisual
Visual representing this model.
Definition: ModelData.hh:83
std::map< rendering::VisualPtr, msgs::Visual > visuals
Visuals of the link.
Definition: ModelData.hh:272
sdf::ElementPtr linkSDF
SDF representing the link data.
Definition: ModelData.hh:250
Definition: ModelData.hh:39
std::map< rendering::VisualPtr, msgs::Collision > deletedCollisions
Deleted collisions of the link.
Definition: ModelData.hh:287
std::vector< msgs::Collision * > collisionUpdateMsgs
Msgs for updating collision visuals.
Definition: ModelData.hh:281
Helper class to store nested models data.
Definition: ModelData.hh:57
Inspector for model plugin properties.
Definition: ModelPluginInspector.hh:34
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:293
ModelPluginInspector * inspector
Inspector for configuring model plugin properties.
Definition: ModelData.hh:324
Helper class to store model plugin data.
Definition: ModelData.hh:309
rendering::LinkFrameVisualPtr linkFrameVis
Link frame visual.
Definition: ModelData.hh:290
Helper class to store link data.
Definition: ModelData.hh:94
sdf::ElementPtr modelPluginSDF
SDF representing the model plugin data.
Definition: ModelData.hh:327
std::shared_ptr< LinkFrameVisual > LinkFrameVisualPtr
Definition: RenderTypes.hh:182
#define NULL
Definition: CommonTypes.hh:31
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
std::map< rendering::VisualPtr, msgs::Visual > deletedVisuals
Deleted visuals of the link.
Definition: ModelData.hh:275
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:296
sdf::ElementPtr modelSDF
SDF representing the model data.
Definition: ModelData.hh:80
std::vector< msgs::Visual * > visualUpdateMsgs
Msgs for updating visuals.
Definition: ModelData.hh:278
std::map< rendering::VisualPtr, msgs::Collision > collisions
Collisions of the link.
Definition: ModelData.hh:284