Back to index

radiance  4R0+20100331
cone.h
Go to the documentation of this file.
00001 /* RCSid $Id: cone.h,v 2.8 2005/09/23 19:04:52 greg Exp $ */
00002 /*
00003  *  cone.h - header file for cones (cones, cylinders, rings, cups, tubes).
00004  *
00005  *     Storage of arguments in the cone structure is a little strange.
00006  *  To save space, we use an index into the real arguments of the
00007  *  object structure through ca.  The indices are for the axis
00008  *  endpoints and radii:  p0, p1, r0 and r1.
00009  *
00010  *     2/12/86
00011  */
00012 #ifndef _RAD_CONE_H_
00013 #define _RAD_CONE_H_
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 
00018 typedef struct cone {
00019        FVECT  ad;           /* axis direction vector */
00020        RREAL  al;           /* axis length */
00021        RREAL  sl;           /* side length */
00022        RREAL  *ca;          /* cone arguments (o->oargs.farg) */
00023        RREAL  (*tm)[4];     /* pointer to transformation matrix */
00024        char  p0, p1;        /* indices for endpoints */
00025        char  r0, r1;        /* indices for radii */
00026 }  CONE;
00027 
00028 #define  CO_R0(co)   ((co)->ca[(int)((co)->r0)])
00029 #define  CO_R1(co)   ((co)->ca[(int)((co)->r1)])
00030 #define  CO_P0(co)   ((co)->ca+(co)->p0)
00031 #define  CO_P1(co)   ((co)->ca+(co)->p1)
00032 
00033 
00034 extern CONE  *getcone(OBJREC *o, int getxf);
00035 extern void  freecone(OBJREC *o);
00036 extern void  conexform(CONE *co);
00037 
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 #endif /* _RAD_CONE_H_ */
00043