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 <plotters/plotter.h>
27#include <board.h>
28#include <reporter.h>
29#include <pcbplot.h>
30#include <wx/filename.h>
38#include <pgm_base.h>
39#include <pcbnew_settings.h>
40#include <math/util.h> // for KiROUND
41
42
43static int scaleToSelection( double scale )
44{
45 int selection = 1;
46
47 if( scale == 0.0 ) selection = 0;
48 else if( scale == 1.5 ) selection = 2;
49 else if( scale == 2.0 ) selection = 3;
50 else if( scale == 3.0 ) selection = 4;
51
52 return selection;
53}
54
55
56PCB_PLOTTER::PCB_PLOTTER( BOARD* aBoard, REPORTER* aReporter, PCB_PLOT_PARAMS& aParams ) :
57 m_board( aBoard ),
58 m_plotOpts( aParams ),
59 m_reporter( aReporter )
60{
61}
62
63
64bool PCB_PLOTTER::Plot( const wxString& aOutputPath, const LSEQ& aLayersToPlot,
65 const LSEQ& aCommonLayers, bool aUseGerberFileExtensions,
66 bool aOutputPathIsSingle, std::optional<wxString> aLayerName,
67 std::optional<wxString> aSheetName, std::optional<wxString> aSheetPath )
68{
69 std::function<bool( wxString* )> textResolver = [&]( wxString* token ) -> bool
70 {
71 // Handles board->GetTitleBlock() *and* board->GetProject()
72 return m_board->ResolveTextVar( token, 0 );
73 };
74
75 // sanity, ensure one layer to print
76 if( aLayersToPlot.size() < 1 )
77 {
78 m_reporter->Report( _( "No layers selected for plotting." ), RPT_SEVERITY_ERROR );
79 return false;
80 }
81
82 PAGE_INFO existingPageInfo = m_board->GetPageSettings();
83 VECTOR2I existingAuxOrigin = m_board->GetDesignSettings().GetAuxOrigin();
84
85 if( m_plotOpts.GetFormat() == PLOT_FORMAT::SVG && m_plotOpts.GetSvgFitPagetoBoard() ) // Page is board boundary size
86 {
87 BOX2I bbox = m_board->ComputeBoundingBox( false );
88 PAGE_INFO currPageInfo = m_board->GetPageSettings();
89
90 currPageInfo.SetWidthMils( bbox.GetWidth() / pcbIUScale.IU_PER_MILS );
91 currPageInfo.SetHeightMils( bbox.GetHeight() / pcbIUScale.IU_PER_MILS );
92
93 m_board->SetPageSettings( currPageInfo );
95
96 VECTOR2I origin = bbox.GetOrigin();
98 }
99
100 // To reuse logic, in single plot mode, we want to kick any extra layers from the main list to commonLayers
101 LSEQ layersToPlot;
102 LSEQ commonLayers;
103
104 if( aOutputPathIsSingle )
105 {
106 layersToPlot.push_back( aLayersToPlot[0] );
107
108 if( aLayersToPlot.size() > 1 )
109 commonLayers.insert( commonLayers.end(), aLayersToPlot.begin() + 1, aLayersToPlot.end() );
110 }
111 else
112 {
113 layersToPlot = aLayersToPlot;
114 commonLayers = aCommonLayers;
115 }
116
117 int finalPageCount = 0;
118
119 for( PCB_LAYER_ID layer : layersToPlot )
120 {
121 if( copperLayerShouldBeSkipped( layer ) )
122 continue;
123
124 finalPageCount++;
125 }
126
127 std::unique_ptr<GERBER_JOBFILE_WRITER> jobfile_writer;
128
129 if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && !aOutputPathIsSingle )
130 jobfile_writer = std::make_unique<GERBER_JOBFILE_WRITER>( m_board, m_reporter );
131
132 wxString fileExt( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
133 wxString sheetPath;
134 wxString msg;
135 bool success = true;
136 PLOTTER* plotter = nullptr;
137 int pageNum = 1;
138
139 for( size_t i = 0; i < layersToPlot.size(); i++ )
140 {
141 PCB_LAYER_ID layer = layersToPlot[i];
142
143 if( copperLayerShouldBeSkipped( layer ) )
144 continue;
145
146 LSEQ plotSequence = getPlotSequence( layer, commonLayers );
147 wxString layerName = m_board->GetLayerName( layer );
148 wxFileName fn;
149
150 if( aOutputPathIsSingle )
151 {
152 fn = wxFileName( aOutputPath );
153 }
154 else
155 {
156 wxFileName brdFn = m_board->GetFileName();
157 fn.Assign( aOutputPath, brdFn.GetName(), fileExt );
158
159 // Use Gerber Extensions based on layer number
160 // (See http://en.wikipedia.org/wiki/Gerber_File)
161 if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && aUseGerberFileExtensions )
162 fileExt = GetGerberProtelExtension( layer );
163
164 if( m_plotOpts.GetFormat() == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle )
165 fn.SetExt( GetDefaultPlotExtension( PLOT_FORMAT::PDF ) );
166 else
167 BuildPlotFileName( &fn, aOutputPath, layerName, fileExt );
168 }
169
170 if( jobfile_writer )
171 {
172 wxString fullname = fn.GetFullName();
173 jobfile_writer->AddGbrFile( layer, fullname );
174 }
175
176 if( m_plotOpts.GetFormat() != PLOT_FORMAT::PDF
178 || ( pageNum == 1 && m_plotOpts.GetFormat() == PLOT_FORMAT::PDF
180 {
181 // this will only be used by pdf
182 wxString pageNumber = wxString::Format( "%d", pageNum );
183 wxString pageName = layerName;
184 wxString sheetName = layerName;
185
186 if( aLayerName.has_value() )
187 {
188 layerName = aLayerName.value();
189 pageName = aLayerName.value();
190 }
191
192 if( aSheetName.has_value() )
193 sheetName = aSheetName.value();
194
195 if( aSheetPath.has_value() )
196 sheetPath = aSheetPath.value();
197
198 plotter = StartPlotBoard( m_board, &m_plotOpts, layer, layerName, fn.GetFullPath(),
199 sheetName, sheetPath, pageName, pageNumber, finalPageCount );
200 }
201
202 if( plotter )
203 {
204 plotter->SetTitle( ExpandTextVars( m_board->GetTitleBlock().GetTitle(), &textResolver ) );
205
207 {
208 msg = wxS( "AUTHOR" );
209
210 if( m_board->ResolveTextVar( &msg, 0 ) )
211 plotter->SetAuthor( msg );
212
213 msg = wxS( "SUBJECT" );
214
215 if( m_board->ResolveTextVar( &msg, 0 ) )
216 plotter->SetSubject( msg );
217 }
218
219 try
220 {
221 PlotBoardLayers( m_board, plotter, plotSequence, m_plotOpts );
223 }
224 catch( ... )
225 {
226 success = false;
227 break;
228 }
229
230 if( m_plotOpts.GetFormat() == PLOT_FORMAT::PDF
232 && i != layersToPlot.size() - 1 )
233 {
234 wxString pageNumber = wxString::Format( "%d", pageNum + 1 );
235 size_t nextI = i + 1;
236 PCB_LAYER_ID nextLayer = layersToPlot[nextI];
237
238 while( copperLayerShouldBeSkipped( nextLayer ) && nextI < layersToPlot.size() - 1 )
239 {
240 ++nextI;
241 nextLayer = layersToPlot[nextI];
242 }
243
244 layerName = m_board->GetLayerName( nextLayer );
245
246 wxString pageName = layerName;
247 wxString sheetName = layerName;
248
249 static_cast<PDF_PLOTTER*>( plotter )->ClosePage();
250 static_cast<PDF_PLOTTER*>( plotter )->StartPage( pageNumber, pageName );
251 setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, layerName, sheetName,
252 sheetPath, pageNumber, finalPageCount );
253 }
254
255 // last page
256 if( m_plotOpts.GetFormat() != PLOT_FORMAT::PDF
258 || i == aLayersToPlot.size() - 1
259 || pageNum == finalPageCount )
260 {
261 try
262 {
263 plotter->EndPlot();
264 }
265 catch( ... )
266 {
267 success = false;
268 }
269
270 delete plotter->RenderSettings();
271 delete plotter;
272 plotter = nullptr;
273
274 msg.Printf( _( "Plotted to '%s'." ), fn.GetFullPath() );
276 }
277 }
278 else
279 {
280 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
282
283 success = false;
284 }
285
286 pageNum++;
287
288 wxSafeYield(); // displays report message.
289 }
290
291 if( jobfile_writer && m_plotOpts.GetCreateGerberJobFile() )
292 {
293 // Pick the basename from the board file
294 wxFileName fn( m_board->GetFileName() );
295
296 // Build gerber job file from basename
297 BuildPlotFileName( &fn, aOutputPath, wxT( "job" ), FILEEXT::GerberJobFileExtension );
298 jobfile_writer->CreateJobFile( fn.GetFullPath() );
299 }
300
302
303 if( m_plotOpts.GetFormat() == PLOT_FORMAT::SVG && m_plotOpts.GetSvgFitPagetoBoard() )
304 {
305 // restore the original page and aux origin
306 m_board->SetPageSettings( existingPageInfo );
307 m_board->GetDesignSettings().SetAuxOrigin( existingAuxOrigin );
308 }
309
310 return success;
311}
312
313
315{
316 return ( LSET::AllCuMask() & ~m_board->GetEnabledLayers() )[aLayerToPlot];
317}
318
319
320void PCB_PLOTTER::BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir,
321 const wxString& aSuffix, const wxString& aExtension )
322{
323 // aFilename contains the base filename only (without path and extension)
324 // when calling this function.
325 // It is expected to be a valid filename (this is usually the board filename)
326 aFilename->SetPath( aOutputDir );
327
328 // Set the file extension
329 aFilename->SetExt( aExtension );
330
331 // remove leading and trailing spaces if any from the suffix, if
332 // something survives add it to the name;
333 // also the suffix can contain some not allowed chars in filename (/ \ . : and some others),
334 // so change them to underscore
335 // Remember it can be called from a python script, so the illegal chars
336 // have to be filtered here.
337 wxString suffix = aSuffix;
338 suffix.Trim( true );
339 suffix.Trim( false );
340
341 wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
342 badchars.Append( "%." );
343
344 for( unsigned ii = 0; ii < badchars.Len(); ii++ )
345 suffix.Replace( badchars[ii], wxT( "_" ) );
346
347 if( !suffix.IsEmpty() )
348 aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
349}
350
351
352LSEQ PCB_PLOTTER::getPlotSequence( PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq )
353{
354 LSEQ plotSequence;
355
356 // Base layer always gets plotted first.
357 plotSequence.push_back( aLayerToPlot );
358
359 for( PCB_LAYER_ID layer : aPlotWithAllLayersSeq )
360 {
361 // Don't plot the same layer more than once;
362 if( find( plotSequence.begin(), plotSequence.end(), layer ) != plotSequence.end() )
363 continue;
364
365 plotSequence.push_back( layer );
366 }
367
368 return plotSequence;
369}
370
371
373 REPORTER& aReporter )
374{
376 {
377 JOB_EXPORT_PCB_GERBERS* gJob = static_cast<JOB_EXPORT_PCB_GERBERS*>( aJob );
380 aOpts.SetUseGerberX2format( gJob->m_useX2Format );
383 aOpts.SetGerberPrecision( gJob->m_precision );
384 // Always disable plot pad holes
385 aOpts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE );
386 }
387 else
388 {
389 // Scale, doesn't apply to GERBER
390 aOpts.SetScale( aJob->m_scale );
391 aOpts.SetAutoScale( !aJob->m_scale );
393 // Drill marks doesn't apply to GERBER
394 switch( aJob->m_drillShapeOption )
395 {
396 case DRILL_MARKS::NO_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); break;
397 case DRILL_MARKS::SMALL_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::SMALL_DRILL_SHAPE ); break;
398 default:
399 case DRILL_MARKS::FULL_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::FULL_DRILL_SHAPE ); break;
400 }
401 }
402
404 {
405 JOB_EXPORT_PCB_SVG* svgJob = static_cast<JOB_EXPORT_PCB_SVG*>( aJob );
406 aOpts.SetSvgPrecision( svgJob->m_precision );
407 aOpts.SetSvgFitPageToBoard( svgJob->m_fitPageToBoard );
408 }
409
411 {
412 JOB_EXPORT_PCB_DXF* dxfJob = static_cast<JOB_EXPORT_PCB_DXF*>( aJob );
413 aOpts.SetDXFPlotUnits( dxfJob->m_dxfUnits == JOB_EXPORT_PCB_DXF::DXF_UNITS::INCH ? DXF_UNITS::INCH
414 : DXF_UNITS::MM );
415 aOpts.SetDXFPlotMode( dxfJob->m_plotGraphicItemsUsingContours ? DXF_OUTLINE_MODE::SKETCH
416 : DXF_OUTLINE_MODE::FILLED );
417 aOpts.SetDXFPlotPolygonMode( dxfJob->m_polygonMode );
418 }
419
421 {
422 JOB_EXPORT_PCB_PDF* pdfJob = static_cast<JOB_EXPORT_PCB_PDF*>( aJob );
425 aOpts.m_PDFMetadata = pdfJob->m_pdfMetadata;
426 aOpts.m_PDFSingle = pdfJob->m_pdfSingle;
427 }
428
430 {
431 JOB_EXPORT_PCB_PS* psJob = static_cast<JOB_EXPORT_PCB_PS*>( aJob );
433 aOpts.SetFineScaleAdjustX( psJob->m_XScaleAdjust );
434 aOpts.SetFineScaleAdjustY( psJob->m_YScaleAdjust );
435 aOpts.SetA4Output( psJob->m_forceA4 );
436 }
437
438 aOpts.SetUseAuxOrigin( aJob->m_useDrillOrigin );
439 aOpts.SetPlotFrameRef( aJob->m_plotDrawingSheet );
441 aOpts.SetPlotReference( aJob->m_plotRefDes );
442 aOpts.SetPlotValue( aJob->m_plotFootprintValues );
447 aOpts.SetPlotPadNumbers( aJob->m_plotPadNumbers );
448
449 aOpts.SetBlackAndWhite( aJob->m_blackAndWhite );
450 aOpts.SetMirror( aJob->m_mirror );
451 aOpts.SetNegative( aJob->m_negative );
452
455
456 switch( aJob->m_plotFormat )
457 {
458 default:
459 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::GERBER: aOpts.SetFormat( PLOT_FORMAT::GERBER ); break;
460 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::POST: aOpts.SetFormat( PLOT_FORMAT::POST ); break;
461 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::SVG: aOpts.SetFormat( PLOT_FORMAT::SVG ); break;
462 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::DXF: aOpts.SetFormat( PLOT_FORMAT::DXF ); break;
463 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::HPGL: /* no longer supported */ break;
464 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::PDF: aOpts.SetFormat( PLOT_FORMAT::PDF ); break;
465 }
466
468 wxString theme = aJob->m_colorTheme;
469
470 // Theme may be empty when running from a job in GUI context, so use the GUI settings.
471 if( theme.IsEmpty() )
472 {
473 PCBNEW_SETTINGS* pcbSettings = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
474 theme = pcbSettings->m_ColorTheme;
475 }
476
477 COLOR_SETTINGS* colors = mgr.GetColorSettings( aJob->m_colorTheme );
478
479 if( colors->GetFilename() != theme && !aOpts.GetBlackAndWhite() )
480 {
481 aReporter.Report( wxString::Format( _( "Color theme '%s' not found, will use theme from PCB Editor.\n" ),
482 theme ),
484 }
485
486 aOpts.SetColorSettings( colors );
488}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:110
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition: box2.h:990
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:235
void SetAuxOrigin(const VECTOR2I &aOrigin)
const VECTOR2I & GetAuxOrigin() const
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:297
const PAGE_INFO & GetPageSettings() const
Definition: board.h:715
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:443
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:721
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1772
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: board.h:716
const wxString & GetFileName() const
Definition: board.h:334
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:623
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:955
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:838
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.
unsigned int m_precision
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
Definition: job.h:227
wxString GetFilename() const
Definition: json_settings.h:81
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: lseq.h:47
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:583
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
void SetHeightMils(double aHeightInMils)
Definition: page_info.cpp:261
void SetWidthMils(double aWidthInMils)
Definition: page_info.cpp:247
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)
Definition: pcb_plotter.cpp:64
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)
Definition: pcb_plotter.cpp:56
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.
PLOT_FORMAT GetFormat() const
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.
bool GetCreateGerberJobFile() const
void SetPlotPadNumbers(bool aFlag)
bool GetSvgFitPagetoBoard() const
bool m_PDFFrontFPPropertyPopups
Generate PDF property popup menus for footprints.
void SetScale(double aVal)
void SetDisableGerberMacros(bool aDisable)
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)
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)
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
Base plotter engine class.
Definition: plotter.h:121
virtual void SetAuthor(const wxString &aAuthor)
Definition: plotter.h:175
virtual void SetTitle(const wxString &aTitle)
Definition: plotter.h:174
virtual bool EndPlot()=0
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:152
virtual void SetSubject(const wxString &aSubject)
Definition: plotter.h:176
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
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:112
T * GetAppSettings(const char *aFilename)
Return a handle to the a given settings by type.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieve a color settings object that applications can read colors from.
const wxString & GetTitle() const
Definition: title_block.h:63
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition: common.cpp:59
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)
Definition: pcb_plotter.cpp:43
const wxString GetGerberProtelExtension(int aLayer)
Definition: pcbplot.cpp:43
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.).
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1071
see class PGM_BASE
Plotting engines similar to ps (PostScript, Gerber, svg)
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_INFO
@ RPT_SEVERITY_ACTION
const int scale
const double IU_PER_MM
Definition: base_units.h:76
const double IU_PER_MILS
Definition: base_units.h:77