KiCad PCB EDA Suite
pcb_draw_panel_gal.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef PCB_DRAW_PANEL_GAL_H_
26 #define PCB_DRAW_PANEL_GAL_H_
27 
28 #include <class_draw_panel_gal.h>
30 #include <common.h>
31 
32 namespace KIGFX
33 {
34  class WORKSHEET_VIEWITEM;
35  class RATSNEST_VIEWITEM;
36  class PCB_VIEW;
37 }
39 
41 {
42 public:
43  PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition,
44  const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions,
45  GAL_TYPE aGalType = GAL_TYPE_OPENGL );
46 
47  virtual ~PCB_DRAW_PANEL_GAL();
48 
54  void DisplayBoard( BOARD* aBoard );
55 
62  void SetWorksheet( KIGFX::WORKSHEET_VIEWITEM* aWorksheet );
63 
69  void UseColorScheme( const COLORS_DESIGN_SETTINGS* aSettings );
70 
72  virtual void SetHighContrastLayer( int aLayer ) override
73  {
74  SetHighContrastLayer( static_cast< PCB_LAYER_ID >( aLayer ) );
75  }
76 
78  void SetHighContrastLayer( PCB_LAYER_ID aLayer );
79 
81  virtual void SetTopLayer( int aLayer ) override
82  {
83  SetTopLayer( static_cast< PCB_LAYER_ID >( aLayer ) );
84  }
85 
87  void SetTopLayer( PCB_LAYER_ID aLayer );
88 
94  void SyncLayersVisibility( const BOARD* aBoard );
95 
97  void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
98 
100  void OnShow() override;
101 
102  bool SwitchBackend( GAL_TYPE aGalType ) override;
103 
105  void RedrawRatsnest();
106 
108  BOX2I GetDefaultViewBBox() const override;
109 
110 protected:
111 
112  KIGFX::PCB_VIEW* view() const;
113 
115  void setDefaultLayerOrder();
116 
118  void setDefaultLayerDeps();
119 
121  std::unique_ptr<KIGFX::WORKSHEET_VIEWITEM> m_worksheet;
122 
124  std::unique_ptr<KIGFX::RATSNEST_VIEWITEM> m_ratsnest;
125 };
126 
127 #endif /* PCB_DRAW_PANEL_GAL_H_ */
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
std::unique_ptr< KIGFX::WORKSHEET_VIEWITEM > m_worksheet
Currently used worksheet
std::unique_ptr< KIGFX::RATSNEST_VIEWITEM > m_ratsnest
Ratsnest view item
PCB_LAYER_ID
A quick note on layer IDs:
virtual void SetHighContrastLayer(int aLayer) override
>
Board layer functions and definitions.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
The common library.
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
virtual void SetTopLayer(int aLayer) override
>
EDA_UNITS_T
Definition: common.h:159