KiCad PCB EDA Suite
|
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. | |
~OPENGL_RENDER_LIST () | |
Destroy this class while free the display lists from GPU memory. | |
void | DrawTopAndMiddle () const |
Call the display lists for the top elements and middle contours. | |
void | DrawBotAndMiddle () const |
Call the display lists for the bottom elements and middle contours. | |
void | DrawTop () const |
Call the display lists for the top elements. | |
void | DrawBot () const |
Call the display lists for the bottom elements. | |
void | DrawMiddle () const |
Call the display lists for the middle elements. | |
void | DrawAll (bool aDrawMiddle=true) const |
Call to draw all the display lists. | |
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. | |
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 |
Store the OpenGL display lists to related with a layer.
Definition at line 139 of file layer_triangles.h.
OPENGL_RENDER_LIST::OPENGL_RENDER_LIST | ( | const TRIANGLE_DISPLAY_LIST & | aLayerTriangles, |
GLuint | aTextureIndexForSegEnds, | ||
float | aZBot, | ||
float | aZTop | ||
) |
Create the display lists for a layer.
aLayerTriangles | contains the layers array of vertex to render to display lists. |
aTextureIndexForSegEnds | is the texture 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 303 of file layer_triangles.cpp.
References generate_middle_triangles(), generate_top_or_bot_seg_ends(), generate_top_or_bot_triangles(), TRIANGLE_LIST::GetVertexSize(), m_draw_it_transparent, m_haveTransformation, TRIANGLE_DISPLAY_LIST::m_layer_bot_segment_ends, m_layer_bot_segment_ends, TRIANGLE_DISPLAY_LIST::m_layer_bot_triangles, m_layer_bot_triangles, TRIANGLE_DISPLAY_LIST::m_layer_middle_contourns_quads, m_layer_middle_contourns_quads, TRIANGLE_DISPLAY_LIST::m_layer_top_segment_ends, m_layer_top_segment_ends, TRIANGLE_DISPLAY_LIST::m_layer_top_triangles, m_layer_top_triangles, m_zBot, m_zPositionTransformation, m_zScaleTransformation, and m_zTop.
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.
void OPENGL_RENDER_LIST::ApplyScalePosition | ( | float | aZposition, |
float | aZscale | ||
) |
Definition at line 562 of file layer_triangles.cpp.
References m_haveTransformation, m_zPositionTransformation, and m_zScaleTransformation.
Referenced by ApplyScalePosition(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_OPENGL::renderBoardBody(), and RENDER_3D_OPENGL::renderSolderMaskLayer().
void OPENGL_RENDER_LIST::ApplyScalePosition | ( | OPENGL_RENDER_LIST * | aOtherList | ) |
Definition at line 572 of file layer_triangles.cpp.
References ApplyScalePosition(), GetZBot(), and GetZTop().
|
private |
Definition at line 761 of file layer_triangles.cpp.
References m_haveTransformation, m_zPositionTransformation, and m_zScaleTransformation.
Referenced by DrawAll(), DrawBot(), DrawBotAndMiddle(), DrawMiddle(), DrawTop(), and DrawTopAndMiddle().
|
inline |
Definition at line 206 of file layer_triangles.h.
References m_haveTransformation.
void OPENGL_RENDER_LIST::DrawAll | ( | bool | aDrawMiddle = true | ) | const |
Call to draw all the display lists.
Definition at line 450 of file layer_triangles.cpp.
References beginTransformation(), endTransformation(), m_layer_bot_segment_ends, m_layer_bot_triangles, m_layer_middle_contourns_quads, m_layer_top_segment_ends, and m_layer_top_triangles.
Referenced by RENDER_3D_OPENGL::Redraw(), and RENDER_3D_OPENGL::renderBoardBody().
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().
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.
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.
zCameraPos | is 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().
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().
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().
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.
|
private |
Definition at line 745 of file layer_triangles.cpp.
References m_haveTransformation.
Referenced by DrawAll(), DrawBot(), DrawBotAndMiddle(), DrawMiddle(), DrawTop(), and DrawTopAndMiddle().
|
private |
Definition at line 695 of file layer_triangles.cpp.
References TRIANGLE_LIST::GetNormalsPointer(), TRIANGLE_LIST::GetNormalsSize(), TRIANGLE_LIST::GetVertexPointer(), TRIANGLE_LIST::GetVertexSize(), and setBlendfunction().
Referenced by OPENGL_RENDER_LIST().
|
private |
Definition at line 584 of file layer_triangles.cpp.
References TRIANGLE_LIST::GetNormalsSize(), TRIANGLE_LIST::GetVertexPointer(), and TRIANGLE_LIST::GetVertexSize().
Referenced by OPENGL_RENDER_LIST().
|
private |
Definition at line 651 of file layer_triangles.cpp.
References TRIANGLE_LIST::GetNormalsSize(), TRIANGLE_LIST::GetVertexPointer(), TRIANGLE_LIST::GetVertexSize(), and setBlendfunction().
Referenced by OPENGL_RENDER_LIST().
|
inline |
Definition at line 210 of file layer_triangles.h.
References m_zBot.
Referenced by ApplyScalePosition().
|
inline |
Definition at line 211 of file layer_triangles.h.
References m_zTop.
Referenced by ApplyScalePosition().
|
private |
Definition at line 754 of file layer_triangles.cpp.
Referenced by generate_middle_triangles(), and generate_top_or_bot_triangles().
void OPENGL_RENDER_LIST::SetItIsTransparent | ( | bool | aSetTransparent | ) |
Definition at line 578 of file layer_triangles.cpp.
References m_draw_it_transparent.
Referenced by RENDER_3D_OPENGL::reload(), RENDER_3D_OPENGL::renderBoardBody(), and RENDER_3D_OPENGL::renderSolderMaskLayer().
|
private |
Definition at line 240 of file layer_triangles.h.
Referenced by OPENGL_RENDER_LIST(), and SetItIsTransparent().
|
private |
Definition at line 236 of file layer_triangles.h.
Referenced by ApplyScalePosition(), beginTransformation(), ClearScalePosition(), endTransformation(), and OPENGL_RENDER_LIST().
|
private |
Definition at line 234 of file layer_triangles.h.
Referenced by DrawAll(), DrawBot(), DrawBotAndMiddle(), OPENGL_RENDER_LIST(), and ~OPENGL_RENDER_LIST().
|
private |
Definition at line 233 of file layer_triangles.h.
Referenced by DrawAll(), DrawBot(), DrawBotAndMiddle(), OPENGL_RENDER_LIST(), and ~OPENGL_RENDER_LIST().
|
private |
Definition at line 232 of file layer_triangles.h.
Referenced by DrawAll(), DrawBotAndMiddle(), DrawMiddle(), DrawTopAndMiddle(), OPENGL_RENDER_LIST(), and ~OPENGL_RENDER_LIST().
|
private |
Definition at line 230 of file layer_triangles.h.
Referenced by DrawAll(), DrawTop(), DrawTopAndMiddle(), OPENGL_RENDER_LIST(), and ~OPENGL_RENDER_LIST().
|
private |
Definition at line 231 of file layer_triangles.h.
Referenced by DrawAll(), DrawTop(), DrawTopAndMiddle(), OPENGL_RENDER_LIST(), and ~OPENGL_RENDER_LIST().
|
private |
Definition at line 228 of file layer_triangles.h.
Referenced by GetZBot(), and OPENGL_RENDER_LIST().
|
private |
Definition at line 237 of file layer_triangles.h.
Referenced by ApplyScalePosition(), beginTransformation(), and OPENGL_RENDER_LIST().
|
private |
Definition at line 238 of file layer_triangles.h.
Referenced by ApplyScalePosition(), beginTransformation(), and OPENGL_RENDER_LIST().
|
private |
Definition at line 229 of file layer_triangles.h.
Referenced by GetZTop(), and OPENGL_RENDER_LIST().