KiCad PCB EDA Suite
LSET Class Reference

LSET is a set of PCB_LAYER_IDs. More...

#include <layer_ids.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 LSEQ &aSequence) const
 
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 PhysicalLayersMask ()
 Return a mask holding all layers which are physically realized. More...
 
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 529 of file layer_ids.h.

Constructor & Destructor Documentation

◆ LSET() [1/6]

LSET::LSET ( )
inline

Create an empty (cleared) set.

Definition at line 546 of file layer_ids.h.

546 :
547 BASE_SET() // all bits are set to zero in BASE_SET()
548 {
549 }
std::bitset< PCB_LAYER_ID_COUNT > BASE_SET
Definition: layer_ids.h:520

Referenced by AllLayersMask(), and AllNonCuMask().

◆ LSET() [2/6]

LSET::LSET ( const BASE_SET aOther)
inline

Definition at line 551 of file layer_ids.h.

551 :
552 BASE_SET( aOther )
553 {
554 }

◆ 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 570 of file layer_ids.h.

570 : // PCB_LAYER_ID deliberately excludes int and relatives
571 BASE_SET()
572 {
573 set( aLayer );
574 }

◆ 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}

◆ 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}
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137

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 787 of file layer_ids.h.

788 {
789 // not usable, it's private.
790 }

Member Function Documentation

◆ AllBoardTechMask()

LSET LSET::AllBoardTechMask ( )
static

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

Definition at line 848 of file lset.cpp.

849{
850 static const LSET saved = BackBoardTechMask() | FrontBoardTechMask();
851 return saved;
852}
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
Definition: lset.cpp:834
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
Definition: lset.cpp:821

References BackBoardTechMask(), and FrontBoardTechMask().

Referenced by DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), PhysicalLayersMask(), and 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 773 of file lset.cpp.

774{
775 // retain all in static as the full set, which is a common case.
776 static const LSET all = InternalCuMask().set( F_Cu ).set( B_Cu );
777
778 if( aCuLayerCount == MAX_CU_LAYERS )
779 return all;
780
781 // subtract out some Cu layers not wanted in the mask.
782 LSET ret = all;
783 int clear_count = MAX_CU_LAYERS - aCuLayerCount;
784
785 clear_count = Clamp( 0, clear_count, MAX_CU_LAYERS - 2 );
786
787 for( int elem = In30_Cu; clear_count; --elem, --clear_count )
788 ret.set( elem, false );
789
790 return ret;
791}
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition: lset.cpp:733
#define MAX_CU_LAYERS
Definition: layer_ids.h:140
@ In30_Cu
Definition: layer_ids.h:94
@ B_Cu
Definition: layer_ids.h:95
@ F_Cu
Definition: layer_ids.h:64
constexpr T Clamp(const T &lower, const T &value, const T &upper)
Limit value within the range lower <= value <= upper.
Definition: util.h:59

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

Referenced by PCAD2KICAD::PCB_PAD::AddToFootprint(), DIALOG_PLOT::applyPlotSettings(), FOOTPRINT::CheckPads(), FOOTPRINT::CheckShortingPads(), TRACKS_CLEANER::cleanup(), HYPERLYNX_EXPORTER::collectNetObjects(), compute_pad_access_code(), EXPORTER_PCB_VRML::ComputeLayer3D_Zpos(), BOARD_ADAPTER::createLayers(), ZONE_CREATE_HELPER::createNewZone(), DIALOG_EXPORT_SVG::CreateSVGFile(), PANEL_SETUP_LAYERS::DenyChangeCheckBox(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), BOARD_COMMIT::dirtyIntersectingZones(), ZONE_FILLER::Fill(), fmt_mask(), PCB_PLUGIN::formatLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), PCB_VIA::GetLayerSet(), BOARD::GetPad(), PAD::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), FOOTPRINT::GetUniquePadCount(), ROUTER_TOOL::handleLayerSwitch(), ALTIUM_PCB::HelperSetZoneLayers(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_PARSER::init(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), PAD::IsAperturePad(), HYPERLYNX_PAD_STACK::IsEmpty(), PAD::IsOnCopperLayer(), ZONE::IsOnCopperLayer(), DSN::isRoundKeepout(), BOARD_ITEM::layerMaskDescribe(), LEGACY_PLUGIN::leg_mask2new(), CADSTAR_PCB_ARCHIVE_LOADER::Load(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers(), FABMASTER::loadZone(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), DIALOG_PRINT_PCBNEW::onPopUpLayers(), DIALOG_PLOT::OnPopUpLayers(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_PAD_PROPERTIES::OnUpdateUINonCopperWarning(), EAGLE_PLUGIN::packageHole(), EAGLE_PLUGIN::packagePad(), PCB_PLOT_PARAMS_PARSER::Parse(), GPCB_FPL_CACHE::parseFOOTPRINT(), DRC_RULES_PARSER::parseLayer(), PCB_PLOT_PARAMS::PCB_PLOT_PARAMS(), PhysicalLayersMask(), DRAWING_TOOL::PlaceCharacteristics(), DRAWING_TOOL::PlaceStackup(), DIALOG_PLOT::Plot(), BRDITEMS_PLOTTER::PlotFootprintShape(), BRDITEMS_PLOTTER::PlotPad(), PlotStandardLayer(), PRIVATE_LAYERS_GRID_TABLE::PRIVATE_LAYERS_GRID_TABLE(), PAD::PTHMask(), DRC_CACHE_GENERATOR::Run(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), PCB_SELECTION_TOOL::selectAllConnectedTracks(), BOARD_DESIGN_SETTINGS::SetCopperLayerCount(), BOARD_DESIGN_SETTINGS::SetEnabledLayers(), setKeepoutSettingsToZone(), ZONE_CREATE_HELPER::setUniquePriority(), PCBNEW_PRINTOUT::setupViewLayers(), PANEL_SETUP_LAYERS::showLayerTypes(), PNS_KICAD_IFACE_BASE::syncPad(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), DIALOG_SWAP_LAYERS::TransferDataFromWindow(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), DIALOG_SWAP_LAYERS::TransferDataToWindow(), PCB_PROPERTIES_PANEL::updateLists(), PCB_CONTROL::UpdateMessagePanel(), DIALOG_PAD_PROPERTIES::updatePadLayersList(), RATSNEST_VIEW_ITEM::ViewDraw(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ AllLayersMask()

LSET LSET::AllLayersMask ( )
static

Definition at line 808 of file lset.cpp.

809{
810 static const LSET saved = LSET().set();
811 return saved;
812}
LSET()
Create an empty (cleared) set.
Definition: layer_ids.h:546

References LSET().

Referenced by PCB_GRID_HELPER::BestDragOrigin(), PCB_GRID_HELPER::BestSnapAnchor(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), DRC_RTREE::DRC_RTREE(), FOOTPRINT_DESC::FOOTPRINT_DESC(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet(), APPEARANCE_CONTROLS::getVisibleLayers(), GERBVIEW_FRAME::GetVisibleLayers(), BOARD::GetVisibleLayers(), ROUTER_TOOL::handleLayerSwitch(), LAYER_PRESET::LAYER_PRESET(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), PCB_EDIT_FRAME::onBoardLoaded(), DIALOG_DRC::OnDRCItemSelected(), PCB_POINT_EDITOR::OnSelectionChange(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS(), PCB_PICKER_TOOL::reset(), PCB_LAYER_BOX_SELECTOR::Resync(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), PCB_SELECTION_TOOL::Selectable(), DRAWING_TOOL::SetAnchor(), APPEARANCE_CONTROLS::setVisibleLayers(), DRC_TEST_PROVIDER_MISC::testAssertions(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), PANEL_SETUP_LAYERS::testLayerNames(), DRC_TEST_PROVIDER_MISC::testTextVars(), TRACK_VIA_DESC::TRACK_VIA_DESC(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), PCB_EDIT_FRAME::UpdateUserInterface(), PAD::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ AllNonCuMask()

◆ AllTechMask()

LSET LSET::AllTechMask ( )
static

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

Definition at line 841 of file lset.cpp.

842{
843 static const LSET saved = BackTechMask() | FrontTechMask();
844 return saved;
845}
static LSET FrontTechMask()
Return a mask holding all technical layers (no CU layer) on front side.
Definition: lset.cpp:827
static LSET BackTechMask()
Return a mask holding all technical layers (no CU layer) on back side.
Definition: lset.cpp:815

References BackTechMask(), and FrontTechMask().

Referenced by BOARD_ITEM::layerMaskDescribe(), FABMASTER::loadLayers(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddField(), DIALOG_PRINT_PCBNEW::onPopUpLayers(), DIALOG_PLOT::OnPopUpLayers(), DRAWING_TOOL::PlaceCharacteristics(), DRAWING_TOOL::PlaceStackup(), and PRIVATE_LAYERS_GRID_TABLE::PRIVATE_LAYERS_GRID_TABLE().

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

720{
721 static const PCB_LAYER_ID back_assembly[] = {
722 B_SilkS,
723 B_Mask,
724 B_Fab,
725 B_CrtYd
726 };
727
728 static const LSET saved( back_assembly, arrayDim( back_assembly ) );
729 return saved;
730}
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
@ B_Mask
Definition: layer_ids.h:106
@ B_CrtYd
Definition: layer_ids.h:116
@ B_SilkS
Definition: layer_ids.h:103
@ B_Fab
Definition: layer_ids.h:119

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

822{
823 static const LSET saved( 4, B_SilkS, B_Mask, B_Adhes, B_Paste );
824 return saved;
825}
@ B_Adhes
Definition: layer_ids.h:97
@ B_Paste
Definition: layer_ids.h:100

References B_Adhes, B_Mask, B_Paste, and B_SilkS.

Referenced by AllBoardTechMask(), and PAD::FlashLayer().

◆ BackMask()

LSET LSET::BackMask ( )
static

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

Definition at line 902 of file lset.cpp.

903{
904 static const LSET saved = BackTechMask().set( B_Cu );
905 return saved;
906}

References B_Cu, and BackTechMask().

Referenced by collidesWithArea(), DRC_ENGINE::EvalRules(), 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 815 of file lset.cpp.

816{
817 static const LSET saved( 6, B_SilkS, B_Mask, B_Adhes, B_Paste, B_CrtYd, B_Fab );
818 return saved;
819}

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

Referenced by AllTechMask(), BackMask(), and PCB_VIA::ViewGetLOD().

◆ Contains()

◆ 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:459
@ In22_Cu
Definition: layer_ids.h:86
@ In11_Cu
Definition: layer_ids.h:75
@ In29_Cu
Definition: layer_ids.h:93
@ In17_Cu
Definition: layer_ids.h:81
@ In9_Cu
Definition: layer_ids.h:73
@ In19_Cu
Definition: layer_ids.h:83
@ In7_Cu
Definition: layer_ids.h:71
@ In28_Cu
Definition: layer_ids.h:92
@ In26_Cu
Definition: layer_ids.h:90
@ In21_Cu
Definition: layer_ids.h:85
@ In23_Cu
Definition: layer_ids.h:87
@ In15_Cu
Definition: layer_ids.h:79
@ In2_Cu
Definition: layer_ids.h:66
@ In10_Cu
Definition: layer_ids.h:74
@ In4_Cu
Definition: layer_ids.h:68
@ In16_Cu
Definition: layer_ids.h:80
@ In24_Cu
Definition: layer_ids.h:88
@ In1_Cu
Definition: layer_ids.h:65
@ In13_Cu
Definition: layer_ids.h:77
@ In8_Cu
Definition: layer_ids.h:72
@ In14_Cu
Definition: layer_ids.h:78
@ In12_Cu
Definition: layer_ids.h:76
@ In27_Cu
Definition: layer_ids.h:91
@ In6_Cu
Definition: layer_ids.h:70
@ In5_Cu
Definition: layer_ids.h:69
@ In3_Cu
Definition: layer_ids.h:67
@ In20_Cu
Definition: layer_ids.h:84
@ In18_Cu
Definition: layer_ids.h:82
@ In25_Cu
Definition: layer_ids.h:89

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_PLUGIN::formatBoardLayers(), APPEARANCE_CONTROLS::rebuildLayers(), UIOrder(), PCB_CONTROL::UpdateMessagePanel(), and HYPERLYNX_EXPORTER::writeStackupInfo().

◆ ExternalCuMask()

LSET LSET::ExternalCuMask ( )
static

Return a mask holding the Front and Bottom layers.

Definition at line 801 of file lset.cpp.

802{
803 static const LSET saved( 2, F_Cu, B_Cu );
804 return saved;
805}

References B_Cu, and F_Cu.

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

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

685{
686 unsigned set_count = count();
687
688 if( !set_count )
689 return UNSELECTED_LAYER;
690 else if( set_count > 1 )
691 return UNDEFINED_LAYER;
692
693 for( unsigned i=0; i < size(); ++i )
694 {
695 if( test( i ) )
696 return PCB_LAYER_ID( i );
697 }
698
699 wxASSERT( 0 ); // set_count was verified as 1 above, what did you break?
700
701 return UNDEFINED_LAYER;
702}
@ UNSELECTED_LAYER
Definition: layer_ids.h:61
@ UNDEFINED_LAYER
Definition: layer_ids.h:60

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}

References arrayDim().

Referenced by PCB_PLOT_PARAMS::Format(), and 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 909 of file lset.cpp.

910{
911 static const LSET saved = InternalCuMask();
912 return saved;
913}

References InternalCuMask().

Referenced by DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), APPEARANCE_CONTROLS::onLayerLeftClick(), 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 705 of file lset.cpp.

706{
707 static const PCB_LAYER_ID front_assembly[] = {
708 F_SilkS,
709 F_Mask,
710 F_Fab,
711 F_CrtYd
712 };
713
714 static const LSET saved( front_assembly, arrayDim( front_assembly ) );
715 return saved;
716}
@ F_CrtYd
Definition: layer_ids.h:117
@ F_Mask
Definition: layer_ids.h:107
@ F_Fab
Definition: layer_ids.h:120
@ F_SilkS
Definition: layer_ids.h:104

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

835{
836 static const LSET saved( 4, F_SilkS, F_Mask, F_Adhes, F_Paste );
837 return saved;
838}
@ F_Paste
Definition: layer_ids.h:101
@ F_Adhes
Definition: layer_ids.h:98

References F_Adhes, F_Mask, F_Paste, and F_SilkS.

Referenced by AllBoardTechMask(), and PAD::FlashLayer().

◆ FrontMask()

LSET LSET::FrontMask ( )
static

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

Definition at line 895 of file lset.cpp.

896{
897 static const LSET saved = FrontTechMask().set( F_Cu );
898 return saved;
899}

References F_Cu, and FrontTechMask().

Referenced by collidesWithArea(), DRC_ENGINE::EvalRules(), 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 827 of file lset.cpp.

828{
829 static const LSET saved( 6, F_SilkS, F_Mask, F_Adhes, F_Paste, F_CrtYd, F_Fab );
830 return saved;
831}

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

Referenced by AllTechMask(), FrontMask(), and PCB_VIA::ViewGetLOD().

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

734{
735 static const PCB_LAYER_ID cu_internals[] = {
736 In1_Cu,
737 In2_Cu,
738 In3_Cu,
739 In4_Cu,
740 In5_Cu,
741 In6_Cu,
742 In7_Cu,
743 In8_Cu,
744 In9_Cu,
745 In10_Cu,
746 In11_Cu,
747 In12_Cu,
748 In13_Cu,
749 In14_Cu,
750 In15_Cu,
751 In16_Cu,
752 In17_Cu,
753 In18_Cu,
754 In19_Cu,
755 In20_Cu,
756 In21_Cu,
757 In22_Cu,
758 In23_Cu,
759 In24_Cu,
760 In25_Cu,
761 In26_Cu,
762 In27_Cu,
763 In28_Cu,
764 In29_Cu,
765 In30_Cu,
766 };
767
768 static const LSET saved( cu_internals, arrayDim( cu_internals ) );
769 return saved;
770}

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(), 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}
@ User_8
Definition: layer_ids.h:130
@ Edge_Cuts
Definition: layer_ids.h:113
@ Dwgs_User
Definition: layer_ids.h:109
@ Cmts_User
Definition: layer_ids.h:110
@ User_6
Definition: layer_ids.h:128
@ User_7
Definition: layer_ids.h:129
@ User_5
Definition: layer_ids.h:127
@ Eco1_User
Definition: layer_ids.h:111
@ User_9
Definition: layer_ids.h:131
@ Margin
Definition: layer_ids.h:114
@ Eco2_User
Definition: layer_ids.h:112
@ Rescue
Definition: layer_ids.h:133
@ User_3
Definition: layer_ids.h:125
@ User_1
Definition: layer_ids.h:123
@ User_4
Definition: layer_ids.h:126
@ User_2
Definition: layer_ids.h:124

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_PLUGIN::format(), PCB_PLUGIN::formatBoardLayers(), BOARD_STACKUP::FormatBoardStackup(), PCB_PLUGIN::formatLayer(), PCB_PLUGIN::formatLayers(), PCB_PARSER::init(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupMessage(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCB_EDIT_FRAME::onBoardLoaded(), PCB_PARSER::parseLayer(), TRACK_VIA_DESC::TRACK_VIA_DESC(), PCB_PROPERTIES_PANEL::updateLists(), 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}

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

◆ PhysicalLayersMask()

LSET LSET::PhysicalLayersMask ( )
static

Return a mask holding all layers which are physically realized.

Equivalent to the copper layers + the board tech mask.

Definition at line 870 of file lset.cpp.

871{
872 static const LSET saved = AllBoardTechMask() | AllCuMask();
873 return saved;
874}
static LSET AllBoardTechMask()
Return a mask holding board technical layers (no CU layer) on both side.
Definition: lset.cpp:848
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773

References AllBoardTechMask(), and AllCuMask().

Referenced by BOARD_COMMIT::dirtyIntersectingZones(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_SELECTION_TOOL::Selectable(), PAD::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ Seq() [1/3]

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

460{
461 LSEQ ret;
462
463 ret.reserve( size() );
464
465 for( unsigned i = 0; i < size(); ++i )
466 {
467 if( test( i ) )
468 ret.push_back( PCB_LAYER_ID( i ) );
469 }
470
471 return ret;
472}
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:491

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

◆ Seq() [2/3]

LSEQ LSET::Seq ( const LSEQ aSequence) const

Definition at line 445 of file lset.cpp.

446{
447 LSEQ ret;
448
449 for( LSEQ seq = aSequence; seq; ++seq )
450 {
451 if( test( *seq ) )
452 ret.push_back( *seq );
453 }
454
455 return ret;
456}

◆ Seq() [3/3]

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}

Referenced by CN_CONNECTIVITY_ALGO::Add(), FOOTPRINT::CheckPads(), collidesWithArea(), BOARD_ADAPTER::createLayers(), CreatePadsShapesSection(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), APPEARANCE_CONTROLS::doApplyLayerPreset(), KIGFX::PCB_PAINTER::Draw(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), DRAWING_TOOL::DrawVia(), DIALOG_EXPORT_SVG::ExportSVGFile(), ZONE_FILLER::Fill(), PAD::FlashLayer(), PCB_VIA::FlashLayer(), PCB_PLUGIN::format(), PCB_PLUGIN::formatBoardLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), ZONE::GetMsgPanelInfo(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PAD::GetPrincipalLayer(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), ZONE_SEARCH_HANDLER::GetResultCell(), ZONE::GetSelectMenuText(), ROUTER_TOOL::handleLayerSwitch(), ZONE::InitDataFromSrcInCopyCtor(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), PNS_KICAD_IFACE::IsItemVisible(), CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols(), DIALOG_DRC::OnDRCItemSelected(), APPEARANCE_CONTROLS::OnLayerContextMenu(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), KI_TEST::kitest_cmp_drawings::operator()(), FOOTPRINT::cmp_zones::operator()(), PlotLayerOutlines(), DRC_CACHE_GENERATOR::Run(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run(), PCB_SELECTION_TOOL::Selectable(), BOARD_ITEM::SetLayerSet(), PCB_VIA::SetLayerSet(), ZONE::SetLayerSet(), GERBVIEW_PRINTOUT::setupViewLayers(), PCBNEW_PRINTOUT::setupViewLayers(), Technicals(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), PCB_EDIT_FRAME::UpdateUserInterface(), RATSNEST_VIEW_ITEM::ViewDraw(), ZONE::ViewGetLayers(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

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

476{
477 // bottom-to-top stack-up layers
478 static const PCB_LAYER_ID sequence[] = {
479 User_9,
480 User_8,
481 User_7,
482 User_6,
483 User_5,
484 User_4,
485 User_3,
486 User_2,
487 User_1,
488 B_Fab,
489 B_CrtYd,
490 B_Adhes,
491 B_SilkS,
492 B_Paste,
493 B_Mask,
494 B_Cu,
495 In30_Cu,
496 In29_Cu,
497 In28_Cu,
498 In27_Cu,
499 In26_Cu,
500 In25_Cu,
501 In24_Cu,
502 In23_Cu,
503 In22_Cu,
504 In21_Cu,
505 In20_Cu,
506 In19_Cu,
507 In18_Cu,
508 In17_Cu,
509 In16_Cu,
510 In15_Cu,
511 In14_Cu,
512 In13_Cu,
513 In12_Cu,
514 In11_Cu,
515 In10_Cu,
516 In9_Cu,
517 In8_Cu,
518 In7_Cu,
519 In6_Cu,
520 In5_Cu,
521 In4_Cu,
522 In3_Cu,
523 In2_Cu,
524 In1_Cu,
525 F_Cu,
526 F_Mask,
527 F_Paste,
528 F_SilkS,
529 F_Adhes,
530 F_CrtYd,
531 F_Fab,
532 Dwgs_User,
533 Cmts_User,
534 Eco1_User,
535 Eco2_User,
536 Margin,
537 Edge_Cuts,
538 };
539
540 return Seq( sequence, arrayDim( sequence ) );
541}

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, Seq(), User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), and PlotLayerOutlines().

◆ 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}

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

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

917{
918 LSEQ order = CuStack();
919 LSEQ techuser = TechAndUserUIOrder();
920 order.insert( order.end(), techuser.begin(), techuser.end() );
921
922 return order;
923}
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

References CuStack(), and TechAndUserUIOrder().

Referenced by PCB_ONE_LAYER_SELECTOR::buildList(), SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList(), DIALOG_PLOT::DIALOG_PLOT(), PAD_TOOL::explodePad(), ZONE::GetFirstLayer(), DIALOG_PLOT::init_Dialog(), DIALOG_EXPORT_SVG::initDialog(), GERBVIEW_PRINTOUT::OnPrintPage(), PCBNEW_PRINTOUT::OnPrintPage(), DIALOG_CLEANUP_GRAPHICS::OnSelectItem(), DIALOG_PLOT::Plot(), PAD_TOOL::RecombinePad(), PCB_LAYER_BOX_SELECTOR::Resync(), ZONE_SETTINGS::SetupLayersList(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), and PCB_PROPERTIES_PANEL::updateLists().

◆ UserDefinedLayers()

LSET LSET::UserDefinedLayers ( )
static

Return a mask with all of the allowable user defined layers.

Definition at line 877 of file lset.cpp.

878{
879 static const LSET saved( 9,
880 User_1,
881 User_2,
882 User_3,
883 User_4,
884 User_5,
885 User_6,
886 User_7,
887 User_8,
888 User_9
889 );
890
891 return saved;
892}

References 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(), CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers(), PANEL_SETUP_LAYERS::setUserDefinedLayerCheckBoxes(), and PANEL_SETUP_LAYERS::TransferDataFromWindow().

◆ UserMask()

LSET LSET::UserMask ( )
static

Definition at line 855 of file lset.cpp.

856{
857 static const LSET saved( 6,
858 Dwgs_User,
859 Cmts_User,
860 Eco1_User,
861 Eco2_User,
862 Edge_Cuts,
863 Margin
864 );
865
866 return saved;
867}

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

Referenced by FABMASTER::loadLayers(), and 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}

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: