![]() |
NDEVR
API Documentation
|
Allows for convenient groupings of commands that can be redo-undo all at once. More...
Public Member Functions | |
| DesignCommandGroup () | |
| Default constructor. | |
| DesignCommandGroup (const Buffer< DynamicPointer< DesignCommand > > &buffer) | |
| Constructs a command group from a buffer of commands. | |
| DesignCommandGroup (const TranslatedString &name, StringView icon=StringView()) | |
| Constructs a command group with a display name and optional icon. | |
| DesignCommandGroup (std::initializer_list< DynamicPointer< DesignCommand > > l) | |
| Constructs a command group from an initializer list of commands. | |
| virtual | ~DesignCommandGroup () |
| Virtual destructor. | |
| template<class t_type> | |
| void | add (const DynamicPointer< t_type > &val) |
| Adds a command to this group via a DynamicPointer. | |
| template<class t_type> | |
| void | add (t_type &&val) |
| Adds a command to this group via move semantics. | |
| virtual bool | addTarget (UUID id) override |
| Adds a target UUID to all commands in this group. | |
| virtual void | execute (DesignObjectLookup *lookup) override |
| Executes all commands in this group sequentially against the given lookup. | |
| virtual StringView | icon () const override |
| Gets the icon identifier for this command group. | |
| virtual bool | isAsyncExecution () const override |
| Checks whether any command in this group requires async execution. | |
| virtual TranslatedString | name () const override |
| Gets the display name of this command group. | |
| Public Member Functions inherited from DesignCommand | |
| DesignCommand () | |
| Default constructor. | |
| DesignCommand (const DesignCommand &command)=default | |
| Default copy constructor. | |
| virtual | ~DesignCommand () |
| Virtual destructor. | |
| virtual bool | canCombineWith (const DynamicPointer< DesignCommand > &) |
| Checks whether this command can be combined with another command into a single operation. | |
| virtual bool | canGroupWith (const DynamicPointer< DesignCommand > &) |
| Checks whether this command can be grouped with another command for batch execution. | |
| virtual void | combineWith (const DynamicPointer< DesignCommand > &command) |
| Combines this command with another compatible command, merging their operations. | |
| void | setUndoRedoID (UUID undo_redo_group) |
| Sets the undo-redo group identifier for this command. | |
| UUID | undoRedoID () const |
| Gets the undo-redo group identifier for this command. | |
Additional Inherited Members | |
| Public Attributes inherited from DesignCommand | |
| bool | can_undo = true |
| Whether this command supports being undone. | |
| bool | has_executed = false |
| Whether this command has already been executed. | |
| UUID | id |
| Unique identifier for this command instance. | |
| bool | is_undo = false |
| Whether this command represents an undo operation. | |
| LogPtr | log |
| Log pipe for reporting command progress and errors. | |
| Time | time = Constant<Time>::Invalid |
| Timestamp of when the command was created or executed. | |
| bool | update_project_modified = true |
| Whether executing this command should mark the project as modified. | |
| Protected Attributes inherited from DesignCommand | |
| UUID | m_undo_redo_group |
| The undo-redo group this command belongs to, for batch undo/redo. | |
Allows for convenient groupings of commands that can be redo-undo all at once.
Execution at one time ensured.
Definition at line 134 of file DesignCommand.h.
|
inline |
Default constructor.
Creates an empty command group.
Definition at line 138 of file DesignCommand.h.
| DesignCommandGroup::DesignCommandGroup | ( | const TranslatedString & | name, |
| StringView | icon = StringView() ) |
| DesignCommandGroup::DesignCommandGroup | ( | std::initializer_list< DynamicPointer< DesignCommand > > | l | ) |
Constructs a command group from an initializer list of commands.
| [in] | l | The initializer list of commands to include in this group. |
| DesignCommandGroup::DesignCommandGroup | ( | const Buffer< DynamicPointer< DesignCommand > > & | buffer | ) |
Constructs a command group from a buffer of commands.
| [in] | buffer | The buffer of commands to include in this group. |
|
inline |
Adds a command to this group via a DynamicPointer.
| [in] | val | The command to add, automatically cast to DesignCommand. |
Definition at line 178 of file DesignCommand.h.
Referenced by add().
|
inline |
Adds a command to this group via move semantics.
| [in] | val | The command to move into this group. |
Definition at line 187 of file DesignCommand.h.
References add().
|
overridevirtual |
Adds a target UUID to all commands in this group.
Reimplemented from DesignCommand.
|
overridevirtual |
Executes all commands in this group sequentially against the given lookup.
| [in] | lookup | The design object registry to modify. |
Reimplemented from DesignCommand.
|
overridevirtual |
Gets the icon identifier for this command group.
Implements DesignCommand.
Referenced by DesignCommandGroup().
|
overridevirtual |
Checks whether any command in this group requires async execution.
Reimplemented from DesignCommand.
|
overridevirtual |
Gets the display name of this command group.
Implements DesignCommand.
Referenced by DesignCommandGroup().