Remove single-zone-fill and unfill.

These are incompatible with our zone-priority-based algorithms.
This commit is contained in:
Jeff Young 2022-10-18 13:45:28 +01:00
parent 437d2c4589
commit 4633d251a5
5 changed files with 0 additions and 92 deletions

View File

@ -847,8 +847,6 @@ void PCB_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( PCB_ACTIONS::drawZoneCutout, ENABLE( singleZoneCond ) );
mgr->SetConditions( PCB_ACTIONS::drawSimilarZone, ENABLE( singleZoneCond ) );
mgr->SetConditions( PCB_ACTIONS::zoneMerge, ENABLE( zoneMergeCond ) );
mgr->SetConditions( PCB_ACTIONS::zoneFill, ENABLE( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
mgr->SetConditions( PCB_ACTIONS::zoneUnfill, ENABLE( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( cond.Get45degMode() ) );

View File

@ -84,9 +84,7 @@ public:
SetIcon( BITMAPS::add_zone );
SetTitle( _( "Zones" ) );
Add( PCB_ACTIONS::zoneFill );
Add( PCB_ACTIONS::zoneFillAll );
Add( PCB_ACTIONS::zoneUnfill );
Add( PCB_ACTIONS::zoneUnfillAll );
AppendSeparator();

View File

@ -1359,11 +1359,6 @@ TOOL_ACTION PCB_ACTIONS::filterSelection( "pcbnew.InteractiveSelection.FilterSel
// ZONE_FILLER_TOOL
//
TOOL_ACTION PCB_ACTIONS::zoneFill( "pcbnew.ZoneFiller.zoneFill",
AS_GLOBAL, 0, "",
_( "Fill Zone" ), _( "Update copper fill of selected zone(s)" ),
BITMAPS::fill_zone );
TOOL_ACTION PCB_ACTIONS::zoneFillAll( "pcbnew.ZoneFiller.zoneFillAll",
AS_GLOBAL,
'B', LEGACY_HK_NAME( "Fill or Refill All Zones" ),
@ -1373,11 +1368,6 @@ TOOL_ACTION PCB_ACTIONS::zoneFillAll( "pcbnew.ZoneFiller.zoneFillAll",
TOOL_ACTION PCB_ACTIONS::zoneFillDirty( "pcbnew.ZoneFiller.zoneFillDirty",
AS_CONTEXT );
TOOL_ACTION PCB_ACTIONS::zoneUnfill( "pcbnew.ZoneFiller.zoneUnfill",
AS_GLOBAL, 0, "",
_( "Unfill Zone" ), _( "Remove copper fill from selected zone(s)" ),
BITMAPS::zone_unfill );
TOOL_ACTION PCB_ACTIONS::zoneUnfillAll( "pcbnew.ZoneFiller.zoneUnfillAll",
AS_GLOBAL,
MD_CTRL + 'B', LEGACY_HK_NAME( "Remove Filled Areas in All Zones" ),

View File

@ -272,57 +272,6 @@ int ZONE_FILLER_TOOL::ZoneFillDirty( const TOOL_EVENT& aEvent )
}
int ZONE_FILLER_TOOL::ZoneFill( const TOOL_EVENT& aEvent )
{
if( m_fillInProgress )
{
wxBell();
return -1;
}
m_fillInProgress = true;
std::vector<ZONE*> toFill;
if( ZONE* passedZone = aEvent.Parameter<ZONE*>() )
{
toFill.push_back( passedZone );
}
else
{
for( EDA_ITEM* item : selection() )
{
if( ZONE* zone = dynamic_cast<ZONE*>( item ) )
toFill.push_back( zone );
}
}
BOARD_COMMIT commit( this );
std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
ZONE_FILLER filler( board(), &commit );
reporter = std::make_unique<WX_PROGRESS_REPORTER>( frame(), _( "Fill Zone" ), 5 );
filler.SetProgressReporter( reporter.get() );
if( filler.Fill( toFill ) )
{
reporter->AdvancePhase();
commit.Push( _( "Fill Zone(s)" ), SKIP_CONNECTIVITY | ZONE_FILL_OP );
}
else
{
commit.Revert();
}
board()->BuildConnectivity( reporter.get() );
refresh();
m_fillInProgress = false;
return 0;
}
int ZONE_FILLER_TOOL::ZoneFillAll( const TOOL_EVENT& aEvent )
{
FillAllZones( frame() );
@ -330,29 +279,6 @@ int ZONE_FILLER_TOOL::ZoneFillAll( const TOOL_EVENT& aEvent )
}
int ZONE_FILLER_TOOL::ZoneUnfill( const TOOL_EVENT& aEvent )
{
BOARD_COMMIT commit( this );
for( EDA_ITEM* item : selection() )
{
assert( item->Type() == PCB_ZONE_T || item->Type() == PCB_FP_ZONE_T );
ZONE* zone = static_cast<ZONE*>( item );
commit.Modify( zone );
zone->UnFill();
}
commit.Push( _( "Unfill Zone" ), ZONE_FILL_OP );
refresh();
return 0;
}
int ZONE_FILLER_TOOL::ZoneUnfillAll( const TOOL_EVENT& aEvent )
{
BOARD_COMMIT commit( this );
@ -396,9 +322,7 @@ void ZONE_FILLER_TOOL::refresh()
void ZONE_FILLER_TOOL::setTransitions()
{
// Zone actions
Go( &ZONE_FILLER_TOOL::ZoneFill, PCB_ACTIONS::zoneFill.MakeEvent() );
Go( &ZONE_FILLER_TOOL::ZoneFillAll, PCB_ACTIONS::zoneFillAll.MakeEvent() );
Go( &ZONE_FILLER_TOOL::ZoneFillDirty, PCB_ACTIONS::zoneFillDirty.MakeEvent() );
Go( &ZONE_FILLER_TOOL::ZoneUnfill, PCB_ACTIONS::zoneUnfill.MakeEvent() );
Go( &ZONE_FILLER_TOOL::ZoneUnfillAll, PCB_ACTIONS::zoneUnfillAll.MakeEvent() );
}

View File

@ -51,10 +51,8 @@ public:
void CheckAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aReporter = nullptr );
void FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aReporter = nullptr );
int ZoneFill( const TOOL_EVENT& aEvent );
int ZoneFillAll( const TOOL_EVENT& aEvent );
int ZoneFillDirty( const TOOL_EVENT& aEvent );
int ZoneUnfill( const TOOL_EVENT& aEvent );
int ZoneUnfillAll( const TOOL_EVENT& aEvent );
bool IsBusy() { return m_fillInProgress; }