KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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, [email protected]
5 * Copyright (C) 1992-2022 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
33#include <layer_ids.h>
34#include <lset.h>
35#include <zones.h>
36#include <geometry/eda_angle.h>
38
39class wxDataViewListCtrl;
40
42{
43 POLYGONS = 0, // fill zone with polygons
44 HATCH_PATTERN = 1 // fill zone using a grid pattern
45};
46
47
50{
54 INVISIBLE_BORDER // Disable outline drawing for very special cases
55};
56
59{
60 ALWAYS = 0,
61 NEVER,
62 AREA
63};
64
72{
73public:
74 // the actual zone outline shape can be slightly modified (smoothed):
75 enum {
77 SMOOTHING_NONE = 0, // Zone outline is used without change
78 SMOOTHING_CHAMFER, // Zone outline is used after chamfering corners
79 SMOOTHING_FILLET, // Zone outline is used after rounding corners
80 SMOOTHING_LAST // sentinel
81 };
82
83 unsigned m_ZonePriority; // Priority (0 ... N) of the zone
84
86 int m_ZoneClearance; // Minimal clearance value
87 int m_ZoneMinThickness; // Min thickness value in filled areas
88 int m_HatchThickness; // HatchBorder thickness of lines (if 0 -> solid shape)
89 int m_HatchGap; // HatchBorder clearance between lines (0 -> solid shape)
90 EDA_ANGLE m_HatchOrientation; // HatchBorder orientation of grid lines
91 int m_HatchSmoothingLevel; // HatchBorder smoothing type, similar to corner smoothing type
92 // 0 = no smoothing, 1 = fillet, >= 2 = arc
93 double m_HatchSmoothingValue; // HatchBorder chamfer/fillet size as a ratio of hole size
94 double m_HatchHoleMinArea; // min size before holes are dropped (ratio)
95 int m_HatchBorderAlgorithm; // 0 = use min zone thickness
96
97 int m_NetcodeSelection; // Net code selection for the current zone
98
99 wxString m_Name; // Unique name for the current zone (can be blank)
100
101 LSET m_Layers; // Layers that this zone exists on
102
105 int m_BorderHatchPitch; // for hatched outlines: dist between 2 hatches
106
107 long m_ThermalReliefGap; // thickness of the gap in thermal reliefs
108 long m_ThermalReliefSpokeWidth; // thickness of the copper bridge in thermal reliefs
109
111
112 /* A zone outline can be a teardrop zone with different rules
113 * priority, smoothed corners, thermal relief...
114 */
116
117private:
118 int m_cornerSmoothingType; // Corner smoothing type
119 unsigned int m_cornerRadius; // Corner chamfer distance / fillet radius
121
122 /*
123 * Keepout zones and keepout flags.
124 * Note that DRC rules can set keepouts on zones whether they're a keepout or not.
125 */
127
133
135 long long int m_minIslandArea;
136
137public:
139
140 bool operator==( const ZONE_SETTINGS& aOther ) const;
141
142 bool operator!=( const ZONE_SETTINGS& aOther ) const { return !operator==( aOther ); }
143
150 ZONE_SETTINGS& operator << ( const ZONE& aSource );
151
155 static const ZONE_SETTINGS& GetDefaultSettings();
156
163 void SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame, LSET aLayers,
164 bool aFpEditorMode );
165
175 void ExportSetting( ZONE& aTarget, bool aFullExport = true ) const;
176
177 void SetCornerSmoothingType( int aType) { m_cornerSmoothingType = aType; }
179
180 void SetCornerRadius( int aRadius );
181 unsigned int GetCornerRadius() const { return m_cornerRadius; }
182
184 void SetPadConnection( ZONE_CONNECTION aPadConnection ) { m_padConnection = aPadConnection; }
185
189 bool GetIsRuleArea() const { return m_isRuleArea; }
195
196 void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; }
197 void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
198 void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
199 void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
200 void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; }
201 void SetDoNotAllowFootprints( bool aEnable ) { m_keepoutDoNotAllowFootprints = aEnable; }
202
205
206 long long int GetMinIslandArea() const { return m_minIslandArea; }
207 void SetMinIslandArea( long long int aArea ) { m_minIslandArea = aArea; }
208};
209
210
211#endif // ZONE_SETTINGS_H_
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:35
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:72
bool GetDoNotAllowCopperPour() const
bool m_keepoutDoNotAllowPads
void SetIsRuleArea(bool aEnable)
bool operator==(const ZONE_SETTINGS &aOther) const
bool operator!=(const ZONE_SETTINGS &aOther) const
unsigned int m_cornerRadius
bool GetDoNotAllowTracks() const
EDA_ANGLE m_HatchOrientation
Definition: zone_settings.h:90
int m_HatchBorderAlgorithm
Definition: zone_settings.h:95
void SetDoNotAllowVias(bool aEnable)
bool GetDoNotAllowFootprints() const
int m_NetcodeSelection
Definition: zone_settings.h:97
long long int m_minIslandArea
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
bool m_keepoutDoNotAllowTracks
bool GetDoNotAllowPads() const
double m_HatchSmoothingValue
Definition: zone_settings.h:93
void SetMinIslandArea(long long int aArea)
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
int m_cornerSmoothingType
void SetDoNotAllowTracks(bool aEnable)
bool GetDoNotAllowVias() const
bool m_keepoutDoNotAllowCopperPour
ISLAND_REMOVAL_MODE m_removeIslands
double m_HatchHoleMinArea
Definition: zone_settings.h:94
void SetPadConnection(ZONE_CONNECTION aPadConnection)
int m_ZoneMinThickness
Definition: zone_settings.h:87
long long int GetMinIslandArea() const
long m_ThermalReliefSpokeWidth
ZONE_CONNECTION GetPadConnection() const
TEARDROP_TYPE m_TeardropType
static const ZONE_SETTINGS & GetDefaultSettings()
unsigned m_ZonePriority
Definition: zone_settings.h:83
void SetCornerRadius(int aRadius)
void SetupLayersList(wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, LSET aLayers, bool aFpEditorMode)
A helper routine for the various zone dialogs (copper, non-copper, keepout).
wxString m_Name
Definition: zone_settings.h:99
int GetCornerSmoothingType() const
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:85
ZONE_CONNECTION m_padConnection
long m_ThermalReliefGap
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowPads(bool aEnable)
void SetCornerSmoothingType(int aType)
int m_HatchSmoothingLevel
Definition: zone_settings.h:91
unsigned int GetCornerRadius() const
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
bool m_keepoutDoNotAllowFootprints
bool m_keepoutDoNotAllowVias
void SetDoNotAllowCopperPour(bool aEnable)
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
TEARDROP_TYPE
define the type of a teardrop: on a via or pad, or a track end
ISLAND_REMOVAL_MODE
Whether or not to remove isolated islands from a zone.
Definition: zone_settings.h:59
ZONE_FILL_MODE
Definition: zone_settings.h:42
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:50
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:47