KiCad PCB EDA Suite
ZONE_SETTINGS Class Reference

Class ZONE_SETTINGS handles zones parameters. More...

#include <class_zone_settings.h>

Public Types

enum  { SMOOTHING_NONE, 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 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

int m_FillMode
 Mode for filling zone : 1 use segments, 0 use polygons. More...
 
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_NetcodeSelection
 Net code selection for the current zone. More...
 
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 48 of file class_zone_settings.h.

Member Enumeration Documentation

anonymous enum
Enumerator
SMOOTHING_NONE 
SMOOTHING_CHAMFER 
SMOOTHING_FILLET 
SMOOTHING_LAST 

Definition at line 51 of file class_zone_settings.h.

Constructor & Destructor Documentation

ZONE_SETTINGS::ZONE_SETTINGS ( )

class ZONE_SETTINGS used to handle zones parameters

Definition at line 38 of file class_zone_settings.cpp.

References ARC_APPROX_SEGMENTS_COUNT_LOW_DEF, ZONE_CONTAINER::DIAGONAL_EDGE, F_Cu, m_ArcToSegmentsCount, m_cornerRadius, m_cornerSmoothingType, m_CurrentZone_Layer, m_FillMode, 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, ZONE_CLEARANCE_MIL, ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL, ZONE_THERMAL_RELIEF_GAP_MIL, and ZONE_THICKNESS_MIL.

39 {
40  m_ZonePriority = 0;
41  m_FillMode = 0; // Mode for filling zone : 1 use segments, 0 use polygons
42  // Zone clearance value
44  // Min thickness value in filled areas (this is the minimum width of copper to fill solid areas) :
46  m_NetcodeSelection = 0; // Net code selection for the current zone
47  m_CurrentZone_Layer = F_Cu; // Layer used to create the current zone
48  m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; // Option to show the zone area (outlines only, short hatches or full hatches
49 
50  m_ArcToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF; // Option to select number of segments to approximate a circle
51  // ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
52  // or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF segments
53 
54  // thickness of the gap in thermal reliefs:
56  // thickness of the copper bridge in thermal reliefs:
58 
59  m_PadConnection = PAD_ZONE_CONN_THERMAL; // How pads are covered by copper in zone
60 
61  m_Zone_45_Only = false;
62 
64  m_cornerRadius = 0;
65 
66  SetIsKeepout( false );
67  SetDoNotAllowCopperPour( false );
68  SetDoNotAllowVias( true );
69  SetDoNotAllowTracks( true );
70 }
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
#define ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
Definition: pcbnew.h:41
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
#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.
ZoneConnection m_PadConnection
int m_cornerSmoothingType
Corner smoothing type.
int m_ZonePriority
Priority (0 ... N) of the zone.
#define ZONE_CLEARANCE_MIL
Definition: zones.h:42
int m_ZoneClearance
Clearance value.
void SetIsKeepout(bool aEnable)
void SetDoNotAllowTracks(bool aEnable)
#define ZONE_THICKNESS_MIL
Definition: zones.h:40
int m_FillMode
Mode for filling zone : 1 use segments, 0 use polygons.
void SetDoNotAllowCopperPour(bool aEnable)
#define ZONE_THERMAL_RELIEF_GAP_MIL
Definition: zones.h:38
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
Use thermal relief for pads.
Definition: zones.h:58
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
int m_ZoneMinThickness
Min thickness value in filled areas.

Member Function Documentation

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 97 of file class_zone_settings.cpp.

References ZONE_CONTAINER::GetDefaultHatchPitch(), GetDoNotAllowCopperPour(), GetDoNotAllowTracks(), GetDoNotAllowVias(), GetIsKeepout(), m_ArcToSegmentsCount, m_cornerRadius, m_cornerSmoothingType, m_CurrentZone_Layer, m_FillMode, m_NetcodeSelection, m_PadConnection, m_ThermalReliefCopperBridge, m_ThermalReliefGap, 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::SetIsKeepout(), BOARD_ITEM::SetLayer(), 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(), PCB_EDIT_FRAME::duplicateZone(), PCB_EDIT_FRAME::Edit_Zone_Params(), DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones(), ZONE_CONTAINER::ZONE_CONTAINER(), and PCB_EDITOR_CONTROL::ZoneDuplicate().

98 {
99  aTarget.SetFillMode( m_FillMode );
107  aTarget.SetCornerRadius( m_cornerRadius );
108  aTarget.SetIsKeepout( GetIsKeepout() );
112 
113  if( aFullExport )
114  {
115  aTarget.SetPriority( m_ZonePriority );
116  aTarget.SetNetCode( m_NetcodeSelection );
117  aTarget.SetLayer( m_CurrentZone_Layer );
118  }
119 
120  // call SetHatch last, because hatch lines will be rebuilt,
121  // using new parameters values
122  aTarget.SetHatch( m_Zone_HatchingStyle, aTarget.GetDefaultHatchPitch(), true );
123 }
void SetDoNotAllowTracks(bool aEnable)
Definition: class_zone.h:662
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
void SetCornerSmoothingType(int aType)
Definition: class_zone.h:610
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
const bool GetDoNotAllowTracks() const
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
void SetCornerRadius(unsigned int aRadius)
Definition: class_zone.cpp:481
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
const bool GetDoNotAllowCopperPour() const
void SetArcSegmentCount(int aArcSegCount)
Definition: class_zone.h:197
void SetHatch(int aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Function SetHatch sets all hatch parameters for the zone.
Definition: class_zone.cpp:926
static int GetDefaultHatchPitch()
Function GetDefaultHatchPitchMils.
void SetDoNotAllowVias(bool aEnable)
Definition: class_zone.h:661
void SetPriority(unsigned aPriority)
Function SetPriority.
Definition: class_zone.h:113
int m_NetcodeSelection
Net code selection for the current zone.
ZoneConnection m_PadConnection
int m_cornerSmoothingType
Corner smoothing type.
const bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
int m_ZonePriority
Priority (0 ... N) of the zone.
int m_ZoneClearance
Clearance value.
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
void SetZoneClearance(int aZoneClearance)
Definition: class_zone.h:204
void SetThermalReliefCopperBridge(int aThermalReliefCopperBridge)
Definition: class_zone.h:191
void SetDoNotAllowCopperPour(bool aEnable)
Definition: class_zone.h:660
int m_FillMode
Mode for filling zone : 1 use segments, 0 use polygons.
const bool GetDoNotAllowVias() const
void SetIsKeepout(bool aEnable)
Definition: class_zone.h:659
void SetPadConnection(ZoneConnection aPadConnection)
Definition: class_zone.h:207
void SetFillMode(int aFillMode)
How to fill areas: 0 = use filled polygons, 1 => fill with segments.
Definition: class_zone.h:185
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:210
void SetThermalReliefGap(int aThermalReliefGap)
Definition: class_zone.h:188
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
int m_ZoneMinThickness
Min thickness value in filled areas.
unsigned int ZONE_SETTINGS::GetCornerRadius ( ) const
inline

Definition at line 126 of file class_zone_settings.h.

References m_cornerRadius.

Referenced by DIALOG_COPPER_ZONE::initDialog().

126 { return m_cornerRadius; }
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
int ZONE_SETTINGS::GetCornerSmoothingType ( ) const
inline

Definition at line 122 of file class_zone_settings.h.

References m_cornerSmoothingType.

Referenced by DIALOG_COPPER_ZONE::initDialog().

122 { return m_cornerSmoothingType; }
int m_cornerSmoothingType
Corner smoothing type.
const bool ZONE_SETTINGS::GetDoNotAllowCopperPour ( ) const
inline
const bool ZONE_SETTINGS::GetDoNotAllowTracks ( ) const
inline
const bool ZONE_SETTINGS::GetDoNotAllowVias ( ) const
inline
const bool ZONE_SETTINGS::GetIsKeepout ( ) const
inline

Accessors to parameters used in Keepout zones:

Definition at line 134 of file class_zone_settings.h.

References m_isKeepout.

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

134 { return m_isKeepout; }
ZoneConnection ZONE_SETTINGS::GetPadConnection ( ) const
inline

Definition at line 128 of file class_zone_settings.h.

References m_PadConnection.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), and DIALOG_COPPER_ZONE::initDialog().

128 { return m_PadConnection; }
ZoneConnection m_PadConnection
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 73 of file class_zone_settings.cpp.

References ZONE_CONTAINER::GetArcSegmentCount(), ZONE_CONTAINER::GetCornerRadius(), ZONE_CONTAINER::GetCornerSmoothingType(), ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetFillMode(), ZONE_CONTAINER::GetHatchStyle(), ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::GetLayer(), 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_isKeepout, m_keepoutDoNotAllowCopperPour, m_keepoutDoNotAllowTracks, m_keepoutDoNotAllowVias, m_NetcodeSelection, m_PadConnection, m_ThermalReliefCopperBridge, m_ThermalReliefGap, m_Zone_HatchingStyle, m_ZoneClearance, m_ZoneMinThickness, and m_ZonePriority.

74 {
75  m_ZonePriority = aSource.GetPriority();
76  m_FillMode = aSource.GetFillMode();
79  m_NetcodeSelection = aSource.GetNetCode();
80  m_CurrentZone_Layer = aSource.GetLayer();
87  m_cornerRadius = aSource.GetCornerRadius();
88  m_isKeepout = aSource.GetIsKeepout();
92 
93  return *this;
94 }
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
int GetMinThickness() const
Definition: class_zone.h:209
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:655
int GetArcSegmentCount() const
Definition: class_zone.h:198
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
int GetCornerSmoothingType() const
Definition: class_zone.h:612
int GetThermalReliefCopperBridge(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:472
unsigned int GetCornerRadius() const
Definition: class_zone.h:616
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:654
int m_NetcodeSelection
Net code selection for the current zone.
ZoneConnection m_PadConnection
ZoneConnection GetPadConnection(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:820
int m_cornerSmoothingType
Corner smoothing type.
int GetThermalReliefGap(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:463
int m_ZonePriority
Priority (0 ... N) of the zone.
int m_ZoneClearance
Clearance value.
int GetNetCode() const
Function GetNetCode.
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool GetDoNotAllowTracks() const
Definition: class_zone.h:657
int GetFillMode() const
Definition: class_zone.h:186
bool GetDoNotAllowVias() const
Definition: class_zone.h:656
bool m_keepoutDoNotAllowCopperPour
HATCH_STYLE GetHatchStyle() const
Definition: class_zone.h:549
int m_FillMode
Mode for filling zone : 1 use segments, 0 use polygons.
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:119
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
int GetZoneClearance() const
Definition: class_zone.h:203
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
int m_ZoneMinThickness
Min thickness value in filled areas.
void ZONE_SETTINGS::SetCornerRadius ( int  aRadius)

Definition at line 126 of file class_zone_settings.cpp.

References m_cornerRadius, and MAX_ZONE_CORNER_RADIUS_MILS.

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

127 {
128  if( aRadius > Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
130  else if( aRadius < 0 )
131  m_cornerRadius = 0;
132  else
133  m_cornerRadius = aRadius;
134 };
unsigned int m_cornerRadius
Corner chamfer distance / fillet radius.
#define MAX_ZONE_CORNER_RADIUS_MILS
void ZONE_SETTINGS::SetCornerSmoothingType ( int  aType)
inline

Definition at line 120 of file class_zone_settings.h.

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

120 { m_cornerSmoothingType = aType; }
int m_cornerSmoothingType
Corner smoothing type.
void ZONE_SETTINGS::SetDoNotAllowCopperPour ( bool  aEnable)
inline
void ZONE_SETTINGS::SetDoNotAllowTracks ( bool  aEnable)
inline
void ZONE_SETTINGS::SetDoNotAllowVias ( bool  aEnable)
inline
void ZONE_SETTINGS::SetIsKeepout ( bool  aEnable)
inline
void ZONE_SETTINGS::SetPadConnection ( ZoneConnection  aPadConnection)
inline

Definition at line 129 of file class_zone_settings.h.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions().

129 { m_PadConnection = aPadConnection; }
ZoneConnection m_PadConnection

Member Data Documentation

int ZONE_SETTINGS::m_ArcToSegmentsCount

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

Definition at line 73 of file class_zone_settings.h.

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

unsigned int ZONE_SETTINGS::m_cornerRadius
private

Corner chamfer distance / fillet radius.

Definition at line 82 of file class_zone_settings.h.

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

int ZONE_SETTINGS::m_cornerSmoothingType
private

Corner smoothing type.

Definition at line 81 of file class_zone_settings.h.

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

int ZONE_SETTINGS::m_FillMode

Mode for filling zone : 1 use segments, 0 use polygons.

Definition at line 59 of file class_zone_settings.h.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), ExportSetting(), DIALOG_COPPER_ZONE::initDialog(), DIALOG_NON_COPPER_ZONES_EDITOR::OnOkClick(), operator<<(), and ZONE_SETTINGS().

bool ZONE_SETTINGS::m_isKeepout
private

Definition at line 88 of file class_zone_settings.h.

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

bool ZONE_SETTINGS::m_keepoutDoNotAllowCopperPour
private

Definition at line 93 of file class_zone_settings.h.

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

bool ZONE_SETTINGS::m_keepoutDoNotAllowTracks
private

Definition at line 95 of file class_zone_settings.h.

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

bool ZONE_SETTINGS::m_keepoutDoNotAllowVias
private

Definition at line 94 of file class_zone_settings.h.

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

ZoneConnection ZONE_SETTINGS::m_PadConnection
private

Definition at line 83 of file class_zone_settings.h.

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

long ZONE_SETTINGS::m_ThermalReliefCopperBridge

thickness of the copper bridge in thermal reliefs

Definition at line 76 of file class_zone_settings.h.

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

long ZONE_SETTINGS::m_ThermalReliefGap
int ZONE_SETTINGS::m_ZonePriority

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