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>
40#include <pgm_base.h>
41#include <pcbnew_settings.h>
43#include <math/util.h> // for KiROUND
44
45
46static int scaleToSelection( double scale )
47{
48 int selection = 1;
49
50 if( scale == 0.0 ) selection = 0;
51 else if( scale == 1.5 ) selection = 2;
52 else if( scale == 2.0 ) selection = 3;
53 else if( scale == 3.0 ) selection = 4;
54
55 return selection;
56}
57
58
59PCB_PLOTTER::PCB_PLOTTER( BOARD* aBoard, REPORTER* aReporter, PCB_PLOT_PARAMS& aParams ) :
60 m_board( aBoard ),
61 m_plotOpts( aParams ),
62 m_reporter( aReporter )
63{
64}
65
66
67bool PCB_PLOTTER::Plot( const wxString& aOutputPath, const LSEQ& aLayersToPlot,
68 const LSEQ& aCommonLayers, bool aUseGerberFileExtensions,
69 bool aOutputPathIsSingle, std::optional<wxString> aLayerName,
70 std::optional<wxString> aSheetName, std::optional<wxString> aSheetPath,
71 std::vector<wxString>* aOutputFiles )
72{
73 std::function<bool( wxString* )> textResolver = [&]( wxString* token ) -> bool
74 {
75 // Handles board->GetTitleBlock() *and* board->GetProject()
76 return m_board->ResolveTextVar( token, 0 );
77 };
78
79 // sanity, ensure one layer to print
80 if( aLayersToPlot.size() < 1 )
81 {
82 m_reporter->Report( _( "No layers selected for plotting." ), RPT_SEVERITY_ERROR );
83 return false;
84 }
85
86 PAGE_INFO existingPageInfo = m_board->GetPageSettings();
87 VECTOR2I existingAuxOrigin = m_board->GetDesignSettings().GetAuxOrigin();
88
89 if( m_plotOpts.GetFormat() == PLOT_FORMAT::SVG && m_plotOpts.GetSvgFitPagetoBoard() ) // Page is board boundary size
90 {
91 BOX2I bbox = m_board->ComputeBoundingBox( false, false );
92 SHAPE_POLY_SET boardOutlines;
93
94 // Board outline geometry is better if it exists so that origin is not influenced by Edge.Cuts line width
95 if( m_board->GetBoardPolygonOutlines( boardOutlines, false ) && boardOutlines.OutlineCount() > 0 )
96 bbox = boardOutlines.BBox();
97
98 PAGE_INFO currPageInfo = m_board->GetPageSettings();
99
100 currPageInfo.SetWidthMils( bbox.GetWidth() / pcbIUScale.IU_PER_MILS );
101 currPageInfo.SetHeightMils( bbox.GetHeight() / pcbIUScale.IU_PER_MILS );
102
103 m_board->SetPageSettings( currPageInfo );
104 m_plotOpts.SetUseAuxOrigin( true );
105
106 VECTOR2I origin = bbox.GetOrigin();
107 m_board->GetDesignSettings().SetAuxOrigin( origin );
108 }
109
110 // To reuse logic, in single plot mode, we want to kick any extra layers from the main list to commonLayers
111 LSEQ layersToPlot;
112 LSEQ commonLayers;
113
114 const bool isPdfMultiPage =
115 ( m_plotOpts.GetFormat() == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle );
116
117 if( aOutputPathIsSingle && !m_plotOpts.GetDXFMultiLayeredExportOption() && !isPdfMultiPage )
118 {
119 layersToPlot.push_back( aLayersToPlot[0] );
120
121 if( aLayersToPlot.size() > 1 )
122 commonLayers.insert( commonLayers.end(), aLayersToPlot.begin() + 1, aLayersToPlot.end() );
123 }
124 else
125 {
126 layersToPlot = aLayersToPlot;
127 commonLayers = aCommonLayers;
128 }
129
130 int finalPageCount = 0;
131 std::vector<std::pair<PCB_LAYER_ID, wxString>> layersToExport;
132
133 // Skip the disabled copper layers and build the layer ID -> layer name mapping for plotter
134 // DXF plotter will use this information to name its layers
135 for( PCB_LAYER_ID layer : layersToPlot )
136 {
137 if( copperLayerShouldBeSkipped( layer ) )
138 continue;
139
140 finalPageCount++;
141 layersToExport.emplace_back( layer, m_board->GetLayerName( layer ) );
142 }
143
144 std::unique_ptr<GERBER_JOBFILE_WRITER> jobfile_writer;
145
146 if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && !aOutputPathIsSingle )
147 jobfile_writer = std::make_unique<GERBER_JOBFILE_WRITER>( m_board, m_reporter );
148
149 PLOT_FORMAT plot_format = m_plotOpts.GetFormat();
150 wxString fileExt( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
151 wxString sheetPath;
152 wxString msg;
153 bool success = true;
154 PLOTTER* plotter = nullptr;
155 int pageNum = 1;
156
157 for( size_t i = 0; i < layersToPlot.size(); i++ )
158 {
159 PCB_LAYER_ID layer = layersToPlot[i];
160
161 if( copperLayerShouldBeSkipped( layer ) )
162 continue;
163
164 LSEQ plotSequence = getPlotSequence( layer, commonLayers );
165 wxString layerName = m_board->GetLayerName( layer );
166 wxFileName fn;
167
168 if( aOutputPathIsSingle )
169 {
170 fn = wxFileName( aOutputPath );
171 }
172 else
173 {
174 wxFileName brdFn = m_board->GetFileName();
175 fn.Assign( aOutputPath, brdFn.GetName(), fileExt );
176
177 // Use Gerber Extensions based on layer number
178 // (See http://en.wikipedia.org/wiki/Gerber_File)
179 if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && aUseGerberFileExtensions )
180 fileExt = GetGerberProtelExtension( layer );
181
182 if( plot_format == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle )
184 else if ( plot_format == PLOT_FORMAT::DXF && m_plotOpts.GetDXFMultiLayeredExportOption() )
186 else
187 BuildPlotFileName( &fn, aOutputPath, layerName, fileExt );
188 }
189
190 if( jobfile_writer )
191 {
192 wxString fullname = fn.GetFullName();
193 jobfile_writer->AddGbrFile( layer, fullname );
194 }
195
196 if( ( plot_format != PLOT_FORMAT::PDF && plot_format != PLOT_FORMAT::DXF )
197 || ( !m_plotOpts.m_PDFSingle && !m_plotOpts.GetDXFMultiLayeredExportOption() )
198 || ( pageNum == 1
199 && ( ( plot_format == PLOT_FORMAT::PDF && m_plotOpts.m_PDFSingle )
200 || ( plot_format == PLOT_FORMAT::DXF && m_plotOpts.GetDXFMultiLayeredExportOption() ) ) ) )
201 {
202 // this will only be used by pdf
203 wxString pageNumber = wxString::Format( "%d", pageNum );
204 wxString pageName = layerName;
205 wxString sheetName = layerName;
206
207 if( aLayerName.has_value() )
208 {
209 layerName = aLayerName.value();
210 pageName = aLayerName.value();
211 }
212
213 if( aSheetName.has_value() )
214 sheetName = aSheetName.value();
215
216 if( aSheetPath.has_value() )
217 sheetPath = aSheetPath.value();
218
219 m_plotOpts.SetLayersToExport( layersToExport );
220 plotter = StartPlotBoard( m_board, &m_plotOpts, layer, layerName, fn.GetFullPath(),
221 sheetName, sheetPath, pageName, pageNumber, finalPageCount );
222 }
223
224 if( plotter )
225 {
226 plotter->SetLayer( layer );
227 plotter->SetTitle( ExpandTextVars( m_board->GetTitleBlock().GetTitle(), &textResolver ) );
228
229 if( m_plotOpts.m_PDFMetadata )
230 {
231 msg = wxS( "AUTHOR" );
232
233 if( m_board->ResolveTextVar( &msg, 0 ) )
234 plotter->SetAuthor( msg );
235
236 msg = wxS( "SUBJECT" );
237
238 if( m_board->ResolveTextVar( &msg, 0 ) )
239 plotter->SetSubject( msg );
240 }
241
242 try
243 {
244 PlotBoardLayers( m_board, plotter, plotSequence, m_plotOpts );
246 }
247 catch( ... )
248 {
249 success = false;
250 delete plotter->RenderSettings();
251 delete plotter;
252 plotter = nullptr;
253 break;
254 }
255
256 if( m_plotOpts.GetFormat() == PLOT_FORMAT::PDF
257 && m_plotOpts.m_PDFSingle
258 && i != layersToPlot.size() - 1 )
259 {
260 wxString pageNumber = wxString::Format( "%d", pageNum + 1 );
261 size_t nextI = i + 1;
262 PCB_LAYER_ID nextLayer = layersToPlot[nextI];
263
264 while( copperLayerShouldBeSkipped( nextLayer ) && nextI < layersToPlot.size() - 1 )
265 {
266 ++nextI;
267 nextLayer = layersToPlot[nextI];
268 }
269
270 layerName = m_board->GetLayerName( nextLayer );
271
272 wxString pageName = layerName;
273 wxString sheetName = layerName;
274
275 static_cast<PDF_PLOTTER*>( plotter )->ClosePage();
276 static_cast<PDF_PLOTTER*>( plotter )->StartPage( pageNumber, pageName );
277 setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, layerName, sheetName,
278 sheetPath, pageNumber, finalPageCount );
279 }
280
281 // last page
282 if( (plot_format != PLOT_FORMAT::PDF && plot_format != PLOT_FORMAT::DXF)
283 || (!m_plotOpts.m_PDFSingle && !m_plotOpts.GetDXFMultiLayeredExportOption())
284 || i == aLayersToPlot.size() - 1
285 || pageNum == finalPageCount )
286 {
287 try
288 {
289 plotter->EndPlot();
290 }
291 catch( ... )
292 {
293 success = false;
294 }
295
296 delete plotter->RenderSettings();
297 delete plotter;
298 plotter = nullptr;
299
300 msg.Printf( _( "Plotted to '%s'." ), fn.GetFullPath() );
301 m_reporter->Report( msg, RPT_SEVERITY_ACTION );
302
303 if( aOutputFiles )
304 aOutputFiles->push_back( fn.GetFullPath() );
305 }
306 }
307 else
308 {
309 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
310 m_reporter->Report( msg, RPT_SEVERITY_ERROR );
311
312 success = false;
313 }
314
315 pageNum++;
316
317 wxSafeYield(); // displays report message.
318 }
319
320 if( jobfile_writer && m_plotOpts.GetCreateGerberJobFile() )
321 {
322 // Pick the basename from the board file
323 wxFileName fn( m_board->GetFileName() );
324
325 // Build gerber job file from basename
326 BuildPlotFileName( &fn, aOutputPath, wxT( "job" ), FILEEXT::GerberJobFileExtension );
327 jobfile_writer->CreateJobFile( fn.GetFullPath() );
328
329 if( aOutputFiles )
330 aOutputFiles->push_back( fn.GetFullPath() );
331 }
332
333 m_reporter->ReportTail( _( "Done." ), RPT_SEVERITY_INFO );
334
335 if( m_plotOpts.GetFormat() == PLOT_FORMAT::SVG && m_plotOpts.GetSvgFitPagetoBoard() )
336 {
337 // restore the original page and aux origin
338 m_board->SetPageSettings( existingPageInfo );
339 m_board->GetDesignSettings().SetAuxOrigin( existingAuxOrigin );
340 }
341
342 return success;
343}
344
345
347{
348 return ( LSET::AllCuMask() & ~m_board->GetEnabledLayers() )[aLayerToPlot];
349}
350
351
352void PCB_PLOTTER::BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir,
353 const wxString& aSuffix, const wxString& aExtension )
354{
355 // aFilename contains the base filename only (without path and extension)
356 // when calling this function.
357 // It is expected to be a valid filename (this is usually the board filename)
358 aFilename->SetPath( aOutputDir );
359
360 // Set the file extension
361 aFilename->SetExt( aExtension );
362
363 // remove leading and trailing spaces if any from the suffix, if
364 // something survives add it to the name;
365 // also the suffix can contain some not allowed chars in filename (/ \ . : and some others),
366 // so change them to underscore
367 // Remember it can be called from a python script, so the illegal chars
368 // have to be filtered here.
369 wxString suffix = aSuffix;
370 suffix.Trim( true );
371 suffix.Trim( false );
372
373 wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
374 badchars.Append( "%." );
375
376 for( unsigned ii = 0; ii < badchars.Len(); ii++ )
377 suffix.Replace( badchars[ii], wxT( "_" ) );
378
379 if( !suffix.IsEmpty() )
380 aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
381}
382
383
384LSEQ PCB_PLOTTER::getPlotSequence( PCB_LAYER_ID aLayerToPlot, LSEQ aPlotWithAllLayersSeq )
385{
386 LSEQ plotSequence;
387
388 // Base layer always gets plotted first.
389 plotSequence.push_back( aLayerToPlot );
390
391 for( PCB_LAYER_ID layer : aPlotWithAllLayersSeq )
392 {
393 // Don't plot the same layer more than once;
394 if( find( plotSequence.begin(), plotSequence.end(), layer ) != plotSequence.end() )
395 continue;
396
397 plotSequence.push_back( layer );
398 }
399
400 return plotSequence;
401}
402
403
405 REPORTER& aReporter )
406{
408 {
409 JOB_EXPORT_PCB_GERBERS* gJob = static_cast<JOB_EXPORT_PCB_GERBERS*>( aJob );
412 aOpts.SetUseGerberX2format( gJob->m_useX2Format );
415 aOpts.SetGerberPrecision( gJob->m_precision );
416 // Always disable plot pad holes
418 }
419 else
420 {
421 // Scale, doesn't apply to GERBER
422 aOpts.SetScale( aJob->m_scale );
423 aOpts.SetAutoScale( !aJob->m_scale );
425 // Drill marks doesn't apply to GERBER
426 switch( aJob->m_drillShapeOption )
427 {
430 default:
432 }
433 }
434
436 {
437 JOB_EXPORT_PCB_SVG* svgJob = static_cast<JOB_EXPORT_PCB_SVG*>( aJob );
438 aOpts.SetSvgPrecision( svgJob->m_precision );
439 aOpts.SetSvgFitPageToBoard( svgJob->m_fitPageToBoard );
440 }
441
443 {
444 JOB_EXPORT_PCB_DXF* dxfJob = static_cast<JOB_EXPORT_PCB_DXF*>( aJob );
446 : DXF_UNITS::MM );
449 aOpts.SetDXFPlotPolygonMode( dxfJob->m_polygonMode );
451 }
452
454 {
455 JOB_EXPORT_PCB_PDF* pdfJob = static_cast<JOB_EXPORT_PCB_PDF*>( aJob );
458 aOpts.m_PDFMetadata = pdfJob->m_pdfMetadata;
459 aOpts.m_PDFSingle = pdfJob->m_pdfSingle;
461 }
462
464 {
465 JOB_EXPORT_PCB_PS* psJob = static_cast<JOB_EXPORT_PCB_PS*>( aJob );
466 aOpts.SetWidthAdjust( KiROUND( psJob->m_trackWidthCorrection * pcbIUScale.IU_PER_MM ) );
467 aOpts.SetFineScaleAdjustX( psJob->m_XScaleAdjust );
468 aOpts.SetFineScaleAdjustY( psJob->m_YScaleAdjust );
469 aOpts.SetA4Output( psJob->m_forceA4 );
470 }
471
473 {
474 JOB_EXPORT_PCB_PNG* pngJob = static_cast<JOB_EXPORT_PCB_PNG*>( aJob );
475 aOpts.SetPngDPI( pngJob->m_dpi );
476 aOpts.SetPngAntialias( pngJob->m_antialias );
477 }
478
479 aOpts.SetUseAuxOrigin( aJob->m_useDrillOrigin );
480 aOpts.SetPlotFrameRef( aJob->m_plotDrawingSheet );
482 aOpts.SetPlotReference( aJob->m_plotRefDes );
483 aOpts.SetPlotValue( aJob->m_plotFootprintValues );
488 aOpts.SetPlotPadNumbers( aJob->m_plotPadNumbers );
489
490 aOpts.SetBlackAndWhite( aJob->m_blackAndWhite );
491 aOpts.SetMirror( aJob->m_mirror );
492 aOpts.SetNegative( aJob->m_negative );
493
496
497 switch( aJob->m_plotFormat )
498 {
499 default:
504 case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::HPGL: /* no longer supported */ break;
507 }
508
509 wxString theme = aJob->m_colorTheme;
510
511 // Theme may be empty when running from a job in GUI context, so use the GUI settings.
512 if( theme.IsEmpty() )
513 {
514 if( PCBNEW_SETTINGS* pcbSettings = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ) )
515 theme = pcbSettings->m_ColorTheme;
516 }
517
518 COLOR_SETTINGS* colors = ::GetColorSettings( theme );
519
520 if( colors->GetFilename() != theme && !aOpts.GetBlackAndWhite() )
521 {
522 aReporter.Report( wxString::Format( _( "Color theme '%s' not found, will use theme from PCB Editor.\n" ),
523 theme ),
525 }
526
527 aOpts.SetColorSettings( colors );
529}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:125
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:323
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:235
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:79
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:80
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:81
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)
void SetPngDPI(int aDPI)
COLOR4D m_PDFBackgroundColor
Background color to use if m_PDFUseBackgroundColor is true.
void SetUseGerberProtelExtensions(bool aUse)
void SetDXFPlotUnits(DXF_UNITS aUnit)
void SetPngAntialias(bool aFlag)
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:137
virtual void SetAuthor(const wxString &aAuthor)
Definition plotter.h:191
void SetLayer(PCB_LAYER_ID aLayer)
Sets the ID of the current layer.
Definition plotter.h:253
virtual void SetTitle(const wxString &aTitle)
Definition plotter.h:190
virtual bool EndPlot()=0
RENDER_SETTINGS * RenderSettings()
Definition plotter.h:168
virtual void SetSubject(const wxString &aSubject)
Definition plotter.h:192
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:75
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Definition reporter.h:104
Represent a set of closed polygons.
int OutlineCount() const
Return the number of outlines in the set.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition common.cpp:63
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: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.).
see class PGM_BASE
@ SKETCH
Definition plotter.h:82
@ FILLED
Definition plotter.h:83
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:687