17 #ifndef _GAZEBO_GUI_MODEL_MODELCREATOR_HH_
18 #define _GAZEBO_GUI_MODEL_MODELCREATOR_HH_
47 class NestedModelData;
49 class ModelPluginData;
104 public:
void SetModelName(
const std::string &_modelName);
108 public: std::string GetModelName()
const;
111 public:
void ModelChanged();
114 public:
void SaveModelFiles();
117 public:
void FinishModel();
126 public:
LinkData *AddShape(EntityType _type,
129 const std::string &_uri =
"",
unsigned int _samples = 5);
138 public:
void AddJoint(
const std::string &_type);
142 public:
void RemoveEntity(
const std::string &_entityName);
146 public:
void RemoveModelPlugin(
const std::string &_pluginName);
150 public:
void SetStatic(
bool _static);
154 public:
void SetAutoDisable(
bool _auto);
157 public:
void Reset();
169 public:
void SetSelected(
const std::string &_name,
const bool selected);
175 const bool selected);
179 public:
enum SaveState GetCurrentSaveState()
const;
183 public:
void AddEntity(
const sdf::ElementPtr &_sdf);
187 public:
void AddLink(EntityType _type);
193 public:
void OnAddModelPlugin(
const std::string &_name,
194 const std::string &_filename,
const std::string &_innerxml);
198 public:
void AddModelPlugin(
const sdf::ElementPtr &_pluginElem);
206 public:
void GenerateSDF();
211 private: sdf::ElementPtr GenerateLinkSDF(
LinkData *_link);
214 private:
void OnNew();
218 private:
bool OnSave();
222 private:
bool OnSaveAs();
227 private:
void OnNameChanged(
const std::string &_modelName);
232 private:
void OnPropertiesChanged(
const bool _static,
233 const bool _autoDisable);
236 private:
void OnExit();
239 private:
void Update();
244 private:
void RemoveNestedModelImpl(
const std::string &_nestedModelName);
249 private:
void RemoveLinkImpl(
const std::string &_linkName);
253 private slots:
void OnEdit(
bool _checked);
257 private slots:
void OnEditModel(
const std::string &_modelName);
260 private slots:
void OnCopy();
263 private slots:
void OnPaste();
292 private:
void OnManipMode(
const std::string &_mode);
297 private:
void OnSetSelectedEntity(
const std::string &_name,
298 const std::string &_mode);
304 private:
void OnSetSelectedLink(
const std::string &_name,
305 const bool _selected);
311 private:
void OnSetSelectedModelPlugin(
const std::string &_name,
312 const bool _selected);
325 private:
NestedModelData *CloneNestedModel(
const std::string &_modelName);
330 private:
LinkData *CloneLink(
const std::string &_linkName);
337 private:
LinkData *CreateLinkFromSDF(
const sdf::ElementPtr &_linkElem,
342 private:
void OpenInspector(
const std::string &_name);
346 private:
void OpenModelPluginInspector(
const std::string &_name);
349 private:
virtual void CreateTheEntity();
352 private:
bool Init();
356 private: std::string CreateModel();
366 private:
NestedModelData *CreateModelFromSDF(
const sdf::ElementPtr &_sdf,
368 const bool _emit =
true);
377 private:
void OnAlignMode(
const std::string &_axis,
378 const std::string &_config,
const std::string &_target,
379 const bool _preview,
const bool _inverted =
false);
384 private:
void OnEntityScaleChanged(
const std::string &_name,
389 private:
void DeselectAll();
392 private:
void DeselectAllLinks();
395 private:
void DeselectAllNestedModels();
398 private:
void DeselectAllModelPlugins();
404 private:
void SetModelVisible(
const std::string &_name,
bool _visible);
415 private:
void ShowContextMenu(
const std::string &_link);
419 private:
void ShowModelPluginContextMenu(
const std::string &_name);
423 private:
void EmitNestedModelInsertedEvent(
428 private slots:
void OnDelete();
432 private slots:
void OnDelete(
const std::string &_name);
435 private slots:
void OnOpenInspector();
439 private slots:
void OnOpenModelPluginInspector(
const QString &_name);
443 private slots:
void OnRemoveModelPlugin(
const QString &_name);
446 Q_SIGNALS:
void LinkAdded();
449 private: sdf::SDFPtr modelSDF;
452 private: sdf::SDFPtr modelTemplateSDF;
455 private: std::string modelName;
458 private: std::string folderName;
461 private:
static const std::string previewName;
471 private: ignition::math::Pose3d modelPose;
474 private:
bool isStatic;
477 private:
bool autoDisable;
480 private: std::vector<event::ConnectionPtr> connections;
483 private:
int linkCounter;
486 private:
int modelCounter;
489 private: EntityType addEntityType;
492 private: std::map<std::string, NestedModelData *> allNestedModels;
495 private: std::map<std::string, LinkData *> allLinks;
498 private: std::map<std::string, ModelPluginData *> allModelPlugins;
518 private: std::vector<rendering::VisualPtr> selectedNestedModels;
521 private: std::vector<rendering::VisualPtr> selectedLinks;
524 private: std::vector<std::string> selectedModelPlugins;
527 private: std::vector<std::string> copiedNames;
533 private: QAction *inspectAct;
536 private: std::string inspectName;
539 private:
bool active;
542 private: std::string manipMode;
545 private:
static const std::string modelDefaultName;
551 private:
enum SaveState currentSaveState;
554 private: std::recursive_mutex updateMutex;
557 private: std::map<std::string, math::Vector3> linkScaleUpdate;
561 private: std::string serverModelName;
564 private: sdf::ElementPtr serverModelSDF;
568 private: std::map<uint32_t, bool> serverModelVisible;
571 private: std::string canonicalModel;
574 private: std::string canonicalLink;
none
Definition: ModelCreator.hh:67
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Dialog for saving to file.
Definition: SaveDialog.hh:37
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
#define GZ_GUI_VISIBLE
Definition: system.hh:284
Imported 3D mesh.
Definition: ModelCreator.hh:75
Box.
Definition: ModelCreator.hh:69
Extruded polyline.
Definition: ModelCreator.hh:77
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Forward declarations for transport.
Definition: ModelCreator.hh:90
Definition: ModelCreator.hh:87
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
Sphere.
Definition: ModelCreator.hh:71
Helper class to store nested models data.
Definition: ModelData.hh:57
static const Vector3 One
math::Vector3(1, 1, 1)
Definition: Vector3.hh:45
Create and manage 3D visuals of a model with links and joints.
Definition: ModelCreator.hh:58
Handles the creation of joints in the model editor.
Definition: JointMaker.hh:77
Helper class to store model plugin data.
Definition: ModelData.hh:224
Helper class to store link data.
Definition: ModelData.hh:90
#define NULL
Definition: CommonTypes.hh:31
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
SaveState
Save states for the model editor.
Definition: ModelCreator.hh:84
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
static const Pose Zero
math::Pose(0, 0, 0, 0, 0, 0)
Definition: Pose.hh:40
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
Cylinder.
Definition: ModelCreator.hh:73
A plugin with access to physics::Model.
Definition: Plugin.hh:245
EntityType
Definition: ModelCreator.hh:64