KiCad PCB EDA Suite
Loading...
Searching...
No Matches
OPENGL_RENDER_LIST Class Reference

Store the OpenGL display lists to related with a layer. More...

#include <layer_triangles.h>

Public Member Functions

 OPENGL_RENDER_LIST (const TRIANGLE_DISPLAY_LIST &aLayerTriangles, GLuint aTextureIndexForSegEnds, float aZBot, float aZTop)
 Create the display lists for a layer. More...
 
 ~OPENGL_RENDER_LIST ()
 Destroy this class while free the display lists from GPU memory. More...
 
void DrawTopAndMiddle () const
 Call the display lists for the top elements and middle contours. More...
 
void DrawBotAndMiddle () const
 Call the display lists for the bottom elements and middle contours. More...
 
void DrawTop () const
 Call the display lists for the top elements. More...
 
void DrawBot () const
 Call the display lists for the bottom elements. More...
 
void DrawMiddle () const
 Call the display lists for the middle elements. More...
 
void DrawAll (bool aDrawMiddle=true) const
 Call to draw all the display lists. More...
 
void DrawCulled (bool aDrawMiddle, const OPENGL_RENDER_LIST *aSubtractList=nullptr, const OPENGL_RENDER_LIST *bSubtractList=nullptr, const OPENGL_RENDER_LIST *cSubtractList=nullptr, const OPENGL_RENDER_LIST *dSubtractList=nullptr) const
 Draw all layers if they are visible by the camera if camera position is above the layer. More...
 
void ApplyScalePosition (float aZposition, float aZscale)
 
void ApplyScalePosition (OPENGL_RENDER_LIST *aOtherList)
 
void ClearScalePosition ()
 
void SetItIsTransparent (bool aSetTransparent)
 
float GetZBot () const
 
float GetZTop () const
 

Private Member Functions

GLuint generate_top_or_bot_seg_ends (const TRIANGLE_LIST *aTriangleContainer, bool aIsNormalUp, GLuint aTextureId) const
 
GLuint generate_top_or_bot_triangles (const TRIANGLE_LIST *aTriangleContainer, bool aIsNormalUp) const
 
GLuint generate_middle_triangles (const TRIANGLE_LIST *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

Store the OpenGL display lists to related with a layer.

Definition at line 139 of file layer_triangles.h.

Constructor & Destructor Documentation

◆ OPENGL_RENDER_LIST()

OPENGL_RENDER_LIST::OPENGL_RENDER_LIST ( const TRIANGLE_DISPLAY_LIST aLayerTriangles,
GLuint  aTextureIndexForSegEnds,
float  aZBot,
float  aZTop 
)

◆ ~OPENGL_RENDER_LIST()

OPENGL_RENDER_LIST::~OPENGL_RENDER_LIST ( )

Destroy this class while free the display lists from GPU memory.

Definition at line 352 of file layer_triangles.cpp.

References m_layer_bot_segment_ends, m_layer_bot_triangles, m_layer_middle_contourns_quads, m_layer_top_segment_ends, and m_layer_top_triangles.

Member Function Documentation

◆ ApplyScalePosition() [1/2]

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

◆ ApplyScalePosition() [2/2]

void OPENGL_RENDER_LIST::ApplyScalePosition ( OPENGL_RENDER_LIST aOtherList)

Definition at line 572 of file layer_triangles.cpp.

References ApplyScalePosition(), GetZBot(), and GetZTop().

◆ beginTransformation()

void OPENGL_RENDER_LIST::beginTransformation ( ) const
private

◆ ClearScalePosition()

void OPENGL_RENDER_LIST::ClearScalePosition ( )
inline

Definition at line 206 of file layer_triangles.h.

References m_haveTransformation.

◆ DrawAll()

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

◆ DrawBot()

void OPENGL_RENDER_LIST::DrawBot ( ) const

Call the display lists for the bottom elements.

Definition at line 425 of file layer_triangles.cpp.

References beginTransformation(), endTransformation(), m_layer_bot_segment_ends, and m_layer_bot_triangles.

Referenced by DrawCulled().

◆ DrawBotAndMiddle()

void OPENGL_RENDER_LIST::DrawBotAndMiddle ( ) const

Call the display lists for the bottom elements and middle contours.

Definition at line 394 of file layer_triangles.cpp.

References beginTransformation(), endTransformation(), m_layer_bot_segment_ends, m_layer_bot_triangles, and m_layer_middle_contourns_quads.

◆ DrawCulled()

void OPENGL_RENDER_LIST::DrawCulled ( bool  aDrawMiddle,
const OPENGL_RENDER_LIST aSubtractList = nullptr,
const OPENGL_RENDER_LIST bSubtractList = nullptr,
const OPENGL_RENDER_LIST cSubtractList = nullptr,
const OPENGL_RENDER_LIST dSubtractList = nullptr 
) const

Draw all layers if they are visible by the camera 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
zCameraPosis the camera z axis position.

Definition at line 474 of file layer_triangles.cpp.

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

Referenced by RENDER_3D_OPENGL::Redraw(), and RENDER_3D_OPENGL::renderSolderMaskLayer().

◆ DrawMiddle()

void OPENGL_RENDER_LIST::DrawMiddle ( ) const

Call the display lists for the middle elements.

Definition at line 439 of file layer_triangles.cpp.

References beginTransformation(), endTransformation(), and m_layer_middle_contourns_quads.

Referenced by DrawCulled().

◆ DrawTop()

void OPENGL_RENDER_LIST::DrawTop ( ) const

Call the display lists for the top elements.

Definition at line 411 of file layer_triangles.cpp.

References beginTransformation(), endTransformation(), m_layer_top_segment_ends, and m_layer_top_triangles.

Referenced by DrawCulled().

◆ DrawTopAndMiddle()

void OPENGL_RENDER_LIST::DrawTopAndMiddle ( ) const

Call the display lists for the top elements and middle contours.

Definition at line 377 of file layer_triangles.cpp.

References beginTransformation(), endTransformation(), m_layer_middle_contourns_quads, m_layer_top_segment_ends, and m_layer_top_triangles.

◆ endTransformation()

void OPENGL_RENDER_LIST::endTransformation ( ) const
private

◆ generate_middle_triangles()

GLuint OPENGL_RENDER_LIST::generate_middle_triangles ( const TRIANGLE_LIST aTriangleContainer) const
private

◆ generate_top_or_bot_seg_ends()

GLuint OPENGL_RENDER_LIST::generate_top_or_bot_seg_ends ( const TRIANGLE_LIST aTriangleContainer,
bool  aIsNormalUp,
GLuint  aTextureId 
) const
private

◆ generate_top_or_bot_triangles()

GLuint OPENGL_RENDER_LIST::generate_top_or_bot_triangles ( const TRIANGLE_LIST aTriangleContainer,
bool  aIsNormalUp 
) const
private

◆ GetZBot()

float OPENGL_RENDER_LIST::GetZBot ( ) const
inline

Definition at line 210 of file layer_triangles.h.

References m_zBot.

Referenced by ApplyScalePosition().

◆ GetZTop()

float OPENGL_RENDER_LIST::GetZTop ( ) const
inline

Definition at line 211 of file layer_triangles.h.

References m_zTop.

Referenced by ApplyScalePosition().

◆ setBlendfunction()

void OPENGL_RENDER_LIST::setBlendfunction ( ) const
private

◆ SetItIsTransparent()

void OPENGL_RENDER_LIST::SetItIsTransparent ( bool  aSetTransparent)

Member Data Documentation

◆ m_draw_it_transparent

bool OPENGL_RENDER_LIST::m_draw_it_transparent
private

Definition at line 240 of file layer_triangles.h.

Referenced by OPENGL_RENDER_LIST(), and SetItIsTransparent().

◆ m_haveTransformation

bool OPENGL_RENDER_LIST::m_haveTransformation
private

◆ m_layer_bot_segment_ends

GLuint OPENGL_RENDER_LIST::m_layer_bot_segment_ends
private

◆ m_layer_bot_triangles

GLuint OPENGL_RENDER_LIST::m_layer_bot_triangles
private

◆ m_layer_middle_contourns_quads

GLuint OPENGL_RENDER_LIST::m_layer_middle_contourns_quads
private

◆ m_layer_top_segment_ends

GLuint OPENGL_RENDER_LIST::m_layer_top_segment_ends
private

◆ m_layer_top_triangles

GLuint OPENGL_RENDER_LIST::m_layer_top_triangles
private

◆ m_zBot

float OPENGL_RENDER_LIST::m_zBot
private

Definition at line 228 of file layer_triangles.h.

Referenced by GetZBot(), and OPENGL_RENDER_LIST().

◆ m_zPositionTransformation

float OPENGL_RENDER_LIST::m_zPositionTransformation
private

Definition at line 237 of file layer_triangles.h.

Referenced by ApplyScalePosition(), beginTransformation(), and OPENGL_RENDER_LIST().

◆ m_zScaleTransformation

float OPENGL_RENDER_LIST::m_zScaleTransformation
private

Definition at line 238 of file layer_triangles.h.

Referenced by ApplyScalePosition(), beginTransformation(), and OPENGL_RENDER_LIST().

◆ m_zTop

float OPENGL_RENDER_LIST::m_zTop
private

Definition at line 229 of file layer_triangles.h.

Referenced by GetZTop(), and OPENGL_RENDER_LIST().


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