Exemplo n.º 1
0
 public static void DrawPolygon(this Graphics gr, KtPolygon2D polygon, Color color)
 {
     foreach (var region1 in polygon)
     {
         gr.DrawHoledRegion(region1, color);
     }
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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());
        }