X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=dev4%2Fpsychlops%2Fcore%2Fgraphic%2Fmodule.cs;h=6adecfd3314ac29ae0fc8b3b7e99eab5cc8b2c85;hb=97a97a46267462940a24f18ad5bbd0f77006dfd9;hp=a53a41accdf9f7c9dd8d1948a5d213cb0a3ef741;hpb=8d02b5d184f6209f65920c2e63bba907e2221f75;p=psychlops%2Fsilverlight.git diff --git a/dev4/psychlops/core/graphic/module.cs b/dev4/psychlops/core/graphic/module.cs index a53a41a..6adecfd 100644 --- a/dev4/psychlops/core/graphic/module.cs +++ b/dev4/psychlops/core/graphic/module.cs @@ -4,6 +4,48 @@ using System.Windows; namespace Psychlops { + public static class StaticFunctions + { + public static T[] NewArray(int x) + where T : new() + { + T[] t = new T[x]; + for (int i = 0; i < x; i++) + { + t[i] = new T(); + } + return t; + } + public static T[,] NewArray(int x, int y) + where T : new() + { + T[,] t = new T[x,y]; + for (int i = 0; i < x; i++) + { + for (int j = 0; j < x; j++) + { + t[i,j] = new T(); + } + } + return t; + } + public static T[,,] NewArray(int x, int y, int z) + where T : new() + { + T[,,] t = new T[x, y, z]; + for (int i = 0; i < x; i++) + { + for (int j = 0; j < y; j++) + { + for (int k = 0; k < z; k++) + { + t[i, j, k] = new T(); + } + } + } + return t; + } + } public partial struct Point { @@ -147,20 +189,50 @@ namespace Psychlops { System.Collections.Generic.List
list; System.Windows.Controls.Canvas cnvs; + System.Windows.Media.TransformGroup trans; + System.Windows.Media.TransformCollection transF; + System.Windows.Media.RotateTransform rotateF; + SimpleProcedure setRotation_; + System.Windows.Media.ScaleTransform scaleF; + SimpleProcedure setScaling_; + System.Windows.Media.TranslateTransform translateF; + bool AsyncBool; - public double rotation; - Point axis, scaling; + double rotation_; + public double rotation + { + get { return rotation_; } + set { rotation_ = value; rotateF.Dispatcher.BeginInvoke(setRotation_); } + } + public Point axis + { + get; + set; + } + Point scaling_; + public Point scaling + { + get { return scaling_; } + set { scaling_ = value; scaleF.Dispatcher.BeginInvoke(setScaling_); } + } + + AppendFunc1 append_; public Group() { + setRotation_ = new SimpleProcedure(setRotation__); + setScaling_ = new SimpleProcedure(setScaling__); + append_ = new AppendFunc1(append__); list = new System.Collections.Generic.List
(); AsyncBool = false; initialize__(); while (!AsyncBool) { } } - public Group append(Figure fig) + + public Group append(Internal.PrimitiveFigure fig) { list.Add(fig); + cnvs.Dispatcher.BeginInvoke(append_, fig); return this; }