From 624a231cc0147ea8618d4104b408ce6024065532 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 6 Feb 2021 06:43:17 -0800 Subject: [PATCH] Remove unused line width option You had to set the line width in the SVG export dialog in order to change the displayed line width in the 3d viewer. The line width did not affect the SVG export. Removing in favor of the Board design settings for line widths --- 3d-viewer/3d_canvas/create_layer_items.cpp | 4 +- pcbnew/dialogs/dialog_export_svg.cpp | 8 +- pcbnew/dialogs/dialog_export_svg_base.cpp | 21 +-- pcbnew/dialogs/dialog_export_svg_base.fbp | 197 --------------------- pcbnew/dialogs/dialog_export_svg_base.h | 7 +- pcbnew/pcb_edit_frame.cpp | 2 - pcbnew/pcb_plot_params.cpp | 6 - pcbnew/pcb_plot_params.h | 7 - pcbnew/pcbnew_settings.cpp | 7 +- pcbnew/pcbnew_settings.h | 3 +- 10 files changed, 10 insertions(+), 252 deletions(-) diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 41174108f8..8bf7daecb3 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -956,7 +956,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) { if( ( curr_layer_id == F_SilkS ) || ( curr_layer_id == B_SilkS ) ) { - int linewidth = g_DrawDefaultLineThickness; + int linewidth = m_board->GetDesignSettings().m_LineThickness[ LAYER_CLASS_SILK ]; for( PAD* pad : footprint->Pads() ) { @@ -981,7 +981,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) { if( ( curr_layer_id == F_SilkS ) || ( curr_layer_id == B_SilkS ) ) { - const int linewidth = g_DrawDefaultLineThickness; + int linewidth = m_board->GetDesignSettings().m_LineThickness[ LAYER_CLASS_SILK ]; for( PAD* pad : footprint->Pads() ) { diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index 9d0f0936a1..5b3d1a9b70 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -56,7 +56,6 @@ private: wxString m_outputDirectory; bool m_printMirror; bool m_oneFileOnly; - UNIT_BINDER m_lineWidth; void initDialog(); @@ -80,8 +79,7 @@ DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG( PCB_EDIT_FRAME* aParent, BOARD* aBoard ) : m_parent( aParent ), m_printBW( false ), m_printMirror( false ), - m_oneFileOnly( false ), - m_lineWidth( aParent, m_penWidthLabel, m_penWidthCtrl, m_penWidthUnits, true ) + m_oneFileOnly( false ) { m_browseButton->SetBitmap( KiBitmap( small_folder_xpm ) ); @@ -99,7 +97,6 @@ DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG( PCB_EDIT_FRAME* aParent, BOARD* aBoard ) : DIALOG_EXPORT_SVG::~DIALOG_EXPORT_SVG() { - g_DrawDefaultLineThickness = m_lineWidth.GetValue(); m_printBW = m_ModeColorOption->GetSelection(); m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; m_outputDirectory = m_outputDirectoryName->GetValue(); @@ -145,8 +142,6 @@ void DIALOG_EXPORT_SVG::initDialog() m_printMirrorOpt->SetValue( m_printMirror ); m_rbFileOpt->SetSelection( m_oneFileOnly ? 1 : 0 ); - m_lineWidth.SetValue( g_DrawDefaultLineThickness ); - for( LSEQ seq = m_board->GetEnabledLayers().UIOrder(); seq; ++seq ) { PCB_LAYER_ID layer = *seq; @@ -240,7 +235,6 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile ) m_printMirror = m_printMirrorOpt->GetValue(); m_printBW = m_ModeColorOption->GetSelection(); - g_DrawDefaultLineThickness = m_lineWidth.GetValue(); LSET all_selected = getCheckBoxSelectedLayers(); diff --git a/pcbnew/dialogs/dialog_export_svg_base.cpp b/pcbnew/dialogs/dialog_export_svg_base.cpp index cff866b92a..6587d5e984 100644 --- a/pcbnew/dialogs/dialog_export_svg_base.cpp +++ b/pcbnew/dialogs/dialog_export_svg_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020) +// C++ code generated with wxFormBuilder (version 3.9.0 Dec 30 2020) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -77,25 +77,6 @@ DIALOG_EXPORT_SVG_BASE::DIALOG_EXPORT_SVG_BASE( wxWindow* parent, wxWindowID id, wxStaticBoxSizer* sbOptionsSizer; sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - wxBoxSizer* bSizer8; - bSizer8 = new wxBoxSizer( wxHORIZONTAL ); - - m_penWidthLabel = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Default pen size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_penWidthLabel->Wrap( -1 ); - m_penWidthLabel->SetToolTip( _("Selection of the pen size used to draw items which have no pen size specified.") ); - - bSizer8->Add( m_penWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_penWidthCtrl = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer8->Add( m_penWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_penWidthUnits = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_penWidthUnits->Wrap( -1 ); - bSizer8->Add( m_penWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - - sbOptionsSizer->Add( bSizer8, 1, wxEXPAND, 5 ); - wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") }; int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); m_ModeColorOption = new wxRadioBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Print Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS ); diff --git a/pcbnew/dialogs/dialog_export_svg_base.fbp b/pcbnew/dialogs/dialog_export_svg_base.fbp index 2244d81b5c..098b1e55eb 100644 --- a/pcbnew/dialogs/dialog_export_svg_base.fbp +++ b/pcbnew/dialogs/dialog_export_svg_base.fbp @@ -575,203 +575,6 @@ wxVERTICAL 1 none - - 5 - wxEXPAND - 1 - - - bSizer8 - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default pen size: - 0 - - 0 - - - 0 - - 1 - m_penWidthLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Selection of the pen size used to draw items which have no pen size specified. - - - - -1 - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_penWidthCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_penWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 5 wxEXPAND|wxALL diff --git a/pcbnew/dialogs/dialog_export_svg_base.h b/pcbnew/dialogs/dialog_export_svg_base.h index 2ec8cf9d16..c925feed73 100644 --- a/pcbnew/dialogs/dialog_export_svg_base.h +++ b/pcbnew/dialogs/dialog_export_svg_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020) +// C++ code generated with wxFormBuilder (version 3.9.0 Dec 30 2020) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -50,9 +50,6 @@ class DIALOG_EXPORT_SVG_BASE : public DIALOG_SHIM wxCheckListBox* m_CopperLayersList; wxStaticText* m_staticTextTechLayers; wxCheckListBox* m_TechnicalLayersList; - wxStaticText* m_penWidthLabel; - wxTextCtrl* m_penWidthCtrl; - wxStaticText* m_penWidthUnits; wxRadioBox* m_ModeColorOption; wxRadioBox* m_rbSvgPageSizeOpt; wxCheckBox* m_PrintBoardEdgesCtrl; @@ -63,7 +60,7 @@ class DIALOG_EXPORT_SVG_BASE : public DIALOG_SHIM wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - // Virtual event handlers, overide them in your derived class + // Virtual event handlers, override them in your derived class virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonPlot( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 1ae7214d47..7e4121997d 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -918,7 +918,6 @@ void PCB_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) if( cfg ) { m_rotationAngle = cfg->m_RotationAngle; - g_DrawDefaultLineThickness = Millimeter2iu( cfg->m_PlotLineWidth ); m_show_layer_manager_tools = cfg->m_AuiPanels.show_layer_manager; m_showPageLimits = cfg->m_ShowPageLimits; } @@ -935,7 +934,6 @@ void PCB_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) if( cfg ) { cfg->m_RotationAngle = m_rotationAngle; - cfg->m_PlotLineWidth = Iu2Millimeter( g_DrawDefaultLineThickness ); cfg->m_AuiPanels.show_layer_manager = m_show_layer_manager_tools; cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x; cfg->m_AuiPanels.appearance_panel_tab = m_appearancePanel->GetTabIndex(); diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index bd057c5ecc..d1a8791f76 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -46,12 +46,6 @@ #define SVG_PRECISION_DEFAULT 6 -/** - * Default line thickness in internal units used to draw or plot items using a - * default thickness line value (Frame references) - */ -int g_DrawDefaultLineThickness = PLOT_LINEWIDTH_DEFAULT; - // default trailing digits in Gerber coordinates, when units are mm // This is also the max usable precision (i.e. internal Pcbnew Units) static const int gbrDefaultPrecision = 6; diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index e161922a6f..b797f87254 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -347,11 +347,4 @@ public: }; -/** - * Default line thickness in PCnew units used to draw or plot items having a - * default thickness line value (Frame references) (i.e. = 0 ). - * 0 = single pixel line width. - */ -extern int g_DrawDefaultLineThickness; - #endif // PCB_PLOT_PARAMS_H_ diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index bd2747704f..9c45640bcb 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -70,7 +70,6 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_AddUnlockedPads( false ), m_PolarCoords( false ), m_RotationAngle( 900 ), - m_PlotLineWidth( 0.1 ), m_ShowPageLimits( true ), m_PnsSettings( nullptr ), m_FootprintViewerAutoZoom( false ), @@ -188,9 +187,6 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "pcb_display.origin_invert_y_axis", &m_Display.m_DisplayInvertYAxis, false ) ); - m_params.emplace_back( new PARAM( "plot.line_width", - &m_PlotLineWidth, 0.1, 0.01, 5.0 ) ); - m_params.emplace_back( new PARAM( "cleanup.cleanup_vias", &m_Cleanup.cleanup_vias, true ) ); @@ -292,6 +288,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "export_svg.output_dir", &m_ExportSvg.output_dir, "" ) ); + m_params.emplace_back( new PARAM( "export_svg.line_width", + &m_ExportSvg.line_width, DEFAULT_LINE_WIDTH ) ); + m_params.emplace_back( new PARAM_LIST( "export_svg.layers", &m_ExportSvg.layers, {} ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 6cfdc0ed97..c5826ccaa1 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -116,6 +116,7 @@ public: bool plot_board_edges; int page_size; wxString output_dir; + int line_width; std::vector layers; }; @@ -288,8 +289,6 @@ public: int m_RotationAngle; - double m_PlotLineWidth; - bool m_ShowPageLimits; wxString m_FootprintTextShownColumns;