Public Types | Signals | Public Member Functions | List of all members
gazebo::gui::ModelCreator Class Reference

Create and manage 3D visuals of a model with links and joints. More...

#include <ModelCreator.hh>

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

Public Types

enum  LinkType {
  LINK_NONE, LINK_BOX, LINK_SPHERE, LINK_CYLINDER,
  LINK_MESH, LINK_POLYLINE
}
 
enum  SaveState { NEVER_SAVED, ALL_SAVED, UNSAVED_CHANGES }
 Save states for the model editor. More...
 

Signals

void LinkAdded ()
 Qt signal when the a link has been added. More...
 

Public Member Functions

 ModelCreator ()
 Constructor. More...
 
virtual ~ModelCreator ()
 Destructor. More...
 
std::string AddBox (const math::Vector3 &_size=math::Vector3::One, const math::Pose &_pose=math::Pose::Zero)
 Add a box to the model. More...
 
std::string AddCustom (const std::string &_name, const math::Vector3 &_scale=math::Vector3::One, const math::Pose &_pose=math::Pose::Zero)
 Add a custom link to the model. More...
 
std::string AddCylinder (double _radius=0.5, double _length=1.0, const math::Pose &_pose=math::Pose::Zero)
 Add a cylinder to the model. More...
 
void AddJoint (const std::string &_type)
 Add a joint to the model. More...
 
void AddLink (LinkType _type)
 Add a link to the model. More...
 
std::string AddShape (LinkType _type, const math::Vector3 &_size=math::Vector3::One, const math::Pose &_pose=math::Pose::Zero, const std::string &_uri="", unsigned int _samples=5)
 Add a link to the model. More...
 
std::string AddSphere (double _radius=0.5, const math::Pose &_pose=math::Pose::Zero)
 Add a sphere to the model. More...
 
void FinishModel ()
 Finish the model and create the entity on the gzserver. More...
 
void GenerateSDF ()
 Generate the SDF from model link and joint visuals. More...
 
enum SaveState GetCurrentSaveState () const
 Get current save state. More...
 
JointMakerGetJointMaker () const
 Get joint maker. More...
 
std::string GetModelName () const
 Get the name of the model. More...
 
void ModelChanged ()
 Set save state upon a change to the model. More...
 
void RemoveLink (const std::string &_linkName)
 Remove a link from the model. More...
 
void Reset ()
 Reset the model creator and the SDF. More...
 
void SaveModelFiles ()
 Helper function to manage writing files to disk. More...
 
void SetAutoDisable (bool _auto)
 Set the model to allow auto disable at rest. More...
 
void SetModelName (const std::string &_modelName)
 Set the name of the model. More...
 
void SetSelected (const std::string &_name, const bool selected)
 Set the select state of a link. More...
 
void SetSelected (rendering::VisualPtr _linkVis, const bool selected)
 Set the select state of a link visual. More...
 
void SetStatic (bool _static)
 Set the model to be static. More...
 
void Stop ()
 Stop the process of adding a link or joint to the model. More...
 

Detailed Description

Create and manage 3D visuals of a model with links and joints.

Member Enumeration Documentation

Enumerator
LINK_NONE 

none

LINK_BOX 

Box.

LINK_SPHERE 

Sphere.

LINK_CYLINDER 

Cylinder.

LINK_MESH 

Imported 3D mesh.

LINK_POLYLINE 

Extruded polyline.

Save states for the model editor.

Enumerator
NEVER_SAVED 
ALL_SAVED 
UNSAVED_CHANGES 

Constructor & Destructor Documentation

gazebo::gui::ModelCreator::ModelCreator ( )

Constructor.

virtual gazebo::gui::ModelCreator::~ModelCreator ( )
virtual

Destructor.

Member Function Documentation

std::string gazebo::gui::ModelCreator::AddBox ( const math::Vector3 _size = math::Vector3::One,
const math::Pose _pose = math::Pose::Zero 
)

Add a box to the model.

Parameters
[in]_sizeSize of the box.
[in]_posePose of the box.
Returns
Name of the box that has been added.
std::string gazebo::gui::ModelCreator::AddCustom ( const std::string &  _name,
const math::Vector3 _scale = math::Vector3::One,
const math::Pose _pose = math::Pose::Zero 
)

Add a custom link to the model.

Parameters
[in]_nameName of the custom link.
[in]_scaleScale of the custom link.
[in]_posePose of the custom link.
Returns
Name of the custom that has been added.
std::string gazebo::gui::ModelCreator::AddCylinder ( double  _radius = 0.5,
double  _length = 1.0,
const math::Pose _pose = math::Pose::Zero 
)

Add a cylinder to the model.

Parameters
[in]_radiusRadius of the cylinder.
[in]_lengthLength of the cylinder.
[in]_posePose of the cylinder.
Returns
Name of the cylinder that has been added.
void gazebo::gui::ModelCreator::AddJoint ( const std::string &  _type)

Add a joint to the model.

Parameters
[in]_typeType of joint to add.
void gazebo::gui::ModelCreator::AddLink ( LinkType  _type)

Add a link to the model.

Parameters
[in]_typeType of link to be added
std::string gazebo::gui::ModelCreator::AddShape ( LinkType  _type,
const math::Vector3 _size = math::Vector3::One,
const math::Pose _pose = math::Pose::Zero,
const std::string &  _uri = "",
unsigned int  _samples = 5 
)

Add a link to the model.

Parameters
[in]_typeType of link to add: box, cylinder, or sphere.
[in]_sizeSize of the link.
[in]_posePose of the link.
[in]_samplesNumber of samples for polyline.
Returns
Name of the link that has been added.
std::string gazebo::gui::ModelCreator::AddSphere ( double  _radius = 0.5,
const math::Pose _pose = math::Pose::Zero 
)

Add a sphere to the model.

Parameters
[in]_radiusRadius of the sphere.
[in]_posePose of the sphere.
Returns
Name of the sphere that has been added.
void gazebo::gui::ModelCreator::FinishModel ( )

Finish the model and create the entity on the gzserver.

void gazebo::gui::ModelCreator::GenerateSDF ( )

Generate the SDF from model link and joint visuals.

enum SaveState gazebo::gui::ModelCreator::GetCurrentSaveState ( ) const

Get current save state.

Returns
Current save state.
JointMaker* gazebo::gui::ModelCreator::GetJointMaker ( ) const

Get joint maker.

Returns
Joint maker
std::string gazebo::gui::ModelCreator::GetModelName ( ) const

Get the name of the model.

Returns
Name of model.
void gazebo::gui::ModelCreator::LinkAdded ( )
signal

Qt signal when the a link has been added.

void gazebo::gui::ModelCreator::ModelChanged ( )

Set save state upon a change to the model.

void gazebo::gui::ModelCreator::RemoveLink ( const std::string &  _linkName)

Remove a link from the model.

Parameters
[in]_linkNameName of the link to remove
void gazebo::gui::ModelCreator::Reset ( )

Reset the model creator and the SDF.

void gazebo::gui::ModelCreator::SaveModelFiles ( )

Helper function to manage writing files to disk.

void gazebo::gui::ModelCreator::SetAutoDisable ( bool  _auto)

Set the model to allow auto disable at rest.

Parameters
[in]_autoTrue to allow the model to auto disable.
void gazebo::gui::ModelCreator::SetModelName ( const std::string &  _modelName)

Set the name of the model.

Parameters
[in]_modelNameName of the model to set to.
void gazebo::gui::ModelCreator::SetSelected ( const std::string &  _name,
const bool  selected 
)

Set the select state of a link.

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

Set the select state of a link visual.

Parameters
[in]_linkVisPointer to the link visual.
[in]_selectedTrue to select the link.
void gazebo::gui::ModelCreator::SetStatic ( bool  _static)

Set the model to be static.

Parameters
[in]_staticTrue to make the model static.
void gazebo::gui::ModelCreator::Stop ( )

Stop the process of adding a link or joint to the model.


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