49 std::cout <<
"Command executed: " <<
m_UndoStack.back()->GetDescription() << std::endl;
69 std::cout <<
"Command undone: " <<
m_RedoStack.back()->GetDescription() << std::endl;
89 std::cout <<
"Command redone: " <<
m_UndoStack.back()->GetDescription() << std::endl;
150 const std::string& nodeType,
151 float posX,
float posY,
154 , m_NodeType(nodeType)
155 , m_NodeName(nodeName)
158 , m_CreatedNodeId(-1)
171 std::cerr <<
"CreateNodeCommand: Graph not found: " <<
m_GraphId << std::endl;
188 std::cerr <<
"CreateNodeCommand::Undo: Graph not found: " <<
m_GraphId << std::endl;
220 std::cerr <<
"DeleteNodeCommand: Graph not found: " <<
m_GraphId << std::endl;
247 std::cerr <<
"DeleteNodeCommand::Undo: Graph not found: " <<
m_GraphId << std::endl;
257 int nodeId =
graph->CreateNode(type,
268 return "Delete Node " + std::to_string(
m_NodeId);
324 return "Move Node " + std::to_string(
m_NodeId);
333 , m_ParentId(parentId)
367 , m_ParentId(parentId)
441 , m_CreatedNodeId(-1)
450 std::cerr <<
"DuplicateNodeCommand: Graph not found: " <<
m_GraphId << std::endl;
458 std::cerr <<
"DuplicateNodeCommand: Source node not found: " <<
m_SourceNodeId << std::endl;
583 return "Edit Node " + std::to_string(
m_NodeId);
ComponentTypeID GetComponentTypeID_Static()
std::vector< std::string > GetUndoStackDescriptions() const
std::string GetNextRedoDescription() const
std::string GetLastCommandDescription() const
std::vector< std::unique_ptr< EditorCommand > > m_RedoStack
std::vector< std::unique_ptr< EditorCommand > > m_UndoStack
const EditorCommand * GetLastCommand() const
std::vector< std::string > GetRedoStackDescriptions() const
void ExecuteCommand(std::unique_ptr< EditorCommand > cmd)
std::string GetDescription() const override
CreateNodeCommand(const std::string &graphId, const std::string &nodeType, float posX, float posY, const std::string &nodeName="", int *outCreatedId=nullptr)
std::string GetDescription() const override
DeleteNodeCommand(const std::string &graphId, int nodeId)
DuplicateNodeCommand(const std::string &graphId, int sourceNodeId)
std::string GetDescription() const override
std::string GetDescription() const override
EditNodeCommand(const std::string &graphId, int nodeId, const std::string &oldName, const std::string &newName, const std::string &oldSubtype, const std::string &newSubtype)
EditorCommand - Base class for all undoable editor commands Implements command pattern for undo/redo ...
virtual std::string GetDescription() const =0
std::string GetDescription() const override
LinkNodesCommand(const std::string &graphId, int parentId, int childId)
MoveNodeCommand(const std::string &graphId, int nodeId, float oldX, float oldY, float newX, float newY)
std::string GetDescription() const override
SetParameterCommand(const std::string &graphId, int nodeId, const std::string ¶mName, const std::string &oldValue, const std::string &newValue)
std::string GetDescription() const override
UnlinkNodesCommand(const std::string &graphId, int parentId, int childId)
std::string GetDescription() const override
NodeGraph * GetGraph(int graphId)
static NodeGraphManager & Get()
bool UnlinkNodes(int parentId, int childId)
bool DeleteNode(int nodeId)
bool LinkNodes(int parentId, int childId)
bool SetNodeParameter(int nodeId, const std::string ¶mName, const std::string &value)
< Provides AssetID and INVALID_ASSET_ID
const char * NodeTypeToString(NodeType type)
@ Blueprint
.ats files (SubGraph/VisualScript)
NodeType StringToNodeType(const std::string &str)