KiCad PCB EDA Suite
layer_ids.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 2007-2022 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef LAYER_IDS_H
27#define LAYER_IDS_H
28
29#include <set>
30#include <vector>
31#include <bitset>
32#include <stdexcept>
33#include <wx/string.h>
34
35
58enum PCB_LAYER_ID: int
59{
62
95 B_Cu, // 31
96
99
102
105
107 F_Mask, // 39
108
114 Margin, // 45
115
118
120 F_Fab, // 49
121
122 // User definable layers.
132
133 Rescue, // 59
134
135 // Four reserved layers (60 - 63) for future expansion within the 64 bit integer limit.
136
139
140#define MAX_CU_LAYERS (B_Cu - F_Cu + 1)
141
146enum class FLASHING
147{
148 DEFAULT, // Flashing follows connectivity
149 ALWAYS_FLASHED, // Always flashed for connectivity
150 NEVER_FLASHED, // Never flashed for connectivity
151};
152
155{
156
158
160
162
164
169
172
174#define NETNAMES_LAYER_INDEX( layer ) ( NETNAMES_LAYER_ID_START + layer )
175
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
262
264#define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START )
265
267#define BITMAP_LAYER_FOR( boardLayer ) ( LAYER_BITMAP_START + boardLayer )
268#define ZONE_LAYER_FOR( boardLayer ) ( LAYER_ZONE_START + boardLayer )
269
271
273{
274 a = GAL_LAYER_ID( int( a ) + 1 );
275 return a;
276}
277
278inline GAL_LAYER_ID ToGalLayer( int aInteger )
279{
280 wxASSERT( aInteger >= GAL_LAYER_ID_START && aInteger <= GAL_LAYER_ID_END );
281 return static_cast<GAL_LAYER_ID>( aInteger );
282}
283
285inline GAL_LAYER_ID operator+( const GAL_LAYER_ID& a, int b )
286{
287 GAL_LAYER_ID t = GAL_LAYER_ID( int( a ) + b );
288 wxASSERT( t <= GAL_LAYER_ID_END );
289 return t;
290}
291
292typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET;
293
295class GAL_SET : public GAL_BASE_SET
296{
297private:
298 static constexpr int start = static_cast<int>( GAL_LAYER_ID_START );
299
300public:
302 {
303 }
304
305 GAL_SET( const GAL_SET& aOther ) : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
306 {
307 }
308
309 GAL_SET( const GAL_LAYER_ID* aArray, unsigned aCount );
310
312 {
313 GAL_BASE_SET::set();
314 return *this;
315 }
316
317 GAL_SET& set( int aPos, bool aVal = true )
318 {
319 GAL_BASE_SET::set( aPos, aVal );
320 return *this;
321 }
322
323 GAL_SET& set( GAL_LAYER_ID aPos, bool aVal = true )
324 {
325 GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
326 return *this;
327 }
328
330 {
331 return test( static_cast<std::size_t>( aPos ) - start );
332 }
333
334 std::vector<GAL_LAYER_ID> Seq() const;
335
336 static GAL_SET DefaultVisible();
337};
338
341{
343
387
390
391#define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
392
393#define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START )
394
396{
397 a = SCH_LAYER_ID( int( a ) + 1 );
398 return a;
399}
400
401// number of draw layers in Gerbview
402#define GERBER_DRAWLAYERS_COUNT PCB_LAYER_ID_COUNT
403
406{
408
411
419
422
423#define GERBER_DRAW_LAYER( x ) ( GERBVIEW_LAYER_ID_START + x )
424
425#define GERBER_DCODE_LAYER( x ) ( GERBER_DRAWLAYERS_COUNT + x )
426
427#define GERBER_DRAW_LAYER_INDEX( x ) ( x - GERBVIEW_LAYER_ID_START )
428
429
431enum LAYER_3D_ID : int
432{
434
444
447
449#define LAYER_ID_COUNT LAYER_3D_END
450
451
456wxString LayerName( int aLayer );
457
458
459// Some elements do not have yet a visibility control
460// from a dialog, but have a visibility control flag.
461// Here is a mask to set them visible, to be sure they are displayed
462// after loading a board for instance
463#define MIN_VISIBILITY_MASK int( ( 1 << GAL_LAYER_INDEX( LAYER_PAD_PLATEDHOLES ) ) +\
464 ( 1 << GAL_LAYER_INDEX( LAYER_VIA_HOLES ) ) +\
465 ( 1 << GAL_LAYER_INDEX( LAYER_SELECT_OVERLAY ) ) +\
466 ( 1 << GAL_LAYER_INDEX( LAYER_GP_OVERLAY ) ) +\
467 ( 1 << GAL_LAYER_INDEX( LAYER_RATSNEST ) ) )
468
469
471typedef std::vector<PCB_LAYER_ID> BASE_SEQ;
472
473
490class LSEQ : public BASE_SEQ
491{
492 unsigned m_index;
493
494public:
495
497 m_index( 0 )
498 {}
499
500 template <class InputIterator>
501 LSEQ( InputIterator aStart, InputIterator aEnd ) :
502 BASE_SEQ( aStart, aEnd ), m_index( 0 )
503 {}
504
505 void Rewind() { m_index = 0; }
506
507 void operator ++ () { ++m_index; } // returns nothing, used in simple statements only.
508
509 void operator ++ (int) { ++m_index; }
510
511 operator bool () { return m_index < size(); }
512
514 {
515 return at( m_index ); // throws std::out_of_range
516 }
517};
518
519
520typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;
521
522
529class LSET : public BASE_SET
530{
531public:
532
533 // The constructor flavors are carefully chosen to prevent LSET( int ) from compiling.
534 // That excludes "LSET s = 0;" and excludes "LSET s = -1;", etc.
535 // LSET s = 0; needs to be removed from the code, this accomplishes that.
536 // Remember LSET( PCB_LAYER_ID(0) ) sets bit 0, so "LSET s = 0;" is illegal
537 // to prevent that surprise. Therefore LSET's constructor suite is significantly
538 // different than the base class from which it is derived.
539
540 // Other member functions (non-constructor functions) are identical to the base
541 // class's and therefore are re-used from the base class.
542
547 BASE_SET() // all bits are set to zero in BASE_SET()
548 {
549 }
550
551 LSET( const BASE_SET& aOther ) :
552 BASE_SET( aOther )
553 {
554 }
555
570 LSET( PCB_LAYER_ID aLayer ) : // PCB_LAYER_ID deliberately excludes int and relatives
571 BASE_SET()
572 {
573 set( aLayer );
574 }
575
579 LSET( const PCB_LAYER_ID* aArray, unsigned aCount );
580
592 LSET( unsigned aIdCount, int aFirst, ... ); // args chosen to prevent LSET( int ) from compiling
593
600 bool Contains( PCB_LAYER_ID aLayer )
601 {
602 try
603 {
604 return test( aLayer );
605 }
606 catch( std::out_of_range& )
607 {
608 return false;
609 }
610 }
611
615 static const wxChar* Name( PCB_LAYER_ID aLayerId );
616
621 static LSET InternalCuMask();
622
626 static LSET FrontAssembly();
627
631 static LSET BackAssembly();
632
636 static LSET AllCuMask( int aCuLayerCount = MAX_CU_LAYERS );
637
641 static LSET ExternalCuMask();
642
646 static LSET AllNonCuMask();
647
648 static LSET AllLayersMask();
649
653 static LSET FrontTechMask();
654
659 static LSET FrontBoardTechMask();
660
664 static LSET BackTechMask();
665
670 static LSET BackBoardTechMask();
671
675 static LSET AllTechMask();
676
680 static LSET AllBoardTechMask();
681
685 static LSET FrontMask();
686
690 static LSET BackMask();
691
692 static LSET UserMask();
693
698 static LSET PhysicalLayersMask();
699
703 static LSET UserDefinedLayers();
704
711
717 LSEQ CuStack() const;
718
724 LSEQ Technicals( LSET aSubToOmit = LSET() ) const;
725
727 LSEQ Users() const;
728
730 LSEQ TechAndUserUIOrder() const;
731
732 LSEQ UIOrder() const;
733
741 LSEQ Seq( const PCB_LAYER_ID* aWishListSequence, unsigned aCount ) const;
742
743 LSEQ Seq( const LSEQ& aSequence ) const;
744
751 LSEQ Seq() const;
752
758
762 std::string FmtHex() const;
763
771 int ParseHex( const char* aStart, int aCount );
772
776 std::string FmtBin() const;
777
783
784private:
785
787 LSET( unsigned long __val )
788 {
789 // not usable, it's private.
790 }
791};
792
793
801inline bool IsValidLayer( int aLayerId )
802{
803 return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
804}
805
812inline bool IsPcbLayer( int aLayer )
813{
814 return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
815}
816
823inline bool IsCopperLayer( int aLayerId )
824{
825 return aLayerId >= F_Cu && aLayerId <= B_Cu;
826}
827
834inline bool IsNonCopperLayer( int aLayerId )
835{
836 return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
837}
838
847inline bool IsCopperLayer( int aLayerId, bool aIncludeSyntheticCopperLayers )
848{
849 if( aIncludeSyntheticCopperLayers )
850 return !IsNonCopperLayer( aLayerId );
851 else
852 return IsCopperLayer( aLayerId );
853}
854
855inline bool IsViaPadLayer( int aLayer )
856{
857 return aLayer == LAYER_VIA_THROUGH
858 || aLayer == LAYER_VIA_MICROVIA
859 || aLayer == LAYER_VIA_BBLIND;
860}
861
862inline bool IsHoleLayer( int aLayer )
863{
864 return aLayer == LAYER_VIA_HOLES
865 || aLayer == LAYER_VIA_HOLEWALLS
866 || aLayer == LAYER_PAD_PLATEDHOLES
867 || aLayer == LAYER_PAD_HOLEWALLS
868 || aLayer == LAYER_NON_PLATEDHOLES;
869}
870
877inline bool IsUserLayer( PCB_LAYER_ID aLayerId )
878{
879 return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
880}
881
882
883/*
884 * IMPORTANT: If a layer is not a front layer that doesn't necessarily mean it's a back layer.
885 *
886 * So a layer can be:
887 * - Front
888 * - Back
889 * - Neither (internal or auxiliary)
890 *
891 * The check most frequent is for back layers, since it involves flips.
892 */
893
897inline bool IsFrontLayer( PCB_LAYER_ID aLayerId )
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}
915
916
920inline bool IsBackLayer( PCB_LAYER_ID aLayerId )
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}
938
939
949PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayerId, int aCopperLayersCount = 0 );
950
960LSET FlipLayerMask( LSET aMask, int aCopperLayersCount = 0 );
961
962
966inline int GetNetnameLayer( int aLayer )
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}
982
989inline bool IsNetnameLayer( int aLayer )
990{
991 return aLayer >= NETNAMES_LAYER_INDEX( F_Cu ) && aLayer < NETNAMES_LAYER_ID_END;
992}
993
994
995inline bool IsZoneLayer( int aLayer )
996{
997 return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
998}
999
1000
1001inline bool IsDCodeLayer( int aLayer )
1002{
1004 && aLayer < ( GERBVIEW_LAYER_ID_START + ( 2 * GERBER_DRAWLAYERS_COUNT ) );
1005}
1006
1007
1014inline bool IsNetCopperLayer( int aLayer )
1015{
1016 static std::set<int> netCopperLayers =
1017 {
1026 };
1027
1028 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
1029}
1030
1031
1032PCB_LAYER_ID ToLAYER_ID( int aLayer );
1033
1034#endif // LAYER_IDS_H
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:296
bool Contains(GAL_LAYER_ID aPos)
Definition: layer_ids.h:329
GAL_SET()
Definition: layer_ids.h:301
GAL_SET & set()
Definition: layer_ids.h:311
static constexpr int start
Definition: layer_ids.h:298
GAL_SET(const GAL_SET &aOther)
Definition: layer_ids.h:305
static GAL_SET DefaultVisible()
Definition: lset.cpp:954
std::vector< GAL_LAYER_ID > Seq() const
Definition: lset.cpp:940
GAL_SET & set(int aPos, bool aVal=true)
Definition: layer_ids.h:317
GAL_SET & set(GAL_LAYER_ID aPos, bool aVal=true)
Definition: layer_ids.h:323
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:491
PCB_LAYER_ID operator*() const
Definition: layer_ids.h:513
void operator++()
Definition: layer_ids.h:507
LSEQ()
Definition: layer_ids.h:496
void Rewind()
Definition: layer_ids.h:505
unsigned m_index
Definition: layer_ids.h:492
LSEQ(InputIterator aStart, InputIterator aEnd)
Definition: layer_ids.h:501
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
Definition: lset.cpp:801
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.
Definition: lset.cpp:359
LSET(PCB_LAYER_ID aLayer)
Take a PCB_LAYER_ID and sets that bit.
Definition: layer_ids.h:570
LSEQ UIOrder() const
Definition: lset.cpp:916
static LSET AllBoardTechMask()
Return a mask holding board technical layers (no CU layer) on both side.
Definition: lset.cpp:848
static LSET AllLayersMask()
Definition: lset.cpp:808
LSET(const BASE_SET &aOther)
Definition: layer_ids.h:551
static LSET UserDefinedLayers()
Return a mask with all of the allowable user defined layers.
Definition: lset.cpp:877
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
Definition: layer_ids.h:600
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Definition: lset.cpp:170
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
Definition: lset.cpp:684
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
Definition: lset.cpp:834
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
Definition: lset.cpp:794
LSEQ SeqStackupBottom2Top() const
Return the sequence that is typical for a bottom-to-top stack-up.
Definition: lset.cpp:475
static LSET FrontAssembly()
Return a complete set of all top assembly layers which is all F_SilkS and F_Mask.
Definition: lset.cpp:705
LSEQ TechAndUserUIOrder() const
Returns the technical and user layers in the order shown in layer widget.
Definition: lset.cpp:261
static LSET UserMask()
Definition: lset.cpp:855
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:841
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
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
Definition: lset.cpp:870
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
Definition: lset.cpp:459
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
Definition: lset.cpp:321
static LSET ForbiddenFootprintLayers()
Layers which are not allowed within footprint definitions.
Definition: lset.cpp:909
LSEQ Technicals(LSET aSubToOmit=LSET()) const
Return a sequence of technical layers.
Definition: lset.cpp:212
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:82
std::string FmtBin() const
Return a binary string showing contents of this LSEQ.
Definition: lset.cpp:297
static LSET FrontTechMask()
Return a mask holding all technical layers (no CU layer) on front side.
Definition: lset.cpp:827
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
Definition: lset.cpp:821
LSEQ Users() const
*_User layers.
Definition: lset.cpp:236
static LSET BackTechMask()
Return a mask holding all technical layers (no CU layer) on back side.
Definition: lset.cpp:815
static LSET BackAssembly()
Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask.
Definition: lset.cpp:719
static LSET FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
Definition: lset.cpp:895
static LSET BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
Definition: lset.cpp:902
LSET()
Create an empty (cleared) set.
Definition: layer_ids.h:546
LSET(unsigned long __val)
Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).
Definition: layer_ids.h:787
NETNAMES_LAYER_ID
Dedicated layers for net names used in Pcbnew.
Definition: layer_ids.h:155
@ 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
@ NETNAMES_LAYER_ID_END
Definition: layer_ids.h:170
@ LAYER_VIA_NETNAMES
Definition: layer_ids.h:168
@ NETNAMES_LAYER_ID_RESERVED
Reserved space for board layer netnames.
Definition: layer_ids.h:161
std::bitset< GAL_LAYER_ID_COUNT > GAL_BASE_SET
Definition: layer_ids.h:292
GAL_LAYER_ID operator++(GAL_LAYER_ID &a)
Definition: layer_ids.h:272
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.
Definition: layer_ids.h:471
GERBVIEW_LAYER_ID
GerbView draw layers.
Definition: layer_ids.h:406
@ 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
bool IsZoneLayer(int aLayer)
Definition: layer_ids.h:995
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
Definition: layer_ids.h:520
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
Definition: layer_ids.h:285
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:926
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount=0)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:590
bool IsPcbLayer(int aLayer)
Test whether a layer is a valid layer for Pcbnew.
Definition: layer_ids.h:812
LAYER_3D_ID
3D Viewer virtual layers for color settings
Definition: layer_ids.h:432
@ 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
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
Definition: layer_ids.h:877
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:174
GAL_LAYER_ID ToGalLayer(int aInteger)
Definition: layer_ids.h:278
bool IsNetCopperLayer(int aLayer)
Checks if the given layer is "net copper", meaning it is eligible for net coloring.
Definition: layer_ids.h:1014
constexpr int GAL_LAYER_ID_COUNT
Definition: layer_ids.h:270
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:897
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:147
@ ALWAYS_FLASHED
bool IsDCodeLayer(int aLayer)
Definition: layer_ids.h:1001
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:920
#define MAX_CU_LAYERS
Definition: layer_ids.h:140
bool IsNonCopperLayer(int aLayerId)
Test whether a layer is a non copper layer.
Definition: layer_ids.h:834
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:966
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:823
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:190
@ 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
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:214
@ GAL_LAYER_ID_END
Definition: layer_ids.h:260
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:218
@ 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_RATSNEST
Definition: layer_ids.h:204
@ 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_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:215
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:194
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:219
@ 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
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:341
@ 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
@ SCH_LAYER_ID_END
Definition: layer_ids.h:388
@ 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
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:989
wxString LayerName(int aLayer)
Returns the string equivalent of a given layer.
Definition: layer_id.cpp:30
bool IsHoleLayer(int aLayer)
Definition: layer_ids.h:862
bool IsViaPadLayer(int aLayer)
Definition: layer_ids.h:855
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ 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
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
@ 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
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount=0)
Definition: lset.cpp:544
bool IsValidLayer(int aLayerId)
Test whether a given integer is a valid layer index, i.e.
Definition: layer_ids.h:801
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:402
Definition: bitmap.cpp:64