18 #ifndef _GAZEBO_GUI_JOINTMAKER_HH_
19 #define _GAZEBO_GUI_JOINTMAKER_HH_
26 #include <ignition/math/Pose3.hh>
27 #include <ignition/math/Vector3.hh>
48 class recursive_mutex;
68 class MEUserCmdManager;
71 class JointMakerPrivate;
113 public:
void Reset();
116 public:
void EnableEventHandlers();
119 public:
void DisableEventHandlers();
123 public:
void AddJoint(
const std::string &_type);
127 public:
void AddJoint(
const JointType _type);
139 public: std::string CreateHotSpot(
JointData *_joint);
142 public:
void Update();
147 public:
void RemoveJoint(
const std::string &_jointName);
151 public:
void RemoveJointByUser(
const std::string &_jointName);
155 public:
void RemoveJointsByLink(
const std::string &_linkName);
161 public: std::vector<JointData *> JointDataByLink(
162 const std::string &_linkName)
const;
165 public:
void GenerateSDF();
169 public: sdf::ElementPtr SDF()
const;
174 public:
static unsigned int JointAxisCount(
180 public:
static std::string TypeAsString(
191 public:
static std::string JointMaterial(
const std::string &_type);
204 public:
unsigned int JointCount();
210 public:
void CreateJointFromSDF(sdf::ElementPtr _jointElem,
211 const std::string &_modelName =
"");
218 public:
void AddScopedLinkName(
const std::string &_name);
222 public slots:
void ShowJoints(
const bool _show);
227 public:
void SetSelected(
const std::string &_name,
const bool selected);
233 const bool selected);
237 public: std::map<std::string, std::string> LinkList()
const;
242 public slots:
void OnType(
const int _typeInt);
248 public slots:
void SetAxis(
const std::string &_axis,
249 const ignition::math::Vector3d &_value);
254 public:
void SetJointPose(
const ignition::math::Pose3d &_pose);
260 public:
void SetParentLink(
const std::string &_name);
266 public:
void SetChildLink(
const std::string &_name);
275 public:
void SetLinksRelativePose(
276 const ignition::math::Pose3d &_pose,
const bool _resetAll,
277 const int _resetAxis = -1);
285 public:
void AlignLinks(
const bool _childToParent,
286 const std::string &_axis,
const std::string &_mode,
287 const bool _reverse);
290 public:
void FinalizeCreation();
323 private:
void OpenInspector(
const std::string &_name);
328 private: std::string ScopedLinkName(
const std::string &_name);
332 private:
void ShowContextMenu(
const std::string &_joint);
335 private:
void DeselectAll();
340 private:
void OnSetSelectedEntity(
const std::string &_name,
341 const std::string &_mode);
347 private:
void OnSetSelectedJoint(
const std::string &_name,
348 const bool _selected);
352 private:
void OnLinkInserted(
const std::string &_linkName);
356 private:
void OnLinkRemoved(
const std::string &_linkName);
362 private:
JointData *CreateJointLine(
const std::string &_name,
369 const std::string &_name);
391 Q_SIGNALS:
void JointAdded();
395 Q_SIGNALS:
void EmitLinkInserted(
const std::string &_linkId);
399 Q_SIGNALS:
void EmitLinkRemoved(
const std::string &_linkId);
402 private slots:
void OnOpenInspector();
406 private slots:
void OnDelete();
409 public:
static std::map<JointMaker::JointType, std::string>
jointTypes;
415 public:
static std::map<JointMaker::JointType, std::string>
420 private: std::unique_ptr<JointMakerPrivate> dataPtr;
432 public:
void OpenInspector();
436 public:
void Update();
439 public:
void UpdateMsg();
481 public: std::vector<ignition::math::Vector3d>
axes;
493 private slots:
void OnOpenInspector();
497 private slots:
void OnApply();
Class for drawing lines that can change.
Definition: DynamicLines.hh:43
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Ball joint.
Definition: JointMaker.hh:101
none
Definition: JointMaker.hh:87
rendering::VisualPtr parent
Parent visual the joint is connected to.
Definition: JointMaker.hh:454
static std::vector< ignition::math::Vector3d > unitVectors
Constant vector containing [UnitX, UnitY, UnitZ].
Definition: JointMaker.hh:412
Screw joint.
Definition: JointMaker.hh:97
Hinge joint.
Definition: JointMaker.hh:93
Fixed joint.
Definition: JointMaker.hh:89
GAZEBO_VISIBLE msgs::Joint::Type ConvertJointType(const std::string &_str)
Convert a string to a msgs::Joint::Type enum.
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:117
static std::map< JointMaker::JointType, std::string > jointMaterials
A map of joint type to its corresponding material.
Definition: JointMaker.hh:416
msgs::JointPtr jointMsg
Msg containing joint data.
Definition: JointMaker.hh:487
Slider joint.
Definition: JointMaker.hh:91
ignition::math::Pose3d parentPose
Definition: JointMaker.hh:461
Hinge2 joint.
Definition: JointMaker.hh:95
Ogre::BillboardSet * handles
Visual handle used to represent joint parent.
Definition: JointMaker.hh:475
Handles the creation of joints in the model editor.
Definition: JointMaker.hh:78
JointInspector * inspector
Inspector for configuring joint properties.
Definition: JointMaker.hh:490
Universal joint.
Definition: JointMaker.hh:99
Class which manages user commands in the model editor.
Definition: MEUserCmdManager.hh:114
rendering::DynamicLines * line
Visual line used to represent joint connecting parent and child.
Definition: JointMaker.hh:472
JointMaker::JointType type
Type of joint.
Definition: JointMaker.hh:478
rendering::JointVisualPtr jointVisual
Joint visual.
Definition: JointMaker.hh:448
std::shared_ptr< JointVisual > JointVisualPtr
Definition: RenderTypes.hh:140
A class to inspect and modify joints.
Definition: JointInspector.hh:42
std::vector< ignition::math::Vector3d > axes
Last known axes values.
Definition: JointMaker.hh:481
ignition::math::Pose3d childPose
Definition: JointMaker.hh:465
std::string name
Name of the joint.
Definition: JointMaker.hh:442
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
rendering::VisualPtr child
Child visual the joint is connected to.
Definition: JointMaker.hh:457
rendering::VisualPtr hotspot
Visual of the hotspot
Definition: JointMaker.hh:451
static std::map< JointMaker::JointType, std::string > jointTypes
A map of joint type to its string value.
Definition: JointMaker.hh:409
rendering::VisualPtr visual
Visual of the dynamic line.
Definition: JointMaker.hh:445
bool dirty
True if the joint needs update.
Definition: JointMaker.hh:484
ignition::math::Vector3d childScale
Definition: JointMaker.hh:469
JointType
Definition: JointMaker.hh:84
Helper class to store joint data.
Definition: JointMaker.hh:427