13#ifndef OLYMPE_HEADLESS
14# include "../../third_party/imgui/imgui.h"
15# include "../../third_party/imnodes/imnodes.h"
40#ifndef OLYMPE_HEADLESS
46 ImGui::PushID(data.
nodeID);
49 ImNodes::BeginNodeTitleBar();
50 ImGui::TextUnformatted(data.
nodeName.c_str());
54 ImGui::TextColored(
ImVec4(1.f, 0.3f, 0.3f, 1.f),
"[\xe2\x97\x8f]");
56 ImNodes::EndNodeTitleBar();
60 ImGui::Columns(2,
"exec_pins",
false);
61 ImGui::SetColumnWidth(0, 80.0f);
70 ImNodes::EndInputAttribute();
71 ImNodes::PopColorStyle();
101 ImNodes::EndOutputAttribute();
102 ImNodes::PopColorStyle();
117 ImGui::Text(
"False");
118 ImNodes::EndOutputAttribute();
119 ImNodes::PopColorStyle();
154#ifndef OLYMPE_HEADLESS
163 ImGui::TextUnformatted(data.
nodeName.c_str());
164 ImGui::PopStyleColor(4);
169 ImGui::TextColored(
ImVec4(1.f, 0.3f, 0.3f, 1.f),
"[\xe2\x97\x8f]");
180#ifndef OLYMPE_HEADLESS
191 ImGui::Text(
"False");
201#ifndef OLYMPE_HEADLESS
204 ImGui::TextDisabled(
"(no conditions)");
235 ImGui::SameLine(0.0f, 0.0f);
244 ImGui::TextColored(
condColor,
"%s",
preset->left.GetDisplayString().c_str());
246 ImGui::SameLine(0.0f, 4.0f);
258 default:
opStr =
"?";
break;
261 ImGui::SameLine(0.0f, 4.0f);
270 ImGui::TextColored(
condColor,
"%s",
preset->right.GetDisplayString().c_str());
274 if (ImGui::IsItemHovered())
276 ImGui::BeginTooltip();
277 ImGui::Text(
"Preset: %s",
preset->name.c_str());
278 ImGui::Text(
"ID: %s",
preset->id.c_str());
279 ImGui::Text(
"Expr: %s",
preset->GetPreview().c_str());
284 if (ImGui::IsItemClicked())
293 ImGui::TextColored(
ImVec4(1.f, 0.3f, 0.3f, 1.f),
294 "%s (missing: %s)",
opLabel,
ref.presetID.c_str());
309#ifndef OLYMPE_HEADLESS
311 const ImVec4 pinColor(180.0f / 255.0f, 100.0f / 255.0f, 200.0f / 255.0f, 1.0f);
333 ImGui::TextColored(
pinColor,
"\xe2\x97\x8f");
334 ImGui::SameLine(0.0f, 4.0f);
341 if (ImGui::IsItemHovered())
344 ImGui::BeginTooltip();
345 ImGui::Text(
"Pin ID: %s",
pin.id.c_str());
346 ImGui::Text(
"Condition index: %d",
pin.conditionIndex);
347 ImGui::Text(
"Operand side: %s",
posStr);
348 ImGui::Text(
"Detail: %s",
pin.GetDisplayLabel().c_str());
352 ImNodes::EndInputAttribute();
353 ImNodes::PopColorStyle();
364#ifndef OLYMPE_HEADLESS
378 std::vector<NodeConditionRef>& conditionRefs)
398#ifndef OLYMPE_HEADLESS
399 ImGui::TextDisabled(
"── %s ──", label);
405#ifndef OLYMPE_HEADLESS
ComponentTypeID GetComponentTypeID_Static()
ImGui renderer for NodeBranch nodes with 4 distinct sections (Phase 24-REFONTE).
Manages the global pool of ConditionPreset objects.
ConditionPreset * GetPreset(const std::string &id)
Returns a mutable pointer to the preset, or nullptr if not found.
Generates, tracks, and invalidates DynamicDataPin objects for a node.
void RegeneratePinsFromConditions(std::vector< NodeConditionRef > &conditionRefs, const std::vector< ConditionRef > &operandRefs=std::vector< ConditionRef >())
Regenerates pins from the current condition list.
void RenderSectionSeparator()
DynamicDataPinManager & m_pinManager
Shared dynamic pin manager.
void NotifyPresetChanged(const std::string &changedPresetID)
Notifies the renderer that a preset has been updated.
void SetupDynamicPinConnectors(const NodeBranchData &data)
Sets up ImNodes connectors for each dynamic pin.
void RenderConditionsSection(const NodeBranchData &data)
Renders Section 3: read-only conditions preview (green text).
void RenderTitleSection(const NodeBranchData &data)
Renders Section 1: title bar with blue background.
bool m_refreshPending
Dirty flag.
void RenderExecPinsSection(const NodeBranchData &data)
Renders Section 2: static exec pins (In / Then / Else).
NodeBranchRenderer(ConditionPresetRegistry ®istry, DynamicDataPinManager &pinManager)
Constructs the renderer with its dependencies.
int m_lastClickedCondition
Interaction state.
void RenderSectionHeader(const char *label)
std::function< void(int)> OnConditionClicked
Fired when the user clicks on a condition row.
void RenderDynamicPinsSection(const NodeBranchData &data, const std::unordered_set< int > &connectedAttrIDs={})
Renders Section 4: dynamic data pins (yellow, conditional).
ConditionPresetRegistry & m_registry
Shared global registry.
void TriggerPinRegeneration(std::vector< NodeConditionRef > &conditionRefs)
Regenerates dynamic data pins from an updated condition list.
void RenderNode(const NodeBranchData &data, const std::unordered_set< int > &connectedAttrIDs={})
Renders the full NodeBranch node in the current ImNodes context.
< Provides AssetID and INVALID_ASSET_ID
@ Left
Pin provides data for the left operand of the condition.
A globally-stored, reusable condition expression.
Lightweight snapshot of a NodeBranch required for rendering.
std::string nodeName
Display name (e.g. "Branch #3")
std::vector< DynamicDataPin > dynamicPins
Generated dynamic data pins.
std::vector< NodeConditionRef > conditionRefs
Ordered condition references.
bool breakpoint
Whether a breakpoint is set.
int nodeID
Numeric node identifier (for ImNodes attribute UIDs)
One entry in a NodeBranch's conditions list.