From 6abe68fff0d769aa72bff600d1dc970a8123c680 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 30 Sep 2020 23:02:05 +0100 Subject: [PATCH] Cleanup. No changes to execution. --- include/pcb_base_frame.h | 21 ++- pcbnew/dialogs/dialog_exchange_footprints.cpp | 2 +- pcbnew/exporters/export_gencad.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 18 +-- pcbnew/footprint_viewer_frame.cpp | 4 +- pcbnew/load_select_footprint.cpp | 2 +- pcbnew/netlist_reader/netlist.cpp | 4 +- pcbnew/pcb_base_edit_frame.cpp | 4 +- pcbnew/pcb_base_frame.cpp | 138 ++++++++---------- pcbnew/pcb_edit_frame.cpp | 14 +- pcbnew/pcb_layer_widget.cpp | 8 - pcbnew/pcb_layer_widget.h | 16 -- pcbnew/pcb_origin_transforms.h | 25 +--- pcbnew/ratsnest/ratsnest.cpp | 4 +- pcbnew/tools/convert_tool.h | 6 +- pcbnew/tools/drawing_tool.h | 18 +-- pcbnew/tools/group_tool.h | 7 +- pcbnew/tools/pad_tool.h | 10 -- pcbnew/undo_redo.cpp | 2 +- 19 files changed, 114 insertions(+), 191 deletions(-) diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index 4fcc13946b..72e30e7566 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -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; } /** diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 055cd4ace7..efd9e690d5 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -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() ); diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 8ed7a61eff..069107db78 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -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; diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index cdd3b5a6fd..6c1ecc6a50 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -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. @@ -201,23 +200,22 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, m_auimgr.SetFlags( wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE ); // Horizontal items; layers 4 - 6 - m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); - m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); + m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) ); + m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer( 6 ) ); m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); // Vertical items; layers 1 - 3 - m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) ); + m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer( 3 ) ); m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(2) .Caption( _( "Libraries" ) ).MinSize( 250, 400 ) .BestSize( m_defaultLibWidth, -1 ) ); 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 ) - .Caption( _( "Appearance" ) ).PaneBorder( false ) - .MinSize( 180, -1 ).BestSize( 180, -1 ) ); + 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, EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 3 ) .Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 ) @@ -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()->GetFilter(); cfg->m_LayerPresets = m_appearancePanel->GetUserLayerPresets(); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index a3894e9d2a..2c94a42042 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -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(); - m_DisplayOptions = fpedit->m_Display; + m_displayOptions = fpedit->m_Display; GetGalDisplayOptions().ReadWindowSettings( fpedit->m_Window ); } diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 500a830010..a56da9b2a8 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -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 ); diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 02ad84dd22..adcef7e6f8 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -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(); diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index 77b63711a4..fface7f089 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -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 ) { diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 74f68b79b7..3ed56dedfe 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -56,13 +56,13 @@ wxDEFINE_EVENT( BOARD_CHANGED, wxCommandEvent ); PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, - 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 ) + 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_Settings = static_cast( Kiface().KifaceSettings() ); + m_settings = static_cast( 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( cursorPos.x ) ); - double userYpos = m_OriginTransforms.ToDisplayAbsY( static_cast( cursorPos.y ) ); + double userXpos = m_originTransforms.ToDisplayAbsX( static_cast( cursorPos.x ) ); + double userYpos = m_originTransforms.ToDisplayAbsY( static_cast( 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( canvas->GetView() ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index dc38577fb3..004b07c5a9 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -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 ); diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index e4e66e5f06..03e5f60522 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -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, diff --git a/pcbnew/pcb_layer_widget.h b/pcbnew/pcb_layer_widget.h index b9b111b1e1..6df3461ec7 100644 --- a/pcbnew/pcb_layer_widget.h +++ b/pcbnew/pcb_layer_widget.h @@ -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 diff --git a/pcbnew/pcb_origin_transforms.h b/pcbnew/pcb_origin_transforms.h index 5857dc98d6..6657b73252 100644 --- a/pcbnew/pcb_origin_transforms.h +++ b/pcbnew/pcb_origin_transforms.h @@ -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 - * 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 T FromDisplayAbs( T aDisplayValue ) const { @@ -173,7 +167,6 @@ public: return internalValue; } - template T ToDisplayRel( T aInternalValue ) const { @@ -185,7 +178,6 @@ public: return displayValue; } - template 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_ diff --git a/pcbnew/ratsnest/ratsnest.cpp b/pcbnew/ratsnest/ratsnest.cpp index 826f5ed046..e57bbf7cdf 100644 --- a/pcbnew/ratsnest/ratsnest.cpp +++ b/pcbnew/ratsnest/ratsnest.cpp @@ -48,7 +48,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus ) if( aDisplayStatus ) { - std::shared_ptr conn = m_Pcb->GetConnectivity(); + std::shared_ptr 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 ); } } diff --git a/pcbnew/tools/convert_tool.h b/pcbnew/tools/convert_tool.h index 5f70642cde..f744935312 100644 --- a/pcbnew/tools/convert_tool.h +++ b/pcbnew/tools/convert_tool.h @@ -88,11 +88,9 @@ private: */ static SHAPE_POLY_SET makePolysFromRects( const std::deque& aItems ); - SELECTION_TOOL* m_selectionTool; - + SELECTION_TOOL* m_selectionTool; CONDITIONAL_MENU* m_menu; - - PCB_BASE_FRAME* m_frame; + PCB_BASE_FRAME* m_frame; }; #endif diff --git a/pcbnew/tools/drawing_tool.h b/pcbnew/tools/drawing_tool.h index 7726fe4f09..302648d574 100644 --- a/pcbnew/tools/drawing_tool.h +++ b/pcbnew/tools/drawing_tool.h @@ -224,17 +224,17 @@ private: ///> Returns the appropriate width for a segment depending on the settings. int getSegmentWidth( PCB_LAYER_ID aLayer ) const; - KIGFX::VIEW* m_view; - KIGFX::VIEW_CONTROLS* m_controls; - BOARD* m_board; - PCB_BASE_EDIT_FRAME* m_frame; - MODE m_mode; + KIGFX::VIEW* m_view; + KIGFX::VIEW_CONTROLS* m_controls; + BOARD* m_board; + PCB_BASE_EDIT_FRAME* m_frame; + 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 + unsigned int m_lineWidth; // Current line width for multi-segment drawing + 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 */ diff --git a/pcbnew/tools/group_tool.h b/pcbnew/tools/group_tool.h index b0aa100327..5a605d7009 100644 --- a/pcbnew/tools/group_tool.h +++ b/pcbnew/tools/group_tool.h @@ -57,11 +57,8 @@ public: void setTransitions() override; private: - DIALOG_GROUP_PROPERTIES* m_propertiesDialog; - - ///> Selection tool used for obtaining selected items - SELECTION_TOOL* m_selectionTool; - + DIALOG_GROUP_PROPERTIES* m_propertiesDialog; + SELECTION_TOOL* m_selectionTool; std::unique_ptr m_commit; }; diff --git a/pcbnew/tools/pad_tool.h b/pcbnew/tools/pad_tool.h index 4741188ffb..6d3d46f5b2 100644 --- a/pcbnew/tools/pad_tool.h +++ b/pcbnew/tools/pad_tool.h @@ -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 ); diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 15ab8d4ed8..0456399598 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -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 );