KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
PCB_PLOTTER Class Reference

#include <pcb_plotter.h>

Public Member Functions

 PCB_PLOTTER (BOARD *aBoard, REPORTER *aReporter, PCB_PLOT_PARAMS &aParams)
 
bool Plot (const wxString &aOutputPath, const LSEQ &aLayersToPlot, const LSEQ &aCommonLayers, bool aUseGerberFileExtensions, bool aOutputPathIsSingle=false, std::optional< wxString > aLayerName=std::nullopt, std::optional< wxString > aSheetName=std::nullopt, std::optional< wxString > aSheetPath=std::nullopt)
 
bool copperLayerShouldBeSkipped (PCB_LAYER_ID aLayerToPlot)
 All copper layers that are disabled are actually selected This is due to wonkyness in automatically selecting copper layers for plotting when adding more than two layers to a board.
 

Static Public Member Functions

static void BuildPlotFileName (wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
 Complete a plot filename.
 
static void PlotJobToPlotOpts (PCB_PLOT_PARAMS &aOpts, JOB_EXPORT_PCB_PLOT *aJob, REPORTER &aReporter)
 Translate a JOB to PCB_PLOT_PARAMS.
 

Protected Attributes

BOARDm_board
 
PCB_PLOT_PARAMS m_plotOpts
 
REPORTERm_reporter
 

Private Member Functions

LSEQ getPlotSequence (PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq)
 Generates a final LSEQ for plotting by removing duplicates.
 

Detailed Description

Definition at line 33 of file pcb_plotter.h.

Constructor & Destructor Documentation

◆ PCB_PLOTTER()

PCB_PLOTTER::PCB_PLOTTER ( BOARD aBoard,
REPORTER aReporter,
PCB_PLOT_PARAMS aParams 
)

Definition at line 41 of file pcb_plotter.cpp.

Member Function Documentation

◆ BuildPlotFileName()

void PCB_PLOTTER::BuildPlotFileName ( wxFileName *  aFilename,
const wxString &  aOutputDir,
const wxString &  aSuffix,
const wxString &  aExtension 
)
static

Complete a plot filename.

It forces the output directory, adds a suffix to the name, and sets the specified extension. The suffix is usually the layer name and replaces illegal file name character in the suffix with an underscore character.

Parameters
aFilenameis the file name to initialize that contains the base filename.
aOutputDiris the path.
aSuffixis the suffix to add to the base filename.
aExtensionis the file extension.

Definition at line 311 of file pcb_plotter.cpp.

Referenced by BuildPlotFileName(), and Plot().

◆ copperLayerShouldBeSkipped()

bool PCB_PLOTTER::copperLayerShouldBeSkipped ( PCB_LAYER_ID  aLayerToPlot)

All copper layers that are disabled are actually selected This is due to wonkyness in automatically selecting copper layers for plotting when adding more than two layers to a board.

If plot options become accessible to the layers setup dialog please move this functionality there! This skips a copper layer if it is actually disabled on the board.

Definition at line 305 of file pcb_plotter.cpp.

References LSET::AllCuMask(), BOARD::GetEnabledLayers(), and m_board.

Referenced by Plot().

◆ getPlotSequence()

LSEQ PCB_PLOTTER::getPlotSequence ( PCB_LAYER_ID  aLayerToPlot,
LSEQ  aPlotWithAllLayersSeq 
)
private

Generates a final LSEQ for plotting by removing duplicates.

Definition at line 343 of file pcb_plotter.cpp.

References find.

Referenced by Plot().

◆ Plot()

bool PCB_PLOTTER::Plot ( const wxString &  aOutputPath,
const LSEQ aLayersToPlot,
const LSEQ aCommonLayers,
bool  aUseGerberFileExtensions,
bool  aOutputPathIsSingle = false,
std::optional< wxString >  aLayerName = std::nullopt,
std::optional< wxString >  aSheetName = std::nullopt,
std::optional< wxString >  aSheetPath = std::nullopt 
)

◆ PlotJobToPlotOpts()

void PCB_PLOTTER::PlotJobToPlotOpts ( PCB_PLOT_PARAMS aOpts,
JOB_EXPORT_PCB_PLOT aJob,
REPORTER aReporter 
)
static

Translate a JOB to PCB_PLOT_PARAMS.

Definition at line 363 of file pcb_plotter.cpp.

References _, JOB_EXPORT_PCB_PLOT::DXF, JOB_EXPORT_PCB_PLOT::GERBER, SETTINGS_MANAGER::GetAppSettings(), SETTINGS_MANAGER::GetColorSettings(), JOB::GetConfiguredOutputPath(), JSON_SETTINGS::GetFilename(), PGM_BASE::GetSettingsManager(), JOB_EXPORT_PCB_PLOT::HPGL, JOB_EXPORT_PCB_DXF::INCH, JOB_EXPORT_PCB_PLOT::m_blackAndWhite, JOB_EXPORT_PCB_PLOT::m_colorTheme, APP_SETTINGS_BASE::m_ColorTheme, JOB_EXPORT_PCB_GERBERS::m_createJobsFile, JOB_EXPORT_PCB_PLOT::m_crossoutDNPFPsOnFabLayers, JOB_EXPORT_PCB_GERBER::m_disableApertureMacros, JOB_EXPORT_PCB_PLOT::m_drillShapeOption, JOB_EXPORT_PCB_DXF::m_dxfUnits, JOB_EXPORT_PCB_SVG::m_fitPageToBoard, JOB_EXPORT_PCB_PLOT::m_hideDNPFPsOnFabLayers, JOB_EXPORT_PCB_GERBER::m_includeNetlistAttributes, JOB_EXPORT_PCB_PLOT::m_mirror, JOB_EXPORT_PCB_PLOT::m_negative, JOB_EXPORT_PCB_PDF::m_pdfBackFPPropertyPopups, PCB_PLOT_PARAMS::m_PDFBackFPPropertyPopups, JOB_EXPORT_PCB_PDF::m_pdfFrontFPPropertyPopups, PCB_PLOT_PARAMS::m_PDFFrontFPPropertyPopups, JOB_EXPORT_PCB_PDF::m_pdfMetadata, PCB_PLOT_PARAMS::m_PDFMetadata, JOB_EXPORT_PCB_PDF::m_pdfSingle, PCB_PLOT_PARAMS::m_PDFSingle, JOB_EXPORT_PCB_PLOT::m_plotDrawingSheet, JOB_EXPORT_PCB_PLOT::m_plotFootprintValues, JOB_EXPORT_PCB_PLOT::m_plotFormat, JOB_EXPORT_PCB_DXF::m_plotGraphicItemsUsingContours, JOB_EXPORT_PCB_PLOT::m_plotLayerSequence, JOB_EXPORT_PCB_PLOT::m_plotOnAllLayersSequence, JOB_EXPORT_PCB_PLOT::m_plotPadNumbers, JOB_EXPORT_PCB_PLOT::m_plotRefDes, JOB_EXPORT_PCB_DXF::m_polygonMode, JOB_EXPORT_PCB_GERBER::m_precision, JOB_EXPORT_PCB_SVG::m_precision, JOB_EXPORT_PCB_PLOT::m_sketchDNPFPsOnFabLayers, JOB_EXPORT_PCB_PLOT::m_sketchPadsOnFabLayers, JOB_EXPORT_PCB_PLOT::m_subtractSolderMaskFromSilk, JOB_EXPORT_PCB_PLOT::m_useDrillOrigin, JOB_EXPORT_PCB_GERBER::m_useProtelFileExtension, JOB_EXPORT_PCB_GERBER::m_useX2Format, JOB_EXPORT_PCB_PLOT::PDF, Pgm(), JOB_EXPORT_PCB_PLOT::POST, REPORTER::Report(), RPT_SEVERITY_WARNING, PCB_PLOT_PARAMS::SetBlackAndWhite(), PCB_PLOT_PARAMS::SetColorSettings(), PCB_PLOT_PARAMS::SetCreateGerberJobFile(), PCB_PLOT_PARAMS::SetCrossoutDNPFPsOnFabLayers(), PCB_PLOT_PARAMS::SetDisableGerberMacros(), PCB_PLOT_PARAMS::SetDrillMarksType(), PCB_PLOT_PARAMS::SetDXFPlotPolygonMode(), PCB_PLOT_PARAMS::SetDXFPlotUnits(), PCB_PLOT_PARAMS::SetFormat(), PCB_PLOT_PARAMS::SetGerberPrecision(), PCB_PLOT_PARAMS::SetHideDNPFPsOnFabLayers(), PCB_PLOT_PARAMS::SetIncludeGerberNetlistInfo(), PCB_PLOT_PARAMS::SetLayerSelection(), PCB_PLOT_PARAMS::SetMirror(), PCB_PLOT_PARAMS::SetNegative(), PCB_PLOT_PARAMS::SetOutputDirectory(), PCB_PLOT_PARAMS::SetPlotFrameRef(), PCB_PLOT_PARAMS::SetPlotMode(), PCB_PLOT_PARAMS::SetPlotOnAllLayersSequence(), PCB_PLOT_PARAMS::SetPlotPadNumbers(), PCB_PLOT_PARAMS::SetPlotReference(), PCB_PLOT_PARAMS::SetPlotValue(), PCB_PLOT_PARAMS::SetSketchDNPFPsOnFabLayers(), PCB_PLOT_PARAMS::SetSketchPadsOnFabLayers(), PCB_PLOT_PARAMS::SetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::SetSvgFitPageToBoard(), PCB_PLOT_PARAMS::SetSvgPrecision(), PCB_PLOT_PARAMS::SetUseAuxOrigin(), PCB_PLOT_PARAMS::SetUseGerberProtelExtensions(), PCB_PLOT_PARAMS::SetUseGerberX2format(), and JOB_EXPORT_PCB_PLOT::SVG.

Referenced by DIALOG_PLOT::DIALOG_PLOT(), PCBNEW_JOBS_HANDLER::doFpExportSvg(), PCBNEW_JOBS_HANDLER::JobExportDxf(), PCBNEW_JOBS_HANDLER::JobExportPdf(), and PCBNEW_JOBS_HANDLER::JobExportSvg().

Member Data Documentation

◆ m_board

BOARD* PCB_PLOTTER::m_board
protected

Definition at line 77 of file pcb_plotter.h.

Referenced by copperLayerShouldBeSkipped(), and Plot().

◆ m_plotOpts

PCB_PLOT_PARAMS PCB_PLOTTER::m_plotOpts
protected

Definition at line 78 of file pcb_plotter.h.

Referenced by Plot().

◆ m_reporter

REPORTER* PCB_PLOTTER::m_reporter
protected

Definition at line 79 of file pcb_plotter.h.

Referenced by Plot().


The documentation for this class was generated from the following files: