Class ParameterizedLayoutAlgorithmBase<TVertex, TEdge, TGraph, TParameters>
Base class for all ILayoutAlgorithm<TVertex, TEdge, TGraph>.
Inheritance
Implements
Inherited Members
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 SourceParameterizedLayoutAlgorithmBase(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 |
|
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 |
|
Properties
| Improve this Doc View SourceDefaultParameters
Default algorithm parameters to use if no parameters provided at construction.
Declaration
protected abstract TParameters DefaultParameters { get; }
Property Value
Type | Description |
---|---|
TParameters |
Parameters
Layout parameters.
Declaration
public TParameters Parameters { get; protected set; }
Property Value
Type | Description |
---|---|
TParameters |
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 SourceCreateLayoutIterationEventArgs(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 |
|
System.ArgumentOutOfRangeException |
|
System.ArgumentOutOfRangeException |
|
GetParameters()
Gets layout parameters.
Declaration
public ILayoutParameters GetParameters()
Returns
Type | Description |
---|---|
ILayoutParameters | Layout parameters. |
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. |
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. |
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. |
NormalizePositions()
Normalizes the vertices positions.
Declaration
protected virtual void NormalizePositions()
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 |
|
System.ArgumentOutOfRangeException |
|
System.ArgumentOutOfRangeException |
|