Back to index

radiance  4R0+20100331
rholo.h
Go to the documentation of this file.
00001 /* RCSid: $Id: rholo.h,v 3.25 2004/06/08 19:48:30 greg Exp $ */
00002 /*
00003  * Header file for rholo program
00004  */
00005 #ifndef _RAD_RHOLO_H_
00006 #define _RAD_RHOLO_H_
00007 
00008 #include "holo.h"
00009 #include "view.h"
00010 #include "vars.h"
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 #ifndef RPACKSIZ
00017 #define RPACKSIZ     21            /* good packet size */
00018 #endif
00019 
00020 typedef struct packet {
00021        int16  hd;           /* holodeck section (first) */
00022        int32  bi;           /* beam index (second) */
00023        int32  nr;           /* number of rays (third) */
00024        int32  nc;           /* number calculated (fourth) */
00025        RAYVAL ra[RPACKSIZ]; /* ray values (fifth) */
00026        float  *offset;      /* offset array if !vbool(OBSTRUCTIONS) */
00027        struct packet *next; /* next in packet list */
00028 } PACKET;            /* a beam packet */
00029 
00030 typedef struct {
00031        int16  hd;           /* holodeck section (first) */
00032        int32  bi;           /* beam index (second) */
00033        int32  nr;           /* number of rays (third) */
00034        int32  nc;           /* number calculated (fourth) */
00035 } PACKHEAD;          /* followed by ray values */
00036 
00037 #define packsiz(nr)  (sizeof(PACKHEAD)+(nr)*sizeof(RAYVAL))
00038 #define packra(p)    ((RAYVAL *)((p)+1))
00039 
00040 typedef struct {
00041        int    nb;           /* number of beams in list */
00042        PACKHEAD      *bl;   /* allocated beam list */
00043 } BEAMLIST;          /* a list of beam requests */
00044 
00045 typedef struct {
00046        FVECT  vpt;          /* view (eye point) position */
00047        double rng;          /* desired mean radius for sample rays */
00048 } VIEWPOINT;         /* target eye position */
00049 
00050                             /* input variables */
00051 #define CACHE        0             /* amount of memory to use as cache */
00052 #define DISKSPACE    1             /* how much disk space to use */
00053 #define EYESEP              2             /* eye separation distance */
00054 #define GEOMETRY     3             /* section geometry */
00055 #define GRID         4             /* target grid size */
00056 #define OBSTRUCTIONS 5             /* shall we track obstructions? */
00057 #define OCTREE              6             /* octree file name */
00058 #define PORTS        7             /* section portals */
00059 #define RENDER              8             /* rendering options */
00060 #define REPORT              9             /* report interval and error file */
00061 #define RIF          10            /* rad input file */
00062 #define SECTION             11            /* holodeck section boundaries */
00063 #define TIME         12            /* maximum rendering time */
00064 #define VDIST        13            /* virtual distance calculation */
00065 
00066 #define NRHVARS             14            /* number of variables */
00067 
00068 #define RHVINIT { \
00069        {"CACHE",     2,     0,     NULL,  fltvalue}, \
00070        {"DISKSPACE", 3,     0,     NULL,  fltvalue}, \
00071        {"EYESEP",    3,     0,     NULL,  fltvalue}, \
00072        {"geometry",  3,     0,     NULL,  NULL}, \
00073        {"GRID",      2,     0,     NULL,  fltvalue}, \
00074        {"OBSTRUCTIONS",3,   0,     NULL,  boolvalue}, \
00075        {"OCTREE",    3,     0,     NULL,  onevalue}, \
00076        {"portals",   3,     0,     NULL,  NULL}, \
00077        {"render",    3,     0,     NULL,  catvalues}, \
00078        {"REPORT",    3,     0,     NULL,  onevalue}, \
00079        {"RIF",              3,     0,     NULL,  onevalue}, \
00080        {"section",   3,     0,     NULL,  NULL}, \
00081        {"TIME",      2,     0,     NULL,  fltvalue}, \
00082        {"VDISTANCE", 2,     0,     NULL,  boolvalue}, \
00083 }
00084 
00085                             /* bundle set requests */
00086 #define BS_NEW              1             /* replace current set with new one */
00087 #define BS_ADD              2             /* add to current set */
00088 #define BS_ADJ              3             /* adjust current set quantities */
00089 #define BS_DEL              4             /* delete from current set */
00090 #define BS_MAX              5             /* set to max of old and new */
00091 
00092 extern char   *progname;    /* our program name */
00093 extern char   *hdkfile;     /* holodeck file name */
00094 extern char   froot[];      /* root file name */
00095 
00096 extern char   *outdev;      /* output device name */
00097 
00098 extern int    readinp;      /* read input from stdin */
00099 
00100 extern int    force;        /* allow overwrite of holodeck */
00101 
00102 extern int    nowarn;              /* turn warnings off? */
00103 
00104 extern int    ncprocs;      /* number of requested compute processes */
00105 extern int    nprocs;              /* number of running compute processes */
00106 
00107 extern int    chunkycmp;    /* using "chunky" comparison mode */
00108 
00109 extern VIEWPOINT     myeye; /* target view position */
00110 
00111 extern time_t starttime;    /* time we got started */
00112 extern time_t endtime;      /* time we should end by */
00113 extern time_t reporttime;   /* time for next report */
00114 
00115 extern long   nraysdone;    /* number of rays done */
00116 extern long   npacksdone;   /* number of packets done */
00117 
00118 extern int    rtargc;              /* rtrace command */
00119 extern char   *rtargv[];
00120 
00121        /* rholo.c */
00122 extern void done_packets(PACKET    *pl);
00123        /* rholo2.c */
00124 extern void new_rtrace(void);
00125 extern int done_rtrace(void);
00126 extern void packrays(float *rod, PACKET *p);
00127 extern void donerays(PACKET *p, float *rvl);
00128 extern int getradfile(void);
00129 extern void report(time_t t);
00130        /* rholo2l.c */
00131 extern int start_rtrace(void);
00132 extern int end_rtrace(void);
00133 extern PACKET *do_packets(PACKET *pl);
00134 extern PACKET *flush_queue(void);
00135        /* rholo3.c */
00136 extern void init_global(void);
00137 extern int next_packet(PACKET *p, int     n);
00138 extern void bundle_set(int op, PACKHEAD *clist, int nents);
00139        /* rholo4.c */
00140 extern void disp_open(char *dname);
00141 extern void disp_packet(register PACKHEAD *p);
00142 extern int disp_check(int block);
00143 extern int disp_close(void);
00144        /* viewbeams.c */
00145 extern int nextview(VIEW *vp, FILE *fp);
00146 extern int16 * viewbeams(VIEW *vp, int hr, int vr, BEAMLIST *blp);
00147 
00148 #ifdef __cplusplus
00149 }
00150 #endif
00151 #endif /* _RAD_RHOLO_H_ */
00152