OSDN Git Service

first
[psychlops/cpp.git] / psychlops / extension / standard / figure / psychlops_figure_visualization.h
1 /*
2  *  psychlops_figure_visualization.h
3  *  Psychlops Standard Library (Universal)
4  *
5  *  Last Modified 2009/10/05 by Kenchi HOSOKAWA
6  *  (C) 2009 Kenchi HOSOKAWA, Kazushi MARUYA, Takao SATO
7  */
8
9 #ifndef HEADER_PSYCHLOPS_FIGURE_VISUALIZATION
10 #define HEADER_PSYCHLOPS_FIGURE_VISUALIZATION
11
12 #include "../../../core/graphic/psychlops_g_fundamental.h"
13 #include "../../../psychlops_core.h"
14 #include <deque>
15
16
17 namespace Psychlops {
18 namespace Figures {
19
20
21         class XYPlot : public Rectangle {
22         protected:
23                 double Xpix(double x);
24                 double Ypix(double y);
25         public:
26                 double x_min, x_max, y_min, y_max;
27                 XYPlot();
28                 XYPlot(double wid, double hei);
29                 XYPlot(double wid, double hei, Interval x_a, Interval y_a);
30                 XYPlot& set(double wid, double hei);
31                 XYPlot& set(double wid, double hei, Interval x_a, Interval y_a);
32                 XYPlot& setInterval(Interval x_a, Interval y_a);
33         };
34
35         class FunctionalPlot : public XYPlot {
36         public:
37                 typedef double (*OneDimFun)(double);
38                 std::deque< OneDimFun > functions;
39                 FunctionalPlot();
40                 FunctionalPlot(double wid, double hei);
41                 FunctionalPlot& set(double wid, double hei);
42                 FunctionalPlot& append(OneDimFun fun);
43                 FunctionalPlot& draw(Drawable &target = *Drawable::prime);
44         };
45
46         class LinePlot : public XYPlot {
47         protected:
48                 std::deque< std::deque<double> > table;
49         public:
50                 LinePlot();
51                 LinePlot(double wid, double hei);
52                 LinePlot& set(double wid, double hei);
53                 void setTableSize(int n_seq, int n_elems);
54                 void push_pop(double x, int seq_index=0);
55                 LinePlot& draw(Drawable &target = *Drawable::prime);
56         };
57
58
59 }       /*      <- namespace Figure     */
60 }       /*      <- namespace Psycholops         */
61
62
63 #endif
64