KiCad PCB EDA Suite
CLAYERS_OGL_DISP_LISTS Class Reference

The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer. More...

#include <clayer_triangles.h>

Public Member Functions

 CLAYERS_OGL_DISP_LISTS (const CLAYER_TRIANGLES &aLayerTriangles, GLuint aTextureIndexForSegEnds, float aZBot, float aZTop)
 CLAYERS_OGL_DISP_LISTS - Creates the display lists for a layer. More...
 
 ~CLAYERS_OGL_DISP_LISTS ()
 ~CLAYERS_OGL_DISP_LISTS - Destroy this class while free the display lists from GPU mem More...
 
void DrawTopAndMiddle () const
 DrawTopAndMiddle - This function calls the display lists for the top elements and middle contourns. More...
 
void DrawBotAndMiddle () const
 DrawBotAndMiddle - This function calls the display lists for the botton elements and middle contourns. More...
 
void DrawTop () const
 DrawTop - This function calls the display lists for the top elements. More...
 
void DrawBot () const
 DrawBot - This function calls the display lists for the botton elements. More...
 
void DrawMiddle () const
 DrawMiddle - This function calls the display lists for the middle elements. More...
 
void DrawAll (bool aDrawMiddle=true) const
 DrawAll - This function calls all the display lists. More...
 
void DrawAllCameraCulled (float zCameraPos, bool aDrawMiddle=true) const
 DrawAllCameraCulled - Draw all layers if they are visible by the camera. More...
 
void DrawAllCameraCulledSubtractLayer (const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractA, const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractB, bool aDrawMiddle=true) const
 
void ApplyScalePosition (float aZposition, float aZscale)
 
void ClearScalePosition ()
 
void SetItIsTransparent (bool aSetTransparent)
 
float GetZBot () const
 
float GetZTop () const
 

Private Member Functions

GLuint generate_top_or_bot_seg_ends (const CLAYER_TRIANGLE_CONTAINER *aTriangleContainer, bool aIsNormalUp, GLuint aTextureId) const
 
GLuint generate_top_or_bot_triangles (const CLAYER_TRIANGLE_CONTAINER *aTriangleContainer, bool aIsNormalUp) const
 
GLuint generate_middle_triangles (const CLAYER_TRIANGLE_CONTAINER *aTriangleContainer) const
 
void beginTransformation () const
 
void endTransformation () const
 
void setBlendfunction () const
 

Private Attributes

float m_zBot
 
float m_zTop
 
GLuint m_layer_top_segment_ends
 
GLuint m_layer_top_triangles
 
GLuint m_layer_middle_contourns_quads
 
GLuint m_layer_bot_triangles
 
GLuint m_layer_bot_segment_ends
 
bool m_haveTransformation
 
float m_zPositionTransformation
 
float m_zScaleTransformation
 
bool m_draw_it_transparent
 

Detailed Description

The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.

Definition at line 192 of file clayer_triangles.h.

Constructor & Destructor Documentation

CLAYERS_OGL_DISP_LISTS::CLAYERS_OGL_DISP_LISTS ( const CLAYER_TRIANGLES aLayerTriangles,
GLuint  aTextureIndexForSegEnds,
float  aZBot,
float  aZTop 
)

CLAYERS_OGL_DISP_LISTS - Creates the display lists for a layer.

Parameters
aLayerTrianglescontains the layers array of vertex to render to display lists
aTextureIndexForSegEndstexture index to be used by segment ends. It is a black and white squared texture with a center circle diameter of the size of the texture.

Definition at line 349 of file clayer_triangles.cpp.

References CLAYER_TRIANGLE_CONTAINER::GetVertexSize(), CLAYER_TRIANGLES::m_layer_bot_segment_ends, CLAYER_TRIANGLES::m_layer_bot_triangles, CLAYER_TRIANGLES::m_layer_middle_contourns_quads, CLAYER_TRIANGLES::m_layer_top_segment_ends, and CLAYER_TRIANGLES::m_layer_top_triangles.

353 {
354  m_zBot = aZBot;
355  m_zTop = aZTop;
356 
362 
363  if( aTextureIndexForSegEnds )
364  {
365  wxASSERT( glIsTexture( aTextureIndexForSegEnds ) );
366 
367  if( glIsTexture( aTextureIndexForSegEnds ) )
368  {
371  true,
372  aTextureIndexForSegEnds );
373 
376  false,
377  aTextureIndexForSegEnds );
378  }
379  }
380 
382  true );
383 
385  false );
386 
387 
388  if( aLayerTriangles.m_layer_middle_contourns_quads->GetVertexSize() > 0 )
389  {
392  }
393 
394  m_draw_it_transparent = false;
395  m_haveTransformation = false;
397  m_zScaleTransformation = 0.0f;
398 }
GLuint generate_middle_triangles(const CLAYER_TRIANGLE_CONTAINER *aTriangleContainer) const
GLuint generate_top_or_bot_seg_ends(const CLAYER_TRIANGLE_CONTAINER *aTriangleContainer, bool aIsNormalUp, GLuint aTextureId) const
CLAYER_TRIANGLE_CONTAINER * m_layer_top_triangles
CLAYER_TRIANGLE_CONTAINER * m_layer_middle_contourns_quads
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_segment_ends
unsigned int GetVertexSize() const
GetVertexSize.
GLuint generate_top_or_bot_triangles(const CLAYER_TRIANGLE_CONTAINER *aTriangleContainer, bool aIsNormalUp) const
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_triangles
CLAYER_TRIANGLE_CONTAINER * m_layer_top_segment_ends
CLAYERS_OGL_DISP_LISTS::~CLAYERS_OGL_DISP_LISTS ( )

~CLAYERS_OGL_DISP_LISTS - Destroy this class while free the display lists from GPU mem

Definition at line 401 of file clayer_triangles.cpp.

402 {
403  if( glIsList( m_layer_top_segment_ends ) )
404  glDeleteLists( m_layer_top_segment_ends, 1 );
405 
406  if( glIsList( m_layer_top_triangles ) )
407  glDeleteLists( m_layer_top_triangles, 1 );
408 
409  if( glIsList( m_layer_middle_contourns_quads ) )
410  glDeleteLists( m_layer_middle_contourns_quads, 1 );
411 
412  if( glIsList( m_layer_bot_triangles ) )
413  glDeleteLists( m_layer_bot_triangles, 1 );
414 
415  if( glIsList( m_layer_bot_segment_ends ) )
416  glDeleteLists( m_layer_bot_segment_ends, 1 );
417 
423 }

Member Function Documentation

void CLAYERS_OGL_DISP_LISTS::ApplyScalePosition ( float  aZposition,
float  aZscale 
)

Definition at line 648 of file clayer_triangles.cpp.

Referenced by C3D_RENDER_OGL_LEGACY::Redraw(), and C3D_RENDER_OGL_LEGACY::render_solder_mask_layer().

650 {
651  wxASSERT( aZscale > FLT_EPSILON );
652 
653  m_zPositionTransformation = aZposition;
654  m_zScaleTransformation = aZscale;
655  m_haveTransformation = true;
656 }
void CLAYERS_OGL_DISP_LISTS::beginTransformation ( ) const
private

Definition at line 849 of file clayer_triangles.cpp.

850 {
852  {
853  glPushMatrix();
854  glTranslatef( 0.0f, 0.0f, m_zPositionTransformation );
855  glScalef( 1.0f, 1.0f, m_zScaleTransformation );
856  }
857 }
void CLAYERS_OGL_DISP_LISTS::ClearScalePosition ( )
inline

Definition at line 262 of file clayer_triangles.h.

void CLAYERS_OGL_DISP_LISTS::DrawAll ( bool  aDrawMiddle = true) const

DrawAll - This function calls all the display lists.

Definition at line 499 of file clayer_triangles.cpp.

Referenced by C3D_RENDER_OGL_LEGACY::Redraw().

500 {
502 
503  if( aDrawMiddle )
504  if( glIsList( m_layer_middle_contourns_quads ) )
505  glCallList( m_layer_middle_contourns_quads );
506 
507  if( glIsList( m_layer_top_triangles ) )
508  glCallList( m_layer_top_triangles );
509 
510  if( glIsList( m_layer_bot_triangles ) )
511  glCallList( m_layer_bot_triangles );
512 
513  if( glIsList( m_layer_top_segment_ends ) )
514  glCallList( m_layer_top_segment_ends );
515 
516  if( glIsList( m_layer_bot_segment_ends ) )
517  glCallList( m_layer_bot_segment_ends );
518 
520 }
void beginTransformation() const
void CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulled ( float  zCameraPos,
bool  aDrawMiddle = true 
) const

DrawAllCameraCulled - Draw all layers if they are visible by the camera.

i.e.: if camera position is above the layer. This only works because the board is centered and the planes are always perpendicular to the Z axis.

Parameters
zCameraPoscamera z position

Definition at line 523 of file clayer_triangles.cpp.

Referenced by C3D_RENDER_OGL_LEGACY::Redraw().

524 {
525  zCameraPos = m_haveTransformation?( (zCameraPos - m_zPositionTransformation ) /
526  m_zScaleTransformation ):zCameraPos;
527 
528  if( aDrawMiddle )
529  DrawMiddle();
530 
531  if( zCameraPos > m_zTop )
532  {
533  DrawTop();
534  }
535  else
536  {
537  if( zCameraPos < m_zBot )
538  {
539  DrawBot();
540  }
541  else
542  {
543  // If camera is in the middle dont draw it
544  }
545  }
546 }
void DrawMiddle() const
DrawMiddle - This function calls the display lists for the middle elements.
void DrawTop() const
DrawTop - This function calls the display lists for the top elements.
void DrawBot() const
DrawBot - This function calls the display lists for the botton elements.
void CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulledSubtractLayer ( const CLAYERS_OGL_DISP_LISTS aLayerToSubtractA,
const CLAYERS_OGL_DISP_LISTS aLayerToSubtractB,
bool  aDrawMiddle = true 
) const

Definition at line 549 of file clayer_triangles.cpp.

References DrawBot(), DrawMiddle(), and DrawTop().

Referenced by C3D_RENDER_OGL_LEGACY::Redraw(), and C3D_RENDER_OGL_LEGACY::render_solder_mask_layer().

553 {
554  if( aDrawMiddle )
555  DrawMiddle();
556 
557  glClearStencil( 0x00 );
558  glClear( GL_STENCIL_BUFFER_BIT );
559 
560  glEnable( GL_CULL_FACE );
561  glCullFace( GL_BACK );
562 
563  glDisable( GL_DEPTH_TEST );
564  glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE );
565  glDepthMask( GL_FALSE );
566  glEnable( GL_STENCIL_TEST );
567  glStencilFunc( GL_ALWAYS, 1, 0 );
568  glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
569 
570  if( aLayerToSubtractA )
571  aLayerToSubtractA->DrawBot();
572 
573  if( aLayerToSubtractB )
574  aLayerToSubtractB->DrawBot();
575 
576 
577  //if( !m_draw_it_transparent )
578  {
579  glEnable(GL_DEPTH_TEST);
580  glDepthMask(GL_TRUE);
581  }
582 
583  glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
584  glStencilFunc( GL_EQUAL, 0, 1 );
585  glStencilOp( GL_KEEP, GL_KEEP, GL_KEEP );
586  DrawBot();
587 
588  glDisable( GL_DEPTH_TEST );
589  glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE );
590  glDepthMask( GL_FALSE );
591  glEnable( GL_STENCIL_TEST );
592  glStencilFunc( GL_ALWAYS, 2, 0 );
593  glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
594 
595  if( aLayerToSubtractA )
596  aLayerToSubtractA->DrawTop();
597 
598  if( aLayerToSubtractB )
599  aLayerToSubtractB->DrawTop();
600 
601  //if( !m_draw_it_transparent )
602  {
603  glEnable(GL_DEPTH_TEST);
604  glDepthMask(GL_TRUE);
605  }
606 
607  glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
608  glStencilFunc( GL_NOTEQUAL, 2, 0x03 );
609  glStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
610  DrawTop();
611 
612 
613  glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );
614 
615  glCullFace( GL_FRONT );
616  glStencilFunc( GL_GEQUAL, 3, 0x03 );
617  glStencilOp( GL_KEEP, GL_KEEP, GL_KEEP );
618  glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
619 
620  if( aDrawMiddle )
621  {
622  if( aLayerToSubtractA )
623  aLayerToSubtractA->DrawMiddle();
624 
625  // It will not render the middle contours of the layer.
626  // It is used with vias and holes (copper vias and to subtract solder
627  // mask holes). But since in the vias, it will draw a cylinder
628  // and in soldermask it doesn't need to draw the contour.
629  // so it is not used the middle part of B
630 // if( aLayerToSubtractB )
631 // aLayerToSubtractB->DrawMiddle();
632  }
633 
634  glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
635 
636  glCullFace( GL_BACK );
637  glDisable( GL_STENCIL_TEST );
638 
639 /*
640  if( m_draw_it_transparent )
641  {
642  glEnable(GL_DEPTH_TEST);
643  glDepthMask(GL_TRUE);
644  }*/
645 }
void DrawMiddle() const
DrawMiddle - This function calls the display lists for the middle elements.
void DrawTop() const
DrawTop - This function calls the display lists for the top elements.
void DrawBot() const
DrawBot - This function calls the display lists for the botton elements.
void CLAYERS_OGL_DISP_LISTS::DrawBot ( ) const

DrawBot - This function calls the display lists for the botton elements.

Definition at line 474 of file clayer_triangles.cpp.

Referenced by DrawAllCameraCulledSubtractLayer().

475 {
477 
478  if( glIsList( m_layer_bot_triangles ) )
479  glCallList( m_layer_bot_triangles );
480 
481  if( glIsList( m_layer_bot_segment_ends ) )
482  glCallList( m_layer_bot_segment_ends );
483 
485 }
void beginTransformation() const
void CLAYERS_OGL_DISP_LISTS::DrawBotAndMiddle ( ) const

DrawBotAndMiddle - This function calls the display lists for the botton elements and middle contourns.

Definition at line 443 of file clayer_triangles.cpp.

444 {
446 
447  if( glIsList( m_layer_middle_contourns_quads ) )
448  glCallList( m_layer_middle_contourns_quads );
449 
450  if( glIsList( m_layer_bot_triangles ) )
451  glCallList( m_layer_bot_triangles );
452 
453  if( glIsList( m_layer_bot_segment_ends ) )
454  glCallList( m_layer_bot_segment_ends );
455 
457 }
void beginTransformation() const
void CLAYERS_OGL_DISP_LISTS::DrawMiddle ( ) const

DrawMiddle - This function calls the display lists for the middle elements.

Definition at line 488 of file clayer_triangles.cpp.

Referenced by DrawAllCameraCulledSubtractLayer().

489 {
491 
492  if( glIsList( m_layer_middle_contourns_quads ) )
493  glCallList( m_layer_middle_contourns_quads );
494 
496 }
void beginTransformation() const
void CLAYERS_OGL_DISP_LISTS::DrawTop ( ) const

DrawTop - This function calls the display lists for the top elements.

Definition at line 460 of file clayer_triangles.cpp.

Referenced by DrawAllCameraCulledSubtractLayer().

461 {
463 
464  if( glIsList( m_layer_top_triangles ) )
465  glCallList( m_layer_top_triangles );
466 
467  if( glIsList( m_layer_top_segment_ends ) )
468  glCallList( m_layer_top_segment_ends );
469 
471 }
void beginTransformation() const
void CLAYERS_OGL_DISP_LISTS::DrawTopAndMiddle ( ) const

DrawTopAndMiddle - This function calls the display lists for the top elements and middle contourns.

Definition at line 426 of file clayer_triangles.cpp.

427 {
429 
430  if( glIsList( m_layer_middle_contourns_quads ) )
431  glCallList( m_layer_middle_contourns_quads );
432 
433  if( glIsList( m_layer_top_triangles ) )
434  glCallList( m_layer_top_triangles );
435 
436  if( glIsList( m_layer_top_segment_ends ) )
437  glCallList( m_layer_top_segment_ends );
438 
440 }
void beginTransformation() const
void CLAYERS_OGL_DISP_LISTS::endTransformation ( ) const
private

Definition at line 833 of file clayer_triangles.cpp.

834 {
836  {
837  glPopMatrix();
838  }
839 }
GLuint CLAYERS_OGL_DISP_LISTS::generate_middle_triangles ( const CLAYER_TRIANGLE_CONTAINER aTriangleContainer) const
private

Definition at line 782 of file clayer_triangles.cpp.

References CLAYER_TRIANGLE_CONTAINER::GetNormalsPointer(), CLAYER_TRIANGLE_CONTAINER::GetNormalsSize(), CLAYER_TRIANGLE_CONTAINER::GetVertexPointer(), and CLAYER_TRIANGLE_CONTAINER::GetVertexSize().

784 {
785  wxASSERT( aTriangleContainer != NULL );
786 
787  // We expect that it is a multiple of 3 vertex
788  wxASSERT( (aTriangleContainer->GetVertexSize() % 3) == 0 );
789 
790  // We expect that it is a multiple of 6 vertex (because we expect to add quads)
791  wxASSERT( (aTriangleContainer->GetVertexSize() % 6) == 0 );
792 
793  // We expect that there are normals with same size as vertex
794  wxASSERT( aTriangleContainer->GetNormalsSize() == aTriangleContainer->GetVertexSize() );
795 
796 
797  if( ( aTriangleContainer->GetVertexSize() > 0 ) &&
798  ( (aTriangleContainer->GetVertexSize() % 3) == 0 ) &&
799  ( (aTriangleContainer->GetVertexSize() % 6) == 0 ) &&
800  ( aTriangleContainer->GetNormalsSize() == aTriangleContainer->GetVertexSize() ) )
801  {
802  const GLuint listIdx = glGenLists( 1 );
803 
804  if( glIsList( listIdx ) )
805  {
806  glDisableClientState( GL_TEXTURE_COORD_ARRAY );
807  glDisableClientState( GL_COLOR_ARRAY );
808  glEnableClientState( GL_NORMAL_ARRAY );
809  glEnableClientState( GL_VERTEX_ARRAY );
810  glVertexPointer( 3, GL_FLOAT, 0, aTriangleContainer->GetVertexPointer() );
811  glNormalPointer( GL_FLOAT, 0, aTriangleContainer->GetNormalsPointer() );
812 
813  glNewList( listIdx, GL_COMPILE );
814 
816 
817  glDrawArrays( GL_TRIANGLES, 0, aTriangleContainer->GetVertexSize() );
818 
819  glDisable( GL_BLEND );
820  glEndList();
821 
822  glDisableClientState( GL_VERTEX_ARRAY );
823  glDisableClientState( GL_NORMAL_ARRAY );
824 
825  return listIdx;
826  }
827  }
828 
829  return 0;
830 }
const float * GetVertexPointer() const
GetVertexPointer - Get the array of vertexes.
const float * GetNormalsPointer() const
GetNormalsPointer - Get the array of normals.
unsigned int GetNormalsSize() const
GetNormalsSize.
unsigned int GetVertexSize() const
GetVertexSize.
GLuint CLAYERS_OGL_DISP_LISTS::generate_top_or_bot_seg_ends ( const CLAYER_TRIANGLE_CONTAINER aTriangleContainer,
bool  aIsNormalUp,
GLuint  aTextureId 
) const
private

Definition at line 665 of file clayer_triangles.cpp.

References CLAYER_TRIANGLE_CONTAINER::GetNormalsSize(), CLAYER_TRIANGLE_CONTAINER::GetVertexPointer(), CLAYER_TRIANGLE_CONTAINER::GetVertexSize(), and i.

669 {
670  wxASSERT( aTriangleContainer != NULL );
671 
672  wxASSERT( (aTriangleContainer->GetVertexSize() % 3) == 0 );
673 
674  // Top and Bot dont have normals array stored in container
675  wxASSERT( aTriangleContainer->GetNormalsSize() == 0 );
676 
677  if( (aTriangleContainer->GetVertexSize() > 0) &&
678  ((aTriangleContainer->GetVertexSize() % 3) == 0) )
679  {
680  GLuint listIdx = glGenLists( 1 );
681 
682  if( glIsList( listIdx ) )
683  {
684  // Prepare an array of UV text coordinates
685  SFVEC2F *uvArray = new SFVEC2F[aTriangleContainer->GetVertexSize()];
686 
687  for( unsigned int i = 0;
688  i < aTriangleContainer->GetVertexSize();
689  i += 3 )
690  {
691  uvArray[i + 0] = SFVEC2F( 1.0f, 0.0f );
692  uvArray[i + 1] = SFVEC2F( 0.0f, 1.0f );
693  uvArray[i + 2] = SFVEC2F( 0.0f, 0.0f );
694  }
695 
696  glEnableClientState( GL_TEXTURE_COORD_ARRAY );
697  glDisableClientState( GL_COLOR_ARRAY );
698  glDisableClientState( GL_NORMAL_ARRAY );
699  glEnableClientState( GL_VERTEX_ARRAY );
700  glVertexPointer( 3, GL_FLOAT, 0, aTriangleContainer->GetVertexPointer() );
701  glTexCoordPointer( 2, GL_FLOAT, 0, uvArray );
702 
703  glNewList( listIdx, GL_COMPILE );
704 
705  glDisable( GL_COLOR_MATERIAL );
706 
707  glEnable( GL_TEXTURE_2D );
708  glBindTexture( GL_TEXTURE_2D, aTextureId );
709 
711 
712  glAlphaFunc( GL_GREATER, 0.2f );
713  glEnable( GL_ALPHA_TEST );
714 
715  glNormal3f( 0.0f, 0.0f, aIsNormalUp?1.0f:-1.0f );
716 
717  glDrawArrays( GL_TRIANGLES, 0, aTriangleContainer->GetVertexSize() );
718 
719  glDisable( GL_TEXTURE_2D );
720  glDisable( GL_ALPHA_TEST );
721  glDisable( GL_BLEND );
722 
723  glEndList();
724 
725  glDisableClientState( GL_VERTEX_ARRAY );
726  glDisableClientState( GL_TEXTURE_COORD_ARRAY );
727 
728  delete [] uvArray;
729  return listIdx;
730  }
731  }
732 
733  return 0;
734 }
const float * GetVertexPointer() const
GetVertexPointer - Get the array of vertexes.
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
unsigned int GetNormalsSize() const
GetNormalsSize.
unsigned int GetVertexSize() const
GetVertexSize.
size_t i
Definition: json11.cpp:597
GLuint CLAYERS_OGL_DISP_LISTS::generate_top_or_bot_triangles ( const CLAYER_TRIANGLE_CONTAINER aTriangleContainer,
bool  aIsNormalUp 
) const
private

Definition at line 737 of file clayer_triangles.cpp.

References CLAYER_TRIANGLE_CONTAINER::GetNormalsSize(), CLAYER_TRIANGLE_CONTAINER::GetVertexPointer(), and CLAYER_TRIANGLE_CONTAINER::GetVertexSize().

740 {
741  wxASSERT( aTriangleContainer != NULL );
742 
743  wxASSERT( (aTriangleContainer->GetVertexSize() % 3) == 0 );
744 
745  // Top and Bot dont have normals array stored in container
746  wxASSERT( aTriangleContainer->GetNormalsSize() == 0 );
747 
748  if( (aTriangleContainer->GetVertexSize() > 0) &&
749  ( (aTriangleContainer->GetVertexSize() % 3) == 0) )
750  {
751  const GLuint listIdx = glGenLists( 1 );
752 
753  if( glIsList( listIdx ) )
754  {
755  glDisableClientState( GL_TEXTURE_COORD_ARRAY );
756  glDisableClientState( GL_COLOR_ARRAY );
757  glDisableClientState( GL_NORMAL_ARRAY );
758  glEnableClientState( GL_VERTEX_ARRAY );
759  glVertexPointer( 3, GL_FLOAT, 0, aTriangleContainer->GetVertexPointer() );
760 
761  glNewList( listIdx, GL_COMPILE );
762 
764 
765  glNormal3f( 0.0f, 0.0f, aIsNormalUp?1.0f:-1.0f );
766 
767  glDrawArrays( GL_TRIANGLES, 0, aTriangleContainer->GetVertexSize() );
768 
769  glDisable( GL_BLEND );
770  glEndList();
771 
772  glDisableClientState( GL_VERTEX_ARRAY );
773 
774  return listIdx;
775  }
776  }
777 
778  return 0;
779 }
const float * GetVertexPointer() const
GetVertexPointer - Get the array of vertexes.
unsigned int GetNormalsSize() const
GetNormalsSize.
unsigned int GetVertexSize() const
GetVertexSize.
float CLAYERS_OGL_DISP_LISTS::GetZBot ( ) const
inline

Definition at line 266 of file clayer_triangles.h.

Referenced by C3D_RENDER_OGL_LEGACY::Redraw().

266 { return m_zBot; }
float CLAYERS_OGL_DISP_LISTS::GetZTop ( ) const
inline

Definition at line 267 of file clayer_triangles.h.

Referenced by C3D_RENDER_OGL_LEGACY::Redraw().

267 { return m_zTop; }
void CLAYERS_OGL_DISP_LISTS::setBlendfunction ( ) const
private

Definition at line 842 of file clayer_triangles.cpp.

843 {
844  glEnable( GL_BLEND );
845  glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
846 }
void CLAYERS_OGL_DISP_LISTS::SetItIsTransparent ( bool  aSetTransparent)

Definition at line 659 of file clayer_triangles.cpp.

Referenced by C3D_RENDER_OGL_LEGACY::Redraw(), and C3D_RENDER_OGL_LEGACY::render_solder_mask_layer().

660 {
661  m_draw_it_transparent = aSetTransparent;
662 }

Member Data Documentation

bool CLAYERS_OGL_DISP_LISTS::m_draw_it_transparent
private

Definition at line 297 of file clayer_triangles.h.

bool CLAYERS_OGL_DISP_LISTS::m_haveTransformation
private

Definition at line 293 of file clayer_triangles.h.

GLuint CLAYERS_OGL_DISP_LISTS::m_layer_bot_segment_ends
private

Definition at line 291 of file clayer_triangles.h.

GLuint CLAYERS_OGL_DISP_LISTS::m_layer_bot_triangles
private

Definition at line 290 of file clayer_triangles.h.

GLuint CLAYERS_OGL_DISP_LISTS::m_layer_middle_contourns_quads
private

Definition at line 289 of file clayer_triangles.h.

GLuint CLAYERS_OGL_DISP_LISTS::m_layer_top_segment_ends
private

Definition at line 287 of file clayer_triangles.h.

GLuint CLAYERS_OGL_DISP_LISTS::m_layer_top_triangles
private

Definition at line 288 of file clayer_triangles.h.

float CLAYERS_OGL_DISP_LISTS::m_zBot
private

Definition at line 285 of file clayer_triangles.h.

float CLAYERS_OGL_DISP_LISTS::m_zPositionTransformation
private

Definition at line 294 of file clayer_triangles.h.

float CLAYERS_OGL_DISP_LISTS::m_zScaleTransformation
private

Definition at line 295 of file clayer_triangles.h.

float CLAYERS_OGL_DISP_LISTS::m_zTop
private

Definition at line 286 of file clayer_triangles.h.


The documentation for this class was generated from the following files: