Debian Codegraph @

lib/database/src/so/nodes/nurbs/SoPrimEvals.c++

raw
1 /*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37 /*
38 * Copyright (C) 1990,91 Silicon Graphics, Inc.
39 *
40 _______________________________________________________________________
41 ______________ S I L I C O N G R A P H I C S I N C . ____________
42 |
43 | $Revision: 1.2 $
44 |
45 | Classes:
46 | _SoNurbsPrimCurvEval
47 | _SoNurbsPrimSurfEval
48 |
49 | Author(s) : Dave Immel
50 |
51 ______________ S I L I C O N G R A P H I C S I N C . ____________
52 _______________________________________________________________________
53 */
54
55
56 /* Polynomial Evaluator Interface */
57
58 #include <cstdio>
59 #include "SoAddPrefix.h"
60 #include <Inventor/actions/SoAction.h>
61 #include <Inventor/nodes/SoShape.h>
62 #include "SoPrimEvals.h"
63 #include "SoPrimMaps.h"
64
65
66 ////////////////////////////////////////////////////////////////////////
67 //
68 // Description:
69 // Constructor.
70 //
71 // Use: internal
72
73 _SoNurbsPrimCurvEval::_SoNurbsPrimCurvEval( void )
74
75 //
76 ////////////////////////////////////////////////////////////////////////
77 {
78 v3CurveMap = new _SoNurbsPrimV3CurveMap;
79 v4CurveMap = new _SoNurbsPrimV4CurveMap;
80 t2CurveMap = new _SoNurbsPrimTex2CurveMap;
81 }
82
83 ////////////////////////////////////////////////////////////////////////
84 //
85 // Description:
86 // Destructor.
87 //
88 // Use: internal
89
90 _SoNurbsPrimCurvEval::~_SoNurbsPrimCurvEval( void )
91
92 //
93 ////////////////////////////////////////////////////////////////////////
94 {
95 // delete t2CurveMap;
96 // delete v4CurveMap;
97 // delete v3CurveMap;
98 }
99
100 ////////////////////////////////////////////////////////////////////////
101 //
102 // Description:
103 // This method initializes the callback routines for getting
104 // vertices and lines back from the NURBS library.
105 //
106 // Use: internal
107
108 void
109 _SoNurbsPrimCurvEval::initialize(SoAction *act, SoNurbsPrimCB *cb, void *data )
110
111 //
112 ////////////////////////////////////////////////////////////////////////
113 {
114 v3CurveMap->initialize( act, cb, data );
115 v4CurveMap->initialize( act, cb, data );
116 addMap( v3CurveMap );
117 addMap( v4CurveMap );
118 addMap( t2CurveMap );
119 }
120
121
122 ////////////////////////////////////////////////////////////////////////
123 //
124 // Description:
125 // This callback routine is called when a bgnline call is generated
126 // by the NURBS library.
127 //
128 // Use: protected
129
130 void
131 _SoNurbsPrimCurvEval::bgnline( void )
132
133 //
134 ////////////////////////////////////////////////////////////////////////
135 {
136 v3CurveMap->startNewCurve();
137 v4CurveMap->startNewCurve();
138 }
139
140 ////////////////////////////////////////////////////////////////////////
141 //
142 // Description:
143 // This callback routine is called when an endline call is generated
144 // by the NURBS library.
145 //
146 // Use: protected
147
148 void
149 _SoNurbsPrimCurvEval::endline( void )
150
151 //
152 ////////////////////////////////////////////////////////////////////////
153 {
154 }
155
156
157
158 ////////////////////////////////////////////////////////////////////////
159 //
160 // Description:
161 // Constructor.
162 //
163 // Use: internal
164
165 _SoNurbsPrimSurfEval::_SoNurbsPrimSurfEval()
166
167 //
168 ////////////////////////////////////////////////////////////////////////
169 {
170 v3SurfaceMap = new _SoNurbsPrimV3SurfaceMap;
171 v4SurfaceMap = new _SoNurbsPrimV4SurfaceMap;
172 t2SurfaceMap = new _SoNurbsPrimTex2SurfaceMap;
173 }
174
175 ////////////////////////////////////////////////////////////////////////
176 //
177 // Description:
178 // Destructor.
179 //
180 // Use: internal
181
182 _SoNurbsPrimSurfEval::~_SoNurbsPrimSurfEval()
183
184 //
185 ////////////////////////////////////////////////////////////////////////
186 {
187 // delete t2SurfaceMap;
188 // delete v4SurfaceMap;
189 // delete v3SurfaceMap;
190 }
191
192 ////////////////////////////////////////////////////////////////////////
193 //
194 // Description:
195 // This method initializes the callback routines for getting
196 // vertices and faces back from the NURBS library.
197 //
198 // Use: internal
199
200 void
201 _SoNurbsPrimSurfEval::initialize(SoAction *act, SoNurbsPrimCB *cb, void *data )
202
203 //
204 ////////////////////////////////////////////////////////////////////////
205 {
206 v3SurfaceMap->initialize( act, cb, data );
207 v4SurfaceMap->initialize( act, cb, data );
208 addMap( v3SurfaceMap );
209 addMap( v4SurfaceMap );
210 addMap( t2SurfaceMap );
211 }
212
213
214 ////////////////////////////////////////////////////////////////////////
215 //
216 // Description:
217 // This callback routine is called when a bgnline call is generated
218 // by the NURBS library.
219 //
220 // Use: protected
221
222 void
223 _SoNurbsPrimSurfEval::bgnline( void )
224
225 //
226 ////////////////////////////////////////////////////////////////////////
227 {
228 }
229
230 ////////////////////////////////////////////////////////////////////////
231 //
232 // Description:
233 // This callback routine is called when an endline call is generated
234 // by the NURBS library.
235 //
236 // Use: protected
237
238 void
239 _SoNurbsPrimSurfEval::endline( void )
240
241 //
242 ////////////////////////////////////////////////////////////////////////
243 {
244 }
245
246 ////////////////////////////////////////////////////////////////////////
247 //
248 // Description:
249 // This callback routine is called when a bgnclosedline call
250 // is generated by the NURBS library.
251 //
252 // Use: protected
253
254 void
255 _SoNurbsPrimSurfEval::bgnclosedline( void )
256
257 //
258 ////////////////////////////////////////////////////////////////////////
259 {
260 }
261
262 ////////////////////////////////////////////////////////////////////////
263 //
264 // Description:
265 // This callback routine is called when an endclosedline call
266 // is generated by the NURBS library.
267 //
268 // Use: protected
269
270 void
271 _SoNurbsPrimSurfEval::endclosedline( void )
272
273 //
274 ////////////////////////////////////////////////////////////////////////
275 {
276 }
277
278 ////////////////////////////////////////////////////////////////////////
279 //
280 // Description:
281 // This callback routine is called when a bgntmesh call is generated
282 // by the NURBS library.
283 //
284 // Use: protected
285
286 void
287 _SoNurbsPrimSurfEval::bgntmesh()
288
289 //
290 ////////////////////////////////////////////////////////////////////////
291 {
292 v3SurfaceMap->startNewTriStrip();
293 v4SurfaceMap->startNewTriStrip();
294 }
295
296 ////////////////////////////////////////////////////////////////////////
297 //
298 // Description:
299 // This callback routine is called when a swaptmesh call is generated
300 // by the NURBS library.
301 //
302 // Use: protected
303
304 void
305 _SoNurbsPrimSurfEval::swaptmesh( void )
306
307 //
308 ////////////////////////////////////////////////////////////////////////
309 {
310 v3SurfaceMap->swapVertices();
311 v4SurfaceMap->swapVertices();
312 }
313
314 ////////////////////////////////////////////////////////////////////////
315 //
316 // Description:
317 // This callback routine is called when an endtmesh call is generated
318 // by the NURBS library.
319 //
320 // Use: protected
321
322 void
323 _SoNurbsPrimSurfEval::endtmesh( void )
324
325 //
326 ////////////////////////////////////////////////////////////////////////
327 {
328 }
329
330 ////////////////////////////////////////////////////////////////////////
331 //
332 // Description:
333 // This callback routine is called when a bgnqstrip call is generated
334 // by the NURBS library.
335 //
336 // Use: protected
337
338 void
339 _SoNurbsPrimSurfEval::bgnqstrip( void )
340
341 //
342 ////////////////////////////////////////////////////////////////////////
343 {
344 v3SurfaceMap->startNewTriStrip();
345 v4SurfaceMap->startNewTriStrip();
346 }
347
348 ////////////////////////////////////////////////////////////////////////
349 //
350 // Description:
351 // This callback routine is called when an endqstrip call is generated
352 // by the NURBS library.
353 //
354 // Use: protected
355
356 void
357 _SoNurbsPrimSurfEval::endqstrip( void )
358
359 //
360 ////////////////////////////////////////////////////////////////////////
361 {
362 }
363
364 ////////////////////////////////////////////////////////////////////////
365 //
366 // Description:
367 // This callback routine is called when an grid of quadstrips is
368 // generated.
369 //
370 // Use: protected
371
372 void
373 _SoNurbsPrimSurfEval::mapmesh2f( long, long umin, long umax,
374 long vmin, long vmax )
375
376 //
377 ////////////////////////////////////////////////////////////////////////
378 {
379 makeMesh(umin, umax, vmin, vmax);
380 }
381