Line jumps other line

May 8, 2015 at 4:52 PM
Edited May 8, 2015 at 6:16 PM
Can I add "Line Jumps" feature. Where connectors overlap the crossing is displayed as a semi-circle indicating a Line Jump?

without the Line Jump it is impossible to know the true route of the connectors.

thanks a lot!
May 12, 2015 at 8:06 AM
Edited May 12, 2015 at 3:19 PM
Some ideas for implementing the feature (for Polyline in this case):
  • Write a method that searches intersections with other lines and stores them in an array/list, e.g.
    foreach (Shape s in this.Diagram.Shapes.FindShapes(0, 0, int.MaxValue, int.MaxValue, false)) {
        if (s is ILinearShape == false) continue;
        if (s is PolylineBase) {
            // Find out intersections using 
            // s. GetControlPointIds(ControlPointCapabilities.Resize) and 
            // s.GetControlPointPosition(...)
        } else if (s is ...) {
  • Override RecalcDrawCache() and coll this method there
  • Override InvalidateDrawCache and clear your buffered intersection points
  • Override DrawShape() and draw your line hops there. Use ToolCache.GetPen() for getting a GDI+ pen for drawing the shape's line. Passing the line cap style will give you a pen with line caps, passing null for the line caps will give you an ordinary pen without caps.
I hope this helps.
May 14, 2015 at 1:35 PM
Thanks a lot.

I will test. And I guess this is exactly what I'm looking for.

Thanks for your fast answer. :)