17 #ifndef _MODEL_CREATOR_HH_
18 #define _MODEL_CREATOR_HH_
39 class recursive_mutex;
104 public:
void SetModelName(
const std::string &_modelName);
108 public: std::string GetModelName()
const;
111 public:
void ModelChanged();
114 private:
void OnNew();
117 public:
void SaveModelFiles();
121 private:
bool OnSave();
125 private:
bool OnSaveAs();
129 private:
void OnNameChanged(
const std::string &_modelName);
132 private:
void OnExit();
135 private:
void Update();
138 public:
void FinishModel();
146 public: std::string AddShape(LinkType _type,
149 const std::string &_uri =
"",
unsigned int _samples = 5);
155 public: std::string AddBox(
163 public: std::string AddSphere(
double _radius = 0.5,
171 public: std::string AddCylinder(
double _radius = 0.5,
179 public: std::string AddCustom(
const std::string &_name,
185 public:
void AddJoint(
const std::string &_type);
189 public:
void RemoveLink(
const std::string &_linkName);
193 public:
void SetStatic(
bool _static);
197 public:
void SetAutoDisable(
bool _auto);
200 public:
void Reset();
212 public:
void SetSelected(
const std::string &_name,
const bool selected);
218 const bool selected);
222 public:
enum SaveState GetCurrentSaveState()
const;
226 public:
void AddLink(LinkType _type);
229 public:
void GenerateSDF();
234 private: sdf::ElementPtr GenerateLinkSDF(
LinkData *_link);
239 private:
void RemoveLinkImpl(
const std::string &_linkName);
243 private slots:
void OnEdit(
bool _checked);
247 private slots:
void OnEditModel(
const std::string &_modelName);
250 private slots:
void OnCopy();
253 private slots:
void OnPaste();
282 private:
void OnManipMode(
const std::string &_mode);
287 private:
void OnSetSelectedEntity(
const std::string &_name,
288 const std::string &_mode);
294 private:
void OnSetSelectedLink(
const std::string &_name,
295 const bool _selected);
307 private:
LinkData *CloneLink(
const std::string &_linkName);
312 private:
void CreateLinkFromSDF(sdf::ElementPtr _linkElem);
316 private:
void OpenInspector(
const std::string &_name);
319 private:
virtual void CreateTheEntity();
322 private:
bool Init();
326 private: std::string CreateModel();
331 private:
void LoadSDF(sdf::ElementPtr _sdf);
339 private:
void OnAlignMode(
const std::string &_axis,
340 const std::string &_config,
const std::string &_target,
346 private:
void OnEntityScaleChanged(
const std::string &_name,
350 private:
void DeselectAll();
356 private:
void SetModelVisible(
const std::string &_name,
bool _visible);
367 private:
void ShowContextMenu(
const std::string &_link);
371 private slots:
void OnDelete();
375 private slots:
void OnDelete(
const std::string &_name);
378 private slots:
void OnOpenInspector();
381 Q_SIGNALS:
void LinkAdded();
384 private: sdf::SDFPtr modelSDF;
387 private: sdf::SDFPtr modelTemplateSDF;
390 private: std::string modelName;
393 private: std::string folderName;
396 private:
static const std::string previewName;
408 private:
bool isStatic;
411 private:
bool autoDisable;
414 private: std::vector<event::ConnectionPtr> connections;
417 private:
int linkCounter;
420 private:
int modelCounter;
423 private: LinkType addLinkType;
426 private: std::map<std::string, LinkData *> allLinks;
446 private: std::vector<rendering::VisualPtr> selectedLinks;
449 private: std::vector<std::string> copiedLinkNames;
455 private: QAction *inspectAct;
458 private: std::string inspectName;
461 private:
bool active;
464 private: std::string manipMode;
467 private:
static const std::string modelDefaultName;
473 private:
enum SaveState currentSaveState;
476 private: boost::recursive_mutex *updateMutex;
479 private: std::map<std::string, math::Vector3> linkScaleUpdate;
483 private: std::string serverModelName;
486 private: sdf::ElementPtr serverModelSDF;
490 private: std::map<uint32_t, bool> serverModelVisible;
493 private: std::string canonicalLink;
none
Definition: ModelCreator.hh:69
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
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Forward declarations for transport.
Sphere.
Definition: ModelCreator.hh:73
Definition: ModelCreator.hh:90
Definition: ModelCreator.hh:87
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:60
Joint visualization.
Definition: JointMaker.hh:58
LinkType
Definition: ModelCreator.hh:66
Helper class to store link data.
Definition: ModelData.hh:56
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
#define GZ_GUI_MODEL_VISIBLE
Definition: system.hh:418
Cylinder.
Definition: ModelCreator.hh:75
Imported 3D mesh.
Definition: ModelCreator.hh:77
SaveState
Save states for the model editor.
Definition: ModelCreator.hh:84
Box.
Definition: ModelCreator.hh:71
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
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