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