![]() |
NDEVR
API Documentation
|
A command that sets a single compile-time-known property on a single DesignObject, with full undo/redo support. More...
Public Member Functions | |
| SetProperty () | |
| Default constructor. | |
| SetProperty (const DesignObject &object, const t_type &value) | |
| Constructs a SetProperty command targeting a specific object with the given value. | |
| SetProperty (const SetProperty< t_property, t_type > &value) | |
| Copy constructor. | |
| SetProperty (const t_type &value) | |
| Constructs a SetProperty command with a value but no target. | |
| virtual bool | addTarget (UUID target_id) override |
| Sets the target object for this command by UUID, replacing any previous target. | |
| void | execute (DesignObjectLookup *lookup) override |
| Executes or undoes the property change on the target object. | |
| virtual StringView | icon () const override |
| Returns the icon identifier for this command. | |
| virtual TranslatedString | name () const override |
| Returns the human-readable name of this command for display in the UI. | |
| 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. | |
| virtual bool | isAsyncExecution () const |
| Whether this command should be executed asynchronously. | |
| 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. | |
Public Attributes | |
| t_type | value |
| The new property value to apply. | |
| 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 | |
| t_type | m_previous_value |
| The stored previous value, used for undo. | |
| UUID | m_target |
| The UUID of the target design object. | |
| Protected Attributes inherited from DesignCommand | |
| UUID | m_undo_redo_group |
| The undo-redo group this command belongs to, for batch undo/redo. | |
A command that sets a single compile-time-known property on a single DesignObject, with full undo/redo support.
The property and its value type are specified as template parameters.
| t_property | The compile-time property identifier (e.g., an NDPO, NDPG, or NDPM enum value). |
| t_type | The value type of the property, defaulting to the type declared by PropertySpec. |
Definition at line 22 of file SetPropertiesCommand.h.
|
inline |
Constructs a SetProperty command targeting a specific object with the given value.
| [in] | object | The design object whose property will be set. |
| [in] | value | The new value to assign to the property. |
Definition at line 33 of file SetPropertiesCommand.h.
References m_previous_value, m_target, and value.
|
inline |
Constructs a SetProperty command with a value but no target.
A target must be added later via addTarget() before execution.
| [in] | value | The new value to assign to the property. |
Definition at line 43 of file SetPropertiesCommand.h.
References m_previous_value, m_target, and value.
|
inline |
Copy constructor.
| [in] | value | The SetProperty instance to copy from. |
Definition at line 52 of file SetPropertiesCommand.h.
References DesignCommand::DesignCommand(), SetProperty(), m_previous_value, m_target, and value.
|
inlineoverridevirtual |
Sets the target object for this command by UUID, replacing any previous target.
| [in] | target_id | The UUID of the design object to target. |
Reimplemented from DesignCommand.
Definition at line 100 of file SetPropertiesCommand.h.
References m_target.
|
inlineoverridevirtual |
Executes or undoes the property change on the target object.
When executing forward, the previous value is stored and the new value is applied. When undoing, the previous value is restored.
| [in] | lookup | The design object registry containing the target object. |
Reimplemented from DesignCommand.
Definition at line 81 of file SetPropertiesCommand.h.
References DesignCommand::is_undo, m_previous_value, m_target, DesignObjectLookup::object(), value, and DesignObjectLookup::writeLock().
|
inlineoverridevirtual |
Returns the icon identifier for this command.
Implements DesignCommand.
Definition at line 63 of file SetPropertiesCommand.h.
|
inlineoverridevirtual |
Returns the human-readable name of this command for display in the UI.
Implements DesignCommand.
Definition at line 71 of file SetPropertiesCommand.h.