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
96 B_Cu, // 31
97
100
103
106
108 F_Mask, // 39
109
115 Margin, // 45
116
119
121 F_Fab, // 49
122
123 // User definable layers.
133
134 Rescue, // 59
135
136 // Four reserved layers (60 - 63) for future expansion within the 64 bit integer limit.
137
140
141#define MAX_CU_LAYERS (B_Cu - F_Cu + 1)
142
147enum class FLASHING
148{
149 DEFAULT, // Flashing follows connectivity
150 ALWAYS_FLASHED, // Always flashed for connectivity
151 NEVER_FLASHED, // Never flashed for connectivity
152};
153
156{
157
159
161
163
165
170
173
175#define NETNAMES_LAYER_INDEX( layer ) ( NETNAMES_LAYER_ID_START + layer )
176
177#define GAL_UI_LAYER_COUNT 10
178
193{
195
202// LAYER_MOD_TEXT_BK deprecated + 6,
210// LAYER_NO_CONNECTS deprecated + 14, ///< show a marker on pads with no nets
227
230
231 // Layers in this section have visibility controls but were not present in legacy board files.
232
235
241
243
245
246 // Add layers below this point that do not have visibility controls, so don't need explicit
247 // enum values
248
251
254
258
262
263 // Layers for drawing on-canvas UI
266
269
271#define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START )
272
274#define BITMAP_LAYER_FOR( boardLayer ) ( LAYER_BITMAP_START + boardLayer )
275#define ZONE_LAYER_FOR( boardLayer ) ( LAYER_ZONE_START + boardLayer )
276
278
280{
281 a = GAL_LAYER_ID( int( a ) + 1 );
282 return a;
283}
284
285inline GAL_LAYER_ID ToGalLayer( int aInteger )
286{
287 wxASSERT( aInteger >= GAL_LAYER_ID_START && aInteger <= GAL_LAYER_ID_END );
288 return static_cast<GAL_LAYER_ID>( aInteger );
289}
290
292inline GAL_LAYER_ID operator+( const GAL_LAYER_ID& a, int b )
293{
294 GAL_LAYER_ID t = GAL_LAYER_ID( int( a ) + b );
295 wxASSERT( t <= GAL_LAYER_ID_END );
296 return t;
297}
298
299
301typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET;
302
303
306{
307
308private:
309 static constexpr int start = static_cast<int>( GAL_LAYER_ID_START );
310
311public:
313 {
314 }
315
316 GAL_SET( const GAL_SET& aOther ) : std::bitset<GAL_LAYER_ID_COUNT>( aOther )
317 {
318 }
319
320 GAL_SET( const GAL_LAYER_ID* aArray, unsigned aCount );
321
323 {
324 GAL_BASE_SET::set();
325 return *this;
326 }
327
328 GAL_SET& set( int aPos, bool aVal = true )
329 {
330 GAL_BASE_SET::set( aPos, aVal );
331 return *this;
332 }
333
334 GAL_SET& set( GAL_LAYER_ID aPos, bool aVal = true )
335 {
336 GAL_BASE_SET::set( static_cast<std::size_t>( aPos ) - start, aVal );
337 return *this;
338 }
339
341 {
342 return test( static_cast<std::size_t>( aPos ) - start );
343 }
344
345 std::vector<GAL_LAYER_ID> Seq() const;
346
347 static GAL_SET DefaultVisible();
348};
349
352{
354
401
404
405#define SCH_LAYER_ID_COUNT ( SCH_LAYER_ID_END - SCH_LAYER_ID_START )
406
407#define SCH_LAYER_INDEX( x ) ( x - SCH_LAYER_ID_START )
408
410{
411 a = SCH_LAYER_ID( int( a ) + 1 );
412 return a;
413}
414
415// number of draw layers in Gerbview
416#define GERBER_DRAWLAYERS_COUNT PCB_LAYER_ID_COUNT
417
420{
422
425
433
436
437#define GERBER_DRAW_LAYER( x ) ( GERBVIEW_LAYER_ID_START + x )
438
439#define GERBER_DCODE_LAYER( x ) ( GERBER_DRAWLAYERS_COUNT + x )
440
441#define GERBER_DRAW_LAYER_INDEX( x ) ( x - GERBVIEW_LAYER_ID_START )
442
443
445enum LAYER_3D_ID : int
446{
448
472
475
477#define LAYER_ID_COUNT LAYER_3D_END
478
479
484KICOMMON_API wxString LayerName( int aLayer );
485
486
487// Some elements do not have yet a visibility control
488// from a dialog, but have a visibility control flag.
489// Here is a mask to set them visible, to be sure they are displayed
490// after loading a board for instance
491#define MIN_VISIBILITY_MASK int( ( 1 << GAL_LAYER_INDEX( LAYER_PAD_PLATEDHOLES ) ) +\
492 ( 1 << GAL_LAYER_INDEX( LAYER_VIA_HOLES ) ) +\
493 ( 1 << GAL_LAYER_INDEX( LAYER_SELECT_OVERLAY ) ) +\
494 ( 1 << GAL_LAYER_INDEX( LAYER_GP_OVERLAY ) ) +\
495 ( 1 << GAL_LAYER_INDEX( LAYER_RATSNEST ) ) )
496
497
499typedef std::vector<PCB_LAYER_ID> BASE_SEQ;
500
501
519{
520 unsigned m_index;
521
522public:
523
525 m_index( 0 )
526 {}
527
528 template <class InputIterator>
529 LSEQ( InputIterator aStart, InputIterator aEnd ) :
530 BASE_SEQ( aStart, aEnd ), m_index( 0 )
531 {}
532
533 LSEQ( std::initializer_list<PCB_LAYER_ID> aLayers ) :
534 BASE_SEQ( aLayers ), m_index( 0 )
535 {}
536
537 void Rewind() { m_index = 0; }
538
539 void operator ++ () { ++m_index; } // returns nothing, used in simple statements only.
540
541 void operator ++ (int) { ++m_index; }
542
543 operator bool () { return m_index < size(); }
544
546 {
547 return at( m_index ); // throws std::out_of_range
548 }
549
550 int TestLayers( PCB_LAYER_ID aRhs, PCB_LAYER_ID aLhs ) const
551 {
552 if( aRhs == aLhs )
553 return 0;
554
555 auto itRhs = std::find( begin(), end(), aRhs );
556 auto itLhs = std::find( begin(), end(), aLhs );
557
558 return std::distance( itRhs, itLhs );
559 }
560};
561
562
563typedef std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;
564
565
573{
574public:
575
576 // The constructor flavors are carefully chosen to prevent LSET( int ) from compiling.
577 // That excludes "LSET s = 0;" and excludes "LSET s = -1;", etc.
578 // LSET s = 0; needs to be removed from the code, this accomplishes that.
579 // Remember LSET( PCB_LAYER_ID(0) ) sets bit 0, so "LSET s = 0;" is illegal
580 // to prevent that surprise. Therefore LSET's constructor suite is significantly
581 // different than the base class from which it is derived.
582
583 // Other member functions (non-constructor functions) are identical to the base
584 // class's and therefore are re-used from the base class.
585
590 BASE_SET() // all bits are set to zero in BASE_SET()
591 {
592 }
593
594 LSET( const BASE_SET& aOther ) :
595 BASE_SET( aOther )
596 {
597 }
598
613 LSET( PCB_LAYER_ID aLayer ) : // PCB_LAYER_ID deliberately excludes int and relatives
614 BASE_SET()
615 {
616 set( aLayer );
617 }
618
622 LSET( const PCB_LAYER_ID* aArray, unsigned aCount );
623
635 LSET( unsigned aIdCount, int aFirst, ... ); // args chosen to prevent LSET( int ) from compiling
636
637 LSET( const LSEQ& aSeq );
638
645 bool Contains( PCB_LAYER_ID aLayer )
646 {
647 try
648 {
649 return test( aLayer );
650 }
651 catch( std::out_of_range& )
652 {
653 return false;
654 }
655 }
656
660 static const wxChar* Name( PCB_LAYER_ID aLayerId );
661
666 static LSET InternalCuMask();
667
671 static LSET FrontAssembly();
672
676 static LSET BackAssembly();
677
681 static LSET AllCuMask( int aCuLayerCount = MAX_CU_LAYERS );
682
686 static LSET ExternalCuMask();
687
691 static LSET AllNonCuMask();
692
693 static LSET AllLayersMask();
694
698 static LSET FrontTechMask();
699
704 static LSET FrontBoardTechMask();
705
709 static LSET BackTechMask();
710
715 static LSET BackBoardTechMask();
716
720 static LSET AllTechMask();
721
725 static LSET AllBoardTechMask();
726
730 static LSET FrontMask();
731
735 static LSET BackMask();
736
737 static LSET SideSpecificMask();
738
739 static LSET UserMask();
740
745 static LSET PhysicalLayersMask();
746
750 static LSET UserDefinedLayers();
751
757 static LSET ForbiddenFootprintLayers();
758
764 LSEQ CuStack() const;
765
771 LSEQ Technicals( LSET aSubToOmit = LSET() ) const;
772
774 LSEQ Users() const;
775
777 LSEQ TechAndUserUIOrder() const;
778
779 LSEQ UIOrder() const;
780
788 LSEQ Seq( const PCB_LAYER_ID* aWishListSequence, unsigned aCount ) const;
789
790 LSEQ Seq( const LSEQ& aSequence ) const;
791
798 LSEQ Seq() const;
799
807 LSEQ SeqStackupTop2Bottom( PCB_LAYER_ID aSelectedLayer = UNDEFINED_LAYER ) const;
808
813 LSEQ SeqStackupForPlotting() const;
814
818 std::string FmtHex() const;
819
827 int ParseHex( const char* aStart, int aCount );
828
832 std::string FmtBin() const;
833
838 PCB_LAYER_ID ExtractLayer() const;
839
840private:
841
843 LSET( unsigned long __val )
844 {
845 // not usable, it's private.
846 }
847};
848
849
857inline bool IsValidLayer( int aLayerId )
858{
859 return unsigned( aLayerId ) < PCB_LAYER_ID_COUNT;
860}
861
868inline bool IsPcbLayer( int aLayer )
869{
870 return aLayer >= F_Cu && aLayer < PCB_LAYER_ID_COUNT;
871}
872
879inline bool IsCopperLayer( int aLayerId )
880{
881 return aLayerId >= F_Cu && aLayerId <= B_Cu;
882}
883
890inline bool IsNonCopperLayer( int aLayerId )
891{
892 return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
893}
894
903inline bool IsCopperLayer( int aLayerId, bool aIncludeSyntheticCopperLayers )
904{
905 if( aIncludeSyntheticCopperLayers )
906 return !IsNonCopperLayer( aLayerId );
907 else
908 return IsCopperLayer( aLayerId );
909}
910
911inline bool IsViaPadLayer( int aLayer )
912{
913 return aLayer == LAYER_VIA_THROUGH
914 || aLayer == LAYER_VIA_MICROVIA
915 || aLayer == LAYER_VIA_BBLIND;
916}
917
918inline bool IsHoleLayer( int aLayer )
919{
920 return aLayer == LAYER_VIA_HOLES
921 || aLayer == LAYER_VIA_HOLEWALLS
922 || aLayer == LAYER_PAD_PLATEDHOLES
923 || aLayer == LAYER_PAD_HOLEWALLS
924 || aLayer == LAYER_NON_PLATEDHOLES;
925}
926
933inline bool IsUserLayer( PCB_LAYER_ID aLayerId )
934{
935 return aLayerId >= Dwgs_User && aLayerId <= Eco2_User;
936}
937
938
939/*
940 * IMPORTANT: If a layer is not a front layer that doesn't necessarily mean it's a back layer.
941 *
942 * So a layer can be:
943 * - Front
944 * - Back
945 * - Neither (internal or auxiliary)
946 *
947 * The check most frequent is for back layers, since it involves flips.
948 */
949
953inline bool IsFrontLayer( PCB_LAYER_ID aLayerId )
954{
955 switch( aLayerId )
956 {
957 case F_Cu:
958 case F_Adhes:
959 case F_Paste:
960 case F_SilkS:
961 case F_Mask:
962 case F_CrtYd:
963 case F_Fab:
964 return true;
965 default:
966 ;
967 }
968
969 return false;
970}
971
972
976inline bool IsBackLayer( PCB_LAYER_ID aLayerId )
977{
978 switch( aLayerId )
979 {
980 case B_Cu:
981 case B_Adhes:
982 case B_Paste:
983 case B_SilkS:
984 case B_Mask:
985 case B_CrtYd:
986 case B_Fab:
987 return true;
988 default:
989 return false;
990 }
991}
992
993
1003KICOMMON_API PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayerId, int aCopperLayersCount = 0 );
1004
1014KICOMMON_API LSET FlipLayerMask( LSET aMask, int aCopperLayersCount = 0 );
1015
1016
1020inline int GetNetnameLayer( int aLayer )
1021{
1022 if( IsCopperLayer( aLayer ) )
1023 return NETNAMES_LAYER_INDEX( aLayer );
1024 else if( aLayer == LAYER_PADS_TH )
1025 return LAYER_PAD_NETNAMES;
1026 else if( aLayer == LAYER_PADS_SMD_FR )
1027 return LAYER_PAD_FR_NETNAMES;
1028 else if( aLayer == LAYER_PADS_SMD_BK )
1029 return LAYER_PAD_BK_NETNAMES;
1030 else if( IsViaPadLayer( aLayer ) )
1031 return LAYER_VIA_NETNAMES;
1032
1033 // Fallback
1034 return Cmts_User;
1035}
1036
1043inline bool IsNetnameLayer( int aLayer )
1044{
1045 return aLayer >= NETNAMES_LAYER_INDEX( F_Cu ) && aLayer < NETNAMES_LAYER_ID_END;
1046}
1047
1048
1049inline bool IsZoneFillLayer( int aLayer )
1050{
1051 return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
1052}
1053
1054
1055inline bool IsDCodeLayer( int aLayer )
1056{
1058 && aLayer < ( GERBVIEW_LAYER_ID_START + ( 2 * GERBER_DRAWLAYERS_COUNT ) );
1059}
1060
1061
1068inline bool IsNetCopperLayer( int aLayer )
1069{
1070 static std::set<int> netCopperLayers =
1071 {
1080 };
1081
1082 return IsCopperLayer( aLayer ) || netCopperLayers.count( aLayer );
1083}
1084
1085
1087
1088#endif // LAYER_IDS_H
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:306
bool Contains(GAL_LAYER_ID aPos)
Definition: layer_ids.h:340
GAL_SET()
Definition: layer_ids.h:312
GAL_SET & set()
Definition: layer_ids.h:322
GAL_SET(const GAL_SET &aOther)
Definition: layer_ids.h:316
GAL_SET & set(int aPos, bool aVal=true)
Definition: layer_ids.h:328
GAL_SET & set(GAL_LAYER_ID aPos, bool aVal=true)
Definition: layer_ids.h:334
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:519
LSEQ()
Definition: layer_ids.h:524
LSEQ(std::initializer_list< PCB_LAYER_ID > aLayers)
Definition: layer_ids.h:533
void Rewind()
Definition: layer_ids.h:537
int TestLayers(PCB_LAYER_ID aRhs, PCB_LAYER_ID aLhs) const
Definition: layer_ids.h:550
unsigned m_index
Definition: layer_ids.h:520
LSEQ(InputIterator aStart, InputIterator aEnd)
Definition: layer_ids.h:529
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:573
LSET(PCB_LAYER_ID aLayer)
Take a PCB_LAYER_ID and sets that bit.
Definition: layer_ids.h:613
LSET(const BASE_SET &aOther)
Definition: layer_ids.h:594
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
Definition: layer_ids.h:645
LSET()
Create an empty (cleared) set.
Definition: layer_ids.h:589
LSET(unsigned long __val)
Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).
Definition: layer_ids.h:843
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:156
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer)
Definition: layer_ids.h:166
@ LAYER_PAD_BK_NETNAMES
Definition: layer_ids.h:167
@ LAYER_PAD_NETNAMES
Definition: layer_ids.h:168
@ NETNAMES_LAYER_ID_START
Definition: layer_ids.h:158
@ NETNAMES_LAYER_ID_END
Definition: layer_ids.h:171
@ LAYER_VIA_NETNAMES
Definition: layer_ids.h:169
@ NETNAMES_LAYER_ID_RESERVED
Reserved space for board layer netnames.
Definition: layer_ids.h:162
std::bitset< GAL_LAYER_ID_COUNT > GAL_BASE_SET
Wraps a std::bitset.
Definition: layer_ids.h:301
GAL_LAYER_ID operator++(GAL_LAYER_ID &a)
Definition: layer_ids.h:279
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.
Definition: layer_ids.h:499
GERBVIEW_LAYER_ID
GerbView draw layers.
Definition: layer_ids.h:420
@ GERBVIEW_LAYER_ID_RESERVED
GerbView draw layers and d-code layers.
Definition: layer_ids.h:424
@ LAYER_GERBVIEW_DRAWINGSHEET
Definition: layer_ids.h:431
@ GERBVIEW_LAYER_ID_START
Definition: layer_ids.h:421
@ LAYER_GERBVIEW_BACKGROUND
Definition: layer_ids.h:430
@ LAYER_DCODES
Definition: layer_ids.h:426
@ LAYER_NEGATIVE_OBJECTS
Definition: layer_ids.h:427
@ LAYER_GERBVIEW_PAGE_LIMITS
Definition: layer_ids.h:432
@ GERBVIEW_LAYER_ID_END
Definition: layer_ids.h:434
@ LAYER_GERBVIEW_AXES
Definition: layer_ids.h:429
@ LAYER_GERBVIEW_GRID
Definition: layer_ids.h:428
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
Definition: layer_ids.h:563
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
Definition: layer_ids.h:292
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:868
LAYER_3D_ID
3D Viewer virtual layers for color settings
Definition: layer_ids.h:446
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:457
@ LAYER_3D_BOUNDING_BOXES
Definition: layer_ids.h:470
@ LAYER_3D_START
Definition: layer_ids.h:447
@ LAYER_3D_ADHESIVE
Definition: layer_ids.h:459
@ LAYER_3D_SMD_MODELS
Definition: layer_ids.h:465
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:450
@ LAYER_3D_USER_COMMENTS
Definition: layer_ids.h:460
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:456
@ LAYER_3D_BOARD
Definition: layer_ids.h:451
@ LAYER_3D_USER_ECO1
Definition: layer_ids.h:462
@ LAYER_3D_USER_ECO2
Definition: layer_ids.h:463
@ LAYER_3D_TH_MODELS
Definition: layer_ids.h:464
@ LAYER_3D_AXES
Definition: layer_ids.h:469
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:455
@ LAYER_3D_VIRTUAL_MODELS
Definition: layer_ids.h:466
@ LAYER_3D_MODELS_MARKED_DNP
Definition: layer_ids.h:468
@ LAYER_3D_COPPER_TOP
Definition: layer_ids.h:452
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:458
@ LAYER_3D_OFF_BOARD_SILK
Definition: layer_ids.h:471
@ LAYER_3D_MODELS_NOT_IN_POS
Definition: layer_ids.h:467
@ LAYER_3D_USER_DRAWINGS
Definition: layer_ids.h:461
@ LAYER_3D_COPPER_BOTTOM
Definition: layer_ids.h:453
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:449
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:454
@ LAYER_3D_END
Definition: layer_ids.h:473
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
Definition: layer_ids.h:933
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:175
GAL_LAYER_ID ToGalLayer(int aInteger)
Definition: layer_ids.h:285
bool IsNetCopperLayer(int aLayer)
Checks if the given layer is "net copper", meaning it is eligible for net coloring.
Definition: layer_ids.h:1068
constexpr int GAL_LAYER_ID_COUNT
Definition: layer_ids.h:277
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:953
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:148
@ ALWAYS_FLASHED
bool IsDCodeLayer(int aLayer)
Definition: layer_ids.h:1055
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:976
#define MAX_CU_LAYERS
Definition: layer_ids.h:141
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:890
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:1020
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:177
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:879
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:193
@ LAYER_GRID
Definition: layer_ids.h:208
@ GAL_LAYER_ID_START
Definition: layer_ids.h:194
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:252
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:242
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:237
@ LAYER_GRID_AXES
Definition: layer_ids.h:209
@ LAYER_DRAWINGSHEET_PAGEn
for drawingsheetEditor previewing
Definition: layer_ids.h:250
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:244
@ LAYER_FOOTPRINTS_FR
show footprints on front
Definition: layer_ids.h:211
@ LAYER_ZONE_END
Definition: layer_ids.h:257
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:200
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:220
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
Definition: layer_ids.h:226
@ LAYER_FP_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:214
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
Definition: layer_ids.h:239
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:223
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:234
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:233
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:238
@ LAYER_UI_START
Definition: layer_ids.h:264
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:217
@ GAL_LAYER_ID_END
Definition: layer_ids.h:267
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:221
@ 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:229
@ LAYER_HIDDEN_TEXT
text marked as invisible
Definition: layer_ids.h:203
@ LAYER_TRACKS
Definition: layer_ids.h:215
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:224
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:225
@ LAYER_RATSNEST
Definition: layer_ids.h:207
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:256
@ LAYER_FP_TEXT
Definition: layer_ids.h:201
@ LAYER_FOOTPRINTS_BK
show footprints on back
Definition: layer_ids.h:212
@ LAYER_UI_END
Definition: layer_ids.h:265
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:204
@ LAYER_DRAWINGSHEET_PAGE1
for drawingsheetEditor previewing
Definition: layer_ids.h:249
@ LAYER_PADS_SMD_BK
smd pads, back layer
Definition: layer_ids.h:206
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:216
@ LAYER_PADS_SMD_FR
smd pads, front layer
Definition: layer_ids.h:205
@ LAYER_MARKER_SHADOWS
shadows for drc markers
Definition: layer_ids.h:240
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:218
@ LAYER_FP_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:213
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:197
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:222
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:199
@ LAYER_BITMAP_END
Definition: layer_ids.h:261
@ LAYER_BITMAP_START
Virtual layers for background images per board layer.
Definition: layer_ids.h:260
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:219
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:196
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:198
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:236
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:352
@ LAYER_DANGLING
Definition: layer_ids.h:379
@ LAYER_SHEETNAME
Definition: layer_ids.h:374
@ LAYER_ERC_WARN
Definition: layer_ids.h:381
@ LAYER_SCHEMATIC_ANCHOR
Definition: layer_ids.h:398
@ LAYER_SHEETLABEL
Definition: layer_ids.h:377
@ LAYER_PINNUM
Definition: layer_ids.h:361
@ LAYER_DEVICE
Definition: layer_ids.h:368
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:385
@ LAYER_BRIGHTENED
Definition: layer_ids.h:391
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:383
@ LAYER_HIDDEN
Definition: layer_ids.h:392
@ LAYER_HIERLABEL
Definition: layer_ids.h:360
@ LAYER_PINNAM
Definition: layer_ids.h:362
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:370
@ LAYER_HOVERED
Definition: layer_ids.h:390
@ LAYER_GLOBLABEL
Definition: layer_ids.h:359
@ LAYER_WIRE
Definition: layer_ids.h:355
@ LAYER_NOTES
Definition: layer_ids.h:369
@ LAYER_ERC_ERR
Definition: layer_ids.h:382
@ LAYER_PIN
Definition: layer_ids.h:372
@ LAYER_VALUEPART
Definition: layer_ids.h:364
@ LAYER_BUS
Definition: layer_ids.h:356
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:389
@ SCH_LAYER_ID_END
Definition: layer_ids.h:402
@ LAYER_FIELDS
Definition: layer_ids.h:365
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:384
@ SCH_LAYER_ID_START
Definition: layer_ids.h:353
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:394
@ LAYER_LOCLABEL
Definition: layer_ids.h:358
@ LAYER_JUNCTION
Definition: layer_ids.h:357
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:376
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:387
@ LAYER_REFERENCEPART
Definition: layer_ids.h:363
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:367
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:371
@ LAYER_OP_CURRENTS
Definition: layer_ids.h:400
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:395
@ LAYER_SHEET
Definition: layer_ids.h:373
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:393
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:388
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition: layer_ids.h:397
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:366
@ LAYER_OP_VOLTAGES
Definition: layer_ids.h:399
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:375
@ LAYER_BUS_JUNCTION
Definition: layer_ids.h:396
@ LAYER_DNP_MARKER
Definition: layer_ids.h:380
@ LAYER_NOCONNECT
Definition: layer_ids.h:378
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:386
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:1043
KICOMMON_API PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:1022
bool IsHoleLayer(int aLayer)
Definition: layer_ids.h:918
bool IsViaPadLayer(int aLayer)
Definition: layer_ids.h:911
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ In22_Cu
Definition: layer_ids.h:87
@ PCBNEW_LAYER_ID_START
Definition: layer_ids.h:64
@ In11_Cu
Definition: layer_ids.h:76
@ In29_Cu
Definition: layer_ids.h:94
@ In30_Cu
Definition: layer_ids.h:95
@ User_8
Definition: layer_ids.h:131
@ F_CrtYd
Definition: layer_ids.h:118
@ In17_Cu
Definition: layer_ids.h:82
@ B_Adhes
Definition: layer_ids.h:98
@ Edge_Cuts
Definition: layer_ids.h:114
@ Dwgs_User
Definition: layer_ids.h:110
@ F_Paste
Definition: layer_ids.h:102
@ In9_Cu
Definition: layer_ids.h:74
@ Cmts_User
Definition: layer_ids.h:111
@ User_6
Definition: layer_ids.h:129
@ User_7
Definition: layer_ids.h:130
@ In19_Cu
Definition: layer_ids.h:84
@ In7_Cu
Definition: layer_ids.h:72
@ In28_Cu
Definition: layer_ids.h:93
@ In26_Cu
Definition: layer_ids.h:91
@ F_Adhes
Definition: layer_ids.h:99
@ B_Mask
Definition: layer_ids.h:107
@ B_Cu
Definition: layer_ids.h:96
@ User_5
Definition: layer_ids.h:128
@ Eco1_User
Definition: layer_ids.h:112
@ F_Mask
Definition: layer_ids.h:108
@ In21_Cu
Definition: layer_ids.h:86
@ In23_Cu
Definition: layer_ids.h:88
@ B_Paste
Definition: layer_ids.h:101
@ In15_Cu
Definition: layer_ids.h:80
@ In2_Cu
Definition: layer_ids.h:67
@ User_9
Definition: layer_ids.h:132
@ UNSELECTED_LAYER
Definition: layer_ids.h:62
@ F_Fab
Definition: layer_ids.h:121
@ In10_Cu
Definition: layer_ids.h:75
@ Margin
Definition: layer_ids.h:115
@ F_SilkS
Definition: layer_ids.h:105
@ In4_Cu
Definition: layer_ids.h:69
@ B_CrtYd
Definition: layer_ids.h:117
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
@ Eco2_User
Definition: layer_ids.h:113
@ In16_Cu
Definition: layer_ids.h:81
@ In24_Cu
Definition: layer_ids.h:89
@ In1_Cu
Definition: layer_ids.h:66
@ Rescue
Definition: layer_ids.h:134
@ User_3
Definition: layer_ids.h:126
@ User_1
Definition: layer_ids.h:124
@ B_SilkS
Definition: layer_ids.h:104
@ In13_Cu
Definition: layer_ids.h:78
@ User_4
Definition: layer_ids.h:127
@ In8_Cu
Definition: layer_ids.h:73
@ In14_Cu
Definition: layer_ids.h:79
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:138
@ User_2
Definition: layer_ids.h:125
@ In12_Cu
Definition: layer_ids.h:77
@ In27_Cu
Definition: layer_ids.h:92
@ In6_Cu
Definition: layer_ids.h:71
@ In5_Cu
Definition: layer_ids.h:70
@ In3_Cu
Definition: layer_ids.h:68
@ In20_Cu
Definition: layer_ids.h:85
@ F_Cu
Definition: layer_ids.h:65
@ In18_Cu
Definition: layer_ids.h:83
@ In25_Cu
Definition: layer_ids.h:90
@ B_Fab
Definition: layer_ids.h:120
bool IsValidLayer(int aLayerId)
Test whether a given integer is a valid layer index, i.e.
Definition: layer_ids.h:857
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:416
bool IsZoneFillLayer(int aLayer)
Definition: layer_ids.h:1049
STL namespace.
SIM_PLOT_COLORS::COLOR_SET & operator++(SIM_PLOT_COLORS::COLOR_SET &x)