File: GLE.i

package info (click to toggle)
pyopengl 2.0.1.08-5.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 19,484 kB
  • ctags: 9,036
  • sloc: pascal: 64,950; xml: 28,088; ansic: 20,696; python: 19,761; tcl: 668; makefile: 240; sh: 25
file content (236 lines) | stat: -rw-r--r-- 11,225 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
# BUILD api_versions [0x300]
# BUILD headers ['gle.h']
# BUILD sources ['src/gle/src/rot_prince.c',\
                 'src/gle/src/ex_cut_round.c',\
                 'src/gle/src/ex_raw.c',\
                 'src/gle/src/extrude.c',\
                 'src/gle/src/intersect.c',\
                 'src/gle/src/qmesh.c',\
                 'src/gle/src/ex_angle.c',\
                 'src/gle/src/rotate.c',\
                 'src/gle/src/round_cap.c',\
                 'src/gle/src/segment.c',\
                 'src/gle/src/texgen.c',\
                 'src/gle/src/urotate.c',\
                 'src/gle/src/view.c']
# BUILD include_dirs ['src/gle/src']
*/

%module GLE

#define __version__ "$Revision: 1.19 $"
#define __date__ "$Date: 2003/05/03 21:05:05 $"
#define __api_version__ API_VERSION
#define __author__ "Tarn Weisner Burton <twburton@users.sourceforge.net>"
#define __doc__ "This module provides support for the GLE (Tubing and Extrusion) Library.\n\
Function prototypes are identical to that of the C binding with the small\n\
difference that passing array lengths explicity is not needed.\n\
\n\
Documentation:\n\
    GLE homepage:  http:\057\057linas.org/gle/\n\
    Man Pages:  http:\057\057pyopengl.sourceforge.net/documentation/ref/gle.html"

%{
/**
 *
 * GLE Module for PyOpenGL
 * 
 * Date: May 2001
 *
 * Authors: Tarn Weisner Burton <twburton@users.sourceforge.net>
 * 
***/

/*
 * gle.h
 *
 * FUNCTION:
 * Tubing and Extrusion header file.
 * This file provides protypes and defines for the extrusion 
 * and tubing primitives.
 *
 * HISTORY:
 * Copyright (c) Linas Vepstas 1990, 1991
 */
%}

%include util.inc

GL_EXCEPTION_HANDLER()

typedef double gleDouble;

/* ====================================================== */

/* control join style of the tubes */
int gleGetJoinStyle (void);
DOC(gleGetJoinStyle, "gleGetJoinStyle() -> style")

void gleSetJoinStyle (int style);	/* bitwise OR of flags */
DOC(gleSetJoinStyle, "gleSetJoinStyle(style) -> None")

/* control number of sides used to draw cylinders, cones */
int gleGetNumSides(void);
DOC(gleGetNumSides, "gleGetNumSides() -> sides")

void gleSetNumSides(int slices); 
DOC(gleSetNumSides, "gleSetNumSides(slices) -> None")

/* draw polyclinder, specified as a polyline */
void glePolyCylinder (int d_0_0,	/* num points in polyline */
                   const gleDouble *point_array,	/* polyline vertces */
                   const float *color_array,	/* colors at polyline verts */
                   gleDouble radius);		/* radius of polycylinder */
DOC(glePolyCylinder, "glePolyCylinder(point_array[][3], color_array[][3], radius) -> None")

/* draw polycone, specified as a polyline with radii */
void glePolyCone (int d_0_0,	 /* numpoints in poly-line */
                   const gleDouble *point_array,	/* polyline vertices */
                   const float *color_array,	/* colors at polyline verts */
                   const gleDouble *radius_array); /* cone radii at polyline verts */
DOC(glePolyCone, "glePolyCone(point_array[][3], color_array[][3], radius_array[])")

/* extrude arbitrary 2D contour along arbitrary 3D path */
void gleExtrusion (int d_0_0,         /* number of contour points */
                const gleDouble *contour,     /* 2D contour */
                const gleDouble *cont_normal, /* 2D contour normals */
                const gleDouble *up,            /* up vector for contour */
                int d_6_0,            /* numpoints in poly-line */
                const gleDouble *point_array, /* polyline vertices */
                const float *color_array); /* colors at polyline verts */
DOC(gleExtrusion, "gleExtrusion(contour[][2], cont_normal[][2], up[3], point_array[][3], color_array[][3]) -> None")

/* extrude 2D contour, specifying local rotations (twists) */
void gleTwistExtrusion (int d_0_0,         /* number of contour points */
                const gleDouble *contour,    /* 2D contour */
                const gleDouble *cont_normal, /* 2D contour normals */
                const gleDouble *up,           /* up vector for contour */
                int d_6_0,           /* numpoints in poly-line */
                const gleDouble *point_array,        /* polyline vertices */
                const float *color_array,        /* color at polyline verts */
                const gleDouble *twist_array);   /* countour twists (in degrees) */
DOC(gleTwistExtrusion, "gleTwistExtrusion(contour[][2], cont_normal[][2], up[3], point_array[][3], color_array[][3], twist_array[]) -> None")

/* extrude 2D contour, specifying local affine tranformations */
void gleSuperExtrusion (int d_0_0,  /* number of contour points */
                const gleDouble *contour,    /* 2D contour */
                const gleDouble *cont_normal, /* 2D contour normals */
                const gleDouble *up,           /* up vector for contour */
                int d_6_0,           /* numpoints in poly-line */
                const gleDouble *point_array,        /* polyline vertices */
                const float *color_array,        /* color at polyline verts */
                const gleDouble *xform_array);   /* 2D contour xforms */
DOC(gleSuperExtrusion, "gleSuperExtrusion(contour[][2], cont_normal[][2], up[3], point_array[][3], color_array[][3], xform_array[][2][3]) -> None")

/* spiral moves contour along helical path by parallel transport */
void gleSpiral (int d_0_0,        /* number of contour points */
             const gleDouble *contour,    /* 2D contour */
             const gleDouble *cont_normal, /* 2D contour normals */
             const gleDouble *up,           /* up vector for contour */
             gleDouble startRadius,	/* spiral starts in x-y plane */
             gleDouble drdTheta,        /* change in radius per revolution */
             gleDouble startZ,		/* starting z value */
             gleDouble dzdTheta,        /* change in Z per revolution */
             const gleDouble *startXform, /* starting contour affine xform */
             const gleDouble *dXformdTheta, /* tangent change xform per revoln */
             gleDouble startTheta,	/* start angle in x-y plane */
             gleDouble sweepTheta);	/* degrees to spiral around */
DOC(gleSpiral, "gleSpiral(contour[][2], cont_normal[][3], up[3], startRadius, drdTheta, startZ, dzdTheta, startXform[2][3], dXformdTheta[2][3], startTheta, sweepTheta) -> None")

/* lathe moves contour along helical path by helically shearing 3D space */
void gleLathe (int d_0_0,        /* number of contour points */
             const gleDouble *contour,    /* 2D contour */
             const gleDouble *cont_normal, /* 2D contour normals */
             const gleDouble *up,           /* up vector for contour */
             gleDouble startRadius,	/* spiral starts in x-y plane */
             gleDouble drdTheta,        /* change in radius per revolution */
             gleDouble startZ,		/* starting z value */
             gleDouble dzdTheta,        /* change in Z per revolution */
             const gleDouble *startXform, /* starting contour affine xform */
             const gleDouble *dXformdTheta, /* tangent change xform per revoln */
             gleDouble startTheta,	/* start angle in x-y plane */
             gleDouble sweepTheta);	/* degrees to spiral around */
DOC(gleLathe, "gleLathe(contour[][2], cont_normal[][2], up[3], startRadius, drdTheta, startZ, dzdTheta, startXform[2][3], dXformdTheta[2][3], startTheta, sweepTheta) -> None")

/* similar to spiral, except contour is a circle */
void gleHelicoid (gleDouble rToroid, /* circle contour (torus) radius */
             gleDouble startRadius,	/* spiral starts in x-y plane */
             gleDouble drdTheta,        /* change in radius per revolution */
             gleDouble startZ,		/* starting z value */
             gleDouble dzdTheta,        /* change in Z per revolution */
             const gleDouble *startXform, /* starting contour affine xform */
             const gleDouble *dXformdTheta, /* tangent change xform per revoln */
             gleDouble startTheta,	/* start angle in x-y plane */
             gleDouble sweepTheta);	/* degrees to spiral around */
DOC(gleHelicoid, "gleHelicoid(rToroid, startRadius, drdTheta, startZ, dzdTheta, startXform[2][3], dXformdTheta[2][3], startTheta, sweepTheta) -> None")

/* similar to lathe, except contour is a circle */
void gleToroid (gleDouble rToroid, /* circle contour (torus) radius */
             gleDouble startRadius,	/* spiral starts in x-y plane */
             gleDouble drdTheta,        /* change in radius per revolution */
             gleDouble startZ,		/* starting z value */
             gleDouble dzdTheta,        /* change in Z per revolution */
             const gleDouble *startXform, /* starting contour affine xform */
             const gleDouble *dXformdTheta, /* tangent change xform per revoln */
             gleDouble startTheta,	/* start angle in x-y plane */
             gleDouble sweepTheta);	/* degrees to spiral around */
DOC(gleToroid, "gleToroid(rToroid, startRadius, drdTheta, startZ, dzdTheta, startXform[2][3], dXformdTheta[2][3], startTheta, sweepTheta) -> None")

/* draws a screw shape */
void gleScrew (int d_0_0,          /* number of contour points */
             const gleDouble *contour,    /* 2D contour */
             const gleDouble *cont_normal, /* 2D contour normals */
             const gleDouble *up,           /* up vector for contour */
             gleDouble startz,          /* start of segment */
             gleDouble endz,            /* end of segment */
             gleDouble twist);          /* number of rotations */
DOC(gleScrew, "gleScrew(contour[][2], cont_normal[][2], up[3], startz, endz, twist) -> None")

void gleTextureMode (int mode);
DOC(gleTextureMode, "gleTextureMode(mode) -> None")


%{
PyObject *__info()
{
	return PyList_New(0);
}
%}

PyObject *__info();


/* defines for tubing join styles */
#define TUBE_JN_RAW          0x1
#define TUBE_JN_ANGLE        0x2
#define TUBE_JN_CUT          0x3
#define TUBE_JN_ROUND        0x4
#define TUBE_JN_MASK         0xf    /* mask bits */
#define TUBE_JN_CAP          0x10

/* determine how normal vectors are to be handled */
#define TUBE_NORM_FACET      0x100
#define TUBE_NORM_EDGE       0x200
#define TUBE_NORM_PATH_EDGE  0x400 /* for spiral, lathe, helix primitives */
#define TUBE_NORM_MASK       0xf00    /* mask bits */

/* closed or open countours */
#define TUBE_CONTOUR_CLOSED	0x1000

#define GLE_TEXTURE_ENABLE	0x10000
#define GLE_TEXTURE_STYLE_MASK	0xff
#define GLE_TEXTURE_VERTEX_FLAT		1
#define GLE_TEXTURE_NORMAL_FLAT		2
#define GLE_TEXTURE_VERTEX_CYL		3
#define GLE_TEXTURE_NORMAL_CYL		4
#define GLE_TEXTURE_VERTEX_SPH		5
#define GLE_TEXTURE_NORMAL_SPH		6
#define GLE_TEXTURE_VERTEX_MODEL_FLAT	7
#define GLE_TEXTURE_NORMAL_MODEL_FLAT	8
#define GLE_TEXTURE_VERTEX_MODEL_CYL	9
#define GLE_TEXTURE_NORMAL_MODEL_CYL	10
#define GLE_TEXTURE_VERTEX_MODEL_SPH	11
#define GLE_TEXTURE_NORMAL_MODEL_SPH	12