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-2023 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#include <kicommon.h>
35
36
59enum PCB_LAYER_ID: int
60{
63
64 F_Cu = 0,
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
141
142#define MAX_CU_LAYERS (B_Cu - F_Cu + 1)
143
148enum class FLASHING
149{
150 DEFAULT, // Flashing follows connectivity
151 ALWAYS_FLASHED, // Always flashed for connectivity
152 NEVER_FLASHED, // Never flashed for connectivity
153};
154
157{
158
160
162
164
166
171
174
176#define NETNAMES_LAYER_INDEX( layer ) ( static_cast<int>( NETNAMES_LAYER_ID_START ) + layer )
177
178#define GAL_UI_LAYER_COUNT 10
179
194{
196
203// LAYER_MOD_TEXT_BK deprecated + 6,
211// LAYER_NO_CONNECTS deprecated + 14, ///< show a marker on pads with no nets
228
231
232 // Layers in this section have visibility controls but were not present in legacy board files.
233
236
242
244
246
247 // Add layers below this point that do not have visibility controls, so don't need explicit
248 // enum values
249
252
255
259
263
264 // Layers for drawing on-canvas UI
267
270
272#define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START )
273
275#define BITMAP_LAYER_FOR( boardLayer ) ( LAYER_BITMAP_START + boardLayer )
276#define ZONE_LAYER_FOR( boardLayer ) ( LAYER_ZONE_START + boardLayer )
277
279
281{
282 a = GAL_LAYER_ID( int( a ) + 1 );
283 return a;
284}
285
286inline GAL_LAYER_ID ToGalLayer( int aInteger )
287{
288 wxASSERT( aInteger >= GAL_LAYER_ID_START && aInteger <= GAL_LAYER_ID_END );
289 return static_cast<GAL_LAYER_ID>( aInteger );
290}
291
293inline GAL_LAYER_ID operator+( const GAL_LAYER_ID& a, int b )
294{
295 GAL_LAYER_ID t = GAL_LAYER_ID( int( a ) + b );
296 wxASSERT( t <= GAL_LAYER_ID_END );
297 return t;
298}
299
300
302typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET;
303
304
307{
308
309private:
310 static constexpr int start = static_cast<int>( GAL_LAYER_ID_START );
311
312public:
314 {
315 }
316
317 GAL_SET( const GAL_SET& aOther ) : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
318 {
319 }
320
321 GAL_SET( const GAL_LAYER_ID* aArray, unsigned aCount );
322
324 {
325 GAL_BASE_SET::set();
326 return *this;
327 }
328
329 GAL_SET& set( int aPos, bool aVal = true )
330 {
331 GAL_BASE_SET::set( aPos, aVal );
332 return *this;
333 }
334
335 GAL_SET& set( GAL_LAYER_ID aPos, bool aVal = true )
336 {
337 GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
338 return *this;
339 }
340
342 {
343 return test( static_cast<std::size_t>( aPos ) - start );
344 }
345
346 std::vector<GAL_LAYER_ID> Seq() const;
347
348 static GAL_SET DefaultVisible();
349};
350
353{
355
403
406
407#define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
408
409#define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START )
410
412{
413 a = SCH_LAYER_ID( int( a ) + 1 );
414 return a;
415}
416
417// number of draw layers in Gerbview
418#define GERBER_DRAWLAYERS_COUNT static_cast<int>( PCB_LAYER_ID_COUNT )
419
422{
424
427
435
438
439#define GERBER_DRAW_LAYER( x ) ( GERBVIEW_LAYER_ID_START + x )
440
441#define GERBER_DCODE_LAYER( x ) ( GERBER_DRAWLAYERS_COUNT + x )
442
443#define GERBER_DRAW_LAYER_INDEX( x ) ( x - GERBVIEW_LAYER_ID_START )
444
445
447enum LAYER_3D_ID : int
448{
450
474
477
479#define LAYER_ID_COUNT LAYER_3D_END
480
481
486KICOMMON_API wxString LayerName( int aLayer );
487
488
489// Some elements do not have yet a visibility control
490// from a dialog, but have a visibility control flag.
491// Here is a mask to set them visible, to be sure they are displayed
492// after loading a board for instance
493#define MIN_VISIBILITY_MASK int( ( 1 << GAL_LAYER_INDEX( LAYER_PAD_PLATEDHOLES ) ) +\
494 ( 1 << GAL_LAYER_INDEX( LAYER_VIA_HOLES ) ) +\
495 ( 1 << GAL_LAYER_INDEX( LAYER_SELECT_OVERLAY ) ) +\
496 ( 1 << GAL_LAYER_INDEX( LAYER_GP_OVERLAY ) ) +\
497 ( 1 << GAL_LAYER_INDEX( LAYER_RATSNEST ) ) )
498
499
501typedef std::vector<PCB_LAYER_ID> BASE_SEQ;
502
503
521{
522 unsigned m_index;
523
524public:
525
527 m_index( 0 )
528 {}
529
530 template <class InputIterator>
531 LSEQ( InputIterator aStart, InputIterator aEnd ) :
532 BASE_SEQ( aStart, aEnd ), m_index( 0 )
533 {}
534
535 LSEQ( std::initializer_list<PCB_LAYER_ID> aLayers ) :
536 BASE_SEQ( aLayers ), m_index( 0 )
537 {}
538
539 void Rewind() { m_index = 0; }
540
541 void operator ++ () { ++m_index; } // returns nothing, used in simple statements only.
542
543 void operator ++ (int) { ++m_index; }
544
545 operator bool () { return m_index < size(); }
546
548 {
549 return at( m_index ); // throws std::out_of_range
550 }
551
552 int TestLayers( PCB_LAYER_ID aRhs, PCB_LAYER_ID aLhs ) const
553 {
554 if( aRhs == aLhs )
555 return 0;
556
557 auto itRhs = std::find( begin(), end(), aRhs );
558 auto itLhs = std::find( begin(), end(), aLhs );
559
560 return std::distance( itRhs, itLhs );
561 }
562};
563
564
565typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;
566
567
575{
576public:
577
578 // The constructor flavors are carefully chosen to prevent LSET( int ) from compiling.
579 // That excludes "LSET s = 0;" and excludes "LSET s = -1;", etc.
580 // LSET s = 0; needs to be removed from the code, this accomplishes that.
581 // Remember LSET( PCB_LAYER_ID(0) ) sets bit 0, so "LSET s = 0;" is illegal
582 // to prevent that surprise. Therefore LSET's constructor suite is significantly
583 // different than the base class from which it is derived.
584
585 // Other member functions (non-constructor functions) are identical to the base
586 // class's and therefore are re-used from the base class.
587
592 BASE_SET() // all bits are set to zero in BASE_SET()
593 {
594 }
595
596 LSET( const BASE_SET& aOther ) :
597 BASE_SET( aOther )
598 {
599 }
600
615 LSET( PCB_LAYER_ID aLayer ) : // PCB_LAYER_ID deliberately excludes int and relatives
616 BASE_SET()
617 {
618 set( aLayer );
619 }
620
624 LSET( const PCB_LAYER_ID* aArray, unsigned aCount );
625
637 LSET( unsigned aIdCount, int aFirst, ... ); // args chosen to prevent LSET( int ) from compiling
638
639 LSET( const LSEQ& aSeq );
640
647 bool Contains( PCB_LAYER_ID aLayer )
648 {
649 try
650 {
651 return test( aLayer );
652 }
653 catch( std::out_of_range& )
654 {
655 return false;
656 }
657 }
658
662 static const wxChar* Name( PCB_LAYER_ID aLayerId );
663
668 static LSET InternalCuMask();
669
673 static LSET FrontAssembly();
674
678 static LSET BackAssembly();
679
683 static LSET AllCuMask( int aCuLayerCount = MAX_CU_LAYERS );
684
688 static LSET ExternalCuMask();
689
693 static LSET AllNonCuMask();
694
695 static LSET AllLayersMask();
696
700 static LSET FrontTechMask();
701
706 static LSET FrontBoardTechMask();
707
711 static LSET BackTechMask();
712
717 static LSET BackBoardTechMask();
718
722 static LSET AllTechMask();
723
727 static LSET AllBoardTechMask();
728
732 static LSET FrontMask();
733
737 static LSET BackMask();
738
739 static LSET SideSpecificMask();
740
741 static LSET UserMask();
742
747 static LSET PhysicalLayersMask();
748
752 static LSET UserDefinedLayers();
753
759 static LSET ForbiddenFootprintLayers();
760
766 LSEQ CuStack() const;
767
773 LSEQ Technicals( LSET aSubToOmit = LSET() ) const;
774
776 LSEQ Users() const;
777
779 LSEQ TechAndUserUIOrder() const;
780
781 LSEQ UIOrder() const;
782
790 LSEQ Seq( const PCB_LAYER_ID* aWishListSequence, unsigned aCount ) const;
791
792 LSEQ Seq( const LSEQ& aSequence ) const;
793
800 LSEQ Seq() const;
801
809 LSEQ SeqStackupTop2Bottom( PCB_LAYER_ID aSelectedLayer = UNDEFINED_LAYER ) const;
810
815 LSEQ SeqStackupForPlotting() const;
816
820 std::string FmtHex() const;
821
829 int ParseHex( const char* aStart, int aCount );
830
834 std::string FmtBin() const;
835
840 PCB_LAYER_ID ExtractLayer() const;
841
842private:
843
845 LSET( unsigned long __val )
846 {
847 // not usable, it's private.
848 }
849};
850
851
859inline bool IsValidLayer( int aLayerId )
860{
861 return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
862}
863
870inline bool IsPcbLayer( int aLayer )
871{
872 return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
873}
874
881inline bool IsCopperLayer( int aLayerId )
882{
883 return aLayerId >= F_Cu && aLayerId <= B_Cu;
884}
885
892inline bool IsNonCopperLayer( int aLayerId )
893{
894 return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
895}
896
905inline bool IsCopperLayer( int aLayerId, bool aIncludeSyntheticCopperLayers )
906{
907 if( aIncludeSyntheticCopperLayers )
908 return !IsNonCopperLayer( aLayerId );
909 else
910 return IsCopperLayer( aLayerId );
911}
912
913inline bool IsViaPadLayer( int aLayer )
914{
915 return aLayer == LAYER_VIA_THROUGH
916 || aLayer == LAYER_VIA_MICROVIA
917 || aLayer == LAYER_VIA_BBLIND;
918}
919
920inline bool IsHoleLayer( int aLayer )
921{
922 return aLayer == LAYER_VIA_HOLES
923 || aLayer == LAYER_VIA_HOLEWALLS
924 || aLayer == LAYER_PAD_PLATEDHOLES
925 || aLayer == LAYER_PAD_HOLEWALLS
926 || aLayer == LAYER_NON_PLATEDHOLES;
927}
928
935inline bool IsUserLayer( PCB_LAYER_ID aLayerId )
936{
937 return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
938}
939
940
941/*
942 * IMPORTANT: If a layer is not a front layer that doesn't necessarily mean it's a back layer.
943 *
944 * So a layer can be:
945 * - Front
946 * - Back
947 * - Neither (internal or auxiliary)
948 *
949 * The check most frequent is for back layers, since it involves flips.
950 */
951
955inline bool IsFrontLayer( PCB_LAYER_ID aLayerId )
956{
957 switch( aLayerId )
958 {
959 case F_Cu:
960 case F_Adhes:
961 case F_Paste:
962 case F_SilkS:
963 case F_Mask:
964 case F_CrtYd:
965 case F_Fab:
966 return true;
967 default:
968 ;
969 }
970
971 return false;
972}
973
974
978inline bool IsBackLayer( PCB_LAYER_ID aLayerId )
979{
980 switch( aLayerId )
981 {
982 case B_Cu:
983 case B_Adhes:
984 case B_Paste:
985 case B_SilkS:
986 case B_Mask:
987 case B_CrtYd:
988 case B_Fab:
989 return true;
990 default:
991 return false;
992 }
993}
994
995
1005KICOMMON_API PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayerId, int aCopperLayersCount = 0 );
1006
1016KICOMMON_API LSET FlipLayerMask( LSET aMask, int aCopperLayersCount = 0 );
1017
1018
1022inline int GetNetnameLayer( int aLayer )
1023{
1024 if( IsCopperLayer( aLayer ) )
1025 return NETNAMES_LAYER_INDEX( aLayer );
1026 else if( aLayer == LAYER_PADS_TH )
1027 return LAYER_PAD_NETNAMES;
1028 else if( aLayer == LAYER_PADS_SMD_FR )
1029 return LAYER_PAD_FR_NETNAMES;
1030 else if( aLayer == LAYER_PADS_SMD_BK )
1031 return LAYER_PAD_BK_NETNAMES;
1032 else if( IsViaPadLayer( aLayer ) )
1033 return LAYER_VIA_NETNAMES;
1034
1035 // Fallback
1036 return Cmts_User;
1037}
1038
1045inline bool IsNetnameLayer( int aLayer )
1046{
1047 return aLayer >= NETNAMES_LAYER_INDEX( F_Cu ) && aLayer < NETNAMES_LAYER_ID_END;
1048}
1049
1050
1051inline bool IsZoneFillLayer( int aLayer )
1052{
1053 return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
1054}
1055
1056
1057inline bool IsDCodeLayer( int aLayer )
1058{
1060 && aLayer < ( GERBVIEW_LAYER_ID_START + ( 2 * GERBER_DRAWLAYERS_COUNT ) );
1061}
1062
1063
1070inline bool IsNetCopperLayer( int aLayer )
1071{
1072 static std::set<int> netCopperLayers =
1073 {
1082 };
1083
1084 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
1085}
1086
1087
1089
1090#endif // LAYER_IDS_H
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:307
bool Contains(GAL_LAYER_ID aPos)
Definition: layer_ids.h:341
GAL_SET()
Definition: layer_ids.h:313
GAL_SET & set()
Definition: layer_ids.h:323
GAL_SET(const GAL_SET &aOther)
Definition: layer_ids.h:317
GAL_SET & set(int aPos, bool aVal=true)
Definition: layer_ids.h:329
GAL_SET & set(GAL_LAYER_ID aPos, bool aVal=true)
Definition: layer_ids.h:335
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:521
LSEQ()
Definition: layer_ids.h:526
LSEQ(std::initializer_list< PCB_LAYER_ID > aLayers)
Definition: layer_ids.h:535
void Rewind()
Definition: layer_ids.h:539
int TestLayers(PCB_LAYER_ID aRhs, PCB_LAYER_ID aLhs) const
Definition: layer_ids.h:552
unsigned m_index
Definition: layer_ids.h:522
LSEQ(InputIterator aStart, InputIterator aEnd)
Definition: layer_ids.h:531
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:575
LSET(PCB_LAYER_ID aLayer)
Take a PCB_LAYER_ID and sets that bit.
Definition: layer_ids.h:615
LSET(const BASE_SET &aOther)
Definition: layer_ids.h:596
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
Definition: layer_ids.h:647
LSET()
Create an empty (cleared) set.
Definition: layer_ids.h:591
LSET(unsigned long __val)
Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).
Definition: layer_ids.h:845
EDA_ANGLE operator*(const EDA_ANGLE &aAngleA, double aOperator)
Definition: eda_angle.h:362
#define KICOMMON_API
Definition: kicommon.h:28
NETNAMES_LAYER_ID
Dedicated layers for net names used in Pcbnew.
Definition: layer_ids.h:157
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer)
Definition: layer_ids.h:167
@ LAYER_PAD_BK_NETNAMES
Definition: layer_ids.h:168
@ LAYER_PAD_NETNAMES
Definition: layer_ids.h:169
@ NETNAMES_LAYER_ID_START
Definition: layer_ids.h:159
@ NETNAMES_LAYER_ID_END
Definition: layer_ids.h:172
@ LAYER_VIA_NETNAMES
Definition: layer_ids.h:170
@ NETNAMES_LAYER_ID_RESERVED
Reserved space for board layer netnames.
Definition: layer_ids.h:163
std::bitset< GAL_LAYER_ID_COUNT > GAL_BASE_SET
Wraps a std::bitset.
Definition: layer_ids.h:302
GAL_LAYER_ID operator++(GAL_LAYER_ID &a)
Definition: layer_ids.h:280
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.
Definition: layer_ids.h:501
GERBVIEW_LAYER_ID
GerbView draw layers.
Definition: layer_ids.h:422
@ GERBVIEW_LAYER_ID_RESERVED
GerbView draw layers and d-code layers.
Definition: layer_ids.h:426
@ LAYER_GERBVIEW_DRAWINGSHEET
Definition: layer_ids.h:433
@ GERBVIEW_LAYER_ID_START
Definition: layer_ids.h:423
@ LAYER_GERBVIEW_BACKGROUND
Definition: layer_ids.h:432
@ LAYER_DCODES
Definition: layer_ids.h:428
@ LAYER_NEGATIVE_OBJECTS
Definition: layer_ids.h:429
@ LAYER_GERBVIEW_PAGE_LIMITS
Definition: layer_ids.h:434
@ GERBVIEW_LAYER_ID_END
Definition: layer_ids.h:436
@ LAYER_GERBVIEW_AXES
Definition: layer_ids.h:431
@ LAYER_GERBVIEW_GRID
Definition: layer_ids.h:430
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
Definition: layer_ids.h:565
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
Definition: layer_ids.h:293
KICOMMON_API LSET FlipLayerMask(LSET aMask, int aCopperLayersCount=0)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:680
bool IsPcbLayer(int aLayer)
Test whether a layer is a valid layer for Pcbnew.
Definition: layer_ids.h:870
LAYER_3D_ID
3D Viewer virtual layers for color settings
Definition: layer_ids.h:448
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:459
@ LAYER_3D_BOUNDING_BOXES
Definition: layer_ids.h:472
@ LAYER_3D_START
Definition: layer_ids.h:449
@ LAYER_3D_ADHESIVE
Definition: layer_ids.h:461
@ LAYER_3D_SMD_MODELS
Definition: layer_ids.h:467
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:452
@ LAYER_3D_USER_COMMENTS
Definition: layer_ids.h:462
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:458
@ LAYER_3D_BOARD
Definition: layer_ids.h:453
@ LAYER_3D_USER_ECO1
Definition: layer_ids.h:464
@ LAYER_3D_USER_ECO2
Definition: layer_ids.h:465
@ LAYER_3D_TH_MODELS
Definition: layer_ids.h:466
@ LAYER_3D_AXES
Definition: layer_ids.h:471
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:457
@ LAYER_3D_VIRTUAL_MODELS
Definition: layer_ids.h:468
@ LAYER_3D_MODELS_MARKED_DNP
Definition: layer_ids.h:470
@ LAYER_3D_COPPER_TOP
Definition: layer_ids.h:454
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:460
@ LAYER_3D_OFF_BOARD_SILK
Definition: layer_ids.h:473
@ LAYER_3D_MODELS_NOT_IN_POS
Definition: layer_ids.h:469
@ LAYER_3D_USER_DRAWINGS
Definition: layer_ids.h:463
@ LAYER_3D_COPPER_BOTTOM
Definition: layer_ids.h:455
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:451
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:456
@ LAYER_3D_END
Definition: layer_ids.h:475
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
Definition: layer_ids.h:935
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
Definition: layer_ids.h:140
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:176
GAL_LAYER_ID ToGalLayer(int aInteger)
Definition: layer_ids.h:286
bool IsNetCopperLayer(int aLayer)
Checks if the given layer is "net copper", meaning it is eligible for net coloring.
Definition: layer_ids.h:1070
constexpr int GAL_LAYER_ID_COUNT
Definition: layer_ids.h:278
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:955
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:149
@ ALWAYS_FLASHED
bool IsDCodeLayer(int aLayer)
Definition: layer_ids.h:1057
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:978
#define MAX_CU_LAYERS
Definition: layer_ids.h:142
KICOMMON_API PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount=0)
Definition: lset.cpp:634
bool IsNonCopperLayer(int aLayerId)
Test whether a layer is a non copper layer.
Definition: layer_ids.h:892
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:1022
KICOMMON_API wxString LayerName(int aLayer)
Returns the string equivalent of a given layer.
Definition: layer_id.cpp:30
#define GAL_UI_LAYER_COUNT
Definition: layer_ids.h:178
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:881
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:194
@ LAYER_GRID
Definition: layer_ids.h:209
@ GAL_LAYER_ID_START
Definition: layer_ids.h:195
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:253
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:243
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:238
@ LAYER_GRID_AXES
Definition: layer_ids.h:210
@ LAYER_DRAWINGSHEET_PAGEn
for drawingsheetEditor previewing
Definition: layer_ids.h:251
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:245
@ LAYER_FOOTPRINTS_FR
show footprints on front
Definition: layer_ids.h:212
@ LAYER_ZONE_END
Definition: layer_ids.h:258
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:201
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:221
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
Definition: layer_ids.h:227
@ LAYER_FP_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:215
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
Definition: layer_ids.h:240
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:224
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:235
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:234
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:239
@ LAYER_UI_START
Definition: layer_ids.h:265
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:218
@ GAL_LAYER_ID_END
Definition: layer_ids.h:268
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:222
@ 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:230
@ LAYER_HIDDEN_TEXT
text marked as invisible
Definition: layer_ids.h:204
@ LAYER_TRACKS
Definition: layer_ids.h:216
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:225
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:226
@ LAYER_RATSNEST
Definition: layer_ids.h:208
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:257
@ LAYER_FP_TEXT
Definition: layer_ids.h:202
@ LAYER_FOOTPRINTS_BK
show footprints on back
Definition: layer_ids.h:213
@ LAYER_UI_END
Definition: layer_ids.h:266
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:205
@ LAYER_DRAWINGSHEET_PAGE1
for drawingsheetEditor previewing
Definition: layer_ids.h:250
@ LAYER_PADS_SMD_BK
smd pads, back layer
Definition: layer_ids.h:207
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:217
@ LAYER_PADS_SMD_FR
smd pads, front layer
Definition: layer_ids.h:206
@ LAYER_MARKER_SHADOWS
shadows for drc markers
Definition: layer_ids.h:241
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:219
@ LAYER_FP_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:214
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:198
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:223
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:200
@ LAYER_BITMAP_END
Definition: layer_ids.h:262
@ LAYER_BITMAP_START
Virtual layers for background images per board layer.
Definition: layer_ids.h:261
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:220
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:197
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:199
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:237
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:353
@ LAYER_DANGLING
Definition: layer_ids.h:381
@ LAYER_SHEETNAME
Definition: layer_ids.h:376
@ LAYER_ERC_WARN
Definition: layer_ids.h:383
@ LAYER_SCHEMATIC_ANCHOR
Definition: layer_ids.h:400
@ LAYER_SHEETLABEL
Definition: layer_ids.h:379
@ LAYER_PINNUM
Definition: layer_ids.h:362
@ LAYER_RULE_AREAS
Definition: layer_ids.h:369
@ LAYER_DEVICE
Definition: layer_ids.h:370
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:387
@ LAYER_BRIGHTENED
Definition: layer_ids.h:393
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:385
@ LAYER_HIDDEN
Definition: layer_ids.h:394
@ LAYER_HIERLABEL
Definition: layer_ids.h:361
@ LAYER_PINNAM
Definition: layer_ids.h:363
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:372
@ LAYER_HOVERED
Definition: layer_ids.h:392
@ LAYER_GLOBLABEL
Definition: layer_ids.h:360
@ LAYER_WIRE
Definition: layer_ids.h:356
@ LAYER_NOTES
Definition: layer_ids.h:371
@ LAYER_ERC_ERR
Definition: layer_ids.h:384
@ LAYER_PIN
Definition: layer_ids.h:374
@ LAYER_VALUEPART
Definition: layer_ids.h:365
@ LAYER_BUS
Definition: layer_ids.h:357
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:391
@ SCH_LAYER_ID_END
Definition: layer_ids.h:404
@ LAYER_FIELDS
Definition: layer_ids.h:366
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:386
@ SCH_LAYER_ID_START
Definition: layer_ids.h:354
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:396
@ LAYER_LOCLABEL
Definition: layer_ids.h:359
@ LAYER_JUNCTION
Definition: layer_ids.h:358
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:378
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:389
@ LAYER_REFERENCEPART
Definition: layer_ids.h:364
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:368
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:373
@ LAYER_OP_CURRENTS
Definition: layer_ids.h:402
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:397
@ LAYER_SHEET
Definition: layer_ids.h:375
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:395
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:390
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition: layer_ids.h:399
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:367
@ LAYER_OP_VOLTAGES
Definition: layer_ids.h:401
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:377
@ LAYER_BUS_JUNCTION
Definition: layer_ids.h:398
@ LAYER_DNP_MARKER
Definition: layer_ids.h:382
@ LAYER_NOCONNECT
Definition: layer_ids.h:380
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:388
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:1045
KICOMMON_API PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:1022
bool IsHoleLayer(int aLayer)
Definition: layer_ids.h:920
bool IsViaPadLayer(int aLayer)
Definition: layer_ids.h:913
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ In22_Cu
Definition: layer_ids.h:86
@ 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:62
@ 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:61
@ 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
bool IsValidLayer(int aLayerId)
Test whether a given integer is a valid layer index, i.e.
Definition: layer_ids.h:859
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:418
bool IsZoneFillLayer(int aLayer)
Definition: layer_ids.h:1051
STL namespace.
SIM_PLOT_COLORS::COLOR_SET & operator++(SIM_PLOT_COLORS::COLOR_SET &x)