<Reference Include="System.Core" />\r
<Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
<Reference Include="System.Windows.Controls.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
- <Reference Include="System.Windows.Controls.DataVisualization.Toolkit, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />\r
<Reference Include="System.Windows.Controls.Toolkit, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />\r
<Reference Include="System.Xml" />\r
<Reference Include="System.Net" />\r
<Reference Include="System.Windows.Browser" />\r
- <Reference Include="WriteableBitmapEx, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">\r
- <SpecificVersion>False</SpecificVersion>\r
+ <Reference Include="WriteableBitmapEx">\r
<HintPath>WriteableBitmapEx\WriteableBitmapEx.dll</HintPath>\r
</Reference>\r
</ItemGroup>\r
<ItemGroup>\r
- <Compile Include="Pages\BinomialSolver.xaml.cs">\r
+ <None Include="Pages\BinomialSolver.xaml.cs">\r
<DependentUpon>BinomialSolver.xaml</DependentUpon>\r
- </Compile>\r
+ </None>\r
<Compile Include="Properties\AssemblyInfo.cs" />\r
<Compile Include="psychlops\core\app\app.cs" />\r
<Compile Include="psychlops\core\app\misc.cs" />\r
<Compile Include="psychlops\core\graphic\shape.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
- <Page Include="Pages\BinomialSolver.xaml">\r
+ <None Include="Pages\BinomialSolver.xaml">\r
<SubType>Designer</SubType>\r
<Generator>MSBuild:Compile</Generator>\r
- </Page>\r
+ </None>\r
</ItemGroup>\r
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
var bitmap = new BitmapImage();\r
bitmap.CreateOptions = BitmapCreateOptions.None;\r
bitmap.UriSource = uri;\r
- try\r
- {\r
+ //try\r
+ //{\r
var wbm = new System.Windows.Media.Imaging.WriteableBitmap(bitmap);\r
buffer = wbm;\r
- }\r
- catch (Exception e)\r
- {\r
- buffer = new WriteableBitmap(64, 64);\r
- buffer.ForEach(bitmap_drawChecker);\r
- }\r
+ //}\r
+ //catch (Exception e)\r
+ //{\r
+ // buffer = new WriteableBitmap(64, 64);\r
+ // buffer.ForEach(bitmap_drawChecker);\r
+ //}\r
self_rect.set(buffer.PixelWidth, buffer.PixelHeight);\r
AsyncBool = true;\r
}\r
\r
public Letters()\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
str_ = "";\r
font = Font.default_font;\r
align = HorizontalAlign.left;\r
}\r
public Letters(String init_str)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
str_ = init_str;\r
font_ = Font.default_font;\r
align = HorizontalAlign.center;\r
}\r
public Letters(String init_str, Font init_font)\r
{\r
+ fill = Color.white;\r
+ stroke = Stroke.null_line;\r
str_ = init_str;\r
font_ = init_font;\r
align = HorizontalAlign.right;\r
public Rectangle self_rect;\r
protected bool AsyncBool;\r
\r
+ public Image() \r
+ {\r
+ self_rect = new Rectangle(1, 1);\r
+ initialize__(1, 1);\r
+ }\r
+\r
public Image(string uri)\r
{\r
self_rect = new Rectangle();\r
yellow = new Color(1, 1, 0, 1),\r
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
- null_color = new Color(0, 0, 0, 0);\r
+ white = new Color(1, 1, 1, 1),\r
+ null_color = new Color(0, 0, 0, 0),\r
+ transparent = new Color(0, 0, 0, 0);\r
\r
}\r
\r
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
\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
\r
public class BinomialLikelihood\r
{\r
+ /*\r
public static void showWindow(Constants.Func1 f)\r
{\r
Main.canvas.api_canvas.Dispatcher.BeginInvoke(new Action<Constants.Func1>(showWindow_), f);\r
System.Windows.Controls.ChildWindow page = new PsychlopsSilverlight4.Pages.BinomialSolver(f);\r
page.Show();\r
}\r
+ * */\r
\r
public int iteration;\r
\r
#if DEBUG\r
public System.Windows.Controls.TextBlock DebugConsole;\r
#endif\r
+ System.Windows.Controls.Image img;\r
public MainPage()\r
{\r
InitializeComponent();\r
//Psychlops.Internal.Main.widgetStack = Controller;\r
AppStatusBar.Text = "Now starting Psychlops environment... please wait a minute";\r
\r
-\r
- var ur = new System.Uri("Resources/logo.png", System.UriKind.RelativeOrAbsolute);\r
+ /*\r
+ var ur = new System.Uri("Resources/Benham.png", System.UriKind.RelativeOrAbsolute);\r
var bitmap = new System.Windows.Media.Imaging.BitmapImage(ur);\r
var img = new System.Windows.Controls.Image();\r
img.Source = bitmap;\r
System.Windows.Controls.Canvas.SetLeft(img, 100);\r
System.Windows.Controls.Canvas.SetTop(img, 100);\r
- LayoutRoot.Children.Add(img);\r
-\r
+ Controller.Children.Add(img);\r
+ * */\r
+ \r
+ \r
}\r
protected void getFocusMouseEnter(object sender, System.Windows.Input.MouseEventArgs e) {\r
this.Focus();\r
\r
private void CompositionTarget_Rendering(object sender, System.EventArgs e)\r
{\r
+ //Controller.Children.Clear();\r
if (Main.canvas != null) Main.canvas.executeFlip();\r
//if (nextIntervalFrame-- <= 0)\r
//{\r
-///+ Prefix linkto BasicCode1\r
+\r
+///+ Prefix\r
//// Lines for set up Psychlops environment\r
using Psychlops;\r
\r
{\r
\r
public class PsychlopsMain\r
- {///- Prefix linkto BasicCode1\r
-\r
+ {///- Prefix\r
\r
///+ Main Routine\r
//// Psychlops runs at the first line of this function psychlops_main().\r
public void psychlops_main()\r
{\r
- ///+ 0 linkto BasicCode3_1a\r
- ////Prepare global parameters\r
- int maxrectnum = 200;\r
- int rectnum = 100;\r
- double rectsize = 5.0;\r
- Rectangle[] rect = StaticFunctions.NewArray<Rectangle>(maxrectnum);\r
- double[] rectcolorR = new double[maxrectnum];\r
- double[] rectcolorG = new double[maxrectnum];\r
- double[] rectcolorB = new double[maxrectnum];\r
- ///- 0 linkto BasicCode3_1a\r
-\r
- Canvas window = new Canvas(Canvas.window);\r
- var img = new Image("logo.png");\r
-\r
-\r
- ///+ 1 linkto BasicCode3_1a\r
- ////Initialize\r
- for (int i = 0; i < rectnum; i++)\r
- {\r
- ///+ 1.1 set1\r
- ////set positions and sizes\r
- rect[i].set(rectsize, rectsize); //Set a size of rectangles.\r
- rect[i].centering();\r
- rect[i].shift((i - 0.5 * rectnum) * rectsize * 1.5,\r
- (i - 0.5 * rectnum) * rectsize * 1.5); //Move Rectangles to initial positions\r
- ///- 1.1 set1\r
- ///+ 1.2 set2\r
- ////set colors\r
- rectcolorR[i] = Math.random(1.0) * 0.5; //Set R values. Note that "i" is converted to double-type.\r
- rectcolorG[i] = Math.random(1.0) * 0.5; //Set G values. Note that "i" is converted to double-type.\r
- rectcolorB[i] = Math.random(1.0) * 0.5; //Set B values. Note that "i" is converted to double-type.\r
- ///- 1.2 set2\r
- }\r
- ///- 1 linkto BasicCode3_1a\r
-\r
- ///+ 2 drawing\r
- ////drawing objects\r
- ///+ 2.1 linkto BasicCode3_2a\r
- ////Prepare variables for movie control;\r
- int frame = 0;\r
- int motion_dir = 1;\r
- double Horizontal_shift, Vertical_shift;\r
- ///- 2.1 linkto BasicCode3_2a\r
-\r
- while (!Keyboard.esc.pushed())\r
- {\r
- window.clear(Color.black);\r
- for (int i = 0; i < rectnum; i++)\r
- {\r
- ///+ 2.2 loopset1\r
- ////set positions and sizes\r
-\r
- Horizontal_shift = Math.sin(2 * Math.PI * ((double)frame / 30.0)) * motion_dir * 100.0; //Calculate horizontal displacement from the center.\r
- Vertical_shift = Math.sin(2 * Math.PI * ((double)frame / 30.0)) * motion_dir * 0.0;//Calculate vertical displacement from the center.\r
- rect[i].resize(rectsize, rectsize); //Resize rectangles.\r
- rect[i].centering(); //Rectangles are moved to the center...\r
- rect[i].shift(Horizontal_shift + (i - 0.5 * rectnum) * rectsize * 1.5,\r
- Vertical_shift + (i - 0.5 * rectnum) * rectsize * 1.5); //and then move to designated positions\r
- ///- 2.2 loopset1\r
-\r
- ///+ 2.3 linkto BasicCode3_2a\r
- ////set colors \r
- rectcolorR[i] = Math.random(1.0) * 0.5; //Set R values. Note that "i" is converted to double-type.\r
- rectcolorG[i] = Math.random(1.0) * 0.5; //Set G values. Note that "i" is converted to double-type.\r
- rectcolorB[i] = Math.random(1.0) * 0.5; //Set B values. Note that "i" is converted to double-type.\r
- ///- 2.3 linkto BasicCode3_2a\r
-\r
- }\r
- ///+ 2.4 linkto BasicCode3_1a\r
- for (int i = 0; i < rectnum; i++)\r
- {\r
- rect[i].draw(new Color(rectcolorR[i], rectcolorG[i], rectcolorB[i])); //draw objects by designated colors.\r
- }\r
- window.flip();\r
- ///- 2.4 linkto BasicCode3_1a\r
- frame++;\r
- }\r
- ///- 2 drawing\r
-\r
- }\r
- ///- Main Routine\r
-\r
-\r
- }\r
-\r
-}\r
-\r
-\r
-\r
-\r
-\r
-/*\r
-using Psychlops;\r
-\r
-namespace PsychlopsSilverlight4test\r
-{\r
-\r
- public class PsychlopsMain\r
- {\r
- void RectLuminance()\r
- {\r
- Canvas display = new Canvas(Canvas.window);\r
- Psychlops.Solver.BinomialLikelihood.showWindow(Math.cumulativeNormalDistibution);\r
- Letters le = new Letters("Reload to restart");\r
- le.fill = Color.black;\r
- le.align = Letters.HorizontalAlign.center;\r
-\r
+ ///+ 1\r
+ //// Set a window for drawing stimulus\r
+ Canvas window = new Canvas(300, 300); //Create a window. Here, window variables are preset mode.\r
+ // You can write this statement as" Canvas window = new Canvas(Canvas.fullscreen); " for fullscreen mode\r
+ // or as " Canvas window = new Canvas(1024, 768, 32, 60.0); " This statement changes screenmode to 1024 x 768, 32bit color, 60 Hz refresh.\r
+ ///- 1\r
+\r
+ var FIGURE = Psychlops.Widgets.Browser.Element.byID("FIGURE");\r
+ var SIZE_X = Psychlops.Widgets.Browser.Element.byID("SIZE_X");\r
+ var SIZE_Y = Psychlops.Widgets.Browser.Element.byID("SIZE_Y");\r
+ var SHIFT_X = Psychlops.Widgets.Browser.Element.byID("SHIFT_X");\r
+ var SHIFT_Y = Psychlops.Widgets.Browser.Element.byID("SHIFT_Y");\r
+ var COLOR_R = Psychlops.Widgets.Browser.Element.byID("COLOR_R");\r
+ var COLOR_G = Psychlops.Widgets.Browser.Element.byID("COLOR_G");\r
+ var COLOR_B = Psychlops.Widgets.Browser.Element.byID("COLOR_B");\r
+\r
+\r
+ ///+ 2\r
+ //// Set a figure size, position and color.\r
+ Rectangle figure = new Rectangle();\r
+ Ellipse figure2 = new Ellipse();\r
+\r
+ window.flip(); // Reflect the drawing for the display by flipping frame buffers.\r
+ // Till this point, you will not see drawn figures.\r
+ ///- 2\r
+\r
+ ///+ 3 \r
+ //// Detect a Keyboard input\r
while (!Keyboard.esc.pushed())\r
{\r
- Display.clear(Color.white);\r
- le.centering().shift(-200,-10).draw();\r
- Display.flip();\r
- }\r
-\r
- }\r
-\r
-\r
- public void psychlops_main()\r
- {\r
- RectLuminance();\r
- }\r
-\r
-\r
- }\r
-\r
-}\r
-\r
-*/\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/*\r
- using Psychlops;\r
-\r
-namespace PsychlopsSilverlight4test\r
-{\r
-\r
- public class PsychlopsMain\r
- {\r
-\r
- Psychlops.Canvas cnvs;\r
- int i;\r
- double x, y, z, t, p, temp, xx, yy;\r
-\r
- //Set Target Initial Value\r
- double TargetEcce = 100.0, TargetSize = 5.0, TargetNumber = 5, Rotate = 0.0;\r
-\r
- //Set Background Initial Value\r
- double Axis = 0.0, BGRadii = 150, BGSize = 5.0;\r
- Psychlops.Widgets.Slider thetaSpeed, DotNumber;\r
- Image img;\r
-\r
-\r
-\r
- public void psychlops_main()\r
- {\r
- cnvs = new Canvas(500, 500);\r
-\r
- Psychlops.Solver.BinomialLikelihood.showWindow(Math.cumulativeNormalDistibution);\r
-\r
-\r
- img = new Image("Resources/logo.png");\r
-\r
- Interval rng = new Interval();\r
- thetaSpeed = new Psychlops.Widgets.Slider("Label", -10 <= rng <= 10, 3.0);\r
- DotNumber = new Psychlops.Widgets.Slider("DotNum", 0 <= rng <= 100, 50.0);\r
-\r
- //Declare background dots and target\r
- Rectangle[] BGDot = new Rectangle[2048];\r
- for(int i=0; i<2048; i++){\r
- BGDot[i]=new Rectangle();\r
- }\r
- Rectangle[] Target= new Rectangle[10];\r
- for(int i=0; i<10; i++){\r
- Target[i]=new Rectangle();\r
- }\r
-\r
-\r
- //Declare Matrix to keep back ground dots' coordinate value\r
- double[] DotX=new double[2048];\r
- double[] DotY = new double[2048];\r
-\r
-\r
- //Set Independent variables to manipulate\r
-\r
-\r
- //Initialize positions of background dots\r
- for(int i=0; i<2048; i++){\r
- t=2.0*Math.PI*Math.random(1.0);\r
- p=2.0*Math.PI*Math.random(1.0);\r
- DotX[i]=t;\r
- DotY[i]=p;\r
-\r
- x=BGRadii*Math.cos(t)*Math.cos(p);\r
- y=BGRadii*Math.sin(t)*Math.cos(p);\r
- BGDot[i].set(BGSize, BGSize);\r
- BGDot[i].centering().shift(x,y);\r
- }\r
-\r
- //Initialize positions of targets\r
- for(int i=0; i<10; i++)Target[i].set(TargetSize, TargetSize);\r
-\r
- double COS, SIN;\r
- //DotNumber = 200;\r
- //Main stimulus loop\r
- while(true){\r
- //Clear the main window\r
- cnvs.clear();\r
-\r
-\r
- temp=Axis/360*2*Math.PI;\r
- COS=Math.cos(temp);\r
- SIN=Math.sin(temp);\r
-\r
- //Calculate positions of background dots and set them\r
- for(int i=0; i<DotNumber; i++){\r
- //Calculate in polar coordinate\r
- t=DotX[i]+2.0*Math.PI*thetaSpeed/360.0;\r
- p=DotY[i];\r
\r
- //Save current position\r
- DotX[i]=t;\r
+ window.clear();\r
\r
- //Convert to Decartes coordinate\r
- x=BGRadii*Math.cos(t)*Math.cos(p);\r
- y=BGRadii*Math.sin(t)*Math.cos(p);\r
- z=BGRadii*Math.sin(p);\r
- xx=x;\r
- yy=SIN*y+COS*z;\r
-\r
- //Set Dotsize and Draw them\r
- BGDot[i].set(BGSize, BGSize);\r
- BGDot[i].centering().shift(xx,yy);\r
- BGDot[i].draw( Color.blue );\r
- }\r
-\r
- //Calculate positions of targets and set them\r
- temp=Rotate*2*Math.PI/360.0;\r
- for (int i = 0; i < 5; i++)\r
- {\r
- t = 2.0 * Math.PI/TargetNumber;\r
- x = TargetEcce*Math.cos(i*t+temp);\r
- y = TargetEcce*Math.sin(i*t+temp);\r
- Target[i].centering().shift(x,y);\r
- Target[i].fill = Color.yellow;\r
- Target[i].draw();\r
- }\r
-\r
- img.centering(Mouse.position).draw();\r
-\r
- cnvs.var(Mouse.position.x, 100, 100);\r
- cnvs.var(Mouse.position.y, 100, 140);\r
-\r
- //Reflect drawing at the next frame;\r
- cnvs.flip();\r
- }\r
- }\r
- }\r
-\r
-}\r
-*/\r
-\r
-\r
-/*using Psychlops;\r
-\r
-namespace PsychlopsSilverlight4test\r
-{\r
- public class PsychlopsMain\r
- {\r
- public void psychlops_main()\r
- {\r
- var figure_type = Psychlops.Widgets.Browser.Element.byID("FIGURE");\r
- var size_x = Psychlops.Widgets.Browser.Element.byID("SIZE_X");\r
- var size_y = Psychlops.Widgets.Browser.Element.byID("SIZE_Y");\r
- var shift_x = Psychlops.Widgets.Browser.Element.byID("SHIFT_X");\r
- var shift_y = Psychlops.Widgets.Browser.Element.byID("SHIFT_Y");\r
- var color_r = Psychlops.Widgets.Browser.Element.byID("COLOR_R");\r
- var color_g = Psychlops.Widgets.Browser.Element.byID("COLOR_G");\r
- var color_b = Psychlops.Widgets.Browser.Element.byID("COLOR_B");\r
-\r
- Canvas window = new Canvas(300, 300);\r
-\r
- var figure_r = new Rectangle();\r
- var figure_e = new Ellipse();\r
- Shape figure = figure_r;\r
- \r
- while (!Keyboard.esc.pushed())\r
- {\r
- if (System.String.Compare(figure_type, "Rectangle") == 0)\r
+ if ("Rectangle".Equals(FIGURE))\r
{\r
- figure_r.set(size_x, size_y);\r
- figure = figure_r;\r
+ figure.set(SIZE_X, SIZE_Y); // Set the size of figure.\r
+ figure.centering(); // Centering the figure in the window\r
+ figure.shift(SHIFT_X, SHIFT_Y); // Displacing the figure by designated vector. \r
+ figure.draw(new Color(COLOR_R, COLOR_G, COLOR_B)); // Drawing the rectangle with a designated color.\r
}\r
else\r
{\r
- figure_e.set(size_x, size_y);\r
- figure = figure_e;\r
+ figure2.set(SIZE_X, SIZE_Y); // Set the size of figure.\r
+ figure2.centering(); // Centering the figure in the window\r
+ figure2.shift(SHIFT_X, SHIFT_Y); // Displacing the figure by designated vector. \r
+ figure2.draw(new Color(COLOR_R, COLOR_G, COLOR_B)); // Drawing the rectangle with a designated color.\r
}\r
- figure.fill = new Color(color_r, color_g, color_b);\r
\r
- window.clear(Color.black);\r
- figure.centering().shift(shift_x, shift_y).draw();\r
window.flip();\r
- }\r
- }\r
- }\r
-\r
-}\r
-\r
\r
+ } //exit a program when the escape key is pressed down.\r
+ ///- 3\r
\r
-\r
-/*\r
-using Psychlops;\r
-\r
-namespace Psychlops\r
-{\r
-\r
- public class RandomDots\r
- {\r
- Rectangle dot;\r
- public Point[] cood;\r
- public RandomDots()\r
- {\r
- cood = new Point[250];\r
- dot = new Rectangle(5, 5);\r
- }\r
- public void draw()\r
- {\r
- dot.fill = Color.white;\r
- foreach (Point p in cood)\r
- {\r
- dot.centering(p).draw();\r
- }\r
}\r
- }\r
-\r
-}\r
-\r
-\r
-\r
-namespace PsychlopsSilverlight4test\r
-{\r
-\r
- public class PsychlopsMain\r
- {\r
- Canvas cnvs;\r
- Image img;\r
- Ellipse fixation;\r
- Shape shape;\r
- Color col;\r
- int isize = 100;\r
- double tfreq = 1;\r
- int frames;\r
- RandomDots dots;\r
- Group g;\r
-\r
- public void psychlops_main()\r
- {\r
- cnvs = new Canvas(500, 500);\r
- g = new Group();\r
- img = new Image(isize * 2, isize * 2);\r
- Figures.drawGrating(ref img, 200, 200, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60);\r
- g.append(img);\r
- g.rotation = 50;\r
- fixation = new Ellipse(10, 10);\r
- fixation.fill = Color.red;\r
- //var poly = new Rectangle(100, 100);\r
- var poly = new Letters("日本語");\r
- //var poly = new Polygon(); poly.append(0, 100); poly.append(-100, 0); poly.append(0, -100); poly.append(100, 0);\r
- //var poly = new Ellipse(100, 100);\r
- //var poly = new Line(0,0,100, 0);\r
- poly.fill = Color.red;\r
- poly.stroke = new Stroke { color = Color.yellow, thick = 1 };\r
- shape = poly;\r
-\r
- var rng = new Interval();\r
- var slider = new Psychlops.Widgets.Slider("tesrt", -100 <= rng <= 100);\r
-\r
- dots = new RandomDots();\r
-\r
-\r
- while (true)\r
- {\r
- frames++;\r
-\r
-\r
- cnvs.clear(new Color(Mouse.left.pressed() ? 0.75 : 0.5));\r
- col.set(Math.random(1.0));\r
-\r
- /*if (frames % 2 == 0)\r
- {\r
- fixation.centering().shift(100, 100);\r
- fixation.draw(new Stroke(Color.blue, 3));\r
- }* /\r
-\r
- fixation.centering().shift(slider, 0);\r
- fixation.draw(Color.red);\r
-\r
- //Figures.drawGabor(ref img, 20, 100, 1, 0, frames * 2.0 * Math.PI / tfreq / 60);\r
- //Figures.drawGaussian(ref img, 20, 1);\r
- //Figures.drawGrating(ref img, 200, 200, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60);\r
- //img.centering(Mouse.position);\r
- //img.draw();\r
- g.centering(Mouse.position).draw();\r
- g.rotation += 1;\r
-\r
- shape.centering(Mouse.position).shift(100, 0);\r
- shape.draw();\r
- if (Keyboard.spc.pressed()) cnvs.var(Mouse.x, 100, 100);\r
-\r
- cnvs.var(frames, 0, 20);\r
- //slider.value = frames / 100.0;\r
-\r
- /*if (frames % 2 != 0)\r
- {\r
- fixation.shift(100, 100);\r
- fixation.draw(new Stroke(Color.green, 3));\r
- }* /\r
-\r
- for (int i = 0; i < dots.cood.Length; i++)\r
- {\r
- dots.cood[i].set(Math.random(500), Math.random(500));\r
- }\r
- cnvs.var((double)slider, 200, 200);\r
- dots.draw();\r
+ ///- Main Routine\r
\r
- cnvs.flip();\r
- }\r
- }\r
}\r
-}\r
-\r
-**/\r
-\r
-\r
-/*\r
-\r
-using Psychlops;\r
-namespace PsychlopsSilverlight4test\r
-{\r
-\r
- public class PsychlopsMain\r
- {\r
- Canvas cnvs;\r
- Rectangle[] rect;\r
- int n;\r
-\r
- public void psychlops_main()\r
- {\r
- n = 1;\r
- cnvs = new Canvas(500, 500);\r
- rect = new Rectangle[n];\r
- for (int i = 0; i < n; i++)\r
- {\r
- rect[i] = new Rectangle(10, 10);\r
- rect[i].fill = Color.red;\r
- }\r
- Interval rng = new Interval();\r
- var slider = new Psychlops.Widgets.Slider("Label", -100 <= rng <= 100);\r
\r
- while (true)\r
- {\r
- cnvs.clear();\r
- for (int i = 0; i < n; i++)\r
- {\r
- rect[i].centering().shift(slider * i*3, i*3).draw();\r
- }\r
- cnvs.flip();\r
- }\r
- }\r
- }\r
}\r
\r
-*/
\ No newline at end of file
+\r
<Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
<Reference Include="System.Xml" />\r
<Reference Include="System.Windows.Browser" />\r
+ <Reference Include="WriteableBitmapEx">\r
+ <HintPath>..\dev4\WriteableBitmapEx\WriteableBitmapEx.dll</HintPath>\r
+ </Reference>\r
</ItemGroup>\r
<ItemGroup>\r
<Compile Include="App.xaml.cs">\r
<None Include="Properties\AppManifest.xml" />\r
</ItemGroup>\r
<ItemGroup>\r
- <Resource Include="Resources\logo.png" />\r
<Content Include="TestPage.html" />\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <Folder Include="Resources\" />\r
+ </ItemGroup>\r
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
-/*\r
+\r
+/*\r
+using Psychlops;\r
+\r
+namespace PsychlopsSilverlight4test\r
+{\r
+\r
+ public class PsychlopsMain\r
+ {\r
+ void RectLuminance()\r
+ {\r
+ Canvas display = new Canvas(Canvas.window);\r
+ Psychlops.Solver.BinomialLikelihood.showWindow(Math.cumulativeNormalDistibution);\r
+ Letters le = new Letters("Reload to restart");\r
+ le.fill = Color.black;\r
+ le.align = Letters.HorizontalAlign.center;\r
+\r
+ while (!Keyboard.esc.pushed())\r
+ {\r
+ Display.clear(Color.white);\r
+ le.centering().shift(-200,-10).draw();\r
+ Display.flip();\r
+ }\r
+\r
+ }\r
+\r
+\r
+ public void psychlops_main()\r
+ {\r
+ RectLuminance();\r
+ }\r
+\r
+\r
+ }\r
+\r
+}\r
+\r
+*/\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+/*\r
+ using Psychlops;\r
+\r
+namespace PsychlopsSilverlight4test\r
+{\r
+\r
+ public class PsychlopsMain\r
+ {\r
+\r
+ Psychlops.Canvas cnvs;\r
+ int i;\r
+ double x, y, z, t, p, temp, xx, yy;\r
+\r
+ //Set Target Initial Value\r
+ double TargetEcce = 100.0, TargetSize = 5.0, TargetNumber = 5, Rotate = 0.0;\r
+\r
+ //Set Background Initial Value\r
+ double Axis = 0.0, BGRadii = 150, BGSize = 5.0;\r
+ Psychlops.Widgets.Slider thetaSpeed, DotNumber;\r
+ Image img;\r
+\r
+\r
+\r
+ public void psychlops_main()\r
+ {\r
+ cnvs = new Canvas(500, 500);\r
+\r
+ Psychlops.Solver.BinomialLikelihood.showWindow(Math.cumulativeNormalDistibution);\r
+\r
+\r
+ img = new Image("Resources/logo.png");\r
+\r
+ Interval rng = new Interval();\r
+ thetaSpeed = new Psychlops.Widgets.Slider("Label", -10 <= rng <= 10, 3.0);\r
+ DotNumber = new Psychlops.Widgets.Slider("DotNum", 0 <= rng <= 100, 50.0);\r
+\r
+ //Declare background dots and target\r
+ Rectangle[] BGDot = new Rectangle[2048];\r
+ for(int i=0; i<2048; i++){\r
+ BGDot[i]=new Rectangle();\r
+ }\r
+ Rectangle[] Target= new Rectangle[10];\r
+ for(int i=0; i<10; i++){\r
+ Target[i]=new Rectangle();\r
+ }\r
+\r
+\r
+ //Declare Matrix to keep back ground dots' coordinate value\r
+ double[] DotX=new double[2048];\r
+ double[] DotY = new double[2048];\r
+\r
+\r
+ //Set Independent variables to manipulate\r
+\r
+\r
+ //Initialize positions of background dots\r
+ for(int i=0; i<2048; i++){\r
+ t=2.0*Math.PI*Math.random(1.0);\r
+ p=2.0*Math.PI*Math.random(1.0);\r
+ DotX[i]=t;\r
+ DotY[i]=p;\r
+\r
+ x=BGRadii*Math.cos(t)*Math.cos(p);\r
+ y=BGRadii*Math.sin(t)*Math.cos(p);\r
+ BGDot[i].set(BGSize, BGSize);\r
+ BGDot[i].centering().shift(x,y);\r
+ }\r
+\r
+ //Initialize positions of targets\r
+ for(int i=0; i<10; i++)Target[i].set(TargetSize, TargetSize);\r
+\r
+ double COS, SIN;\r
+ //DotNumber = 200;\r
+ //Main stimulus loop\r
+ while(true){\r
+ //Clear the main window\r
+ cnvs.clear();\r
+\r
+\r
+ temp=Axis/360*2*Math.PI;\r
+ COS=Math.cos(temp);\r
+ SIN=Math.sin(temp);\r
+\r
+ //Calculate positions of background dots and set them\r
+ for(int i=0; i<DotNumber; i++){\r
+ //Calculate in polar coordinate\r
+ t=DotX[i]+2.0*Math.PI*thetaSpeed/360.0;\r
+ p=DotY[i];\r
+\r
+ //Save current position\r
+ DotX[i]=t;\r
+\r
+ //Convert to Decartes coordinate\r
+ x=BGRadii*Math.cos(t)*Math.cos(p);\r
+ y=BGRadii*Math.sin(t)*Math.cos(p);\r
+ z=BGRadii*Math.sin(p);\r
+ xx=x;\r
+ yy=SIN*y+COS*z;\r
+\r
+ //Set Dotsize and Draw them\r
+ BGDot[i].set(BGSize, BGSize);\r
+ BGDot[i].centering().shift(xx,yy);\r
+ BGDot[i].draw( Color.blue );\r
+ }\r
+\r
+ //Calculate positions of targets and set them\r
+ temp=Rotate*2*Math.PI/360.0;\r
+ for (int i = 0; i < 5; i++)\r
+ {\r
+ t = 2.0 * Math.PI/TargetNumber;\r
+ x = TargetEcce*Math.cos(i*t+temp);\r
+ y = TargetEcce*Math.sin(i*t+temp);\r
+ Target[i].centering().shift(x,y);\r
+ Target[i].fill = Color.yellow;\r
+ Target[i].draw();\r
+ }\r
+\r
+ img.centering(Mouse.position).draw();\r
+\r
+ cnvs.var(Mouse.position.x, 100, 100);\r
+ cnvs.var(Mouse.position.y, 100, 140);\r
+\r
+ //Reflect drawing at the next frame;\r
+ cnvs.flip();\r
+ }\r
+ }\r
+ }\r
+\r
+}\r
+*/\r
+\r
+\r
+/*using Psychlops;\r
+\r
+namespace PsychlopsSilverlight4test\r
+{\r
+ public class PsychlopsMain\r
+ {\r
+ public void psychlops_main()\r
+ {\r
+ var figure_type = Psychlops.Widgets.Browser.Element.byID("FIGURE");\r
+ var size_x = Psychlops.Widgets.Browser.Element.byID("SIZE_X");\r
+ var size_y = Psychlops.Widgets.Browser.Element.byID("SIZE_Y");\r
+ var shift_x = Psychlops.Widgets.Browser.Element.byID("SHIFT_X");\r
+ var shift_y = Psychlops.Widgets.Browser.Element.byID("SHIFT_Y");\r
+ var color_r = Psychlops.Widgets.Browser.Element.byID("COLOR_R");\r
+ var color_g = Psychlops.Widgets.Browser.Element.byID("COLOR_G");\r
+ var color_b = Psychlops.Widgets.Browser.Element.byID("COLOR_B");\r
+\r
+ Canvas window = new Canvas(300, 300);\r
+\r
+ var figure_r = new Rectangle();\r
+ var figure_e = new Ellipse();\r
+ Shape figure = figure_r;\r
+ \r
+ while (!Keyboard.esc.pushed())\r
+ {\r
+ if (System.String.Compare(figure_type, "Rectangle") == 0)\r
+ {\r
+ figure_r.set(size_x, size_y);\r
+ figure = figure_r;\r
+ }\r
+ else\r
+ {\r
+ figure_e.set(size_x, size_y);\r
+ figure = figure_e;\r
+ }\r
+ figure.fill = new Color(color_r, color_g, color_b);\r
+\r
+ window.clear(Color.black);\r
+ figure.centering().shift(shift_x, shift_y).draw();\r
+ window.flip();\r
+ }\r
+ }\r
+ }\r
+\r
+}\r
+\r
+\r
+\r
+\r
+/*\r
+using Psychlops;\r
+\r
+namespace Psychlops\r
+{\r
+\r
+ public class RandomDots\r
+ {\r
+ Rectangle dot;\r
+ public Point[] cood;\r
+ public RandomDots()\r
+ {\r
+ cood = new Point[250];\r
+ dot = new Rectangle(5, 5);\r
+ }\r
+ public void draw()\r
+ {\r
+ dot.fill = Color.white;\r
+ foreach (Point p in cood)\r
+ {\r
+ dot.centering(p).draw();\r
+ }\r
+ }\r
+ }\r
+\r
+}\r
+\r
+\r
+\r
+namespace PsychlopsSilverlight4test\r
+{\r
+\r
+ public class PsychlopsMain\r
+ {\r
+ Canvas cnvs;\r
+ Image img;\r
+ Ellipse fixation;\r
+ Shape shape;\r
+ Color col;\r
+ int isize = 100;\r
+ double tfreq = 1;\r
+ int frames;\r
+ RandomDots dots;\r
+ Group g;\r
+\r
+ public void psychlops_main()\r
+ {\r
+ cnvs = new Canvas(500, 500);\r
+ g = new Group();\r
+ img = new Image(isize * 2, isize * 2);\r
+ Figures.drawGrating(ref img, 200, 200, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60);\r
+ g.append(img);\r
+ g.rotation = 50;\r
+ fixation = new Ellipse(10, 10);\r
+ fixation.fill = Color.red;\r
+ //var poly = new Rectangle(100, 100);\r
+ var poly = new Letters("日本語");\r
+ //var poly = new Polygon(); poly.append(0, 100); poly.append(-100, 0); poly.append(0, -100); poly.append(100, 0);\r
+ //var poly = new Ellipse(100, 100);\r
+ //var poly = new Line(0,0,100, 0);\r
+ poly.fill = Color.red;\r
+ poly.stroke = new Stroke { color = Color.yellow, thick = 1 };\r
+ shape = poly;\r
+\r
+ var rng = new Interval();\r
+ var slider = new Psychlops.Widgets.Slider("tesrt", -100 <= rng <= 100);\r
+\r
+ dots = new RandomDots();\r
+\r
+\r
+ while (true)\r
+ {\r
+ frames++;\r
+\r
+\r
+ cnvs.clear(new Color(Mouse.left.pressed() ? 0.75 : 0.5));\r
+ col.set(Math.random(1.0));\r
+\r
+ /*if (frames % 2 == 0)\r
+ {\r
+ fixation.centering().shift(100, 100);\r
+ fixation.draw(new Stroke(Color.blue, 3));\r
+ }* /\r
+\r
+ fixation.centering().shift(slider, 0);\r
+ fixation.draw(Color.red);\r
+\r
+ //Figures.drawGabor(ref img, 20, 100, 1, 0, frames * 2.0 * Math.PI / tfreq / 60);\r
+ //Figures.drawGaussian(ref img, 20, 1);\r
+ //Figures.drawGrating(ref img, 200, 200, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60);\r
+ //img.centering(Mouse.position);\r
+ //img.draw();\r
+ g.centering(Mouse.position).draw();\r
+ g.rotation += 1;\r
+\r
+ shape.centering(Mouse.position).shift(100, 0);\r
+ shape.draw();\r
+ if (Keyboard.spc.pressed()) cnvs.var(Mouse.x, 100, 100);\r
+\r
+ cnvs.var(frames, 0, 20);\r
+ //slider.value = frames / 100.0;\r
+\r
+ /*if (frames % 2 != 0)\r
+ {\r
+ fixation.shift(100, 100);\r
+ fixation.draw(new Stroke(Color.green, 3));\r
+ }* /\r
+\r
+ for (int i = 0; i < dots.cood.Length; i++)\r
+ {\r
+ dots.cood[i].set(Math.random(500), Math.random(500));\r
+ }\r
+ cnvs.var((double)slider, 200, 200);\r
+ dots.draw();\r
+\r
+ cnvs.flip();\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+**/\r
+\r
+\r
+/*\r
+\r
+using Psychlops;\r
+namespace PsychlopsSilverlight4test\r
+{\r
+\r
+ public class PsychlopsMain\r
+ {\r
+ Canvas cnvs;\r
+ Rectangle[] rect;\r
+ int n;\r
+\r
+ public void psychlops_main()\r
+ {\r
+ n = 1;\r
+ cnvs = new Canvas(500, 500);\r
+ rect = new Rectangle[n];\r
+ for (int i = 0; i < n; i++)\r
+ {\r
+ rect[i] = new Rectangle(10, 10);\r
+ rect[i].fill = Color.red;\r
+ }\r
+ Interval rng = new Interval();\r
+ var slider = new Psychlops.Widgets.Slider("Label", -100 <= rng <= 100);\r
+\r
+ while (true)\r
+ {\r
+ cnvs.clear();\r
+ for (int i = 0; i < n; i++)\r
+ {\r
+ rect[i].centering().shift(slider * i*3, i*3).draw();\r
+ }\r
+ cnvs.flip();\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+*/\r
+\r
+/*\r
using Psychlops;\r
\r
namespace PsychlopsSilverlight4test\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" >\r
-<!-- saved from url=(0014)about:internet -->\r
-<head>\r
- <title>PsychlopsSilverlight4test</title>\r
- <style type="text/css">\r
- html, body {\r
- height: 100%;\r
- overflow: auto;\r
- }\r
- body {\r
- padding: 0;\r
- margin: 0;\r
- }\r
- #silverlightControlHost {\r
- height: 100%;\r
- text-align:center;\r
- }\r
- </style>\r
- \r
- <script type="text/javascript">\r
- function onSilverlightError(sender, args) {\r
- var appSource = "";\r
- if (sender != null && sender != 0) {\r
- appSource = sender.getHost().Source;\r
- }\r
- \r
- var errorType = args.ErrorType;\r
- var iErrorCode = args.ErrorCode;\r
-\r
- if (errorType == "ImageError" || errorType == "MediaError") {\r
- return;\r
- }\r
-\r
- var errMsg = "Silverlight アプリケーションでハンドルされていないエラーが発生しまし " + appSource + "\n" ;\r
-\r
- errMsg += "コード: "+ iErrorCode + " \n";\r
- errMsg += "カテゴリ: " + errorType + " \n";\r
- errMsg += "メッセージ: " + args.ErrorMessage + " \n";\r
-\r
- if (errorType == "ParserError") {\r
- errMsg += "ファイル: " + args.xamlFile + " \n";\r
- errMsg += "行: " + args.lineNumber + " \n";\r
- errMsg += "位置: " + args.charPosition + " \n";\r
- }\r
- else if (errorType == "RuntimeError") { \r
- if (args.lineNumber != 0) {\r
- errMsg += "行: " + args.lineNumber + " \n";\r
- errMsg += "位置: " + args.charPosition + " \n";\r
- }\r
- errMsg += "メソッド名: " + args.methodName + " \n";\r
- }\r
-\r
- throw new Error(errMsg);\r
- }\r
- </script>\r
-</head>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> \r
+<html> \r
+ <head> \r
+ \r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+ <meta http-equiv="Content-Style-Type" content="text/css" />\r
+\r
+ <link rel="stylesheet" href="./css/import.css" type="text/css" media="screen,print" />\r
+ <link rel="stylesheet" href="./css/jquery.lightbox-0.5.css" type="text/css" media="screen" />\r
+<link rel="stylesheet" href="./css/tipTip.css" type="text/css" /> \r
+\r
+ <script type="text/javascript" src="./js/raphael-min.js"></script> \r
+ <script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script>\r
+\r
+ <script type="text/javascript" src="./js_basic/jquery-ui-1.8.2.custom.min.js"></script>\r
+\r
+\r
+ <script type="text/javascript" src="./js/loadJSON.js"></script>\r
+\r
+ <script type="text/javascript" src="./js/buttonFunction.js"></script>\r
+ <script type="text/javascript" src="./js/jquery.rollover.js"></script>\r
+\r
+ <script type="text/javascript" src="./js/jquery.tipTip.js"></script> \r
+\r
+ <script type="text/javascript" src="./js/setPos.js"></script>\r
+ <script type="text/javascript" src="./js/createNode.js"></script>\r
+ <script type="text/javascript" src="./js/createVoronoi.js"></script>\r
+\r
+ <script type="text/javascript" src="./js/voronoi.js"></script>\r
+\r
+<script type="text/javascript" src="./js/jquery.tipTip.js"></script> \r
+\r
+\r
+ <script type="text/javascript" src="./js/jquery.cookie.js"></script> \r
+\r
+\r
+\r
+\r
+ <link type="text/css" href="./css_basic/south-street/jquery-ui-1.8.2.custom.css" rel="stylesheet" />\r
+ <script type="text/javascript" src="./js_basic/fg.menu.js"></script>\r
+ <link type="text/css" href="./css_basic/fg.menu.css" rel="stylesheet" />\r
+ <script type="text/javascript" src="./js_basic/jQuery.spinTheWheel.js"></script>\r
+ <script type="text/javascript" src="./js_basic/jquery.highlight-3.js"></script>\r
+\r
+ <script type="text/javascript" src="./js_basic/prettify/prettify.js"></script>\r
+\r
+ <script type="text/javascript" src="./js_basic/silverlight_host.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="./css_basic/silverlight_host.css" media="all">\r
+\r
+ <script type="text/javascript" src="./js_basic/basiccode.js"></script>\r
+ <script type="text/javascript" src="./js_basic/basiccode_function_highlighter.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="./css_basic/basiccode.css" media="all">\r
+\r
+\r
+\r
+\r
+ <script type="text/javascript">\r
+<!--\r
+ var naviwidth = 200;\r
+ var naviheight = 800;\r
+\r
+\r
+ //professionalにリンクするかどうかの判断するため、jsonのデータから情報を得るためのID\r
+ var currentselectedID = "basiccode_step1";\r
+\r
+ //JSONからデータを利用するためindex\r
+ var currentselectedIndex;\r
+\r
+ //このデモとかかわりのあるlibrarys.jsonのインデックスを格納する配列\r
+ var professionalIndexs = new Array();\r
+\r
+ //library.jsonから読み込んだデータを格納する配列\r
+ var librarys;\r
+\r
+ //JSONデータをひとまとめにした配列\r
+ var nodedatas;\r
+\r
+ //現在開いているページのカテゴリのJSONデータを格納する配列\r
+ var currentselectedCategory;\r
+\r
+\r
+ var lang = "jp";\r
+\r
+ if (window.location.search.length != 0) {\r
+ var temppath = window.location.search.substring(1);\r
+\r
+ //lang取得\r
+ if (temppath != null) {\r
+ var templang = temppath.split('=');\r
+ if (templang[0] == "lang" && templang[1] == "en") {\r
+ lang = "en";\r
+ }\r
+ }\r
+ }\r
+\r
+\r
+\r
+\r
+ //JSONを読み込み、処理を開始\r
+ window.onload = function () {\r
+ loadParams('./json/library.json', callbackFunc);\r
+ }\r
+\r
+ function callbackFunc(params) {\r
+ librarys = params.library;\r
+ loadParams('./json/datas.json', callbackFunc1);\r
+ }\r
+\r
+\r
+\r
+ function callbackFunc1(params) {\r
+\r
+ currentselectedCategory = params.articles;\r
+\r
+ //現在開いているページのIDから、data.jsonの配列インデックスを取得\r
+ for (i = 0; i < currentselectedCategory.length; i++) {\r
+ if (currentselectedCategory[i].id == currentselectedID) currentselectedIndex = i;\r
+ }\r
+\r
+\r
+ var paper = Raphael("navi", naviwidth, naviheight);\r
+\r
+ //カテゴリ別に分けられたJSONのデータをひとまとめにする\r
+ var nodedatas = new Array();\r
+ for (i = 0; i < params.visiondemo.length; i++) { nodedatas.push(params.visiondemo[i]); }\r
+ for (i = 0; i < params.blogparts.length; i++) { nodedatas.push(params.blogparts[i]); }\r
+ for (i = 0; i < params.articles.length; i++) { nodedatas.push(params.articles[i]); }\r
+\r
+\r
+ //位置を生成\r
+ var posdatas = setPos(nodedatas.length, naviwidth - 100, naviheight - 200, 50, 160);\r
+\r
+\r
+ //母点を生成\r
+ var generatrices_data = createNode(nodedatas, posdatas, naviwidth, naviheight, paper, lang);\r
+\r
+ //ボロノイを生成\r
+ var lines = setVoronoi(posdatas, naviwidth, naviheight);\r
+ for (n = 0; n < lines.length; n++) {\r
+ pa = paper.path("M" + lines[n].sx + " " + lines[n].sy + " L" + lines[n].ex + " " + lines[n].ey);\r
+\r
+ pa.attr({ "stroke-width": "0.8" });\r
+ pa.attr({ "stroke": "#9D95A4" });\r
+ pa.attr({ "opacity": "0.8" });\r
+ }\r
+\r
+\r
+ var flgx = 88;\r
+ var flgy = 54;\r
+ flg = paper.image("./img/currentpos.png", flgx, 0, 25, 77);\r
+\r
+\r
+\r
+ //言語を切り替える時に使う\r
+ url = currentselectedCategory[currentselectedIndex].url;\r
+\r
+\r
+ $('#header').html(\r
+ '<span class="highlight"><a href="./index.html"><img id="smalllogo" src="./img/logo_small.png" /></a></span>'\r
+\r
+ + '<div style="text-align:right; float:right;" >'\r
+ + '<img id="japanese" src="./img/japanese.png" onclick="buttonJP(url,0)" />'\r
+ + '<img id="english" src="./img/english.png" onclick="buttonEN(url,0)"/>'\r
+ + '</div>'\r
+ + '<div class="space30px"></div>'\r
+ + '<h1>Library</h1>'\r
+ );\r
+\r
+ $('#tutoriallink1').html(\r
+ "<a href='./basiccode_step1.html?lang=" + lang + "'>"\r
+ + "<img src='./img/articles/basiccode01.jpg' />"\r
+ + "</a>"\r
+ );\r
+\r
+ $('#tutoriallink2').html(\r
+ "<a href='./basiccode_step2.html?lang=" + lang + "'>"\r
+ + "<img src='./img/articles/basiccode02.jpg' />"\r
+ + "</a>"\r
+ );\r
+\r
+\r
+ setButton(lang);\r
+\r
+ $('.highlight a img').rollover();\r
+\r
+ if (lang == "en") {\r
+ $("#japanese").hover(function () {\r
+ $(this).css("cursor", "pointer");\r
+ }, function () {\r
+ $(this).css("cursor", "default");\r
+ });\r
+ }\r
+\r
+ if (lang == "jp") {\r
+ $("#english").hover(function () {\r
+ $(this).css("cursor", "pointer");\r
+ }, function () {\r
+ $(this).css("cursor", "default");\r
+ });\r
+ }\r
+ }\r
+\r
+\r
+ $(document).ready(function () {\r
+ $(".tooltip").tipTip({\r
+ maxWidth: "auto",\r
+ edgeOffset: 0,\r
+ fadeIn: 0,\r
+ activation: "hover", //click\r
+ defaultPosition: "top"\r
+ });\r
+ });\r
+\r
+//-->\r
+ </script>\r
+\r
+ </head>\r
+\r
<body>\r
- <form id="parameters">\r
- <input type="text" size="10" id="TheInput" />\r
- </form>\r
-\r
- <form id="form1" runat="server" style="height:60%">\r
- <div id="silverlightControlHost">\r
- <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">\r
- <param name="source" value="Bin/Debug/PsychlopsSilverlight4test.xap"/>\r
- <param name="onError" value="onSilverlightError" />\r
- <param name="background" value="white" />\r
- <param name="minRuntimeVersion" value="3.0.40624.0" />\r
- <param name="autoUpgrade" value="true" />\r
- <param name="enableHtmlAccess" value="true" />\r
- <param name="enableGPUAcceleration" value="false" />\r
- <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">\r
- <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Microsoft Silverlight を入手" style="border-style:none"/>\r
- </a>\r
- </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>\r
- </form>\r
+<div id="wrapper">\r
+\r
+ <div id="navi">\r
+ <!-- #navi --></div>\r
+ \r
+ <div id="contents">\r
+\r
+ <div id="header"></div>\r
+\r
+\r
+ <div id="title"><h2>Basic Code Step1 </h2></div>\r
+\r
+ <div class="space30px"></div>\r
+\r
+ <div id="codecontents">\r
+ \r
+ <div id="code" style="float:left; width:400px;">\r
+\r
+<pre id="main_code" class="main prettyprint cpp">\r
+///+ Prefix\r
+//// Lines for set up Psychlops environment\r
+#include <psychlops.h>\r
+using namespace Psychlops;\r
+///- Prefix\r
+ \r
+///+ Main Routine\r
+//// Psychlops runs at the first line of this function psychlops_main().\r
+void psychlops_main() {\r
+ ///+ 1\r
+ //// Set a window for drawing stimulus\r
+ Canvas window(Canvas::window); //Create a window. Here, window variables are preset mode.\r
+ // You can write this statement as" Canvas window(Canvas::fullscreen); " for fullscreen mode\r
+ // or as " Canvas window(1024, 768, 32, 60.0); " This statement changes screenmode to 1024 x 768, 32bit color, 60 Hz refresh.\r
+ ///- 1\r
+ \r
+ ///+ 2\r
+ //// Set a figure size, position and color.\r
+ Psychlops::Rectangle/*ID:FIGURE selector Rectangle Ellipse*/ figure; //Create a figure (Rectangle or Ellipse) variable.\r
+ \r
+ figure.set( 100/*ID:SIZE_X 1 200 10*/, 100/*ID:SIZE_Y 1 200 10*/ ); // Set the size of figure.\r
+ figure.centering(); // Centering the figure in the window\r
+ figure.shift( 10/*ID:SHIFT_X -100 100 10*/, 10/*ID:SHIFT_Y -100 100 10*/ ); // Displacing the figure by designated vector. \r
+ figure.draw( Color( 1.0/*ID:COLOR_R 0 1.0 0.1*/, 0.0/*ID:COLOR_G 0.0 1.0 0.1*/, 0.0/*ID:COLOR_B 0 1.0 0.1*/) ); // Drawing the rectangle with a designated color.\r
+ \r
+ window.flip(); // Reflect the drawing for the display by flipping frame buffers.\r
+ // Till this point, you will not see drawn figures.\r
+ ///- 2\r
+ \r
+ ///+ 3 \r
+ //// Detect a Keyboard input\r
+ while(!Keyboard::esc.pushed()) {} //exit a program when the escape key is pressed down.\r
+ ///- 3\r
+ \r
+}\r
+///- Main Routine\r
+\r
+</pre>\r
+\r
+ <!-- #code --></div>\r
+\r
+\r
+ <div id="window" style="float:left; width:200px; height:300px; ">\r
+ <div class="desc_child"><span id="xap">Bin/Debug/PsychlopsSilverlight4test.xap</span></div>\r
+ </div>\r
+\r
+ <!-- #codecontents --></div>\r
+\r
+ <div class="clearfix"></div>\r
+\r
+\r
+ <div style="text-align:right;">\r
+ <a class="txt" style="margin-right:200px;" href="./basiccode_step2.html">Next Step>></a>\r
+ </div>\r
+\r
+ <div class="space40px"></div>\r
+ \r
+ <div id="comment">\r
+ 上記の文字は<b>Psychlopsのコード</b>です。そしてコードの実行結果はコード右のウィンドウに表示されています。<br />\r
+ コード内の<b>太文字をクリック</b>するとマウス操作で値を変えることができ、結果がすぐに反映されます。\r
+ また、コード内の<b>青い文字をロールオーバ</b>すると、ポップアップで説明が現れます。\r
+ <!-- #comment --></div>\r
+\r
+</div>\r
+<!-- #wrapper --></div>\r
</body>\r
</html>\r