1 /* Copyright (C) 1992-1998 The Geometry Center
2  * Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips
3  *
4  * This file is part of Geomview.
5  *
6  * Geomview is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published
8  * by the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * Geomview is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Geomview; see the file COPYING.  If not, write
18  * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
19  * USA, or visit http://www.gnu.org.
20  */
21 
22 
23 /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
24 
25 #ifndef CR_DEF
26 #define CR_DEF
27 
28 #include <stdarg.h>	/* So we only have to do it once, here. */
29 
30 /* This stuff should be an enum, not a define */
31 
32 	/* Generic attributes */
33 #define	CR_END		0	/* Marks end of create list (any object) */
34 #define CR_COPY		1	/* no argument  (any object)		*/
35 #define CR_NOCOPY	2	/* no argument  (any object)		*/
36 
37 	/* Generic Geom attributes */
38 #define CR_APPEAR	8	/* marks beginning of Appearance create list) */
39 
40 #define CR_POINT	9	/* Point3 []	(any Geom with vertices) */
41 #define CR_POINT4	18	/* HPoint3 []	(any Geom with 4D vertices) */
42 #define CR_NORMAL	10	/* Point3 []	(any Geom w/per-vtx normals) */
43 #define CR_COLOR	11	/* ColorA []	(any Geom w/per-vtx colors) */
44 #define CR_OPACITY	12	/* XXX Not used yet XXX		*/
45 
46 #define CR_FLAG		13	/* int flags	(patch,Mesh,PolyList,Quad) */
47 #define	CR_FLAGMERGE	14	/* int flags, int flagmask		*/
48 	/* Control of 'override' mask for mergeable things (Appearance)	*/
49 #define	CR_OVERMERGE	15	/* int override, int ovmask		*/
50 
51 	/* BBox attributes */
52 #define CR_MAX		16	/* Point3 *	(BBox)			*/
53 #define CR_MIN		17	/* Point3 *	(BBox)			*/
54 #define CR_4MAX		1492	/* HPoint3 *	(BBox)			*/
55 #define CR_4MIN		1066	/* HPoint3 *	(BBox)			*/
56 #define CR_NMIN		2048    /* HPointN *	(BBox)			*/
57 #define CR_NMAX		2049    /* HPointN *	(BBox)			*/
58 #define CR_NCENTER      2050	/* HPointN *    (return NDcenter of BBox) */
59 
60 #define CR_4D		19	/* is this object a true 4D item?	*/
61 
62 	/* Hierarchy object (Inst, List, TList) attributes */
63 #define CR_AXIS		20	/* Transform	(Inst)			*/
64 #define	CR_AXISHANDLE	28	/* Handle * to TransObj (for Inst)	*/
65 #define CR_NDAXIS	202	/* Transform	(Inst)			*/
66 #define	CR_NDAXISHANDLE	203	/* Handle * to NTransObj (for Inst)	*/
67 #define CR_GEOM		21	/* Geom *child	(Inst,List)		*/
68 #define	CR_GEOMHANDLE	22	/* Handle *childname (Inst,List)	*/
69 #define CR_TLIST	23	/* Geom *tlist	   (Inst,TList)		*/
70 #define	CR_TLISTHANDLE	24	/* Handle *tlistname (Inst,TList) 	*/
71 #define CR_TXTLIST	204	/* Geom *txtlist	   (Inst)	*/
72 #define	CR_TXTLISTHANDLE 205	/* Handle *txtlistname (Inst) 		*/
73 #define CR_ELEM		25	/* Transform []	(TList)			*/
74 #define CR_NELEM	26	/* int nxforms(TList), int nquads (Quad)*/
75 #define CR_CDR		27	/* List *	(List) (obsolescent?)	*/
76 #define CR_HANDLE_GEOM  29	/* Handle *, Geom *	(Inst, List)	*/
77 #define	CR_CAR		CR_GEOM	/* Geom *	(List) (obsolescent)	*/
78 #define	CR_UNIT		CR_GEOM /* Geom *	(Inst) (obsolescent)	*/
79 #define	CR_LOCATION	201	/* int		(Inst) L_LOCAL, L_CAMERA, ...*/
80 
81 	/* Mesh attributes */
82 #define CR_NU		30	/* int nu	(Mesh)			*/
83 #define CR_NV		31	/* int nv	(Mesh)			*/
84 #define	CR_UWRAP	32	/* int uwrapped	(Mesh)			*/
85 #define	CR_VWRAP	33	/* int vwrapped	(Mesh)			*/
86 #define CR_U		34	/* Point3 texturecoords[] (Mesh)	*/
87 
88 #define CR_UMIN		35	/* int umin	(Mesh) [submesh]	*/
89 #define CR_UMAX		36	/* int umax	(Mesh)			*/
90 #define CR_VMIN		37	/* int vmin	(Mesh) 			*/
91 #define CR_VMAX		38	/* int vmax	(Mesh)			*/
92 
93 	/* Patch attributes */
94 #define CR_DEGU		40	/* int u_degree	(patches)		*/
95 #define CR_DEGV		41	/* int v_degree	(patches)		*/
96 #define CR_MESH		42	/* Mesh *	(patches)		*/
97 #define CR_DIM		43	/* int vertex_dim (= 3 or 4) (patches)	*/
98 #define	CR_ST		44	/* struct { float s, t; } stcoords[4];	*/
99 				/* (texture coords at corners (Mesh,Patch) */
100 #define	CR_MESHDIM	45	/* mesh surface dimension (typ. 2)	*/
101 #define	CR_MESHSIZE	46	/* int meshsize[meshdim] 	 	*/
102 
103 	/* Vect attributes */
104 #define CR_NVECT	48	/* int  nvectors (Vect)			*/
105 #define CR_NVERT	49	/* int nvertices (Vect)			*/
106 #define CR_NCOLR	50	/* int ncolors  (Vect)			*/
107 #define CR_VECTC	51	/* short nverts_per_vector[nvect] (Vect)*/
108 #define CR_COLRC	52	/* short ncolors_per_vector[nvect] (Vect)*/
109 
110 	/* PolyList attributes */
111 #define CR_NPOLY        56	/* int npolygons	(PolyList)	*/
112 /*      CR_NVERT	(48)	   int nvertperpol[npoly]		*/
113 #define CR_VERT         57	/* int vertindex[sum(nvertperpol[])]	*/
114 #define CR_POLYNORMAL   58	/* Point3 facenormal[npoly]		*/
115 #define CR_POLYCOLOR    59	/* ColorA facecolor[npoly]		*/
116 #define CR_POLYFLAGS   300      /* per poly concave/not-flat flags      */
117 
118 	/* Sphere attributes */
119 #define CR_CENTER		60	/* HPoint3 *center (also bbox)  */
120 #define CR_RADIUS		61	/* float  radius		*/
121 #define CR_SPACE		64	/* Space - TM_EUCLIDEAN is default */
122 #define CR_NENCOMPASS_POINTS	65	/* int - Number of points to be
123 					 * put inside sphere */
124 #define CR_ENCOMPASS_POINTS	66	/* Hpoint3 * - points to be inside
125 					 * sphere (for bounding spheres */
126 /*      CR_AXIS			20	Transform to apply to points before
127 					making bounding sphere */
128 #define CR_SPHERETX             67      /* texture mapping for sphere */
129 
130 /* tokens for Camera moved to camera.h */
131 
132 /* tokens for Appearances, Lights, Materials moved to shade/appearance.h */
133 
134 #define	CR_POLICE	62	/* enforce strong checking on input data? */
135 #define	CR_NOPOLICE	63	/* enforce strong checking on input data? */
136 
137 
138 
139 #endif
140