33 #include <wx/string.h> 147 #define MAX_CU_LAYERS (B_Cu - F_Cu + 1) 181 #define NETNAMES_LAYER_INDEX( layer ) ( NETNAMES_LAYER_ID_START + layer ) 260 #define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START ) 263 #define ZONE_LAYER_FOR( copperLayer ) ( LAYER_ZONE_START + copperLayer ) 276 return static_cast<GAL_LAYER_ID>( aInteger );
314 GAL_BASE_SET::set( aPos, aVal );
320 GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) -
start, aVal );
326 return test( static_cast<std::size_t>( aPos ) -
start );
329 std::vector<GAL_LAYER_ID>
Seq()
const;
379 #define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START ) 381 #define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START ) 390 #define GERBER_DRAWLAYERS_COUNT PCB_LAYER_ID_COUNT 410 #define GERBER_DRAW_LAYER( x ) ( GERBVIEW_LAYER_ID_START + x ) 412 #define GERBER_DCODE_LAYER( x ) ( GERBER_DRAWLAYERS_COUNT + x ) 414 #define GERBER_DRAW_LAYER_INDEX( x ) ( x - GERBVIEW_LAYER_ID_START ) 436 #define LAYER_ID_COUNT LAYER_3D_END 450 #define MIN_VISIBILITY_MASK int( ( 1 << GAL_LAYER_INDEX( LAYER_PAD_PLATEDHOLES ) ) +\ 451 ( 1 << GAL_LAYER_INDEX( LAYER_VIA_HOLES ) ) +\ 452 ( 1 << GAL_LAYER_INDEX( LAYER_SELECT_OVERLAY ) ) +\ 453 ( 1 << GAL_LAYER_INDEX( LAYER_GP_OVERLAY ) ) +\ 454 ( 1 << GAL_LAYER_INDEX( LAYER_RATSNEST ) ) ) 487 template <
class InputIterator>
488 LSEQ( InputIterator aStart, InputIterator aEnd ) :
579 LSET(
unsigned aIdCount,
int aFirst, ... );
591 return test( aLayer );
593 catch( std::out_of_range& )
747 std::string
FmtHex()
const;
756 int ParseHex(
const char* aStart,
int aCount );
761 std::string
FmtBin()
const;
810 return aLayerId >=
F_Cu && aLayerId <=
B_Cu;
834 if( aIncludeSyntheticCopperLayers )
1004 static std::set<LAYER_NUM> netCopperLayers =
1016 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
1022 #endif // LAYER_IDS_H static LSET UserDefinedLayers()
Return a mask with all of the allowable user defined layers.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
LSET(const BASE_SET &aOther)
NETNAMES_LAYER_ID
Dedicated layers for net names used in Pcbnew.
currently selected items overlay
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Auxiliary items (guides, rule, etc)
bool IsDCodeLayer(int aLayer)
layer for drc markers with SEVERITY_ERROR
PCB_LAYER_ID ToLAYER_ID(int aLayer)
static LSET ForbiddenFootprintLayers()
Layers which are not allowed within footprint definitions.
for drawingsheetEditor previewing
Meta control for all pads opacity/visibility (color ignored)
static LSET BackTechMask()
Return a mask holding all technical layers (no CU layer) on back side.
show footprints values (when texts are visible)
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
Additional netnames layers (not associated with a PCB layer)
GAL_LAYER_ID ToGalLayer(int aInteger)
anchor of items having an anchor point (texts, footprints)
int LAYER_NUM
This can be replaced with int and removed.
static LSET FrontTechMask()
Return a mask holding all technical layers (no CU layer) on front side.
PCB_LAYER_ID operator *() const
LSEQ SeqStackupBottom2Top() const
Return the sequence that is typical for a bottom-to-top stack-up.
LSEQ Users() const
*_User layers.
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
Reserved space for board layer netnames.
to draw via holes (pad holes do not use this layer)
bool IsPcbLayer(LAYER_NUM aLayer)
Test whether a layer is a valid layer for Pcbnew.
Control for copper zone opacity/visibility (color ignored)
LSET(PCB_LAYER_ID aLayer)
Take a PCB_LAYER_ID and sets that bit.
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
This is the end of the layers used for visibility bit masks in Pcbnew.
to draw usual through hole vias
LSEQ TechAndUserUIOrder() const
Returns the technical and user layers in the order shown in layer widget.
GAL_SET & set(int aPos, bool aVal=true)
for drawingsheetEditor previewing
GerbView draw layers and d-code layers.
bool IsNetCopperLayer(LAYER_NUM aLayer)
Checks if the given layer is "net copper", meaning it is eligible for net coloring.
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount=0)
static LSET BackAssembly()
Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask.
bool IsHoleLayer(LAYER_NUM aLayer)
LSET is a set of PCB_LAYER_IDs.
handle color for not plated holes (holes, not pads)
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.
Meta control for all vias opacity/visibility.
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
SCH_LAYER_ID
Eeschema drawing layers.
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
#define GERBER_DRAWLAYERS_COUNT
constexpr int GAL_LAYER_ID_COUNT
bool IsNonCopperLayer(LAYER_NUM aLayerId)
Test whether a layer is a non copper layer.
Helper for storing and iterating over GAL_LAYER_IDs.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
static GAL_SET DefaultVisible()
Virtual layers for stacking zones and tracks on a given copper layer.
static LSET FrontAssembly()
Return a complete set of all top assembly layers which is all F_SilkS and F_Mask.
static LSET AllLayersMask()
to handle and draw images bitmaps
drawingsheet frame and titleblock
GAL_SET & set(GAL_LAYER_ID aPos, bool aVal=true)
LSEQ Technicals(LSET aSubToOmit=LSET()) const
Return a sequence of technical layers.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
show a marker on pads with no nets
show footprints references (when texts are visible)
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
GAL_LAYER_ID operator++(GAL_LAYER_ID &a)
std::bitset< GAL_LAYER_ID_COUNT > GAL_BASE_SET
LSET()
Create an empty (cleared) set.
multilayer pads, usually with holes
std::string FmtBin() const
Return a binary string showing contents of this LSEQ.
to draw blind/buried vias
layer for drc markers which have been individually excluded
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
PCB_LAYER_ID
A quick note on layer IDs:
static constexpr int start
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
bool IsViaPadLayer(LAYER_NUM aLayer)
GERBVIEW_LAYER_ID
GerbView draw layers.
layer for drc markers with SEVERITY_WARNING
static LSET BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
static LSET AllBoardTechMask()
Return a mask holding board technical layers (no CU layer) on both side.
std::vector< GAL_LAYER_ID > Seq() const
to draw pad holes (plated)
bool IsValidLayer(LAYER_NUM aLayerId)
Test whether a given integer is a valid layer index, i.e.
bool IsZoneLayer(LAYER_NUM aLayer)
GAL_SET(const GAL_SET &aOther)
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
LSEQ(InputIterator aStart, InputIterator aEnd)
wxString LayerName(int aLayer)
Returns the string equivalent of a given layer.
LSET(unsigned long __val)
Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).
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.
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
LAYER_3D_ID
3D Viewer virtual layers for color settings
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount=0)
Calculate the mask layer when flipping a footprint.
bool Contains(GAL_LAYER_ID aPos)