Cleanup. No changes to execution.

This commit is contained in:
Jeff Young 2020-09-30 23:02:05 +01:00
parent 83e452390d
commit 6abe68fff0
19 changed files with 114 additions and 191 deletions

View File

@ -75,13 +75,10 @@ wxDECLARE_EVENT( BOARD_CHANGED, wxCommandEvent );
class PCB_BASE_FRAME : public EDA_DRAW_FRAME
{
protected:
BOARD* m_Pcb;
PCB_DISPLAY_OPTIONS m_DisplayOptions;
PCB_ORIGIN_TRANSFORMS m_OriginTransforms;
PCBNEW_SETTINGS* m_Settings; // No ownership, just a shortcut
BOARD* m_pcb;
PCB_DISPLAY_OPTIONS m_displayOptions;
PCB_ORIGIN_TRANSFORMS m_originTransforms;
PCBNEW_SETTINGS* m_settings; // No ownership, just a shortcut
virtual void unitsChangeRefresh() override;
@ -155,7 +152,7 @@ public:
* Calling "GetBoardBoundingBox(true)" when edge cuts are turned off will return bbox of
* entire page and border, so we make sure to do "GetBoardBoundingBox(false)" instead.
*/
if( aIncludeAllVisible || ( !aIncludeAllVisible && !m_Pcb->IsLayerVisible( Edge_Cuts ) ) )
if( aIncludeAllVisible || ( !aIncludeAllVisible && !m_pcb->IsLayerVisible( Edge_Cuts ) ) )
return GetBoardBoundingBox( false );
else
return GetBoardBoundingBox( true );
@ -196,7 +193,7 @@ public:
return nullptr;
}
PCBNEW_SETTINGS& Settings() { return *m_Settings; }
PCBNEW_SETTINGS& Settings() { return *m_settings; }
void SetDrawBgColor( COLOR4D aColor ) override;
@ -205,7 +202,7 @@ public:
* Display options control the way tracks, vias, outlines and other things are shown
* (for instance solid or sketch mode)
*/
const PCB_DISPLAY_OPTIONS& GetDisplayOptions() const { return m_DisplayOptions; }
const PCB_DISPLAY_OPTIONS& GetDisplayOptions() const { return m_displayOptions; }
void SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions );
const ZONE_SETTINGS& GetZoneSettings() const;
@ -229,8 +226,8 @@ public:
BOARD* GetBoard() const
{
wxASSERT( m_Pcb );
return m_Pcb;
wxASSERT( m_pcb );
return m_pcb;
}
/**

View File

@ -495,7 +495,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aExisting, MODULE* aNew, BOARD_COM
aNew->SetPosition( aExisting->GetPosition() );
if( aNew->GetLayer() != aExisting->GetLayer() )
aNew->Flip( aNew->GetPosition(), m_Settings->m_FlipLeftRight );
aNew->Flip( aNew->GetPosition(), m_settings->m_FlipLeftRight );
if( aNew->GetOrientation() != aExisting->GetOrientation() )
aNew->SetOrientation( aExisting->GetOrientation() );

View File

@ -260,7 +260,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
GetBoard()->ComputeBoundingBox();
// Save the auxiliary origin for the rest of the module
wxPoint auxOrigin = m_Pcb->GetDesignSettings().m_AuxOrigin;
wxPoint auxOrigin = m_pcb->GetDesignSettings().m_AuxOrigin;
GencadOffsetX = optionsDialog.GetOption( USE_AUX_ORIGIN ) ? auxOrigin.x : 0;
GencadOffsetY = optionsDialog.GetOption( USE_AUX_ORIGIN ) ? auxOrigin.y : 0;

View File

@ -135,7 +135,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
SetCanvas( drawPanel );
SetBoard( new BOARD() );
// In modedit, the default net clearance is not known (it depends on the actual board).
// So we do not show the default clearance, by setting it to 0.
// The footprint or pad specific clearance will be shown.
@ -214,8 +213,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
m_auimgr.AddPane( m_appearancePanel,
EDA_PANE().Name( "LayersManager" ).Right().Layer( 3 )
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" ).Right().Layer( 3 )
.Caption( _( "Appearance" ) ).PaneBorder( false )
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
m_auimgr.AddPane( m_selectionFilterPanel,
@ -465,7 +463,7 @@ void FOOTPRINT_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
GetDesignSettings() = cfg->m_DesignSettings;
m_DisplayOptions = cfg->m_Display;
m_displayOptions = cfg->m_Display;
m_defaultLibWidth = cfg->m_LibWidth;
m_selectionFilterPanel->SetCheckboxesFromFilter( cfg->m_SelectionFilter );
}
@ -479,7 +477,7 @@ void FOOTPRINT_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
PCB_BASE_FRAME::SaveSettings( cfg );
cfg->m_DesignSettings = GetDesignSettings();
cfg->m_Display = m_DisplayOptions;
cfg->m_Display = m_displayOptions;
cfg->m_LibWidth = m_treePane->GetSize().x;
cfg->m_SelectionFilter = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter();
cfg->m_LayerPresets = m_appearancePanel->GetUserLayerPresets();

View File

@ -232,7 +232,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
GetBoard()->Add( loadFootprint( id ) );
}
drawPanel->DisplayBoard( m_Pcb );
drawPanel->DisplayBoard( m_pcb );
m_auimgr.SetManagedWindow( this );
@ -762,7 +762,7 @@ void FOOTPRINT_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
// Fetch display and grid settings from Footprint Editor
auto fpedit = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
m_DisplayOptions = fpedit->m_Display;
m_displayOptions = fpedit->m_Display;
GetGalDisplayOptions().ReadWindowSettings( fpedit->m_Window );
}

View File

@ -497,7 +497,7 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, bool aRecreateRatsnest )
s_ModuleInitialCopy = NULL;
if( aRecreateRatsnest )
m_Pcb->GetConnectivity()->Update( aModule );
m_pcb->GetConnectivity()->Update( aModule );
if( aRecreateRatsnest )
Compile_Ratsnest( true );

View File

@ -160,9 +160,9 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
// Check if component footprint is already on BOARD and only load the footprint from
// the library if it's needed. Nickname can be blank.
if( aNetlist.IsFindByTimeStamp() )
fpOnBoard = m_Pcb->FindModuleByPath( aNetlist.GetComponent( ii )->GetPath() );
fpOnBoard = m_pcb->FindModuleByPath( aNetlist.GetComponent( ii )->GetPath() );
else
fpOnBoard = m_Pcb->FindModuleByReference( aNetlist.GetComponent( ii )->GetReference() );
fpOnBoard = m_pcb->FindModuleByReference( aNetlist.GetComponent( ii )->GetReference() );
bool footprintMisMatch = fpOnBoard && fpOnBoard->GetFPID() != component->GetFPID();

View File

@ -122,13 +122,13 @@ void PCB_BASE_EDIT_FRAME::ActivateGalCanvas()
{
PCB_BASE_FRAME::ActivateGalCanvas();
GetCanvas()->SyncLayersVisibility( m_Pcb );
GetCanvas()->SyncLayersVisibility( m_pcb );
}
void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
bool new_board = ( aBoard != m_Pcb );
bool new_board = ( aBoard != m_pcb );
if( new_board )
{

View File

@ -59,10 +59,10 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
long aStyle, const wxString & aFrameName ) :
EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
m_Pcb( nullptr ),
m_OriginTransforms( *this )
m_pcb( nullptr ),
m_originTransforms( *this )
{
m_Settings = static_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
m_settings = static_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
}
@ -71,7 +71,7 @@ PCB_BASE_FRAME::~PCB_BASE_FRAME()
// Ensure m_canvasType is up to date, to save it in config
m_canvasType = GetCanvas()->GetBackend();
delete m_Pcb;
delete m_pcb;
}
@ -144,10 +144,10 @@ FP_LIB_TABLE* PROJECT::PcbFootprintLibs()
void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
{
if( m_Pcb != aBoard )
if( m_pcb != aBoard )
{
delete m_Pcb;
m_Pcb = aBoard;
delete m_pcb;
m_pcb = aBoard;
wxCommandEvent e( BOARD_CHANGED );
ProcessEventLocally( e );
@ -167,7 +167,7 @@ void PCB_BASE_FRAME::AddModuleToBoard( MODULE* module )
// Put it on FRONT layer (note that it might be stored flipped if the lib is an archive
// built from a board)
if( module->IsFlipped() )
module->Flip( module->GetPosition(), m_Settings->m_FlipLeftRight );
module->Flip( module->GetPosition(), m_settings->m_FlipLeftRight );
// Place it in orientation 0 even if it is not saved with orientation 0 in lib (note that
// it might be stored in another orientation if the lib is an archive built from a board)
@ -241,8 +241,7 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem )
void PCB_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
{
wxASSERT( m_Pcb );
m_Pcb->SetPageSettings( aPageSettings );
m_pcb->SetPageSettings( aPageSettings );
if( GetScreen() )
GetScreen()->InitDataPoints( aPageSettings.GetSizeIU() );
@ -251,40 +250,34 @@ void PCB_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
const PAGE_INFO& PCB_BASE_FRAME::GetPageSettings() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetPageSettings();
return m_pcb->GetPageSettings();
}
const wxSize PCB_BASE_FRAME::GetPageSizeIU() const
{
wxASSERT( m_Pcb );
// this function is only needed because EDA_DRAW_FRAME is not compiled
// with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
// into an application specific source file.
return m_Pcb->GetPageSettings().GetSizeIU();
return m_pcb->GetPageSettings().GetSizeIU();
}
const wxPoint& PCB_BASE_FRAME::GetGridOrigin() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetDesignSettings().m_GridOrigin;
return m_pcb->GetDesignSettings().m_GridOrigin;
}
void PCB_BASE_FRAME::SetGridOrigin( const wxPoint& aPoint )
{
wxASSERT( m_Pcb );
m_Pcb->GetDesignSettings().m_GridOrigin = aPoint;
m_pcb->GetDesignSettings().m_GridOrigin = aPoint;
}
const wxPoint& PCB_BASE_FRAME::GetAuxOrigin() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetDesignSettings().m_AuxOrigin;
return m_pcb->GetDesignSettings().m_AuxOrigin;
}
@ -295,18 +288,10 @@ const wxPoint PCB_BASE_FRAME::GetUserOrigin() const
switch( displ_opts.m_DisplayOrigin )
{
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE:
// No-op
break;
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX:
origin = GetAuxOrigin();
break;
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID:
origin = GetGridOrigin();
break;
default:
wxASSERT( false );
break;
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: break;
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = GetAuxOrigin(); break;
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID: origin = GetGridOrigin(); break;
default: wxASSERT( false ); break;
}
return origin;
@ -314,28 +299,25 @@ const wxPoint PCB_BASE_FRAME::GetUserOrigin() const
ORIGIN_TRANSFORMS& PCB_BASE_FRAME::GetOriginTransforms()
{
return m_OriginTransforms;
return m_originTransforms;
}
const TITLE_BLOCK& PCB_BASE_FRAME::GetTitleBlock() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetTitleBlock();
return m_pcb->GetTitleBlock();
}
void PCB_BASE_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
{
wxASSERT( m_Pcb );
m_Pcb->SetTitleBlock( aTitleBlock );
m_pcb->SetTitleBlock( aTitleBlock );
}
BOARD_DESIGN_SETTINGS& PCB_BASE_FRAME::GetDesignSettings() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetDesignSettings();
return m_pcb->GetDesignSettings();
}
@ -348,37 +330,31 @@ void PCB_BASE_FRAME::SetDrawBgColor( COLOR4D aColor )
const ZONE_SETTINGS& PCB_BASE_FRAME::GetZoneSettings() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetDesignSettings().GetDefaultZoneSettings();
return m_pcb->GetDesignSettings().GetDefaultZoneSettings();
}
void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings )
{
wxASSERT( m_Pcb );
m_Pcb->GetDesignSettings().SetDefaultZoneSettings( aSettings );
m_pcb->GetDesignSettings().SetDefaultZoneSettings( aSettings );
}
const PCB_PLOT_PARAMS& PCB_BASE_FRAME::GetPlotSettings() const
{
wxASSERT( m_Pcb );
return m_Pcb->GetPlotOptions();
return m_pcb->GetPlotOptions();
}
void PCB_BASE_FRAME::SetPlotSettings( const PCB_PLOT_PARAMS& aSettings )
{
wxASSERT( m_Pcb );
m_Pcb->SetPlotOptions( aSettings );
m_pcb->SetPlotOptions( aSettings );
}
EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
{
wxASSERT( m_Pcb );
EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
EDA_RECT area = aBoardEdgesOnly ? m_pcb->GetBoardEdgesBoundingBox() : m_pcb->GetBoundingBox();
if( area.GetWidth() == 0 && area.GetHeight() == 0 )
{
@ -458,7 +434,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
{
// If only one copper layer is enabled, the only such layer that can be selected to
// is the "Copper" layer (so the selection of any other copper layer is disregarded).
if( m_Pcb->GetCopperLayerCount() < 2 )
if( m_pcb->GetCopperLayerCount() < 2 )
{
if( layer != B_Cu )
return;
@ -469,7 +445,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
// layers are also capable of being selected.
else
{
if( layer != B_Cu && layer != F_Cu && layer >= ( m_Pcb->GetCopperLayerCount() - 1 ) )
if( layer != B_Cu && layer != F_Cu && layer >= ( m_pcb->GetCopperLayerCount() - 1 ) )
return;
}
}
@ -487,24 +463,24 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide()
{
GENERAL_COLLECTORS_GUIDE guide( m_Pcb->GetVisibleLayers(), GetActiveLayer(),
GENERAL_COLLECTORS_GUIDE guide( m_pcb->GetVisibleLayers(), GetActiveLayer(),
GetCanvas()->GetView() );
// account for the globals
guide.SetIgnoreMTextsMarkedNoShow( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) );
guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_BK ) );
guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_FR ) );
guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( LAYER_PAD_BK ) );
guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( LAYER_PAD_FR ) );
guide.SetIgnoreThroughHolePads( ! m_Pcb->IsElementVisible( LAYER_PADS_TH ) );
guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
guide.SetIgnoreMTextsMarkedNoShow( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) );
guide.SetIgnoreMTextsOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
guide.SetIgnoreMTextsOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
guide.SetIgnoreModulesOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_BK ) );
guide.SetIgnoreModulesOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_FR ) );
guide.SetIgnorePadsOnBack( ! m_pcb->IsElementVisible( LAYER_PAD_BK ) );
guide.SetIgnorePadsOnFront( ! m_pcb->IsElementVisible( LAYER_PAD_FR ) );
guide.SetIgnoreThroughHolePads( ! m_pcb->IsElementVisible( LAYER_PADS_TH ) );
guide.SetIgnoreModulesVals( ! m_pcb->IsElementVisible( LAYER_MOD_VALUES ) );
guide.SetIgnoreModulesRefs( ! m_pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
guide.SetIgnoreThroughVias( ! m_pcb->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreBlindBuriedVias( ! m_pcb->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreMicroVias( ! m_pcb->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreTracks( ! m_pcb->IsElementVisible( LAYER_TRACKS ) );
return guide;
}
@ -576,8 +552,8 @@ void PCB_BASE_FRAME::UpdateStatusBar()
}
// Transform absolute coordinates for user origin preferences
double userXpos = m_OriginTransforms.ToDisplayAbsX( static_cast<double>( cursorPos.x ) );
double userYpos = m_OriginTransforms.ToDisplayAbsY( static_cast<double>( cursorPos.y ) );
double userXpos = m_originTransforms.ToDisplayAbsX( static_cast<double>( cursorPos.x ) );
double userYpos = m_originTransforms.ToDisplayAbsY( static_cast<double>( cursorPos.y ) );
// Display absolute coordinates:
double dXpos = To_User_Unit( GetUserUnits(), userXpos );
@ -619,8 +595,8 @@ void PCB_BASE_FRAME::UpdateStatusBar()
double relYpos = cursorPos.y - screen->m_LocalOrigin.y;
// Transform relative coordinates for user origin preferences
userXpos = m_OriginTransforms.ToDisplayRelX( relXpos );
userYpos = m_OriginTransforms.ToDisplayRelY( relYpos );
userXpos = m_originTransforms.ToDisplayRelX( relXpos );
userYpos = m_originTransforms.ToDisplayRelY( relYpos );
// Display relative coordinates:
dXpos = To_User_Unit( GetUserUnits(), userXpos );
@ -710,7 +686,7 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
if( cfg )
{
m_DisplayOptions = cfg->m_Display;
m_displayOptions = cfg->m_Display;
m_PolarCoords = cfg->m_PolarCoords;
}
@ -750,7 +726,7 @@ void PCB_BASE_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
if( cfg )
{
cfg->m_Display = m_DisplayOptions;
cfg->m_Display = m_displayOptions;
cfg->m_PolarCoords = m_PolarCoords;
}
}
@ -769,8 +745,8 @@ FOOTPRINT_EDITOR_SETTINGS* PCB_BASE_FRAME::GetFootprintEditorSettings()
MAGNETIC_SETTINGS* PCB_BASE_FRAME::GetMagneticItemsSettings()
{
wxCHECK( m_Settings, nullptr );
return &m_Settings->m_MagneticItems;
wxCHECK( m_settings, nullptr );
return &m_settings->m_MagneticItems;
}
@ -814,7 +790,7 @@ void PCB_BASE_FRAME::ActivateGalCanvas()
if( m_toolManager )
{
m_toolManager->SetEnvironment( m_Pcb, GetCanvas()->GetView(),
m_toolManager->SetEnvironment( m_pcb, GetCanvas()->GetView(),
GetCanvas()->GetViewControls(), config(), this );
}
@ -836,7 +812,7 @@ void PCB_BASE_FRAME::ActivateGalCanvas()
void PCB_BASE_FRAME::SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions )
{
m_DisplayOptions = aOptions;
m_displayOptions = aOptions;
EDA_DRAW_PANEL_GAL* canvas = GetCanvas();
KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( canvas->GetView() );

View File

@ -410,8 +410,8 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
if( m_Pcb )
m_Pcb->ClearProject();
if( m_pcb )
m_pcb->ClearProject();
PCB_BASE_EDIT_FRAME::SetBoard( aBoard );
@ -425,7 +425,7 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
BOARD_ITEM_CONTAINER* PCB_EDIT_FRAME::GetModel() const
{
return m_Pcb;
return m_pcb;
}
@ -435,8 +435,8 @@ void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
// Prepare worksheet template
KIGFX::WS_PROXY_VIEW_ITEM* worksheet;
worksheet = new KIGFX::WS_PROXY_VIEW_ITEM( IU_PER_MILS ,&m_Pcb->GetPageSettings(),
m_Pcb->GetProject(), &m_Pcb->GetTitleBlock() );
worksheet = new KIGFX::WS_PROXY_VIEW_ITEM( IU_PER_MILS, &m_pcb->GetPageSettings(),
m_pcb->GetProject(), &m_pcb->GetTitleBlock() );
worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
BASE_SCREEN* screen = GetScreen();
@ -480,7 +480,7 @@ void PCB_EDIT_FRAME::setupTools()
{
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( m_Pcb, GetCanvas()->GetView(),
m_toolManager->SetEnvironment( m_pcb, GetCanvas()->GetView(),
GetCanvas()->GetViewControls(), config(), this );
m_actions = new PCB_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
@ -1036,7 +1036,7 @@ void PCB_EDIT_FRAME::onBoardLoaded()
ReCreateLayerBox();
// Sync layer and item visibility
GetCanvas()->SyncLayersVisibility( m_Pcb );
GetCanvas()->SyncLayersVisibility( m_pcb );
SetElementVisibility( LAYER_RATSNEST, GetDisplayOptions().m_ShowGlobalRatsnest );

View File

@ -137,14 +137,6 @@ bool PCB_LAYER_WIDGET::isAllowedInFpMode( int aId )
}
bool PCB_LAYER_WIDGET::isLayerAllowedInFpMode( PCB_LAYER_ID aLayer )
{
static LSET allowed = LSET::AllTechMask();
allowed.set( F_Cu ).set( B_Cu );
return allowed.test( aLayer );
}
void PCB_LAYER_WIDGET::AddRightClickMenuItems( wxMenu& menu )
{
AddMenuItem( &menu, ID_SHOW_ALL_COPPER_LAYERS,

View File

@ -154,18 +154,6 @@ protected:
*/
bool isAllowedInFpMode( int aId );
/**
* Function isLayerAllowedInFpMode
*
* User layers, which are not paired, are not shown in layers manager. However a not
* listed layer can be reachable in the graphic item properties dialog.
*
* @param aLayer is the layer id to test
* @return true if PCB_LAYER_ID aLayer has meaning in footprint editor mode.
* and therefore is shown in render panel
*/
bool isLayerAllowedInFpMode( PCB_LAYER_ID aLayer );
/**
* Function OnRightDownLayers
* puts up a popup menu for the layer panel.
@ -173,10 +161,6 @@ protected:
void onRightDownLayers( wxMouseEvent& event );
void onPopupSelection( wxCommandEvent& event );
/// this is for the popup menu, the right click handler has to be installed
/// on every child control within the layer panel.
void installRightLayerClickHandler();
};
#endif // PCB_LAYER_WIDGET_H

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019-2020 Reece R. Pollack <reece@his.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 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
@ -36,23 +36,18 @@ public:
virtual ~PCB_ORIGIN_TRANSFORMS() override;
using ORIGIN_TRANSFORMS::ToDisplay;
virtual long long int ToDisplay( long long int aValue,
COORD_TYPES_T aCoordType ) override;
virtual long long int ToDisplay( long long int aValue, COORD_TYPES_T aCoordType ) override;
virtual double ToDisplay( double aValue,
COORD_TYPES_T aCoordType ) override;
virtual double ToDisplay( double aValue, COORD_TYPES_T aCoordType ) override;
using ORIGIN_TRANSFORMS::FromDisplay;
virtual long long int FromDisplay( long long int aValue,
COORD_TYPES_T aCoordType ) override;
virtual long long int FromDisplay( long long int aValue, COORD_TYPES_T aCoordType ) override;
virtual double FromDisplay( double aValue,
COORD_TYPES_T aCoordType ) override;
virtual double FromDisplay( double aValue, COORD_TYPES_T aCoordType ) override;
/**
@ -161,7 +156,6 @@ public:
return displayValue;
}
template<typename T>
T FromDisplayAbs( T aDisplayValue ) const
{
@ -173,7 +167,6 @@ public:
return internalValue;
}
template<typename T>
T ToDisplayRel( T aInternalValue ) const
{
@ -185,7 +178,6 @@ public:
return displayValue;
}
template<typename T>
T FromDisplayRel( T aDisplayValue ) const
{
@ -197,15 +189,14 @@ public:
return internalValue;
}
protected:
int GetUserXOrigin() const;
int GetUserYOrigin() const;
protected:
const PCB_BASE_FRAME& m_pcbBaseFrame;
const bool& m_invertXAxis;
const bool& m_invertYAxis;
int GetUserXOrigin() const;
int GetUserYOrigin() const;
};
#endif // PCB_ORIGIN_TRANSFORMS_H_

View File

@ -48,7 +48,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus )
if( aDisplayStatus )
{
std::shared_ptr<CONNECTIVITY_DATA> conn = m_Pcb->GetConnectivity();
std::shared_ptr<CONNECTIVITY_DATA> conn = m_pcb->GetConnectivity();
wxString msg;
msg.Printf( wxT( " %d" ), conn->GetPadCount() );
@ -57,7 +57,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus )
msg.Printf( wxT( " %d" ), conn->GetNetCount() - 1 /* Don't include "No Net" in count */ );
AppendMsgPanel( _( "Nets" ), msg, CYAN );
SetMsgPanel( m_Pcb );
SetMsgPanel( m_pcb );
}
}

View File

@ -89,9 +89,7 @@ private:
static SHAPE_POLY_SET makePolysFromRects( const std::deque<EDA_ITEM*>& aItems );
SELECTION_TOOL* m_selectionTool;
CONDITIONAL_MENU* m_menu;
PCB_BASE_FRAME* m_frame;
};

View File

@ -231,10 +231,10 @@ private:
MODE m_mode;
unsigned int m_lineWidth; // Current line width for multi-segment drawing
static const unsigned int WIDTH_STEP; // Amount of width change with one -/+ key press
static const unsigned int WIDTH_STEP; // Amount of width change for one -/+ key press
// give internal access to drawing helper classes
friend class ZONE_CREATE_HELPER;
friend class ZONE_CREATE_HELPER; // give internal access to helper classes
};
#endif /* __DRAWING_TOOL_H */

View File

@ -58,10 +58,7 @@ public:
private:
DIALOG_GROUP_PROPERTIES* m_propertiesDialog;
///> Selection tool used for obtaining selected items
SELECTION_TOOL* m_selectionTool;
std::unique_ptr<BOARD_COMMIT> m_commit;
};

View File

@ -58,13 +58,6 @@ public:
*/
int PlacePad( const TOOL_EVENT& aEvent );
/**
* Function CreatePadFromShapes()
*
* Creates a custom-shaped pad from a set of selected graphical shapes
*/
int CreatePadFromShapes( const TOOL_EVENT& aEvent );
/**
* Enters/exits WYSIWYG pad shape editing
*/
@ -77,9 +70,6 @@ private:
///> Bind handlers to corresponding TOOL_ACTIONs
void setTransitions() override;
///> Determine if there are any footprints on the board
bool haveFootprints();
///> Apply pad settings from board design settings to a pad
int pastePadProperties( const TOOL_EVENT& aEvent );

View File

@ -554,7 +554,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
case UNDO_REDO::FLIPPED:
{
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
item->Flip( aList->m_TransformPoint, m_Settings->m_FlipLeftRight );
item->Flip( aList->m_TransformPoint, m_settings->m_FlipLeftRight );
view->Update( item, KIGFX::LAYERS );
connectivity->Update( item );
item->GetBoard()->OnItemChanged( item );