ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/cone.h
Revision: 2.8
Committed: Fri Sep 23 19:04:52 2005 UTC (18 years, 7 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R1, rad4R0, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 2.7: +4 -4 lines
Log Message:
Rearranged some struct's for better efficiency on 64-bit architectures

File Contents

# User Rev Content
1 greg 2.8 /* RCSid $Id: cone.h,v 2.7 2003/11/14 17:22:06 schorsch Exp $ */
2 greg 1.1 /*
3     * cone.h - header file for cones (cones, cylinders, rings, cups, tubes).
4     *
5     * Storage of arguments in the cone structure is a little strange.
6     * To save space, we use an index into the real arguments of the
7     * object structure through ca. The indices are for the axis
8     * endpoints and radii: p0, p1, r0 and r1.
9     *
10     * 2/12/86
11     */
12 schorsch 2.4 #ifndef _RAD_CONE_H_
13     #define _RAD_CONE_H_
14     #ifdef __cplusplus
15     extern "C" {
16     #endif
17 greg 2.2
18 greg 1.1 typedef struct cone {
19     FVECT ad; /* axis direction vector */
20 schorsch 2.5 RREAL al; /* axis length */
21     RREAL sl; /* side length */
22 greg 2.8 RREAL *ca; /* cone arguments (o->oargs.farg) */
23 schorsch 2.5 RREAL (*tm)[4]; /* pointer to transformation matrix */
24 greg 2.8 char p0, p1; /* indices for endpoints */
25     char r0, r1; /* indices for radii */
26 greg 1.1 } CONE;
27    
28 schorsch 2.7 #define CO_R0(co) ((co)->ca[(int)((co)->r0)])
29     #define CO_R1(co) ((co)->ca[(int)((co)->r1)])
30 greg 1.1 #define CO_P0(co) ((co)->ca+(co)->p0)
31     #define CO_P1(co) ((co)->ca+(co)->p1)
32    
33 greg 2.2
34     extern CONE *getcone(OBJREC *o, int getxf);
35     extern void freecone(OBJREC *o);
36     extern void conexform(CONE *co);
37    
38 schorsch 2.4
39     #ifdef __cplusplus
40     }
41 greg 2.2 #endif
42 schorsch 2.4 #endif /* _RAD_CONE_H_ */
43