X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=dev4%2Fpsychlops%2Fcore%2Fgraphic%2Fmodule.cs;h=b899caeceaad1338123ca2bf3773d7c43138f032;hb=e1bcd188a9eeb10582140f13e77b5857f9244816;hp=7afeeaf212a2ae3b92d6e0333e985375b3c09d6f;hpb=cb8916a7a5cd929f57b3f9edd99209680db90546;p=psychlops%2Fsilverlight.git diff --git a/dev4/psychlops/core/graphic/module.cs b/dev4/psychlops/core/graphic/module.cs index 7afeeaf..b899cae 100644 --- a/dev4/psychlops/core/graphic/module.cs +++ b/dev4/psychlops/core/graphic/module.cs @@ -8,32 +8,19 @@ namespace Psychlops public partial struct Point { public double x, y, z; - public Point(double dx, double dy, double dz) + public Point(double dx, double dy, double dz = 0.0) { x = dx; y = dy; z = dz; } - public Point(double dx, double dy) - { - x = dx; - y = dy; - z = 0.0; - } - public Point set(double dx, double dy, double dz) + public Point set(double dx, double dy, double dz = 0.0) { x = dx; y = dy; z = dz; return this; } - public Point set(double dx, double dy) - { - x = dx; - y = dy; - z = 0.0; - return this; - } public static Point operator +(Point lhs, Point rhs) { @@ -58,14 +45,7 @@ namespace Psychlops r = g = b = lum; a = 1.0; } - public Color(double red, double green, double blue) - { - r = red; - g = green; - b = blue; - a = 1.0; - } - public Color(double red, double green, double blue, double alpha) + public Color(double red, double green, double blue, double alpha = 1.0) { r = red; g = green; @@ -77,14 +57,7 @@ namespace Psychlops r = g = b = lum; a = 1.0; } - public void set(double red, double green, double blue) - { - r = red; - g = green; - b = blue; - a = 1.0; - } - public void set(double red, double green, double blue, double alpha) + public void set(double red, double green, double blue, double alpha = 1.0) { r = red; g = green; @@ -123,6 +96,7 @@ namespace Psychlops void polygon(Polygon drawee); void letters(Letters drawee); void image(Image drawee); + void group(Group drawee); void msg(string s, double x, double y, Color c); } @@ -146,17 +120,17 @@ namespace Psychlops target.datum = p; return target.datum; } - public static Figure shift(this Figure target, double x, double y) + public static Figure shift(this Figure target, double x, double y, double z = 0.0) { - return target.shift(new Point(x, y)); + return target.shift(new Point(x, y, z)); } public static Figure centering(this Figure target) { return target.centering(Main.drawable.getCenter()); } - public static Figure centering(this Figure target, double x, double y) + public static Figure centering(this Figure target, double x, double y, double z = 0.0) { - return target.centering(new Point(x, y)); + return target.centering(new Point(x, y, z)); } } @@ -165,6 +139,49 @@ namespace Psychlops public interface PrimitiveFigure : Figure { UIElement toNative(); + UIElement poolNative(Canvas c); + } + } + + public partial class Group : Internal.PrimitiveFigure + { + System.Collections.Generic.List
list; + System.Windows.Controls.Canvas cnvs; + AppendFunc1 append_; + bool AsyncBool; + public double rotation; + Point axis, scaling; + + public Group() + { + append_ = new AppendFunc1(append__); + list = new System.Collections.Generic.List
(); + AsyncBool = false; + initialize__(); + while (!AsyncBool) { } + } + public Group append(Internal.PrimitiveFigure fig) + { + list.Add(fig); + append_(fig); + return this; + } + + public Point datum { get; set; } + public Figure shift(Point p) + { + datum = datum + p; + return this; + } + public Figure centering(Point p) + { + datum = p; + return this; + } + public void draw() + { + Main.drawable.group(this); } } + } \ No newline at end of file