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.

Functions

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 
)
static

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

1361 {
1362  // Try to be smart and useful. Check all copper first.
1363  if( aMask[F_Cu] && aMask[B_Cu] )
1364  return wxT( "all copper layers" );
1365 
1366  // Check for single copper.
1367  LSEQ cu = aBoard->GetEnabledLayers().CuStack();
1368 
1369  if( cu )
1370  return aBoard->GetLayerName( *cu );
1371 
1372  // No copper; check for single techincal.
1373  LSEQ tech = aBoard->GetEnabledLayers().Technicals();
1374 
1375  if( tech )
1376  {
1377  wxString layerInfo = aBoard->GetLayerName( *tech );
1378 
1379  if( tech.size() > 1 )
1380  layerInfo << _( " & others" );
1381 
1382  return layerInfo;
1383  }
1384 
1385  // No copper, no technicals: no layer
1386  return _( "no layers" );
1387 }
LSEQ CuStack() const
Function CuStack returns a sequence of copper layers in starting from the front/top and extending to ...
Definition: lset.cpp:147
#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:189
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.