LayoutNode class

Layout-specific metadata wrapped around a HierarchyOccurrence.

This class represents a node in the schematic layout WITH a reference to the semantic HierarchyOccurrence, avoiding duplication of names/hierarchy info.

The HierarchyOccurrence is the single source of truth for:

  • Node name and type
  • Parent-child hierarchical relationships
  • Port definitions (rohd_hierarchy Port)
  • Internal signal definitions (rohd_hierarchy SignalOccurrence)

This LayoutNode adds ELK layout and display data:

  • Position, size, padding (layout results from ELK)
  • ELK ports with side/index (for FIXED_ORDER port constraints)
  • ELK layout properties
  • Display metadata (hwMeta: cls, bodyText, instanceName)
  • Hyperedges (connectivity within this node's scope)
  • Visibility state (expanded vs collapsed)
  • Partial expansion tracking (SHIFT+click)

Constructors

LayoutNode({required HierarchyOccurrence occurrence, String? id, HwMeta? hwMeta, Map<String, dynamic>? properties, List<ElkPort>? elkPorts, List<LayoutNode>? children, List<LayoutNode>? hiddenChildren, List<LayoutHyperedge>? hyperedges, LayoutNode? parent, double? x, double? y, double? width, double? height, ElkPadding? padding, String? hierarchyNodeId, Set<String>? partialChildIds, Set<String>? partialHyperedgeIds})
Constructor for LayoutNode.

Properties

allPorts Iterable<ElkPort>
Get all ELK ports including nested children's ports (flattened).
no setter
children List<LayoutNode>
Visible layout children nodes (for expanded state).
getter/setter pair
definition String?
Delegate definition to hierarchy node.
no setter
descendants Iterable<LayoutNode>
Get all descendant nodes (BFS traversal).
no setter
elkPorts List<ElkPort>
ELK ports with layout-specific data (side, index, position).
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Layout result height in pixels.
getter/setter pair
hiddenChildren List<LayoutNode>?
Hidden layout children (for collapsed state).
getter/setter pair
hierarchyNodeId String?
Link to corresponding HierarchyOccurrence ID (optional, for bridge code).
getter/setter pair
hwMeta ↔ HwMeta
Hardware metadata for display (cls, bodyText, instanceName).
getter/setter pair
hyperedges List<LayoutHyperedge>?
Hyperedges: one per SignalOccurrence net in this node's scope.
getter/setter pair
id String
Delegate ID to stored address or hierarchy node path.
getter/setter pair
isExpandable bool
Whether this node has hidden children (is expandable).
no setter
isExpanded bool
Whether this node is currently expanded (visible children present).
no setter
isPartiallyExpanded bool
Whether this node is partial expanded via SHIFT+click.
no setter
name String
Delegate name to hierarchy node (single source of truth).
no setter
occurrence HierarchyOccurrence
Reference to the semantic source of truth (never duplicated elsewhere).
final
padding ↔ ElkPadding?
Layout padding.
getter/setter pair
parent LayoutNode?
Parent reference in the layout tree.
getter/setter pair
partialChildIds Set<String>?
Partial expansion state from SHIFT+click on a port.
getter/setter pair
partialHyperedgeIds Set<String>?
IDs of signals to treat as visible during partial expansion.
getter/setter pair
portHyperedgeIndex Map<int, List<LayoutHyperedge>>
Returns the port→hyperedge index for this node, building it on first access.
no setter
ports List<SignalOccurrence>
Get ports from hierarchy's signals (no duplication).
no setter
properties Map<String, dynamic>
ELK layout properties (e.g. portConstraints, mergeEdges).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signals List<SignalOccurrence>
Get internal signals from hierarchy (excludes ports).
no setter
slimConnectedPortIds Set<String>?
Port IDs that have internal connectivity in a slim module.
getter/setter pair
width double?
Layout result width in pixels.
getter/setter pair
x double?
Layout result X position in pixels.
getter/setter pair
y double?
Layout result Y position in pixels.
getter/setter pair

Methods

applyPartialExpansion() → void
Temporarily move partial children from hiddenChildren to children.
collapsePartialExpansion() bool
Collapse partial expansion back to fully hidden state.
expandNonPrimitivesPartial() bool
Partially expand this node to reveal non-primitive children (blocks-only).
invalidatePortIndex() → void
Invalidate the cached port→hyperedge index (e.g. after modifying hyperedges).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
portIdAt(int portIndex) String
Return the ID of the port at portIndex in elkPorts.
portIndexById(String portId) int
Lazily-built port→hyperedge cache. The port-ID-to-index map has been eliminated: port IDs are now "nodeId:portIndex" so the index can be parsed directly from the string. Return the index of the port whose ID equals portId, or -1 if not found.
resolvePortId(String portId) → (String, int)?
Resolve a string port ID to (ownerNodeId, portIndex) by searching this node's ports first, then all children and hidden children.
restorePartialExpansion() → void
Reverse the effect of applyPartialExpansion.
toggle() → void
Toggle expansion state (same as ElkNode).
toJson() Map<String, dynamic>
Convert to JSON map for ELK JS serialization.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

clearDescendantMarks(List<LayoutNode> nodes) → void
Recursively clear partial marks on all descendants.