NDEVR
API Documentation
SetProperties< t_property, t_type >

A command that sets a single compile-time-known property on multiple DesignObjects at once, with full undo/redo support. More...

Inheritance diagram for SetProperties< t_property, t_type >:
[legend]
Collaboration diagram for SetProperties< t_property, t_type >:
[legend]

Public Member Functions

 SetProperties ()
 Default constructor.
 SetProperties (t_type value)
 Constructs a SetProperties command with the value to apply to all targets.
virtual bool addTarget (UUID target_id) override
 Adds a target object by UUID to this command's target list.
void execute (DesignObjectLookup *lookup)
 Executes or undoes the property change on all target objects.
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

Buffer< UUIDtargets
 The list of target design object UUIDs.
t_type value
 The new property value to apply to all targets.
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

Buffer< t_type > m_previous_values
 Stored previous values for each target, used for undo.
Protected Attributes inherited from DesignCommand
UUID m_undo_redo_group
 The undo-redo group this command belongs to, for batch undo/redo.

Detailed Description

template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
class SetProperties< t_property, t_type >

A command that sets a single compile-time-known property on multiple DesignObjects at once, with full undo/redo support.


Each target's previous value is individually stored and restored on undo.

Template Parameters
t_propertyThe compile-time property identifier (e.g., an NDPO, NDPG, or NDPM enum value).
t_typeThe value type of the property, defaulting to the type declared by PropertySpec.

Definition at line 115 of file SetPropertiesCommand.h.

Constructor & Destructor Documentation

◆ SetProperties()

template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
SetProperties< t_property, t_type >::SetProperties ( t_type value)
inline

Constructs a SetProperties command with the value to apply to all targets.

Parameters
[in]valueThe new value to assign to the property on each target.

Definition at line 126 of file SetPropertiesCommand.h.

References value.

Member Function Documentation

◆ addTarget()

template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
virtual bool SetProperties< t_property, t_type >::addTarget ( UUID target_id)
inlineoverridevirtual

Adds a target object by UUID to this command's target list.

Parameters
[in]target_idThe UUID of the design object to add as a target.
Returns
True, indicating the target was accepted.

Reimplemented from DesignCommand.

Definition at line 180 of file SetPropertiesCommand.h.

References targets.

◆ execute()

template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
void SetProperties< t_property, t_type >::execute ( DesignObjectLookup * lookup)
inlinevirtual

Executes or undoes the property change on all target objects.

When executing forward, each target's previous value is stored and the new value is applied. When undoing, each target's previous value is restored. Invalid targets are skipped.

Parameters
[in]lookupThe design object registry containing the target objects.
Note
This method is missing the override keyword on the base class virtual.

Reimplemented from DesignCommand.

Definition at line 153 of file SetPropertiesCommand.h.

References DesignCommand::is_undo, m_previous_values, DesignObjectLookup::object(), targets, value, and DesignObjectLookup::writeLock().

◆ icon()

template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
virtual StringView SetProperties< t_property, t_type >::icon ( ) const
inlineoverridevirtual

Returns the icon identifier for this command.

Returns
A string view containing the icon name.

Implements DesignCommand.

Definition at line 134 of file SetPropertiesCommand.h.

◆ name()

template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
virtual TranslatedString SetProperties< t_property, t_type >::name ( ) const
inlineoverridevirtual

Returns the human-readable name of this command for display in the UI.

Returns
The translated command name.

Implements DesignCommand.

Definition at line 142 of file SetPropertiesCommand.h.


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