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

Modify Element command implementation of CommandI. More...

#include <ModifyElementCommand.h>

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

Public Member Functions

 ModifyElementCommand (std::shared_ptr< GUII > gui, std::shared_ptr< SDFormatParserI > sdformatParser, sdf::ElementPtr element_to_modify, T new_value)
 Constructor for modify element 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::ElementPtr element_to_modify
 Pointer to the element to modify.
 
new_value
 The value that will be given to the element.
 
old_value
 The value that will be overridden in the element.
 
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 ModifyElementCommand< T >

Modify Element command implementation of CommandI.

Constructor & Destructor Documentation

◆ ModifyElementCommand()

template<typename T >
ModifyElementCommand< T >::ModifyElementCommand ( std::shared_ptr< GUII gui,
std::shared_ptr< SDFormatParserI sdformatParser,
sdf::ElementPtr  element_to_modify,
new_value 
)

Constructor for modify element command objects.

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

Member Function Documentation

◆ ChangesProgramStateIrreversibly()

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

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ Execute()

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

Implementation of interface method.

Returns
Returns true if the element's value has been modified

Implements CommandI.

◆ ExecuteRedo()

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

Implementation of interface method.

Returns
Returns true if the element's value has been one again set to the new value

Implements CommandI.

◆ ExecuteUndo()

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

Implementation of interface method.

Returns
Returns true if the element's value has been reset

Implements CommandI.

◆ IsRedoable()

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

Implementation of interface method.

Returns
Returns true if the command has been undone

Implements CommandI.

◆ IsThreaded()

template<typename T >
bool ModifyElementCommand< 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 ModifyElementCommand< 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: