IEdge FindInputEdgeAt(IVertex vertex, PointF location) { if (vertex.InDegree == 0) return null; PointF pointT = (PointF)vertex.GetAlgorithmObj(_KH_PANE_LOCATION); foreach (var incomingEdges in vertex.IncomingEdges) { PointF pointS = (PointF)incomingEdges.Source.GetAlgorithmObj(_KH_PANE_LOCATION); RectangleF bound = new RectangleF((pointS.X + pointT.X) / 2 - 3, (pointS.Y + pointT.Y) / 2 - 3, 6, 6); if (bound.IsEmpty) continue; if (bound.Contains(location)) return incomingEdges; } return null; }
protected void OnPaint_DrawVertexInfo(Graphics g,IVertex v) { PointF location = (PointF)v.GetAlgorithmObj(_KH_PANE_LOCATION); RectangleF rect = (RectangleF)v.GetAlgorithmObj(_KH_PANE_BOUNDS); Render.DrawVertexSelected(g, v, _Attrfont, location, rect); }