1 |
schorsch |
3.23 |
/* RCSid: $Id: rholo.h,v 3.22 2003/06/20 00:25:49 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 |
|
|
#include "holo.h" |
9 |
|
|
#include "vars.h" |
10 |
|
|
|
11 |
schorsch |
3.23 |
#ifdef __cplusplus |
12 |
|
|
extern "C" { |
13 |
|
|
#endif |
14 |
|
|
|
15 |
gregl |
3.1 |
#ifndef RPACKSIZ |
16 |
|
|
#define RPACKSIZ 21 /* good packet size */ |
17 |
|
|
#endif |
18 |
|
|
|
19 |
|
|
typedef struct packet { |
20 |
greg |
3.22 |
int16 hd; /* holodeck section (first) */ |
21 |
|
|
int32 bi; /* beam index (second) */ |
22 |
|
|
int32 nr; /* number of rays (third) */ |
23 |
|
|
int32 nc; /* number calculated (fourth) */ |
24 |
gwlarson |
3.15 |
RAYVAL ra[RPACKSIZ]; /* ray values (fifth) */ |
25 |
gregl |
3.1 |
float *offset; /* offset array if !vbool(OBSTRUCTIONS) */ |
26 |
|
|
struct packet *next; /* next in packet list */ |
27 |
|
|
} PACKET; /* a beam packet */ |
28 |
|
|
|
29 |
|
|
typedef struct { |
30 |
greg |
3.22 |
int16 hd; /* holodeck section (first) */ |
31 |
|
|
int32 bi; /* beam index (second) */ |
32 |
|
|
int32 nr; /* number of rays (third) */ |
33 |
|
|
int32 nc; /* number calculated (fourth) */ |
34 |
gregl |
3.1 |
} PACKHEAD; /* followed by ray values */ |
35 |
|
|
|
36 |
|
|
#define packsiz(nr) (sizeof(PACKHEAD)+(nr)*sizeof(RAYVAL)) |
37 |
gregl |
3.3 |
#define packra(p) ((RAYVAL *)((p)+1)) |
38 |
gregl |
3.1 |
|
39 |
gwlarson |
3.16 |
typedef struct { |
40 |
gwlarson |
3.20 |
int nb; /* number of beams in list */ |
41 |
|
|
PACKHEAD *bl; /* allocated beam list */ |
42 |
|
|
} BEAMLIST; /* a list of beam requests */ |
43 |
|
|
|
44 |
|
|
typedef struct { |
45 |
gwlarson |
3.16 |
FVECT vpt; /* view (eye point) position */ |
46 |
|
|
double rng; /* desired mean radius for sample rays */ |
47 |
|
|
} VIEWPOINT; /* target eye position */ |
48 |
|
|
|
49 |
gregl |
3.1 |
/* input variables */ |
50 |
gwlarson |
3.14 |
#define CACHE 0 /* amount of memory to use as cache */ |
51 |
|
|
#define DISKSPACE 1 /* how much disk space to use */ |
52 |
|
|
#define EYESEP 2 /* eye separation distance */ |
53 |
gwlarson |
3.18 |
#define GEOMETRY 3 /* section geometry */ |
54 |
|
|
#define GRID 4 /* target grid size */ |
55 |
|
|
#define OBSTRUCTIONS 5 /* shall we track obstructions? */ |
56 |
|
|
#define OCTREE 6 /* octree file name */ |
57 |
|
|
#define PORTS 7 /* section portals */ |
58 |
|
|
#define RENDER 8 /* rendering options */ |
59 |
|
|
#define REPORT 9 /* report interval and error file */ |
60 |
|
|
#define RIF 10 /* rad input file */ |
61 |
|
|
#define SECTION 11 /* holodeck section boundaries */ |
62 |
|
|
#define TIME 12 /* maximum rendering time */ |
63 |
|
|
#define VDIST 13 /* virtual distance calculation */ |
64 |
gregl |
3.1 |
|
65 |
gwlarson |
3.18 |
#define NRHVARS 14 /* number of variables */ |
66 |
gregl |
3.1 |
|
67 |
|
|
#define RHVINIT { \ |
68 |
gwlarson |
3.14 |
{"CACHE", 2, 0, NULL, fltvalue}, \ |
69 |
|
|
{"DISKSPACE", 3, 0, NULL, fltvalue}, \ |
70 |
|
|
{"EYESEP", 3, 0, NULL, fltvalue}, \ |
71 |
gwlarson |
3.18 |
{"geometry", 3, 0, NULL, NULL}, \ |
72 |
gwlarson |
3.14 |
{"GRID", 2, 0, NULL, fltvalue}, \ |
73 |
|
|
{"OBSTRUCTIONS",3, 0, NULL, boolvalue}, \ |
74 |
|
|
{"OCTREE", 3, 0, NULL, onevalue}, \ |
75 |
gwlarson |
3.18 |
{"portals", 3, 0, NULL, NULL}, \ |
76 |
gregl |
3.1 |
{"render", 3, 0, NULL, catvalues}, \ |
77 |
gwlarson |
3.14 |
{"REPORT", 3, 0, NULL, onevalue}, \ |
78 |
|
|
{"RIF", 3, 0, NULL, onevalue}, \ |
79 |
gregl |
3.1 |
{"section", 3, 0, NULL, NULL}, \ |
80 |
|
|
{"TIME", 2, 0, NULL, fltvalue}, \ |
81 |
gregl |
3.6 |
{"VDISTANCE", 2, 0, NULL, boolvalue}, \ |
82 |
gregl |
3.1 |
} |
83 |
|
|
|
84 |
gregl |
3.2 |
/* bundle set requests */ |
85 |
gregl |
3.4 |
#define BS_NEW 1 /* replace current set with new one */ |
86 |
|
|
#define BS_ADD 2 /* add to current set */ |
87 |
gregl |
3.5 |
#define BS_ADJ 3 /* adjust current set quantities */ |
88 |
|
|
#define BS_DEL 4 /* delete from current set */ |
89 |
gwlarson |
3.20 |
#define BS_MAX 5 /* set to max of old and new */ |
90 |
gregl |
3.2 |
|
91 |
gregl |
3.1 |
extern char *progname; /* our program name */ |
92 |
|
|
extern char *hdkfile; /* holodeck file name */ |
93 |
|
|
extern char froot[]; /* root file name */ |
94 |
|
|
|
95 |
gregl |
3.4 |
extern char *outdev; /* output device name */ |
96 |
|
|
|
97 |
gregl |
3.8 |
extern int readinp; /* read input from stdin */ |
98 |
|
|
|
99 |
gregl |
3.10 |
extern int force; /* allow overwrite of holodeck */ |
100 |
|
|
|
101 |
gregl |
3.1 |
extern int nowarn; /* turn warnings off? */ |
102 |
|
|
|
103 |
gregl |
3.9 |
extern int ncprocs; /* number of requested compute processes */ |
104 |
|
|
extern int nprocs; /* number of running compute processes */ |
105 |
gregl |
3.4 |
|
106 |
gwlarson |
3.19 |
extern int chunkycmp; /* using "chunky" comparison mode */ |
107 |
gwlarson |
3.16 |
|
108 |
|
|
extern VIEWPOINT myeye; /* target view position */ |
109 |
gregl |
3.1 |
|
110 |
|
|
extern time_t starttime; /* time we got started */ |
111 |
|
|
extern time_t endtime; /* time we should end by */ |
112 |
|
|
extern time_t reporttime; /* time for next report */ |
113 |
|
|
|
114 |
gregl |
3.11 |
extern long nraysdone; /* number of rays done */ |
115 |
|
|
extern long npacksdone; /* number of packets done */ |
116 |
|
|
|
117 |
gregl |
3.1 |
extern int rtargc; /* rtrace command */ |
118 |
|
|
extern char *rtargv[]; |
119 |
|
|
|
120 |
|
|
extern PACKET *do_packets(), *get_packets(), *flush_queue(); |
121 |
gwlarson |
3.20 |
|
122 |
greg |
3.22 |
extern int16 *viewbeams(); |
123 |
schorsch |
3.23 |
|
124 |
|
|
|
125 |
|
|
#ifdef __cplusplus |
126 |
|
|
} |
127 |
|
|
#endif |
128 |
|
|
#endif /* _RAD_RHOLO_H_ */ |
129 |
|
|
|