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