ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/object.h
Revision: 2.15
Committed: Thu Jun 26 00:58:09 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 2.14: +2 -2 lines
Log Message:
Abstracted process and path handling for Windows.
Renamed FLOAT to RREAL because of conflict on Windows.
Added conditional compiles for some signal handlers.

File Contents

# Content
1 /* RCSid $Id: object.h,v 2.14 2003/06/20 00:25:49 greg Exp $ */
2 /*
3 * object.h - header file for routines using objects and object sets.
4 *
5 * Include after "standard.h"
6 */
7 #ifndef _RAD_OBJECT_H_
8 #define _RAD_OBJECT_H_
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 #include "copyright.h"
14
15 #ifndef OCTREE
16 #define OCTREE int
17 #endif
18
19 /*
20 * Object definitions require general specifications
21 * which may include a number of different argument types.
22 * The following structure aids in the storage of such
23 * argument lists.
24 */
25
26 typedef struct {
27 short nsargs; /* # of string arguments */
28 short nfargs; /* # of real arguments */
29 char **sarg; /* string arguments */
30 RREAL *farg; /* real arguments */
31 #ifdef IARGS
32 short niargs; /* # of integer arguments */
33 long *iarg; /* integer arguments */
34 #endif
35 } FUNARGS;
36
37 #define MAXSTR 128 /* maximum string length */
38
39 /*
40 * An object is defined as an index into an array of
41 * structures containing the object type and specification
42 * and the modifier index.
43 */
44
45 #ifndef OBJECT
46 #ifdef SMLMEM
47 #define OBJECT int16 /* index to object array */
48 #else
49 #define OBJECT int32 /* index to object array */
50 #endif
51 #endif
52
53 typedef struct {
54 OBJECT omod; /* modifier number */
55 short otype; /* object type number */
56 char *oname; /* object name */
57 FUNARGS oargs; /* object specification */
58 char *os; /* object structure */
59 } OBJREC;
60
61 #ifndef MAXOBJBLK
62 #ifdef SMLMEM
63 #define MAXOBJBLK 63 /* maximum number of object blocks */
64 #else
65 #define MAXOBJBLK 65535 /* maximum number of object blocks */
66 #endif
67 #endif
68
69 extern OBJREC *objblock[MAXOBJBLK]; /* the object blocks */
70 extern OBJECT nobjects; /* # of objects */
71
72 #define OBJBLKSHFT 9
73 #define OBJBLKSIZ (1<<OBJBLKSHFT) /* object block size */
74 #define objptr(obj) (objblock[(obj)>>OBJBLKSHFT]+((obj)&(OBJBLKSIZ-1)))
75
76 #define OVOID (-1) /* void object */
77 #define VOIDID "void" /* void identifier */
78
79 /*
80 * Object sets begin with the number of objects and proceed with
81 * the objects in ascending order.
82 */
83
84 #define MAXSET 511 /* maximum object set size */
85
86 #define setfree(os) free((void *)(os))
87
88 extern void (*addobjnotify[])(); /* people to notify of new objects */
89
90 /* defined in modobject.c */
91 extern OBJECT objndx(OBJREC *op);
92 extern OBJECT lastmod(OBJECT obj, char *mname);
93 extern OBJECT modifier(char *name);
94 extern OBJECT object(char *oname);
95 extern void insertobject(OBJECT obj);
96 extern void clearobjndx(void);
97 /* defined in objset.c */
98 extern void insertelem(OBJECT *os, OBJECT obj);
99 extern void deletelem(OBJECT *os, OBJECT obj);
100 extern int inset(OBJECT *os, OBJECT obj);
101 extern int setequal(OBJECT *os1, OBJECT *os2);
102 extern void setcopy(OBJECT *os1, OBJECT *os2);
103 extern OBJECT * setsave(OBJECT *os);
104 extern void setunion(OBJECT *osr, OBJECT *os1, OBJECT *os2);
105 extern void setintersect(OBJECT *osr, OBJECT *os1, OBJECT *os2);
106 extern OCTREE fullnode(OBJECT *oset);
107 extern void objset(OBJECT *oset, OCTREE ot);
108 extern int dosets(int (*f)());
109 extern void donesets(void);
110
111 /* defined in otypes.c */
112 extern int otype(char *ofname);
113 extern void objerror(OBJREC *o, int etyp, char *msg);
114 /* defined in readfargs.c */
115 extern int readfargs(FUNARGS *fa, FILE *fp);
116 extern void freefargs(FUNARGS *fa);
117 /* defined in readobj.c */
118 extern void readobj(char *inpspec);
119 extern void getobject(char *name, FILE *fp);
120 extern OBJECT newobject();
121 extern void freeobjects(int firstobj, int nobjs);
122 /* defined in free_os.c */
123 extern int free_os(OBJREC *op);
124
125
126 #ifdef __cplusplus
127 }
128 #endif
129 #endif /* _RAD_OBJECT_H_ */
130