Beispiel #1
0
 protected void DrawBoundingBox(Graphics g,
     FlowChartPoint p1,
     FlowChartPoint p2,
     FlowChartPoint p3,
     FlowChartPoint p4)
 {
     g.DrawPolygon(
         ViewFactory.BoundingBoxPen,
         new PointF[] 
         { 
             p1.MakePointF(), 
             p2.MakePointF(), 
             p3.MakePointF(), 
             p4.MakePointF()
         });
 }
 private PointF Bezier(FlowChartPoint a, FlowChartPoint b, FlowChartPoint c, FlowChartPoint d, float t)
 {
     FlowChartPoint
         ab = new FlowChartPoint(),
         bc = new FlowChartPoint(),
         cd = new FlowChartPoint(),
         abbc = new FlowChartPoint(),
         bccd = new FlowChartPoint(),
         dest = new FlowChartPoint();
     Lerp( ab,  a,  b, t);           // point between a and b (green)
     Lerp( bc,  b,  c, t);           // point between b and c (green)
     Lerp( cd,  c,  d, t);           // point between c and d (green)
     Lerp( abbc,  ab,  bc, t);       // point between ab and bc (blue)
     Lerp( bccd,  bc,  cd, t);       // point between bc and cd (blue)
     Lerp( dest,  abbc,  bccd, t);   // point on the bezier-curve (black)
     return dest.MakePointF();
 }