34#include <NDEVR/UUID.h>
35#include <NDEVR/Resource.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/String.h>
38#include <NDEVR/Time.h>
39#include <NDEVR/InfoPipe.h>
40#include <NDEVR/TranslatedString.h>
177 template<
class t_type>
180 m_group.add(val.template as<DesignCommand>());
186 template<
class t_type>
The equivelent of std::vector but with a bit more control.
DesignCommandGroup(const TranslatedString &name, StringView icon=StringView())
Constructs a command group with a display name and optional icon.
DesignCommandGroup(const Buffer< DynamicPointer< DesignCommand > > &buffer)
Constructs a command group from a buffer of commands.
void add(t_type &&val)
Adds a command to this group via move semantics.
virtual TranslatedString name() const override
Gets the display name of this command group.
virtual void execute(DesignObjectLookup *lookup) override
Executes all commands in this group sequentially against the given lookup.
void add(const DynamicPointer< t_type > &val)
Adds a command to this group via a DynamicPointer.
DesignCommandGroup(std::initializer_list< DynamicPointer< DesignCommand > > l)
Constructs a command group from an initializer list of commands.
virtual ~DesignCommandGroup()
Virtual destructor.
virtual bool addTarget(UUID id) override
Adds a target UUID to all commands in this group.
DesignCommandGroup()
Default constructor.
virtual bool isAsyncExecution() const override
Checks whether any command in this group requires async execution.
virtual StringView icon() const override
Gets the icon identifier for this command group.
bool update_project_modified
Whether executing this command should mark the project as modified.
DesignCommand(const DesignCommand &command)=default
Default copy constructor.
virtual void combineWith(const DynamicPointer< DesignCommand > &command)
Combines this command with another compatible command, merging their operations.
DesignCommand()
Default constructor.
virtual bool canCombineWith(const DynamicPointer< DesignCommand > &)
Checks whether this command can be combined with another command into a single operation.
void setUndoRedoID(UUID undo_redo_group)
Sets the undo-redo group identifier for this command.
bool has_executed
Whether this command has already been executed.
Time time
Timestamp of when the command was created or executed.
UUID id
Unique identifier for this command instance.
virtual void execute(DesignObjectLookup *)
Executes this command against the given DesignObjectLookup.
LogPtr log
Log pipe for reporting command progress and errors.
virtual bool canGroupWith(const DynamicPointer< DesignCommand > &)
Checks whether this command can be grouped with another command for batch execution.
bool can_undo
Whether this command supports being undone.
virtual TranslatedString name() const =0
Gets the human-readable name of this command for display in the UI.
bool is_undo
Whether this command represents an undo operation.
virtual bool addTarget(UUID)
Adds a target object by UUID to this command.
UUID undoRedoID() const
Gets the undo-redo group identifier for this command.
virtual ~DesignCommand()
Virtual destructor.
virtual bool isAsyncExecution() const
Whether this command should be executed asynchronously.
virtual StringView icon() const =0
Gets the icon identifier for this command.
UUID m_undo_redo_group
The undo-redo group this command belongs to, for batch undo/redo.
A core class where all Design Objects including models, materials, and geometries are stored.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
A readers-writer lock allowing concurrent reads or exclusive writes.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Represents a timestamp with utilities for manipulation and conversion.
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.