KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
292
294typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET;
295
296
298class GAL_SET : public GAL_BASE_SET
299{
300
301private:
302 static constexpr int start = static_cast<int>( GAL_LAYER_ID_START );
303
304public:
306 {
307 }
308
309 GAL_SET( const GAL_SET& aOther ) : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
310 {
311 }
312
313 GAL_SET( const GAL_LAYER_ID* aArray, unsigned aCount );
314
316 {
317 GAL_BASE_SET::set();
318 return *this;
319 }
320
321 GAL_SET& set( int aPos, bool aVal = true )
322 {
323 GAL_BASE_SET::set( aPos, aVal );
324 return *this;
325 }
326
327 GAL_SET& set( GAL_LAYER_ID aPos, bool aVal = true )
328 {
329 GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
330 return *this;
331 }
332
334 {
335 return test( static_cast<std::size_t>( aPos ) - start );
336 }
337
338 std::vector<GAL_LAYER_ID> Seq() const;
339
340 static GAL_SET DefaultVisible();
341};
342
345{
347
393
396
397#define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
398
399#define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START )
400
402{
403 a = SCH_LAYER_ID( int( a ) + 1 );
404 return a;
405}
406
407// number of draw layers in Gerbview
408#define GERBER_DRAWLAYERS_COUNT PCB_LAYER_ID_COUNT
409
412{
414
417
425
428
429#define GERBER_DRAW_LAYER( x ) ( GERBVIEW_LAYER_ID_START + x )
430
431#define GERBER_DCODE_LAYER( x ) ( GERBER_DRAWLAYERS_COUNT + x )
432
433#define GERBER_DRAW_LAYER_INDEX( x ) ( x - GERBVIEW_LAYER_ID_START )
434
435
437enum LAYER_3D_ID : int
438{
440
450
453
455#define LAYER_ID_COUNT LAYER_3D_END
456
457
462wxString LayerName( int aLayer );
463
464
465// Some elements do not have yet a visibility control
466// from a dialog, but have a visibility control flag.
467// Here is a mask to set them visible, to be sure they are displayed
468// after loading a board for instance
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 ) ) )
474
475
477typedef std::vector<PCB_LAYER_ID> BASE_SEQ;
478
479
496class LSEQ : public BASE_SEQ
497{
498 unsigned m_index;
499
500public:
501
503 m_index( 0 )
504 {}
505
506 template <class InputIterator>
507 LSEQ( InputIterator aStart, InputIterator aEnd ) :
508 BASE_SEQ( aStart, aEnd ), m_index( 0 )
509 {}
510
511 void Rewind() { m_index = 0; }
512
513 void operator ++ () { ++m_index; } // returns nothing, used in simple statements only.
514
515 void operator ++ (int) { ++m_index; }
516
517 operator bool () { return m_index < size(); }
518
520 {
521 return at( m_index ); // throws std::out_of_range
522 }
523};
524
525
526typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;
527
528
535class LSET : public BASE_SET
536{
537public:
538
539 // The constructor flavors are carefully chosen to prevent LSET( int ) from compiling.
540 // That excludes "LSET s = 0;" and excludes "LSET s = -1;", etc.
541 // LSET s = 0; needs to be removed from the code, this accomplishes that.
542 // Remember LSET( PCB_LAYER_ID(0) ) sets bit 0, so "LSET s = 0;" is illegal
543 // to prevent that surprise. Therefore LSET's constructor suite is significantly
544 // different than the base class from which it is derived.
545
546 // Other member functions (non-constructor functions) are identical to the base
547 // class's and therefore are re-used from the base class.
548
553 BASE_SET() // all bits are set to zero in BASE_SET()
554 {
555 }
556
557 LSET( const BASE_SET& aOther ) :
558 BASE_SET( aOther )
559 {
560 }
561
576 LSET( PCB_LAYER_ID aLayer ) : // PCB_LAYER_ID deliberately excludes int and relatives
577 BASE_SET()
578 {
579 set( aLayer );
580 }
581
585 LSET( const PCB_LAYER_ID* aArray, unsigned aCount );
586
598 LSET( unsigned aIdCount, int aFirst, ... ); // args chosen to prevent LSET( int ) from compiling
599
606 bool Contains( PCB_LAYER_ID aLayer )
607 {
608 try
609 {
610 return test( aLayer );
611 }
612 catch( std::out_of_range& )
613 {
614 return false;
615 }
616 }
617
621 static const wxChar* Name( PCB_LAYER_ID aLayerId );
622
627 static LSET InternalCuMask();
628
632 static LSET FrontAssembly();
633
637 static LSET BackAssembly();
638
642 static LSET AllCuMask( int aCuLayerCount = MAX_CU_LAYERS );
643
647 static LSET ExternalCuMask();
648
652 static LSET AllNonCuMask();
653
654 static LSET AllLayersMask();
655
659 static LSET FrontTechMask();
660
665 static LSET FrontBoardTechMask();
666
670 static LSET BackTechMask();
671
676 static LSET BackBoardTechMask();
677
681 static LSET AllTechMask();
682
686 static LSET AllBoardTechMask();
687
691 static LSET FrontMask();
692
696 static LSET BackMask();
697
698 static LSET SideSpecificMask();
699
700 static LSET UserMask();
701
706 static LSET PhysicalLayersMask();
707
711 static LSET UserDefinedLayers();
712
719
725 LSEQ CuStack() const;
726
732 LSEQ Technicals( LSET aSubToOmit = LSET() ) const;
733
735 LSEQ Users() const;
736
738 LSEQ TechAndUserUIOrder() const;
739
740 LSEQ UIOrder() const;
741
749 LSEQ Seq( const PCB_LAYER_ID* aWishListSequence, unsigned aCount ) const;
750
751 LSEQ Seq( const LSEQ& aSequence ) const;
752
759 LSEQ Seq() const;
760
766
770 std::string FmtHex() const;
771
779 int ParseHex( const char* aStart, int aCount );
780
784 std::string FmtBin() const;
785
791
792private:
793
795 LSET( unsigned long __val )
796 {
797 // not usable, it's private.
798 }
799};
800
801
809inline bool IsValidLayer( int aLayerId )
810{
811 return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
812}
813
820inline bool IsPcbLayer( int aLayer )
821{
822 return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
823}
824
831inline bool IsCopperLayer( int aLayerId )
832{
833 return aLayerId >= F_Cu && aLayerId <= B_Cu;
834}
835
842inline bool IsNonCopperLayer( int aLayerId )
843{
844 return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
845}
846
855inline bool IsCopperLayer( int aLayerId, bool aIncludeSyntheticCopperLayers )
856{
857 if( aIncludeSyntheticCopperLayers )
858 return !IsNonCopperLayer( aLayerId );
859 else
860 return IsCopperLayer( aLayerId );
861}
862
863inline bool IsViaPadLayer( int aLayer )
864{
865 return aLayer == LAYER_VIA_THROUGH
866 || aLayer == LAYER_VIA_MICROVIA
867 || aLayer == LAYER_VIA_BBLIND;
868}
869
870inline bool IsHoleLayer( int aLayer )
871{
872 return aLayer == LAYER_VIA_HOLES
873 || aLayer == LAYER_VIA_HOLEWALLS
874 || aLayer == LAYER_PAD_PLATEDHOLES
875 || aLayer == LAYER_PAD_HOLEWALLS
876 || aLayer == LAYER_NON_PLATEDHOLES;
877}
878
885inline bool IsUserLayer( PCB_LAYER_ID aLayerId )
886{
887 return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
888}
889
890
891/*
892 * IMPORTANT: If a layer is not a front layer that doesn't necessarily mean it's a back layer.
893 *
894 * So a layer can be:
895 * - Front
896 * - Back
897 * - Neither (internal or auxiliary)
898 *
899 * The check most frequent is for back layers, since it involves flips.
900 */
901
905inline bool IsFrontLayer( PCB_LAYER_ID aLayerId )
906{
907 switch( aLayerId )
908 {
909 case F_Cu:
910 case F_Adhes:
911 case F_Paste:
912 case F_SilkS:
913 case F_Mask:
914 case F_CrtYd:
915 case F_Fab:
916 return true;
917 default:
918 ;
919 }
920
921 return false;
922}
923
924
928inline bool IsBackLayer( PCB_LAYER_ID aLayerId )
929{
930 switch( aLayerId )
931 {
932 case B_Cu:
933 case B_Adhes:
934 case B_Paste:
935 case B_SilkS:
936 case B_Mask:
937 case B_CrtYd:
938 case B_Fab:
939 return true;
940 default:
941 return false;
942 }
943}
944
945
955PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayerId, int aCopperLayersCount = 0 );
956
966LSET FlipLayerMask( LSET aMask, int aCopperLayersCount = 0 );
967
968
972inline int GetNetnameLayer( int aLayer )
973{
974 if( IsCopperLayer( aLayer ) )
975 return NETNAMES_LAYER_INDEX( aLayer );
976 else if( aLayer == LAYER_PADS_TH )
977 return LAYER_PAD_NETNAMES;
978 else if( aLayer == LAYER_PAD_FR )
980 else if( aLayer == LAYER_PAD_BK )
982 else if( IsViaPadLayer( aLayer ) )
983 return LAYER_VIA_NETNAMES;
984
985 // Fallback
986 return Cmts_User;
987}
988
995inline bool IsNetnameLayer( int aLayer )
996{
997 return aLayer >= NETNAMES_LAYER_INDEX( F_Cu ) && aLayer < NETNAMES_LAYER_ID_END;
998}
999
1000
1001inline bool IsZoneFillLayer( int aLayer )
1002{
1003 return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
1004}
1005
1006
1007inline bool IsDCodeLayer( int aLayer )
1008{
1010 && aLayer < ( GERBVIEW_LAYER_ID_START + ( 2 * GERBER_DRAWLAYERS_COUNT ) );
1011}
1012
1013
1020inline bool IsNetCopperLayer( int aLayer )
1021{
1022 static std::set<int> netCopperLayers =
1023 {
1032 };
1033
1034 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
1035}
1036
1037
1038PCB_LAYER_ID ToLAYER_ID( int aLayer );
1039
1040#endif // LAYER_IDS_H
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:299
bool Contains(GAL_LAYER_ID aPos)
Definition: layer_ids.h:333
GAL_SET()
Definition: layer_ids.h:305
GAL_SET & set()
Definition: layer_ids.h:315
static constexpr int start
Definition: layer_ids.h:302
GAL_SET(const GAL_SET &aOther)
Definition: layer_ids.h:309
static GAL_SET DefaultVisible()
Definition: lset.cpp:960
std::vector< GAL_LAYER_ID > Seq() const
Definition: lset.cpp:946
GAL_SET & set(int aPos, bool aVal=true)
Definition: layer_ids.h:321
GAL_SET & set(GAL_LAYER_ID aPos, bool aVal=true)
Definition: layer_ids.h:327
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:497
PCB_LAYER_ID operator*() const
Definition: layer_ids.h:519
void operator++()
Definition: layer_ids.h:513
LSEQ()
Definition: layer_ids.h:502
void Rewind()
Definition: layer_ids.h:511
unsigned m_index
Definition: layer_ids.h:498
LSEQ(InputIterator aStart, InputIterator aEnd)
Definition: layer_ids.h:507
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:536
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:576
LSEQ UIOrder() const
Definition: lset.cpp:922
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:557
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:606
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 SideSpecificMask()
Definition: lset.cpp:908
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:915
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:552
LSET(unsigned long __val)
Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).
Definition: layer_ids.h:795
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
Wraps a std::bitset.
Definition: layer_ids.h:294
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:477
GERBVIEW_LAYER_ID
GerbView draw layers.
Definition: layer_ids.h:412
@ GERBVIEW_LAYER_ID_RESERVED
GerbView draw layers and d-code layers.
Definition: layer_ids.h:416
@ LAYER_GERBVIEW_DRAWINGSHEET
Definition: layer_ids.h:423
@ GERBVIEW_LAYER_ID_START
Definition: layer_ids.h:413
@ LAYER_GERBVIEW_BACKGROUND
Definition: layer_ids.h:422
@ LAYER_DCODES
Definition: layer_ids.h:418
@ LAYER_NEGATIVE_OBJECTS
Definition: layer_ids.h:419
@ LAYER_GERBVIEW_PAGE_LIMITS
Definition: layer_ids.h:424
@ GERBVIEW_LAYER_ID_END
Definition: layer_ids.h:426
@ LAYER_GERBVIEW_AXES
Definition: layer_ids.h:421
@ LAYER_GERBVIEW_GRID
Definition: layer_ids.h:420
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
Definition: layer_ids.h:526
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:932
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:820
LAYER_3D_ID
3D Viewer virtual layers for color settings
Definition: layer_ids.h:438
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:448
@ LAYER_3D_START
Definition: layer_ids.h:439
@ LAYER_3D_COPPER
Definition: layer_ids.h:444
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:442
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:447
@ LAYER_3D_BOARD
Definition: layer_ids.h:443
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:446
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:449
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:441
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:445
@ LAYER_3D_END
Definition: layer_ids.h:451
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
Definition: layer_ids.h:885
#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:1020
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:905
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:1007
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:928
#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:842
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:972
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:831
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:345
@ LAYER_DANGLING
Definition: layer_ids.h:372
@ LAYER_SHEETNAME
Definition: layer_ids.h:367
@ LAYER_ERC_WARN
Definition: layer_ids.h:373
@ LAYER_SCHEMATIC_ANCHOR
Definition: layer_ids.h:390
@ LAYER_SHEETLABEL
Definition: layer_ids.h:370
@ LAYER_PINNUM
Definition: layer_ids.h:354
@ LAYER_DEVICE
Definition: layer_ids.h:361
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:377
@ LAYER_BRIGHTENED
Definition: layer_ids.h:383
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:375
@ LAYER_HIDDEN
Definition: layer_ids.h:384
@ LAYER_HIERLABEL
Definition: layer_ids.h:353
@ LAYER_PINNAM
Definition: layer_ids.h:355
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:363
@ LAYER_HOVERED
Definition: layer_ids.h:382
@ LAYER_GLOBLABEL
Definition: layer_ids.h:352
@ LAYER_WIRE
Definition: layer_ids.h:348
@ LAYER_NOTES
Definition: layer_ids.h:362
@ LAYER_ERC_ERR
Definition: layer_ids.h:374
@ LAYER_PIN
Definition: layer_ids.h:365
@ LAYER_VALUEPART
Definition: layer_ids.h:357
@ LAYER_BUS
Definition: layer_ids.h:349
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:381
@ SCH_LAYER_ID_END
Definition: layer_ids.h:394
@ LAYER_FIELDS
Definition: layer_ids.h:358
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:376
@ SCH_LAYER_ID_START
Definition: layer_ids.h:346
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:386
@ LAYER_LOCLABEL
Definition: layer_ids.h:351
@ LAYER_JUNCTION
Definition: layer_ids.h:350
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:369
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:379
@ LAYER_REFERENCEPART
Definition: layer_ids.h:356
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:360
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:364
@ LAYER_OP_CURRENTS
Definition: layer_ids.h:392
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:387
@ LAYER_SHEET
Definition: layer_ids.h:366
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:385
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:380
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition: layer_ids.h:389
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:359
@ LAYER_OP_VOLTAGES
Definition: layer_ids.h:391
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:368
@ LAYER_BUS_JUNCTION
Definition: layer_ids.h:388
@ LAYER_NOCONNECT
Definition: layer_ids.h:371
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:378
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:995
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:870
bool IsViaPadLayer(int aLayer)
Definition: layer_ids.h:863
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:809
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:408
bool IsZoneFillLayer(int aLayer)
Definition: layer_ids.h:1001
STL namespace.