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"
47#define SIZE_OF_CIRCLE_TEXTURE 1024
90 float aZtop,
float aZbot );
93 float aZtop,
float aZbot );
96 float aZtop,
float aZbot );
99 float aZtop,
float aZbot );
102 float aZtop,
float aZbot );
105 bool aSkipRenderHoles );
112 unsigned int aNr_sides_per_circle,
113 std::vector< SFVEC2F >& aInnerContourResult,
114 std::vector< SFVEC2F >& aOuterContourResult,
bool aInvertOrder );
117 float aZtop,
float aZbot,
unsigned int aNr_sides_per_circle,
156 void renderModel(
const glm::mat4 &aCameraViewMatrix,
const MODELTORENDER &aModelToRender,
160 void get3dModelsSelected( std::list<MODELTORENDER> &aDstRenderList,
bool aGetTop,
bool aGetBot,
161 bool aRenderTransparentOnly,
bool aRenderSelectedOnly );
164 const FOOTPRINT* aFootprint,
bool aRenderTransparentOnly,
defines the basic data associated with a single 3D model.
Helper class to handle information needed to display 3D board.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
A class used to derive camera objects from.
Implement a canvas based on a wxGLCanvas.
Store the OpenGL display lists to related with a layer.
Simple non-intersecting polygon with 4 points.
This is a base class to hold data and functions for render targets.
Object to render the board using openGL.
OPENGL_RENDER_LIST * m_board
OPENGL_RENDER_LIST * m_vias
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)
void generateCylinder(const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, float aZtop, float aZbot, unsigned int aNr_sides_per_circle, TRIANGLE_DISPLAY_LIST *aDstLayer)
OPENGL_RENDER_LIST * m_outerThroughHoleRings
OPENGL_RENDER_LIST * m_offboardPadsFront
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)
SHAPE_POLY_SET m_antiBoardPolys
The negative polygon representation of the board outline.
void load3dModels(REPORTER *aStatusReporter)
Load footprint models from the cache and load it to openGL lists in the form of MODEL_3D objects.
void generateViasAndPads()
GRID3D_TYPE m_lastGridType
Stores the last grid type.
OPENGL_RENDER_LIST * generateLayerList(const BVH_CONTAINER_2D *aContainer, const SHAPE_POLY_SET *aPolyList, PCB_LAYER_ID aLayer, const BVH_CONTAINER_2D *aThroughHoles=nullptr)
void renderOpaqueModels(const glm::mat4 &aCameraViewMatrix)
OPENGL_RENDER_LIST * createBoard(const SHAPE_POLY_SET &aBoardPoly, const BVH_CONTAINER_2D *aThroughHoles=nullptr)
void Load3dModelsIfNeeded()
Load footprint models if they are not already loaded, i.e.
void generate3dGrid(GRID3D_TYPE aGridType)
Create a 3D grid to an OpenGL display list.
void setLightFront(bool enabled)
void addObjectTriangles(const RING_2D *aRing, TRIANGLE_DISPLAY_LIST *aDstLayer, float aZtop, float aZbot)
bool Redraw(bool aIsMoving, REPORTER *aStatusReporter, REPORTER *aWarningReporter) override
Redraw the view.
MAP_OGL_DISP_LISTS m_layers
MAP_OGL_DISP_LISTS m_innerLayerHoles
OPENGL_RENDER_LIST * m_boardWithHoles
MAP_OGL_DISP_LISTS m_outerLayerHoles
OPENGL_RENDER_LIST * m_offboardPadsBack
BOARD_ITEM * m_currentRollOverItem
void renderBoardBody(bool aSkipRenderHoles)
std::map< std::vector< float >, glm::mat4 > m_3dModelMatrixMap
std::map< wxString, MODEL_3D * > m_3dModelMap
void SetCurrentRollOverItem(BOARD_ITEM *aRollOverItem)
OPENGL_RENDER_LIST * generateEmptyLayerList(PCB_LAYER_ID aLayer)
LIST_TRIANGLES m_triangles
store pointers so can be deleted latter
OPENGL_RENDER_LIST * m_outerViaThroughHoles
OPENGL_RENDER_LIST * m_outerThroughHoles
void setLayerMaterial(PCB_LAYER_ID aLayerID)
OPENGL_RENDER_LIST * m_platedPadsFront
void renderModel(const glm::mat4 &aCameraViewMatrix, const MODELTORENDER &aModelToRender, const SFVEC3F &aSelColor, const SFVEC3F *aCameraWorldPos)
int GetWaitForEditingTimeOut() override
Give the interface the time (in ms) that it should wait for editing or movements before (this works f...
SMATERIAL m_NonPlatedCopper
void renderSolderMaskLayer(PCB_LAYER_ID aLayerID, float aZPos, bool aShowThickness, bool aSkipRenderHoles)
void renderTransparentModels(const glm::mat4 &aCameraViewMatrix)
void get3dModelsSelected(std::list< MODELTORENDER > &aDstRenderList, bool aGetTop, bool aGetBot, bool aRenderTransparentOnly, bool aRenderSelectedOnly)
void setPlatedCopperAndDepthOffset(PCB_LAYER_ID aLayer_id)
OPENGL_RENDER_LIST * m_antiBoard
void getLayerZPos(PCB_LAYER_ID aLayerID, float &aOutZtop, float &aOutZbot) const
void SetCurWindowSize(const wxSize &aSize) override
Before each render, the canvas will tell the render what is the size of its windows,...
OPENGL_RENDER_LIST * m_padHoles
void addTopAndBottomTriangles(TRIANGLE_DISPLAY_LIST *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)
GLuint m_grid
oGL list that stores current grid
OPENGL_RENDER_LIST * m_platedPadsBack
void get3dModelsFromFootprint(std::list< MODELTORENDER > &aDstRenderList, const FOOTPRINT *aFootprint, bool aRenderTransparentOnly, bool aIsSelected)
struct RENDER_3D_OPENGL::@2 m_materials
void setLightBottom(bool enabled)
void setLightTop(bool enabled)
A pure virtual class used to derive REPORTER objects from.
Represent a set of closed polygons.
Store arrays of triangles to be used to create display lists.
std::list< OBJECT_2D * > LIST_OBJECT2D
PCB_LAYER_ID
A quick note on layer IDs:
std::list< TRIANGLE_DISPLAY_LIST * > LIST_TRIANGLES
std::map< PCB_LAYER_ID, OPENGL_RENDER_LIST * > MAP_OGL_DISP_LISTS
MODELTORENDER(glm::mat4 aModelWorldMat, const MODEL_3D *aNodel, float aOpacity, bool aIsTransparent, bool aIsSelected)
glm::mat4 m_modelWorldMat