KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LSET Class Reference

LSET is a set of PCB_LAYER_IDs. More...

#include <lset.h>

Inheritance diagram for LSET:
BASE_SET

Public Types

using iterator = std::vector< int >::iterator
 
using const_iterator = std::vector< int >::const_iterator
 

Public Member Functions

 LSET ()
 Create an empty (cleared) set.
 
 LSET (const BASE_SET &aOther)
 
 LSET (PCB_LAYER_ID aLayer)
 
 LSET (std::initializer_list< PCB_LAYER_ID > aList)
 
 LSET (const LSEQ &aSeq)
 
 LSET (unsigned long __val)=delete
 
bool Contains (PCB_LAYER_ID aLayer)
 See if the layer set contains a PCB layer.
 
LSEQ CuStack () const
 Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
 
LSEQ Technicals (LSET aSubToOmit=LSET()) const
 Return a sequence of technical layers.
 
LSEQ Users () const
 *_User layers.
 
LSEQ TechAndUserUIOrder () const
 Returns the technical and user layers in the order shown in layer widget.
 
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.
 
LSEQ Seq (const LSEQ &aSequence) const
 
LSEQ Seq () const
 Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
 
LSEQ SeqStackupTop2Bottom (PCB_LAYER_ID aSelectedLayer=UNDEFINED_LAYER) const
 Generate a sequence of layers that represent a top to bottom stack of this set of layers.
 
LSEQ SeqStackupForPlotting () const
 Return the sequence that is typical for a bottom-to-top stack-up.
 
void RunOnLayers (const std::function< void(PCB_LAYER_ID)> &aFunction) const
 Execute a function on each layer of the LSET.
 
std::string FmtHex () const
 Return a hex string showing contents of this LSEQ.
 
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.
 
std::string FmtBin () const
 Return a binary string showing contents of this LSEQ.
 
PCB_LAYER_ID ExtractLayer () const
 Find the first set PCB_LAYER_ID.
 
LSETFlip (int aCopperLayersCount=0)
 Flip the layers in this set.
 
bool test (size_t pos) const
 
bool any () const
 
bool all () const
 
bool none () const
 
BASE_SETset (size_t pos=std::numeric_limits< size_t >::max(), bool value=true)
 
BASE_SETreset (size_t pos=std::numeric_limits< size_t >::max())
 
BASE_SETflip (size_t pos=std::numeric_limits< size_t >::max())
 
size_t count () const
 
size_t size () const
 
void resize (size_t newSize)
 
int & operator[] (size_t pos)
 
const int & operator[] (size_t pos) const
 
int compare (const BASE_SET &other) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
bool operator== (const BASE_SET &other) const
 
bool operator< (const BASE_SET &other) const
 
template<typename CharT = char>
std::basic_string< CharT > to_string (CharT zero=CharT( '0'), CharT one=CharT( '1')) const
 
BASE_SEToperator&= (const BASE_SET &rhs)
 
BASE_SEToperator|= (const BASE_SET &rhs)
 
BASE_SEToperator^= (const BASE_SET &rhs)
 
BASE_SET operator~ () const
 
set_bits_iterator set_bits_begin () const
 
set_bits_iterator set_bits_end () const
 
set_bits_reverse_iterator set_bits_rbegin () const
 
set_bits_reverse_iterator set_bits_rend () const
 

Static Public Member Functions

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

Private Attributes

std::vector< int > m_bits
 

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 34 of file lset.h.

Member Typedef Documentation

◆ const_iterator

using BASE_SET::const_iterator = std::vector<int>::const_iterator
inherited

Definition at line 43 of file base_set.h.

◆ iterator

using BASE_SET::iterator = std::vector<int>::iterator
inherited

Definition at line 42 of file base_set.h.

Constructor & Destructor Documentation

◆ LSET() [1/6]

LSET::LSET ( )
inline

Create an empty (cleared) set.

Definition at line 51 of file lset.h.

Referenced by AllLayersMask(), and AllNonCuMask().

◆ LSET() [2/6]

LSET::LSET ( const BASE_SET aOther)
inline

Definition at line 56 of file lset.h.

◆ LSET() [3/6]

LSET::LSET ( PCB_LAYER_ID  aLayer)
inline

Definition at line 61 of file lset.h.

References BASE_SET::set().

◆ LSET() [4/6]

LSET::LSET ( std::initializer_list< PCB_LAYER_ID aList)

Definition at line 43 of file lset.cpp.

References BASE_SET::set().

◆ LSET() [5/6]

LSET::LSET ( const LSEQ aSeq)

Definition at line 51 of file lset.cpp.

References BASE_SET::set().

◆ LSET() [6/6]

LSET::LSET ( unsigned long  __val)
delete

Member Function Documentation

◆ all()

bool BASE_SET::all ( ) const
inlineinherited

Definition at line 57 of file base_set.h.

Referenced by AllCuMask().

◆ AllBoardTechMask()

LSET LSET::AllBoardTechMask ( )
static

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

Definition at line 807 of file lset.cpp.

References BackBoardTechMask(), and FrontBoardTechMask().

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet(), PhysicalLayersMask(), CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers(), and ALTIUM_PCB::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 732 of file lset.cpp.

References BASE_SET::all(), B_Cu, Clamp(), F_Cu, In30_Cu, InternalCuMask(), MAX_CU_LAYERS, and BASE_SET::set().

Referenced by PCAD2KICAD::PCAD_PAD::AddToFootprint(), DIALOG_PLOT::applyPlotSettings(), CN_CONNECTIVITY_ALGO::Build(), EXPORTER_STEP::buildZones3DShape(), FOOTPRINT::CheckShortingPads(), TRACKS_CLEANER::cleanup(), HYPERLYNX_EXPORTER::collectNetObjects(), compute_pad_access_code(), EXPORTER_PCB_VRML::ComputeLayer3D_Zpos(), BOARD_ADAPTER::createLayers(), ZONE_CREATE_HELPER::createNewZone(), 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_IO_KICAD_SEXPR::formatLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet(), ALTIUM_PCB::GetKicadLayersToIterate(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), PCB_VIA::GetLayerSet(), BOARD::GetPad(), PAD::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), FOOTPRINT::GetUniquePadNumbers(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_IO_KICAD_SEXPR_PARSER::init(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), PAD::IsAperturePad(), HYPERLYNX_PAD_STACK::IsEmpty(), isMaskAperture(), PAD::IsOnCopperLayer(), ZONE::IsOnCopperLayer(), DSN::isRoundKeepout(), PCBNEW_JOBS_HANDLER::JobExportGerbers(), BOARD_ITEM::layerMaskDescribe(), PCB_IO_KICAD_LEGACY::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::OnRightClickLayers(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_PAD_PROPERTIES::OnUpdateUINonCopperWarning(), PCB_IO_EAGLE::packageHole(), PCB_IO_EAGLE::packagePad(), PCB_PLOT_PARAMS_PARSER::Parse(), GPCB_FPL_CACHE::parseFOOTPRINT(), DRC_RULES_PARSER::parseLayer(), PCB_IO_KICAD_SEXPR_PARSER::parsePAD(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_VIA(), CLI::PCB_EXPORT_BASE_COMMAND::PCB_EXPORT_BASE_COMMAND(), PCB_PLOT_PARAMS::PCB_PLOT_PARAMS(), PhysicalLayersMask(), DRAWING_TOOL::PlaceCharacteristics(), DRAWING_TOOL::PlaceStackup(), EXPORT_SVG::Plot(), DIALOG_PLOT::Plot(), BRDITEMS_PLOTTER::PlotDrillMarks(), 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(), PAD::SetAttribute(), BOARD_DESIGN_SETTINGS::SetCopperLayerCount(), BOARD_DESIGN_SETTINGS::SetEnabledLayers(), PCB_IO_EAGLE::setKeepoutSettingsToZone(), ZONE_CREATE_HELPER::setUniquePriority(), PCBNEW_PRINTOUT::setupViewLayers(), PANEL_SETUP_LAYERS::showLayerTypes(), SideSpecificMask(), PNS_KICAD_IFACE_BASE::syncPad(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), DIALOG_SWAP_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 767 of file lset.cpp.

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(), BOOST_AUTO_TEST_CASE(), CLI::FP_EXPORT_SVG_COMMAND::doPerform(), DRC_RTREE::DRC_RTREE(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), FOOTPRINT_DESC::FOOTPRINT_DESC(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), APPEARANCE_CONTROLS::getVisibleLayers(), GERBVIEW_FRAME::GetVisibleLayers(), BOARD::GetVisibleLayers(), ROUTER_TOOL::handleLayerSwitch(), LoadBoard(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), PCB_EDIT_FRAME::onBoardLoaded(), DIALOG_DRC::OnDRCItemSelected(), PCB_POINT_EDITOR::OnSelectionChange(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), padNeedsUpdate(), DRC_RULES_PARSER::parseDRC_RULE(), CLI::PCB_EXPORT_BASE_COMMAND::PCB_EXPORT_BASE_COMMAND(), PCB_SHAPE_DESC::PCB_SHAPE_DESC(), 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(), PCB_VIA::ViewGetLOD(), WriteDRCReport(), and ZONE_DESC::ZONE_DESC().

◆ AllNonCuMask()

◆ AllTechMask()

◆ any()

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

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

References B_Adhes, B_Mask, B_Paste, and B_SilkS.

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

◆ BackMask()

◆ BackTechMask()

LSET LSET::BackTechMask ( )
static

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

Definition at line 774 of file lset.cpp.

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

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

◆ begin() [1/2]

iterator BASE_SET::begin ( )
inlineinherited

Definition at line 123 of file base_set.h.

◆ begin() [2/2]

const_iterator BASE_SET::begin ( ) const
inlineinherited

Definition at line 125 of file base_set.h.

◆ compare()

int BASE_SET::compare ( const BASE_SET other) const
inlineinherited

Definition at line 116 of file base_set.h.

References BASE_SET::m_bits.

Referenced by PAD::Compare().

◆ Contains()

◆ count()

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

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

◆ end() [1/2]

iterator BASE_SET::end ( )
inlineinherited

Definition at line 124 of file base_set.h.

◆ end() [2/2]

const_iterator BASE_SET::end ( ) const
inlineinherited

Definition at line 126 of file base_set.h.

◆ ExternalCuMask()

LSET LSET::ExternalCuMask ( )
static

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

References BASE_SET::count(), BASE_SET::size(), UNDEFINED_LAYER, and UNSELECTED_LAYER.

Referenced by BOOST_AUTO_TEST_CASE(), KIGFX::PCB_PAINTER::Draw(), and PCBNEW_PRINTOUT::OnPrintPage().

◆ Flip()

LSET & LSET::Flip ( int  aCopperLayersCount = 0)

Flip the layers in this set.

BACK and FRONT copper layers, mask, paste, solder layers are swapped internal layers are flipped only if the copper layers count is known

Parameters
aMask= the LSET to flip
aCopperLayersCount= the number of copper layers. if 0 (in fact if < 4 ) internal layers will be not flipped because the layer count is not known

Definition at line 608 of file lset.cpp.

References B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In1_Cu, InternalCuMask(), BASE_SET::reset(), BASE_SET::set(), and BASE_SET::test().

Referenced by PAD::Flip().

◆ flip()

BASE_SET & BASE_SET::flip ( size_t  pos = std::numeric_limits<size_t>::max())
inlineinherited

Definition at line 91 of file base_set.h.

Referenced by DRC_TEST_PROVIDER_MISC::testDisabledLayers().

◆ FmtBin()

std::string LSET::FmtBin ( ) const

Return a binary string showing contents of this LSEQ.

Definition at line 278 of file lset.cpp.

References BASE_SET::size().

Referenced by ViaSort().

◆ FmtHex()

std::string LSET::FmtHex ( ) const

Return a hex string showing contents of this LSEQ.

Definition at line 302 of file lset.cpp.

References arrayDim(), and BASE_SET::size().

Referenced by BOOST_AUTO_TEST_CASE(), 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 858 of file lset.cpp.

References InternalCuMask().

Referenced by DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_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 707 of file lset.cpp.

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

References F_Adhes, F_Mask, F_Paste, and F_SilkS.

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

◆ FrontMask()

◆ FrontTechMask()

LSET LSET::FrontTechMask ( )
static

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

Definition at line 786 of file lset.cpp.

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

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

◆ InternalCuMask()

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

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_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::formatBoardLayers(), BOARD_STACKUP::FormatBoardStackup(), PCB_IO_KICAD_SEXPR::formatLayer(), PCB_IO_KICAD_SEXPR::formatLayers(), PCB_IO_KICAD_SEXPR_PARSER::init(), LoadBoard(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupMessage(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCB_EDIT_FRAME::onBoardLoaded(), PCB_IO_KICAD_SEXPR_PARSER::parseLayer(), CLI::PCB_EXPORT_BASE_COMMAND::PCB_EXPORT_BASE_COMMAND(), PCB_SHAPE_DESC::PCB_SHAPE_DESC(), TRACK_VIA_DESC::TRACK_VIA_DESC(), PCB_PROPERTIES_PANEL::updateLists(), PCB_EDIT_FRAME::UpdateUserInterface(), WriteDRCReport(), and ZONE_DESC::ZONE_DESC().

◆ none()

bool BASE_SET::none ( ) const
inlineinherited

◆ operator&=()

BASE_SET & BASE_SET::operator&= ( const BASE_SET rhs)
inlineinherited

Definition at line 174 of file base_set.h.

References BASE_SET::m_bits.

◆ operator<()

bool BASE_SET::operator< ( const BASE_SET other) const
inlineinherited

Definition at line 145 of file base_set.h.

References BASE_SET::m_bits.

◆ operator==()

bool BASE_SET::operator== ( const BASE_SET other) const
inlineinherited

Definition at line 129 of file base_set.h.

References BASE_SET::m_bits, minSize, and BASE_SET::size().

◆ operator[]() [1/2]

int & BASE_SET::operator[] ( size_t  pos)
inlineinherited

Definition at line 112 of file base_set.h.

◆ operator[]() [2/2]

const int & BASE_SET::operator[] ( size_t  pos) const
inlineinherited

Definition at line 114 of file base_set.h.

◆ operator^=()

BASE_SET & BASE_SET::operator^= ( const BASE_SET rhs)
inlineinherited

Definition at line 190 of file base_set.h.

References BASE_SET::m_bits.

◆ operator|=()

BASE_SET & BASE_SET::operator|= ( const BASE_SET rhs)
inlineinherited

Definition at line 182 of file base_set.h.

References BASE_SET::m_bits.

◆ operator~()

BASE_SET BASE_SET::operator~ ( ) const
inlineinherited

Definition at line 198 of file base_set.h.

References BASE_SET::m_bits.

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

References BASE_SET::set(), and BASE_SET::size().

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

References AllBoardTechMask(), and AllCuMask().

Referenced by BOARD_COMMIT::dirtyIntersectingZones(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_OPENGL::reload(), PCB_SELECTION_TOOL::Selectable(), PAD::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ reset()

◆ resize()

void BASE_SET::resize ( size_t  newSize)
inlineinherited

Definition at line 110 of file base_set.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ RunOnLayers()

void LSET::RunOnLayers ( const std::function< void(PCB_LAYER_ID)> &  aFunction) const
inline

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

References BASE_SET::size().

Referenced by CuStack(), SeqStackupForPlotting(), SeqStackupTop2Bottom(), TechAndUserUIOrder(), and Users().

◆ Seq() [2/3]

LSEQ LSET::Seq ( const LSEQ aSequence) const

Definition at line 426 of file lset.cpp.

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

Referenced by PANE_ZONE_VIEWER::ActivateSelectedZone(), STEP_PCB_MODEL::AddPadShape(), PCB_IO_IPC2581::addPadStack(), EXPORTER_STEP::buildBoard3DShapes(), PCB_NET_INSPECTOR_PANEL::buildColumns(), EXPORTER_STEP::buildFootprint3DShapes(), EXPORTER_STEP::buildTrack3DShape(), EXPORTER_STEP::buildZones3DShape(), BOARD_ADAPTER::createLayers(), GENCAD_EXPORTER::CreatePadsShapesSection(), DIALOG_MAP_LAYERS::DIALOG_MAP_LAYERS(), APPEARANCE_CONTROLS::doApplyLayerPreset(), DRAWING_TOOL::DrawVia(), DIALOG_EXPORT_SVG::ExportSVGFile(), ZONE_FILLER::Fill(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), PAD::FlashLayer(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::formatBoardLayers(), GENDRILL_WRITER_BASE::GenDrillReportFile(), PCB_IO_IPC2581::generateCadLayers(), PCB_IO_IPC2581::generateLayerFeatures(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ZONE::GetItemDescription(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), ZONE::GetMsgPanelInfo(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PAD::GetPrincipalLayer(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), ZONE_SEARCH_HANDLER::getResultCell(), MODEL_ZONES_OVERVIEW_TABLE::GetValueByRow(), ROUTER_TOOL::handleLayerSwitch(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), PNS_KICAD_IFACE::IsItemVisible(), CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols(), CADSTAR_PCB_ARCHIVE_LOADER::loadFigures(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryFigures(), DIALOG_DRC::OnDRCItemSelected(), APPEARANCE_CONTROLS::OnLayerContextMenu(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), BOARD_ITEM::ptr_cmp::operator()(), KI_TEST::kitest_cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), FOOTPRINT::cmp_padstack::operator()(), FOOTPRINT::cmp_zones::operator()(), kiapi::board::PackLayerSet(), PCB_IO_KICAD_SEXPR_PARSER::parsePAD(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_VIA(), PlotLayerOutlines(), PlotStandardLayer(), PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run(), PCB_SELECTION_TOOL::Selectable(), PAD::SetAttribute(), BOARD_ITEM::SetLayerSet(), GERBVIEW_PRINTOUT::setupViewLayers(), PCBNEW_PRINTOUT::setupViewLayers(), GLOBAL_EDIT_TOOL::swapBoardItem(), Technicals(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), PCB_EDIT_FRAME::UpdateUserInterface(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ SeqStackupForPlotting()

LSEQ LSET::SeqStackupForPlotting ( ) const

◆ SeqStackupTop2Bottom()

LSEQ LSET::SeqStackupTop2Bottom ( PCB_LAYER_ID  aSelectedLayer = UNDEFINED_LAYER) const

Generate a sequence of layers that represent a top to bottom stack of this set of layers.

Parameters
aSelectedLayeris the layer to put at the top of stack when defined.
Returns
the top to bottom layer sequence.

Definition at line 456 of file lset.cpp.

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

Referenced by BOOST_AUTO_TEST_CASE(), and PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates().

◆ set()

BASE_SET & BASE_SET::set ( size_t  pos = std::numeric_limits<size_t>::max(),
bool  value = true 
)
inlineinherited

Definition at line 61 of file base_set.h.

Referenced by SCOPED_LAYERSET::Add(), AllCuMask(), DIALOG_PLOT::applyPlotSettings(), BackMask(), BOARD::BOARD(), BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), BOARD_PRINTOUT_SETTINGS::BOARD_PRINTOUT_SETTINGS(), BOOST_AUTO_TEST_CASE(), AR_AUTOPLACER::buildFpAreas(), BOARD::ComputeBoundingBox(), ALTIUM_PCB::ConvertFills6ToFootprintItemOnLayer(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItemOnLayer(), ZONE_CREATE_HELPER::createNewZone(), CONVERT_TOOL::CreatePolys(), PCB_IO_EAGLE::defaultKicadLayer(), FOOTPRINT::Deserialize(), DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), PCBEXPR_LAYER_VALUE::EqualTo(), existsOnLayerFunc(), EXPORTER_STEP::Export(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), Flip(), FrontMask(), AR_AUTOPLACER::genModuleOnRoutingMatrix(), DIALOG_EXPORT_SVG::getCheckBoxSelectedLayers(), PCB_VIA::GetLayerSet(), PANEL_SETUP_LAYERS::GetUILayerMask(), APPEARANCE_CONTROLS::getVisibleLayers(), BOARD_ADAPTER::GetVisibleLayers(), ROUTER_TOOL::handleLayerSwitch(), ALTIUM_PCB::HelperSetZoneLayers(), intersectsAreaFunc(), PARAM_LAYER_PRESET::jsonToPresets(), PCB_IO_KICAD_LEGACY::leg_mask2new(), BOARD_PRINTOUT_SETTINGS::Load(), FABMASTER::loadLayers(), LSET(), DIALOG_DRC::OnDRCItemSelected(), DIALOG_COPPER_ZONE::OnLayerSelection(), DIALOG_NON_COPPER_ZONES_EDITOR::OnLayerSelection(), DIALOG_RULE_AREA_PROPERTIES::OnLayerSelection(), APPEARANCE_CONTROLS::onLayerVisibilityToggled(), PCBNEW_PRINTOUT::OnPrintPage(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), PCB_PLOT_PARAMS_PARSER::Parse(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked(), ParseHex(), DRC_RULES_PARSER::parseLayer(), PCB_IO_KICAD_SEXPR_PARSER::parseLayers(), DRAWING_TOOL::PlaceCharacteristics(), DRAWING_TOOL::PlaceStackup(), PRIVATE_LAYERS_GRID_TABLE::PRIVATE_LAYERS_GRID_TABLE(), GERBVIEW_FRAME::RemapLayers(), PCB_SELECTION_CONDITIONS::sameLayerFunc(), PCB_SELECTION_TOOL::Selectable(), PAD::SetAttribute(), BOARD_DESIGN_SETTINGS::SetEnabledLayers(), ZONE::SetFillFlag(), DIALOG_PRINT_GERBVIEW::setLayerSetFromList(), DIALOG_PRINT_PCBNEW::setLayerSetFromList(), APPEARANCE_CONTROLS::SetLayerVisible(), GENERAL_COLLECTORS_GUIDE::SetLayerVisible(), ZONE_SETTINGS::SetupLayersList(), GLOBAL_EDIT_TOOL::swapBoardItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), kiapi::board::UnpackLayerSet(), PANEL_SETUP_BOARD_STACKUP::updateCopperLayerCount(), RATSNEST_VIEW_ITEM::ViewDraw(), and ZONE_SETTINGS::ZONE_SETTINGS().

◆ set_bits_begin()

set_bits_iterator BASE_SET::set_bits_begin ( ) const
inlineinherited

Definition at line 295 of file base_set.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ set_bits_end()

set_bits_iterator BASE_SET::set_bits_end ( ) const
inlineinherited

Definition at line 296 of file base_set.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ set_bits_rbegin()

set_bits_reverse_iterator BASE_SET::set_bits_rbegin ( ) const
inlineinherited

Definition at line 298 of file base_set.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ set_bits_rend()

set_bits_reverse_iterator BASE_SET::set_bits_rend ( ) const
inlineinherited

Definition at line 302 of file base_set.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SideSpecificMask()

LSET LSET::SideSpecificMask ( )
static

Definition at line 851 of file lset.cpp.

References AllCuMask(), BackTechMask(), and FrontTechMask().

Referenced by FOOTPRINT::GetSide(), and BOARD_ITEM::IsSideSpecific().

◆ size()

◆ TechAndUserUIOrder()

LSEQ LSET::TechAndUserUIOrder ( ) const

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

Definition at line 242 of file lset.cpp.

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

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

◆ test()

bool BASE_SET::test ( size_t  pos) const
inlineinherited

Definition at line 47 of file base_set.h.

Referenced by BOOST_AUTO_TEST_CASE(), collidesWithArea(), DIALOG_PLOT::DIALOG_PLOT(), BOARD_COMMIT::dirtyIntersectingZones(), APPEARANCE_CONTROLS::doApplyLayerPreset(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawVia(), PCB_VIA::FlashLayer(), Flip(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ZONE::GetFillFlag(), FOOTPRINT::GetLayerBoundingBox(), PCB_VIA::GetLayerSet(), BOARD_ADAPTER::GetVisibleLayers(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::InspectClearance(), PCB_LAYER_BOX_SELECTOR::isLayerEnabled(), PAD::IsOnLayer(), PCB_VIA::IsOnLayer(), ZONE::IsOnLayer(), LoadBoard(), DIALOG_DRC::OnDRCItemSelected(), APPEARANCE_CONTROLS::OnLayerContextMenu(), APPEARANCE_CONTROLS::onLayerVisibilityToggled(), DIALOG_CLEANUP_GRAPHICS::OnSelectItem(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), PCB_EDIT_FRAME::OpenProjectFiles(), CN_VISITOR::operator()(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), PCB_CONTROL::pruneItemLayers(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), PAD::Recombine(), DRC_TEST_PROVIDER_DISALLOW::Run(), BOARD_PRINTOUT_SETTINGS::Save(), PAD::SetAttribute(), APPEARANCE_CONTROLS::SetLayerVisible(), PCB_BASE_FRAME::SetPlotSettings(), ZONE_SETTINGS::SetupLayersList(), PCBNEW_PRINTOUT::setupViewLayers(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testKnockoutTextAgainstZone(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), FOOTPRINT::TextOnly(), DIALOG_SWAP_LAYERS::TransferDataFromWindow(), DIALOG_SWAP_LAYERS::TransferDataToWindow(), DIALOG_PAD_PROPERTIES::updatePadLayersList(), and PCB_EDIT_FRAME::UpdateUserInterface().

◆ to_string()

template<typename CharT = char>
std::basic_string< CharT > BASE_SET::to_string ( CharT  zero = CharT( '0' ),
CharT  one = CharT( '1' ) 
) const
inlineinherited

Definition at line 158 of file base_set.h.

◆ UIOrder()

◆ UserDefinedLayers()

◆ UserMask()

◆ Users()

LSEQ LSET::Users ( ) const

*_User layers.

Definition at line 217 of file lset.cpp.

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.

Member Data Documentation

◆ m_bits

std::vector<int> BASE_SET::m_bits
privateinherited

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