18 #ifndef GAZEBO_GUI_MODEL_MODELCREATOR_HH_
19 #define GAZEBO_GUI_MODEL_MODELCREATOR_HH_
26 #include <ignition/math/Pose3.hh>
27 #include <ignition/math/Vector3.hh>
48 class ModelPluginData;
49 class NestedModelData;
52 class ModelCreatorPrivate;
106 public:
void EnableEventHandlers();
109 public:
void DisableEventHandlers();
113 public:
void SetModelName(
const std::string &_modelName);
117 public: std::string ModelName()
const;
120 public:
void ModelChanged();
123 public:
void SaveModelFiles();
126 public:
void FinishModel();
134 public:
void AddCustomLink(
const EntityType _type,
135 const ignition::math::Vector3d &_size = ignition::math::Vector3d::One,
136 const ignition::math::Pose3d &_pose = ignition::math::Pose3d::Zero,
137 const std::string &_uri =
"",
const unsigned int _samples = 5);
146 public:
LinkData *AddShape(
const EntityType _type,
147 const ignition::math::Vector3d &_size = ignition::math::Vector3d::One,
148 const ignition::math::Pose3d &_pose = ignition::math::Pose3d::Zero,
149 const std::string &_uri =
"",
const unsigned int _samples = 5);
158 public:
void AddJoint(
const std::string &_type);
162 public:
void RemoveEntity(
const std::string &_entityName);
168 public:
void RemoveModelPlugin(
const std::string &_pluginName,
169 const bool _newCmd =
true);
173 public:
void SetStatic(
const bool _static);
177 public:
void SetAutoDisable(
const bool _auto);
180 public:
void Reset();
192 public:
void SetSelected(
const std::string &_name,
const bool selected);
198 const bool selected);
202 public:
enum SaveState CurrentSaveState()
const;
206 public:
void AddEntity(
const sdf::ElementPtr &_sdf);
210 public:
void AddLink(
const EntityType _type);
218 public:
void OnAddModelPlugin(
const std::string &_name,
219 const std::string &_filename,
const std::string &_innerxml,
220 const bool _newCmd =
true);
224 public:
void AddModelPlugin(
const sdf::ElementPtr &_pluginElem);
232 public:
void GenerateSDF();
236 public slots:
void ShowCollisions(
const bool _show);
240 public slots:
void ShowVisuals(
const bool _show);
244 public slots:
void ShowLinkFrames(
const bool _show);
250 public: ignition::math::Pose3d WorldToLocal(
251 const ignition::math::Pose3d &_world)
const;
256 private: sdf::ElementPtr GenerateLinkSDF(
LinkData *_link);
259 private:
void OnNew();
263 private:
bool OnSave();
267 private:
bool OnSaveAs();
272 private:
void OnNameChanged(
const std::string &_modelName);
277 private:
void OnPropertiesChanged(
const bool _static,
278 const bool _autoDisable);
281 private:
void OnExit();
286 private:
void RemoveNestedModelImpl(
const std::string &_nestedModelName);
291 private:
void RemoveLinkImpl(
const std::string &_linkName);
295 private slots:
void OnEdit(
const bool _checked);
299 private slots:
void OnEditModel(
const std::string &_modelName);
302 private slots:
void OnCopy();
305 private slots:
void OnPaste();
334 private:
void OnManipMode(
const std::string &_mode);
339 private:
void OnDeselectAll(
const std::string &_name,
340 const std::string &_mode);
346 private:
void OnSetSelectedEntity(
const std::string &_name,
347 const bool _selected);
353 private:
void OnSetSelectedModelPlugin(
const std::string &_name,
354 const bool _selected);
366 private:
void InsertLinkFromSDF(sdf::ElementPtr _sdf);
370 private:
void InsertNestedModelFromSDF(sdf::ElementPtr _sdf);
375 private:
NestedModelData *CloneNestedModel(
const std::string &_modelName);
380 private:
LinkData *CloneLink(
const std::string &_linkName);
387 private:
LinkData *CreateLinkFromSDF(
const sdf::ElementPtr &_linkElem,
392 private:
void OpenInspector(
const std::string &_name);
396 private:
void OpenModelPluginInspector(
const std::string &_name);
399 private:
virtual void CreateTheEntity();
402 private:
bool Init();
406 private: std::string CreateModel();
416 private:
NestedModelData *CreateModelFromSDF(
const sdf::ElementPtr &_sdf,
418 const bool _emit =
true);
427 private:
void OnAlignMode(
const std::string &_axis,
428 const std::string &_config,
const std::string &_target,
429 const bool _preview,
const bool _inverted =
false);
434 private:
void OnEntityScaleChanged(
const std::string &_name,
435 const ignition::math::Vector3d &_scale);
442 private:
void OnEntityMoved(
const std::string &_name,
443 const ignition::math::Pose3d &_pose,
const bool _isFinal);
447 private:
void DeselectAll();
450 private:
void DeselectAllEntities();
453 private:
void DeselectAllModelPlugins();
458 private:
void OnRequestLinkScale(
const std::string &_name,
459 const std::map<std::string, ignition::math::Vector3d> &_scales);
464 private:
void OnRequestLinkMove(
const std::string &_name,
465 const ignition::math::Pose3d &_pose);
470 private:
void OnRequestNestedModelMove(
const std::string &_name,
471 const ignition::math::Pose3d &_pose);
477 private:
void SetModelVisible(
const std::string &_name,
478 const bool _visible);
485 const bool _visible);
489 private:
void ShowContextMenu(
const std::string &_link);
493 private:
void ShowModelPluginContextMenu(
const std::string &_name);
497 private:
void EmitNestedModelInsertedEvent(
502 private slots:
void OnDelete();
506 private slots:
void OnDelete(
const std::string &_name);
509 private slots:
void OnOpenInspector();
513 private slots:
void OnOpenModelPluginInspector(
const QString &_name);
517 private slots:
void OnRemoveModelPlugin(
const QString &_name);
520 Q_SIGNALS:
void LinkAdded();
524 private: std::unique_ptr<ModelCreatorPrivate> dataPtr;
Extruded polyline.
Definition: ModelCreator.hh:79
none
Definition: ModelCreator.hh:69
EntityType
Definition: ModelCreator.hh:66
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Sphere.
Definition: ModelCreator.hh:73
Cylinder.
Definition: ModelCreator.hh:75
Helper class to store nested models data.
Definition: ModelData.hh:57
Create and manage 3D visuals of a model with links, nested models and joints.
Definition: ModelCreator.hh:60
Box.
Definition: ModelCreator.hh:71
Handles the creation of joints in the model editor.
Definition: JointMaker.hh:76
The model has never been saved.
Definition: ModelCreator.hh:89
SaveState
Save states for the model editor.
Definition: ModelCreator.hh:86
Helper class to store model plugin data.
Definition: ModelData.hh:309
Helper class to store link data.
Definition: ModelData.hh:94
Imported 3D mesh.
Definition: ModelCreator.hh:77
#define NULL
Definition: CommonTypes.hh:31
All changes have been saved.
Definition: ModelCreator.hh:92
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
A plugin with access to physics::Model.
Definition: Plugin.hh:260