I was wondering if anyone has ever created a custom router that acts much like schematic capture programs where the connections are all at right angles. If you look at the youtube video (link is below) starting at 4m28s you can see how this works. How would I go about creating an orthogonal routing service like this? What I have done so far is below, which creates two points in the middle of the connection to allow this to sort of work, but it does not handle anything complex such as going around different shapes and adding additional points when needed. Any thoughts?
http://youtu.be/JutQuq1vFYY?t=4m28s
public class OrthogonalRouter : IRouter
{
public System.Collections.Generic.IList<
Point
> GetRoutePoints(IConnection connection, bool showLastLine)
{
List<
Point
> pointList = new List<
Point
>();
Point start = connection.StartPoint;
Point end = connection.EndPoint;
pointList.Add(new Point(start.X + (end.X - start.X) / 2, start.Y));
pointList.Add(new Point(start.X + (end.X - start.X) / 2, end.Y));
return pointList;
}
}
http://youtu.be/JutQuq1vFYY?t=4m28s