KiCad PCB EDA Suite
layers_id_colors_and_visibility.h File Reference

Board layer functions and definitions. More...

#include <vector>
#include <bitset>
#include <wx/string.h>
#include <macros.h>

Go to the source code of this file.

Classes

class  GAL_SET
 Helper for storing and iterating over GAL_LAYER_IDs. More...
 
class  LSEQ
 LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs. More...
 
class  LSET
 LSET is a set of PCB_LAYER_IDs. More...
 

Macros

#define MAX_CU_LAYERS   (B_Cu - F_Cu + 1)
 
#define NETNAMES_LAYER_INDEX(layer)   ( NETNAMES_LAYER_ID_START + layer )
 Macro for obtaining netname layer for a given PCB layer. More...
 
#define GAL_LAYER_INDEX(x)   ( x - GAL_LAYER_ID_START )
 Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS. More...
 
#define ZONE_LAYER_FOR(copperLayer)   ( LAYER_ZONE_START + copperLayer )
 Macro for getting the zone layer for a given copper layer. More...
 
#define SCH_LAYER_ID_COUNT   ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
 
#define SCH_LAYER_INDEX(x)   ( x - SCH_LAYER_ID_START )
 
#define GERBER_DRAWLAYERS_COUNT   PCB_LAYER_ID_COUNT
 
#define GERBER_DRAW_LAYER(x)   ( GERBVIEW_LAYER_ID_START + x )
 
#define GERBER_DCODE_LAYER(x)   ( GERBER_DRAWLAYERS_COUNT + x )
 
#define GERBER_DRAW_LAYER_INDEX(x)   ( x - GERBVIEW_LAYER_ID_START )
 
#define LAYER_ID_COUNT   LAYER_3D_END
 Must update this if you add any enums after GerbView! More...
 
#define MIN_VISIBILITY_MASK
 

Typedefs

typedef int LAYER_NUM
 Type LAYER_NUM can be replaced with int and removed. More...
 
typedef std::bitset< GAL_LAYER_ID_COUNTGAL_BASE_SET
 
typedef std::vector< PCB_LAYER_IDBASE_SEQ
 A sequence of layers, a sequence provides a certain order. More...
 
typedef std::bitset< PCB_LAYER_ID_COUNTBASE_SET
 

Enumerations

enum  PCB_LAYER_ID : int {
  UNDEFINED_LAYER = -1, UNSELECTED_LAYER = -2, PCBNEW_LAYER_ID_START = 0, F_Cu = PCBNEW_LAYER_ID_START,
  In1_Cu, In2_Cu, In3_Cu, In4_Cu,
  In5_Cu, In6_Cu, In7_Cu, In8_Cu,
  In9_Cu, In10_Cu, In11_Cu, In12_Cu,
  In13_Cu, In14_Cu, In15_Cu, In16_Cu,
  In17_Cu, In18_Cu, In19_Cu, In20_Cu,
  In21_Cu, In22_Cu, In23_Cu, In24_Cu,
  In25_Cu, In26_Cu, In27_Cu, In28_Cu,
  In29_Cu, In30_Cu, B_Cu, B_Adhes,
  F_Adhes, B_Paste, F_Paste, B_SilkS,
  F_SilkS, B_Mask, F_Mask, Dwgs_User,
  Cmts_User, Eco1_User, Eco2_User, Edge_Cuts,
  Margin, B_CrtYd, F_CrtYd, B_Fab,
  F_Fab, Rescue, PCB_LAYER_ID_COUNT
}
 A quick note on layer IDs: More...
 
enum  NETNAMES_LAYER_ID : int {
  NETNAMES_LAYER_ID_START = PCB_LAYER_ID_COUNT, NETNAMES_LAYER_ID_RESERVED = NETNAMES_LAYER_ID_START + PCB_LAYER_ID_COUNT, LAYER_PAD_FR_NETNAMES, LAYER_PAD_BK_NETNAMES,
  LAYER_PADS_NETNAMES, LAYER_VIAS_NETNAMES, NETNAMES_LAYER_ID_END
}
 Dedicated layers for net names used in Pcbnew. More...
 
enum  GAL_LAYER_ID : int {
  GAL_LAYER_ID_START = NETNAMES_LAYER_ID_END, LAYER_VIAS = GAL_LAYER_ID_START, LAYER_VIA_MICROVIA, LAYER_VIA_BBLIND,
  LAYER_VIA_THROUGH, LAYER_NON_PLATEDHOLES, LAYER_MOD_TEXT_FR, LAYER_MOD_TEXT_BK,
  LAYER_MOD_TEXT_INVISIBLE, LAYER_ANCHOR, LAYER_PAD_FR, LAYER_PAD_BK,
  LAYER_RATSNEST, LAYER_GRID, LAYER_GRID_AXES, LAYER_NO_CONNECTS,
  LAYER_MOD_FR, LAYER_MOD_BK, LAYER_MOD_VALUES, LAYER_MOD_REFERENCES,
  LAYER_TRACKS, LAYER_PADS_TH, LAYER_PADS_PLATEDHOLES, LAYER_VIAS_HOLES,
  LAYER_DRC_ERROR, LAYER_DRC_WARNING, LAYER_DRC_EXCLUSION, LAYER_WORKSHEET,
  LAYER_GP_OVERLAY, LAYER_SELECT_OVERLAY, LAYER_PCB_BACKGROUND, LAYER_CURSOR,
  LAYER_AUX_ITEMS, LAYER_DRAW_BITMAPS, GAL_LAYER_ID_BITMASK_END, LAYER_WORKSHEET_PAGE1,
  LAYER_WORKSHEET_PAGEn, LAYER_PADS, LAYER_ZONES, LAYER_ZONE_START,
  LAYER_ZONE_END = LAYER_ZONE_START + PCB_LAYER_ID_COUNT, GAL_LAYER_ID_END
}
 GAL layers are "virtual" layers, i.e. More...
 
enum  SCH_LAYER_ID : int {
  SCH_LAYER_ID_START = GAL_LAYER_ID_END, LAYER_WIRE = SCH_LAYER_ID_START, LAYER_BUS, LAYER_JUNCTION,
  LAYER_LOCLABEL, LAYER_GLOBLABEL, LAYER_HIERLABEL, LAYER_PINNUM,
  LAYER_PINNAM, LAYER_REFERENCEPART, LAYER_VALUEPART, LAYER_FIELDS,
  LAYER_DEVICE, LAYER_NOTES, LAYER_NETNAM, LAYER_PIN,
  LAYER_SHEET, LAYER_SHEETNAME, LAYER_SHEETFILENAME, LAYER_SHEETFIELDS,
  LAYER_SHEETLABEL, LAYER_NOCONNECT, LAYER_ERC_WARN, LAYER_ERC_ERR,
  LAYER_DEVICE_BACKGROUND, LAYER_SHEET_BACKGROUND, LAYER_SCHEMATIC_GRID, LAYER_SCHEMATIC_GRID_AXES,
  LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_CURSOR, LAYER_BRIGHTENED, LAYER_HIDDEN,
  LAYER_SELECTION_SHADOWS, LAYER_SCHEMATIC_WORKSHEET, LAYER_BUS_JUNCTION, LAYER_SCHEMATIC_AUX_ITEMS,
  SCH_LAYER_ID_END
}
 Eeschema drawing layers. More...
 
enum  GERBVIEW_LAYER_ID : int {
  GERBVIEW_LAYER_ID_START = SCH_LAYER_ID_END, GERBVIEW_LAYER_ID_RESERVED = GERBVIEW_LAYER_ID_START + ( 2 * GERBER_DRAWLAYERS_COUNT ), LAYER_DCODES, LAYER_NEGATIVE_OBJECTS,
  LAYER_GERBVIEW_GRID, LAYER_GERBVIEW_AXES, LAYER_GERBVIEW_BACKGROUND, LAYER_GERBVIEW_WORKSHEET,
  GERBVIEW_LAYER_ID_END
}
 GerbView draw layers. More...
 
enum  LAYER_3D_ID : int {
  LAYER_3D_START = GERBVIEW_LAYER_ID_END, LAYER_3D_BACKGROUND_BOTTOM, LAYER_3D_BACKGROUND_TOP, LAYER_3D_BOARD,
  LAYER_3D_COPPER, LAYER_3D_SILKSCREEN_BOTTOM, LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SOLDERMASK,
  LAYER_3D_SOLDERPASTE, LAYER_3D_END = LAYER_3D_SOLDERPASTE
}
 3D Viewer virtual layers for color settings More...
 

Functions

GAL_LAYER_ID operator++ (GAL_LAYER_ID &a)
 
GAL_LAYER_ID ToGalLayer (int aInteger)
 
GAL_LAYER_ID operator+ (const GAL_LAYER_ID &a, int b)
 Used for via types. More...
 
SCH_LAYER_ID operator++ (SCH_LAYER_ID &a)
 
wxString LayerName (int aLayer)
 Returns the string equivalent of a given layer. More...
 
bool IsValidLayer (LAYER_NUM aLayerId)
 Function IsValidLayer tests whether a given integer is a valid layer index, i.e. More...
 
bool IsPcbLayer (LAYER_NUM aLayer)
 Function IsPcbLayer tests whether a layer is a valid layer for pcbnew. More...
 
bool IsCopperLayer (LAYER_NUM aLayerId)
 Function IsCopperLayer tests whether a layer is a copper layer. More...
 
bool IsNonCopperLayer (LAYER_NUM aLayerId)
 Function IsNonCopperLayer tests whether a layer is a non copper layer. More...
 
bool IsUserLayer (PCB_LAYER_ID aLayerId)
 Function IsUserLayer tests whether a layer is a non copper and a non tech layer. More...
 
bool IsFrontLayer (PCB_LAYER_ID aLayerId)
 Layer classification: check if it's a front layer. More...
 
bool IsBackLayer (PCB_LAYER_ID aLayerId)
 Layer classification: check if it's a back layer. More...
 
PCB_LAYER_ID FlipLayer (PCB_LAYER_ID aLayerId, int aCopperLayersCount=0)
 Function FlippedLayerNumber. More...
 
LSET FlipLayerMask (LSET aMask, int aCopperLayersCount=0)
 Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask, paste, solder layers are swapped internal layers are flipped only if the copper layers count is known. More...
 
int GetNetnameLayer (int aLayer)
 Returns a netname layer corresponding to the given layer. More...
 
bool IsNetnameLayer (LAYER_NUM aLayer)
 Function IsNetnameLayer tests whether a layer is a netname layer. More...
 
bool IsZoneLayer (LAYER_NUM aLayer)
 
bool IsDCodeLayer (int aLayer)
 
bool IsNetCopperLayer (LAYER_NUM aLayer)
 Checks if the given layer is "net copper", meaning it is eligible for net coloring. More...
 
PCB_LAYER_ID ToLAYER_ID (int aLayer)
 

Variables

constexpr int GAL_LAYER_ID_COUNT = GAL_LAYER_ID_END - GAL_LAYER_ID_START
 

Detailed Description

Board layer functions and definitions.

Definition in file layers_id_colors_and_visibility.h.

Macro Definition Documentation

◆ GAL_LAYER_INDEX

#define GAL_LAYER_INDEX (   x)    ( x - GAL_LAYER_ID_START )

Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.

Definition at line 227 of file layers_id_colors_and_visibility.h.

◆ GERBER_DCODE_LAYER

#define GERBER_DCODE_LAYER (   x)    ( GERBER_DRAWLAYERS_COUNT + x )

Definition at line 378 of file layers_id_colors_and_visibility.h.

◆ GERBER_DRAW_LAYER

#define GERBER_DRAW_LAYER (   x)    ( GERBVIEW_LAYER_ID_START + x )

Definition at line 376 of file layers_id_colors_and_visibility.h.

◆ GERBER_DRAW_LAYER_INDEX

#define GERBER_DRAW_LAYER_INDEX (   x)    ( x - GERBVIEW_LAYER_ID_START )

Definition at line 380 of file layers_id_colors_and_visibility.h.

◆ GERBER_DRAWLAYERS_COUNT

#define GERBER_DRAWLAYERS_COUNT   PCB_LAYER_ID_COUNT

Definition at line 356 of file layers_id_colors_and_visibility.h.

◆ LAYER_ID_COUNT

#define LAYER_ID_COUNT   LAYER_3D_END

Must update this if you add any enums after GerbView!

Definition at line 401 of file layers_id_colors_and_visibility.h.

◆ MAX_CU_LAYERS

#define MAX_CU_LAYERS   (B_Cu - F_Cu + 1)

Definition at line 142 of file layers_id_colors_and_visibility.h.

◆ MIN_VISIBILITY_MASK

#define MIN_VISIBILITY_MASK
Value:
to draw via holes (pad holes do not use this layer)
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
currently selected items overlay

Definition at line 415 of file layers_id_colors_and_visibility.h.

◆ NETNAMES_LAYER_INDEX

#define NETNAMES_LAYER_INDEX (   layer)    ( NETNAMES_LAYER_ID_START + layer )

Macro for obtaining netname layer for a given PCB layer.

Definition at line 165 of file layers_id_colors_and_visibility.h.

◆ SCH_LAYER_ID_COUNT

#define SCH_LAYER_ID_COUNT   ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )

Definition at line 345 of file layers_id_colors_and_visibility.h.

◆ SCH_LAYER_INDEX

#define SCH_LAYER_INDEX (   x)    ( x - SCH_LAYER_ID_START )

Definition at line 347 of file layers_id_colors_and_visibility.h.

◆ ZONE_LAYER_FOR

#define ZONE_LAYER_FOR (   copperLayer)    ( LAYER_ZONE_START + copperLayer )

Macro for getting the zone layer for a given copper layer.

Definition at line 230 of file layers_id_colors_and_visibility.h.

Typedef Documentation

◆ BASE_SEQ

typedef std::vector<PCB_LAYER_ID> BASE_SEQ

A sequence of layers, a sequence provides a certain order.

Definition at line 423 of file layers_id_colors_and_visibility.h.

◆ BASE_SET

typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET

Definition at line 473 of file layers_id_colors_and_visibility.h.

◆ GAL_BASE_SET

typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET

Definition at line 254 of file layers_id_colors_and_visibility.h.

◆ LAYER_NUM

typedef int LAYER_NUM

Type LAYER_NUM can be replaced with int and removed.

Until then, it is something you can increment, and its meaning is only advisory but can extend beyond PCB layers into view layers and gerber layers.

Definition at line 39 of file layers_id_colors_and_visibility.h.

Enumeration Type Documentation

◆ GAL_LAYER_ID

enum GAL_LAYER_ID : int

GAL layers are "virtual" layers, i.e.

not tied into design data. Some layers here are shared between applications.

Enumerator
GAL_LAYER_ID_START 
LAYER_VIAS 

Meta control for all vias opacity/visibility.

LAYER_VIA_MICROVIA 

to draw micro vias

LAYER_VIA_BBLIND 

to draw blind/buried vias

LAYER_VIA_THROUGH 

to draw usual through hole vias

LAYER_NON_PLATEDHOLES 

handle color for not plated holes (holes, not pads)

LAYER_MOD_TEXT_FR 
LAYER_MOD_TEXT_BK 
LAYER_MOD_TEXT_INVISIBLE 

text marked as invisible

LAYER_ANCHOR 

anchor of items having an anchor point (texts, footprints)

LAYER_PAD_FR 

smd pads, front layer

LAYER_PAD_BK 

smd pads, back layer

LAYER_RATSNEST 
LAYER_GRID 
LAYER_GRID_AXES 
LAYER_NO_CONNECTS 

show a marker on pads with no nets

LAYER_MOD_FR 

show modules on front

LAYER_MOD_BK 

show modules on back

LAYER_MOD_VALUES 

show modules values (when texts are visibles)

LAYER_MOD_REFERENCES 

show modules references (when texts are visibles)

LAYER_TRACKS 
LAYER_PADS_TH 

multilayer pads, usually with holes

LAYER_PADS_PLATEDHOLES 

to draw pad holes (plated)

LAYER_VIAS_HOLES 

to draw via holes (pad holes do not use this layer)

LAYER_DRC_ERROR 

layer for drc markers with SEVERITY_ERROR

LAYER_DRC_WARNING 

layer for drc markers with SEVERITY_WARNING

LAYER_DRC_EXCLUSION 

layer for drc markers which have been individually excluded

LAYER_WORKSHEET 

worksheet frame

LAYER_GP_OVERLAY 

general purpose overlay

LAYER_SELECT_OVERLAY 

currently selected items overlay

LAYER_PCB_BACKGROUND 

PCB background color.

LAYER_CURSOR 

PCB cursor.

LAYER_AUX_ITEMS 

Auxiliary items (guides, rule, etc)

LAYER_DRAW_BITMAPS 

to handle and draw images bitmaps

GAL_LAYER_ID_BITMASK_END 

This is the end of the layers used for visibility bitmasks in Pcbnew There can be at most 32 layers above here.

LAYER_WORKSHEET_PAGE1 

for pageLayout editor previewing

LAYER_WORKSHEET_PAGEn 

for pageLayout editor previewing

LAYER_PADS 

Meta control for all pads opacity/visibility (color ignored)

LAYER_ZONES 

Control for copper zone opacity/visibility (color ignored)

LAYER_ZONE_START 

Virtual layers for stacking zones and tracks on a given copper layer.

LAYER_ZONE_END 
GAL_LAYER_ID_END 

Add new GAL layers here.

Definition at line 169 of file layers_id_colors_and_visibility.h.

169  : int
170 {
172 
181  LAYER_ANCHOR,
182  LAYER_PAD_FR,
183  LAYER_PAD_BK,
185  LAYER_GRID,
188  LAYER_MOD_FR,
189  LAYER_MOD_BK,
192  LAYER_TRACKS,
193  LAYER_PADS_TH,
203  LAYER_CURSOR,
206 
210 
213 
214  LAYER_PADS,
215  LAYER_ZONES,
216 
220 
222 
224 };
Virtual layers for stacking zones and tracks on a given copper layer.
to draw blind/buried vias
show a marker on pads with no nets
for pageLayout editor previewing
multilayer pads, usually with holes
to handle and draw images bitmaps
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
Control for copper zone opacity/visibility (color ignored)
to draw via holes (pad holes do not use this layer)
show modules values (when texts are visibles)
This is the end of the layers used for visibility bitmasks in Pcbnew There can be at most 32 layers a...
Add new GAL layers here.
show modules on front
Auxiliary items (guides, rule, etc)
Meta control for all pads opacity/visibility (color ignored)
to draw usual through hole vias
layer for drc markers which have been individually excluded
layer for drc markers with SEVERITY_WARNING
smd pads, front layer
Meta control for all vias opacity/visibility.
currently selected items overlay
for pageLayout editor previewing
show modules references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR

◆ GERBVIEW_LAYER_ID

enum GERBVIEW_LAYER_ID : int

GerbView draw layers.

Enumerator
GERBVIEW_LAYER_ID_START 
GERBVIEW_LAYER_ID_RESERVED 

GerbView draw layers and d-code layers.

LAYER_DCODES 
LAYER_NEGATIVE_OBJECTS 
LAYER_GERBVIEW_GRID 
LAYER_GERBVIEW_AXES 
LAYER_GERBVIEW_BACKGROUND 
LAYER_GERBVIEW_WORKSHEET 
GERBVIEW_LAYER_ID_END 

Definition at line 359 of file layers_id_colors_and_visibility.h.

◆ LAYER_3D_ID

◆ NETNAMES_LAYER_ID

enum NETNAMES_LAYER_ID : int

Dedicated layers for net names used in Pcbnew.

Enumerator
NETNAMES_LAYER_ID_START 
NETNAMES_LAYER_ID_RESERVED 

Reserved space for board layer netnames.

LAYER_PAD_FR_NETNAMES 

Additional netnames layers (not associated with a PCB layer)

LAYER_PAD_BK_NETNAMES 
LAYER_PADS_NETNAMES 
LAYER_VIAS_NETNAMES 
NETNAMES_LAYER_ID_END 

Definition at line 145 of file layers_id_colors_and_visibility.h.

◆ PCB_LAYER_ID

enum PCB_LAYER_ID : int

A quick note on layer IDs:

The layers are stored in separate enums so that certain functions can take in the enums as datatypes and don't have to know about layers from other applications.

Layers that are shared between applications should be in the GAL_LAYER_ID enum.

The PCB_LAYER_ID struct must start at zero for compatibility with legacy board files.

Some functions accept any layer ID, so they start at zero (i.e. F_Cu) and go up to the LAYER_ID_COUNT, which needs to be kept up-to-date if new enums are added.Enum PCB_LAYER_ID This is the definition of all layers used in Pcbnew The PCB layer types are fixed at value 0 through LAYER_ID_COUNT, to ensure compatibility with legacy board files.

Enumerator
UNDEFINED_LAYER 
UNSELECTED_LAYER 
PCBNEW_LAYER_ID_START 
F_Cu 
In1_Cu 
In2_Cu 
In3_Cu 
In4_Cu 
In5_Cu 
In6_Cu 
In7_Cu 
In8_Cu 
In9_Cu 
In10_Cu 
In11_Cu 
In12_Cu 
In13_Cu 
In14_Cu 
In15_Cu 
In16_Cu 
In17_Cu 
In18_Cu 
In19_Cu 
In20_Cu 
In21_Cu 
In22_Cu 
In23_Cu 
In24_Cu 
In25_Cu 
In26_Cu 
In27_Cu 
In28_Cu 
In29_Cu 
In30_Cu 
B_Cu 
B_Adhes 
F_Adhes 
B_Paste 
F_Paste 
B_SilkS 
F_SilkS 
B_Mask 
F_Mask 
Dwgs_User 
Cmts_User 
Eco1_User 
Eco2_User 
Edge_Cuts 
Margin 
B_CrtYd 
F_CrtYd 
B_Fab 
F_Fab 
Rescue 
PCB_LAYER_ID_COUNT 

Definition at line 73 of file layers_id_colors_and_visibility.h.

73  : int
74 {
75  UNDEFINED_LAYER = -1,
76  UNSELECTED_LAYER = -2,
77 
80  In1_Cu,
81  In2_Cu,
82  In3_Cu,
83  In4_Cu,
84  In5_Cu,
85  In6_Cu,
86  In7_Cu,
87  In8_Cu,
88  In9_Cu,
89  In10_Cu,
90  In11_Cu,
91  In12_Cu,
92  In13_Cu,
93  In14_Cu,
94  In15_Cu,
95  In16_Cu,
96  In17_Cu,
97  In18_Cu,
98  In19_Cu,
99  In20_Cu,
100  In21_Cu,
101  In22_Cu,
102  In23_Cu,
103  In24_Cu,
104  In25_Cu,
105  In26_Cu,
106  In27_Cu,
107  In28_Cu,
108  In29_Cu,
109  In30_Cu,
110  B_Cu, // 31
111 
112  B_Adhes,
113  F_Adhes,
114 
115  B_Paste,
116  F_Paste,
117 
118  B_SilkS,
119  F_SilkS,
120 
121  B_Mask,
122  F_Mask,
123 
124  Dwgs_User,
125  Cmts_User,
126  Eco1_User,
127  Eco2_User,
128  Edge_Cuts,
129  Margin,
130 
131  B_CrtYd,
132  F_CrtYd,
133 
134  B_Fab,
135  F_Fab,
136 
137  Rescue,
138 
140 };

◆ SCH_LAYER_ID

enum SCH_LAYER_ID : int

Eeschema drawing layers.

Enumerator
SCH_LAYER_ID_START 
LAYER_WIRE 
LAYER_BUS 
LAYER_JUNCTION 
LAYER_LOCLABEL 
LAYER_GLOBLABEL 
LAYER_HIERLABEL 
LAYER_PINNUM 
LAYER_PINNAM 
LAYER_REFERENCEPART 
LAYER_VALUEPART 
LAYER_FIELDS 
LAYER_DEVICE 
LAYER_NOTES 
LAYER_NETNAM 
LAYER_PIN 
LAYER_SHEET 
LAYER_SHEETNAME 
LAYER_SHEETFILENAME 
LAYER_SHEETFIELDS 
LAYER_SHEETLABEL 
LAYER_NOCONNECT 
LAYER_ERC_WARN 
LAYER_ERC_ERR 
LAYER_DEVICE_BACKGROUND 
LAYER_SHEET_BACKGROUND 
LAYER_SCHEMATIC_GRID 
LAYER_SCHEMATIC_GRID_AXES 
LAYER_SCHEMATIC_BACKGROUND 
LAYER_SCHEMATIC_CURSOR 
LAYER_BRIGHTENED 
LAYER_HIDDEN 
LAYER_SELECTION_SHADOWS 
LAYER_SCHEMATIC_WORKSHEET 
LAYER_BUS_JUNCTION 
LAYER_SCHEMATIC_AUX_ITEMS 
SCH_LAYER_ID_END 

Definition at line 302 of file layers_id_colors_and_visibility.h.

302  : int
303 {
305 
307  LAYER_BUS,
312  LAYER_PINNUM,
313  LAYER_PINNAM,
316  LAYER_FIELDS,
317  LAYER_DEVICE,
318  LAYER_NOTES,
319  LAYER_NETNAM,
320  LAYER_PIN,
321  LAYER_SHEET,
336  LAYER_HIDDEN,
341 
343 };
Add new GAL layers here.

Function Documentation

◆ FlipLayer()

PCB_LAYER_ID FlipLayer ( PCB_LAYER_ID  aLayerId,
int  aCopperLayersCount = 0 
)

Function FlippedLayerNumber.

Returns
the layer number after flipping an item some (not all) layers: external copper, and paired layers( Mask, Paste, solder ... ) are swapped between front and back sides internal layers are flipped only if the copper layers count is known
Parameters
aLayerId= the PCB_LAYER_ID to flip
aCopperLayersCount= the number of copper layers. if 0 (in fact if < 4 ) internal layers will be not flipped because the layer count is not known

Definition at line 490 of file lset.cpp.

491 {
492  switch( aLayerId )
493  {
494  case B_Cu: return F_Cu;
495  case F_Cu: return B_Cu;
496 
497  case B_SilkS: return F_SilkS;
498  case F_SilkS: return B_SilkS;
499 
500  case B_Adhes: return F_Adhes;
501  case F_Adhes: return B_Adhes;
502 
503  case B_Mask: return F_Mask;
504  case F_Mask: return B_Mask;
505 
506  case B_Paste: return F_Paste;
507  case F_Paste: return B_Paste;
508 
509  case B_CrtYd: return F_CrtYd;
510  case F_CrtYd: return B_CrtYd;
511 
512  case B_Fab: return F_Fab;
513  case F_Fab: return B_Fab;
514 
515  default: // change internal layer if aCopperLayersCount is >= 4
516  if( IsCopperLayer( aLayerId ) && aCopperLayersCount >= 4 )
517  {
518  // internal copper layers count is aCopperLayersCount-2
519  PCB_LAYER_ID fliplayer = PCB_LAYER_ID(aCopperLayersCount - 2 - ( aLayerId - In1_Cu ) );
520  // Ensure fliplayer has a value which does not crash pcbnew:
521  if( fliplayer < F_Cu )
522  fliplayer = F_Cu;
523 
524  if( fliplayer > B_Cu )
525  fliplayer = B_Cu;
526 
527  return fliplayer;
528  }
529 
530  // No change for the other layers
531  return aLayerId;
532  }
533 }
PCB_LAYER_ID
A quick note on layer IDs:
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.

References B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In1_Cu, and IsCopperLayer().

Referenced by PCAD2KICAD::PCB_MODULE::AddToBoard(), PCAD2KICAD::PCB_PAD::Flip(), PCAD2KICAD::PCB_LINE::Flip(), PCAD2KICAD::PCB_ARC::Flip(), PCAD2KICAD::PCB_POLYGON::Flip(), PCB_TARGET::Flip(), TEXTE_PCB::Flip(), TRACK::Flip(), EDGE_MODULE::Flip(), TEXTE_MODULE::Flip(), DIMENSION::Flip(), MODULE::Flip(), ARC::Flip(), DRAWSEGMENT::Flip(), VIA::Flip(), and ZONE_CONTAINER::Flip().

◆ FlipLayerMask()

LSET FlipLayerMask ( LSET  aMask,
int  aCopperLayersCount = 0 
)

Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask, paste, solder layers are swapped internal layers are flipped only if the copper layers count is known.

Parameters
aMask= the LSET to flip
aCopperLayersCount= the number of copper layers. if 0 (in fact if < 4 ) internal layers will be not flipped because the layer count is not known

Definition at line 536 of file lset.cpp.

537 {
538  // layers on physical outside of a board:
539  const static LSET and_mask( 16, // !! update count
540  B_Cu, F_Cu,
541  B_SilkS, F_SilkS,
542  B_Adhes, F_Adhes,
543  B_Mask, F_Mask,
544  B_Paste, F_Paste,
545  B_Adhes, F_Adhes,
546  B_CrtYd, F_CrtYd,
547  B_Fab, F_Fab
548  );
549 
550  LSET newMask = aMask & ~and_mask;
551 
552  if( aMask[B_Cu] )
553  newMask.set( F_Cu );
554 
555  if( aMask[F_Cu] )
556  newMask.set( B_Cu );
557 
558  if( aMask[B_SilkS] )
559  newMask.set( F_SilkS );
560 
561  if( aMask[F_SilkS] )
562  newMask.set( B_SilkS );
563 
564  if( aMask[B_Adhes] )
565  newMask.set( F_Adhes );
566 
567  if( aMask[F_Adhes] )
568  newMask.set( B_Adhes );
569 
570  if( aMask[B_Mask] )
571  newMask.set( F_Mask );
572 
573  if( aMask[F_Mask] )
574  newMask.set( B_Mask );
575 
576  if( aMask[B_Paste] )
577  newMask.set( F_Paste );
578 
579  if( aMask[F_Paste] )
580  newMask.set( B_Paste );
581 
582  if( aMask[B_Adhes] )
583  newMask.set( F_Adhes );
584 
585  if( aMask[F_Adhes] )
586  newMask.set( B_Adhes );
587 
588  if( aMask[B_CrtYd] )
589  newMask.set( F_CrtYd );
590 
591  if( aMask[F_CrtYd] )
592  newMask.set( B_CrtYd );
593 
594  if( aMask[B_Fab] )
595  newMask.set( F_Fab );
596 
597  if( aMask[F_Fab] )
598  newMask.set( B_Fab );
599 
600  if( aCopperLayersCount >= 4 ) // Internal layers exist
601  {
602  LSET internalMask = aMask & LSET::InternalCuMask();
603 
604  if( internalMask != LSET::InternalCuMask() )
605  {
606  // the mask does not include all internal layers. Therefore
607  // the flipped mask for internal copper layers must be built
608  int innerLayerCnt = aCopperLayersCount -2;
609 
610  // the flipped mask is the innerLayerCnt bits rewritten in reverse order
611  // ( bits innerLayerCnt to 1 rewritten in bits 1 to innerLayerCnt )
612  for( int ii = 0; ii < innerLayerCnt; ii++ )
613  {
614  if( internalMask[innerLayerCnt - ii] )
615  {
616  newMask.set( ii + In1_Cu );
617  }
618  else
619  {
620  newMask.reset( ii + In1_Cu );
621  }
622  }
623  }
624  }
625 
626  return newMask;
627 }
LSET is a set of PCB_LAYER_IDs.
static LSET InternalCuMask()
Function InternalCuMask() returns a complete set of internal copper layers, which is all Cu layers ex...
Definition: lset.cpp:679

References B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In1_Cu, and LSET::InternalCuMask().

Referenced by D_PAD::Flip(), ZONE_CONTAINER::Flip(), DIALOG_PAD_PROPERTIES::initValues(), ALTIUM_PCB::ParsePads6Data(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetNetnameLayer()

int GetNetnameLayer ( int  aLayer)
inline

Returns a netname layer corresponding to the given layer.

Definition at line 903 of file layers_id_colors_and_visibility.h.

904 {
905  if( IsCopperLayer( aLayer ) )
906  return NETNAMES_LAYER_INDEX( aLayer );
907  else if( aLayer == LAYER_PADS_TH )
908  return LAYER_PADS_NETNAMES;
909  else if( aLayer == LAYER_PAD_FR )
910  return LAYER_PAD_FR_NETNAMES;
911  else if( aLayer == LAYER_PAD_BK )
912  return LAYER_PAD_BK_NETNAMES;
913  else if( aLayer >= LAYER_VIA_MICROVIA && aLayer <= LAYER_VIA_THROUGH )
914  return LAYER_VIAS_NETNAMES;
915 
916  // Fallback
917  return Cmts_User;
918 }
multilayer pads, usually with holes
to draw usual through hole vias
smd pads, front layer
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Additional netnames layers (not associated with a PCB layer)

References Cmts_User, IsCopperLayer(), LAYER_PAD_BK, LAYER_PAD_BK_NETNAMES, LAYER_PAD_FR, LAYER_PAD_FR_NETNAMES, LAYER_PADS_NETNAMES, LAYER_PADS_TH, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_VIAS_NETNAMES, and NETNAMES_LAYER_INDEX.

Referenced by KIGFX::PCB_RENDER_SETTINGS::LoadColors(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), PCB_LAYER_WIDGET::OnLayerColorChange(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and TRACK::ViewGetLayers().

◆ IsBackLayer()

bool IsBackLayer ( PCB_LAYER_ID  aLayerId)
inline

◆ IsCopperLayer()

bool IsCopperLayer ( LAYER_NUM  aLayerId)
inline

Function IsCopperLayer tests whether a layer is a copper layer.

Parameters
aLayerId= Layer to test
Returns
true if aLayer is a valid copper layer

Definition at line 794 of file layers_id_colors_and_visibility.h.

795 {
796  return aLayerId >= F_Cu && aLayerId <= B_Cu;
797 }

References B_Cu, and F_Cu.

Referenced by BOARD::Add(), BOARD_ADAPTER::AddPadsShapesWithClearanceToContainer(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), BOARD::BOARD(), PCB_ONE_LAYER_SELECTOR::buildList(), SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList(), BOARD_ADAPTER::createLayers(), KIGFX::PCB_PAINTER::draw(), PCB_EDIT_FRAME::Edit_Zone_Params(), FlipLayer(), DSN::SPECCTRA_DB::FromBOARD(), GenCADLayerName(), GetGerberFileFunctionAttribute(), GetGerberFilePolarityAttribute(), GetGerberProtelExtension(), BOARD_DESIGN_SETTINGS::GetLayerClass(), BOARD::GetLayerID(), BOARD::GetLayerName(), BOARD::GetLayerType(), GetNetnameLayer(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), DIALOG_EXPORT_SVG::initDialog(), PCB_INSPECTION_TOOL::InspectClearance(), IsNetCopperLayer(), BOARD_ITEM::IsOnCopperLayer(), PCBNEW_CONTROL::LayerNext(), PCBNEW_CONTROL::LayerPrev(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), DIALOG_PLOT::OnPopUpLayers(), EAGLE_PLUGIN::packageSMD(), ALTIUM_PCB::ParseVias6Data(), PNS::TOOL_BASE::pickSingleItem(), BRDITEMS_PLOTTER::PlotDrawSegment(), PlotOneBoardLayer(), BRDITEMS_PLOTTER::PlotTextePcb(), CONVERT_TOOL::PolyToLines(), ROUTER_TOOL::prepareInteractive(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), BOARD::SetLayerName(), BOARD::SetLayerType(), PCB_DRAW_PANEL_GAL::SetTopLayer(), PCBNEW_PRINTOUT::setupViewLayers(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), PNS_KICAD_IFACE_BASE::syncGraphicalItem(), PNS_KICAD_IFACE_BASE::syncTextItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperTextAndGraphics(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), and MODULE::TransformPadsShapesWithClearanceToPolygon().

◆ IsDCodeLayer()

◆ IsFrontLayer()

bool IsFrontLayer ( PCB_LAYER_ID  aLayerId)
inline

Layer classification: check if it's a front layer.

Definition at line 834 of file layers_id_colors_and_visibility.h.

835 {
836  switch( aLayerId )
837  {
838  case F_Cu:
839  case F_Adhes:
840  case F_Paste:
841  case F_SilkS:
842  case F_Mask:
843  case F_CrtYd:
844  case F_Fab:
845  return true;
846  default:
847  ;
848  }
849 
850  return false;
851 }

References F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, and F_SilkS.

Referenced by GENERAL_COLLECTOR::Inspect(), PCB_DRAW_PANEL_GAL::SetTopLayer(), TEXTE_MODULE::ViewGetLOD(), and D_PAD::ViewGetLOD().

◆ IsNetCopperLayer()

bool IsNetCopperLayer ( LAYER_NUM  aLayer)
inline

Checks if the given layer is "net copper", meaning it is eligible for net coloring.

Parameters
aLayeris the layer to test
Returns
true if the layer is one that participates in net coloring

Definition at line 951 of file layers_id_colors_and_visibility.h.

952 {
953  static std::set<LAYER_NUM> netCopperLayers =
954  {
955  LAYER_PAD_FR,
956  LAYER_PAD_BK,
961  };
962 
963  return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
964 }
to draw blind/buried vias
multilayer pads, usually with holes
to draw usual through hole vias
smd pads, front layer
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.

References IsCopperLayer(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS_TH, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, and LAYER_VIA_THROUGH.

Referenced by KIGFX::PCB_RENDER_SETTINGS::GetColor().

◆ IsNetnameLayer()

bool IsNetnameLayer ( LAYER_NUM  aLayer)
inline

Function IsNetnameLayer tests whether a layer is a netname layer.

Parameters
aLayer= Layer to test
Returns
true if aLayer is a valid netname layer

Definition at line 926 of file layers_id_colors_and_visibility.h.

927 {
928  return aLayer >= NETNAMES_LAYER_INDEX( F_Cu ) &&
929  aLayer < NETNAMES_LAYER_ID_END;
930 }
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.

References F_Cu, NETNAMES_LAYER_ID_END, and NETNAMES_LAYER_INDEX.

Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), TRACK::ViewGetLOD(), VIA::ViewGetLOD(), and D_PAD::ViewGetLOD().

◆ IsNonCopperLayer()

bool IsNonCopperLayer ( LAYER_NUM  aLayerId)
inline

Function IsNonCopperLayer tests whether a layer is a non copper layer.

Parameters
aLayerId= Layer to test
Returns
true if aLayer is a non copper layer

Definition at line 805 of file layers_id_colors_and_visibility.h.

806 {
807  return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
808 }

References B_Cu, and PCB_LAYER_ID_COUNT.

Referenced by PCAD2KICAD::PCB_LINE::AddToModule(), PCAD2KICAD::PCB_ARC::AddToModule(), and PCAD2KICAD::PCB_POLYGON::AddToModule().

◆ IsPcbLayer()

bool IsPcbLayer ( LAYER_NUM  aLayer)
inline

Function IsPcbLayer tests whether a layer is a valid layer for pcbnew.

Parameters
aLayer= Layer to test
Returns
true if aLayer is a layer valid in pcbnew

Definition at line 783 of file layers_id_colors_and_visibility.h.

784 {
785  return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
786 }

References F_Cu, and PCB_LAYER_ID_COUNT.

Referenced by GBR_TO_PCB_EXPORTER::ExportPcb().

◆ IsUserLayer()

bool IsUserLayer ( PCB_LAYER_ID  aLayerId)
inline

Function IsUserLayer tests whether a layer is a non copper and a non tech layer.

Parameters
aLayerId= Layer to test
Returns
true if aLayer is a user layer

Definition at line 816 of file layers_id_colors_and_visibility.h.

817 {
818  return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
819 }

References Dwgs_User, and Eco2_User.

◆ IsValidLayer()

bool IsValidLayer ( LAYER_NUM  aLayerId)
inline

Function IsValidLayer tests whether a given integer is a valid layer index, i.e.

can be safely put in a PCB_LAYER_ID

Parameters
aLayerId= Layer index to test. It can be an int, so its useful during I/O
Returns
true if aLayerIndex is a valid layer index

Definition at line 772 of file layers_id_colors_and_visibility.h.

773 {
774  return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
775 }

References PCB_LAYER_ID_COUNT.

Referenced by LAYERS_MAP_DIALOG::OnSelectLayer().

◆ IsZoneLayer()

bool IsZoneLayer ( LAYER_NUM  aLayer)
inline

Definition at line 933 of file layers_id_colors_and_visibility.h.

934 {
935  return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
936 }
Virtual layers for stacking zones and tracks on a given copper layer.

References LAYER_ZONE_END, and LAYER_ZONE_START.

Referenced by KIGFX::PCB_PAINTER::draw(), and KIGFX::PCB_RENDER_SETTINGS::GetColor().

◆ LayerName()

wxString LayerName ( int  aLayer)

Returns the string equivalent of a given layer.

Parameters
aLayeris a valid layer ID

Definition at line 24 of file layer_id.cpp.

25 {
26  switch( aLayer )
27  {
28  // PCB_LAYER_ID
29  case F_Cu: return _( "F.Cu" );
30  case In1_Cu: return _( "In1.Cu" );
31  case In2_Cu: return _( "In2.Cu" );
32  case In3_Cu: return _( "In3.Cu" );
33  case In4_Cu: return _( "In4.Cu" );
34  case In5_Cu: return _( "In5.Cu" );
35  case In6_Cu: return _( "In6.Cu" );
36  case In7_Cu: return _( "In7.Cu" );
37  case In8_Cu: return _( "In8.Cu" );
38  case In9_Cu: return _( "In9.Cu" );
39  case In10_Cu: return _( "In10.Cu" );
40  case In11_Cu: return _( "In11.Cu" );
41  case In12_Cu: return _( "In12.Cu" );
42  case In13_Cu: return _( "In13.Cu" );
43  case In14_Cu: return _( "In14.Cu" );
44  case In15_Cu: return _( "In15.Cu" );
45  case In16_Cu: return _( "In16.Cu" );
46  case In17_Cu: return _( "In17.Cu" );
47  case In18_Cu: return _( "In18.Cu" );
48  case In19_Cu: return _( "In19.Cu" );
49  case In20_Cu: return _( "In20.Cu" );
50  case In21_Cu: return _( "In21.Cu" );
51  case In22_Cu: return _( "In22.Cu" );
52  case In23_Cu: return _( "In23.Cu" );
53  case In24_Cu: return _( "In24.Cu" );
54  case In25_Cu: return _( "In25.Cu" );
55  case In26_Cu: return _( "In26.Cu" );
56  case In27_Cu: return _( "In27.Cu" );
57  case In28_Cu: return _( "In28.Cu" );
58  case In29_Cu: return _( "In29.Cu" );
59  case In30_Cu: return _( "In30.Cu" );
60  case B_Cu: return _( "B.Cu" );
61 
62  // Technicals
63  case B_Adhes: return _( "B.Adhes" );
64  case F_Adhes: return _( "F.Adhes" );
65  case B_Paste: return _( "B.Paste" );
66  case F_Paste: return _( "F.Paste" );
67  case B_SilkS: return _( "B.SilkS" );
68  case F_SilkS: return _( "F.SilkS" );
69  case B_Mask: return _( "B.Mask" );
70  case F_Mask: return _( "F.Mask" );
71 
72  // Users
73  case Dwgs_User: return _( "Dwgs.User" );
74  case Cmts_User: return _( "Cmts.User" );
75  case Eco1_User: return _( "Eco1.User" );
76  case Eco2_User: return _( "Eco2.User" );
77  case Edge_Cuts: return _( "Edge.Cuts" );
78  case Margin: return _( "Margin" );
79 
80  // Footprint
81  case F_CrtYd: return _( "F.CrtYd" );
82  case B_CrtYd: return _( "B.CrtYd" );
83  case F_Fab: return _( "F.Fab" );
84  case B_Fab: return _( "B.Fab" );
85 
86  // Rescue
87  case Rescue: return _( "Rescue" );
88 
89  // SCH_LAYER_ID
90 
91  case LAYER_WIRE: return _( "Wire" );
92  case LAYER_BUS: return _( "Bus" );
93  case LAYER_BUS_JUNCTION: return _( "Bus Junction" );
94  case LAYER_JUNCTION: return _( "Junction" );
95  case LAYER_LOCLABEL: return _( "Label" );
96  case LAYER_GLOBLABEL: return _( "Global label" );
97  case LAYER_HIERLABEL: return _( "Hierarchical label" );
98  case LAYER_PINNUM: return _( "Pin number" );
99  case LAYER_PINNAM: return _( "Pin name" );
100  case LAYER_REFERENCEPART: return _( "Symbol reference" );
101  case LAYER_VALUEPART: return _( "Symbol value" );
102  case LAYER_FIELDS: return _( "Symbol fields" );
103  case LAYER_DEVICE: return _( "Symbol body outline" );
104  case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fill" );
105  case LAYER_NOTES: return _( "Notes" );
106  case LAYER_NETNAM: return _( "Net name" );
107  case LAYER_PIN: return _( "Pin" );
108  case LAYER_SHEET: return _( "Sheet border" );
109  case LAYER_SHEET_BACKGROUND: return _( "Sheet background" );
110  case LAYER_SHEETNAME: return _( "Sheet name" );
111  case LAYER_SHEETFIELDS: return _( "Sheet fields" );
112  case LAYER_SHEETFILENAME: return _( "Sheet file name" );
113  case LAYER_SHEETLABEL: return _( "Sheet label" );
114  case LAYER_NOCONNECT: return _( "No connect symbol" );
115  case LAYER_ERC_WARN: return _( "ERC warning" );
116  case LAYER_ERC_ERR: return _( "ERC error" );
117  case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
118  case LAYER_SCHEMATIC_GRID: return _( "Grid" );
119  case LAYER_SCHEMATIC_GRID_AXES: return _( "Axes" );
120  case LAYER_SCHEMATIC_BACKGROUND: return _( "Background" );
121  case LAYER_SCHEMATIC_CURSOR: return _( "Cursor" );
122  case LAYER_BRIGHTENED: return _( "Highlighted items" );
123  case LAYER_HIDDEN: return _( "Hidden item" );
124  case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
125  case LAYER_SCHEMATIC_WORKSHEET: return _( "Worksheet" );
126 
127  // GAL_LAYER_ID
128 
129  case LAYER_MOD_FR: return _( "Footprints Front" );
130  case LAYER_MOD_BK: return _( "Footprints Back" );
131  case LAYER_MOD_VALUES: return _( "Values" );
132  case LAYER_MOD_REFERENCES: return _( "Reference Designators" );
133  case LAYER_MOD_TEXT_FR: return _( "Footprint Text Front" );
134  case LAYER_MOD_TEXT_BK: return _( "Footprint Text Back" );
135  case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden Text" );
136  case LAYER_PAD_FR: return _( "Pads Front" );
137  case LAYER_PAD_BK: return _( "Pads Back" );
138  case LAYER_PADS_TH: return _( "Through Hole Pads" );
139  case LAYER_TRACKS: return _( "Tracks" );
140  case LAYER_VIA_THROUGH: return _( "Through Via" );
141  case LAYER_VIA_BBLIND: return _( "Bl/Buried Via" );
142  case LAYER_VIA_MICROVIA: return _( "Micro Via" );
143  case LAYER_NON_PLATEDHOLES: return _( "Non Plated Holes" );
144  case LAYER_RATSNEST: return _( "Ratsnest" );
145  case LAYER_NO_CONNECTS: return _( "No-Connects" );
146  case LAYER_DRC_WARNING: return _( "DRC Warnings" );
147  case LAYER_DRC_ERROR: return _( "DRC Errors" );
148  case LAYER_DRC_EXCLUSION: return _( "DRC Exclusions" );
149  case LAYER_ANCHOR: return _( "Anchors" );
150  case LAYER_WORKSHEET: return _( "Worksheet" );
151  case LAYER_CURSOR: return _( "Cursor" );
152  case LAYER_AUX_ITEMS: return _( "Helper items" );
153  case LAYER_GRID: return _( "Grid" );
154  case LAYER_GRID_AXES: return _( "Grid Axes" );
155  case LAYER_PCB_BACKGROUND: return _( "Background" );
156  case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
157 
158  default:
159 #if DEBUG
160  wxString str;
161  str.Printf( "Unknown: ID %d", aLayer );
162  return str;
163 #else
164  return wxEmptyString;
165 #endif
166  }
167 }
to draw blind/buried vias
show a marker on pads with no nets
multilayer pads, usually with holes
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
show modules values (when texts are visibles)
show modules on front
Auxiliary items (guides, rule, etc)
to draw usual through hole vias
layer for drc markers which have been individually excluded
layer for drc markers with SEVERITY_WARNING
smd pads, front layer
#define _(s)
Definition: 3d_actions.cpp:33
currently selected items overlay
show modules references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR

References _, B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, LAYER_ANCHOR, LAYER_AUX_ITEMS, LAYER_BRIGHTENED, LAYER_BUS, LAYER_BUS_JUNCTION, LAYER_CURSOR, LAYER_DEVICE, LAYER_DEVICE_BACKGROUND, LAYER_DRC_ERROR, LAYER_DRC_EXCLUSION, LAYER_DRC_WARNING, LAYER_ERC_ERR, LAYER_ERC_WARN, LAYER_FIELDS, LAYER_GLOBLABEL, LAYER_GRID, LAYER_GRID_AXES, LAYER_HIDDEN, LAYER_HIERLABEL, LAYER_JUNCTION, LAYER_LOCLABEL, LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT_BK, LAYER_MOD_TEXT_FR, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_NETNAM, LAYER_NO_CONNECTS, LAYER_NOCONNECT, LAYER_NON_PLATEDHOLES, LAYER_NOTES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS_TH, LAYER_PCB_BACKGROUND, LAYER_PIN, LAYER_PINNAM, LAYER_PINNUM, LAYER_RATSNEST, LAYER_REFERENCEPART, LAYER_SCHEMATIC_AUX_ITEMS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_CURSOR, LAYER_SCHEMATIC_GRID, LAYER_SCHEMATIC_GRID_AXES, LAYER_SCHEMATIC_WORKSHEET, LAYER_SELECT_OVERLAY, LAYER_SELECTION_SHADOWS, LAYER_SHEET, LAYER_SHEET_BACKGROUND, LAYER_SHEETFIELDS, LAYER_SHEETFILENAME, LAYER_SHEETLABEL, LAYER_SHEETNAME, LAYER_TRACKS, LAYER_VALUEPART, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_WIRE, LAYER_WORKSHEET, Margin, and Rescue.

Referenced by AUTOPLACE_TOOL::autoplace(), PANEL_MODEDIT_COLOR_SETTINGS::createSwatches(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches(), and BOARD::GetStandardLayerName().

◆ operator+()

GAL_LAYER_ID operator+ ( const GAL_LAYER_ID a,
int  b 
)
inline

Used for via types.

Definition at line 247 of file layers_id_colors_and_visibility.h.

248 {
249  GAL_LAYER_ID t = GAL_LAYER_ID( int( a ) + b );
250  wxASSERT( t <= GAL_LAYER_ID_END );
251  return t;
252 }
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Add new GAL layers here.

References GAL_LAYER_ID_END.

◆ operator++() [1/2]

GAL_LAYER_ID operator++ ( GAL_LAYER_ID a)
inline

Definition at line 234 of file layers_id_colors_and_visibility.h.

235 {
236  a = GAL_LAYER_ID( int( a ) + 1 );
237  return a;
238 }
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.

◆ operator++() [2/2]

SCH_LAYER_ID operator++ ( SCH_LAYER_ID a)
inline

Definition at line 349 of file layers_id_colors_and_visibility.h.

350 {
351  a = SCH_LAYER_ID( int( a ) + 1 );
352  return a;
353 }
SCH_LAYER_ID
Eeschema drawing layers.

◆ ToGalLayer()

GAL_LAYER_ID ToGalLayer ( int  aInteger)
inline

Definition at line 240 of file layers_id_colors_and_visibility.h.

241 {
242  wxASSERT( aInteger >= GAL_LAYER_ID_START && aInteger <= GAL_LAYER_ID_END );
243  return static_cast<GAL_LAYER_ID>( aInteger );
244 }
Add new GAL layers here.

References GAL_LAYER_ID_END, and GAL_LAYER_ID_START.

Referenced by APPEARANCE_CONTROLS::rebuildObjects(), and APPEARANCE_CONTROLS::syncObjectSettings().

◆ ToLAYER_ID()

PCB_LAYER_ID ToLAYER_ID ( int  aLayer)

Definition at line 856 of file lset.cpp.

857 {
858  wxASSERT( aLayer < GAL_LAYER_ID_END );
859  return PCB_LAYER_ID( aLayer );
860 }
Add new GAL layers here.
PCB_LAYER_ID
A quick note on layer IDs:

References GAL_LAYER_ID_END.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), PNS_KICAD_IFACE::AddItem(), GRID_CELL_LAYER_SELECTOR::BeginEdit(), BOARD::BOARD(), DSN::SPECCTRA_DB::buildLayerMaps(), BOARD_ADAPTER::createLayers(), GRID_CELL_LAYER_RENDERER::Draw(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), GENDRILL_WRITER_BASE::GenDrillReportFile(), GetGerberFileFunctionAttribute(), BOARD::GetLayerID(), PCB_LAYER_SELECTOR::getLayerName(), PCB_LAYER_BOX_SELECTOR::getLayerName(), GRID_CELL_LAYER_SELECTOR::GetValue(), PCB_LAYER_BOX_SELECTOR::isLayerEnabled(), PCBNEW_CONTROL::LayerNext(), PCBNEW_CONTROL::LayerPrev(), PCAD2KICAD::PCB::MapLayer(), onLayer(), APPEARANCE_CONTROLS::onLayerClick(), PCB_LAYER_WIDGET::OnLayerSelect(), DIALOG_RULE_AREA_PROPERTIES::OnLayerSelection(), DIALOG_NON_COPPER_ZONES_EDITOR::OnLayerSelection(), DIALOG_COPPER_ZONE::OnLayerSelection(), PCB_LAYER_WIDGET::onPopupSelection(), PLOT_CONTROLLER::OpenPlotfile(), DRC_RULES_PARSER::parseLayer(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), PLOT_CONTROLLER::PlotLayer(), ROUTER_TOOL::prepareInteractive(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), SELECTION_TOOL::Selectable(), PCB_BASE_FRAME::SelectLayer(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), APPEARANCE_CONTROLS::SetLayerVisible(), TEXT_MOD_GRID_TABLE::SetValueAsLong(), ROUTER_TOOL::switchLayerOnViaPlacement(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), PCB_LAYER_WIDGET::SyncLayerVisibilities(), PNS_KICAD_IFACE_BASE::syncZone(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), and DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow().

Variable Documentation

◆ GAL_LAYER_ID_COUNT

constexpr int GAL_LAYER_ID_COUNT = GAL_LAYER_ID_END - GAL_LAYER_ID_START

Definition at line 232 of file layers_id_colors_and_visibility.h.