diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index 6b8c8b39ea..0f43d75845 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -182,9 +182,6 @@ public: */ void SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions, bool aRefresh = true ); - const ZONE_SETTINGS& GetZoneSettings() const; - void SetZoneSettings( const ZONE_SETTINGS& aSettings ); - /** * Return the #PCB_PLOT_PARAMS for the BOARD owned by this frame. */ diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 9f5ccf3140..7c24056289 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -771,17 +771,6 @@ BOARD_DESIGN_SETTINGS& BOARD::GetDesignSettings() const } -const ZONE_SETTINGS& BOARD::GetZoneSettings() const -{ - return GetDesignSettings().GetDefaultZoneSettings(); -} - - -void BOARD::SetZoneSettings( const ZONE_SETTINGS& aSettings ) -{ - GetDesignSettings().SetDefaultZoneSettings( aSettings ); -} - int BOARD::GetMaxClearanceValue() const { int worstClearance = m_designSettings->GetBiggestClearanceValue(); diff --git a/pcbnew/board.h b/pcbnew/board.h index 63b5a1e0b2..93700cfd34 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -642,10 +642,6 @@ public: */ BOARD_DESIGN_SETTINGS& GetDesignSettings() const; - const ZONE_SETTINGS& GetZoneSettings() const override; - - void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override; - // Tented vias are vias covered by solder mask. So because the solder mask is a negative // layer, tented vias are NOT plotted on solder mask layers bool GetTentVias() const { return !m_plotOptions.GetPlotViaOnMaskLayer(); } diff --git a/pcbnew/board_item_container.h b/pcbnew/board_item_container.h index e454e4eed9..ddc561ebcb 100644 --- a/pcbnew/board_item_container.h +++ b/pcbnew/board_item_container.h @@ -79,26 +79,6 @@ public: Remove( aItem ); delete aItem; } - - /** - * @brief Fetch the zone settings for this container - */ - virtual const ZONE_SETTINGS& GetZoneSettings() const - { - return m_zoneSettings; - } - - /** - * @brief Set the zone settings for this container - * @param aSettings new Zone settings for this container - */ - virtual void SetZoneSettings( const ZONE_SETTINGS& aSettings ) - { - m_zoneSettings = aSettings; - } - -private: - ZONE_SETTINGS m_zoneSettings; }; #endif /* BOARD_ITEM_CONTAINER_H */ diff --git a/pcbnew/edit_zone_helpers.cpp b/pcbnew/edit_zone_helpers.cpp index d17a590344..0277d453b1 100644 --- a/pcbnew/edit_zone_helpers.cpp +++ b/pcbnew/edit_zone_helpers.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone ) { int dialogResult; - ZONE_SETTINGS zoneInfo = GetZoneSettings(); + ZONE_SETTINGS zoneInfo = m_pcb->GetDesignSettings().GetDefaultZoneSettings(); PICKED_ITEMS_LIST pickedList; // zones for undo/redo command PICKED_ITEMS_LIST deletedList; // zones that have been deleted when combined BOARD_COMMIT commit( this ); @@ -74,7 +75,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone ) return; } - SetZoneSettings( zoneInfo ); + m_pcb->GetDesignSettings().SetDefaultZoneSettings( zoneInfo ); OnModify(); if( dialogResult == ZONE_EXPORT_VALUES ) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 5d55652d94..cfcd8f04de 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -581,18 +581,6 @@ void PCB_BASE_FRAME::SetDrawBgColor( const COLOR4D& aColor ) } -const ZONE_SETTINGS& PCB_BASE_FRAME::GetZoneSettings() const -{ - return m_pcb->GetDesignSettings().GetDefaultZoneSettings(); -} - - -void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings ) -{ - m_pcb->GetDesignSettings().SetDefaultZoneSettings( aSettings ); -} - - const PCB_PLOT_PARAMS& PCB_BASE_FRAME::GetPlotSettings() const { return m_pcb->GetPlotOptions(); 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 8e31188376..e3c2ac7a2a 100644 --- a/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp +++ b/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp @@ -905,7 +905,7 @@ void PCB_IO_KICAD_LEGACY::loadSHEET() void PCB_IO_KICAD_LEGACY::loadSETUP() { BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings(); - ZONE_SETTINGS zoneSettings = m_board->GetZoneSettings(); + ZONE_SETTINGS zoneSettings = bds.GetDefaultZoneSettings(); std::shared_ptr defaultNetclass = bds.m_NetSettings->m_DefaultNetClass; char* line; char* saveptr; @@ -1146,7 +1146,7 @@ void PCB_IO_KICAD_LEGACY::loadSETUP() } else if( TESTLINE( "$EndSETUP" ) ) { - m_board->SetZoneSettings( zoneSettings ); + bds.SetDefaultZoneSettings( zoneSettings ); // Very old *.brd file does not have NETCLASSes // "TrackWidth", "ViaSize", "ViaDrill", "ViaMinSize", and "TrackClearence" were diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index ebe1f9720a..2fdbeaaf8e 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -468,7 +468,7 @@ int CONVERT_TOOL::CreatePolys( const TOOL_EVENT& aEvent ) // Creating zone or keepout PCB_BASE_EDIT_FRAME* frame = getEditFrame(); BOARD_ITEM_CONTAINER* parent = frame->GetModel(); - ZONE_SETTINGS zoneInfo = frame->GetZoneSettings(); + ZONE_SETTINGS zoneInfo = bds.GetDefaultZoneSettings(); bool nonCopper = IsNonCopperLayer( destLayer ); zoneInfo.m_Layers.reset().set( destLayer ); diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index a92648bdf5..c54ee715b7 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -92,7 +92,7 @@ std::unique_ptr ZONE_CREATE_HELPER::createNewZone( bool aKeepout ) std::set highlightedNets = board->GetHighLightNetCodes(); // Get the current default settings for zones - ZONE_SETTINGS zoneInfo = frame->GetZoneSettings(); + ZONE_SETTINGS zoneInfo = board->GetDesignSettings().GetDefaultZoneSettings(); zoneInfo.m_Layers.reset().set( m_params.m_layer ); // TODO(JE) multilayer defaults? zoneInfo.m_NetcodeSelection = highlightedNets.empty() ? -1 : *highlightedNets.begin(); zoneInfo.SetIsRuleArea( m_params.m_keepout ); diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 96c546807c..1f217e9ca8 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -73,7 +73,7 @@ ZONE::ZONE( BOARD_ITEM_CONTAINER* aParent ) : m_hatchThickness = m_ZoneMinThickness; m_hatchGap = m_ZoneMinThickness; - aParent->GetZoneSettings().ExportSetting( *this ); + aParent->GetBoard()->GetDesignSettings().GetDefaultZoneSettings().ExportSetting( *this ); m_needRefill = false; // True only after edits. }