32 : id(GenerateUniqueID())
48 : id(GenerateUniqueID())
57 std::ostringstream
oss;
73 std::ostringstream
oss;
84 static bool seeded =
false;
87 std::srand(
static_cast<unsigned int>(std::time(
nullptr)));
93 for (
int i = 0;
i < 16; ++
i)
94 b[
i] =
static_cast<unsigned int>(std::rand()) & 0xFF;
97 b[6] = (
b[6] & 0x0F) | 0x40;
98 b[8] = (
b[8] & 0x3F) | 0x80;
100 std::ostringstream
oss;
101 oss << std::hex << std::setfill(
'0');
103 for (
int i = 0;
i < 16; ++
i)
105 if (
i == 4 ||
i == 6 ||
i == 8 ||
i == 10)
107 oss << std::setw(2) <<
b[
i];
110 return "pin_" +
oss.str();
134 if (!data.is_object())
137 if (data.contains(
"id") && data[
"id"].is_string())
138 pin.
id = data[
"id"].get<std::string>();
140 if (data.contains(
"conditionIndex") && data[
"conditionIndex"].is_number_integer())
141 pin.conditionIndex = data[
"conditionIndex"].get<
int>();
143 if (data.contains(
"position") && data[
"position"].is_string())
145 std::string
pos = data[
"position"].get<std::string>();
149 if (data.contains(
"label") && data[
"label"].is_string())
150 pin.label = data[
"label"].get<std::string>();
152 if (data.contains(
"nodePinID") && data[
"nodePinID"].is_string())
153 pin.nodePinID = data[
"nodePinID"].get<std::string>();
155 if (data.contains(
"dataValue") && data[
"dataValue"].is_number())
156 pin.dataValue = data[
"dataValue"].get<
float>();
Defines DynamicDataPin — a runtime data-input pin attached to a node.
ComponentTypeID GetComponentTypeID_Static()
< Provides AssetID and INVALID_ASSET_ID
OperandPosition
Identifies which operand side a DynamicDataPin serves.
@ Right
Pin provides data for the right operand of the condition.
@ Left
Pin provides data for the left operand of the condition.
A data-input pin created dynamically for a Pin-mode operand.
static DynamicDataPin FromJson(const nlohmann::json &data)
Deserializes a DynamicDataPin from a JSON object.
int sequenceNumber
1-based sequence index across all pins on the node (for "Pin-in #N" label)
int conditionIndex
Index in node.conditions (0-based)
nlohmann::json ToJson() const
Serializes this pin to a JSON object.
OperandPosition position
Left or Right operand side.
std::string GetDisplayLabel() const
Returns the full display label shown on the node.
static std::string GenerateUniqueID()
Generates a globally unique identifier string (UUID v4-style).
float dataValue
Runtime float value received from connected node.
std::string GetShortLabel() const
Returns the short label for use as a pin connector slot.
std::string id
Global unique UUID (e.g. "pin_inst_abc123")
std::string nodePinID
ImGui/ImNodes pin ID (assigned at render time)
std::string label
Display label (set at construction)
DynamicDataPin()
Default constructor — zero-initialised.