KiCad PCB EDA Suite
ZONE_DESC Struct Reference

Public Member Functions

 ZONE_DESC ()
 

Detailed Description

Definition at line 1353 of file zone.cpp.

Constructor & Destructor Documentation

◆ ZONE_DESC()

ZONE_DESC::ZONE_DESC ( )
inline

Definition at line 1355 of file zone.cpp.

1356 {
1358
1359 if( zcMap.Choices().GetCount() == 0 )
1360 {
1362 zcMap.Map( ZONE_CONNECTION::INHERITED, _HKI( "Inherited" ) )
1363 .Map( ZONE_CONNECTION::NONE, _HKI( "None" ) )
1364 .Map( ZONE_CONNECTION::THERMAL, _HKI( "Thermal reliefs" ) )
1365 .Map( ZONE_CONNECTION::FULL, _HKI( "Solid" ) )
1366 .Map( ZONE_CONNECTION::THT_THERMAL, _HKI( "Thermal reliefs for PTH" ) );
1367 }
1368
1372
1373 // Mask layer and position properties; they aren't useful in current form
1374 auto posX = new PROPERTY<ZONE, int>( _HKI( "Position X" ),
1375 NO_SETTER( ZONE, int ),
1376 reinterpret_cast<int (ZONE::*)() const>( &ZONE::GetX ),
1379 posX->SetIsInternal( true );
1380
1381 auto posY = new PROPERTY<ZONE, int>( _HKI( "Position Y" ), NO_SETTER( ZONE, int ),
1382 reinterpret_cast<int (ZONE::*)() const>( &ZONE::GetY ),
1385 posY->SetIsInternal( true );
1386
1387 propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Position X" ), posX );
1388 propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Position Y" ), posY );
1389
1390 auto isCopperZone =
1391 []( INSPECTABLE* aItem ) -> bool
1392 {
1393 if( ZONE* zone = dynamic_cast<ZONE*>( aItem ) )
1394 return !zone->GetIsRuleArea() && IsCopperLayer( zone->GetFirstLayer() );
1395
1396 return false;
1397 };
1398
1399 auto layer = new PROPERTY_ENUM<ZONE, PCB_LAYER_ID>( _HKI( "Layer" ),
1401 layer->SetIsInternal( true );
1402 propMgr.ReplaceProperty( TYPE_HASH( BOARD_CONNECTED_ITEM ), _HKI( "Layer" ), layer );
1403
1404 auto priority = new PROPERTY<ZONE, unsigned>( _HKI( "Priority" ),
1406 priority->SetAvailableFunc( isCopperZone );
1407 propMgr.AddProperty( priority );
1408
1409 propMgr.AddProperty( new PROPERTY<ZONE, wxString>( _HKI( "Name" ),
1411
1412 const wxString groupOverrides = _( "Overrides" );
1413
1414 auto clearanceOverride = new PROPERTY<ZONE, int>( _HKI( "Clearance Override" ),
1417 clearanceOverride->SetAvailableFunc( isCopperZone );
1418
1419 auto minWidth = new PROPERTY<ZONE, int>( _HKI( "Minimum Width" ),
1422 minWidth->SetAvailableFunc( isCopperZone );
1423
1424 auto padConnections = new PROPERTY_ENUM<ZONE, ZONE_CONNECTION>( _HKI( "Pad Connections" ),
1426 padConnections->SetAvailableFunc( isCopperZone );
1427
1428 auto thermalGap = new PROPERTY<ZONE, int>( _HKI( "Thermal Relief Gap" ),
1431 thermalGap->SetAvailableFunc( isCopperZone );
1432
1433 auto thermalSpokeWidth = new PROPERTY<ZONE, int>( _HKI( "Thermal Relief Spoke Width" ),
1436 thermalSpokeWidth->SetAvailableFunc( isCopperZone );
1437
1438 propMgr.AddProperty( clearanceOverride, groupOverrides );
1439 propMgr.AddProperty( minWidth, groupOverrides );
1440 propMgr.AddProperty( padConnections, groupOverrides );
1441 propMgr.AddProperty( thermalGap, groupOverrides );
1442 propMgr.AddProperty( thermalSpokeWidth, groupOverrides );
1443 }
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:58
int GetY() const
Definition: board_item.h:82
int GetX() const
Definition: board_item.h:76
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:552
static ENUM_MAP< T > & Instance()
Definition: property.h:546
ENUM_MAP & Undefined(T aValue)
Definition: property.h:559
wxPGChoices & Choices()
Definition: property.h:595
Class that other classes need to inherit from, in order to be inspectable.
Definition: inspectable.h:36
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:67
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:69
void AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew, const wxString &aGroup=wxEmptyString)
Replace an existing property for a specific type.
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
void SetMinThickness(int aMinThickness)
Definition: zone.h:252
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
Definition: zone.h:187
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:236
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition: zone.cpp:257
int GetLocalClearance() const
Definition: zone.h:152
wxString GetZoneName() const
Definition: zone.h:124
int GetMinThickness() const
Definition: zone.h:251
ZONE_CONNECTION GetPadConnection() const
Definition: zone.h:248
int GetThermalReliefSpokeWidth() const
Definition: zone.h:195
void SetLocalClearance(int aClearance)
Definition: zone.h:153
void SetThermalReliefGap(int aThermalReliefGap)
Definition: zone.h:176
void SetAssignedPriority(unsigned aPriority)
Definition: zone.h:107
void SetPadConnection(ZONE_CONNECTION aPadConnection)
Definition: zone.h:249
void SetZoneName(const wxString &aName)
Definition: zone.h:125
int GetThermalReliefGap() const
Definition: zone.h:184
unsigned GetAssignedPriority() const
Definition: zone.h:112
#define _HKI(x)
#define _(s)
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:825
#define TYPE_HASH(x)
Definition: property.h:61
#define NO_SETTER(owner, type)
Definition: property.h:657
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
Definition: property.h:55
@ PT_SIZE
Size expressed in distance units (mm/inch)
Definition: property.h:54
#define REGISTER_TYPE(x)
Definition: property_mgr.h:298
@ THERMAL
Use thermal relief for pads.
@ THT_THERMAL
Thermal relief only for THT pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper

References _, _HKI, ORIGIN_TRANSFORMS::ABS_X_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD, PROPERTY_MANAGER::AddProperty(), ENUM_MAP< T >::Choices(), FULL, ZONE::GetAssignedPriority(), ZONE::GetLayer(), ZONE::GetLocalClearance(), ZONE::GetMinThickness(), ZONE::GetPadConnection(), ZONE::GetThermalReliefGap(), ZONE::GetThermalReliefSpokeWidth(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), ZONE::GetZoneName(), INHERITED, PROPERTY_MANAGER::InheritsAfter(), ENUM_MAP< T >::Instance(), PROPERTY_MANAGER::Instance(), IsCopperLayer(), ENUM_MAP< T >::Map(), NO_SETTER, NONE, PT_COORD, PT_SIZE, REGISTER_TYPE, PROPERTY_MANAGER::ReplaceProperty(), ZONE::SetAssignedPriority(), ZONE::SetLayer(), ZONE::SetLocalClearance(), ZONE::SetMinThickness(), ZONE::SetPadConnection(), ZONE::SetThermalReliefGap(), ZONE::SetThermalReliefSpokeWidth(), ZONE::SetZoneName(), THERMAL, THT_THERMAL, TYPE_HASH, and ENUM_MAP< T >::Undefined().


The documentation for this struct was generated from the following file: