NDEVR
API Documentation
SetPropertiesCommand

A command that sets arbitrary properties on design objects using runtime-resolved property identifiers and string-serialized values. More...

Inheritance diagram for SetPropertiesCommand:
[legend]
Collaboration diagram for SetPropertiesCommand:
[legend]

Classes

struct  PropertyValue
 Holds a single property assignment: a target object UUID, the property to change, and the new value serialized as a string. More...

Public Member Functions

 SetPropertiesCommand ()
 Default constructor.
template<class t_type>
void add (const DesignObject &obj, NDPO prop, const t_type &value)
 Adds a property change for a DesignObject identified by an NDPO property.
template<class t_type>
void add (const Geometry &geo, NDPG prop, const t_type &value)
 Adds a property change for a Geometry object identified by an NDPG property.
template<class t_type>
void add (const Material &mat, NDPM prop, const t_type &value)
 Adds a property change for a Material object identified by an NDPM property.
virtual bool addTarget (UUID) override
 This command does not support adding targets via UUID; property targets are specified individually through the add() methods instead.
virtual void execute (DesignObjectLookup *lookup) override
 Executes or undoes all property changes stored in this command.
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< PropertyValueproperties
 The list of property changes 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.

Additional Inherited Members

Protected Attributes inherited from DesignCommand
UUID m_undo_redo_group
 The undo-redo group this command belongs to, for batch undo/redo.

Detailed Description

A command that sets arbitrary properties on design objects using runtime-resolved property identifiers and string-serialized values.


Unlike SetProperty and SetProperties, this class supports heterogeneous property changes across different objects and property types in a single command, with full undo/redo support.

Definition at line 193 of file SetPropertiesCommand.h.

Member Function Documentation

◆ add() [1/3]

template<class t_type>
void SetPropertiesCommand::add ( const DesignObject & obj,
NDPO prop,
const t_type & value )
inline

Adds a property change for a DesignObject identified by an NDPO property.

Parameters
[in]objThe design object whose property will be set.
[in]propThe NDPO property identifier.
[in]valueThe new value to assign, converted to String for storage.
Template Parameters
t_typeThe type of the value being set.

Definition at line 238 of file SetPropertiesCommand.h.

References DesignObject::get(), guid, and properties.

◆ add() [2/3]

template<class t_type>
void SetPropertiesCommand::add ( const Geometry & geo,
NDPG prop,
const t_type & value )
inline

Adds a property change for a Geometry object identified by an NDPG property.

Parameters
[in]geoThe geometry whose property will be set.
[in]propThe NDPG property identifier.
[in]valueThe new value to assign, converted to String for storage.
Template Parameters
t_typeThe type of the value being set.

Definition at line 250 of file SetPropertiesCommand.h.

References DesignObject::get(), guid, and properties.

◆ add() [3/3]

template<class t_type>
void SetPropertiesCommand::add ( const Material & mat,
NDPM prop,
const t_type & value )
inline

Adds a property change for a Material object identified by an NDPM property.

Parameters
[in]matThe material whose property will be set.
[in]propThe NDPM property identifier.
[in]valueThe new value to assign, converted to String for storage.
Template Parameters
t_typeThe type of the value being set.

Definition at line 262 of file SetPropertiesCommand.h.

References DesignObject::get(), guid, and properties.

◆ addTarget()

virtual bool SetPropertiesCommand::addTarget ( UUID )
inlineoverridevirtual

This command does not support adding targets via UUID; property targets are specified individually through the add() methods instead.

Parameters
[in]target_idUnused.
Returns
False, always.

Reimplemented from DesignCommand.

Definition at line 272 of file SetPropertiesCommand.h.

◆ execute()

virtual void SetPropertiesCommand::execute ( DesignObjectLookup * lookup)
overridevirtual

Executes or undoes all property changes stored in this command.

Parameters
[in]lookupThe design object registry containing the target objects.

Reimplemented from DesignCommand.

◆ icon()

virtual StringView SetPropertiesCommand::icon ( ) const
inlineoverridevirtual

Returns the icon identifier for this command.

Returns
A string view containing the icon name.

Implements DesignCommand.

Definition at line 213 of file SetPropertiesCommand.h.

◆ name()

virtual TranslatedString SetPropertiesCommand::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 221 of file SetPropertiesCommand.h.


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