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  EntityType {
  ENTITY_NONE, ENTITY_BOX, ENTITY_SPHERE, ENTITY_CYLINDER,
  ENTITY_MESH, ENTITY_POLYLINE, ENTITY_MODEL
}
 
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...
 
void AddEntity (const sdf::ElementPtr &_sdf)
 Add an entity to the model. More...
 
void AddJoint (const std::string &_type)
 Add a joint to the model. More...
 
void AddLink (EntityType _type)
 Add a link to the model. More...
 
NestedModelDataAddModel (const sdf::ElementPtr &_sdf)
 Add a nested model to the model. More...
 
void AddModelPlugin (const sdf::ElementPtr &_pluginElem)
 Add a model plugin to the model. More...
 
LinkDataAddShape (EntityType _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...
 
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...
 
ModelPluginDataModelPlugin (const std::string &_name)
 Get a model plugin data by its name. More...
 
void OnAddModelPlugin (const std::string &_name, const std::string &_filename, const std::string &_innerxml)
 Add a model plugin to the model. More...
 
void RemoveEntity (const std::string &_entityName)
 Remove an entity from the model. More...
 
void RemoveModelPlugin (const std::string &_pluginName)
 Remove a model plugin 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 an entity. More...
 
void SetSelected (rendering::VisualPtr _linkVis, const bool selected)
 Set the select state of a entity 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
ENTITY_NONE 

none

ENTITY_BOX 

Box.

ENTITY_SPHERE 

Sphere.

ENTITY_CYLINDER 

Cylinder.

ENTITY_MESH 

Imported 3D mesh.

ENTITY_POLYLINE 

Extruded polyline.

ENTITY_MODEL 

Nested model.

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

void gazebo::gui::ModelCreator::AddEntity ( const sdf::ElementPtr &  _sdf)

Add an entity to the model.

Parameters
[in]_sdfSDF describing the entity.
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 ( EntityType  _type)

Add a link to the model.

Parameters
[in]_typeType of link to be added
NestedModelData* gazebo::gui::ModelCreator::AddModel ( const sdf::ElementPtr &  _sdf)

Add a nested model to the model.

Parameters
[in]_sdfSDF describing the model.
Returns
Nested model data.
void gazebo::gui::ModelCreator::AddModelPlugin ( const sdf::ElementPtr &  _pluginElem)

Add a model plugin to the model.

Parameters
[in]_pluginElemPointer to plugin SDF element
LinkData* gazebo::gui::ModelCreator::AddShape ( EntityType  _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: ENTITY_BOX, ENTITY_CYLINDER, ENTITY_SPHERE, ENTITY_MESH or ENTITY_POLYLINE.
[in]_sizeSize of the link.
[in]_posePose of the link.
[in]_samplesNumber of samples for polyline.
Returns
Link data.
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.

ModelPluginData* gazebo::gui::ModelCreator::ModelPlugin ( const std::string &  _name)

Get a model plugin data by its name.

Parameters
[in]_nameName of model plugin
Returns
Model plugin data.
void gazebo::gui::ModelCreator::OnAddModelPlugin ( const std::string &  _name,
const std::string &  _filename,
const std::string &  _innerxml 
)

Add a model plugin to the model.

Parameters
[in]_nameName of plugin
[in]_filenamePlugin filename
[in]_innerxmlPlugin SDF elements in string
void gazebo::gui::ModelCreator::RemoveEntity ( const std::string &  _entityName)

Remove an entity from the model.

Parameters
[in]_entityNameName of the entity to remove
void gazebo::gui::ModelCreator::RemoveModelPlugin ( const std::string &  _pluginName)

Remove a model plugin from the model.

Parameters
[in]_pluginNameName of the model plugin 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 an entity.

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

Set the select state of a entity visual.

Parameters
[in]_linkVisPointer to the entity visual.
[in]_selectedTrue to select the entity.
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: