ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/mgvars.h
Revision: 1.2
Committed: Mon Jul 14 22:24:00 2003 UTC (20 years, 9 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 1.1: +16 -3 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Moved includes in headers out of "C" scope.

File Contents

# Content
1 /* RCSid: $Id: mgvars.h,v 1.1 2003/02/22 02:07:26 greg Exp $ */
2 /*
3 * mgvars.h - header file for graphing routines using variables.
4 *
5 * 6/23/86
6 *
7 * Greg Ward Larson
8 */
9 #ifndef _RAD_MGVARS_H_
10 #define _RAD_MGVARS_H_
11
12 #include <errno.h>
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /*
19 * Data arrays are used to store point data.
20 */
21
22 typedef struct {
23 int size; /* the size of the array */
24 float *data; /* pointer to the array */
25 } DARRAY;
26
27 /*
28 * Intermediate variables are not referenced
29 * directly by the program, but may be used
30 * for defining other variables.
31 */
32
33 typedef struct ivar {
34 char *name; /* the variable name */
35 char *dfn; /* its definition */
36 struct ivar *next; /* next in list */
37 } IVAR; /* an intermediate variable */
38
39 /*
40 * Variables are used for all graph parameters. The four variable
41 * types are: REAL, FUNCTION, STRING and DATA.
42 * Of these, only STRING and DATA must be interpreted by us; an
43 * expression parser will handle the rest.
44 */
45 /* standard variables */
46 #define FTHICK 0 /* frame thickness */
47 #define GRID 1 /* grid on? */
48 #define LEGEND 2 /* legend title */
49 #define OTHICK 3 /* origin thickness */
50 #define PERIOD 4 /* period of polar plot */
51 #define SUBTITLE 5 /* subtitle */
52 #define SYMFILE 6 /* symbol file */
53 #define TSTYLE 7 /* tick mark style */
54 #define TITLE 8 /* title */
55 #define XLABEL 9 /* x axis label */
56 #define XMAP 10 /* x axis mapping */
57 #define XMAX 11 /* x axis maximum */
58 #define XMIN 12 /* x axis minimum */
59 #define XSTEP 13 /* x axis step */
60 #define YLABEL 14 /* y axis label */
61 #define YMAP 15 /* y axis mapping */
62 #define YMAX 16 /* y axis maximum */
63 #define YMIN 17 /* y axis minimum */
64 #define YSTEP 18 /* y axis step */
65
66 #define NVARS 19 /* number of standard variables */
67
68 /* curve variables */
69 #define C 0 /* the curve function */
70 #define CCOLOR 1 /* the curve color */
71 #define CDATA 2 /* the curve data */
72 #define CLABEL 3 /* the curve label */
73 #define CLINTYPE 4 /* the curve line type */
74 #define CNPOINTS 5 /* number of curve points to plot */
75 #define CSYMSIZE 6 /* the curve symbol size */
76 #define CSYMTYPE 7 /* the curve symbol type */
77 #define CTHICK 8 /* the curve line thickness */
78
79 #define NCVARS 9 /* number of curve variables */
80
81 #define MAXCUR 8 /* maximum number of curves */
82
83 /* types */
84 #define REAL 1 /* floating point */
85 #define STRING 2 /* character array */
86 #define FUNCTION 3 /* function definition */
87 #define DATA 4 /* a set of real points */
88
89 /* flags */
90 #define DEFINED 01 /* variable is defined */
91
92 typedef struct {
93 char *name; /* the variable name */
94 short type; /* the variable type */
95 char *descrip; /* brief description */
96 unsigned short flags; /* DEFINED, etc. */
97 union {
98 char *s; /* STRING value */
99 DARRAY d; /* DATA value */
100 char *dfn; /* variable definition */
101 } v; /* value */
102 } VARIABLE; /* a variable */
103
104 extern IVAR *ivhead; /* the intermediate list */
105
106 extern VARIABLE gparam[NVARS]; /* the graph variables */
107 extern VARIABLE cparam[MAXCUR][NCVARS]; /* the curve variables */
108
109 extern VARIABLE *vlookup();
110
111 extern double varvalue(), funvalue();
112
113 #define mgclear(vname) undefine(vlookup(vname))
114
115
116 #ifdef __cplusplus
117 }
118 #endif
119 #endif /* _RAD_MGVARS_H_ */
120