3#include <NDEVR/DesignCommand.h>
4#include <NDEVR/Model.h>
5#include <NDEVR/Geometry.h>
6#include <NDEVR/Material.h>
7#include <NDEVR/Buffer.h>
8#include <NDEVR/DesignObjectLookup.h>
9#include <NDEVR/DesignParameter.h>
10#include <NDEVR/Translator.h>
21 template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
73 return _t(
"Set Property");
92 object.update<t_property>(
value);
114 template<auto t_property, class t_type = typename PropertySpec<t_property>::type>
144 return _t(
"Set Properties");
161 if (!
object.isValid())
163 t_type previous_value;
171 object.update<t_property>(
value);
223 return _t(
"Set Properties");
237 template<
class t_type>
249 template<
class t_type>
261 template<
class t_type>
The equivelent of std::vector but with a bit more control.
DesignCommand()
Default constructor.
bool is_undo
Whether this command represents an undo operation.
A core class where all Design Objects including models, materials, and geometries are stored.
DesignObject object(const UUID &id) const
Retrieves a generic design object by its UUID.
WLock writeLock() const
Acquires an exclusive write lock on the design object store.
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
constexpr decltype(auto) get(t_property_type property) const
Retrieves a property value from the database, cast to the requested type.
A definition of data that is logically stored in the Model hierarchy.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
void add(const Geometry &geo, NDPG prop, const t_type &value)
Adds a property change for a Geometry object identified by an NDPG property.
void add(const DesignObject &obj, NDPO prop, const t_type &value)
Adds a property change for a DesignObject identified by an NDPO property.
virtual void execute(DesignObjectLookup *lookup) override
Executes or undoes all property changes stored in this command.
SetPropertiesCommand()
Default constructor.
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 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.
Buffer< PropertyValue > properties
The list of property changes to apply.
virtual bool addTarget(UUID) override
This command does not support adding targets via UUID; property targets are specified individually th...
virtual TranslatedString name() const override
Returns the human-readable name of this command for display in the UI.
void execute(DesignObjectLookup *lookup)
Executes or undoes the property change on all target objects.
virtual bool addTarget(UUID target_id) override
Adds a target object by UUID to this command's target list.
virtual StringView icon() const override
Returns the icon identifier for this command.
SetProperties()
Default constructor.
t_type value
The new property value to apply to all targets.
Buffer< UUID > targets
The list of target design object UUIDs.
SetProperties(t_type value)
Constructs a SetProperties command with the value to apply to all targets.
Buffer< t_type > m_previous_values
Stored previous values for each target, used for undo.
void execute(DesignObjectLookup *lookup) override
Executes or undoes the property change on the target object.
SetProperty(const t_type &value)
Constructs a SetProperty command with a value but no target.
virtual StringView icon() const override
Returns the icon identifier for this command.
SetProperty(const SetProperty< t_property, t_type > &value)
Copy constructor.
t_type value
The new property value to apply.
virtual bool addTarget(UUID target_id) override
Sets the target object for this command by UUID, replacing any previous target.
UUID m_target
The UUID of the target design object.
SetProperty(const DesignObject &object, const t_type &value)
Constructs a SetProperty command targeting a specific object with the given value.
virtual TranslatedString name() const override
Returns the human-readable name of this command for display in the UI.
SetProperty()
Default constructor.
t_type m_previous_value
The stored previous value, used for undo.
The core String View class for the NDEVR API.
The core String 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...
Used to lock a particular variable for writing.
The primary namespace for the NDEVR SDK.
NDPM
NDPM - NDEVR Design Property Material: Values stored in the material database.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
NDPO
NDPO - NDEVR Design Property Object: Values stored in the property database.
@ guid
A 128-bit globally unique identifier for the object.
NDPG
Forward declaration for Geometry design object.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Holds a single property assignment: a target object UUID, the property to change, and the new value s...
UUID target
The UUID of the design object to modify.
DesignParameter parameter
The property identifier to set.
String value
The new value, serialized as a string.