OSDN Git Service

clock interval
[psychlops/silverlight.git] / dev3 / psychlops / core / graphic / module.cs
index 43b7caa..ac8000e 100644 (file)
@@ -1,13 +1,5 @@
 using System;\r
 using System.Windows;\r
-using System.Windows.Controls;\r
-using System.Windows.Documents;\r
-using System.Windows.Input;\r
-using System.Windows.Media;\r
-using System.Windows.Media.Animation;\r
-using System.Windows.Media.Imaging;\r
-using System.Windows.Shapes;\r
-\r
 \r
 \r
 namespace Psychlops\r
@@ -51,6 +43,10 @@ namespace Psychlops
                {\r
                        return new Point(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);\r
                }\r
+               public override string ToString()\r
+               {\r
+                       return "X:"+ x.ToString() + " Y:"+ y.ToString() + " Z:"+ z.ToString();\r
+               }\r
        }\r
 \r
 \r
@@ -96,6 +92,11 @@ namespace Psychlops
                        a = alpha;\r
                }\r
 \r
+               public override string ToString()\r
+               {\r
+                       return "R:" + r.ToString() + " G:" + g.ToString() + " B:" + b.ToString() + " A:" + a.ToString();\r
+               }\r
+\r
                public static readonly Color\r
                        black = new Color(0, 0, 0, 1),\r
                        red = new Color(1, 0, 0, 1),\r
@@ -105,7 +106,8 @@ namespace Psychlops
                        magenta = new Color(1, 0, 1, 1),\r
                        cyan = new Color(0, 1, 1, 1),\r
                        white = new Color(1, 1, 1, 1),\r
-                       gray = new Color(.5, .5, .5, 1);\r
+                       gray = new Color(.5, .5, .5, 1),\r
+                       null_color = new Color(0, 0, 0, 0);\r
 \r
        }\r
 \r
@@ -116,20 +118,10 @@ namespace Psychlops
                void clear(Color col);\r
                void pix(int x, int y, Color col);\r
                void line(Line drawee);\r
-               void line(Line drawee, Color col);\r
-               //void line(Line drawee, Stroke strk);\r
                void rect(Rectangle drawee);\r
-               void rect(Rectangle drawee, Color col);\r
-               //void rect(Rectangle drawee, Stroke strk);\r
                void ellipse(Ellipse drawee);\r
-               void ellipse(Ellipse drawee, Color col);\r
-               //void ellipse(Ellipse drawee, Stroke strk);\r
                void polygon(Polygon drawee);\r
-               void polygon(Polygon drawee, Color col);\r
-               //void polygon(Polygon drawee, Stroke strk);\r
                void letters(Letters drawee);\r
-               void letters(Letters drawee, Color col);\r
-               //void letters(Letters drawee, Stroke strk);\r
                void image(Image drawee);\r
                void msg(string s, double x, double y, Color c);\r
        }\r
@@ -141,7 +133,6 @@ namespace Psychlops
                Figure shift(Point p);\r
                Figure centering(Point p);\r
                void draw();\r
-               UIElement toNative();\r
        }\r
        public static class FigureExtention\r
        {\r
@@ -159,61 +150,11 @@ namespace Psychlops
                }\r
        }\r
 \r
-       public partial class Image : Figure\r
+       namespace Internal\r
        {\r
-               public WriteableBitmap buffer;\r
-               public Point datum;\r
-               public Rectangle self_rect;\r
-\r
-               public Image(int wid, int hei)\r
-               {\r
-                       initialize__(wid, hei);\r
-                       self_rect = new Rectangle(wid, hei);\r
-               }\r
-\r
-               /*public Image shift(double x, double y)\r
-               {\r
-                       datum.x += x;\r
-                       datum.y += y;\r
-                       return this;\r
-               }*/\r
-               public Figure shift(Point p)\r
+               public interface PrimitiveFigure : Figure\r
                {\r
-                       datum += p;\r
-                       return this;\r
-               }\r
-               public Figure centering(Point p)\r
-               {\r
-                       datum.x = p.x - width / 2.0;\r
-                       datum.y = p.y - height / 2.0;\r
-                       return this;\r
+                       UIElement toNative();\r
                }\r
-\r
-               public void pix(int x, int y, Color col)\r
-               {\r
-                       buffer.SetPixel(x, y, col);\r
-               }\r
-\r
-\r
-               public void field(System.Func<int,int,System.Windows.Media.Color> func)\r
-               {\r
-                       field__(func);\r
-                       //buffer.ForEach(func);\r
-               }\r
-               public void field(System.Func<int, int, System.Windows.Media.Color, System.Windows.Media.Color> func)\r
-               {\r
-                       field__(func);\r
-                       //buffer.ForEach(func);\r
-               }\r
-\r
-               public void draw()\r
-               {\r
-                       Main.drawable.image(this);\r
-               }\r
-\r
-               public double width  { get { return self_rect.width; } }\r
-               public double height { get { return self_rect.height; } }\r
-\r
        }\r
-\r
 }
\ No newline at end of file