SILICON
Loading...
Searching...
No Matches
GraphLayout Class Reference

Pure OGDF adapter for calculating circuit component positions. More...

#include <ogdfCircuit.hpp>

Public Types

using PlacementMap = std::unordered_map<GraphicalLogicComponent*, QPointF>
 Map from graphical component to the computed scene position for that item.

Static Public Member Functions

static PlacementMap compute (const core::Circuit &circuit, std::span< GraphicalLogicComponent *const > components, const GraphLayoutOptions &options={})
 Computes component placements for the subset represented by components.

Detailed Description

Pure OGDF adapter for calculating circuit component positions.

GraphLayout does not mutate the scene or any graphical item. It only matches graphical components to vertices in a Circuit, computes a Sugiyama layered layout, and returns the scene positions that callers may apply through their own command or undo flow.

Definition at line 82 of file ogdfCircuit.hpp.

Member Typedef Documentation

◆ PlacementMap

using PlacementMap = std::unordered_map<GraphicalLogicComponent*, QPointF>

Map from graphical component to the computed scene position for that item.

Definition at line 87 of file ogdfCircuit.hpp.

Member Function Documentation

◆ compute()

GraphLayout::PlacementMap compute ( const core::Circuit & circuit,
std::span< GraphicalLogicComponent *const > components,
const GraphLayoutOptions & options = {} )
staticnodiscard

Computes component placements for the subset represented by components.

Components whose associated core component is not present in circuit are ignored. Circuit vertices without a matching graphical component are also ignored. The returned points are suitable for QGraphicsItem::setPos().

Parameters
circuitLogical circuit topology used as the layout graph.
componentsGraphical logic components that may participate in placement.
optionsLayout spacing, fallback sizing, origin, and determinism settings.
Returns
Computed scene positions indexed by graphical component pointer.

Definition at line 61 of file ogdfCircuit.cpp.


The documentation for this class was generated from the following files: