22#include "../TaskSystem/TaskGraphTemplate.h"
247 const std::string&
key,
300 const std::string& pinName,
359 using ParameterMap = std::unordered_map<std::string, ParameterBinding>;
ComponentTypeID GetComponentTypeID_Static()
Records an "add exec connection" operation for undo/redo.
std::string GetDescription() const override
Returns a short human-readable description (e.g.
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
Records an "add data connection" operation for undo/redo.
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
std::string GetDescription() const override
Returns a short human-readable description (e.g.
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
Records "add dynamic exec-out pin" on a VSSequence or VSSwitch node for undo/redo.
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
std::string GetDescription() const override
Returns a short human-readable description (e.g.
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
Command to add a node to the tree.
TaskNodeDefinition m_node
std::string GetDescription() const override
Get a human-readable description of the command.
void Undo() override
Undo the command.
void Execute() override
Execute the command.
Records a "delete link" operation for undo/redo.
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
DataPinConnection m_savedDataConn
ExecPinConnection m_savedExecConn
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
std::string GetDescription() const override
Returns a short human-readable description (e.g.
Command to delete a node from the tree.
TaskNodeDefinition m_savedNode
void Undo() override
Undo the command.
std::vector< DataPinConnection > m_savedDataConns
void Execute() override
Execute the command.
std::string GetDescription() const override
Get a human-readable description of the command.
std::vector< ExecPinConnection > m_savedExecConns
Records a batch edit of all parameter bindings on a node.
std::string GetDescription() const override
Returns a short human-readable description (e.g.
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
std::unordered_map< std::string, ParameterBinding > ParameterMap
Records a property edit on a single node for undo/redo.
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
std::string m_propertyKey
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
static void ApplyValue(TaskNodeDefinition &node, const std::string &key, const PropertyValue &value)
Applies value to the named field of node.
std::string GetDescription() const override
Returns a short human-readable description (e.g.
Command to edit a node parameter.
std::string GetDescription() const override
Get a human-readable description of the command.
void Undo() override
Undo the command.
void Execute() override
Execute the command.
ParameterBinding m_oldBinding
ParameterBinding m_newBinding
Abstract base for all reversible editor commands.
virtual std::string GetDescription() const =0
Returns a short human-readable description (e.g.
virtual void Undo(TaskGraphTemplate &graph)=0
Reverses the command on the graph.
virtual void Execute(TaskGraphTemplate &graph)=0
Applies the command to the graph.
virtual ~ICommand()=default
std::string GetDescription() const override
Get a human-readable description of the command.
void Undo() override
Undo the command.
static void SetNodePos(TaskGraphTemplate &graph, int32_t nodeID, float x, float y)
void Execute() override
Execute the command.
Records "remove dynamic exec-out pin" on a VSSequence or VSSwitch node for undo/redo.
std::string m_linkedTargetPinName
std::string GetDescription() const override
Returns a short human-readable description (e.g.
int32_t m_linkedTargetNodeID
-1 if no outgoing link was present
void Execute(TaskGraphTemplate &graph) override
Applies the command to the graph.
void Undo(TaskGraphTemplate &graph) override
Reverses the command on the graph.
Immutable, shareable task graph asset.
Bounded stack of reversible editor commands.
bool CanUndo() const
Returns true if there is at least one command to undo.
std::size_t RedoSize() const
Returns the number of commands currently on the redo stack.
void Clear()
Clears both undo and redo stacks (e.g.
std::size_t UndoSize() const
Returns the number of commands currently on the undo stack.
bool CanRedo() const
Returns true if there is at least one command to redo.
std::string PeekUndoDescription() const
Returns the description of the top undo command, or "" if empty.
void Redo(TaskGraphTemplate &graph)
Re-applies the last undone command, moving it back to the undo stack.
std::string PeekRedoDescription() const
Returns the description of the top redo command, or "" if empty.
void Undo(TaskGraphTemplate &graph)
Undoes the last command, moving it to the redo stack.
std::vector< std::unique_ptr< ICommand > > m_undoStack
std::vector< std::unique_ptr< ICommand > > m_redoStack
void PushCommand(std::unique_ptr< ICommand > cmd, TaskGraphTemplate &graph)
Executes the command on graph, then pushes it onto the undo stack.
static const std::size_t MAX_STACK_SIZE
Maximum number of undo entries kept in memory.
< Provides AssetID and INVALID_ASSET_ID
Explicit connection between an output data pin of a source node and an input data pin of a target nod...
Explicit connection between a named exec-out pin of a source node and the exec-in pin of a target nod...
Describes how a single parameter value is supplied to a task node.
Discriminated union of property value types (String / Float).
static PropertyValue FromFloat(float f)
enum Olympe::PropertyValue::Kind kind
static PropertyValue FromString(const std::string &s)
static PropertyValue FromInt(int i)
Full description of a single node in the task graph.