Search
RoutingOptions.Distance Property
See Also
 





Gets a heuristic delegate function that returns the real distance sqrt(dx^2 + dy^2) between two pieces of the routing grid.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public static RouteHeuristics Distance { get; }

Visual Basic  Copy Code

Public Shared ReadOnly Property Distance As RouteHeuristics

 Property Value

A predefined RouteHeuristics delegate instance.

 Remarks

While generating a path, the routing algorithm evaluates pieces of the routing grid adjacent to the current one. It takes into account the cost for passing trough a piece and adds to that cost a heuristic value calculated by a RouteHeuristics delegate. So the smaller heuristic value a piece has, the greater the chance the found route to go through that piece.

Distance is a predefined delegate that assigns to pieces a heuristic value equaling the piece distance to the target. Thus of the four pieces adjacent to the current one, the piece closest to the target has the smallest value and the route generation continues through it. Distance is the default value of the RouteHeuristics property.

 Example

The following sample demonstrates how to use this property:

C#  Copy Code

diagram.RoutingOptions.RouteHeuristics = RoutingOptions.Distance;

Visual Basic  Copy Code
Diagram.RoutingOptions.RouteHeuristics = RoutingOptions.Distance

 See Also