![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
ImGui sub-panel for editing MathOp operands and operator. More...
#include <MathOpPropertyPanel.h>
Collaboration diagram for Olympe::MathOpPropertyPanel:Public Member Functions | |
| MathOpPropertyPanel (ConditionPresetRegistry ®istry, DynamicDataPinManager &dynamicPinMgr) | |
| Constructs the panel bound to a preset registry. | |
| ~MathOpPropertyPanel ()=default | |
| MathOpPropertyPanel (const MathOpPropertyPanel &)=delete | |
| MathOpPropertyPanel & | operator= (const MathOpPropertyPanel &)=delete |
| void | SetMathOpRef (const MathOpRef &ref) |
| Sets the MathOpRef to edit. | |
| const MathOpRef & | GetMathOpRef () const |
| Returns the current (possibly modified) MathOpRef. | |
| void | SetDynamicPins (const std::vector< DynamicDataPin > &pins) |
| Provides the read-only list of dynamic pins for display. | |
| void | SetNodeName (const std::string &name) |
| Sets the node name displayed in the title section. | |
| bool | IsDirty () const |
| Returns true if the operand or operator has been modified since the last call to ClearDirty(). | |
| void | ClearDirty () |
| Resets the dirty flag. | |
| void | SetOnOperandChange (std::function< void()> cb) |
| Registers a callback to be invoked when Pin-mode operands change. | |
| void | Render () |
| Renders the panel into the current ImGui context. | |
Private Member Functions | |
| void | RenderTitleSection () |
| Renders the title section (node name in blue background). | |
| void | RenderInlineOperandEditor () |
| Renders the operand editor (collapsible section with 3 rows). | |
| void | RenderOperandRow (int rowIndex, MathOpOperand &operand) |
| Renders one operand row with mode selector and value input. | |
| void | RenderOperatorSelector () |
| Renders the operator dropdown ("+", "-", "*", "/", "%", "^"). | |
| void | RenderDynamicPinsSection () |
| Renders the dynamic pins section (read-only display). | |
| void | RenderVariableModeInput (MathOpOperand &operand) |
| Helper to render Variable mode input field. | |
| void | RenderConstModeInput (MathOpOperand &operand) |
| Helper to render Const mode input field. | |
| void | RenderPinModeSelector (MathOpOperand &operand) |
| Helper to render Pin mode selector (list of available pins). | |
Private Attributes | |
| ConditionPresetRegistry & | m_registry |
| Global preset registry. | |
| DynamicDataPinManager & | m_dynamicPinMgr |
| Pin generation manager. | |
| std::string | m_nodeName |
| Node name for display. | |
| MathOpRef | m_mathOpRef |
| Current operand configuration. | |
| std::vector< DynamicDataPin > | m_dynamicPins |
| Read-only dynamic pins display. | |
| bool | m_operandEditorOpen = true |
| Collapsible section state. | |
| bool | m_dirty = false |
| Changed since last ClearDirty() | |
| std::function< void()> | m_onOperandChange |
| Callback when operands change. | |
ImGui sub-panel for editing MathOp operands and operator.
The panel does NOT own the data — it holds references. The caller is responsible for persisting changes from GetMathOpRef() back to the node definition.
Dependency injection: MathOpPropertyPanel panel(registry, dynamicPinManager); panel.SetMathOpRef(node.mathOpRef); panel.SetDynamicPins(node.dynamicPins); panel.SetNodeName(node.NodeName); panel.Render(); if (panel.IsDirty()) { node.mathOpRef = panel.GetMathOpRef(); panel.ClearDirty(); }
Definition at line 53 of file MathOpPropertyPanel.h.
|
explicit |
Constructs the panel bound to a preset registry.
| registry | Global ConditionPresetRegistry (must outlive this panel). |
| dynamicPinMgr | DynamicDataPinManager for Pin-mode generation. |
Definition at line 17 of file MathOpPropertyPanel.cpp.
|
default |
|
delete |
|
inline |
Returns the current (possibly modified) MathOpRef.
Definition at line 33 of file MathOpPropertyPanel.cpp.
References m_mathOpRef.
|
inline |
Returns true if the operand or operator has been modified since the last call to ClearDirty().
Definition at line 102 of file MathOpPropertyPanel.h.
References m_dirty.
|
delete |
| void Olympe::MathOpPropertyPanel::Render | ( | ) |
Renders the panel into the current ImGui context.
Must be called between ImGui::Begin() / ImGui::End() or within a child window. Handles layout, operand editors, and state synchronization.
Definition at line 52 of file MathOpPropertyPanel.cpp.
References m_dynamicPins, RenderDynamicPinsSection(), RenderInlineOperandEditor(), and RenderTitleSection().
Here is the call graph for this function:
|
private |
Helper to render Const mode input field.
Definition at line 156 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), and m_dirty.
Referenced by RenderOperandRow().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Renders the dynamic pins section (read-only display).
Definition at line 217 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), and m_dynamicPins.
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Renders the operand editor (collapsible section with 3 rows).
Definition at line 72 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), Olympe::MathOpRef::leftOperand, m_mathOpRef, RenderOperandRow(), RenderOperatorSelector(), and Olympe::MathOpRef::rightOperand.
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Renders one operand row with mode selector and value input.
| rowIndex | 0 = left operand, 1 = right operand |
| operand | MathOpOperand to edit |
Definition at line 106 of file MathOpPropertyPanel.cpp.
References Olympe::MathOpOperand::Const, GetComponentTypeID_Static(), m_dirty, m_onOperandChange, Olympe::MathOpOperand::Pin, RenderConstModeInput(), RenderPinModeSelector(), RenderVariableModeInput(), and Olympe::MathOpOperand::Variable.
Referenced by RenderInlineOperandEditor().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Renders the operator dropdown ("+", "-", "*", "/", "%", "^").
Definition at line 196 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), m_dirty, m_mathOpRef, and Olympe::MathOpRef::mathOperator.
Referenced by RenderInlineOperandEditor().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Helper to render Pin mode selector (list of available pins).
Definition at line 170 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), m_dirty, m_dynamicPins, and m_onOperandChange.
Referenced by RenderOperandRow().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Renders the title section (node name in blue background).
Definition at line 65 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), and m_nodeName.
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Helper to render Variable mode input field.
Definition at line 139 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), m_dirty, and m_onOperandChange.
Referenced by RenderOperandRow().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::MathOpPropertyPanel::SetDynamicPins | ( | const std::vector< DynamicDataPin > & | pins | ) |
Provides the read-only list of dynamic pins for display.
| pins | Current dynamic pins associated with this MathOp node. |
Definition at line 38 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), and m_dynamicPins.
Here is the call graph for this function:Sets the MathOpRef to edit.
| ref | MathOpRef from node.mathOpRef. |
Definition at line 28 of file MathOpPropertyPanel.cpp.
References GetComponentTypeID_Static(), and m_mathOpRef.
Here is the call graph for this function:Sets the node name displayed in the title section.
| name | Human-readable node name (e.g., "MathOp_1"). |
Definition at line 43 of file MathOpPropertyPanel.cpp.
References m_nodeName.
Registers a callback to be invoked when Pin-mode operands change.
The callback should regenerate dynamic pins via DynamicDataPinManager and trigger a canvas refresh.
| cb | Callback function. |
Definition at line 117 of file MathOpPropertyPanel.h.
References GetComponentTypeID_Static(), and m_onOperandChange.
Here is the call graph for this function:Changed since last ClearDirty()
Definition at line 182 of file MathOpPropertyPanel.h.
Referenced by ClearDirty(), IsDirty(), RenderConstModeInput(), RenderOperandRow(), RenderOperatorSelector(), RenderPinModeSelector(), and RenderVariableModeInput().
|
private |
Pin generation manager.
Definition at line 175 of file MathOpPropertyPanel.h.
|
private |
Read-only dynamic pins display.
Definition at line 179 of file MathOpPropertyPanel.h.
Referenced by Render(), RenderDynamicPinsSection(), RenderPinModeSelector(), and SetDynamicPins().
|
private |
Current operand configuration.
Definition at line 178 of file MathOpPropertyPanel.h.
Referenced by GetMathOpRef(), RenderInlineOperandEditor(), RenderOperatorSelector(), and SetMathOpRef().
|
private |
Node name for display.
Definition at line 177 of file MathOpPropertyPanel.h.
Referenced by RenderTitleSection(), and SetNodeName().
|
private |
Callback when operands change.
Definition at line 184 of file MathOpPropertyPanel.h.
Referenced by RenderOperandRow(), RenderPinModeSelector(), RenderVariableModeInput(), and SetOnOperandChange().
Collapsible section state.
Definition at line 181 of file MathOpPropertyPanel.h.
|
private |
Global preset registry.
Definition at line 174 of file MathOpPropertyPanel.h.