Horizon
|
Board layer functions and definitions. More...
#include <vector>
#include <bitset>
Go to the source code of this file.
Classes | |
class | LSEQ |
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs. More... | |
class | LSET |
Class 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. | |
#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. | |
#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 GERBVIEW_LAYER_ID_END |
Must update this if you add any enums after GerbView! | |
#define | MIN_VISIBILITY_MASK |
Typedefs | |
typedef int | LAYER_NUM |
Type LAYER_NUM can be replaced with int and removed. More... | |
typedef std::vector< PCB_LAYER_ID > | BASE_SEQ |
A sequence of layers, a sequence provides a certain order. | |
typedef std::bitset< PCB_LAYER_ID_COUNT > | BASE_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 , LAYER_WORKSHEET , LAYER_GP_OVERLAY , LAYER_SELECT_OVERLAY , LAYER_PCB_BACKGROUND , LAYER_CURSOR , LAYER_AUX_ITEMS , LAYER_DRAW_BITMAPS , GAL_LAYER_ID_BITMASK_END , 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_SHEETLABEL , LAYER_NOCONNECT , LAYER_ERC_WARN , LAYER_ERC_ERR , LAYER_DEVICE_BACKGROUND , LAYER_SHEET_BACKGROUND , LAYER_SCHEMATIC_BITMAPS , LAYER_SCHEMATIC_GRID , LAYER_SCHEMATIC_BACKGROUND , LAYER_SCHEMATIC_CURSOR , LAYER_BRIGHTENED , LAYER_HIDDEN , SCH_LAYER_ID_END } |
Eeschema drawing layers. | |
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 , GERBVIEW_LAYER_ID_END } |
GerbView draw layers. More... | |
Functions | |
GAL_LAYER_ID | operator++ (GAL_LAYER_ID &a) |
GAL_LAYER_ID | operator+ (const GAL_LAYER_ID &a, int b) |
Used for via types. | |
SCH_LAYER_ID | operator++ (SCH_LAYER_ID &a) |
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. | |
bool | IsBackLayer (PCB_LAYER_ID aLayerId) |
Layer classification: check if it's a back layer. | |
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. | |
bool | IsNetnameLayer (LAYER_NUM aLayer) |
Function IsNetnameLayer tests whether a layer is a netname layer. More... | |
bool | IsDCodeLayer (int aLayer) |
PCB_LAYER_ID | ToLAYER_ID (int aLayer) |
Board layer functions and definitions.
#define MIN_VISIBILITY_MASK |
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.
enum GAL_LAYER_ID : int |
GAL layers are "virtual" layers, i.e.
not tied into design data. Some layers here are shared between applications.
enum GERBVIEW_LAYER_ID : int |
enum NETNAMES_LAYER_ID : int |
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.
PCB_LAYER_ID FlipLayer | ( | PCB_LAYER_ID | aLayerId, |
int | aCopperLayersCount = 0 |
||
) |
Function FlippedLayerNumber.
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 |
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.
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 |
|
inline |
Function IsCopperLayer tests whether a layer is a copper layer.
aLayerId | = Layer to test |
|
inline |
Function IsNetnameLayer tests whether a layer is a netname layer.
aLayer | = Layer to test |
|
inline |
Function IsNonCopperLayer tests whether a layer is a non copper layer.
aLayerId | = Layer to test |
|
inline |
Function IsPcbLayer tests whether a layer is a valid layer for pcbnew.
aLayer | = Layer to test |
|
inline |
Function IsUserLayer tests whether a layer is a non copper and a non tech layer.
aLayerId | = Layer to test |
|
inline |
Function IsValidLayer tests whether a given integer is a valid layer index, i.e.
can be safely put in a PCB_LAYER_ID
aLayerId | = Layer index to test. It can be an int, so its useful during I/O |