Refactor: Move static to be inside ZONE_SETTINGS

This commit is contained in:
Roberto Fernandez Bautista 2023-06-10 12:03:18 +02:00
parent 2450435131
commit 90ff331c58
3 changed files with 14 additions and 4 deletions

View File

@ -54,9 +54,6 @@ TEARDROP_MANAGER::TEARDROP_MANAGER( BOARD* aBoard, TOOL_MANAGER* aToolManager )
}
// Build a zone teardrop
static ZONE_SETTINGS s_default_settings; // Use zone default settings for teardrop
ZONE* TEARDROP_MANAGER::createTeardrop( TEARDROP_VARIANT aTeardropVariant,
std::vector<VECTOR2I>& aPoints, PCB_TRACK* aTrack ) const
{
@ -64,7 +61,7 @@ ZONE* TEARDROP_MANAGER::createTeardrop( TEARDROP_VARIANT aTeardropVariant,
// teardrop settings are the last zone settings used by a zone dialog.
// override them by default.
s_default_settings.ExportSetting( *teardrop, false );
ZONE_SETTINGS::GetDefaultSettings().ExportSetting( *teardrop, false );
// Add zone properties (priority will be fixed later)
teardrop->SetTeardropAreaType( aTeardropVariant == TD_TYPE_PADVIA ? TEARDROP_TYPE::TD_VIAPAD

View File

@ -196,6 +196,14 @@ const static wxSize LAYER_BITMAP_SIZE( 24, 16 );
const static wxSize CHECKERBOARD_SIZE( 8, 8 );
static const ZONE_SETTINGS& GetDefaultSettings()
{
static ZONE_SETTINGS defaultSettings;
return defaultSettings;
}
// A helper for setting up a dialog list for specifying zone layers. Used by all three
// zone settings dialogs.
void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame,

View File

@ -143,6 +143,11 @@ public:
*/
ZONE_SETTINGS& operator << ( const ZONE& aSource );
/**
* @return Default ZONE_SETTINGS
*/
static const ZONE_SETTINGS& GetDefaultSettings();
/**
* A helper routine for the various zone dialogs (copper, non-copper, keepout).
* @param aList the wxDataViewListCtrl to populate