refactoring: renamed pcbstruct.h to pcb_display_options.h, DISPLAY_OPTIONS->PCB_DISPLAY_OPTIONS

This commit is contained in:
Tomasz Włostowski 2017-10-30 18:21:07 +01:00
parent 90ab5860dc
commit 81d1e17f02
54 changed files with 473 additions and 357 deletions

View File

@ -38,11 +38,10 @@
#include <wx/sizer.h>
#include <wx/frame.h>
struct MODULE_3D_SETTINGS;
class MODULE_3D_SETTINGS;
class S3D_CACHE;
class S3D_FILENAME_RESOLVER;
class C3D_MODEL_VIEWER;
//class wxGenericDirCtrl;
class DLG_SELECT_3DMODEL : public wxDialog
{

View File

@ -407,6 +407,7 @@ set( PCB_COMMON_SRCS
../pcbnew/kicad_clipboard.cpp
../pcbnew/gpcb_plugin.cpp
../pcbnew/pcb_netlist.cpp
../pcbnew/pcb_display_options.cpp
widgets/widget_net_selector.cpp
pcb_plot_params_keywords.cpp
pcb_keywords.cpp
@ -532,7 +533,7 @@ target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
add_dependencies( dsntest lib-dependencies )
target_link_libraries( pcbcommon 3d-viewer )
target_link_libraries( pcbcommon )
# _kiway.so

View File

@ -96,11 +96,11 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRA
GetScreen()->SetGrid( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 );
// Initialize some display options
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
displ_opts->m_DisplayPadIsol = false; // Pad clearance has no meaning here
// Track and via clearance has no meaning here.
displ_opts->m_ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
displ_opts->m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
ReCreateHToolbar();
@ -249,7 +249,7 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
wxString msgTextsFill[2] = { _( "Show texts in filled mode" ),
_( "Show texts in sketch mode" ) };
@ -264,7 +264,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
void DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
wxString msgEdgesFill[2] = { _( "Show outlines in filled mode" ),
_( "Show outlines in sketch mode" ) };
@ -295,7 +295,7 @@ bool DISPLAY_FOOTPRINTS_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* Po
void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{
int id = event.GetId();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
switch( id )
{

View File

@ -72,7 +72,7 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog()
/* mandatory to use escape key as cancel under wxGTK. */
SetFocus();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
m_EdgesDisplayOption->SetValue( not displ_opts->m_DisplayModEdgeFill );
m_TextDisplayOption->SetValue( not displ_opts->m_DisplayModTextFill );
@ -89,7 +89,7 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog()
void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
displ_opts->m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue();
displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue();

View File

@ -25,7 +25,6 @@
#ifndef BOARD_DESIGN_SETTINGS_H_
#define BOARD_DESIGN_SETTINGS_H_
#include <pcbstruct.h> // NB_COLORS
#include <class_pad.h>
#include <class_track.h>
#include <class_netclass.h>

View File

@ -61,15 +61,13 @@ public:
virtual void Save( wxConfigBase *aConfig ) override;
/**
* Function GetLayerColor
* @return the color for aLayer which is one of the layer indices given
* in pcbstruct.h or in schematic
* @return the color for aLayer which
*/
COLOR4D GetLayerColor( LAYER_NUM aLayer ) const;
/**
* Function SetLayerColor
* sets the color for aLayer which is one of the layer indices given
* in pcbstruct.h or in schematic
* sets the color for aLayer
*/
void SetLayerColor( LAYER_NUM aLayer, COLOR4D aColor );

View File

@ -33,7 +33,6 @@
#define INCLUDE__COMMON_H_
#include <vector>
#include <boost/cstdint.hpp>
#include <wx/wx.h>
#include <wx/confbase.h>

View File

@ -0,0 +1,93 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* 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
*/
/**
* @file pcb_display_options.h
* @brief Definition of PCB_DISPLAY_OPTIONS class
*/
#ifndef PCB_DISPLAY_OPTIONS_H_
#define PCB_DISPLAY_OPTIONS_H_
/**
* Class PCB_DISPLAY_OPTIONS
* handles display options like enable/disable some optional drawings.
*/
class PCB_DISPLAY_OPTIONS
{
public:
/**
* Enum TRACE_CLEARANCE_DISPLAY_MODE_T
* is the set of values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option.
* This parameter controls how to show tracks and vias clearance area.
*/
enum TRACE_CLEARANCE_DISPLAY_MODE_T {
DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas
SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only for new track
* during track creation. */
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only for new track
* during track creation, and shows a via
* clearance area at end of current new
* segment (guide to place a new via
*/
SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS,
/* Show clearance for new, moving and
* dragging tracks and vias
*/
SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas
* for track and vias
*/
};
bool m_DisplayPadFill;
bool m_DisplayViaFill;
bool m_DisplayPadNum; // show pads numbers
bool m_DisplayPadIsol;
bool m_DisplayModEdgeFill; // How to display module drawings ( sketch/ filled )
bool m_DisplayModTextFill; // How to display module texts ( sketch/ filled )
bool m_DisplayPcbTrackFill; // false : tracks are show in sketch mode, true = filled.
/// How trace clearances are displayed. @see TRACE_CLEARANCE_DISPLAY_MODE_T.
TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode;
bool m_DisplayPolarCood;
int m_DisplayZonesMode;
int m_DisplayNetNamesMode; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads
*/
bool m_DisplayDrawItemsFill; // How to display graphic items on board ( sketch/ filled )
bool m_ContrastModeDisplay;
int m_MaxLinksShowed; // in track creation: number of hairwires shown
bool m_Show_Module_Ratsnest; // When moving a footprint: allows displaying a ratsnest
public:
PCB_DISPLAY_OPTIONS();
};
#endif // PCBSTRUCT_H_

View File

@ -40,8 +40,8 @@
#include <eda_text.h> // EDA_DRAW_MODE_T
#include <richio.h>
#include <class_pcb_screen.h>
#include <pcbstruct.h>
#include <pcb_display_options.h>
#include <pcb_general_settings.h>
/* Forward declarations of classes. */
@ -68,7 +68,7 @@ class PCB_GENERAL_SETTINGS ;
class PCB_BASE_FRAME : public EDA_DRAW_FRAME
{
public:
DISPLAY_OPTIONS m_DisplayOptions;
PCB_DISPLAY_OPTIONS m_DisplayOptions;
EDA_UNITS_T m_UserGridUnit;
wxRealPoint m_UserGridSize;

View File

@ -618,7 +618,7 @@ int getOptimalModulePlacement( PCB_EDIT_FRAME* aFrame, MODULE* aModule, wxDC* aD
wxPoint LastPosOK;
double min_cost, curr_cost, Score;
bool TstOtherSide;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aFrame->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)aFrame->GetDisplayOptions();
BOARD* brd = aFrame->GetBoard();
aModule->CalculateBoundingBox();

View File

@ -382,7 +382,7 @@ void PCB_BASE_FRAME::Show3D_Frame( wxCommandEvent& event )
void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
{
PCB_LAYER_ID preslayer = GetActiveLayer();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
// Check if the specified layer matches the present layer
if( layer == preslayer )
@ -431,7 +431,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
SetStatusText( wxEmptyString );
displ_opts->m_DisplayPolarCood = !displ_opts->m_DisplayPolarCood;
@ -442,7 +442,7 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent )
void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
displ_opts->m_DisplayPadFill = !displ_opts->m_DisplayPadFill;
EDA_DRAW_PANEL_GAL* gal = GetGalCanvas();
@ -470,7 +470,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
void PCB_BASE_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
aEvent.Check( displ_opts->m_DisplayPolarCood );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
@ -482,7 +482,8 @@ void PCB_BASE_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
void PCB_BASE_FRAME::OnUpdatePadDrawMode( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
aEvent.Check( !displ_opts->m_DisplayPadFill );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
displ_opts->m_DisplayPadFill ?
@ -621,7 +622,7 @@ void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
if( aId < 0 )
return;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
// handle color changes for transitions in and out of ID_TRACK_BUTT
if( ( GetToolId() == ID_TRACK_BUTT && aId != ID_TRACK_BUTT )
@ -654,7 +655,7 @@ void PCB_BASE_FRAME::UpdateStatusBar()
double dYpos;
wxString line;
wxString locformatter;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
EDA_DRAW_FRAME::UpdateStatusBar();
@ -983,7 +984,7 @@ void PCB_BASE_FRAME::UseGalCanvas( bool aEnable )
// Transfer latest current display options from legacy to GAL canvas:
auto painter = static_cast<KIGFX::PCB_PAINTER*>( galCanvas->GetView()->GetPainter() );
auto settings = painter->GetSettings();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
settings->LoadDisplayOptions( displ_opts );
galCanvas->GetView()->RecacheAllItems();

View File

@ -489,7 +489,7 @@ static void drawMovingBlock( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
BASE_SCREEN* screen = aPanel->GetScreen();
// do not show local module rastnest in block move, it is not usable.
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aPanel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( aPanel->GetDisplayOptions() );
bool showRats = displ_opts->m_Show_Module_Ratsnest;
displ_opts->m_Show_Module_Ratsnest = false;

View File

@ -1088,7 +1088,6 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
}
// virtual, see pcbstruct.h
void BOARD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
{
wxString txt;
@ -1123,7 +1122,6 @@ void BOARD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
}
// virtual, see pcbstruct.h
SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
KICAD_T stype;

View File

@ -327,7 +327,7 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
auto gcolor = frame->Settings().Colors().GetLayerColor( m_Layer );
GRSetDrawMode( DC, mode_color );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
bool filled = displ_opts ? displ_opts->m_DisplayDrawItemsFill : FILLED;
int width = m_Width;

View File

@ -217,7 +217,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
auto color = frame->Settings().Colors().GetLayerColor( GetLayer() );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) panel->GetDisplayOptions();
if( ( draw_mode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay )
{
@ -331,8 +331,6 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
}
}
// see pcbstruct.h
void DRAWSEGMENT::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
{
wxString msg;

View File

@ -123,7 +123,7 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if(( draw_mode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay )
{

View File

@ -93,7 +93,7 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
auto gcolor = frame->Settings().Colors().GetLayerColor( m_Layer );
GRSetDrawMode( DC, mode_color );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
bool filled = displ_opts ? displ_opts->m_DisplayDrawItemsFill : FILLED;
width = m_Width;

View File

@ -127,7 +127,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
wxCHECK_RET( frame != NULL, wxT( "Panel has no parent frame window." ) );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)frame->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( frame->GetDisplayOptions() );
PCB_SCREEN* screen = frame->GetScreen();
if( displ_opts && displ_opts->m_DisplayPadFill == SKETCH )

View File

@ -37,7 +37,7 @@
#include <confirm.h>
#include <wxPcbStruct.h>
#include <pcbstruct.h>
#include <pcb_display_options.h>
#include <layer_widget.h>
#include <macros.h>
#include <menus_helpers.h>
@ -562,7 +562,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
return false;
myframe->SetActiveLayer( layer );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)myframe->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)myframe->GetDisplayOptions();
if( m_alwaysShowActiveCopperLayer )
OnLayerSelected();

View File

@ -83,7 +83,12 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
EDA_DRAW_MODE_T fillmode = FILLED;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = nullptr;
if( panel )
{
displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
}
if( displ_opts && displ_opts->m_DisplayDrawItemsFill == SKETCH )
fillmode = SKETCH;

View File

@ -254,7 +254,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMod
color = frame->Settings().Colors().GetItemColor( LAYER_MOD_TEXT_INVISIBLE );
}
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aPanel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( aPanel->GetDisplayOptions() );
// shade text if high contrast mode is active
if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay )

View File

@ -29,6 +29,7 @@
* @brief Functions relatives to tracks, vias and segments used to fill zones.
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <common.h>
@ -51,14 +52,14 @@
* tests to see if the clearance border is drawn on the given track.
* @return bool - true if should draw clearance, else false.
*/
static bool ShowClearance( DISPLAY_OPTIONS* aDisplOpts, const TRACK* aTrack )
static bool ShowClearance( PCB_DISPLAY_OPTIONS* aDisplOpts, const TRACK* aTrack )
{
// maybe return true for tracks and vias, not for zone segments
return IsCopperLayer( aTrack->GetLayer() )
&& ( aTrack->Type() == PCB_TRACE_T || aTrack->Type() == PCB_VIA_T )
&& ( ( aDisplOpts->m_ShowTrackClearanceMode == SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS
&& ( ( aDisplOpts->m_ShowTrackClearanceMode == PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS
&& ( aTrack->IsDragging() || aTrack->IsMoving() || aTrack->IsNew() ) )
|| ( aDisplOpts->m_ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
|| ( aDisplOpts->m_ShowTrackClearanceMode == PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS )
);
}
@ -554,7 +555,7 @@ void TRACK::DrawShortNetname( EDA_DRAW_PANEL* panel,
* - only tracks with a length > 10 * thickness are eligible
* and, of course, if we are not printing the board
*/
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if( displ_opts->m_DisplayNetNamesMode == 0 || displ_opts->m_DisplayNetNamesMode == 1 )
return;
@ -649,7 +650,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
return;
#endif
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts->m_ContrastModeDisplay )
{
@ -701,7 +702,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
void SEGZONE::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if( displ_opts->m_DisplayZonesMode != 0 )
return;
@ -789,7 +790,7 @@ void VIA::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, const w
int fillvia = 0;
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) panel->GetParent();
PCB_SCREEN* screen = frame->GetScreen();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)frame->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( frame->GetDisplayOptions() );
if( displ_opts->m_DisplayViaFill == FILLED )
fillvia = 1;

View File

@ -34,7 +34,9 @@
#include <pcbnew.h>
#include <class_board_item.h>
#include <class_board_connected_item.h>
#include <PolyLine.h>
#include <pcb_display_options.h>
//#include <PolyLine.h>
#include <trigo.h>
@ -42,7 +44,7 @@ class TRACK;
class VIA;
class D_PAD;
class MSG_PANEL_ITEM;
class SHAPE_POLY_SET;
// Via types
// Note that this enum must be synchronized to GAL_LAYER_ID

View File

@ -361,7 +361,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE aDrawMod
auto color = frame->Settings().Colors().GetLayerColor( draw_layer );
GRSetDrawMode( DC, aDrawMode );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if( displ_opts->m_ContrastModeDisplay )
{
@ -415,7 +415,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
{
static std::vector <wxPoint> CornersBuffer;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
// outline_mode is false to show filled polys,
// and true to show polygons outlines only (test and debug purposes)
@ -563,7 +563,7 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
auto color = frame->Settings().Colors().GetLayerColor( GetLayer() );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if( displ_opts->m_ContrastModeDisplay )
{

View File

@ -1,9 +1,3 @@
/**
* @file classpcb.cpp
* @brief Member functions of classes used in Pcbnew (see pcbstruct.h)
* except for tracks (see class_track.cpp).
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
@ -198,31 +192,3 @@ int PCB_SCREEN::MilsToIuScalar()
{
return (int)IU_PER_MILS;
}
DISPLAY_OPTIONS::DISPLAY_OPTIONS()
{
m_DisplayPadFill = FILLED;
m_DisplayViaFill = FILLED;
m_DisplayPadNum = true;
m_DisplayPadIsol = true;
m_DisplayModEdgeFill = FILLED;
m_DisplayModTextFill = FILLED;
m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled
m_ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
m_DisplayPolarCood = false; /* false = display absolute coordinates,
* true = display polar cordinates */
m_DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones,
* 1 = do not show filled areas outlines
* 2 = show outlines of filled areas */
m_DisplayNetNamesMode = 3; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads */
m_DisplayDrawItemsFill = FILLED;
m_ContrastModeDisplay = false;
m_MaxLinksShowed = 3; // in track creation: number of hairwires shown
m_Show_Module_Ratsnest = true; // When moving a footprint: allows displaying a ratsnest
}

View File

@ -104,7 +104,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
BOARD_ITEM* item;
GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( GetDisplayOptions() );
// Assign to scanList the proper item types desired based on tool type
// or hotkey that is in play.

View File

@ -31,7 +31,7 @@
#include <confirm.h>
#include <pcbnew.h>
#include <wxPcbStruct.h>
#include <pcbstruct.h>
#include <pcb_display_options.h>
#include <config_map.h>
#include <pcbnew_id.h>
@ -46,13 +46,13 @@
#include <widgets/gal_options_panel.h>
static const UTIL::CFG_MAP<TRACE_CLEARANCE_DISPLAY_MODE_T> traceClearanceSelectMap =
static const UTIL::CFG_MAP<PCB_DISPLAY_OPTIONS::TRACE_CLEARANCE_DISPLAY_MODE_T> traceClearanceSelectMap =
{
{ SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, 2 }, // Default
{ DO_NOT_SHOW_CLEARANCE, 0 },
{ SHOW_CLEARANCE_NEW_TRACKS, 1 },
{ SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS, 3 },
{ SHOW_CLEARANCE_ALWAYS, 4 },
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, 2 }, // Default
{ PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, 0 },
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS, 1 },
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS, 3 },
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS, 4 },
};
@ -83,7 +83,7 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) :
bool DIALOG_DISPLAY_OPTIONS::TransferDataToWindow()
{
const DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) m_parent->GetDisplayOptions();
const PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_parent->GetDisplayOptions();
m_OptDisplayTracks->SetValue( displ_opts->m_DisplayPcbTrackFill == SKETCH );
@ -114,7 +114,7 @@ bool DIALOG_DISPLAY_OPTIONS::TransferDataToWindow()
*/
bool DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow()
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) m_parent->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_parent->GetDisplayOptions();
m_parent->SetShowPageLimits( m_Show_Page_Limits->GetValue() );

View File

@ -59,7 +59,7 @@ void DIALOG_GENERALOPTIONS::init()
m_sdbSizerOK->SetDefault();
m_Board = GetParent()->GetBoard();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetParent()->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetParent()->GetDisplayOptions();
/* Set display options */
m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 );
@ -97,7 +97,7 @@ void DIALOG_GENERALOPTIONS::OnCancelClick( wxCommandEvent& event )
void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
{
EDA_UNITS_T ii;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetParent()->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetParent()->GetDisplayOptions();
displ_opts->m_DisplayPolarCood = ( m_PolarDisplay->GetSelection() == 0 ) ? false : true;
ii = g_UserUnit;

View File

@ -68,7 +68,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
INSTALL_UNBUFFERED_DC( dc, m_canvas );
MODULE* module;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
m_canvas->CrossHairOff( &dc );
@ -1352,7 +1352,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
{
PCB_LAYER_ID curLayer = GetActiveLayer();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
// Check if the specified layer matches the present layer
if( layer == curLayer )
@ -1427,7 +1427,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
int lastToolID = GetToolId();
INSTALL_UNBUFFERED_DC( dc, m_canvas );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
// Stop the current command and deselect the current tool.
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );

View File

@ -113,7 +113,7 @@ static void Move_Segment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos
void PCB_EDIT_FRAME::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
{
EDA_ITEM* PtStruct;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
bool tmp = displ_opts->m_DisplayDrawItemsFill;
if( Segment == NULL )
@ -347,7 +347,7 @@ static void DrawSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
if( Segment == NULL )
return;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aPanel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) ( aPanel->GetDisplayOptions() );
bool tmp = displ_opts->m_DisplayDrawItemsFill;
displ_opts->m_DisplayDrawItemsFill = SKETCH;

View File

@ -675,19 +675,19 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
PCB_SCREEN* screen = (PCB_SCREEN*) aPanel->GetScreen();
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) aPanel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) aPanel-> GetDisplayOptions();
bool tmp = displ_opts->m_DisplayPcbTrackFill;
displ_opts->m_DisplayPcbTrackFill = true;
TRACE_CLEARANCE_DISPLAY_MODE_T showTrackClearanceMode = displ_opts->m_ShowTrackClearanceMode;
auto showTrackClearanceMode = displ_opts->m_ShowTrackClearanceMode;
if ( g_FirstTrackSegment == NULL )
return;
NETCLASSPTR netclass = g_FirstTrackSegment->GetNetClass();
if( showTrackClearanceMode != DO_NOT_SHOW_CLEARANCE )
displ_opts->m_ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS;
if( showTrackClearanceMode != PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE )
displ_opts->m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS;
// Values to Via circle
int boardViaRadius = frame->GetDesignSettings().GetCurrentViaSize()/2;
@ -702,7 +702,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
frame->TraceAirWiresToTargets( aDC );
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS )
if( showTrackClearanceMode >= PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS )
{
COLOR4D color = frame->Settings().Colors().GetLayerColor( g_CurrentTrackSegment->GetLayer() );
DrawViaCirclesWhenEditingNewTrack( panelClipBox, aDC, g_CurrentTrackSegment->GetEnd(),
@ -766,7 +766,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
DBG( g_CurrentTrackList.VerifyListIntegrity(); );
DrawTraces( aPanel, aDC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR );
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS )
if( showTrackClearanceMode >= PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS )
{
COLOR4D color = frame->Settings().Colors().GetLayerColor(g_CurrentTrackSegment->GetLayer());

View File

@ -143,7 +143,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway,
// Set some display options here, because the FOOTPRINT_WIZARD_FRAME
// does not have a config menu to do that:
DISPLAY_OPTIONS* disp_opts = (DISPLAY_OPTIONS*) GetDisplayOptions();
auto disp_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
disp_opts->m_DisplayPadIsol = false;
disp_opts->m_DisplayPadNum = true;
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );

View File

@ -70,7 +70,7 @@ bool PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
MODULE* module = NULL;
int evt_type = 0; //Used to post a wxCommandEvent on demand
PCB_SCREEN* screen = GetScreen();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
/* Convert lower to upper case
* (the usual toupper function has problem with non ascii codes like function keys

View File

@ -44,7 +44,7 @@
void FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{
int id = event.GetId();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
bool state = m_optionsToolBar->GetToolToggled( id );
switch( id )
@ -83,7 +83,7 @@ void FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
PARAM_CFG_ARRAY& FOOTPRINT_EDIT_FRAME::GetConfigurationSettings()
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
BOARD_DESIGN_SETTINGS& settings = GetDesignSettings();
// Update everything
@ -148,4 +148,3 @@ PARAM_CFG_ARRAY& FOOTPRINT_EDIT_FRAME::GetConfigurationSettings()
return m_configParams;
}

View File

@ -596,7 +596,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
void FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar( wxUpdateUIEvent& aEvent )
{
int id = aEvent.GetId();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
bool state = false;

View File

@ -380,7 +380,7 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, wxDC* aDC, bool aDoNotRecreat
s_PickedList.ClearItemsList();
}
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
if( displ_opts->m_Show_Module_Ratsnest && aDC )
TraceModuleRatsNest( aDC );

View File

@ -103,7 +103,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
static void Show_MoveNode( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
bool aErase )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) aPanel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) aPanel->GetDisplayOptions();
wxPoint moveVector;
int tmp = displ_opts->m_DisplayPcbTrackFill;
GR_DRAWMODE draw_mode = GR_XOR | GR_HIGHLIGHT;

View File

@ -0,0 +1,59 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* 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
*/
#include <common.h>
#include <pcbnew.h>
#include <class_board_design_settings.h>
#include <layers_id_colors_and_visibility.h>
#include <pcb_display_options.h>
#include <eda_text.h>
PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS()
{
m_DisplayPadFill = FILLED;
m_DisplayViaFill = FILLED;
m_DisplayPadNum = true;
m_DisplayPadIsol = true;
m_DisplayModEdgeFill = FILLED;
m_DisplayModTextFill = FILLED;
m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled
m_ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
m_DisplayPolarCood = false; /* false = display absolute coordinates,
* true = display polar cordinates */
m_DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones,
* 1 = do not show filled areas outlines
* 2 = show outlines of filled areas */
m_DisplayNetNamesMode = 3; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads */
m_DisplayDrawItemsFill = FILLED;
m_ContrastModeDisplay = false;
m_MaxLinksShowed = 3; // in track creation: number of hairwires shown
m_Show_Module_Ratsnest = true; // When moving a footprint: allows displaying a ratsnest
}

View File

@ -117,7 +117,7 @@ EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalTy
if( frame )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) frame->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) frame->GetDisplayOptions();
static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() )->LoadDisplayOptions( displ_opts );
}
}
@ -345,7 +345,7 @@ void PCB_DRAW_PANEL_GAL::OnShow()
if( frame )
{
SetTopLayer( frame->GetActiveLayer() );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) frame->GetDisplayOptions();
static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
m_view->GetPainter()->GetSettings() )->LoadDisplayOptions( displ_opts );
}

View File

@ -38,6 +38,8 @@
#include <layers_id_colors_and_visibility.h>
#include <pcb_painter.h>
#include <pcb_display_options.h>
#include <gal/graphics_abstraction_layer.h>
#include <convert_basic_shapes_to_polygon.h>
@ -118,7 +120,7 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( const COLORS_DESIGN_SETTINGS* aSet
}
void PCB_RENDER_SETTINGS::LoadDisplayOptions( const DISPLAY_OPTIONS* aOptions )
void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS* aOptions )
{
if( aOptions == NULL )
return;
@ -178,23 +180,23 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const DISPLAY_OPTIONS* aOptions )
// Clearance settings
switch( aOptions->m_ShowTrackClearanceMode )
{
case DO_NOT_SHOW_CLEARANCE:
case PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE:
m_clearance = CL_NONE;
break;
case SHOW_CLEARANCE_NEW_TRACKS:
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS:
m_clearance = CL_NEW | CL_TRACKS;
break;
case SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS:
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS:
m_clearance = CL_NEW | CL_TRACKS | CL_VIAS;
break;
case SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS:
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS:
m_clearance = CL_NEW | CL_EDITED | CL_TRACKS | CL_VIAS;
break;
case SHOW_CLEARANCE_ALWAYS:
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS:
m_clearance = CL_NEW | CL_EDITED | CL_EXISTING | CL_TRACKS | CL_VIAS;
break;
}

View File

@ -34,7 +34,7 @@
class EDA_ITEM;
class COLORS_DESIGN_SETTINGS;
class DISPLAY_OPTIONS;
class PCB_DISPLAY_OPTIONS;
class BOARD_ITEM;
class BOARD;
@ -99,7 +99,7 @@ public:
* for vias/pads/tracks and so on).
* @param aOptions are settings that you want to use for displaying items.
*/
void LoadDisplayOptions( const DISPLAY_OPTIONS* aOptions );
void LoadDisplayOptions( const PCB_DISPLAY_OPTIONS* aOptions );
/// @copydoc RENDER_SETTINGS::GetColor()
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;

View File

@ -326,7 +326,7 @@ PARAM_CFG_ARRAY PCB_EDIT_FRAME::GetProjectFileParameters()
PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
if( m_configParams.empty() )
{
@ -344,7 +344,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
&displ_opts->m_DisplayPcbTrackFill, true ) );
m_configParams.push_back( new PARAM_CFG_INT( true, wxT( "TrackDisplayClearance" ),
(int*) &displ_opts->m_ShowTrackClearanceMode,
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) );
PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) );
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "PadFill" ),
&displ_opts->m_DisplayPadFill, true ) );
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "ViaFill" ),

View File

@ -32,7 +32,6 @@
#include <confirm.h>
#include <wxPcbStruct.h>
#include <pcbplot.h>
#include <pcbstruct.h>
#include <base_units.h>
#include <reporter.h>
#include <class_board.h>

View File

@ -51,9 +51,8 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
{
const GR_DRAWMODE drawmode = (GR_DRAWMODE) 0;
int defaultPenSize = Millimeter2iu( 0.2 );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
DISPLAY_OPTIONS save_opt;
auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
PCB_DISPLAY_OPTIONS save_opt;
PRINT_PARAMETERS * printParameters = (PRINT_PARAMETERS*) aData; // can be null
PRINT_PARAMETERS::DrillShapeOptT drillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
@ -73,7 +72,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
displ_opts->m_DisplayModEdgeFill = FILLED;
displ_opts->m_DisplayModTextFill = FILLED;
displ_opts->m_DisplayPcbTrackFill = true;
displ_opts->m_ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
displ_opts->m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
displ_opts->m_DisplayDrawItemsFill = FILLED;
displ_opts->m_DisplayZonesMode = 0;
displ_opts->m_DisplayNetNamesMode = 0;
@ -110,13 +109,13 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
void* aData)
{
const GR_DRAWMODE drawmode = (GR_DRAWMODE) 0;
DISPLAY_OPTIONS save_opt;
PCB_DISPLAY_OPTIONS save_opt;
BOARD* Pcb = GetBoard();
int defaultPenSize = Millimeter2iu( 0.2 );
bool onePagePerLayer = false;
PRINT_PARAMETERS* printParameters = (PRINT_PARAMETERS*) aData; // can be null
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
if( printParameters && printParameters->m_OptionPrintPage == 0 )
onePagePerLayer = true;
@ -186,7 +185,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
displ_opts->m_DisplayModEdgeFill = FILLED;
displ_opts->m_DisplayModTextFill = FILLED;
displ_opts->m_DisplayPcbTrackFill = true;
displ_opts->m_ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
displ_opts->m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
displ_opts->m_DisplayDrawItemsFill = FILLED;
displ_opts->m_DisplayZonesMode = 0;
displ_opts->m_DisplayNetNamesMode = 0;

View File

@ -196,7 +196,7 @@ void PCB_BASE_FRAME::build_ratsnest_module( MODULE* aModule, wxPoint aMoveVector
void PCB_BASE_FRAME::TraceAirWiresToTargets( wxDC* aDC )
{
auto connectivity = GetBoard()->GetConnectivity();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
auto targets = connectivity->NearestUnconnectedTargets( s_ref, s_CursorPos, s_refNet );
@ -221,7 +221,7 @@ void MODULE::DrawOutlinesWhenMoving( EDA_DRAW_PANEL* panel, wxDC* DC,
D_PAD* pt_pad;
DrawEdgesOnly( panel, DC, aMoveVector, GR_XOR );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*) ( panel->GetDisplayOptions() );
// Show pads in sketch mode to speedu up drawings
pad_fill_tmp = displ_opts->m_DisplayPadFill;

View File

@ -898,9 +898,9 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aColor, int aClea
if( m_dispOptions )
{
auto clearanceDisp = m_dispOptions->m_ShowTrackClearanceMode;
pitem->ShowTrackClearance( clearanceDisp != DO_NOT_SHOW_CLEARANCE );
pitem->ShowViaClearance( clearanceDisp != DO_NOT_SHOW_CLEARANCE
&& clearanceDisp != SHOW_CLEARANCE_NEW_TRACKS );
pitem->ShowTrackClearance( clearanceDisp != PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE );
pitem->ShowViaClearance( clearanceDisp != PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE
&& clearanceDisp != PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS );
}
}
@ -1037,5 +1037,5 @@ void PNS_KICAD_IFACE::SetHostFrame( PCB_EDIT_FRAME* aFrame )
m_frame = aFrame;
m_commit.reset( new BOARD_COMMIT( m_frame ) );
m_dispOptions = (DISPLAY_OPTIONS*) m_frame->GetDisplayOptions();
m_dispOptions = (PCB_DISPLAY_OPTIONS*) m_frame->GetDisplayOptions();
}

View File

@ -31,7 +31,7 @@ class PNS_PCBNEW_DEBUG_DECORATOR;
class BOARD;
class BOARD_COMMIT;
class DISPLAY_OPTIONS;
class PCB_DISPLAY_OPTIONS;
namespace KIGFX
{
@ -78,7 +78,7 @@ private:
BOARD* m_board;
PCB_EDIT_FRAME* m_frame;
std::unique_ptr<BOARD_COMMIT> m_commit;
DISPLAY_OPTIONS* m_dispOptions;
PCB_DISPLAY_OPTIONS* m_dispOptions;
};
#endif

View File

@ -157,7 +157,7 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer )
ITEM* rv = NULL;
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)frame->GetDisplayOptions();
for( int i = 0; i < 4; i++ )
{

View File

@ -32,7 +32,6 @@
*/
#include <wxPcbStruct.h>
#include <pcbstruct.h> // HISTORY_NUMBER
#include <confirm.h> // DisplayError()
#include <gestfich.h> // EDA_FileSelector()
#include <trigo.h> // RotatePoint()

View File

@ -733,7 +733,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{
int id = event.GetId();
bool state = event.IsChecked();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
switch( id )
{

View File

@ -120,7 +120,7 @@ void PCB_EDIT_FRAME::OnUpdateScriptingConsoleState( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent )
{
int selected = aEvent.GetId() - ID_TB_OPTIONS_SHOW_ZONES;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
if( aEvent.IsChecked() && ( displ_opts->m_DisplayZonesMode == selected ) )
return;
@ -161,7 +161,7 @@ void PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
aEvent.Check( !displ_opts->m_DisplayViaFill );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH,
displ_opts->m_DisplayViaFill ?
@ -172,7 +172,7 @@ void PCB_EDIT_FRAME::OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
aEvent.Check( !displ_opts->m_DisplayPcbTrackFill );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH,
displ_opts->m_DisplayPcbTrackFill ?
@ -183,7 +183,7 @@ void PCB_EDIT_FRAME::OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
aEvent.Check( displ_opts->m_ContrastModeDisplay );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
displ_opts->m_ContrastModeDisplay ?

View File

@ -154,7 +154,6 @@ TOOL_ACTION PCB_ACTIONS::showLocalRatsnest( "pcbnew.Control.showLocalRatsnest",
AS_GLOBAL, 0,
"", "" );
class ZONE_CONTEXT_MENU : public CONTEXT_MENU
{
public:

View File

@ -263,7 +263,7 @@ int PCBNEW_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent )
auto settings = painter->GetSettings();
// Apply new display options to the GAL canvas
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
displ_opts->m_DisplayPcbTrackFill = !displ_opts->m_DisplayPcbTrackFill;
settings->LoadDisplayOptions( displ_opts );
@ -284,7 +284,7 @@ int PCBNEW_CONTROL::PadDisplayMode( const TOOL_EVENT& aEvent )
auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
auto settings = painter->GetSettings();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
// Apply new display options to the GAL canvas
displ_opts->m_DisplayPadFill = !displ_opts->m_DisplayPadFill;
@ -306,7 +306,7 @@ int PCBNEW_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent )
{
auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
auto settings = painter->GetSettings();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
// Apply new display options to the GAL canvas
displ_opts->m_DisplayViaFill = !displ_opts->m_DisplayViaFill;
@ -328,7 +328,7 @@ int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
{
auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
auto settings = painter->GetSettings();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
// Apply new display options to the GAL canvas
if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayEnable ) )
@ -355,7 +355,7 @@ int PCBNEW_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent )
{
auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
auto settings = painter->GetSettings();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
displ_opts->m_ContrastModeDisplay = !displ_opts->m_ContrastModeDisplay;
settings->LoadDisplayOptions( displ_opts );

View File

@ -295,7 +295,7 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* am_canvas, wxDC* DC, int aNetCode )
static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* aModule,
int ox, int oy, LSET aLayerMask, GR_DRAWMODE draw_mode )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
int tmp = displ_opts->m_DisplayPadFill;