Pcbnew: rename ZONE* m_SolderMask to m_SolderMaskBridges
(It is a container to build bridges on solder mask layers by DRC, not real zone) Disable also this special zone selection by adding it in PCB_SELECTION_TOOL::itemPassesFilter Do not display the outlines of this very special zone used by DRC to show layer mask bridges created by DRC to show these bridges. From Master branch Fixes #15847 https://gitlab.com/kicad/code/kicad/-/issues/15847
This commit is contained in:
parent
b92861c7e3
commit
00bf2ca36f
|
@ -97,15 +97,18 @@ BOARD::BOARD() :
|
|||
m_layers[layer].m_type = LT_UNDEFINED;
|
||||
}
|
||||
|
||||
m_SolderMask = new ZONE( this );
|
||||
m_SolderMask->SetLayerSet( LSET().set( F_Mask ).set( B_Mask ) );
|
||||
// Creates a zone to show sloder mask bridges created by a min web value
|
||||
// it it just to show them
|
||||
m_SolderMaskBridges = new ZONE( this );
|
||||
m_SolderMaskBridges->SetHatchStyle( ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER );
|
||||
m_SolderMaskBridges->SetLayerSet( LSET().set( F_Mask ).set( B_Mask ) );
|
||||
int infinity = ( std::numeric_limits<int>::max() / 2 ) - pcbIUScale.mmToIU( 1 );
|
||||
m_SolderMask->Outline()->NewOutline();
|
||||
m_SolderMask->Outline()->Append( VECTOR2I( -infinity, -infinity ) );
|
||||
m_SolderMask->Outline()->Append( VECTOR2I( -infinity, +infinity ) );
|
||||
m_SolderMask->Outline()->Append( VECTOR2I( +infinity, +infinity ) );
|
||||
m_SolderMask->Outline()->Append( VECTOR2I( +infinity, -infinity ) );
|
||||
m_SolderMask->SetMinThickness( 0 );
|
||||
m_SolderMaskBridges->Outline()->NewOutline();
|
||||
m_SolderMaskBridges->Outline()->Append( VECTOR2I( -infinity, -infinity ) );
|
||||
m_SolderMaskBridges->Outline()->Append( VECTOR2I( -infinity, +infinity ) );
|
||||
m_SolderMaskBridges->Outline()->Append( VECTOR2I( +infinity, +infinity ) );
|
||||
m_SolderMaskBridges->Outline()->Append( VECTOR2I( +infinity, -infinity ) );
|
||||
m_SolderMaskBridges->SetMinThickness( 0 );
|
||||
|
||||
BOARD_DESIGN_SETTINGS& bds = GetDesignSettings();
|
||||
|
||||
|
@ -141,7 +144,7 @@ BOARD::~BOARD()
|
|||
|
||||
m_zones.clear();
|
||||
|
||||
delete m_SolderMask;
|
||||
delete m_SolderMaskBridges;
|
||||
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
delete footprint;
|
||||
|
|
|
@ -1193,7 +1193,7 @@ public:
|
|||
std::vector<ZONE*> m_DRCCopperZones;
|
||||
int m_DRCMaxClearance;
|
||||
int m_DRCMaxPhysicalClearance;
|
||||
ZONE* m_SolderMask;
|
||||
ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
|
||||
std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
|
||||
|
||||
private:
|
||||
|
|
|
@ -294,6 +294,7 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow()
|
|||
case ZONE_BORDER_DISPLAY_STYLE::NO_HATCH: m_OutlineDisplayCtrl->SetSelection( 0 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE: m_OutlineDisplayCtrl->SetSelection( 1 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL: m_OutlineDisplayCtrl->SetSelection( 2 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER: break; // Not used for standard zones
|
||||
}
|
||||
|
||||
m_outlineHatchPitch.SetValue( m_settings.m_BorderHatchPitch );
|
||||
|
|
|
@ -178,6 +178,7 @@ bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow()
|
|||
case ZONE_BORDER_DISPLAY_STYLE::NO_HATCH: m_OutlineDisplayCtrl->SetSelection( 0 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE: m_OutlineDisplayCtrl->SetSelection( 1 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL: m_OutlineDisplayCtrl->SetSelection( 2 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER: break; // Not used for standard zones
|
||||
}
|
||||
|
||||
m_outlineHatchPitch.SetValue( m_settings.m_BorderHatchPitch );
|
||||
|
|
|
@ -156,6 +156,7 @@ bool DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow()
|
|||
|
||||
switch( m_zonesettings.m_ZoneBorderDisplayStyle )
|
||||
{
|
||||
case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER: // Not used for standard zones. Here use NO_HATCH
|
||||
case ZONE_BORDER_DISPLAY_STYLE::NO_HATCH: m_OutlineDisplayCtrl->SetSelection( 0 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE: m_OutlineDisplayCtrl->SetSelection( 1 ); break;
|
||||
case ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL: m_OutlineDisplayCtrl->SetSelection( 2 ); break;
|
||||
|
|
|
@ -112,7 +112,7 @@ private:
|
|||
|
||||
void DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees( BOARD_ITEM* aItem )
|
||||
{
|
||||
ZONE* solderMask = m_board->m_SolderMask;
|
||||
ZONE* solderMask = m_board->m_SolderMaskBridges;
|
||||
|
||||
if( aItem->Type() == PCB_ZONE_T || aItem->Type() == PCB_FP_ZONE_T )
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees( BOARD_ITEM* aItem )
|
|||
|
||||
void DRC_TEST_PROVIDER_SOLDER_MASK::buildRTrees()
|
||||
{
|
||||
ZONE* solderMask = m_board->m_SolderMask;
|
||||
ZONE* solderMask = m_board->m_SolderMaskBridges;
|
||||
LSET layers = { 4, F_Mask, B_Mask, F_Cu, B_Cu };
|
||||
|
||||
const size_t progressDelta = 500;
|
||||
|
|
|
@ -506,8 +506,8 @@ void PCB_BASE_FRAME::HideSolderMask()
|
|||
{
|
||||
KIGFX::PCB_VIEW* view = GetCanvas()->GetView();
|
||||
|
||||
if( view && GetBoard()->m_SolderMask && view->HasItem( GetBoard()->m_SolderMask ) )
|
||||
view->Remove( GetBoard()->m_SolderMask );
|
||||
if( view && GetBoard()->m_SolderMaskBridges && view->HasItem( GetBoard()->m_SolderMaskBridges ) )
|
||||
view->Remove( GetBoard()->m_SolderMaskBridges );
|
||||
}
|
||||
|
||||
|
||||
|
@ -515,12 +515,12 @@ void PCB_BASE_FRAME::ShowSolderMask()
|
|||
{
|
||||
KIGFX::PCB_VIEW* view = GetCanvas()->GetView();
|
||||
|
||||
if( view && GetBoard()->m_SolderMask )
|
||||
if( view && GetBoard()->m_SolderMaskBridges )
|
||||
{
|
||||
if( view->HasItem( GetBoard()->m_SolderMask ) )
|
||||
view->Remove( GetBoard()->m_SolderMask );
|
||||
if( view->HasItem( GetBoard()->m_SolderMaskBridges ) )
|
||||
view->Remove( GetBoard()->m_SolderMaskBridges );
|
||||
|
||||
view->Add( GetBoard()->m_SolderMask );
|
||||
view->Add( GetBoard()->m_SolderMaskBridges );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2446,8 +2446,9 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer )
|
|||
if( !IsZoneFillLayer( aLayer ) )
|
||||
{
|
||||
const SHAPE_POLY_SET* outline = aZone->Outline();
|
||||
bool allowDrawOutline = aZone->GetHatchStyle() != ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER;
|
||||
|
||||
if( !m_pcbSettings.m_isPrinting && outline && outline->OutlineCount() > 0 )
|
||||
if( allowDrawOutline && !m_pcbSettings.m_isPrinting && outline && outline->OutlineCount() > 0 )
|
||||
{
|
||||
m_gal->SetStrokeColor( color.a > 0.0 ? color.WithAlpha( 1.0 ) : color );
|
||||
m_gal->SetIsFill( false );
|
||||
|
|
|
@ -2232,6 +2232,12 @@ bool PCB_SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem, bool aMultiSelect
|
|||
return false;
|
||||
}
|
||||
|
||||
// m_SolderMaskBridges zone is a special zone, only used to showsolder mask briges
|
||||
// after running DRC. it is not really a board item.
|
||||
// Never select it or delete by a Commit.
|
||||
if( zone == m_frame->GetBoard()->m_SolderMaskBridges )
|
||||
return false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ enum class ZONE_BORDER_DISPLAY_STYLE
|
|||
{
|
||||
NO_HATCH,
|
||||
DIAGONAL_FULL,
|
||||
DIAGONAL_EDGE
|
||||
DIAGONAL_EDGE,
|
||||
INVISIBLE_BORDER // Disable outline drawing for very special cases
|
||||
};
|
||||
|
||||
/// Whether or not to remove isolated islands from a zone
|
||||
|
|
Loading…
Reference in New Issue