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 
46 enum class ZONE_HATCH_STYLE
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 
80 
82 
91 
94 
95  wxString m_Name;
96 
98 
101 
104 
106 
107 private:
109  unsigned int m_cornerRadius;
111 
112  /* A zone outline can be a keepout zone.
113  * It will be never filled, and DRC should test for pads, tracks and vias
114  */
116 
117  /* For keepout zones only:
118  * what is not allowed inside the keepout ( pads, tracks and vias )
119  */
125 
127  long long int m_minIslandArea;
128 
129 public:
130  ZONE_SETTINGS();
131 
138  ZONE_SETTINGS& operator << ( const ZONE_CONTAINER& aSource );
139 
147  void SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame,
148  bool aShowCopper, bool aFpEditorMode = false );
149 
159  void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true ) const;
160 
161  void SetCornerSmoothingType( int aType) { m_cornerSmoothingType = aType; }
162 
164 
165  void SetCornerRadius( int aRadius );
166 
167  unsigned int GetCornerRadius() const { return m_cornerRadius; }
168 
170  {
171  return m_PadConnection;
172  }
173 
174  void SetPadConnection( ZONE_CONNECTION aPadConnection )
175  {
176  m_PadConnection = aPadConnection;
177  }
178 
182  const bool GetIsKeepout() const { return m_isKeepout; }
184  const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
185  const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
186  const bool GetDoNotAllowPads() const { return m_keepoutDoNotAllowPads; }
188 
189  void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
190  void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
191  void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
192  void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
193  void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; }
194  void SetDoNotAllowFootprints( bool aEnable ) { m_keepoutDoNotAllowFootprints = aEnable; }
195 
198 
199  long long int GetMinIslandArea() const { return m_minIslandArea; }
200  void SetMinIslandArea( long long int aArea ) { m_minIslandArea = aArea; }
201 };
202 
203 
204 #endif // ZONE_SETTINGS_H_
void SetMinIslandArea(long long int aArea)
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
LSET m_Layers
Layers that this zone exists on.
Definition: zone_settings.h:97
const bool GetDoNotAllowFootprints() const
long long int GetMinIslandArea() const
void SetCornerSmoothingType(int aType)
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 GetCornerSmoothingType() const
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
ZONE_CONNECTION m_PadConnection
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
ZONE_CONNECTION GetPadConnection() const
unsigned int GetCornerRadius() const
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowVias(bool aEnable)
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:93
LSET is a set of PCB_LAYER_IDs.
void SetPadConnection(ZONE_CONNECTION aPadConnection)
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.
bool m_keepoutDoNotAllowPads
int m_ZoneClearance
Minimal clearance value.
Definition: zone_settings.h:83
void SetIsKeepout(bool aEnable)
const bool GetDoNotAllowVias() const
const bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
void SetDoNotAllowTracks(bool aEnable)
void ExportSetting(ZONE_CONTAINER &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
const bool GetDoNotAllowTracks() const
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:67
ZONE_SETTINGS()
class ZONE_SETTINGS used to handle zones parameters
const bool GetDoNotAllowPads() const
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:79
Board layer functions and definitions.
ZONE_HATCH_STYLE
Zone hatch styles.
Definition: zone_settings.h:46
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
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:90
bool m_keepoutDoNotAllowFootprints
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
Corner chamfer distance / fillet radius.
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:85
ZONE_SETTINGS & operator<<(const ZONE_CONTAINER &aSource)
operator << ( const ZONE_CONTAINER& ) was Function ImportSetting copies settings from a given zone in...
ZONE_FILL_MODE
Definition: zone_settings.h:38
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
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