Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
gazebo::gui::JointMaker Class Reference

Joint visualization. More...

#include <JointMaker.hh>

Inheritance diagram for gazebo::gui::JointMaker:
Inheritance graph
[legend]

Public Types

enum  JointType {
  JOINT_NONE, JOINT_FIXED, JOINT_SLIDER, JOINT_HINGE,
  JOINT_HINGE2, JOINT_SCREW, JOINT_UNIVERSAL, JOINT_BALL
}
 

Public Slots

void ShowJoints (bool _show)
 Qt Callback to show / hide joint visuals. More...
 

Signals

void JointAdded ()
 Qt signal when the joint creation process has ended. More...
 

Public Member Functions

 JointMaker ()
 Constructor. More...
 
virtual ~JointMaker ()
 Destructor. More...
 
void AddJoint (const std::string &_type)
 Add a joint. More...
 
void AddJoint (JointType _type)
 Add a joint. More...
 
void AddScopedLinkName (const std::string &_name)
 Add a scoped link name. More...
 
void CreateHotSpot (JointData *_joint)
 Helper method to create hotspot visual for mouse interaction. More...
 
JointDataCreateJoint (rendering::VisualPtr _parent, rendering::VisualPtr _child)
 Create a joint with parent and child. More...
 
void CreateJointFromSDF (sdf::ElementPtr _jointElem, const std::string &_modelName="")
 Create a joint from SDF. More...
 
void DisableEventHandlers ()
 Disable the mouse and key event handlers for the joint maker. More...
 
void EnableEventHandlers ()
 Enable the mouse and key event handlers for the joint maker. More...
 
void GenerateSDF ()
 Generate SDF for all joints. More...
 
unsigned int GetJointCount ()
 Get the number of joints added. More...
 
std::vector< JointData * > GetJointDataByLink (const std::string &_linkName) const
 Get a vector containing data for all joints connected to the given link. More...
 
sdf::ElementPtr GetSDF () const
 Generate SDF for all joints. More...
 
JointMaker::JointType GetState () const
 Get state. More...
 
void RemoveJoint (const std::string &_jointName)
 Remove joint by name. More...
 
void RemoveJointsByLink (const std::string &_linkName)
 Remove all joints connected to link. More...
 
void Reset ()
 Reset the joint maker;. More...
 
void SetSelected (const std::string &_name, const bool selected)
 Set the select state of a joint. More...
 
void SetSelected (rendering::VisualPtr _jointVis, const bool selected)
 Set the select state of a joint visual. More...
 
void Stop ()
 Stop the process of adding joint to the model. More...
 
void Update ()
 Update callback on PreRender. More...
 

Static Public Member Functions

static JointType ConvertJointType (const std::string &_type)
 Convert a joint type string to enum. More...
 
static unsigned int GetJointAxisCount (JointMaker::JointType _type)
 Get the axis count for joint type. More...
 
static std::string GetTypeAsString (JointMaker::JointType _type)
 Get the joint type in string. More...
 

Detailed Description

Joint visualization.

Member Enumeration Documentation

Enumerator
JOINT_NONE 

none

JOINT_FIXED 

Fixed joint.

JOINT_SLIDER 

Slider joint.

JOINT_HINGE 

Hinge joint.

JOINT_HINGE2 

Hinge2 joint.

JOINT_SCREW 

Screw joint.

JOINT_UNIVERSAL 

Universal joint.

JOINT_BALL 

Revolute joint.

Constructor & Destructor Documentation

gazebo::gui::JointMaker::JointMaker ( )

Constructor.

virtual gazebo::gui::JointMaker::~JointMaker ( )
virtual

Destructor.

Member Function Documentation

void gazebo::gui::JointMaker::AddJoint ( const std::string &  _type)

Add a joint.

Parameters
[in]_typeType of joint to be added in string.
void gazebo::gui::JointMaker::AddJoint ( JointType  _type)

Add a joint.

Parameters
[in]_typeType of joint to be added
void gazebo::gui::JointMaker::AddScopedLinkName ( const std::string &  _name)

Add a scoped link name.

Nested model's link names are scoped but the parent and child field in the joint SDF element may not be. So keep track of scoped link names in order to generate the correct SDF before spawning the model.

Parameters
[in]_nameScoped link name.
static JointType gazebo::gui::JointMaker::ConvertJointType ( const std::string &  _type)
static

Convert a joint type string to enum.

Parameters
[in]_typeJoint type in string.
Returns
Joint type enum.
void gazebo::gui::JointMaker::CreateHotSpot ( JointData _joint)

Helper method to create hotspot visual for mouse interaction.

Parameters
[in]_jointJoint data used for creating the hotspot
JointData* gazebo::gui::JointMaker::CreateJoint ( rendering::VisualPtr  _parent,
rendering::VisualPtr  _child 
)

Create a joint with parent and child.

Parameters
[in]_parentParent of the joint.
[in]_childChild of the joint.
Returns
joint data.
void gazebo::gui::JointMaker::CreateJointFromSDF ( sdf::ElementPtr  _jointElem,
const std::string &  _modelName = "" 
)

Create a joint from SDF.

This is mainly used when editing existing models.

Parameters
[in]_jointElementSDF element to load.
[in]_modelNameName of the model that contains this joint.
void gazebo::gui::JointMaker::DisableEventHandlers ( )

Disable the mouse and key event handlers for the joint maker.

void gazebo::gui::JointMaker::EnableEventHandlers ( )

Enable the mouse and key event handlers for the joint maker.

void gazebo::gui::JointMaker::GenerateSDF ( )

Generate SDF for all joints.

static unsigned int gazebo::gui::JointMaker::GetJointAxisCount ( JointMaker::JointType  _type)
static

Get the axis count for joint type.

Parameters
[in]_typeType of joint.
unsigned int gazebo::gui::JointMaker::GetJointCount ( )

Get the number of joints added.

return Number of joints.

std::vector<JointData *> gazebo::gui::JointMaker::GetJointDataByLink ( const std::string &  _linkName) const

Get a vector containing data for all joints connected to the given link.

Parameters
[in]_linkNameName of the link.
Returns
Vector with joint data.
sdf::ElementPtr gazebo::gui::JointMaker::GetSDF ( ) const

Generate SDF for all joints.

JointMaker::JointType gazebo::gui::JointMaker::GetState ( ) const

Get state.

Returns
State of JointType if joint creation is in process, otherwise JOINT_NONE
static std::string gazebo::gui::JointMaker::GetTypeAsString ( JointMaker::JointType  _type)
static

Get the joint type in string.

Parameters
[in]_typeType of joint.
Returns
Joint type in string.
void gazebo::gui::JointMaker::JointAdded ( )
signal

Qt signal when the joint creation process has ended.

void gazebo::gui::JointMaker::RemoveJoint ( const std::string &  _jointName)

Remove joint by name.

Parameters
[in]_jointNameName of joint to be removed.
void gazebo::gui::JointMaker::RemoveJointsByLink ( const std::string &  _linkName)

Remove all joints connected to link.

Parameters
[in]_linkNameName of the link.
void gazebo::gui::JointMaker::Reset ( )

Reset the joint maker;.

void gazebo::gui::JointMaker::SetSelected ( const std::string &  _name,
const bool  selected 
)

Set the select state of a joint.

Parameters
[in]_nameName of the joint.
[in]_selectedTrue to select the joint.
void gazebo::gui::JointMaker::SetSelected ( rendering::VisualPtr  _jointVis,
const bool  selected 
)

Set the select state of a joint visual.

Parameters
[in]_jointVisPointer to the joint visual.
[in]_selectedTrue to select the joint.
void gazebo::gui::JointMaker::ShowJoints ( bool  _show)
slot

Qt Callback to show / hide joint visuals.

Parameters
[in]_showTrue to show joints, false to hide them.
void gazebo::gui::JointMaker::Stop ( )

Stop the process of adding joint to the model.

void gazebo::gui::JointMaker::Update ( )

Update callback on PreRender.


The documentation for this class was generated from the following file: