3#include <NDEVR/DesignCommand.h>
4#include <NDEVR/DesignObjectLookup.h>
5#include <NDEVR/TranslatedString.h>
58 UUID m_previous_material_id = Constant<UUID>::Invalid;
100 virtual bool addTarget(
UUID target_id)
override { m_targets.add(target_id);
return true; }
147 virtual bool addTarget(
UUID target_id)
override { m_targets.add(target_id);
return true; }
197 virtual bool addTarget(
UUID target_id)
override { m_targets.add(target_id);
return true; }
The equivelent of std::vector but with a bit more control.
virtual ~ClearMaterialDescendentsCommand()
Default virtual destructor.
virtual void execute(DesignObjectLookup *lookup) override
Executes the command, clearing material assignments from descendant objects.
virtual TranslatedString name() const override
Returns the translated display name of this command.
virtual StringView icon() const override
Returns the icon identifier for this command.
UUID parent_id
UUID of the parent object scoping the descendant search.
ClearMaterialDescendentsCommand()
Default constructor.
virtual bool addTarget(UUID target_id) override
Adds a target object whose material descendants should be cleared.
DesignCommand()
Default constructor.
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
virtual TranslatedString name() const override
Returns the translated display name of this command.
virtual bool addTarget(UUID target_id) override
Sets the target object that the new material will be assigned to.
NewMaterialCommand(const std::function< void(Material &material)> &on_finished)
Constructs a NewMaterialCommand with a callback invoked after the material is created.
std::function< void(Material &model)> on_create
Optional callback invoked during material creation.
UUID parent_id
UUID of the parent object under which the new material is created.
virtual StringView icon() const override
Returns the icon identifier for this command.
UUID target
UUID of the target object to receive the new material.
virtual void execute(DesignObjectLookup *lookup) override
Executes the command, creating a new Material within the given lookup.
virtual ~NewMaterialCommand()
Default virtual destructor.
std::function< void(Material &model)> finished_callback
Callback invoked after the command finishes execution.
virtual void execute(DesignObjectLookup *lookup) override
Executes the command, assigning the material to all target objects.
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.
UUID material_id
UUID of the material to assign to each target.
SetMaterialCommand()
Default constructor.
virtual bool addTarget(UUID target_id) override
Adds a target object to receive the material assignment.
virtual ~SetMaterialCommand()
Default virtual destructor.
virtual TranslatedString name() const override
Returns the translated display name of this command.
SetPaletteCommand(const Buffer< RGBColor > &values)
Constructs a SetPaletteCommand with the given color palette.
virtual StringView icon() const override
Returns the icon identifier for this command.
virtual void execute(DesignObjectLookup *lookup) override
Executes the command, applying the color palette to all target materials.
virtual ~SetPaletteCommand()
Default virtual destructor.
virtual bool addTarget(UUID target_id) override
Adds a target material to receive the palette.
The core String View class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.