KiCad PCB EDA Suite
ZONE_SETTINGS Class Reference

ZONE_SETTINGS handles zones parameters. More...

#include <zone_settings.h>

Public Types

enum  {
  SMOOTHING_UNDEFINED = -1, SMOOTHING_NONE = 0, SMOOTHING_CHAMFER, SMOOTHING_FILLET,
  SMOOTHING_LAST
}
 

Public Member Functions

 ZONE_SETTINGS ()
 class ZONE_SETTINGS used to handle zones parameters More...
 
ZONE_SETTINGSoperator<< (const ZONE_CONTAINER &aSource)
 operator << ( const ZONE_CONTAINER& ) was Function ImportSetting copies settings from a given zone into this object. More...
 
void SetupLayersList (wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, bool aShowCopper, bool aFpEditorMode=false)
 A helper routine for the various zone dialogs (copper, non-copper, keepout). More...
 
void ExportSetting (ZONE_CONTAINER &aTarget, bool aFullExport=true) const
 Function ExportSetting copy settings to a given zone. More...
 
void SetCornerSmoothingType (int aType)
 
int GetCornerSmoothingType () const
 
void SetCornerRadius (int aRadius)
 
unsigned int GetCornerRadius () const
 
ZONE_CONNECTION GetPadConnection () const
 
void SetPadConnection (ZONE_CONNECTION aPadConnection)
 
const bool GetIsKeepout () const
 Accessors to parameters used in Keepout zones: More...
 
const bool GetDoNotAllowCopperPour () const
 
const bool GetDoNotAllowVias () const
 
const bool GetDoNotAllowTracks () const
 
const bool GetDoNotAllowPads () const
 
const bool GetDoNotAllowFootprints () const
 
void SetIsKeepout (bool aEnable)
 
void SetDoNotAllowCopperPour (bool aEnable)
 
void SetDoNotAllowVias (bool aEnable)
 
void SetDoNotAllowTracks (bool aEnable)
 
void SetDoNotAllowPads (bool aEnable)
 
void SetDoNotAllowFootprints (bool aEnable)
 
const ISLAND_REMOVAL_MODE GetIslandRemovalMode () const
 
void SetIslandRemovalMode (ISLAND_REMOVAL_MODE aRemove)
 
long long int GetMinIslandArea () const
 
void SetMinIslandArea (long long int aArea)
 

Public Attributes

ZONE_FILL_MODE m_FillMode
 
int m_ZonePriority
 Priority (0 ... N) of the zone. More...
 
int m_ZoneClearance
 Minimal clearance value. More...
 
int m_ZoneMinThickness
 Min thickness value in filled areas. More...
 
int m_HatchFillTypeThickness
 Grid style shape: thickness of lines (if 0 -> solid shape) More...
 
int m_HatchFillTypeGap
 Grid style shape: clearance between lines (0 -> solid shape) More...
 
double m_HatchFillTypeOrientation
 Grid style shape: orientation of grid lines in degrees. More...
 
int m_HatchFillTypeSmoothingLevel
 Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet, >= 2 = arc. More...
 
double m_HatchFillTypeSmoothingValue
 Grid pattern chamfer distance/fillet value. More...
 
int m_NetcodeSelection
 Net code selection for the current zone. More...
 
wxString m_Name
 Unique name for the current zone (can be blank) More...
 
LSET m_Layers
 Layers that this zone exists on. More...
 
ZONE_HATCH_STYLE m_Zone_HatchingStyle
 Option to show the zone area (outlines only, short hatches or full hatches. More...
 
long m_ThermalReliefGap
 thickness of the gap in thermal reliefs More...
 
long m_ThermalReliefCopperBridge
 thickness of the copper bridge in thermal reliefs More...
 
bool m_Zone_45_Only
 

Private Attributes

int m_cornerSmoothingType
 Corner smoothing type. More...
 
unsigned int m_cornerRadius
 Corner chamfer distance / fillet radius. More...
 
ZONE_CONNECTION m_PadConnection
 
bool m_isKeepout
 
bool m_keepoutDoNotAllowCopperPour
 
bool m_keepoutDoNotAllowVias
 
bool m_keepoutDoNotAllowTracks
 
bool m_keepoutDoNotAllowPads
 
bool m_keepoutDoNotAllowFootprints
 
ISLAND_REMOVAL_MODE m_removeIslands
 
long long int m_minIslandArea
 

Detailed Description

ZONE_SETTINGS handles zones parameters.

Because a zone can be on copper or non copper layers, and can be also a keepout area, some parameters are irrelevant depending on the type of zone

Definition at line 67 of file zone_settings.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SMOOTHING_UNDEFINED 
SMOOTHING_NONE 
SMOOTHING_CHAMFER 
SMOOTHING_FILLET 
SMOOTHING_LAST 

Definition at line 71 of file zone_settings.h.

71  {
73  SMOOTHING_NONE = 0, // Zone outline is used without change
74  SMOOTHING_CHAMFER, // Zone outline is used after chamfering corners
75  SMOOTHING_FILLET, // Zone outline is used after rounding corners
76  SMOOTHING_LAST // sentinel
77  };

Constructor & Destructor Documentation

◆ ZONE_SETTINGS()

ZONE_SETTINGS::ZONE_SETTINGS ( )

class ZONE_SETTINGS used to handle zones parameters

Definition at line 45 of file zone_settings.cpp.

46 {
47  m_ZonePriority = 0;
48  m_FillMode = ZONE_FILL_MODE::POLYGONS; // Mode for filling zone
49  // Zone clearance value
51  // Min thickness value in filled areas (this is the minimum width of copper to fill solid areas) :
54  0; // good value of grid line thickness if m_FillMode = ZFM_GRID_PATTERN
55  m_HatchFillTypeGap = 0; // good value of grid line gap if m_FillMode = ZFM_GRID_PATTERN
56  m_HatchFillTypeOrientation = 0.0; // Grid style: orientation of grid lines in degrees
57  m_HatchFillTypeSmoothingLevel = 0; // Grid pattern smoothing type. 0 = no smoothing
58  m_HatchFillTypeSmoothingValue = 0.1; // Grid pattern chamfer value relative to the gap value
59  m_NetcodeSelection = 0; // Net code selection for the current zone
61  ZONE_HATCH_STYLE::DIAGONAL_EDGE; // Option to show the zone area (outlines only,
62  //short hatches or full hatches
63 
64  m_Layers.reset().set( F_Cu );
65  m_Name = wxEmptyString;
66 
67  // thickness of the gap in thermal reliefs:
69  // thickness of the copper bridge in thermal reliefs:
71 
72  m_PadConnection = ZONE_CONNECTION::THERMAL; // How pads are covered by copper in zone
73 
74  m_Zone_45_Only = false;
75 
77  m_cornerRadius = 0;
78 
80  m_minIslandArea = 0;
81 
82  SetIsKeepout( false );
83  SetDoNotAllowCopperPour( false );
84  SetDoNotAllowVias( true );
85  SetDoNotAllowTracks( true );
86  SetDoNotAllowPads( true );
87  SetDoNotAllowFootprints( false );
88 }
LSET m_Layers
Layers that this zone exists on.
Definition: zone_settings.h:97
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: zone_settings.h:88
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:87
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:86
long long int m_minIslandArea
ISLAND_REMOVAL_MODE m_removeIslands
wxString m_Name
Unique name for the current zone (can be blank)
Definition: zone_settings.h:95
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL
Definition: zones.h:30
ZONE_CONNECTION m_PadConnection
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowVias(bool aEnable)
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:93
int m_cornerSmoothingType
Corner smoothing type.
void SetDoNotAllowPads(bool aEnable)
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:81
ZONE_HATCH_STYLE m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
#define ZONE_CLEARANCE_MIL
Definition: zones.h:33
int m_ZoneClearance
Minimal clearance value.
Definition: zone_settings.h:83
void SetIsKeepout(bool aEnable)
void SetDoNotAllowTracks(bool aEnable)
#define ZONE_THICKNESS_MIL
Definition: zones.h:31
Use thermal relief for pads.
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:79
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:90
void SetDoNotAllowCopperPour(bool aEnable)
#define ZONE_THERMAL_RELIEF_GAP_MIL
Definition: zones.h:29
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:85
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:84

References ALWAYS, DIAGONAL_EDGE, F_Cu, m_cornerRadius, m_cornerSmoothingType, m_FillMode, m_HatchFillTypeGap, m_HatchFillTypeOrientation, m_HatchFillTypeSmoothingLevel, m_HatchFillTypeSmoothingValue, m_HatchFillTypeThickness, m_Layers, m_minIslandArea, m_Name, m_NetcodeSelection, m_PadConnection, m_removeIslands, m_ThermalReliefCopperBridge, m_ThermalReliefGap, m_Zone_45_Only, m_Zone_HatchingStyle, m_ZoneClearance, m_ZoneMinThickness, m_ZonePriority, POLYGONS, SetDoNotAllowCopperPour(), SetDoNotAllowFootprints(), SetDoNotAllowPads(), SetDoNotAllowTracks(), SetDoNotAllowVias(), SetIsKeepout(), SMOOTHING_NONE, THERMAL, ZONE_CLEARANCE_MIL, ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL, ZONE_THERMAL_RELIEF_GAP_MIL, and ZONE_THICKNESS_MIL.

Member Function Documentation

◆ ExportSetting()

void ZONE_SETTINGS::ExportSetting ( ZONE_CONTAINER aTarget,
bool  aFullExport = true 
) const

Function ExportSetting copy settings to a given zone.

Parameters
aTargetthe given zone
aFullExportif false: some parameters are NOT exported because they must not be exported when export settings from a zone to others zones Currently: m_NetcodeSelection

Definition at line 126 of file zone_settings.cpp.

127 {
128  aTarget.SetFillMode( m_FillMode );
140  aTarget.SetCornerRadius( m_cornerRadius );
141  aTarget.SetIsKeepout( GetIsKeepout() );
147  aTarget.SetHV45( m_Zone_45_Only );
149  aTarget.SetMinIslandArea( GetMinIslandArea() );
150 
151  if( aFullExport )
152  {
153  aTarget.SetPriority( m_ZonePriority );
154  aTarget.SetLayerSet( m_Layers );
155  aTarget.SetZoneName( m_Name );
156 
157  if( !m_isKeepout )
158  aTarget.SetNetCode( m_NetcodeSelection );
159  }
160 
161  // call SetHatch last, because hatch lines will be rebuilt,
162  // using new parameters values
163  aTarget.SetHatch( m_Zone_HatchingStyle, aTarget.GetDefaultHatchPitch(), true );
164 }
void SetDoNotAllowTracks(bool aEnable)
Definition: class_zone.h:721
void SetCornerSmoothingType(int aType)
Definition: class_zone.h:653
void SetHatch(ZONE_HATCH_STYLE aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Function SetHatch sets all hatch parameters for the zone.
Definition: class_zone.cpp:951
void SetHatchFillTypeSmoothingLevel(int aLevel)
Definition: class_zone.h:220
void SetHatchFillTypeSmoothingValue(double aValue)
Definition: class_zone.h:223
void SetPadConnection(ZONE_CONNECTION aPadConnection)
Definition: class_zone.h:196
LSET m_Layers
Layers that this zone exists on.
Definition: zone_settings.h:97
const bool GetDoNotAllowFootprints() const
long long int GetMinIslandArea() const
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
Definition: class_zone.h:726
void SetCornerRadius(unsigned int aRadius)
Definition: class_zone.cpp:439
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: zone_settings.h:88
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:87
void SetDoNotAllowFootprints(bool aEnable)
Definition: class_zone.h:723
void SetMinIslandArea(long long int aArea)
Definition: class_zone.h:730
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:86
void SetZoneName(const wxString &aName)
Definition: class_zone.h:111
wxString m_Name
Unique name for the current zone (can be blank)
Definition: zone_settings.h:95
ZONE_CONNECTION m_PadConnection
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
static int GetDefaultHatchPitch()
Function GetDefaultHatchPitchMils.
void SetDoNotAllowVias(bool aEnable)
Definition: class_zone.h:720
void SetPriority(unsigned aPriority)
Function SetPriority.
Definition: class_zone.h:95
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:93
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:264
void SetHatchFillTypeGap(int aStep)
Definition: class_zone.h:214
int m_cornerSmoothingType
Corner smoothing type.
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:81
ZONE_HATCH_STYLE m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
int m_ZoneClearance
Minimal clearance value.
Definition: zone_settings.h:83
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Sets net using a net code.
const bool GetDoNotAllowVias() const
const bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
void SetZoneClearance(int aZoneClearance)
Definition: class_zone.h:192
void SetDoNotAllowPads(bool aEnable)
Definition: class_zone.h:722
const bool GetDoNotAllowTracks() const
void SetThermalReliefCopperBridge(int aThermalReliefCopperBridge)
Definition: class_zone.h:153
void SetDoNotAllowCopperPour(bool aEnable)
Definition: class_zone.h:719
const bool GetDoNotAllowPads() const
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:79
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition: class_zone.h:147
void SetHatchFillTypeOrientation(double aStep)
Definition: class_zone.h:217
const bool GetDoNotAllowCopperPour() const
void SetHV45(bool aConstrain)
Definition: class_zone.h:782
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:90
void SetHatchFillTypeThickness(int aThickness)
Definition: class_zone.h:211
void SetIsKeepout(bool aEnable)
Definition: class_zone.h:718
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:202
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:85
void SetThermalReliefGap(int aThermalReliefGap)
Definition: class_zone.h:150
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:84

References ZONE_CONTAINER::GetDefaultHatchPitch(), GetDoNotAllowCopperPour(), GetDoNotAllowFootprints(), GetDoNotAllowPads(), GetDoNotAllowTracks(), GetDoNotAllowVias(), GetIsKeepout(), GetIslandRemovalMode(), GetMinIslandArea(), m_cornerRadius, m_cornerSmoothingType, m_FillMode, m_HatchFillTypeGap, m_HatchFillTypeOrientation, m_HatchFillTypeSmoothingLevel, m_HatchFillTypeSmoothingValue, m_HatchFillTypeThickness, m_isKeepout, m_Layers, m_Name, m_NetcodeSelection, m_PadConnection, m_ThermalReliefCopperBridge, m_ThermalReliefGap, m_Zone_45_Only, m_Zone_HatchingStyle, m_ZoneClearance, m_ZoneMinThickness, m_ZonePriority, ZONE_CONTAINER::SetCornerRadius(), ZONE_CONTAINER::SetCornerSmoothingType(), ZONE_CONTAINER::SetDoNotAllowCopperPour(), ZONE_CONTAINER::SetDoNotAllowFootprints(), ZONE_CONTAINER::SetDoNotAllowPads(), ZONE_CONTAINER::SetDoNotAllowTracks(), ZONE_CONTAINER::SetDoNotAllowVias(), ZONE_CONTAINER::SetFillMode(), ZONE_CONTAINER::SetHatch(), ZONE_CONTAINER::SetHatchFillTypeGap(), ZONE_CONTAINER::SetHatchFillTypeOrientation(), ZONE_CONTAINER::SetHatchFillTypeSmoothingLevel(), ZONE_CONTAINER::SetHatchFillTypeSmoothingValue(), ZONE_CONTAINER::SetHatchFillTypeThickness(), ZONE_CONTAINER::SetHV45(), ZONE_CONTAINER::SetIsKeepout(), ZONE_CONTAINER::SetIslandRemovalMode(), ZONE_CONTAINER::SetLayerSet(), ZONE_CONTAINER::SetMinIslandArea(), ZONE_CONTAINER::SetMinThickness(), BOARD_CONNECTED_ITEM::SetNetCode(), ZONE_CONTAINER::SetPadConnection(), ZONE_CONTAINER::SetPriority(), ZONE_CONTAINER::SetThermalReliefCopperBridge(), ZONE_CONTAINER::SetThermalReliefGap(), ZONE_CONTAINER::SetZoneClearance(), and ZONE_CONTAINER::SetZoneName().

Referenced by ZONE_CREATE_HELPER::createNewZone(), ZONE_CREATE_HELPER::createZoneFromExisting(), PCB_EDIT_FRAME::Edit_Zone_Params(), DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), ZONE_CONTAINER::ZONE_CONTAINER(), and PCB_EDITOR_CONTROL::ZoneDuplicate().

◆ GetCornerRadius()

unsigned int ZONE_SETTINGS::GetCornerRadius ( ) const
inline

Definition at line 167 of file zone_settings.h.

167 { return m_cornerRadius; }
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.

References m_cornerRadius.

Referenced by DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), and DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ GetCornerSmoothingType()

int ZONE_SETTINGS::GetCornerSmoothingType ( ) const
inline

◆ GetDoNotAllowCopperPour()

const bool ZONE_SETTINGS::GetDoNotAllowCopperPour ( ) const
inline

◆ GetDoNotAllowFootprints()

const bool ZONE_SETTINGS::GetDoNotAllowFootprints ( ) const
inline

◆ GetDoNotAllowPads()

const bool ZONE_SETTINGS::GetDoNotAllowPads ( ) const
inline

◆ GetDoNotAllowTracks()

const bool ZONE_SETTINGS::GetDoNotAllowTracks ( ) const
inline

◆ GetDoNotAllowVias()

const bool ZONE_SETTINGS::GetDoNotAllowVias ( ) const
inline

◆ GetIsKeepout()

const bool ZONE_SETTINGS::GetIsKeepout ( ) const
inline

Accessors to parameters used in Keepout zones:

Definition at line 182 of file zone_settings.h.

182 { return m_isKeepout; }

References m_isKeepout.

Referenced by ExportSetting().

◆ GetIslandRemovalMode()

const ISLAND_REMOVAL_MODE ZONE_SETTINGS::GetIslandRemovalMode ( ) const
inline

Definition at line 196 of file zone_settings.h.

196 { return m_removeIslands; }
ISLAND_REMOVAL_MODE m_removeIslands

References m_removeIslands.

Referenced by ExportSetting(), and DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ GetMinIslandArea()

long long int ZONE_SETTINGS::GetMinIslandArea ( ) const
inline

Definition at line 199 of file zone_settings.h.

199 { return m_minIslandArea; }
long long int m_minIslandArea

References m_minIslandArea.

Referenced by ExportSetting(), and DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ GetPadConnection()

ZONE_CONNECTION ZONE_SETTINGS::GetPadConnection ( ) const
inline

Definition at line 169 of file zone_settings.h.

170  {
171  return m_PadConnection;
172  }
ZONE_CONNECTION m_PadConnection

References m_PadConnection.

Referenced by DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ operator<<()

ZONE_SETTINGS & ZONE_SETTINGS::operator<< ( const ZONE_CONTAINER aSource)

operator << ( const ZONE_CONTAINER& ) was Function ImportSetting copies settings from a given zone into this object.

Parameters
aSourcethe given zone

Definition at line 91 of file zone_settings.cpp.

92 {
93  m_ZonePriority = aSource.GetPriority();
94  m_FillMode = aSource.GetFillMode();
102  m_NetcodeSelection = aSource.GetNetCode();
103  m_Name = aSource.GetZoneName();
107  m_PadConnection = aSource.GetPadConnection();
109  m_cornerRadius = aSource.GetCornerRadius();
110  m_isKeepout = aSource.GetIsKeepout();
116  m_Zone_45_Only = aSource.GetHV45();
118  m_minIslandArea = aSource.GetMinIslandArea();
119 
120  m_Layers = aSource.GetLayerSet();
121 
122  return *this;
123 }
bool GetDoNotAllowPads() const
Definition: class_zone.h:706
int GetNetCode() const
Function GetNetCode.
int GetThermalReliefCopperBridge(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:354
LSET m_Layers
Layers that this zone exists on.
Definition: zone_settings.h:97
int GetHatchFillTypeThickness() const
Definition: class_zone.h:210
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: zone_settings.h:88
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:87
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:86
double GetHatchFillTypeOrientation() const
Definition: class_zone.h:216
double GetHatchFillTypeSmoothingValue() const
Definition: class_zone.h:222
long long int m_minIslandArea
ISLAND_REMOVAL_MODE m_removeIslands
wxString m_Name
Unique name for the current zone (can be blank)
Definition: zone_settings.h:95
ZONE_CONNECTION m_PadConnection
int GetThermalReliefGap(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:345
bool GetDoNotAllowVias() const
Definition: class_zone.h:704
long long int GetMinIslandArea() const
Definition: class_zone.h:729
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:312
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:93
wxString GetZoneName() const
Definition: class_zone.h:109
unsigned int GetCornerRadius() const
Definition: class_zone.h:659
int m_cornerSmoothingType
Corner smoothing type.
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:148
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:81
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:703
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
Definition: class_zone.h:725
ZONE_HATCH_STYLE m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
bool m_keepoutDoNotAllowPads
int m_ZoneClearance
Minimal clearance value.
Definition: zone_settings.h:83
ZONE_CONNECTION GetPadConnection(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:839
ZONE_HATCH_STYLE GetHatchStyle() const
Definition: class_zone.h:565
int GetCornerSmoothingType() const
Definition: class_zone.h:655
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:702
bool GetHV45() const
Definition: class_zone.h:781
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:79
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:101
bool m_keepoutDoNotAllowCopperPour
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:90
int GetMinThickness() const
Definition: class_zone.h:201
bool m_keepoutDoNotAllowFootprints
bool GetDoNotAllowTracks() const
Definition: class_zone.h:705
bool GetDoNotAllowFootprints() const
Definition: class_zone.h:707
int GetHatchFillTypeSmoothingLevel() const
Definition: class_zone.h:219
bool m_keepoutDoNotAllowTracks
int GetZoneClearance() const
Definition: class_zone.h:191
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:85
int GetHatchFillTypeGap() const
Definition: class_zone.h:213
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:84
bool m_keepoutDoNotAllowVias

References ZONE_CONTAINER::GetCornerRadius(), ZONE_CONTAINER::GetCornerSmoothingType(), ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowFootprints(), ZONE_CONTAINER::GetDoNotAllowPads(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetFillMode(), ZONE_CONTAINER::GetHatchFillTypeGap(), ZONE_CONTAINER::GetHatchFillTypeOrientation(), ZONE_CONTAINER::GetHatchFillTypeSmoothingLevel(), ZONE_CONTAINER::GetHatchFillTypeSmoothingValue(), ZONE_CONTAINER::GetHatchFillTypeThickness(), ZONE_CONTAINER::GetHatchStyle(), ZONE_CONTAINER::GetHV45(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetIslandRemovalMode(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::GetMinIslandArea(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::GetPadConnection(), ZONE_CONTAINER::GetPriority(), ZONE_CONTAINER::GetThermalReliefCopperBridge(), ZONE_CONTAINER::GetThermalReliefGap(), ZONE_CONTAINER::GetZoneClearance(), ZONE_CONTAINER::GetZoneName(), m_cornerRadius, m_cornerSmoothingType, m_FillMode, m_HatchFillTypeGap, m_HatchFillTypeOrientation, m_HatchFillTypeSmoothingLevel, m_HatchFillTypeSmoothingValue, m_HatchFillTypeThickness, m_isKeepout, m_keepoutDoNotAllowCopperPour, m_keepoutDoNotAllowFootprints, m_keepoutDoNotAllowPads, m_keepoutDoNotAllowTracks, m_keepoutDoNotAllowVias, m_Layers, m_minIslandArea, m_Name, m_NetcodeSelection, m_PadConnection, m_removeIslands, m_ThermalReliefCopperBridge, m_ThermalReliefGap, m_Zone_45_Only, m_Zone_HatchingStyle, m_ZoneClearance, m_ZoneMinThickness, and m_ZonePriority.

◆ SetCornerRadius()

void ZONE_SETTINGS::SetCornerRadius ( int  aRadius)

Definition at line 167 of file zone_settings.cpp.

168 {
169  if( aRadius < 0 )
170  m_cornerRadius = 0;
171  else
172  m_cornerRadius = aRadius;
173 }
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.

References m_cornerRadius.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), and DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow().

◆ SetCornerSmoothingType()

void ZONE_SETTINGS::SetCornerSmoothingType ( int  aType)
inline

Definition at line 161 of file zone_settings.h.

161 { m_cornerSmoothingType = aType; }
int m_cornerSmoothingType
Corner smoothing type.

References m_cornerSmoothingType.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), and DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow().

◆ SetDoNotAllowCopperPour()

void ZONE_SETTINGS::SetDoNotAllowCopperPour ( bool  aEnable)
inline

◆ SetDoNotAllowFootprints()

void ZONE_SETTINGS::SetDoNotAllowFootprints ( bool  aEnable)
inline

◆ SetDoNotAllowPads()

void ZONE_SETTINGS::SetDoNotAllowPads ( bool  aEnable)
inline

◆ SetDoNotAllowTracks()

void ZONE_SETTINGS::SetDoNotAllowTracks ( bool  aEnable)
inline

◆ SetDoNotAllowVias()

void ZONE_SETTINGS::SetDoNotAllowVias ( bool  aEnable)
inline

◆ SetIsKeepout()

void ZONE_SETTINGS::SetIsKeepout ( bool  aEnable)
inline

◆ SetIslandRemovalMode()

void ZONE_SETTINGS::SetIslandRemovalMode ( ISLAND_REMOVAL_MODE  aRemove)
inline

Definition at line 197 of file zone_settings.h.

197 { m_removeIslands = aRemove; }
ISLAND_REMOVAL_MODE m_removeIslands

References m_removeIslands.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions().

◆ SetMinIslandArea()

void ZONE_SETTINGS::SetMinIslandArea ( long long int  aArea)
inline

Definition at line 200 of file zone_settings.h.

200 { m_minIslandArea = aArea; }
long long int m_minIslandArea

References m_minIslandArea.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions().

◆ SetPadConnection()

void ZONE_SETTINGS::SetPadConnection ( ZONE_CONNECTION  aPadConnection)
inline

Definition at line 174 of file zone_settings.h.

175  {
176  m_PadConnection = aPadConnection;
177  }
ZONE_CONNECTION m_PadConnection

References m_PadConnection.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions().

◆ SetupLayersList()

void ZONE_SETTINGS::SetupLayersList ( wxDataViewListCtrl *  aList,
PCB_BASE_FRAME aFrame,
bool  aShowCopper,
bool  aFpEditorMode = false 
)

A helper routine for the various zone dialogs (copper, non-copper, keepout).

Parameters
aListthe wxDataViewListCtrl to populate
aFramethe parent editor frame
aShowCopperindicates whether copper or technical layers should be shown
aFpEditorModetrue to show (when aShowCopper = true) the option: all inner layers

Definition at line 184 of file zone_settings.cpp.

186 {
187  BOARD* board = aFrame->GetBoard();
188  COLOR4D backgroundColor = aFrame->GetColorSettings()->GetColor( LAYER_PCB_BACKGROUND );
189  LSET layers = aShowCopper ? LSET::AllCuMask( board->GetCopperLayerCount() )
190  : LSET::AllNonCuMask();
191 
192  wxDataViewColumn* checkColumn = aList->AppendToggleColumn( wxEmptyString );
193  wxDataViewColumn* layerColumn = aList->AppendIconTextColumn( wxEmptyString );
194  wxDataViewColumn* layerIDColumn = aList->AppendTextColumn( wxEmptyString );
195  layerIDColumn->SetHidden( true );
196 
197  int textWidth = 0;
198 
199  for( LSEQ layer = layers.UIOrder(); layer; ++layer )
200  {
201  PCB_LAYER_ID layerID = *layer;
202  wxString layerName = board->GetLayerName( layerID );
203  if( aFpEditorMode && layerID == In1_Cu )
204  layerName = _( "Inner layers" );
205 
206  // wxCOL_WIDTH_AUTOSIZE doesn't work on all platforms, so we calculate width here
207  textWidth = std::max( textWidth, GetTextSize( layerName, aList ).x );
208 
209  COLOR4D layerColor = aFrame->GetColorSettings()->GetColor( layerID );
210  auto bitmap = COLOR_SWATCH::MakeBitmap( layerColor, backgroundColor, LAYER_BITMAP_SIZE );
211  wxIcon icon;
212  icon.CopyFromBitmap( bitmap );
213 
214  wxVector<wxVariant> row;
215  row.push_back( wxVariant( m_Layers.test( layerID ) ) );
216  row.push_back( wxVariant( wxDataViewIconText( layerName, icon ) ) );
217  row.push_back( wxVariant( wxString::Format( "%i", layerID ) ) );
218  aList->AppendItem( row );
219 
220  if( m_Layers.test( layerID ) )
221  aList->SetToggleValue( true, (unsigned) aList->GetItemCount() - 1, 0 );
222  }
223 
224  int checkColSize = 22;
225  int layerColSize = textWidth + LAYER_BITMAP_SIZE.x + 15;
226 
227  // You'd think the fact that m_layers is a list would encourage wxWidgets not to save room
228  // for the tree expanders... but you'd be wrong. Force indent to 0.
229  aList->SetIndent( 0 );
230  aList->SetMinClientSize( wxSize( checkColSize + layerColSize, aList->GetMinClientSize().y ) );
231 
232  checkColumn->SetWidth( checkColSize );
233  layerColumn->SetWidth( layerColSize );
234 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:712
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
LSET m_Layers
Layers that this zone exists on.
Definition: zone_settings.h:97
virtual COLOR_SETTINGS * GetColorSettings() override
Helper to retrieve the current color settings.
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:735
wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
Definition: common.cpp:268
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize)
Make a simple color swatch bitmap.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
COLOR4D GetColor(int aLayer) const
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:180
#define _(s)
Definition: 3d_actions.cpp:33
int GetCopperLayerCount() const
Function GetCopperLayerCount.
BOARD * GetBoard() const
static const wxSize LAYER_BITMAP_SIZE(24, 16)
LSEQ UIOrder() const
Definition: lset.cpp:839
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References _, LSET::AllCuMask(), LSET::AllNonCuMask(), Format(), PCB_BASE_FRAME::GetBoard(), COLOR_SETTINGS::GetColor(), PCB_BASE_FRAME::GetColorSettings(), BOARD::GetCopperLayerCount(), BOARD::GetLayerName(), GetTextSize(), In1_Cu, LAYER_BITMAP_SIZE(), LAYER_PCB_BACKGROUND, m_Layers, COLOR_SWATCH::MakeBitmap(), and LSET::UIOrder().

Referenced by DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), and DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR().

Member Data Documentation

◆ m_cornerRadius

unsigned int ZONE_SETTINGS::m_cornerRadius
private

Corner chamfer distance / fillet radius.

Definition at line 109 of file zone_settings.h.

Referenced by ExportSetting(), GetCornerRadius(), operator<<(), SetCornerRadius(), and ZONE_SETTINGS().

◆ m_cornerSmoothingType

int ZONE_SETTINGS::m_cornerSmoothingType
private

Corner smoothing type.

Definition at line 108 of file zone_settings.h.

Referenced by ExportSetting(), GetCornerSmoothingType(), operator<<(), SetCornerSmoothingType(), and ZONE_SETTINGS().

◆ m_FillMode

◆ m_HatchFillTypeGap

◆ m_HatchFillTypeOrientation

◆ m_HatchFillTypeSmoothingLevel

int ZONE_SETTINGS::m_HatchFillTypeSmoothingLevel

◆ m_HatchFillTypeSmoothingValue

double ZONE_SETTINGS::m_HatchFillTypeSmoothingValue

◆ m_HatchFillTypeThickness

◆ m_isKeepout

bool ZONE_SETTINGS::m_isKeepout
private

Definition at line 115 of file zone_settings.h.

Referenced by ExportSetting(), GetIsKeepout(), operator<<(), and SetIsKeepout().

◆ m_keepoutDoNotAllowCopperPour

bool ZONE_SETTINGS::m_keepoutDoNotAllowCopperPour
private

Definition at line 120 of file zone_settings.h.

Referenced by GetDoNotAllowCopperPour(), operator<<(), and SetDoNotAllowCopperPour().

◆ m_keepoutDoNotAllowFootprints

bool ZONE_SETTINGS::m_keepoutDoNotAllowFootprints
private

Definition at line 124 of file zone_settings.h.

Referenced by GetDoNotAllowFootprints(), operator<<(), and SetDoNotAllowFootprints().

◆ m_keepoutDoNotAllowPads

bool ZONE_SETTINGS::m_keepoutDoNotAllowPads
private

Definition at line 123 of file zone_settings.h.

Referenced by GetDoNotAllowPads(), operator<<(), and SetDoNotAllowPads().

◆ m_keepoutDoNotAllowTracks

bool ZONE_SETTINGS::m_keepoutDoNotAllowTracks
private

Definition at line 122 of file zone_settings.h.

Referenced by GetDoNotAllowTracks(), operator<<(), and SetDoNotAllowTracks().

◆ m_keepoutDoNotAllowVias

bool ZONE_SETTINGS::m_keepoutDoNotAllowVias
private

Definition at line 121 of file zone_settings.h.

Referenced by GetDoNotAllowVias(), operator<<(), and SetDoNotAllowVias().

◆ m_Layers

◆ m_minIslandArea

long long int ZONE_SETTINGS::m_minIslandArea
private

Definition at line 127 of file zone_settings.h.

Referenced by GetMinIslandArea(), operator<<(), SetMinIslandArea(), and ZONE_SETTINGS().

◆ m_Name

◆ m_NetcodeSelection

int ZONE_SETTINGS::m_NetcodeSelection

◆ m_PadConnection

ZONE_CONNECTION ZONE_SETTINGS::m_PadConnection
private

◆ m_removeIslands

ISLAND_REMOVAL_MODE ZONE_SETTINGS::m_removeIslands
private

◆ m_ThermalReliefCopperBridge

long ZONE_SETTINGS::m_ThermalReliefCopperBridge

thickness of the copper bridge in thermal reliefs

Definition at line 103 of file zone_settings.h.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), ExportSetting(), operator<<(), DIALOG_COPPER_ZONE::TransferDataToWindow(), and ZONE_SETTINGS().

◆ m_ThermalReliefGap

long ZONE_SETTINGS::m_ThermalReliefGap

thickness of the gap in thermal reliefs

Definition at line 102 of file zone_settings.h.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), ExportSetting(), operator<<(), DIALOG_COPPER_ZONE::TransferDataToWindow(), and ZONE_SETTINGS().

◆ m_Zone_45_Only

◆ m_Zone_HatchingStyle

◆ m_ZoneClearance

◆ m_ZoneMinThickness

◆ m_ZonePriority


The documentation for this class was generated from the following files: