public static void DrawPolygon(this Graphics gr, KtPolygon2D polygon, Color color) { foreach (var region1 in polygon) { gr.DrawHoledRegion(region1, color); } }
public void StartDrawing(KtPolygon2D polygon, Action <string> whatToDoWhenStartedDrawing) { if (_blnDrawing) { return; } polygonInUse = polygon; pb.Paint -= originalDrawing; pb.Paint += Pb_Paint; pb.MouseClick += CreateRegion; this.whatToDoWhenStartedDrawing = whatToDoWhenStartedDrawing; }
public static string ConvertedAPolygonToAnInstance(this KtPolygon2D polygon, string polygonName) { var builder = new StringBuilder(); builder.Append("var ").Append(polygonName).Append(" = new KtPolygon2D(); \n"); foreach (var solid in polygon) { builder.Append(AddToPolygonText(solid, polygonName)); foreach (var hole in solid.Holes) { builder.Append(AddToPolygonText(hole, polygonName)); } } return(builder.ToString()); }