KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_PLOTTER Class Reference

Schematic plotting class. More...

#include <sch_plotter.h>

Public Member Functions

 SCH_PLOTTER (SCH_EDIT_FRAME *aFrame)
 Constructor for usage with a frame having the schematic we want to print loaded.
 
 SCH_PLOTTER (SCHEMATIC *aSch)
 Constructor for usage with a schematic that can be headless.
 
void Plot (PLOT_FORMAT aPlotFormat, const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter=nullptr)
 Perform the plotting of the schematic using the given aPlotFormat and a\ aPlotSettings.
 
wxString GetLastOutputFilePath () const
 Get the last output file path, this is mainly intended for PDFs with the open after plot GUI option.
 
const std::vector< wxString > & GetOutputFilePaths () const
 Get all output file paths generated by the last Plot() call.
 

Protected Member Functions

wxFileName getOutputFilenameSingle (const SCH_PLOT_OPTS &aPlotOpts, REPORTER *aReporter, const wxString &ext)
 Return the output filename for formats where the output is a single file.
 
void createPDFFile (const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter)
 
void plotOneSheetPDF (PLOTTER *aPlotter, SCH_SCREEN *aScreen, const SCH_PLOT_OPTS &aPlotOpts)
 
void setupPlotPagePDF (PLOTTER *aPlotter, SCH_SCREEN *aScreen, const SCH_PLOT_OPTS &aPlotOpts)
 
void createDXFFiles (const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter)
 
bool plotOneSheetDXF (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const VECTOR2I &aPlotOffset, double aScale, const SCH_PLOT_OPTS &aPlotOpts)
 
void createPSFiles (const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter)
 
bool plotOneSheetPS (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const PAGE_INFO &aPageInfo, const VECTOR2I &aPlot0ffset, double aScale, const SCH_PLOT_OPTS &aPlotOpts)
 
void createSVGFiles (const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter)
 
bool plotOneSheetSVG (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const SCH_PLOT_OPTS &aPlotOpts)
 
void createPNGFiles (const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter)
 
bool plotOneSheetPNG (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const SCH_PLOT_OPTS &aPlotOpts)
 
wxFileName createPlotFileName (const SCH_PLOT_OPTS &aPlotOpts, const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
 Create a file name with an absolute path name.
 

Private Attributes

SCHEMATIC * m_schematic
 
COLOR_SETTINGS * m_colorSettings
 
wxString m_lastOutputFilePath
 
std::vector< wxString > m_outputFilePaths
 

Detailed Description

Schematic plotting class.

Definition at line 106 of file sch_plotter.h.

Constructor & Destructor Documentation

◆ SCH_PLOTTER() [1/2]

SCH_PLOTTER::SCH_PLOTTER ( SCH_EDIT_FRAME * aFrame)

Constructor for usage with a frame having the schematic we want to print loaded.

Definition at line 60 of file sch_plotter.cpp.

References m_colorSettings, and m_schematic.

◆ SCH_PLOTTER() [2/2]

SCH_PLOTTER::SCH_PLOTTER ( SCHEMATIC * aSch)

Constructor for usage with a schematic that can be headless.

Definition at line 53 of file sch_plotter.cpp.

References m_colorSettings, and m_schematic.

Member Function Documentation

◆ createDXFFiles()

◆ createPDFFile()

◆ createPlotFileName()

wxFileName SCH_PLOTTER::createPlotFileName ( const SCH_PLOT_OPTS & aPlotOpts,
const wxString & aPlotFileName,
const wxString & aExtension,
REPORTER * aReporter = nullptr )
protected

Create a file name with an absolute path name.

Parameters
aPlotOptsThe configuration for the plotting operation
aPlotFileNamethe name for the file to plot without a path.
aExtensionthe extension for the file to plot.
aReportera point to a REPORTER object use to show messages (can be NULL).
Returns
the created file name.
Exceptions
IO_ERRORon file I/O errors.

Definition at line 1081 of file sch_plotter.cpp.

References _, EnsureFileDirectoryExists(), SCH_PLOT_OPTS::m_outputDirectory, SCHEMATIC_SETTINGS::m_PlotDirectoryName, m_schematic, REPORTER::Report(), RPT_SEVERITY_ERROR, and tracePathsAndFiles.

Referenced by createDXFFiles(), createPNGFiles(), createPSFiles(), createSVGFiles(), and getOutputFilenameSingle().

◆ createPNGFiles()

◆ createPSFiles()

◆ createSVGFiles()

◆ GetLastOutputFilePath()

wxString SCH_PLOTTER::GetLastOutputFilePath ( ) const
inline

Get the last output file path, this is mainly intended for PDFs with the open after plot GUI option.

Definition at line 134 of file sch_plotter.h.

References m_lastOutputFilePath.

Referenced by DIALOG_PRINT::TransferDataFromWindow().

◆ getOutputFilenameSingle()

wxFileName SCH_PLOTTER::getOutputFilenameSingle ( const SCH_PLOT_OPTS & aPlotOpts,
REPORTER * aReporter,
const wxString & ext )
protected

Return the output filename for formats where the output is a single file.

Definition at line 67 of file sch_plotter.cpp.

References createPlotFileName(), SCH_PLOT_OPTS::m_outputFile, and m_schematic.

Referenced by createPDFFile().

◆ GetOutputFilePaths()

const std::vector< wxString > & SCH_PLOTTER::GetOutputFilePaths ( ) const
inline

Get all output file paths generated by the last Plot() call.

Definition at line 139 of file sch_plotter.h.

References m_outputFilePaths.

◆ Plot()

void SCH_PLOTTER::Plot ( PLOT_FORMAT aPlotFormat,
const SCH_PLOT_OPTS & aPlotOpts,
SCH_RENDER_SETTINGS * aRenderSettings,
REPORTER * aReporter = nullptr )

Perform the plotting of the schematic using the given aPlotFormat and a\ aPlotSettings.

Parameters
aPlotFormatThe resulting output plot format (PDF, SVG, DXF, etc).
aPlotOptsThe configuration for the plotting operation.
aRenderSettingsMandatory object containing render settings for lower level classes.
aReporterOptional reporter to print messages to.

Definition at line 1123 of file sch_plotter.cpp.

References createDXFFiles(), createPDFFile(), createPNGFiles(), createPSFiles(), createSVGFiles(), DXF, GetColorSettings(), HPGL, m_colorSettings, m_outputFilePaths, m_schematic, SCH_PLOT_OPTS::m_theme, SCH_PLOT_OPTS::m_variant, PDF, PNG, POST, and SVG.

Referenced by DIALOG_PRINT::TransferDataFromWindow().

◆ plotOneSheetDXF()

◆ plotOneSheetPDF()

◆ plotOneSheetPNG()

bool SCH_PLOTTER::plotOneSheetPNG ( const wxString & aFileName,
SCH_SCREEN * aScreen,
RENDER_SETTINGS * aRenderSettings,
const SCH_PLOT_OPTS & aPlotOpts )
protected

◆ plotOneSheetPS()

◆ plotOneSheetSVG()

◆ setupPlotPagePDF()

Member Data Documentation

◆ m_colorSettings

COLOR_SETTINGS* SCH_PLOTTER::m_colorSettings
private

Definition at line 197 of file sch_plotter.h.

Referenced by Plot(), plotOneSheetDXF(), SCH_PLOTTER(), and SCH_PLOTTER().

◆ m_lastOutputFilePath

wxString SCH_PLOTTER::m_lastOutputFilePath
private

◆ m_outputFilePaths

std::vector<wxString> SCH_PLOTTER::m_outputFilePaths
private

◆ m_schematic


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