New to Telerik UI for WinFormsStart a free 30-day trial

Routing based on the A* algorithm.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public sealed class GridRouter : RoutingBase, IRouter

Inheritance: objectRoutingBaseGridRouter

Implements: IRouter

Constructors

Initializes a new instance of the GridRouter class.

C#
public GridRouter(IGraphInternal diagram, Func<Point, bool> locationDelegate)
Parameters:diagramIGraphInternal

The diagram.

locationDelegateFunc<Point, bool>

The location delegate.

Initializes a new instance of the GridRouter class.

C#
public GridRouter(IGraphInternal diagram)
Parameters:diagramIGraphInternal

The diagram.

Properties

This is a cutoff for the A*-search and represents the buffer of points.

C#
public static int Cutoff { get; set; }

Methods

Finds the duplicate in the list of points which leads to loops in the paths.

C#
public static Point? FindDuplicate(IEnumerable<Point> source)
Parameters:sourceIEnumerable<Point>

The source.

Returns:

Point?

Gets the route points.

C#
public override IList<Point> GetRoutePoints(IConnection connection, bool showLastLine = true)
Parameters:connectionIConnection

The connection.

showLastLinebool

If set to true the intermediate points will be added to the resulting path.

Returns:

IList<Point>

Overrides: RoutingBase.GetRoutePoints(IConnection, bool)

Removes the loops in the point list.

C#
public static IList<Point> RemoveLoops(IList<Point> points)
Parameters:pointsIList<Point>

The points.

Returns:

IList<Point>

Returns null, if no path is found. Start- and End-Node are included in returned path.

C#
public IList<Point> Route(Point startPoint, Point endPoint)
Parameters:startPointPointendPointPointReturns:

IList<Point>