NDEVR
API Documentation
SetPaletteCommand

A DesignCommand that sets a color palette on one or more target materials. More...

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

Public Member Functions

 SetPaletteCommand (const Buffer< RGBColor > &values)
 Constructs a SetPaletteCommand with the given color palette.
virtual ~SetPaletteCommand ()
 Default virtual destructor.
virtual bool addTarget (UUID target_id) override
 Adds a target material to receive the palette.
virtual void execute (DesignObjectLookup *lookup) override
 Executes the command, applying the color palette to all target materials.
virtual StringView icon () const override
 Returns the icon identifier for this command.
virtual TranslatedString name () const override
 Returns the translated display name of this command.
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.

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.

Detailed Description

A DesignCommand that sets a color palette on one or more target materials.


When executed, the specified RGB color palette is applied to each target material. The previous palettes are stored for undo support.

Definition at line 162 of file MaterialCommands.h.

Constructor & Destructor Documentation

◆ SetPaletteCommand()

SetPaletteCommand::SetPaletteCommand ( const Buffer< RGBColor > & values)

Constructs a SetPaletteCommand with the given color palette.

Parameters
[in]valuesThe buffer of RGBColor values to apply as the new palette.

Member Function Documentation

◆ addTarget()

virtual bool SetPaletteCommand::addTarget ( UUID target_id)
inlineoverridevirtual

Adds a target material to receive the palette.

Parameters
[in]target_idThe UUID of the target material.
Returns
True, indicating the target was accepted.

Reimplemented from DesignCommand.

Definition at line 197 of file MaterialCommands.h.

◆ execute()

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

Executes the command, applying the color palette to all target materials.

Parameters
[in]lookupThe DesignObjectLookup containing the target materials.

Reimplemented from DesignCommand.

◆ icon()

virtual StringView SetPaletteCommand::icon ( ) const
overridevirtual

Returns the icon identifier for this command.

Returns
A StringView representing the icon name.

Implements DesignCommand.

◆ name()

virtual TranslatedString SetPaletteCommand::name ( ) const
overridevirtual

Returns the translated display name of this command.

Returns
A TranslatedString containing the command name.

Implements DesignCommand.


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