Debian Codegraph @

lib/database/src/so/nodes/nurbs/SoPickEvals.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.1.1.1 $
44 |
45 | Classes:
46 | _SoNurbsPickCurvEval
47 | _SoNurbsPickSurfEval
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/SoRayPickAction.h>
61 #include "SoPickEvals.h"
62 #include "SoPickMaps.h"
63
64
65 ////////////////////////////////////////////////////////////////////////
66 //
67 // Description:
68 // Constructor.
69 //
70 // Use: internal
71
72 _SoNurbsPickCurvEval::_SoNurbsPickCurvEval( void )
73
74 //
75 ////////////////////////////////////////////////////////////////////////
76 {
77 v3CurveMap = new _SoNurbsPickV3CurveMap;
78 v4CurveMap = new _SoNurbsPickV4CurveMap;
79 t2CurveMap = new _SoNurbsPickTex2CurveMap;
80 }
81
82 ////////////////////////////////////////////////////////////////////////
83 //
84 // Description:
85 // Destructor.
86 //
87 // Use: internal
88
89 _SoNurbsPickCurvEval::~_SoNurbsPickCurvEval( void )
90
91 //
92 ////////////////////////////////////////////////////////////////////////
93 {
94 // delete t2CurveMap;
95 // delete v4CurveMap;
96 // delete v3CurveMap;
97 }
98
99 ////////////////////////////////////////////////////////////////////////
100 //
101 // Description:
102 // This method initializes the callback routines for getting
103 // vertices and lines back from the NURBS library.
104 //
105 // Use: internal
106
107 void
108 _SoNurbsPickCurvEval::initialize(SoRayPickAction *pa)
109
110 //
111 ////////////////////////////////////////////////////////////////////////
112 {
113 v3CurveMap->initialize( pa );
114 v4CurveMap->initialize( pa );
115 addMap( v3CurveMap );
116 addMap( v4CurveMap );
117 addMap( t2CurveMap );
118 }
119
120
121 ////////////////////////////////////////////////////////////////////////
122 //
123 // Description:
124 // This callback routine is called when a bgnline call is generated
125 // by the NURBS library.
126 //
127 // Use: protected
128
129 void
130 _SoNurbsPickCurvEval::bgnline( void )
131
132 //
133 ////////////////////////////////////////////////////////////////////////
134 {
135 v3CurveMap->startNewCurve();
136 v4CurveMap->startNewCurve();
137 }
138
139 ////////////////////////////////////////////////////////////////////////
140 //
141 // Description:
142 // This callback routine is called when an endline call is generated
143 // by the NURBS library.
144 //
145 // Use: protected
146
147 void
148 _SoNurbsPickCurvEval::endline( void )
149
150 //
151 ////////////////////////////////////////////////////////////////////////
152 {
153 }
154
155
156
157 ////////////////////////////////////////////////////////////////////////
158 //
159 // Description:
160 // Constructor.
161 //
162 // Use: internal
163
164 _SoNurbsPickSurfEval::_SoNurbsPickSurfEval()
165
166 //
167 ////////////////////////////////////////////////////////////////////////
168 {
169 v3SurfaceMap = new _SoNurbsPickV3SurfaceMap;
170 v4SurfaceMap = new _SoNurbsPickV4SurfaceMap;
171 t2SurfaceMap = new _SoNurbsPickTex2SurfaceMap;
172 }
173
174 ////////////////////////////////////////////////////////////////////////
175 //
176 // Description:
177 // Destructor.
178 //
179 // Use: internal
180
181 _SoNurbsPickSurfEval::~_SoNurbsPickSurfEval()
182
183 //
184 ////////////////////////////////////////////////////////////////////////
185 {
186 // delete t2SurfaceMap;
187 // delete v4SurfaceMap;
188 // delete v3SurfaceMap;
189 }
190
191 ////////////////////////////////////////////////////////////////////////
192 //
193 // Description:
194 // This method initializes the callback routines for getting
195 // vertices and faces back from the NURBS library.
196 //
197 // Use: internal
198
199 void
200 _SoNurbsPickSurfEval::initialize(SoRayPickAction *pa)
201
202 //
203 ////////////////////////////////////////////////////////////////////////
204 {
205 v3SurfaceMap->initialize( pa );
206 v4SurfaceMap->initialize( pa );
207 addMap( v3SurfaceMap );
208 addMap( v4SurfaceMap );
209 addMap( t2SurfaceMap );
210 }
211
212
213 ////////////////////////////////////////////////////////////////////////
214 //
215 // Description:
216 // This callback routine is called when a bgnline call is generated
217 // by the NURBS library.
218 //
219 // Use: protected
220
221 void
222 _SoNurbsPickSurfEval::bgnline( void )
223
224 //
225 ////////////////////////////////////////////////////////////////////////
226 {
227 }
228
229 ////////////////////////////////////////////////////////////////////////
230 //
231 // Description:
232 // This callback routine is called when an endline call is generated
233 // by the NURBS library.
234 //
235 // Use: protected
236
237 void
238 _SoNurbsPickSurfEval::endline( void )
239
240 //
241 ////////////////////////////////////////////////////////////////////////
242 {
243 }
244
245 ////////////////////////////////////////////////////////////////////////
246 //
247 // Description:
248 // This callback routine is called when a bgnclosedline call
249 // is generated by the NURBS library.
250 //
251 // Use: protected
252
253 void
254 _SoNurbsPickSurfEval::bgnclosedline( void )
255
256 //
257 ////////////////////////////////////////////////////////////////////////
258 {
259 }
260
261 ////////////////////////////////////////////////////////////////////////
262 //
263 // Description:
264 // This callback routine is called when an endclosedline call
265 // is generated by the NURBS library.
266 //
267 // Use: protected
268
269 void
270 _SoNurbsPickSurfEval::endclosedline( void )
271
272 //
273 ////////////////////////////////////////////////////////////////////////
274 {
275 }
276
277 ////////////////////////////////////////////////////////////////////////
278 //
279 // Description:
280 // This callback routine is called when a bgntmesh call is generated
281 // by the NURBS library.
282 //
283 // Use: protected
284
285 void
286 _SoNurbsPickSurfEval::bgntmesh( void )
287
288 //
289 ////////////////////////////////////////////////////////////////////////
290 {
291 v3SurfaceMap->startNewTriStrip();
292 v4SurfaceMap->startNewTriStrip();
293 }
294
295 ////////////////////////////////////////////////////////////////////////
296 //
297 // Description:
298 // This callback routine is called when a swaptmesh call is generated
299 // by the NURBS library.
300 //
301 // Use: protected
302
303 void
304 _SoNurbsPickSurfEval::swaptmesh( void )
305
306 //
307 ////////////////////////////////////////////////////////////////////////
308 {
309 v3SurfaceMap->swapVertices();
310 v4SurfaceMap->swapVertices();
311 }
312
313 ////////////////////////////////////////////////////////////////////////
314 //
315 // Description:
316 // This callback routine is called when an endtmesh call is generated
317 // by the NURBS library.
318 //
319 // Use: protected
320
321 void
322 _SoNurbsPickSurfEval::endtmesh( void )
323
324 //
325 ////////////////////////////////////////////////////////////////////////
326 {
327 }
328
329 ////////////////////////////////////////////////////////////////////////
330 //
331 // Description:
332 // This callback routine is called when a bgnqstrip call is generated
333 // by the NURBS library.
334 //
335 // Use: protected
336
337 void
338 _SoNurbsPickSurfEval::bgnqstrip( void )
339
340 //
341 ////////////////////////////////////////////////////////////////////////
342 {
343 v3SurfaceMap->startNewTriStrip();
344 v4SurfaceMap->startNewTriStrip();
345 }
346
347 ////////////////////////////////////////////////////////////////////////
348 //
349 // Description:
350 // This callback routine is called when an endqstrip call is generated
351 // by the NURBS library.
352 //
353 // Use: protected
354
355 void
356 _SoNurbsPickSurfEval::endqstrip( void )
357
358 //
359 ////////////////////////////////////////////////////////////////////////
360 {
361 }
362