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 
31 namespace KIGFX
32 {
33  class WORKSHEET_VIEWITEM;
34  class RATSNEST_VIEWITEM;
35 }
37 
39 {
40 public:
41  PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition,
42  const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions,
43  GAL_TYPE aGalType = GAL_TYPE_OPENGL );
44 
45  virtual ~PCB_DRAW_PANEL_GAL();
46 
52  void DisplayBoard( const BOARD* aBoard );
53 
60  void SetWorksheet( KIGFX::WORKSHEET_VIEWITEM* aWorksheet );
61 
67  void UseColorScheme( const COLORS_DESIGN_SETTINGS* aSettings );
68 
70  virtual void SetHighContrastLayer( int aLayer ) override
71  {
72  SetHighContrastLayer( static_cast< LAYER_ID >( aLayer ) );
73  }
74 
76  void SetHighContrastLayer( LAYER_ID aLayer );
77 
79  virtual void SetTopLayer( int aLayer ) override
80  {
81  SetTopLayer( static_cast< LAYER_ID >( aLayer ) );
82  }
83 
85  void SetTopLayer( LAYER_ID aLayer );
86 
92  void SyncLayersVisibility( const BOARD* aBoard );
93 
95  void GetMsgPanelInfo( std::vector<MSG_PANEL_ITEM>& aList ) override;
96 
98  void OnShow() override;
99 
100  bool SwitchBackend( GAL_TYPE aGalType ) override;
101 
102 protected:
104  void setDefaultLayerOrder();
105 
107  void setDefaultLayerDeps();
108 
110  std::unique_ptr<KIGFX::WORKSHEET_VIEWITEM> m_worksheet;
111 
113  std::unique_ptr<KIGFX::RATSNEST_VIEWITEM> m_ratsnest;
114 };
115 
116 #endif /* PCB_DRAW_PANEL_GAL_H_ */
void SetWorksheet(KIGFX::WORKSHEET_VIEWITEM *aWorksheet)
Function SetWorksheet Sets (or updates) worksheet used by the draw panel.
void DisplayBoard(const BOARD *aBoard)
Function DisplayBoard adds all items from the current board to the VIEW, so they can be displayed by ...
void setDefaultLayerDeps()
Sets rendering targets & dependencies for layers.
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:56
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
>
void setDefaultLayerOrder()
Reassigns layer order to the initial settings.
std::unique_ptr< KIGFX::WORKSHEET_VIEWITEM > m_worksheet
Currently used worksheet
std::unique_ptr< KIGFX::RATSNEST_VIEWITEM > m_ratsnest
Ratsnest view item
PCB_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
void SyncLayersVisibility(const BOARD *aBoard)
Function SyncLayersVisibility Updates "visibility" property of each layer of a given BOARD...
void UseColorScheme(const COLORS_DESIGN_SETTINGS *aSettings)
Function UseColorScheme Applies layer color settings.
virtual void SetHighContrastLayer(int aLayer) override
>
bool SwitchBackend(GAL_TYPE aGalType) override
Function SwitchBackend Switches method of rendering graphics.
Board layer functions and definitions.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Eeschema, Pcbnew and GerbView...
virtual void SetTopLayer(int aLayer) override
>
void OnShow() override
>