Class AStarRouter
Implements A* algorithm for finding the cheapest path between two points.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.WinControls.RadDiagram.dll
Syntax
public class AStarRouter : IExtendedRouter, IRouter
Constructors
AStarRouter(IGraphInternal)
Initializes a new instance of the AStarRouter class.
Declaration
public AStarRouter(IGraphInternal diagram)
Parameters
|
IGraphInternal
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.
Declaration
public bool AvoidConnectionOverlap { get; set; }
Property Value
|
System.Boolean
|
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
|
System.Boolean
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
|
System.Double
|
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
|
System.Double
|
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.
Declaration
public double ShapeCrossPenalty { get; set; }
Property Value
|
System.Double
|
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
|
System.Double
|
WallOptimization
Gets or sets the wall optimization.
Declaration
public bool WallOptimization { get; set; }
Property Value
|
System.Boolean
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
|
AStarNode
node
The node. |
|
AStarNode
previousNode
The previous node. |
|
Rect
endWall
The end wall. |
|
Point
endPoint
The end point. |
|
Orientation
currentOrientation
The current direction. |
|
System.Double
penaltyBaseValue
The penalty base value. |
Returns
|
System.Double
|
CalculateWallPenalty(AStarNode, Double)
Calculates the wall penalty.
Declaration
protected virtual double CalculateWallPenalty(AStarNode node, double penaltyBaseValue)
Parameters
|
AStarNode
node
The node. |
|
System.Double
penaltyBaseValue
The penalty base value. |
Returns
|
System.Double
|
GetRoutePoints(IConnection)
Gets the route points and the start and end connectors.
Declaration
public ConnectionRoute GetRoutePoints(IConnection connection)
Parameters
|
IConnection
connection
The connection. |
Returns
|
ConnectionRoute
|
Implements
GetRoutePoints(IConnection, Boolean)
Gets the route points.
Declaration
public IList<Point> GetRoutePoints(IConnection connection, bool showLastLine = true)
Parameters
|
IConnection
connection
The connection. |
|
System.Boolean
showLastLine
Whether the last line segment should be shown. |
Returns
|
System.Collections.Generic.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
|
AStarNode
node
The node. |
|
Rect
endWall
The end wall. |
|
Point
endPosition
The end position. |
|
Orientation
preferredOrientation
The preferred direction. |
|
System.Double
gridSize
Size of the grid. |
Returns
|
System.Collections.Generic.IEnumerable<AStarNode>
|