--- ray/src/common/otypes.h 2003/02/25 02:47:21 2.9 +++ ray/src/common/otypes.h 2012/07/29 19:01:39 2.17 @@ -1,15 +1,29 @@ -/* RCSid $Id: otypes.h,v 2.9 2003/02/25 02:47:21 greg Exp $ */ +/* RCSid $Id: otypes.h,v 2.17 2012/07/29 19:01:39 greg Exp $ */ /* * otypes.h - defines for object types. */ +#ifndef _RAD_OTYPES_H_ +#define _RAD_OTYPES_H_ +#ifdef __cplusplus +extern "C" { +#endif -#include "copyright.h" - typedef struct { char *funame; /* function name */ int flags; /* type flags */ +#ifdef FUN_ARGLIST + int (*funp)(FUN_ARGLIST); /* pointer to function */ +#else int (*funp)(); /* pointer to function */ +#endif } FUN; + +#ifdef FUN_ARGLIST +extern int o_default(FUN_ARGLIST); +#else +extern int o_default(); /* XXX conflict with radogl.h */ +#endif + /* object types in decreasing frequency */ #define OBJ_FACE 0 /* polygon */ #define OBJ_CONE 1 /* cone */ @@ -21,46 +35,50 @@ typedef struct { #define OBJ_CUP 7 /* inverted cone */ #define OBJ_BUBBLE 8 /* inverted sphere */ #define OBJ_TUBE 9 /* inverted cylinder */ -#define MAT_PLASTIC 10 /* plastic surface */ -#define MAT_METAL 11 /* metal surface */ -#define MAT_GLASS 12 /* thin glass surface */ -#define MAT_TRANS 13 /* translucent material */ -#define MAT_DIELECTRIC 14 /* dielectric material */ -#define MAT_PLASTIC2 15 /* anisotropic plastic */ -#define MAT_METAL2 16 /* anisotropic metal */ -#define MAT_TRANS2 17 /* anisotropic translucent material */ -#define MAT_INTERFACE 18 /* dielectric interface */ -#define MAT_PFUNC 19 /* plastic brdf function */ -#define MAT_MFUNC 20 /* metal brdf function */ -#define PAT_BFUNC 21 /* brightness function */ -#define PAT_BDATA 22 /* brightness data */ -#define PAT_BTEXT 23 /* monochromatic text */ -#define PAT_CPICT 24 /* color picture */ -#define MAT_GLOW 25 /* proximity light source */ -#define OBJ_SOURCE 26 /* distant source */ -#define MAT_LIGHT 27 /* primary light source */ -#define MAT_ILLUM 28 /* secondary light source */ -#define MAT_SPOT 29 /* spot light source */ -#define MAT_MIST 30 /* mist medium */ -#define MAT_MIRROR 31 /* mirror (secondary source) */ -#define MAT_TFUNC 32 /* trans brdf function */ -#define MAT_BRTDF 33 /* brtd function */ -#define MAT_PDATA 34 /* plastic brdf data */ -#define MAT_MDATA 35 /* metal brdf data */ -#define MAT_TDATA 36 /* trans brdf data */ -#define PAT_CFUNC 37 /* color function */ -#define MAT_CLIP 38 /* clipping surface */ -#define PAT_CDATA 39 /* color data */ -#define PAT_CTEXT 40 /* colored text */ -#define TEX_DATA 41 /* surface texture data */ -#define MIX_FUNC 42 /* mixing function */ -#define MIX_DATA 43 /* mixing data */ -#define MIX_TEXT 44 /* mixing text */ -#define MIX_PICT 45 /* mixing picture */ -#define MAT_DIRECT1 46 /* unidirecting material */ -#define MAT_DIRECT2 47 /* bidirecting material */ +#define OBJ_MESH 10 /* mesh instance */ +#define MOD_ALIAS 11 /* modifier alias */ +#define MAT_PLASTIC 12 /* plastic surface */ +#define MAT_METAL 13 /* metal surface */ +#define MAT_GLASS 14 /* thin glass surface */ +#define MAT_TRANS 15 /* translucent material */ +#define MAT_DIELECTRIC 16 /* dielectric material */ +#define MAT_PLASTIC2 17 /* anisotropic plastic */ +#define MAT_METAL2 18 /* anisotropic metal */ +#define MAT_TRANS2 19 /* anisotropic translucent material */ +#define MAT_INTERFACE 20 /* dielectric interface */ +#define MAT_PFUNC 21 /* plastic brdf function */ +#define MAT_MFUNC 22 /* metal brdf function */ +#define PAT_BFUNC 23 /* brightness function */ +#define PAT_BDATA 24 /* brightness data */ +#define PAT_BTEXT 25 /* monochromatic text */ +#define PAT_CPICT 26 /* color picture */ +#define MAT_GLOW 27 /* proximity light source */ +#define OBJ_SOURCE 28 /* distant source */ +#define MAT_LIGHT 29 /* primary light source */ +#define MAT_ILLUM 30 /* secondary light source */ +#define MAT_SPOT 31 /* spot light source */ +#define MAT_MIST 32 /* mist medium */ +#define MAT_MIRROR 33 /* mirror (secondary source) */ +#define MAT_TFUNC 34 /* trans brdf function */ +#define MAT_BRTDF 35 /* BRTD function */ +#define MAT_BSDF 36 /* BSDF data file */ +#define MAT_PDATA 37 /* plastic brdf data */ +#define MAT_MDATA 38 /* metal brdf data */ +#define MAT_TDATA 39 /* trans brdf data */ +#define PAT_CFUNC 40 /* color function */ +#define MAT_CLIP 41 /* clipping surface */ +#define PAT_CDATA 42 /* color data */ +#define PAT_CTEXT 43 /* colored text */ +#define TEX_DATA 44 /* surface texture data */ +#define MIX_FUNC 45 /* mixing function */ +#define MIX_DATA 46 /* mixing data */ +#define MIX_TEXT 47 /* mixing text */ +#define MIX_PICT 48 /* mixing picture */ +#define MAT_DIRECT1 49 /* unidirecting material */ +#define MAT_DIRECT2 50 /* bidirecting material */ +#define MAT_ASHIKHMIN 51 /* Ashikhmin-Shirley BRDF material */ /* number of object types */ -#define NUMOTYPE 48 +#define NUMOTYPE 52 /* type flags */ #define T_S 01 /* surface (object) */ #define T_M 02 /* material */ @@ -85,6 +103,9 @@ extern FUN ofun[]; /* our type list */ #define isvolume(t) (ofun[t].flags & T_V) #define ismodifier(t) (!(ofun[t].flags & (T_S|T_V))) #define ismaterial(t) (ofun[t].flags & T_M) +#define ispattern(t) (ofun[t].flags & T_P) +#define istexture(t) (ofun[t].flags & T_T) +#define ismixture(t) (ofun[t].flags & T_X) #define islight(t) (ofun[t].flags & T_L) #define isvlight(t) (ofun[t].flags & T_LV) #define hasdata(t) (ofun[t].flags & (T_D|T_I)) @@ -92,7 +113,9 @@ extern FUN ofun[]; /* our type list */ #define hastext(t) (ofun[t].flags & T_E) #define isflat(t) ((t)==OBJ_FACE || (t)==OBJ_RING) -extern int o_default(); +#define ALIASKEY "alias" /* alias keyword */ +#define ALIASMOD "inherit" /* inherit target modifier */ + /* type list initialization */ #define INIT_OTYPE { { "polygon", T_S, o_default }, \ { "cone", T_S, o_default }, \ @@ -104,6 +127,8 @@ extern int o_default(); { "cup", T_S, o_default }, \ { "bubble", T_S, o_default }, \ { "tube", T_S, o_default }, \ + { "mesh", T_V, o_default }, \ + { ALIASKEY, 0, o_default }, \ { "plastic", T_M, o_default }, \ { "metal", T_M, o_default }, \ { "glass", T_M, o_default }, \ @@ -128,6 +153,7 @@ extern int o_default(); { "mirror", T_M|T_LV, o_default }, \ { "transfunc", T_M|T_F, o_default }, \ { "BRTDfunc", T_M|T_F, o_default }, \ + { "BSDF", T_M|T_D, o_default }, \ { "plasdata", T_M|T_D, o_default }, \ { "metdata", T_M|T_D, o_default }, \ { "transdata", T_M|T_D, o_default }, \ @@ -142,6 +168,11 @@ extern int o_default(); { "mixpict", T_X|T_I, o_default }, \ { "prism1", T_M|T_F|T_LV, o_default }, \ { "prism2", T_M|T_F|T_LV, o_default }, \ + { "ashik2", T_M|T_F, o_default }, \ } -#define ALIASID "alias" /* alias type identifier */ + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_OTYPES_H_ */