Go to the documentation of this file.
31 #ifndef LAYERS_ID_AND_VISIBILITY_H_
32 #define LAYERS_ID_AND_VISIBILITY_H_
74 UNSELECTED_LAYER = -2,
137 #define MAX_CU_LAYERS (B_Cu - F_Cu + 1)
143 NETNAMES_LAYER_ID_START = PCB_LAYER_ID_COUNT,
152 LAYER_PAD_BK_NETNAMES,
156 NETNAMES_LAYER_ID_END
160 #define NETNAMES_LAYER_INDEX( layer ) ( NETNAMES_LAYER_ID_START + layer )
166 GAL_LAYER_ID_START = NETNAMES_LAYER_ID_END,
168 LAYER_VIAS = GAL_LAYER_ID_START,
205 #define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START )
226 LAYER_WIRE = SCH_LAYER_ID_START,
248 LAYER_DEVICE_BACKGROUND,
249 LAYER_SCHEMATIC_GRID,
250 LAYER_SCHEMATIC_BACKGROUND,
256 #define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
258 #define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START )
267 #define GERBER_DRAWLAYERS_COUNT 32
272 GERBVIEW_LAYER_ID_START = SCH_LAYER_ID_END,
278 LAYER_NEGATIVE_OBJECTS,
281 LAYER_GERBVIEW_BACKGROUND,
283 GERBVIEW_LAYER_ID_END
287 #define LAYER_ID_COUNT GERBVIEW_LAYER_ID_END
294 #define MIN_VISIBILITY_MASK int( (1 << GAL_LAYER_INDEX( LAYER_TRACKS ) ) +\
295 ( 1 << GAL_LAYER_INDEX( LAYER_PADS ) ) +\
296 ( 1 << GAL_LAYER_INDEX( LAYER_PADS_HOLES ) ) +\
297 ( 1 << GAL_LAYER_INDEX( LAYER_VIAS_HOLES ) ) +\
298 ( 1 << GAL_LAYER_INDEX( LAYER_DRC ) ) +\
299 ( 1 << GAL_LAYER_INDEX( LAYER_WORKSHEET ) ) +\
300 ( 1 << GAL_LAYER_INDEX( LAYER_GP_OVERLAY ) ) )
334 template <
class InputIterator>
335 LSEQ( InputIterator aStart, InputIterator aEnd ) :
336 BASE_SEQ( aStart, aEnd ), m_index( 0 )
339 void Rewind() { m_index = 0; }
341 void operator ++ () { ++m_index; }
343 void operator ++ (
int) { ++m_index; }
345 operator bool () {
return m_index < size(); }
349 return at( m_index );
354 typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;
387 LSET(
const BASE_SET& aOther ) :
431 LSET(
unsigned aIdCount,
int aFirst, ... );
464 static LSET AllLayersMask();
516 static LSET UserMask();
538 LSEQ UIOrder()
const;
570 std::string
FmtHex()
const;
580 int ParseHex(
const char* aStart,
int aCount );
586 std::string
FmtBin()
const;
597 LSET(
unsigned long __val )
613 return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
624 return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
635 return aLayerId >= F_Cu && aLayerId <= B_Cu;
646 return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
657 return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
747 return LAYER_PADS_NETNAMES;
751 return LAYER_PAD_BK_NETNAMES;
753 return LAYER_VIAS_NETNAMES;
768 aLayer < NETNAMES_LAYER_ID_END;
774 #endif // LAYERS_ID_AND_VISIBILITY_H_
This is the end of the layers used for visibility bitmasks in Pcbnew There can be at most 32 layers a...
Definition: layers_id_colors_and_visibility.h:197
bool IsNetnameLayer(LAYER_NUM aLayer)
Function IsNetnameLayer tests whether a layer is a netname layer.
Definition: layers_id_colors_and_visibility.h:765
worksheet frame
Definition: layers_id_colors_and_visibility.h:192
to draw blind/buried vias
Definition: layers_id_colors_and_visibility.h:170
static LSET FrontMask()
Function FrontMask returns a mask holding all technical layers and the external CU layer on front sid...
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layers_id_colors_and_visibility.h:324
std::string FmtBin() const
Function FmtBin returns a binary string showing contents of this LSEQ.
static const char * Name(PCB_LAYER_ID aLayerId)
Function Name returns the fixed name association with aLayerId.
Add new GAL layers here.
Definition: layers_id_colors_and_visibility.h:201
show modules on back
Definition: layers_id_colors_and_visibility.h:184
show a marker on pads with no nets
Definition: layers_id_colors_and_visibility.h:182
LSET()
Constructor LSET() creates an empty (cleared) set.
Definition: layers_id_colors_and_visibility.h:382
to draw via holes (pad holes do not use this layer)
Definition: layers_id_colors_and_visibility.h:190
static LSET BackTechMask()
Function BackTechMask returns a mask holding all technical layers (no CU layer) on back side.
std::string FmtHex() const
Function FmtHex returns a hex string showing contents of this LSEQ.
show modules values (when texts are visibles)
Definition: layers_id_colors_and_visibility.h:185
GERBVIEW_LAYER_ID
GerbView draw layers.
Definition: layers_id_colors_and_visibility.h:270
smd pads, back layer
Definition: layers_id_colors_and_visibility.h:178
static LSET ExternalCuMask()
Function ExternalCuMask returns a mask holding the Front and Bottom layers.
drc markers
Definition: layers_id_colors_and_visibility.h:191
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
Definition: layers_id_colors_and_visibility.h:633
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layers_id_colors_and_visibility.h:696
show modules on front
Definition: layers_id_colors_and_visibility.h:183
static LSET InternalCuMask()
Function InternalCuMask() returns a complete set of internal copper layers, which is all Cu layers ex...
static LSET FrontTechMask()
Function FrontTechMask returns a mask holding all technical layers (no CU layer) on front side.
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layers_id_colors_and_visibility.h:160
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
bool IsPcbLayer(LAYER_NUM aLayer)
Function IsPcbLayer tests whether a layer is a valid layer for pcbnew.
Definition: layers_id_colors_and_visibility.h:622
multilayer pads, usually with holes
Definition: layers_id_colors_and_visibility.h:188
to draw usual through hole vias
Definition: layers_id_colors_and_visibility.h:171
static LSET AllBoardTechMask()
Function AllTechMask returns a mask holding board technical layers (no CU layer) on both side.
int ParseHex(const char *aStart, int aCount)
Function ParseHex understands the output of FmtHex() and replaces this set's values with those given ...
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Definition: layers_id_colors_and_visibility.h:46
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layers_id_colors_and_visibility.h:222
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Function IsUserLayer tests whether a layer is a non copper and a non tech layer.
Definition: layers_id_colors_and_visibility.h:655
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layers_id_colors_and_visibility.h:742
static LSET AllNonCuMask()
Function AllNonCuMask returns a mask holding all layer minus CU layers.
LSEQ CuStack() const
Function CuStack returns a sequence of copper layers in starting from the front/top and extending to ...
bool IsNonCopperLayer(LAYER_NUM aLayerId)
Function IsNonCopperLayer tests whether a layer is a non copper layer.
Definition: layers_id_colors_and_visibility.h:644
to draw pad holes (plated or not plated)
Definition: layers_id_colors_and_visibility.h:189
NETNAMES_LAYER_ID
Dedicated layers for net names used in Pcbnew.
Definition: layers_id_colors_and_visibility.h:140
LSEQ SeqStackupBottom2Top() const
Function SeqStackBottom2Top returns the sequence that is typical for a bottom-to-top stack-up.
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount=0)
Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask,...
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side.
general purpose overlay
Definition: layers_id_colors_and_visibility.h:193
static LSET FrontBoardTechMask()
Function FrontBoardTechMask returns a mask holding technical layers used in a board fabrication (no C...
LSEQ Users() const
*_User layers.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount=0)
Function FlippedLayerNumber.
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
Definition: layers_id_colors_and_visibility.h:214
GerbView draw layers.
Definition: layers_id_colors_and_visibility.h:275
handle color for not plated holes
Definition: layers_id_colors_and_visibility.h:172
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layers_id_colors_and_visibility.h:673
LSEQ Seq() const
Function Seq returns a LSEQ from this LSET in ascending PCB_LAYER_ID order.
LSET(PCB_LAYER_ID aLayer)
Constructor LSET( PCB_LAYER_ID ) takes a PCB_LAYER_ID and sets that bit.
Definition: layers_id_colors_and_visibility.h:407
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Additional netnames layers (not associated with a PCB layer)
Definition: layers_id_colors_and_visibility.h:151
static LSET BackBoardTechMask()
Function BackBoardTechMask returns a mask holding technical layers used in a board fabrication (no CU...
text marked as invisible
Definition: layers_id_colors_and_visibility.h:175
Class LSET is a set of PCB_LAYER_IDs.
Definition: layers_id_colors_and_visibility.h:364
static LSET BackMask()
Function BackMask returns a mask holding all technical layers and the external CU layer on back side.
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.
Definition: layers_id_colors_and_visibility.h:304
Reserved space for board layer netnames.
Definition: layers_id_colors_and_visibility.h:147
bool IsValidLayer(LAYER_NUM aLayerId)
Function IsValidLayer tests whether a given integer is a valid layer index, i.e.
Definition: layers_id_colors_and_visibility.h:611
to draw micro vias
Definition: layers_id_colors_and_visibility.h:169
anchor of items having an anchor point (texts, footprints)
Definition: layers_id_colors_and_visibility.h:176
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layers_id_colors_and_visibility.h:71
LSEQ Technicals(LSET aSubToOmit=LSET()) const
Function Technicals returns a sequence of technical layers.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layers_id_colors_and_visibility.h:164
show modules references (when texts are visibles)
Definition: layers_id_colors_and_visibility.h:186
smd pads, front layer
Definition: layers_id_colors_and_visibility.h:177