Show / Hide Table of Contents

Class StandardLayoutAlgorithmFactory<TVertex, TEdge, TGraph>

Simple implementation of a layout algorithm factory.

Inheritance
System.Object
StandardLayoutAlgorithmFactory<TVertex, TEdge, TGraph>
Implements
ILayoutAlgorithmFactory<TVertex, TEdge, TGraph>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GraphShape.Algorithms.Layout
Assembly: GraphShape.dll
Syntax
public class StandardLayoutAlgorithmFactory<TVertex, TEdge, TGraph> : ILayoutAlgorithmFactory<TVertex, TEdge, TGraph> where TVertex : class where TEdge : IEdge<TVertex> where TGraph : class, IBidirectionalGraph<TVertex, TEdge>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

TGraph

Graph type.

Properties

| Improve this Doc View Source

AlgorithmTypes

The set of available algorithms.

Declaration
public IEnumerable<string> AlgorithmTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.String>

Methods

| Improve this Doc View Source

CreateAlgorithm(String, ILayoutContext<TVertex, TEdge, TGraph>, ILayoutParameters)

Creates an algorithm corresponding to given algorithmType, context and parameters.

Declaration
public ILayoutAlgorithm<TVertex, TEdge, TGraph> CreateAlgorithm(string algorithmType, ILayoutContext<TVertex, TEdge, TGraph> context, ILayoutParameters parameters)
Parameters
Type Name Description
System.String algorithmType

Algorithm type.

ILayoutContext<TVertex, TEdge, TGraph> context

Creation context.

ILayoutParameters parameters

Algorithm parameters.

Returns
Type Description
ILayoutAlgorithm<TVertex, TEdge, TGraph>

Created algorithm.

Exceptions
Type Condition
System.ArgumentNullException

algorithmType is null.

System.ArgumentNullException

context is null.

| Improve this Doc View Source

CreateParameters(String, ILayoutParameters)

Creates algorithm parameters for an algorithm of given algorithmType and parameters.

Declaration
public ILayoutParameters CreateParameters(string algorithmType, ILayoutParameters parameters)
Parameters
Type Name Description
System.String algorithmType

Algorithm type.

ILayoutParameters parameters

Algorithm parameters.

Returns
Type Description
ILayoutParameters

Parameters for the algorithm.

Exceptions
Type Condition
System.ArgumentNullException

algorithmType is null.

| Improve this Doc View Source

GetAlgorithmType(ILayoutAlgorithm<TVertex, TEdge, TGraph>)

Gets the algorithm type from a given algorithm.

Declaration
public string GetAlgorithmType(ILayoutAlgorithm<TVertex, TEdge, TGraph> algorithm)
Parameters
Type Name Description
ILayoutAlgorithm<TVertex, TEdge, TGraph> algorithm

Algorithm to get its type.

Returns
Type Description
System.String

Algorithm type.

Exceptions
Type Condition
System.ArgumentNullException

algorithm is null.

| Improve this Doc View Source

IsValidAlgorithm(String)

Checks if the given algorithmType is a valid one.

Declaration
public bool IsValidAlgorithm(string algorithmType)
Parameters
Type Name Description
System.String algorithmType

Algorithm type.

Returns
Type Description
System.Boolean

True if the algorithm type is valid, false otherwise.

| Improve this Doc View Source

NeedEdgeRouting(String)

Indicates if the given algorithmType require edge routing.

Declaration
public bool NeedEdgeRouting(string algorithmType)
Parameters
Type Name Description
System.String algorithmType

Algorithm type.

Returns
Type Description
System.Boolean

True if the algorithm require edge routing, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

algorithmType is null.

| Improve this Doc View Source

NeedOverlapRemoval(String)

Indicates if the given algorithmType require overlap removal.

Declaration
public bool NeedOverlapRemoval(string algorithmType)
Parameters
Type Name Description
System.String algorithmType

Algorithm type.

Returns
Type Description
System.Boolean

True if the algorithm require overlap removal, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

algorithmType is null.

Implements

ILayoutAlgorithmFactory<TVertex, TEdge, TGraph>

Extension Methods

GraphHelpers.GetDistances<TVertex, TEdge, TGraph>(TGraph)
GraphHelpers.GetDiameter<TVertex, TEdge, TGraph>(TGraph)
GraphHelpers.GetDiameter<TVertex, TEdge, TGraph>(TGraph, out Double[,])
  • Improve this Doc
  • View Source
In This Article
Back to top GraphShape