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

Base class for routing algorithms.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public abstract class RoutingBase : IRouter

Inheritance: objectRoutingBase

Derived Classes: GridRouter

Implements: IRouter

Constructors

Initializes a new instance of the RoutingBase class.

C#
protected RoutingBase(IGraphInternal graph)
Parameters:graphIGraphInternal

The graph.

Methods

Given a point on the edge of a shape, this returns the middle point of the edge adjacent to it in the clockwise direction.

C#
protected static Point ClockwiseMoveAroundEdgeOfShape(Point point, IDiagramItem shape)
Parameters:pointPoint

The point on the edge of the shape.

shapeIDiagramItem

The shape holding the point.

Returns:

Point

Remarks:

This method is called when the routing algorithm is unable to find a route from the given starting point and an alternative starting point at the edge of the shape is necessary.

Finds the crossings.

C#
protected static void FindCrossings(IConnection connection, ref Point source, ref Point target)
Parameters:connectionIConnection

The connection.

sourcePoint

The source.

targetPoint

The target.

Given the connection, the most probable start and end points are returned together with some additional points if necessary.

C#
protected static Tuple<Point, Point, Point, Point, Point, Point> FindMostProbableTuple(IConnection connection)
Parameters:connectionIConnection

The connection which is being routed.

Returns:

Tuple<Point, Point, Point, Point, Point, Point>

A tuple containing

  • the source point; this is the start point given by the connection
  • the intermediate start point: the point which is not necessarily on the grid but which forms the corner between the endpoint of the connection and the nearest grid point. It's defined by the place where the endpoint is located on the shape. If the endpoint is free (because the connection is free at that point) the intermediate endpoint is NaN.
  • the actual start point for the routing procedure
  • the end point of the routing procedure
  • the intermediate end point: analog as the intermediate start point.
  • the target point; this is the end or target point given by the connection.

Gets the route points.

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

The connection.

showLastLinebool

If set to true [show last line].

Returns:

IList<Point>

Implements: IRouter.GetRoutePoints(IConnection, bool)

Gets the sector.

C#
protected static Sector GetSector(Point point, Rect bounds)
Parameters:pointPointboundsRectReturns:

Sector

Returns whether the given point is in the neighborhood of a shape.

C#
protected bool PointIsInNeighborhoodOfShape(Point point)
Parameters:pointPoint

The point.

Returns:

bool

Returns whether the given point resides in one of the shapes in the diagram.

C#
protected bool PointIsInShape(Point point)
Parameters:pointPoint

The point.

Returns:

bool