public virtual void render(ref Arc arc) { render(ref arc, 32); }
// Renders an arc public abstract void render(ref Arc arc, int segments);
// Gets the points of an arc public static Point[] getArcPoints(Arc arc, int segments) { // Variables Point[] points= new Point[((arc.height== 0f) ? segments+1 : segments*2+1)]; for(int i= 0; i<= segments; i++) { points[i]= new Point( arc.radius*(float)(Math.Cos(((float)i/(float)segments)*(arc.angB-arc.angA)+arc.angA))+arc.centerPosition.x, arc.radius*(float)(Math.Sin(((float)i/(float)segments)*(arc.angB-arc.angA)+arc.angA))+arc.centerPosition.y, arc.centerPosition.z ); } if(arc.height!= 0f) { for(int i= segments+1; i<= segments*2; i++) { points[i]= new Point( points[i-segments].x, points[i-segments].y, points[i-segments].z+arc.height ); } } return points; }
public virtual void render(Arc arc, int segments) { render(ref arc, segments); }
// Renders an arc public override void render(Arc arc) { // Variables Sdx.Graphics graphics= form.CreateGraphics(); switch((byte)(renderType)) { case 1:/* graphics.FillArc( new Sdx.SolidBrush(renderColor.toSysColor()), arc.centerPosition.x-arc.radius, arc.centerPosition.y-arc.radius, arc.radius, arc.radius, arc.angA, arc.angB ); break;*/ case 2: graphics.DrawArc( new Sdx.Pen(renderColor.toSysColor()), arc.centerPosition.x-arc.radius, arc.centerPosition.y-arc.radius, arc.radius, arc.radius, arc.angA, arc.angB ); break; } }