KiCad PCB EDA Suite
Loading...
Searching...
No Matches
lset.cpp File Reference
#include <bitset>
#include <cassert>
#include <cstdarg>
#include <iostream>
#include <stddef.h>
#include <core/arraydim.h>
#include <math/util.h>
#include <layer_ids.h>
#include <macros.h>
#include <wx/debug.h>
#include <wx/string.h>

Go to the source code of this file.

Functions

PCB_LAYER_ID FlipLayer (PCB_LAYER_ID aLayerId, int aCopperLayersCount)
 
LSET FlipLayerMask (LSET aMask, int aCopperLayersCount)
 Calculate the mask layer when flipping a footprint. More...
 
PCB_LAYER_ID ToLAYER_ID (int aLayer)
 

Function Documentation

◆ FlipLayer()

PCB_LAYER_ID FlipLayer ( PCB_LAYER_ID  aLayerId,
int  aCopperLayersCount = 0 
)
Returns
the layer number after flipping an item some (not all) layers: external copper, and paired layers( Mask, Paste, solder ... ) are swapped between front and back sides internal layers are flipped only if the copper layers count is known
Parameters
aLayerId= the PCB_LAYER_ID 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 634 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, and IsCopperLayer().

Referenced by PCAD2KICAD::PCAD_FOOTPRINT::AddToBoard(), PCAD2KICAD::PCAD_ARC::Flip(), PCAD2KICAD::PCAD_LINE::Flip(), PCAD2KICAD::PCAD_PAD::Flip(), PCAD2KICAD::PCAD_POLYGON::Flip(), FOOTPRINT::Flip(), PCB_DIMENSION_BASE::Flip(), PCB_SHAPE::Flip(), PCB_TARGET::Flip(), PCB_TEXT::Flip(), PCB_TRACK::Flip(), PCB_ARC::Flip(), PCB_VIA::Flip(), ZONE::Flip(), PCB_IO_IPC2581::generateLayerSetNet(), and FABMASTER::loadFootprints().

◆ FlipLayerMask()

LSET FlipLayerMask ( LSET  aMask,
int  aCopperLayersCount = 0 
)

Calculate the mask layer when flipping a footprint.

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 680 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, and LSET::InternalCuMask().

Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), PCB_IO_EASYEDAPRO_PARSER::createPAD(), ZONE::Flip(), PAD::Flip(), FABMASTER::loadFootprints(), and PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer().

◆ ToLAYER_ID()

PCB_LAYER_ID ToLAYER_ID ( int  aLayer)

Definition at line 1022 of file lset.cpp.

References GAL_LAYER_ID_END.

Referenced by GRID_CELL_LAYER_SELECTOR::BeginEdit(), BOARD::BOARD(), DSN::SPECCTRA_DB::buildLayerMaps(), CN_ANCHOR::ConnectedItemsCount(), PNS_KICAD_IFACE::createBoardItem(), BOARD_ADAPTER::createLayers(), PCB_PROPERTIES_PANEL::createPGProperty(), PCB_MARKER::Deserialize(), KIGFX::PCB_PAINTER::draw(), GRID_CELL_LAYER_RENDERER::Draw(), DRAWING_TOOL::DrawVia(), PCBEXPR_LAYER_VALUE::EqualTo(), existsOnLayerFunc(), GENDRILL_WRITER_BASE::GenDrillReportFile(), PNS_PCBNEW_RULE_RESOLVER::getBoardItem(), GetGerberFileFunctionAttribute(), DIALOG_TRACK_VIA_PROPERTIES::getLayerDepth(), BOARD::GetLayerID(), PCB_LAYER_BOX_SELECTOR::getLayerName(), PCB_LAYER_SELECTOR::getLayerName(), PCB_VIA::GetOutermostConnectedLayers(), DIALOG_IMPORTED_LAYERS::GetSelectedLayerID(), GRID_CELL_LAYER_SELECTOR::GetValue(), CONNECTIVITY_DATA::IsConnectedOnLayer(), CN_ANCHOR::IsDangling(), PNS_KICAD_IFACE_BASE::IsFlashedOnLayer(), PNS_PCBNEW_RULE_RESOLVER::IsNetTieExclusion(), BOARD::LayerDepth(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), PCAD2KICAD::PCAD_PCB::MapLayer(), PNS_KICAD_IFACE::modifyBoardItem(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddLayer(), APPEARANCE_CONTROLS::onLayerLeftClick(), DIALOG_COPPER_ZONE::OnLayerSelection(), DIALOG_NON_COPPER_ZONES_EDITOR::OnLayerSelection(), DIALOG_RULE_AREA_PROPERTIES::OnLayerSelection(), PLOT_CONTROLLER::OpenPlotfile(), DRC_RULES_PARSER::parseLayer(), PCB_MARKER::PCB_MARKER(), ROUTER_TOOL::performRouting(), PLOT_CONTROLLER::PlotLayer(), ROUTER_TOOL::prepareInteractive(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), PCB_SELECTION_TOOL::Selectable(), FOOTPRINT_EDIT_FRAME::SelectLayer(), PCB_BASE_FRAME::SelectOneLayer(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), APPEARANCE_CONTROLS::SetLayerVisible(), PRIVATE_LAYERS_GRID_TABLE::SetValueAsLong(), FP_TEXT_GRID_TABLE::SetValueAsLong(), PNS_KICAD_IFACE_BASE::StackupHeight(), StartPlotBoard(), ROUTER_TOOL::switchLayerOnViaPlacement(), DIALOG_REFERENCE_IMAGE_PROPERTIES::TransferDataFromWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow().