OSDN Git Service

132132
[psychlops/silverlight.git] / dev4 / psychlops / core / graphic / shape.cs
index 23cbeca..b007b7f 100644 (file)
@@ -70,6 +70,26 @@ namespace Psychlops{
                        set { begin = value; }\r
                }\r
 \r
+               //public static Line[] this[int x] { get { return Array(x); } }\r
+               //public static Line[,] this[int x, int y] { get { return Array(x, y); } }\r
+               public static Line[] Array(int ind)\r
+               {\r
+                       Line[] l = new Line[ind];\r
+                       for(int i=0; i<ind; i++) { l[i] = new Line(); }\r
+                       return l;\r
+               }\r
+               public static Line[,] Array(int indx, int indy)\r
+               {\r
+                       Line[,] l = new Line[indx, indy];\r
+                       for (int i = 0; i < indx; i++) { for (int j = 0; j < indy; j++) { l[i, j] = new Line(); } }\r
+                       return l;\r
+               }\r
+\r
+\r
+               public Line()\r
+               {\r
+                       set(0,0,0,0);\r
+               }\r
                public Line(double x1, double y1, double x2, double y2)\r
                {\r
                        set(x1, y1, x2, y2);\r
@@ -134,6 +154,22 @@ namespace Psychlops{
        {\r
                public Point v1, v2;\r
 \r
+               //public static Rectangle[] this[int x] { get { return Array(x); } }\r
+               //public static Rectangle[,] this[int x, int y] { get { return Array(x, y); } }\r
+               public static Rectangle[] Array(int ind)\r
+               {\r
+                       Rectangle[] l = new Rectangle[ind];\r
+                       for (int i = 0; i < ind; i++) { l[i] = new Rectangle(); }\r
+                       return l;\r
+               }\r
+               public static Rectangle[,] Array(int indx, int indy)\r
+               {\r
+                       Rectangle[,] l = new Rectangle[indx, indy];\r
+                       for (int i = 0; i < indx; i++) { for (int j = 0; j < indy; j++) { l[i, j] = new Rectangle(); } }\r
+                       return l;\r
+               }\r
+\r
+\r
                public Rectangle()\r
                {\r
                        set(0,0);\r
@@ -295,6 +331,21 @@ namespace Psychlops{
                public Point datum { get; set; }\r
                public double xdiameter, ydiameter;\r
 \r
+               //public static Ellipse[] this[int x] { get { return Array(x); } }\r
+               //public static Ellipse[,] this[int x, int y] { get { return Array(x, y); } }\r
+               public static Ellipse[] Array(int ind)\r
+               {\r
+                       Ellipse[] l = new Ellipse[ind];\r
+                       for (int i = 0; i < ind; i++) { l[i] = new Ellipse(); }\r
+                       return l;\r
+               }\r
+               public static Ellipse[,] Array(int indx, int indy)\r
+               {\r
+                       Ellipse[,] l = new Ellipse[indx, indy];\r
+                       for (int i = 0; i < indx; i++) { for (int j = 0; j < indy; j++) { l[i, j] = new Ellipse(); } }\r
+                       return l;\r
+               }\r
+\r
                public Ellipse()\r
                {\r
                        set(0,0);\r