KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_plotter.cpp
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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <pcb_plotter.h>
25#include <common.h>
26#include <plotters/plotter.h>
28#include <board.h>
29#include <reporter.h>
30#include <pcbplot.h>
31#include <wx/filename.h>
39#include <pgm_base.h>
40#include <pcbnew_settings.h>
41#include <math/util.h> // for KiROUND
42
43
44static int scaleToSelection( double scale )
45{
46 int selection = 1;
47
48 if( scale == 0.0 ) selection = 0;
49 else if( scale == 1.5 ) selection = 2;
50 else if( scale == 2.0 ) selection = 3;
51 else if( scale == 3.0 ) selection = 4;
52
53 return selection;
54}
55
56
57PCB_PLOTTER::PCB_PLOTTER( BOARD* aBoard, REPORTER* aReporter, PCB_PLOT_PARAMS& aParams ) :
58 m_board( aBoard ),
59 m_plotOpts( aParams ),
60 m_reporter( aReporter )
61{
62}
63
64
65bool PCB_PLOTTER::Plot( const wxString& aOutputPath, const LSEQ& aLayersToPlot,
66 const LSEQ& aCommonLayers, bool aUseGerberFileExtensions,
67 bool aOutputPathIsSingle, std::optional<wxString> aLayerName,
68 std::optional<wxString> aSheetName, std::optional<wxString> aSheetPath )
69{
70 std::function<bool( wxString* )> textResolver = [&]( wxString* token ) -> bool
71 {
72 // Handles board->GetTitleBlock() *and* board->GetProject()
73 return m_board->ResolveTextVar( token, 0 );
74 };
75
76 // sanity, ensure one layer to print
77 if( aLayersToPlot.size() < 1 )
78 {
79 m_reporter->Report( _( "No layers selected for plotting." ), RPT_SEVERITY_ERROR );
80 return false;
81 }
82
83 PAGE_INFO existingPageInfo = m_board->GetPageSettings();
84 VECTOR2I existingAuxOrigin = m_board->GetDesignSettings().GetAuxOrigin();
85
86 if( m_plotOpts.GetFormat() == PLOT_FORMAT::SVG && m_plotOpts.GetSvgFitPagetoBoard() ) // Page is board boundary size
87 {
88 BOX2I bbox = m_board->ComputeBoundingBox( false );
89 PAGE_INFO currPageInfo = m_board->GetPageSettings();
90
91 currPageInfo.SetWidthMils( bbox.GetWidth() / pcbIUScale.IU_PER_MILS );
92 currPageInfo.SetHeightMils( bbox.GetHeight() / pcbIUScale.IU_PER_MILS );
93
94 m_board->SetPageSettings( currPageInfo );
95 m_plotOpts.SetUseAuxOrigin( true );
96
97 VECTOR2I origin = bbox.GetOrigin();
98 m_board->GetDesignSettings().SetAuxOrigin( origin );
99 }
100
101 // To reuse logic, in single plot mode, we want to kick any extra layers from the main list to commonLayers
102 LSEQ layersToPlot;
103 LSEQ commonLayers;
104
105 const bool isPdfMultiPage =
106 ( m_plotOpts.GetFormat() == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle );
107
108 if( aOutputPathIsSingle && !m_plotOpts.GetDXFMultiLayeredExportOption() && !isPdfMultiPage )
109 {
110 layersToPlot.push_back( aLayersToPlot[0] );
111
112 if( aLayersToPlot.size() > 1 )
113 commonLayers.insert( commonLayers.end(), aLayersToPlot.begin() + 1, aLayersToPlot.end() );
114 }
115 else
116 {
117 layersToPlot = aLayersToPlot;
118 commonLayers = aCommonLayers;
119 }
120
121 int finalPageCount = 0;
122 std::vector<std::pair<PCB_LAYER_ID, wxString>> layersToExport;
123
124 // Skip the disabled copper layers and build the layer ID -> layer name mapping for plotter
125 // DXF plotter will use this information to name its layers
126 for( PCB_LAYER_ID layer : layersToPlot )
127 {
128 if( copperLayerShouldBeSkipped( layer ) )
129 continue;
130
131 finalPageCount++;
132 layersToExport.emplace_back( layer, m_board->GetLayerName( layer ) );
133 }
134
135 std::unique_ptr<GERBER_JOBFILE_WRITER> jobfile_writer;
136
137 if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && !aOutputPathIsSingle )
138 jobfile_writer = std::make_unique<GERBER_JOBFILE_WRITER>( m_board, m_reporter );
139
140 PLOT_FORMAT plot_format = m_plotOpts.GetFormat();
141 wxString fileExt( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
142 wxString sheetPath;
143 wxString msg;
144 bool success = true;
145 PLOTTER* plotter = nullptr;
146 int pageNum = 1;
147
148 for( size_t i = 0; i < layersToPlot.size(); i++ )
149 {
150 PCB_LAYER_ID layer = layersToPlot[i];
151
152 if( copperLayerShouldBeSkipped( layer ) )
153 continue;
154
155 LSEQ plotSequence = getPlotSequence( layer, commonLayers );
156 wxString layerName = m_board->GetLayerName( layer );
157 wxFileName fn;
158
159 if( aOutputPathIsSingle )
160 {
161 fn = wxFileName( aOutputPath );
162 }
163 else
164 {
165 wxFileName brdFn = m_board->GetFileName();
166 fn.Assign( aOutputPath, brdFn.GetName(), fileExt );
167
168 // Use Gerber Extensions based on layer number
169 // (See http://en.wikipedia.org/wiki/Gerber_File)
170 if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && aUseGerberFileExtensions )
171 fileExt = GetGerberProtelExtension( layer );
172
173 if( plot_format == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle )
175 else if ( plot_format == PLOT_FORMAT::DXF && m_plotOpts.GetDXFMultiLayeredExportOption() )
177 else
178 BuildPlotFileName( &fn, aOutputPath, layerName, fileExt );
179 }
180
181 if( jobfile_writer )
182 {
183 wxString fullname = fn.GetFullName();
184 jobfile_writer->AddGbrFile( layer, fullname );
185 }
186
187 if( ( plot_format != PLOT_FORMAT::PDF && plot_format != PLOT_FORMAT::DXF )
188 || ( !m_plotOpts.m_PDFSingle && !m_plotOpts.GetDXFMultiLayeredExportOption() )
189 || ( pageNum == 1
190 && ( ( plot_format == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle )
191 || ( plot_format == PLOT_FORMAT::DXF && m_plotOpts.GetDXFMultiLayeredExportOption() ) ) ) )
192 {
193 // this will only be used by pdf
194 wxString pageNumber = wxString::Format( "%d", pageNum );
195 wxString pageName = layerName;
196 wxString sheetName = layerName;
197
198 if( aLayerName.has_value() )
199 {
200 layerName = aLayerName.value();
201 pageName = aLayerName.value();
202 }
203
204 if( aSheetName.has_value() )
205 sheetName = aSheetName.value();
206
207 if( aSheetPath.has_value() )
208 sheetPath = aSheetPath.value();
209
210 m_plotOpts.SetLayersToExport( layersToExport );
211 plotter = StartPlotBoard( m_board, &m_plotOpts, layer, layerName, fn.GetFullPath(),
212 sheetName, sheetPath, pageName, pageNumber, finalPageCount );
213 }
214
215 if( plotter )
216 {
217 plotter->SetLayer( layer );
218 plotter->SetTitle( ExpandTextVars( m_board->GetTitleBlock().GetTitle(), &textResolver ) );
219
220 if( m_plotOpts.m_PDFMetadata )
221 {
222 msg = wxS( "AUTHOR" );
223
224 if( m_board->ResolveTextVar( &msg, 0 ) )
225 plotter->SetAuthor( msg );
226
227 msg = wxS( "SUBJECT" );
228
229 if( m_board->ResolveTextVar( &msg, 0 ) )
230 plotter->SetSubject( msg );
231 }
232
233 try
234 {
235 PlotBoardLayers( m_board, plotter, plotSequence, m_plotOpts );
237 }
238 catch( ... )
239 {
240 success = false;
241 break;
242 }
243
244 if( m_plotOpts.GetFormat() == PLOT_FORMAT::PDF
245 && m_plotOpts.m_PDFSingle
246 && i != layersToPlot.size() - 1 )
247 {
248 wxString pageNumber = wxString::Format( "%d", pageNum + 1 );
249 size_t nextI = i + 1;
250 PCB_LAYER_ID nextLayer = layersToPlot[nextI];
251
252 while( copperLayerShouldBeSkipped( nextLayer ) && nextI < layersToPlot.size() - 1 )
253 {
254 ++nextI;
255 nextLayer = layersToPlot[nextI];
256 }
257
258 layerName = m_board->GetLayerName( nextLayer );
259
260 wxString pageName = layerName;
261 wxString sheetName = layerName;
262
263 static_cast<PDF_PLOTTER*>( plotter )->ClosePage();
264 static_cast<PDF_PLOTTER*>( plotter )->StartPage( pageNumber, pageName );
265 setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, layerName, sheetName,
266 sheetPath, pageNumber, finalPageCount );
267 }
268
269 // last page
270 if( (plot_format != PLOT_FORMAT::PDF && plot_format != PLOT_FORMAT::DXF)
271 || (!m_plotOpts.m_PDFSingle && !m_plotOpts.GetDXFMultiLayeredExportOption())
272 || i == aLayersToPlot.size() - 1
273 || pageNum == finalPageCount )
274 {
275 try
276 {
277 plotter->EndPlot();
278 }
279 catch( ... )
280 {
281 success = false;
282 }
283
284 delete plotter->RenderSettings();
285 delete plotter;
286 plotter = nullptr;
287
288 msg.Printf( _( "Plotted to '%s'." ), fn.GetFullPath() );
289 m_reporter->Report( msg, RPT_SEVERITY_ACTION );
290 }
291 }
292 else
293 {
294 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
295 m_reporter->Report( msg, RPT_SEVERITY_ERROR );
296
297 success = false;
298 }
299
300 pageNum++;
301
302 wxSafeYield(); // displays report message.
303 }
304
305 if( jobfile_writer && m_plotOpts.GetCreateGerberJobFile() )
306 {
307 // Pick the basename from the board file
308 wxFileName fn( m_board->GetFileName() );
309
310 // Build gerber job file from basename
311 BuildPlotFileName( &fn, aOutputPath, wxT( "job" ), FILEEXT::GerberJobFileExtension );
312 jobfile_writer->CreateJobFile( fn.GetFullPath() );
313 }
314
315 m_reporter->ReportTail( _( "Done." ), RPT_SEVERITY_INFO );
316
317 if( m_plotOpts.GetFormat() == PLOT_FORMAT::SVG && m_plotOpts.GetSvgFitPagetoBoard() )
318 {
319 // restore the original page and aux origin
320 m_board->SetPageSettings( existingPageInfo );
321 m_board->GetDesignSettings().SetAuxOrigin( existingAuxOrigin );
322 }
323
324 return success;
325}
326
327
329{
330 return ( LSET::AllCuMask() & ~m_board->GetEnabledLayers() )[aLayerToPlot];
331}
332
333
334void PCB_PLOTTER::BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir,
335 const wxString& aSuffix, const wxString& aExtension )
336{
337 // aFilename contains the base filename only (without path and extension)
338 // when calling this function.
339 // It is expected to be a valid filename (this is usually the board filename)
340 aFilename->SetPath( aOutputDir );
341
342 // Set the file extension
343 aFilename->SetExt( aExtension );
344
345 // remove leading and trailing spaces if any from the suffix, if
346 // something survives add it to the name;
347 // also the suffix can contain some not allowed chars in filename (/ \ . : and some others),
348 // so change them to underscore
349 // Remember it can be called from a python script, so the illegal chars
350 // have to be filtered here.
351 wxString suffix = aSuffix;
352 suffix.Trim( true );
353 suffix.Trim( false );
354
355 wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
356 badchars.Append( "%." );
357
358 for( unsigned ii = 0; ii < badchars.Len(); ii++ )
359 suffix.Replace( badchars[ii], wxT( "_" ) );
360
361 if( !suffix.IsEmpty() )
362 aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
363}
364
365
366LSEQ PCB_PLOTTER::getPlotSequence( PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq )
367{
368 LSEQ plotSequence;
369
370 // Base layer always gets plotted first.
371 plotSequence.push_back( aLayerToPlot );
372
373 for( PCB_LAYER_ID layer : aPlotWithAllLayersSeq )
374 {
375 // Don't plot the same layer more than once;
376 if( find( plotSequence.begin(), plotSequence.end(), layer ) != plotSequence.end() )
377 continue;
378
379 plotSequence.push_back( layer );
380 }
381
382 return plotSequence;
383}
384
385
387 REPORTER& aReporter )
388{
390 {
391 JOB_EXPORT_PCB_GERBERS* gJob = static_cast<JOB_EXPORT_PCB_GERBERS*>( aJob );
394 aOpts.SetUseGerberX2format( gJob->m_useX2Format );
397 aOpts.SetGerberPrecision( gJob->m_precision );
398 // Always disable plot pad holes
400 }
401 else
402 {
403 // Scale, doesn't apply to GERBER
404 aOpts.SetScale( aJob->m_scale );
405 aOpts.SetAutoScale( !aJob->m_scale );
407 // Drill marks doesn't apply to GERBER
408 switch( aJob->m_drillShapeOption )
409 {
412 default:
414 }
415 }
416
418 {
419 JOB_EXPORT_PCB_SVG* svgJob = static_cast<JOB_EXPORT_PCB_SVG*>( aJob );
420 aOpts.SetSvgPrecision( svgJob->m_precision );
421 aOpts.SetSvgFitPageToBoard( svgJob->m_fitPageToBoard );
422 }
423
425 {
426 JOB_EXPORT_PCB_DXF* dxfJob = static_cast<JOB_EXPORT_PCB_DXF*>( aJob );
428 : DXF_UNITS::MM );
431 aOpts.SetDXFPlotPolygonMode( dxfJob->m_polygonMode );
433 }
434
436 {
437 JOB_EXPORT_PCB_PDF* pdfJob = static_cast<JOB_EXPORT_PCB_PDF*>( aJob );
440 aOpts.m_PDFMetadata = pdfJob->m_pdfMetadata;
441 aOpts.m_PDFSingle = pdfJob->m_pdfSingle;
443 }
444
446 {
447 JOB_EXPORT_PCB_PS* psJob = static_cast<JOB_EXPORT_PCB_PS*>( aJob );
448 aOpts.SetWidthAdjust( KiROUND( psJob->m_trackWidthCorrection * pcbIUScale.IU_PER_MM ) );
449 aOpts.SetFineScaleAdjustX( psJob->m_XScaleAdjust );
450 aOpts.SetFineScaleAdjustY( psJob->m_YScaleAdjust );
451 aOpts.SetA4Output( psJob->m_forceA4 );
452 }
453
454 aOpts.SetUseAuxOrigin( aJob->m_useDrillOrigin );
455 aOpts.SetPlotFrameRef( aJob->m_plotDrawingSheet );
457 aOpts.SetPlotReference( aJob->m_plotRefDes );
458 aOpts.SetPlotValue( aJob->m_plotFootprintValues );
463 aOpts.SetPlotPadNumbers( aJob->m_plotPadNumbers );
464
465 aOpts.SetBlackAndWhite( aJob->m_blackAndWhite );
466 aOpts.SetMirror( aJob->m_mirror );
467 aOpts.SetNegative( aJob->m_negative );
468
471
472 switch( aJob->m_plotFormat )
473 {
474 default:
479 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::HPGL: /* no longer supported */ break;
481 }
482
483 wxString theme = aJob->m_colorTheme;
484
485 // Theme may be empty when running from a job in GUI context, so use the GUI settings.
486 if( theme.IsEmpty() )
487 {
488 if( PCBNEW_SETTINGS* pcbSettings = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ) )
489 theme = pcbSettings->m_ColorTheme;
490 }
491
492 COLOR_SETTINGS* colors = ::GetColorSettings( theme );
493
494 if( colors->GetFilename() != theme && !aOpts.GetBlackAndWhite() )
495 {
496 aReporter.Report( wxString::Format( _( "Color theme '%s' not found, will use theme from PCB Editor.\n" ),
497 theme ),
499 }
500
501 aOpts.SetColorSettings( colors );
503}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:990
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
constexpr size_type GetWidth() const
Definition box2.h:214
constexpr size_type GetHeight() const
Definition box2.h:215
constexpr const Vec & GetOrigin() const
Definition box2.h:210
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool m_pdfSingle
This is a hack to deal with cli having the wrong behavior We will deprecate out the wrong behavior,...
LSEQ m_plotOnAllLayersSequence
Used by SVG & PDF.
DRILL_MARKS m_drillShapeOption
Used by SVG/DXF/PDF/Gerbers.
bool m_mirror
Common Options.
LSEQ m_plotLayerSequence
Layers to include on all individual layer prints.
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
Definition job.h:233
wxString GetFilename() const
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition lseq.h:47
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition lset.cpp:599
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition page_info.h:79
void SetHeightMils(double aHeightInMils)
void SetWidthMils(double aWidthInMils)
LSEQ getPlotSequence(PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq)
Generates a final LSEQ for plotting by removing duplicates.
BOARD * m_board
Definition pcb_plotter.h:77
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)
static void PlotJobToPlotOpts(PCB_PLOT_PARAMS &aOpts, JOB_EXPORT_PCB_PLOT *aJob, REPORTER &aReporter)
Translate a JOB to PCB_PLOT_PARAMS.
PCB_PLOTTER(BOARD *aBoard, REPORTER *aReporter, PCB_PLOT_PARAMS &aParams)
PCB_PLOT_PARAMS m_plotOpts
Definition pcb_plotter.h:78
REPORTER * m_reporter
Definition pcb_plotter.h:79
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.
void SetDrillMarksType(DRILL_MARKS aVal)
void SetLayerSelection(const LSET &aSelection)
void SetOutputDirectory(const wxString &aDir)
void SetPlotReference(bool aFlag)
void SetSketchPadsOnFabLayers(bool aFlag)
void SetUseGerberX2format(bool aUse)
void SetA4Output(int aForce)
void SetPlotOnAllLayersSequence(LSEQ aSeq)
void SetDXFPlotPolygonMode(bool aFlag)
void SetAutoScale(bool aFlag)
void SetPlotFrameRef(bool aFlag)
void SetSketchDNPFPsOnFabLayers(bool aFlag)
bool m_PDFMetadata
Generate PDF metadata for SUBJECT and AUTHOR.
void SetPlotPadNumbers(bool aFlag)
bool m_PDFFrontFPPropertyPopups
Generate PDF property popup menus for footprints.
void SetScale(double aVal)
void SetDisableGerberMacros(bool aDisable)
void SetDXFMultiLayeredExportOption(bool aFlag)
void SetScaleSelection(int aSelection)
void SetFineScaleAdjustX(double aVal)
void SetMirror(bool aFlag)
void SetBlackAndWhite(bool blackAndWhite)
void SetGerberPrecision(int aPrecision)
void SetSubtractMaskFromSilk(bool aSubtract)
void SetHideDNPFPsOnFabLayers(bool aFlag)
void SetPlotValue(bool aFlag)
COLOR4D m_PDFBackgroundColor
Background color to use if m_PDFUseBackgroundColor is true.
void SetUseGerberProtelExtensions(bool aUse)
void SetDXFPlotUnits(DXF_UNITS aUnit)
void SetColorSettings(COLOR_SETTINGS *aSettings)
void SetIncludeGerberNetlistInfo(bool aUse)
void SetCreateGerberJobFile(bool aCreate)
bool m_PDFSingle
Generate a single PDF file for all layers.
void SetNegative(bool aFlag)
bool GetBlackAndWhite() const
void SetUseAuxOrigin(bool aAux)
bool m_PDFBackFPPropertyPopups
on front and/or back of board
void SetDXFPlotMode(DXF_OUTLINE_MODE aPlotMode)
void SetSvgFitPageToBoard(int aSvgFitPageToBoard)
void SetSvgPrecision(unsigned aPrecision)
void SetCrossoutDNPFPsOnFabLayers(bool aFlag)
void SetFormat(PLOT_FORMAT aFormat)
void SetFineScaleAdjustY(double aVal)
void SetWidthAdjust(int aVal)
Base plotter engine class.
Definition plotter.h:136
virtual void SetAuthor(const wxString &aAuthor)
Definition plotter.h:190
void SetLayer(PCB_LAYER_ID aLayer)
Sets the ID of the current layer.
Definition plotter.h:252
virtual void SetTitle(const wxString &aTitle)
Definition plotter.h:189
virtual bool EndPlot()=0
RENDER_SETTINGS * RenderSettings()
Definition plotter.h:167
virtual void SetSubject(const wxString &aSubject)
Definition plotter.h:191
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Definition reporter.h:102
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition common.cpp:62
The common library.
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Return the default plot extension for a format.
#define _(s)
Classes used to generate a Gerber job file in JSON.
static const std::string GerberJobFileExtension
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
static int scaleToSelection(double scale)
const wxString GetGerberProtelExtension(int aLayer)
Definition pcbplot.cpp:44
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aLayerName, const wxString &aFullFileName, const wxString &aSheetName, const wxString &aSheetPath, const wxString &aPageName=wxT("1"), const wxString &aPageNumber=wxEmptyString, const int aPageCount=1)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
void setupPlotterNewPDFPage(PLOTTER *aPlotter, BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, const wxString &aLayerName, const wxString &aSheetName, const wxString &aSheetPath, const wxString &aPageNumber, int aPageCount)
void PlotBoardLayers(BOARD *aBoard, PLOTTER *aPlotter, const LSEQ &aLayerSequence, const PCB_PLOT_PARAMS &aPlotOptions)
Plot a sequence of board layer IDs.
void PlotInteractiveLayer(BOARD *aBoard, PLOTTER *aPlotter, const PCB_PLOT_PARAMS &aPlotOpt)
Plot interactive items (hypertext links, properties, etc.).
see class PGM_BASE
@ SKETCH
Definition plotter.h:81
@ FILLED
Definition plotter.h:82
PLOT_FORMAT
The set of supported output plot formats.
Definition plotter.h:64
Plotting engines similar to ps (PostScript, Gerber, svg)
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_INFO
@ RPT_SEVERITY_ACTION
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
T * GetAppSettings(const char *aFilename)
const int scale
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695