KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 * Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef PCB_DRAW_PANEL_GAL_H_
28#define PCB_DRAW_PANEL_GAL_H_
29
31#include <layer_ids.h>
32#include <pcb_view.h>
33
37
39{
40public:
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( BOARD* aBoard, PROGRESS_REPORTER* aReporter = nullptr );
53
60 void SetDrawingSheet( DS_PROXY_VIEW_ITEM* aDrawingSheet );
61
63
64 // TODO(JE) Look at optimizing this out
68 void UpdateColors();
69
71 virtual void SetHighContrastLayer( int aLayer ) override
72 {
73 SetHighContrastLayer( static_cast< PCB_LAYER_ID >( aLayer ) );
74 }
75
78
80 virtual void SetTopLayer( int aLayer ) override
81 {
82 SetTopLayer( static_cast< PCB_LAYER_ID >( aLayer ) );
83 }
84
86 void SetTopLayer( PCB_LAYER_ID aLayer );
87
93 void SyncLayersVisibility( const BOARD* aBoard );
94
96 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
97
99 void OnShow() override;
100
101 bool SwitchBackend( GAL_TYPE aGalType ) override;
102
104 void RedrawRatsnest();
105
107 BOX2I GetDefaultViewBBox() const override;
108
109 virtual KIGFX::PCB_VIEW* GetView() const override;
110
111protected:
114
116 void setDefaultLayerDeps();
117
118protected:
119 std::unique_ptr<DS_PROXY_VIEW_ITEM> m_drawingSheet;
120 std::unique_ptr<RATSNEST_VIEW_ITEM> m_ratsnest;
121};
122
123#endif /* PCB_DRAW_PANEL_GAL_H_ */
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
The base class for create windows for drawing purpose.
@ GAL_TYPE_OPENGL
OpenGL implementation.
void UpdateColors()
Update the color settings in the painter and GAL.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
virtual void SetTopLayer(int aLayer) override
SetTopLayer(), with some extra smarts for PCB.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Called when the window is shown for the first time.
std::unique_ptr< RATSNEST_VIEW_ITEM > m_ratsnest
Ratsnest view item.
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void OnShow() override
Called when the window is shown for the first time.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
void setDefaultLayerOrder()
< Reassign layer order to the initial settings.
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Currently used drawing-sheet.
bool SwitchBackend(GAL_TYPE aGalType) override
Force refresh of the ratsnest visual representation.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
A progress reporter interface for use in multi-threaded environments.
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60