From 6c9ba52f18d8820c1999b8e89e08c83d17603381 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 18 Aug 2023 18:44:54 +0100 Subject: [PATCH] Clean up naming. --- common/CMakeLists.txt | 1 - pcbnew/CMakeLists.txt | 5 +-- pcbnew/dialogs/dialog_export_svg.cpp | 4 +-- .../export_svg.cpp} | 34 +++++++------------ .../export_svg.h} | 2 +- pcbnew/pcbnew_jobs_handler.cpp | 6 ++-- 6 files changed, 22 insertions(+), 30 deletions(-) rename pcbnew/{pcb_plot_svg.cpp => exporters/export_svg.cpp} (83%) rename pcbnew/{pcb_plot_svg.h => exporters/export_svg.h} (98%) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 035e5b090e..54004bd00d 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -613,7 +613,6 @@ set( PCB_COMMON_SRCS ${CMAKE_SOURCE_DIR}/pcbnew/pcb_painter.cpp ${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/pcb_parser.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_params.cpp - ${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_svg.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_screen.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_view.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcbnew_settings.cpp diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 8f862116ba..08467f88e5 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -52,8 +52,8 @@ set( PCBNEW_DIALOGS dialogs/dialog_drc_base.cpp dialogs/dialog_footprint_checker.cpp dialogs/dialog_footprint_checker_base.cpp - dialogs/dialog_footprint_associations.cpp - dialogs/dialog_footprint_associations_base.cpp + dialogs/dialog_footprint_associations.cpp + dialogs/dialog_footprint_associations_base.cpp dialogs/dialog_footprint_properties.cpp dialogs/dialog_footprint_properties_base.cpp dialogs/dialog_footprint_properties_fp_editor.cpp @@ -207,6 +207,7 @@ set( PCBNEW_EXPORTERS exporters/export_footprint_associations.cpp exporters/export_gencad.cpp exporters/export_idf.cpp + exporters/export_svg.cpp exporters/step/exporter_step.cpp exporters/step/step_pcb_model.cpp exporters/exporter_vrml.cpp diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index aaacd6fd83..1bd1c59337 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include class DIALOG_EXPORT_SVG : public DIALOG_EXPORT_SVG_BASE { @@ -310,7 +310,7 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile ) svgPlotOptions.m_outputFile = svgPath; svgPlotOptions.m_printMaskLayer = m_printMaskLayer; - if( PCB_PLOT_SVG::Plot(m_board, svgPlotOptions ) ) + if( EXPORT_SVG::Plot(m_board, svgPlotOptions ) ) { reporter.Report( wxString::Format( _( "Exported '%s'." ), svgPath ), RPT_SEVERITY_ACTION ); diff --git a/pcbnew/pcb_plot_svg.cpp b/pcbnew/exporters/export_svg.cpp similarity index 83% rename from pcbnew/pcb_plot_svg.cpp rename to pcbnew/exporters/export_svg.cpp index 0fa950d980..5cd77f467e 100644 --- a/pcbnew/pcb_plot_svg.cpp +++ b/pcbnew/exporters/export_svg.cpp @@ -18,18 +18,16 @@ * with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "board.h" +#include "locale_io.h" +#include "pcb_plot_params.h" +#include "export_svg.h" +#include "pcbplot.h" +#include "pgm_base.h" +#include "plotters/plotters_pslike.h" -bool PCB_PLOT_SVG::Plot( BOARD* aBoard, const PCB_PLOT_SVG_OPTIONS& aSvgPlotOptions ) +bool EXPORT_SVG::Plot( BOARD* aBoard, const PCB_PLOT_SVG_OPTIONS& aSvgPlotOptions ) { PCB_PLOT_PARAMS plot_opts; wxString outputFile = aSvgPlotOptions.m_outputFile; @@ -42,21 +40,15 @@ bool PCB_PLOT_SVG::Plot( BOARD* aBoard, const PCB_PLOT_SVG_OPTIONS& aSvgPlotOpti switch( aSvgPlotOptions.m_drillShapeOption ) { default: - case 0: - plot_opts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); - break; - - case 1: - plot_opts.SetDrillMarksType( DRILL_MARKS::SMALL_DRILL_SHAPE ); - break; - - case 2: - plot_opts.SetDrillMarksType( DRILL_MARKS::FULL_DRILL_SHAPE ); - break; + case 0: plot_opts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); break; + case 1: plot_opts.SetDrillMarksType( DRILL_MARKS::SMALL_DRILL_SHAPE ); break; + case 2: plot_opts.SetDrillMarksType( DRILL_MARKS::FULL_DRILL_SHAPE ); break; } } else + { plot_opts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); + } plot_opts.SetSkipPlotNPTH_Pads( false ); diff --git a/pcbnew/pcb_plot_svg.h b/pcbnew/exporters/export_svg.h similarity index 98% rename from pcbnew/pcb_plot_svg.h rename to pcbnew/exporters/export_svg.h index f6954fd3f5..e80b5aa9a7 100644 --- a/pcbnew/pcb_plot_svg.h +++ b/pcbnew/exporters/export_svg.h @@ -41,7 +41,7 @@ struct PCB_PLOT_SVG_OPTIONS int m_drillShapeOption; }; -class PCB_PLOT_SVG +class EXPORT_SVG { public: static bool Plot( BOARD* aBoard, const PCB_PLOT_SVG_OPTIONS& aSvgPlotOptions ); diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index 3e2877d56b..d6f17cf035 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include @@ -156,7 +156,7 @@ int PCBNEW_JOBS_HANDLER::JobExportSvg( JOB* aJob ) if( aJob->IsCli() ) { - if( PCB_PLOT_SVG::Plot( brd, svgPlotOptions ) ) + if( EXPORT_SVG::Plot( brd, svgPlotOptions ) ) m_reporter->Report( _( "Successfully created svg file" ), RPT_SEVERITY_INFO ); else m_reporter->Report( _( "Error creating svg file" ), RPT_SEVERITY_ERROR ); @@ -843,7 +843,7 @@ int PCBNEW_JOBS_HANDLER::doFpExportSvg( JOB_FP_EXPORT_SVG* aSvgJob, const FOOTPR svgPlotOptions.m_printMaskLayer = aSvgJob->m_printMaskLayer; svgPlotOptions.m_plotFrame = false; - if( !PCB_PLOT_SVG::Plot( brd.get(), svgPlotOptions ) ) + if( !EXPORT_SVG::Plot( brd.get(), svgPlotOptions ) ) m_reporter->Report( _( "Error creating svg file" ), RPT_SEVERITY_ERROR );