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 GetIsRuleArea () const
 Accessors to parameters used in Rule Area zones: More...
 
const bool GetDoNotAllowCopperPour () const
 
const bool GetDoNotAllowVias () const
 
const bool GetDoNotAllowTracks () const
 
const bool GetDoNotAllowPads () const
 
const bool GetDoNotAllowFootprints () const
 
void SetIsRuleArea (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

int m_ZonePriority
 
ZONE_FILL_MODE m_FillMode
 
int m_ZoneClearance
 
int m_ZoneMinThickness
 
int m_HatchThickness
 
int m_HatchGap
 
double m_HatchOrientation
 
int m_HatchSmoothingLevel
 
double m_HatchSmoothingValue
 
double m_HatchHoleMinArea
 
int m_HatchBorderAlgorithm
 
int m_NetcodeSelection
 
wxString m_Name
 
LSET m_Layers
 
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
 Option to show the zone area (outlines only, short hatches or full hatches. More...
 
long m_ThermalReliefGap
 
long m_ThermalReliefSpokeWidth
 
bool m_Zone_45_Only
 

Private Attributes

int m_cornerSmoothingType
 
unsigned int m_cornerRadius
 
ZONE_CONNECTION m_padConnection
 
bool m_isRuleArea
 
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) :
53  m_HatchThickness = 0; // good value of grid line thickness if m_FillMode = ZFM_GRID_PATTERN
54  m_HatchGap = 0; // good value of grid line gap if m_FillMode = ZFM_GRID_PATTERN
55  m_HatchOrientation = 0.0; // Grid style: orientation of grid lines in degrees
56  m_HatchSmoothingLevel = 0; // Grid pattern smoothing type. 0 = no smoothing
57  m_HatchSmoothingValue = 0.1; // Grid pattern chamfer value relative to the gap value
58  m_HatchHoleMinArea = 0.3; // Min size before holes are dropped (ratio of hole size)
59  m_HatchBorderAlgorithm = 1; // 0 = use zone min thickness; 1 = use hatch width
60  m_NetcodeSelection = 0; // Net code selection for the current zone
62  // outlines only, short
63  // hatches or full hatches
64 
65  m_Layers.reset().set( F_Cu );
66  m_Name = wxEmptyString;
67 
68  // thickness of the gap in thermal reliefs:
70  // thickness of the copper bridge in thermal reliefs:
72 
73  m_padConnection = ZONE_CONNECTION::THERMAL; // How pads are covered by copper in zone
74 
75  m_Zone_45_Only = false;
76 
78  m_cornerRadius = 0;
79 
81  m_minIslandArea = 0;
82 
83  SetIsRuleArea( false );
84  SetDoNotAllowCopperPour( false );
85  SetDoNotAllowVias( true );
86  SetDoNotAllowTracks( true );
87  SetDoNotAllowPads( true );
88  SetDoNotAllowFootprints( false );
89 }
int m_HatchSmoothingLevel
Definition: zone_settings.h:87
double m_HatchSmoothingValue
Definition: zone_settings.h:89
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
double m_HatchHoleMinArea
Definition: zone_settings.h:90
long long int m_minIslandArea
ISLAND_REMOVAL_MODE m_removeIslands
wxString m_Name
Definition: zone_settings.h:95
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL
Definition: zones.h:30
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowVias(bool aEnable)
int m_NetcodeSelection
Definition: zone_settings.h:93
int m_cornerSmoothingType
void SetDoNotAllowPads(bool aEnable)
#define ZONE_CLEARANCE_MIL
Definition: zones.h:33
void SetDoNotAllowTracks(bool aEnable)
void SetIsRuleArea(bool aEnable)
#define ZONE_THICKNESS_MIL
Definition: zones.h:31
ZONE_CONNECTION m_padConnection
Use thermal relief for pads.
int m_HatchBorderAlgorithm
Definition: zone_settings.h:91
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:81
long m_ThermalReliefSpokeWidth
void SetDoNotAllowCopperPour(bool aEnable)
#define ZONE_THERMAL_RELIEF_GAP_MIL
Definition: zones.h:29
unsigned int m_cornerRadius
double m_HatchOrientation
Definition: zone_settings.h:86
long m_ThermalReliefGap
int m_ZoneMinThickness
Definition: zone_settings.h:83

References ALWAYS, DIAGONAL_EDGE, F_Cu, m_cornerRadius, m_cornerSmoothingType, m_FillMode, m_HatchBorderAlgorithm, m_HatchGap, m_HatchHoleMinArea, m_HatchOrientation, m_HatchSmoothingLevel, m_HatchSmoothingValue, m_HatchThickness, m_Layers, m_minIslandArea, m_Name, m_NetcodeSelection, m_padConnection, m_removeIslands, m_ThermalReliefGap, m_ThermalReliefSpokeWidth, m_Zone_45_Only, m_ZoneBorderDisplayStyle, m_ZoneClearance, m_ZoneMinThickness, m_ZonePriority, POLYGONS, SetDoNotAllowCopperPour(), SetDoNotAllowFootprints(), SetDoNotAllowPads(), SetDoNotAllowTracks(), SetDoNotAllowVias(), SetIsRuleArea(), 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 129 of file zone_settings.cpp.

130 {
131  aTarget.SetFillMode( m_FillMode );
135  aTarget.SetHatchGap( m_HatchGap );
145  aTarget.SetCornerRadius( m_cornerRadius );
146  aTarget.SetIsRuleArea( GetIsRuleArea() );
152  aTarget.SetHV45( m_Zone_45_Only );
154  aTarget.SetMinIslandArea( GetMinIslandArea() );
155 
156  if( aFullExport )
157  {
158  aTarget.SetPriority( m_ZonePriority );
159  aTarget.SetLayerSet( m_Layers );
160  aTarget.SetZoneName( m_Name );
161 
162  if( !m_isRuleArea )
163  aTarget.SetNetCode( m_NetcodeSelection );
164  }
165 
166  // call SetBorderDisplayStyle last, because hatch lines will be rebuilt,
167  // using new parameters values
169  true );
170 }
void SetDoNotAllowTracks(bool aEnable)
Definition: class_zone.h:734
int m_HatchSmoothingLevel
Definition: zone_settings.h:87
void SetHatchGap(int aStep)
Definition: class_zone.h:237
void SetCornerSmoothingType(int aType)
Definition: class_zone.h:674
void SetPadConnection(ZONE_CONNECTION aPadConnection)
Definition: class_zone.h:222
const bool GetDoNotAllowFootprints() const
const bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
double m_HatchSmoothingValue
Definition: zone_settings.h:89
long long int GetMinIslandArea() const
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
Definition: class_zone.h:739
void SetCornerRadius(unsigned int aRadius)
Definition: class_zone.cpp:357
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
void SetDoNotAllowFootprints(bool aEnable)
Definition: class_zone.h:736
void SetMinIslandArea(long long int aArea)
Definition: class_zone.h:743
double m_HatchHoleMinArea
Definition: zone_settings.h:90
void SetZoneName(const wxString &aName)
Definition: class_zone.h:114
bool SetNetCode(int aNetCode, bool aNoAssert)
Sets net using a net code.
void SetHatchHoleMinArea(double aPct)
Definition: class_zone.h:249
wxString m_Name
Definition: zone_settings.h:95
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
Definition: class_zone.h:175
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
void SetIsRuleArea(bool aEnable)
Definition: class_zone.h:731
static int GetDefaultHatchPitch()
Function GetDefaultHatchPitchMils.
void SetDoNotAllowVias(bool aEnable)
Definition: class_zone.h:733
void SetPriority(unsigned aPriority)
Function SetPriority.
Definition: class_zone.h:100
int m_NetcodeSelection
Definition: zone_settings.h:93
void SetHatchThickness(int aThickness)
Definition: class_zone.h:234
void SetLayerSet(LSET aLayerSet) override
Definition: class_zone.cpp:242
int m_cornerSmoothingType
const bool GetDoNotAllowVias() const
void SetDoNotAllowPads(bool aEnable)
Definition: class_zone.h:735
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Function SetBorderDisplayStyle sets all hatch parameters for the zone.
Definition: class_zone.cpp:875
const bool GetDoNotAllowTracks() const
void SetHatchSmoothingValue(double aValue)
Definition: class_zone.h:246
ZONE_CONNECTION m_padConnection
void SetLocalClearance(int aClearance)
Definition: class_zone.h:138
void SetHatchBorderAlgorithm(int aAlgo)
Definition: class_zone.h:252
void SetDoNotAllowCopperPour(bool aEnable)
Definition: class_zone.h:732
const bool GetDoNotAllowPads() const
int m_HatchBorderAlgorithm
Definition: zone_settings.h:91
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:81
void SetHatchOrientation(double aStep)
Definition: class_zone.h:240
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition: class_zone.h:162
long m_ThermalReliefSpokeWidth
const bool GetDoNotAllowCopperPour() const
void SetHV45(bool aConstrain)
Definition: class_zone.h:795
void SetHatchSmoothingLevel(int aLevel)
Definition: class_zone.h:243
unsigned int m_cornerRadius
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:225
void SetThermalReliefGap(int aThermalReliefGap)
Definition: class_zone.h:165
double m_HatchOrientation
Definition: zone_settings.h:86
long m_ThermalReliefGap
int m_ZoneMinThickness
Definition: zone_settings.h:83

References ZONE_CONTAINER::GetDefaultHatchPitch(), GetDoNotAllowCopperPour(), GetDoNotAllowFootprints(), GetDoNotAllowPads(), GetDoNotAllowTracks(), GetDoNotAllowVias(), GetIslandRemovalMode(), GetIsRuleArea(), GetMinIslandArea(), m_cornerRadius, m_cornerSmoothingType, m_FillMode, m_HatchBorderAlgorithm, m_HatchGap, m_HatchHoleMinArea, m_HatchOrientation, m_HatchSmoothingLevel, m_HatchSmoothingValue, m_HatchThickness, m_isRuleArea, m_Layers, m_Name, m_NetcodeSelection, m_padConnection, m_ThermalReliefGap, m_ThermalReliefSpokeWidth, m_Zone_45_Only, m_ZoneBorderDisplayStyle, m_ZoneClearance, m_ZoneMinThickness, m_ZonePriority, ZONE_CONTAINER::SetBorderDisplayStyle(), 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::SetHatchBorderAlgorithm(), ZONE_CONTAINER::SetHatchGap(), ZONE_CONTAINER::SetHatchHoleMinArea(), ZONE_CONTAINER::SetHatchOrientation(), ZONE_CONTAINER::SetHatchSmoothingLevel(), ZONE_CONTAINER::SetHatchSmoothingValue(), ZONE_CONTAINER::SetHatchThickness(), ZONE_CONTAINER::SetHV45(), ZONE_CONTAINER::SetIslandRemovalMode(), ZONE_CONTAINER::SetIsRuleArea(), ZONE_CONTAINER::SetLayerSet(), ZONE_CONTAINER::SetLocalClearance(), ZONE_CONTAINER::SetMinIslandArea(), ZONE_CONTAINER::SetMinThickness(), BOARD_CONNECTED_ITEM::SetNetCode(), ZONE_CONTAINER::SetPadConnection(), ZONE_CONTAINER::SetPriority(), ZONE_CONTAINER::SetThermalReliefGap(), ZONE_CONTAINER::SetThermalReliefSpokeWidth(), and ZONE_CONTAINER::SetZoneName().

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

◆ GetCornerRadius()

unsigned int ZONE_SETTINGS::GetCornerRadius ( ) const
inline

◆ GetCornerSmoothingType()

◆ 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

◆ GetIslandRemovalMode()

const ISLAND_REMOVAL_MODE ZONE_SETTINGS::GetIslandRemovalMode ( ) const
inline

Definition at line 194 of file zone_settings.h.

194 { return m_removeIslands; }
ISLAND_REMOVAL_MODE m_removeIslands

References m_removeIslands.

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

◆ GetIsRuleArea()

const bool ZONE_SETTINGS::GetIsRuleArea ( ) const
inline

Accessors to parameters used in Rule Area zones:

Definition at line 180 of file zone_settings.h.

180 { return m_isRuleArea; }

References m_isRuleArea.

Referenced by ExportSetting().

◆ GetMinIslandArea()

long long int ZONE_SETTINGS::GetMinIslandArea ( ) const
inline

Definition at line 197 of file zone_settings.h.

197 { 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 167 of file zone_settings.h.

168  {
169  return m_padConnection;
170  }
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 92 of file zone_settings.cpp.

93 {
94  m_ZonePriority = aSource.GetPriority();
95  m_FillMode = aSource.GetFillMode();
99  m_HatchGap = aSource.GetHatchGap();
105  m_NetcodeSelection = aSource.GetNetCode();
106  m_Name = aSource.GetZoneName();
110  m_padConnection = aSource.GetPadConnection();
112  m_cornerRadius = aSource.GetCornerRadius();
113  m_isRuleArea = aSource.GetIsRuleArea();
119  m_Zone_45_Only = aSource.GetHV45();
121  m_minIslandArea = aSource.GetMinIslandArea();
122 
123  m_Layers = aSource.GetLayerSet();
124 
125  return *this;
126 }
int m_HatchSmoothingLevel
Definition: zone_settings.h:87
bool GetDoNotAllowPads() const
Definition: class_zone.h:728
int GetNetCode() const
Function GetNetCode.
int GetHatchBorderAlgorithm() const
Definition: class_zone.h:251
double m_HatchSmoothingValue
Definition: zone_settings.h:89
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
double m_HatchHoleMinArea
Definition: zone_settings.h:90
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system.
Definition: class_zone.cpp:460
long long int m_minIslandArea
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
Definition: class_zone.h:592
ISLAND_REMOVAL_MODE m_removeIslands
wxString m_Name
Definition: zone_settings.h:95
bool GetDoNotAllowVias() const
Definition: class_zone.h:726
long long int GetMinIslandArea() const
Definition: class_zone.h:742
int GetHatchGap() const
Definition: class_zone.h:236
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: class_zone.cpp:287
int m_NetcodeSelection
Definition: zone_settings.h:93
wxString GetZoneName() const
Definition: class_zone.h:113
unsigned int GetCornerRadius() const
Definition: class_zone.h:680
int m_cornerSmoothingType
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:163
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:725
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
Definition: class_zone.h:738
bool m_keepoutDoNotAllowPads
int GetCornerSmoothingType() const
Definition: class_zone.h:676
double GetHatchOrientation() const
Definition: class_zone.h:239
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:724
bool GetHV45() const
Definition: class_zone.h:794
ZONE_CONNECTION m_padConnection
int GetThermalReliefGap() const
Definition: class_zone.h:172
int m_HatchBorderAlgorithm
Definition: zone_settings.h:91
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:81
long m_ThermalReliefSpokeWidth
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:106
double GetHatchSmoothingValue() const
Definition: class_zone.h:245
bool m_keepoutDoNotAllowCopperPour
int GetMinThickness() const
Definition: class_zone.h:224
bool m_keepoutDoNotAllowFootprints
ZONE_CONNECTION GetPadConnection(D_PAD *aPad, wxString *aSource=nullptr) const
Definition: class_zone.cpp:756
int GetHatchSmoothingLevel() const
Definition: class_zone.h:242
bool GetDoNotAllowTracks() const
Definition: class_zone.h:727
bool GetDoNotAllowFootprints() const
Definition: class_zone.h:729
int GetHatchThickness() const
Definition: class_zone.h:233
bool m_keepoutDoNotAllowTracks
unsigned int m_cornerRadius
int GetThermalReliefSpokeWidth() const
Definition: class_zone.h:182
double m_HatchOrientation
Definition: zone_settings.h:86
double GetHatchHoleMinArea() const
Definition: class_zone.h:248
long m_ThermalReliefGap
int m_ZoneMinThickness
Definition: zone_settings.h:83
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::GetHatchBorderAlgorithm(), ZONE_CONTAINER::GetHatchGap(), ZONE_CONTAINER::GetHatchHoleMinArea(), ZONE_CONTAINER::GetHatchOrientation(), ZONE_CONTAINER::GetHatchSmoothingLevel(), ZONE_CONTAINER::GetHatchSmoothingValue(), ZONE_CONTAINER::GetHatchStyle(), ZONE_CONTAINER::GetHatchThickness(), ZONE_CONTAINER::GetHV45(), ZONE_CONTAINER::GetIslandRemovalMode(), ZONE_CONTAINER::GetIsRuleArea(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::GetLocalClearance(), ZONE_CONTAINER::GetMinIslandArea(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::GetPadConnection(), ZONE_CONTAINER::GetPriority(), ZONE_CONTAINER::GetThermalReliefGap(), ZONE_CONTAINER::GetThermalReliefSpokeWidth(), ZONE_CONTAINER::GetZoneName(), m_cornerRadius, m_cornerSmoothingType, m_FillMode, m_HatchBorderAlgorithm, m_HatchGap, m_HatchHoleMinArea, m_HatchOrientation, m_HatchSmoothingLevel, m_HatchSmoothingValue, m_HatchThickness, m_isRuleArea, m_keepoutDoNotAllowCopperPour, m_keepoutDoNotAllowFootprints, m_keepoutDoNotAllowPads, m_keepoutDoNotAllowTracks, m_keepoutDoNotAllowVias, m_Layers, m_minIslandArea, m_Name, m_NetcodeSelection, m_padConnection, m_removeIslands, m_ThermalReliefGap, m_ThermalReliefSpokeWidth, m_Zone_45_Only, m_ZoneBorderDisplayStyle, m_ZoneClearance, m_ZoneMinThickness, and m_ZonePriority.

◆ SetCornerRadius()

void ZONE_SETTINGS::SetCornerRadius ( int  aRadius)

Definition at line 173 of file zone_settings.cpp.

174 {
175  if( aRadius < 0 )
176  m_cornerRadius = 0;
177  else
178  m_cornerRadius = aRadius;
179 }
unsigned int m_cornerRadius

References m_cornerRadius.

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

◆ SetCornerSmoothingType()

void ZONE_SETTINGS::SetCornerSmoothingType ( int  aType)
inline

◆ SetDoNotAllowCopperPour()

void ZONE_SETTINGS::SetDoNotAllowCopperPour ( bool  aEnable)
inline

◆ SetDoNotAllowFootprints()

void ZONE_SETTINGS::SetDoNotAllowFootprints ( bool  aEnable)
inline

◆ SetDoNotAllowPads()

void ZONE_SETTINGS::SetDoNotAllowPads ( bool  aEnable)
inline

Definition at line 191 of file zone_settings.h.

191 { m_keepoutDoNotAllowPads = aEnable; }
bool m_keepoutDoNotAllowPads

References m_keepoutDoNotAllowPads.

Referenced by DIALOG_RULE_AREA_PROPERTIES::TransferDataFromWindow(), and ZONE_SETTINGS().

◆ SetDoNotAllowTracks()

void ZONE_SETTINGS::SetDoNotAllowTracks ( bool  aEnable)
inline

◆ SetDoNotAllowVias()

void ZONE_SETTINGS::SetDoNotAllowVias ( bool  aEnable)
inline

Definition at line 189 of file zone_settings.h.

189 { m_keepoutDoNotAllowVias = aEnable; }
bool m_keepoutDoNotAllowVias

References m_keepoutDoNotAllowVias.

Referenced by DIALOG_RULE_AREA_PROPERTIES::TransferDataFromWindow(), and ZONE_SETTINGS().

◆ SetIslandRemovalMode()

void ZONE_SETTINGS::SetIslandRemovalMode ( ISLAND_REMOVAL_MODE  aRemove)
inline

Definition at line 195 of file zone_settings.h.

195 { m_removeIslands = aRemove; }
ISLAND_REMOVAL_MODE m_removeIslands

References m_removeIslands.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions().

◆ SetIsRuleArea()

void ZONE_SETTINGS::SetIsRuleArea ( bool  aEnable)
inline

◆ SetMinIslandArea()

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

Definition at line 198 of file zone_settings.h.

198 { 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 172 of file zone_settings.h.

173  {
174  m_padConnection = aPadConnection;
175  }
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 193 of file zone_settings.cpp.

195 {
196  BOARD* board = aFrame->GetBoard();
197  COLOR4D backgroundColor = aFrame->GetColorSettings()->GetColor( LAYER_PCB_BACKGROUND );
198  LSET layers = aShowCopper ? LSET::AllCuMask( board->GetCopperLayerCount() )
199  : LSET::AllNonCuMask();
200 
201  // In the Footprint Editor In1_Cu is used as a proxy for "all inner layers"
202  if( aFpEditorMode )
203  layers.set( In1_Cu );
204 
205  wxDataViewColumn* checkColumn = aList->AppendToggleColumn( wxEmptyString );
206  wxDataViewColumn* layerColumn = aList->AppendIconTextColumn( wxEmptyString );
207  wxDataViewColumn* layerIDColumn = aList->AppendTextColumn( wxEmptyString );
208  layerIDColumn->SetHidden( true );
209 
210  int textWidth = 0;
211 
212  for( LSEQ layer = layers.UIOrder(); layer; ++layer )
213  {
214  PCB_LAYER_ID layerID = *layer;
215  wxString layerName = board->GetLayerName( layerID );
216 
217  if( aFpEditorMode && layerID == In1_Cu )
218  layerName = _( "Inner layers" );
219 
220  // wxCOL_WIDTH_AUTOSIZE doesn't work on all platforms, so we calculate width here
221  textWidth = std::max( textWidth, GetTextSize( layerName, aList ).x );
222 
223  COLOR4D layerColor = aFrame->GetColorSettings()->GetColor( layerID );
224  auto bitmap = COLOR_SWATCH::MakeBitmap( layerColor, backgroundColor, LAYER_BITMAP_SIZE,
225  CHECKERBOARD_SIZE, aList->GetBackgroundColour() );
226  wxIcon icon;
227  icon.CopyFromBitmap( bitmap );
228 
229  wxVector<wxVariant> row;
230  row.push_back( wxVariant( m_Layers.test( layerID ) ) );
231  row.push_back( wxVariant( wxDataViewIconText( layerName, icon ) ) );
232  row.push_back( wxVariant( wxString::Format( "%i", layerID ) ) );
233  aList->AppendItem( row );
234 
235  if( m_Layers.test( layerID ) )
236  aList->SetToggleValue( true, (unsigned) aList->GetItemCount() - 1, 0 );
237  }
238 
239  int checkColSize = 22;
240  int layerColSize = textWidth + LAYER_BITMAP_SIZE.x + 15;
241 
242  // You'd think the fact that m_layers is a list would encourage wxWidgets not to save room
243  // for the tree expanders... but you'd be wrong. Force indent to 0.
244  aList->SetIndent( 0 );
245  aList->SetMinClientSize( wxSize( checkColSize + layerColSize, aList->GetMinClientSize().y ) );
246 
247  checkColumn->SetWidth( checkColSize );
248  layerColumn->SetWidth( layerColSize );
249 }
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:719
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
virtual COLOR_SETTINGS * GetColorSettings() override
Helper to retrieve the current color settings.
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
Make a simple color swatch bitmap.
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:742
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.
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:201
static const wxSize CHECKERBOARD_SIZE(8, 8)
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
#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:846
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References _, LSET::AllCuMask(), LSET::AllNonCuMask(), CHECKERBOARD_SIZE(), 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_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), and DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES().

Member Data Documentation

◆ m_cornerRadius

unsigned int ZONE_SETTINGS::m_cornerRadius
private

◆ m_cornerSmoothingType

int ZONE_SETTINGS::m_cornerSmoothingType
private

◆ m_FillMode

◆ m_HatchBorderAlgorithm

int ZONE_SETTINGS::m_HatchBorderAlgorithm

Definition at line 91 of file zone_settings.h.

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

◆ m_HatchGap

◆ m_HatchHoleMinArea

double ZONE_SETTINGS::m_HatchHoleMinArea

Definition at line 90 of file zone_settings.h.

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

◆ m_HatchOrientation

◆ m_HatchSmoothingLevel

◆ m_HatchSmoothingValue

◆ m_HatchThickness

◆ m_isRuleArea

bool ZONE_SETTINGS::m_isRuleArea
private

Definition at line 116 of file zone_settings.h.

Referenced by ExportSetting(), GetIsRuleArea(), operator<<(), and SetIsRuleArea().

◆ m_keepoutDoNotAllowCopperPour

bool ZONE_SETTINGS::m_keepoutDoNotAllowCopperPour
private

Definition at line 118 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowFootprints

bool ZONE_SETTINGS::m_keepoutDoNotAllowFootprints
private

Definition at line 122 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowPads

bool ZONE_SETTINGS::m_keepoutDoNotAllowPads
private

Definition at line 121 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowTracks

bool ZONE_SETTINGS::m_keepoutDoNotAllowTracks
private

Definition at line 120 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowVias

bool ZONE_SETTINGS::m_keepoutDoNotAllowVias
private

Definition at line 119 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 125 of file zone_settings.h.

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

◆ m_Name

◆ m_NetcodeSelection

◆ m_padConnection

ZONE_CONNECTION ZONE_SETTINGS::m_padConnection
private

◆ m_removeIslands

ISLAND_REMOVAL_MODE ZONE_SETTINGS::m_removeIslands
private

◆ m_ThermalReliefGap

long ZONE_SETTINGS::m_ThermalReliefGap

◆ m_ThermalReliefSpokeWidth

long ZONE_SETTINGS::m_ThermalReliefSpokeWidth

◆ m_Zone_45_Only

◆ m_ZoneBorderDisplayStyle

◆ m_ZoneClearance

◆ m_ZoneMinThickness

◆ m_ZonePriority


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