9#include "../system/system_utils.h"
50 ann.hasBreakpoint = enabled;
51 SYSTEM_LOG <<
"[NodeAnnotations] Node " << nodeId
52 <<
" breakpoint: " << (enabled ?
"ON" :
"OFF") << std::endl;
59 SYSTEM_LOG <<
"[NodeAnnotations] Node " << nodeId <<
" comment set" << std::endl;
74 SYSTEM_LOG <<
"[NodeAnnotations] Node " << nodeId <<
" annotation cleared" << std::endl;
98 entry[
"hasBreakpoint"] =
ann.hasBreakpoint;
120 for (
size_t i = 0;
i <
j.size(); ++
i)
123 if (!
entry.is_object())
139 if (
entry.contains(
"color") &&
entry[
"color"].is_object())
ComponentTypeID GetComponentTypeID_Static()
Per-node annotations manager for node graphs (Phase 2.0)
void ClearAnnotation(int nodeId)
Remove all annotation data for a node.
json ToJson() const
Serialize all annotations to JSON.
void SetComment(int nodeId, const std::string &text)
Set comment for a node.
void SetBreakpoint(int nodeId, bool enabled)
Set breakpoint state for a node.
const std::map< int, NodeAnnotation > & GetAll() const
Get all annotations (for serialization / rendering)
std::map< int, NodeAnnotation > m_annotations
NodeAnnotation * GetAnnotation(int nodeId)
Get annotation for a node (non-const)
NodeAnnotation & GetOrCreate(int nodeId)
Get or create annotation for a node.
void FromJson(const json &j)
Deserialize annotations from JSON.
void SetColor(int nodeId, float r, float g, float b, float a)
Set custom color for a node.
bool HasAnnotation(int nodeId) const
Check if a node has any annotation.
std::string GetString(const json &j, const std::string &key, const std::string &defaultValue="")
Safely get a string value from JSON.
int GetInt(const json &j, const std::string &key, int defaultValue=0)
Safely get an integer value from JSON.
float GetFloat(const json &j, const std::string &key, float defaultValue=0.0f)
Safely get a float value from JSON.
bool GetBool(const json &j, const std::string &key, bool defaultValue=false)
Safely get a boolean value from JSON.
< Provides AssetID and INVALID_ASSET_ID
Holds annotation data for a single node.