Helper class to store link data. More...
#include <ModelData.hh>
Inherits QObject.
Public Slots | |
void | ShowCollisions (const bool _show) |
Show or hide collision visuals. More... | |
void | ShowLinkFrame (const bool _show) |
Show or hide link frame visuals. More... | |
void | ShowVisuals (const bool _show) |
Show or hide visual visuals. More... | |
Public Member Functions | |
LinkData () | |
Constructor. More... | |
~LinkData () | |
Destructor. More... | |
void | AddCollision (rendering::VisualPtr _collisionVis, const msgs::Collision *_msg=NULL) |
Add a collision to the link. More... | |
void | AddVisual (rendering::VisualPtr _visual) |
Add a visual to the link. More... | |
LinkData * | Clone (const std::string &_newName) |
Clone the link data. More... | |
double | ComputeVolume () const |
Computes the volume of the link. More... | |
rendering::VisualPtr | LinkVisual () const |
Get the visual for the link. More... | |
void | Load (sdf::ElementPtr _sdf) |
Load the link with data from SDF. More... | |
std::string | Name () const |
Get the name of the link. More... | |
ignition::math::Pose3d | Pose () const |
Get the pose of the link. More... | |
const std::map< std::string, ignition::math::Vector3d > & | Scales () const |
Get the scale of all of the link's children. More... | |
void | SetLinkVisual (const rendering::VisualPtr _visual) |
Set the visual for the link. More... | |
void | SetName (const std::string &_name) |
Set the name of the link. More... | |
void | SetPose (const ignition::math::Pose3d &_pose3d) |
Set the pose of the link. More... | |
void | SetScales (const std::map< std::string, ignition::math::Vector3d > &_scales) |
Set the scales of the link. More... | |
void | UpdateConfig () |
Update the inspector widget if necessary. More... | |
void | UpdateInspectorScale () |
Update the scale of all the inspectors, making the necessary conversions to update inertial information. More... | |
Static Public Member Functions | |
static ignition::math::Vector3d | ComputeMomentOfInertia (const msgs::Collision &_collision, const double _mass) |
Computes mass moment of inertia for a link. More... | |
static double | ComputeVolume (const msgs::Collision &_collision) |
Computes the volume of a link. More... | |
Public Attributes | |
std::map< rendering::VisualPtr, msgs::Collision > | collisions |
Collisions of the link. More... | |
std::vector< msgs::Collision * > | collisionUpdateMsgs |
Msgs for updating collision visuals. More... | |
std::map< rendering::VisualPtr, msgs::Collision > | deletedCollisions |
Deleted collisions of the link. More... | |
std::map< rendering::VisualPtr, msgs::Visual > | deletedVisuals |
Deleted visuals of the link. More... | |
LinkInspector * | inspector |
Inspector for configuring link properties. More... | |
rendering::LinkFrameVisualPtr | linkFrameVis |
Link frame visual. More... | |
sdf::ElementPtr | linkSDF |
SDF representing the link data. More... | |
bool | nested |
Flag set to true if this is a link of a nested model. More... | |
std::map< std::string, ignition::math::Vector3d > | scales |
Scale of all collisions and visuals in the link, indexed by their visual's names. More... | |
bool | showCollisions = true |
True if all collisions are currently visible, false otherwise. More... | |
bool | showLinkFrame = true |
True if all link frames are currently visible, false otherwise. More... | |
bool | showVisuals = true |
True if all visuals are currently visible, false otherwise. More... | |
std::map< rendering::VisualPtr, msgs::Visual > | visuals |
Visuals of the link. More... | |
std::vector< msgs::Visual * > | visualUpdateMsgs |
Msgs for updating visuals. More... | |
Helper class to store link data.
LinkData | ( | ) |
Constructor.
~LinkData | ( | ) |
Destructor.
void AddCollision | ( | rendering::VisualPtr | _collisionVis, |
const msgs::Collision * | _msg = NULL |
||
) |
Add a collision to the link.
[in] | _collisionVis | Visual representing the collision. |
[in] | _msg | Optional message containing collision params. |
void AddVisual | ( | rendering::VisualPtr | _visual | ) |
Add a visual to the link.
[in] | _visual | Visual to be added. |
LinkData* Clone | ( | const std::string & | _newName | ) |
Clone the link data.
[in] | _newName | Name to give to the cloned link. |
|
static |
Computes mass moment of inertia for a link.
[in] | _collision | A collision message. |
[in] | _mass | The mass of the link. |
|
static |
Computes the volume of a link.
[in] | _collision | A collision message. |
double ComputeVolume | ( | ) | const |
Computes the volume of the link.
rendering::VisualPtr LinkVisual | ( | ) | const |
Get the visual for the link.
void Load | ( | sdf::ElementPtr | _sdf | ) |
Load the link with data from SDF.
[in] | _sdf | Link SDF element. |
std::string Name | ( | ) | const |
Get the name of the link.
ignition::math::Pose3d Pose | ( | ) | const |
Get the pose of the link.
const std::map<std::string, ignition::math::Vector3d>& Scales | ( | ) | const |
Get the scale of all of the link's children.
void SetLinkVisual | ( | const rendering::VisualPtr | _visual | ) |
Set the visual for the link.
[in] | _visual | Visual for the link. |
void SetName | ( | const std::string & | _name | ) |
Set the name of the link.
[in] | _name | Name of link. |
void SetPose | ( | const ignition::math::Pose3d & | _pose3d | ) |
Set the pose of the link.
[in] | _pose | Pose of link. |
void SetScales | ( | const std::map< std::string, ignition::math::Vector3d > & | _scales | ) |
Set the scales of the link.
This function calls UpdateInspectorScale.
[in] | _scale | Scales of all of the link's children. |
|
slot |
Show or hide collision visuals.
[in] | _show | True to show, false to hide. |
|
slot |
Show or hide link frame visuals.
[in] | _show | True to show, false to hide. |
|
slot |
Show or hide visual visuals.
[in] | _show | True to show, false to hide. |
void UpdateConfig | ( | ) |
Update the inspector widget if necessary.
void UpdateInspectorScale | ( | ) |
Update the scale of all the inspectors, making the necessary conversions to update inertial information.
The scale is updated based on the current geometry of 3D visuals. This does not alter the internal scale value returned by Scale().
std::map<rendering::VisualPtr, msgs::Collision> collisions |
Collisions of the link.
std::vector<msgs::Collision *> collisionUpdateMsgs |
Msgs for updating collision visuals.
std::map<rendering::VisualPtr, msgs::Collision> deletedCollisions |
Deleted collisions of the link.
std::map<rendering::VisualPtr, msgs::Visual> deletedVisuals |
Deleted visuals of the link.
LinkInspector* inspector |
Inspector for configuring link properties.
rendering::LinkFrameVisualPtr linkFrameVis |
Link frame visual.
sdf::ElementPtr linkSDF |
SDF representing the link data.
bool nested |
Flag set to true if this is a link of a nested model.
std::map<std::string, ignition::math::Vector3d> scales |
Scale of all collisions and visuals in the link, indexed by their visual's names.
bool showCollisions = true |
True if all collisions are currently visible, false otherwise.
bool showLinkFrame = true |
True if all link frames are currently visible, false otherwise.
bool showVisuals = true |
True if all visuals are currently visible, false otherwise.
std::map<rendering::VisualPtr, msgs::Visual> visuals |
Visuals of the link.
std::vector<msgs::Visual *> visualUpdateMsgs |
Msgs for updating visuals.