37#include <glm/geometric.hpp>
50#define UNITS3D_TO_UNITSPCB ( pcbIUScale.IU_PER_MM )
56 wxLogTrace(
m_logTrace, wxT(
"RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) );
93 wxLogTrace(
m_logTrace, wxT(
"RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) );
114 int fbWidth, fbHeight;
115 glGetIntegerv( GL_VIEWPORT, viewport );
128 glEnable( GL_LIGHT0 );
130 glDisable( GL_LIGHT0 );
137 glEnable( GL_LIGHT1 );
139 glDisable( GL_LIGHT1 );
146 glEnable( GL_LIGHT2 );
148 glDisable( GL_LIGHT2 );
205 m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f;
214 m_materials.m_NonPlatedCopper.m_Shininess = 0.1f * 128.0f;
242 m_materials.m_SilkSTop.m_Shininess = 0.078125f * 128.0f;
255 m_materials.m_SilkSBot.m_Shininess = 0.078125f * 128.0f;
258 m_materials.m_SolderMask.m_Shininess = 0.8f * 128.0f;
268 m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f;
298 m_materials.m_SolderMask.m_Transparency = 1.0f - layerColor.a;
358 m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
381 m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
399 const GLfloat ambient[] = { 0.084f, 0.084f, 0.084f, 1.0f };
400 const GLfloat diffuse0[] = { 0.3f, 0.3f, 0.3f, 1.0f };
401 const GLfloat specular0[] = { 0.5f, 0.5f, 0.5f, 1.0f };
403 glLightfv( GL_LIGHT0, GL_AMBIENT, ambient );
404 glLightfv( GL_LIGHT0, GL_DIFFUSE, diffuse0 );
405 glLightfv( GL_LIGHT0, GL_SPECULAR, specular0 );
407 const GLfloat diffuse12[] = { 0.7f, 0.7f, 0.7f, 1.0f };
408 const GLfloat specular12[] = { 0.7f, 0.7f, 0.7f, 1.0f };
411 GLfloat position[4] = { 0.0f, 0.0f, 1.0f, 0.0f };
415 glm::pi<float>() * 0.25f );
417 position[0] = vectorLight.x;
418 position[1] = vectorLight.y;
419 position[2] = vectorLight.z;
421 glLightfv( GL_LIGHT1, GL_AMBIENT, ambient );
422 glLightfv( GL_LIGHT1, GL_DIFFUSE, diffuse12 );
423 glLightfv( GL_LIGHT1, GL_SPECULAR, specular12 );
424 glLightfv( GL_LIGHT1, GL_POSITION, position );
427 position[2] = -position[2];
429 glLightfv( GL_LIGHT2, GL_AMBIENT, ambient );
430 glLightfv( GL_LIGHT2, GL_DIFFUSE, diffuse12 );
431 glLightfv( GL_LIGHT2, GL_SPECULAR, specular12 );
432 glLightfv( GL_LIGHT2, GL_POSITION, position );
434 const GLfloat lmodel_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
436 glLightModelfv( GL_LIGHT_MODEL_AMBIENT, lmodel_ambient );
438 glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
450 glEnable( GL_POLYGON_OFFSET_FILL );
451 glPolygonOffset( -0.1f, -2.0f );
458 glDisable( GL_POLYGON_OFFSET_FILL );
473 if( aSkipRenderHoles )
501 return SFVEC4F( aInput.r * aInput.a, aInput.g * aInput.a, aInput.b * aInput.a, aInput.a );
521 if( aStatusReporter )
522 aStatusReporter->
Report(
_(
"Loading..." ) );
529 reload( aStatusReporter, aWarningReporter );
550 glDepthFunc( GL_LESS );
551 glEnable( GL_CULL_FACE );
552 glFrontFace( GL_CCW );
553 glEnable( GL_NORMALIZE );
557 glDisable( GL_MULTISAMPLE );
559 glEnable( GL_MULTISAMPLE );
562 glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
563 glClearDepth( 1.0f );
564 glClearStencil( 0x00 );
565 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
573 glEnable( GL_DEPTH_TEST );
576 glMatrixMode( GL_PROJECTION );
577 glLoadMatrixf( glm::value_ptr(
m_camera.GetProjectionMatrix() ) );
578 glMatrixMode( GL_MODELVIEW );
580 glLoadMatrixf( glm::value_ptr(
m_camera.GetViewMatrix() ) );
587 glEnable( GL_LIGHTING );
596 if( cameraPos.z > 0.0f )
597 zpos = glm::max( cameraPos.z, 0.5f ) + cameraPos.z * cameraPos.z;
599 zpos = glm::min( cameraPos.z,-0.5f ) - cameraPos.z * cameraPos.z;
602 const GLfloat headlight_pos[] = { cameraPos.x, cameraPos.y, zpos, 1.0f };
604 glLightfv( GL_LIGHT0, GL_POSITION, headlight_pos );
610 bool showThickness = !skipThickness;
612 std::bitset<LAYER_3D_END> layerFlags =
m_boardAdapter.GetVisibleLayers();
623 for( MAP_OGL_DISP_LISTS::const_iterator ii =
m_layers.begin(); ii !=
m_layers.end(); ++ii )
637 const double opacity_min = 0.8;
662 if( !skipRenderHoles )
708 if( !skipRenderHoles )
717 anti_board =
nullptr;
724 if( throughHolesOuter )
733 pLayerDispList->
DrawCulled( showThickness, solder_mask, throughHolesOuter, anti_board );
739 glm::mat4 cameraViewMatrix;
741 glGetFloatv( GL_MODELVIEW_MATRIX, glm::value_ptr( cameraViewMatrix ) );
756 glEnable( GL_POLYGON_OFFSET_FILL );
757 glPolygonOffset( 0.0f, -2.0f );
764 showThickness, skipRenderHoles );
770 showThickness, skipRenderHoles );
778 showThickness, skipRenderHoles );
784 showThickness, skipRenderHoles );
788 glDisable( GL_POLYGON_OFFSET_FILL );
789 glPolygonOffset( 0.0f, 0.0f );
795 glDepthMask( GL_FALSE );
796 glEnable( GL_BLEND );
797 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
800 glEnable( GL_TEXTURE_2D );
801 glActiveTexture( GL_TEXTURE0 );
806 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
807 glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE );
808 glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE );
810 glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PRIMARY_COLOR );
811 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
813 glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS );
814 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
816 glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR );
817 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
818 glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_CONSTANT );
819 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA );
823 glDisable( GL_BLEND );
826 glDepthMask( GL_TRUE );
831 glDisable( GL_LIGHTING );
836 glEnable( GL_LIGHTING );
853 glEnable( GL_LINE_SMOOTH );
854 glShadeModel( GL_SMOOTH );
857 glPixelStorei( GL_UNPACK_ALIGNMENT, 4 );
878 delete circleImageBlured;
879 circleImageBlured =
nullptr;
882 circleImage =
nullptr;
896 glEnable( GL_COLOR_MATERIAL );
897 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
904 glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r );
905 glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 96.0f );
907 glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.r );
908 glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.r );
909 glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.r );
915#define DELETE_AND_FREE( ptr ) \
921#define DELETE_AND_FREE_MAP( map ) \
923 for( auto& [ layer, ptr ] : map ) \
930 glDeleteLists(
m_grid, 1 );
970 bool aShowThickness,
bool aSkipRenderHoles )
972 wxASSERT( (aLayerID ==
B_Mask) || (aLayerID ==
F_Mask) );
985 m_board->SetItIsTransparent(
true );
986 m_board->DrawCulled( aShowThickness, solder_mask, via_holes );
1003 bool aGetBot,
bool aRenderTransparentOnly,
1004 bool aRenderSelectedOnly )
1006 wxASSERT( ( aGetTop ==
true ) || ( aGetBot ==
true ) );
1012 const wxString currentVariant =
m_boardAdapter.GetBoard()->GetCurrentVariant();
1017 bool highlight =
false;
1021 if( fp->IsSelected() )
1027 if( aRenderSelectedOnly != highlight )
1031 if( !fp->Models().empty() )
1036 if( fp->GetDNPForVariant( currentVariant ) )
1039 const bool isFlipped = fp->IsFlipped();
1041 if( aGetTop == !isFlipped || aGetBot == isFlipped )
1052 bool aRenderTransparentOnly,
bool aIsSelected )
1054 if( !aFootprint->
Models().empty() )
1060 glm::mat4 fpMatrix( 1.0f );
1069 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1074 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1075 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1080 fpMatrix = glm::scale( fpMatrix,
SFVEC3F( modelunit_to_3d_units_factor ) );
1085 if( !sM.m_Show || sM.m_Filename.empty() )
1094 if(
const MODEL_3D* modelPtr = cache_i->second )
1096 bool opaque = sM.m_Opacity >= 1.0;
1098 if( ( !aRenderTransparentOnly && modelPtr->HasOpaqueMeshes() && opaque ) ||
1099 ( aRenderTransparentOnly && ( modelPtr->HasTransparentMeshes() || !opaque ) ) )
1101 glm::mat4 modelworldMatrix = fpMatrix;
1103 const SFVEC3F offset =
SFVEC3F( sM.m_Offset.x, sM.m_Offset.y, sM.m_Offset.z );
1104 const SFVEC3F rotation =
SFVEC3F( sM.m_Rotation.x, sM.m_Rotation.y,
1108 std::vector<float> key = { offset.x, offset.y, offset.z,
1109 rotation.x, rotation.y, rotation.z,
1116 modelworldMatrix *= it->second;
1120 glm::mat4 mtx( 1.0f );
1121 mtx = glm::translate( mtx, offset );
1122 mtx = glm::rotate( mtx, glm::radians( -rotation.z ), { 0.0f, 0.0f, 1.0f } );
1123 mtx = glm::rotate( mtx, glm::radians( -rotation.y ), { 0.0f, 1.0f, 0.0f } );
1124 mtx = glm::rotate( mtx, glm::radians( -rotation.x ), { 1.0f, 0.0f, 0.0f } );
1125 mtx = glm::scale( mtx,
scale );
1128 modelworldMatrix *= mtx;
1131 aDstRenderList.emplace_back( modelworldMatrix, modelPtr,
1132 aRenderTransparentOnly ? sM.m_Opacity : 1.0f,
1133 aRenderTransparentOnly,
1150 std::list<MODELTORENDER> renderList;
1158 if( !renderList.empty() )
1163 renderModel( aCameraViewMatrix, mtr, selColor,
nullptr );
1172 if( !renderList.empty() )
1177 renderModel( aCameraViewMatrix, mtr, selColor,
nullptr );
1192 std::list<MODELTORENDER> renderListModels;
1203 if( renderListModels.empty() )
1206 std::vector<std::pair<const MODELTORENDER *, float>> transparentModelList;
1208 transparentModelList.reserve( renderListModels.size() );
1215 const BBOX_3D& bBox = mtr.m_model->GetBBox();
1217 const SFVEC3F bBoxWorld = mtr.m_modelWorldMat * glm::vec4( bBoxCenter, 1.0f );
1219 const float distanceToCamera = glm::length( cameraPos - bBoxWorld );
1221 transparentModelList.emplace_back( &mtr, distanceToCamera );
1225 std::sort( transparentModelList.begin(), transparentModelList.end(),
1226 [&]( std::pair<const MODELTORENDER *, float>& a,
1227 std::pair<const MODELTORENDER *, float>& b )
1229 if( a.second != b.second )
1230 return a.second > b.second;
1232 return a.first > b.first;
1238 bool isUsingColorInformation = !( transparentModelList.begin()->first->m_isSelected &&
1243 for(
const std::pair<const MODELTORENDER *, float>& mtr : transparentModelList )
1248 if( !isUsingColorInformation && !mtr.first->m_isSelected )
1250 isUsingColorInformation =
true;
1252 glEnableClientState( GL_COLOR_ARRAY );
1253 glEnableClientState( GL_TEXTURE_COORD_ARRAY );
1254 glEnable( GL_COLOR_MATERIAL );
1256 else if( isUsingColorInformation && mtr.first->m_isSelected )
1258 isUsingColorInformation =
false;
1260 glDisableClientState( GL_COLOR_ARRAY );
1261 glDisableClientState( GL_TEXTURE_COORD_ARRAY );
1262 glDisable( GL_COLOR_MATERIAL );
1268 renderModel( aCameraViewMatrix, *mtr.first, selColor, &cameraPos );
1283 const glm::mat4 modelviewMatrix = aCameraViewMatrix * aModelToRender.
m_modelWorldMat;
1285 glLoadMatrixf( glm::value_ptr( modelviewMatrix ) );
1293 const bool wasBlendEnabled = glIsEnabled( GL_BLEND );
1295 if( !wasBlendEnabled )
1297 glEnable( GL_BLEND );
1298 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
1301 glDisable( GL_LIGHTING );
1309 glEnable( GL_LIGHTING );
1311 if( !wasBlendEnabled )
1312 glDisable( GL_BLEND );
1320 glDeleteLists(
m_grid, 1 );
1327 m_grid = glGenLists( 1 );
1329 if( !glIsList(
m_grid ) )
1332 glNewList(
m_grid, GL_COMPILE );
1334 glEnable( GL_BLEND );
1335 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
1337 const double zpos = 0.0;
1345 const GLfloat transparency = 0.35f;
1347 double griSizeMM = 0.0;
1360 glNormal3f( 0.0, 0.0, 1.0 );
1365 brd_center_pos.
y = -brd_center_pos.
y;
1367 const int xsize = std::max( brd_size.
x,
pcbIUScale.mmToIU( 100 ) ) * 1.2;
1368 const int ysize = std::max( brd_size.
y,
pcbIUScale.mmToIU( 100 ) ) * 1.2;
1371 double xmin = ( brd_center_pos.
x - xsize / 2 ) *
scale;
1372 double xmax = ( brd_center_pos.
x + xsize / 2 ) *
scale;
1373 double ymin = ( brd_center_pos.
y - ysize / 2 ) *
scale;
1374 double ymax = ( brd_center_pos.
y + ysize / 2 ) *
scale;
1382 for(
int ii = 0; ; ii++ )
1385 glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1387 glColor4f( gridColor_marker.r, gridColor_marker.g, gridColor_marker.b,
1392 if(
delta <= xsize / 2 )
1394 glBegin( GL_LINES );
1395 glVertex3f( (brd_center_pos.
x +
delta) *
scale, -ymin, zpos );
1396 glVertex3f( (brd_center_pos.
x +
delta) *
scale, -ymax, zpos );
1401 glBegin( GL_LINES );
1402 glVertex3f( (brd_center_pos.
x -
delta) *
scale, -ymin, zpos );
1403 glVertex3f( (brd_center_pos.
x -
delta) *
scale, -ymax, zpos );
1408 if(
delta <= ysize / 2 )
1410 glBegin( GL_LINES );
1411 glVertex3f( xmin, -( brd_center_pos.
y +
delta ) *
scale, zpos );
1412 glVertex3f( xmax, -( brd_center_pos.
y +
delta ) *
scale, zpos );
1417 glBegin( GL_LINES );
1418 glVertex3f( xmin, -( brd_center_pos.
y -
delta ) *
scale, zpos );
1419 glVertex3f( xmax, -( brd_center_pos.
y -
delta ) *
scale, zpos );
1424 if( (
delta > ysize / 2 ) && (
delta > xsize / 2 ) )
1429 glNormal3f( 0.0, -1.0, 0.0 );
1432 double posy = -brd_center_pos.
y *
scale;
1434 for(
int ii = 0; ; ii++ )
1437 glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1439 glColor4f( gridColor_marker.r, gridColor_marker.g, gridColor_marker.b,
1444 glBegin( GL_LINES );
1447 glVertex3f( xmax, posy, zmin );
1448 glVertex3f( xmax, posy, zmax );
1453 glBegin( GL_LINES );
1455 glVertex3f( xmin, posy, zmin );
1456 glVertex3f( xmin, posy, zmax );
1460 if(
delta > xsize / 2.0f )
1465 for(
int ii = 0; ; ii++ )
1468 glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1470 glColor4f( gridColor_marker.r, gridColor_marker.g, gridColor_marker.b, transparency );
1477 glBegin( GL_LINES );
1478 glVertex3f( xmin, posy,
delta );
1479 glVertex3f( xmax, posy,
delta );
1483 if(
delta <= -zmin && ( ii != 0 ) )
1486 glBegin( GL_LINES );
1487 glVertex3f( xmin, posy, -
delta );
1488 glVertex3f( xmax, posy, -
delta );
1496 glDisable( GL_BLEND );
Defines math related functions.
float mapf(float x, float in_min, float in_max, float out_min, float out_max)
SFVEC3F SphericalToCartesian(float aInclination, float aAzimuth)
https://en.wikipedia.org/wiki/Spherical_coordinate_system
constexpr EDA_IU_SCALE pcbIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Helper class to handle information needed to display 3D board.
A class used to derive camera objects from.
Implement a canvas based on a wxGLCanvas.
auto RunWithoutCtxLock(Func &&aFunction, Args &&... args)
Run the given function first releasing the GL context lock, then restoring it.
Manage an 8-bit channel image.
void CircleFilled(int aCx, int aCy, int aRadius, unsigned char aValue)
void EfxFilter_SkipCenter(IMAGE *aInImg, IMAGE_FILTER aFilterType, unsigned int aRadius)
Apply a filter to the input image and store it in the image class.
unsigned int GetHeight() const
unsigned int GetWidth() const
A color representation with 4 components: red, green, blue, alpha.
static const LSET & PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
void DrawBbox() const
Draw main bounding box of the model.
static void EndDrawMulti()
Cleanup render states after drawing multiple models.
void Draw(bool aTransparent, float aOpacity, bool aUseSelectedMaterial, const SFVEC3F &aSelectionColor, const glm::mat4 *aModelWorldMatrix, const SFVEC3F *aCameraWorldPos) const
Render the model into the current context.
static void BeginDrawMulti(bool aUseColorInformation)
Set some basic render states before drawing multiple models.
void DrawBboxes() const
Draw individual bounding boxes of each mesh.
Store the OpenGL display lists to related with a layer.
void ApplyScalePosition(float aZposition, float aZscale)
void SetItIsTransparent(bool aSetTransparent)
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 DrawAll(bool aDrawMiddle=true) const
Call to draw all the display lists.
GL_CONTEXT_MANAGER * GetGLContextManager()
std::unique_ptr< BUSY_INDICATOR > CreateBusyIndicator() const
Return a created busy indicator, if a factory has been set, else a null pointer.
RENDER_3D_BASE(BOARD_ADAPTER &aBoardAdapter, CAMERA &aCamera)
bool m_canvasInitialized
Flag if the canvas specific for this render was already initialized.
wxSize m_windowSize
The window size that this camera is working.
BOARD_ADAPTER & m_boardAdapter
Settings reference in use for this render.
OPENGL_RENDER_LIST * m_board
OPENGL_RENDER_LIST * m_outerThroughHoleRings
OPENGL_RENDER_LIST * m_offboardPadsFront
SPHERES_GIZMO::GizmoSphereSelection getSelectedGizmoSphere() const
GRID3D_TYPE m_lastGridType
Stores the last grid type.
std::tuple< int, int, int, int > getGizmoViewport() const
OPENGL_RENDER_LIST * m_microviaHoles
void renderOpaqueModels(const glm::mat4 &aCameraViewMatrix)
void generate3dGrid(GRID3D_TYPE aGridType)
Create a 3D grid to an OpenGL display list.
void setLightFront(bool enabled)
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
RENDER_3D_OPENGL(EDA_3D_CANVAS *aCanvas, BOARD_ADAPTER &aAdapter, CAMERA &aCamera)
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
OPENGL_RENDER_LIST * m_viaBackCover
OPENGL_RENDER_LIST * m_viaFrontCover
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 resetSelectedGizmoSphere()
struct RENDER_3D_OPENGL::@136145154067207014164113243162246125147361200233 m_materials
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...
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)
OPENGL_RENDER_LIST * m_postMachinePlugs
Board material plugs for backdrill/counterbore/countersink.
void setPlatedCopperAndDepthOffset(PCB_LAYER_ID aLayer_id)
OPENGL_RENDER_LIST * m_antiBoard
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
SPHERES_GIZMO * m_spheres_gizmo
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)
void handleGizmoMouseInput(int mouseX, int mouseY)
void setLightBottom(bool enabled)
void setGizmoViewport(int x, int y, int width, int height)
void setLightTop(bool enabled)
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Renders a set of colored spheres in 3D space that act as a directional orientation gizmo.
GizmoSphereSelection
Enum to indicate which sphere (direction) is selected.
Store arrays of triangles to be used to create display lists.
#define DELETE_AND_FREE_MAP(map)
#define DELETE_AND_FREE(ptr)
#define UNITS3D_TO_UNITSPCB
Implements a model viewer canvas.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
int MapPCBLayerTo3DLayer(PCB_LAYER_ID aLayer)
@ LAYER_3D_SOLDERMASK_TOP
@ LAYER_3D_SOLDERMASK_BOTTOM
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
void OglResetTextureState()
Reset to default state the texture settings.
void OglSetMaterial(const SMATERIAL &aMaterial, float aOpacity, bool aUseSelectedMaterial, SFVEC3F aSelectionColor)
Set OpenGL materials.
GLuint OglLoadTexture(const IMAGE &aImage)
Generate a new OpenGL texture.
void OglDrawBackground(const SFVEC4F &aTopColor, const SFVEC4F &aBotColor)
Define generic OpenGL functions that are common to any OpenGL target.
PGM_BASE & Pgm()
The global program "get" accessor.
static SFVEC4F premultiplyAlpha(const SFVEC4F &aInput)
#define SIZE_OF_CIRCLE_TEXTURE
Manage a bounding box defined by two SFVEC3F min max points.
SFVEC3F GetCenter() const
Return the center point of the bounding box.
bool opengl_thickness_disableOnMove
KIGFX::COLOR4D opengl_selection_color
bool clip_silk_on_via_annuli
bool subtract_mask_from_silk
bool opengl_microvias_disableOnMove
bool highlight_on_rollover
bool DifferentiatePlatedCopper()
return true if platted copper aeras and non platted copper areas must be drawn using a different colo...
bool opengl_holes_disableOnMove
bool opengl_AA_disableOnMove
glm::mat4 m_modelWorldMat
VECTOR2< int32_t > VECTOR2I