MEUserCmd Class Reference

Class which represents a user command, which can be "undone" and "redone". More...

#include <MEUserCmdManager.hh>

Public Types

enum  CmdType {
  INSERTING_LINK = 0, DELETING_LINK = 1, INSERTING_NESTED_MODEL = 2, DELETING_NESTED_MODEL = 3,
  INSERTING_JOINT = 4, DELETING_JOINT = 5
}
 Types of user commands. More...
 

Public Member Functions

 MEUserCmd (const unsigned int _id, const std::string &_description, MEUserCmd::CmdType _type)
 Constructor. More...
 
virtual ~MEUserCmd ()
 Destructor. More...
 
std::string Description () const
 Return this command's description. More...
 
unsigned int Id () const
 Return this command's unique ID. More...
 
virtual void Redo ()
 Redo this command. More...
 
void SetJointId (const std::string &_id)
 Set the unique id of the joint related to this command. More...
 
void SetScopedName (const std::string &_name)
 Set the scoped name of the entity related to this command. More...
 
void SetSDF (sdf::ElementPtr _sdf)
 Set the SDF element relevant to this command. More...
 
virtual void Undo ()
 Undo this command. More...
 

Protected Attributes

std::unique_ptr< MEUserCmdPrivate > dataPtr
 

Detailed Description

Class which represents a user command, which can be "undone" and "redone".

Member Enumeration Documentation

enum CmdType

Types of user commands.

Enumerator
INSERTING_LINK 

Insert a link.

DELETING_LINK 

Delete a link.

INSERTING_NESTED_MODEL 

Insert a nested model.

DELETING_NESTED_MODEL 

Delete a nested model.

INSERTING_JOINT 

Insert a joint.

DELETING_JOINT 

Delete a joint.

Constructor & Destructor Documentation

MEUserCmd ( const unsigned int  _id,
const std::string &  _description,
MEUserCmd::CmdType  _type 
)

Constructor.

Parameters
[in]_idUnique ID for this command
[in]_descriptionDescription for the command, such as "Rotate box", "Delete sphere", etc.
[in]_typeType of command, such as MOVING, DELETING, etc.
virtual ~MEUserCmd ( )
virtual

Destructor.

Member Function Documentation

std::string Description ( ) const

Return this command's description.

Returns
Description
unsigned int Id ( ) const

Return this command's unique ID.

Returns
Unique ID
virtual void Redo ( )
virtual

Redo this command.

void SetJointId ( const std::string &  _id)

Set the unique id of the joint related to this command.

Parameters
[in]_idUnique id of joint.
void SetScopedName ( const std::string &  _name)

Set the scoped name of the entity related to this command.

Parameters
[in]_nameFully scoped entity name.
void SetSDF ( sdf::ElementPtr  _sdf)

Set the SDF element relevant to this command.

Parameters
[in]_sdfSDF pointer.
virtual void Undo ( )
virtual

Undo this command.

Member Data Documentation

std::unique_ptr<MEUserCmdPrivate> dataPtr
protected

The documentation for this class was generated from the following file: