KiCad PCB EDA Suite
PCB_LAYER_SELECTOR Class Reference
Inheritance diagram for PCB_LAYER_SELECTOR:
LAYER_SELECTOR PCB_ONE_LAYER_SELECTOR SELECT_COPPER_LAYERS_PAIR_DIALOG

Public Member Functions

 PCB_LAYER_SELECTOR (BOARD *aBrd)
 
bool SetLayersOrdered (bool value)
 
bool SetLayersHotkeys (bool value)
 

Public Attributes

struct EDA_HOTKEY_CONFIGm_hotkeys
 

Protected Member Functions

bool IsLayerEnabled (LAYER_NUM aLayer) const override
 
COLOR4D GetLayerColor (LAYER_NUM aLayer) const override
 
wxString GetLayerName (LAYER_NUM aLayer) const override
 
void SetBitmapLayer (wxBitmap &aLayerbmp, LAYER_NUM aLayer)
 

Protected Attributes

BOARDm_brd
 
bool m_layerhotkeys
 

Detailed Description

Definition at line 42 of file sel_layer.cpp.

Constructor & Destructor Documentation

PCB_LAYER_SELECTOR::PCB_LAYER_SELECTOR ( BOARD aBrd)
inline

Definition at line 45 of file sel_layer.cpp.

References m_brd.

45  :
47  {
48  m_brd = aBrd;
49  }

Member Function Documentation

COLOR4D PCB_LAYER_SELECTOR::GetLayerColor ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 62 of file sel_layer.cpp.

References BOARD::GetLayerColor(), and ToLAYER_ID().

Referenced by PCB_ONE_LAYER_SELECTOR::buildList(), SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList(), and SELECT_COPPER_LAYERS_PAIR_DIALOG::SetGridCursor().

63  {
64  return m_brd->GetLayerColor( ToLAYER_ID( aLayer ) );
65  }
COLOR4D GetLayerColor(PCB_LAYER_ID aLayer) const
Function GetLayerColor gets a layer color for any valid layer, including non-copper ones...
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:767
wxString PCB_LAYER_SELECTOR::GetLayerName ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 68 of file sel_layer.cpp.

References BOARD::GetLayerName(), and ToLAYER_ID().

Referenced by PCB_ONE_LAYER_SELECTOR::buildList(), and SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList().

69  {
70  return m_brd->GetLayerName( ToLAYER_ID( aLayer ) );
71  }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:767
bool PCB_LAYER_SELECTOR::IsLayerEnabled ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 55 of file sel_layer.cpp.

References BOARD::IsLayerEnabled().

56  {
57  return m_brd->IsLayerEnabled( PCB_LAYER_ID( aLayer ) );
58  }
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
Function IsLayerEnabled is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:431
PCB_LAYER_ID
A quick note on layer IDs:
void LAYER_SELECTOR::SetBitmapLayer ( wxBitmap &  aLayerbmp,
LAYER_NUM  aLayer 
)
protectedinherited

Definition at line 51 of file class_layer_box_selector.cpp.

References LAYER_SELECTOR::GetLayerColor().

Referenced by GBR_LAYER_BOX_SELECTOR::Resync(), PCB_LAYER_BOX_SELECTOR::Resync(), and LAYER_BOX_SELECTOR::ResyncBitmapOnly().

52 {
53  wxMemoryDC bmpDC;
54  wxBrush brush;
55 
56  // Prepare Bitmap
57  bmpDC.SelectObject( aLayerbmp );
58  brush.SetColour( GetLayerColor( aLayer ).ToColour() );
59  brush.SetStyle( wxBRUSHSTYLE_SOLID );
60 
61  bmpDC.SetBrush( brush );
62  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
63  bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
64  bmpDC.SetPen( *wxBLACK_PEN );
65  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
66 }
virtual COLOR4D GetLayerColor(LAYER_NUM aLayer) const =0
bool LAYER_SELECTOR::SetLayersOrdered ( bool  value)
inherited

Member Data Documentation

BOARD* PCB_LAYER_SELECTOR::m_brd
protected
struct EDA_HOTKEY_CONFIG* LAYER_SELECTOR::m_hotkeys
inherited

Definition at line 46 of file class_layer_box_selector.h.

Referenced by LAYER_SELECTOR::LAYER_SELECTOR().


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