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