ClassRoutingBase
Base class for routing algorithms.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public abstract class RoutingBase : IRouter
Inheritance: objectRoutingBase
Derived Classes:
Implements:
Constructors
RoutingBase(IGraphInternal)
Initializes a new instance of the RoutingBase class.
Declaration
protected RoutingBase(IGraphInternal graph)
Parameters
graph
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
protected static Point ClockwiseMoveAroundEdgeOfShape(Point point, IDiagramItem shape)
Parameters
point
Point
The point on the edge of the shape.
shape
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
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
protected static void FindCrossings(IConnection connection, ref Point source, ref Point target)
Parameters
connection
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
protected static Tuple<Point, Point, Point, Point, Point, Point> FindMostProbableTuple(IConnection connection)
Parameters
connection
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
public abstract IList<Point> GetRoutePoints(IConnection connection, bool showLastLine = true)
Parameters
connection
The connection.
showLastLine
If set to true [show last line].
Returns
IList<Point>
Implements
GetSector(Point, Rect)
Gets the sector.
Declaration
protected static Sector GetSector(Point point, Rect bounds)
Parameters
point
Point
bounds
Rect
Returns
PointIsInNeighborhoodOfShape(Point)
Returns whether the given point is in the neighborhood of a shape.
Declaration
protected bool PointIsInNeighborhoodOfShape(Point point)
Parameters
point
Point
The point.
Returns
PointIsInShape(Point)
Returns whether the given point resides in one of the shapes in the diagram.
Declaration
protected bool PointIsInShape(Point point)
Parameters
point
Point
The point.
Returns