18#ifndef GAZEBO_GUI_MODEL_MEUSERCMDMANAGER_HH_
19#define GAZEBO_GUI_MODEL_MEUSERCMDMANAGER_HH_
41 class MEUserCmdPrivate;
42 class MEUserCmdManagerPrivate;
59 INSERTING_NESTED_MODEL = 2,
62 DELETING_NESTED_MODEL = 3,
74 MOVING_NESTED_MODEL = 7,
80 INSERTING_MODEL_PLUGIN = 9,
83 DELETING_MODEL_PLUGIN = 10
91 public:
MEUserCmd(
const unsigned int _id,
const std::string &_description,
98 public:
virtual void Undo();
105 public:
unsigned int Id()
const;
113 public:
void SetSDF(sdf::ElementPtr _sdf);
128 const ignition::math::Pose3d &_after);
134 const std::map<std::string, ignition::math::Vector3d> &_before,
135 const std::map<std::string, ignition::math::Vector3d> &_after);
139 protected: std::unique_ptr<MEUserCmdPrivate>
dataPtr;
167 private slots:
void OnUndoCommand(QAction *_action);
171 private slots:
void OnRedoCommand(QAction *_action);
175 private:
virtual bool HasUndo()
const;
179 private:
virtual bool HasRedo()
const;
183 private:
virtual std::vector<std::pair<unsigned int, std::string>>
184 Cmds(
const bool _undo)
const;
188 private: std::unique_ptr<MEUserCmdManagerPrivate> dataPtr;
gui
Definition KeyEventHandler.hh:29
Class which manages user commands in the model editor.
Definition MEUserCmdManager.hh:145
MEUserCmdPtr NewCmd(const std::string &_description, const MEUserCmd::CmdType _type)
Register that a new command has been executed by the user.
void Reset()
Reset commands.
virtual ~MEUserCmdManager()
Destructor.
MEUserCmdManager()
Constructor.
Class which represents a user command, which can be "undone" and "redone".
Definition MEUserCmdManager.hh:47
void SetJointId(const std::string &_id)
Set the unique id of the joint related to this command.
std::string Description() const
Return this command's description.
void SetScaleChange(const std::map< std::string, ignition::math::Vector3d > &_before, const std::map< std::string, ignition::math::Vector3d > &_after)
Set the scale factors before and after the command.
virtual ~MEUserCmd()
Destructor.
void SetSDF(sdf::ElementPtr _sdf)
Set the SDF element relevant to this command.
MEUserCmd(const unsigned int _id, const std::string &_description, MEUserCmd::CmdType _type)
Constructor.
virtual void Redo()
Redo this command.
CmdType
Types of user commands.
Definition MEUserCmdManager.hh:51
@ DELETING_NESTED_MODEL
Delete a nested model.
Definition MEUserCmdManager.hh:62
@ DELETING_LINK
Delete a link.
Definition MEUserCmdManager.hh:56
@ DELETING_JOINT
Delete a joint.
Definition MEUserCmdManager.hh:68
@ INSERTING_NESTED_MODEL
Insert a nested model.
Definition MEUserCmdManager.hh:59
@ DELETING_MODEL_PLUGIN
Delete a model plugin.
Definition MEUserCmdManager.hh:83
@ INSERTING_JOINT
Insert a joint.
Definition MEUserCmdManager.hh:65
@ INSERTING_LINK
Insert a link.
Definition MEUserCmdManager.hh:53
@ MOVING_NESTED_MODEL
Move a nested model.
Definition MEUserCmdManager.hh:74
@ SCALING_LINK
Scale a link.
Definition MEUserCmdManager.hh:77
@ INSERTING_MODEL_PLUGIN
Insert a model plugin.
Definition MEUserCmdManager.hh:80
@ MOVING_LINK
Move a link.
Definition MEUserCmdManager.hh:71
void SetPoseChange(const ignition::math::Pose3d &_before, const ignition::math::Pose3d &_after)
Set the pose before and after the command.
std::unique_ptr< MEUserCmdPrivate > dataPtr
Definition MEUserCmdManager.hh:139
void SetScopedName(const std::string &_name)
Set the scoped name of the entity related to this command.
unsigned int Id() const
Return this command's unique ID.
virtual void Undo()
Undo this command.
Class which manages user commands in the client side.
Definition UserCmdHistory.hh:37
std::shared_ptr< MEUserCmd > MEUserCmdPtr
Definition ModelEditorTypes.hh:37
Forward declarations for the common classes.
Definition Animation.hh:27