diff --git a/3d-viewer/3d_draw.cpp b/3d-viewer/3d_draw.cpp index 26a544afc4..ee120e0f4c 100644 --- a/3d-viewer/3d_draw.cpp +++ b/3d-viewer/3d_draw.cpp @@ -867,10 +867,6 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas ) // Draw 3D pads. void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) { - int layer, nlmax; - bool Oncu, Oncmp, Both; - int color; - double scale = g_Parm_3D_Visu.m_BiuTo3Dunits; // Calculate the center of the pad shape. @@ -932,10 +928,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis - nlmax = g_Parm_3D_Visu.m_CopperLayersCount - 1; - Oncu = (m_layerMask & LAYER_BACK) ? true : false; - Oncmp = (m_layerMask & LAYER_FRONT) ? true : false; - Both = Oncu && Oncmp; + int nlmax = g_Parm_3D_Visu.m_CopperLayersCount - 1; // Store here the points to approximate pad shape by segments std::vector polyPadShape; @@ -943,26 +936,18 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) switch( GetShape() ) { case PAD_CIRCLE: - for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) + for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) { if( layer && (layer == nlmax) ) layer = LAYER_N_FRONT; - if( (layer == LAYER_N_FRONT) && !Oncmp ) + if( !IsOnLayer( layer ) ) continue; - if( (layer == LAYER_N_BACK) && !Oncu ) - continue; - - if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both ) - continue; - - color = g_ColorsSettings.GetLayerColor( layer ); - if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false ) continue; - SetGLColor( color ); + SetGLColor( g_ColorsSettings.GetLayerColor( layer ) ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); int ring_radius = (m_Size.x + m_Drill.x) / 4; if( thickness == 0 ) @@ -1022,25 +1007,18 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas ) if( polyPadShape.size() ) { - for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) + for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) { if( layer && (layer == nlmax) ) layer = LAYER_N_FRONT; - if( (layer == LAYER_N_FRONT) && !Oncmp ) - continue; - - if( (layer == LAYER_N_BACK) && !Oncu ) - continue; - - if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both ) + if( !IsOnLayer( layer ) ) continue; if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false ) continue; - color = g_ColorsSettings.GetLayerColor( layer ); - SetGLColor( color ); + SetGLColor( g_ColorsSettings.GetLayerColor( layer ) ); if( thickness == 0 ) glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) ); diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 393b6b539d..6b4d9ec111 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -356,7 +356,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event ) } else { - msg.Printf( _( "Help file %s not found." ), GetChars( wxGetApp().GetHelpFileName() ) ); + msg.Printf( _( "Help file %s could not be found." ), GetChars( wxGetApp().GetHelpFileName() ) ); wxMessageBox( msg ); } diff --git a/common/confirm.cpp b/common/confirm.cpp index 717f267cb0..32eb3f4afe 100644 --- a/common/confirm.cpp +++ b/common/confirm.cpp @@ -58,7 +58,7 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text, int displaytime { wxMessageDialog* dialog; - dialog = new wxMessageDialog( parent, text, _( "Info:" ), + dialog = new wxMessageDialog( parent, text, _( "Info" ), wxOK | wxCENTRE | wxICON_INFORMATION ); dialog->ShowModal(); diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index 4880d75def..b20c4de2a2 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -27,6 +27,7 @@ #include #include +#include #include @@ -148,6 +149,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa MODULE* module = NULL; D_PAD* pad = NULL; bool pad_through = false; + SEGVIA* via = NULL; MARKER_PCB* marker = NULL; #if 0 // debugging @@ -249,7 +251,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa break; - case PCB_VIA_T: + case PCB_VIA_T: // vias are on many layers, so layer test is specific + via = (SEGVIA*) item; break; case PCB_TRACE_T: @@ -351,7 +354,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa // Modules and their subcomponents: text and pads are not sensitive to the layer // visibility controls. They all have their own separate visibility controls - if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() ) + // for vias, GetLayer() has no meaning, but IsOnLayer() works fine + if( via || module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() ) { if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() ) { @@ -378,7 +382,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa // Modules and their subcomponents: text and pads are not sensitive to the layer // visibility controls. They all have their own separate visibility controls - if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() ) + if( via || module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() ) { if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() ) {