KiCad PCB EDA Suite
zone_settings.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2008-2018 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef ZONE_SETTINGS_H_
31 #define ZONE_SETTINGS_H_
32 
34 #include <zones.h>
35 
36 class wxDataViewListCtrl;
37 
38 enum class ZONE_FILL_MODE
39 {
40  POLYGONS = 0, // fill zone with polygons
41  HATCH_PATTERN = 1 // fill zone using a grid pattern
42 };
43 
44 
47 {
48  NO_HATCH,
51 };
52 
55 {
56  ALWAYS,
57  NEVER,
58  AREA
59 };
60 
68 {
69 public:
70  // the actual zone outline shape can be slightly modified (smoothed):
71  enum {
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  };
78 
79  int m_ZonePriority; // Priority (0 ... N) of the zone
80 
82  int m_ZoneClearance; // Minimal clearance value
83  int m_ZoneMinThickness; // Min thickness value in filled areas
84  int m_HatchThickness; // HatchBorder thickness of lines (if 0 -> solid shape)
85  int m_HatchGap; // HatchBorder clearance between lines (0 -> solid shape)
86  double m_HatchOrientation; // HatchBorder orientation of grid lines in degrees
87  int m_HatchSmoothingLevel; // HatchBorder smoothing type, similar to corner smoothing type
88  // 0 = no smoothing, 1 = fillet, >= 2 = arc
89  double m_HatchSmoothingValue; // HatchBorder chamfer/fillet size as a ratio of hole size
90  double m_HatchHoleMinArea; // min size before holes are dropped (ratio)
91  int m_HatchBorderAlgorithm; // 0 = use min zone thickness
92 
93  int m_NetcodeSelection; // Net code selection for the current zone
94 
95  wxString m_Name; // Unique name for the current zone (can be blank)
96 
97  LSET m_Layers; // Layers that this zone exists on
98 
101 
102  long m_ThermalReliefGap; // thickness of the gap in thermal reliefs
103  long m_ThermalReliefSpokeWidth; // thickness of the copper bridge in thermal reliefs
104 
106 
107 private:
108  int m_cornerSmoothingType; // Corner smoothing type
109  unsigned int m_cornerRadius; // Corner chamfer distance / fillet radius
111 
112  /*
113  * Keepout zones and keepout flags.
114  * Note that DRC rules can set keepouts on zones whether they're a keepout or not.
115  */
117 
123 
125  long long int m_minIslandArea;
126 
127 public:
128  ZONE_SETTINGS();
129 
136  ZONE_SETTINGS& operator << ( const ZONE& aSource );
137 
145  void SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame,
146  bool aShowCopper, bool aFpEditorMode = false );
147 
157  void ExportSetting( ZONE& aTarget, bool aFullExport = true ) const;
158 
159  void SetCornerSmoothingType( int aType) { m_cornerSmoothingType = aType; }
160 
162 
163  void SetCornerRadius( int aRadius );
164 
165  unsigned int GetCornerRadius() const { return m_cornerRadius; }
166 
168  {
169  return m_padConnection;
170  }
171 
172  void SetPadConnection( ZONE_CONNECTION aPadConnection )
173  {
174  m_padConnection = aPadConnection;
175  }
176 
180  const bool GetIsRuleArea() const { return m_isRuleArea; }
182  const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
183  const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
184  const bool GetDoNotAllowPads() const { return m_keepoutDoNotAllowPads; }
186 
187  void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; }
188  void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
189  void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
190  void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
191  void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; }
192  void SetDoNotAllowFootprints( bool aEnable ) { m_keepoutDoNotAllowFootprints = aEnable; }
193 
196 
197  long long int GetMinIslandArea() const { return m_minIslandArea; }
198  void SetMinIslandArea( long long int aArea ) { m_minIslandArea = aArea; }
199 };
200 
201 
202 #endif // ZONE_SETTINGS_H_
int m_HatchSmoothingLevel
Definition: zone_settings.h:87
void SetMinIslandArea(long long int aArea)
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
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 SetCornerSmoothingType(int aType)
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 GetCornerSmoothingType() const
long long int m_minIslandArea
ISLAND_REMOVAL_MODE m_removeIslands
wxString m_Name
Definition: zone_settings.h:95
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
ZONE_CONNECTION GetPadConnection() const
unsigned int GetCornerRadius() const
ZONE_SETTINGS & operator<<(const ZONE &aSource)
operator << ( const ZONE& ) was Function ImportSetting copies settings from a given zone into this ob...
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowVias(bool aEnable)
int m_NetcodeSelection
Definition: zone_settings.h:93
LSET is a set of PCB_LAYER_IDs.
void SetPadConnection(ZONE_CONNECTION aPadConnection)
int m_cornerSmoothingType
void SetDoNotAllowPads(bool aEnable)
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
bool m_keepoutDoNotAllowPads
const bool GetDoNotAllowVias() const
ZONE handles a list of polygons defining a copper zone.
Definition: zone.h:57
void SetDoNotAllowTracks(bool aEnable)
void SetIsRuleArea(bool aEnable)
const bool GetDoNotAllowTracks() const
ZONE_CONNECTION m_padConnection
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:67
ZONE_SETTINGS()
class ZONE_SETTINGS used to handle zones parameters
const bool GetDoNotAllowPads() const
int m_HatchBorderAlgorithm
Definition: zone_settings.h:91
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:81
long m_ThermalReliefSpokeWidth
Board layer functions and definitions.
ISLAND_REMOVAL_MODE
Whether or not to remove isolated islands from a zone.
Definition: zone_settings.h:54
bool m_keepoutDoNotAllowCopperPour
void SetCornerRadius(int aRadius)
const bool GetDoNotAllowCopperPour() const
bool m_keepoutDoNotAllowFootprints
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:46
void SetDoNotAllowCopperPour(bool aEnable)
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).
bool m_keepoutDoNotAllowTracks
unsigned int m_cornerRadius
ZONE_FILL_MODE
Definition: zone_settings.h:38
double m_HatchOrientation
Definition: zone_settings.h:86
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
long m_ThermalReliefGap
int m_ZoneMinThickness
Definition: zone_settings.h:83
bool m_keepoutDoNotAllowVias