1 // File: OpenGl_TriangleStrip.cxx
2 // Created: 13 July 2011
3 // Author: Sergey ZERCHANINOV
4 // Copyright: OPEN CASCADE 2011
6 #include <OpenGl_tgl_all.hxx>
9 #include <OpenGl_TriangleStrip.hxx>
11 #include <OpenGl_telem_util.hxx>
12 #include <OpenGl_TextureBox.hxx>
14 #include <OpenGl_AspectFace.hxx>
15 #include <OpenGl_Structure.hxx>
17 /*----------------------------------------------------------------------*/
19 void draw_degenerates_as_points ( PDS_INTERNAL, tel_point, Tint, const Handle(OpenGl_Workspace) & );
20 void draw_degenerates_as_bboxs ( PDS_INTERNAL, tel_point, Tint, const Handle(OpenGl_Workspace) & );
21 extern void set_drawable_items ( GLboolean*, int, const float );
23 /*----------------------------------------------------------------------*/
25 void OpenGl_TriangleStrip::draw_tmesh (const Tint front_lighting_model,
26 const Aspect_InteriorStyle interior_style,
27 const TEL_COLOUR *edge_colour,
28 const Handle(OpenGl_Workspace) &AWorkspace) const
32 tel_colour pfc = myData.fcolours;
33 tel_point pv = myData.vertices;
34 tel_colour pvc = myData.vcolours;
35 tel_point pvn = myData.vnormals;
36 tel_texture_coord pvt = myData.vtexturecoord;
38 if ( AWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT ) pvc = pfc = 0;
40 if ( AWorkspace->DegenerateModel < 2 && interior_style != Aspect_IS_EMPTY )
42 if ( front_lighting_model )
43 glEnable(GL_LIGHTING);
45 glDisable(GL_LIGHTING);
47 if ( (AWorkspace->NamedStatus & OPENGL_NS_ANIMATION) == 0 )
48 goto doDraw; /* Disable object display list out of animation */
49 if ( myDS->model != front_lighting_model || !myDS->list || myDS->model == -1 ||
50 ( AWorkspace->DegenerateModel && myDS->skipRatio != AWorkspace->SkipRatio ) )
52 myDS->skipRatio = AWorkspace->SkipRatio;
53 myDS->model = front_lighting_model;
54 myDS->degMode = AWorkspace->DegenerateModel;
56 if ( AWorkspace->SkipRatio <= 0.f ) {
58 if ( !myDS->list ) myDS->list = glGenLists ( 1 );
60 glNewList ( myDS->list, GL_COMPILE_AND_EXECUTE );
63 glBegin ( GL_TRIANGLE_STRIP );
65 if ( front_lighting_model )
67 if ( pvt && (AWorkspace->NamedStatus & OPENGL_NS_FORBIDSETTEX) == 0 )
69 for ( i = 0; i < myData.num_facets + 2; ++i )
71 glNormal3fv ( pvn[ i ].xyz );
72 glTexCoord2fv ( pvt[ i ].xy );
73 glVertex3fv ( pv [ i ].xyz );
77 for ( i = 0; i < myData.num_facets + 2; ++i )
79 glNormal3fv( pvn[ i ].xyz );
80 glVertex3fv( pv[ i ].xyz );
87 for ( i = 0; i < myData.num_facets + 2; ++i )
89 glColor3fv ( pvc[ i ].rgb );
90 glVertex3fv ( pv [ i ].xyz );
95 glColor3fv ( pfc[ 0 ].rgb );
96 glVertex3fv ( pv [ 0 ].xyz );
97 glVertex3fv ( pv [ 1 ].xyz );
98 for ( i = 2; i < myData.num_facets + 2; ++i )
100 glColor3fv ( pfc[ i - 2 ].rgb );
101 glVertex3fv( pv [ i ].xyz );
105 for ( i = 0; i < myData.num_facets + 2; ++i ) glVertex3fv ( pv[ i ].xyz );
109 else if ( AWorkspace->SkipRatio < 1.f )
111 set_drawable_items ( myDS->bDraw, myData.num_facets + 2, AWorkspace->SkipRatio );
113 if ( !myDS->dlist ) myDS->dlist = glGenLists ( 1 );
115 glNewList ( myDS->dlist, GL_COMPILE_AND_EXECUTE );
118 glBegin ( GL_TRIANGLES );
120 if ( front_lighting_model )
122 if ( pvt && (AWorkspace->NamedStatus & OPENGL_NS_FORBIDSETTEX) == 0 )
124 for ( i = 0; i < myData.num_facets; ++i )
126 if ( myDS->bDraw[ i ] )
130 glNormal3fv ( pvn[ i ].xyz );
131 glTexCoord2fv ( pvt[ i ].xy );
132 glVertex3fv ( pv [ i ].xyz );
133 glNormal3fv ( pvn[ i + 2 ].xyz );
134 glTexCoord2fv ( pvt[ i + 2 ].xy );
135 glVertex3fv ( pv [ i + 2 ].xyz );
136 glNormal3fv ( pvn[ i + 1 ].xyz );
137 glTexCoord2fv ( pvt[ i + 1 ].xy );
138 glVertex3fv ( pv [ i + 1 ].xyz );
142 glNormal3fv ( pvn[ i + 2 ].xyz );
143 glTexCoord2fv ( pvt[ i + 2 ].xy );
144 glVertex3fv ( pv [ i + 2 ].xyz );
145 glNormal3fv ( pvn[ i ].xyz );
146 glTexCoord2fv ( pvt[ i ].xy );
147 glVertex3fv ( pv [ i ].xyz );
148 glNormal3fv ( pvn[ i + 1 ].xyz );
149 glTexCoord2fv ( pvt[ i + 1 ].xy );
150 glVertex3fv ( pv [ i + 1 ].xyz );
157 for ( i = 0; i < myData.num_facets; ++i )
159 if ( myDS->bDraw[ i ] )
163 glNormal3fv( pvn[ i ].xyz );
164 glVertex3fv( pv[ i ].xyz );
165 glNormal3fv( pvn[ i + 2 ].xyz );
166 glVertex3fv( pv[ i + 2 ].xyz );
167 glNormal3fv( pvn[ i + 1 ].xyz );
168 glVertex3fv( pv[ i + 1 ].xyz );
172 glNormal3fv( pvn[ i + 2 ].xyz );
173 glVertex3fv( pv[ i + 2 ].xyz );
174 glNormal3fv( pvn[ i ].xyz );
175 glVertex3fv( pv[ i ].xyz );
176 glNormal3fv( pvn[ i + 1 ].xyz );
177 glVertex3fv( pv[ i + 1 ].xyz );
187 for ( i = 0; i < myData.num_facets; ++i )
189 if ( myDS->bDraw[ i ] )
193 glColor3fv ( pvc[ i ].rgb );
194 glVertex3fv ( pv [ i ].xyz );
195 glColor3fv ( pvc[ i + 2 ].rgb );
196 glVertex3fv ( pv [ i + 2 ].xyz );
197 glColor3fv ( pvc[ i + 1 ].rgb );
198 glVertex3fv ( pv [ i + 1 ].xyz );
202 glColor3fv ( pvc[ i + 2 ].rgb );
203 glVertex3fv ( pv [ i + 2 ].xyz );
204 glColor3fv ( pvc[ i ].rgb );
205 glVertex3fv ( pv [ i ].xyz );
206 glColor3fv ( pvc[ i + 1 ].rgb );
207 glVertex3fv ( pv [ i + 1 ].xyz );
214 for ( i = 0; i < myData.num_facets; ++i )
216 if ( myDS->bDraw[ i ] )
220 glColor3fv ( pfc[ i ].rgb );
221 glVertex3fv( pv [ i ].xyz );
222 glColor3fv ( pfc[ i + 2 ].rgb );
223 glVertex3fv( pv [ i + 2 ].xyz );
224 glColor3fv ( pfc[ i + 1 ].rgb );
225 glVertex3fv( pv [ i + 1 ].xyz );
229 glColor3fv ( pfc[ i + 2 ].rgb );
230 glVertex3fv( pv [ i + 2 ].xyz );
231 glColor3fv ( pfc[ i ].rgb );
232 glVertex3fv( pv [ i ].xyz );
233 glColor3fv ( pfc[ i + 1 ].rgb );
234 glVertex3fv( pv [ i + 1 ].xyz );
241 for ( i = 0; i < myData.num_facets; ++i )
243 if ( myDS->bDraw[ i ] )
247 glVertex3fv ( pv[ i ].xyz );
248 glVertex3fv ( pv[ i + 2 ].xyz );
249 glVertex3fv ( pv[ i + 1 ].xyz );
253 glVertex3fv ( pv[ i + 2 ].xyz );
254 glVertex3fv ( pv[ i ].xyz );
255 glVertex3fv ( pv[ i + 1 ].xyz );
265 if ( !myDS->dlist ) myDS->dlist = glGenLists ( 1 );
267 glNewList ( myDS->dlist, GL_COMPILE_AND_EXECUTE );
270 if ( newList ) glEndList ();
272 if ( AWorkspace->DegenerateModel ) return;
276 glCallList ( AWorkspace->SkipRatio <= 0.f ? myDS->list : myDS->dlist );
277 if ( AWorkspace->DegenerateModel ) return;
283 /* OCC11904 -- Temporarily disable environment mapping */
284 glPushAttrib(GL_ENABLE_BIT);
285 glDisable(GL_TEXTURE_1D);
286 glDisable(GL_TEXTURE_2D);
288 switch ( AWorkspace->DegenerateModel )
293 case 2: /* XXX_TDM_WIREFRAME */
297 case 3: /* XXX_TDM_MARKER */
298 draw_degenerates_as_points ( myDS, myData.vertices, myData.num_facets + 2, AWorkspace );
302 case 4: /* XXX_TDM_BBOX */
303 draw_degenerates_as_bboxs ( myDS, myData.vertices, myData.num_facets + 2, AWorkspace );
308 draw_edges ( edge_colour, interior_style, i, AWorkspace );
313 /*----------------------------------------------------------------------*/
315 void OpenGl_TriangleStrip::draw_edges (const TEL_COLOUR *edge_colour, const Aspect_InteriorStyle interior_style,
316 Tint forceDraw, const Handle(OpenGl_Workspace) &AWorkspace) const
318 const OpenGl_AspectFace *aspect_face = AWorkspace->AspectFace( Standard_True );
320 if ( interior_style != Aspect_IS_HIDDENLINE && !forceDraw && aspect_face->Context().Edge == TOff )
323 glDisable(GL_LIGHTING);
324 const GLboolean texture_on = IsTextureEnabled();
325 if ( texture_on ) DisableTexture();
328 const OpenGl_AspectLine *aspect_line_old = AWorkspace->SetAspectLine( aspect_face->AspectEdge() );
329 AWorkspace->AspectLine( Standard_True );
331 tel_point pv = myData.vertices;
334 glColor3fv ( edge_colour->rgb );
339 if ( (AWorkspace->NamedStatus & OPENGL_NS_ANIMATION) == 0 )
340 goto doDraw; /* Disable object display list out of animation */
341 if ( myDS->degMode != 2 || myDS->skipRatio != AWorkspace->SkipRatio || !myDS->dlist ) {
343 if ( !myDS->dlist ) myDS->dlist = glGenLists ( 1 );
346 myDS->skipRatio = AWorkspace->SkipRatio;
347 glNewList ( myDS->dlist, GL_COMPILE_AND_EXECUTE );
350 glPushAttrib ( GL_DEPTH_BUFFER_BIT );
351 glDisable ( GL_DEPTH_TEST );
353 if ( AWorkspace->SkipRatio <= 0.f )
357 else if ( AWorkspace->SkipRatio < 1.f ) {
359 set_drawable_items ( myDS->bDraw, myData.num_facets + 2, AWorkspace->SkipRatio );
361 for ( i = 0; i < myData.num_facets; ++i )
363 if ( myDS->bDraw[ i ] ) {
365 glBegin ( GL_LINE_LOOP );
366 glVertex3fv ( pv[ i ].xyz );
367 glVertex3fv ( pv[ i + 1 ].xyz );
368 glVertex3fv ( pv[ i + 2 ].xyz );
376 if ( newList ) glEndList ();
378 } else glCallList ( myDS->dlist );
382 // Restore line context
383 AWorkspace->SetAspectLine( aspect_line_old );
385 if ( texture_on ) EnableTexture ();
388 void draw_degenerates_as_points ( PDS_INTERNAL pd, tel_point p, Tint n, const Handle(OpenGl_Workspace) &AWorkspace )
392 glDisable(GL_LIGHTING);
393 if ( (AWorkspace->NamedStatus & OPENGL_NS_ANIMATION) == 0 )
394 goto doDraw; /* Disable object display list out of animation */
395 if ( pd -> degMode != 3 || pd -> skipRatio != AWorkspace->SkipRatio || !pd -> dlist ) {
397 if ( !pd -> dlist ) pd -> dlist = glGenLists ( 1 );
400 pd -> skipRatio = AWorkspace->SkipRatio;
401 glNewList ( pd -> dlist, GL_COMPILE_AND_EXECUTE );
404 if ( AWorkspace->SkipRatio <= 0.f ) {
406 glBegin ( GL_POINTS );
408 for ( i = 0; i < n; ++i ) glVertex3fv ( p[ i ].xyz );
412 } else if ( AWorkspace->SkipRatio < 1.f ) {
414 set_drawable_items ( pd -> bDraw, n, AWorkspace->SkipRatio );
416 glBegin ( GL_POINTS );
418 for ( i = 0; i < n; ++i )
420 if ( pd -> bDraw[ i ] ) glVertex3fv ( p[ i ].xyz );
425 if ( newList ) glEndList ();
427 } else glCallList ( pd -> dlist );
429 } /* end draw_degenerates_as_points */
431 void draw_degenerates_as_bboxs ( PDS_INTERNAL pd, tel_point p, Tint n, const Handle(OpenGl_Workspace) &AWorkspace )
434 GLfloat minp[ 3 ] = { FLT_MAX, FLT_MAX, FLT_MAX };
435 GLfloat maxp[ 3 ] = { FLT_MIN, FLT_MIN, FLT_MIN };
437 glDisable(GL_LIGHTING);
438 if ( (AWorkspace->NamedStatus & OPENGL_NS_ANIMATION) == 0 )
439 goto doDraw; /* Disable object display list out of animation */
440 if ( pd -> degMode != 4 || !pd -> dlist ) {
442 if ( !pd -> dlist ) pd -> dlist = glGenLists ( 1 );
446 glNewList ( pd -> dlist, GL_COMPILE_AND_EXECUTE );
449 for ( i = 0; i < n; ++i ) {
451 TEL_POINT pt = p[ i ];
453 if ( pt.xyz[ 0 ] < minp[ 0 ] )
454 minp[ 0 ] = pt.xyz[ 0 ] ;
455 if ( pt.xyz[ 1 ] < minp[ 1 ] )
456 minp[ 1 ] = pt.xyz[ 1 ] ;
457 if ( pt.xyz[ 2 ] < minp[ 2 ] )
458 minp[ 2 ] = pt.xyz[ 2 ] ;
460 if ( pt.xyz[ 0 ] > maxp[ 0 ] )
461 maxp[ 0 ] = pt.xyz[ 0 ] ;
462 if ( pt.xyz[ 1 ] > maxp[ 1 ] )
463 maxp[ 1 ] = pt.xyz[ 1 ] ;
464 if ( pt.xyz[ 2 ] > maxp[ 2 ] )
465 maxp[ 2 ] = pt.xyz[ 2 ] ;
469 glBegin ( GL_LINE_STRIP );
471 glVertex3fv ( minp );
472 glVertex3f ( minp[ 0 ], maxp[ 1 ], minp[ 2 ] );
473 glVertex3f ( minp[ 0 ], maxp[ 1 ], maxp[ 2 ] );
474 glVertex3f ( minp[ 0 ], minp[ 1 ], maxp[ 2 ] );
475 glVertex3f ( minp[ 0 ], minp[ 1 ], minp[ 2 ] );
477 glVertex3f ( maxp[ 0 ], minp[ 1 ], minp[ 2 ] );
478 glVertex3f ( maxp[ 0 ], maxp[ 1 ], minp[ 2 ] );
479 glVertex3f ( maxp[ 0 ], maxp[ 1 ], maxp[ 2 ] );
480 glVertex3f ( maxp[ 0 ], minp[ 1 ], maxp[ 2 ] );
481 glVertex3f ( maxp[ 0 ], minp[ 1 ], minp[ 2 ] );
483 glVertex3f ( maxp[ 0 ], minp[ 1 ], maxp[ 2 ] );
484 glVertex3f ( minp[ 0 ], minp[ 1 ], maxp[ 2 ] );
485 glVertex3f ( minp[ 0 ], maxp[ 1 ], maxp[ 2 ] );
486 glVertex3fv ( maxp );
487 glVertex3f ( maxp[ 0 ], maxp[ 1 ], minp[ 2 ] );
488 glVertex3f ( minp[ 0 ], maxp[ 1 ], minp[ 2 ] );
491 if ( newList ) glEndList ();
493 } else glCallList ( pd -> dlist );
495 } /* end draw_degenerates_as_bboxs */
497 void OpenGl_TriangleStrip::draw_line_loop () const
501 for ( i = 0; i < myData.num_facets; ++i )
503 glBegin ( GL_LINE_LOOP );
504 glVertex3fv ( myData.vertices[ i ].xyz );
505 glVertex3fv ( myData.vertices[ i + 1 ].xyz );
506 glVertex3fv ( myData.vertices[ i + 2 ].xyz );
511 /*----------------------------------------------------------------------*/
513 OpenGl_TriangleStrip::OpenGl_TriangleStrip (const Graphic3d_Array1OfVertex& AListVertex)
515 const Standard_Integer nv = AListVertex.Length();
516 TEL_POINT *points = new TEL_POINT[nv];
517 memcpy( points, &AListVertex(AListVertex.Lower()), nv*sizeof(TEL_POINT) );
519 Init(nv - 2,points,NULL,NULL,NULL,NULL,NULL);
522 /*----------------------------------------------------------------------*/
524 OpenGl_TriangleStrip::OpenGl_TriangleStrip (const Graphic3d_Array1OfVertexN& AListVertex)
526 const Standard_Integer nv = AListVertex.Length ();
528 // Dynamic allocation
529 TEL_POINT *points = new TEL_POINT[nv];
530 TEL_POINT *normals = new TEL_POINT[nv];
532 Standard_Integer i = 0, j = AListVertex.Lower();
533 Standard_Real X, Y, Z;
534 for ( ; i < nv; i++, j++)
536 AListVertex(j).Coord (X, Y, Z);
537 points[i].xyz[0] = float (X);
538 points[i].xyz[1] = float (Y);
539 points[i].xyz[2] = float (Z);
540 AListVertex(j).Normal (X, Y, Z);
541 normals[i].xyz[0] = float (X);
542 normals[i].xyz[1] = float (Y);
543 normals[i].xyz[2] = float (Z);
546 Init(nv - 2,points,normals,NULL,NULL,NULL,NULL);
549 /*----------------------------------------------------------------------*/
551 OpenGl_TriangleStrip::OpenGl_TriangleStrip (const Graphic3d_Array1OfVertexNT& AListVertex)
553 const Standard_Integer nv = AListVertex.Length();
555 // Dynamic allocation
556 TEL_POINT *points = new TEL_POINT[nv];
557 TEL_POINT *normals = new TEL_POINT[nv];
558 TEL_TEXTURE_COORD *tcoords = new TEL_TEXTURE_COORD[nv];
560 Standard_Integer i = 0, j = AListVertex.Upper();
561 Standard_Real X, Y, Z;
562 for ( ; i < nv; i++, j++)
564 AListVertex(j).Coord (X, Y, Z);
565 points[i].xyz[0] = float (X);
566 points[i].xyz[1] = float (Y);
567 points[i].xyz[2] = float (Z);
568 AListVertex(j).Normal (X, Y, Z);
569 normals[i].xyz[0] = float (X);
570 normals[i].xyz[1] = float (Y);
571 normals[i].xyz[2] = float (Z);
572 AListVertex(j).TextureCoordinate(X, Y);
573 tcoords[i].xy[0] = float(X);
574 tcoords[i].xy[1] = float(Y);
577 Init(nv - 2,points,normals,NULL,tcoords,NULL,NULL);
580 /*----------------------------------------------------------------------*/
582 void OpenGl_TriangleStrip::Init (const Tint ANbFacets, tel_point AVertices,
583 tel_point AVNormals, tel_colour AVColors, tel_texture_coord ATCoords,
584 tel_point AFNormals, tel_colour AFColors)
586 myData.num_facets = ANbFacets;
588 const Tint nv = ANbFacets + 2;
593 myData.vertices = AVertices;
595 // Store or compute (based on vertices) facet normals
598 myData.facet_flag = TEL_FA_NORMAL;
599 myData.fnormals = AFNormals;
600 for( i = 0; i < ANbFacets; i++ )
601 vecnrm( myData.fnormals[i].xyz );
605 myData.facet_flag = TEL_FA_NONE;
606 myData.fnormals = new TEL_POINT[ANbFacets];
607 for( i = 0; i < ANbFacets; i++ )
610 TelGetNormal( myData.vertices[i].xyz, myData.vertices[i+2].xyz, myData.vertices[i+1].xyz, myData.fnormals[i].xyz );
612 TelGetNormal( myData.vertices[i].xyz, myData.vertices[i+1].xyz, myData.vertices[i+2].xyz, myData.fnormals[i].xyz );
617 // Store or compute (based on facet normals) vertex normals
620 myData.vertex_flag = TEL_VT_NORMAL;
621 myData.vnormals = AVNormals;
622 for( i = 0; i < nv; i++ )
623 vecnrm( myData.vnormals[i].xyz );
627 myData.vertex_flag = TEL_VT_NONE;
628 myData.vnormals = new TEL_POINT[nv];
629 for( i = 2; i < ANbFacets; i++ )
631 myData.vnormals[i].xyz[0] = ( myData.fnormals[i-2].xyz[0] + myData.fnormals[i-1].xyz[0] + myData.fnormals[i].xyz[0] ) / 3.0F;
632 myData.vnormals[i].xyz[1] = ( myData.fnormals[i-2].xyz[1] + myData.fnormals[i-1].xyz[1] + myData.fnormals[i].xyz[1] ) / 3.0F;
633 myData.vnormals[i].xyz[2] = ( myData.fnormals[i-2].xyz[2] + myData.fnormals[i-1].xyz[2] + myData.fnormals[i].xyz[2] ) / 3.0F;
635 myData.vnormals[0] = myData.fnormals[0];
638 myData.vnormals[1].xyz[0] = ( myData.fnormals[0].xyz[0] + myData.fnormals[1].xyz[0] ) / 2.0F;
639 myData.vnormals[1].xyz[1] = ( myData.fnormals[0].xyz[1] + myData.fnormals[1].xyz[1] ) / 2.0F;
640 myData.vnormals[1].xyz[2] = ( myData.fnormals[0].xyz[2] + myData.fnormals[1].xyz[2] ) / 2.0F;
643 myData.vnormals[1] = myData.fnormals[0];
645 myData.vnormals[ANbFacets+1] = myData.fnormals[ANbFacets-1];
646 // second last vertex
649 myData.vnormals[ANbFacets].xyz[0] = ( myData.fnormals[ANbFacets-1].xyz[0] + myData.fnormals[ANbFacets-2].xyz[0] ) / 2.0F;
650 myData.vnormals[ANbFacets].xyz[1] = ( myData.fnormals[ANbFacets-1].xyz[1] + myData.fnormals[ANbFacets-2].xyz[1] ) / 2.0F;
651 myData.vnormals[ANbFacets].xyz[2] = ( myData.fnormals[ANbFacets-1].xyz[2] + myData.fnormals[ANbFacets-2].xyz[2] ) / 2.0F;
655 myData.vcolours = AVColors;
656 myData.vtexturecoord = ATCoords;
657 myData.fcolours = AFColors;
659 myDS = new DS_INTERNAL();
664 myDS->skipRatio = 0.0F;
665 myDS->bDraw = new unsigned char[nv];
668 /*----------------------------------------------------------------------*/
670 OpenGl_TriangleStrip::~OpenGl_TriangleStrip ()
672 if( myData.fnormals )
673 delete[] myData.fnormals;
674 if( myData.fcolours )
675 delete[] myData.fcolours;
676 if( myData.vertices )
677 delete[] myData.vertices;
678 if( myData.vcolours )
679 delete[] myData.vcolours;
680 if( myData.vnormals )
681 delete[] myData.vnormals;
682 if ( myData.vtexturecoord )
683 delete[] myData.vtexturecoord;
687 if ( GET_GL_CONTEXT() != NULL )
689 if ( myDS->list ) glDeleteLists ( myDS->list, 1 );
690 if ( myDS->dlist ) glDeleteLists ( myDS->dlist, 1 );
693 delete[] myDS->bDraw;
699 /*----------------------------------------------------------------------*/
701 void OpenGl_TriangleStrip::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
703 const OpenGl_AspectFace *aspect_face = AWorkspace->AspectFace( Standard_True );
705 Tint front_lighting_model = aspect_face->Context().IntFront.color_mask;
706 const TEL_COLOUR *interior_colour = &aspect_face->Context().IntFront.matcol;
707 const TEL_COLOUR *edge_colour = &aspect_face->AspectEdge()->Color();
709 // Use highlight colors
710 if ( AWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT )
712 edge_colour = interior_colour = AWorkspace->HighlightColor;
713 front_lighting_model = 0;
716 glColor3fv( interior_colour->rgb );
718 draw_tmesh( front_lighting_model,
719 aspect_face->Context().InteriorStyle,
724 /*----------------------------------------------------------------------*/