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.
 

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 restoreEnvironment (PDF_PLOTTER *aPlotter, SCH_SHEET_PATH &aOldsheetpath)
 Everything done, close the plot and restore the environment.
 
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

SCHEMATICm_schematic
 
COLOR_SETTINGSm_colorSettings
 
wxString m_lastOutputFilePath
 

Detailed Description

Schematic plotting class.

Definition at line 97 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 57 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 50 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
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 833 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(), createPSFiles(), createSVGFiles(), and getOutputFilenameSingle().

◆ 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 125 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 64 of file sch_plotter.cpp.

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

Referenced by createPDFFile().

◆ 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)
aPlotSettingsThe configuration for the plotting operation
aRenderSettingsMandatory object containing render settings for lower level classes
aReporterOptional reporter to print messages to

Definition at line 875 of file sch_plotter.cpp.

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

Referenced by DIALOG_PRINT::TransferDataFromWindow().

◆ plotOneSheetDXF()

◆ plotOneSheetPDF()

◆ plotOneSheetPS()

◆ plotOneSheetSVG()

◆ restoreEnvironment()

void SCH_PLOTTER::restoreEnvironment ( PDF_PLOTTER * aPlotter,
SCH_SHEET_PATH & aOldsheetpath )
protected

Everything done, close the plot and restore the environment.

Parameters
aPlotterthe plotter to close and destroy (can be null if no current active plotter)
aOldsheetpaththe stored old sheet path for the current sheet before the plot started

Definition at line 818 of file sch_plotter.cpp.

References PDF_PLOTTER::EndPlot(), and m_schematic.

Referenced by createDXFFiles(), createPDFFile(), createPSFiles(), and createSVGFiles().

◆ setupPlotPagePDF()

Member Data Documentation

◆ m_colorSettings

COLOR_SETTINGS* SCH_PLOTTER::m_colorSettings
private

Definition at line 185 of file sch_plotter.h.

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

◆ m_lastOutputFilePath

wxString SCH_PLOTTER::m_lastOutputFilePath
private

◆ m_schematic


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