color = c;\r
thick = t;\r
}\r
+ public static readonly Stroke null_line = new Stroke(Color.null_color, 0);\r
+ public static readonly Stroke hair_line = new Stroke(Color.white, 1);\r
}\r
\r
public partial class Line : Shape\r
\r
public Line()\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.hair_line;\r
set(0,0,0,0);\r
}\r
public Line(double x1, double y1, double x2, double y2)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.hair_line;\r
set(x1, y1, x2, y2);\r
}\r
public Line(Point v1, Point v2)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.hair_line;\r
set(v1, v2);\r
}\r
public Line set(double x1, double y1, double x2, double y2)\r
public Stroke stroke { get; set; }\r
}\r
\r
+ public partial class Rectangle_\r
+ {\r
+ public Point v1, v2;\r
+\r
+ public double left { get { return v1.x; } }\r
+ public double top { get { return v1.y; } }\r
+ public double right { get { return v2.x; } }\r
+ public double bottom { get { return v2.y; } }\r
+ public double width { get { return Math.abs(v1.x - v2.x); } }\r
+ public double height { get { return Math.abs(v1.y - v2.y); } }\r
+ public double getLeft() { return left; }\r
+ public double getTop() { return top; }\r
+ public double getRight() { return right; }\r
+ public double getBottom() { return bottom; }\r
+ public double getWidth() { return width; }\r
+ public double getHeight() { return height; }\r
+\r
+\r
+\r
+ public Color fill { get; set; }\r
+ public Stroke stroke { get; set; }\r
+\r
+ public override string ToString()\r
+ {\r
+ return "Left:" + left.ToString() + " Top:" + top.ToString() + " Right:" + right.ToString() + " Bottom:" + bottom.ToString();\r
+ }\r
+ }\r
+\r
\r
public partial class Rectangle : Shape\r
{\r
\r
public Rectangle()\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
set(0,0);\r
}\r
public Rectangle(double wid, double hei)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
set(wid, hei);\r
}\r
public Rectangle(Rectangle another)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
v1 = another.v1;\r
v2 = another.v2;\r
}\r
\r
public Ellipse()\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
set(0,0);\r
}\r
public Ellipse(double wid, double hei)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
set(wid, hei);\r
}\r
\r
\r
public Polygon()\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
vertices = new System.Collections.Generic.List<Point>();\r
}\r
public Polygon(double[] verts)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
vertices = new System.Collections.Generic.List<Point>();\r
for (int i=0; i < verts.Length; i+=2)\r
{\r
}\r
public Polygon(Point[] verts)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
vertices = new System.Collections.Generic.List<Point>();\r
foreach (Point p in verts)\r
{\r