| 1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
| 2 |
< |
|
| 3 |
< |
/* SCCSid "$SunId$ SGI" */ |
| 4 |
< |
|
| 1 |
> |
/* RCSid: $Id$ */ |
| 2 |
|
/* |
| 3 |
|
* Header file for rholo program |
| 4 |
|
*/ |
| 5 |
+ |
#ifndef _RAD_RHOLO_H_ |
| 6 |
+ |
#define _RAD_RHOLO_H_ |
| 7 |
|
|
| 8 |
|
#include "holo.h" |
| 9 |
|
#include "vars.h" |
| 10 |
|
|
| 11 |
+ |
#ifdef __cplusplus |
| 12 |
+ |
extern "C" { |
| 13 |
+ |
#endif |
| 14 |
+ |
|
| 15 |
|
#ifndef RPACKSIZ |
| 16 |
|
#define RPACKSIZ 21 /* good packet size */ |
| 17 |
|
#endif |
| 18 |
|
|
| 19 |
|
typedef struct packet { |
| 20 |
< |
int2 hd; /* holodeck section (first) */ |
| 21 |
< |
int4 bi; /* beam index (second) */ |
| 22 |
< |
int4 nr; /* number of rays (third) */ |
| 23 |
< |
RAYVAL ra[RPACKSIZ]; /* ray values (fourth) */ |
| 20 |
> |
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 |
> |
RAYVAL ra[RPACKSIZ]; /* ray values (fifth) */ |
| 25 |
|
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 |
< |
int2 hd; /* holodeck section (first) */ |
| 31 |
< |
int4 bi; /* beam index (second) */ |
| 32 |
< |
int4 nr; /* number of rays (third) */ |
| 30 |
> |
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 |
|
} PACKHEAD; /* followed by ray values */ |
| 35 |
|
|
| 36 |
|
#define packsiz(nr) (sizeof(PACKHEAD)+(nr)*sizeof(RAYVAL)) |
| 37 |
< |
#define packray(p) (RAYVAL *)((PACKHEAD *)(p)+1) |
| 37 |
> |
#define packra(p) ((RAYVAL *)((p)+1)) |
| 38 |
|
|
| 39 |
+ |
typedef struct { |
| 40 |
+ |
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 |
+ |
FVECT vpt; /* view (eye point) position */ |
| 46 |
+ |
double rng; /* desired mean radius for sample rays */ |
| 47 |
+ |
} VIEWPOINT; /* target eye position */ |
| 48 |
+ |
|
| 49 |
|
/* input variables */ |
| 50 |
< |
#define RENDER 0 /* rendering options */ |
| 51 |
< |
#define VIEW 1 /* starting view */ |
| 52 |
< |
#define SECTION 2 /* holodeck section boundaries */ |
| 53 |
< |
#define OCTREE 3 /* octree file name */ |
| 54 |
< |
#define RIF 4 /* rad input file */ |
| 55 |
< |
#define EXPOSURE 5 /* section exposure value */ |
| 56 |
< |
#define TIME 6 /* maximum rendering time */ |
| 57 |
< |
#define DISKSPACE 7 /* how much disk space to use */ |
| 58 |
< |
#define CACHE 8 /* amount of memory to use as cache */ |
| 59 |
< |
#define GRID 9 /* target grid size */ |
| 60 |
< |
#define OBSTRUCTIONS 10 /* shall we track obstructions? */ |
| 61 |
< |
#define OCCUPANCY 11 /* expected occupancy probability */ |
| 62 |
< |
#define REPORT 12 /* report interval and error file */ |
| 50 |
> |
#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 |
> |
#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 |
|
|
| 65 |
< |
#define NRHVARS 13 /* number of variables */ |
| 65 |
> |
#define NRHVARS 14 /* number of variables */ |
| 66 |
|
|
| 67 |
|
#define RHVINIT { \ |
| 52 |
– |
{"render", 3, 0, NULL, catvalues}, \ |
| 53 |
– |
{"view", 2, 0, NULL, NULL}, \ |
| 54 |
– |
{"section", 3, 0, NULL, NULL}, \ |
| 55 |
– |
{"OCTREE", 3, 0, NULL, onevalue}, \ |
| 56 |
– |
{"RIF", 3, 0, NULL, onevalue}, \ |
| 57 |
– |
{"EXPOSURE", 3, 0, NULL, fltvalue}, \ |
| 58 |
– |
{"TIME", 2, 0, NULL, fltvalue}, \ |
| 59 |
– |
{"DISKSPACE", 3, 0, NULL, fltvalue}, \ |
| 68 |
|
{"CACHE", 2, 0, NULL, fltvalue}, \ |
| 69 |
+ |
{"DISKSPACE", 3, 0, NULL, fltvalue}, \ |
| 70 |
+ |
{"EYESEP", 3, 0, NULL, fltvalue}, \ |
| 71 |
+ |
{"geometry", 3, 0, NULL, NULL}, \ |
| 72 |
|
{"GRID", 2, 0, NULL, fltvalue}, \ |
| 73 |
|
{"OBSTRUCTIONS",3, 0, NULL, boolvalue}, \ |
| 74 |
< |
{"OCCUPANCY", 3, 0, NULL, onevalue}, \ |
| 74 |
> |
{"OCTREE", 3, 0, NULL, onevalue}, \ |
| 75 |
> |
{"portals", 3, 0, NULL, NULL}, \ |
| 76 |
> |
{"render", 3, 0, NULL, catvalues}, \ |
| 77 |
|
{"REPORT", 3, 0, NULL, onevalue}, \ |
| 78 |
+ |
{"RIF", 3, 0, NULL, onevalue}, \ |
| 79 |
+ |
{"section", 3, 0, NULL, NULL}, \ |
| 80 |
+ |
{"TIME", 2, 0, NULL, fltvalue}, \ |
| 81 |
+ |
{"VDISTANCE", 2, 0, NULL, boolvalue}, \ |
| 82 |
|
} |
| 83 |
|
|
| 84 |
+ |
/* bundle set requests */ |
| 85 |
+ |
#define BS_NEW 1 /* replace current set with new one */ |
| 86 |
+ |
#define BS_ADD 2 /* add to current set */ |
| 87 |
+ |
#define BS_ADJ 3 /* adjust current set quantities */ |
| 88 |
+ |
#define BS_DEL 4 /* delete from current set */ |
| 89 |
+ |
#define BS_MAX 5 /* set to max of old and new */ |
| 90 |
+ |
|
| 91 |
|
extern char *progname; /* our program name */ |
| 92 |
|
extern char *hdkfile; /* holodeck file name */ |
| 93 |
|
extern char froot[]; /* root file name */ |
| 94 |
|
|
| 95 |
+ |
extern char *outdev; /* output device name */ |
| 96 |
+ |
|
| 97 |
+ |
extern int readinp; /* read input from stdin */ |
| 98 |
+ |
|
| 99 |
+ |
extern int force; /* allow overwrite of holodeck */ |
| 100 |
+ |
|
| 101 |
|
extern int nowarn; /* turn warnings off? */ |
| 102 |
|
|
| 103 |
< |
extern double expval; /* global exposure value */ |
| 103 |
> |
extern int ncprocs; /* number of requested compute processes */ |
| 104 |
> |
extern int nprocs; /* number of running compute processes */ |
| 105 |
|
|
| 106 |
< |
extern int ncprocs; /* number of compute processes */ |
| 106 |
> |
extern int chunkycmp; /* using "chunky" comparison mode */ |
| 107 |
|
|
| 108 |
+ |
extern VIEWPOINT myeye; /* target view position */ |
| 109 |
+ |
|
| 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 |
+ |
extern long nraysdone; /* number of rays done */ |
| 115 |
+ |
extern long npacksdone; /* number of packets done */ |
| 116 |
+ |
|
| 117 |
|
extern int rtargc; /* rtrace command */ |
| 118 |
|
extern char *rtargv[]; |
| 119 |
|
|
| 120 |
|
extern PACKET *do_packets(), *get_packets(), *flush_queue(); |
| 121 |
+ |
|
| 122 |
+ |
extern int16 *viewbeams(); |
| 123 |
+ |
|
| 124 |
+ |
|
| 125 |
+ |
#ifdef __cplusplus |
| 126 |
+ |
} |
| 127 |
+ |
#endif |
| 128 |
+ |
#endif /* _RAD_RHOLO_H_ */ |
| 129 |
+ |
|