KiCad PCB EDA Suite
ZONE_SETTINGS Class Reference

Class 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)
 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
 
ZoneConnection GetPadConnection () const
 
void SetPadConnection (ZoneConnection 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
 
void SetIsKeepout (bool aEnable)
 
void SetDoNotAllowCopperPour (bool aEnable)
 
void SetDoNotAllowVias (bool aEnable)
 
void SetDoNotAllowTracks (bool aEnable)
 

Public Attributes

ZONE_FILL_MODE m_FillMode
 
int m_ZonePriority
 Priority (0 ... N) of the zone. More...
 
int m_ZoneClearance
 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. More...
 
double m_HatchFillTypeSmoothingValue
 Grid pattern chamfer distance/fillet value. More...
 
int m_NetcodeSelection
 Net code selection for the current zone. More...
 
LSET m_Layers
 
PCB_LAYER_ID m_CurrentZone_Layer
 Layer used to create the current zone. More...
 
int m_Zone_HatchingStyle
 Option to show the zone area (outlines only, short hatches or full hatches. More...
 
int m_ArcToSegmentsCount
 Option to select number of segments to approximate a circle 16 or 32 segments. 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...
 
ZoneConnection m_PadConnection
 
bool m_isKeepout
 
bool m_keepoutDoNotAllowCopperPour
 
bool m_keepoutDoNotAllowVias
 
bool m_keepoutDoNotAllowTracks
 

Detailed Description

Class 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 49 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 52 of file zone_settings.h.

Constructor & Destructor Documentation

◆ ZONE_SETTINGS()

ZONE_SETTINGS::ZONE_SETTINGS ( )

class ZONE_SETTINGS used to handle zones parameters

Definition at line 44 of file zone_settings.cpp.

45 {
46  m_ZonePriority = 0;
47  m_FillMode = ZFM_POLYGONS; // Mode for filling zone : 1 use segments, 0 use polygons
48  // Zone clearance value
50  // Min thickness value in filled areas (this is the minimum width of copper to fill solid areas) :
52  m_HatchFillTypeThickness = 0; // good value of grid line thickness if m_FillMode = ZFM_GRID_PATTERN
53  m_HatchFillTypeGap = 0; // good value of grid line gap if m_FillMode = ZFM_GRID_PATTERN
54  m_HatchFillTypeOrientation = 0.0; // Grid style: orientation of grid lines in degrees
55  m_HatchFillTypeSmoothingLevel = 0; // Grid pattern smoothing type. 0 = no smoothing
56  m_HatchFillTypeSmoothingValue = 0.1; // Grid pattern chamfer value relative to the gap value
57  m_NetcodeSelection = 0; // Net code selection for the current zone
58  m_CurrentZone_Layer = F_Cu; // Layer used to create the current zone
59  m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; // Option to show the zone area (outlines only,
60  //short hatches or full hatches
61 
62  m_ArcToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF; // Option to select number of segments to approximate a circle
63  // ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
64  // or ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF segments
65 
66  // thickness of the gap in thermal reliefs:
68  // thickness of the copper bridge in thermal reliefs:
70 
71  m_PadConnection = PAD_ZONE_CONN_THERMAL; // How pads are covered by copper in zone
72 
73  m_Zone_45_Only = false;
74 
76  m_cornerRadius = 0;
77 
78  SetIsKeepout( false );
79  SetDoNotAllowCopperPour( false );
80  SetDoNotAllowVias( true );
81  SetDoNotAllowTracks( true );
82 }
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
Definition: zone_settings.h:81
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
Definition: zone_settings.h:84
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
Definition: zone_settings.h:87
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type.
Definition: zone_settings.h:69
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:68
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:67
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL
Definition: zones.h:39
void SetDoNotAllowVias(bool aEnable)
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:74
ZoneConnection m_PadConnection
Definition: zone_settings.h:94
int m_cornerSmoothingType
Corner smoothing type.
Definition: zone_settings.h:92
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:62
#define ZONE_CLEARANCE_MIL
Definition: zones.h:42
int m_ZoneClearance
Clearance value.
Definition: zone_settings.h:64
void SetIsKeepout(bool aEnable)
void SetDoNotAllowTracks(bool aEnable)
#define ZONE_THICKNESS_MIL
Definition: zones.h:40
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:60
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:71
void SetDoNotAllowCopperPour(bool aEnable)
#define ZONE_THERMAL_RELIEF_GAP_MIL
Definition: zones.h:38
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
Definition: zone_settings.h:93
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:66
#define ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF
Definition: pcbnew.h:42
Use thermal relief for pads.
Definition: zones.h:53
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:78
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
Definition: zone_settings.h:86
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:65

References ARC_APPROX_SEGMENTS_COUNT_HIGH_DEF, ZONE_CONTAINER::DIAGONAL_EDGE, F_Cu, m_ArcToSegmentsCount, m_cornerRadius, m_cornerSmoothingType, m_CurrentZone_Layer, m_FillMode, m_HatchFillTypeGap, m_HatchFillTypeOrientation, m_HatchFillTypeSmoothingLevel, m_HatchFillTypeSmoothingValue, m_HatchFillTypeThickness, m_NetcodeSelection, m_PadConnection, m_ThermalReliefCopperBridge, m_ThermalReliefGap, m_Zone_45_Only, m_Zone_HatchingStyle, m_ZoneClearance, m_ZoneMinThickness, m_ZonePriority, PAD_ZONE_CONN_THERMAL, SetDoNotAllowCopperPour(), SetDoNotAllowTracks(), SetDoNotAllowVias(), SetIsKeepout(), SMOOTHING_NONE, ZFM_POLYGONS, 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 117 of file zone_settings.cpp.

118 {
119  aTarget.SetFillMode( m_FillMode );
132  aTarget.SetCornerRadius( m_cornerRadius );
133  aTarget.SetIsKeepout( GetIsKeepout() );
137  aTarget.SetHV45( m_Zone_45_Only );
138 
139  if( aFullExport )
140  {
141  aTarget.SetPriority( m_ZonePriority );
142  aTarget.SetNetCode( m_NetcodeSelection );
143 
144  // Keepout zones can have multiple layers
145  if( m_isKeepout )
146  {
147  aTarget.SetLayerSet( m_Layers );
148  }
149  else
150  {
151  aTarget.SetLayer( m_CurrentZone_Layer );
152  }
153  }
154 
155  // call SetHatch last, because hatch lines will be rebuilt,
156  // using new parameters values
157  aTarget.SetHatch( m_Zone_HatchingStyle, aTarget.GetDefaultHatchPitch(), true );
158 }
void SetDoNotAllowTracks(bool aEnable)
Definition: class_zone.h:659
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
Definition: zone_settings.h:81
void SetCornerSmoothingType(int aType)
Definition: class_zone.h:617
void SetHatchFillTypeSmoothingLevel(int aLevel)
Definition: class_zone.h:218
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
Definition: zone_settings.h:84
void SetHatchFillTypeSmoothingValue(double aValue)
Definition: class_zone.h:221
void SetCornerRadius(unsigned int aRadius)
Definition: class_zone.cpp:644
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
Definition: zone_settings.h:87
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type.
Definition: zone_settings.h:69
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:68
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:67
void SetArcSegmentCount(int aArcSegCount)
Definition: class_zone.h:184
void SetHatch(int aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Function SetHatch sets all hatch parameters for the zone.
static int GetDefaultHatchPitch()
Function GetDefaultHatchPitchMils.
void SetDoNotAllowVias(bool aEnable)
Definition: class_zone.h:658
void SetPriority(unsigned aPriority)
Function SetPriority.
Definition: class_zone.h:90
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:74
ZoneConnection m_PadConnection
Definition: zone_settings.h:94
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:220
void SetHatchFillTypeGap(int aStep)
Definition: class_zone.h:212
int m_cornerSmoothingType
Corner smoothing type.
Definition: zone_settings.h:92
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:62
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Function SetLayer sets the layer this item is on.
Definition: class_zone.cpp:212
int m_ZoneClearance
Clearance value.
Definition: zone_settings.h:64
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode 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:194
const bool GetDoNotAllowTracks() const
void SetThermalReliefCopperBridge(int aThermalReliefCopperBridge)
Definition: class_zone.h:175
void SetDoNotAllowCopperPour(bool aEnable)
Definition: class_zone.h:657
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:60
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition: class_zone.h:169
void SetHatchFillTypeOrientation(double aStep)
Definition: class_zone.h:215
const bool GetDoNotAllowCopperPour() const
void SetHV45(bool aConstrain)
Definition: class_zone.h:711
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:71
void SetHatchFillTypeThickness(int aThickness)
Definition: class_zone.h:209
void SetIsKeepout(bool aEnable)
Definition: class_zone.h:656
void SetPadConnection(ZoneConnection aPadConnection)
Definition: class_zone.h:197
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
Definition: zone_settings.h:93
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:200
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:66
void SetThermalReliefGap(int aThermalReliefGap)
Definition: class_zone.h:172
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:78
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
Definition: zone_settings.h:86
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:65

References ZONE_CONTAINER::GetDefaultHatchPitch(), GetDoNotAllowCopperPour(), GetDoNotAllowTracks(), GetDoNotAllowVias(), GetIsKeepout(), m_ArcToSegmentsCount, m_cornerRadius, m_cornerSmoothingType, m_CurrentZone_Layer, m_FillMode, m_HatchFillTypeGap, m_HatchFillTypeOrientation, m_HatchFillTypeSmoothingLevel, m_HatchFillTypeSmoothingValue, m_HatchFillTypeThickness, m_isKeepout, m_Layers, m_NetcodeSelection, m_PadConnection, m_ThermalReliefCopperBridge, m_ThermalReliefGap, m_Zone_45_Only, m_Zone_HatchingStyle, m_ZoneClearance, m_ZoneMinThickness, m_ZonePriority, ZONE_CONTAINER::SetArcSegmentCount(), ZONE_CONTAINER::SetCornerRadius(), ZONE_CONTAINER::SetCornerSmoothingType(), ZONE_CONTAINER::SetDoNotAllowCopperPour(), 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::SetLayer(), ZONE_CONTAINER::SetLayerSet(), ZONE_CONTAINER::SetMinThickness(), BOARD_CONNECTED_ITEM::SetNetCode(), ZONE_CONTAINER::SetPadConnection(), ZONE_CONTAINER::SetPriority(), ZONE_CONTAINER::SetThermalReliefCopperBridge(), ZONE_CONTAINER::SetThermalReliefGap(), and ZONE_CONTAINER::SetZoneClearance().

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

◆ GetCornerRadius()

unsigned int ZONE_SETTINGS::GetCornerRadius ( ) const
inline

Definition at line 143 of file zone_settings.h.

143 { return m_cornerRadius; }
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
Definition: zone_settings.h:93

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

◆ 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 151 of file zone_settings.h.

151 { return m_isKeepout; }

References m_isKeepout.

Referenced by PCB_EDIT_FRAME::Begin_Zone(), and ExportSetting().

◆ GetPadConnection()

ZoneConnection ZONE_SETTINGS::GetPadConnection ( ) const
inline

Definition at line 145 of file zone_settings.h.

145 { return m_PadConnection; }
ZoneConnection m_PadConnection
Definition: zone_settings.h:94

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 85 of file zone_settings.cpp.

86 {
87  m_ZonePriority = aSource.GetPriority();
88  m_FillMode = aSource.GetFillMode();
96  m_NetcodeSelection = aSource.GetNetCode();
101  m_PadConnection = aSource.GetPadConnection();
103  m_cornerRadius = aSource.GetCornerRadius();
104  m_isKeepout = aSource.GetIsKeepout();
108  m_Zone_45_Only = aSource.GetHV45();
109 
110  m_CurrentZone_Layer = aSource.GetLayer();
111  m_Layers = aSource.GetLayerSet();
112 
113  return *this;
114 }
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
Definition: zone_settings.h:81
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
Definition: zone_settings.h:84
int GetNetCode() const
Function GetNetCode.
int GetThermalReliefCopperBridge(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:635
int GetHatchFillTypeThickness() const
Definition: class_zone.h:208
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
Definition: zone_settings.h:87
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type.
Definition: zone_settings.h:69
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:68
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:185
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:67
double GetHatchFillTypeOrientation() const
Definition: class_zone.h:214
double GetHatchFillTypeSmoothingValue() const
Definition: class_zone.h:220
int GetThermalReliefGap(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:626
bool GetDoNotAllowVias() const
Definition: class_zone.h:653
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:243
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:74
ZoneConnection m_PadConnection
Definition: zone_settings.h:94
int GetArcSegmentCount() const
Definition: class_zone.h:185
HATCH_STYLE GetHatchStyle() const
Definition: class_zone.h:547
unsigned int GetCornerRadius() const
Definition: class_zone.h:623
int m_cornerSmoothingType
Corner smoothing type.
Definition: zone_settings.h:92
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:170
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:62
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:652
int m_ZoneClearance
Clearance value.
Definition: zone_settings.h:64
int GetCornerSmoothingType() const
Definition: class_zone.h:619
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:651
bool GetHV45() const
Definition: class_zone.h:710
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:60
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:96
ZoneConnection GetPadConnection(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:999
bool m_keepoutDoNotAllowCopperPour
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:71
int GetMinThickness() const
Definition: class_zone.h:199
bool GetDoNotAllowTracks() const
Definition: class_zone.h:654
int GetHatchFillTypeSmoothingLevel() const
Definition: class_zone.h:217
bool m_keepoutDoNotAllowTracks
int GetZoneClearance() const
Definition: class_zone.h:193
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
Definition: zone_settings.h:93
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:66
int GetHatchFillTypeGap() const
Definition: class_zone.h:211
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:78
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
Definition: zone_settings.h:86
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:65
bool m_keepoutDoNotAllowVias

References ZONE_CONTAINER::GetArcSegmentCount(), ZONE_CONTAINER::GetCornerRadius(), ZONE_CONTAINER::GetCornerSmoothingType(), ZONE_CONTAINER::GetDoNotAllowCopperPour(), 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::GetLayer(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::GetPadConnection(), ZONE_CONTAINER::GetPriority(), ZONE_CONTAINER::GetThermalReliefCopperBridge(), ZONE_CONTAINER::GetThermalReliefGap(), ZONE_CONTAINER::GetZoneClearance(), m_ArcToSegmentsCount, m_cornerRadius, m_cornerSmoothingType, m_CurrentZone_Layer, m_FillMode, m_HatchFillTypeGap, m_HatchFillTypeOrientation, m_HatchFillTypeSmoothingLevel, m_HatchFillTypeSmoothingValue, m_HatchFillTypeThickness, m_isKeepout, m_keepoutDoNotAllowCopperPour, m_keepoutDoNotAllowTracks, m_keepoutDoNotAllowVias, m_Layers, m_NetcodeSelection, m_PadConnection, 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 161 of file zone_settings.cpp.

162 {
163  if( aRadius < 0 )
164  m_cornerRadius = 0;
165  else
166  m_cornerRadius = aRadius;
167 }
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
Definition: zone_settings.h:93

References m_cornerRadius.

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

◆ SetCornerSmoothingType()

void ZONE_SETTINGS::SetCornerSmoothingType ( int  aType)
inline

◆ SetDoNotAllowCopperPour()

void ZONE_SETTINGS::SetDoNotAllowCopperPour ( 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

◆ SetPadConnection()

void ZONE_SETTINGS::SetPadConnection ( ZoneConnection  aPadConnection)
inline

Definition at line 146 of file zone_settings.h.

146 { m_PadConnection = aPadConnection; }
ZoneConnection m_PadConnection
Definition: zone_settings.h:94

References m_PadConnection.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions().

◆ SetupLayersList()

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

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

Parameters
aShowCopperindicates whether copper or technical layers should be shown

Definition at line 178 of file zone_settings.cpp.

180 {
181  BOARD* board = aFrame->GetBoard();
182  COLOR4D backgroundColor = aFrame->Settings().Colors().GetLayerColor( LAYER_PCB_BACKGROUND );
183  LSET layers = aShowCopper ? LSET::AllCuMask( board->GetCopperLayerCount() )
184  : LSET::AllNonCuMask();
185 
186  wxDataViewColumn* checkColumn = aList->AppendToggleColumn( wxEmptyString );
187  wxDataViewColumn* layerColumn = aList->AppendIconTextColumn( wxEmptyString );
188  wxDataViewColumn* layerIDColumn = aList->AppendTextColumn( wxEmptyString );
189  layerIDColumn->SetHidden( true );
190 
191  int textWidth = 0;
192 
193  for( LSEQ layer = layers.UIOrder(); layer; ++layer )
194  {
195  PCB_LAYER_ID layerID = *layer;
196  wxString layerName = board->GetLayerName( layerID );
197 
198  // wxCOL_WIDTH_AUTOSIZE doesn't work on all platforms, so we calculate width here
199  textWidth = std::max( textWidth, GetTextSize( layerName, aList ).x );
200 
201  COLOR4D layerColor = aFrame->Settings().Colors().GetLayerColor( layerID );
202  auto bitmap = COLOR_SWATCH::MakeBitmap( layerColor, backgroundColor, LAYER_BITMAP_SIZE );
203  wxIcon icon;
204  icon.CopyFromBitmap( bitmap );
205 
206  wxVector<wxVariant> row;
207  row.push_back( wxVariant( m_Layers.test( layerID ) ) );
208  row.push_back( wxVariant( wxDataViewIconText( layerName, icon ) ) );
209  row.push_back( wxVariant( wxString::Format( "%i", layerID ) ) );
210  aList->AppendItem( row );
211 
212  if( m_CurrentZone_Layer == layerID )
213  aList->SetToggleValue( true, (unsigned) aList->GetItemCount() - 1, 0 );
214  }
215 
216  int checkColSize = 22;
217  int layerColSize = textWidth + LAYER_BITMAP_SIZE.x + 15;
218 
219  // You'd think the fact that m_layers is a list would encourage wxWidgets not to save room
220  // for the tree expanders... but you'd be wrong. Force indent to 0.
221  aList->SetIndent( 0 );
222  aList->SetMinClientSize( wxSize( checkColSize + layerColSize, aList->GetMinClientSize().y ) );
223 
224  checkColumn->SetWidth( checkColSize );
225  layerColumn->SetWidth( layerColSize );
226 }
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:676
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
Definition: lset.cpp:699
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:115
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
PCB_LAYER_ID
A quick note on layer IDs:
Class LSET is a set of PCB_LAYER_IDs.
PCB_GENERAL_SETTINGS & Settings()
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize)
Make a simple color swatch bitmap.
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
COLORS_DESIGN_SETTINGS & Colors()
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
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
int GetCopperLayerCount() const
Function GetCopperLayerCount.
BOARD * GetBoard() const
static const wxSize LAYER_BITMAP_SIZE(24, 16)
LSEQ UIOrder() const
Definition: lset.cpp:803
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:78
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References LSET::AllCuMask(), LSET::AllNonCuMask(), PCB_GENERAL_SETTINGS::Colors(), Format(), PCB_BASE_FRAME::GetBoard(), BOARD::GetCopperLayerCount(), COLORS_DESIGN_SETTINGS::GetLayerColor(), BOARD::GetLayerName(), GetTextSize(), LAYER_BITMAP_SIZE(), LAYER_PCB_BACKGROUND, m_CurrentZone_Layer, m_Layers, COLOR_SWATCH::MakeBitmap(), max, PCB_BASE_FRAME::Settings(), 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_ArcToSegmentsCount

int ZONE_SETTINGS::m_ArcToSegmentsCount

Option to select number of segments to approximate a circle 16 or 32 segments.

Definition at line 84 of file zone_settings.h.

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

◆ m_cornerRadius

unsigned int ZONE_SETTINGS::m_cornerRadius
private

Corner chamfer distance / fillet radius.

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

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

◆ m_CurrentZone_Layer

◆ 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 99 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowCopperPour

bool ZONE_SETTINGS::m_keepoutDoNotAllowCopperPour
private

Definition at line 104 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowTracks

bool ZONE_SETTINGS::m_keepoutDoNotAllowTracks
private

Definition at line 106 of file zone_settings.h.

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

◆ m_keepoutDoNotAllowVias

bool ZONE_SETTINGS::m_keepoutDoNotAllowVias
private

Definition at line 105 of file zone_settings.h.

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

◆ m_Layers

◆ m_NetcodeSelection

◆ m_PadConnection

ZoneConnection ZONE_SETTINGS::m_PadConnection
private

◆ m_ThermalReliefCopperBridge

long ZONE_SETTINGS::m_ThermalReliefCopperBridge

thickness of the copper bridge in thermal reliefs

Definition at line 87 of file zone_settings.h.

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

◆ m_ThermalReliefGap

long ZONE_SETTINGS::m_ThermalReliefGap

◆ m_Zone_45_Only

◆ m_Zone_HatchingStyle

◆ m_ZoneClearance

◆ m_ZoneMinThickness

◆ m_ZonePriority


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