40 #define UNITS3D_TO_UNITSPCB (IU_PER_MM) 46 wxLogTrace(
m_logTrace, wxT(
"RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) );
76 wxLogTrace(
m_logTrace, wxT(
"RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) );
105 glEnable( GL_LIGHT0 );
107 glDisable( GL_LIGHT0 );
114 glEnable( GL_LIGHT1 );
116 glDisable( GL_LIGHT1 );
123 glEnable( GL_LIGHT2 );
125 glDisable( GL_LIGHT2 );
133 glDisable( GL_CULL_FACE );
137 glClear( GL_DEPTH_BUFFER_BIT );
139 glMatrixMode( GL_PROJECTION );
143 glMatrixMode( GL_MODELVIEW );
146 const glm::mat4 TranslationMatrix =
147 glm::translate( glm::mat4( 1.0f ),
SFVEC3F( 0.0f, 0.0f, -( arrow_size * 2.75f ) ) );
151 glLoadMatrixf( glm::value_ptr( ViewMatrix ) );
155 glColor3f( 0.9f, 0.0f, 0.0f );
158 glColor3f( 0.0f, 0.9f, 0.0f );
161 glColor3f( 0.0f, 0.0f, 0.9f );
164 glEnable( GL_CULL_FACE );
193 m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f;
202 m_materials.m_NonPlatedCopper.m_Shininess = 0.1f * 128.0f;
233 m_materials.m_SilkSTop.m_Shininess = 0.078125f * 128.0f;
249 m_materials.m_SilkSBot.m_Shininess = 0.078125f * 128.0f;
252 m_materials.m_SolderMask.m_Shininess = 0.8f * 128.0f;
262 m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f;
269 const float matShininess = 0.1f * 128.0f;
273 m_materials.m_Copper.m_Specular = matSpecularColor;
284 m_materials.m_SilkSTop.m_Ambient = matAmbientColor;
285 m_materials.m_SilkSTop.m_Specular = matSpecularColor;
290 m_materials.m_SilkSBot.m_Ambient = matAmbientColor;
291 m_materials.m_SilkSBot.m_Specular = matSpecularColor;
296 m_materials.m_SolderMask.m_Ambient = matAmbientColor;
297 m_materials.m_SolderMask.m_Specular = matSpecularColor;
298 m_materials.m_SolderMask.m_Shininess = matShininess;
302 m_materials.m_EpoxyBoard.m_Ambient = matAmbientColor;
303 m_materials.m_EpoxyBoard.m_Specular = matSpecularColor;
304 m_materials.m_EpoxyBoard.m_Shininess = matShininess;
311 m_materials.m_GrayMaterial.m_Shininess = 0.01f * 128.0f;
329 m_materials.m_SolderMask.m_Transparency = 1.0f - layerColor.a;
381 m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
455 const GLfloat ambient[] = { 0.084f, 0.084f, 0.084f, 1.0f };
456 const GLfloat diffuse0[] = { 0.3f, 0.3f, 0.3f, 1.0f };
457 const GLfloat specular0[] = { 0.5f, 0.5f, 0.5f, 1.0f };
459 glLightfv( GL_LIGHT0, GL_AMBIENT, ambient );
460 glLightfv( GL_LIGHT0, GL_DIFFUSE, diffuse0 );
461 glLightfv( GL_LIGHT0, GL_SPECULAR, specular0 );
463 const GLfloat diffuse12[] = { 0.7f, 0.7f, 0.7f, 1.0f };
464 const GLfloat specular12[] = { 0.7f, 0.7f, 0.7f, 1.0f };
467 GLfloat position[4] = { 0.0f, 0.0f, 1.0f, 0.0f };
471 glm::pi<float>() * 0.25f );
473 position[0] = vectorLight.x;
474 position[1] = vectorLight.y;
475 position[2] = vectorLight.z;
477 glLightfv( GL_LIGHT1, GL_AMBIENT, ambient );
478 glLightfv( GL_LIGHT1, GL_DIFFUSE, diffuse12 );
479 glLightfv( GL_LIGHT1, GL_SPECULAR, specular12 );
480 glLightfv( GL_LIGHT1, GL_POSITION, position );
483 position[2] = -position[2];
485 glLightfv( GL_LIGHT2, GL_AMBIENT, ambient );
486 glLightfv( GL_LIGHT2, GL_DIFFUSE, diffuse12 );
487 glLightfv( GL_LIGHT2, GL_SPECULAR, specular12 );
488 glLightfv( GL_LIGHT2, GL_POSITION, position );
490 const GLfloat lmodel_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
492 glLightModelfv( GL_LIGHT_MODEL_AMBIENT, lmodel_ambient );
494 glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
506 glEnable( GL_POLYGON_OFFSET_FILL );
507 glPolygonOffset( -0.1f, -2.0f );
514 glDisable( GL_POLYGON_OFFSET_FILL );
529 if( aSkipRenderHoles )
560 if( aStatusReporter )
561 aStatusReporter->
Report(
_(
"Loading..." ) );
563 reload( aStatusReporter, aWarningReporter );
583 glDepthFunc( GL_LESS );
584 glEnable( GL_CULL_FACE );
585 glFrontFace( GL_CCW );
586 glEnable( GL_NORMALIZE );
590 glDisable( GL_MULTISAMPLE );
592 glEnable( GL_MULTISAMPLE );
595 glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
596 glClearDepth( 1.0f );
597 glClearStencil( 0x00 );
598 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
606 glEnable( GL_DEPTH_TEST );
609 glMatrixMode( GL_PROJECTION );
611 glMatrixMode( GL_MODELVIEW );
620 glEnable( GL_LIGHTING );
629 if( cameraPos.z > 0.0f )
631 zpos = glm::max( cameraPos.z, 0.5f ) + cameraPos.z * cameraPos.z;
635 zpos = glm::min( cameraPos.z,-0.5f ) - cameraPos.z * cameraPos.z;
639 const GLfloat headlight_pos[] = { cameraPos.x, cameraPos.y, zpos, 1.0f };
641 glLightfv( GL_LIGHT0, GL_POSITION, headlight_pos );
644 const bool drawMiddleSegments = !( aIsMoving &&
647 const bool skipRenderHoles = aIsMoving &&
650 const bool skipRenderVias = aIsMoving &&
663 if( !( skipRenderVias || skipRenderHoles ) &&
m_vias )
670 for( MAP_OGL_DISP_LISTS::const_iterator ii =
m_layers.begin(); ii !=
m_layers.end(); ++ii )
681 const double opacity_min = 0.8;
686 if( ( layer_id >
F_Cu ) && ( layer_id <
B_Cu ) )
694 if( ( layer_id >=
F_Cu ) && ( layer_id <=
B_Cu ) )
703 if( skipRenderHoles )
712 drawMiddleSegments );
718 drawMiddleSegments );
743 wxASSERT( viasHolesLayer !=
nullptr );
745 if( viasHolesLayer !=
nullptr )
811 if( throughHolesOuter )
839 throughHolesOuter, anti_board );
843 if( !skipRenderHoles && throughHolesOuter
854 if( !( skipRenderHoles && ( layer_id ==
B_Paste || layer_id ==
F_Paste ) ) )
881 glEnable( GL_POLYGON_OFFSET_FILL );
882 glPolygonOffset( 0.0f, -2.0f );
887 drawMiddleSegments, skipRenderHoles );
890 drawMiddleSegments, skipRenderHoles );
895 drawMiddleSegments, skipRenderHoles );
898 drawMiddleSegments, skipRenderHoles );
901 glDisable( GL_POLYGON_OFFSET_FILL );
902 glPolygonOffset( 0.0f, 0.0f );
908 glDepthMask( GL_FALSE );
909 glEnable( GL_BLEND );
910 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
913 glEnable( GL_TEXTURE_2D );
914 glActiveTexture( GL_TEXTURE0 );
916 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
917 glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE );
918 glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE );
920 glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PRIMARY_COLOR );
921 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
923 glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS );
924 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
926 glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR );
927 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
928 glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_CONSTANT );
929 glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_CONSTANT );
934 glDisable( GL_BLEND );
937 glDepthMask( GL_TRUE );
942 glDisable( GL_LIGHTING );
947 glEnable( GL_LIGHTING );
964 glEnable( GL_LINE_SMOOTH );
965 glShadeModel( GL_SMOOTH );
968 glPixelStorei( GL_UNPACK_ALIGNMENT, 4 );
989 delete circleImageBlured;
990 circleImageBlured =
nullptr;
993 circleImage =
nullptr;
1007 glEnable( GL_COLOR_MATERIAL );
1008 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
1015 glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r );
1016 glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 96.0f );
1018 glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.r );
1019 glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.r );
1020 glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.r );
1027 glDeleteLists(
m_grid, 1 );
1031 for( MAP_OGL_DISP_LISTS::const_iterator ii =
m_layers.begin(); ii !=
m_layers.end(); ++ii )
1034 delete pLayerDispList;
1050 delete pLayerDispList;
1060 delete pLayerDispList;
1074 MODEL_3D* pointer = static_cast<MODEL_3D*>(ii->second);
1107 bool aDrawMiddleSegments,
bool aSkipRenderHoles )
1109 wxASSERT( (aLayerID ==
B_Mask) || (aLayerID ==
F_Mask) );
1128 if( aSkipRenderHoles )
1150 if( aSkipRenderHoles )
1165 bool aRenderSelectedOnly )
1175 bool highlight =
false;
1179 if( fp->IsSelected() )
1185 if( aRenderSelectedOnly != highlight )
1189 if( !fp->Models().empty() )
1193 if( aRenderTopOrBot == !fp->IsFlipped() )
1215 if( !aFootprint->
Models().empty() )
1227 glRotated( (
double) aFootprint->
GetOrientation() / 10.0, 0.0, 0.0, 1.0 );
1231 glRotatef( 180.0f, 0.0f, 1.0f, 0.0f );
1232 glRotatef( 180.0f, 0.0f, 0.0f, 1.0f );
1237 glScaled( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
1238 modelunit_to_3d_units_factor );
1243 if( !sM.m_Show || sM.m_Filename.empty() )
1252 if(
const MODEL_3D* modelPtr = cache_i->second )
1254 bool opaque = sM.m_Opacity >= 1.0;
1256 if( ( !aRenderTransparentOnly && modelPtr->HasOpaqueMeshes() && opaque ) ||
1257 ( aRenderTransparentOnly && ( modelPtr->HasTransparentMeshes() || !opaque ) ) )
1264 mtx = glm::translate( mtx, { sM.m_Offset.x, sM.m_Offset.y, sM.m_Offset.z } );
1265 mtx = glm::rotate( mtx, glm::radians( (
float) -sM.m_Rotation.z ),
1266 { 0.0f, 0.0f, 1.0f } );
1267 mtx = glm::rotate( mtx, glm::radians( (
float) -sM.m_Rotation.y ),
1268 { 0.0f, 1.0f, 0.0f } );
1269 mtx = glm::rotate( mtx, glm::radians( (
float) -sM.m_Rotation.x ),
1270 { 1.0f, 0.0f, 0.0f } );
1271 mtx =
glm::scale( mtx, { sM.m_Scale.x, sM.m_Scale.y, sM.m_Scale.z } );
1272 glMultMatrixf( glm::value_ptr( mtx ) );
1274 if( aRenderTransparentOnly )
1276 modelPtr->DrawTransparent( sM.m_Opacity,
1282 modelPtr->DrawOpaque( aFootprint->
IsSelected() || aIsSelected,
1288 glEnable( GL_BLEND );
1289 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
1291 glDisable( GL_LIGHTING );
1294 modelPtr->DrawBboxes();
1297 modelPtr->DrawBbox();
1299 glEnable( GL_LIGHTING );
1300 glDisable( GL_BLEND );
1316 glDeleteLists(
m_grid, 1 );
1323 m_grid = glGenLists( 1 );
1325 if( !glIsList(
m_grid ) )
1328 glNewList(
m_grid, GL_COMPILE );
1330 glEnable( GL_BLEND );
1331 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
1333 const double zpos = 0.0;
1341 const GLfloat transparency = 0.35f;
1343 double griSizeMM = 0.0;
1364 glNormal3f( 0.0, 0.0, 1.0 );
1369 brd_center_pos.y = -brd_center_pos.y;
1371 const int xsize = std::max( brd_size.x,
Millimeter2iu( 100 ) ) * 1.2;
1372 const int ysize = std::max( brd_size.y,
Millimeter2iu( 100 ) ) * 1.2;
1375 double xmin = ( brd_center_pos.x - xsize / 2 ) *
scale;
1376 double xmax = ( brd_center_pos.x + xsize / 2 ) *
scale;
1377 double ymin = ( brd_center_pos.y - ysize / 2 ) *
scale;
1378 double ymax = ( brd_center_pos.y + ysize / 2 ) *
scale;
1386 for(
int ii = 0; ; ii++ )
1389 glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1391 glColor4f( gridColor_marker.r, gridColor_marker.g, gridColor_marker.b,
1396 if(
delta <= xsize / 2 )
1398 glBegin( GL_LINES );
1399 glVertex3f( (brd_center_pos.x +
delta) *
scale, -ymin, zpos );
1400 glVertex3f( (brd_center_pos.x +
delta) *
scale, -ymax, zpos );
1405 glBegin( GL_LINES );
1406 glVertex3f( (brd_center_pos.x -
delta) *
scale, -ymin, zpos );
1407 glVertex3f( (brd_center_pos.x -
delta) *
scale, -ymax, zpos );
1412 if(
delta <= ysize / 2 )
1414 glBegin( GL_LINES );
1415 glVertex3f( xmin, -( brd_center_pos.y +
delta ) *
scale, zpos );
1416 glVertex3f( xmax, -( brd_center_pos.y +
delta ) *
scale, zpos );
1421 glBegin( GL_LINES );
1422 glVertex3f( xmin, -( brd_center_pos.y -
delta ) *
scale, zpos );
1423 glVertex3f( xmax, -( brd_center_pos.y -
delta ) *
scale, zpos );
1428 if( (
delta > ysize / 2 ) && (
delta > xsize / 2 ) )
1433 glNormal3f( 0.0, -1.0, 0.0 );
1436 double posy = -brd_center_pos.y *
scale;
1438 for(
int ii = 0; ; ii++ )
1441 glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1443 glColor4f( gridColor_marker.r, gridColor_marker.g, gridColor_marker.b,
1448 glBegin( GL_LINES );
1451 glVertex3f( xmax, posy, zmin );
1452 glVertex3f( xmax, posy, zmax );
1457 glBegin( GL_LINES );
1459 glVertex3f( xmin, posy, zmin );
1460 glVertex3f( xmin, posy, zmax );
1464 if(
delta > xsize / 2.0f )
1469 for(
int ii = 0; ; ii++ )
1472 glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1474 glColor4f( gridColor_marker.r, gridColor_marker.g, gridColor_marker.b, transparency );
1481 glBegin( GL_LINES );
1482 glVertex3f( xmin, posy,
delta );
1483 glVertex3f( xmax, posy,
delta );
1487 if(
delta <= -zmin && ( ii != 0 ) )
1490 glBegin( GL_LINES );
1491 glVertex3f( xmin, posy, -
delta );
1492 glVertex3f( xmax, posy, -
delta );
1500 glDisable( GL_BLEND );
OPENGL_RENDER_LIST * m_platedPadsBack
GRID3D_TYPE GetGridType() const noexcept
Get the current grid.
OPENGL_RENDER_LIST * m_antiBoard
bool GetFlag(DISPLAY3D_FLG aFlag) const
Get a configuration status of a flag.
BOARD_ADAPTER & m_boardAdapter
void setLightFront(bool enabled)
OPENGL_RENDER_LIST * m_board
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
bool IsFootprintShown(FOOTPRINT_ATTR_T aFPAttributes) const
Test if footprint should be displayed in relation to attributes and the flags.
void OglSetMaterial(const SMATERIAL &aMaterial, float aOpacity, bool aUseSelectedMaterial, SFVEC3F aSelectionColor)
Set OpenGL materials.
Implementation of conversion functions that require both schematic and board internal units.
OPENGL_RENDER_LIST * m_outerViaThroughHoles
OPENGL_RENDER_LIST * m_boardWithHoles
static constexpr double IU_PER_MM
Mock up a conversion function.
SFVEC4F GetColor(const COLOR4D &aColor) const
void DrawAllCameraCulledSubtractLayer(bool aDrawMiddle, const OPENGL_RENDER_LIST *aLayerToSubtractA=nullptr, const OPENGL_RENDER_LIST *aLayerToSubtractB=nullptr, const OPENGL_RENDER_LIST *aLayerToSubtractC=nullptr, const OPENGL_RENDER_LIST *aLayerToSubtractD=nullptr) const
void DrawAllCameraCulled(float zCameraPos, bool aDrawMiddle=true) const
Draw all layers if they are visible by the camera if camera position is above the layer.
const glm::mat4 & GetProjectionMatrix() const
LIST_TRIANGLES m_triangles
store pointers so can be deleted latter
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
MAP_OGL_DISP_LISTS m_innerLayerHoles
float GetNonCopperLayerThickness() const noexcept
Get the current non copper layers thickness.
const SFVEC3F & GetPos() const
float mapf(float x, float in_min, float in_max, float out_min, float out_max)
Implement a canvas based on a wxGLCanvas.
MAP_OGL_DISP_LISTS m_layers
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
BOARD_ITEM * m_currentRollOverItem
OPENGL_RENDER_LIST * m_outerThroughHoles
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
void OglResetTextureState()
Reset to default state the texture settings.
A pure virtual class used to derive REPORTER objects from.
const glm::mat4 GetRotationMatrix() const
Get the rotation matrix to be applied in a transformation camera.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
#define UNITS3D_TO_UNITSPCB
Scale conversion from 3d model units to pcb units.
struct RENDER_3D_OPENGL::@2 m_materials
A class used to derive camera objects from.
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.
#define SIZE_OF_CIRCLE_TEXTURE
OPENGL_RENDER_LIST * m_vias
void reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
SFVEC4F m_BgColorTop
background top color
void CircleFilled(int aCx, int aCy, int aRadius, unsigned char aValue)
void setLightBottom(bool enabled)
wxPoint GetBoardPos() const noexcept
Get the board center.
float GetLayerTopZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the top z position.
MAP_OGL_DISP_LISTS m_outerLayerHoles
GLuint m_grid
oGL list that stores current grid
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
FOOTPRINTS & Footprints()
float GetLayerBottomZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the bottom z position.
const glm::mat4 & GetViewMatrix() const
OPENGL_RENDER_LIST * m_outerThroughHoleRings
double BiuTo3dUnits() const noexcept
Board integer units To 3D units.
void setPlatedCopperAndDepthOffset(PCB_LAYER_ID aLayer_id)
const BOARD * GetBoard() const noexcept
Get current board to be rendered.
SFVEC4F m_BgColorBot
background bottom color
void renderFootprint(const FOOTPRINT *aFootprint, bool aRenderTransparentOnly, bool aIsSelected)
void ApplyScalePosition(float aZposition, float aZscale)
void setLightTop(bool enabled)
OPENGL_RENDER_LIST * m_padHoles
This is a base class to hold data and functions for render targets.
void DrawRoundArrow(SFVEC3F aPosition, SFVEC3F aTargetPos, float aSize)
Draw a round arrow.
void DrawAll(bool aDrawMiddle=true) const
Call to draw all the display lists.
OPENGL_RENDER_LIST * m_platedPadsFront
bool m_is_opengl_initialized
void SetCurWindowSize(const wxSize &aSize) override
Before each render, the canvas will tell the render what is the size of its windows,...
float GetFootprintZPos(bool aIsFlipped) const
Get the position of the footprint in 3d integer units considering if it is flipped or not.
std::unique_ptr< BUSY_INDICATOR > CreateBusyIndicator() const
Return a created busy indicator, if a factory has been set, else a null pointer.
Store the OpenGL display lists to related with a layer.
bool m_reloadRequested
The window size that this camera is working.
void generate3dGrid(GRID3D_TYPE aGridType)
Create a 3D grid to an OpenGL display list.
static void EndDrawMulti()
Cleanup render states after drawing multiple models.
void renderBoardBody(bool aSkipRenderHoles)
SFVEC4F GetLayerColor(PCB_LAYER_ID aLayerId) const
Get the technical color of a layer.
void setLayerMaterial(PCB_LAYER_ID aLayerID)
GRID3D_TYPE m_lastGridType
Stores the last grid type.
void OglDrawBackground(const SFVEC3F &aTopColor, const SFVEC3F &aBotColor)
PCB_LAYER_ID
A quick note on layer IDs:
SFVEC4F m_CopperColor
in realistic mode: copper color
unsigned int GetHeight() const
RENDER_3D_OPENGL(EDA_3D_CANVAS *aCanvas, BOARD_ADAPTER &aAdapter, CAMERA &aCamera)
SFVEC3F SphericalToCartesian(float aInclination, float aAzimuth)
https://en.wikipedia.org/wiki/Spherical_coordinate_system
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Define generic OpenGL functions that are common to any OpenGL target.
Manage an 8-bit channel image.
CAMERA & m_camera
Flag if the opengl specific for this render was already initialized.
void SetItIsTransparent(bool aSetTransparent)
Defines math related functions.
SFVEC3F m_OpenGlSelectionColor
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
unsigned int GetWidth() const
float GetEpoxyThickness() const noexcept
Get the current epoxy thickness.
static void BeginDrawMulti(bool aUseColorInformation)
Set some basic render states before drawing multiple models.
GLuint OglLoadTexture(const IMAGE &aImage)
Generate a new OpenGL texture.
static constexpr int Millimeter2iu(double mm)
void render3dModels(bool aRenderTopOrBot, bool aRenderTransparentOnly)
wxSize GetBoardSize() const noexcept
Get the board size.
Helper class to handle information needed to display 3D board.
bool Redraw(bool aIsMoving, REPORTER *aStatusReporter, REPORTER *aWarningReporter) override
Redraw the view.
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
void render3dModelsSelected(bool aRenderTopOrBot, bool aRenderTransparentOnly, bool aRenderSelectedOnly)
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)