KiCad PCB EDA Suite
LSET Class Reference

LSET is a set of PCB_LAYER_IDs. More...

#include <layers_id_colors_and_visibility.h>

Inheritance diagram for LSET:

Public Member Functions

 LSET ()
 Create an empty (cleared) set. More...
 
 LSET (const BASE_SET &aOther)
 
 LSET (PCB_LAYER_ID aLayer)
 Take a PCB_LAYER_ID and sets that bit. More...
 
 LSET (const PCB_LAYER_ID *aArray, unsigned aCount)
 Create an array or LSEQ. More...
 
 LSET (unsigned aIdCount, int aFirst,...)
 Take one or more PCB_LAYER_IDs in the argument list to construct the set. More...
 
bool Contains (PCB_LAYER_ID aLayer)
 See if the layer set contains a PCB layer. More...
 
LSEQ CuStack () const
 Return a sequence of copper layers in starting from the front/top and extending to the back/bottom. More...
 
LSEQ Technicals (LSET aSubToOmit=LSET()) const
 Return a sequence of technical layers. More...
 
LSEQ Users () const
 *_User layers. More...
 
LSEQ TechAndUserUIOrder () const
 Returns the technical and user layers in the order shown in layer widget. More...
 
LSEQ UIOrder () const
 
LSEQ Seq (const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
 Return an LSEQ from the union of this LSET and a desired sequence. More...
 
LSEQ Seq () const
 Return a LSEQ from this LSET in ascending PCB_LAYER_ID order. More...
 
LSEQ SeqStackupBottom2Top () const
 Return the sequence that is typical for a bottom-to-top stack-up. More...
 
std::string FmtHex () const
 Return a hex string showing contents of this LSEQ. More...
 
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. More...
 
std::string FmtBin () const
 Return a binary string showing contents of this LSEQ. More...
 
PCB_LAYER_ID ExtractLayer () const
 Find the first set PCB_LAYER_ID. More...
 

Static Public Member Functions

static const wxChar * Name (PCB_LAYER_ID aLayerId)
 Return the fixed name association with aLayerId. More...
 
static LSET InternalCuMask ()
 Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu. More...
 
static LSET FrontAssembly ()
 Return a complete set of all top assembly layers which is all F_SilkS and F_Mask. More...
 
static LSET BackAssembly ()
 Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask. More...
 
static LSET AllCuMask (int aCuLayerCount=MAX_CU_LAYERS)
 Return a mask holding the requested number of Cu PCB_LAYER_IDs. More...
 
static LSET ExternalCuMask ()
 Return a mask holding the Front and Bottom layers. More...
 
static LSET AllNonCuMask ()
 Return a mask holding all layer minus CU layers. More...
 
static LSET AllLayersMask ()
 
static LSET FrontTechMask ()
 Return a mask holding all technical layers (no CU layer) on front side. More...
 
static LSET FrontBoardTechMask ()
 Return a mask holding technical layers used in a board fabrication (no CU layer) on front side. More...
 
static LSET BackTechMask ()
 Return a mask holding all technical layers (no CU layer) on back side. More...
 
static LSET BackBoardTechMask ()
 Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side. More...
 
static LSET AllTechMask ()
 Return a mask holding all technical layers (no CU layer) on both side. More...
 
static LSET AllBoardTechMask ()
 Return a mask holding board technical layers (no CU layer) on both side. More...
 
static LSET FrontMask ()
 Return a mask holding all technical layers and the external CU layer on front side. More...
 
static LSET BackMask ()
 Return a mask holding all technical layers and the external CU layer on back side. More...
 
static LSET UserMask ()
 
static LSET UserDefinedLayers ()
 Return a mask with all of the allowable user defined layers. More...
 
static LSET ForbiddenFootprintLayers ()
 Layers which are not allowed within footprint definitions. More...
 
static LSET ForbiddenTextLayers ()
 Layers which are allowed to have text on them. More...
 

Private Member Functions

 LSET (unsigned long __val)
 Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ). More...
 

Detailed Description

LSET is a set of PCB_LAYER_IDs.

It can be converted to numerous purpose LSEQs using the various member functions, most of which are based on Seq(). The advantage of converting to LSEQ using purposeful code, is it removes any dependency on order/sequence inherent in this set.

Definition at line 490 of file layers_id_colors_and_visibility.h.

Constructor & Destructor Documentation

◆ LSET() [1/6]

LSET::LSET ( )
inline

Create an empty (cleared) set.

Definition at line 507 of file layers_id_colors_and_visibility.h.

507  :
508  BASE_SET() // all bits are set to zero in BASE_SET()
509  {
510  }
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET

Referenced by AllLayersMask(), and AllNonCuMask().

◆ LSET() [2/6]

LSET::LSET ( const BASE_SET aOther)
inline

Definition at line 512 of file layers_id_colors_and_visibility.h.

512  :
513  BASE_SET( aOther )
514  {
515  }
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET

◆ LSET() [3/6]

LSET::LSET ( PCB_LAYER_ID  aLayer)
inline

Take a PCB_LAYER_ID and sets that bit.

This makes the following code into a bug:

LSET s = 0;

Instead use:

LSET s;

for an empty set.

Definition at line 531 of file layers_id_colors_and_visibility.h.

531  : // PCB_LAYER_ID deliberately excludes int and relatives
532  BASE_SET()
533  {
534  set( aLayer );
535  }
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET

◆ LSET() [4/6]

LSET::LSET ( const PCB_LAYER_ID aArray,
unsigned  aCount 
)

Create an array or LSEQ.

Definition at line 38 of file lset.cpp.

38  :
39  BASE_SET()
40 {
41  for( unsigned i=0; i<aCount; ++i )
42  set( aArray[i] );
43 }
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET

◆ LSET() [5/6]

LSET::LSET ( unsigned  aIdCount,
int  aFirst,
  ... 
)

Take one or more PCB_LAYER_IDs in the argument list to construct the set.

Typically only used in static construction.

Parameters
aIdCountis the number of PCB_LAYER_IDs which follow.
aFirstis the first included in aIdCount and must always be present, and can be followed by any number of additional PCB_LAYER_IDs so long as aIdCount accurately reflects the count.

Parameter is 'int' to avoid va_start undefined behavior.

Definition at line 46 of file lset.cpp.

46  :
47  BASE_SET()
48 {
49  // The constructor, without the mandatory aFirst argument, could have been confused
50  // by the compiler with the LSET( PCB_LAYER_ID ). With aFirst, that ambiguity is not
51  // present. Therefore aIdCount must always be >=1.
52  wxASSERT_MSG( aIdCount > 0, wxT( "aIdCount must be >= 1" ) );
53 
54  set( aFirst );
55 
56  if( --aIdCount )
57  {
58  va_list ap;
59 
60  va_start( ap, aFirst );
61 
62  for( unsigned i=0; i<aIdCount; ++i )
63  {
64  PCB_LAYER_ID id = (PCB_LAYER_ID) va_arg( ap, int );
65 
66  assert( unsigned( id ) < PCB_LAYER_ID_COUNT );
67 
68  set( id );
69  }
70 
71  va_end( ap );
72  }
73 }
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
PCB_LAYER_ID
A quick note on layer IDs:

References PCB_LAYER_ID_COUNT.

◆ LSET() [6/6]

LSET::LSET ( unsigned long  __val)
inlineprivate

Take this off the market, it may not be used because of LSET( PCB_LAYER_ID ).

Definition at line 738 of file layers_id_colors_and_visibility.h.

739  {
740  // not usable, it's private.
741  }

Member Function Documentation

◆ AllBoardTechMask()

LSET LSET::AllBoardTechMask ( )
static

Return a mask holding board technical layers (no CU layer) on both side.

Definition at line 826 of file lset.cpp.

827 {
828  static const LSET saved = BackBoardTechMask() | FrontBoardTechMask();
829  return saved;
830 }
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
Definition: lset.cpp:812
LSET is a set of PCB_LAYER_IDs.
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
Definition: lset.cpp:799

References BackBoardTechMask(), and FrontBoardTechMask().

◆ AllCuMask()

LSET LSET::AllCuMask ( int  aCuLayerCount = MAX_CU_LAYERS)
static

Return a mask holding the requested number of Cu PCB_LAYER_IDs.

Definition at line 749 of file lset.cpp.

750 {
751  // retain all in static as the full set, which is a common case.
752  static const LSET all = InternalCuMask().set( F_Cu ).set( B_Cu );
753 
754  if( aCuLayerCount == MAX_CU_LAYERS )
755  return all;
756 
757  // subtract out some Cu layers not wanted in the mask.
758  LSET ret = all;
759  int clear_count = MAX_CU_LAYERS - aCuLayerCount;
760 
761  clear_count = Clamp( 0, clear_count, MAX_CU_LAYERS - 2 );
762 
763  for( LAYER_NUM elem=In30_Cu; clear_count; --elem, --clear_count )
764  {
765  ret.set( elem, false );
766  }
767 
768  return ret;
769 }
LSET is a set of PCB_LAYER_IDs.
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:709
int LAYER_NUM
This can be replaced with int and removed.
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: util.h:46

References B_Cu, Clamp(), F_Cu, In30_Cu, InternalCuMask(), and MAX_CU_LAYERS.

Referenced by PCAD2KICAD::PCB_PAD::AddToModule(), AllNonCuMask(), DIALOG_PLOT::applyPlotSettings(), TRACKS_CLEANER::cleanupVias(), HYPERLYNX_EXPORTER::collectNetObjects(), compute_layer_Zs(), compute_pad_access_code(), BOARD_ADAPTER::createLayers(), ZONE_CREATE_HELPER::createNewZone(), DIALOG_EXPORT_SVG::CreateSVGFile(), PANEL_SETUP_LAYERS::DenyChangeCheckBox(), DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc(), fmt_mask(), PCB_IO::formatLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet(), VIA::GetLayerSet(), BOARD::GetPad(), HYPERLYNX_PAD_STACK::getSMDLayer(), D_PAD::GetSolderMaskMargin(), D_PAD::GetSolderPasteMargin(), MODULE::GetUniquePadCount(), PCB_INSPECTION_TOOL::highlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK(), PCB_PARSER::init(), D_PAD::IsAperturePad(), HYPERLYNX_PAD_STACK::isEmpty(), ZONE_CONTAINER::IsOnCopperLayer(), D_PAD::IsOnCopperLayer(), DSN::isRoundKeepout(), BOARD_ITEM::LayerMaskDescribe(), LEGACY_PLUGIN::leg_mask2new(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), DIALOG_PLOT::OnPopUpLayers(), PCB_LAYER_WIDGET::onPopupSelection(), PANEL_SETUP_LAYERS::OnPresetsChoice(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_PAD_PROPERTIES::OnUpdateUINonCopperWarning(), ROUTER_TOOL::onViaCommand(), EAGLE_PLUGIN::packageHole(), EAGLE_PLUGIN::packagePad(), PCB_PLOT_PARAMS_PARSER::Parse(), DRC_RULES_PARSER::parseLayer(), GPCB_FPL_CACHE::parseMODULE(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), PCB_PLOT_PARAMS::PCB_PLOT_PARAMS(), DIALOG_PLOT::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotPad(), PlotStandardLayer(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run(), BOARD_DESIGN_SETTINGS::SetCopperLayerCount(), BOARD_DESIGN_SETTINGS::SetEnabledLayers(), setKeepoutSettingsToZone(), ZONE_CONTAINER::SetLayerSet(), DIALOG_PAD_PROPERTIES::setPadLayersList(), ZONE_SETTINGS::SetupLayersList(), PCBNEW_PRINTOUT::setupViewLayers(), PANEL_SETUP_LAYERS::showLayerTypes(), D_PAD::StandardMask(), PNS_KICAD_IFACE_BASE::syncPad(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DIALOG_SWAP_LAYERS::TransferDataFromWindow(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), DIALOG_SWAP_LAYERS::TransferDataToWindow(), KIGFX::RATSNEST_VIEWITEM::ViewDraw(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ AllLayersMask()

◆ AllNonCuMask()

LSET LSET::AllNonCuMask ( )
static

Return a mask holding all layer minus CU layers.

Definition at line 772 of file lset.cpp.

773 {
774  static const LSET saved = LSET().set() & ~AllCuMask();
775  return saved;
776 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:749
LSET is a set of PCB_LAYER_IDs.
LSET()
Create an empty (cleared) set.

References AllCuMask(), and LSET().

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildFilterLists(), BOARD_ADAPTER::createLayers(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PCB_LAYER_WIDGET::onPopupSelection(), ROUTER_TOOL::onViaCommand(), CONVERT_TOOL::PolyToLines(), ZONE_SETTINGS::SetupLayersList(), and DIALOG_SWAP_LAYERS::TransferDataToWindow().

◆ AllTechMask()

LSET LSET::AllTechMask ( )
static

Return a mask holding all technical layers (no CU layer) on both side.

Definition at line 819 of file lset.cpp.

820 {
821  static const LSET saved = BackTechMask() | FrontTechMask();
822  return saved;
823 }
static LSET BackTechMask()
Return a mask holding all technical layers (no CU layer) on back side.
Definition: lset.cpp:793
static LSET FrontTechMask()
Return a mask holding all technical layers (no CU layer) on front side.
Definition: lset.cpp:805
LSET is a set of PCB_LAYER_IDs.

References BackTechMask(), and FrontTechMask().

Referenced by PCB_LAYER_WIDGET::isLayerAllowedInFpMode(), BOARD_ITEM::LayerMaskDescribe(), DIALOG_FOOTPRINT_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAddField(), DIALOG_PLOT::OnPopUpLayers(), and test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run().

◆ BackAssembly()

LSET LSET::BackAssembly ( )
static

Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask.

Definition at line 695 of file lset.cpp.

696 {
697  static const PCB_LAYER_ID back_assembly[] = {
698  B_SilkS,
699  B_Mask,
700  B_Fab,
701  B_CrtYd
702  };
703 
704  static const LSET saved( back_assembly, arrayDim( back_assembly ) );
705  return saved;
706 }
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), B_CrtYd, B_Fab, B_Mask, and B_SilkS.

Referenced by PCB_LAYER_WIDGET::onPopupSelection().

◆ BackBoardTechMask()

LSET LSET::BackBoardTechMask ( )
static

Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.

Definition at line 799 of file lset.cpp.

800 {
801  static const LSET saved( 4, B_SilkS, B_Mask, B_Adhes, B_Paste );
802  return saved;
803 }
LSET is a set of PCB_LAYER_IDs.

References B_Adhes, B_Mask, B_Paste, and B_SilkS.

Referenced by AllBoardTechMask().

◆ BackMask()

LSET LSET::BackMask ( )
static

Return a mask holding all technical layers and the external CU layer on back side.

Definition at line 873 of file lset.cpp.

874 {
875  static const LSET saved = BackTechMask().set( B_Cu );
876  return saved;
877 }
static LSET BackTechMask()
Return a mask holding all technical layers (no CU layer) on back side.
Definition: lset.cpp:793
LSET is a set of PCB_LAYER_IDs.

References B_Cu, and BackTechMask().

Referenced by PCB_LAYER_WIDGET::onPopupSelection().

◆ BackTechMask()

LSET LSET::BackTechMask ( )
static

Return a mask holding all technical layers (no CU layer) on back side.

Definition at line 793 of file lset.cpp.

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, and B_SilkS.

Referenced by AllTechMask(), and BackMask().

◆ Contains()

bool LSET::Contains ( PCB_LAYER_ID  aLayer)
inline

See if the layer set contains a PCB layer.

Parameters
aLayeris the layer to check
Returns
true if the layer is included

Definition at line 561 of file layers_id_colors_and_visibility.h.

562  {
563  return test( aLayer );
564  }

Referenced by ZONE_CREATE_HELPER::commitZone(), APPEARANCE_CONTROLS::doApplyLayerPreset(), ZONE_FILLER::Fill(), and PCB_LAYER_WIDGET::onPopupSelection().

◆ CuStack()

LSEQ LSET::CuStack ( ) const

Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.

This specific sequence is depended upon in numerous places.

Definition at line 169 of file lset.cpp.

170 {
171  // desired sequence
172  static const PCB_LAYER_ID sequence[] = {
173  F_Cu,
174  In1_Cu,
175  In2_Cu,
176  In3_Cu,
177  In4_Cu,
178  In5_Cu,
179  In6_Cu,
180  In7_Cu,
181  In8_Cu,
182  In9_Cu,
183  In10_Cu,
184  In11_Cu,
185  In12_Cu,
186  In13_Cu,
187  In14_Cu,
188  In15_Cu,
189  In16_Cu,
190  In17_Cu,
191  In18_Cu,
192  In19_Cu,
193  In20_Cu,
194  In21_Cu,
195  In22_Cu,
196  In23_Cu,
197  In24_Cu,
198  In25_Cu,
199  In26_Cu,
200  In27_Cu,
201  In28_Cu,
202  In29_Cu,
203  In30_Cu,
204  B_Cu, // 31
205  };
206 
207  return Seq( sequence, arrayDim( sequence ) );
208 }
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
Definition: lset.cpp:444
PCB_LAYER_ID
A quick note on layer IDs:
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), B_Cu, F_Cu, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, and Seq().

Referenced by PCB_IO::formatBoardLayers(), APPEARANCE_CONTROLS::rebuildLayers(), PCB_LAYER_WIDGET::ReFill(), UIOrder(), and HYPERLYNX_EXPORTER::writeStackupInfo().

◆ ExternalCuMask()

LSET LSET::ExternalCuMask ( )
static

Return a mask holding the Front and Bottom layers.

Definition at line 779 of file lset.cpp.

780 {
781  static const LSET saved( 2, F_Cu, B_Cu );
782  return saved;
783 }
LSET is a set of PCB_LAYER_IDs.

References B_Cu, and F_Cu.

Referenced by DRC_RULES_PARSER::parseLayer(), BRDITEMS_PLOTTER::PlotPad(), PANEL_SETUP_BOARD_STACKUP::showOnlyActiveLayers(), and BOARD_STACKUP::StackupAllowedBrdLayers().

◆ ExtractLayer()

PCB_LAYER_ID LSET::ExtractLayer ( ) const

Find the first set PCB_LAYER_ID.

Returns UNDEFINED_LAYER if more than one is set or UNSELECTED_LAYER if none is set.

Definition at line 660 of file lset.cpp.

661 {
662  unsigned set_count = count();
663 
664  if( !set_count )
665  return UNSELECTED_LAYER;
666  else if( set_count > 1 )
667  return UNDEFINED_LAYER;
668 
669  for( unsigned i=0; i < size(); ++i )
670  {
671  if( test( i ) )
672  return PCB_LAYER_ID( i );
673  }
674 
675  wxASSERT( 0 ); // set_count was verified as 1 above, what did you break?
676 
677  return UNDEFINED_LAYER;
678 }
PCB_LAYER_ID
A quick note on layer IDs:

References UNDEFINED_LAYER, and UNSELECTED_LAYER.

Referenced by PCBNEW_PRINTOUT::OnPrintPage().

◆ FmtBin()

std::string LSET::FmtBin ( ) const

Return a binary string showing contents of this LSEQ.

Definition at line 296 of file lset.cpp.

297 {
298  std::string ret;
299 
300  int bit_count = size();
301 
302  for( int bit=0; bit<bit_count; ++bit )
303  {
304  if( bit )
305  {
306  if( !( bit % 8 ) )
307  ret += '|';
308  else if( !( bit % 4 ) )
309  ret += '_';
310  }
311 
312  ret += (*this)[bit] ? '1' : '0';
313  }
314 
315  // reverse of string
316  return std::string( ret.rbegin(), ret.rend() );
317 }

Referenced by ViaSort().

◆ FmtHex()

std::string LSET::FmtHex ( ) const

Return a hex string showing contents of this LSEQ.

Definition at line 320 of file lset.cpp.

321 {
322  std::string ret;
323 
324  static const char hex[] = "0123456789abcdef";
325 
326  size_t nibble_count = ( size() + 3 ) / 4;
327 
328  for( size_t nibble = 0; nibble < nibble_count; ++nibble )
329  {
330  unsigned int ndx = 0;
331 
332  // test 4 consecutive bits and set ndx to 0-15
333  for( size_t nibble_bit = 0; nibble_bit < 4; ++nibble_bit )
334  {
335  size_t nibble_pos = nibble_bit + ( nibble * 4 );
336  // make sure it's not extra bits that don't exist in the bitset but need to in the
337  // hex format
338  if( nibble_pos >= size() )
339  break;
340 
341  if( ( *this )[nibble_pos] )
342  ndx |= ( 1 << nibble_bit );
343  }
344 
345  if( nibble && !( nibble % 8 ) )
346  ret += '_';
347 
348  assert( ndx < arrayDim( hex ) );
349 
350  ret += hex[ndx];
351  }
352 
353  // reverse of string
354  return std::string( ret.rbegin(), ret.rend() );
355 }
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim().

Referenced by PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS().

◆ ForbiddenFootprintLayers()

LSET LSET::ForbiddenFootprintLayers ( )
static

Layers which are not allowed within footprint definitions.

Currently internal copper layers, Edge.Cuts and Margin.

Definition at line 880 of file lset.cpp.

881 {
882  static const LSET saved = InternalCuMask().set( Edge_Cuts ).set( Margin );
883  return saved;
884 }
LSET is a set of PCB_LAYER_IDs.
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:709

References Edge_Cuts, InternalCuMask(), and Margin.

Referenced by DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), APPEARANCE_CONTROLS::onLayerClick(), PCB_LAYER_WIDGET::OnLayerSelect(), APPEARANCE_CONTROLS::rebuildLayers(), FOOTPRINT_EDIT_FRAME::ReCreateHToolbar(), and PCB_LAYER_WIDGET::ReFill().

◆ ForbiddenTextLayers()

LSET LSET::ForbiddenTextLayers ( )
static

Layers which are allowed to have text on them.

Currently Edge.Cuts and Margin.

Definition at line 887 of file lset.cpp.

888 {
889  static const LSET saved( 1, Edge_Cuts );
890  return saved;
891 }
LSET is a set of PCB_LAYER_IDs.

References Edge_Cuts.

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), PANEL_MODEDIT_DEFAULTS::PANEL_MODEDIT_DEFAULTS(), and TEXT_MOD_GRID_TABLE::TEXT_MOD_GRID_TABLE().

◆ FrontAssembly()

LSET LSET::FrontAssembly ( )
static

Return a complete set of all top assembly layers which is all F_SilkS and F_Mask.

Definition at line 681 of file lset.cpp.

682 {
683  static const PCB_LAYER_ID front_assembly[] = {
684  F_SilkS,
685  F_Mask,
686  F_Fab,
687  F_CrtYd
688  };
689 
690  static const LSET saved( front_assembly, arrayDim( front_assembly ) );
691  return saved;
692 }
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), F_CrtYd, F_Fab, F_Mask, and F_SilkS.

Referenced by PCB_LAYER_WIDGET::onPopupSelection().

◆ FrontBoardTechMask()

LSET LSET::FrontBoardTechMask ( )
static

Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.

Definition at line 812 of file lset.cpp.

813 {
814  static const LSET saved( 4, F_SilkS, F_Mask, F_Adhes, F_Paste );
815  return saved;
816 }
LSET is a set of PCB_LAYER_IDs.

References F_Adhes, F_Mask, F_Paste, and F_SilkS.

Referenced by AllBoardTechMask().

◆ FrontMask()

LSET LSET::FrontMask ( )
static

Return a mask holding all technical layers and the external CU layer on front side.

Definition at line 866 of file lset.cpp.

867 {
868  static const LSET saved = FrontTechMask().set( F_Cu );
869  return saved;
870 }
static LSET FrontTechMask()
Return a mask holding all technical layers (no CU layer) on front side.
Definition: lset.cpp:805
LSET is a set of PCB_LAYER_IDs.

References F_Cu, and FrontTechMask().

Referenced by PCB_LAYER_WIDGET::onPopupSelection().

◆ FrontTechMask()

LSET LSET::FrontTechMask ( )
static

Return a mask holding all technical layers (no CU layer) on front side.

Definition at line 805 of file lset.cpp.

References F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, and F_SilkS.

Referenced by AllTechMask(), and FrontMask().

◆ InternalCuMask()

LSET LSET::InternalCuMask ( )
static

Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.

Definition at line 709 of file lset.cpp.

710 {
711  static const PCB_LAYER_ID cu_internals[] = {
712  In1_Cu,
713  In2_Cu,
714  In3_Cu,
715  In4_Cu,
716  In5_Cu,
717  In6_Cu,
718  In7_Cu,
719  In8_Cu,
720  In9_Cu,
721  In10_Cu,
722  In11_Cu,
723  In12_Cu,
724  In13_Cu,
725  In14_Cu,
726  In15_Cu,
727  In16_Cu,
728  In17_Cu,
729  In18_Cu,
730  In19_Cu,
731  In20_Cu,
732  In21_Cu,
733  In22_Cu,
734  In23_Cu,
735  In24_Cu,
736  In25_Cu,
737  In26_Cu,
738  In27_Cu,
739  In28_Cu,
740  In29_Cu,
741  In30_Cu,
742  };
743 
744  static const LSET saved( cu_internals, arrayDim( cu_internals ) );
745  return saved;
746 }
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, and In9_Cu.

Referenced by AllCuMask(), ZONE_FILLER::computeRawFilledArea(), ZONE_FILLER::Fill(), FlipLayerMask(), ForbiddenFootprintLayers(), ZONE_CONTAINER::GetFilledPolysUseThickness(), PCB_PARSER::init(), DIALOG_RULE_AREA_PROPERTIES::OnLayerSelection(), PCB_LAYER_WIDGET::onPopupSelection(), DIALOG_PAD_PROPERTIES::padValuesOK(), DRC_RULES_PARSER::parseLayer(), PANEL_SETUP_LAYERS::setCopperLayerCheckBoxes(), PANEL_SETUP_BOARD_STACKUP::showOnlyActiveLayers(), and BOARD_STACKUP::StackupAllowedBrdLayers().

◆ Name()

const wxChar * LSET::Name ( PCB_LAYER_ID  aLayerId)
static

Return the fixed name association with aLayerId.

NOTE: These names must not be translated or changed.

They are used as tokens in the board file format because the ordinal value of the PCB_LAYER_ID enum was not stable over time.

See also
LayerName() for what should be used to display the default name of a layer in the GUI.

Definition at line 81 of file lset.cpp.

82 {
83  const wxChar* txt;
84 
85  // using a switch to explicitly show the mapping more clearly
86  switch( aLayerId )
87  {
88  case F_Cu: txt = wxT( "F.Cu" ); break;
89  case In1_Cu: txt = wxT( "In1.Cu" ); break;
90  case In2_Cu: txt = wxT( "In2.Cu" ); break;
91  case In3_Cu: txt = wxT( "In3.Cu" ); break;
92  case In4_Cu: txt = wxT( "In4.Cu" ); break;
93  case In5_Cu: txt = wxT( "In5.Cu" ); break;
94  case In6_Cu: txt = wxT( "In6.Cu" ); break;
95  case In7_Cu: txt = wxT( "In7.Cu" ); break;
96  case In8_Cu: txt = wxT( "In8.Cu" ); break;
97  case In9_Cu: txt = wxT( "In9.Cu" ); break;
98  case In10_Cu: txt = wxT( "In10.Cu" ); break;
99  case In11_Cu: txt = wxT( "In11.Cu" ); break;
100  case In12_Cu: txt = wxT( "In12.Cu" ); break;
101  case In13_Cu: txt = wxT( "In13.Cu" ); break;
102  case In14_Cu: txt = wxT( "In14.Cu" ); break;
103  case In15_Cu: txt = wxT( "In15.Cu" ); break;
104  case In16_Cu: txt = wxT( "In16.Cu" ); break;
105  case In17_Cu: txt = wxT( "In17.Cu" ); break;
106  case In18_Cu: txt = wxT( "In18.Cu" ); break;
107  case In19_Cu: txt = wxT( "In19.Cu" ); break;
108  case In20_Cu: txt = wxT( "In20.Cu" ); break;
109  case In21_Cu: txt = wxT( "In21.Cu" ); break;
110  case In22_Cu: txt = wxT( "In22.Cu" ); break;
111  case In23_Cu: txt = wxT( "In23.Cu" ); break;
112  case In24_Cu: txt = wxT( "In24.Cu" ); break;
113  case In25_Cu: txt = wxT( "In25.Cu" ); break;
114  case In26_Cu: txt = wxT( "In26.Cu" ); break;
115  case In27_Cu: txt = wxT( "In27.Cu" ); break;
116  case In28_Cu: txt = wxT( "In28.Cu" ); break;
117  case In29_Cu: txt = wxT( "In29.Cu" ); break;
118  case In30_Cu: txt = wxT( "In30.Cu" ); break;
119  case B_Cu: txt = wxT( "B.Cu" ); break;
120 
121  // Technicals
122  case B_Adhes: txt = wxT( "B.Adhes" ); break;
123  case F_Adhes: txt = wxT( "F.Adhes" ); break;
124  case B_Paste: txt = wxT( "B.Paste" ); break;
125  case F_Paste: txt = wxT( "F.Paste" ); break;
126  case B_SilkS: txt = wxT( "B.SilkS" ); break;
127  case F_SilkS: txt = wxT( "F.SilkS" ); break;
128  case B_Mask: txt = wxT( "B.Mask" ); break;
129  case F_Mask: txt = wxT( "F.Mask" ); break;
130 
131  // Users
132  case Dwgs_User: txt = wxT( "Dwgs.User" ); break;
133  case Cmts_User: txt = wxT( "Cmts.User" ); break;
134  case Eco1_User: txt = wxT( "Eco1.User" ); break;
135  case Eco2_User: txt = wxT( "Eco2.User" ); break;
136  case Edge_Cuts: txt = wxT( "Edge.Cuts" ); break;
137  case Margin: txt = wxT( "Margin" ); break;
138 
139  // Footprint
140  case F_CrtYd: txt = wxT( "F.CrtYd" ); break;
141  case B_CrtYd: txt = wxT( "B.CrtYd" ); break;
142  case F_Fab: txt = wxT( "F.Fab" ); break;
143  case B_Fab: txt = wxT( "B.Fab" ); break;
144 
145  // User definable layers.
146  case User_1: txt = wxT( "User.1" ); break;
147  case User_2: txt = wxT( "User.2" ); break;
148  case User_3: txt = wxT( "User.3" ); break;
149  case User_4: txt = wxT( "User.4" ); break;
150  case User_5: txt = wxT( "User.5" ); break;
151  case User_6: txt = wxT( "User.6" ); break;
152  case User_7: txt = wxT( "User.7" ); break;
153  case User_8: txt = wxT( "User.8" ); break;
154  case User_9: txt = wxT( "User.9" ); break;
155 
156  // Rescue
157  case Rescue: txt = wxT( "Rescue" ); break;
158 
159  default:
160  std::cout << aLayerId << std::endl;
161  wxASSERT_MSG( 0, wxT( "aLayerId out of range" ) );
162  txt = wxT( "BAD INDEX!" ); break;
163  }
164 
165  return txt;
166 }

References B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, Margin, Rescue, User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.

Referenced by PANEL_SETUP_LAYERS::addUserDefinedLayer(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), PCB_IO::format(), PCB_IO::formatBoardLayers(), BOARD_STACKUP::FormatBoardStackup(), PCB_IO::formatLayer(), PCB_IO::formatLayers(), PCB_PARSER::init(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), MODULE_DESC::MODULE_DESC(), PCBNEW_PRINTOUT::OnPrintPage(), PCB_PARSER::parseLayer(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), PCB_LAYER_WIDGET::ReFill(), and TRACK_VIA_DESC::TRACK_VIA_DESC().

◆ ParseHex()

int LSET::ParseHex ( const char *  aStart,
int  aCount 
)

Convert the output of FmtHex() and replaces this set's values with those given in the input string.

Parsing stops at the first non hex ASCII byte, except that marker bytes output from FmtHex are not terminators.

Returns
int - number of bytes consumed

Definition at line 358 of file lset.cpp.

359 {
360  LSET tmp;
361 
362  const char* rstart = aStart + aCount - 1;
363  const char* rend = aStart - 1;
364 
365  const int bitcount = size();
366 
367  int nibble_ndx = 0;
368 
369  while( rstart > rend )
370  {
371  int cc = *rstart--;
372 
373  if( cc == '_' )
374  continue;
375 
376  int nibble;
377 
378  if( cc >= '0' && cc <= '9' )
379  nibble = cc - '0';
380  else if( cc >= 'a' && cc <= 'f' )
381  nibble = cc - 'a' + 10;
382  else if( cc >= 'A' && cc <= 'F' )
383  nibble = cc - 'A' + 10;
384  else
385  break;
386 
387  int bit = nibble_ndx * 4;
388 
389  for( int ndx=0; bit<bitcount && ndx<4; ++bit, ++ndx )
390  if( nibble & (1<<ndx) )
391  tmp.set( bit );
392 
393  if( bit >= bitcount )
394  break;
395 
396  ++nibble_ndx;
397  }
398 
399  int byte_count = aStart + aCount - 1 - rstart;
400 
401  assert( byte_count >= 0 );
402 
403  if( byte_count > 0 )
404  *this = tmp;
405 
406  return byte_count;
407 }
LSET is a set of PCB_LAYER_IDs.

Referenced by PCB_PLOT_PARAMS_PARSER::Parse(), and PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS().

◆ Seq() [1/2]

LSEQ LSET::Seq ( const PCB_LAYER_ID aWishListSequence,
unsigned  aCount 
) const

Return an LSEQ from the union of this LSET and a desired sequence.

The LSEQ element will be in the same sequence as aWishListSequence if they are present.

Parameters
aWishListSequenceestablishes the order of the returned LSEQ, and the LSEQ will only contain PCB_LAYER_IDs which are present in this set.
aCountis the length of aWishListSequence array.

Definition at line 410 of file lset.cpp.

411 {
412  LSEQ ret;
413 
414 #if defined(DEBUG) && 0
415  LSET dup_detector;
416 
417  for( unsigned i=0; i<aCount; ++i )
418  {
419  PCB_LAYER_ID id = aWishListSequence[i];
420 
421  if( test( id ) )
422  {
423  wxASSERT_MSG( !dup_detector[id], wxT( "Duplicate in aWishListSequence" ) );
424  dup_detector[id] = true;
425 
426  ret.push_back( id );
427  }
428  }
429 #else
430 
431  for( unsigned i=0; i<aCount; ++i )
432  {
433  PCB_LAYER_ID id = aWishListSequence[i];
434 
435  if( test( id ) )
436  ret.push_back( id );
437  }
438 #endif
439 
440  return ret;
441 }
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.

Referenced by PANEL_SETUP_LAYERS::addUserDefinedLayer(), BOARD_ADAPTER::createLayers(), CreatePadsShapesSection(), APPEARANCE_CONTROLS::doApplyLayerPreset(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), DIALOG_EXPORT_SVG::ExportSVGFile(), PCB_IO::format(), PCB_IO::formatBoardLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), ZONE_CONTAINER::GetMsgPanelInfo(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), ZONE_CONTAINER::GetSelectMenuText(), ZONE_CONTAINER::InitDataFromSrcInCopyCtor(), VIA::IsPadOnLayer(), D_PAD::IsPadOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols(), DIALOG_DRC::OnDRCItemSelected(), APPEARANCE_CONTROLS::OnLayerContextMenu(), ROUTER_TOOL::onViaCommand(), PlotLayerOutlines(), ZONE_CONTAINER::SetLayerSet(), VIA::SetLayerSet(), GERBVIEW_PRINTOUT::setupViewLayers(), PCBNEW_PRINTOUT::setupViewLayers(), Technicals(), PCB_EDIT_FRAME::UpdateUserInterface(), ZONE_CONTAINER::ViewGetLayers(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ Seq() [2/2]

LSEQ LSET::Seq ( ) const

Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.

Each LSEQ element will be in the same sequence as in PCB_LAYER_ID and only present in the resultant LSEQ if present in this set. Therefore the sequence is subject to change, use it only when enumeration and not order is important.

Definition at line 444 of file lset.cpp.

445 {
446  LSEQ ret;
447 
448  ret.reserve( size() );
449 
450  for( unsigned i = 0; i < size(); ++i )
451  {
452  if( test( i ) )
453  ret.push_back( PCB_LAYER_ID( i ) );
454  }
455 
456  return ret;
457 }
PCB_LAYER_ID
A quick note on layer IDs:
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.

Referenced by CuStack(), SeqStackupBottom2Top(), TechAndUserUIOrder(), and Users().

◆ SeqStackupBottom2Top()

LSEQ LSET::SeqStackupBottom2Top ( ) const

Return the sequence that is typical for a bottom-to-top stack-up.

For instance, to plot multiple layers in a single image, the top layers output last.

Definition at line 460 of file lset.cpp.

461 {
462  // bottom-to-top stack-up layers
463  static const PCB_LAYER_ID sequence[] = {
464  B_Fab,
465  B_CrtYd,
466  B_Adhes,
467  B_SilkS,
468  B_Paste,
469  B_Mask,
470  B_Cu,
471  In30_Cu,
472  In29_Cu,
473  In28_Cu,
474  In27_Cu,
475  In26_Cu,
476  In25_Cu,
477  In24_Cu,
478  In23_Cu,
479  In22_Cu,
480  In21_Cu,
481  In20_Cu,
482  In19_Cu,
483  In18_Cu,
484  In17_Cu,
485  In16_Cu,
486  In15_Cu,
487  In14_Cu,
488  In13_Cu,
489  In12_Cu,
490  In11_Cu,
491  In10_Cu,
492  In9_Cu,
493  In8_Cu,
494  In7_Cu,
495  In6_Cu,
496  In5_Cu,
497  In4_Cu,
498  In3_Cu,
499  In2_Cu,
500  In1_Cu,
501  F_Cu,
502  F_Mask,
503  F_Paste,
504  F_SilkS,
505  F_Adhes,
506  F_CrtYd,
507  F_Fab,
508  Dwgs_User,
509  Cmts_User,
510  Eco1_User,
511  Eco2_User,
512  Margin,
513  Edge_Cuts,
514  };
515 
516  return Seq( sequence, arrayDim( sequence ) );
517 }
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
Definition: lset.cpp:444
PCB_LAYER_ID
A quick note on layer IDs:
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, Margin, and Seq().

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile().

◆ TechAndUserUIOrder()

LSEQ LSET::TechAndUserUIOrder ( ) const

Returns the technical and user layers in the order shown in layer widget.

Definition at line 260 of file lset.cpp.

261 {
262  static const PCB_LAYER_ID sequence[] = {
263  F_Adhes,
264  B_Adhes,
265  F_Paste,
266  B_Paste,
267  F_SilkS,
268  B_SilkS,
269  F_Mask,
270  B_Mask,
271  Dwgs_User,
272  Cmts_User,
273  Eco1_User,
274  Eco2_User,
275  Edge_Cuts,
276  Margin,
277  F_CrtYd,
278  B_CrtYd,
279  F_Fab,
280  B_Fab,
281  User_1,
282  User_2,
283  User_3,
284  User_4,
285  User_5,
286  User_6,
287  User_7,
288  User_8,
289  User_9
290  };
291 
292  return Seq( sequence, arrayDim( sequence ) );
293 }
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
Definition: lset.cpp:444
PCB_LAYER_ID
A quick note on layer IDs:
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, Margin, Seq(), User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.

Referenced by UIOrder().

◆ Technicals()

LSEQ LSET::Technicals ( LSET  aSubToOmit = LSET()) const

Return a sequence of technical layers.

A sequence provides a certain order.

Parameters
aSubToOmitis the subset of the technical layers to omit, defaults to none.

Definition at line 211 of file lset.cpp.

212 {
213  // desired sequence
214  static const PCB_LAYER_ID sequence[] = {
215  F_Adhes,
216  B_Adhes,
217  F_Paste,
218  B_Paste,
219  F_SilkS,
220  B_SilkS,
221  F_Mask,
222  B_Mask,
223  F_CrtYd,
224  B_CrtYd,
225  F_Fab,
226  B_Fab,
227  };
228 
229  LSET subset = ~aSetToOmit & *this;
230 
231  return subset.Seq( sequence, arrayDim( sequence ) );
232 }
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:410
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, and Seq().

◆ UIOrder()

LSEQ LSET::UIOrder ( ) const

Definition at line 894 of file lset.cpp.

895 {
896  LSEQ order = CuStack();
897  LSEQ techuser = TechAndUserUIOrder();
898  order.insert( order.end(), techuser.begin(), techuser.end() );
899 
900  return order;
901 }
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Definition: lset.cpp:169
LSEQ TechAndUserUIOrder() const
Returns the technical and user layers in the order shown in layer widget.
Definition: lset.cpp:260
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.

References CuStack(), and TechAndUserUIOrder().

Referenced by PCB_ONE_LAYER_SELECTOR::buildList(), SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList(), PAD_TOOL::explodePad(), DIALOG_PLOT::init_Dialog(), DIALOG_EXPORT_SVG::initDialog(), GERBVIEW_PRINTOUT::OnPrintPage(), PCBNEW_PRINTOUT::OnPrintPage(), DIALOG_PLOT::Plot(), PAD_TOOL::recombinePad(), PCB_LAYER_BOX_SELECTOR::Resync(), ZONE_SETTINGS::SetupLayersList(), and DIALOG_PRINT_PCBNEW::TransferDataToWindow().

◆ UserDefinedLayers()

LSET LSET::UserDefinedLayers ( )
static

◆ UserMask()

LSET LSET::UserMask ( )
static

Definition at line 833 of file lset.cpp.

834 {
835  static const LSET saved( 6,
836  Dwgs_User,
837  Cmts_User,
838  Eco1_User,
839  Eco2_User,
840  Edge_Cuts,
841  Margin
842  );
843 
844  return saved;
845 }
LSET is a set of PCB_LAYER_IDs.

References Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, and Margin.

◆ Users()

LSEQ LSET::Users ( ) const

*_User layers.

Definition at line 235 of file lset.cpp.

236 {
237  // desired
238  static const PCB_LAYER_ID sequence[] = {
239  Dwgs_User,
240  Cmts_User,
241  Eco1_User,
242  Eco2_User,
243  Edge_Cuts,
244  Margin,
245  User_1,
246  User_2,
247  User_3,
248  User_4,
249  User_5,
250  User_6,
251  User_7,
252  User_8,
253  User_9
254  };
255 
256  return Seq( sequence, arrayDim( sequence ) );
257 }
LSEQ Seq() const
Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
Definition: lset.cpp:444
PCB_LAYER_ID
A quick note on layer IDs:
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160

References arrayDim(), Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, Margin, Seq(), User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.


The documentation for this class was generated from the following files: