18 #ifndef _GAZEBO_GUI_MODEL_MODELCREATOR_HH_
19 #define _GAZEBO_GUI_MODEL_MODELCREATOR_HH_
25 #include <ignition/math/Pose3.hh>
26 #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);
166 public:
void RemoveModelPlugin(
const std::string &_pluginName);
170 public:
void SetStatic(
const bool _static);
174 public:
void SetAutoDisable(
const bool _auto);
177 public:
void Reset();
189 public:
void SetSelected(
const std::string &_name,
const bool selected);
195 const bool selected);
199 public:
enum SaveState CurrentSaveState()
const;
203 public:
void AddEntity(
const sdf::ElementPtr &_sdf);
207 public:
void AddLink(
const EntityType _type);
213 public:
void OnAddModelPlugin(
const std::string &_name,
214 const std::string &_filename,
const std::string &_innerxml);
218 public:
void AddModelPlugin(
const sdf::ElementPtr &_pluginElem);
226 public:
void GenerateSDF();
231 private: sdf::ElementPtr GenerateLinkSDF(
LinkData *_link);
234 private:
void OnNew();
238 private:
bool OnSave();
242 private:
bool OnSaveAs();
247 private:
void OnNameChanged(
const std::string &_modelName);
252 private:
void OnPropertiesChanged(
const bool _static,
253 const bool _autoDisable);
256 private:
void OnExit();
259 private:
void Update();
264 private:
void RemoveNestedModelImpl(
const std::string &_nestedModelName);
269 private:
void RemoveLinkImpl(
const std::string &_linkName);
273 private slots:
void OnEdit(
const bool _checked);
277 private slots:
void OnEditModel(
const std::string &_modelName);
280 private slots:
void OnCopy();
283 private slots:
void OnPaste();
312 private:
void OnManipMode(
const std::string &_mode);
317 private:
void OnSetSelectedEntity(
const std::string &_name,
318 const std::string &_mode);
324 private:
void OnSetSelectedLink(
const std::string &_name,
325 const bool _selected);
331 private:
void OnSetSelectedModelPlugin(
const std::string &_name,
332 const bool _selected);
344 private:
void InsertLinkFromSDF(sdf::ElementPtr _sdf);
348 private:
void InsertNestedModelFromSDF(sdf::ElementPtr _sdf);
353 private:
NestedModelData *CloneNestedModel(
const std::string &_modelName);
358 private:
LinkData *CloneLink(
const std::string &_linkName);
365 private:
LinkData *CreateLinkFromSDF(
const sdf::ElementPtr &_linkElem,
370 private:
void OpenInspector(
const std::string &_name);
374 private:
void OpenModelPluginInspector(
const std::string &_name);
377 private:
virtual void CreateTheEntity();
380 private:
bool Init();
384 private: std::string CreateModel();
394 private:
NestedModelData *CreateModelFromSDF(
const sdf::ElementPtr &_sdf,
396 const bool _emit =
true);
405 private:
void OnAlignMode(
const std::string &_axis,
406 const std::string &_config,
const std::string &_target,
407 const bool _preview,
const bool _inverted =
false);
412 private:
void OnEntityScaleChanged(
const std::string &_name,
417 private:
void DeselectAll();
420 private:
void DeselectAllLinks();
423 private:
void DeselectAllNestedModels();
426 private:
void DeselectAllModelPlugins();
432 private:
void SetModelVisible(
const std::string &_name,
433 const bool _visible);
440 const bool _visible);
444 private:
void ShowContextMenu(
const std::string &_link);
448 private:
void ShowModelPluginContextMenu(
const std::string &_name);
452 private:
void EmitNestedModelInsertedEvent(
457 private slots:
void OnDelete();
461 private slots:
void OnDelete(
const std::string &_name);
464 private slots:
void OnOpenInspector();
468 private slots:
void OnOpenModelPluginInspector(
const QString &_name);
472 private slots:
void OnRemoveModelPlugin(
const QString &_name);
475 Q_SIGNALS:
void LinkAdded();
479 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
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
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:78
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:252
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:112
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:245