KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_plotter.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <pcb_plot_params.h>
23#include <map>
24#include <vector>
25
26class BOARD;
27class FOOTPRINT;
28class PROJECT;
29class REPORTER;
30class wxFileName;
32
34{
35public:
36 PCB_PLOTTER( BOARD* aBoard, REPORTER* aReporter, PCB_PLOT_PARAMS& aParams );
37
38 bool Plot( const wxString& aOutputPath, const LSEQ& aLayersToPlot, const LSEQ& aCommonLayers,
39 bool aUseGerberFileExtensions,
40 bool aOutputPathIsSingle = false,
41 std::optional<wxString> aLayerName = std::nullopt,
42 std::optional<wxString> aSheetName = std::nullopt,
43 std::optional<wxString> aSheetPath = std::nullopt,
44 std::vector<wxString>* aOutputFiles = nullptr );
45
54 bool copperLayerShouldBeSkipped( PCB_LAYER_ID aLayerToPlot );
55
68 static void BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir, const wxString& aSuffix,
69 const wxString& aExtension );
70
78
82 static void PlotJobToPlotOpts( PCB_PLOT_PARAMS& aOpts, JOB_EXPORT_PCB_PLOT* aJob,
83 REPORTER& aReporter );
84
85protected:
89
90private:
94 LSEQ getPlotSequence( PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq );
95
96};
97
98
106bool PlotFootprintToSVG( const FOOTPRINT& aFootprint, PROJECT& aProject,
107 const std::map<wxString, wxString>* aVarOverrides, PCB_PLOT_PARAMS& aPlotOpts,
108 const LSEQ& aLayersToPlot, const LSEQ& aLayersOnAll, const wxString& aFileName,
109 REPORTER* aReporter = nullptr );
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:409
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition lseq.h:47
LSEQ getPlotSequence(PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq)
Generates a final LSEQ for plotting by removing duplicates.
BOARD * m_board
Definition pcb_plotter.h:86
static void PlotJobToPlotOpts(PCB_PLOT_PARAMS &aOpts, JOB_EXPORT_PCB_PLOT *aJob, REPORTER &aReporter)
True when the board's out-of-date-chart policy regenerated charts during the last Plot().
PCB_PLOTTER(BOARD *aBoard, REPORTER *aReporter, PCB_PLOT_PARAMS &aParams)
PCB_PLOT_PARAMS m_plotOpts
Definition pcb_plotter.h:87
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, std::vector< wxString > *aOutputFiles=nullptr)
REPORTER * m_reporter
Definition pcb_plotter.h:88
bool copperLayerShouldBeSkipped(PCB_LAYER_ID aLayerToPlot)
All copper layers that are disabled are actually selected This is due to wonkyness in automatically s...
static void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Parameters and options when plotting/printing a board.
Container for project specific data.
Definition project.h:63
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
bool PlotFootprintToSVG(const FOOTPRINT &aFootprint, PROJECT &aProject, const std::map< wxString, wxString > *aVarOverrides, PCB_PLOT_PARAMS &aPlotOpts, const LSEQ &aLayersToPlot, const LSEQ &aLayersOnAll, const wxString &aFileName, REPORTER *aReporter=nullptr)
Plot a footprint to an SVG file, with the footprint origin at the SVG origin and the page/viewBox siz...