3#include <NDEVR/DesignCommand.h>
4#include <NDEVR/DesignObjectLookup.h>
5#include <NDEVR/TranslatedString.h>
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.
virtual void addModel(Model object)
Registers a model in the lookup.
virtual void deleteObject(UUID id)
Marks a design object as deleted by its UUID.
virtual void addScene(Scene scene, bool add_all_scene_models=true)
Adds a scene to the lookup and optionally registers all of its models.
bool hasModelID(const UUID &id, bool allow_deleted=false) const
Checks whether a model with the given UUID exists.
Model model(const UUID &id, bool allow_deleted=false) const
Retrieves a model by its UUID.
virtual Model restoreModel(UUID id)
Restores a previously deleted model back into the lookup.
WLock writeLock() const
Acquires an exclusive write lock on the design object store.
constexpr decltype(auto) get(t_property_type property) const
Retrieves a property value from the database, cast to the requested type.
void set(t_property_type property, const t_type &value)
Sets a property value in the database.
A core class that represents a node on model hierarchy.
void updateModifiedTime(Time time=Time::SystemTime())
Updates the modified timestamp for this model.
Model createChild()
Creates a new child model and appends it to this model's child list.
std::function< void(Model &model)> on_create
Callback invoked on the model immediately after creation, before it is added to the lookup.
virtual bool addTarget(UUID target_id) override
Adds a target UUID to this command's target list.
virtual void execute(DesignObjectLookup *lookup) override
Executes the new model command against the given lookup.
TranslatedString model_name
The display name assigned to the newly created model.
UUID parent_id
The UUID of the parent model. If invalid, a top-level Scene is created instead.
NewModelCommand(const TranslatedString &name, const std::function< void(Model &model)> &on_finished)
Creates a model with the specified name and calls on_finished at the end of the command.
virtual TranslatedString name() const override
Returns the display name of this command.
std::function< void(Model &model)> finished_callback
Callback invoked after the model has been fully created and added to the lookup.
virtual StringView icon() const override
Returns the icon identifier for this command.
Buffer< UUID > targets
The UUIDs of models created by this command, used for undo/redo tracking.
The root Model that is responsible for storing the underlying data for all Scene Models.
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...
Used to lock a particular variable for writing.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ name
The calculated/translated display name.
static constexpr bool IsInvalid(const Angle< t_type > &value)
Checks whether the given Angle holds an invalid value.
@ guid
A 128-bit globally unique identifier for the object.