Commit 9c43d6f2 authored by jean-pierre charras's avatar jean-pierre charras

Very minor fixes: 3D viewer: remove artifacts with NPTH pads having the save...

Very minor fixes: 3D viewer: remove artifacts with NPTH pads having the save size as their hole. Kicad: remove duplicate submenu in menubar. remove a minor coverity warning
parent 0e03fbff
...@@ -692,11 +692,13 @@ void EDA_3D_CANVAS::BuildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList, ...@@ -692,11 +692,13 @@ void EDA_3D_CANVAS::BuildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList,
// draw pads // draw pads
for( MODULE* module = pcb->m_Modules; module; module = module->Next() ) for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
{ {
// Note: NPTH pads are not drawn on copper layers when the pad
// has same shape as its hole
module->TransformPadsShapesWithClearanceToPolygon( layer, module->TransformPadsShapesWithClearanceToPolygon( layer,
bufferPolys, bufferPolys,
0, 0,
segcountforcircle, segcountforcircle,
correctionFactor ); correctionFactor, true );
// Micro-wave modules may have items on copper layers // Micro-wave modules may have items on copper layers
module->TransformGraphicShapesWithClearanceToPolygonSet( layer, module->TransformGraphicShapesWithClearanceToPolygonSet( layer,
......
...@@ -349,9 +349,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() ...@@ -349,9 +349,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
Pgm().AddMenuLanguageList( preferencesMenu ); Pgm().AddMenuLanguageList( preferencesMenu );
// Hotkey submenu
AddHotkeyConfigMenu( preferencesMenu );
// Menu Tools: // Menu Tools:
wxMenu* toolsMenu = new wxMenu; wxMenu* toolsMenu = new wxMenu;
......
...@@ -131,7 +131,8 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer, ...@@ -131,7 +131,8 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer,
CPOLYGONS_LIST& aCornerBuffer, CPOLYGONS_LIST& aCornerBuffer,
int aInflateValue, int aInflateValue,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
double aCorrectionFactor ) double aCorrectionFactor,
bool aSkipNPTHPadsWihNoCopper )
{ {
D_PAD* pad = Pads(); D_PAD* pad = Pads();
...@@ -141,6 +142,29 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer, ...@@ -141,6 +142,29 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer,
if( !pad->IsOnLayer(aLayer) ) if( !pad->IsOnLayer(aLayer) )
continue; continue;
// NPTH pads are not drawn on layers if the shape size and pos is the same
// as their hole:
if( aSkipNPTHPadsWihNoCopper && pad->GetAttribute() == PAD_HOLE_NOT_PLATED )
{
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
{
switch( pad->GetShape() )
{
case PAD_CIRCLE:
if( pad->GetDrillShape() == PAD_DRILL_CIRCLE )
continue;
break;
case PAD_OVAL:
if( pad->GetDrillShape() != PAD_DRILL_CIRCLE )
continue;
break;
default:
break;
}
}
}
switch( aLayer ) switch( aLayer )
{ {
......
...@@ -58,7 +58,7 @@ MODULE::MODULE( BOARD* parent ) : ...@@ -58,7 +58,7 @@ MODULE::MODULE( BOARD* parent ) :
m_Layer = F_Cu; m_Layer = F_Cu;
m_Orient = 0; m_Orient = 0;
m_ModuleStatus = MODULE_PADS_LOCKED; m_ModuleStatus = MODULE_PADS_LOCKED;
flag = 0; m_arflag = 0;
m_CntRot90 = m_CntRot180 = 0; m_CntRot90 = m_CntRot180 = 0;
m_Surface = 0.0; m_Surface = 0.0;
m_Link = 0; m_Link = 0;
...@@ -157,6 +157,8 @@ MODULE::MODULE( const MODULE& aModule ) : ...@@ -157,6 +157,8 @@ MODULE::MODULE( const MODULE& aModule ) :
m_Doc = aModule.m_Doc; m_Doc = aModule.m_Doc;
m_KeyWord = aModule.m_KeyWord; m_KeyWord = aModule.m_KeyWord;
m_arflag = 0;
// Ensure auxiliary data is up to date // Ensure auxiliary data is up to date
CalculateBoundingBox(); CalculateBoundingBox();
......
...@@ -199,9 +199,9 @@ public: ...@@ -199,9 +199,9 @@ public:
int GetAttributes() const { return m_Attributs; } int GetAttributes() const { return m_Attributs; }
void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; } void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
void SetFlag( int aFlag ) { flag = aFlag; } void SetFlag( int aFlag ) { m_arflag = aFlag; }
void IncrementFlag() { flag += 1; } void IncrementFlag() { m_arflag += 1; }
int GetFlag() const { return flag; } int GetFlag() const { return m_arflag; }
void Move( const wxPoint& aMoveVector ); void Move( const wxPoint& aMoveVector );
...@@ -328,12 +328,19 @@ public: ...@@ -328,12 +328,19 @@ public:
* if aCorrectionFactor = 1.0, the polygon is inside the circle * if aCorrectionFactor = 1.0, the polygon is inside the circle
* the radius of circle approximated by segments is * the radius of circle approximated by segments is
* initial radius * aCorrectionFactor * initial radius * aCorrectionFactor
* @param aSkipNPTHPadsWihNoCopper = if true, do not add a NPTH pad shape,
* if the shape has same size and position as the hole. Usually, these
* pads are not drawn on copper layers, because there is actually no copper
* Due to diff between layers and holes, these pads must be skipped to be sure
* there is no copper left on the board (for instance when creating Gerber Files or 3D shapes)
* default = false
*/ */
void TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer, void TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer,
CPOLYGONS_LIST& aCornerBuffer, CPOLYGONS_LIST& aCornerBuffer,
int aInflateValue, int aInflateValue,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
double aCorrectionFactor ); double aCorrectionFactor,
bool aSkipNPTHPadsWihNoCopper = false );
/** /**
* function TransformGraphicShapesWithClearanceToPolygonSet * function TransformGraphicShapesWithClearanceToPolygonSet
...@@ -645,7 +652,7 @@ private: ...@@ -645,7 +652,7 @@ private:
wxString m_Path; wxString m_Path;
ZoneConnection m_ZoneConnection; ZoneConnection m_ZoneConnection;
time_t m_LastEditTime; time_t m_LastEditTime;
int flag; ///< Use to trace ratsnest and auto routing. int m_arflag; ///< Use to trace ratsnest and auto routing.
double m_Surface; ///< Bounding box area double m_Surface; ///< Bounding box area
time_t m_Link; ///< Temporary logical link used in edition time_t m_Link; ///< Temporary logical link used in edition
int m_CntRot90; ///< Horizontal automatic placement cost ( 0..10 ). int m_CntRot90; ///< Horizontal automatic placement cost ( 0..10 ).
......
...@@ -93,7 +93,7 @@ static EDA_HOTKEY HkSwitch2NextCopperLayer( _HKI( "Switch to Next Layer" ), ...@@ -93,7 +93,7 @@ static EDA_HOTKEY HkSwitch2NextCopperLayer( _HKI( "Switch to Next Layer" ),
static EDA_HOTKEY HkSwitch2PreviousCopperLayer( _HKI( "Switch to Previous Layer" ), static EDA_HOTKEY HkSwitch2PreviousCopperLayer( _HKI( "Switch to Previous Layer" ),
HK_SWITCH_LAYER_TO_PREVIOUS, '-' ); HK_SWITCH_LAYER_TO_PREVIOUS, '-' );
static EDA_HOTKEY HkSaveModule( _HKI( "Save Module" ), HK_SAVE_MODULE, 'S' + GR_KB_CTRL ); static EDA_HOTKEY HkSaveModule( _HKI( "Save Footprint" ), HK_SAVE_MODULE, 'S' + GR_KB_CTRL );
static EDA_HOTKEY HkSavefile( _HKI( "Save Board" ), HK_SAVE_BOARD, 'S' + GR_KB_CTRL ); static EDA_HOTKEY HkSavefile( _HKI( "Save Board" ), HK_SAVE_BOARD, 'S' + GR_KB_CTRL );
static EDA_HOTKEY HkSavefileAs( _HKI( "Save Board As" ), HK_SAVE_BOARD_AS, 'S' + GR_KB_CTRL + GR_KB_SHIFT ); static EDA_HOTKEY HkSavefileAs( _HKI( "Save Board As" ), HK_SAVE_BOARD_AS, 'S' + GR_KB_CTRL + GR_KB_SHIFT );
static EDA_HOTKEY HkLoadfile( _HKI( "Load Board" ), HK_LOAD_BOARD, 'L' + GR_KB_CTRL ); static EDA_HOTKEY HkLoadfile( _HKI( "Load Board" ), HK_LOAD_BOARD, 'L' + GR_KB_CTRL );
......
...@@ -2125,6 +2125,8 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM() ...@@ -2125,6 +2125,8 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()
} }
} }
// If we are here, there is an error.
delete net;
THROW_IO_ERROR( "Missing '$EndEQUIPOT'" ); THROW_IO_ERROR( "Missing '$EndEQUIPOT'" );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment