25 #ifndef RENDER_3D_OPENGL_H 26 #define RENDER_3D_OPENGL_H 28 #include "../render_3d_base.h" 31 #include "../raytracing/shapes2D/polygon_2d.h" 32 #include "../raytracing/shapes2D/triangle_2d.h" 33 #include "../raytracing/shapes2D/4pt_polygon_2d.h" 34 #include "../raytracing/shapes2D/filled_circle_2d.h" 35 #include "../raytracing/shapes2D/ring_2d.h" 36 #include "../raytracing/shapes2D/round_segment_2d.h" 49 #define SIZE_OF_CIRCLE_TEXTURE 1024 79 float aZbot,
bool aInvertFaces,
93 float aZtop,
float aZbot );
96 float aZtop,
float aZbot );
102 float aZtop,
float aZbot );
108 bool aDrawMiddleSegments,
bool aSkipRenderHoles );
115 unsigned int aNr_sides_per_circle,
116 std::vector< SFVEC2F >& aInnerContourResult,
117 std::vector< SFVEC2F >& aOuterContourResult,
bool aInvertOrder );
120 float aZtop,
float aZbot,
unsigned int aNr_sides_per_circle,
139 void render3dModels(
bool aRenderTopOrBot,
bool aRenderTransparentOnly );
142 bool aRenderSelectedOnly );
221 #endif // RENDER_3D_OPENGL_H OPENGL_RENDER_LIST * m_platedPadsBack
OPENGL_RENDER_LIST * m_antiBoard
void setLightFront(bool enabled)
VECTOR2I v2(1, 0)
Test suite for KiCad math code.
Object to render the board using openGL.
OPENGL_RENDER_LIST * m_board
void addTopAndBottomTriangles(TRIANGLE_DISPLAY_LIST *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)
void Load3dModelsIfNeeded()
Load footprint models if they are not already loaded, i.e.
void load3dModels(REPORTER *aStatusReporter)
Load footprint models from the cache and load it to openGL lists in the form of MODEL_3D objects.
Store arrays of triangles to be used to create display lists.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
OPENGL_RENDER_LIST * m_outerViaThroughHoles
OPENGL_RENDER_LIST * m_boardWithHoles
std::map< wxString, MODEL_3D * > MAP_3DMODEL
LIST_TRIANGLES m_triangles
store pointers so can be deleted latter
void generateViasAndPads()
MAP_OGL_DISP_LISTS m_innerLayerHoles
OPENGL_RENDER_LIST * generateEmptyLayerList(PCB_LAYER_ID aLayerId)
void getLayerZPos(PCB_LAYER_ID aLayerID, float &aOutZtop, float &aOutZbot) const
Implement a canvas based on a wxGLCanvas.
MAP_OGL_DISP_LISTS m_layers
BOARD_ITEM * m_currentRollOverItem
OPENGL_RENDER_LIST * m_outerThroughHoles
std::list< TRIANGLE_DISPLAY_LIST * > LIST_TRIANGLES
A pure virtual class used to derive REPORTER objects from.
defines the basic data associated with a single 3D model.
SHAPE_POLY_SET m_antiBoardPolys
The negative polygon representation of the board outline.
struct RENDER_3D_OPENGL::@2 m_materials
A class used to derive camera objects from.
OPENGL_RENDER_LIST * m_vias
void reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
void setLightBottom(bool enabled)
void generateRing(const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, unsigned int aNr_sides_per_circle, std::vector< SFVEC2F > &aInnerContourResult, std::vector< SFVEC2F > &aOuterContourResult, bool aInvertOrder)
Represent a set of closed polygons.
MAP_OGL_DISP_LISTS m_outerLayerHoles
GLuint m_grid
oGL list that stores current grid
OPENGL_RENDER_LIST * m_outerThroughHoleRings
SMATERIAL m_NonPlatedCopper
void setPlatedCopperAndDepthOffset(PCB_LAYER_ID aLayer_id)
OPENGL_RENDER_LIST * createBoard(const SHAPE_POLY_SET &aBoardPoly, const BVH_CONTAINER_2D *aThroughHoles=nullptr)
void renderFootprint(const FOOTPRINT *aFootprint, bool aRenderTransparentOnly, bool aIsSelected)
void setLightTop(bool enabled)
OPENGL_RENDER_LIST * m_padHoles
This is a base class to hold data and functions for render targets.
OPENGL_RENDER_LIST * m_platedPadsFront
void SetCurWindowSize(const wxSize &aSize) override
Before each render, the canvas will tell the render what is the size of its windows,...
Store the OpenGL display lists to related with a layer.
Simple non-intersecting polygon with 4 points.
void addObjectTriangles(const RING_2D *aRing, TRIANGLE_DISPLAY_LIST *aDstLayer, float aZtop, float aZbot)
void generate3dGrid(GRID3D_TYPE aGridType)
Create a 3D grid to an OpenGL display list.
void renderBoardBody(bool aSkipRenderHoles)
void generateCylinder(const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, float aZtop, float aZbot, unsigned int aNr_sides_per_circle, TRIANGLE_DISPLAY_LIST *aDstLayer)
void setLayerMaterial(PCB_LAYER_ID aLayerID)
GRID3D_TYPE m_lastGridType
Stores the last grid type.
PCB_LAYER_ID
A quick note on layer IDs:
RENDER_3D_OPENGL(EDA_3D_CANVAS *aCanvas, BOARD_ADAPTER &aAdapter, CAMERA &aCamera)
void SetCurrentRollOverItem(BOARD_ITEM *aRollOverItem)
std::list< OBJECT_2D * > LIST_OBJECT2D
OPENGL_RENDER_LIST * generateHoles(const LIST_OBJECT2D &aListHolesObject2d, const SHAPE_POLY_SET &aPoly, float aZtop, float aZbot, bool aInvertFaces, const BVH_CONTAINER_2D *aThroughHoles=nullptr)
std::map< PCB_LAYER_ID, OPENGL_RENDER_LIST * > MAP_OGL_DISP_LISTS
void render3dModels(bool aRenderTopOrBot, bool aRenderTransparentOnly)
Helper class to handle information needed to display 3D board.
bool Redraw(bool aIsMoving, REPORTER *aStatusReporter, REPORTER *aWarningReporter) override
Redraw the view.
void render3dModelsSelected(bool aRenderTopOrBot, bool aRenderTransparentOnly, bool aRenderSelectedOnly)
OPENGL_RENDER_LIST * generateLayerList(const BVH_CONTAINER_2D *aContainer, const SHAPE_POLY_SET *aPolyList, PCB_LAYER_ID aLayerId, const BVH_CONTAINER_2D *aThroughHoles=nullptr)
int GetWaitForEditingTimeOut() override
Give the interface the time (in ms) that it should wait for editing or movements before (this works f...
void renderSolderMaskLayer(PCB_LAYER_ID aLayerID, float aZPosition, bool aDrawMiddleSegments, bool aSkipRenderHoles)
SFVEC4F getLayerColor(PCB_LAYER_ID aLayerID)