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...
 

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 491 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 508 of file layers_id_colors_and_visibility.h.

508  :
509  BASE_SET() // all bits are set to zero in BASE_SET()
510  {
511  }
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 513 of file layers_id_colors_and_visibility.h.

513  :
514  BASE_SET( aOther )
515  {
516  }
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 532 of file layers_id_colors_and_visibility.h.

532  : // PCB_LAYER_ID deliberately excludes int and relatives
533  BASE_SET()
534  {
535  set( aLayer );
536  }
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 39 of file lset.cpp.

39  :
40  BASE_SET()
41 {
42  for( unsigned i=0; i<aCount; ++i )
43  set( aArray[i] );
44 }
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 47 of file lset.cpp.

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

735  {
736  // not usable, it's private.
737  }

Member Function Documentation

◆ AllBoardTechMask()

LSET LSET::AllBoardTechMask ( )
static

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

Definition at line 827 of file lset.cpp.

828 {
829  static const LSET saved = BackBoardTechMask() | FrontBoardTechMask();
830  return saved;
831 }
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
Definition: lset.cpp:813
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:800

References BackBoardTechMask(), and FrontBoardTechMask().

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers().

◆ 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 750 of file lset.cpp.

751 {
752  // retain all in static as the full set, which is a common case.
753  static const LSET all = InternalCuMask().set( F_Cu ).set( B_Cu );
754 
755  if( aCuLayerCount == MAX_CU_LAYERS )
756  return all;
757 
758  // subtract out some Cu layers not wanted in the mask.
759  LSET ret = all;
760  int clear_count = MAX_CU_LAYERS - aCuLayerCount;
761 
762  clear_count = Clamp( 0, clear_count, MAX_CU_LAYERS - 2 );
763 
764  for( LAYER_NUM elem=In30_Cu; clear_count; --elem, --clear_count )
765  {
766  ret.set( elem, false );
767  }
768 
769  return ret;
770 }
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:710
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::AddToFootprint(), AllNonCuMask(), DIALOG_PLOT::applyPlotSettings(), TRACKS_CLEANER::cleanup(), 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(), ZONE_FILLER::Fill(), fmt_mask(), PCB_IO::formatLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), VIA::GetLayerSet(), BOARD::GetPad(), HYPERLYNX_PAD_STACK::getSMDLayer(), PAD::GetSolderMaskMargin(), PAD::GetSolderPasteMargin(), FOOTPRINT::GetUniquePadCount(), ROUTER_TOOL::handleLayerSwitch(), PCB_INSPECTION_TOOL::highlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK(), PCB_PARSER::init(), PAD::IsAperturePad(), HYPERLYNX_PAD_STACK::isEmpty(), ZONE::IsOnCopperLayer(), 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(), PANEL_SETUP_LAYERS::OnPresetsChoice(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_PAD_PROPERTIES::OnUpdateUINonCopperWarning(), EAGLE_PLUGIN::packageHole(), EAGLE_PLUGIN::packagePad(), DIALOG_PAD_PROPERTIES::padValuesOK(), PCB_PLOT_PARAMS_PARSER::Parse(), ALTIUM_PCB::ParseArcs6Data(), GPCB_FPL_CACHE::parseFOOTPRINT(), DRC_RULES_PARSER::parseLayer(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), ALTIUM_PCB::ParseTracks6Data(), PCB_PLOT_PARAMS::PCB_PLOT_PARAMS(), DIALOG_PLOT::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotPad(), PlotStandardLayer(), PAD::PTHMask(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), BOARD_DESIGN_SETTINGS::SetCopperLayerCount(), BOARD_DESIGN_SETTINGS::SetEnabledLayers(), setKeepoutSettingsToZone(), ZONE::SetLayerSet(), ZONE_SETTINGS::SetupLayersList(), PCBNEW_PRINTOUT::setupViewLayers(), PANEL_SETUP_LAYERS::showLayerTypes(), 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(), DIALOG_PAD_PROPERTIES::updatePadLayersList(), KIGFX::RATSNEST_VIEWITEM::ViewDraw(), PAD::ViewGetLOD(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ AllLayersMask()

◆ AllNonCuMask()

LSET LSET::AllNonCuMask ( )
static

Return a mask holding all layer minus CU layers.

Definition at line 773 of file lset.cpp.

774 {
775  static const LSET saved = LSET().set() & ~AllCuMask();
776  return saved;
777 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
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(), ROUTER_TOOL::handleLayerSwitch(), 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 820 of file lset.cpp.

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

References BackTechMask(), and FrontTechMask().

Referenced by BOARD_ITEM::layerMaskDescribe(), DIALOG_FOOTPRINT_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), and DIALOG_PLOT::OnPopUpLayers().

◆ 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 696 of file lset.cpp.

697 {
698  static const PCB_LAYER_ID back_assembly[] = {
699  B_SilkS,
700  B_Mask,
701  B_Fab,
702  B_CrtYd
703  };
704 
705  static const LSET saved( back_assembly, arrayDim( back_assembly ) );
706  return saved;
707 }
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
Returns # of elements in an array.
Definition: arraydim.h:31

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

◆ 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 800 of file lset.cpp.

801 {
802  static const LSET saved( 4, B_SilkS, B_Mask, B_Adhes, B_Paste );
803  return saved;
804 }
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 874 of file lset.cpp.

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

References B_Cu, and BackTechMask().

Referenced by insideArea(), and DRC_TEST_PROVIDER_SILK_CLEARANCE::Run().

◆ BackTechMask()

LSET LSET::BackTechMask ( )
static

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

Definition at line 794 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 562 of file layers_id_colors_and_visibility.h.

563  {
564  return test( aLayer );
565  }

Referenced by ZONE_CREATE_HELPER::commitZone(), APPEARANCE_CONTROLS::doApplyLayerPreset(), ZONE_FILLER::Fill(), PCB_INSPECTION_TOOL::highlightNet(), APPEARANCE_CONTROLS::setVisibleLayers(), and PCB_EDIT_FRAME::UpdateUserInterface().

◆ 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 170 of file lset.cpp.

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

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(), UIOrder(), and HYPERLYNX_EXPORTER::writeStackupInfo().

◆ ExternalCuMask()

LSET LSET::ExternalCuMask ( )
static

Return a mask holding the Front and Bottom layers.

Definition at line 780 of file lset.cpp.

781 {
782  static const LSET saved( 2, F_Cu, B_Cu );
783  return saved;
784 }
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 661 of file lset.cpp.

662 {
663  unsigned set_count = count();
664 
665  if( !set_count )
666  return UNSELECTED_LAYER;
667  else if( set_count > 1 )
668  return UNDEFINED_LAYER;
669 
670  for( unsigned i=0; i < size(); ++i )
671  {
672  if( test( i ) )
673  return PCB_LAYER_ID( i );
674  }
675 
676  wxASSERT( 0 ); // set_count was verified as 1 above, what did you break?
677 
678  return UNDEFINED_LAYER;
679 }
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 297 of file lset.cpp.

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

Referenced by ViaSort().

◆ FmtHex()

std::string LSET::FmtHex ( ) const

Return a hex string showing contents of this LSEQ.

Definition at line 321 of file lset.cpp.

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

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 and Margin.

Definition at line 881 of file lset.cpp.

882 {
883  static const LSET saved = InternalCuMask();
884  return saved;
885 }
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:710

References InternalCuMask().

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

◆ 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 682 of file lset.cpp.

683 {
684  static const PCB_LAYER_ID front_assembly[] = {
685  F_SilkS,
686  F_Mask,
687  F_Fab,
688  F_CrtYd
689  };
690 
691  static const LSET saved( front_assembly, arrayDim( front_assembly ) );
692  return saved;
693 }
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
Returns # of elements in an array.
Definition: arraydim.h:31

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

◆ 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 813 of file lset.cpp.

814 {
815  static const LSET saved( 4, F_SilkS, F_Mask, F_Adhes, F_Paste );
816  return saved;
817 }
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 867 of file lset.cpp.

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

References F_Cu, and FrontTechMask().

Referenced by insideArea(), and DRC_TEST_PROVIDER_SILK_CLEARANCE::Run().

◆ FrontTechMask()

LSET LSET::FrontTechMask ( )
static

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

Definition at line 806 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 710 of file lset.cpp.

711 {
712  static const PCB_LAYER_ID cu_internals[] = {
713  In1_Cu,
714  In2_Cu,
715  In3_Cu,
716  In4_Cu,
717  In5_Cu,
718  In6_Cu,
719  In7_Cu,
720  In8_Cu,
721  In9_Cu,
722  In10_Cu,
723  In11_Cu,
724  In12_Cu,
725  In13_Cu,
726  In14_Cu,
727  In15_Cu,
728  In16_Cu,
729  In17_Cu,
730  In18_Cu,
731  In19_Cu,
732  In20_Cu,
733  In21_Cu,
734  In22_Cu,
735  In23_Cu,
736  In24_Cu,
737  In25_Cu,
738  In26_Cu,
739  In27_Cu,
740  In28_Cu,
741  In29_Cu,
742  In30_Cu,
743  };
744 
745  static const LSET saved( cu_internals, arrayDim( cu_internals ) );
746  return saved;
747 }
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
Returns # of elements in an array.
Definition: arraydim.h:31

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::Fill(), ZONE_FILLER::fillSingleZone(), FlipLayerMask(), ForbiddenFootprintLayers(), ZONE::GetFilledPolysUseThickness(), PCB_PARSER::init(), DIALOG_RULE_AREA_PROPERTIES::OnLayerSelection(), 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 82 of file lset.cpp.

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

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(), FOOTPRINT_DESC::FOOTPRINT_DESC(), PCB_IO::format(), PCB_IO::formatBoardLayers(), BOARD_STACKUP::FormatBoardStackup(), PCB_IO::formatLayer(), PCB_IO::formatLayers(), PCB_PARSER::init(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupMessage(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCBNEW_PRINTOUT::OnPrintPage(), PCB_PARSER::parseLayer(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), TRACK_VIA_DESC::TRACK_VIA_DESC(), and PCB_EDIT_FRAME::UpdateUserInterface().

◆ 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 359 of file lset.cpp.

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

412 {
413  LSEQ ret;
414 
415 #if defined(DEBUG) && 0
416  LSET dup_detector;
417 
418  for( unsigned i=0; i<aCount; ++i )
419  {
420  PCB_LAYER_ID id = aWishListSequence[i];
421 
422  if( test( id ) )
423  {
424  wxASSERT_MSG( !dup_detector[id], wxT( "Duplicate in aWishListSequence" ) );
425  dup_detector[id] = true;
426 
427  ret.push_back( id );
428  }
429  }
430 #else
431 
432  for( unsigned i=0; i<aCount; ++i )
433  {
434  PCB_LAYER_ID id = aWishListSequence[i];
435 
436  if( test( id ) )
437  ret.push_back( id );
438  }
439 #endif
440 
441  return ret;
442 }
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 CN_CONNECTIVITY_ALGO::Add(), PANEL_SETUP_LAYERS::addUserDefinedLayer(), BOARD_ADAPTER::createLayers(), CreatePadsShapesSection(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), APPEARANCE_CONTROLS::doApplyLayerPreset(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), DIALOG_EXPORT_SVG::ExportSVGFile(), ZONE_FILLER::Fill(), VIA::FlashLayer(), PAD::FlashLayer(), PCB_IO::format(), PCB_IO::formatBoardLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), ZONE::GetMsgPanelInfo(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), ZONE::GetSelectMenuText(), ROUTER_TOOL::handleLayerSwitch(), ZONE::InitDataFromSrcInCopyCtor(), DRC_RTREE::Insert(), CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols(), DIALOG_DRC::OnDRCItemSelected(), APPEARANCE_CONTROLS::OnLayerContextMenu(), DIALOG_PAD_PROPERTIES::padValuesOK(), PlotLayerOutlines(), ZONE::SetLayerSet(), VIA::SetLayerSet(), GERBVIEW_PRINTOUT::setupViewLayers(), PCBNEW_PRINTOUT::setupViewLayers(), Technicals(), PCB_EDIT_FRAME::UpdateUserInterface(), ZONE::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 445 of file lset.cpp.

446 {
447  LSEQ ret;
448 
449  ret.reserve( size() );
450 
451  for( unsigned i = 0; i < size(); ++i )
452  {
453  if( test( i ) )
454  ret.push_back( PCB_LAYER_ID( i ) );
455  }
456 
457  return ret;
458 }
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 461 of file lset.cpp.

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

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 261 of file lset.cpp.

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

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 212 of file lset.cpp.

213 {
214  // desired sequence
215  static const PCB_LAYER_ID sequence[] = {
216  F_Adhes,
217  B_Adhes,
218  F_Paste,
219  B_Paste,
220  F_SilkS,
221  B_SilkS,
222  F_Mask,
223  B_Mask,
224  F_CrtYd,
225  B_CrtYd,
226  F_Fab,
227  B_Fab,
228  };
229 
230  LSET subset = ~aSetToOmit & *this;
231 
232  return subset.Seq( sequence, arrayDim( sequence ) );
233 }
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:411
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
Returns # of elements in an array.
Definition: arraydim.h:31

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 888 of file lset.cpp.

889 {
890  LSEQ order = CuStack();
891  LSEQ techuser = TechAndUserUIOrder();
892  order.insert( order.end(), techuser.begin(), techuser.end() );
893 
894  return order;
895 }
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
Definition: lset.cpp:170
LSEQ TechAndUserUIOrder() const
Returns the technical and user layers in the order shown in layer widget.
Definition: lset.cpp:261
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()

◆ UserMask()

LSET LSET::UserMask ( )
static

Definition at line 834 of file lset.cpp.

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

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

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers().

◆ Users()

LSEQ LSET::Users ( ) const

*_User layers.

Definition at line 236 of file lset.cpp.

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

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: