140#define MAX_CU_LAYERS (B_Cu - F_Cu + 1)
174#define NETNAMES_LAYER_INDEX( layer ) ( NETNAMES_LAYER_ID_START + layer )
264#define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START )
267#define BITMAP_LAYER_FOR( boardLayer ) ( LAYER_BITMAP_START + boardLayer )
268#define ZONE_LAYER_FOR( boardLayer ) ( LAYER_ZONE_START + boardLayer )
323 GAL_BASE_SET::set( aPos, aVal );
329 GAL_BASE_SET::set(
static_cast<std::size_t
>( aPos ) -
start, aVal );
335 return test(
static_cast<std::size_t
>( aPos ) -
start );
338 std::vector<GAL_LAYER_ID>
Seq()
const;
397#define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
399#define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START )
408#define GERBER_DRAWLAYERS_COUNT PCB_LAYER_ID_COUNT
429#define GERBER_DRAW_LAYER( x ) ( GERBVIEW_LAYER_ID_START + x )
431#define GERBER_DCODE_LAYER( x ) ( GERBER_DRAWLAYERS_COUNT + x )
433#define GERBER_DRAW_LAYER_INDEX( x ) ( x - GERBVIEW_LAYER_ID_START )
455#define LAYER_ID_COUNT LAYER_3D_END
469#define MIN_VISIBILITY_MASK int( ( 1 << GAL_LAYER_INDEX( LAYER_PAD_PLATEDHOLES ) ) +\
470 ( 1 << GAL_LAYER_INDEX( LAYER_VIA_HOLES ) ) +\
471 ( 1 << GAL_LAYER_INDEX( LAYER_SELECT_OVERLAY ) ) +\
472 ( 1 << GAL_LAYER_INDEX( LAYER_GP_OVERLAY ) ) +\
473 ( 1 << GAL_LAYER_INDEX( LAYER_RATSNEST ) ) )
506 template <
class InputIterator>
507 LSEQ( InputIterator aStart, InputIterator aEnd ) :
598 LSET(
unsigned aIdCount,
int aFirst, ... );
610 return test( aLayer );
612 catch( std::out_of_range& )
770 std::string
FmtHex()
const;
779 int ParseHex(
const char* aStart,
int aCount );
784 std::string
FmtBin()
const;
833 return aLayerId >=
F_Cu && aLayerId <=
B_Cu;
855inline bool IsCopperLayer(
int aLayerId,
bool aIncludeSyntheticCopperLayers )
857 if( aIncludeSyntheticCopperLayers )
1022 static std::set<int> netCopperLayers =
1034 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
Helper for storing and iterating over GAL_LAYER_IDs.
bool Contains(GAL_LAYER_ID aPos)
static constexpr int start
GAL_SET(const GAL_SET &aOther)
static GAL_SET DefaultVisible()
std::vector< GAL_LAYER_ID > Seq() const
GAL_SET & set(int aPos, bool aVal=true)
GAL_SET & set(GAL_LAYER_ID aPos, bool aVal=true)
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
PCB_LAYER_ID operator*() const
LSEQ(InputIterator aStart, InputIterator aEnd)
LSET is a set of PCB_LAYER_IDs.
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
int ParseHex(const char *aStart, int aCount)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
LSET(PCB_LAYER_ID aLayer)
Take a PCB_LAYER_ID and sets that bit.
static LSET AllBoardTechMask()
Return a mask holding board technical layers (no CU layer) on both side.
static LSET AllLayersMask()
LSET(const BASE_SET &aOther)
static LSET UserDefinedLayers()
Return a mask with all of the allowable user defined layers.
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
LSEQ SeqStackupBottom2Top() const
Return the sequence that is typical for a bottom-to-top stack-up.
static LSET FrontAssembly()
Return a complete set of all top assembly layers which is all F_SilkS and F_Mask.
LSEQ TechAndUserUIOrder() const
Returns the technical and user layers in the order shown in layer widget.
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static LSET SideSpecificMask()
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
static LSET ForbiddenFootprintLayers()
Layers which are not allowed within footprint definitions.
LSEQ Technicals(LSET aSubToOmit=LSET()) const
Return a sequence of technical layers.
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
std::string FmtBin() const
Return a binary string showing contents of this LSEQ.
static LSET FrontTechMask()
Return a mask holding all technical layers (no CU layer) on front side.
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
LSEQ Users() const
*_User layers.
static LSET BackTechMask()
Return a mask holding all technical layers (no CU layer) on back side.
static LSET BackAssembly()
Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask.
static LSET FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
static LSET BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
LSET()
Create an empty (cleared) set.
LSET(unsigned long __val)
Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).
NETNAMES_LAYER_ID
Dedicated layers for net names used in Pcbnew.
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer)
@ NETNAMES_LAYER_ID_START
@ NETNAMES_LAYER_ID_RESERVED
Reserved space for board layer netnames.
std::bitset< GAL_LAYER_ID_COUNT > GAL_BASE_SET
Wraps a std::bitset.
GAL_LAYER_ID operator++(GAL_LAYER_ID &a)
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.
GERBVIEW_LAYER_ID
GerbView draw layers.
@ GERBVIEW_LAYER_ID_RESERVED
GerbView draw layers and d-code layers.
@ LAYER_GERBVIEW_DRAWINGSHEET
@ GERBVIEW_LAYER_ID_START
@ LAYER_GERBVIEW_BACKGROUND
@ LAYER_GERBVIEW_PAGE_LIMITS
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount=0)
Calculate the mask layer when flipping a footprint.
bool IsPcbLayer(int aLayer)
Test whether a layer is a valid layer for Pcbnew.
LAYER_3D_ID
3D Viewer virtual layers for color settings
@ LAYER_3D_SOLDERMASK_TOP
@ LAYER_3D_BACKGROUND_TOP
@ LAYER_3D_SOLDERMASK_BOTTOM
@ LAYER_3D_SILKSCREEN_TOP
@ LAYER_3D_BACKGROUND_BOTTOM
@ LAYER_3D_SILKSCREEN_BOTTOM
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
GAL_LAYER_ID ToGalLayer(int aInteger)
bool IsNetCopperLayer(int aLayer)
Checks if the given layer is "net copper", meaning it is eligible for net coloring.
constexpr int GAL_LAYER_ID_COUNT
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
bool IsDCodeLayer(int aLayer)
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
bool IsNonCopperLayer(int aLayerId)
Test whether a layer is a non copper layer.
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
@ LAYER_DRAWINGSHEET_PAGEn
for drawingsheetEditor previewing
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
@ LAYER_PAD_FR
smd pads, front layer
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
@ LAYER_PCB_BACKGROUND
PCB background color.
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
@ LAYER_GP_OVERLAY
general purpose overlay
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
@ LAYER_CURSOR
PCB cursor.
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
@ LAYER_MOD_FR
show footprints on front
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
@ LAYER_PAD_BK
smd pads, back layer
@ LAYER_MOD_VALUES
show footprints values (when texts are visible)
@ LAYER_DRAWINGSHEET_PAGE1
for drawingsheetEditor previewing
@ LAYER_PADS_TH
multilayer pads, usually with holes
@ LAYER_MARKER_SHADOWS
shadows for drc markers
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
@ LAYER_VIA_MICROVIA
to draw micro vias
@ LAYER_SELECT_OVERLAY
currently selected items overlay
@ LAYER_VIA_THROUGH
to draw usual through hole vias
@ LAYER_BITMAP_START
Virtual layers for background images per board layer.
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
@ LAYER_MOD_BK
show footprints on back
@ LAYER_MOD_REFERENCES
show footprints references (when texts are visible)
@ LAYER_VIA_BBLIND
to draw blind/buried vias
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_DEVICE_BACKGROUND
@ LAYER_SCHEMATIC_DRAWINGSHEET
@ LAYER_SCHEMATIC_GRID_AXES
@ LAYER_SCHEMATIC_PAGE_LIMITS
@ LAYER_SELECTION_SHADOWS
@ LAYER_SCHEMATIC_BACKGROUND
@ LAYER_SCHEMATIC_AUX_ITEMS
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
wxString LayerName(int aLayer)
Returns the string equivalent of a given layer.
bool IsHoleLayer(int aLayer)
bool IsViaPadLayer(int aLayer)
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount=0)
bool IsValidLayer(int aLayerId)
Test whether a given integer is a valid layer index, i.e.
#define GERBER_DRAWLAYERS_COUNT
bool IsZoneFillLayer(int aLayer)