KiCad PCB EDA Suite
Loading...
Searching...
No Matches
color_settings.cpp
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) 2020 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <layer_ids.h>
24#include <settings/parameters.h>
26#include <wx/log.h>
27#include <wx/translation.h>
28
30
31
33const int colorsSchemaVersion = 5;
34const wxString COLOR_SETTINGS::COLOR_BUILTIN_DEFAULT = "_builtin_default";
35const wxString COLOR_SETTINGS::COLOR_BUILTIN_CLASSIC = "_builtin_classic";
36
37
38COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) :
41{
42 if( aAbsolutePath )
44
45 m_params.emplace_back( new PARAM<wxString>( "meta.name", &m_displayName,
46 wxS( "KiCad Default" ) ) );
47
48 m_params.emplace_back( new PARAM<bool>( "schematic.override_item_colors",
49 &m_overrideSchItemColors, false ) );
50
51#define CLR( x, y ) \
52 wxASSERT( s_defaultTheme.count( y ) ); \
53 m_params.emplace_back( new COLOR_MAP_PARAM( x, y, s_defaultTheme.at( y ), &m_colors ) );
54
55 CLR( "schematic.anchor", LAYER_SCHEMATIC_ANCHOR );
56 CLR( "schematic.aux_items", LAYER_SCHEMATIC_AUX_ITEMS );
57 CLR( "schematic.background", LAYER_SCHEMATIC_BACKGROUND );
58 CLR( "schematic.hovered", LAYER_HOVERED );
59 CLR( "schematic.brightened", LAYER_BRIGHTENED );
60 CLR( "schematic.bus", LAYER_BUS );
61 CLR( "schematic.bus_junction", LAYER_BUS_JUNCTION );
62 CLR( "schematic.component_body", LAYER_DEVICE_BACKGROUND );
63 CLR( "schematic.component_outline", LAYER_DEVICE );
64 CLR( "schematic.cursor", LAYER_SCHEMATIC_CURSOR );
65 CLR( "schematic.dnp_marker", LAYER_DNP_MARKER );
66 CLR( "schematic.excluded_from_sim", LAYER_EXCLUDED_FROM_SIM );
67 CLR( "schematic.erc_error", LAYER_ERC_ERR );
68 CLR( "schematic.erc_warning", LAYER_ERC_WARN );
69 CLR( "schematic.erc_exclusion", LAYER_ERC_EXCLUSION );
70 CLR( "schematic.fields", LAYER_FIELDS );
71 CLR( "schematic.grid", LAYER_SCHEMATIC_GRID );
72 CLR( "schematic.grid_axes", LAYER_SCHEMATIC_GRID_AXES );
73 CLR( "schematic.hidden", LAYER_HIDDEN );
74 CLR( "schematic.junction", LAYER_JUNCTION );
75 CLR( "schematic.label_global", LAYER_GLOBLABEL );
76 CLR( "schematic.label_hier", LAYER_HIERLABEL );
77 CLR( "schematic.label_local", LAYER_LOCLABEL );
78 CLR( "schematic.netclass_flag", LAYER_NETCLASS_REFS );
79 CLR( "schematic.rule_area", LAYER_RULE_AREAS );
80 CLR( "schematic.no_connect", LAYER_NOCONNECT );
81 CLR( "schematic.note", LAYER_NOTES );
82 CLR( "schematic.private_note", LAYER_PRIVATE_NOTES );
83 CLR( "schematic.note_background", LAYER_NOTES_BACKGROUND );
84 CLR( "schematic.pin", LAYER_PIN );
85 CLR( "schematic.pin_name", LAYER_PINNAM );
86 CLR( "schematic.pin_number", LAYER_PINNUM );
87 CLR( "schematic.reference", LAYER_REFERENCEPART );
88 CLR( "schematic.shadow", LAYER_SELECTION_SHADOWS );
89 CLR( "schematic.sheet", LAYER_SHEET );
90 CLR( "schematic.sheet_background", LAYER_SHEET_BACKGROUND );
91 CLR( "schematic.sheet_filename", LAYER_SHEETFILENAME );
92 CLR( "schematic.sheet_fields", LAYER_SHEETFIELDS );
93 CLR( "schematic.sheet_label", LAYER_SHEETLABEL );
94 CLR( "schematic.sheet_name", LAYER_SHEETNAME );
95 CLR( "schematic.value", LAYER_VALUEPART );
96 CLR( "schematic.wire", LAYER_WIRE );
97 CLR( "schematic.worksheet", LAYER_SCHEMATIC_DRAWINGSHEET );
98 CLR( "schematic.page_limits", LAYER_SCHEMATIC_PAGE_LIMITS );
99 CLR( "schematic.op_voltages", LAYER_OP_VOLTAGES );
100 CLR( "schematic.op_currents", LAYER_OP_CURRENTS );
101
102 CLR( "gerbview.axes", LAYER_GERBVIEW_AXES );
103 CLR( "gerbview.background", LAYER_GERBVIEW_BACKGROUND );
104 CLR( "gerbview.dcodes", LAYER_DCODES );
105 CLR( "gerbview.grid", LAYER_GERBVIEW_GRID );
106 CLR( "gerbview.negative_objects", LAYER_NEGATIVE_OBJECTS );
107 CLR( "gerbview.worksheet", LAYER_GERBVIEW_DRAWINGSHEET );
108 CLR( "gerbview.page_limits", LAYER_GERBVIEW_PAGE_LIMITS );
109
110 for( int i = 0, id = GERBVIEW_LAYER_ID_START;
112 {
113 if( !s_defaultTheme.count( id ) )
114 {
115 wxLogTrace( "colors", "Missing default color for gerbview layer %d", id );
116 continue;
117 }
118
119 m_params.emplace_back( new COLOR_MAP_PARAM( "gerbview.layers." + std::to_string( i ), id,
120 s_defaultTheme.at( id ), &m_colors ) );
121 }
122
123 CLR( "board.anchor", LAYER_ANCHOR );
124 CLR( "board.locked_shadow", LAYER_LOCKED_ITEM_SHADOW );
125 CLR( "board.conflicts_shadow", LAYER_CONFLICTS_SHADOW );
126 CLR( "board.aux_items", LAYER_AUX_ITEMS );
127 CLR( "board.background", LAYER_PCB_BACKGROUND );
128 CLR( "board.cursor", LAYER_CURSOR );
129 CLR( "board.drc_error", LAYER_DRC_ERROR );
130 CLR( "board.drc_warning", LAYER_DRC_WARNING );
131 CLR( "board.drc_exclusion", LAYER_DRC_EXCLUSION );
132 CLR( "board.grid", LAYER_GRID );
133 CLR( "board.grid_axes", LAYER_GRID_AXES );
134 CLR( "board.pad_plated_hole", LAYER_PAD_PLATEDHOLES );
135 CLR( "board.plated_hole", LAYER_NON_PLATEDHOLES );
136 CLR( "board.ratsnest", LAYER_RATSNEST );
137 CLR( "board.via_hole", LAYER_VIA_HOLES );
138 CLR( "board.via_hole_walls", LAYER_VIA_HOLEWALLS );
139 CLR( "board.worksheet", LAYER_DRAWINGSHEET );
140 CLR( "board.page_limits", LAYER_PAGE_LIMITS );
141 CLR( "board.outline_area", LAYER_BOARD_OUTLINE_AREA );
142 CLR( "board.track_net_names", NETNAMES_LAYER_ID_START );
143 CLR( "board.pad_net_names", LAYER_PAD_NETNAMES );
144 CLR( "board.via_net_names", LAYER_VIA_NETNAMES );
145 CLR( "board.points", LAYER_POINTS );
146
147 CLR( "board.copper.f", F_Cu );
148 CLR( "board.copper.in1", In1_Cu );
149 CLR( "board.copper.in2", In2_Cu );
150 CLR( "board.copper.in3", In3_Cu );
151 CLR( "board.copper.in4", In4_Cu );
152 CLR( "board.copper.in5", In5_Cu );
153 CLR( "board.copper.in6", In6_Cu );
154 CLR( "board.copper.in7", In7_Cu );
155 CLR( "board.copper.in8", In8_Cu );
156 CLR( "board.copper.in9", In9_Cu );
157 CLR( "board.copper.in10", In10_Cu );
158 CLR( "board.copper.in11", In11_Cu );
159 CLR( "board.copper.in12", In12_Cu );
160 CLR( "board.copper.in13", In13_Cu );
161 CLR( "board.copper.in14", In14_Cu );
162 CLR( "board.copper.in15", In15_Cu );
163 CLR( "board.copper.in16", In16_Cu );
164 CLR( "board.copper.in17", In17_Cu );
165 CLR( "board.copper.in18", In18_Cu );
166 CLR( "board.copper.in19", In19_Cu );
167 CLR( "board.copper.in20", In20_Cu );
168 CLR( "board.copper.in21", In21_Cu );
169 CLR( "board.copper.in22", In22_Cu );
170 CLR( "board.copper.in23", In23_Cu );
171 CLR( "board.copper.in24", In24_Cu );
172 CLR( "board.copper.in25", In25_Cu );
173 CLR( "board.copper.in26", In26_Cu );
174 CLR( "board.copper.in27", In27_Cu );
175 CLR( "board.copper.in28", In28_Cu );
176 CLR( "board.copper.in29", In29_Cu );
177 CLR( "board.copper.in30", In30_Cu );
178 CLR( "board.copper.b", B_Cu );
179
180 CLR( "board.b_adhes", B_Adhes );
181 CLR( "board.f_adhes", F_Adhes );
182 CLR( "board.b_paste", B_Paste );
183 CLR( "board.f_paste", F_Paste );
184 CLR( "board.b_silks", B_SilkS );
185 CLR( "board.f_silks", F_SilkS );
186 CLR( "board.b_mask", B_Mask );
187 CLR( "board.f_mask", F_Mask );
188 CLR( "board.dwgs_user", Dwgs_User );
189 CLR( "board.cmts_user", Cmts_User );
190 CLR( "board.eco1_user", Eco1_User );
191 CLR( "board.eco2_user", Eco2_User );
192 CLR( "board.edge_cuts", Edge_Cuts );
193 CLR( "board.margin", Margin );
194 CLR( "board.b_crtyd", B_CrtYd );
195 CLR( "board.f_crtyd", F_CrtYd );
196 CLR( "board.b_fab", B_Fab );
197 CLR( "board.f_fab", F_Fab );
198 CLR( "board.user_1", User_1 );
199 CLR( "board.user_2", User_2 );
200 CLR( "board.user_3", User_3 );
201 CLR( "board.user_4", User_4 );
202 CLR( "board.user_5", User_5 );
203 CLR( "board.user_6", User_6 );
204 CLR( "board.user_7", User_7 );
205 CLR( "board.user_8", User_8 );
206 CLR( "board.user_9", User_9 );
207 CLR( "board.user_10", User_10 );
208 CLR( "board.user_11", User_11 );
209 CLR( "board.user_12", User_12 );
210 CLR( "board.user_13", User_13 );
211 CLR( "board.user_14", User_14 );
212 CLR( "board.user_15", User_15 );
213 CLR( "board.user_16", User_16 );
214 CLR( "board.user_17", User_17 );
215 CLR( "board.user_18", User_18 );
216 CLR( "board.user_19", User_19 );
217 CLR( "board.user_20", User_20 );
218 CLR( "board.user_21", User_21 );
219 CLR( "board.user_22", User_22 );
220 CLR( "board.user_23", User_23 );
221 CLR( "board.user_24", User_24 );
222 CLR( "board.user_25", User_25 );
223 CLR( "board.user_26", User_26 );
224 CLR( "board.user_27", User_27 );
225 CLR( "board.user_28", User_28 );
226 CLR( "board.user_29", User_29 );
227 CLR( "board.user_30", User_30 );
228 CLR( "board.user_31", User_31 );
229 CLR( "board.user_32", User_32 );
230 CLR( "board.user_33", User_33 );
231 CLR( "board.user_34", User_34 );
232 CLR( "board.user_35", User_35 );
233 CLR( "board.user_36", User_36 );
234 CLR( "board.user_37", User_37 );
235 CLR( "board.user_38", User_38 );
236 CLR( "board.user_39", User_39 );
237 CLR( "board.user_40", User_40 );
238 CLR( "board.user_41", User_41 );
239 CLR( "board.user_42", User_42 );
240 CLR( "board.user_43", User_43 );
241 CLR( "board.user_44", User_44 );
242 CLR( "board.user_45", User_45 );
243
244 // Colors for 3D viewer, which are used as defaults unless overridden by the board
245 CLR( "3d_viewer.background_bottom", LAYER_3D_BACKGROUND_BOTTOM );
246 CLR( "3d_viewer.background_top", LAYER_3D_BACKGROUND_TOP );
247 CLR( "3d_viewer.board", LAYER_3D_BOARD );
248 CLR( "3d_viewer.copper", LAYER_3D_COPPER_TOP );
249 CLR( "3d_viewer.silkscreen_bottom", LAYER_3D_SILKSCREEN_BOTTOM );
250 CLR( "3d_viewer.silkscreen_top", LAYER_3D_SILKSCREEN_TOP );
251 CLR( "3d_viewer.soldermask_bottom", LAYER_3D_SOLDERMASK_BOTTOM );
252 CLR( "3d_viewer.soldermask_top", LAYER_3D_SOLDERMASK_TOP );
253 CLR( "3d_viewer.solderpaste", LAYER_3D_SOLDERPASTE );
254
255 for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
256 {
257 int idx = layer - LAYER_3D_USER_1;
258 PCB_LAYER_ID pcb_layer = Map3DLayerToPCBLayer( layer );
259
260 m_params.emplace_back( new COLOR_MAP_PARAM( "3d_viewer.user_" + std::to_string( idx + 1 ),
261 layer, s_defaultTheme.at( pcb_layer ),
262 &m_colors ) );
263 }
264
265 registerMigration( 0, 1, std::bind( &COLOR_SETTINGS::migrateSchema0to1, this ) );
266
267 registerMigration( 1, 2,
268 [&]()
269 {
270 // Fix LAYER_VIA_HOLES color - before version 2, this setting had no effect
271 nlohmann::json::json_pointer ptr( "/board/via_hole" );
272
273 ( *m_internals )[ptr] = COLOR4D( 0.5, 0.4, 0, 0.8 ).ToCSSString();
274
275 return true;
276 } );
277
278 registerMigration( 2, 3,
279 [&]()
280 {
281 // We don't support opacity in some 3D colors but some versions of 5.99 let
282 // you set it.
283
284 for( std::string path : { "3d_viewer.background_top",
285 "3d_viewer.background_bottom",
286 "3d_viewer.copper",
287 "3d_viewer.silkscreen_top",
288 "3d_viewer.silkscreen_bottom",
289 "3d_viewer.solderpaste" } )
290 {
291 if( std::optional<COLOR4D> optval = Get<COLOR4D>( path ) )
292 Set( path, optval->WithAlpha( 1.0 ) );
293 }
294
295 return true;
296 } );
297
298 registerMigration( 3, 4,
299 [&]()
300 {
301 if( std::optional<COLOR4D> optval = Get<COLOR4D>( "board.grid" ) )
302 Set( "board.page_limits", *optval );
303
304 if( std::optional<COLOR4D> optval = Get<COLOR4D>( "schematic.grid" ) )
305 Set( "schematic.page_limits", *optval );
306
307 return true;
308 } );
309
310 // this bump shouldn't have happened; add a no-op migration to avoid future issues
311 registerMigration( 4, 5, []() { return true; } );
312}
313
314
320
321
323{
324 m_filename = aOther.m_filename;
325
326 initFromOther( aOther );
327
328 return *this;
329}
330
331
333{
336 m_colors = aOther.m_colors;
338 m_writeFile = aOther.m_writeFile;
339
340 // Ensure default colors are present
341 for( PARAM_BASE* param : aOther.m_params )
342 {
343 if( COLOR_MAP_PARAM* cmp = dynamic_cast<COLOR_MAP_PARAM*>( param ) )
344 m_defaultColors[cmp->GetKey()] = cmp->GetDefault();
345 }
346}
347
348
349bool COLOR_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
350{
351 return false;
352}
353
354
356{
363
364 if( !m_manager )
365 {
366 wxLogTrace( traceSettings, wxT( "Error: COLOR_SETTINGS migration cannot run unmanaged!" ) );
367 return false;
368 }
369
370 if( !Contains( "fpedit" ) )
371 {
372 wxLogTrace( traceSettings,
373 wxT( "migrateSchema0to1: %s doesn't have fpedit settings; skipping." ),
374 m_filename );
375 return true;
376 }
377
378 wxString filename = GetFilename().BeforeLast( '.' ) + wxT( "_footprints" );
379
380 COLOR_SETTINGS* fpsettings = m_manager->AddNewColorSettings( filename );
381 fpsettings->SetLocation( GetLocation() );
382
383 // Start out with a clone
384 fpsettings->m_internals->CloneFrom( *m_internals );
385
386 // Footprint editor now just looks at the "board" namespace
387 fpsettings->Set( "board", fpsettings->At( "fpedit" ) );
388
389 fpsettings->Internals()->erase( "fpedit" );
390 fpsettings->Load();
391 fpsettings->SetName( fpsettings->GetName() + wxS( " " ) + _( "(Footprints)" ) );
392 m_manager->Save( fpsettings );
393
394 // Now we can get rid of our own copy
395 m_internals->erase( "fpedit" );
396
397 return true;
398}
399
400
402{
403 if( m_colors.count( aLayer ) )
404 return m_colors.at( aLayer );
405
407}
408
409
411{
412 if( !m_defaultColors.count( aLayer ) )
413 {
414 COLOR_MAP_PARAM* p = nullptr;
415
416 for( PARAM_BASE* param : m_params )
417 {
418 COLOR_MAP_PARAM* cmp = dynamic_cast<COLOR_MAP_PARAM*>( param );
419
420 if( cmp && cmp->GetKey() == aLayer )
421 p = cmp;
422 }
423
424 if( p )
425 m_defaultColors[aLayer] = p->GetDefault();
426 else if( IsCopperLayer( aLayer ) )
427 m_defaultColors[aLayer] = s_copperColors[aLayer % s_copperColors.size()];
428 else
429 m_defaultColors[aLayer] = s_userColors[aLayer % s_userColors.size()];
430 }
431
432 return m_defaultColors.at( aLayer );
433}
434
435
436void COLOR_SETTINGS::SetColor( int aLayer, const COLOR4D& aColor )
437{
438 m_colors[ aLayer ] = aColor;
439}
440
441
442std::vector<COLOR_SETTINGS*> COLOR_SETTINGS::CreateBuiltinColorSettings()
443{
445 defaultTheme->SetName( _( "KiCad Default" ) );
446 defaultTheme->m_writeFile = false;
447 defaultTheme->Load(); // We can just get the colors out of the param defaults for this one
448
450 classicTheme->SetName( _( "KiCad Classic" ) );
451 classicTheme->m_writeFile = false;
452
453 for( PARAM_BASE* param : classicTheme->m_params )
454 delete param;
455
456 classicTheme->m_params.clear(); // Disable load/store
457
458 for( const std::pair<int, COLOR4D> entry : s_classicTheme )
459 classicTheme->m_colors[entry.first] = entry.second;
460
461 std::vector<COLOR_SETTINGS*> ret;
462
463 ret.push_back( defaultTheme );
464 ret.push_back( classicTheme );
465
466 return ret;
467}
static const std::vector< COLOR4D > s_userColors
static const std::map< int, COLOR4D > s_defaultTheme
static const std::vector< COLOR4D > s_copperColors
static const std::map< int, COLOR4D > s_classicTheme
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
COLOR4D GetDefault() const
int GetKey() const
void SetName(const wxString &aName)
std::unordered_map< int, COLOR4D > m_defaultColors
void initFromOther(const COLOR_SETTINGS &aOther)
void SetColor(int aLayer, const COLOR4D &aColor)
static std::vector< COLOR_SETTINGS * > CreateBuiltinColorSettings()
Constructs and returns a list of color settings objects based on the built-in color themes.
bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
static const wxString COLOR_BUILTIN_CLASSIC
static const wxString COLOR_BUILTIN_DEFAULT
COLOR4D GetColor(int aLayer) const
COLOR4D GetDefaultColor(int aLayer)
wxString m_displayName
COLOR_SETTINGS & operator=(const COLOR_SETTINGS &aOther)
std::unordered_map< int, COLOR4D > m_colors
Map of all layer colors.
COLOR_SETTINGS(const wxString &aFilename=wxT("user"), bool aAbsolutePath=false)
const wxString & GetName() const
void CloneFrom(const JSON_SETTINGS_INTERNALS &aOther)
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
wxString m_filename
The filename (not including path) of this settings file (inicode)
SETTINGS_MANAGER * m_manager
A pointer to the settings manager managing this file (may be null)
bool Contains(const std::string &aPath) const
SETTINGS_LOC GetLocation() const
void SetLocation(SETTINGS_LOC aLocation)
bool m_writeFile
Whether or not the backing store file should be written.
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
std::optional< ValueType > Get(const std::string &aPath) const
Fetches a value from within the JSON document.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
JSON_SETTINGS_INTERNALS * Internals()
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
std::unique_ptr< JSON_SETTINGS_INTERNALS > m_internals
wxString GetFilename() const
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:104
wxString ToCSSString() const
Definition color4d.cpp:147
#define CLR(x, y)
const int colorsSchemaVersion
! Update the schema version whenever a migration is required
#define _(s)
SETTINGS_LOC
@ COLORS
The color scheme directory (e.g. ~/.config/kicad/colors/)
@ NONE
No directory prepended, full path in filename (used for PROJECT_FILE)
#define traceSettings
PCB_LAYER_ID Map3DLayerToPCBLayer(int aLayer)
Definition layer_id.cpp:266
@ LAYER_PAD_NETNAMES
Definition layer_ids.h:202
@ NETNAMES_LAYER_ID_START
Definition layer_ids.h:194
@ LAYER_VIA_NETNAMES
Definition layer_ids.h:203
@ LAYER_GERBVIEW_DRAWINGSHEET
Definition layer_ids.h:531
@ GERBVIEW_LAYER_ID_START
Definition layer_ids.h:521
@ LAYER_GERBVIEW_BACKGROUND
Definition layer_ids.h:530
@ LAYER_DCODES
Definition layer_ids.h:526
@ LAYER_NEGATIVE_OBJECTS
Definition layer_ids.h:527
@ LAYER_GERBVIEW_PAGE_LIMITS
Definition layer_ids.h:532
@ LAYER_GERBVIEW_AXES
Definition layer_ids.h:529
@ LAYER_GERBVIEW_GRID
Definition layer_ids.h:528
@ LAYER_3D_USER_1
Definition layer_ids.h:564
@ LAYER_3D_SOLDERMASK_TOP
Definition layer_ids.h:557
@ LAYER_3D_BACKGROUND_TOP
Definition layer_ids.h:550
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition layer_ids.h:556
@ LAYER_3D_BOARD
Definition layer_ids.h:551
@ LAYER_3D_SILKSCREEN_TOP
Definition layer_ids.h:555
@ LAYER_3D_COPPER_TOP
Definition layer_ids.h:552
@ LAYER_3D_SOLDERPASTE
Definition layer_ids.h:558
@ LAYER_3D_USER_45
Definition layer_ids.h:608
@ LAYER_3D_BACKGROUND_BOTTOM
Definition layer_ids.h:549
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition layer_ids.h:554
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
Definition layer_ids.h:674
@ LAYER_GRID
Definition layer_ids.h:253
@ LAYER_POINTS
PCB reference/manual snap points visibility.
Definition layer_ids.h:320
@ LAYER_PAGE_LIMITS
Color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition layer_ids.h:328
@ LAYER_LOCKED_ITEM_SHADOW
Shadow layer for locked items.
Definition layer_ids.h:306
@ LAYER_VIA_HOLEWALLS
Definition layer_ids.h:297
@ LAYER_GRID_AXES
Definition layer_ids.h:254
@ LAYER_CONFLICTS_SHADOW
Shadow layer for items flagged conflicting.
Definition layer_ids.h:309
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
Definition layer_ids.h:238
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
Definition layer_ids.h:277
@ LAYER_BOARD_OUTLINE_AREA
PCB board outline.
Definition layer_ids.h:317
@ LAYER_DRC_EXCLUSION
Layer for DRC markers which have been individually excluded.
Definition layer_ids.h:303
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition layer_ids.h:280
@ LAYER_DRC_WARNING
Layer for DRC markers with #SEVERITY_WARNING.
Definition layer_ids.h:300
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition layer_ids.h:270
@ LAYER_CURSOR
PCB cursor.
Definition layer_ids.h:281
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc).
Definition layer_ids.h:282
@ LAYER_RATSNEST
Definition layer_ids.h:252
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
Definition layer_ids.h:247
@ LAYER_VIA_HOLES
Draw via holes (pad holes do not use this layer).
Definition layer_ids.h:273
@ LAYER_DRC_ERROR
Layer for DRC markers with #SEVERITY_ERROR.
Definition layer_ids.h:276
@ LAYER_SHEETNAME
Definition layer_ids.h:471
@ LAYER_ERC_WARN
Definition layer_ids.h:478
@ LAYER_SCHEMATIC_ANCHOR
Definition layer_ids.h:498
@ LAYER_SHEETLABEL
Definition layer_ids.h:474
@ LAYER_PINNUM
Definition layer_ids.h:457
@ LAYER_RULE_AREAS
Definition layer_ids.h:464
@ LAYER_DEVICE
Definition layer_ids.h:465
@ LAYER_SHEET_BACKGROUND
Definition layer_ids.h:484
@ LAYER_EXCLUDED_FROM_SIM
Definition layer_ids.h:481
@ LAYER_BRIGHTENED
Definition layer_ids.h:490
@ LAYER_ERC_EXCLUSION
Definition layer_ids.h:480
@ LAYER_HIDDEN
Definition layer_ids.h:491
@ LAYER_HIERLABEL
Definition layer_ids.h:456
@ LAYER_PINNAM
Definition layer_ids.h:458
@ LAYER_PRIVATE_NOTES
Definition layer_ids.h:467
@ LAYER_HOVERED
Definition layer_ids.h:489
@ LAYER_GLOBLABEL
Definition layer_ids.h:455
@ LAYER_WIRE
Definition layer_ids.h:451
@ LAYER_NOTES
Definition layer_ids.h:466
@ LAYER_ERC_ERR
Definition layer_ids.h:479
@ LAYER_PIN
Definition layer_ids.h:469
@ LAYER_VALUEPART
Definition layer_ids.h:460
@ LAYER_BUS
Definition layer_ids.h:452
@ LAYER_SCHEMATIC_CURSOR
Definition layer_ids.h:488
@ LAYER_FIELDS
Definition layer_ids.h:461
@ LAYER_DEVICE_BACKGROUND
Definition layer_ids.h:483
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition layer_ids.h:494
@ LAYER_LOCLABEL
Definition layer_ids.h:454
@ LAYER_JUNCTION
Definition layer_ids.h:453
@ LAYER_SHEETFIELDS
Definition layer_ids.h:473
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:486
@ LAYER_REFERENCEPART
Definition layer_ids.h:459
@ LAYER_NETCLASS_REFS
Definition layer_ids.h:463
@ LAYER_NOTES_BACKGROUND
Definition layer_ids.h:468
@ LAYER_OP_CURRENTS
Definition layer_ids.h:500
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition layer_ids.h:495
@ LAYER_SHEET
Definition layer_ids.h:470
@ LAYER_SELECTION_SHADOWS
Definition layer_ids.h:493
@ LAYER_SCHEMATIC_BACKGROUND
Definition layer_ids.h:487
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition layer_ids.h:497
@ LAYER_OP_VOLTAGES
Definition layer_ids.h:499
@ LAYER_SHEETFILENAME
Definition layer_ids.h:472
@ LAYER_BUS_JUNCTION
Definition layer_ids.h:496
@ LAYER_DNP_MARKER
Definition layer_ids.h:477
@ LAYER_NOCONNECT
Definition layer_ids.h:475
@ LAYER_SCHEMATIC_GRID
Definition layer_ids.h:485
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ User_16
Definition layer_ids.h:139
@ In22_Cu
Definition layer_ids.h:87
@ In11_Cu
Definition layer_ids.h:76
@ User_29
Definition layer_ids.h:152
@ In29_Cu
Definition layer_ids.h:94
@ In30_Cu
Definition layer_ids.h:95
@ User_40
Definition layer_ids.h:163
@ User_15
Definition layer_ids.h:138
@ User_8
Definition layer_ids.h:131
@ F_CrtYd
Definition layer_ids.h:116
@ User_11
Definition layer_ids.h:134
@ User_25
Definition layer_ids.h:148
@ In17_Cu
Definition layer_ids.h:82
@ User_34
Definition layer_ids.h:157
@ User_45
Definition layer_ids.h:168
@ B_Adhes
Definition layer_ids.h:103
@ User_36
Definition layer_ids.h:159
@ Edge_Cuts
Definition layer_ids.h:112
@ Dwgs_User
Definition layer_ids.h:107
@ F_Paste
Definition layer_ids.h:104
@ In9_Cu
Definition layer_ids.h:74
@ Cmts_User
Definition layer_ids.h:108
@ User_6
Definition layer_ids.h:129
@ User_7
Definition layer_ids.h:130
@ In19_Cu
Definition layer_ids.h:84
@ User_19
Definition layer_ids.h:142
@ User_23
Definition layer_ids.h:146
@ In7_Cu
Definition layer_ids.h:72
@ In28_Cu
Definition layer_ids.h:93
@ In26_Cu
Definition layer_ids.h:91
@ F_Adhes
Definition layer_ids.h:102
@ User_41
Definition layer_ids.h:164
@ B_Mask
Definition layer_ids.h:98
@ B_Cu
Definition layer_ids.h:65
@ User_14
Definition layer_ids.h:137
@ User_39
Definition layer_ids.h:162
@ User_5
Definition layer_ids.h:128
@ User_20
Definition layer_ids.h:143
@ Eco1_User
Definition layer_ids.h:109
@ F_Mask
Definition layer_ids.h:97
@ In21_Cu
Definition layer_ids.h:86
@ User_42
Definition layer_ids.h:165
@ User_43
Definition layer_ids.h:166
@ In23_Cu
Definition layer_ids.h:88
@ B_Paste
Definition layer_ids.h:105
@ In15_Cu
Definition layer_ids.h:80
@ In2_Cu
Definition layer_ids.h:67
@ User_10
Definition layer_ids.h:133
@ User_9
Definition layer_ids.h:132
@ User_27
Definition layer_ids.h:150
@ User_28
Definition layer_ids.h:151
@ F_Fab
Definition layer_ids.h:119
@ In10_Cu
Definition layer_ids.h:75
@ Margin
Definition layer_ids.h:113
@ F_SilkS
Definition layer_ids.h:100
@ In4_Cu
Definition layer_ids.h:69
@ B_CrtYd
Definition layer_ids.h:115
@ Eco2_User
Definition layer_ids.h:110
@ In16_Cu
Definition layer_ids.h:81
@ In24_Cu
Definition layer_ids.h:89
@ In1_Cu
Definition layer_ids.h:66
@ User_35
Definition layer_ids.h:158
@ User_31
Definition layer_ids.h:154
@ User_3
Definition layer_ids.h:126
@ User_1
Definition layer_ids.h:124
@ User_12
Definition layer_ids.h:135
@ B_SilkS
Definition layer_ids.h:101
@ User_30
Definition layer_ids.h:153
@ User_37
Definition layer_ids.h:160
@ User_22
Definition layer_ids.h:145
@ User_38
Definition layer_ids.h:161
@ In13_Cu
Definition layer_ids.h:78
@ User_4
Definition layer_ids.h:127
@ In8_Cu
Definition layer_ids.h:73
@ User_21
Definition layer_ids.h:144
@ In14_Cu
Definition layer_ids.h:79
@ User_24
Definition layer_ids.h:147
@ User_13
Definition layer_ids.h:136
@ User_2
Definition layer_ids.h:125
@ In12_Cu
Definition layer_ids.h:77
@ User_17
Definition layer_ids.h:140
@ In27_Cu
Definition layer_ids.h:92
@ In6_Cu
Definition layer_ids.h:71
@ In5_Cu
Definition layer_ids.h:70
@ User_33
Definition layer_ids.h:156
@ User_26
Definition layer_ids.h:149
@ In3_Cu
Definition layer_ids.h:68
@ User_32
Definition layer_ids.h:155
@ In20_Cu
Definition layer_ids.h:85
@ User_18
Definition layer_ids.h:141
@ User_44
Definition layer_ids.h:167
@ F_Cu
Definition layer_ids.h:64
@ In18_Cu
Definition layer_ids.h:83
@ In25_Cu
Definition layer_ids.h:90
@ B_Fab
Definition layer_ids.h:118
#define GERBER_DRAWLAYERS_COUNT
Number of draw layers in Gerbview.
Definition layer_ids.h:516