KiCad PCB EDA Suite
pcbplot.h File Reference

Board plot function definition file. More...

#include <wx/filename.h>
#include <pad_shapes.h>
#include <pcb_plot_params.h>
#include <layers_id_colors_and_visibility.h>
#include <math/util.h>

Go to the source code of this file.

Classes

class  BRDITEMS_PLOTTER
 

Macros

#define PLOT_MIN_SCALE   0.01
 
#define PLOT_MAX_SCALE   100.0
 
#define SMALL_DRILL   KiROUND( 0.35 * IU_PER_MM )
 
#define OPTKEY_LAYERBASE   wxT( "PlotLayer_%d" )
 
#define OPTKEY_PRINT_LINE_WIDTH   wxT( "PrintLineWidth" )
 
#define OPTKEY_PRINT_SCALE   wxT( "PrintScale" )
 
#define OPTKEY_PRINT_PAGE_FRAME   wxT( "PrintPageFrame" )
 
#define OPTKEY_PRINT_MONOCHROME_MODE   wxT( "PrintMonochrome" )
 
#define OPTKEY_PRINT_PAGE_PER_LAYER   wxT( "PrintSinglePage" )
 
#define OPTKEY_PRINT_PADS_DRILL   wxT( "PrintPadsDrillOpt" )
 
#define OPTKEY_PLOT_X_FINESCALE_ADJ   wxT( "PlotXFineScaleAdj" )
 
#define OPTKEY_PLOT_Y_FINESCALE_ADJ   wxT( "PlotYFineScaleAdj" )
 
#define CONFIG_PS_FINEWIDTH_ADJ   wxT( "PSPlotFineWidthAdj" )
 
#define OPTKEY_PLOT_CHECK_ZONES   wxT( "CheckZonesBeforePlotting" )
 

Functions

PLOTTERStartPlotBoard (BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aFullFileName, const wxString &aSheetDesc)
 Open a new plotfile using the options (and especially the format) specified in the options and prepare the page for plotting. More...
 
void PlotOneBoardLayer (BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotOneBoardLayer main function to plot one copper or technical layer. More...
 
void PlotStandardLayer (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotStandardLayer plot copper or technical layers. More...
 
void PlotLayerOutlines (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotLayerOutlines plot copper outline of a copper layer. More...
 
void PlotSilkScreen (BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
 Function PlotSilkScreen plot silkscreen layers which have specific requirements, mainly for pads. More...
 
void BuildPlotFileName (wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
 Function BuildPlotFileName (helper function) Complete a plot filename: forces the output directory, add a suffix to the name and sets the specified extension the suffix is usually the layer name replaces not allowed chars in suffix by '_'. More...
 
const wxString GetGerberProtelExtension (LAYER_NUM aLayer)
 Function GetGerberProtelExtension. More...
 
const wxString GetGerberFileFunctionAttribute (const BOARD *aBoard, LAYER_NUM aLayer)
 Function GetGerberFileFunctionAttribute Returns the "file function" attribute for aLayer, as defined in the Gerber file format specification J1 (chapter 5). More...
 
void AddGerberX2Header (PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode=false)
 Calculates some X2 attributes, as defined in the Gerber file format specification J4 (chapter 5) and add them the to the gerber file header: TF.GenerationSoftware TF.CreationDate TF.ProjectId file format attribute is not added. More...
 
void AddGerberX2Attribute (PLOTTER *aPlotter, const BOARD *aBoard, LAYER_NUM aLayer, bool aUseX1CompatibilityMode)
 Calculates some X2 attributes, as defined in the Gerber file format specification and add them to the gerber file header: TF.GenerationSoftware TF.CreationDate TF.ProjectId TF.FileFunction TF.FilePolarity. More...
 

Detailed Description

Board plot function definition file.

Definition in file pcbplot.h.

Macro Definition Documentation

◆ PLOT_MAX_SCALE

#define PLOT_MAX_SCALE   100.0

Definition at line 70 of file pcbplot.h.

◆ PLOT_MIN_SCALE

#define PLOT_MIN_SCALE   0.01

Definition at line 69 of file pcbplot.h.

◆ SMALL_DRILL

#define SMALL_DRILL   KiROUND( 0.35 * IU_PER_MM )

Definition at line 73 of file pcbplot.h.

Function Documentation

◆ AddGerberX2Attribute()

void AddGerberX2Attribute ( PLOTTER aPlotter,
const BOARD aBoard,
LAYER_NUM  aLayer,
bool  aUseX1CompatibilityMode 
)

Calculates some X2 attributes, as defined in the Gerber file format specification and add them to the gerber file header: TF.GenerationSoftware TF.CreationDate TF.ProjectId TF.FileFunction TF.FilePolarity.

Parameters
aPlotter= the current plotter.
aBoard= the board, needed to extract some info
aLayer= the layer number to create the attribute for
aUseX1CompatibilityMode= false to generate X2 attributes, true to use X1 compatibility (X2 attributes added as structured comments, starting by "G04 #@! " followed by the X2 attribute

Definition at line 354 of file pcbplot.cpp.

356 {
357  AddGerberX2Header( aPlotter, aBoard, aUseX1CompatibilityMode );
358 
359  wxString text;
360 
361  // Add the TF.FileFunction
362  text = GetGerberFileFunctionAttribute( aBoard, aLayer );
363  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
364 
365  // Add the TF.FilePolarity (for layers which support that)
366  text = GetGerberFilePolarityAttribute( aLayer );
367 
368  if( !text.IsEmpty() )
369  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
370 }
void AddGerberX2Header(PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode)
Calculates some X2 attributes, as defined in the Gerber file format specification J4 (chapter 5) and ...
Definition: pcbplot.cpp:282
void AddLineToHeader(const wxString &aExtraString)
Function AddLineToHeader Add a line to the list of free lines to print at the beginning of the file.
Definition: plotter.h:182
static const wxString GetGerberFilePolarityAttribute(LAYER_NUM aLayer)
Definition: pcbplot.cpp:211
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
Definition: pcbplot.cpp:270
const wxString GetGerberFileFunctionAttribute(const BOARD *aBoard, LAYER_NUM aLayer)
Function GetGerberFileFunctionAttribute Returns the "file function" attribute for aLayer,...
Definition: pcbplot.cpp:89

References AddGerberX2Header(), PLOTTER::AddLineToHeader(), GetGerberFileFunctionAttribute(), GetGerberFilePolarityAttribute(), and makeStringCompatX1().

Referenced by StartPlotBoard().

◆ AddGerberX2Header()

void AddGerberX2Header ( PLOTTER aPlotter,
const BOARD aBoard,
bool  aUseX1CompatibilityMode = false 
)

Calculates some X2 attributes, as defined in the Gerber file format specification J4 (chapter 5) and add them the to the gerber file header: TF.GenerationSoftware TF.CreationDate TF.ProjectId file format attribute is not added.

Parameters
aPlotter= the current plotter.
aBoard= the board, needed to extract some info
aUseX1CompatibilityMode= false to generate X2 attributes, true to use X1 compatibility (X2 attributes added as structured comments, starting by "G04 #@! " followed by the X2 attribute

Definition at line 282 of file pcbplot.cpp.

284 {
285  wxString text;
286 
287  // Creates the TF,.GenerationSoftware. Format is:
288  // %TF,.GenerationSoftware,<vendor>,<application name>[,<application version>]*%
289  text.Printf( wxT( "%%TF.GenerationSoftware,KiCad,Pcbnew,%s*%%" ), GetBuildVersion() );
290  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
291 
292  // creates the TF.CreationDate attribute:
293  text = GbrMakeCreationDateAttributeString( aUseX1CompatibilityMode ?
296  aPlotter->AddLineToHeader( text );
297 
298  // Creates the TF,.ProjectId. Format is (from Gerber file format doc):
299  // %TF.ProjectId,<project id>,<project GUID>,<revision id>*%
300  // <project id> is the name of the project, restricted to basic ASCII symbols only,
301  // Rem: <project id> accepts only ASCII 7 code (only basic ASCII codes are allowed in gerber files).
302  // and comma not accepted
303  // All illegal chars will be replaced by underscore
304  //
305  // <project GUID> is a string which is an unique id of a project.
306  // However Kicad does not handle such a project GUID, so it is built from the board name
307  wxFileName fn = aBoard->GetFileName();
308  wxString msg = fn.GetFullName();
309 
310  // Build a <project GUID>, from the board name
311  wxString guid = GbrMakeProjectGUIDfromString( msg );
312 
313  // build the <project id> string: this is the board short filename (without ext)
314  // and all non ASCII chars and comma are replaced by '_'
315  msg = fn.GetName();
316  msg.Replace( wxT( "," ), wxT( "_" ) );
317 
318  // build the <rec> string. All non ASCII chars and comma are replaced by '_'
319  wxString rev = ((BOARD*)aBoard)->GetTitleBlock().GetRevision();
320  rev.Replace( wxT( "," ), wxT( "_" ) );
321 
322  if( rev.IsEmpty() )
323  rev = wxT( "rev?" );
324 
325  text.Printf( wxT( "%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), GetChars( guid ), rev.ToAscii() );
326  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
327 
328  // Add the TF.SameCoordinates, that specify all gerber files uses the same
329  // origin and orientation, and the registration between files is OK.
330  // The parameter of TF.SameCoordinates is a string that is common
331  // to all files using the same registration and has no special meaning:
332  // this is just a key
333  // Because there is no mirroring/rotation in Kicad, only the plot offset origin
334  // can create incorrect registration.
335  // So we create a key from plot offset options.
336  // and therefore for a given board, all Gerber files having the same key have the same
337  // plot origin and use the same registration
338  //
339  // Currently the key is "Original" when using absolute Pcbnew coordinates,
340  // and te PY ans PY position od auxiliary axis, when using it.
341  // Please, if absolute Pcbnew coordinates, one day, are set by user, change the way
342  // the key is built to ensure file only using the *same* axis have the same key.
343  wxString registration_id = "Original";
344  wxPoint auxOrigin = aBoard->GetAuxOrigin();
345 
346  if( aBoard->GetPlotOptions().GetUseAuxOrigin() && auxOrigin.x && auxOrigin.y )
347  registration_id.Printf( "PX%xPY%x", auxOrigin.x, auxOrigin.y );
348 
349  text.Printf( "%%TF.SameCoordinates,%s*%%", registration_id.GetData() );
350  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
351 }
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:548
wxString GbrMakeCreationDateAttributeString(GBR_NC_STRING_FORMAT aFormat)
void AddLineToHeader(const wxString &aExtraString)
Function AddLineToHeader Add a line to the list of free lines to print at the beginning of the file.
Definition: plotter.h:182
const wxString & GetFileName() const
Definition: class_board.h:215
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
wxString GbrMakeProjectGUIDfromString(wxString &aText)
A helper function to build a project GUID using format RFC4122 Version 1 or 4 from the project name,...
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:353
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
Definition: pcbplot.cpp:270
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
bool GetUseAuxOrigin() const

References PLOTTER::AddLineToHeader(), GBR_NC_STRING_FORMAT_X1, GBR_NC_STRING_FORMAT_X2, GbrMakeCreationDateAttributeString(), GbrMakeProjectGUIDfromString(), BOARD::GetAuxOrigin(), GetBuildVersion(), GetChars(), BOARD::GetFileName(), BOARD::GetPlotOptions(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), makeStringCompatX1(), wxPoint::x, and wxPoint::y.

Referenced by AddGerberX2Attribute(), GERBER_WRITER::createDrillFile(), and PLACEFILE_GERBER_WRITER::CreatePlaceFile().

◆ BuildPlotFileName()

void BuildPlotFileName ( wxFileName *  aFilename,
const wxString &  aOutputDir,
const wxString &  aSuffix,
const wxString &  aExtension 
)

Function BuildPlotFileName (helper function) Complete a plot filename: forces the output directory, add a suffix to the name and sets the specified extension the suffix is usually the layer name replaces not allowed chars in suffix by '_'.

Parameters
aFilename= the wxFileName to initialize Contains the base filename
aOutputDir= the path
aSuffix= the suffix to add to the base filename
aExtension= the file extension

Definition at line 373 of file pcbplot.cpp.

375 {
376  // aFilename contains the base filename only (without path and extension)
377  // when calling this function.
378  // It is expected to be a valid filename (this is usually the board filename)
379  aFilename->SetPath( aOutputDir );
380 
381  // Set the file extension
382  aFilename->SetExt( aExtension );
383 
384  // remove leading and trailing spaces if any from the suffix, if
385  // something survives add it to the name;
386  // also the suffix can contain some not allowed chars in filename (/ \ . : and some others),
387  // so change them to underscore
388  // Remember it can be called from a python script, so the illegal chars
389  // have to be filtered here.
390  wxString suffix = aSuffix;
391  suffix.Trim( true );
392  suffix.Trim( false );
393 
394  wxString badchars = wxFileName::GetForbiddenChars(wxPATH_DOS);
395  badchars.Append( "%." );
396 
397  for( unsigned ii = 0; ii < badchars.Len(); ii++ )
398  suffix.Replace( badchars[ii], wxT("_") );
399 
400  if( !suffix.IsEmpty() )
401  aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
402 }

Referenced by DIALOG_EXPORT_SVG::ExportSVGFile(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().

◆ GetGerberFileFunctionAttribute()

const wxString GetGerberFileFunctionAttribute ( const BOARD aBoard,
LAYER_NUM  aLayer 
)

Function GetGerberFileFunctionAttribute Returns the "file function" attribute for aLayer, as defined in the Gerber file format specification J1 (chapter 5).

The returned string includes the "%TF.FileFunction" attribute prefix and the "*%" suffix.

Parameters
aBoard= the board, needed to get the total count of copper layers
aLayer= the layer number to create the attribute for
Returns
The attribute, as a text string

Definition at line 89 of file pcbplot.cpp.

90 {
91  wxString attrib;
92 
93  switch( aLayer )
94  {
95  case F_Adhes:
96  attrib = "Glue,Top";
97  break;
98 
99  case B_Adhes:
100  attrib = "Glue,Bot";
101  break;
102 
103  case F_SilkS:
104  attrib = "Legend,Top";
105  break;
106 
107  case B_SilkS:
108  attrib = "Legend,Bot";
109  break;
110 
111  case F_Mask:
112  attrib = "Soldermask,Top";
113  break;
114 
115  case B_Mask:
116  attrib = "Soldermask,Bot";
117  break;
118 
119  case F_Paste:
120  attrib = "Paste,Top";
121  break;
122 
123  case B_Paste:
124  attrib = "Paste,Bot";
125  break;
126 
127  case Edge_Cuts:
128  // Board outline.
129  // Can be "Profile,NP" (Not Plated: usual) or "Profile,P"
130  // This last is the exception (Plated)
131  attrib = "Profile,NP";
132  break;
133 
134  case Dwgs_User:
135  attrib = "OtherDrawing,Comment";
136  break;
137 
138  case Cmts_User:
139  attrib = "Other,Comment";
140  break;
141 
142  case Eco1_User:
143  attrib = "Other,ECO1";
144  break;
145 
146  case Eco2_User:
147  attrib = "Other,ECO2";
148  break;
149 
150  case B_Fab:
151  // This is actually a assembly layer
152  attrib = "AssemblyDrawing,Bot";
153  break;
154 
155  case F_Fab:
156  // This is actually a assembly layer
157  attrib = "AssemblyDrawing,Top";
158  break;
159 
160  case B_Cu:
161  attrib.Printf( wxT( "Copper,L%d,Bot" ), aBoard->GetCopperLayerCount() );
162  break;
163 
164  case F_Cu:
165  attrib = "Copper,L1,Top";
166  break;
167 
168  default:
169  if( IsCopperLayer( aLayer ) )
170  attrib.Printf( wxT( "Copper,L%d,Inr" ), aLayer+1 );
171  else
172  attrib.Printf( wxT( "Other,User" ), aLayer+1 );
173  break;
174  }
175 
176  // This code adds a optional parameter: the type of copper layers.
177  // Because it is not used by Pcbnew (it can be used only by external autorouters)
178  // user do not really set this parameter.
179  // Therefore do not add it.
180  // However, this code is left here, for perhaps a future usage.
181 #if 0
182  // Add the signal type of the layer, if relevant
183  if( IsCopperLayer( aLayer ) )
184  {
185  LAYER_T type = aBoard->GetLayerType( ToLAYER_ID( aLayer ) );
186 
187  switch( type )
188  {
189  case LT_SIGNAL:
190  attrib += ",Signal";
191  break;
192  case LT_POWER:
193  attrib += ",Plane";
194  break;
195  case LT_MIXED:
196  attrib += ",Mixed";
197  break;
198  default:
199  break; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC)
200  }
201  }
202 #endif
203 
204  wxString fileFct;
205  fileFct.Printf( "%%TF.FileFunction,%s*%%", GetChars( attrib ) );
206 
207  return fileFct;
208 }
LAYER_T
Enum LAYER_T gives the allowed types of layers, same as Specctra DSN spec.
Definition: class_board.h:65
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Function GetLayerType returns the type of the copper layer given by aLayer.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
int GetCopperLayerCount() const
Function GetCopperLayerCount.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:823

References B_Adhes, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, GetChars(), BOARD::GetCopperLayerCount(), BOARD::GetLayerType(), IsCopperLayer(), LT_MIXED, LT_POWER, LT_SIGNAL, and ToLAYER_ID().

Referenced by AddGerberX2Attribute().

◆ GetGerberProtelExtension()

const wxString GetGerberProtelExtension ( LAYER_NUM  aLayer)

Function GetGerberProtelExtension.

Returns
the appropriate Gerber file extension for aLayer used by Protel, and still sometimes in use (although the official Gerber Ext is now .gbr)

Definition at line 48 of file pcbplot.cpp.

49 {
50  if( IsCopperLayer( aLayer ) )
51  {
52  if( aLayer == F_Cu )
53  return wxT( "gtl" );
54  else if( aLayer == B_Cu )
55  return wxT( "gbl" );
56  else
57  {
58  return wxString::Format( wxT( "g%d" ), aLayer+1 );
59  }
60  }
61  else
62  {
63  switch( aLayer )
64  {
65  case B_Adhes: return wxT( "gba" );
66  case F_Adhes: return wxT( "gta" );
67 
68  case B_Paste: return wxT( "gbp" );
69  case F_Paste: return wxT( "gtp" );
70 
71  case B_SilkS: return wxT( "gbo" );
72  case F_SilkS: return wxT( "gto" );
73 
74  case B_Mask: return wxT( "gbs" );
75  case F_Mask: return wxT( "gts" );
76 
77  case Edge_Cuts: return wxT( "gm1" );
78 
79  case Dwgs_User:
80  case Cmts_User:
81  case Eco1_User:
82  case Eco2_User:
83  default: return wxT( "gbr" );
84  }
85  }
86 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.

References B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, Format(), and IsCopperLayer().

Referenced by PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().

◆ PlotLayerOutlines()

void PlotLayerOutlines ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotLayerOutlines plot copper outline of a copper layer.

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayerMask= the mask to define the layers to plot
aPlotOpt= the plot options. Has meaning for some formats only

Definition at line 689 of file plot_board_layers.cpp.

691 {
692 
693  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
694  itemplotter.SetLayerSet( aLayerMask );
695 
696  SHAPE_POLY_SET outlines;
697 
698  for( LSEQ seq = aLayerMask.Seq( plot_seq, arrayDim( plot_seq ) ); seq; ++seq )
699  {
700  PCB_LAYER_ID layer = *seq;
701 
702  outlines.RemoveAllContours();
703  aBoard->ConvertBrdLayerToPolygonalContours( layer, outlines );
704 
705  outlines.Simplify( SHAPE_POLY_SET::PM_FAST );
706 
707  // Plot outlines
708  std::vector< wxPoint > cornerList;
709 
710  // Now we have one or more basic polygons: plot each polygon
711  for( int ii = 0; ii < outlines.OutlineCount(); ii++ )
712  {
713  for(int kk = 0; kk <= outlines.HoleCount (ii); kk++ )
714  {
715  cornerList.clear();
716  const SHAPE_LINE_CHAIN& path = (kk == 0) ? outlines.COutline( ii ) : outlines.CHole( ii, kk - 1 );
717 
718  for( int jj = 0; jj < path.PointCount(); jj++ )
719  cornerList.emplace_back( (wxPoint) path.CPoint( jj ) );
720 
721  // Ensure the polygon is closed
722  if( cornerList[0] != cornerList[cornerList.size() - 1] )
723  cornerList.push_back( cornerList[0] );
724 
725  aPlotter->PlotPoly( cornerList, NO_FILL );
726  }
727  }
728 
729  // Plot pad holes
731  {
732  int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE)
733  ? SMALL_DRILL : INT_MAX;
734 
735  for( auto module : aBoard->Modules() )
736  {
737  for( auto pad : module->Pads() )
738  {
739  wxSize hole = pad->GetDrillSize();
740 
741  if( hole.x == 0 || hole.y == 0 )
742  continue;
743 
744  if( hole.x == hole.y )
745  {
746  hole.x = std::min( smallDrill, hole.x );
747  aPlotter->Circle( pad->GetPosition(), hole.x, NO_FILL );
748  }
749  else
750  {
751  // Note: small drill marks have no significance when applied to slots
752  wxPoint drl_start, drl_end;
753  int width;
754  pad->GetOblongDrillGeometry( drl_start, drl_end, width );
755  aPlotter->ThickSegment( pad->GetPosition() + drl_start,
756  pad->GetPosition() + drl_end, width, SKETCH, NULL );
757  }
758  }
759  }
760  }
761 
762  // Plot vias holes
763  for( auto track : aBoard->Tracks() )
764  {
765  const VIA* via = dyn_cast<const VIA*>( track );
766 
767  if( via && via->IsOnLayer( layer ) ) // via holes can be not through holes
768  {
769  aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), NO_FILL );
770  }
771  }
772  }
773 }
#define SMALL_DRILL
Definition: pcbplot.h:73
int OutlineCount() const
Returns the number of outlines in the set
static const PCB_LAYER_ID plot_seq[]
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
int PointCount() const
Function PointCount()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:377
const VECTOR2I & CPoint(int aIndex) const
Function Point()
PCB_LAYER_ID
A quick note on layer IDs:
#define NULL
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
MODULES & Modules()
Definition: class_board.h:226
SHAPE_POLY_SET.
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines)
Function ConvertBrdLayerToPolygonalContours Build a set of polygons which are the outlines of copper ...
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
const wxPoint GetPosition() const override
Definition: class_track.h:309
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:108
SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:506
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
DrillMarksType GetDrillMarksType() const
TRACKS & Tracks()
Definition: class_board.h:217
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0

References arrayDim(), SHAPE_POLY_SET::CHole(), PLOTTER::Circle(), BOARD::ConvertBrdLayerToPolygonalContours(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), VIA::GetPosition(), SHAPE_POLY_SET::HoleCount(), VIA::IsOnLayer(), BOARD::Modules(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NO_FILL, NULL, SHAPE_POLY_SET::OutlineCount(), plot_seq, PLOTTER::PlotPoly(), SHAPE_POLY_SET::PM_FAST, SHAPE_LINE_CHAIN::PointCount(), SHAPE_POLY_SET::RemoveAllContours(), LSET::Seq(), BRDITEMS_PLOTTER::SetLayerSet(), SHAPE_POLY_SET::Simplify(), SKETCH, SMALL_DRILL, PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, PLOTTER::ThickSegment(), and BOARD::Tracks().

Referenced by PlotOneBoardLayer().

◆ PlotOneBoardLayer()

void PlotOneBoardLayer ( BOARD aBoard,
PLOTTER aPlotter,
PCB_LAYER_ID  aLayer,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotOneBoardLayer main function to plot one copper or technical layer.

It prepare options and calls the specialized plot function, according to the layer type

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayer= the layer id to plot
aPlotOpt= the plot options (files, sketch). Has meaning for some formats only

Definition at line 153 of file plot_board_layers.cpp.

155 {
156  PCB_PLOT_PARAMS plotOpt = aPlotOpt;
157  int soldermask_min_thickness = aBoard->GetDesignSettings().m_SolderMaskMinWidth;
158 
159  // Set a default color and the text mode for this layer
160  aPlotter->SetColor( aPlotOpt.GetColor() );
161  aPlotter->SetTextMode( aPlotOpt.GetTextMode() );
162 
163  // Specify that the contents of the "Edges Pcb" layer are to be plotted in addition to the
164  // contents of the currently specified layer.
165  LSET layer_mask( aLayer );
166 
167  if( !aPlotOpt.GetExcludeEdgeLayer() )
168  layer_mask.set( Edge_Cuts );
169 
170  if( IsCopperLayer( aLayer ) )
171  {
172  // Skip NPTH pads on copper layers ( only if hole size == pad size ):
173  // Drill mark will be plotted if drill mark is SMALL_DRILL_SHAPE or FULL_DRILL_SHAPE
174  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF )
175  {
176  plotOpt.SetSkipPlotNPTH_Pads( false );
177  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
178  }
179  else
180  {
181  plotOpt.SetSkipPlotNPTH_Pads( true );
182  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
183  }
184  }
185  else
186  {
187  switch( aLayer )
188  {
189  case B_Mask:
190  case F_Mask:
191  plotOpt.SetSkipPlotNPTH_Pads( false );
192  // Disable plot pad holes
194 
195  // Plot solder mask:
196  if( soldermask_min_thickness == 0 )
197  {
198  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF )
199  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
200  else
201  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
202  }
203  else
204  PlotSolderMaskLayer( aBoard, aPlotter, layer_mask, plotOpt,
205  soldermask_min_thickness );
206 
207  break;
208 
209  case B_Adhes:
210  case F_Adhes:
211  case B_Paste:
212  case F_Paste:
213  plotOpt.SetSkipPlotNPTH_Pads( false );
214  // Disable plot pad holes
216 
217  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF )
218  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
219  else
220  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
221  break;
222 
223  case F_SilkS:
224  case B_SilkS:
225  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF && plotOpt.GetDXFPlotPolygonMode() )
226  // PlotLayerOutlines() is designed only for DXF plotters.
227  // and must not be used for other plot formats
228  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
229  else
230  PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
231 
232  // Gerber: Subtract soldermask from silkscreen if enabled
233  if( aPlotter->GetPlotterType() == PLOT_FORMAT::GERBER
234  && plotOpt.GetSubtractMaskFromSilk() )
235  {
236  if( aLayer == F_SilkS )
237  layer_mask = LSET( F_Mask );
238  else
239  layer_mask = LSET( B_Mask );
240 
241  // Create the mask to subtract by creating a negative layer polarity
242  aPlotter->SetLayerPolarity( false );
243 
244  // Disable plot pad holes
246 
247  // Plot the mask
248  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
249  }
250  break;
251 
252  // These layers are plotted like silk screen layers.
253  // Mainly, pads on these layers are not filled.
254  // This is not necessary the best choice.
255  case Dwgs_User:
256  case Cmts_User:
257  case Eco1_User:
258  case Eco2_User:
259  case Edge_Cuts:
260  case Margin:
261  case F_CrtYd:
262  case B_CrtYd:
263  case F_Fab:
264  case B_Fab:
265  plotOpt.SetSkipPlotNPTH_Pads( false );
267 
268  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF && plotOpt.GetDXFPlotPolygonMode() )
269  // PlotLayerOutlines() is designed only for DXF plotters.
270  // and must not be used for other plot formats
271  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
272  else
273  PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
274  break;
275 
276  default:
277  plotOpt.SetSkipPlotNPTH_Pads( false );
279 
280  if( plotOpt.GetFormat() == PLOT_FORMAT::DXF && plotOpt.GetDXFPlotPolygonMode() )
281  // PlotLayerOutlines() is designed only for DXF plotters.
282  // and must not be used for other plot formats
283  PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
284  else
285  PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
286  break;
287  }
288  }
289 }
bool GetDXFPlotPolygonMode() const
virtual void SetColor(COLOR4D color)=0
virtual void SetLayerPolarity(bool aPositive)
Function SetLayerPolarity sets current Gerber layer polarity to positive or negative by writing %LPD*...
Definition: plotter.h:449
void PlotStandardLayer(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotStandardLayer plot copper or technical layers.
void PlotSilkScreen(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotSilkScreen plot silkscreen layers which have specific requirements, mainly for pads.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
void SetDrillMarksType(DrillMarksType aVal)
static void PlotSolderMaskLayer(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt, int aMinThickness)
void PlotLayerOutlines(BOARD *aBoard, PLOTTER *aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotLayerOutlines plot copper outline of a copper layer.
LSET is a set of PCB_LAYER_IDs.
PLOT_FORMAT GetFormat() const
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
COLOR4D GetColor() const
virtual void SetTextMode(PLOT_TEXT_MODE mode)
Change the current text mode.
Definition: plotter.h:458
void SetSkipPlotNPTH_Pads(bool aSkip)
PLOT_TEXT_MODE GetTextMode() const
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
bool GetSubtractMaskFromSilk() const
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
bool GetExcludeEdgeLayer() const
int m_SolderMaskMinWidth
Solder mask min width.

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, DXF, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, GERBER, PCB_PLOT_PARAMS::GetColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDXFPlotPolygonMode(), PCB_PLOT_PARAMS::GetExcludeEdgeLayer(), PCB_PLOT_PARAMS::GetFormat(), PLOTTER::GetPlotterType(), PCB_PLOT_PARAMS::GetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::GetTextMode(), IsCopperLayer(), BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, Margin, PCB_PLOT_PARAMS::NO_DRILL_SHAPE, PlotLayerOutlines(), PlotSilkScreen(), PlotSolderMaskLayer(), PlotStandardLayer(), PLOTTER::SetColor(), PCB_PLOT_PARAMS::SetDrillMarksType(), PLOTTER::SetLayerPolarity(), PCB_PLOT_PARAMS::SetSkipPlotNPTH_Pads(), and PLOTTER::SetTextMode().

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), DIALOG_PLOT::Plot(), and PLOT_CONTROLLER::PlotLayer().

◆ PlotSilkScreen()

void PlotSilkScreen ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotSilkScreen plot silkscreen layers which have specific requirements, mainly for pads.

Should not be used for other layers

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayerMask= the mask to define the layers to plot (silkscreen Front and/or Back)
aPlotOpt= the plot options (files, sketch). Has meaning for some formats only

Definition at line 68 of file plot_board_layers.cpp.

70 {
71  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
72  itemplotter.SetLayerSet( aLayerMask );
73 
74  // Plot edge layer and graphic items
75  itemplotter.PlotBoardGraphicItems();
76 
77  // Plot footprint outlines :
78  itemplotter.Plot_Edges_Modules();
79 
80  // Plot pads (creates pads outlines, for pads on silkscreen layers)
81  LSET layersmask_plotpads = aLayerMask;
82 
83  // Calculate the mask layers of allowed layers for pads
84 
85  if( !aPlotOpt.GetPlotPadsOnSilkLayer() ) // Do not plot pads on silk screen layers
86  layersmask_plotpads.set( B_SilkS, false ).set( F_SilkS, false );
87 
88  if( layersmask_plotpads.any() )
89  {
90  for( auto Module : aBoard->Modules() )
91  {
92  aPlotter->StartBlock( NULL );
93 
94  for( auto pad : Module->Pads() )
95  {
96  // See if the pad is on this layer
97  LSET masklayer = pad->GetLayerSet();
98  if( !( masklayer & layersmask_plotpads ).any() )
99  continue;
100 
102 
103  if( layersmask_plotpads[B_SilkS] )
104  color = aBoard->Colors().GetLayerColor( B_SilkS );
105 
106  if( layersmask_plotpads[F_SilkS] )
107  color = ( color == COLOR4D::BLACK) ? aBoard->Colors().GetLayerColor( F_SilkS ) : color;
108 
109  itemplotter.PlotPad( pad, color, SKETCH );
110  }
111 
112  aPlotter->EndBlock( NULL );
113  }
114  }
115 
116  // Plot footprints fields (ref, value ...)
117  for( auto module : aBoard->Modules() )
118  {
119  if( ! itemplotter.PlotAllTextsModule( module ) )
120  {
121  wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ),
122  module->GetReference() );
123  }
124  }
125 
126  // Plot filled areas
127  aPlotter->StartBlock( NULL );
128 
129  // Plot all zones together so we don't end up with divots where zones touch each other.
130  ZONE_CONTAINER* zone = nullptr;
131  SHAPE_POLY_SET aggregateArea;
132 
133  for( ZONE_CONTAINER* candidate : aBoard->Zones() )
134  {
135  if( !aLayerMask[ candidate->GetLayer() ] )
136  continue;
137 
138  if( !zone )
139  zone = candidate;
140 
141  aggregateArea.BooleanAdd( candidate->GetFilledPolysList(), SHAPE_POLY_SET::PM_FAST );
142  }
143 
144  if( zone )
145  {
147  itemplotter.PlotFilledAreas( zone, aggregateArea );
148  }
149 
150  aPlotter->EndBlock( NULL );
151 }
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:484
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
int color
Definition: DXF_plotter.cpp:61
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:475
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
LSET is a set of PCB_LAYER_IDs.
#define NULL
MODULES & Modules()
Definition: class_board.h:226
SHAPE_POLY_SET.
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:560
ZONE_CONTAINERS & Zones()
Definition: class_board.h:240
#define _(s)
Definition: 3d_actions.cpp:31
bool GetPlotPadsOnSilkLayer() const
Definition: colors.h:45
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References _, B_SilkS, BLACK, SHAPE_POLY_SET::BooleanAdd(), color, BOARD::Colors(), PLOTTER::EndBlock(), F_SilkS, SHAPE_POLY_SET::Fracture(), COLORS_DESIGN_SETTINGS::GetLayerColor(), PCB_PLOT_PARAMS::GetPlotPadsOnSilkLayer(), BOARD::Modules(), NULL, BRDITEMS_PLOTTER::Plot_Edges_Modules(), BRDITEMS_PLOTTER::PlotAllTextsModule(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, BRDITEMS_PLOTTER::SetLayerSet(), SKETCH, PLOTTER::StartBlock(), and BOARD::Zones().

Referenced by PlotOneBoardLayer().

◆ PlotStandardLayer()

void PlotStandardLayer ( BOARD aBoard,
PLOTTER aPlotter,
LSET  aLayerMask,
const PCB_PLOT_PARAMS aPlotOpt 
)

Function PlotStandardLayer plot copper or technical layers.

not used for silk screen layers, because these layers have specific requirements, mainly for pads

Parameters
aBoard= the board to plot
aPlotter= the plotter to use
aLayerMask= the mask to define the layers to plot
aPlotOpt= the plot options (files, sketch). Has meaning for some formats only

aPlotOpt has 3 important options to control this plot, which are set, depending on the layer type to plot SetEnablePlotVia( bool aEnable ) aEnable = true to plot vias, false to skip vias (has meaning only for solder mask layers). SetSkipPlotNPTH_Pads( bool aSkip ) aSkip = true to skip NPTH Pads, when the pad size and the pad hole have the same size. Used in GERBER format only. SetDrillMarksType( DrillMarksType aVal ) controle the actual hole: no hole, small hole, actual hole

Definition at line 295 of file plot_board_layers.cpp.

297 {
298  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
299 
300  itemplotter.SetLayerSet( aLayerMask );
301 
302  EDA_DRAW_MODE_T plotMode = aPlotOpt.GetPlotMode();
303 
304  // Plot edge layer and graphic items
305  itemplotter.PlotBoardGraphicItems();
306 
307  // Draw footprint texts:
308  for( auto module : aBoard->Modules() )
309  {
310  if( ! itemplotter.PlotAllTextsModule( module ) )
311  {
312  wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ),
313  module->GetReference() );
314  }
315  }
316 
317  // Draw footprint other graphic items:
318  for( auto module : aBoard->Modules() )
319  {
320  for( auto item : module->GraphicalItems() )
321  {
322  if( item->Type() == PCB_MODULE_EDGE_T && aLayerMask[ item->GetLayer() ] )
323  itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item );
324  }
325  }
326 
327  // Plot footprint pads
328  for( auto module : aBoard->Modules() )
329  {
330  aPlotter->StartBlock( NULL );
331 
332  for( auto pad : module->Pads() )
333  {
334  if( (pad->GetLayerSet() & aLayerMask) == 0 )
335  continue;
336 
337  wxSize margin;
338  double width_adj = 0;
339 
340  if( ( aLayerMask & LSET::AllCuMask() ).any() )
341  width_adj = itemplotter.getFineWidthAdj();
342 
343  static const LSET speed( 4, B_Mask, F_Mask, B_Paste, F_Paste );
344 
345  LSET anded = ( speed & aLayerMask );
346 
347  if( anded == LSET( F_Mask ) || anded == LSET( B_Mask ) )
348  {
349  margin.x = margin.y = pad->GetSolderMaskMargin();
350  }
351  else if( anded == LSET( F_Paste ) || anded == LSET( B_Paste ) )
352  {
353  margin = pad->GetSolderPasteMargin();
354  }
355 
356  // Now offset the pad size by margin + width_adj
357  // this is easy for most shapes, but not for a trapezoid or a custom shape
358  wxSize padPlotsSize;
359  wxSize extraSize = margin * 2;
360  extraSize.x += width_adj;
361  extraSize.y += width_adj;
362  wxSize deltaSize = pad->GetDelta(); // has meaning only for trapezoidal pads
363 
364  if( pad->GetShape() == PAD_SHAPE_TRAPEZOID )
365  { // The easy way is to use BuildPadPolygon to calculate
366  // size and delta of the trapezoidal pad after offseting:
367  wxPoint coord[4];
368  pad->BuildPadPolygon( coord, extraSize/2, 0.0 );
369  // Calculate the size and delta from polygon corners coordinates:
370  // coord[0] is the lower left
371  // coord[1] is the upper left
372  // coord[2] is the upper right
373  // coord[3] is the lower right
374 
375  // the size is the distance between middle of segments
376  // (left/right or top/bottom)
377  // size X is the dist between left and right middle points:
378  padPlotsSize.x = ( ( -coord[0].x + coord[3].x ) // the lower segment X length
379  + ( -coord[1].x + coord[2].x ) ) // the upper segment X length
380  / 2; // the Y size is the half sum
381  // size Y is the dist between top and bottom middle points:
382  padPlotsSize.y = ( ( coord[0].y - coord[1].y ) // the left segment Y lenght
383  + ( coord[3].y - coord[2].y ) ) // the right segment Y lenght
384  / 2; // the Y size is the half sum
385 
386  // calculate the delta ( difference of lenght between 2 opposite edges )
387  // The delta.x is the delta along the X axis, therefore the delta of Y lenghts
388  wxSize delta;
389 
390  if( coord[0].y != coord[3].y )
391  delta.x = coord[0].y - coord[3].y;
392  else
393  delta.y = coord[1].x - coord[0].x;
394 
395  pad->SetDelta( delta );
396  }
397  else
398  padPlotsSize = pad->GetSize() + extraSize;
399 
400  // Don't draw a null size item :
401  if( padPlotsSize.x <= 0 || padPlotsSize.y <= 0 )
402  continue;
403 
405 
406  if( pad->GetLayerSet()[B_Cu] )
407  color = aBoard->Colors().GetItemColor( LAYER_PAD_BK );
408 
409  if( pad->GetLayerSet()[F_Cu] )
410  color = color.LegacyMix( aBoard->Colors().GetItemColor( LAYER_PAD_FR ) );
411 
412  // Temporary set the pad size to the required plot size:
413  wxSize tmppadsize = pad->GetSize();
414 
415  switch( pad->GetShape() )
416  {
417  case PAD_SHAPE_CIRCLE:
418  case PAD_SHAPE_OVAL:
419  pad->SetSize( padPlotsSize );
420 
421  if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
423  ( pad->GetSize() == pad->GetDrillSize() ) &&
424  ( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) )
425  break;
426 
427  itemplotter.PlotPad( pad, color, plotMode );
428  break;
429 
430  case PAD_SHAPE_TRAPEZOID:
431  case PAD_SHAPE_RECT:
432  case PAD_SHAPE_ROUNDRECT:
434  pad->SetSize( padPlotsSize );
435  itemplotter.PlotPad( pad, color, plotMode );
436  break;
437 
438  case PAD_SHAPE_CUSTOM:
439  {
440  // inflate/deflate a custom shape is a bit complex.
441  // so build a similar pad shape, and inflate/deflate the polygonal shape
442  D_PAD dummy( *pad );
443  SHAPE_POLY_SET shape;
444  pad->MergePrimitivesAsPolygon( &shape );
445  // Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
446  // which can create bad shapes if margin.x is < 0
447  int maxError = aBoard->GetDesignSettings().m_MaxError;
448  int numSegs = std::max( GetArcToSegmentCount( margin.x, maxError, 360.0 ), 6 );
449  shape.InflateWithLinkedHoles( margin.x, numSegs, SHAPE_POLY_SET::PM_FAST );
450  dummy.DeletePrimitivesList();
451  dummy.AddPrimitive( shape, 0 );
452  dummy.MergePrimitivesAsPolygon();
453 
454  // Be sure the anchor pad is not bigger than the deflated shape because this
455  // anchor will be added to the pad shape when plotting the pad. So now the
456  // polygonal shape is built, we can clamp the anchor size
457  if( margin.x < 0 ) // we expect margin.x = margin.y for custom pads
458  dummy.SetSize( padPlotsSize );
459 
460  itemplotter.PlotPad( &dummy, color, plotMode );
461  }
462  break;
463  }
464 
465  pad->SetSize( tmppadsize ); // Restore the pad size
466  pad->SetDelta( deltaSize );
467  }
468 
469  aPlotter->EndBlock( NULL );
470  }
471 
472  // Plot vias on copper layers, and if aPlotOpt.GetPlotViaOnMaskLayer() is true,
473  // plot them on solder mask
474 
475  GBR_METADATA gbr_metadata;
476 
477  bool isOnCopperLayer = ( aLayerMask & LSET::AllCuMask() ).any();
478 
479  if( isOnCopperLayer )
480  {
483  }
484 
485  aPlotter->StartBlock( NULL );
486 
487  for( auto track : aBoard->Tracks() )
488  {
489  const VIA* Via = dyn_cast<const VIA*>( track );
490 
491  if( !Via )
492  continue;
493 
494  // vias are not plotted if not on selected layer, but if layer is SOLDERMASK_LAYER_BACK
495  // or SOLDERMASK_LAYER_FRONT, vias are drawn only if they are on the corresponding
496  // external copper layer
497  LSET via_mask_layer = Via->GetLayerSet();
498 
499  if( aPlotOpt.GetPlotViaOnMaskLayer() )
500  {
501  if( via_mask_layer[B_Cu] )
502  via_mask_layer.set( B_Mask );
503 
504  if( via_mask_layer[F_Cu] )
505  via_mask_layer.set( F_Mask );
506  }
507 
508  if( !( via_mask_layer & aLayerMask ).any() )
509  continue;
510 
511  int via_margin = 0;
512  double width_adj = 0;
513 
514  // If the current layer is a solder mask, use the global mask clearance for vias
515  if( aLayerMask[B_Mask] || aLayerMask[F_Mask] )
516  via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
517 
518  if( ( aLayerMask & LSET::AllCuMask() ).any() )
519  width_adj = itemplotter.getFineWidthAdj();
520 
521  int diameter = Via->GetWidth() + 2 * via_margin + width_adj;
522 
523  // Don't draw a null size item :
524  if( diameter <= 0 )
525  continue;
526 
527  // Some vias can be not connected (no net).
528  // Set the m_NotInNet for these vias to force a empty net name in gerber file
529  gbr_metadata.m_NetlistMetadata.m_NotInNet = Via->GetNetname().IsEmpty();
530 
531  gbr_metadata.SetNetName( Via->GetNetname() );
532 
533  COLOR4D color =
534  aBoard->Colors().GetItemColor( LAYER_VIAS + static_cast<int>( Via->GetViaType() ) );
535  // Set plot color (change WHITE to LIGHTGRAY because the white items are not seen on a
536  // white paper or screen
537  aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY);
538  aPlotter->FlashPadCircle( Via->GetStart(), diameter, plotMode, &gbr_metadata );
539  }
540 
541  aPlotter->EndBlock( NULL );
542  aPlotter->StartBlock( NULL );
544 
545  // Plot tracks (not vias) :
546  for( auto track : aBoard->Tracks() )
547  {
548  if( track->Type() == PCB_VIA_T )
549  continue;
550 
551  if( !aLayerMask[track->GetLayer()] )
552  continue;
553 
554  // Some track segments can be not connected (no net).
555  // Set the m_NotInNet for these segments to force a empty net name in gerber file
556  gbr_metadata.m_NetlistMetadata.m_NotInNet = track->GetNetname().IsEmpty();
557 
558  gbr_metadata.SetNetName( track->GetNetname() );
559  int width = track->GetWidth() + itemplotter.getFineWidthAdj();
560  aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
561  aPlotter->ThickSegment( track->GetStart(), track->GetEnd(), width, plotMode, &gbr_metadata );
562  }
563 
564  aPlotter->EndBlock( NULL );
565 
566  // Plot filled ares
567  aPlotter->StartBlock( NULL );
568 
569  // Plot all zones of the same layer & net together so we don't end up with divots where
570  // zones touch each other.
571  std::set<ZONE_CONTAINER*> plotted;
572 
573  for( ZONE_CONTAINER* zone : aBoard->Zones() )
574  {
575  if( !aLayerMask[ zone->GetLayer() ] || plotted.count( zone ) )
576  continue;
577 
578  plotted.insert( zone );
579 
580  SHAPE_POLY_SET aggregateArea = zone->GetFilledPolysList();
581  bool needFracture = false; // If 2 or more filled areas are combined, resulting
582  // aggregateArea will be simplified and fractured
583  // (Long calculation time)
584 
585  for( ZONE_CONTAINER* candidate : aBoard->Zones() )
586  {
587  if( !aLayerMask[ candidate->GetLayer() ] || plotted.count( candidate ) )
588  continue;
589 
590  if( candidate->GetNetCode() != zone->GetNetCode() )
591  continue;
592 
593  // Merging zones of the same net can be done only for areas
594  // having compatible settings for drawings:
595  // use or not outline thickness, and if using outline thickness,
596  // having the same thickness
597  // because after merging only one outline thickness is used
598  if( candidate->GetFilledPolysUseThickness() != zone->GetFilledPolysUseThickness() )
599  // Should not happens, because usually the same option is used for filling
600  continue;
601 
602  if( zone->GetFilledPolysUseThickness() &&
603  ( candidate->GetMinThickness() != zone->GetMinThickness() ) )
604  continue;
605 
606  plotted.insert( candidate );
607  aggregateArea.Append( candidate->GetFilledPolysList() );
608  needFracture = true;
609  }
610 
611  if( needFracture )
612  {
615  }
616 
617  itemplotter.PlotFilledAreas( zone, aggregateArea );
618  }
619  aPlotter->EndBlock( NULL );
620 
621  // Adding drill marks, if required and if the plotter is able to plot them:
623  itemplotter.PlotDrillMarks();
624 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:686
int m_SolderMaskMargin
Solder mask margin.
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:484
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:66
virtual void SetColor(COLOR4D color)=0
const wxPoint & GetStart() const
Definition: class_track.h:109
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
int color
Definition: DXF_plotter.cpp:61
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:475
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
LSET is a set of PCB_LAYER_IDs.
#define NULL
MODULES & Modules()
Definition: class_board.h:226
SHAPE_POLY_SET.
EDA_DRAW_MODE_T
Definition: eda_text.h:59
bool GetSkipPlotNPTH_Pads() const
const wxString & GetNetname() const
Function GetNetname.
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:180
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:560
ZONE_CONTAINERS & Zones()
Definition: class_board.h:240
bool GetPlotViaOnMaskLayer() const
smd pads, front layer
int GetWidth() const
Definition: class_track.h:103
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
#define _(s)
Definition: 3d_actions.cpp:31
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:506
VIATYPE GetViaType() const
Definition: class_track.h:336
void InflateWithLinkedHoles(int aFactor, int aCircleSegmentsCount, POLYGON_MODE aFastMode)
Performs outline inflation/deflation, using round corners.
Definition: colors.h:49
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:212
Definition: colors.h:45
DrillMarksType GetDrillMarksType() const
print info associated to a net (TO.N attribute)
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
TRACKS & Tracks()
Definition: class_board.h:217
EDA_DRAW_MODE_T GetPlotMode() const
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void Unfracture(POLYGON_MODE aFastMode)
Converts a single outline slitted ("fractured") polygon into a set ouf outlines with holes.

References _, LSET::AllCuMask(), SHAPE_POLY_SET::Append(), B_Cu, B_Mask, B_Paste, BLACK, color, BOARD::Colors(), dummy(), PLOTTER::EndBlock(), F_Cu, F_Mask, F_Paste, PLOTTER::FlashPadCircle(), SHAPE_POLY_SET::Fracture(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_VIAPAD, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GetArcToSegmentCount(), BRDITEMS_PLOTTER::getColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), BRDITEMS_PLOTTER::getFineWidthAdj(), COLORS_DESIGN_SETTINGS::GetItemColor(), VIA::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads(), TRACK::GetStart(), VIA::GetViaType(), TRACK::GetWidth(), SHAPE_POLY_SET::InflateWithLinkedHoles(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_VIAS, LIGHTGRAY, BOARD_DESIGN_SETTINGS::m_MaxError, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD::Modules(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NULL, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, PCB_MODULE_EDGE_T, PCB_VIA_T, BRDITEMS_PLOTTER::Plot_1_EdgeModule(), BRDITEMS_PLOTTER::PlotAllTextsModule(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotDrillMarks(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), BRDITEMS_PLOTTER::SetLayerSet(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), PLOTTER::StartBlock(), PLOTTER::ThickSegment(), BOARD::Tracks(), SHAPE_POLY_SET::Unfracture(), WHITE, wxPoint::x, wxPoint::y, and BOARD::Zones().

Referenced by PlotOneBoardLayer().

◆ StartPlotBoard()

PLOTTER* StartPlotBoard ( BOARD aBoard,
PCB_PLOT_PARAMS aPlotOpts,
int  aLayer,
const wxString &  aFullFileName,
const wxString &  aSheetDesc 
)

Open a new plotfile using the options (and especially the format) specified in the options and prepare the page for plotting.

Return the plotter object if OK, NULL if the file is not created (or has a problem)

Definition at line 1039 of file plot_board_layers.cpp.

1041 {
1042  // Create the plotter driver and set the few plotter specific options
1043  PLOTTER* plotter = NULL;
1044 
1045  switch( aPlotOpts->GetFormat() )
1046  {
1047  case PLOT_FORMAT::DXF:
1048  DXF_PLOTTER* DXF_plotter;
1049  DXF_plotter = new DXF_PLOTTER();
1050  DXF_plotter->SetUnits(
1051  static_cast<DXF_PLOTTER::DXF_UNITS>( aPlotOpts->GetDXFPlotUnits() ) );
1052 
1053  plotter = DXF_plotter;
1054  break;
1055 
1056  case PLOT_FORMAT::POST:
1057  PS_PLOTTER* PS_plotter;
1058  PS_plotter = new PS_PLOTTER();
1059  PS_plotter->SetScaleAdjust( aPlotOpts->GetFineScaleAdjustX(),
1060  aPlotOpts->GetFineScaleAdjustY() );
1061  plotter = PS_plotter;
1062  break;
1063 
1064  case PLOT_FORMAT::PDF:
1065  plotter = new PDF_PLOTTER();
1066  break;
1067 
1068  case PLOT_FORMAT::HPGL:
1069  HPGL_PLOTTER* HPGL_plotter;
1070  HPGL_plotter = new HPGL_PLOTTER();
1071 
1072  // HPGL options are a little more convoluted to compute, so they get their own function
1073  ConfigureHPGLPenSizes( HPGL_plotter, aPlotOpts );
1074  plotter = HPGL_plotter;
1075  break;
1076 
1077  case PLOT_FORMAT::GERBER:
1078  plotter = new GERBER_PLOTTER();
1079  break;
1080 
1081  case PLOT_FORMAT::SVG:
1082  plotter = new SVG_PLOTTER();
1083  break;
1084 
1085  default:
1086  wxASSERT( false );
1087  return NULL;
1088  }
1089 
1090  // Compute the viewport and set the other options
1091 
1092  // page layout is not mirrored, so temporarily change mirror option for the page layout
1093  PCB_PLOT_PARAMS plotOpts = *aPlotOpts;
1094 
1095  if( plotOpts.GetPlotFrameRef() && plotOpts.GetMirror() )
1096  plotOpts.SetMirror( false );
1097 
1098  initializePlotter( plotter, aBoard, &plotOpts );
1099 
1100  if( plotter->OpenFile( aFullFileName ) )
1101  {
1102  plotter->ClearHeaderLinesList();
1103 
1104  // For the Gerber "file function" attribute, set the layer number
1105  if( plotter->GetPlotterType() == PLOT_FORMAT::GERBER )
1106  {
1107  bool useX2mode = plotOpts.GetUseGerberX2format();
1108 
1109  GERBER_PLOTTER* gbrplotter = static_cast <GERBER_PLOTTER*> ( plotter );
1110  gbrplotter->UseX2format( useX2mode );
1111  gbrplotter->UseX2NetAttributes( plotOpts.GetIncludeGerberNetlistInfo() );
1112 
1113  // Attributes can be added using X2 format or as comment (X1 format)
1114  AddGerberX2Attribute( plotter, aBoard, aLayer, not useX2mode );
1115  }
1116 
1117  plotter->StartPlot();
1118 
1119  // Plot the frame reference if requested
1120  if( aPlotOpts->GetPlotFrameRef() )
1121  {
1122  PlotWorkSheet( plotter, aBoard->GetTitleBlock(), aBoard->GetPageSettings(),
1123  1, 1, aSheetDesc, aBoard->GetFileName() );
1124 
1125  if( aPlotOpts->GetMirror() )
1126  initializePlotter( plotter, aBoard, aPlotOpts );
1127  }
1128 
1129  // When plotting a negative board: draw a black rectangle (background for plot board
1130  // in white) and switch the current color to WHITE; note the color inversion is actually
1131  // done in the driver (if supported)
1132  if( aPlotOpts->GetNegative() )
1133  {
1134  EDA_RECT bbox = aBoard->ComputeBoundingBox();
1135  FillNegativeKnockout( plotter, bbox );
1136  }
1137 
1138  return plotter;
1139  }
1140 
1141  delete plotter;
1142  return NULL;
1143 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:545
void UseX2NetAttributes(bool aEnable)
Definition: plotter.h:1282
bool GetPlotFrameRef() const
static void initializePlotter(PLOTTER *aPlotter, BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts)
Set up most plot options for plotting a board (especially the viewport) Important thing: page size is...
virtual bool StartPlot()=0
static void FillNegativeKnockout(PLOTTER *aPlotter, const EDA_RECT &aBbbox)
Prefill in black an area a little bigger than the board to prepare for the negative plot.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:82
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
Definition: plotter.h:715
void SetMirror(bool aFlag)
void UseX2format(bool aEnable)
Definition: plotter.h:1281
void AddGerberX2Attribute(PLOTTER *aPlotter, const BOARD *aBoard, LAYER_NUM aLayer, bool aUseX1CompatibilityMode)
Calculates some X2 attributes, as defined in the Gerber file format specification and add them to the...
Definition: pcbplot.cpp:354
void SetUnits(DXF_UNITS aUnit)
Set the units to use for plotting the DXF file.
const wxString & GetFileName() const
Definition: class_board.h:215
bool GetUseGerberX2format() const
bool GetMirror() const
void PlotWorkSheet(PLOTTER *plotter, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, const COLOR4D aColor)
PLOT_FORMAT GetFormat() const
#define NULL
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
bool GetIncludeGerberNetlistInfo() const
static void ConfigureHPGLPenSizes(HPGL_PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts)
Calculate the effective size of HPGL pens and set them in the plotter object.
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
double GetFineScaleAdjustX() const
Base plotter engine class.
Definition: plotter.h:103
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:551
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void ClearHeaderLinesList()
Function ClearHeaderLinesList remove all lines from the list of free lines to print at the beginning ...
Definition: plotter.h:191
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Function ComputeBoundingBox calculates the bounding box containing all board items (or board edge seg...
double GetFineScaleAdjustY() const
bool GetNegative() const
DXF_PLOTTER::DXF_UNITS GetDXFPlotUnits() const

References AddGerberX2Attribute(), PLOTTER::ClearHeaderLinesList(), BOARD::ComputeBoundingBox(), ConfigureHPGLPenSizes(), DXF, FillNegativeKnockout(), GERBER, PCB_PLOT_PARAMS::GetDXFPlotUnits(), BOARD::GetFileName(), PCB_PLOT_PARAMS::GetFineScaleAdjustX(), PCB_PLOT_PARAMS::GetFineScaleAdjustY(), PCB_PLOT_PARAMS::GetFormat(), PCB_PLOT_PARAMS::GetIncludeGerberNetlistInfo(), PCB_PLOT_PARAMS::GetMirror(), PCB_PLOT_PARAMS::GetNegative(), BOARD::GetPageSettings(), PCB_PLOT_PARAMS::GetPlotFrameRef(), PLOTTER::GetPlotterType(), BOARD::GetTitleBlock(), PCB_PLOT_PARAMS::GetUseGerberX2format(), HPGL, initializePlotter(), NULL, PLOTTER::OpenFile(), PDF, PlotWorkSheet(), POST, PCB_PLOT_PARAMS::SetMirror(), PSLIKE_PLOTTER::SetScaleAdjust(), DXF_PLOTTER::SetUnits(), PLOTTER::StartPlot(), SVG, GERBER_PLOTTER::UseX2format(), and GERBER_PLOTTER::UseX2NetAttributes().

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().