SDFormat Editor
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DeleteElementCommand Class Reference

Delete Element command implementation of CommandI. More...

#include <DeleteElementCommand.h>

Inheritance diagram for DeleteElementCommand:
Inheritance graph
Collaboration diagram for DeleteElementCommand:
Collaboration graph

Public Member Functions

 DeleteElementCommand (std::shared_ptr< GUII > gui, std::shared_ptr< SDFormatParserI > sdformatParser, sdf::ElementPtr element_to_delete)
 Constructor for delete 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.
 
bool ElementRequired ()
 Determine if an element is strictly required.
 

Private Attributes

std::shared_ptr< GUIIgui
 Pointer to the gui interface.
 
std::shared_ptr< SDFormatParserIsdformatParser
 Pointer to the sdformat parser interface.
 
sdf::ElementPtr element_to_delete
 Pointer to the element to delete.
 
sdf::ElementPtr element_to_deletes_parent
 Pointer to the parent of the element to delete.
 
bool is_currently_undoable = false
 Store if the command is currently undo-able.
 
bool is_currently_redoable = false
 Store if the command is currently redo-able.
 

Detailed Description

Delete Element command implementation of CommandI.

Constructor & Destructor Documentation

◆ DeleteElementCommand()

DeleteElementCommand::DeleteElementCommand ( std::shared_ptr< GUII gui,
std::shared_ptr< SDFormatParserI sdformatParser,
sdf::ElementPtr  element_to_delete 
)

Constructor for delete element command objects.

Parameters
[in]guiPointer to the GUII object
[in]sdformatParserPointer to the SDFormatParserI object
[in]element_to_deletePointer to the element that may be deleted

Member Function Documentation

◆ ChangesProgramStateIrreversibly()

bool DeleteElementCommand::ChangesProgramStateIrreversibly ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Always false

Implements CommandI.

◆ ElementRequired()

bool DeleteElementCommand::ElementRequired ( )
private

Determine if an element is strictly required.

Returns
True if the element is a required element and is the only child element of that type

◆ Execute()

bool DeleteElementCommand::Execute ( )
overrideprivatevirtual

Implementation of interface method.

Returns
True if the element has been deleted from it's parent

Implements CommandI.

◆ ExecuteRedo()

bool DeleteElementCommand::ExecuteRedo ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the element to delete was removed from its parent again

Implements CommandI.

◆ ExecuteUndo()

bool DeleteElementCommand::ExecuteUndo ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the element to delete was already deleted and now restored to its parent

Implements CommandI.

◆ IsRedoable()

bool DeleteElementCommand::IsRedoable ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the command has been undone

Implements CommandI.

◆ IsThreaded()

bool DeleteElementCommand::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()

bool DeleteElementCommand::IsUndoable ( )
overrideprivatevirtual

Implementation of interface method.

Returns
Returns true if the command has been executed or redone

Implements CommandI.


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