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 (PCB_BASE_FRAME *aFrame)
 
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

PCB_BASE_FRAMEm_frame
 
bool m_layerhotkeys
 

Detailed Description

Definition at line 42 of file sel_layer.cpp.

Constructor & Destructor Documentation

PCB_LAYER_SELECTOR::PCB_LAYER_SELECTOR ( PCB_BASE_FRAME aFrame)
inline

Definition at line 45 of file sel_layer.cpp.

References m_frame.

45  :
47  {
48  m_frame = aFrame;
49  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:52

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 PCB_GENERAL_SETTINGS::Colors(), COLORS_DESIGN_SETTINGS::GetLayerColor(), PCB_BASE_FRAME::Settings(), 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_frame->Settings().Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
65  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:52
PCB_GENERAL_SETTINGS & Settings()
COLORS_DESIGN_SETTINGS & Colors()
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:796
wxString PCB_LAYER_SELECTOR::GetLayerName ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 68 of file sel_layer.cpp.

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

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

69  {
70  return m_frame->GetBoard()->GetLayerName( ToLAYER_ID( aLayer ) );
71  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:52
BOARD * GetBoard() const
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:796
bool PCB_LAYER_SELECTOR::IsLayerEnabled ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 55 of file sel_layer.cpp.

References PCB_BASE_FRAME::GetBoard(), and BOARD::IsLayerEnabled().

56  {
57  return m_frame->GetBoard()->IsLayerEnabled( PCB_LAYER_ID( aLayer ) );
58  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:52
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:439
BOARD * GetBoard() const
PCB_LAYER_ID
A quick note on layer IDs:
void LAYER_SELECTOR::SetBitmapLayer ( wxBitmap &  aLayerbmp,
LAYER_NUM  aLayer 
)
protectedinherited

Definition at line 48 of file layer_box_selector.cpp.

References LAYER_SELECTOR::GetLayerColor(), LAYER_PCB_BACKGROUND, and KIGFX::COLOR4D::WithAlpha().

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

49 {
50  wxMemoryDC bmpDC;
51  wxBrush brush;
52 
53  // Prepare Bitmap
54  bmpDC.SelectObject( aLayerbmp );
55 
56  brush.SetStyle( wxBRUSHSTYLE_SOLID );
57  COLOR4D backgroundColor = GetLayerColor( LAYER_PCB_BACKGROUND );
58  if( backgroundColor != COLOR4D::UNSPECIFIED )
59  {
60  brush.SetColour( backgroundColor.WithAlpha(1.0).ToColour() );
61  bmpDC.SetBrush( brush );
62  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
63  }
64 
65  brush.SetColour( GetLayerColor( aLayer ).ToColour() );
66  bmpDC.SetBrush( brush );
67  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
68 
69  bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
70  bmpDC.SetPen( *wxBLACK_PEN );
71  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
72 }
virtual COLOR4D GetLayerColor(LAYER_NUM aLayer) const =0
COLOR4D WithAlpha(double aAlpha) const
Function WithAlpha Returns a colour with the same colour, but the given alpha.
Definition: color4d.h:237
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
bool LAYER_SELECTOR::SetLayersOrdered ( bool  value)
inherited

Member Data Documentation

PCB_BASE_FRAME* PCB_LAYER_SELECTOR::m_frame
protected

Definition at line 52 of file sel_layer.cpp.

Referenced by PCB_LAYER_SELECTOR().

struct EDA_HOTKEY_CONFIG* LAYER_SELECTOR::m_hotkeys
inherited

Definition at line 46 of file layer_box_selector.h.

Referenced by LAYER_SELECTOR::LAYER_SELECTOR().

bool LAYER_SELECTOR::m_layerhotkeys
protectedinherited

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