17#include "../json_helper.h"
239 std::map<NodeId, bool>&
visited
Blackboard system for shared graph variables (Phase 2.1)
ComponentTypeID GetComponentTypeID_Static()
Per-node annotations manager for node graphs (Phase 2.0)
Core data structures for generic node graph system.
Manages named blackboard variables for a graph.
Main document class for a node graph.
bool UpdateNode(NodeId nodeId, const NodeData &newData)
Update an existing node's data.
bool DeleteNode(NodeId id)
Delete a node from the graph.
float AutoLayoutNode(NodeId nodeId, const AutoLayoutConfig &config, float startX, float startY, int depth, std::map< NodeId, bool > &visited)
Helper to recursively layout a node and its children.
bool AutoLayout(const AutoLayoutConfig &config)
Automatically layout nodes in a hierarchical arrangement.
bool UpdateNodeParameters(NodeId id, const std::map< std::string, std::string > ¶ms)
Update node parameters.
LinkId ConnectPins(PinId fromPin, PinId toPin)
Connect two pins with a link.
const std::vector< LinkData > & GetLinks() const
std::vector< LinkData > & GetLinksRef()
bool HasCyclesHelper(NodeId nodeId, std::vector< NodeId > &visited, std::vector< NodeId > &recursionStack) const
std::vector< NodeData > & GetNodesRef()
LinkData * GetLink(LinkId id)
Get a link by ID.
json ToJson() const
Convert graph to JSON format (v2 schema)
BlackboardSystem m_blackboard
bool DisconnectLink(LinkId id)
Disconnect a link.
std::vector< LinkData > m_links
static GraphDocument FromJson(const json &j)
Create graph from JSON.
const NodeAnnotationsManager & GetNodeAnnotations() const
Get node annotations manager (const)
NodeAnnotationsManager m_nodeAnnotations
NodeId CreateNode(const std::string &nodeType, Vector2 pos)
Create a new node in the graph.
NodeAnnotationsManager & GetNodeAnnotations()
Get node annotations manager (non-const)
NodeData * GetNode(NodeId id)
Get a node by ID.
bool UpdateNodePosition(NodeId id, Vector2 newPos)
Update node position.
const std::vector< NodeData > & GetNodes() const
bool HasCycles() const
Check if the graph has cycles.
bool ValidateGraph(std::string &errorMessage) const
Validate the graph structure.
void SetDirty(bool dirty)
std::vector< NodeData > m_nodes
const BlackboardSystem & GetBlackboard() const
Get blackboard system (const)
BlackboardSystem & GetBlackboard()
Get blackboard system (non-const)
Manages per-node annotations (breakpoints, comments, colors)
< Provides AssetID and INVALID_ASSET_ID