comparison src/pt-plot.h @ 578:d169be9237fb

[project @ 1994-08-03 20:06:54 by jwe]
author jwe
date Wed, 03 Aug 1994 20:07:26 +0000
parents 2814c75c8398
children bc813f5eb025
comparison
equal deleted inserted replaced
577:91e2164fb1b2 578:d169be9237fb
27 #if defined (__GNUG__) 27 #if defined (__GNUG__)
28 #pragma interface 28 #pragma interface
29 #endif 29 #endif
30 30
31 class tree_command; 31 class tree_command;
32 class tree_plot_limits;
33 class tree_plot_range;
34 class tree_subplot;
35 class tree_subplot_using;
36 class tree_subplot_style;
37 class tree_subplot_list;
38 class tree_plot_command; 32 class tree_plot_command;
33 class plot_limits;
34 class plot_range;
35 class subplot_using;
36 class subplot_style;
37 class subplot;
38 class subplot_list;
39 39
40 class ostream; 40 class ostream;
41 41
42 #include <SLList.h>
43
42 #include "tree.h" 44 #include "tree.h"
43 45
44 class 46 class
45 tree_plot_command : public tree_command 47 tree_plot_command : public tree_command
46 { 48 {
47 public: 49 public:
48 tree_plot_command (void); 50 tree_plot_command (void);
49 tree_plot_command (tree_subplot_list *plt, int nd); 51 tree_plot_command (subplot_list *plt, int nd);
50 tree_plot_command (tree_subplot_list *plt, tree_plot_limits *rng, int nd); 52 tree_plot_command (subplot_list *plt, plot_limits *rng, int nd);
51 53
52 ~tree_plot_command (void); 54 ~tree_plot_command (void);
53 55
54 tree_constant eval (int print); 56 void eval (void);
55 57
56 private: 58 private:
57 int ndim; 59 int ndim;
58 tree_plot_limits *range; 60 plot_limits *range;
59 tree_subplot_list *plot_list; 61 subplot_list *plot_list;
60 }; 62 };
61 63
62 class 64 class
63 tree_subplot_list : public tree 65 plot_limits
64 { 66 {
65 public: 67 public:
66 tree_subplot_list (void); 68 plot_limits (void);
67 tree_subplot_list (tree_expression *data); 69 plot_limits (plot_range *xlim);
68 tree_subplot_list (tree_subplot_list *t); 70 plot_limits (plot_range *xlim, plot_range *ylim);
69 tree_subplot_list (tree_subplot_using *u, tree_expression *t, 71 plot_limits (plot_range *xlim, plot_range *ylim,
70 tree_subplot_style *s); 72 plot_range *zlim);
71 73
72 ~tree_subplot_list (void); 74 ~plot_limits (void);
73
74 tree_subplot_list *set_data (tree_expression *data);
75
76 tree_subplot_list *chain (tree_subplot_list *t);
77
78 tree_subplot_list *reverse (void);
79
80 tree_subplot_list *next_elem (void);
81
82 tree_constant eval (int print);
83
84 int print (int ndim, ostrstream& plot_buf);
85
86 private:
87 tree_expression *plot_data;
88 tree_subplot_using *using;
89 tree_expression *title;
90 tree_subplot_style *style;
91 tree_subplot_list *next;
92 };
93
94 class
95 tree_plot_limits : public tree
96 {
97 public:
98 tree_plot_limits (void);
99 tree_plot_limits (tree_plot_range *xlim);
100 tree_plot_limits (tree_plot_range *xlim, tree_plot_range *ylim);
101 tree_plot_limits (tree_plot_range *xlim, tree_plot_range *ylim,
102 tree_plot_range *zlim);
103
104 ~tree_plot_limits (void);
105
106 tree_constant eval (int print);
107 75
108 void print (int print, ostrstream& plot_buf); 76 void print (int print, ostrstream& plot_buf);
109 77
110 private: 78 private:
111 tree_plot_range *x_range; 79 plot_range *x_range;
112 tree_plot_range *y_range; 80 plot_range *y_range;
113 tree_plot_range *z_range; 81 plot_range *z_range;
114 }; 82 };
115 83
116 class 84 class
117 tree_plot_range : public tree 85 plot_range
118 { 86 {
119 public: 87 public:
120 tree_plot_range (void); 88 plot_range (void);
121 tree_plot_range (tree_expression *l, tree_expression *u); 89 plot_range (tree_expression *l, tree_expression *u);
122 90
123 ~tree_plot_range (void); 91 ~plot_range (void);
124
125 tree_constant eval (int print);
126 92
127 void print (ostrstream& plot_buf); 93 void print (ostrstream& plot_buf);
128 94
129 private: 95 private:
130 tree_expression *lower; 96 tree_expression *lower;
131 tree_expression *upper; 97 tree_expression *upper;
132 }; 98 };
133 99
134 class 100 class
135 tree_subplot_using : public tree 101 subplot_using
136 { 102 {
137 public: 103 public:
138 tree_subplot_using (void); 104 subplot_using (void);
139 tree_subplot_using (tree_expression *fmt); 105 subplot_using (tree_expression *fmt);
140 106
141 ~tree_subplot_using (void); 107 ~subplot_using (void);
142 108
143 tree_subplot_using *set_format (tree_expression *fmt); 109 subplot_using *set_format (tree_expression *fmt);
144 110
145 tree_subplot_using *add_qualifier (tree_expression *t); 111 subplot_using *add_qualifier (tree_expression *t);
146
147 tree_constant eval (int print);
148 112
149 int print (int ndim, int n_max, ostrstream& plot_buf); 113 int print (int ndim, int n_max, ostrstream& plot_buf);
150 114
151 private: 115 private:
152 int qualifier_count; 116 int qualifier_count;
153 tree_expression *x[4]; 117 tree_expression *x[4];
154 tree_expression *scanf_fmt; 118 tree_expression *scanf_fmt;
155 }; 119 };
156 120
157 class 121 class
158 tree_subplot_style : public tree 122 subplot_style
159 { 123 {
160 public: 124 public:
161 tree_subplot_style (void); 125 subplot_style (void);
162 tree_subplot_style (char *s); 126 subplot_style (char *s);
163 tree_subplot_style (char *s, tree_expression *lt); 127 subplot_style (char *s, tree_expression *lt);
164 tree_subplot_style (char *s, tree_expression *lt, tree_expression *pt); 128 subplot_style (char *s, tree_expression *lt, tree_expression *pt);
165 129
166 ~tree_subplot_style (void); 130 ~subplot_style (void);
167
168 tree_constant eval (int print);
169 131
170 int print (ostrstream& plot_buf); 132 int print (ostrstream& plot_buf);
171 133
172 private: 134 private:
173 char *style; 135 char *style;
174 tree_expression *linetype; 136 tree_expression *linetype;
175 tree_expression *pointtype; 137 tree_expression *pointtype;
138 };
139
140 class
141 subplot
142 {
143 public:
144 subplot (void)
145 {
146 plot_data = 0;
147 using = 0;
148 title = 0;
149 style = 0;
150 }
151
152 subplot (tree_expression *data)
153 {
154 plot_data = data;
155 using = 0;
156 title = 0;
157 style = 0;
158 }
159
160 subplot (subplot_using *u, tree_expression *t,
161 subplot_style *s)
162 {
163 plot_data = 0;
164 using = u;
165 title = t;
166 style = s;
167 }
168
169 ~subplot (void)
170 {
171 delete plot_data;
172 delete using;
173 delete title;
174 delete style;
175 }
176
177 void set_data (tree_expression *data)
178 { plot_data = data; }
179
180 int print (int ndim, ostrstream& plot_buf);
181
182 private:
183 tree_expression *plot_data;
184 subplot_using *using;
185 tree_expression *title;
186 subplot_style *style;
187 };
188
189 class
190 subplot_list : public SLList<subplot *>
191 {
192 public:
193 subplot_list (void) : SLList<subplot *> () { }
194 subplot_list (subplot *t) : SLList<subplot *> ()
195 { append (t); }
196
197 ~subplot_list (void)
198 {
199 while (! empty ())
200 {
201 subplot *t = remove_front ();
202 delete t;
203 }
204 }
176 }; 205 };
177 206
178 extern char *save_in_tmp_file (tree_constant& t, int ndim = 2, 207 extern char *save_in_tmp_file (tree_constant& t, int ndim = 2,
179 int parametric = 0); 208 int parametric = 0);
180 209