2 //Psychlops Code Template
\r
3 // Please visit following web site to get sample codes.
\r
4 // http://psychlops.sourceforge.jp/ja/?StartCode
\r
5 // CodeDresser at following address is also available to view the code.
\r
6 // http://visitope.org/Tools/codedresser.html
\r
8 ///+ 0 Setup Psychlops Circumstances
\r
9 //// 0 Setup Psychlops Circumstances
\r
10 #include <psychlops.h>
\r
11 using namespace Psychlops;
\r
12 using namespace Psychlops::Utilities;
\r
13 // Psychlops Win32 1.5.4 / 20110810
\r
14 ///- 0 Setup Psychlops Circumstances
\r
16 //Widgets::Slider out_slider;
\r
18 void psychlops_main() {
\r
21 ///+ 1 Declaration /////////////////////////////////////////////////////////////
\r
24 AppState::createSynchronousProcess("echo hoge");
\r
25 //AppState::createSynchronousProcess("echo hoge", File::decodePath("%APP%text.txt"));
\r
26 AppState::createSynchronousProcess("D:\\Users\\hskwk\\Documents\\R\\R-2.11.0\\bin\\Rscript.exe -e 'print(pi)'");
\r
28 // declare default window and variables for its parameters
\r
29 Canvas cnvs(Canvas::window, Display::secondary);
\r
30 double CANVAS_FRAMENUM;
\r
31 int CANVAS_REFRESHRATE;
\r
32 Psychlops::Color DEFAULT_BG_COLOR;
\r
34 Figures::ShaderGaborAlpha gabor;
\r
35 Psychlops::Rectangle rect;
\r
36 Psychlops::Ellipse ell;
\r
38 std::wstring ws = StringToWString("hoge");
\r
40 //declare local variables around here
\r
42 ///- 1 Declaration /////////////////////////////////////////////////////////////
\r
44 ///+ 2 Initialization //////////////////////////////////////////////////////////
\r
45 //// 2 Initialization
\r
47 // Set initial values for local variables
\r
48 CANVAS_REFRESHRATE = cnvs.getRefreshRate();
\r
49 CANVAS_FRAMENUM = 0;
\r
50 DEFAULT_BG_COLOR.set(127.0/255.0,127.0/255.0,127.0/255.0,1.0); // default background color is 127/255 mid-gray
\r
51 Widgets::Slider slider0, slider1, slider2, slider3;
\r
52 Widgets::Slider sliders[5];
\r
57 slider1.link(a, 0<=rng<=100, 1, 10).setSize(100,20).shift(0,0);
\r
58 slider2.set(toString("150") + "Name2", 0<=rng<=100, 1, 10).shift(0,50);
\r
60 slider3.set("Name3", 0<=rng<=1, 0.125, 0.125).shift(50,100);
\r
62 sliders[1].link(a, "hoge", 0<=rng<=1, .2);
\r
63 sliders[1].area.set(20,100).centering().shift(100,0);
\r
65 //out_slider.setLabel("out_slider").shift(200,100);
\r
68 ell.set(200,100).centering().shift(200,200);
\r
69 ell.fill = Color::green;
\r
75 // Draw Offline images around here
\r
77 // Offline Movie calculation using Image array around here
\r
79 ///- 2 Initialization //////////////////////////////////////////////////////////
\r
81 ///+ 3 Drawing /////////////////////////////////////////////////////////////////
\r
83 while(!Input::get(Keyboard::esc)) {
\r
84 cnvs.clear(DEFAULT_BG_COLOR);
\r
95 // out_slider.draw();
\r
97 gabor.wavelength = slider2;
\r
98 gabor.centering().draw();
\r
100 ell.draw(Color::red);
\r
102 rect.centering().shift(0,20).draw(Color::red);
\r
108 ///- 3 Drawing /////////////////////////////////////////////////////////////////
\r