Show / Hide Table of Contents

Class ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters>

Base class for all ILayoutAlgorithm<TVertex, TEdge, TGraph>.

Inheritance
System.Object
AlgorithmBase
LayoutAlgorithmBase<TVertex, TEdge, TGraph>
ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters>
DefaultParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters>
FRLayoutAlgorithm<TVertex, TEdge, TGraph>
ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TVertexInfo, TEdgeInfo, TParameters>
Implements
IAlgorithm
IParameterizedLayoutAlgorithm<TVertex, TEdge, TGraph, TParameters>
IParameterizedLayoutAlgorithm<TVertex, TEdge, TGraph>
ILayoutAlgorithm<TVertex, TEdge, TGraph>
QuikGraph.Algorithms.IAlgorithm<TGraph>
QuikGraph.Algorithms.IComputation
Inherited Members
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.VisitedGraph
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.VerticesPositions
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.ProgressChanged
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.IterationEnded
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.ReportOnProgressChangedNeeded
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.ReportOnIterationEndNeeded
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.GetVertexInfo(TVertex)
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.GetEdgeInfo(TEdge)
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.OnProgressChanged(Double)
LayoutAlgorithmBase<TVertex, TEdge, TGraph>.OnIterationEnded(ILayoutIterationEventArgs<TVertex>)
AlgorithmBase.IsCancelling
AlgorithmBase.ThrowIfCancellationRequested()
AlgorithmBase.SyncRoot
AlgorithmBase.State
AlgorithmBase.Compute()
AlgorithmBase.Abort()
AlgorithmBase.StateChanged
AlgorithmBase.OnStateChanged(EventArgs)
AlgorithmBase.Started
AlgorithmBase.OnStarted(EventArgs)
AlgorithmBase.Finished
AlgorithmBase.OnFinished(EventArgs)
AlgorithmBase.Aborted
AlgorithmBase.OnAborted(EventArgs)
AlgorithmBase.Initialize()
AlgorithmBase.InternalCompute()
AlgorithmBase.Clean()
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 abstract class ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters> : LayoutAlgorithmBase<TVertex, TEdge, TGraph>, IAlgorithm, IParameterizedLayoutAlgorithm<TVertex, TEdge, TGraph, TParameters>, IParameterizedLayoutAlgorithm<TVertex, TEdge, TGraph>, ILayoutAlgorithm<TVertex, TEdge, TGraph>, IAlgorithm<TGraph>, IComputation where TEdge : IEdge<TVertex> where TGraph : IVertexAndEdgeListGraph<TVertex, TEdge> where TParameters : class, ILayoutParameters
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

TGraph

Graph type.

TParameters

Parameters type.

Constructors

| Improve this Doc View Source

ParameterizedLayoutAlgorithmBase(TGraph)

Initializes a new instance of the ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters> class.

Declaration
protected ParameterizedLayoutAlgorithmBase(TGraph visitedGraph)
Parameters
Type Name Description
TGraph visitedGraph

Graph to layout.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

| Improve this Doc View Source

ParameterizedLayoutAlgorithmBase(TGraph, IDictionary<TVertex, Point>, TParameters)

Initializes a new instance of the ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters> class.

Declaration
protected ParameterizedLayoutAlgorithmBase(TGraph visitedGraph, IDictionary<TVertex, Point> verticesPositions, TParameters parameters)
Parameters
Type Name Description
TGraph visitedGraph

Graph to layout.

System.Collections.Generic.IDictionary<TVertex, Point> verticesPositions

Vertices positions.

TParameters parameters

Optional algorithm parameters.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

Properties

| Improve this Doc View Source

DefaultParameters

Default algorithm parameters to use if no parameters provided at construction.

Declaration
protected abstract TParameters DefaultParameters { get; }
Property Value
Type Description
TParameters
| Improve this Doc View Source

Parameters

Layout parameters.

Declaration
public TParameters Parameters { get; protected set; }
Property Value
Type Description
TParameters
| Improve this Doc View Source

Rand

Gets or sets the random number generator used to initialize positions randomly (and eventually during algorithm computation).

Declaration
public Random Rand { get; set; }
Property Value
Type Description
System.Random
Exceptions
Type Condition
System.ArgumentNullException

Value is null.

Methods

| Improve this Doc View Source

CreateLayoutIterationEventArgs(Int32, Double, String, IDictionary<TVertex, Point>)

Creates event arguments for IterationEnded.

Declaration
protected virtual ILayoutIterationEventArgs<TVertex> CreateLayoutIterationEventArgs(int iteration, double statusInPercent, string message, IDictionary<TVertex, Point> verticesPositions)
Parameters
Type Name Description
System.Int32 iteration

Number of the current iteration.

System.Double statusInPercent

Status of the layout algorithm in percent.

System.String message

Message representing the status of the algorithm.

System.Collections.Generic.IDictionary<TVertex, Point> verticesPositions

Vertices positions associations.

Returns
Type Description
ILayoutIterationEventArgs<TVertex>

A new instance of ILayoutIterationEventArgs<TVertex>.

Exceptions
Type Condition
System.ArgumentNullException

message is null.

System.ArgumentOutOfRangeException

iteration is negative.

System.ArgumentOutOfRangeException

statusInPercent is negative.

| Improve this Doc View Source

GetParameters()

Gets layout parameters.

Declaration
public ILayoutParameters GetParameters()
Returns
Type Description
ILayoutParameters

Layout parameters.

| Improve this Doc View Source

InitializeWithRandomPositions(Double, Double)

Initializes the positions of the vertices. Assigns a random position inside the 'bounding box' to the vertices without positions. It does NOT modify the position of the other vertices. Bounding box: x coordinates: double.Epsilon - width y coordinates: double.Epsilon - height

Declaration
protected virtual void InitializeWithRandomPositions(double width, double height)
Parameters
Type Name Description
System.Double width

Width of the bounding box.

System.Double height

Height of the bounding box.

| Improve this Doc View Source

InitializeWithRandomPositions(Double, Double, Double, Double)

Initializes the positions of the vertices. Assigns a random position inside the 'bounding box' to the vertices without positions. It does NOT modify the position of the other vertices. Bounding box: x coordinates: double.Epsilon - width y coordinates: double.Epsilon - height

Declaration
protected virtual void InitializeWithRandomPositions(double width, double height, double translateX, double translateY)
Parameters
Type Name Description
System.Double width

Width of the bounding box.

System.Double height

Height of the bounding box.

System.Double translateX

Translates the generated x coordinate.

System.Double translateY

Translates the generated y coordinate.

| Improve this Doc View Source

InitParameters(TParameters)

Initializes the parameters (cloning or creating new parameter object with default values).

Declaration
protected void InitParameters(TParameters parameters)
Parameters
Type Name Description
TParameters parameters

Parameters from a previous layout. If it is null, the Parameters will be set to the default ones.

| Improve this Doc View Source

NormalizePositions()

Normalizes the vertices positions.

Declaration
protected virtual void NormalizePositions()
| Improve this Doc View Source

OnIterationEnded(Int32, Double, String, Boolean)

Raises an IterationEnded event.

Declaration
protected void OnIterationEnded(int iteration, double statusInPercent, string message, bool normalizePositions)
Parameters
Type Name Description
System.Int32 iteration

Number of the current iteration.

System.Double statusInPercent

Status of the layout algorithm in percent.

System.String message

Message representing the status of the algorithm.

System.Boolean normalizePositions

Indicates if given positions must be normalized.

Exceptions
Type Condition
System.ArgumentNullException

message is null.

System.ArgumentOutOfRangeException

iteration is negative.

System.ArgumentOutOfRangeException

statusInPercent is negative.

Implements

IAlgorithm
IParameterizedLayoutAlgorithm<TVertex, TEdge, TGraph, TParameters>
IParameterizedLayoutAlgorithm<TVertex, TEdge, TGraph>
ILayoutAlgorithm<TVertex, TEdge, TGraph>
QuikGraph.Algorithms.IAlgorithm<TGraph>
QuikGraph.Algorithms.IComputation

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