ClassAStarRouter
Implements A* algorithm for finding the cheapest path between two points.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public class AStarRouter : IExtendedRouter, IRouter
Inheritance: objectAStarRouter
Implements:
Constructors
AStarRouter(IGraphInternal)
Initializes a new instance of the AStarRouter class.
Declaration
public AStarRouter(IGraphInternal diagram)
Parameters
diagram
The related diagram.
Properties
AvoidConnectionOverlap
Gets or sets a value which indicates whether the routing algorithm tries to minimize connection overlaps. Default value is False.
AvoidShapes
Gets or sets the avoid shapes property. This property determines if the routing will go around shapes or go through them.
Declaration
public bool AvoidShapes { get; set; }
Property Value
The avoid shapes.
SegmentOverlapDistance
Gets or sets the distance around a segment in which an overlap is detected. Note: This property has effect only when AvoidConnectionOverlap is True. Default value is 3.
Declaration
public double SegmentOverlapDistance { get; set; }
Property Value
SegmentOverlapPenalty
Gets or sets the penalty value for a connection which overlaps another connection. Note: This property has effect only when AvoidConnectionOverlap is True. Default value is 0.75.
Declaration
public double SegmentOverlapPenalty { get; set; }
Property Value
ShapeCrossPenalty
Gets or sets the penalty value for a connection which crosses a diagram shapes other than its start or end shape. Note: This property has effect only when AvoidShapes is True. Default value is 1.
StartOrEndShapeWallPenalty
Gets or sets the penalty value for a connection which crosses its start or end shape. Default value is 3.
Declaration
public double StartOrEndShapeWallPenalty { get; set; }
Property Value
WallOptimization
Gets or sets the wall optimization.
Declaration
public bool WallOptimization { get; set; }
Property Value
The wall optimization.
Methods
CalculateBendAlteration(AStarNode, AStarNode, Rect, Point, Orientation, double)
Calculates the bend alteration.
Declaration
protected virtual double CalculateBendAlteration(AStarNode node, AStarNode previousNode, Rect endWall, Point endPoint, Orientation currentOrientation, double penaltyBaseValue)
Parameters
node
The node.
previousNode
The previous node.
endWall
Rect
The end wall.
endPoint
Point
The end point.
currentOrientation
The current direction.
penaltyBaseValue
The penalty base value.
Returns
CalculateWallPenalty(AStarNode, double)
Calculates the wall penalty.
GetRoutePoints(IConnection)
Gets the route points and the start and end connectors.
Declaration
public ConnectionRoute GetRoutePoints(IConnection connection)
Parameters
connection
The connection.
Returns
Implements
GetRoutePoints(IConnection, bool)
Gets the route points.
Declaration
public IList<Point> GetRoutePoints(IConnection connection, bool showLastLine = true)
Parameters
connection
The connection.
showLastLine
Whether the last line segment should be shown.
Returns
IList<Point>
Implements
GetSiblingNodes(AStarNode, Rect, Point, Orientation, double)
Calculates the sibling nodes.
Declaration
protected virtual IEnumerable<AStarNode> GetSiblingNodes(AStarNode node, Rect endWall, Point endPosition, Orientation preferredOrientation, double gridSize)
Parameters
node
The node.
endWall
Rect
The end wall.
endPosition
Point
The end position.
preferredOrientation
The preferred direction.
gridSize
Size of the grid.
Returns