skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class AStarRouter

Implements A* algorithm for finding the cheapest path between two points.

Inheritance
System.Object
AStarRouter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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
IExtendedRouter.GetRoutePoints(IConnection)

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
IRouter.GetRoutePoints(IConnection, Boolean)

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>

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.