Back to index

radiance  4R0+20100331
initotypes.c
Go to the documentation of this file.
00001 #ifndef lint
00002 static const char RCSid[] = "$Id: initotypes.c,v 2.16 2007/10/08 18:07:57 greg Exp $";
00003 #endif
00004 /*
00005  * Initialize ofun[] list for renderers
00006  */
00007 
00008 #include  "copyright.h"
00009 
00010 #include  "ray.h"
00011 #include  "otypes.h"
00012 #include  "rtotypes.h"
00013 #include  "otspecial.h"
00014 
00015 
00016 FUN  ofun[NUMOTYPE] = INIT_OTYPE;
00017 
00018 
00019 extern void
00020 initotypes(void)                   /* initialize ofun array */
00021 {
00022        ofun[OBJ_SPHERE].funp =
00023        ofun[OBJ_BUBBLE].funp = o_sphere;
00024        ofun[OBJ_FACE].funp = o_face;
00025        ofun[OBJ_CONE].funp =
00026        ofun[OBJ_CUP].funp =
00027        ofun[OBJ_CYLINDER].funp =
00028        ofun[OBJ_TUBE].funp =
00029        ofun[OBJ_RING].funp = o_cone;
00030        ofun[OBJ_INSTANCE].funp = o_instance;
00031        ofun[OBJ_MESH].funp = o_mesh;
00032        ofun[MOD_ALIAS].funp = m_alias;
00033        ofun[MAT_LIGHT].funp =
00034        ofun[MAT_ILLUM].funp =
00035        ofun[MAT_GLOW].funp =
00036        ofun[MAT_SPOT].funp = m_light;
00037        ofun[MAT_LIGHT].flags |= T_OPAQUE;
00038        ofun[MAT_SPOT].flags |= T_OPAQUE;
00039        ofun[MAT_PLASTIC].funp =
00040        ofun[MAT_METAL].funp =
00041        ofun[MAT_TRANS].funp = m_normal;
00042        ofun[MAT_PLASTIC].flags |= T_OPAQUE;
00043        ofun[MAT_METAL].flags |= T_OPAQUE;
00044        ofun[MAT_TRANS].flags |= T_IRR_IGN;
00045        ofun[MAT_PLASTIC2].funp =
00046        ofun[MAT_METAL2].funp =
00047        ofun[MAT_TRANS2].funp = m_aniso;
00048        ofun[MAT_PLASTIC2].flags |= T_OPAQUE;
00049        ofun[MAT_METAL2].flags |= T_OPAQUE;
00050        ofun[MAT_TRANS2].flags |= T_IRR_IGN;
00051        ofun[MAT_DIELECTRIC].funp =
00052        ofun[MAT_INTERFACE].funp = m_dielectric;
00053        ofun[MAT_DIELECTRIC].flags |= T_IRR_IGN;
00054        ofun[MAT_INTERFACE].flags |= T_IRR_IGN;
00055        ofun[MAT_MIST].funp = m_mist;
00056        ofun[MAT_MIST].flags |= T_IRR_IGN;
00057        ofun[MAT_GLASS].funp = m_glass;
00058        ofun[MAT_GLASS].flags |= T_IRR_IGN;
00059        ofun[MAT_MIRROR].funp = m_mirror;
00060        ofun[MAT_DIRECT1].funp =
00061        ofun[MAT_DIRECT2].funp = m_direct;
00062        ofun[MAT_CLIP].funp = m_clip;
00063        ofun[MAT_BRTDF].funp = m_brdf;
00064        ofun[MAT_PFUNC].funp =
00065        ofun[MAT_MFUNC].funp =
00066        ofun[MAT_PDATA].funp =
00067        ofun[MAT_MDATA].funp = 
00068        ofun[MAT_TFUNC].funp =
00069        ofun[MAT_TDATA].funp = m_brdf2;
00070        ofun[MAT_PFUNC].flags |= T_OPAQUE;
00071        ofun[MAT_MFUNC].flags |= T_OPAQUE;
00072        ofun[MAT_PDATA].flags |= T_OPAQUE;
00073        ofun[MAT_MDATA].flags |= T_OPAQUE;
00074        ofun[TEX_FUNC].funp = t_func;
00075        ofun[TEX_DATA].funp = t_data;
00076        ofun[PAT_CFUNC].funp = p_cfunc;
00077        ofun[PAT_BFUNC].funp = p_bfunc;
00078        ofun[PAT_CPICT].funp = p_pdata;
00079        ofun[PAT_CDATA].funp = p_cdata;
00080        ofun[PAT_BDATA].funp = p_bdata;
00081        ofun[PAT_CTEXT].funp =
00082        ofun[PAT_BTEXT].funp =
00083        ofun[MIX_TEXT].funp = do_text;
00084        ofun[MIX_FUNC].funp = mx_func;
00085        ofun[MIX_DATA].funp = mx_data;
00086        ofun[MIX_PICT].funp = mx_pdata;
00087 }
00088 
00089 
00090 extern int
00091 o_default(OBJREC *o, RAY *r)                     /* default action is error */
00092 {
00093        objerror(o, CONSISTENCY, "unexpected object call");
00094                             /* unused call to load freeobjmem.o */
00095        free_objs(0, 0);
00096        return(0);
00097 }