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;
107 public:
void SetModelName(
const std::string &_modelName);
111 public: std::string ModelName()
const;
114 public:
void ModelChanged();
117 public:
void SaveModelFiles();
120 public:
void FinishModel();
128 public:
void AddCustomLink(
const EntityType _type,
129 const ignition::math::Vector3d &_size = ignition::math::Vector3d::One,
130 const ignition::math::Pose3d &_pose = ignition::math::Pose3d::Zero,
131 const std::string &_uri =
"",
const unsigned int _samples = 5);
141 const ignition::math::Vector3d &_size = ignition::math::Vector3d::One,
142 const ignition::math::Pose3d &_pose = ignition::math::Pose3d::Zero,
143 const std::string &_uri =
"",
const unsigned int _samples = 5);
152 public:
void AddJoint(
const std::string &_type);
156 public:
void RemoveEntity(
const std::string &_entityName);
160 public:
void RemoveModelPlugin(
const std::string &_pluginName);
164 public:
void SetStatic(
const bool _static);
168 public:
void SetAutoDisable(
const bool _auto);
171 public:
void Reset();
183 public:
void SetSelected(
const std::string &_name,
const bool selected);
189 const bool selected);
193 public:
enum SaveState CurrentSaveState()
const;
197 public:
void AddEntity(
const sdf::ElementPtr &_sdf);
207 public:
void OnAddModelPlugin(
const std::string &_name,
208 const std::string &_filename,
const std::string &_innerxml);
212 public:
void AddModelPlugin(
const sdf::ElementPtr &_pluginElem);
220 public:
void GenerateSDF();
225 private: sdf::ElementPtr GenerateLinkSDF(
LinkData *_link);
228 private:
void OnNew();
232 private:
bool OnSave();
236 private:
bool OnSaveAs();
241 private:
void OnNameChanged(
const std::string &_modelName);
246 private:
void OnPropertiesChanged(
const bool _static,
247 const bool _autoDisable);
250 private:
void OnExit();
253 private:
void Update();
258 private:
void RemoveNestedModelImpl(
const std::string &_nestedModelName);
263 private:
void RemoveLinkImpl(
const std::string &_linkName);
267 private slots:
void OnEdit(
const bool _checked);
271 private slots:
void OnEditModel(
const std::string &_modelName);
274 private slots:
void OnCopy();
277 private slots:
void OnPaste();
306 private:
void OnManipMode(
const std::string &_mode);
311 private:
void OnDeselectAll(
const std::string &_name,
312 const std::string &_mode);
318 private:
void OnSetSelectedEntity(
const std::string &_name,
319 const bool _selected);
325 private:
void OnSetSelectedModelPlugin(
const std::string &_name,
326 const bool _selected);
339 private:
NestedModelData *CloneNestedModel(
const std::string &_modelName);
344 private:
LinkData *CloneLink(
const std::string &_linkName);
351 private:
LinkData *CreateLinkFromSDF(
const sdf::ElementPtr &_linkElem,
356 private:
void OpenInspector(
const std::string &_name);
360 private:
void OpenModelPluginInspector(
const std::string &_name);
363 private:
virtual void CreateTheEntity();
366 private:
bool Init();
370 private: std::string CreateModel();
380 private:
NestedModelData *CreateModelFromSDF(
const sdf::ElementPtr &_sdf,
382 const bool _emit =
true);
391 private:
void OnAlignMode(
const std::string &_axis,
392 const std::string &_config,
const std::string &_target,
393 const bool _preview,
const bool _inverted =
false);
398 private:
void OnEntityScaleChanged(
const std::string &_name,
403 private:
void DeselectAll();
406 private:
void DeselectAllEntities();
409 private:
void DeselectAllModelPlugins();
415 private:
void SetModelVisible(
const std::string &_name,
416 const bool _visible);
423 const bool _visible);
427 private:
void ShowContextMenu(
const std::string &_link);
431 private:
void ShowModelPluginContextMenu(
const std::string &_name);
435 private:
void EmitNestedModelInsertedEvent(
440 private slots:
void OnDelete();
444 private slots:
void OnDelete(
const std::string &_name);
447 private slots:
void OnOpenInspector();
451 private slots:
void OnOpenModelPluginInspector(
const QString &_name);
455 private slots:
void OnRemoveModelPlugin(
const QString &_name);
458 Q_SIGNALS:
void LinkAdded();
462 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
Forward declarations for the common classes.
Definition: Animation.hh:33
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:77
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:233
Helper class to store link data.
Definition: ModelData.hh:90
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