ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rholo.h
Revision: 3.24
Committed: Thu Jan 1 11:21:55 2004 UTC (20 years, 3 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.23: +30 -5 lines
Log Message:
Ansification and prototypes.

File Contents

# Content
1 /* RCSid: $Id: rholo.h,v 3.23 2003/07/14 22:24:00 schorsch Exp $ */
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 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 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 */
51
52 /* input variables */
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 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 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}, \
82 {"section", 3, 0, NULL, NULL}, \
83 {"TIME", 2, 0, NULL, fltvalue}, \
84 {"VDISTANCE", 2, 0, NULL, boolvalue}, \
85 }
86
87 /* bundle set requests */
88 #define BS_NEW 1 /* replace current set with new one */
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 */
96 extern char froot[]; /* root file name */
97
98 extern char *outdev; /* output device name */
99
100 extern int readinp; /* read input from stdin */
101
102 extern int force; /* allow overwrite of holodeck */
103
104 extern int nowarn; /* turn warnings off? */
105
106 extern int ncprocs; /* number of requested compute processes */
107 extern int nprocs; /* number of running compute processes */
108
109 extern int chunkycmp; /* using "chunky" comparison mode */
110
111 extern VIEWPOINT myeye; /* target view position */
112
113 extern time_t starttime; /* time we got started */
114 extern time_t endtime; /* time we should end by */
115 extern time_t reporttime; /* time for next report */
116
117 extern long nraysdone; /* number of rays done */
118 extern long npacksdone; /* number of packets done */
119
120 extern int rtargc; /* rtrace command */
121 extern char *rtargv[];
122
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