![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Applies a hierarchical layout to a TaskGraphTemplate in place. More...
#include <GraphAutoLayout.h>
Classes | |
| struct | Layer |
| A single layer in the hierarchical layout. More... | |
Static Public Member Functions | |
| static void | ApplyHierarchicalLayout (TaskGraphTemplate &graph) |
Assigns screen-space positions to every node in graph. | |
| static std::vector< Layer > | BuildLayers (const TaskGraphTemplate &graph) |
| Builds layers via BFS from the entry point. | |
| static void | AssignPositions (TaskGraphTemplate &graph, const std::vector< Layer > &layers) |
| Assigns x/y positions from the layer structure. | |
Static Public Attributes | |
| static constexpr float | SPACING_X = 220.0f |
| Horizontal gap between columns (pixels). | |
| static constexpr float | SPACING_Y = 130.0f |
| Vertical gap between rows (pixels). | |
| static constexpr float | ORIGIN_X = 100.0f |
| X coordinate of the root (EntryPoint) column. | |
| static constexpr float | ORIGIN_Y = 100.0f |
| Y coordinate of the first row. | |
Static Private Member Functions | |
| static void | SetPos (TaskNodeDefinition &node, float x, float y) |
| Writes a float position into a node's Parameters map. | |
Applies a hierarchical layout to a TaskGraphTemplate in place.
Typical usage:
Definition at line 44 of file GraphAutoLayout.h.
|
static |
Assigns screen-space positions to every node in graph.
Positions are written into each node's Parameters map under the keys "__posX" (float) and "__posY" (float) so they can be consumed by the editor canvas without touching the node's semantic fields.
If graph has no EntryPoint node, the first node in Nodes is used as the root. Disconnected (orphan) nodes are placed in an overflow column to the right of the main layout.
| graph | The graph whose nodes will be positioned. |
Definition at line 170 of file GraphAutoLayout.cpp.
References AssignPositions(), BuildLayers(), and GetComponentTypeID_Static().
Here is the call graph for this function:
|
static |
Assigns x/y positions from the layer structure.
| graph | Graph whose nodes will be modified. |
| layers | Layer structure produced by BuildLayers(). |
Definition at line 137 of file GraphAutoLayout.cpp.
References GetComponentTypeID_Static(), Olympe::GraphAutoLayout::Layer::NodeIDs, ORIGIN_X, ORIGIN_Y, SetPos(), SPACING_X, and SPACING_Y.
Referenced by ApplyHierarchicalLayout().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Builds layers via BFS from the entry point.
| graph | Source graph. |
Definition at line 38 of file GraphAutoLayout.cpp.
References Olympe::EntryPoint, GetComponentTypeID_Static(), Olympe::NODE_INDEX_NONE, and Olympe::GraphAutoLayout::Layer::NodeIDs.
Referenced by ApplyHierarchicalLayout().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Writes a float position into a node's Parameters map.
Definition at line 23 of file GraphAutoLayout.cpp.
References GetComponentTypeID_Static(), Olympe::Literal, and Olympe::ParameterBinding::Type.
Referenced by AssignPositions().
Here is the call graph for this function:
Here is the caller graph for this function:X coordinate of the root (EntryPoint) column.
Definition at line 54 of file GraphAutoLayout.h.
Referenced by AssignPositions().
Y coordinate of the first row.
Definition at line 57 of file GraphAutoLayout.h.
Referenced by AssignPositions().
Horizontal gap between columns (pixels).
Definition at line 48 of file GraphAutoLayout.h.
Referenced by AssignPositions().
Vertical gap between rows (pixels).
Definition at line 51 of file GraphAutoLayout.h.
Referenced by AssignPositions().