ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/otypes.h
Revision: 1.5
Committed: Fri Mar 30 09:58:33 1990 UTC (34 years, 1 month ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.4: +1 -0 lines
Log Message:
added test for volumetric objects (instance currently)

File Contents

# User Rev Content
1 greg 1.1 /* Copyright (c) 1986 Regents of the University of California */
2    
3     /* SCCSid "$SunId$ LBL" */
4    
5     /*
6     * otypes.h - defines for object types.
7     *
8     * 1/28/86
9     */
10    
11     typedef struct {
12     char *funame; /* function name */
13     int (*funp)(); /* pointer to function */
14     } FUN;
15     /* surface types */
16     #define OBJ_MIN 0
17     #define OBJ_SOURCE (OBJ_MIN+0) /* distant source */
18     #define OBJ_SPHERE (OBJ_MIN+1) /* sphere */
19     #define OBJ_BUBBLE (OBJ_MIN+2) /* inverted sphere */
20     #define OBJ_FACE (OBJ_MIN+3) /* polygon */
21     #define OBJ_CONE (OBJ_MIN+4) /* cone */
22     #define OBJ_CUP (OBJ_MIN+5) /* inverted cone */
23     #define OBJ_CYLINDER (OBJ_MIN+6) /* cylinder */
24     #define OBJ_TUBE (OBJ_MIN+7) /* inverted cylinder */
25     #define OBJ_RING (OBJ_MIN+8) /* disk */
26     #define OBJ_INSTANCE (OBJ_MIN+9) /* octree instance */
27     #define OBJ_CNT 10
28     /* material types */
29     #define MOD_MIN MAT_MIN
30     #define MAT_MIN (OBJ_MIN+OBJ_CNT)
31     #define MAT_LIGHT (MAT_MIN+0) /* primary light source */
32     #define MAT_ILLUM (MAT_MIN+1) /* secondary light source */
33 greg 1.4 #define MAT_GLOW (MAT_MIN+2) /* proximity light source */
34     #define MAT_SPOT (MAT_MIN+3) /* spot light source */
35     #define MAT_PLASTIC (MAT_MIN+4) /* plastic surface */
36     #define MAT_METAL (MAT_MIN+5) /* metal surface */
37     #define MAT_TRANS (MAT_MIN+6) /* translucent material */
38     #define MAT_DIELECTRIC (MAT_MIN+7) /* dielectric material */
39     #define MAT_INTERFACE (MAT_MIN+8) /* dielectric interface */
40     #define MAT_GLASS (MAT_MIN+9) /* thin glass surface */
41     #define MAT_CLIP (MAT_MIN+10) /* clipping surface */
42     #define MAT_CNT 11
43 greg 1.1 /* textures and patterns */
44     #define TP_MIN (MAT_MIN+MAT_CNT)
45     #define TEX_FUNC (TP_MIN+0) /* surface texture function */
46 greg 1.2 #define TEX_DATA (TP_MIN+1) /* surface texture data */
47     #define PAT_CFUNC (TP_MIN+2) /* color function */
48     #define PAT_BFUNC (TP_MIN+3) /* brightness function */
49     #define PAT_CPICT (TP_MIN+4) /* color picture */
50     #define PAT_CDATA (TP_MIN+5) /* color data */
51     #define PAT_BDATA (TP_MIN+6) /* brightness data */
52     #define PAT_CTEXT (TP_MIN+7) /* colored text */
53     #define PAT_BTEXT (TP_MIN+8) /* monochromatic text */
54     #define MIX_FUNC (TP_MIN+9) /* mixing function */
55     #define MIX_DATA (TP_MIN+10) /* mixing data */
56     #define MIX_TEXT (TP_MIN+11) /* mixing text */
57     #define TP_CNT 12
58 greg 1.1 #define MOD_CNT (MAT_CNT+TP_CNT)
59     /* number of object types */
60     #define NUMOTYPE (OBJ_CNT+MAT_CNT+TP_CNT)
61    
62     #define issurface(t) ((t) >= OBJ_MIN && (t) < OBJ_MIN+OBJ_CNT)
63 greg 1.5 #define isvolume(t) ((t) == OBJ_INSTANCE)
64 greg 1.1 #define ismodifier(t) ((t) >= MOD_MIN && (t) < MOD_MIN+MOD_CNT)
65     #define ismaterial(t) ((t) >= MAT_MIN && (t) < MAT_MIN+MAT_CNT)
66     #define istexture(t) ((t) >= TP_MIN && (t) < TP_MIN+TP_CNT)
67    
68     extern int o_source();
69     extern int o_sphere();
70     extern int o_face();
71     extern int o_cone();
72     extern int o_instance();
73     extern int m_light();
74     extern int m_normal();
75     extern int m_dielectric();
76     extern int m_glass();
77     extern int m_clip();
78 greg 1.2 extern int t_func(), t_data();
79 greg 1.1 extern int p_cfunc(), p_bfunc();
80     extern int p_pdata(), p_cdata(), p_bdata();
81     extern int mx_func(), mx_data();
82     extern int text();
83    
84     #define INIT_OTYPE { { "source", o_source }, \
85     { "sphere", o_sphere }, \
86     { "bubble", o_sphere }, \
87     { "polygon", o_face }, \
88     { "cone", o_cone }, \
89     { "cup", o_cone }, \
90     { "cylinder", o_cone }, \
91     { "tube", o_cone }, \
92     { "ring", o_cone }, \
93     { "instance", o_instance }, \
94     { "light", m_light }, \
95     { "illum", m_light }, \
96     { "glow", m_light }, \
97 greg 1.4 { "spotlight", m_light }, \
98 greg 1.1 { "plastic", m_normal }, \
99     { "metal", m_normal }, \
100     { "trans", m_normal }, \
101     { "dielectric", m_dielectric }, \
102     { "interface", m_dielectric }, \
103     { "glass", m_glass }, \
104     { "antimatter", m_clip }, \
105     { "texfunc", t_func }, \
106 greg 1.2 { "texdata", t_data }, \
107 greg 1.1 { "colorfunc", p_cfunc }, \
108     { "brightfunc", p_bfunc }, \
109     { "colorpict", p_pdata }, \
110     { "colordata", p_cdata }, \
111     { "brightdata", p_bdata }, \
112     { "colortext", text }, \
113     { "brighttext", text }, \
114     { "mixfunc", mx_func }, \
115     { "mixdata", mx_data }, \
116     { "mixtext", text } }
117    
118     #define ALIASID "alias" /* alias type identifier */
119    
120     extern FUN ofun[];