Class
RoutingBase

Base class for routing algorithms.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public abstract class RoutingBase : IRouter

Inheritance: objectRoutingBase

Derived Classes: GridRouter

Implements: IRouter

Constructors

RoutingBase(IGraphInternal)

Initializes a new instance of the RoutingBase class.

Declaration

cs-api-definition
protected RoutingBase(IGraphInternal graph)

Parameters

graph

IGraphInternal

The graph.

Methods

ClockwiseMoveAroundEdgeOfShape(Point, IDiagramItem)

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

Declaration

cs-api-definition
protected static Point ClockwiseMoveAroundEdgeOfShape(Point point, IDiagramItem shape)

Parameters

point

Point

The point on the edge of the shape.

shape

IDiagramItem

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.

FindCrossings(IConnection, ref Point, ref Point)

Finds the crossings.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
protected static void FindCrossings(IConnection connection, ref Point source, ref Point target)

Parameters

connection

IConnection

The connection.

source

Point

The source.

target

Point

The target.

FindMostProbableTuple(IConnection)

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

Declaration

cs-api-definition
protected static Tuple<Point, Point, Point, Point, Point, Point> FindMostProbableTuple(IConnection connection)

Parameters

connection

IConnection

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.

GetRoutePoints(IConnection, bool)

Gets the route points.

Declaration

cs-api-definition
public abstract IList<Point> GetRoutePoints(IConnection connection, bool showLastLine = true)

Parameters

connection

IConnection

The connection.

showLastLine

bool

If set to true [show last line].

Returns

IList<Point>

Implements IRouter.GetRoutePoints(IConnection, bool)

GetSector(Point, Rect)

Gets the sector.

Declaration

cs-api-definition
protected static Sector GetSector(Point point, Rect bounds)

Parameters

point

Point

bounds

Rect

Returns

Sector

PointIsInNeighborhoodOfShape(Point)

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

Declaration

cs-api-definition
protected bool PointIsInNeighborhoodOfShape(Point point)

Parameters

point

Point

The point.

Returns

bool

PointIsInShape(Point)

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

Declaration

cs-api-definition
protected bool PointIsInShape(Point point)

Parameters

point

Point

The point.

Returns

bool