home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / Gnuplot / Source / Status.h < prev    next >
Encoding:
Text File  |  1993-03-18  |  6.4 KB  |  226 lines

  1.  
  2. /* $Id: Status.h,v 1.1.1.1 1993/03/18 03:35:25 davis Exp $ */
  3.  
  4. #import <objc/List.h>
  5. #import <objc/Object.h>
  6.  
  7. #import <streams/streams.h>
  8.  
  9. #import "DoubleValueSortedList.h"
  10.  
  11. #define    X_TAG    0
  12. #define    Y_TAG    1
  13. #define    Z_TAG    2
  14. #define    R_TAG    3
  15. #define ANGLES_RADIANS        0
  16. #define ANGLES_DEGREES        1
  17. #define TIC_COMPUTED        1    /* default; gnuplot calcs them    */
  18. #define TIC_SERIES        2    /* user-defined series        */
  19. #define TIC_USER        3    /* user-defined points        */
  20. #define CONTOUR_KIND_LINEAR     0
  21. #define CONTOUR_KIND_CUBIC_SPL  1
  22. #define CONTOUR_KIND_BSPLINE    2
  23.  
  24.  
  25. @interface Status:Object
  26. {
  27.     NXZone *zone;        /* Our zone                */
  28.     id delegate;        /* Whom to inform if settings change    */
  29.  
  30.     BOOL report;        /* Report setting changes to delegate?    */
  31.  
  32.     char *text;            /* Command text that we pass to gnuplot    */
  33.     NXStream *s_epsStream;    /* Term writes EPS to this stream    */
  34.  
  35.     /*** Settings ***/
  36.  
  37.     BOOL isThreeD;        /* Is this a 3D plot (or just 2D)?    */
  38.     BOOL s_parametric;        /* Is this a parametric plot?        */
  39.     BOOL s_polar;        /* Is this a polar plot?        */
  40.     BOOL s_border;        /* Does it have a border?        */
  41.     BOOL s_draw_surface;    /* Should we show the surface?        */
  42.     BOOL contourBase;        /* Should a contour appear on the base?    */
  43.     BOOL contourSurface;    /* Should a contour appear on the surf?    */
  44.     int s_contour_kind;        /* Type of contour            */
  45.     int s_contour_pts;        /* Contour points            */
  46.     int s_contour_order;
  47.     BOOL s_label_contours;
  48.  
  49.     BOOL s_grid;        /* Does it have a grid?            */
  50.     BOOL s_xzeroaxis;        /* Should we show the x-zeroaxis?    */
  51.     BOOL s_yzeroaxis;        /* Should we show the y-zeroaxis?    */
  52.  
  53.     BOOL s_tics_in;        /* Should the tics be in (or out)?    */
  54.     BOOL s_ticsCoord[3];    /* Should the axis have tics at all?    */
  55.     int  s_ticTypeCoord[3];    /* What type tics does the coord use?    */
  56.     struct _ticSeries {
  57.     double start, incr, end;
  58.     } s_ticSeriesCoord[3];    /* Tics Series parameters        */
  59.     DoubleValueSortedList *ticDefs[3];    /* Custom, user-defined tics    */
  60.  
  61.     BOOL s_isLogCoord[3];    /* Is this axis a log scale?        */
  62.  
  63.     char *s_title;        /* Plot title                */
  64.     char *s_labelCoord[3];    /* Labels for the axes            */
  65.  
  66.     int s_fontsize;        /* Font size in points            */
  67.     char *s_font;        /* Font string. Example: "Times-Roman"    */
  68.  
  69.     BOOL s_key;            /* Is there a key?            */
  70.     BOOL s_key_default;        /* Would a key be in the default loc.?    */
  71.     double s_keyCoord[3];    /* Location of the key if not default    */
  72.  
  73.     BOOL s_time;        /* Should we show the time/date?    */
  74.     BOOL s_time_default;    /* Should time/date be in default loc.?    */
  75.     int s_timeCoord[3];        /* Location of time/date if not default    */
  76.  
  77.     BOOL sizeProp;        /* Should we keep x & y proportional?    */
  78.     float s_xsize, s_ysize;    /* Size of the plot            */
  79.     int s_samples;        /* Number of samples per function plot    */
  80.     int s_samplesCoord[2];
  81.     int s_iso_samplesCoord[2];
  82.  
  83.     BOOL s_hidden3d;        /* Are the hidden lines removed?    */
  84.  
  85.     float s_rotCoord[3];    /* How the 3D view is rotated        */
  86.  
  87.     BOOL s_autoscaleCoord[4];    /* Are we autoscaling?            */
  88.  
  89.     double s_minCoord[4];    /* Axis Ranges                */
  90.     double s_maxCoord[4];
  91.  
  92.     char *s_dummy_var[2];    /* Dummy vars for functions        */
  93.  
  94.     BOOL degrees;        /* Are ranges in degrees? (Or radians?)    */
  95.  
  96.     char *s_plotargs;        /* Arguments for a plot command        */
  97.     List *functions;        /* List of FunctionObjects, which store    */
  98.                 /* info about functions (titles, style)    */
  99.  
  100.     char *appendix;        /*
  101.                  *  Appendix is a postamble where we 
  102.                  *  can put newline-separated Gnuplot 
  103.                  *  commands that will override any of 
  104.                  *  the settings.  We use it to 
  105.                  *  process the text read from a file, 
  106.                  *  before we've had a chance to set 
  107.                  *  the instance variables.
  108.                  */
  109.  
  110.     BOOL areSettingsEdited;    /* Do the plotargs and text need to be    */
  111.                 /* rebuilt?                */
  112. }
  113.  
  114. + lastplot;
  115. + setHalvePlot:(BOOL)condition;
  116.  
  117. - init;
  118. - free;
  119.  
  120. - setReport:(BOOL)cond;
  121. - (BOOL)report;
  122.  
  123. - setDelegate: anObject;
  124. - delegate;
  125.  
  126. - (NXStream *)stream;
  127.  
  128. - plot;                    /* Plot current settings    */
  129. - (BOOL)canPlot;            /* Can we plot current settings    */
  130.  
  131. - saveToFile:(const char *)filename;    /* Save current settings    */
  132. - reportSettingsChange:sender;        /* Inform delegate of change    */
  133. - resetCurrent;                /* Reset settings to defaults    */
  134. - applyCurrent;                /* Set gnuplot vars from ours    */
  135. - applyCurrentTicDefs;            /* Set gnuplot ticdefs from ours*/
  136. - grabCurrent;                /* Set our vars from gnuplot's    */
  137. - grabCurrentTicDefs;            /* Set our ticdefs        */
  138. - grabFunctionsFrom: (char *) aString;    /* aString is the plot command    */
  139.  
  140. - setThreeD:(BOOL) aCondition;        /* Setting instance variables    */
  141. - (BOOL) isThreeD;
  142. - setParametric:(BOOL) cond;
  143. - (BOOL) parametric;
  144. - setPolar:(BOOL) cond;
  145. - (BOOL) isPolar;
  146. - setBorder:(BOOL) cond;
  147. - (BOOL) border;
  148. - setSurface:(BOOL) cond;
  149. - (BOOL) surface;
  150.  
  151. - setHiddenThreeD:(BOOL) cond;
  152. - (BOOL) hiddenThreeD;
  153. - setGrid:(BOOL) cond;
  154. - (BOOL) grid;
  155. - setAxisX:(int) anInt;
  156. - (int) axisX;
  157. - setAxisY:(int) anInt;
  158. - (int) axisY;
  159.  
  160. - setIsLogCoord:(int)coord isOn:(BOOL)isOn;
  161. - (BOOL)isLogCoord:(int)coord;
  162.  
  163. - setTitle:(const char *) aString;
  164. - (const char *) title;
  165. - setLabelCoord:(int)coord to:(const char *) aString;
  166. - (const char *) labelCoord:(int) coord;
  167.  
  168. - setDummyVar:(int)coord to:(const char *)aString;
  169. - (const char *)dummyVar:(int)coord;
  170.  
  171. - setAppendix:(const char *) aString;
  172.  
  173. - setFontsize:(int) anInt;
  174. - (int) fontsize;
  175. - setFontname:(const char *) aString;
  176. - (const char *) fontname;
  177. - setFont:aFont;        /* Sets fontname and fontsize from aFont */
  178. - font;                /* Returns a Font object */
  179.  
  180. - setKey:(BOOL) cond;
  181. - (BOOL) key;
  182. - setKeyDefault: (BOOL) cond;
  183. - (BOOL) keyDefault;
  184. - setKeyCoord:(int)coord to:(double)aDouble;
  185. - (double) keyCoord:(int)coord;
  186.  
  187. - setTime:(BOOL) cond;
  188. - (BOOL) time;
  189. - setTimeDefault: (BOOL) cond;
  190. - (BOOL) timeDefault;
  191. - setTimeCoord:(int)coord to:(int)anInt;
  192. - (int) timeCoord:(int)coord;
  193.  
  194. - setSizeProp:(BOOL) cond;
  195. - (BOOL) sizeProp;
  196. - setSizeX:(float) xFloat Y:(float) yFloat;
  197. - (float) sizeX;
  198. - (float) sizeY;
  199.  
  200. - setRotCoord:(int)coord to:(float)aFloat;
  201. - resetRotation;
  202. - (float)rotCoord:(int)coord;
  203.  
  204. - setSamplesCoord:(int)coord to:(int) anInt;
  205. - (int) samples:(int)coord;
  206.  
  207. - setIsoSamplesCoord:(int)coor to:(int) anInt;
  208. - (int) isoSamples:(int)coord;
  209.  
  210. - setAutoscaleCoord:(int)coord isOn:(BOOL)cond;
  211. - (BOOL)autoscaleCoord:(int)coord;
  212.  
  213. - setRangeCoord:(int)coord min:(double)min max:(double)max;
  214. - (double)minCoord:(int)coord;
  215. - (double)maxCoord:(int)coord;
  216.  
  217. - setDegrees:(BOOL) cond;
  218. - (BOOL)degrees;
  219.  
  220. - buildPlotargs;
  221. - (const char *) plotargs;
  222.  
  223. - (List *)functions;
  224.  
  225. @end
  226.