SDFormat Editor
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ModifyAttributeCommand< T > Class Template Reference

Modify Attribute command implementation of CommandI. More...

#include <ModifyAttributeCommand.h>

Inheritance diagram for ModifyAttributeCommand< T >:
Inheritance graph
Collaboration diagram for ModifyAttributeCommand< T >:
Collaboration graph

Public Member Functions

 ModifyAttributeCommand (std::shared_ptr< GUII > gui, std::shared_ptr< SDFormatParserI > sdformatParser, sdf::ParamPtr attribute_to_modify, T new_value)
 Constructor for modify attribute command objects.
 

Private Member Functions

bool Execute () override
 Implementation of interface method.
 
bool ExecuteUndo () override
 Implementation of interface method.
 
bool ExecuteRedo () override
 Implementation of interface method.
 
bool IsUndoable () override
 Implementation of interface method.
 
bool IsRedoable () override
 Implementation of interface method.
 
bool IsThreaded (bool &prevent_user_input) override
 Implementation of interface method.
 
bool ChangesProgramStateIrreversibly () override
 Implementation of interface method.
 

Private Attributes

std::string file_path
 Filepath of the model.
 
std::shared_ptr< GUIIgui
 Pointer to the gui interface.
 
std::shared_ptr< SDFormatParserIsdformatParser
 Pointer to the sdformat parser interface.
 
sdf::ParamPtr attribute_to_modify
 Pointer to the attribute to modify.
 
new_value
 The value that will be given to the element.
 
old_value
 The value that will be overridden in the attribute.
 
bool is_currently_undoable = true
 Store if the command is currently undo-able.
 
bool is_currently_redoable = true
 Store if the command is currently redo-able.
 

Detailed Description

template<typename T>
class ModifyAttributeCommand< T >

Modify Attribute command implementation of CommandI.

Constructor & Destructor Documentation

◆ ModifyAttributeCommand()

template<typename T >
ModifyAttributeCommand< T >::ModifyAttributeCommand ( std::shared_ptr< GUII gui,
std::shared_ptr< SDFormatParserI sdformatParser,
sdf::ParamPtr  attribute_to_modify,
new_value 
)

Constructor for modify attribute command objects.

Parameters
[in]guiPointer to the GUII object
[in]sdformatParserPointer to the SDFormatParserI object
[in]attribute_to_modifyPointer to the attribute to modify
[in]new_valueThe new value with which to modify the element

Member Function Documentation

◆ ChangesProgramStateIrreversibly()

template<typename T >
bool ModifyAttributeCommand< T >::ChangesProgramStateIrreversibly ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ Execute()

template<typename T >
bool ModifyAttributeCommand< T >::Execute ( )
overrideprivatevirtual

Implementation of interface method.

Returns
True if the attribute has been modified

Implements CommandI.

◆ ExecuteRedo()

template<typename T >
bool ModifyAttributeCommand< T >::ExecuteRedo ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the element was once again given the new value

Implements CommandI.

◆ ExecuteUndo()

template<typename T >
bool ModifyAttributeCommand< T >::ExecuteUndo ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the attribute has been restored to its initial value

Implements CommandI.

◆ IsRedoable()

template<typename T >
bool ModifyAttributeCommand< T >::IsRedoable ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the command has been undone

Implements CommandI.

◆ IsThreaded()

template<typename T >
bool ModifyAttributeCommand< T >::IsThreaded ( bool &  prevent_user_input)
overrideprivatevirtual

Implementation of interface method.

Parameters
[out]prevent_user_inputindicates if user input should be prevented if this happens to be a threaded command
Returns
Always false

Implements CommandI.

◆ IsUndoable()

template<typename T >
bool ModifyAttributeCommand< T >::IsUndoable ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the command as been executed or redone

Implements CommandI.


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