KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LAYER_UTILS Namespace Reference

Utility functions for dealing with layers in the context of a PCB board.s. More...

Functions

wxString AccumulateNames (const LSEQ &aLayers, const BOARD *aBoard)
 Accumulate layer names from a layer set into a comma separated string.
 
wxString AccumulateNames (const LSET &aLayers, const BOARD *aBoard)
 Accumulate layer names from a layer set into a comma separated string, in UI order.
 
LSET GetAllFootprintLayers (const FOOTPRINT &aFootprint)
 Return the union of layers referenced by every item inside the footprint (including graphic items, pads, zones, fields, and nested groups).
 
LSET GetOrphanedFootprintLayers (const FOOTPRINT &aFootprint, const LSET &aCustomUserLayers)
 Compute the set of footprint-used layers that would be orphaned if the footprint's allowed layer set is restricted to aCustomUserLayers (plus the tech and user masks).
 

Detailed Description

Utility functions for dealing with layers in the context of a PCB board.s.

This includes functions that need access to the board to get layer names, and other more complex, but reusable operations that either shouldn't be in LSET/LSEQ's interface or need access to Pcbnew types.

Function Documentation

◆ AccumulateNames() [1/2]

wxString LAYER_UTILS::AccumulateNames ( const LSEQ & aLayers,
const BOARD * aBoard )

Accumulate layer names from a layer set into a comma separated string.

Parameters
aLayersis the list of layers to accumulate.
aBoardis the board to get layer names from, if null the default names are used.

Definition at line 27 of file layer_utils.cpp.

References BOARD::GetLayerName(), LayerName(), and result.

Referenced by AccumulateNames(), footprintVsBoardStackup(), and DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate().

◆ AccumulateNames() [2/2]

wxString LAYER_UTILS::AccumulateNames ( const LSET & aLayers,
const BOARD * aBoard )
inline

Accumulate layer names from a layer set into a comma separated string, in UI order.

Definition at line 57 of file layer_utils.h.

References AccumulateNames(), and LSET::UIOrder().

◆ GetAllFootprintLayers()

LSET LAYER_UTILS::GetAllFootprintLayers ( const FOOTPRINT & aFootprint)

Return the union of layers referenced by every item inside the footprint (including graphic items, pads, zones, fields, and nested groups).

Definition at line 43 of file layer_utils.cpp.

References BOARD_ITEM::GetLayerSet(), RECURSE, and FOOTPRINT::RunOnChildren().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetOrphanedFootprintLayers().

◆ GetOrphanedFootprintLayers()

LSET LAYER_UTILS::GetOrphanedFootprintLayers ( const FOOTPRINT & aFootprint,
const LSET & aCustomUserLayers )

Compute the set of footprint-used layers that would be orphaned if the footprint's allowed layer set is restricted to aCustomUserLayers (plus the tech and user masks).

The Rescue pseudo-layer is intentionally excluded. It is an internal fallback for items referencing unknown layer names at load time and is not surfaced in any layer-selection UI. Orphans on Rescue must be addressed through the library-parity DRC, not by blocking edits in the Footprint Properties dialog.

Definition at line 59 of file layer_utils.cpp.

References GetAllFootprintLayers(), Rescue, and BASE_SET::reset().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate().