From 970a0a593ae887b4ded300f8ac0a9c19105ca97f Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Wed, 29 Jan 2020 16:00:05 +0000 Subject: [PATCH] 3d-viewer, add an option to subtract Mask from Silk Remove holes on Silk layer by default so the behaviour is the same on OpenGL and Raytracing. Fixes #1836 Fix raytracing shadow offset issue. Some codestyle fix. --- 3d-viewer/3d_canvas/cinfo3d_visu.cpp | 1 + 3d-viewer/3d_enums.h | 12 +- .../c3d_render_ogl_legacy.cpp | 44 +- .../3d_render_ogl_legacy/clayer_triangles.cpp | 5 +- .../c3d_render_createscene.cpp | 47 +- .../c3d_render_raytracing.cpp | 2 +- .../dialogs/dialog_3D_view_option.cpp | 3 + .../dialogs/dialog_3D_view_option_base.cpp | 221 +-- .../dialogs/dialog_3D_view_option_base.fbp | 1458 +++-------------- .../dialogs/dialog_3D_view_option_base.h | 22 +- 3d-viewer/3d_viewer/eda_3d_viewer.cpp | 7 +- 11 files changed, 480 insertions(+), 1342 deletions(-) diff --git a/3d-viewer/3d_canvas/cinfo3d_visu.cpp b/3d-viewer/3d_canvas/cinfo3d_visu.cpp index cfde5b2536..1ce78dc6e1 100644 --- a/3d-viewer/3d_canvas/cinfo3d_visu.cpp +++ b/3d-viewer/3d_canvas/cinfo3d_visu.cpp @@ -103,6 +103,7 @@ CINFO3D_VISU::CINFO3D_VISU() : SetFlag( FL_ZONE, true ); SetFlag( FL_SILKSCREEN, true ); SetFlag( FL_SOLDERMASK, true ); + SetFlag( FL_SUBTRACT_MASK_FROM_SILK, false ); m_BgColorBot = SFVEC3D( 0.4, 0.4, 0.5 ); m_BgColorTop = SFVEC3D( 0.8, 0.8, 0.9 ); diff --git a/3d-viewer/3d_enums.h b/3d-viewer/3d_enums.h index 4e1b874e1b..9f5b4ff922 100644 --- a/3d-viewer/3d_enums.h +++ b/3d-viewer/3d_enums.h @@ -32,9 +32,14 @@ /// Flags used in rendering options enum DISPLAY3D_FLG { - FL_AXIS=0, FL_ZONE, - FL_ADHESIVE, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE, - FL_COMMENTS, FL_ECO, + FL_AXIS = 0, + FL_ZONE, + FL_ADHESIVE, + FL_SILKSCREEN, + FL_SOLDERMASK, + FL_SOLDERPASTE, + FL_COMMENTS, + FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, @@ -43,6 +48,7 @@ enum DISPLAY3D_FLG { FL_SHOW_BOARD_BODY, FL_MOUSEWHEEL_PANNING, FL_USE_REALISTIC_MODE, + FL_SUBTRACT_MASK_FROM_SILK, // OpenGL options FL_RENDER_OPENGL_SHOW_MODEL_BBOX, diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index 7388f182f0..bf31d33f5a 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -735,8 +735,40 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( bool aIsMoving, } else { - pLayerDispList->DrawAllCameraCulled( m_settings.CameraGet().GetPos().z, - (aIsMoving == false) ); + if( m_settings.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) && + ( ( ( layer_id == B_SilkS ) && + ( m_ogl_disp_lists_layers.find( B_Mask ) != m_ogl_disp_lists_layers.end() ) ) || + ( ( layer_id == F_SilkS ) && + ( m_ogl_disp_lists_layers.find( F_Mask ) != m_ogl_disp_lists_layers.end() ) ) ) ) + { + const PCB_LAYER_ID layerMask_id = (layer_id == B_SilkS)?B_Mask:F_Mask; + + const CLAYERS_OGL_DISP_LISTS *pLayerDispListMask = m_ogl_disp_lists_layers.at( layerMask_id ); + + pLayerDispList->DrawAllCameraCulledSubtractLayer( + pLayerDispListMask, + m_ogl_disp_list_through_holes_vias_outer, + (aIsMoving == false) ); + } + else + { + if( m_ogl_disp_list_through_holes_vias_outer && + ( ( layer_id == B_SilkS ) || ( layer_id == F_SilkS ) + // Remove vias on SolderPaste can be added as an option in future + // ( layer_id == B_Paste ) || ( layer_id == F_Paste ) ) + ) ) + { + pLayerDispList->DrawAllCameraCulledSubtractLayer( + NULL, + m_ogl_disp_list_through_holes_vias_outer, + (aIsMoving == false) ); + } + else + { + pLayerDispList->DrawAllCameraCulled( m_settings.CameraGet().GetPos().z, + (aIsMoving == false) ); + } + } } glPopMatrix(); @@ -762,6 +794,11 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( bool aIsMoving, //setLight_Top( true ); //setLight_Bottom( true ); + // add a depth buffer offset, it will help to hide some artifacts + // on silkscreen where the SolderMask is removed + glEnable( GL_POLYGON_OFFSET_FILL ); + glPolygonOffset( 0.0f, -1.0f ); + if( m_settings.CameraGet().GetPos().z > 0 ) { render_solder_mask_layer( B_Mask, m_settings.GetLayerTopZpos3DU( B_Mask ), @@ -778,6 +815,9 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( bool aIsMoving, render_solder_mask_layer( B_Mask, m_settings.GetLayerTopZpos3DU( B_Mask ), aIsMoving ); } + + glDisable( GL_POLYGON_OFFSET_FILL ); + glPolygonOffset( 0.0f, 0.0f ); } diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/clayer_triangles.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/clayer_triangles.cpp index d91c9521ba..9ae5c4d85a 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/clayer_triangles.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/clayer_triangles.cpp @@ -526,9 +526,6 @@ void CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulledSubtractLayer( const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractB, bool aDrawMiddle ) const { - if( aDrawMiddle ) - DrawMiddle(); - glClearStencil( 0x00 ); glClear( GL_STENCIL_BUFFER_BIT ); @@ -584,6 +581,8 @@ void CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulledSubtractLayer( glStencilOp( GL_KEEP, GL_KEEP, GL_INCR ); DrawTop(); + if( aDrawMiddle ) + DrawMiddle(); glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE ); diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp index 92fec05f69..6b5d37bb59 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp @@ -539,10 +539,12 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter ) std::vector *object2d_B = CSGITEM_EMPTY; - if( true ) // previously, was a option, now holes are always drawn in zones - { - object2d_B = new std::vector(); + object2d_B = new std::vector(); + // Subtract holes but not in SolderPaste + // (can be added as an option in future) + if( !( ( layer_id == B_Paste ) || ( layer_id == F_Paste ) ) ) + { // Check if there are any layerhole that intersects this object // Eg: a segment is cutted by a via hole or THT hole. // ///////////////////////////////////////////////////////////// @@ -555,7 +557,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter ) const CBVHCONTAINER2D *containerLayerHoles2d = static_cast(ii_hole->second); - CONST_LIST_OBJECT2D intersectionList; containerLayerHoles2d->GetListObjectsIntersects( object2d_A->GetBBox(), intersectionList ); @@ -600,14 +601,46 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter ) } } } + } - if( object2d_B->empty() ) + + const MAP_CONTAINER_2D& mapLayers = m_settings.GetMapLayers(); + + if( m_settings.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) && + ( ( ( layer_id == B_SilkS ) && + ( mapLayers.find( B_Mask ) != mapLayers.end() ) ) || + ( ( layer_id == F_SilkS ) && + ( mapLayers.find( F_Mask ) != mapLayers.end() ) ) ) ) + { + const PCB_LAYER_ID layerMask_id = ( layer_id == B_SilkS ) ? B_Mask : F_Mask; + + const CBVHCONTAINER2D *containerMaskLayer2d = + static_cast( mapLayers.at( layerMask_id ) ); + + CONST_LIST_OBJECT2D intersectionList; + containerMaskLayer2d->GetListObjectsIntersects( object2d_A->GetBBox(), + intersectionList ); + + if( !intersectionList.empty() ) { - delete object2d_B; - object2d_B = CSGITEM_EMPTY; + for( CONST_LIST_OBJECT2D::const_iterator objOnLayer = + intersectionList.begin(); + objOnLayer != intersectionList.end(); + ++objOnLayer ) + { + const COBJECT2D* obj2d = static_cast( *objOnLayer ); + + object2d_B->push_back( obj2d ); + } } } + if( object2d_B->empty() ) + { + delete object2d_B; + object2d_B = CSGITEM_EMPTY; + } + if( (object2d_B == CSGITEM_EMPTY) && (object2d_C == CSGITEM_FULL) ) { diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp index e2d362f60a..43b0d15e03 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp @@ -1727,7 +1727,7 @@ SFVEC3F C3D_RENDER_RAYTRACING::shadeHit( const SFVEC3F &aBgColor, SFVEC3F hitPoint = aHitInfo.m_HitPoint; if( !m_isPreview ) - hitPoint += aHitInfo.m_HitNormal * m_settings.GetNonCopperLayerThickness3DU() * 1.0f; + hitPoint += aHitInfo.m_HitNormal * m_settings.GetNonCopperLayerThickness3DU() * 1.2f; const CMATERIAL *objMaterial = aHitInfo.pHitObject->GetMaterial(); wxASSERT( objMaterial != NULL ); diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp index 3f188a357e..602bcb63bf 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp @@ -87,6 +87,7 @@ void DIALOG_3D_VIEW_OPTIONS::initDialog() m_bitmapAdhesive->SetBitmap( KiBitmap( tools_xpm ) ); m_bitmapComments->SetBitmap( KiBitmap( editor_xpm ) ); m_bitmapECO->SetBitmap( KiBitmap( editor_xpm ) ); + m_bitmapSubtractMaskFromSilk->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) ); } @@ -109,6 +110,7 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow() m_checkBoxAdhesive->SetValue( m_3Dprms.GetFlag( FL_ADHESIVE ) ); m_checkBoxComments->SetValue( m_3Dprms.GetFlag( FL_COMMENTS ) ); m_checkBoxECO->SetValue( m_3Dprms.GetFlag( FL_ECO ) ); + m_checkBoxSubtractMaskFromSilk->SetValue( m_3Dprms.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) ); return true; } @@ -124,6 +126,7 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow() m_3Dprms.SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, m_checkBoxCuThickness->GetValue() ); m_3Dprms.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() ); m_3Dprms.SetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, m_checkBoxBoundingBoxes->GetValue() ); + m_3Dprms.SetFlag( FL_SUBTRACT_MASK_FROM_SILK, m_checkBoxSubtractMaskFromSilk->GetValue() ); // Set 3D shapes visibility m_3Dprms.SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, m_checkBox3DshapesTH->GetValue() ); diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp index 1be7e8a5e3..30f306c08a 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 11 2018) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,251 +12,260 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bSizerUpper; bSizerUpper = new wxBoxSizer( wxHORIZONTAL ); - + wxBoxSizer* bSizeLeft; bSizeLeft = new wxBoxSizer( wxVERTICAL ); - + m_staticText3DRenderOpts = new wxStaticText( this, wxID_ANY, _("Render options:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3DRenderOpts->Wrap( -1 ); m_staticText3DRenderOpts->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - + bSizeLeft->Add( m_staticText3DRenderOpts, 0, wxALL, 5 ); - + wxFlexGridSizer* fgSizerRenderOptions; fgSizerRenderOptions = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizerRenderOptions->SetFlexibleDirection( wxBOTH ); fgSizerRenderOptions->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - + + fgSizerRenderOptions->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 ); - + m_bitmapRealisticMode = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_bitmapRealisticMode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxRealisticMode = new wxCheckBox( this, wxID_ANY, _("Realistic mode"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_checkBoxRealisticMode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerRenderOptions->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapBoardBody = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_bitmapBoardBody, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxBoardBody = new wxCheckBox( this, wxID_ANY, _("Show board body"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_checkBoxBoardBody, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerRenderOptions->Add( 0, 0, 1, wxEXPAND, 5 ); - + m_bitmapCuThickness = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_bitmapCuThickness, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper thickness"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_checkBoxCuThickness, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerRenderOptions->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapBoundingBoxes = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_bitmapBoundingBoxes, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxBoundingBoxes = new wxCheckBox( this, wxID_ANY, _("Show model bounding boxes"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_checkBoxBoundingBoxes, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerRenderOptions->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapAreas = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_bitmapAreas, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxAreas = new wxCheckBox( this, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerRenderOptions->Add( m_checkBoxAreas, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + + + fgSizerRenderOptions->Add( 0, 0, 0, wxALIGN_LEFT|wxALIGN_RIGHT, 10 ); + + m_bitmapSubtractMaskFromSilk = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerRenderOptions->Add( m_bitmapSubtractMaskFromSilk, 0, wxALL, 5 ); + + m_checkBoxSubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerRenderOptions->Add( m_checkBoxSubtractMaskFromSilk, 0, wxALL, 5 ); + wxFlexGridSizer* fgSizer3; fgSizer3 = new wxFlexGridSizer( 0, 2, 0, 0 ); fgSizer3->SetFlexibleDirection( wxBOTH ); fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - + + fgSizerRenderOptions->Add( fgSizer3, 1, wxEXPAND, 5 ); - - + + bSizeLeft->Add( fgSizerRenderOptions, 0, wxEXPAND|wxBOTTOM, 5 ); - - + + bSizeLeft->Add( 0, 10, 0, 0, 5 ); - + m_staticText3DmodelVisibility = new wxStaticText( this, wxID_ANY, _("3D model visibility:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3DmodelVisibility->Wrap( -1 ); m_staticText3DmodelVisibility->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - + bSizeLeft->Add( m_staticText3DmodelVisibility, 0, wxALL, 5 ); - + wxFlexGridSizer* fgSizer3DVisibility; fgSizer3DVisibility = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizer3DVisibility->SetFlexibleDirection( wxBOTH ); fgSizer3DVisibility->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - + + fgSizer3DVisibility->Add( 0, 0, 1, wxRIGHT|wxLEFT, 10 ); - + m_bitmap3DshapesTH = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_bitmap3DshapesTH, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBox3DshapesTH = new wxCheckBox( this, wxID_ANY, _("Show 3D through hole models"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_checkBox3DshapesTH, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizer3DVisibility->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmap3DshapesSMD = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_bitmap3DshapesSMD, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBox3DshapesSMD = new wxCheckBox( this, wxID_ANY, _("Show 3D SMD models"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_checkBox3DshapesSMD, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizer3DVisibility->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmap3DshapesVirtual = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_bitmap3DshapesVirtual, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBox3DshapesVirtual = new wxCheckBox( this, wxID_ANY, _("Show 3D virtual models"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_checkBox3DshapesVirtual, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + bSizeLeft->Add( fgSizer3DVisibility, 0, wxEXPAND, 5 ); - - + + bSizerUpper->Add( bSizeLeft, 1, wxEXPAND, 5 ); - + m_staticlineVertical = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); bSizerUpper->Add( m_staticlineVertical, 0, wxEXPAND | wxALL, 5 ); - + wxBoxSizer* bSizerRight; bSizerRight = new wxBoxSizer( wxHORIZONTAL ); - + wxBoxSizer* bSizeLayer; bSizeLayer = new wxBoxSizer( wxVERTICAL ); - + m_staticTextBoardLayers = new wxStaticText( this, wxID_ANY, _("Board layers:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextBoardLayers->Wrap( -1 ); m_staticTextBoardLayers->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - + bSizeLayer->Add( m_staticTextBoardLayers, 0, wxALL, 5 ); - + wxFlexGridSizer* fgSizerShowBrdLayersOpts; fgSizerShowBrdLayersOpts = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizerShowBrdLayersOpts->SetFlexibleDirection( wxBOTH ); fgSizerShowBrdLayersOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - + + fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapSilkscreen = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_bitmapSilkscreen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxSilkscreen = new wxCheckBox( this, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_checkBoxSilkscreen, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - + + fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapSolderMask = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_bitmapSolderMask, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxSolderMask = new wxCheckBox( this, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_checkBoxSolderMask, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapSolderPaste = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_bitmapSolderPaste, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxSolderpaste = new wxCheckBox( this, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_checkBoxSolderpaste, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapAdhesive = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_bitmapAdhesive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxAdhesive = new wxCheckBox( this, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowBrdLayersOpts->Add( m_checkBoxAdhesive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + bSizeLayer->Add( fgSizerShowBrdLayersOpts, 0, wxEXPAND, 5 ); - - + + bSizeLayer->Add( 0, 10, 0, 0, 5 ); - + m_staticTextUserLayers = new wxStaticText( this, wxID_ANY, _("User layers (not shown in realistic mode):"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUserLayers->Wrap( -1 ); m_staticTextUserLayers->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - + bSizeLayer->Add( m_staticTextUserLayers, 0, wxALL, 5 ); - + wxFlexGridSizer* fgSizerShowUserLayersOpts; fgSizerShowUserLayersOpts = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizerShowUserLayersOpts->SetFlexibleDirection( wxBOTH ); fgSizerShowUserLayersOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - + + fgSizerShowUserLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapComments = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowUserLayersOpts->Add( m_bitmapComments, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comments and drawings layers"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowUserLayersOpts->Add( m_checkBoxComments, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + fgSizerShowUserLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); - + m_bitmapECO = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowUserLayersOpts->Add( m_bitmapECO, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECO layers"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerShowUserLayersOpts->Add( m_checkBoxECO, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - + + bSizeLayer->Add( fgSizerShowUserLayersOpts, 0, wxEXPAND, 5 ); - - + + bSizerRight->Add( bSizeLayer, 1, wxEXPAND, 5 ); - - + + bSizerUpper->Add( bSizerRight, 1, wxEXPAND, 5 ); - - + + bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 ); - + m_staticlineH = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizerMain->Add( m_staticlineH, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - + m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - + bSizerMain->Add( m_sdbSizer, 0, wxALL|wxALIGN_RIGHT, 5 ); - - + + this->SetSizer( bSizerMain ); this->Layout(); - + this->Centre( wxBOTH ); - + // Connect Events m_checkBoxRealisticMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCheckRealisticMode ), NULL, this ); } @@ -265,5 +274,5 @@ DIALOG_3D_VIEW_OPTIONS_BASE::~DIALOG_3D_VIEW_OPTIONS_BASE() { // Disconnect Events m_checkBoxRealisticMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCheckRealisticMode ), NULL, this ); - + } diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp index 6c632fa950..1d3a00da2e 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -53,55 +53,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerMain @@ -116,20 +67,20 @@ bSizerUpper wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizeLeft wxVERTICAL none - + 5 wxALL 0 - + 1 1 1 @@ -184,43 +135,13 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND|wxBOTTOM 0 - + 3 wxBOTH @@ -232,21 +153,21 @@ none 0 0 - + 10 wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -298,43 +219,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -392,54 +283,24 @@ - - - - - - - - OnCheckRealisticMode - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -491,43 +352,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -585,54 +416,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND 1 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -684,43 +484,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -778,54 +548,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -877,43 +616,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -971,54 +680,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1070,43 +748,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1164,44 +812,145 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 10 + wxALIGN_LEFT|wxALIGN_RIGHT + 0 + + 0 + protected + 0 + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_bitmapSubtractMaskFromSilk + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Subtract soldermask from silkscreen + + 0 + + + 0 + + 1 + m_checkBoxSubtractMaskFromSilk + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + 5 wxEXPAND 1 - + 2 wxBOTH @@ -1217,21 +966,21 @@ - + 5 0 - + 10 protected 0 - + 5 wxALL 0 - + 1 1 1 @@ -1286,43 +1035,13 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND 0 - + 3 wxBOTH @@ -1334,21 +1053,21 @@ none 0 0 - + 10 wxRIGHT|wxLEFT 1 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1400,43 +1119,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1494,54 +1183,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1593,43 +1251,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1687,54 +1315,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1786,43 +1383,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1880,48 +1447,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND | wxALL 0 - + 1 1 1 @@ -1973,61 +1509,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND 1 - + bSizerRight wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizeLayer wxVERTICAL none - + 5 wxALL 0 - + 1 1 1 @@ -2082,43 +1588,13 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND 0 - + 3 wxBOTH @@ -2130,21 +1606,21 @@ none 0 0 - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2196,43 +1672,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALIGN_CENTER_VERTICAL|wxALL 0 - + 1 1 1 @@ -2290,54 +1736,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2389,43 +1804,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2483,54 +1868,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2582,43 +1936,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2676,54 +2000,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2775,43 +2068,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2869,56 +2132,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 0 - + 10 protected 0 - + 5 wxALL 0 - + 1 1 1 @@ -2973,43 +2205,13 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND 0 - + 3 wxBOTH @@ -3021,21 +2223,21 @@ none 0 0 - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -3087,43 +2289,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -3181,54 +2353,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 wxRIGHT|wxLEFT 0 - + 0 protected 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -3280,43 +2421,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -3374,37 +2485,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3415,11 +2495,11 @@ - + 5 wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND 0 - + 1 1 1 @@ -3471,43 +2551,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxALL|wxALIGN_RIGHT 0 - + 0 1 0 @@ -3519,14 +2569,6 @@ m_sdbSizer protected - - - - - - - - diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h index cf43681572..d8480b442e 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 11 2018) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_3D_VIEW_OPTION_BASE_H__ -#define __DIALOG_3D_VIEW_OPTION_BASE_H__ +#pragma once #include #include @@ -37,7 +36,7 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM { private: - + protected: wxStaticText* m_staticText3DRenderOpts; wxStaticBitmap* m_bitmapRealisticMode; @@ -50,6 +49,8 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_checkBoxBoundingBoxes; wxStaticBitmap* m_bitmapAreas; wxCheckBox* m_checkBoxAreas; + wxStaticBitmap* m_bitmapSubtractMaskFromSilk; + wxCheckBox* m_checkBoxSubtractMaskFromSilk; wxStaticText* m_staticText3DmodelVisibility; wxStaticBitmap* m_bitmap3DshapesTH; wxCheckBox* m_checkBox3DshapesTH; @@ -76,16 +77,15 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; - + // Virtual event handlers, overide them in your derived class virtual void OnCheckRealisticMode( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 571,372 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 571,372 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_3D_VIEW_OPTIONS_BASE(); - + }; -#endif //__DIALOG_3D_VIEW_OPTION_BASE_H__ diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index 53fe1ce7b3..98b8a33588 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -87,6 +87,7 @@ static const wxChar keyBoardBodyColor_Green[] = wxT( "BoardBodyColor_Green" ); static const wxChar keyBoardBodyColor_Blue[] = wxT( "BoardBodyColor_Blue" ); static const wxChar keyShowRealisticMode[] = wxT( "ShowRealisticMode" ); +static const wxChar keySubtractMaskFromSilk[] = wxT( "SubtractMaskFromSilk" ); static const wxChar keyRenderEngine[] = wxT( "RenderEngine" ); static const wxChar keyRenderMaterial[] = wxT( "Render_Material" ); @@ -756,6 +757,9 @@ void EDA_3D_VIEWER::LoadSettings( wxConfigBase *aCfg ) aCfg->Read( keyShowRealisticMode, &tmp, true ); m_settings.SetFlag( FL_USE_REALISTIC_MODE, tmp ); + aCfg->Read( keySubtractMaskFromSilk, &tmp, false ); + m_settings.SetFlag( FL_SUBTRACT_MASK_FROM_SILK, tmp ); + // OpenGL options aCfg->Read( keyRenderOGL_ShowCopperTck, &tmp, true ); m_settings.SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, tmp ); @@ -879,13 +883,14 @@ void EDA_3D_VIEWER::SaveSettings( wxConfigBase *aCfg ) aCfg->Write( keyBoardBodyColor_Blue, m_settings.m_BoardBodyColor.b ); aCfg->Write( keyShowRealisticMode, m_settings.GetFlag( FL_USE_REALISTIC_MODE ) ); + aCfg->Write( keySubtractMaskFromSilk, m_settings.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) ); aCfg->Write( keyRenderEngine, static_cast( m_settings.RenderEngineGet() ) ); wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings render setting %s", ( m_settings.RenderEngineGet() == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" : "OpenGL" ); - aCfg->Write( keyRenderMaterial, (int)m_settings.MaterialModeGet() ); + aCfg->Write( keyRenderMaterial, (int) m_settings.MaterialModeGet() ); // OpenGL options aCfg->Write( keyRenderOGL_ShowCopperTck,