KiCad PCB EDA Suite
|
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 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) |
Returns 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 | createHPGLFiles (const SCH_PLOT_OPTS &aPlotOpts, SCH_RENDER_SETTINGS *aRenderSettings, REPORTER *aReporter) |
bool | plotOneSheetHpgl (const wxString &aFileName, SCH_SCREEN *aScreen, const PAGE_INFO &aPageInfo, RENDER_SETTINGS *aRenderSettings, const VECTOR2I &aPlot0ffset, 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 | |
SCHEMATIC * | m_schematic |
COLOR_SETTINGS * | m_colorSettings |
wxString | m_lastOutputFilePath |
Schematic plotting class.
Definition at line 125 of file sch_plotter.h.
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 80 of file sch_plotter.cpp.
References m_colorSettings.
SCH_PLOTTER::SCH_PLOTTER | ( | SCHEMATIC * | aSch | ) |
Constructor for usage with a schematic that can be headless.
Definition at line 73 of file sch_plotter.cpp.
References m_colorSettings.
|
protected |
Definition at line 852 of file sch_plotter.cpp.
References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCHEMATIC::CurrentSheet(), DXF_PLOTTER::GetDefaultFileExtension(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), m_lastOutputFilePath, SCH_PLOT_OPTS::m_plotAll, SCH_PLOT_OPTS::m_plotPages, m_schematic, plotOneSheetDXF(), REPORTER::Report(), REPORTER::ReportTail(), restoreEnvironment(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, SCHEMATIC::SetCurrentSheet(), SCHEMATIC::SetSheetNumberAndCount(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_LIST::TrimToPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().
Referenced by Plot().
|
protected |
Definition at line 666 of file sch_plotter.cpp.
References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCHEMATIC::CurrentSheet(), HPGL_PLOTTER::GetDefaultFileExtension(), PAGE_INFO::GetHeightIU(), SCH_SCREEN::GetPageSettings(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), PAGE_INFO::GetWidthIU(), PAGE_INFO::GetWidthMils(), EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::LastScreen(), SCH_PLOT_OPTS::m_HPGLPaperSizeSelect, SCH_PLOT_OPTS::m_HPGLPlotOrigin, SCH_PLOT_OPTS::m_plotAll, SCH_PLOT_OPTS::m_plotPages, m_schematic, plot_sheet_list(), plotOneSheetHpgl(), REPORTER::Report(), REPORTER::ReportTail(), restoreEnvironment(), SCHEMATIC::Root(), SCHEMATIC::RootScreen(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, schIUScale, SCHEMATIC::SetCurrentSheet(), SCHEMATIC::SetSheetNumberAndCount(), PAGE_INFO::SetType(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_LIST::TrimToPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), IO_ERROR::What(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Plot().
|
protected |
Definition at line 110 of file sch_plotter.cpp.
References _, SCH_SHEET_LIST::BuildSheetList(), PDF_PLOTTER::ClosePage(), SCHEMATIC::CurrentSheet(), ExpandTextVars(), PDF_PLOTTER::GetDefaultFileExtension(), getOutputFilenameSingle(), TITLE_BLOCK::GetTitle(), SCH_SCREEN::GetTitleBlock(), SCH_SHEET_PATH::LastScreen(), SCH_PLOT_OPTS::m_blackAndWhite, m_lastOutputFilePath, SCH_PLOT_OPTS::m_PDFMetadata, SCH_PLOT_OPTS::m_plotAll, SCH_PLOT_OPTS::m_plotPages, m_schematic, PDF_PLOTTER::OpenFile(), plotOneSheetPDF(), SCHEMATIC::Prj(), REPORTER::Report(), REPORTER::ReportTail(), SCHEMATIC::ResolveTextVar(), restoreEnvironment(), SCHEMATIC::Root(), SCHEMATIC::RootScreen(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, PLOTTER::SetAuthor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), SCHEMATIC::SetCurrentSheet(), PLOTTER::SetRenderSettings(), SCHEMATIC::SetSheetNumberAndCount(), PLOTTER::SetSubject(), PLOTTER::SetTitle(), setupPlotPagePDF(), SHEETNAME, SCH_SHEET_LIST::SortByPageNumbers(), PDF_PLOTTER::StartPage(), PDF_PLOTTER::StartPlot(), SCH_SHEET_LIST::TrimToPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().
Referenced by Plot().
|
protected |
Create a file name with an absolute path name.
aPlotFileName | the name for the file to plot without a path. |
aExtension | the extension for the file to plot. |
aReporter | a point to a REPORTER object use to show messages (can be NULL). |
IO_ERROR | on file I/O errors. |
Definition at line 1016 of file sch_plotter.cpp.
References _, EnsureFileDirectoryExists(), SCH_PLOT_OPTS::m_outputDirectory, SCHEMATIC_SETTINGS::m_PlotDirectoryName, m_schematic, REPORTER::Report(), RPT_SEVERITY_ERROR, SCHEMATIC::Settings(), and tracePathsAndFiles.
Referenced by createDXFFiles(), createHPGLFiles(), createPSFiles(), createSVGFiles(), and getOutputFilenameSingle().
|
protected |
Definition at line 317 of file sch_plotter.cpp.
References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCHEMATIC::CurrentSheet(), PS_PLOTTER::GetDefaultFileExtension(), PAGE_INFO::GetHeightMils(), SCH_SCREEN::GetPageSettings(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), SCH_SHEET_PATH::LastScreen(), m_lastOutputFilePath, SCH_PLOT_OPTS::m_pageSizeSelect, SCH_PLOT_OPTS::m_plotAll, SCH_PLOT_OPTS::m_plotPages, m_schematic, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, plotOneSheetPS(), REPORTER::Report(), REPORTER::ReportTail(), restoreEnvironment(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, scale, SCHEMATIC::SetCurrentSheet(), PAGE_INFO::SetPortrait(), SCHEMATIC::SetSheetNumberAndCount(), PAGE_INFO::SetType(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_LIST::TrimToPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().
Referenced by Plot().
|
protected |
Definition at line 491 of file sch_plotter.cpp.
References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCHEMATIC::CurrentSheet(), SVG_PLOTTER::GetDefaultFileExtension(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), m_lastOutputFilePath, SCH_PLOT_OPTS::m_plotAll, SCH_PLOT_OPTS::m_plotPages, m_schematic, plotOneSheetSVG(), REPORTER::Report(), REPORTER::ReportTail(), restoreEnvironment(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, SCHEMATIC::SetCurrentSheet(), SCHEMATIC::SetSheetNumberAndCount(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_LIST::TrimToPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().
Referenced by Plot().
|
inline |
Get the last output file path, this is mainly intended for PDFs with the open after plot GUI option.
Definition at line 152 of file sch_plotter.h.
References m_lastOutputFilePath.
|
protected |
Returns the output filename for formats where the output is a single file.
Definition at line 87 of file sch_plotter.cpp.
References createPlotFileName(), SCHEMATIC::GetUniqueFilenameForCurrentSheet(), SCH_PLOT_OPTS::m_outputFile, and m_schematic.
Referenced by createPDFFile().
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 aPlotSettings.
aPlotFormat | The resulting output plot format (PDF, SVG, DXF, etc) |
aPlotSettings | The configuration for the plotting operation |
aRenderSettings | Mandatory object containing render settings for lower level classes |
aReporter | Optional reporter to print messages to |
Definition at line 1057 of file sch_plotter.cpp.
References createDXFFiles(), createHPGLFiles(), createPDFFile(), createPSFiles(), createSVGFiles(), SETTINGS_MANAGER::GetColorSettings(), PGM_BASE::GetSettingsManager(), m_colorSettings, SCH_PLOT_OPTS::m_theme, and Pgm().
|
protected |
Definition at line 946 of file sch_plotter.cpp.
References color, SCHEMATIC::CurrentSheet(), DXF_PLOTTER::EndPlot(), PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), SCH_SHEET::GetName(), BASE_SCREEN::GetPageCount(), SCH_SHEET_PATH::GetPageNumber(), BASE_SCREEN::GetPageNumber(), SCH_SCREEN::GetPageSettings(), SCHEMATIC::GetProperties(), SCH_SCREEN::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::Last(), LAYER_SCHEMATIC_DRAWINGSHEET, KIGFX::RENDER_SETTINGS::LoadColors(), SCH_PLOT_OPTS::m_blackAndWhite, m_colorSettings, SCH_PLOT_OPTS::m_plotDrawingSheet, m_schematic, PLOTTER::OpenFile(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), schIUScale, PLOTTER::SetColorMode(), PLOTTER::SetCreator(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), DXF_PLOTTER::SetViewport(), and DXF_PLOTTER::StartPlot().
Referenced by createDXFFiles().
|
protected |
Definition at line 780 of file sch_plotter.cpp.
References SCHEMATIC::CurrentSheet(), HPGL_PLOTTER::EndPlot(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetName(), BASE_SCREEN::GetPageCount(), SCH_SHEET_PATH::GetPageNumber(), BASE_SCREEN::GetPageNumber(), SCHEMATIC::GetProperties(), SCH_SCREEN::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::Last(), KIGFX::RENDER_SETTINGS::LoadColors(), m_colorSettings, SCH_PLOT_OPTS::m_HPGLPenSize, SCH_PLOT_OPTS::m_HPGLPlotOrigin, SCH_PLOT_OPTS::m_plotDrawingSheet, m_schematic, EDA_IU_SCALE::mmToIU(), PLOTTER::OpenFile(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), schIUScale, PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), HPGL_PLOTTER::SetPenDiameter(), PLOTTER::SetRenderSettings(), HPGL_PLOTTER::SetTargetChordLength(), HPGL_PLOTTER::SetUserCoords(), HPGL_PLOTTER::SetUserCoordsFit(), HPGL_PLOTTER::SetViewport(), and HPGL_PLOTTER::StartPlot().
Referenced by createHPGLFiles().
|
protected |
Definition at line 247 of file sch_plotter.cpp.
References color, SCHEMATIC::CurrentSheet(), KIGFX::RENDER_SETTINGS::GetBackgroundColor(), PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), PAGE_INFO::GetHeightIU(), KIGFX::RENDER_SETTINGS::GetLayerColor(), SCH_SHEET::GetName(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_SCREEN::GetPageSettings(), SCHEMATIC::GetProperties(), SCH_SCREEN::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), PAGE_INFO::GetWidthIU(), EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::Last(), LAYER_SCHEMATIC_DRAWINGSHEET, SCH_PLOT_OPTS::m_plotDrawingSheet, m_schematic, SCH_PLOT_OPTS::m_useBackgroundColor, PLOTTER::PageSettings(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), PLOTTER::Rect(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), schIUScale, and PLOTTER::SetColor().
Referenced by createPDFFile().
|
protected |
Definition at line 433 of file sch_plotter.cpp.
References color, SCHEMATIC::CurrentSheet(), PS_PLOTTER::EndPlot(), PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), PAGE_INFO::GetHeightIU(), KIGFX::RENDER_SETTINGS::GetLayerColor(), SCH_SHEET::GetName(), BASE_SCREEN::GetPageCount(), SCH_SHEET_PATH::GetPageNumber(), BASE_SCREEN::GetPageNumber(), SCHEMATIC::GetProperties(), SCH_SCREEN::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), PAGE_INFO::GetWidthIU(), EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::Last(), LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_DRAWINGSHEET, SCH_PLOT_OPTS::m_blackAndWhite, SCH_PLOT_OPTS::m_plotDrawingSheet, m_schematic, SCH_PLOT_OPTS::m_useBackgroundColor, PLOTTER::OpenFile(), PLOTTER::PageSettings(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), PS_PLOTTER::Rect(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), schIUScale, PSLIKE_PLOTTER::SetColor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), PS_PLOTTER::SetViewport(), and PS_PLOTTER::StartPlot().
Referenced by createPSFiles().
|
protected |
Definition at line 583 of file sch_plotter.cpp.
References color, SCHEMATIC::CurrentSheet(), SVG_PLOTTER::EndPlot(), PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), PAGE_INFO::GetHeightIU(), PAGE_INFO::GetHeightMils(), KIGFX::RENDER_SETTINGS::GetLayerColor(), SCH_SHEET::GetName(), BASE_SCREEN::GetPageCount(), SCH_SHEET_PATH::GetPageNumber(), BASE_SCREEN::GetPageNumber(), SCH_SCREEN::GetPageSettings(), SCHEMATIC::GetProperties(), SCH_SCREEN::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), PAGE_INFO::GetWidthIU(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::Last(), LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_DRAWINGSHEET, SCH_PLOT_OPTS::m_blackAndWhite, SCH_PLOT_OPTS::m_pageSizeSelect, SCH_PLOT_OPTS::m_plotDrawingSheet, m_schematic, SCH_PLOT_OPTS::m_useBackgroundColor, PLOTTER::OpenFile(), PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, PLOTTER::PageSettings(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), SVG_PLOTTER::Rect(), PLOTTER::RenderSettings(), scale, SCH_SCREEN::Schematic(), schIUScale, PSLIKE_PLOTTER::SetColor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), PAGE_INFO::SetPortrait(), PLOTTER::SetRenderSettings(), PAGE_INFO::SetType(), SVG_PLOTTER::SetViewport(), and SVG_PLOTTER::StartPlot().
Referenced by createSVGFiles().
|
protected |
Everything done, close the plot and restore the environment.
aPlotter | the plotter to close and destroy (can be null if no current active plotter) |
aOldsheetpath | the stored old sheet path for the current sheet before the plot started |
Definition at line 1001 of file sch_plotter.cpp.
References SCHEMATIC::CurrentSheet(), PDF_PLOTTER::EndPlot(), m_schematic, SCHEMATIC::SetCurrentSheet(), SCHEMATIC::SetSheetNumberAndCount(), and SCH_SHEET_PATH::UpdateAllScreenReferences().
Referenced by createDXFFiles(), createHPGLFiles(), createPDFFile(), createPSFiles(), and createSVGFiles().
|
protected |
Definition at line 281 of file sch_plotter.cpp.
References PAGE_INFO::GetHeightMils(), SCH_SCREEN::GetPageSettings(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), EDA_IU_SCALE::IU_PER_MILS, SCH_PLOT_OPTS::m_pageSizeSelect, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, scale, schIUScale, PLOTTER::SetPageSettings(), PAGE_INFO::SetPortrait(), PAGE_INFO::SetType(), and PLOTTER::SetViewport().
Referenced by createPDFFile().
|
private |
Definition at line 220 of file sch_plotter.h.
Referenced by Plot(), plotOneSheetDXF(), plotOneSheetHpgl(), and SCH_PLOTTER().
|
private |
Definition at line 221 of file sch_plotter.h.
Referenced by createDXFFiles(), createPDFFile(), createPSFiles(), createSVGFiles(), and GetLastOutputFilePath().
|
private |
Definition at line 219 of file sch_plotter.h.
Referenced by createDXFFiles(), createHPGLFiles(), createPDFFile(), createPlotFileName(), createPSFiles(), createSVGFiles(), getOutputFilenameSingle(), plotOneSheetDXF(), plotOneSheetHpgl(), plotOneSheetPDF(), plotOneSheetPS(), plotOneSheetSVG(), and restoreEnvironment().