| 1 |
greg |
3.26 |
/* RCSid: $Id: rholo.h,v 3.25 2004/06/08 19:48:30 greg Exp $ */
|
| 2 |
gregl |
3.1 |
/*
|
| 3 |
|
|
* Header file for rholo program
|
| 4 |
|
|
*/
|
| 5 |
schorsch |
3.23 |
#ifndef _RAD_RHOLO_H_
|
| 6 |
|
|
#define _RAD_RHOLO_H_
|
| 7 |
gregl |
3.1 |
|
| 8 |
greg |
3.25 |
#include "holo.h"
|
| 9 |
schorsch |
3.24 |
#include "view.h"
|
| 10 |
gregl |
3.1 |
#include "vars.h"
|
| 11 |
|
|
|
| 12 |
schorsch |
3.23 |
#ifdef __cplusplus
|
| 13 |
|
|
extern "C" {
|
| 14 |
|
|
#endif
|
| 15 |
|
|
|
| 16 |
gregl |
3.1 |
#ifndef RPACKSIZ
|
| 17 |
|
|
#define RPACKSIZ 21 /* good packet size */
|
| 18 |
|
|
#endif
|
| 19 |
|
|
|
| 20 |
|
|
typedef struct packet {
|
| 21 |
greg |
3.22 |
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 |
gwlarson |
3.15 |
RAYVAL ra[RPACKSIZ]; /* ray values (fifth) */
|
| 26 |
gregl |
3.1 |
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 |
greg |
3.22 |
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 |
gregl |
3.1 |
} PACKHEAD; /* followed by ray values */
|
| 36 |
|
|
|
| 37 |
|
|
#define packsiz(nr) (sizeof(PACKHEAD)+(nr)*sizeof(RAYVAL))
|
| 38 |
gregl |
3.3 |
#define packra(p) ((RAYVAL *)((p)+1))
|
| 39 |
gregl |
3.1 |
|
| 40 |
gwlarson |
3.16 |
typedef struct {
|
| 41 |
gwlarson |
3.20 |
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 |
gwlarson |
3.16 |
FVECT vpt; /* view (eye point) position */
|
| 47 |
|
|
double rng; /* desired mean radius for sample rays */
|
| 48 |
|
|
} VIEWPOINT; /* target eye position */
|
| 49 |
|
|
|
| 50 |
gregl |
3.1 |
/* input variables */
|
| 51 |
gwlarson |
3.14 |
#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 |
gwlarson |
3.18 |
#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 |
gregl |
3.1 |
|
| 66 |
gwlarson |
3.18 |
#define NRHVARS 14 /* number of variables */
|
| 67 |
gregl |
3.1 |
|
| 68 |
|
|
#define RHVINIT { \
|
| 69 |
gwlarson |
3.14 |
{"CACHE", 2, 0, NULL, fltvalue}, \
|
| 70 |
|
|
{"DISKSPACE", 3, 0, NULL, fltvalue}, \
|
| 71 |
|
|
{"EYESEP", 3, 0, NULL, fltvalue}, \
|
| 72 |
gwlarson |
3.18 |
{"geometry", 3, 0, NULL, NULL}, \
|
| 73 |
gwlarson |
3.14 |
{"GRID", 2, 0, NULL, fltvalue}, \
|
| 74 |
|
|
{"OBSTRUCTIONS",3, 0, NULL, boolvalue}, \
|
| 75 |
|
|
{"OCTREE", 3, 0, NULL, onevalue}, \
|
| 76 |
gwlarson |
3.18 |
{"portals", 3, 0, NULL, NULL}, \
|
| 77 |
gregl |
3.1 |
{"render", 3, 0, NULL, catvalues}, \
|
| 78 |
gwlarson |
3.14 |
{"REPORT", 3, 0, NULL, onevalue}, \
|
| 79 |
|
|
{"RIF", 3, 0, NULL, onevalue}, \
|
| 80 |
gregl |
3.1 |
{"section", 3, 0, NULL, NULL}, \
|
| 81 |
|
|
{"TIME", 2, 0, NULL, fltvalue}, \
|
| 82 |
gregl |
3.6 |
{"VDISTANCE", 2, 0, NULL, boolvalue}, \
|
| 83 |
gregl |
3.1 |
}
|
| 84 |
|
|
|
| 85 |
gregl |
3.2 |
/* bundle set requests */
|
| 86 |
gregl |
3.4 |
#define BS_NEW 1 /* replace current set with new one */
|
| 87 |
|
|
#define BS_ADD 2 /* add to current set */
|
| 88 |
gregl |
3.5 |
#define BS_ADJ 3 /* adjust current set quantities */
|
| 89 |
|
|
#define BS_DEL 4 /* delete from current set */
|
| 90 |
gwlarson |
3.20 |
#define BS_MAX 5 /* set to max of old and new */
|
| 91 |
gregl |
3.2 |
|
| 92 |
gregl |
3.1 |
extern char *progname; /* our program name */
|
| 93 |
|
|
extern char *hdkfile; /* holodeck file name */
|
| 94 |
|
|
extern char froot[]; /* root file name */
|
| 95 |
|
|
|
| 96 |
gregl |
3.4 |
extern char *outdev; /* output device name */
|
| 97 |
|
|
|
| 98 |
gregl |
3.8 |
extern int readinp; /* read input from stdin */
|
| 99 |
|
|
|
| 100 |
gregl |
3.10 |
extern int force; /* allow overwrite of holodeck */
|
| 101 |
|
|
|
| 102 |
gregl |
3.1 |
extern int nowarn; /* turn warnings off? */
|
| 103 |
|
|
|
| 104 |
gregl |
3.9 |
extern int ncprocs; /* number of requested compute processes */
|
| 105 |
|
|
extern int nprocs; /* number of running compute processes */
|
| 106 |
gregl |
3.4 |
|
| 107 |
gwlarson |
3.19 |
extern int chunkycmp; /* using "chunky" comparison mode */
|
| 108 |
gwlarson |
3.16 |
|
| 109 |
|
|
extern VIEWPOINT myeye; /* target view position */
|
| 110 |
gregl |
3.1 |
|
| 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 */
|
| 114 |
|
|
|
| 115 |
gregl |
3.11 |
extern long nraysdone; /* number of rays done */
|
| 116 |
|
|
extern long npacksdone; /* number of packets done */
|
| 117 |
|
|
|
| 118 |
greg |
3.26 |
#define MAXRTARGC 256
|
| 119 |
gregl |
3.1 |
extern int rtargc; /* rtrace command */
|
| 120 |
|
|
extern char *rtargv[];
|
| 121 |
|
|
|
| 122 |
schorsch |
3.24 |
/* rholo.c */
|
| 123 |
|
|
extern void done_packets(PACKET *pl);
|
| 124 |
|
|
/* rholo2.c */
|
| 125 |
|
|
extern void new_rtrace(void);
|
| 126 |
|
|
extern int done_rtrace(void);
|
| 127 |
|
|
extern void packrays(float *rod, PACKET *p);
|
| 128 |
|
|
extern void donerays(PACKET *p, float *rvl);
|
| 129 |
|
|
extern int getradfile(void);
|
| 130 |
|
|
extern void report(time_t t);
|
| 131 |
|
|
/* rholo2l.c */
|
| 132 |
|
|
extern int start_rtrace(void);
|
| 133 |
|
|
extern int end_rtrace(void);
|
| 134 |
|
|
extern PACKET *do_packets(PACKET *pl);
|
| 135 |
|
|
extern PACKET *flush_queue(void);
|
| 136 |
|
|
/* rholo3.c */
|
| 137 |
|
|
extern void init_global(void);
|
| 138 |
|
|
extern int next_packet(PACKET *p, int n);
|
| 139 |
|
|
extern void bundle_set(int op, PACKHEAD *clist, int nents);
|
| 140 |
|
|
/* rholo4.c */
|
| 141 |
|
|
extern void disp_open(char *dname);
|
| 142 |
|
|
extern void disp_packet(register PACKHEAD *p);
|
| 143 |
|
|
extern int disp_check(int block);
|
| 144 |
|
|
extern int disp_close(void);
|
| 145 |
|
|
/* viewbeams.c */
|
| 146 |
|
|
extern int nextview(VIEW *vp, FILE *fp);
|
| 147 |
|
|
extern int16 * viewbeams(VIEW *vp, int hr, int vr, BEAMLIST *blp);
|
| 148 |
schorsch |
3.23 |
|
| 149 |
|
|
#ifdef __cplusplus
|
| 150 |
|
|
}
|
| 151 |
|
|
#endif
|
| 152 |
|
|
#endif /* _RAD_RHOLO_H_ */
|
| 153 |
|
|
|