34#include "../system/system_utils.h"
35#include "../system/system_consts.h"
36#include "../NodeGraphCore/GlobalTemplateBlackboard.h"
38#include "../third_party/imgui/imgui.h"
39#include "../third_party/imnodes/imnodes.h"
40#include "../json_helper.h"
41#include "../TaskSystem/TaskGraphLoader.h"
51#include <unordered_set>
96 if (!std::isfinite(x) || !std::isfinite(y))
98 SYSTEM_LOG <<
"[VSEditor] AddNode: warning - non-finite position provided (x="
99 << x <<
", y=" << y <<
"), resetting to (0, 0)\n";
110 TaskNodeDefinition def;
127 DataPinDefinition
pinA;
131 def.DataPins.push_back(
pinA);
133 DataPinDefinition
pinB;
137 def.DataPins.push_back(
pinB);
149 def.mathOpRef.leftOperand.constValue =
"0";
150 def.mathOpRef.mathOperator =
"+";
152 def.mathOpRef.rightOperand.constValue =
"0";
177 ParameterBinding
bx,
by;
179 bx.LiteralValue = TaskValue(x);
181 by.LiteralValue = TaskValue(y);
182 def.Parameters[
"__posX"] =
bx;
183 def.Parameters[
"__posY"] =
by;
196 std::unique_ptr<ICommand>(
new AddNodeCommand(def)),
231 [nodeID](
const VSEditorNode&
n) { return n.nodeID == nodeID; }),
236 std::unique_ptr<ICommand>(
new DeleteNodeCommand(nodeID)),
281 ExecPinConnection
conn;
289 std::unique_ptr<ICommand>(
new AddConnectionCommand(
conn)),
337 DataPinConnection
conn;
345 std::unique_ptr<ICommand>(
new AddDataConnectionCommand(
conn)),
UI-side registry of available atomic tasks with display metadata.
Wrapper around the graph blackboard entries for dropdown editors.
Registry of available condition types for Branch/While node dropdowns.
Runtime debug controller for ATS Visual Scripting (Phase 5).
ComponentTypeID GetComponentTypeID_Static()
Defines MathOpOperand — operand references for MathOp nodes.
Hardcoded lists of math and comparison operators for dropdown editors.
ImNodes-based graph editor for ATS Visual Script graphs (Phase 5).
int32_t RootNodeID
ID of the root node (must exist in Nodes)
int32_t EntryPointID
ID of the EntryPoint node (for VS graphs)
void PushCommand(std::unique_ptr< ICommand > cmd, TaskGraphTemplate &graph)
Executes the command on graph, then pushes it onto the undo stack.
UndoRedoStack m_undoStack
Undo/Redo command stack for reversible graph editing operations.
TaskGraphTemplate m_template
The template currently being edited.
void RemoveNode(int nodeID)
Removes a node from the canvas.
void ConnectData(int srcNodeID, const std::string &srcPinName, int dstNodeID, const std::string &dstPinName)
Creates a data connection between two nodes.
void ConnectExec(int srcNodeID, const std::string &srcPinName, int dstNodeID, const std::string &dstPinName)
Creates an exec connection between two nodes.
int AddNode(TaskNodeType type, float x, float y)
Creates a new node on the canvas.
void RebuildLinks()
Rebuilds ImNodes exec/data link arrays from the template.
int AllocNodeID()
Allocate a unique node ID.
bool m_verificationDone
True once RunVerification() has been called at least once for the current graph.
std::vector< VSEditorNode > m_editorNodes
Editor nodes (mirrors m_template.Nodes + position/selection state)
< Provides AssetID and INVALID_ASSET_ID
const char * GetNodeTypeLabel(TaskNodeType type)
Returns a human-readable label for a TaskNodeType.
@ Float
Single-precision float.
@ None
Uninitialized / empty value.
@ Literal
Value is embedded directly in the template.
TaskNodeType
Identifies the role of a node in the task graph.
@ GetBBValue
Data node – reads a Blackboard key.
@ MathOp
Data node – arithmetic operation (+, -, *, /)
@ SetBBValue
Data node – writes a Blackboard key.
@ EntryPoint
Unique entry node for VS graphs (replaces Root)
constexpr int32_t NODE_INDEX_NONE
Sentinel value for "no node" in node index / ID fields.
@ Output
Value produced by the node.
@ Input
Value consumed by the node.
@ Const
Literal constant value.