![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <ImNodesCanvasEditor.h>
Inheritance diagram for Olympe::ImNodesCanvasEditor:
Collaboration diagram for Olympe::ImNodesCanvasEditor:Private Attributes | |
| std::string | m_name |
| ImVec2 | m_canvasScreenPos |
| ImVec2 | m_canvasSize |
| ImNodesEditorContext * | m_imnodesContext |
| bool | m_gridVisible |
| bool | m_minimapVisible = true |
| float | m_minimapSize = 0.15f |
| int | m_minimapPosition = ImNodesMiniMapLocation_BottomRight |
Definition at line 39 of file ImNodesCanvasEditor.h.
| Olympe::ImNodesCanvasEditor::ImNodesCanvasEditor | ( | const char * | name, |
| ImVec2 | canvasScreenPos, | ||
| ImVec2 | canvasSize, | ||
| ImNodesEditorContext * | imnodesContext = nullptr |
||
| ) |
Construct imnodes-based canvas editor.
| name | Identifier for this editor (e.g., "VisualScript") |
| canvasScreenPos | Top-left corner of canvas on screen (pixels) |
| canvasSize | Width/height of canvas area (pixels) |
| imnodesContext | Optional ImNodes context (nullptr = use current) |
Definition at line 11 of file ImNodesCanvasEditor.cpp.
|
virtualdefault |
|
overridevirtual |
Begin rendering cycle (calls ImNodes::BeginNodeEditor)
Implements Olympe::ICanvasEditor.
Definition at line 29 of file ImNodesCanvasEditor.cpp.
References m_imnodesContext.
|
overridevirtual |
Transform canvas space to screen space.
For imnodes (zoom=1.0): screen = canvas + pan + canvasScreenPos
Implements Olympe::ICanvasEditor.
Definition at line 62 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), GetPan(), and m_canvasScreenPos.
Here is the call graph for this function:Transform editor space to grid space (removes pan)
For imnodes: grid = editor - pan
Implements Olympe::ICanvasEditor.
Definition at line 69 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), and GetPan().
Here is the call graph for this function:
|
overridevirtual |
End rendering cycle (calls ImNodes::EndNodeEditor)
Implements Olympe::ICanvasEditor.
Definition at line 41 of file ImNodesCanvasEditor.cpp.
Get canvas name.
Implements Olympe::ICanvasEditor.
Definition at line 272 of file ImNodesCanvasEditor.h.
References m_name.
Get canvas screen position.
Implements Olympe::ICanvasEditor.
Definition at line 222 of file ImNodesCanvasEditor.h.
References m_canvasScreenPos.
Get canvas size.
Implements Olympe::ICanvasEditor.
Definition at line 228 of file ImNodesCanvasEditor.h.
References m_canvasSize.
|
overridevirtual |
Get canvas visible bounds in canvas space.
| outMin | Top-left corner of visible area |
| outMax | Bottom-right corner of visible area |
Implements Olympe::ICanvasEditor.
Definition at line 154 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), m_canvasScreenPos, m_canvasSize, and ScreenToCanvas().
Here is the call graph for this function:
|
overridevirtual |
Get current grid configuration.
Implements Olympe::ICanvasEditor.
Definition at line 112 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), GetPan(), Olympe::CanvasGridRenderer::GetStylePreset(), m_canvasScreenPos, m_canvasSize, and Olympe::CanvasGridRenderer::Style_VisualScript.
Here is the call graph for this function:Get minimap position.
Implements Olympe::ICanvasEditor.
Definition at line 318 of file ImNodesCanvasEditor.h.
References m_minimapPosition.
Get minimap size scale.
Implements Olympe::ICanvasEditor.
Definition at line 306 of file ImNodesCanvasEditor.h.
References m_minimapSize.
|
overridevirtual |
Get current pan offset.
Implements Olympe::ICanvasEditor.
Definition at line 87 of file ImNodesCanvasEditor.cpp.
Referenced by CanvasToScreen(), EditorToGrid(), GetGridConfig(), GridToEditor(), PanBy(), RenderGrid(), and ScreenToCanvas().
Here is the caller graph for this function:Get current zoom level.
Implements Olympe::ICanvasEditor.
Definition at line 139 of file ImNodesCanvasEditor.h.
Get zoom limits.
Implements Olympe::ICanvasEditor.
Definition at line 167 of file ImNodesCanvasEditor.h.
References GetComponentTypeID_Static().
Here is the call graph for this function:Transform grid space to editor space (adds pan)
For imnodes: editor = grid + pan
Implements Olympe::ICanvasEditor.
Definition at line 76 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), and GetPan().
Here is the call graph for this function:
|
overridevirtual |
Check if canvas is hovered.
Implements Olympe::ICanvasEditor.
Definition at line 177 of file ImNodesCanvasEditor.cpp.
Check if grid is visible.
Implements Olympe::ICanvasEditor.
Definition at line 212 of file ImNodesCanvasEditor.h.
References m_gridVisible.
Check if minimap is visible.
Implements Olympe::ICanvasEditor.
Definition at line 294 of file ImNodesCanvasEditor.h.
References m_minimapVisible.
Check if point is in canvas.
| screenPos | Position in screen space |
Implements Olympe::ICanvasEditor.
Definition at line 165 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), m_canvasScreenPos, and m_canvasSize.
Here is the call graph for this function:Pan by delta.
Implements Olympe::ICanvasEditor.
Definition at line 97 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), GetPan(), and SetPan().
Here is the call graph for this function:
|
overridevirtual |
Render grid.
| preset | Style preset (typically Style_VisualScript) |
Implements Olympe::ICanvasEditor.
Definition at line 128 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), GetPan(), Olympe::CanvasGridRenderer::GetStylePreset(), m_canvasScreenPos, m_canvasSize, m_gridVisible, and Olympe::CanvasGridRenderer::RenderGrid().
Here is the call graph for this function:
|
overridevirtual |
Render minimap overlay.
Calls ImNodes::MiniMap() with configured size and position
Implements Olympe::ICanvasEditor.
Definition at line 186 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), m_minimapPosition, m_minimapSize, and m_minimapVisible.
Here is the call graph for this function:
|
overridevirtual |
Reset pan to origin.
Implements Olympe::ICanvasEditor.
Definition at line 103 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), and SetPan().
Referenced by ResetView().
Here is the call graph for this function:
Here is the caller graph for this function:Reset view to defaults (pan only, zoom already 1.0f)
Implements Olympe::ICanvasEditor.
Definition at line 180 of file ImNodesCanvasEditor.h.
References ResetPan().
Here is the call graph for this function:Reset zoom to 1.0x (no-op, already 1.0f)
Implements Olympe::ICanvasEditor.
Definition at line 172 of file ImNodesCanvasEditor.h.
|
overridevirtual |
Transform screen space to canvas space.
For imnodes (zoom=1.0): canvas = screen - canvasScreenPos - pan
Implements Olympe::ICanvasEditor.
Definition at line 54 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), GetPan(), and m_canvasScreenPos.
Referenced by GetCanvasVisibleBounds().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
Set canvas screen position (call each frame to update)
| screenPos | Top-left corner position in screen space |
Required for minimap coordinate calculations each frame
Implements Olympe::ICanvasEditor.
Definition at line 235 of file ImNodesCanvasEditor.h.
References GetComponentTypeID_Static(), and m_canvasScreenPos.
Here is the call graph for this function:
|
inlineoverridevirtual |
Set canvas size (call each frame to update)
| size | Width and height in screen space |
Required for minimap rendering calculations each frame
Implements Olympe::ICanvasEditor.
Definition at line 242 of file ImNodesCanvasEditor.h.
References m_canvasSize.
Set grid visibility.
| enabled | True to show grid |
Implements Olympe::ICanvasEditor.
Definition at line 145 of file ImNodesCanvasEditor.cpp.
References m_gridVisible.
Set minimap position.
| position | ImNodesMiniMapLocation enum value |
Implements Olympe::ICanvasEditor.
Definition at line 207 of file ImNodesCanvasEditor.cpp.
References m_minimapPosition.
Set minimap size scale.
| scale | Size multiplier (0.1f to 0.3f typical) |
Implements Olympe::ICanvasEditor.
Definition at line 201 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static(), and m_minimapSize.
Here is the call graph for this function:Enable/disable minimap rendering.
| enabled | True to show minimap |
Implements Olympe::ICanvasEditor.
Definition at line 196 of file ImNodesCanvasEditor.cpp.
References m_minimapVisible.
Set pan offset.
| offset | New pan offset |
Calls EditorContextResetPanning()
Implements Olympe::ICanvasEditor.
Definition at line 92 of file ImNodesCanvasEditor.cpp.
References GetComponentTypeID_Static().
Referenced by PanBy(), and ResetPan().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
Set zoom level (no-op for imnodes)
This is a no-op because imnodes doesn't expose zoom control. If zoom is needed, use CustomCanvasEditor instead.
Implements Olympe::ICanvasEditor.
Definition at line 146 of file ImNodesCanvasEditor.h.
References GetComponentTypeID_Static().
Here is the call graph for this function:
|
inlineoverridevirtual |
Update minimap nodes (no-op for imnodes)
ImNodes manages minimap data internally, so this is unused
Implements Olympe::ICanvasEditor.
Definition at line 324 of file ImNodesCanvasEditor.h.
References GetComponentTypeID_Static().
Here is the call graph for this function:
|
inlineoverridevirtual |
Update minimap viewport (no-op for imnodes)
ImNodes manages minimap viewport internally, so this is unused
Implements Olympe::ICanvasEditor.
Definition at line 336 of file ImNodesCanvasEditor.h.
References GetComponentTypeID_Static().
Here is the call graph for this function:
|
inlineoverridevirtual |
Zoom by multiplier (no-op for imnodes)
Implements Olympe::ICanvasEditor.
Definition at line 156 of file ImNodesCanvasEditor.h.
References GetComponentTypeID_Static().
Here is the call graph for this function:
|
private |
Definition at line 347 of file ImNodesCanvasEditor.h.
Referenced by CanvasToScreen(), GetCanvasScreenPos(), GetCanvasVisibleBounds(), GetGridConfig(), IsPointInCanvas(), RenderGrid(), ScreenToCanvas(), and SetCanvasScreenPos().
|
private |
Definition at line 348 of file ImNodesCanvasEditor.h.
Referenced by GetCanvasSize(), GetCanvasVisibleBounds(), GetGridConfig(), IsPointInCanvas(), RenderGrid(), and SetCanvasSize().
|
private |
Definition at line 350 of file ImNodesCanvasEditor.h.
Referenced by IsGridVisible(), RenderGrid(), and SetGridVisible().
|
private |
Definition at line 349 of file ImNodesCanvasEditor.h.
Referenced by BeginRender().
|
private |
Definition at line 355 of file ImNodesCanvasEditor.h.
Referenced by GetMinimapPosition(), RenderMinimap(), and SetMinimapPosition().
Definition at line 354 of file ImNodesCanvasEditor.h.
Referenced by GetMinimapSize(), RenderMinimap(), and SetMinimapSize().
Definition at line 353 of file ImNodesCanvasEditor.h.
Referenced by IsMinimapVisible(), RenderMinimap(), and SetMinimapVisible().
|
private |
Definition at line 346 of file ImNodesCanvasEditor.h.
Referenced by GetCanvasName().