fix minor warnings from g++ 3.2
[mesa.git] / src / glu / sgi / libnurbs / internals / nurbstess.h
1 /*
2 ** License Applicability. Except to the extent portions of this file are
3 ** made subject to an alternative license as permitted in the SGI Free
4 ** Software License B, Version 1.1 (the "License"), the contents of this
5 ** file are subject only to the provisions of the License. You may not use
6 ** this file except in compliance with the License. You may obtain a copy
7 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
8 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
9 **
10 ** http://oss.sgi.com/projects/FreeB
11 **
12 ** Note that, as provided in the License, the Software is distributed on an
13 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
14 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
15 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
16 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
17 **
18 ** Original Code. The Original Code is: OpenGL Sample Implementation,
19 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
20 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
21 ** Copyright in any portions created by third parties is as indicated
22 ** elsewhere herein. All Rights Reserved.
23 **
24 ** Additional Notice Provisions: The application programming interfaces
25 ** established by SGI in conjunction with the Original Code are The
26 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
27 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
28 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
29 ** Window System(R) (Version 1.3), released October 19, 1998. This software
30 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
31 ** published by SGI, but has not been independently verified as being
32 ** compliant with the OpenGL(R) version 1.2.1 Specification.
33 */
34
35 /*
36 * nurbstess.h
37 *
38 * $Date: 2003/10/15 21:11:13 $ $Revision: 1.3 $
39 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.h,v 1.3 2003/10/15 21:11:13 brianp Exp $
40 */
41
42 #ifndef __glunurbstess_h_
43 #define __glunurbstess_h_
44
45 #include "mysetjmp.h"
46 #include "subdivider.h"
47 #include "renderhints.h"
48 #include "backend.h"
49 #include "maplist.h"
50 #include "reader.h"
51 #include "nurbsconsts.h"
52
53 struct Knotvector;
54 class Quilt;
55 class DisplayList;
56 class BasicCurveEvaluator;
57 class BasicSurfaceEvaluator;
58
59 class NurbsTessellator {
60 public:
61 NurbsTessellator( BasicCurveEvaluator &c,
62 BasicSurfaceEvaluator &e );
63 virtual ~NurbsTessellator( void );
64
65 void getnurbsproperty( long, INREAL * );
66 void getnurbsproperty( long, long, INREAL * );
67 void setnurbsproperty( long, INREAL );
68 void setnurbsproperty( long, long, INREAL );
69 void setnurbsproperty( long, long, INREAL * );
70 void setnurbsproperty( long, long, INREAL *, long, long );
71
72 // called before a tessellation begins/ends
73 virtual void bgnrender( void );
74 virtual void endrender( void );
75
76 // called to make a display list of the output vertices
77 virtual void makeobj( int n );
78 virtual void closeobj( void );
79
80 // called when a error occurs
81 virtual void errorHandler( int );
82
83 void bgnsurface( long );
84 void endsurface( void );
85 void bgntrim( void );
86 void endtrim( void );
87 void bgncurve( long );
88 void endcurve( void );
89 void pwlcurve( long, INREAL[], long, long );
90 void nurbscurve( long, INREAL[], long, INREAL[], long, long );
91 void nurbssurface( long, INREAL[], long, INREAL[], long, long,
92 INREAL[], long, long, long );
93
94 void defineMap( long, long, long );
95 void redefineMaps( void );
96
97 // recording of input description
98 void discardRecording( void * );
99 void * beginRecording( void );
100 void endRecording( void );
101 void playRecording( void * );
102
103 //for optimizing untrimmed nurbs in the case of domain distance sampling
104 void set_domain_distance_u_rate(REAL u_rate);
105 void set_domain_distance_v_rate(REAL v_rate);
106 void set_is_domain_distance_sampling(int flag);
107
108
109 protected:
110 Renderhints renderhints;
111 Maplist maplist;
112 Backend backend;
113
114 private:
115
116 void resetObjects( void );
117 int do_check_knots( Knotvector *, char * );
118 void do_nurbserror( int );
119 void do_bgncurve( O_curve * );
120 void do_endcurve( void );
121 void do_freeall( void );
122 void do_freecurveall( O_curve * );
123 void do_freebgntrim( O_trim * );
124 void do_freebgncurve( O_curve * );
125 void do_freepwlcurve( O_pwlcurve * );
126 void do_freenurbscurve( O_nurbscurve * );
127 void do_freenurbssurface( O_nurbssurface * );
128 void do_freebgnsurface( O_surface * );
129 void do_bgnsurface( O_surface * );
130 void do_endsurface( void );
131 void do_bgntrim( O_trim * );
132 void do_endtrim( void );
133 void do_pwlcurve( O_pwlcurve * );
134 void do_nurbscurve( O_nurbscurve * );
135 void do_nurbssurface( O_nurbssurface * );
136 void do_freenurbsproperty( Property * );
137 void do_setnurbsproperty( Property * );
138 void do_setnurbsproperty2( Property * );
139
140 Subdivider subdivider;
141 JumpBuffer* jumpbuffer;
142 Pool o_pwlcurvePool;
143 Pool o_nurbscurvePool;
144 Pool o_curvePool;
145 Pool o_trimPool;
146 Pool o_surfacePool;
147 Pool o_nurbssurfacePool;
148 Pool propertyPool;
149 public:
150 Pool quiltPool;
151 private:
152 TrimVertexPool extTrimVertexPool;
153
154 int inSurface; /* bgnsurface seen */
155 int inCurve; /* bgncurve seen */
156 int inTrim; /* bgntrim seen */
157 int isCurveModified; /* curve changed */
158 int isTrimModified; /* trim curves changed */
159 int isSurfaceModified; /* surface changed */
160 int isDataValid; /* all data is good */
161 int numTrims; /* valid trim regions */
162 int playBack;
163
164 O_trim** nextTrim; /* place to link o_trim */
165 O_curve** nextCurve; /* place to link o_curve */
166 O_nurbscurve** nextNurbscurve; /* place to link o_nurbscurve */
167 O_pwlcurve** nextPwlcurve; /* place to link o_pwlcurve */
168 O_nurbssurface** nextNurbssurface; /* place to link o_nurbssurface */
169
170 O_surface* currentSurface;
171 O_trim* currentTrim;
172 O_curve* currentCurve;
173
174 DisplayList *dl;
175
176 };
177
178 #endif /* __glunurbstess_h_ */