~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/draw/plot/plot.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <math.h>
  5 #include <tina/sys.h>
  6 #include <tina/math.h>
  7 #include <tina/tv.h>
  8 #include <tina/vision.h>
  9 #include <tina/draw.h>
 10 #include <tina/drawfuncs.h>
 11 
 12 void plot(int case_flag, ...)
 13 {
 14     va_list ap;
 15     va_start(ap, case_flag);
 16 
 17     while (case_flag)
 18     {
 19         switch (case_flag)
 20         {
 21             case PL_INIT:
 22                 pl_init();
 23                 break;
 24             case PL_FREE:
 25             {
 26                 Bool set = (Bool) va_arg(ap, int);
 27                 pl_free_set(set);
 28                 break;
 29             }
 30             case PL_TV:
 31             {
 32                 Tv *tv = (Tv *) va_arg(ap, void *);
 33                 pl_set_tv(tv);
 34                 break;
 35             }
 36             case PL_COLOR:
 37             {
 38                 int color = va_arg(ap, int);
 39                 pl_set_color(color);
 40                 break;
 41             }
 42             case PL_AXIS_COLOR:
 43             {
 44                 int color = va_arg(ap, int);
 45                 pl_set_axis_color(color);
 46                 break;
 47             }
 48             case PL_STYLE:
 49             {
 50                 int style = va_arg(ap, int);
 51                 pl_set_style(style);
 52                 break;
 53             }
 54             case PL_TITLE:
 55             {
 56                 char *title = va_arg(ap, char *);
 57                 pl_set_title(title);
 58                 break;
 59             }
 60             case PL_LEGEND:
 61             {
 62                 char *legend = va_arg(ap, char *);
 63                 pl_set_legend(legend);
 64                 break;
 65             }
 66             case PL_AXES:
 67             {
 68                 Bool set = (Bool) va_arg(ap, int);
 69                 pl_set_x_axis(set);
 70                 pl_set_y_axis(set);
 71             }
 72             break;
 73             case PL_TICS:
 74             {
 75                 Bool set = (Bool) va_arg(ap, int);
 76                 pl_set_x_tics(set);
 77                 pl_set_y_tics(set);
 78                 break;
 79             }
 80             case PL_TEXT:
 81             {
 82                 Bool set = (Bool) va_arg(ap, int);
 83                 pl_set_x_text(set);
 84                 pl_set_y_text(set);
 85                 break;
 86             }
 87             case PL_X_AXIS:
 88             {
 89                 Bool set = (Bool) va_arg(ap, int);
 90                 pl_set_x_axis(set);
 91                 break;
 92             }
 93             case PL_X_TICS:
 94             {
 95                 Bool set = (Bool) va_arg(ap, int);
 96                 pl_set_x_tics(set);
 97                 break;
 98             }
 99             case PL_X_TEXT:
100             {
101                 Bool set = (Bool) va_arg(ap, int);
102                 pl_set_x_text(set);
103                 break;
104             }
105             case PL_X_RANGE:
106             {
107                 double xmin = va_arg(ap, double);
108                 double xmax = va_arg(ap, double);
109                 double xinc = va_arg(ap, double);
110                 pl_set_x_range(xmin, xmax, xinc);
111                 break;
112             }
113             case PL_Y_AXIS:
114             {
115                 Bool set = (Bool) va_arg(ap, int);
116                 pl_set_y_axis(set);
117                 break;
118             }
119             case PL_Y_TICS:
120             {
121                 Bool set = (Bool) va_arg(ap, int);
122                 pl_set_y_tics(set);
123                 break;
124             }
125             case PL_Y_TEXT:
126             {
127                 Bool set = (Bool) va_arg(ap, int);
128                 pl_set_y_text(set);
129                 break;
130             }
131             case PL_Y_RANGE:
132             {
133                 double ymin = va_arg(ap, double);
134                 double ymax = va_arg(ap, double);
135                 double yinc = va_arg(ap, double);
136                 pl_set_y_range(ymin, ymax, yinc);
137                 break;
138             }
139             case PL_XFORMAT:
140             {
141                 char *fmt = va_arg(ap, char *);
142                 pl_xfmt_set(fmt);
143                 break;
144             }
145             case PL_YFORMAT:
146             {
147                 char *fmt = va_arg(ap, char *);
148                 pl_yfmt_set(fmt);
149                 break;
150             }
151             case PL_GRAPH_DATA:
152             {
153                 int n;
154                 float *x, *y;
155                 n = va_arg(ap, int);
156                 x = (float *) va_arg(ap, void *);
157                 y = (float *) va_arg(ap, void *);
158                 pl_set_graph_data(n, x, y);
159                 break;
160             }
161             case PL_SCATTER_DATA:
162             {
163                 int n = va_arg(ap, int);
164                 float *x = (float *) va_arg(ap, void *);
165                 float *y = (float *) va_arg(ap, void *);
166                 pl_set_scatt_data(n, x, y);
167                 break;
168             }
169             case PL_GRAPH_FUNC:
170             {
171                 int n = va_arg(ap, int);
172                 double a = va_arg(ap, double);
173                 double b = va_arg(ap, double);
174                 double (*f) () = (double (*) ()) va_arg(ap, void *);
175                 pl_set_graph_func(n, a, b, f);
176                 break;
177             }
178             case PL_HIST_RANGE:
179             {
180                 double zmin = va_arg(ap, double);
181                 double zmax = va_arg(ap, double);
182                 double zinc = va_arg(ap, double);
183                 pl_set_hist_range(zmin, zmax, zinc);
184                 break;
185             }
186             case PL_HIST_DATA:
187             {
188                 int n = va_arg(ap, int);
189                 float *z = (float *) va_arg(ap, void *);
190                 pl_set_hist_data(n, z);
191                 break;
192             }
193             case PL_HIST:
194             {
195                 void *h = va_arg(ap, void *);
196                 pl_set_hist_binned_data(h);
197                 break;
198             }
199             case PL_CUMHIST_DATA:
200             {
201                 int n = va_arg(ap, int);
202                 float *z = (float *) va_arg(ap, void *);
203                 pl_set_cumhist_data(n, z);
204                 break;
205             }
206             case PL_CTR_RANGE:
207             {
208                 double cmin = va_arg(ap, double);
209                 double cmax = va_arg(ap, double);
210                 double cinc = va_arg(ap, double);
211                 pl_set_ctr_range(cmin, cmax, cinc);
212                 break;
213             }
214             case PL_CTR_DATA:
215             {
216                 int nx = va_arg(ap, int);
217                 float *x = (float *) va_arg(ap, void *);
218                 int ny = va_arg(ap, int);
219                 float *y = (float *) va_arg(ap, void *);
220                 float **z = (float **) va_arg(ap, void *);
221                 pl_set_ctr_data(nx, x, ny, y, z);
222                 break;
223             }
224             case PL_CTR_FUNC:
225             {
226                 int nx = va_arg(ap, int);
227                 double ax = va_arg(ap, double);
228                 double bx = va_arg(ap, double);
229                 int ny = va_arg(ap, int);
230                 double ay = va_arg(ap, double);
231                 double by = va_arg(ap, double);
232                 double (*f) () = (double (*) ()) va_arg(ap, void *);
233                 pl_set_ctr_func(nx, ax, bx, ny, ay, by, f);
234                 break;
235             }
236             case PL_PLOT:
237                 pl_plot();
238                 break;
239         }
240         case_flag = va_arg(ap, int);
241     }
242     va_end(ap);
243 }
244 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.