ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/source.h
(Generate patch)

Comparing ray/src/rt/source.h (file contents):
Revision 2.1 by greg, Tue Nov 12 17:10:17 1991 UTC vs.
Revision 2.9 by greg, Fri Jun 27 06:53:23 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   *  source.h - header file for ray tracing sources.
4   *
5 < *     8/20/85
5 > *  Include after ray.h
6   */
7 + #ifndef _RAD_SOURCE_H_
8 + #define _RAD_SOURCE_H_
9 + #ifdef __cplusplus
10 + extern "C" {
11 + #endif
12  
13   #define  AIMREQT        100             /* required aim success/failure */
14  
# Line 22 | Line 24
24   typedef struct {
25          FVECT  aim;             /* aim direction or center */
26          float  siz;             /* output solid angle or area */
27 <        float  flen;            /* focal length */
27 >        float  flen;            /* focal length (negative if distant source) */
28   } SPOT;                 /* spotlight */
29  
30   typedef struct {
# Line 36 | Line 38 | typedef struct {
38                  SPOT  *s;               /* spot */
39          } sl;                   /* localized source information */
40          union {
41 <                int  success;           /* successes - AIMREQT*failures */
41 >                long  success;          /* successes - AIMREQT*failures */
42                  struct {
43                          short  pn;              /* projection number */
44 <                        short  sn;              /* next source to aim for */
44 >                        int  sn;                /* next source to aim for */
45                  }  sv;                  /* virtual source */
46          } sa;                   /* source aiming information */
47 <        long  ntests, nhits;    /* shadow tests and hits */
47 >        unsigned long
48 >                ntests, nhits;  /* shadow tests and hits */
49          OBJREC  *so;            /* source destination object */
50   }  SRCREC;              /* light source */
51  
# Line 91 | Line 94 | typedef struct {
94   } VSMATERIAL;           /* virtual source material functions */
95  
96   typedef struct {
97 <        int     (*setsrc)();    /* set light source for object */
98 <        int     (*partit)();    /* partition light source object */
97 >        void    (*setsrc)();    /* set light source for object */
98 >        void    (*partit)();    /* partition light source object */
99          double  (*getpleq)();   /* plane equation for surface */
100          double  (*getdisk)();   /* maximum disk for surface */
101   } SOBJECT;              /* source object functions */
# Line 107 | Line 110 | extern SRCFUNC  sfun[];                        /* source dispatch table */
110   extern SRCREC  *source;                 /* our source list */
111   extern int  nsources;                   /* the number of sources */
112  
110 extern int  srcvalue();                 /* compute source value w/o shadows */
111 extern double  nextssamp();             /* get next source sample location */
112 extern double  scylform();              /* cosine to axis of cylinder */
113
113   #define  sflatform(sn,dir)      -DOT(source[sn].snorm, dir)
114  
115 < extern OBJREC  *vsmaterial();           /* virtual source material */
115 > #define  getplaneq(c,o)         (*sfun[(o)->otype].of->getpleq)(c,o)
116 > #define  getmaxdisk(c,o)        (*sfun[(o)->otype].of->getdisk)(c,o)
117 > #define  setsource(s,o)         (*sfun[(o)->otype].of->setsrc)(s,o)
118  
119 < extern double  intercircle();           /* intersect two circles */
120 < extern double  spotdisk();              /* intersecting disk for spot */
121 < extern double  beamdisk();              /* intersecting disk for beam */
119 >                                        /* defined in source.c */
120 > extern void     marksources(void);
121 > extern void     freesources(void);
122 > extern int      srcray(RAY *sr, RAY *r, SRCINDEX *si);
123 > extern void     srcvalue(RAY *r);
124 > extern int      sourcehit(RAY *r);
125 > extern void     direct(RAY *r, void (*f)(), char *p);
126 > extern void     srcscatter(RAY *r);
127 > extern int      m_light(OBJREC *m, RAY *r);
128 >                                        /* defined in srcsamp.c */
129 > extern double   nextssamp(RAY *r, SRCINDEX *si);
130 > extern int      skipparts(int ct[3], int sz[3], int pp[2], unsigned char *pt);
131 > extern void     nopart(SRCINDEX *si, RAY *r);
132 > extern void     cylpart(SRCINDEX *si, RAY *r);
133 > extern void     flatpart(SRCINDEX *si, RAY *r);
134 > extern double   scylform(int sn, FVECT dir);
135 >                                        /* defined in srcsupp.c */
136 > extern void     initstypes(void);
137 > extern int      newsource(void);
138 > extern void     setflatss(SRCREC *src);
139 > extern void     fsetsrc(SRCREC *src, OBJREC *so);
140 > extern void     ssetsrc(SRCREC *src, OBJREC *so);
141 > extern void     sphsetsrc(SRCREC *src, OBJREC *so);
142 > extern void     rsetsrc(SRCREC *src, OBJREC *so);
143 > extern void     cylsetsrc(SRCREC *src, OBJREC *so);
144 > extern SPOT     *makespot(OBJREC *m);
145 > extern int      spotout(RAY *r, SPOT *s);
146 > extern double   fgetmaxdisk(FVECT ocent, OBJREC *op);
147 > extern double   rgetmaxdisk(FVECT ocent, OBJREC *op);
148 > extern double   fgetplaneq(FVECT nvec, OBJREC *op);
149 > extern double   rgetplaneq(FVECT nvec, OBJREC *op);
150 > extern int      commonspot(SPOT *sp1, SPOT *sp2, FVECT org);
151 > extern int      commonbeam(SPOT *sp1, SPOT *sp2, FVECT org);
152 > extern int      checkspot(SPOT *sp, FVECT nrm);
153 > extern double   spotdisk(FVECT oc, OBJREC *op, SPOT *sp, FVECT pos);
154 > extern double   beamdisk(FVECT oc, OBJREC *op, SPOT *sp, FVECT dir);
155 > extern double   intercircle(FVECT cc, FVECT c1, FVECT c2,
156 >                        double r1s, double r2s);
157 >                                        /* defined in virtuals.c */
158 > extern void     markvirtuals(void);
159 > extern void     addvirtuals(int sn, int nr);
160 > extern void     vproject(OBJREC *o, int sn, int n);
161 > extern OBJREC   *vsmaterial(OBJREC *o);
162 > extern int      makevsrc(OBJREC *op, int sn, MAT4 pm);
163 > extern double   getdisk(FVECT oc, OBJREC *op, int sn);
164 > extern int      vstestvis(int f, OBJREC *o, FVECT oc, double or2, int sn);
165 > extern void     virtverb(int sn, FILE *fp);
166  
122 extern SPOT  *makespot();               /* make spotlight */
167  
168 < extern double  dstrsrc;                 /* source distribution amount */
169 < extern double  shadthresh;              /* relative shadow threshold */
170 < extern double  shadcert;                /* shadow testing certainty */
171 < extern double  srcsizerat;              /* max. ratio of source size/dist. */
128 < extern int  directrelay;                /* maximum number of source relays */
129 < extern int  vspretest;                  /* virtual source pretest density */
130 < extern int  directinvis;                /* sources invisible? */
168 > #ifdef __cplusplus
169 > }
170 > #endif
171 > #endif /* _RAD_SOURCE_H_ */
172  
132 #define  getplaneq(c,o)         (*sfun[(o)->otype].of->getpleq)(c,o)
133 #define  getmaxdisk(c,o)        (*sfun[(o)->otype].of->getdisk)(c,o)
134 #define  setsource(s,o)         (*sfun[(o)->otype].of->setsrc)(s,o)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines