From 6e2914b9908de993799ac447e217354925fd658f Mon Sep 17 00:00:00 2001 From: Jeff Young <jeff@rokeby.ie> Date: Tue, 25 Mar 2025 12:02:25 +0000 Subject: [PATCH] Update terminology. --- include/board_item.h | 7 +- .../dialogs/dialog_rule_area_properties.cpp | 4 +- pcbnew/drc/drc_engine.cpp | 4 +- pcbnew/drc/drc_test_provider_disallow.cpp | 2 +- .../drc/drc_test_provider_library_parity.cpp | 4 +- pcbnew/pcb_io/altium/altium_pcb.cpp | 6 +- .../cadstar/cadstar_pcb_archive_loader.cpp | 4 +- pcbnew/pcb_io/eagle/pcb_io_eagle.cpp | 8 +-- .../pcb_io/easyeda/pcb_io_easyeda_parser.cpp | 2 +- .../easyedapro/pcb_io_easyedapro_parser.cpp | 8 +-- pcbnew/pcb_io/fabmaster/import_fabmaster.cpp | 2 +- .../kicad_legacy/pcb_io_kicad_legacy.cpp | 2 +- .../pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp | 2 +- .../kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp | 2 +- pcbnew/pcb_io/pcad/pcad_polygon.cpp | 4 +- pcbnew/tools/multichannel_tool.cpp | 2 +- pcbnew/tools/pcb_selection_tool.cpp | 66 +++++++++---------- pcbnew/zone.cpp | 20 +++--- pcbnew/zone.h | 33 +++++----- pcbnew/zone_filler.cpp | 18 ++--- pcbnew/zone_settings.cpp | 15 ++--- pcbnew/zone_settings.h | 30 ++++----- pcbnew/zones_functions_for_undo_redo.cpp | 2 +- qa/pcbnew_utils/board_test_utils.cpp | 2 +- 24 files changed, 125 insertions(+), 124 deletions(-) diff --git a/include/board_item.h b/include/board_item.h index 7385fe1ebc..11f3a31520 100644 --- a/include/board_item.h +++ b/include/board_item.h @@ -79,8 +79,11 @@ class BOARD_ITEM : public EDA_ITEM { public: BOARD_ITEM( BOARD_ITEM* aParent, KICAD_T idtype, PCB_LAYER_ID aLayer = F_Cu ) : - EDA_ITEM( aParent, idtype, false, true ), m_layer( aLayer ), m_isKnockout( false ), - m_isLocked( false ), m_group( nullptr ) + EDA_ITEM( aParent, idtype, false, true ), + m_layer( aLayer ), + m_isKnockout( false ), + m_isLocked( false ), + m_group( nullptr ) { } diff --git a/pcbnew/dialogs/dialog_rule_area_properties.cpp b/pcbnew/dialogs/dialog_rule_area_properties.cpp index 51694451ab..464ec2637a 100644 --- a/pcbnew/dialogs/dialog_rule_area_properties.cpp +++ b/pcbnew/dialogs/dialog_rule_area_properties.cpp @@ -232,7 +232,7 @@ bool DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow() m_keepoutProperties->m_cbViasCtrl->SetValue( m_zonesettings.GetDoNotAllowVias() ); m_keepoutProperties->m_cbPadsCtrl->SetValue( m_zonesettings.GetDoNotAllowPads() ); m_keepoutProperties->m_cbFootprintsCtrl->SetValue( m_zonesettings.GetDoNotAllowFootprints() ); - m_keepoutProperties->m_cbCopperPourCtrl->SetValue( m_zonesettings.GetDoNotAllowCopperPour() ); + m_keepoutProperties->m_cbCopperPourCtrl->SetValue( m_zonesettings.GetDoNotAllowZoneFills() ); // Init placement parameters: m_placementProperties->m_DisabedlRb->SetValue( true ); @@ -384,7 +384,7 @@ bool DIALOG_RULE_AREA_PROPERTIES::TransferDataFromWindow() m_zonesettings.SetIsRuleArea( true ); m_zonesettings.SetDoNotAllowTracks( m_keepoutProperties->m_cbTracksCtrl->GetValue() ); m_zonesettings.SetDoNotAllowVias( m_keepoutProperties->m_cbViasCtrl->GetValue() ); - m_zonesettings.SetDoNotAllowCopperPour( m_keepoutProperties->m_cbCopperPourCtrl->GetValue() ); + m_zonesettings.SetDoNotAllowZoneFills( m_keepoutProperties->m_cbCopperPourCtrl->GetValue() ); m_zonesettings.SetDoNotAllowPads( m_keepoutProperties->m_cbPadsCtrl->GetValue() ); m_zonesettings.SetDoNotAllowFootprints( m_keepoutProperties->m_cbFootprintsCtrl->GetValue() ); diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index d060529b21..3c278f3824 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -126,7 +126,7 @@ static bool isKeepoutZone( const BOARD_ITEM* aItem, bool aCheckFlags ) if( !zone->GetDoNotAllowTracks() && !zone->GetDoNotAllowVias() && !zone->GetDoNotAllowPads() - && !zone->GetDoNotAllowCopperPour() + && !zone->GetDoNotAllowZoneFills() && !zone->GetDoNotAllowFootprints() ) { return false; @@ -479,7 +479,7 @@ void DRC_ENGINE::loadImplicitRules() if( zone->GetDoNotAllowPads() ) disallowFlags |= DRC_DISALLOW_PADS; - if( zone->GetDoNotAllowCopperPour() ) + if( zone->GetDoNotAllowZoneFills() ) disallowFlags |= DRC_DISALLOW_ZONES; if( zone->GetDoNotAllowFootprints() ) diff --git a/pcbnew/drc/drc_test_provider_disallow.cpp b/pcbnew/drc/drc_test_provider_disallow.cpp index 1006c5e9ae..d00367be91 100644 --- a/pcbnew/drc/drc_test_provider_disallow.cpp +++ b/pcbnew/drc/drc_test_provider_disallow.cpp @@ -92,7 +92,7 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run() { ZONE* zone = static_cast<ZONE*>( item ); - if( zone->GetIsRuleArea() && zone->GetDoNotAllowCopperPour() ) + if( zone->GetIsRuleArea() && zone->GetDoNotAllowZoneFills() ) { antiCopperKeepouts.push_back( zone ); } diff --git a/pcbnew/drc/drc_test_provider_library_parity.cpp b/pcbnew/drc/drc_test_provider_library_parity.cpp index 9ebb54aac5..339da83aba 100644 --- a/pcbnew/drc/drc_test_provider_library_parity.cpp +++ b/pcbnew/drc/drc_test_provider_library_parity.cpp @@ -498,8 +498,8 @@ bool zoneNeedsUpdate( const ZONE* a, const ZONE* b, REPORTER* aReporter ) TEST( a->GetIsRuleArea(), b->GetIsRuleArea(), wxString::Format( _( "%s keep-out property differs." ), ITEM_DESC( a ) ) ); - TEST( a->GetDoNotAllowCopperPour(), b->GetDoNotAllowCopperPour(), - wxString::Format( _( "%s keep out copper fill setting differs." ), ITEM_DESC( a ) ) ); + TEST( a->GetDoNotAllowZoneFills(), b->GetDoNotAllowZoneFills(), + wxString::Format( _( "%s keep out zone fill setting differs." ), ITEM_DESC( a ) ) ); TEST( a->GetDoNotAllowFootprints(), b->GetDoNotAllowFootprints(), wxString::Format( _( "%s keep out footprints setting differs." ), ITEM_DESC( a ) ) ); TEST( a->GetDoNotAllowPads(), b->GetDoNotAllowPads(), diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 11625c48e6..03185f37fa 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -2395,7 +2395,7 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem( const AREGION6& aElem ) } else if( aElem.kind == ALTIUM_REGION_KIND::POLYGON_CUTOUT ) { - zone->SetDoNotAllowCopperPour( true ); + zone->SetDoNotAllowZoneFills( true ); zone->SetDoNotAllowVias( false ); zone->SetDoNotAllowTracks( false ); zone->SetDoNotAllowPads( false ); @@ -2502,7 +2502,7 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem( FOOTPRINT* aFoot } else if( aElem.kind == ALTIUM_REGION_KIND::POLYGON_CUTOUT ) { - zone->SetDoNotAllowCopperPour( true ); + zone->SetDoNotAllowZoneFills( true ); zone->SetDoNotAllowVias( false ); zone->SetDoNotAllowTracks( false ); zone->SetDoNotAllowPads( false ); @@ -4816,7 +4816,7 @@ void ALTIUM_PCB::HelperSetZoneKeepoutRestrictions( ZONE& aZone, const uint8_t aK aZone.SetDoNotAllowVias( keepoutRestrictionVia ); aZone.SetDoNotAllowTracks( keepoutRestrictionTrack ); - aZone.SetDoNotAllowCopperPour( keepoutRestrictionCopper ); + aZone.SetDoNotAllowZoneFills( keepoutRestrictionCopper ); aZone.SetDoNotAllowPads( keepoutRestrictionSMDPad && keepoutRestrictionTHPad ); aZone.SetDoNotAllowFootprints( false ); } diff --git a/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp index 05dbb22c60..fe049fb001 100644 --- a/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp @@ -979,7 +979,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas( const SYMDEF_PCB& aComponent, //There is no distinction between tracks and copper pours in CADSTAR Keepout zones zone->SetDoNotAllowTracks( area.NoTracks ); - zone->SetDoNotAllowCopperPour( area.NoTracks ); + zone->SetDoNotAllowZoneFills( area.NoTracks ); zone->SetDoNotAllowVias( area.NoVias ); } @@ -1715,7 +1715,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadAreas() zone->SetDoNotAllowFootprints( area.Keepout ); zone->SetDoNotAllowTracks( area.NoTracks ); - zone->SetDoNotAllowCopperPour( area.NoTracks ); + zone->SetDoNotAllowZoneFills( area.NoTracks ); zone->SetDoNotAllowVias( area.NoVias ); diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp index b30843bbe1..52a5411e84 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp @@ -126,7 +126,7 @@ void PCB_IO_EAGLE::setKeepoutSettingsToZone( ZONE* aZone, int aLayer ) const aZone->SetIsRuleArea( true ); aZone->SetDoNotAllowVias( true ); aZone->SetDoNotAllowTracks( true ); - aZone->SetDoNotAllowCopperPour( true ); + aZone->SetDoNotAllowZoneFills( true ); aZone->SetDoNotAllowPads( true ); aZone->SetDoNotAllowFootprints( false ); @@ -140,7 +140,7 @@ void PCB_IO_EAGLE::setKeepoutSettingsToZone( ZONE* aZone, int aLayer ) const aZone->SetIsRuleArea( true ); aZone->SetDoNotAllowVias( true ); aZone->SetDoNotAllowTracks( false ); - aZone->SetDoNotAllowCopperPour( false ); + aZone->SetDoNotAllowZoneFills( false ); aZone->SetDoNotAllowPads( false ); aZone->SetDoNotAllowFootprints( false ); @@ -151,7 +151,7 @@ void PCB_IO_EAGLE::setKeepoutSettingsToZone( ZONE* aZone, int aLayer ) const aZone->SetIsRuleArea( true ); aZone->SetDoNotAllowVias( false ); aZone->SetDoNotAllowTracks( false ); - aZone->SetDoNotAllowCopperPour( true ); + aZone->SetDoNotAllowZoneFills( true ); aZone->SetDoNotAllowPads( false ); aZone->SetDoNotAllowFootprints( false ); @@ -1614,7 +1614,7 @@ ZONE* PCB_IO_EAGLE::loadPolygon( wxXmlNode* aPolyNode ) zone->SetDoNotAllowTracks( false ); zone->SetDoNotAllowPads( false ); zone->SetDoNotAllowFootprints( false ); - zone->SetDoNotAllowCopperPour( true ); + zone->SetDoNotAllowZoneFills( true ); zone->SetHatchStyle( ZONE_BORDER_DISPLAY_STYLE::NO_HATCH ); } else if( p.pour == EPOLYGON::EHATCH ) diff --git a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_parser.cpp b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_parser.cpp index 6a02642b6a..7c7c1fffb6 100644 --- a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_parser.cpp +++ b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_parser.cpp @@ -496,7 +496,7 @@ void PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer( if( arr[4].Lower() == wxS( "cutout" ) ) { zone->SetIsRuleArea( true ); - zone->SetDoNotAllowCopperPour( true ); + zone->SetDoNotAllowZoneFills( true ); zone->SetDoNotAllowTracks( false ); zone->SetDoNotAllowVias( false ); zone->SetDoNotAllowPads( false ); diff --git a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp index 6b94b4d2da..67c132191d 100644 --- a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp +++ b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp @@ -888,8 +888,8 @@ FOOTPRINT* PCB_IO_EASYEDAPRO_PARSER::ParseFootprint( const nlohmann::json& zone->SetIsRuleArea( true ); zone->SetDoNotAllowFootprints( !!flags.count( 2 ) ); - zone->SetDoNotAllowCopperPour( !!flags.count( 7 ) || !!flags.count( 6 ) - || !!flags.count( 8 ) ); + zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) + || !!flags.count( 8 ) ); zone->SetDoNotAllowPads( !!flags.count( 7 ) ); zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) ); zone->SetDoNotAllowVias( !!flags.count( 7 ) ); @@ -1282,8 +1282,8 @@ void PCB_IO_EASYEDAPRO_PARSER::ParseBoard( zone->SetIsRuleArea( true ); zone->SetDoNotAllowFootprints( !!flags.count( 2 ) ); - zone->SetDoNotAllowCopperPour( !!flags.count( 7 ) || !!flags.count( 6 ) - || !!flags.count( 8 ) ); + zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) + || !!flags.count( 8 ) ); zone->SetDoNotAllowPads( !!flags.count( 7 ) ); zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) ); zone->SetDoNotAllowVias( !!flags.count( 7 ) ); diff --git a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp index c44a5b8803..16faaaf61c 100644 --- a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp +++ b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp @@ -3392,7 +3392,7 @@ bool FABMASTER::loadZone( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRACE> zone->SetDoNotAllowVias( false ); zone->SetDoNotAllowPads( false ); zone->SetDoNotAllowFootprints( false ); - zone->SetDoNotAllowCopperPour( false ); + zone->SetDoNotAllowZoneFills( false ); if( aLine->lclass == "ROUTE KEEPOUT") { diff --git a/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp b/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp index 0d27c1686f..ee20cc7954 100644 --- a/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp +++ b/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp @@ -2513,7 +2513,7 @@ void PCB_IO_KICAD_LEGACY::loadZONE_CONTAINER() else if( !strcmp( token, "copperpour" ) ) { token = strtok_r( nullptr, delims, (char**) &data ); - zc->SetDoNotAllowCopperPour( token && *token == 'N' ); + zc->SetDoNotAllowZoneFills( token && *token == 'N' ); } token = strtok_r( nullptr, delims, (char**) &data ); diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp index 403512fe44..4db217b50d 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp @@ -2608,7 +2608,7 @@ void PCB_IO_KICAD_SEXPR::format( const ZONE* aZone ) const aZone->GetDoNotAllowTracks() ? "not_allowed" : "allowed", aZone->GetDoNotAllowVias() ? "not_allowed" : "allowed", aZone->GetDoNotAllowPads() ? "not_allowed" : "allowed", - aZone->GetDoNotAllowCopperPour() ? "not_allowed" : "allowed", + aZone->GetDoNotAllowZoneFills() ? "not_allowed" : "allowed", aZone->GetDoNotAllowFootprints() ? "not_allowed" : "allowed" ); // Multichannel settings diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp index 4983777ed2..4b847efa47 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp @@ -7269,7 +7269,7 @@ ZONE* PCB_IO_KICAD_SEXPR_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent ) if( token != T_allowed && token != T_not_allowed ) Expecting( "allowed or not_allowed" ); - zone->SetDoNotAllowCopperPour( token == T_not_allowed ); + zone->SetDoNotAllowZoneFills( token == T_not_allowed ); break; case T_pads: diff --git a/pcbnew/pcb_io/pcad/pcad_polygon.cpp b/pcbnew/pcb_io/pcad/pcad_polygon.cpp index 4aa385a1d2..df72b2967e 100644 --- a/pcbnew/pcb_io/pcad/pcad_polygon.cpp +++ b/pcbnew/pcb_io/pcad/pcad_polygon.cpp @@ -205,14 +205,14 @@ void PCAD_POLYGON::AddToBoard( FOOTPRINT* aFootprint ) zone->SetDoNotAllowTracks( true ); zone->SetDoNotAllowVias( true ); zone->SetDoNotAllowPads( true ); - zone->SetDoNotAllowCopperPour( true ); + zone->SetDoNotAllowZoneFills( true ); zone->SetDoNotAllowFootprints( false ); } else if( m_ObjType == wxT( 'C' ) ) { // convert cutouts to keepouts because standalone cutouts are not supported in KiCad zone->SetIsRuleArea( true ); - zone->SetDoNotAllowCopperPour( true ); + zone->SetDoNotAllowZoneFills( true ); zone->SetDoNotAllowTracks( false ); zone->SetDoNotAllowVias( false ); zone->SetDoNotAllowPads( false ); diff --git a/pcbnew/tools/multichannel_tool.cpp b/pcbnew/tools/multichannel_tool.cpp index d955a21373..f88b405037 100644 --- a/pcbnew/tools/multichannel_tool.cpp +++ b/pcbnew/tools/multichannel_tool.cpp @@ -1136,7 +1136,7 @@ int MULTICHANNEL_TOOL::AutogenerateRuleAreas( const TOOL_EVENT& aEvent ) newZone->SetIsRuleArea( true ); newZone->SetLayerSet( LSET::AllCuMask() ); newZone->SetRuleAreaPlacementEnabled( true ); - newZone->SetDoNotAllowCopperPour( false ); + newZone->SetDoNotAllowZoneFills( false ); newZone->SetDoNotAllowVias( false ); newZone->SetDoNotAllowTracks( false ); newZone->SetDoNotAllowPads( false ); diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index e11d7d2849..69bb4454bd 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -3386,21 +3386,19 @@ void PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates( GENERAL_COLLECTOR& aC wxCHECK( !enabledLayerStack.empty(), /* void */ ); - auto isCopperPourKeepoutZone = []( const BOARD_ITEM* aItem ) -> bool - { - if( aItem->Type() == PCB_ZONE_T ) - { - const ZONE* zone = static_cast<const ZONE*>( aItem ); + auto isZoneFillKeepout = + []( const BOARD_ITEM* aItem ) -> bool + { + if( aItem->Type() == PCB_ZONE_T ) + { + const ZONE* zone = static_cast<const ZONE*>( aItem ); - wxCHECK( zone, false ); + if( zone->GetIsRuleArea() && zone->GetDoNotAllowZoneFills() ) + return true; + } - if( zone->GetIsRuleArea() - && zone->GetDoNotAllowCopperPour() ) - return true; - } - - return false; - }; + return false; + }; std::vector<LAYER_OPACITY_ITEM> opacityStackup; @@ -3424,7 +3422,7 @@ void PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates( GENERAL_COLLECTOR& aC opacityItem.m_Opacity = color.a; opacityItem.m_Item = item; - if( isCopperPourKeepoutZone( item ) ) + if( isZoneFillKeepout( item ) ) opacityItem.m_Opacity = 0.0; opacityStackup.emplace_back( opacityItem ); @@ -3459,30 +3457,32 @@ void PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates( GENERAL_COLLECTOR& aC } // Objects to ignore and fallback to the old selection behavior. - auto ignoreItem = [&]() - { - const BOARD_ITEM* item = opacityItem.m_Item; + auto ignoreItem = + [&]() + { + const BOARD_ITEM* item = opacityItem.m_Item; - wxCHECK( item, false ); + wxCHECK( item, false ); - // Check items that span multiple layers for visibility. - if( visibleItems.count( item ) ) - return true; + // Check items that span multiple layers for visibility. + if( visibleItems.count( item ) ) + return true; - // Don't prune child items of a footprint that is already visible. - if( item->GetParent() - && ( item->GetParent()->Type() == PCB_FOOTPRINT_T ) - && visibleItems.count( item->GetParent() ) ) - return true; + // Don't prune child items of a footprint that is already visible. + if( item->GetParent() + && ( item->GetParent()->Type() == PCB_FOOTPRINT_T ) + && visibleItems.count( item->GetParent() ) ) + { + return true; + } - // Keepout zones are transparent but for some reason, - // PCB_PAINTER::GetColor() returns the color of the zone it - // prevents from filling. - if( isCopperPourKeepoutZone( item ) ) - return true; + // Keepout zones are transparent but for some reason, PCB_PAINTER::GetColor() + // returns the color of the zone it prevents from filling. + if( isZoneFillKeepout( item ) ) + return true; - return false; - }; + return false; + }; // Everything on the currently selected layer is visible; if( opacityItem.m_Layer == enabledLayerStack[0] ) diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index fe072cd149..b1cf1cad6c 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -146,7 +146,7 @@ void ZONE::InitDataFromSrcInCopyCtor( const ZONE& aZone ) m_ruleAreaPlacementSource = aZone.m_ruleAreaPlacementSource; SetLayerSet( aZone.GetLayerSet() ); - m_doNotAllowCopperPour = aZone.m_doNotAllowCopperPour; + m_doNotAllowZoneFills = aZone.m_doNotAllowZoneFills; m_doNotAllowVias = aZone.m_doNotAllowVias; m_doNotAllowTracks = aZone.m_doNotAllowTracks; m_doNotAllowPads = aZone.m_doNotAllowPads; @@ -243,7 +243,7 @@ void ZONE::Serialize( google::protobuf::Any& aContainer ) const if( m_isRuleArea ) { types::RuleAreaSettings* ra = zone.mutable_rule_area_settings(); - ra->set_keepout_copper( m_doNotAllowCopperPour ); + ra->set_keepout_copper( m_doNotAllowZoneFills ); ra->set_keepout_footprints( m_doNotAllowFootprints ); ra->set_keepout_pads( m_doNotAllowPads ); ra->set_keepout_tracks( m_doNotAllowTracks ); @@ -348,7 +348,7 @@ bool ZONE::Deserialize( const google::protobuf::Any& aContainer ) if( m_isRuleArea ) { const types::RuleAreaSettings& ra = zone.rule_area_settings(); - m_doNotAllowCopperPour = ra.keepout_copper(); + m_doNotAllowZoneFills = ra.keepout_copper(); m_doNotAllowFootprints = ra.keepout_footprints(); m_doNotAllowPads = ra.keepout_pads(); m_doNotAllowTracks = ra.keepout_tracks(); @@ -854,8 +854,8 @@ void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& if( GetDoNotAllowPads() ) AccumulateDescription( msg, _( "No pads" ) ); - if( GetDoNotAllowCopperPour() ) - AccumulateDescription( msg, _( "No copper zones" ) ); + if( GetDoNotAllowZoneFills() ) + AccumulateDescription( msg, _( "No zone fills" ) ); if( GetDoNotAllowFootprints() ) AccumulateDescription( msg, _( "No footprints" ) ); @@ -1653,7 +1653,7 @@ bool ZONE::operator==( const ZONE& aOther ) const if( GetIsRuleArea() ) { - if( GetDoNotAllowCopperPour() != other.GetDoNotAllowCopperPour() ) + if( GetDoNotAllowZoneFills() != other.GetDoNotAllowZoneFills() ) return false; if( GetDoNotAllowTracks() != other.GetDoNotAllowTracks() ) @@ -1745,7 +1745,7 @@ double ZONE::Similarity( const BOARD_ITEM& aOther ) const } else { - if( GetDoNotAllowCopperPour() != other.GetDoNotAllowCopperPour() ) + if( GetDoNotAllowZoneFills() != other.GetDoNotAllowZoneFills() ) similarity *= 0.9; if( GetDoNotAllowTracks() != other.GetDoNotAllowTracks() ) similarity *= 0.9; @@ -1934,9 +1934,9 @@ static struct ZONE_DESC groupKeepout ) .SetAvailableFunc( isRuleArea ); - propMgr.AddProperty( new PROPERTY<ZONE, bool>( _HKI( "Keep Out Copper Pours" ), - &ZONE::SetDoNotAllowCopperPour, - &ZONE::GetDoNotAllowCopperPour ), + propMgr.AddProperty( new PROPERTY<ZONE, bool>( _HKI( "Keep Out Zone Fills" ), + &ZONE::SetDoNotAllowZoneFills, + &ZONE::GetDoNotAllowZoneFills ), groupKeepout ) .SetAvailableFunc( isRuleArea ); diff --git a/pcbnew/zone.h b/pcbnew/zone.h index 09f48ce219..d820c6b370 100644 --- a/pcbnew/zone.h +++ b/pcbnew/zone.h @@ -741,36 +741,35 @@ public: bool HasKeepoutParametersSet() const { return m_doNotAllowTracks || m_doNotAllowVias || m_doNotAllowPads || m_doNotAllowFootprints - || m_doNotAllowCopperPour; + || m_doNotAllowZoneFills; } /** * Accessors to parameters used in Rule Area zones: */ - bool GetIsRuleArea() const { return m_isRuleArea; } - bool GetRuleAreaPlacementEnabled() const { return m_ruleAreaPlacementEnabled ; } + bool GetIsRuleArea() const { return m_isRuleArea; } + void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; } + bool GetRuleAreaPlacementEnabled() const { return m_ruleAreaPlacementEnabled ; } + void SetRuleAreaPlacementEnabled( bool aEnabled ) { m_ruleAreaPlacementEnabled = aEnabled; } + + wxString GetRuleAreaPlacementSource() const { return m_ruleAreaPlacementSource; } + void SetRuleAreaPlacementSource( const wxString& aSource ) { m_ruleAreaPlacementSource = aSource; } RULE_AREA_PLACEMENT_SOURCE_TYPE GetRuleAreaPlacementSourceType() const { return m_ruleAreaPlacementSourceType; } - wxString GetRuleAreaPlacementSource() const { return m_ruleAreaPlacementSource; } - bool GetDoNotAllowCopperPour() const { return m_doNotAllowCopperPour; } + void SetRuleAreaPlacementSourceType( RULE_AREA_PLACEMENT_SOURCE_TYPE aType ) + { + m_ruleAreaPlacementSourceType = aType; + } + + bool GetDoNotAllowZoneFills() const { return m_doNotAllowZoneFills; } bool GetDoNotAllowVias() const { return m_doNotAllowVias; } bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; } bool GetDoNotAllowPads() const { return m_doNotAllowPads; } bool GetDoNotAllowFootprints() const { return m_doNotAllowFootprints; } - void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; } - void SetRuleAreaPlacementEnabled( bool aEnabled ) { m_ruleAreaPlacementEnabled = aEnabled; } - void SetRuleAreaPlacementSourceType( RULE_AREA_PLACEMENT_SOURCE_TYPE aType ) - { - m_ruleAreaPlacementSourceType = aType; - } - void SetRuleAreaPlacementSource( const wxString& aSource ) - { - m_ruleAreaPlacementSource = aSource; - } - void SetDoNotAllowCopperPour( bool aEnable ) { m_doNotAllowCopperPour = aEnable; } + void SetDoNotAllowZoneFills( bool aEnable ) { m_doNotAllowZoneFills = aEnable; } void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; } void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; } void SetDoNotAllowPads( bool aEnable ) { m_doNotAllowPads = aEnable; } @@ -897,7 +896,7 @@ protected: /* For keepout zones only: * what is not allowed inside the keepout ( pads, tracks and vias ) */ - bool m_doNotAllowCopperPour; + bool m_doNotAllowZoneFills; bool m_doNotAllowVias; bool m_doNotAllowTracks; bool m_doNotAllowPads; diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 1dc22f379c..9a10d573c1 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -339,7 +339,7 @@ bool ZONE_FILLER::Fill( const std::vector<ZONE*>& aZones, bool aCheck, wxWindow* if( !zone->HasKeepoutParametersSet() ) continue; - if( !zone->GetDoNotAllowCopperPour() ) + if( !zone->GetDoNotAllowZoneFills() ) continue; if( !zone->IsOnLayer( itemLayer ) ) @@ -1500,7 +1500,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa if( otherZone->GetIsRuleArea() ) { - if( otherZone->GetDoNotAllowCopperPour() && !aZone->IsTeardropArea() ) + if( otherZone->GetDoNotAllowZoneFills() && !aZone->IsTeardropArea() ) knockoutZoneClearance( otherZone ); } else if( otherZone->HigherPriority( aZone ) ) @@ -1519,7 +1519,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa if( otherZone->GetIsRuleArea() ) { - if( otherZone->GetDoNotAllowCopperPour() && !aZone->IsTeardropArea() ) + if( otherZone->GetDoNotAllowZoneFills() && !aZone->IsTeardropArea() ) knockoutZoneClearance( otherZone ); } else if( otherZone->HigherPriority( aZone ) ) @@ -1903,7 +1903,7 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer, return aReporter && ( ticker++ % 50 ) == 0 && aReporter->IsCancelled(); }; - auto knockoutGraphicClearance = + auto knockoutGraphicItem = [&]( BOARD_ITEM* aItem ) { if( aItem->IsKnockout() && aItem->IsOnLayer( aLayer ) @@ -1918,11 +1918,11 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer, if( checkForCancel( m_progressReporter ) ) return false; - knockoutGraphicClearance( &footprint->Reference() ); - knockoutGraphicClearance( &footprint->Value() ); + knockoutGraphicItem( &footprint->Reference() ); + knockoutGraphicItem( &footprint->Value() ); for( BOARD_ITEM* item : footprint->GraphicalItems() ) - knockoutGraphicClearance( item ); + knockoutGraphicItem( item ); } for( BOARD_ITEM* item : m_board->Drawings() ) @@ -1930,7 +1930,7 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer, if( checkForCancel( m_progressReporter ) ) return false; - knockoutGraphicClearance( item ); + knockoutGraphicItem( item ); } aFillPolys = aSmoothedOutline; @@ -1945,7 +1945,7 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer, if( !candidate->HasKeepoutParametersSet() ) return; - if( candidate->GetDoNotAllowCopperPour() && candidate->IsOnLayer( aLayer ) ) + if( candidate->GetDoNotAllowZoneFills() && candidate->IsOnLayer( aLayer ) ) { if( candidate->GetBoundingBox().Intersects( zone_boundingbox ) ) { diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index 5fde50c8d8..5ac71b8b79 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -82,7 +82,7 @@ ZONE_SETTINGS::ZONE_SETTINGS() SetIsRuleArea( false ); SetRuleAreaPlacementSourceType( RULE_AREA_PLACEMENT_SOURCE_TYPE::SHEETNAME ); - SetDoNotAllowCopperPour( false ); + SetDoNotAllowZoneFills( false ); SetDoNotAllowVias( true ); SetDoNotAllowTracks( true ); SetDoNotAllowPads( true ); @@ -116,11 +116,10 @@ bool ZONE_SETTINGS::operator==( const ZONE_SETTINGS& aOther ) const if( m_cornerSmoothingType != aOther.m_cornerSmoothingType ) return false; if( m_cornerRadius != aOther.m_cornerRadius ) return false; if( m_isRuleArea != aOther.m_isRuleArea ) return false; - if( m_ruleAreaPlacementEnabled != aOther.m_ruleAreaPlacementEnabled ) - return false; + if( m_ruleAreaPlacementEnabled != aOther.m_ruleAreaPlacementEnabled ) return false; if( m_ruleAreaPlacementSourceType != aOther.m_ruleAreaPlacementSourceType ) return false; if( m_ruleAreaPlacementSource != aOther.m_ruleAreaPlacementSource ) return false; - if( m_keepoutDoNotAllowCopperPour != aOther.m_keepoutDoNotAllowCopperPour ) return false; + if( m_keepoutDoNotAllowZoneFills != aOther.m_keepoutDoNotAllowZoneFills ) return false; if( m_keepoutDoNotAllowVias != aOther.m_keepoutDoNotAllowVias ) return false; if( m_keepoutDoNotAllowTracks != aOther.m_keepoutDoNotAllowTracks ) return false; if( m_keepoutDoNotAllowPads != aOther.m_keepoutDoNotAllowPads ) return false; @@ -167,10 +166,10 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE& aSource ) m_cornerSmoothingType = aSource.GetCornerSmoothingType(); m_cornerRadius = aSource.GetCornerRadius(); m_isRuleArea = aSource.GetIsRuleArea(); - m_ruleAreaPlacementEnabled = aSource.GetRuleAreaPlacementEnabled(); + m_ruleAreaPlacementEnabled = aSource.GetRuleAreaPlacementEnabled(); m_ruleAreaPlacementSourceType = aSource.GetRuleAreaPlacementSourceType(); m_ruleAreaPlacementSource = aSource.GetRuleAreaPlacementSource(); - m_keepoutDoNotAllowCopperPour = aSource.GetDoNotAllowCopperPour(); + m_keepoutDoNotAllowZoneFills = aSource.GetDoNotAllowZoneFills(); m_keepoutDoNotAllowVias = aSource.GetDoNotAllowVias(); m_keepoutDoNotAllowTracks = aSource.GetDoNotAllowTracks(); m_keepoutDoNotAllowPads = aSource.GetDoNotAllowPads(); @@ -216,7 +215,7 @@ void ZONE_SETTINGS::ExportSetting( ZONE& aTarget, bool aFullExport ) const aTarget.SetRuleAreaPlacementEnabled( GetRuleAreaPlacementEnabled() ); aTarget.SetRuleAreaPlacementSourceType( GetRuleAreaPlacementSourceType() ); aTarget.SetRuleAreaPlacementSource( GetRuleAreaPlacementSource() ); - aTarget.SetDoNotAllowCopperPour( GetDoNotAllowCopperPour() ); + aTarget.SetDoNotAllowZoneFills( GetDoNotAllowZoneFills() ); aTarget.SetDoNotAllowVias( GetDoNotAllowVias() ); aTarget.SetDoNotAllowTracks( GetDoNotAllowTracks() ); aTarget.SetDoNotAllowPads( GetDoNotAllowPads() ); @@ -277,7 +276,7 @@ void ZONE_SETTINGS::CopyFrom( const ZONE_SETTINGS& aOther, bool aCopyFull ) m_ruleAreaPlacementEnabled = aOther.m_ruleAreaPlacementEnabled; m_ruleAreaPlacementSourceType = aOther.m_ruleAreaPlacementSourceType; m_ruleAreaPlacementSource = aOther.m_ruleAreaPlacementSource; - m_keepoutDoNotAllowCopperPour = aOther.m_keepoutDoNotAllowCopperPour; + m_keepoutDoNotAllowZoneFills = aOther.m_keepoutDoNotAllowZoneFills; m_keepoutDoNotAllowVias = aOther.m_keepoutDoNotAllowVias; m_keepoutDoNotAllowTracks = aOther.m_keepoutDoNotAllowTracks; m_keepoutDoNotAllowPads = aOther.m_keepoutDoNotAllowPads; diff --git a/pcbnew/zone_settings.h b/pcbnew/zone_settings.h index b6abf01fe3..d6da56188d 100644 --- a/pcbnew/zone_settings.h +++ b/pcbnew/zone_settings.h @@ -140,7 +140,7 @@ private: * Keepout zones and keepout flags. * Note that DRC rules can set keepouts on zones whether they're a keepout or not. */ - bool m_isRuleArea; + bool m_isRuleArea; /** * Placement rule area data @@ -149,11 +149,11 @@ private: RULE_AREA_PLACEMENT_SOURCE_TYPE m_ruleAreaPlacementSourceType; wxString m_ruleAreaPlacementSource; - bool m_keepoutDoNotAllowCopperPour; - bool m_keepoutDoNotAllowVias; - bool m_keepoutDoNotAllowTracks; - bool m_keepoutDoNotAllowPads; - bool m_keepoutDoNotAllowFootprints; + bool m_keepoutDoNotAllowZoneFills; + bool m_keepoutDoNotAllowVias; + bool m_keepoutDoNotAllowTracks; + bool m_keepoutDoNotAllowPads; + bool m_keepoutDoNotAllowFootprints; ISLAND_REMOVAL_MODE m_removeIslands; long long int m_minIslandArea; @@ -226,7 +226,7 @@ public: bool HasKeepoutParametersSet() const { return m_keepoutDoNotAllowTracks || m_keepoutDoNotAllowVias || m_keepoutDoNotAllowPads - || m_keepoutDoNotAllowFootprints || m_keepoutDoNotAllowCopperPour; + || m_keepoutDoNotAllowFootprints || m_keepoutDoNotAllowZoneFills; } /** @@ -239,10 +239,10 @@ public: return m_ruleAreaPlacementSourceType; } wxString GetRuleAreaPlacementSource() const { return m_ruleAreaPlacementSource; } - bool GetDoNotAllowCopperPour() const { return m_keepoutDoNotAllowCopperPour; } - bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; } - bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; } - bool GetDoNotAllowPads() const { return m_keepoutDoNotAllowPads; } + bool GetDoNotAllowZoneFills() const { return m_keepoutDoNotAllowZoneFills; } + bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; } + bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; } + bool GetDoNotAllowPads() const { return m_keepoutDoNotAllowPads; } bool GetDoNotAllowFootprints() const { return m_keepoutDoNotAllowFootprints; } void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; } @@ -255,10 +255,10 @@ public: { m_ruleAreaPlacementSource = aSource; } - void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; } - void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; } - void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; } - void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; } + void SetDoNotAllowZoneFills( bool aEnable ) { m_keepoutDoNotAllowZoneFills = aEnable; } + void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; } + void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; } + void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; } void SetDoNotAllowFootprints( bool aEnable ) { m_keepoutDoNotAllowFootprints = aEnable; } ISLAND_REMOVAL_MODE GetIslandRemovalMode() const { return m_removeIslands; } diff --git a/pcbnew/zones_functions_for_undo_redo.cpp b/pcbnew/zones_functions_for_undo_redo.cpp index 6608443ca3..8b68b93ddb 100644 --- a/pcbnew/zones_functions_for_undo_redo.cpp +++ b/pcbnew/zones_functions_for_undo_redo.cpp @@ -67,7 +67,7 @@ bool ZONE::IsSame( const ZONE& aZoneToCompare ) if( GetIsRuleArea() != aZoneToCompare.GetIsRuleArea() ) return false; - if( GetDoNotAllowCopperPour() != aZoneToCompare.GetDoNotAllowCopperPour() ) + if( GetDoNotAllowZoneFills() != aZoneToCompare.GetDoNotAllowZoneFills() ) return false; if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() ) diff --git a/qa/pcbnew_utils/board_test_utils.cpp b/qa/pcbnew_utils/board_test_utils.cpp index 75d53513dd..531c0f07ec 100644 --- a/qa/pcbnew_utils/board_test_utils.cpp +++ b/qa/pcbnew_utils/board_test_utils.cpp @@ -614,7 +614,7 @@ void CheckFpZone( const ZONE* expected, const ZONE* zone ) BOOST_CHECK_EQUAL( expected->GetMinIslandArea(), zone->GetMinIslandArea() ); BOOST_CHECK_EQUAL( expected->GetIsRuleArea(), zone->GetIsRuleArea() ); - BOOST_CHECK_EQUAL( expected->GetDoNotAllowCopperPour(), zone->GetDoNotAllowCopperPour() ); + BOOST_CHECK_EQUAL( expected->GetDoNotAllowZoneFills(), zone->GetDoNotAllowZoneFills() ); BOOST_CHECK_EQUAL( expected->GetDoNotAllowVias(), zone->GetDoNotAllowVias() ); BOOST_CHECK_EQUAL( expected->GetDoNotAllowTracks(), zone->GetDoNotAllowTracks() ); BOOST_CHECK_EQUAL( expected->GetDoNotAllowPads(), zone->GetDoNotAllowPads() );