| 1 | < | /* Copyright (c) 1997 Silicon Graphics, Inc. */ | 
| 2 | < |  | 
| 3 | < | /* SCCSid "$SunId$ SGI" */ | 
| 4 | < |  | 
| 1 | > | /* RCSid: $Id$ */ | 
| 2 |  | /* | 
| 3 |  | * Header file for rholo program | 
| 4 |  | */ | 
| 5 | + | #ifndef _RAD_RHOLO_H_ | 
| 6 | + | #define _RAD_RHOLO_H_ | 
| 7 |  |  | 
| 8 |  | #include "holo.h" | 
| 9 | + | #include "view.h" | 
| 10 |  | #include "vars.h" | 
| 11 |  |  | 
| 12 | + | #ifdef __cplusplus | 
| 13 | + | extern "C" { | 
| 14 | + | #endif | 
| 15 | + |  | 
| 16 |  | #ifndef RPACKSIZ | 
| 17 |  | #define RPACKSIZ        21              /* good packet size */ | 
| 18 |  | #endif | 
| 19 |  |  | 
| 20 |  | typedef struct packet { | 
| 21 | < | int2    hd;             /* holodeck section (first) */ | 
| 22 | < | int4    bi;             /* beam index (second) */ | 
| 23 | < | int4    nr;             /* number of rays (third) */ | 
| 24 | < | int4    nc;             /* number calculated (fourth) */ | 
| 25 | < | RAYVAL  ra[RPACKSIZ];   /* ray values (fourth) */ | 
| 21 | > | int16   hd;             /* holodeck section (first) */ | 
| 22 | > | int32   bi;             /* beam index (second) */ | 
| 23 | > | int32   nr;             /* number of rays (third) */ | 
| 24 | > | int32   nc;             /* number calculated (fourth) */ | 
| 25 | > | RAYVAL  ra[RPACKSIZ];   /* ray values (fifth) */ | 
| 26 |  | float   *offset;        /* offset array if !vbool(OBSTRUCTIONS) */ | 
| 27 |  | struct packet   *next;  /* next in packet list */ | 
| 28 |  | } PACKET;               /* a beam packet */ | 
| 29 |  |  | 
| 30 |  | typedef struct { | 
| 31 | < | int2    hd;             /* holodeck section (first) */ | 
| 32 | < | int4    bi;             /* beam index (second) */ | 
| 33 | < | int4    nr;             /* number of rays (third) */ | 
| 34 | < | int4    nc;             /* number calculated (fourth) */ | 
| 31 | > | int16   hd;             /* holodeck section (first) */ | 
| 32 | > | int32   bi;             /* beam index (second) */ | 
| 33 | > | int32   nr;             /* number of rays (third) */ | 
| 34 | > | int32   nc;             /* number calculated (fourth) */ | 
| 35 |  | } PACKHEAD;             /* followed by ray values */ | 
| 36 |  |  | 
| 37 |  | #define packsiz(nr)     (sizeof(PACKHEAD)+(nr)*sizeof(RAYVAL)) | 
| 38 |  | #define packra(p)       ((RAYVAL *)((p)+1)) | 
| 39 |  |  | 
| 40 | + | typedef struct { | 
| 41 | + | int     nb;             /* number of beams in list */ | 
| 42 | + | PACKHEAD        *bl;    /* allocated beam list */ | 
| 43 | + | } BEAMLIST;             /* a list of beam requests */ | 
| 44 | + |  | 
| 45 | + | typedef struct { | 
| 46 | + | FVECT   vpt;            /* view (eye point) position */ | 
| 47 | + | double  rng;            /* desired mean radius for sample rays */ | 
| 48 | + | } VIEWPOINT;            /* target eye position */ | 
| 49 | + |  | 
| 50 |  | /* input variables */ | 
| 51 | < | #define RENDER          0               /* rendering options */ | 
| 52 | < | #define SECTION         1               /* holodeck section boundaries */ | 
| 53 | < | #define OCTREE          2               /* octree file name */ | 
| 54 | < | #define RIF             3               /* rad input file */ | 
| 55 | < | #define TIME            4               /* maximum rendering time */ | 
| 56 | < | #define DISKSPACE       5               /* how much disk space to use */ | 
| 57 | < | #define CACHE           6               /* amount of memory to use as cache */ | 
| 58 | < | #define GRID            7               /* target grid size */ | 
| 59 | < | #define OBSTRUCTIONS    8               /* shall we track obstructions? */ | 
| 60 | < | #define VDIST           9               /* virtual distance calculation */ | 
| 61 | < | #define OCCUPANCY       10              /* expected occupancy probability */ | 
| 62 | < | #define REPORT          11              /* report interval and error file */ | 
| 51 | > | #define CACHE           0               /* amount of memory to use as cache */ | 
| 52 | > | #define DISKSPACE       1               /* how much disk space to use */ | 
| 53 | > | #define EYESEP          2               /* eye separation distance */ | 
| 54 | > | #define GEOMETRY        3               /* section geometry */ | 
| 55 | > | #define GRID            4               /* target grid size */ | 
| 56 | > | #define OBSTRUCTIONS    5               /* shall we track obstructions? */ | 
| 57 | > | #define OCTREE          6               /* octree file name */ | 
| 58 | > | #define PORTS           7               /* section portals */ | 
| 59 | > | #define RENDER          8               /* rendering options */ | 
| 60 | > | #define REPORT          9               /* report interval and error file */ | 
| 61 | > | #define RIF             10              /* rad input file */ | 
| 62 | > | #define SECTION         11              /* holodeck section boundaries */ | 
| 63 | > | #define TIME            12              /* maximum rendering time */ | 
| 64 | > | #define VDIST           13              /* virtual distance calculation */ | 
| 65 |  |  | 
| 66 | < | #define NRHVARS         12              /* number of variables */ | 
| 66 | > | #define NRHVARS         14              /* number of variables */ | 
| 67 |  |  | 
| 68 |  | #define RHVINIT { \ | 
| 53 | – | {"render",      3,      0,      NULL,   catvalues}, \ | 
| 54 | – | {"section",     3,      0,      NULL,   NULL}, \ | 
| 55 | – | {"OCTREE",      3,      0,      NULL,   onevalue}, \ | 
| 56 | – | {"RIF",         3,      0,      NULL,   onevalue}, \ | 
| 57 | – | {"TIME",        2,      0,      NULL,   fltvalue}, \ | 
| 58 | – | {"DISKSPACE",   3,      0,      NULL,   fltvalue}, \ | 
| 69 |  | {"CACHE",       2,      0,      NULL,   fltvalue}, \ | 
| 70 | + | {"DISKSPACE",   3,      0,      NULL,   fltvalue}, \ | 
| 71 | + | {"EYESEP",      3,      0,      NULL,   fltvalue}, \ | 
| 72 | + | {"geometry",    3,      0,      NULL,   NULL}, \ | 
| 73 |  | {"GRID",        2,      0,      NULL,   fltvalue}, \ | 
| 74 |  | {"OBSTRUCTIONS",3,      0,      NULL,   boolvalue}, \ | 
| 75 | < | {"VDISTANCE",   2,      0,      NULL,   boolvalue}, \ | 
| 76 | < | {"OCCUPANCY",   3,      0,      NULL,   onevalue}, \ | 
| 75 | > | {"OCTREE",      3,      0,      NULL,   onevalue}, \ | 
| 76 | > | {"portals",     3,      0,      NULL,   NULL}, \ | 
| 77 | > | {"render",      3,      0,      NULL,   catvalues}, \ | 
| 78 |  | {"REPORT",      3,      0,      NULL,   onevalue}, \ | 
| 79 | + | {"RIF",         3,      0,      NULL,   onevalue}, \ | 
| 80 | + | {"section",     3,      0,      NULL,   NULL}, \ | 
| 81 | + | {"TIME",        2,      0,      NULL,   fltvalue}, \ | 
| 82 | + | {"VDISTANCE",   2,      0,      NULL,   boolvalue}, \ | 
| 83 |  | } | 
| 84 |  |  | 
| 85 |  | /* bundle set requests */ | 
| 87 |  | #define BS_ADD          2               /* add to current set */ | 
| 88 |  | #define BS_ADJ          3               /* adjust current set quantities */ | 
| 89 |  | #define BS_DEL          4               /* delete from current set */ | 
| 90 | + | #define BS_MAX          5               /* set to max of old and new */ | 
| 91 |  |  | 
| 92 |  | extern char     *progname;      /* our program name */ | 
| 93 |  | extern char     *hdkfile;       /* holodeck file name */ | 
| 104 |  | extern int      ncprocs;        /* number of requested compute processes */ | 
| 105 |  | extern int      nprocs;         /* number of running compute processes */ | 
| 106 |  |  | 
| 107 | < | extern double   expval;         /* global exposure value */ | 
| 107 | > | extern int      chunkycmp;      /* using "chunky" comparison mode */ | 
| 108 |  |  | 
| 109 | + | extern VIEWPOINT        myeye;  /* target view position */ | 
| 110 | + |  | 
| 111 |  | extern time_t   starttime;      /* time we got started */ | 
| 112 |  | extern time_t   endtime;        /* time we should end by */ | 
| 113 |  | extern time_t   reporttime;     /* time for next report */ | 
| 118 |  | extern int      rtargc;         /* rtrace command */ | 
| 119 |  | extern char     *rtargv[]; | 
| 120 |  |  | 
| 121 | < | extern PACKET   *do_packets(), *get_packets(), *flush_queue(); | 
| 121 | > | /* rholo.c */ | 
| 122 | > | extern void done_packets(PACKET *pl); | 
| 123 | > | /* rholo2.c */ | 
| 124 | > | extern void new_rtrace(void); | 
| 125 | > | extern int done_rtrace(void); | 
| 126 | > | extern void packrays(float *rod, PACKET *p); | 
| 127 | > | extern void donerays(PACKET *p, float *rvl); | 
| 128 | > | extern int getradfile(void); | 
| 129 | > | extern void report(time_t t); | 
| 130 | > | /* rholo2l.c */ | 
| 131 | > | extern int start_rtrace(void); | 
| 132 | > | extern int end_rtrace(void); | 
| 133 | > | extern PACKET *do_packets(PACKET *pl); | 
| 134 | > | extern PACKET *flush_queue(void); | 
| 135 | > | /* rholo3.c */ | 
| 136 | > | extern void init_global(void); | 
| 137 | > | extern int next_packet(PACKET *p, int   n); | 
| 138 | > | extern void bundle_set(int op, PACKHEAD *clist, int nents); | 
| 139 | > | /* rholo4.c */ | 
| 140 | > | extern void disp_open(char *dname); | 
| 141 | > | extern void disp_packet(register PACKHEAD *p); | 
| 142 | > | extern int disp_check(int block); | 
| 143 | > | extern int disp_close(void); | 
| 144 | > | /* viewbeams.c */ | 
| 145 | > | extern int nextview(VIEW *vp, FILE *fp); | 
| 146 | > | extern int16 * viewbeams(VIEW *vp, int hr, int vr, BEAMLIST *blp); | 
| 147 | > |  | 
| 148 | > | #ifdef __cplusplus | 
| 149 | > | } | 
| 150 | > | #endif | 
| 151 | > | #endif /* _RAD_RHOLO_H_ */ | 
| 152 | > |  |