Browse Source
refactoring: derive PCB-specific PCB_VIEW from VIEW with the intention of moving PCB_EDIT_FRAME entries used by the tools (e.g. GetActiveLayer) there
pull/5/merge
refactoring: derive PCB-specific PCB_VIEW from VIEW with the intention of moving PCB_EDIT_FRAME entries used by the tools (e.g. GetActiveLayer) there
pull/5/merge
14 changed files with 197 additions and 70 deletions
-
7common/draw_panel_gal.cpp
-
20include/view/view.h
-
2include/view/wx_view_controls.h
-
1pcbnew/CMakeLists.txt
-
8pcbnew/basepcbframe.cpp
-
2pcbnew/dialogs/dialog_display_options.cpp
-
23pcbnew/pcb_draw_panel_gal.cpp
-
4pcbnew/pcb_draw_panel_gal.h
-
3pcbnew/pcb_painter.cpp
-
47pcbnew/pcb_view.cpp
-
63pcbnew/pcb_view.h
-
11pcbnew/tools/pcb_tool.cpp
-
7pcbnew/tools/pcb_tool.h
-
69pcbnew/tools/pcbnew_control.cpp
@ -0,0 +1,47 @@ |
|||
#include <pcb_view.h>
|
|||
#include <pcb_display_options.h>
|
|||
#include <pcb_painter.h>
|
|||
|
|||
namespace KIGFX |
|||
{ |
|||
|
|||
PCB_VIEW::PCB_VIEW( bool aIsDynamic ) : |
|||
VIEW ( aIsDynamic ) |
|||
{ |
|||
|
|||
} |
|||
|
|||
PCB_VIEW::~PCB_VIEW() |
|||
{ |
|||
|
|||
} |
|||
|
|||
void PCB_VIEW::Add( VIEW_ITEM* aItem, int aDrawPriority ) |
|||
{ |
|||
VIEW::Add( aItem, aDrawPriority ); |
|||
} |
|||
|
|||
void PCB_VIEW::Remove( VIEW_ITEM* aItem ) |
|||
{ |
|||
VIEW::Remove( aItem ); |
|||
} |
|||
|
|||
void PCB_VIEW::Update( VIEW_ITEM* aItem, int aUpdateFlags ) |
|||
{ |
|||
VIEW::Update( aItem, aUpdateFlags ); |
|||
} |
|||
|
|||
/// @copydoc VIEW::Update()
|
|||
void PCB_VIEW::Update( VIEW_ITEM* aItem ) |
|||
{ |
|||
VIEW::Update( aItem ); |
|||
} |
|||
|
|||
void PCB_VIEW::UpdateDisplayOptions( PCB_DISPLAY_OPTIONS* aOptions ) |
|||
{ |
|||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetPainter() ); |
|||
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() ); |
|||
settings->LoadDisplayOptions( aOptions ); |
|||
} |
|||
|
|||
}; |
@ -0,0 +1,63 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2013-2016 CERN |
|||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch> |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef __PCB_VIEW_H |
|||
#define __PCB_VIEW_H |
|||
|
|||
#include <layers_id_colors_and_visibility.h> |
|||
#include <view/view.h> |
|||
|
|||
class PCB_DISPLAY_OPTIONS; |
|||
|
|||
namespace KIGFX { |
|||
|
|||
class PCB_VIEW : public VIEW |
|||
{ |
|||
public: |
|||
PCB_VIEW( bool aIsDynamic = true ); |
|||
virtual ~PCB_VIEW(); |
|||
|
|||
/// @copydoc VIEW::Add() |
|||
virtual void Add( VIEW_ITEM* aItem, int aDrawPriority = -1 ) override; |
|||
/// @copydoc VIEW::Remove() |
|||
|
|||
virtual void Remove( VIEW_ITEM* aItem ) override; |
|||
|
|||
/// @copydoc VIEW::Update() |
|||
virtual void Update( VIEW_ITEM* aItem, int aUpdateFlags ) override; |
|||
|
|||
/// @copydoc VIEW::Update() |
|||
virtual void Update( VIEW_ITEM* aItem ) override; |
|||
|
|||
void UpdateDisplayOptions( PCB_DISPLAY_OPTIONS* aOptions ); |
|||
private: |
|||
|
|||
PCB_LAYER_ID m_activeLayer; |
|||
PCB_LAYER_ID m_routeLayerTop; |
|||
PCB_LAYER_ID m_routeLayerBottom; |
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif |
Write
Preview
Loading…
Cancel
Save
Reference in new issue