KiCad PCB EDA Suite
class_pad.cpp File Reference

D_PAD class implementation. More...

#include <fctsys.h>
#include <PolyLine.h>
#include <trigo.h>
#include <macros.h>
#include <msgpanel.h>
#include <base_units.h>
#include <bitmaps.h>
#include <view/view.h>
#include <pcbnew.h>
#include <class_board.h>
#include <class_module.h>
#include <polygon_test_point_inside.h>
#include <convert_to_biu.h>
#include <convert_basic_shapes_to_polygon.h>

Go to the source code of this file.


static wxString LayerMaskDescribe (const BOARD *aBoard, LSET aMask)
 Helper function Return a string (to be shown to the user) describing a layer mask. More...

Detailed Description

D_PAD class implementation.

Definition in file class_pad.cpp.

Function Documentation

wxString LayerMaskDescribe ( const BOARD aBoard,
LSET  aMask 

Helper function Return a string (to be shown to the user) describing a layer mask.

Useful for showing where is a pad. The BOARD is needed because layer names are (somewhat) customizable

Definition at line 1369 of file class_pad.cpp.

References B_Cu, cu, LSET::CuStack(), F_Cu, BOARD::GetEnabledLayers(), BOARD::GetLayerName(), and LSET::Technicals().

Referenced by D_PAD::GetMsgPanelInfo(), and D_PAD::GetSelectMenuText().

1370 {
1371  // Try to be smart and useful. Check all copper first.
1372  if( aMask[F_Cu] && aMask[B_Cu] )
1373  return wxT( "all copper layers" );
1375  // Check for single copper.
1376  LSEQ cu = aBoard->GetEnabledLayers().CuStack();
1378  if( cu )
1379  return aBoard->GetLayerName( *cu );
1381  // No copper; check for single techincal.
1382  LSEQ tech = aBoard->GetEnabledLayers().Technicals();
1384  if( tech )
1385  {
1386  wxString layerInfo = aBoard->GetLayerName( *tech );
1388  if( tech.size() > 1 )
1389  layerInfo << _( " & others" );
1391  return layerInfo;
1392  }
1394  // No copper, no technicals: no layer
1395  return _( "no layers" );
1396 }
LSEQ CuStack() const
Function CuStack returns a sequence of copper layers in starting from the front/top and extending to ...
Definition: lset.cpp:150
#define cu(a)
Definition: auxiliary.h:88
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
LSEQ Technicals(LSET aSubToOmit=LSET()) const
Function Technicals returns a sequence of technical layers.
Definition: lset.cpp:192
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.