Table of Contents

Class GraphLayout

Namespace
ValveResourceFormat.Utils
Assembly
ValveResourceFormat.dll

Generic graph layout algorithm based on Sugiyama's hierarchical layout method.

public static class GraphLayout

Inheritance

Inherited Members

Methods

LayoutNodes<TNode, TConnection>(IEnumerable<TNode>, IEnumerable<TConnection>, Func<TNode, Vector2>, Action<TNode, Vector2>, Func<TNode, Vector2>, Func<TConnection, TNode>, Func<TConnection, TNode>, Func<TNode, IEnumerable<TConnection>>, Func<TNode, IEnumerable<TConnection>>, LayoutOptions?)

Layouts nodes in a hierarchical arrangement using the Sugiyama algorithm.

public static void LayoutNodes<TNode, TConnection>(IEnumerable<TNode> nodes, IEnumerable<TConnection> connections, Func<TNode, Vector2> getPosition, Action<TNode, Vector2> setPosition, Func<TNode, Vector2> getSize, Func<TConnection, TNode> getSourceNode, Func<TConnection, TNode> getTargetNode, Func<TNode, IEnumerable<TConnection>> getInputConnections, Func<TNode, IEnumerable<TConnection>> getOutputConnections, GraphLayout.LayoutOptions? options = null) where TNode : class

Parameters

nodes IEnumerable<TNode>

The nodes to layout.

connections IEnumerable<TConnection>

The connections between nodes.

getPosition Func<TNode, Vector2>

Function to get a node's current position.

setPosition Action<TNode, Vector2>

Function to set a node's position.

getSize Func<TNode, Vector2>

Function to get a node's size.

getSourceNode Func<TConnection, TNode>

Function to get the source node from a connection.

getTargetNode Func<TConnection, TNode>

Function to get the target node from a connection.

getInputConnections Func<TNode, IEnumerable<TConnection>>

Function to get connections where this node is the target (optional, for barycenter calculation).

getOutputConnections Func<TNode, IEnumerable<TConnection>>

Function to get connections where this node is the source (optional, for barycenter calculation).

options GraphLayout.LayoutOptions?

Layout options (uses defaults if null).

Type Parameters

TNode

Type representing a node.

TConnection

Type representing a connection between nodes.