![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton mini-map providing normalised graph overview data. More...
#include <MiniMapPanel.h>
Public Member Functions | |
| void | SetGraphBounds (float minX, float maxX, float minY, float maxY) |
| Sets the full bounds of the graph in graph space. | |
| void | SetViewport (float minX, float maxX, float minY, float maxY) |
| Sets the currently visible viewport in graph space. | |
| void | UpdateNodePositions (const std::vector< std::pair< int, std::pair< float, float > > > &rawPositions) |
| Updates the normalised node positions from raw (id, x, y) triples. | |
| const std::vector< MiniMapNodeEntry > & | GetNodes () const |
| Returns the normalised node positions for rendering. | |
| void | GetViewportRect (float &outX, float &outY, float &outW, float &outH) const |
| Returns the normalised viewport rectangle. | |
| bool | IsVisible () const |
| Returns true when the mini-map has valid data to display. | |
| bool | HandleClick (float clickNX, float clickNY, float &outScrollX, float &outScrollY) const |
| Converts a click on the mini-map into a graph-scroll target. | |
Static Public Member Functions | |
| static MiniMapPanel & | Get () |
| Returns the single shared instance. | |
Static Public Attributes | |
| static constexpr float | PANEL_WIDTH = 200.0f |
| Default panel width in screen px. | |
| static constexpr float | PANEL_HEIGHT = 150.0f |
| Default panel height in screen px. | |
Private Member Functions | |
| MiniMapPanel () | |
| float | Normalise (float value, float minVal, float maxVal) const |
Private Attributes | |
| float | m_GraphMinX |
| float | m_GraphMaxX |
| float | m_GraphMinY |
| float | m_GraphMaxY |
| float | m_ViewMinX |
| float | m_ViewMaxX |
| float | m_ViewMinY |
| float | m_ViewMaxY |
| std::vector< MiniMapNodeEntry > | m_Nodes |
| bool | m_IsVisible |
Singleton mini-map providing normalised graph overview data.
Typical usage:
Definition at line 57 of file MiniMapPanel.h.
|
private |
Definition at line 24 of file MiniMapPanel.cpp.
|
static |
Returns the single shared instance.
Definition at line 18 of file MiniMapPanel.cpp.
| const std::vector< MiniMapNodeEntry > & Olympe::MiniMapPanel::GetNodes | ( | ) | const |
Returns the normalised node positions for rendering.
Definition at line 90 of file MiniMapPanel.cpp.
References m_Nodes.
| void Olympe::MiniMapPanel::GetViewportRect | ( | float & | outX, |
| float & | outY, | ||
| float & | outW, | ||
| float & | outH | ||
| ) | const |
Returns the normalised viewport rectangle.
| outX | Left edge [0..1] |
| outY | Top edge [0..1] |
| outW | Width [0..1] |
| outH | Height [0..1] |
Definition at line 95 of file MiniMapPanel.cpp.
References GetComponentTypeID_Static(), m_GraphMaxX, m_GraphMaxY, m_GraphMinX, m_GraphMinY, m_ViewMaxX, m_ViewMaxY, m_ViewMinX, m_ViewMinY, and Normalise().
Here is the call graph for this function:| bool Olympe::MiniMapPanel::HandleClick | ( | float | clickNX, |
| float | clickNY, | ||
| float & | outScrollX, | ||
| float & | outScrollY | ||
| ) | const |
Converts a click on the mini-map into a graph-scroll target.
| clickNX | Normalised X of the click on the mini-map [0..1]. |
| clickNY | Normalised Y of the click on the mini-map [0..1]. |
| outScrollX | Target scroll X in graph space. |
| outScrollY | Target scroll Y in graph space. |
Definition at line 120 of file MiniMapPanel.cpp.
References GetComponentTypeID_Static(), m_GraphMaxX, m_GraphMaxY, m_GraphMinX, and m_GraphMinY.
Here is the call graph for this function:| bool Olympe::MiniMapPanel::IsVisible | ( | ) | const |
Returns true when the mini-map has valid data to display.
Definition at line 111 of file MiniMapPanel.cpp.
References m_IsVisible.
Definition at line 37 of file MiniMapPanel.cpp.
References GetComponentTypeID_Static().
Referenced by GetViewportRect(), and UpdateNodePositions().
Here is the call graph for this function:
Here is the caller graph for this function:Sets the full bounds of the graph in graph space.
Definition at line 52 of file MiniMapPanel.cpp.
References GetComponentTypeID_Static(), m_GraphMaxX, m_GraphMaxY, m_GraphMinX, and m_GraphMinY.
Here is the call graph for this function:Sets the currently visible viewport in graph space.
Definition at line 60 of file MiniMapPanel.cpp.
References GetComponentTypeID_Static(), m_ViewMaxX, m_ViewMaxY, m_ViewMinX, and m_ViewMinY.
Here is the call graph for this function:| void Olympe::MiniMapPanel::UpdateNodePositions | ( | const std::vector< std::pair< int, std::pair< float, float > > > & | rawPositions | ) |
Updates the normalised node positions from raw (id, x, y) triples.
| rawPositions | Each entry: (nodeId, graphX, graphY). |
Definition at line 68 of file MiniMapPanel.cpp.
References GetComponentTypeID_Static(), Olympe::MiniMapNodeEntry::id, m_GraphMaxX, m_GraphMaxY, m_GraphMinX, m_GraphMinY, m_IsVisible, m_Nodes, and Normalise().
Here is the call graph for this function:
|
private |
Definition at line 131 of file MiniMapPanel.h.
Referenced by GetViewportRect(), HandleClick(), SetGraphBounds(), and UpdateNodePositions().
|
private |
Definition at line 133 of file MiniMapPanel.h.
Referenced by GetViewportRect(), HandleClick(), SetGraphBounds(), and UpdateNodePositions().
|
private |
Definition at line 130 of file MiniMapPanel.h.
Referenced by GetViewportRect(), HandleClick(), SetGraphBounds(), and UpdateNodePositions().
|
private |
Definition at line 132 of file MiniMapPanel.h.
Referenced by GetViewportRect(), HandleClick(), SetGraphBounds(), and UpdateNodePositions().
|
private |
Definition at line 141 of file MiniMapPanel.h.
Referenced by IsVisible(), and UpdateNodePositions().
|
private |
Definition at line 140 of file MiniMapPanel.h.
Referenced by GetNodes(), and UpdateNodePositions().
|
private |
Definition at line 136 of file MiniMapPanel.h.
Referenced by GetViewportRect(), and SetViewport().
|
private |
Definition at line 138 of file MiniMapPanel.h.
Referenced by GetViewportRect(), and SetViewport().
|
private |
Definition at line 135 of file MiniMapPanel.h.
Referenced by GetViewportRect(), and SetViewport().
|
private |
Definition at line 137 of file MiniMapPanel.h.
Referenced by GetViewportRect(), and SetViewport().
Default panel height in screen px.
Definition at line 122 of file MiniMapPanel.h.
Default panel width in screen px.
Definition at line 121 of file MiniMapPanel.h.