X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=dev4%2Fpsychlops%2Fcore%2Fgraphic%2Fshape.cs;h=aa0885d4f29342e6c8e1595c4a2777bdd4e20254;hb=2025e2db455b85eae3dec989bdfd39f3c1292df1;hp=d6ec7934e83e6ac67428cb12f79b8b4032389b90;hpb=2d16c7bc232e1d8e0f57404c4b37e3a8db6ab207;p=psychlops%2Fsilverlight.git diff --git a/dev4/psychlops/core/graphic/shape.cs b/dev4/psychlops/core/graphic/shape.cs index d6ec793..aa0885d 100644 --- a/dev4/psychlops/core/graphic/shape.cs +++ b/dev4/psychlops/core/graphic/shape.cs @@ -19,6 +19,10 @@ namespace Psychlops{ } public static class ShapeExtention { + public static void draw(this Shape drawee, double c) + { + drawee.draw( new Color(c) ); + } public static void draw(this Shape drawee, Color c) { Color tmp_col = drawee.fill; @@ -55,6 +59,8 @@ namespace Psychlops{ color = c; thick = t; } + public static readonly Stroke null_line = new Stroke(Color.null_color, 0); + public static readonly Stroke hair_line = new Stroke(Color.white, 1); } public partial class Line : Shape @@ -66,23 +72,51 @@ namespace Psychlops{ set { begin = value; } } + //public static Line[] this[int x] { get { return Array(x); } } + //public static Line[,] this[int x, int y] { get { return Array(x, y); } } + public static Line[] Array(int ind) + { + Line[] l = new Line[ind]; + for(int i=0; i(); } public Polygon(double[] verts) { + fill = Color.white; + stroke = Stroke.null_line; vertices = new System.Collections.Generic.List(); for (int i=0; i < verts.Length; i+=2) { @@ -364,6 +450,8 @@ namespace Psychlops{ } public Polygon(Point[] verts) { + fill = Color.white; + stroke = Stroke.null_line; vertices = new System.Collections.Generic.List(); foreach (Point p in verts) { @@ -387,7 +475,7 @@ namespace Psychlops{ return this; } - public void draw() + public virtual void draw() { Main.drawable.polygon(this); }