Nevron .NET Vision Documentation
Routable Connectors and Routing

Routing is the process of finding a path between two points, which strives not to cross any obstacles and also tries to obey certain aesthetic criterias, such as minimal number of turns, port orientation etc.

Routing works with three corner stone objects:

A route tries to avoid the current set of obstacles, residing in the manager container, by obtaining routing points from the routing manager.


You can force the reroute of a route with the help of the Reroute method, which must be implemented by each routable shape. Routes can be configured to automatically reroute themselves. This is specified by the RerouteAutomatically property (accept a value from the RerouteAutomatically enumeration). Currently the automatic reroute modes are: 

Routing Manager
The routing manager is responsible for creating and maintaining routing graphs for the current set of obstacles existing in the container to which the manager is attached. The route finding uses a generic A-Star algorithm, which is by far the best known algorithm for fast finding of a route in a graph.

The routing manager can be enabled or disabled, which is specified by the Enabled property. When the routing manager is disabled it will only reroute routes when routes request it (for example if you call the Reroute command from the context menu). Disabling the routing manager will globally disable automatic routing.

The manager currently supports two types of routing graphs: grid and mesh.
Grid Routing

Grid routing is applicable for routable connectors of type Dynamic HV. In grid routing the manager always outputs a set of points, which are the vertices of an imaginary grid and hence the produced line segments are orthogonal. The grid can be built from the intersection of the lines formed by the obstacles sides or sides and centers - specified by the RoutingGridType property (accepts values of the of the RoutingGridType enumeration). 

Also applicable for grid routing is the obstacle type, which is specified by the RouteObstacleType property of each shape (accepts values from the RouteObstacleType enumeration). Currently the obstacle type can be one of the following:

Mesh Routing
Mesh routing is applicable for routable connectors of type Dynamic Polyline and Curve. In mesh routing the manager outputs a set of points, which connect the start and end points in the shortest possible way. The mesh routing graph vertices are constructed by the obstacles corners - specified by the RoutingMeshType property (accepts values of the RoutingMeshType enumeration).
Related Examples
Windows Forms: Document Object Model - Shapes - Routable Connectors
See Also



©2017. Nevron Software LLC.

Send Feedback