0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler)
[occt.git] / src / OpenGl / OpenGl_tmesh.cxx
CommitLineData
7fd59977 1#define G003
2#define G004
3/***********************************************************************
4
5FONCTION :
6----------
7File OpenGl_tmesh :
8
9
10REMARQUES:
11----------
12
13Le culling et le backfacing ne marchent pas.
14
15
16HISTORIQUE DES MODIFICATIONS :
17--------------------------------
18xx-xx-xx : xxx ; Creation.
1911-03-96 : FMN ; Correction warning compilation
2001-04-96 : CAL ; Integration MINSK portage WNT
2122-04-96 : FMN ; Suppression prototype inutile.
2209-08-96 : FMN ; Suppression appel glMatrixMode() avant glGetFloatv()
2321-10-96 : FMN ; Suppression LMC_COLOR fait dans OpenGl_execstruct.c
2430-06-97 : FMN ; Suppression OpenGl_telem_light.h
2518-07-97 : FMN ; Ajout desactivation des lights suivant front_lighting_model
2621-07-97 : FMN ; Amelioration des performances OPTIMISATION_FMN
27- suppression calcul inutile sur les front faces
28- utilisation de GL_LINE_LOOP
2927-08-97 : FMN ; Correction affichage des edges
30On n'affiche que les edges dans le mode IS_EMPTY
3110-09-97 : FMN ; Amelioration des perfs liees aux lights.
3215-09-97 : PCT ; Ajout coordonnees textures
3324-09-97 : FMN ; Suppression OPTIMISATION_FMN.
3408-12-97 : FMN ; Suppression appel TsmGetAttri inutile.
3523-12-97 : FMN ; Suppression IsBackFace()
3631-12-97 : FMN ; Simplification pour le highlight
3715-01-98 : FMN ; Ajout Hidden line
3816-02-00 : EUG ; Degeneration support
3916-02-00 : EUG ; Bitmap drawing support
4008-03-01 : GG ; BUC60823 Avoid crash in the normal computation method
41on confuse point.
42
43************************************************************************/
44
45#define BUC60876 /* GG 5/4/2001 Disable local display list
46// when animation is not required
47*/
48
49/*----------------------------------------------------------------------*/
50
51#define OCC4298 // SAN : 12/11/2003 : Memory beyond array bound read in TriangleMeshAdd()
52/*
53* Includes
54*/
55
56#include <OpenGl_tgl_all.hxx>
57
58#include <stddef.h>
59#include <stdio.h>
60#include <GL/gl.h>
61#include <GL/glu.h>
62
63#include <OpenGl_cmn_varargs.hxx>
64#include <OpenGl_telem_attri.hxx>
65#include <OpenGl_tsm.hxx>
66#include <OpenGl_telem.hxx>
67#include <OpenGl_telem_util.hxx>
68#include <OpenGl_telem_highlight.hxx>
69#include <OpenGl_telem_inquire.hxx>
70#include <OpenGl_telem_view.hxx>
71#include <OpenGl_tgl_funcs.hxx>
72#include <OpenGl_LightBox.hxx>
73#include <OpenGl_TextureBox.hxx>
74#include <OpenGl_Memory.hxx>
75
76/*----------------------------------------------------------------------*/
77/*
78* Constantes
79*/
80
81/*----------------------------------------------------------------------*/
82/*
83* Variables externes
84*/
85
86extern Tint ForbidSetTextureMapping; /* currently defined in tsm/tsm.c */
87
88#ifdef G003
89# include <float.h>
90# define DEF_DS_INTERNAL
91# include <OpenGl_degeneration.hxx>
92
93# ifdef G004
94extern GLboolean g_fBitmap;
95# endif /* G004 */
96
97extern int g_nDegenerateModel;
98extern float g_fSkipRatio;
99extern GLboolean g_fAnimation;
100
101#endif /* G003 */
102
103/*----------------------------------------------------------------------*/
104
105typedef struct
106{
107 Tint num_facets; /* Number of facets */
108 Tint facet_flag; /* TEL_FA_NONE or TEL_FA_NORMAL */
109 Tint vertex_flag;/* TEL_VT_NONE or TEL_VT_NORMAL */
110 tel_point fnormals; /* length = num_facets */
111 tel_colour fcolours; /* length = num_facets */
112 tel_point vertices; /* length = num_facets + 2 */
113 tel_colour vcolours; /* length = num_facets + 2 */
114 tel_point vnormals; /* length = num_facets + 2 */
115 tel_texture_coord vtexturecoord; /* Texture coordinates */
116#ifdef G003
117 DS_INTERNAL d;
118#endif /* G003 */
119} TEL_TMESH_DATA, *tel_tmesh_data;
120
121static TStatus TriangleMeshDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
122static TStatus TriangleMeshAdd( TSM_ELEM_DATA, Tint, cmn_key* );
123static TStatus TriangleMeshDelete( TSM_ELEM_DATA, Tint, cmn_key* );
124static TStatus TriangleMeshPrint( TSM_ELEM_DATA, Tint, cmn_key* );
125static TStatus TriangleMeshInquire( TSM_ELEM_DATA, Tint, cmn_key* );
126
127static void draw_tmesh( tel_tmesh_data,
128 Tint, /* highlight flag */
129 Tint, /* front_lighting_model, */
130 Tint, /* interior_style, */
131 tel_colour /* edge_colour, */
132 );
133#ifndef G003
134static void draw_edges( tel_tmesh_data, tel_colour, Tint);
135#else
136static void draw_edges ( tel_tmesh_data, tel_colour, Tint, Tint );
137void draw_degenerates_as_points ( PDS_INTERNAL, tel_point, Tint );
138void draw_degenerates_as_bboxs ( PDS_INTERNAL, tel_point, Tint );
139extern void set_drawable_items ( GLboolean*, int );
140#endif /* G003 */
141
142static void draw_line_loop ( tel_tmesh_data );
143
144static TStatus ( *MtdTbl[] )( TSM_ELEM_DATA, Tint, cmn_key* ) = {
145
146 TriangleMeshDisplay, /* PickTraverse */
147 TriangleMeshDisplay,
148 TriangleMeshAdd,
149 TriangleMeshDelete,
150 TriangleMeshPrint,
151 TriangleMeshInquire
152
153};
154
155/*----------------------------------------------------------------------*/
156
157MtblPtr TelTriangleMeshInitClass ( TelType* el ) {
158
159 *el = TelTriangleMesh;
160
161 return MtdTbl;
162
163} /* end TelTriangleMeshInitClass */
164
165/*----------------------------------------------------------------------*/
166static TStatus
167TriangleMeshAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
168/* expects keys
169NUM_FACETS_ID
170FNORMALS_ID
171FACET_COLOUR_VALS_ID
172VERTICES_ID
173VERTEX_COLOUR_VALS_ID
174VNORMALS_ID
175VTEXTURECOORD_ID */
176{
177 Tint i, j;
178 tel_tmesh_data data;
179
180 for( i = 0; i < n; i++ )
181 {
182 if( k[i]->id == NUM_FACETS_ID )
183 break;
184 }
185 if( i == n )
186 return TFailure;
187
188 if( !(k[i]->data.ldata) )
189 return TFailure;
190
191 data = new TEL_TMESH_DATA();
192 if( !data )
193 return TFailure;
194
195 data->num_facets = k[i]->data.ldata;
196 data->vtexturecoord = 0;
197
198 for( i = 0; i < n; i++ )
199 {
200 switch( k[i]->id )
201 {
202 case FNORMALS_ID:
203 {
204 data->facet_flag = TEL_FA_NORMAL;
205 data->fnormals = new TEL_POINT[data->num_facets];
206 memcpy( data->fnormals, k[i]->data.pdata, data->num_facets*sizeof(TEL_POINT) );
207 for( j = 0; j < data->num_facets; j++ )
208 vecnrm( data->fnormals[j].xyz );
209 break;
210 }
211 case FACET_COLOUR_VALS_ID:
212 {
213 data->fcolours = new TEL_COLOUR[data->num_facets];
214 memcpy( data->fcolours,
215 k[i]->data.pdata,
216 data->num_facets*sizeof(TEL_COLOUR) );
217 break;
218 }
219 case VERTICES_ID:
220 {
221 data->vertices = new TEL_POINT[data->num_facets + 2];
222 memcpy( data->vertices, k[i]->data.pdata,
223 (data->num_facets+2)*sizeof(TEL_POINT) );
224 break;
225 }
226 case VERTEX_COLOUR_VALS_ID:
227 {
228 data->vcolours = new TEL_COLOUR[data->num_facets];
229 memcpy( data->vcolours, k[i]->data.pdata,
230 (data->num_facets+2)*sizeof(TEL_COLOUR) );
231
232 break;
233 }
234 case VNORMALS_ID:
235 {
236 data->vertex_flag = TEL_VT_NORMAL;
237 data->vnormals = new TEL_POINT[data->num_facets + 2];
238 memcpy( data->vnormals, k[i]->data.pdata,
239 (data->num_facets + 2)*sizeof(TEL_POINT) );
240 for( j = 0; j < (data->num_facets+2); j++ )
241 vecnrm( data->vnormals[j].xyz );
242 break;
243 }
244 case VTEXTURECOORD_ID:
245 {
246 data->vtexturecoord = new TEL_TEXTURE_COORD[data->num_facets + 2];
247 memcpy( data->vtexturecoord,
248 k[i]->data.pdata,
249 (data->num_facets + 2)*sizeof(TEL_TEXTURE_COORD) );
250 break;
251 }
252
253 default:
254 {
255 break;
256 }
257 }
258 }
259
260 if( data->facet_flag != TEL_FA_NORMAL )
261 {
262 /* calculate the normals and store */
263
264 data->fnormals = new TEL_POINT[data->num_facets];
265 for( i = 0; i < data->num_facets; i++ ) {
266 if( i & 1 ) {
267 TelGetNormal( data->vertices[i].xyz, data->vertices[i+2].xyz,
268 data->vertices[i+1].xyz, data->fnormals[i].xyz );
269 } else {
270 TelGetNormal( data->vertices[i].xyz, data->vertices[i+1].xyz,
271 data->vertices[i+2].xyz, data->fnormals[i].xyz );
272 }
273 }
274#ifndef BUC60823
275 for( j = 0; j < data->num_facets; j++ )
276 vecnrm( data->fnormals[j].xyz );
277#endif
278 }
279 if( data->vertex_flag != TEL_VT_NORMAL )
280 {
281 /* calculate the vertex normals */
282 data->vnormals = new TEL_POINT[data->num_facets + 2];
283 for( i = 2; i < data->num_facets; i++ )
284 {
285 data->vnormals[i].xyz[0] = ( data->fnormals[i-2].xyz[0] +
286 data->fnormals[i-1].xyz[0] +
287 data->fnormals[ i ].xyz[0] ) / ( float )3.0;
288 data->vnormals[i].xyz[1] = ( data->fnormals[i-2].xyz[1] +
289 data->fnormals[i-1].xyz[1] +
290 data->fnormals[ i ].xyz[1] ) / ( float )3.0;
291 data->vnormals[i].xyz[2] = ( data->fnormals[i-2].xyz[2] +
292 data->fnormals[i-1].xyz[2] +
293 data->fnormals[ i ].xyz[2] ) / ( float )3.0;
294 }
295 data->vnormals[0] = data->fnormals[0];
296#ifdef OCC4298
297 if( data->num_facets > 1 )
298 {
299#endif
300 data->vnormals[1].xyz[0] = ( data->fnormals[0].xyz[0] +
301 data->fnormals[1].xyz[0] )/( float )2.0;
302 data->vnormals[1].xyz[1] = ( data->fnormals[0].xyz[1] +
303 data->fnormals[1].xyz[1] )/( float )2.0;
304 data->vnormals[1].xyz[2] = ( data->fnormals[0].xyz[2] +
305 data->fnormals[1].xyz[2] )/( float )2.0;
306#ifdef OCC4298
307 }
308 else
309 data->vnormals[1] = data->fnormals[0];
310#endif
311 /* last vertex */
312 data->vnormals[data->num_facets+1] = data->fnormals[data->num_facets-1];
313
314 /* second last vertex */
315#ifdef OCC4298
316 if( data->num_facets > 1 )
317 {
318#endif
319 data->vnormals[data->num_facets].xyz[0] =
320 ( data->fnormals[data->num_facets-1].xyz[0] +
321 data->fnormals[data->num_facets-2].xyz[0] ) / ( float )2.0;
322 data->vnormals[data->num_facets].xyz[1] =
323 ( data->fnormals[data->num_facets-1].xyz[1] +
324 data->fnormals[data->num_facets-2].xyz[1] ) / ( float )2.0;
325 data->vnormals[data->num_facets].xyz[2] =
326 ( data->fnormals[data->num_facets-1].xyz[2] +
327 data->fnormals[data->num_facets-2].xyz[2] ) / ( float )2.0;
328#ifdef OCC4298
329 }
330#endif
331 }
332#ifdef G003
333 data -> d.list = 0;
334 data -> d.dlist = 0;
335 data -> d.degMode = 0;
336 data -> d.model = -1;
337 data -> d.skipRatio = 0.0F;
338 data->d.bDraw = new unsigned char[data->num_facets + 2];
339#endif /* G003 */
340 ((tsm_elem_data)(d.pdata))->pdata = data;
341
342 return TSuccess;
343}
344/*----------------------------------------------------------------------*/
345
346static TStatus
347TriangleMeshDisplay( TSM_ELEM_DATA data, Tint n, cmn_key *k )
348{
349 CMN_KEY k11, k12, k17, k111, k114;
350
351 Tint front_lighting_model;
352 Tint interior_style;
353 TEL_COLOUR interior_colour;
354 TEL_COLOUR edge_colour;
355
356 tel_tmesh_data d;
357
358 k12.id = TelInteriorReflectanceEquation;
359 k17.id = TelInteriorStyle;
360 k111.id = TelInteriorColour;
361 k111.data.pdata = &interior_colour;
362 k114.id = TelEdgeColour;
363 k114.data.pdata = &edge_colour;
364
365 TsmGetAttri( 4, &k12, &k17, &k111, &k114);
366
367 front_lighting_model = k12.data.ldata;
368 interior_style = k17.data.ldata;
369
370#ifdef PRINT
371 printf("TriangleMeshDisplay \n");
372#endif
373
374 /*
375 * Use highlight colours
376 */
377 if( k[0]->id == TOn )
378 {
379 TEL_HIGHLIGHT hrep;
380
381 k11.id = TelHighlightIndex;
382 TsmGetAttri( 1, &k11 );
383 if( TelGetHighlightRep( TglActiveWs, k11.data.ldata, &hrep ) == TSuccess )
384 {
385 if( hrep.type == TelHLForcedColour )
386 {
387 edge_colour = interior_colour = hrep.col;
388 front_lighting_model = CALL_PHIGS_REFL_NONE;
389 }
390 else if( hrep.type == TelHLColour )
391 {
392 edge_colour = hrep.col;
393 k[0]->id = TOff;
394 }
395 }
396 else
397 {
398 TelGetHighlightRep( TglActiveWs, 0, &hrep );
399 if( hrep.type == TelHLForcedColour )
400 {
401 edge_colour = interior_colour = hrep.col;
402 front_lighting_model = CALL_PHIGS_REFL_NONE;
403 }
404 else if( hrep.type == TelHLColour )
405 {
406 edge_colour = hrep.col;
407 k[0]->id = TOff;
408 }
409 }
410 }
411
412 d = (tel_tmesh_data)data.pdata;
413
414 glColor3fv( interior_colour.rgb );
415
416 draw_tmesh( d, k[0]->id,
417 front_lighting_model,
418 interior_style,
419 &edge_colour);
420
421 return TSuccess;
422
423}
424
425/*----------------------------------------------------------------------*/
426
427static void draw_tmesh (
428 tel_tmesh_data p,
429 Tint hflag,
430 Tint front_lighting_model,
431 Tint interior_style,
432 tel_colour edge_colour
433 )
434{
435
436 Tint i, newList = 0;
437 tel_point pv, pfn, pvn;
438 tel_colour pfc, pvc;
439 tel_texture_coord pvt;
440
441 pfn = p -> fnormals;
442 pfc = p -> fcolours;
443 pv = p -> vertices;
444 pvc = p -> vcolours;
445 pvn = p -> vnormals;
446 pvt = p -> vtexturecoord;
447
448 if ( hflag ) pvc = pfc = 0;
449#ifdef G003
450 if ( g_nDegenerateModel < 2 && interior_style != TSM_EMPTY ) {
451#else
452 if( interior_style != TSM_EMPTY ) {
453#endif /* G003 */
454 if ( front_lighting_model == CALL_PHIGS_REFL_NONE )
455
456 LightOff ();
457
458 else LightOn ();
459#ifdef G003
460#ifdef BUC60876
461 if ( !g_fAnimation )
462 goto doDraw; /* Disable object display list out of animation */
463#endif
464# ifdef G004
465 if ( g_fBitmap ) goto doDraw; /* display lists are NOT shared between */
466 /* window's context and bitmap's one */
467# endif /* G004 */
468 if ( p -> d.model != front_lighting_model || !p -> d.list ||
469 p -> d.model == -1 ||
470 ( g_nDegenerateModel && p -> d.skipRatio != g_fSkipRatio )
471 ) {
472
473 p -> d.skipRatio = g_fSkipRatio;
474 p -> d.model = front_lighting_model;
475 p -> d.degMode = g_nDegenerateModel;
476
477 if ( g_fSkipRatio == 0.0 ) {
478
479 if ( !p -> d.list ) p -> d.list = glGenLists ( 1 );
480
481 glNewList ( p -> d.list, GL_COMPILE_AND_EXECUTE );
482 newList = 1;
483#endif /* G003 */
484#ifdef G004
485doDraw:
486#endif /* G004 */
487 glBegin ( GL_TRIANGLE_STRIP );
488
489 if ( front_lighting_model == CALL_PHIGS_REFL_NONE ) {
490
491 if ( pvc )
492
493 for ( i = 0; i < p -> num_facets + 2; ++i ) {
494
495 glColor3fv ( pvc[ i ].rgb );
496 glVertex3fv ( pv [ i ].xyz );
497
498 } /* end for */
499
500 else if ( pfc ) {
501
502 glColor3fv ( pfc[ 0 ].rgb );
503 glVertex3fv ( pv [ 0 ].xyz );
504 glVertex3fv ( pv [ 1 ].xyz );
505
506 for ( i = 2; i < p -> num_facets + 2; ++i ) {
507
508 glColor3fv ( pfc[ i - 2 ].rgb );
509 glVertex3fv( pv [ i ].xyz );
510
511 } /* end for */
512
513 } else for ( i = 0; i < p -> num_facets + 2; ++i ) glVertex3fv ( pv[ i ].xyz );
514
515 } else { /* front_lighting_model != TelLModelNone */
516
517 if ( pvt && !ForbidSetTextureMapping )
518
519 for ( i = 0; i < p -> num_facets + 2; ++i ) {
520
521 glNormal3fv ( pvn[ i ].xyz );
522 glTexCoord2fv ( pvt[ i ].xy );
523 glVertex3fv ( pv [ i ].xyz );
524
525 } /* end for */
526
527 else for ( i = 0; i < p -> num_facets + 2; ++i ) {
528
529 glNormal3fv( pvn[ i ].xyz );
530 glVertex3fv( pv[ i ].xyz );
531
532 } /* end for */
533
534 } /* end else */
535
536 glEnd ();
537#ifdef G003
538 } else if ( g_fSkipRatio != 1.0 ) {
539
540 set_drawable_items ( p -> d.bDraw, p -> num_facets + 2 );
541
542 if ( !p -> d.dlist ) p -> d.dlist = glGenLists ( 1 );
543
544 glNewList ( p -> d.dlist, GL_COMPILE_AND_EXECUTE );
545 newList = 1;
546
547 glBegin ( GL_TRIANGLES );
548
549 if ( front_lighting_model == CALL_PHIGS_REFL_NONE ) {
550
551 if ( pvc ) {
552
553 for ( i = 0; i < p -> num_facets; ++i ) {
554
555 if ( p -> d.bDraw[ i ] ) {
556
557 if ( i % 2 ) {
558
559 glColor3fv ( pvc[ i ].rgb );
560 glVertex3fv ( pv [ i ].xyz );
561 glColor3fv ( pvc[ i + 2 ].rgb );
562 glVertex3fv ( pv [ i + 2 ].xyz );
563 glColor3fv ( pvc[ i + 1 ].rgb );
564 glVertex3fv ( pv [ i + 1 ].xyz );
565
566 } else {
567
568 glColor3fv ( pvc[ i + 2 ].rgb );
569 glVertex3fv ( pv [ i + 2 ].xyz );
570 glColor3fv ( pvc[ i ].rgb );
571 glVertex3fv ( pv [ i ].xyz );
572 glColor3fv ( pvc[ i + 1 ].rgb );
573 glVertex3fv ( pv [ i + 1 ].xyz );
574
575 } /* end else */
576 } /* if */
577 } /* for */
578
579 } else if ( pfc ) {
580
581 for ( i = 0; i < p -> num_facets; ++i ) {
582
583 if ( p -> d.bDraw[ i ] ) {
584
585 if ( i % 2 ) {
586
587 glColor3fv ( pfc[ i ].rgb );
588 glVertex3fv( pv [ i ].xyz );
589 glColor3fv ( pfc[ i + 2 ].rgb );
590 glVertex3fv( pv [ i + 2 ].xyz );
591 glColor3fv ( pfc[ i + 1 ].rgb );
592 glVertex3fv( pv [ i + 1 ].xyz );
593
594 } else {
595
596 glColor3fv ( pfc[ i + 2 ].rgb );
597 glVertex3fv( pv [ i + 2 ].xyz );
598 glColor3fv ( pfc[ i ].rgb );
599 glVertex3fv( pv [ i ].xyz );
600 glColor3fv ( pfc[ i + 1 ].rgb );
601 glVertex3fv( pv [ i + 1 ].xyz );
602
603 } /* end else */
604 } /* if */
605 } /* for */
606
607 } else {
608 for ( i = 0; i < p -> num_facets; ++i ) {
609
610 if ( p -> d.bDraw[ i ] ) {
611
612 if ( i % 2 ) {
613
614 glVertex3fv ( pv[ i ].xyz );
615 glVertex3fv ( pv[ i + 2 ].xyz );
616 glVertex3fv ( pv[ i + 1 ].xyz );
617
618 } else {
619
620 glVertex3fv ( pv[ i + 2 ].xyz );
621 glVertex3fv ( pv[ i ].xyz );
622 glVertex3fv ( pv[ i + 1 ].xyz );
623
624 } /* end else */
625 } /* if */
626 } /* for */
627 }
628
629 } else { /* front_lighting_model != TelLModelNone */
630
631 if ( pvt && !ForbidSetTextureMapping ) {
632
633 for ( i = 0; i < p -> num_facets; ++i ) {
634
635 if ( p -> d.bDraw[ i ] ) {
636
637 if ( i % 2 ) {
638
639 glNormal3fv ( pvn[ i ].xyz );
640 glTexCoord2fv ( pvt[ i ].xy );
641 glVertex3fv ( pv [ i ].xyz );
642 glNormal3fv ( pvn[ i + 2 ].xyz );
643 glTexCoord2fv ( pvt[ i + 2 ].xy );
644 glVertex3fv ( pv [ i + 2 ].xyz );
645 glNormal3fv ( pvn[ i + 1 ].xyz );
646 glTexCoord2fv ( pvt[ i + 1 ].xy );
647 glVertex3fv ( pv [ i + 1 ].xyz );
648
649 } else {
650
651 glNormal3fv ( pvn[ i + 2 ].xyz );
652 glTexCoord2fv ( pvt[ i + 2 ].xy );
653 glVertex3fv ( pv [ i + 2 ].xyz );
654 glNormal3fv ( pvn[ i ].xyz );
655 glTexCoord2fv ( pvt[ i ].xy );
656 glVertex3fv ( pv [ i ].xyz );
657 glNormal3fv ( pvn[ i + 1 ].xyz );
658 glTexCoord2fv ( pvt[ i + 1 ].xy );
659 glVertex3fv ( pv [ i + 1 ].xyz );
660
661 } /* end else */
662 } /* if */
663 } /* end for */
664
665 } else {
666 for ( i = 0; i < p -> num_facets; ++i ) {
667
668 if ( p -> d.bDraw[ i ] ) {
669
670 if ( i % 2 ) {
671
672 glNormal3fv( pvn[ i ].xyz );
673 glVertex3fv( pv[ i ].xyz );
674 glNormal3fv( pvn[ i + 2 ].xyz );
675 glVertex3fv( pv[ i + 2 ].xyz );
676 glNormal3fv( pvn[ i + 1 ].xyz );
677 glVertex3fv( pv[ i + 1 ].xyz );
678
679 } else {
680
681 glNormal3fv( pvn[ i + 2 ].xyz );
682 glVertex3fv( pv[ i + 2 ].xyz );
683 glNormal3fv( pvn[ i ].xyz );
684 glVertex3fv( pv[ i ].xyz );
685 glNormal3fv( pvn[ i + 1 ].xyz );
686 glVertex3fv( pv[ i + 1 ].xyz );
687
688 } /* end else */
689
690 } /* if */
691 } /* for */
692 } /* end else */
693 } /* end else front_lighting_model != TelLModelNone */
694
695 glEnd ();
696
697 } else {
698
699 if ( !p -> d.dlist ) p -> d.dlist = glGenLists ( 1 );
700
701 glNewList ( p -> d.dlist, GL_COMPILE_AND_EXECUTE );
702 newList = 1;
703
704 } /* end else */
705 if ( newList ) glEndList ();
706
707 if ( g_nDegenerateModel ) return;
708
709 } else {
710
711 glCallList ( g_fSkipRatio == 0.0 ? p -> d.list : p -> d.dlist );
712
713 if ( g_nDegenerateModel ) return;
714
715 } /* end else */
716#endif /* G003 */
717 } /* end if ( interior_style != TSM_EMPTY ) */
718#ifdef G003
719 i = 0;
720
721 /* OCC11904 -- Temporarily disable environment mapping */
722 glPushAttrib(GL_ENABLE_BIT);
723 glDisable(GL_TEXTURE_1D);
724 glDisable(GL_TEXTURE_2D);
725
726 switch ( g_nDegenerateModel ) {
727
728 default:
729 break;
730
731 case 2: /* XXX_TDM_WIREFRAME */
732 i = 1;
733 break;
734
735 case 3: /* XXX_TDM_MARKER */
736 draw_degenerates_as_points ( &p -> d, p -> vertices, p -> num_facets + 2 );
737 glPopAttrib();
738 return;
739
740 case 4: /* XXX_TDM_BBOX */
741 draw_degenerates_as_bboxs ( &p -> d, p -> vertices, p -> num_facets + 2 );
742 glPopAttrib();
743 return;
744
745 } /* end switch */
746
747 draw_edges ( p, edge_colour, interior_style, i );
748#else
749 draw_edges ( p, edge_colour, interior_style );
750#endif /* G003 */
751
752 glPopAttrib();
753} /* end draw_tmesh */
754
755/*----------------------------------------------------------------------*/
756static TStatus
757TriangleMeshDelete( TSM_ELEM_DATA data, Tint n, cmn_key *k )
758{
759 tel_tmesh_data p;
760
761 p = (tel_tmesh_data)data.pdata;
762 if( p->fnormals )
763 delete[] p->fnormals;
764 if( p->fcolours )
765 delete[] p->fcolours;
766 if( p->vertices )
767 delete[] p->vertices;
768 if( p->vcolours )
769 delete[] p->vcolours;
770 if( p->vnormals )
771 delete[] p->vnormals;
772 if (p->vtexturecoord)
773 delete[] p->vtexturecoord;
774#ifdef G003
775 if ( GET_GL_CONTEXT() != NULL ) {
776
777 if ( p -> d.list ) glDeleteLists ( p -> d.list, 1 );
778 if ( p -> d.dlist ) glDeleteLists ( p -> d.dlist, 1 );
779
780 } /* end if */
781
782 if ( p -> d.bDraw )
783 delete[] p->d.bDraw;
784#endif /* G003 */
785 if (data.pdata)
786 delete data.pdata;
787 return TSuccess;
788}
789
790/*----------------------------------------------------------------------*/
791static TStatus
792TriangleMeshPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
793{
794 Tint i;
795 tel_tmesh_data p;
796
797 p = (tel_tmesh_data)data.pdata;
798
799 fprintf(stdout, "TelTriangleMesh. Number of Facets : %d\n", p->num_facets);
800 switch( p->facet_flag )
801 {
802 case TEL_FA_NONE:
803 if( p->fcolours )
804 fprintf( stdout, "\t\tFacet Flag : COLOUR\n" );
805 else
806 fprintf( stdout, "\t\tFacet Flag : NONE\n" );
807 break;
808
809 case TEL_FA_NORMAL:
810 if( p->fcolours )
811 fprintf( stdout, "\t\tFacet Flag : COLOURNORMAL\n" );
812 else
813 fprintf( stdout, "\t\tFacet Flag : NORMAL\n" );
814 break;
815 }
816
817 switch( p->vertex_flag )
818 {
819 case TEL_VT_NONE:
820 if( p->vcolours )
821 fprintf( stdout, "\t\tVertex Flag : COLOUR\n" );
822 else
823 fprintf( stdout, "\t\tVertex Flag : NONE\n" );
824 break;
825
826 case TEL_VT_NORMAL:
827 if( p->vcolours )
828 fprintf( stdout, "\t\tVertex Flag : COLOURNORMAL\n" );
829 else
830 fprintf( stdout, "\t\tVertex Flag : NORMAL\n" );
831 break;
832 }
833 if( p->fnormals )
834 {
835 fprintf( stdout, "\n\t\tFacet Normals : " );
836 for( i = 0; i < p->num_facets; i++ )
837 fprintf( stdout, "\n\t\t v[%d] = %g %g %g", i,
838 p->fnormals[i].xyz[0],
839 p->fnormals[i].xyz[1],
840 p->fnormals[i].xyz[2] );
841 }
842 else
843 fprintf( stdout, "\n\t\tFacet Normals not specified\n" );
844
845 if( p->fcolours )
846 {
847 fprintf( stdout, "\n\t\tFacet Colours : " );
848 for( i = 0; i < p->num_facets; i++ )
849 fprintf( stdout, "\n\t\t v[%d] = %g %g %g", i,
850 p->fcolours[i].rgb[0],
851 p->fcolours[i].rgb[1],
852 p->fcolours[i].rgb[2] ); }
853 else
854 fprintf( stdout, "\n\t\tFacet Colours not specified\n" );
855 if( p->vertices )
856 {
857 fprintf( stdout, "\n\t\tVertices : " );
858 for( i = 0; i < p->num_facets+2; i++ )
859 fprintf( stdout, "\n\t\t v[%d] = %g %g %g", i,
860 p->vertices[i].xyz[0],
861 p->vertices[i].xyz[1],
862 p->vertices[i].xyz[2] ); }
863
864 fprintf( stdout, "\n" );
865 if( p->vcolours )
866 {
867 fprintf( stdout, "\n\t\tVertex Colours : " );
868 for( i = 0; i < p->num_facets+2; i++ )
869 fprintf( stdout, "\n\t\t v[%d] = %g %g %g", i,
870 p->vcolours[i].rgb[0],
871 p->vcolours[i].rgb[1],
872 p->vcolours[i].rgb[2] ); }
873 else
874 fprintf( stdout, "\n\t\tVertex Colours not specified\n" );
875
876 if( p->vnormals )
877 {
878 fprintf( stdout, "\n\t\tVertex Normals : " );
879 for( i = 0; i < p->num_facets+2; i++ )
880 fprintf( stdout, "\n\t\t v[%d] = %g %g %g", i,
881 p->vnormals[i].xyz[0],
882 p->vnormals[i].xyz[1],
883 p->vnormals[i].xyz[2] ); }
884 else
885 fprintf( stdout, "\n\t\tVertex Normals not specified\n" );
886
887 if (p->vtexturecoord)
888 {
889 fprintf(stdout, "\n\t\tTexture Coordinates : ");
890 for (i=0; i<p->num_facets+2; i++)
891 fprintf(stdout, "\n\t\t v[%d] = %g %g", i,
892 p->vtexturecoord[i].xy[0],
893 p->vtexturecoord[i].xy[1]);
894 }
895 else
896 fprintf( stdout, "\n\t\tTexture Coordinates not specified\n");
897
898 fprintf( stdout, "\n" );
899
900 return TSuccess;
901}
902
903/*----------------------------------------------------------------------*/
904#ifndef G003
905static void draw_edges ( tel_tmesh_data p, tel_colour edge_colour, Tint interior_style )
906{
907#else
908static void draw_edges (
909 tel_tmesh_data p,
910 tel_colour edge_colour,
911 Tint interior_style,
912 Tint forceDraw
913 )
914{
915#endif /* G003 */
916 CMN_KEY k, k1, k2, k3, k4;
917 Tint i, edge_type, line_type_preserve, newList = 0;
918 Tfloat edge_width, line_width_preserve;
919 GLboolean texture_on;
920 tel_point pv;
921#ifdef G003
922 if ( interior_style != TSM_HIDDENLINE && !forceDraw ) {
923#else
924 if ( interior_style != TSM_HIDDENLINE ) {
925#endif /* G003 */
926
927 k.id = TelEdgeFlag;
928 TsmGetAttri ( 1, &k );
929
930 if ( k.data.ldata == TOff ) return;
931
932 } /* end if */
933
934 pv = p -> vertices;
935
936 LightOff ();
937 texture_on = IsTextureEnabled ();
938 if ( texture_on ) DisableTexture ();
939
940 k1.id = TelPolylineWidth;
941 k2.id = TelPolylineType;
942 k3.id = TelEdgeType;
943 k4.id = TelEdgeWidth;
944 TsmGetAttri ( 4, &k1, &k2, &k3, &k4 );
945
946 line_width_preserve = k1.data.fdata;
947 line_type_preserve = k2.data.ldata;
948 edge_type = k3.data.ldata;
949 edge_width = k4.data.fdata;
950
951 if ( line_width_preserve != edge_width ) {
952
953 k.id = TelPolylineWidth;
954 k.data.fdata = edge_width;
955 TsmSetAttri ( 1, &k );
956
957 } /* end if */
958
959 if ( line_type_preserve != edge_type ) {
960
961 k.id = TelPolylineType;
962 k.data.ldata = edge_type;
963 TsmSetAttri ( 1, &k );
964
965 } /* end if */
966
967 glColor3fv ( edge_colour -> rgb );
968#ifdef G003
969 if ( !forceDraw )
970#endif /* G003 */
971 draw_line_loop ( p );
972#ifdef G003
973 else {
974#ifdef BUC60876
975 if ( !g_fAnimation )
976 goto doDraw; /* Disable object display list out of animation */
977#endif
978# ifdef G004
979 if ( g_fBitmap )
980 goto doDraw;
981# endif /* G004 */
982 if ( p -> d.degMode != 2 || p -> d.skipRatio != g_fSkipRatio || !p -> d.dlist ) {
983
984 if ( !p -> d.dlist ) p -> d.dlist = glGenLists ( 1 );
985
986 p -> d.degMode = 2;
987 p -> d.skipRatio = g_fSkipRatio;
988 glNewList ( p -> d.dlist, GL_COMPILE_AND_EXECUTE );
989 newList = 1;
990doDraw:
991 glPushAttrib ( GL_DEPTH_BUFFER_BIT );
992 glDisable ( GL_DEPTH_TEST );
993
994 if ( g_fSkipRatio == 0.0 )
995
996 draw_line_loop ( p );
997
998 else if ( g_fSkipRatio != 1.0 ) {
999
1000 set_drawable_items ( p -> d.bDraw, p -> num_facets + 2 );
1001
1002 for ( i = 0; i < p -> num_facets; ++i )
1003
1004 if ( p -> d.bDraw[ i ] ) {
1005
1006 glBegin ( GL_LINE_LOOP );
1007 glVertex3fv ( pv[ i ].xyz );
1008 glVertex3fv ( pv[ i + 1 ].xyz );
1009 glVertex3fv ( pv[ i + 2 ].xyz );
1010 glEnd();
1011
1012 } /* end if */
1013
1014 } /* end if */
1015
1016 glPopAttrib ();
1017 if ( newList ) glEndList ();
1018
1019 } else glCallList ( p -> d.dlist );
1020
1021 } /* end else */
1022#endif /* G003 */
1023 if ( line_width_preserve != edge_width ) {
1024
1025 k.id = TelPolylineWidth;
1026 k.data.fdata = line_width_preserve;
1027 TsmSetAttri ( 1, &k );
1028
1029 } /* end if */
1030
1031 if ( line_type_preserve != edge_type ) {
1032
1033 k.id = TelPolylineType;
1034 k.data.ldata = line_type_preserve;
1035 TsmSetAttri ( 1, &k );
1036
1037 } /* end if */
1038
1039 if ( texture_on ) EnableTexture ();
1040
1041} /* end draw_edges */
1042#ifdef G003
1043void draw_degenerates_as_points ( PDS_INTERNAL pd, tel_point p, Tint n ) {
1044
1045 int i, newList = 0;
1046
1047 LightOff ();
1048#ifdef BUC60876
1049 if ( !g_fAnimation )
1050 goto doDraw; /* Disable object display list out of animation */
1051#endif
1052#ifdef G004
1053 if ( g_fBitmap )
1054 goto doDraw;
1055#endif /* G004 */
1056 if ( pd -> degMode != 3 || pd -> skipRatio != g_fSkipRatio || !pd -> dlist ) {
1057
1058 if ( !pd -> dlist ) pd -> dlist = glGenLists ( 1 );
1059
1060 pd -> degMode = 3;
1061 pd -> skipRatio = g_fSkipRatio;
1062 glNewList ( pd -> dlist, GL_COMPILE_AND_EXECUTE );
1063 newList = 1;
1064
1065 if ( g_fSkipRatio == 0.0 ) {
1066#ifdef G004
1067doDraw:
1068#endif /* G004 */
1069 glBegin ( GL_POINTS );
1070
1071 for ( i = 0; i < n; ++i ) glVertex3fv ( p[ i ].xyz );
1072
1073 glEnd ();
1074
1075 } else if ( g_fSkipRatio != 1.0 ) {
1076
1077 set_drawable_items ( pd -> bDraw, n );
1078
1079 glBegin ( GL_POINTS );
1080
1081 for ( i = 0; i < n; ++i )
1082
1083 if ( pd -> bDraw[ i ] ) glVertex3fv ( p[ i ].xyz );
1084
1085 glEnd ();
1086
1087 } /* end if */
1088 if ( newList ) glEndList ();
1089
1090 } else glCallList ( pd -> dlist );
1091
1092} /* end draw_degenerates_as_points */
1093
1094void draw_degenerates_as_bboxs ( PDS_INTERNAL pd, tel_point p, Tint n ) {
1095
1096 int i, newList = 0;
1097 GLfloat minp[ 3 ] = { FLT_MAX, FLT_MAX, FLT_MAX };
1098 GLfloat maxp[ 3 ] = { FLT_MIN, FLT_MIN, FLT_MIN };
1099
1100 LightOff ();
1101#ifdef BUC60876
1102 if ( !g_fAnimation )
1103 goto doDraw; /* Disable object display list out of animation */
1104#endif
1105#ifdef G004
1106 if ( g_fBitmap )
1107 goto doDraw;
1108#endif /* G004 */
1109 if ( pd -> degMode != 4 || !pd -> dlist ) {
1110
1111 if ( !pd -> dlist ) pd -> dlist = glGenLists ( 1 );
1112
1113 pd -> degMode = 4;
1114
1115 glNewList ( pd -> dlist, GL_COMPILE_AND_EXECUTE );
1116 newList = 1;
1117#ifdef G004
1118doDraw:
1119#endif /* G004 */
1120 for ( i = 0; i < n; ++i ) {
1121
1122 TEL_POINT pt = p[ i ];
1123
1124 if ( pt.xyz[ 0 ] < minp[ 0 ] )
1125 minp[ 0 ] = pt.xyz[ 0 ] ;
1126 if ( pt.xyz[ 1 ] < minp[ 1 ] )
1127 minp[ 1 ] = pt.xyz[ 1 ] ;
1128 if ( pt.xyz[ 2 ] < minp[ 2 ] )
1129 minp[ 2 ] = pt.xyz[ 2 ] ;
1130
1131 if ( pt.xyz[ 0 ] > maxp[ 0 ] )
1132 maxp[ 0 ] = pt.xyz[ 0 ] ;
1133 if ( pt.xyz[ 1 ] > maxp[ 1 ] )
1134 maxp[ 1 ] = pt.xyz[ 1 ] ;
1135 if ( pt.xyz[ 2 ] > maxp[ 2 ] )
1136 maxp[ 2 ] = pt.xyz[ 2 ] ;
1137
1138 } /* end for */
1139
1140 glBegin ( GL_LINE_STRIP );
1141
1142 glVertex3fv ( minp );
1143 glVertex3f ( minp[ 0 ], maxp[ 1 ], minp[ 2 ] );
1144 glVertex3f ( minp[ 0 ], maxp[ 1 ], maxp[ 2 ] );
1145 glVertex3f ( minp[ 0 ], minp[ 1 ], maxp[ 2 ] );
1146 glVertex3f ( minp[ 0 ], minp[ 1 ], minp[ 2 ] );
1147
1148 glVertex3f ( maxp[ 0 ], minp[ 1 ], minp[ 2 ] );
1149 glVertex3f ( maxp[ 0 ], maxp[ 1 ], minp[ 2 ] );
1150 glVertex3f ( maxp[ 0 ], maxp[ 1 ], maxp[ 2 ] );
1151 glVertex3f ( maxp[ 0 ], minp[ 1 ], maxp[ 2 ] );
1152 glVertex3f ( maxp[ 0 ], minp[ 1 ], minp[ 2 ] );
1153
1154 glVertex3f ( maxp[ 0 ], minp[ 1 ], maxp[ 2 ] );
1155 glVertex3f ( minp[ 0 ], minp[ 1 ], maxp[ 2 ] );
1156 glVertex3f ( minp[ 0 ], maxp[ 1 ], maxp[ 2 ] );
1157 glVertex3fv ( maxp );
1158 glVertex3f ( maxp[ 0 ], maxp[ 1 ], minp[ 2 ] );
1159 glVertex3f ( minp[ 0 ], maxp[ 1 ], minp[ 2 ] );
1160
1161 glEnd();
1162 if ( newList ) glEndList ();
1163
1164 } else glCallList ( pd -> dlist );
1165
1166} /* end draw_degenerates_as_bboxs */
1167#endif /* G003 */
1168
1169static void draw_line_loop ( tel_tmesh_data p ) {
1170
1171 int i;
1172
1173 for ( i = 0; i < p -> num_facets; ++i ) {
1174
1175 glBegin ( GL_LINE_LOOP );
1176 glVertex3fv ( p -> vertices[ i ].xyz );
1177 glVertex3fv ( p -> vertices[ i + 1 ].xyz );
1178 glVertex3fv ( p -> vertices[ i + 2 ].xyz );
1179 glEnd();
1180
1181 } /* end for */
1182
1183} /* end draw_line_loop */
1184
1185/*----------------------------------------------------------------------*/
1186static TStatus
1187TriangleMeshInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
1188{
1189 Tint i, j;
1190 tel_tmesh_data d;
1191 Tint size_reqd=0;
1192 TStatus status = TSuccess;
1193 Tchar *cur_ptr = 0;
1194
1195 d = (tel_tmesh_data)data.pdata;
1196
1197 if( d->fcolours )
1198 size_reqd += ( d->num_facets * sizeof( TEL_COLOUR ) );
1199
1200 if( d->facet_flag == TEL_FA_NORMAL )
1201 size_reqd += ( d->num_facets * sizeof( TEL_POINT ) );
1202
1203 size_reqd += ( (d->num_facets+2) * sizeof( TEL_POINT ) );
1204
1205 if( d->vcolours )
1206 size_reqd += ( (d->num_facets+2) * sizeof( TEL_COLOUR ) );
1207
1208 if( d->vertex_flag == TEL_VT_NORMAL )
1209 size_reqd += ( (d->num_facets+2) * sizeof( TEL_POINT ) );
1210
1211 for( i = 0; i < n; i++ )
1212 {
1213 switch( k[i]->id )
1214 {
1215 case INQ_GET_SIZE_ID:
1216 {
1217 k[i]->data.ldata = size_reqd;
1218 break;
1219 }
1220
1221 case INQ_GET_CONTENT_ID:
1222 {
1223 TEL_INQ_CONTENT *c;
1224 Teldata *w;
1225
1226 c = (TEL_INQ_CONTENT*)k[i]->data.pdata;
1227 c->act_size = size_reqd;
1228 w = c->data;
1229
1230 cur_ptr = c->buf;
1231 w->trianglestrip3data.num_facets = d->num_facets;
1232
1233 if( c->size >= size_reqd )
1234 {
1235 if( d->facet_flag == TEL_FA_NORMAL )
1236 {
1237 if( d->fcolours )
1238 {
1239 w->trianglestrip3data.fctflag = TEL_FAFLAG_COLOURNORMAL;
1240 w->trianglestrip3data.gnormals = (tel_point)(c->buf);
1241 for( j = 0; j < d->num_facets; j++ )
1242 {
1243 w->trianglestrip3data.gnormals[j] = d->fnormals[j];
1244 }
1245 cur_ptr += ( d->num_facets * sizeof( TEL_POINT ) );
1246
1247 w->trianglestrip3data.facet_colour_vals =
1248 (tel_colour)(cur_ptr);
1249 for( j = 0; j < d->num_facets; j++ )
1250 {
1251 w->trianglestrip3data.facet_colour_vals[j] =
1252 d->fcolours[j];
1253 }
1254 cur_ptr += ( d->num_facets * sizeof( TEL_COLOUR ) );
1255 }
1256 else
1257 {
1258 w->trianglestrip3data.fctflag = TEL_FAFLAG_NORMAL;
1259 w->trianglestrip3data.facet_colour_vals = 0;
1260 w->trianglestrip3data.gnormals = (tel_point)(c->buf);
1261 for( j = 0; j < d->num_facets; j++ )
1262 {
1263 w->trianglestrip3data.gnormals[j] = d->fnormals[j];
1264 }
1265 cur_ptr += ( d->num_facets * sizeof( TEL_POINT ) );
1266 }
1267 }
1268 else
1269 {
1270 w->trianglestrip3data.gnormals = 0;
1271 if( d->fcolours )
1272 {
1273 w->trianglestrip3data.fctflag = TEL_FAFLAG_COLOUR;
1274 w->trianglestrip3data.facet_colour_vals =
1275 (tel_colour)(c->buf );
1276 for( j = 0; j < d->num_facets; j++ )
1277 {
1278 w->trianglestrip3data.facet_colour_vals[j] =
1279 d->fcolours[j];
1280 }
1281 cur_ptr += ( d->num_facets * sizeof( TEL_COLOUR ) );
1282 }
1283 else
1284 {
1285 w->trianglestrip3data.fctflag = TEL_FAFLAG_NONE;
1286 w->trianglestrip3data.facet_colour_vals = 0;
1287 }
1288 }
1289
1290 w->trianglestrip3data.points = (tel_point)cur_ptr;
1291 for( j = 0; j < (d->num_facets+2); j++ )
1292 {
1293 w->trianglestrip3data.points[j] = d->vertices[j];
1294 }
1295 cur_ptr += ( (d->num_facets+2) * sizeof( TEL_POINT ) );
1296
1297 if( d->vertex_flag == TEL_VT_NORMAL )
1298 {
1299 if( d->vcolours )
1300 {
1301 w->trianglestrip3data.vrtflag = TEL_VTFLAG_COLOURNORMAL;
1302 w->trianglestrip3data.vnormals = (tel_point)(cur_ptr);
1303 for( j = 0; j < (d->num_facets+2); j++ )
1304 {
1305 w->trianglestrip3data.vnormals[j] = d->vnormals[i];
1306 }
1307 cur_ptr += ( (d->num_facets+2) * sizeof( TEL_POINT ) );
1308
1309 w->trianglestrip3data.colours = (tel_colour)(cur_ptr);
1310
1311 for( j = 0; j < (d->num_facets+2); j++ )
1312 {
1313 w->trianglestrip3data.colours[j] = d->vcolours[i];
1314 }
1315 }
1316 else
1317 {
1318 w->trianglestrip3data.vrtflag = TEL_VTFLAG_NORMAL;
1319 w->trianglestrip3data.colours = 0;
1320 w->trianglestrip3data.vnormals = (tel_point)(cur_ptr);
1321
1322 for( j = 0; j < (d->num_facets+2); j++ )
1323 {
1324 w->trianglestrip3data.vnormals[j] = d->vnormals[i];
1325 }
1326 }
1327 }
1328 else
1329 {
1330 w->trianglestrip3data.vnormals = 0;
1331 if( d->vcolours )
1332 {
1333 w->trianglestrip3data.vrtflag = TEL_VTFLAG_COLOUR;
1334 w->trianglestrip3data.colours = (tel_colour)(cur_ptr);
1335 for( j = 0; j < (d->num_facets+2); j++ )
1336 {
1337 w->trianglestrip3data.colours[j] = d->vcolours[i];
1338 }
1339 }
1340 else
1341 {
1342 w->trianglestrip3data.vrtflag = TEL_VTFLAG_NONE;
1343 w->trianglestrip3data.colours = 0;
1344 }
1345 }
1346
1347 status = TSuccess;
1348 }
1349 else
1350 status = TFailure;
1351 break;
1352 }
1353 }
1354 }
1355 return status;
1356}
1357/*----------------------------------------------------------------------*/