KiCad PCB EDA Suite
layer_ids.h File Reference
#include <set>
#include <vector>
#include <bitset>
#include <stdexcept>
#include <wx/string.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 BITMAP_LAYER_FOR(boardLayer)   ( LAYER_BITMAP_START + boardLayer )
 Macros for getting the extra layers for a given board layer. More...
 
#define ZONE_LAYER_FOR(boardLayer)   ( LAYER_ZONE_START + boardLayer )
 
#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 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 , User_1 , User_2 , User_3 ,
  User_4 , User_5 , User_6 , User_7 ,
  User_8 , User_9 , Rescue , PCB_LAYER_ID_COUNT
}
 A quick note on layer IDs: More...
 
enum class  FLASHING { DEFAULT , ALWAYS_FLASHED , NEVER_FLASHED }
 Enum used during connectivity building to ensure we do not query connectivity while building the database. 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_PAD_NETNAMES , LAYER_VIA_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 + 0 , LAYER_VIA_MICROVIA = GAL_LAYER_ID_START + 1 , LAYER_VIA_BBLIND = GAL_LAYER_ID_START + 2 ,
  LAYER_VIA_THROUGH = GAL_LAYER_ID_START + 3 , LAYER_NON_PLATEDHOLES = GAL_LAYER_ID_START + 4 , LAYER_MOD_TEXT = GAL_LAYER_ID_START + 5 , LAYER_MOD_TEXT_INVISIBLE = GAL_LAYER_ID_START + 7 ,
  LAYER_ANCHOR = GAL_LAYER_ID_START + 8 , LAYER_PAD_FR = GAL_LAYER_ID_START + 9 , LAYER_PAD_BK = GAL_LAYER_ID_START + 10 , LAYER_RATSNEST = GAL_LAYER_ID_START + 11 ,
  LAYER_GRID = GAL_LAYER_ID_START + 12 , LAYER_GRID_AXES = GAL_LAYER_ID_START + 13 , LAYER_MOD_FR = GAL_LAYER_ID_START + 15 , LAYER_MOD_BK = GAL_LAYER_ID_START + 16 ,
  LAYER_MOD_VALUES = GAL_LAYER_ID_START + 17 , LAYER_MOD_REFERENCES = GAL_LAYER_ID_START + 18 , LAYER_TRACKS = GAL_LAYER_ID_START + 19 , LAYER_PADS_TH = GAL_LAYER_ID_START + 20 ,
  LAYER_PAD_PLATEDHOLES = GAL_LAYER_ID_START + 21 , LAYER_VIA_HOLES = GAL_LAYER_ID_START + 22 , LAYER_DRC_ERROR = GAL_LAYER_ID_START + 23 , LAYER_DRAWINGSHEET = GAL_LAYER_ID_START + 24 ,
  LAYER_GP_OVERLAY = GAL_LAYER_ID_START + 25 , LAYER_SELECT_OVERLAY = GAL_LAYER_ID_START + 26 , LAYER_PCB_BACKGROUND = GAL_LAYER_ID_START + 27 , LAYER_CURSOR = GAL_LAYER_ID_START + 28 ,
  LAYER_AUX_ITEMS = GAL_LAYER_ID_START + 29 , LAYER_DRAW_BITMAPS = GAL_LAYER_ID_START + 30 , GAL_LAYER_ID_BITMASK_END = GAL_LAYER_ID_START + 31 , LAYER_PADS = GAL_LAYER_ID_START + 32 ,
  LAYER_ZONES = GAL_LAYER_ID_START + 33 , LAYER_PAD_HOLEWALLS = GAL_LAYER_ID_START + 34 , LAYER_VIA_HOLEWALLS = GAL_LAYER_ID_START + 35 , LAYER_DRC_WARNING = GAL_LAYER_ID_START + 36 ,
  LAYER_DRC_EXCLUSION = GAL_LAYER_ID_START + 37 , LAYER_MARKER_SHADOWS = GAL_LAYER_ID_START + 38 , LAYER_LOCKED_ITEM_SHADOW = GAL_LAYER_ID_START + 39 , LAYER_CONFLICTS_SHADOW = GAL_LAYER_ID_START + 40 ,
  LAYER_DRAWINGSHEET_PAGE1 , LAYER_DRAWINGSHEET_PAGEn , LAYER_PAGE_LIMITS , LAYER_ZONE_START ,
  LAYER_ZONE_END = LAYER_ZONE_START + PCB_LAYER_ID_COUNT , LAYER_BITMAP_START , LAYER_BITMAP_END = LAYER_BITMAP_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_INTERSHEET_REFS , LAYER_NETCLASS_REFS , LAYER_DEVICE , LAYER_NOTES ,
  LAYER_PRIVATE_NOTES , LAYER_NOTES_BACKGROUND , LAYER_PIN , LAYER_SHEET ,
  LAYER_SHEETNAME , LAYER_SHEETFILENAME , LAYER_SHEETFIELDS , LAYER_SHEETLABEL ,
  LAYER_NOCONNECT , LAYER_DANGLING , LAYER_ERC_WARN , LAYER_ERC_ERR ,
  LAYER_ERC_EXCLUSION , LAYER_DEVICE_BACKGROUND , LAYER_SHEET_BACKGROUND , LAYER_SCHEMATIC_GRID ,
  LAYER_SCHEMATIC_GRID_AXES , LAYER_SCHEMATIC_BACKGROUND , LAYER_SCHEMATIC_CURSOR , LAYER_HOVERED ,
  LAYER_BRIGHTENED , LAYER_HIDDEN , LAYER_SELECTION_SHADOWS , LAYER_SCHEMATIC_DRAWINGSHEET ,
  LAYER_SCHEMATIC_PAGE_LIMITS , LAYER_BUS_JUNCTION , LAYER_SCHEMATIC_AUX_ITEMS , LAYER_SCHEMATIC_ANCHOR ,
  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_DRAWINGSHEET ,
  LAYER_GERBVIEW_PAGE_LIMITS , 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_BOTTOM ,
  LAYER_3D_SOLDERMASK_TOP , 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 (int aLayerId)
 Test whether a given integer is a valid layer index, i.e. More...
 
bool IsPcbLayer (int aLayer)
 Test whether a layer is a valid layer for Pcbnew. More...
 
bool IsCopperLayer (int aLayerId)
 Tests whether a layer is a copper layer. More...
 
bool IsNonCopperLayer (int aLayerId)
 Test whether a layer is a non copper layer. More...
 
bool IsCopperLayer (int aLayerId, bool aIncludeSyntheticCopperLayers)
 Tests whether a layer is a copper layer, optionally including synthetic copper layers such as LAYER_VIA_THROUGH, LAYER_PAD_FR, etc. More...
 
bool IsViaPadLayer (int aLayer)
 
bool IsHoleLayer (int aLayer)
 
bool IsUserLayer (PCB_LAYER_ID aLayerId)
 Test 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)
 
LSET FlipLayerMask (LSET aMask, int aCopperLayersCount=0)
 Calculate the mask layer when flipping a footprint. More...
 
int GetNetnameLayer (int aLayer)
 Returns a netname layer corresponding to the given layer. More...
 
bool IsNetnameLayer (int aLayer)
 Test whether a layer is a netname layer. More...
 
bool IsZoneLayer (int aLayer)
 
bool IsDCodeLayer (int aLayer)
 
bool IsNetCopperLayer (int 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
 

Macro Definition Documentation

◆ BITMAP_LAYER_FOR

#define BITMAP_LAYER_FOR (   boardLayer)    ( LAYER_BITMAP_START + boardLayer )

Macros for getting the extra layers for a given board layer.

Definition at line 267 of file layer_ids.h.

◆ 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 264 of file layer_ids.h.

◆ GERBER_DCODE_LAYER

#define GERBER_DCODE_LAYER (   x)    ( GERBER_DRAWLAYERS_COUNT + x )

Definition at line 425 of file layer_ids.h.

◆ GERBER_DRAW_LAYER

#define GERBER_DRAW_LAYER (   x)    ( GERBVIEW_LAYER_ID_START + x )

Definition at line 423 of file layer_ids.h.

◆ GERBER_DRAW_LAYER_INDEX

#define GERBER_DRAW_LAYER_INDEX (   x)    ( x - GERBVIEW_LAYER_ID_START )

Definition at line 427 of file layer_ids.h.

◆ GERBER_DRAWLAYERS_COUNT

#define GERBER_DRAWLAYERS_COUNT   PCB_LAYER_ID_COUNT

Definition at line 402 of file layer_ids.h.

◆ LAYER_ID_COUNT

#define LAYER_ID_COUNT   LAYER_3D_END

Must update this if you add any enums after GerbView!

Definition at line 449 of file layer_ids.h.

◆ MAX_CU_LAYERS

#define MAX_CU_LAYERS   (B_Cu - F_Cu + 1)

Definition at line 140 of file layer_ids.h.

◆ MIN_VISIBILITY_MASK

#define MIN_VISIBILITY_MASK
Value:
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:214
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:218
@ LAYER_RATSNEST
Definition: layer_ids.h:204
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:215
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:219
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
Definition: layer_ids.h:264

Definition at line 463 of file layer_ids.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 174 of file layer_ids.h.

◆ SCH_LAYER_ID_COUNT

#define SCH_LAYER_ID_COUNT   ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )

Definition at line 391 of file layer_ids.h.

◆ SCH_LAYER_INDEX

#define SCH_LAYER_INDEX (   x)    ( x - SCH_LAYER_ID_START )

Definition at line 393 of file layer_ids.h.

◆ ZONE_LAYER_FOR

#define ZONE_LAYER_FOR (   boardLayer)    ( LAYER_ZONE_START + boardLayer )

Definition at line 268 of file layer_ids.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 471 of file layer_ids.h.

◆ BASE_SET

typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET

Definition at line 520 of file layer_ids.h.

◆ GAL_BASE_SET

typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET

Definition at line 292 of file layer_ids.h.

Enumeration Type Documentation

◆ FLASHING

enum class FLASHING
strong

Enum used during connectivity building to ensure we do not query connectivity while building the database.

Enumerator
DEFAULT 
ALWAYS_FLASHED 
NEVER_FLASHED 

Definition at line 146 of file layer_ids.h.

147{
148 DEFAULT, // Flashing follows connectivity
149 ALWAYS_FLASHED, // Always flashed for connectivity
150 NEVER_FLASHED, // Never flashed for connectivity
151};
@ ALWAYS_FLASHED

◆ 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.

NOTE: Be very careful where you add new layers here. Layers up to GAL_LAYER_ID_BITMASK_END must never be re-ordered and new layers must always be added after this value, because the layers before this value are mapped to bit locations in legacy board files.

The values in this enum that are used to store visibility state are explicitly encoded with an offset from GAL_LAYER_ID_START, which is explicitly encoded itself. The exact value of GAL_LAYER_ID_START is not that sensitive, but the offsets should never be changed or else any existing visibility settings will be disrupted.

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 
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_MOD_FR 

show footprints on front

LAYER_MOD_BK 

show footprints on back

LAYER_MOD_VALUES 

show footprints values (when texts are visible)

LAYER_MOD_REFERENCES 

show footprints references (when texts are visible)

LAYER_TRACKS 
LAYER_PADS_TH 

multilayer pads, usually with holes

LAYER_PAD_PLATEDHOLES 

to draw pad holes (plated)

LAYER_VIA_HOLES 

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

LAYER_DRC_ERROR 

layer for drc markers with SEVERITY_ERROR

LAYER_DRAWINGSHEET 

drawingsheet frame and titleblock

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 bit masks in legacy board files.

LAYER_PADS 

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

LAYER_ZONES 

Control for copper zone opacity/visibility (color ignored)

LAYER_PAD_HOLEWALLS 
LAYER_VIA_HOLEWALLS 
LAYER_DRC_WARNING 

layer for drc markers with SEVERITY_WARNING

LAYER_DRC_EXCLUSION 

layer for drc markers which have been individually excluded

LAYER_MARKER_SHADOWS 

shadows for drc markers

LAYER_LOCKED_ITEM_SHADOW 

shadow layer for locked items

LAYER_CONFLICTS_SHADOW 

shadow layer for items flagged conficting

LAYER_DRAWINGSHEET_PAGE1 

for drawingsheetEditor previewing

LAYER_DRAWINGSHEET_PAGEn 

for drawingsheetEditor previewing

LAYER_PAGE_LIMITS 

color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)

LAYER_ZONE_START 

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

LAYER_ZONE_END 
LAYER_BITMAP_START 

Virtual layers for background images per board layer.

LAYER_BITMAP_END 
GAL_LAYER_ID_END 

Definition at line 189 of file layer_ids.h.

190{
192
199// LAYER_MOD_TEXT_BK deprecated + 6,
207// LAYER_NO_CONNECTS deprecated + 14, ///< show a marker on pads with no nets
224
227
228 // Layers in this section have visibility controls but were not present in legacy board files.
229
232
238
240
242
243 // Add layers below this point that do not have visibility controls, so don't need explicit
244 // enum values
245
248
251
255
259
261};
@ NETNAMES_LAYER_ID_END
Definition: layer_ids.h:170
@ LAYER_GRID
Definition: layer_ids.h:205
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
Definition: layer_ids.h:200
@ GAL_LAYER_ID_START
Definition: layer_ids.h:191
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:249
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:239
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:234
@ LAYER_GRID_AXES
Definition: layer_ids.h:206
@ LAYER_DRAWINGSHEET_PAGEn
for drawingsheetEditor previewing
Definition: layer_ids.h:247
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:241
@ LAYER_ZONE_END
Definition: layer_ids.h:254
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:197
@ LAYER_PAD_FR
smd pads, front layer
Definition: layer_ids.h:202
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:217
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
Definition: layer_ids.h:223
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
Definition: layer_ids.h:236
@ LAYER_MOD_TEXT
Definition: layer_ids.h:198
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:220
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:231
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:230
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:235
@ GAL_LAYER_ID_END
Definition: layer_ids.h:260
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
Definition: layer_ids.h:226
@ LAYER_TRACKS
Definition: layer_ids.h:212
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:221
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:222
@ LAYER_MOD_FR
show footprints on front
Definition: layer_ids.h:208
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:253
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:201
@ LAYER_PAD_BK
smd pads, back layer
Definition: layer_ids.h:203
@ LAYER_MOD_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:210
@ LAYER_DRAWINGSHEET_PAGE1
for drawingsheetEditor previewing
Definition: layer_ids.h:246
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:213
@ LAYER_MARKER_SHADOWS
shadows for drc markers
Definition: layer_ids.h:237
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:194
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:196
@ LAYER_BITMAP_END
Definition: layer_ids.h:258
@ LAYER_BITMAP_START
Virtual layers for background images per board layer.
Definition: layer_ids.h:257
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:216
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:193
@ LAYER_MOD_BK
show footprints on back
Definition: layer_ids.h:209
@ LAYER_MOD_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:211
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:195
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:233
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137

◆ 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_DRAWINGSHEET 
LAYER_GERBVIEW_PAGE_LIMITS 
GERBVIEW_LAYER_ID_END 

Definition at line 405 of file layer_ids.h.

406{
408
411
419
421};
@ GERBVIEW_LAYER_ID_RESERVED
GerbView draw layers and d-code layers.
Definition: layer_ids.h:410
@ LAYER_GERBVIEW_DRAWINGSHEET
Definition: layer_ids.h:417
@ GERBVIEW_LAYER_ID_START
Definition: layer_ids.h:407
@ LAYER_GERBVIEW_BACKGROUND
Definition: layer_ids.h:416
@ LAYER_DCODES
Definition: layer_ids.h:412
@ LAYER_NEGATIVE_OBJECTS
Definition: layer_ids.h:413
@ LAYER_GERBVIEW_PAGE_LIMITS
Definition: layer_ids.h:418
@ GERBVIEW_LAYER_ID_END
Definition: layer_ids.h:420
@ LAYER_GERBVIEW_AXES
Definition: layer_ids.h:415
@ LAYER_GERBVIEW_GRID
Definition: layer_ids.h:414
@ SCH_LAYER_ID_END
Definition: layer_ids.h:388
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:402

◆ LAYER_3D_ID

enum LAYER_3D_ID : int

3D Viewer virtual layers for color settings

Enumerator
LAYER_3D_START 
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_BOTTOM 
LAYER_3D_SOLDERMASK_TOP 
LAYER_3D_SOLDERPASTE 
LAYER_3D_END 

Definition at line 431 of file layer_ids.h.

432{
434
444
446};
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:442
@ LAYER_3D_START
Definition: layer_ids.h:433
@ LAYER_3D_COPPER
Definition: layer_ids.h:438
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:436
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:441
@ LAYER_3D_BOARD
Definition: layer_ids.h:437
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:440
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:443
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:435
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:439
@ LAYER_3D_END
Definition: layer_ids.h:445

◆ 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_PAD_NETNAMES 
LAYER_VIA_NETNAMES 
NETNAMES_LAYER_ID_END 

Definition at line 154 of file layer_ids.h.

155{
156
158
160
162
164
169
171};
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer)
Definition: layer_ids.h:165
@ LAYER_PAD_BK_NETNAMES
Definition: layer_ids.h:166
@ LAYER_PAD_NETNAMES
Definition: layer_ids.h:167
@ NETNAMES_LAYER_ID_START
Definition: layer_ids.h:157
@ LAYER_VIA_NETNAMES
Definition: layer_ids.h:168
@ NETNAMES_LAYER_ID_RESERVED
Reserved space for board layer netnames.
Definition: layer_ids.h:161

◆ 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 data types 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. 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 
User_1 
User_2 
User_3 
User_4 
User_5 
User_6 
User_7 
User_8 
User_9 
Rescue 
PCB_LAYER_ID_COUNT 

Definition at line 58 of file layer_ids.h.

59{
60 UNDEFINED_LAYER = -1,
62
65 In1_Cu,
66 In2_Cu,
67 In3_Cu,
68 In4_Cu,
69 In5_Cu,
70 In6_Cu,
71 In7_Cu,
72 In8_Cu,
73 In9_Cu,
74 In10_Cu,
75 In11_Cu,
76 In12_Cu,
77 In13_Cu,
78 In14_Cu,
79 In15_Cu,
80 In16_Cu,
81 In17_Cu,
82 In18_Cu,
83 In19_Cu,
84 In20_Cu,
85 In21_Cu,
86 In22_Cu,
87 In23_Cu,
88 In24_Cu,
89 In25_Cu,
90 In26_Cu,
91 In27_Cu,
92 In28_Cu,
93 In29_Cu,
94 In30_Cu,
95 B_Cu, // 31
96
97 B_Adhes,
98 F_Adhes,
99
100 B_Paste,
101 F_Paste,
102
103 B_SilkS,
104 F_SilkS,
105
106 B_Mask,
107 F_Mask, // 39
108
109 Dwgs_User,
110 Cmts_User,
111 Eco1_User,
112 Eco2_User,
113 Edge_Cuts,
114 Margin, // 45
115
116 B_CrtYd,
117 F_CrtYd,
118
119 B_Fab,
120 F_Fab, // 49
121
122 // User definable layers.
123 User_1,
124 User_2,
125 User_3,
126 User_4,
127 User_5,
128 User_6,
129 User_7,
130 User_8,
131 User_9,
132
133 Rescue, // 59
134
135 // Four reserved layers (60 - 63) for future expansion within the 64 bit integer limit.
136
138};
@ In22_Cu
Definition: layer_ids.h:86
@ PCBNEW_LAYER_ID_START
Definition: layer_ids.h:63
@ In11_Cu
Definition: layer_ids.h:75
@ In29_Cu
Definition: layer_ids.h:93
@ In30_Cu
Definition: layer_ids.h:94
@ User_8
Definition: layer_ids.h:130
@ F_CrtYd
Definition: layer_ids.h:117
@ In17_Cu
Definition: layer_ids.h:81
@ B_Adhes
Definition: layer_ids.h:97
@ Edge_Cuts
Definition: layer_ids.h:113
@ Dwgs_User
Definition: layer_ids.h:109
@ F_Paste
Definition: layer_ids.h:101
@ In9_Cu
Definition: layer_ids.h:73
@ Cmts_User
Definition: layer_ids.h:110
@ User_6
Definition: layer_ids.h:128
@ User_7
Definition: layer_ids.h:129
@ In19_Cu
Definition: layer_ids.h:83
@ In7_Cu
Definition: layer_ids.h:71
@ In28_Cu
Definition: layer_ids.h:92
@ In26_Cu
Definition: layer_ids.h:90
@ F_Adhes
Definition: layer_ids.h:98
@ B_Mask
Definition: layer_ids.h:106
@ B_Cu
Definition: layer_ids.h:95
@ User_5
Definition: layer_ids.h:127
@ Eco1_User
Definition: layer_ids.h:111
@ F_Mask
Definition: layer_ids.h:107
@ In21_Cu
Definition: layer_ids.h:85
@ In23_Cu
Definition: layer_ids.h:87
@ B_Paste
Definition: layer_ids.h:100
@ In15_Cu
Definition: layer_ids.h:79
@ In2_Cu
Definition: layer_ids.h:66
@ User_9
Definition: layer_ids.h:131
@ UNSELECTED_LAYER
Definition: layer_ids.h:61
@ F_Fab
Definition: layer_ids.h:120
@ In10_Cu
Definition: layer_ids.h:74
@ Margin
Definition: layer_ids.h:114
@ F_SilkS
Definition: layer_ids.h:104
@ In4_Cu
Definition: layer_ids.h:68
@ B_CrtYd
Definition: layer_ids.h:116
@ UNDEFINED_LAYER
Definition: layer_ids.h:60
@ Eco2_User
Definition: layer_ids.h:112
@ In16_Cu
Definition: layer_ids.h:80
@ In24_Cu
Definition: layer_ids.h:88
@ In1_Cu
Definition: layer_ids.h:65
@ Rescue
Definition: layer_ids.h:133
@ User_3
Definition: layer_ids.h:125
@ User_1
Definition: layer_ids.h:123
@ B_SilkS
Definition: layer_ids.h:103
@ In13_Cu
Definition: layer_ids.h:77
@ User_4
Definition: layer_ids.h:126
@ In8_Cu
Definition: layer_ids.h:72
@ In14_Cu
Definition: layer_ids.h:78
@ User_2
Definition: layer_ids.h:124
@ In12_Cu
Definition: layer_ids.h:76
@ In27_Cu
Definition: layer_ids.h:91
@ In6_Cu
Definition: layer_ids.h:70
@ In5_Cu
Definition: layer_ids.h:69
@ In3_Cu
Definition: layer_ids.h:67
@ In20_Cu
Definition: layer_ids.h:84
@ F_Cu
Definition: layer_ids.h:64
@ In18_Cu
Definition: layer_ids.h:82
@ In25_Cu
Definition: layer_ids.h:89
@ B_Fab
Definition: layer_ids.h:119

◆ 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_INTERSHEET_REFS 
LAYER_NETCLASS_REFS 
LAYER_DEVICE 
LAYER_NOTES 
LAYER_PRIVATE_NOTES 
LAYER_NOTES_BACKGROUND 
LAYER_PIN 
LAYER_SHEET 
LAYER_SHEETNAME 
LAYER_SHEETFILENAME 
LAYER_SHEETFIELDS 
LAYER_SHEETLABEL 
LAYER_NOCONNECT 
LAYER_DANGLING 
LAYER_ERC_WARN 
LAYER_ERC_ERR 
LAYER_ERC_EXCLUSION 
LAYER_DEVICE_BACKGROUND 
LAYER_SHEET_BACKGROUND 
LAYER_SCHEMATIC_GRID 
LAYER_SCHEMATIC_GRID_AXES 
LAYER_SCHEMATIC_BACKGROUND 
LAYER_SCHEMATIC_CURSOR 
LAYER_HOVERED 
LAYER_BRIGHTENED 
LAYER_HIDDEN 
LAYER_SELECTION_SHADOWS 
LAYER_SCHEMATIC_DRAWINGSHEET 
LAYER_SCHEMATIC_PAGE_LIMITS 
LAYER_BUS_JUNCTION 
LAYER_SCHEMATIC_AUX_ITEMS 
LAYER_SCHEMATIC_ANCHOR 
SCH_LAYER_ID_END 

Definition at line 340 of file layer_ids.h.

341{
343
345 LAYER_BUS,
361 LAYER_PIN,
387
389};
@ LAYER_DANGLING
Definition: layer_ids.h:368
@ LAYER_SHEETNAME
Definition: layer_ids.h:363
@ LAYER_ERC_WARN
Definition: layer_ids.h:369
@ LAYER_SCHEMATIC_ANCHOR
Definition: layer_ids.h:386
@ LAYER_SHEETLABEL
Definition: layer_ids.h:366
@ LAYER_PINNUM
Definition: layer_ids.h:350
@ LAYER_DEVICE
Definition: layer_ids.h:357
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:373
@ LAYER_BRIGHTENED
Definition: layer_ids.h:379
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:371
@ LAYER_HIDDEN
Definition: layer_ids.h:380
@ LAYER_HIERLABEL
Definition: layer_ids.h:349
@ LAYER_PINNAM
Definition: layer_ids.h:351
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:359
@ LAYER_HOVERED
Definition: layer_ids.h:378
@ LAYER_GLOBLABEL
Definition: layer_ids.h:348
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_NOTES
Definition: layer_ids.h:358
@ LAYER_ERC_ERR
Definition: layer_ids.h:370
@ LAYER_PIN
Definition: layer_ids.h:361
@ LAYER_VALUEPART
Definition: layer_ids.h:353
@ LAYER_BUS
Definition: layer_ids.h:345
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:377
@ LAYER_FIELDS
Definition: layer_ids.h:354
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:372
@ SCH_LAYER_ID_START
Definition: layer_ids.h:342
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:382
@ LAYER_LOCLABEL
Definition: layer_ids.h:347
@ LAYER_JUNCTION
Definition: layer_ids.h:346
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:365
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:375
@ LAYER_REFERENCEPART
Definition: layer_ids.h:352
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:356
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:360
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:383
@ LAYER_SHEET
Definition: layer_ids.h:362
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:381
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:376
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition: layer_ids.h:385
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:355
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:364
@ LAYER_BUS_JUNCTION
Definition: layer_ids.h:384
@ LAYER_NOCONNECT
Definition: layer_ids.h:367
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:374

Function Documentation

◆ FlipLayer()

PCB_LAYER_ID FlipLayer ( PCB_LAYER_ID  aLayerId,
int  aCopperLayersCount = 0 
)
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 544 of file lset.cpp.

545{
546 switch( aLayerId )
547 {
548 case B_Cu: return F_Cu;
549 case F_Cu: return B_Cu;
550
551 case B_SilkS: return F_SilkS;
552 case F_SilkS: return B_SilkS;
553
554 case B_Adhes: return F_Adhes;
555 case F_Adhes: return B_Adhes;
556
557 case B_Mask: return F_Mask;
558 case F_Mask: return B_Mask;
559
560 case B_Paste: return F_Paste;
561 case F_Paste: return B_Paste;
562
563 case B_CrtYd: return F_CrtYd;
564 case F_CrtYd: return B_CrtYd;
565
566 case B_Fab: return F_Fab;
567 case F_Fab: return B_Fab;
568
569 default: // change internal layer if aCopperLayersCount is >= 4
570 if( IsCopperLayer( aLayerId ) && aCopperLayersCount >= 4 )
571 {
572 // internal copper layers count is aCopperLayersCount-2
573 PCB_LAYER_ID fliplayer = PCB_LAYER_ID(aCopperLayersCount - 2 - ( aLayerId - In1_Cu ) );
574 // Ensure fliplayer has a value which does not crash Pcbnew:
575 if( fliplayer < F_Cu )
576 fliplayer = F_Cu;
577
578 if( fliplayer > B_Cu )
579 fliplayer = B_Cu;
580
581 return fliplayer;
582 }
583
584 // No change for the other layers
585 return aLayerId;
586 }
587}
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:823
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59

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_FOOTPRINT::AddToBoard(), PCAD2KICAD::PCB_ARC::Flip(), PCAD2KICAD::PCB_LINE::Flip(), PCAD2KICAD::PCB_PAD::Flip(), PCAD2KICAD::PCB_POLYGON::Flip(), FOOTPRINT::Flip(), FP_SHAPE::Flip(), FP_TEXT::Flip(), FP_TEXTBOX::Flip(), PCB_DIMENSION_BASE::Flip(), PCB_SHAPE::Flip(), PCB_TARGET::Flip(), PCB_TEXT::Flip(), PCB_TEXTBOX::Flip(), PCB_TRACK::Flip(), PCB_ARC::Flip(), PCB_VIA::Flip(), and FABMASTER::loadFootprints().

◆ 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 590 of file lset.cpp.

591{
592 // layers on physical outside of a board:
593 const static LSET and_mask( 16, // !! update count
594 B_Cu, F_Cu,
597 B_Mask, F_Mask,
601 B_Fab, F_Fab
602 );
603
604 LSET newMask = aMask & ~and_mask;
605
606 if( aMask[B_Cu] )
607 newMask.set( F_Cu );
608
609 if( aMask[F_Cu] )
610 newMask.set( B_Cu );
611
612 if( aMask[B_SilkS] )
613 newMask.set( F_SilkS );
614
615 if( aMask[F_SilkS] )
616 newMask.set( B_SilkS );
617
618 if( aMask[B_Adhes] )
619 newMask.set( F_Adhes );
620
621 if( aMask[F_Adhes] )
622 newMask.set( B_Adhes );
623
624 if( aMask[B_Mask] )
625 newMask.set( F_Mask );
626
627 if( aMask[F_Mask] )
628 newMask.set( B_Mask );
629
630 if( aMask[B_Paste] )
631 newMask.set( F_Paste );
632
633 if( aMask[F_Paste] )
634 newMask.set( B_Paste );
635
636 if( aMask[B_Adhes] )
637 newMask.set( F_Adhes );
638
639 if( aMask[F_Adhes] )
640 newMask.set( B_Adhes );
641
642 if( aMask[B_CrtYd] )
643 newMask.set( F_CrtYd );
644
645 if( aMask[F_CrtYd] )
646 newMask.set( B_CrtYd );
647
648 if( aMask[B_Fab] )
649 newMask.set( F_Fab );
650
651 if( aMask[F_Fab] )
652 newMask.set( B_Fab );
653
654 if( aCopperLayersCount >= 4 ) // Internal layers exist
655 {
656 LSET internalMask = aMask & LSET::InternalCuMask();
657
658 if( internalMask != LSET::InternalCuMask() )
659 {
660 // the mask does not include all internal layers. Therefore
661 // the flipped mask for internal copper layers must be built
662 int innerLayerCnt = aCopperLayersCount -2;
663
664 // the flipped mask is the innerLayerCnt bits rewritten in reverse order
665 // ( bits innerLayerCnt to 1 rewritten in bits 1 to innerLayerCnt )
666 for( int ii = 0; ii < innerLayerCnt; ii++ )
667 {
668 if( internalMask[innerLayerCnt - ii] )
669 {
670 newMask.set( ii + In1_Cu );
671 }
672 else
673 {
674 newMask.reset( ii + In1_Cu );
675 }
676 }
677 }
678 }
679
680 return newMask;
681}
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition: lset.cpp:733

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 ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), ZONE::Flip(), PAD::Flip(), and FABMASTER::loadFootprints().

◆ GetNetnameLayer()

int GetNetnameLayer ( int  aLayer)
inline

Returns a netname layer corresponding to the given layer.

Definition at line 966 of file layer_ids.h.

967{
968 if( IsCopperLayer( aLayer ) )
969 return NETNAMES_LAYER_INDEX( aLayer );
970 else if( aLayer == LAYER_PADS_TH )
971 return LAYER_PAD_NETNAMES;
972 else if( aLayer == LAYER_PAD_FR )
974 else if( aLayer == LAYER_PAD_BK )
976 else if( IsViaPadLayer( aLayer ) )
977 return LAYER_VIA_NETNAMES;
978
979 // Fallback
980 return Cmts_User;
981}
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:174
bool IsViaPadLayer(int aLayer)
Definition: layer_ids.h:855

References Cmts_User, IsCopperLayer(), IsViaPadLayer(), LAYER_PAD_BK, LAYER_PAD_BK_NETNAMES, LAYER_PAD_FR, LAYER_PAD_FR_NETNAMES, LAYER_PAD_NETNAMES, LAYER_PADS_TH, LAYER_VIA_NETNAMES, and NETNAMES_LAYER_INDEX.

Referenced by PCB_CONTROL::LayerAlphaDec(), PCB_CONTROL::LayerAlphaInc(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), PCB_EDIT_FRAME::redrawNetnames(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and PCB_TRACK::ViewGetLayers().

◆ IsBackLayer()

bool IsBackLayer ( PCB_LAYER_ID  aLayerId)
inline

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

Definition at line 920 of file layer_ids.h.

921{
922 switch( aLayerId )
923 {
924 case B_Cu:
925 case B_Adhes:
926 case B_Paste:
927 case B_SilkS:
928 case B_Mask:
929 case B_CrtYd:
930 case B_Fab:
931 return true;
932 default:
933 ;
934 }
935
936 return false;
937}

References B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, and B_SilkS.

Referenced by DRAWING_TOOL::drawShape(), FP_TEXT::Flip(), FP_TEXTBOX::Flip(), FP_TEXT::FP_TEXT(), FOOTPRINT::GetCourtyard(), BOARD::GetFootprint(), GENERAL_COLLECTOR::Inspect(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), DRAWING_TOOL::PlaceText(), PCB_DRAW_PANEL_GAL::SetTopLayer(), FP_TEXT_GRID_TABLE::SetValueAsLong(), and PAD::ViewGetLOD().

◆ IsCopperLayer() [1/2]

bool IsCopperLayer ( int  aLayerId)
inline

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 823 of file layer_ids.h.

824{
825 return aLayerId >= F_Cu && aLayerId <= B_Cu;
826}

References B_Cu, and F_Cu.

Referenced by BOARD::Add(), BOARD_ADAPTER::addPads(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), BOARD::BOARD(), CN_CONNECTIVITY_ALGO::Build(), PCB_ONE_LAYER_SELECTOR::buildList(), SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList(), DRC_TEST_PROVIDER_SOLDER_MASK::checkMaskAperture(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToFootprintItem(), ALTIUM_PCB::ConvertTracks6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertTracks6ToFootprintItem(), BOARD_ADAPTER::createLayers(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::Edit_Zone_Params(), PAD::FlashLayer(), FlipLayer(), DSN::SPECCTRA_DB::FromBOARD(), GenCADLayerName(), GetGerberFileFunctionAttribute(), GetGerberFilePolarityAttribute(), GetGerberProtelExtension(), BOARD_DESIGN_SETTINGS::GetLayerClass(), BOARD_STACKUP::GetLayerDistance(), BOARD::GetLayerType(), GetNetnameLayer(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), DIALOG_EXPORT_SVG::initDialog(), BOARD_INSPECTION_TOOL::InspectClearance(), IsCopperLayer(), IsNetCopperLayer(), BOARD_ITEM::IsOnCopperLayer(), PCB_CONTROL::LayerAlphaDec(), PCB_CONTROL::LayerAlphaInc(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), FABMASTER::loadEtch(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), FABMASTER::loadZones(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), DIALOG_PRINT_PCBNEW::onPopUpLayers(), DIALOG_PLOT::OnPopUpLayers(), EAGLE_PLUGIN::packageSMD(), ALTIUM_PCB::ParseVias6Data(), PNS::TOOL_BASE::pickSingleItem(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), PlotOneBoardLayer(), BRDITEMS_PLOTTER::PlotPcbShape(), BRDITEMS_PLOTTER::PlotPcbText(), ROUTER_TOOL::prepareInteractive(), RENDER_3D_RAYTRACE::Reload(), DRC_CACHE_GENERATOR::Run(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), BOARD::SetLayerType(), PCB_DRAW_PANEL_GAL::SetTopLayer(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), PNS_KICAD_IFACE_BASE::syncGraphicalItem(), PNS_KICAD_IFACE_BASE::syncTextItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), and PCB_CONTROL::UpdateMessagePanel().

◆ IsCopperLayer() [2/2]

bool IsCopperLayer ( int  aLayerId,
bool  aIncludeSyntheticCopperLayers 
)
inline

Tests whether a layer is a copper layer, optionally including synthetic copper layers such as LAYER_VIA_THROUGH, LAYER_PAD_FR, etc.

Parameters
aLayerId
aIncludeSyntheticCopperLayers
Returns

Definition at line 847 of file layer_ids.h.

848{
849 if( aIncludeSyntheticCopperLayers )
850 return !IsNonCopperLayer( aLayerId );
851 else
852 return IsCopperLayer( aLayerId );
853}
bool IsNonCopperLayer(int aLayerId)
Test whether a layer is a non copper layer.
Definition: layer_ids.h:834

References IsCopperLayer(), and IsNonCopperLayer().

◆ IsDCodeLayer()

bool IsDCodeLayer ( int  aLayer)
inline

◆ IsFrontLayer()

bool IsFrontLayer ( PCB_LAYER_ID  aLayerId)
inline

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

Definition at line 897 of file layer_ids.h.

898{
899 switch( aLayerId )
900 {
901 case F_Cu:
902 case F_Adhes:
903 case F_Paste:
904 case F_SilkS:
905 case F_Mask:
906 case F_CrtYd:
907 case F_Fab:
908 return true;
909 default:
910 ;
911 }
912
913 return false;
914}

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

Referenced by GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and PAD::ViewGetLOD().

◆ IsHoleLayer()

bool IsHoleLayer ( int  aLayer)
inline

◆ IsNetCopperLayer()

bool IsNetCopperLayer ( int  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 1014 of file layer_ids.h.

1015{
1016 static std::set<int> netCopperLayers =
1017 {
1026 };
1027
1028 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
1029}

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

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

◆ IsNetnameLayer()

bool IsNetnameLayer ( int  aLayer)
inline

Test whether a layer is a netname layer.

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

Definition at line 989 of file layer_ids.h.

990{
991 return aLayer >= NETNAMES_LAYER_INDEX( F_Cu ) && aLayer < NETNAMES_LAYER_ID_END;
992}

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(), KIGFX::RENDER_SETTINGS::update(), PAD::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ IsNonCopperLayer()

bool IsNonCopperLayer ( int  aLayerId)
inline

Test 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 834 of file layer_ids.h.

835{
836 return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
837}

References B_Cu, and PCB_LAYER_ID_COUNT.

Referenced by PCAD2KICAD::PCB_ARC::AddToFootprint(), PCAD2KICAD::PCB_LINE::AddToFootprint(), PCAD2KICAD::PCB_POLYGON::AddToFootprint(), CONVERT_TOOL::CreatePolys(), IsCopperLayer(), and PCB_DRAW_PANEL_GAL::setDefaultLayerDeps().

◆ IsPcbLayer()

bool IsPcbLayer ( int  aLayer)
inline

Test 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 812 of file layer_ids.h.

813{
814 return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
815}

References F_Cu, and PCB_LAYER_ID_COUNT.

Referenced by PCB_PROPERTIES_PANEL::createPGProperty(), KIGFX::PCB_PAINTER::Draw(), GBR_TO_PCB_EXPORTER::ExportPcb(), FABMASTER::loadFootprints(), FABMASTER::loadGraphics(), FABMASTER::loadPolygon(), and FABMASTER::loadZone().

◆ IsUserLayer()

bool IsUserLayer ( PCB_LAYER_ID  aLayerId)
inline

Test 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 877 of file layer_ids.h.

878{
879 return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
880}

References Dwgs_User, and Eco2_User.

◆ IsValidLayer()

bool IsValidLayer ( int  aLayerId)
inline

Test 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 801 of file layer_ids.h.

802{
803 return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
804}

References PCB_LAYER_ID_COUNT.

Referenced by DRAWING_TOOL::DrawSpecificationStackup(), and LAYERS_MAP_DIALOG::OnSelectLayer().

◆ IsViaPadLayer()

bool IsViaPadLayer ( int  aLayer)
inline

Definition at line 855 of file layer_ids.h.

856{
857 return aLayer == LAYER_VIA_THROUGH
858 || aLayer == LAYER_VIA_MICROVIA
859 || aLayer == LAYER_VIA_BBLIND;
860}

References LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, and LAYER_VIA_THROUGH.

Referenced by GetNetnameLayer(), and PCB_VIA::ViewGetLOD().

◆ IsZoneLayer()

bool IsZoneLayer ( int  aLayer)
inline

Definition at line 995 of file layer_ids.h.

996{
997 return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
998}

References LAYER_ZONE_END, and LAYER_ZONE_START.

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

◆ LayerName()

wxString LayerName ( int  aLayer)

Returns the string equivalent of a given layer.

Parameters
aLayeris a valid layer ID

Returns the string equivalent of a given layer.

These are not the same as the canonical name in LSET::Name(), which is used in board files and cannot be translated or changed. WARNING: do not translate board physical layers names (F.Cu to User.9): because canonical names are used in files (boards and fab files), using translated names in UI create mistakes for users. Board physical layers names must be seen as proper nouns.

Definition at line 30 of file layer_id.cpp.

31{
32 switch( aLayer )
33 {
34 // PCB_LAYER_ID
35 case F_Cu: return wxT( "F.Cu" );
36 case In1_Cu: return wxT( "In1.Cu" );
37 case In2_Cu: return wxT( "In2.Cu" );
38 case In3_Cu: return wxT( "In3.Cu" );
39 case In4_Cu: return wxT( "In4.Cu" );
40 case In5_Cu: return wxT( "In5.Cu" );
41 case In6_Cu: return wxT( "In6.Cu" );
42 case In7_Cu: return wxT( "In7.Cu" );
43 case In8_Cu: return wxT( "In8.Cu" );
44 case In9_Cu: return wxT( "In9.Cu" );
45 case In10_Cu: return wxT( "In10.Cu" );
46 case In11_Cu: return wxT( "In11.Cu" );
47 case In12_Cu: return wxT( "In12.Cu" );
48 case In13_Cu: return wxT( "In13.Cu" );
49 case In14_Cu: return wxT( "In14.Cu" );
50 case In15_Cu: return wxT( "In15.Cu" );
51 case In16_Cu: return wxT( "In16.Cu" );
52 case In17_Cu: return wxT( "In17.Cu" );
53 case In18_Cu: return wxT( "In18.Cu" );
54 case In19_Cu: return wxT( "In19.Cu" );
55 case In20_Cu: return wxT( "In20.Cu" );
56 case In21_Cu: return wxT( "In21.Cu" );
57 case In22_Cu: return wxT( "In22.Cu" );
58 case In23_Cu: return wxT( "In23.Cu" );
59 case In24_Cu: return wxT( "In24.Cu" );
60 case In25_Cu: return wxT( "In25.Cu" );
61 case In26_Cu: return wxT( "In26.Cu" );
62 case In27_Cu: return wxT( "In27.Cu" );
63 case In28_Cu: return wxT( "In28.Cu" );
64 case In29_Cu: return wxT( "In29.Cu" );
65 case In30_Cu: return wxT( "In30.Cu" );
66 case B_Cu: return wxT( "B.Cu" );
67
68 // Technicals
69 case B_Adhes: return wxT( "B.Adhesive" );
70 case F_Adhes: return wxT( "F.Adhesive" );
71 case B_Paste: return wxT( "B.Paste" );
72 case F_Paste: return wxT( "F.Paste" );
73 case B_SilkS: return wxT( "B.Silkscreen" );
74 case F_SilkS: return wxT( "F.Silkscreen" );
75 case B_Mask: return wxT( "B.Mask" );
76 case F_Mask: return wxT( "F.Mask" );
77
78 // Users
79 case Dwgs_User: return wxT( "User.Drawings" );
80 case Cmts_User: return wxT( "User.Comments" );
81 case Eco1_User: return wxT( "User.Eco1" );
82 case Eco2_User: return wxT( "User.Eco2" );
83 case Edge_Cuts: return wxT( "Edge.Cuts" );
84 case Margin: return wxT( "Margin" );
85
86 // Footprint
87 case F_CrtYd: return wxT( "F.Courtyard" );
88 case B_CrtYd: return wxT( "B.Courtyard" );
89 case F_Fab: return wxT( "F.Fab" );
90 case B_Fab: return wxT( "B.Fab" );
91
92 // User definable layers.
93 case User_1: return wxT( "User.1" );
94 case User_2: return wxT( "User.2" );
95 case User_3: return wxT( "User.3" );
96 case User_4: return wxT( "User.4" );
97 case User_5: return wxT( "User.5" );
98 case User_6: return wxT( "User.6" );
99 case User_7: return wxT( "User.7" );
100 case User_8: return wxT( "User.8" );
101 case User_9: return wxT( "User.9" );
102
103 // Rescue
104 case Rescue: return _( "Rescue" );
105
106 // SCH_LAYER_ID
107
108 case LAYER_WIRE: return _( "Wires" );
109 case LAYER_BUS: return _( "Buses" );
110 case LAYER_BUS_JUNCTION: return _( "Bus junctions" );
111 case LAYER_JUNCTION: return _( "Junctions" );
112 case LAYER_LOCLABEL: return _( "Labels" );
113 case LAYER_GLOBLABEL: return _( "Global labels" );
114 case LAYER_HIERLABEL: return _( "Hierarchical labels" );
115 case LAYER_PINNUM: return _( "Pin numbers" );
116 case LAYER_PINNAM: return _( "Pin names" );
117 case LAYER_REFERENCEPART: return _( "Symbol references" );
118 case LAYER_VALUEPART: return _( "Symbol values" );
119 case LAYER_FIELDS: return _( "Symbol fields" );
120 case LAYER_INTERSHEET_REFS: return _( "Sheet references" );
121 case LAYER_NETCLASS_REFS: return _( "Net class references" );
122 case LAYER_DEVICE: return _( "Symbol body outlines" );
123 case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
124 case LAYER_NOTES: return _( "Schematic text && graphics" );
125 case LAYER_PRIVATE_NOTES: return _( "Symbol private text && graphics" );
126 case LAYER_NOTES_BACKGROUND: return _( "Schematic text && graphics backgrounds" );
127 case LAYER_PIN: return _( "Pins" );
128 case LAYER_SHEET: return _( "Sheet borders" );
129 case LAYER_SHEET_BACKGROUND: return _( "Sheet backgrounds" );
130 case LAYER_SHEETNAME: return _( "Sheet names" );
131 case LAYER_SHEETFIELDS: return _( "Sheet fields" );
132 case LAYER_SHEETFILENAME: return _( "Sheet file names" );
133 case LAYER_SHEETLABEL: return _( "Sheet pins" );
134 case LAYER_NOCONNECT: return _( "No-connect symbols" );
135 case LAYER_ERC_WARN: return _( "ERC warnings" );
136 case LAYER_ERC_ERR: return _( "ERC errors" );
137 case LAYER_ERC_EXCLUSION: return _( "ERC exclusions" );
138 case LAYER_SCHEMATIC_ANCHOR: return _( "Anchors" );
139 case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
140 case LAYER_SCHEMATIC_GRID: return _( "Grid" );
141 case LAYER_SCHEMATIC_GRID_AXES: return _( "Axes" );
142 case LAYER_SCHEMATIC_BACKGROUND: return _( "Background" );
143 case LAYER_SCHEMATIC_CURSOR: return _( "Cursor" );
144 case LAYER_HOVERED: return _( "Hovered items" );
145 case LAYER_BRIGHTENED: return _( "Highlighted items" );
146 case LAYER_HIDDEN: return _( "Hidden items" );
147 case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
148 case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
149 case LAYER_SCHEMATIC_PAGE_LIMITS: return _( "Page limits" );
150
151 // GAL_LAYER_ID
152
153 case LAYER_MOD_FR: return _( "Footprints front" );
154 case LAYER_MOD_BK: return _( "Footprints back" );
155 case LAYER_MOD_VALUES: return _( "Values" );
156 case LAYER_MOD_REFERENCES: return _( "Reference designators" );
157 case LAYER_MOD_TEXT: return _( "Footprint text" );
158 case LAYER_MOD_TEXT_INVISIBLE: return _( "Hidden text" );
159 case LAYER_PAD_FR: return _( "SMD pads front" );
160 case LAYER_PAD_BK: return _( "SMD pads back" );
161 case LAYER_PADS_TH: return _( "Through-hole pads" );
162 case LAYER_TRACKS: return _( "Tracks" );
163 case LAYER_VIA_THROUGH: return _( "Through vias" );
164 case LAYER_VIA_BBLIND: return _( "Blind/Buried vias" );
165 case LAYER_VIA_MICROVIA: return _( "Micro-vias" );
166 case LAYER_VIA_HOLES: return _( "Via holes" );
167 case LAYER_VIA_HOLEWALLS: return _( "Via hole walls" );
168 case LAYER_PAD_PLATEDHOLES: return _( "Plated holes" );
169 case LAYER_PAD_HOLEWALLS: return _( "Plated hole walls" );
170 case LAYER_NON_PLATEDHOLES: return _( "Non-plated holes" );
171 case LAYER_RATSNEST: return _( "Ratsnest" );
172 case LAYER_DRC_WARNING: return _( "DRC warnings" );
173 case LAYER_DRC_ERROR: return _( "DRC errors" );
174 case LAYER_DRC_EXCLUSION: return _( "DRC exclusions" );
175 case LAYER_MARKER_SHADOWS: return _( "DRC marker shadows" );
176 case LAYER_ANCHOR: return _( "Anchors" );
177 case LAYER_DRAWINGSHEET: return _( "Drawing sheet" );
178 case LAYER_PAGE_LIMITS: return _( "Page limits" );
179 case LAYER_CURSOR: return _( "Cursor" );
180 case LAYER_AUX_ITEMS: return _( "Helper items" );
181 case LAYER_GRID: return _( "Grid" );
182 case LAYER_GRID_AXES: return _( "Grid axes" );
183 case LAYER_PCB_BACKGROUND: return _( "Background" );
184 case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
185 case LAYER_LOCKED_ITEM_SHADOW: return _( "Locked item shadow" );
186 case LAYER_CONFLICTS_SHADOW: return _( "Conflicting items shadow" );
187
188 default:
189 wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
190 }
191}
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

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, Format(), 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_CONFLICTS_SHADOW, LAYER_CURSOR, LAYER_DEVICE, LAYER_DEVICE_BACKGROUND, LAYER_DRAWINGSHEET, LAYER_DRC_ERROR, LAYER_DRC_EXCLUSION, LAYER_DRC_WARNING, LAYER_ERC_ERR, LAYER_ERC_EXCLUSION, LAYER_ERC_WARN, LAYER_FIELDS, LAYER_GLOBLABEL, LAYER_GRID, LAYER_GRID_AXES, LAYER_HIDDEN, LAYER_HIERLABEL, LAYER_HOVERED, LAYER_INTERSHEET_REFS, LAYER_JUNCTION, LAYER_LOCKED_ITEM_SHADOW, LAYER_LOCLABEL, LAYER_MARKER_SHADOWS, LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_NETCLASS_REFS, LAYER_NOCONNECT, LAYER_NON_PLATEDHOLES, LAYER_NOTES, LAYER_NOTES_BACKGROUND, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_PADS_TH, LAYER_PAGE_LIMITS, LAYER_PCB_BACKGROUND, LAYER_PIN, LAYER_PINNAM, LAYER_PINNUM, LAYER_PRIVATE_NOTES, LAYER_RATSNEST, LAYER_REFERENCEPART, LAYER_SCHEMATIC_ANCHOR, LAYER_SCHEMATIC_AUX_ITEMS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_CURSOR, LAYER_SCHEMATIC_DRAWINGSHEET, LAYER_SCHEMATIC_GRID, LAYER_SCHEMATIC_GRID_AXES, LAYER_SCHEMATIC_PAGE_LIMITS, 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_HOLES, LAYER_VIA_HOLEWALLS, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_WIRE, Margin, Rescue, User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.

Referenced by DIALOG_IMPORTED_LAYERS::AddMappings(), PANEL_SETUP_LAYERS::addUserDefinedLayer(), AUTOPLACE_TOOL::autoplace(), PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches(), PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), PCB_MARKER::Deserialize(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), PCB_BITMAP::GetMsgPanelInfo(), DIALOG_IMPORTED_LAYERS::GetSelectedLayerID(), BOARD::GetStandardLayerName(), DIALOG_IMPORTED_LAYERS::OnAutoMatchLayersClicked(), SCH_SEXPR_PLUGIN::saveLine(), PCB_MARKER::Serialize(), and DRC_TEST_PROVIDER_MISC::testDisabledLayers().

◆ operator+()

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

Used for via types.

Definition at line 285 of file layer_ids.h.

286{
287 GAL_LAYER_ID t = GAL_LAYER_ID( int( a ) + b );
288 wxASSERT( t <= GAL_LAYER_ID_END );
289 return t;
290}
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:190

References GAL_LAYER_ID_END.

◆ operator++() [1/2]

GAL_LAYER_ID operator++ ( GAL_LAYER_ID a)
inline

Definition at line 272 of file layer_ids.h.

273{
274 a = GAL_LAYER_ID( int( a ) + 1 );
275 return a;
276}

◆ operator++() [2/2]

SCH_LAYER_ID operator++ ( SCH_LAYER_ID a)
inline

Definition at line 395 of file layer_ids.h.

396{
397 a = SCH_LAYER_ID( int( a ) + 1 );
398 return a;
399}
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:341

◆ ToGalLayer()

GAL_LAYER_ID ToGalLayer ( int  aInteger)
inline

Definition at line 278 of file layer_ids.h.

279{
280 wxASSERT( aInteger >= GAL_LAYER_ID_START && aInteger <= GAL_LAYER_ID_END );
281 return static_cast<GAL_LAYER_ID>( aInteger );
282}

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 926 of file lset.cpp.

927{
928 wxASSERT( aLayer < GAL_LAYER_ID_END );
929 return PCB_LAYER_ID( aLayer );
930}

References GAL_LAYER_ID_END.

Referenced by PNS_KICAD_IFACE::AddItem(), GRID_CELL_LAYER_SELECTOR::BeginEdit(), BOARD::BOARD(), DSN::SPECCTRA_DB::buildLayerMaps(), CN_ANCHOR::ConnectedItemsCount(), BOARD_ADAPTER::createLayers(), PCB_MARKER::Deserialize(), KIGFX::PCB_PAINTER::draw(), GRID_CELL_LAYER_RENDERER::Draw(), DRAWING_TOOL::DrawVia(), PCB_LAYER_VALUE::EqualTo(), existsOnLayerFunc(), GENDRILL_WRITER_BASE::GenDrillReportFile(), GetGerberFileFunctionAttribute(), BOARD::GetLayerID(), PCB_LAYER_BOX_SELECTOR::getLayerName(), PCB_LAYER_SELECTOR::getLayerName(), DIALOG_IMPORTED_LAYERS::GetSelectedLayerID(), GRID_CELL_LAYER_SELECTOR::GetValue(), CONNECTIVITY_DATA::IsConnectedOnLayer(), CN_ANCHOR::IsDangling(), PNS_PCBNEW_RULE_RESOLVER::IsNetTieExclusion(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), PCAD2KICAD::PCB::MapLayer(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddLayer(), APPEARANCE_CONTROLS::onLayerLeftClick(), DIALOG_COPPER_ZONE::OnLayerSelection(), DIALOG_NON_COPPER_ZONES_EDITOR::OnLayerSelection(), DIALOG_RULE_AREA_PROPERTIES::OnLayerSelection(), PLOT_CONTROLLER::OpenPlotfile(), DRC_RULES_PARSER::parseLayer(), PCB_MARKER::PCB_MARKER(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), PLOT_CONTROLLER::PlotLayer(), ROUTER_TOOL::prepareInteractive(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), PCB_SELECTION_TOOL::Selectable(), FOOTPRINT_EDIT_FRAME::SelectLayer(), PCB_BASE_FRAME::SelectOneLayer(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), APPEARANCE_CONTROLS::SetLayerVisible(), PRIVATE_LAYERS_GRID_TABLE::SetValueAsLong(), FP_TEXT_GRID_TABLE::SetValueAsLong(), PNS_KICAD_IFACE_BASE::StackupHeight(), StartPlotBoard(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), and PNS_KICAD_IFACE::UpdateItem().

Variable Documentation

◆ GAL_LAYER_ID_COUNT

constexpr int GAL_LAYER_ID_COUNT = GAL_LAYER_ID_END - GAL_LAYER_ID_START
constexpr

Definition at line 270 of file layer_ids.h.