hekeus@6
|
1 /*
|
hekeus@6
|
2 * tube.h
|
hekeus@6
|
3 *
|
hekeus@6
|
4 * FUNCTION:
|
hekeus@6
|
5 * Tubing and Extrusion header file.
|
hekeus@6
|
6 * This file provides protypes and defines for the extrusion
|
hekeus@6
|
7 * and tubing primitives.
|
hekeus@6
|
8 *
|
hekeus@6
|
9 * HISTORY:
|
hekeus@6
|
10 * Linas Vepstas 1990, 1991
|
hekeus@6
|
11 */
|
hekeus@6
|
12
|
hekeus@6
|
13 #ifndef __TUBE_H__
|
hekeus@6
|
14 #define __TUBE_H__
|
hekeus@6
|
15
|
hekeus@6
|
16 #ifdef __cplusplus
|
hekeus@6
|
17 extern "C" {
|
hekeus@6
|
18 #endif
|
hekeus@6
|
19
|
hekeus@6
|
20 /**
|
hekeus@6
|
21 GLE API revision history:
|
hekeus@6
|
22
|
hekeus@6
|
23 GLE_API_VERSION is updated to reflect GLE API changes (interface
|
hekeus@6
|
24 changes, semantic changes, deletions, or additions).
|
hekeus@6
|
25
|
hekeus@6
|
26 GLE_API_VERSION=228 GLUT 3.7 release of GLE.
|
hekeus@6
|
27 **/
|
hekeus@6
|
28 #ifndef GLE_API_VERSION /* allow this to be overriden */
|
hekeus@6
|
29 #define GLE_API_VERSION 228
|
hekeus@6
|
30 #endif
|
hekeus@6
|
31
|
hekeus@6
|
32 /* some types */
|
hekeus@6
|
33 #ifndef gleDouble
|
hekeus@6
|
34 #define gleDouble double
|
hekeus@6
|
35 #endif
|
hekeus@6
|
36 typedef gleDouble gleAffine[2][3];
|
hekeus@6
|
37
|
hekeus@6
|
38 /* ====================================================== */
|
hekeus@6
|
39
|
hekeus@6
|
40 /* defines for tubing join styles */
|
hekeus@6
|
41 #define TUBE_JN_RAW 0x1
|
hekeus@6
|
42 #define TUBE_JN_ANGLE 0x2
|
hekeus@6
|
43 #define TUBE_JN_CUT 0x3
|
hekeus@6
|
44 #define TUBE_JN_ROUND 0x4
|
hekeus@6
|
45 #define TUBE_JN_MASK 0xf /* mask bits */
|
hekeus@6
|
46 #define TUBE_JN_CAP 0x10
|
hekeus@6
|
47
|
hekeus@6
|
48 /* determine how normal vectors are to be handled */
|
hekeus@6
|
49 #define TUBE_NORM_FACET 0x100
|
hekeus@6
|
50 #define TUBE_NORM_EDGE 0x200
|
hekeus@6
|
51 #define TUBE_NORM_PATH_EDGE 0x400 /* for spiral, lathe, helix primitives */
|
hekeus@6
|
52 #define TUBE_NORM_MASK 0xf00 /* mask bits */
|
hekeus@6
|
53
|
hekeus@6
|
54 /* closed or open countours */
|
hekeus@6
|
55 #define TUBE_CONTOUR_CLOSED 0x1000
|
hekeus@6
|
56
|
hekeus@6
|
57 #define GLE_TEXTURE_ENABLE 0x10000
|
hekeus@6
|
58 #define GLE_TEXTURE_STYLE_MASK 0xff
|
hekeus@6
|
59 #define GLE_TEXTURE_VERTEX_FLAT 1
|
hekeus@6
|
60 #define GLE_TEXTURE_NORMAL_FLAT 2
|
hekeus@6
|
61 #define GLE_TEXTURE_VERTEX_CYL 3
|
hekeus@6
|
62 #define GLE_TEXTURE_NORMAL_CYL 4
|
hekeus@6
|
63 #define GLE_TEXTURE_VERTEX_SPH 5
|
hekeus@6
|
64 #define GLE_TEXTURE_NORMAL_SPH 6
|
hekeus@6
|
65 #define GLE_TEXTURE_VERTEX_MODEL_FLAT 7
|
hekeus@6
|
66 #define GLE_TEXTURE_NORMAL_MODEL_FLAT 8
|
hekeus@6
|
67 #define GLE_TEXTURE_VERTEX_MODEL_CYL 9
|
hekeus@6
|
68 #define GLE_TEXTURE_NORMAL_MODEL_CYL 10
|
hekeus@6
|
69 #define GLE_TEXTURE_VERTEX_MODEL_SPH 11
|
hekeus@6
|
70 #define GLE_TEXTURE_NORMAL_MODEL_SPH 12
|
hekeus@6
|
71
|
hekeus@6
|
72 #ifdef GL_32
|
hekeus@6
|
73 /* HACK for GL 3.2 -- needed because no way to tell if lighting is on. */
|
hekeus@6
|
74 #define TUBE_LIGHTING_ON 0x80000000
|
hekeus@6
|
75
|
hekeus@6
|
76 #define gleExtrusion extrusion
|
hekeus@6
|
77 #define gleSetJoinStyle setjoinstyle
|
hekeus@6
|
78 #define gleGetJoinStyle getjoinstyle
|
hekeus@6
|
79 #define glePolyCone polycone
|
hekeus@6
|
80 #define glePolyCylinder polycylinder
|
hekeus@6
|
81 #define gleSuperExtrusion super_extrusion
|
hekeus@6
|
82 #define gleTwistExtrusion twist_extrusion
|
hekeus@6
|
83 #define gleSpiral spiral
|
hekeus@6
|
84 #define gleLathe lathe
|
hekeus@6
|
85 #define gleHelicoid helicoid
|
hekeus@6
|
86 #define gleToroid toroid
|
hekeus@6
|
87 #define gleScrew screw
|
hekeus@6
|
88
|
hekeus@6
|
89 #endif /* GL_32 */
|
hekeus@6
|
90
|
hekeus@6
|
91 extern int gleGetJoinStyle (void);
|
hekeus@6
|
92 extern void gleSetJoinStyle (int style); /* bitwise OR of flags */
|
hekeus@6
|
93 extern int gleGetNumSlices(void);
|
hekeus@6
|
94 extern void gleSetNumSlices(int slices);
|
hekeus@6
|
95
|
hekeus@6
|
96 /* draw polyclinder, specified as a polyline */
|
hekeus@6
|
97 extern void glePolyCylinder (int npoints, /* num points in polyline */
|
hekeus@6
|
98 gleDouble point_array[][3], /* polyline vertces */
|
hekeus@6
|
99 float color_array[][3], /* colors at polyline verts */
|
hekeus@6
|
100 gleDouble radius); /* radius of polycylinder */
|
hekeus@6
|
101
|
hekeus@6
|
102 /* draw polycone, specified as a polyline with radii */
|
hekeus@6
|
103 extern void glePolyCone (int npoints, /* numpoints in poly-line */
|
hekeus@6
|
104 gleDouble point_array[][3], /* polyline vertices */
|
hekeus@6
|
105 float color_array[][3], /* colors at polyline verts */
|
hekeus@6
|
106 gleDouble radius_array[]); /* cone radii at polyline verts */
|
hekeus@6
|
107
|
hekeus@6
|
108 /* extrude arbitrary 2D contour along arbitrary 3D path */
|
hekeus@6
|
109 extern void gleExtrusion (int ncp, /* number of contour points */
|
hekeus@6
|
110 gleDouble contour[][2], /* 2D contour */
|
hekeus@6
|
111 gleDouble cont_normal[][2], /* 2D contour normals */
|
hekeus@6
|
112 gleDouble up[3], /* up vector for contour */
|
hekeus@6
|
113 int npoints, /* numpoints in poly-line */
|
hekeus@6
|
114 gleDouble point_array[][3], /* polyline vertices */
|
hekeus@6
|
115 float color_array[][3]); /* colors at polyline verts */
|
hekeus@6
|
116
|
hekeus@6
|
117 /* extrude 2D contour, specifying local rotations (twists) */
|
hekeus@6
|
118 extern void gleTwistExtrusion (int ncp, /* number of contour points */
|
hekeus@6
|
119 gleDouble contour[][2], /* 2D contour */
|
hekeus@6
|
120 gleDouble cont_normal[][2], /* 2D contour normals */
|
hekeus@6
|
121 gleDouble up[3], /* up vector for contour */
|
hekeus@6
|
122 int npoints, /* numpoints in poly-line */
|
hekeus@6
|
123 gleDouble point_array[][3], /* polyline vertices */
|
hekeus@6
|
124 float color_array[][3], /* color at polyline verts */
|
hekeus@6
|
125 gleDouble twist_array[]); /* countour twists (in degrees) */
|
hekeus@6
|
126
|
hekeus@6
|
127 /* extrude 2D contour, specifying local affine tranformations */
|
hekeus@6
|
128 extern void gleSuperExtrusion (int ncp, /* number of contour points */
|
hekeus@6
|
129 gleDouble contour[][2], /* 2D contour */
|
hekeus@6
|
130 gleDouble cont_normal[][2], /* 2D contour normals */
|
hekeus@6
|
131 gleDouble up[3], /* up vector for contour */
|
hekeus@6
|
132 int npoints, /* numpoints in poly-line */
|
hekeus@6
|
133 gleDouble point_array[][3], /* polyline vertices */
|
hekeus@6
|
134 float color_array[][3], /* color at polyline verts */
|
hekeus@6
|
135 gleDouble xform_array[][2][3]); /* 2D contour xforms */
|
hekeus@6
|
136
|
hekeus@6
|
137 /* spiral moves contour along helical path by parallel transport */
|
hekeus@6
|
138 extern void gleSpiral (int ncp, /* number of contour points */
|
hekeus@6
|
139 gleDouble contour[][2], /* 2D contour */
|
hekeus@6
|
140 gleDouble cont_normal[][2], /* 2D contour normals */
|
hekeus@6
|
141 gleDouble up[3], /* up vector for contour */
|
hekeus@6
|
142 gleDouble startRadius, /* spiral starts in x-y plane */
|
hekeus@6
|
143 gleDouble drdTheta, /* change in radius per revolution */
|
hekeus@6
|
144 gleDouble startZ, /* starting z value */
|
hekeus@6
|
145 gleDouble dzdTheta, /* change in Z per revolution */
|
hekeus@6
|
146 gleDouble startXform[2][3], /* starting contour affine xform */
|
hekeus@6
|
147 gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
|
hekeus@6
|
148 gleDouble startTheta, /* start angle in x-y plane */
|
hekeus@6
|
149 gleDouble sweepTheta); /* degrees to spiral around */
|
hekeus@6
|
150
|
hekeus@6
|
151 /* lathe moves contour along helical path by helically shearing 3D space */
|
hekeus@6
|
152 extern void gleLathe (int ncp, /* number of contour points */
|
hekeus@6
|
153 gleDouble contour[][2], /* 2D contour */
|
hekeus@6
|
154 gleDouble cont_normal[][2], /* 2D contour normals */
|
hekeus@6
|
155 gleDouble up[3], /* up vector for contour */
|
hekeus@6
|
156 gleDouble startRadius, /* spiral starts in x-y plane */
|
hekeus@6
|
157 gleDouble drdTheta, /* change in radius per revolution */
|
hekeus@6
|
158 gleDouble startZ, /* starting z value */
|
hekeus@6
|
159 gleDouble dzdTheta, /* change in Z per revolution */
|
hekeus@6
|
160 gleDouble startXform[2][3], /* starting contour affine xform */
|
hekeus@6
|
161 gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
|
hekeus@6
|
162 gleDouble startTheta, /* start angle in x-y plane */
|
hekeus@6
|
163 gleDouble sweepTheta); /* degrees to spiral around */
|
hekeus@6
|
164
|
hekeus@6
|
165 /* similar to spiral, except contour is a circle */
|
hekeus@6
|
166 extern void gleHelicoid (gleDouble rToroid, /* circle contour (torus) radius */
|
hekeus@6
|
167 gleDouble startRadius, /* spiral starts in x-y plane */
|
hekeus@6
|
168 gleDouble drdTheta, /* change in radius per revolution */
|
hekeus@6
|
169 gleDouble startZ, /* starting z value */
|
hekeus@6
|
170 gleDouble dzdTheta, /* change in Z per revolution */
|
hekeus@6
|
171 gleDouble startXform[2][3], /* starting contour affine xform */
|
hekeus@6
|
172 gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
|
hekeus@6
|
173 gleDouble startTheta, /* start angle in x-y plane */
|
hekeus@6
|
174 gleDouble sweepTheta); /* degrees to spiral around */
|
hekeus@6
|
175
|
hekeus@6
|
176 /* similar to lathe, except contour is a circle */
|
hekeus@6
|
177 extern void gleToroid (gleDouble rToroid, /* circle contour (torus) radius */
|
hekeus@6
|
178 gleDouble startRadius, /* spiral starts in x-y plane */
|
hekeus@6
|
179 gleDouble drdTheta, /* change in radius per revolution */
|
hekeus@6
|
180 gleDouble startZ, /* starting z value */
|
hekeus@6
|
181 gleDouble dzdTheta, /* change in Z per revolution */
|
hekeus@6
|
182 gleDouble startXform[2][3], /* starting contour affine xform */
|
hekeus@6
|
183 gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
|
hekeus@6
|
184 gleDouble startTheta, /* start angle in x-y plane */
|
hekeus@6
|
185 gleDouble sweepTheta); /* degrees to spiral around */
|
hekeus@6
|
186
|
hekeus@6
|
187 /* draws a screw shape */
|
hekeus@6
|
188 extern void gleScrew (int ncp, /* number of contour points */
|
hekeus@6
|
189 gleDouble contour[][2], /* 2D contour */
|
hekeus@6
|
190 gleDouble cont_normal[][2], /* 2D contour normals */
|
hekeus@6
|
191 gleDouble up[3], /* up vector for contour */
|
hekeus@6
|
192 gleDouble startz, /* start of segment */
|
hekeus@6
|
193 gleDouble endz, /* end of segment */
|
hekeus@6
|
194 gleDouble twist); /* number of rotations */
|
hekeus@6
|
195
|
hekeus@6
|
196 extern void gleTextureMode (int mode);
|
hekeus@6
|
197
|
hekeus@6
|
198 #ifdef __cplusplus
|
hekeus@6
|
199 }
|
hekeus@6
|
200
|
hekeus@6
|
201 #endif
|
hekeus@6
|
202 #endif /* __TUBE_H__ */
|
hekeus@6
|
203 /* ================== END OF FILE ======================= */
|