![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Unified minimap renderer for standardized appearance. More...
#include <CanvasMinimapRenderer.h>
Collaboration diagram for Olympe::CanvasMinimapRenderer:Public Member Functions | |
| CanvasMinimapRenderer () | |
| virtual | ~CanvasMinimapRenderer ()=default |
| void | SetVisible (bool visible) |
| Set minimap visibility. | |
| bool | IsVisible () const |
| Check if minimap should be rendered. | |
| void | SetSize (float ratio) |
| Set minimap size as ratio of canvas (0.05 - 0.5) | |
| float | GetSize () const |
| Get current size ratio. | |
| void | SetPosition (MinimapPosition pos) |
| Set minimap corner position. | |
| MinimapPosition | GetPosition () const |
| Get current position. | |
| void | UpdateNodes (const std::vector< std::tuple< int, float, float, float, float > > &nodes, float graphMinX, float graphMaxX, float graphMinY, float graphMaxY) |
| Update node positions from raw graph data. | |
| void | UpdateViewport (float viewMinX, float viewMaxX, float viewMinY, float viewMaxY, float graphMinX, float graphMaxX, float graphMinY, float graphMaxY) |
| Update visible viewport. | |
| void | RenderImNodes () const |
| Render minimap using ImNodes native API. | |
| void | RenderCustom (const ImVec2 &canvasScreenPos, const ImVec2 &canvasSize) const |
| Render minimap using custom ImGui drawing. | |
| const std::vector< MinimapNodeData > & | GetNormalisedNodes () const |
| Get normalised node positions for custom rendering. | |
| const MinimapViewportData & | GetNormalisedViewport () const |
| Get normalised viewport rectangle for custom rendering. | |
| void | SetBackgroundColor (ImU32 color) |
| Set minimap background color (RGBA) | |
| void | SetNodeColor (ImU32 color) |
| Set minimap node color (RGBA) | |
| void | SetViewportColor (ImU32 color) |
| Set minimap viewport rectangle color (RGBA) | |
Static Public Attributes | |
| static constexpr float | DEFAULT_WIDTH = 200.0f |
| static constexpr float | DEFAULT_HEIGHT = 150.0f |
Static Private Member Functions | |
| static float | NormaliseCoord (float value, float minVal, float maxVal) |
Private Attributes | |
| bool | m_visible |
| float | m_sizeRatio |
| 0.05 - 0.5 ratio of canvas | |
| MinimapPosition | m_position |
| std::vector< MinimapNodeData > | m_normalisedNodes |
| MinimapViewportData | m_normalisedViewport |
| ImU32 | m_backgroundColor |
| ImU32 | m_nodeColor |
| ImU32 | m_viewportColor |
Unified minimap renderer for standardized appearance.
Typical usage:
Definition at line 90 of file CanvasMinimapRenderer.h.
| Olympe::CanvasMinimapRenderer::CanvasMinimapRenderer | ( | ) |
Definition at line 16 of file CanvasMinimapRenderer.cpp.
|
virtualdefault |
| const std::vector< MinimapNodeData > & Olympe::CanvasMinimapRenderer::GetNormalisedNodes | ( | ) | const |
Get normalised node positions for custom rendering.
Definition at line 220 of file CanvasMinimapRenderer.cpp.
References m_normalisedNodes.
| const MinimapViewportData & Olympe::CanvasMinimapRenderer::GetNormalisedViewport | ( | ) | const |
Get normalised viewport rectangle for custom rendering.
Definition at line 225 of file CanvasMinimapRenderer.cpp.
References m_normalisedViewport.
| MinimapPosition Olympe::CanvasMinimapRenderer::GetPosition | ( | ) | const |
Get current position.
Definition at line 56 of file CanvasMinimapRenderer.cpp.
References m_position.
| float Olympe::CanvasMinimapRenderer::GetSize | ( | ) | const |
Get current size ratio.
Definition at line 46 of file CanvasMinimapRenderer.cpp.
References m_sizeRatio.
| bool Olympe::CanvasMinimapRenderer::IsVisible | ( | ) | const |
Check if minimap should be rendered.
Definition at line 35 of file CanvasMinimapRenderer.cpp.
References m_visible.
|
staticprivate |
Definition at line 65 of file CanvasMinimapRenderer.cpp.
References GetComponentTypeID_Static().
Referenced by UpdateNodes(), and UpdateViewport().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::CanvasMinimapRenderer::RenderCustom | ( | const ImVec2 & | canvasScreenPos, |
| const ImVec2 & | canvasSize | ||
| ) | const |
Render minimap using custom ImGui drawing.
| canvasScreenPos | Top-left of canvas on screen |
| canvasSize | Canvas dimensions in screen pixels |
Definition at line 140 of file CanvasMinimapRenderer.cpp.
References Olympe::BottomLeft, Olympe::BottomRight, GetComponentTypeID_Static(), Olympe::MinimapViewportData::h, m_backgroundColor, m_nodeColor, m_normalisedNodes, m_normalisedViewport, m_position, m_sizeRatio, m_viewportColor, m_visible, Olympe::TopLeft, Olympe::TopRight, Olympe::MinimapViewportData::w, Olympe::MinimapViewportData::x, and Olympe::MinimapViewportData::y.
Here is the call graph for this function:| void Olympe::CanvasMinimapRenderer::RenderImNodes | ( | ) | const |
Render minimap using ImNodes native API.
Must be called BEFORE ImNodes::EndNodeEditor()
Definition at line 130 of file CanvasMinimapRenderer.cpp.
References GetComponentTypeID_Static(), m_position, m_sizeRatio, and m_visible.
Here is the call graph for this function:Set minimap background color (RGBA)
Definition at line 234 of file CanvasMinimapRenderer.cpp.
References m_backgroundColor.
Set minimap node color (RGBA)
Definition at line 239 of file CanvasMinimapRenderer.cpp.
References m_nodeColor.
| void Olympe::CanvasMinimapRenderer::SetPosition | ( | MinimapPosition | pos | ) |
Set minimap corner position.
Definition at line 51 of file CanvasMinimapRenderer.cpp.
References GetComponentTypeID_Static(), and m_position.
Here is the call graph for this function:Set minimap size as ratio of canvas (0.05 - 0.5)
Definition at line 40 of file CanvasMinimapRenderer.cpp.
References GetComponentTypeID_Static(), and m_sizeRatio.
Here is the call graph for this function:Set minimap viewport rectangle color (RGBA)
Definition at line 244 of file CanvasMinimapRenderer.cpp.
References m_viewportColor.
Set minimap visibility.
Definition at line 30 of file CanvasMinimapRenderer.cpp.
References m_visible.
| void Olympe::CanvasMinimapRenderer::UpdateNodes | ( | const std::vector< std::tuple< int, float, float, float, float > > & | nodes, |
| float | graphMinX, | ||
| float | graphMaxX, | ||
| float | graphMinY, | ||
| float | graphMaxY | ||
| ) |
Update node positions from raw graph data.
| nodes | Vector of (nodeId, posX, posY, width, height) tuples |
| graphMinX | Graph bounds left edge |
| graphMaxX | Graph bounds right edge |
| graphMinY | Graph bounds top edge |
| graphMaxY | Graph bounds bottom edge |
Definition at line 80 of file CanvasMinimapRenderer.cpp.
References GetComponentTypeID_Static(), m_normalisedNodes, Olympe::MinimapNodeData::nodeId, and NormaliseCoord().
Here is the call graph for this function:| void Olympe::CanvasMinimapRenderer::UpdateViewport | ( | float | viewMinX, |
| float | viewMaxX, | ||
| float | viewMinY, | ||
| float | viewMaxY, | ||
| float | graphMinX, | ||
| float | graphMaxX, | ||
| float | graphMinY, | ||
| float | graphMaxY | ||
| ) |
Update visible viewport.
| viewMinX | Left edge of visible area (graph space) |
| viewMaxX | Right edge of visible area (graph space) |
| viewMinY | Top edge of visible area (graph space) |
| viewMaxY | Bottom edge of visible area (graph space) |
| graphMinX | Graph bounds left edge |
| graphMaxX | Graph bounds right edge |
| graphMinY | Graph bounds top edge |
| graphMaxY | Graph bounds bottom edge |
Definition at line 110 of file CanvasMinimapRenderer.cpp.
References GetComponentTypeID_Static(), Olympe::MinimapViewportData::h, m_normalisedViewport, NormaliseCoord(), Olympe::MinimapViewportData::w, Olympe::MinimapViewportData::x, and Olympe::MinimapViewportData::y.
Here is the call graph for this function:Definition at line 95 of file CanvasMinimapRenderer.h.
Definition at line 94 of file CanvasMinimapRenderer.h.
|
private |
Definition at line 232 of file CanvasMinimapRenderer.h.
Referenced by RenderCustom(), and SetBackgroundColor().
|
private |
Definition at line 233 of file CanvasMinimapRenderer.h.
Referenced by RenderCustom(), and SetNodeColor().
|
private |
Definition at line 228 of file CanvasMinimapRenderer.h.
Referenced by GetNormalisedNodes(), RenderCustom(), and UpdateNodes().
|
private |
Definition at line 229 of file CanvasMinimapRenderer.h.
Referenced by GetNormalisedViewport(), RenderCustom(), and UpdateViewport().
|
private |
Definition at line 225 of file CanvasMinimapRenderer.h.
Referenced by GetPosition(), RenderCustom(), RenderImNodes(), and SetPosition().
|
private |
0.05 - 0.5 ratio of canvas
Definition at line 224 of file CanvasMinimapRenderer.h.
Referenced by GetSize(), RenderCustom(), RenderImNodes(), and SetSize().
|
private |
Definition at line 234 of file CanvasMinimapRenderer.h.
Referenced by RenderCustom(), and SetViewportColor().
|
private |
Definition at line 223 of file CanvasMinimapRenderer.h.
Referenced by IsVisible(), RenderCustom(), RenderImNodes(), and SetVisible().