Create and manage 3D visuals of a model with links and joints. More...
#include <ModelCreator.hh>
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... | |
JointMaker * | GetJointMaker () 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... | |
Create and manage 3D visuals of a model with links and joints.
gazebo::gui::ModelCreator::ModelCreator | ( | ) |
Constructor.
|
virtual |
Destructor.
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.
[in] | _size | Size of the box. |
[in] | _pose | Pose of the box. |
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.
[in] | _name | Name of the custom link. |
[in] | _scale | Scale of the custom link. |
[in] | _pose | Pose of the custom link. |
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.
[in] | _radius | Radius of the cylinder. |
[in] | _length | Length of the cylinder. |
[in] | _pose | Pose of the cylinder. |
void gazebo::gui::ModelCreator::AddJoint | ( | const std::string & | _type | ) |
Add a joint to the model.
[in] | _type | Type of joint to add. |
void gazebo::gui::ModelCreator::AddLink | ( | LinkType | _type | ) |
Add a link to the model.
[in] | _type | Type 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.
[in] | _type | Type of link to add: box, cylinder, or sphere. |
[in] | _size | Size of the link. |
[in] | _pose | Pose of the link. |
[in] | _samples | Number of samples for polyline. |
std::string gazebo::gui::ModelCreator::AddSphere | ( | double | _radius = 0.5 , |
const math::Pose & | _pose = math::Pose::Zero |
||
) |
Add a sphere to the model.
[in] | _radius | Radius of the sphere. |
[in] | _pose | Pose of the sphere. |
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.
JointMaker* gazebo::gui::ModelCreator::GetJointMaker | ( | ) | const |
Get joint maker.
std::string gazebo::gui::ModelCreator::GetModelName | ( | ) | const |
Get the name of the model.
|
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.
[in] | _linkName | Name 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.
[in] | _auto | True to allow the model to auto disable. |
void gazebo::gui::ModelCreator::SetModelName | ( | const std::string & | _modelName | ) |
Set the name of the model.
[in] | _modelName | Name 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.
[in] | _name | Name of the link. |
[in] | _selected | True to select the link. |
void gazebo::gui::ModelCreator::SetSelected | ( | rendering::VisualPtr | _linkVis, |
const bool | selected | ||
) |
Set the select state of a link visual.
[in] | _linkVis | Pointer to the link visual. |
[in] | _selected | True to select the link. |
void gazebo::gui::ModelCreator::SetStatic | ( | bool | _static | ) |
Set the model to be static.
[in] | _static | True to make the model static. |
void gazebo::gui::ModelCreator::Stop | ( | ) |
Stop the process of adding a link or joint to the model.