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>

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

#define PLOT_MAX_SCALE   100.0
#define PLOT_MIN_SCALE   0.01
#define SMALL_DRILL   KiROUND( 0.35 * IU_PER_MM )

Definition at line 72 of file pcbplot.h.

Referenced by BRDITEMS_PLOTTER::PlotDrillMarks(), and PlotLayerOutlines().

Function Documentation

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 361 of file pcbplot.cpp.

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

Referenced by BRDITEMS_PLOTTER::SetLayerSet(), and StartPlotBoard().

363 {
364  AddGerberX2Header( aPlotter, aBoard, aUseX1CompatibilityMode );
365 
366  wxString text;
367 
368  // Add the TF.FileFunction
369  text = GetGerberFileFunctionAttribute( aBoard, aLayer );
370  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
371 
372  // Add the TF.FilePolarity (for layers which support that)
373  text = GetGerberFilePolarityAttribute( aLayer );
374 
375  if( !text.IsEmpty() )
376  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
377 }
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:280
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:176
static const wxString GetGerberFilePolarityAttribute(LAYER_NUM aLayer)
Definition: pcbplot.cpp:209
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
Definition: pcbplot.cpp:268
const wxString GetGerberFileFunctionAttribute(const BOARD *aBoard, LAYER_NUM aLayer)
Function GetGerberFileFunctionAttribute Returns the "file function" attribute for aLayer...
Definition: pcbplot.cpp:89
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 280 of file pcbplot.cpp.

References PLOTTER::AddLineToHeader(), 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 BRDITEMS_PLOTTER::SetLayerSet().

282 {
283  wxString text;
284 
285  // Creates the TF,.GenerationSoftware. Format is:
286  // %TF,.GenerationSoftware,<vendor>,<application name>[,<application version>]*%
287  text.Printf( wxT( "%%TF.GenerationSoftware,KiCad,Pcbnew,%s*%%" ), GetBuildVersion() );
288  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
289 
290  // creates the TF.CreationDate ext:
291  // The attribute value must conform to the full version of the ISO 8601
292  // date and time format, including time and time zone. Note that this is
293  // the date the Gerber file was effectively created,
294  // not the time the project of PCB was started
295  wxDateTime date( wxDateTime::GetTimeNow() );
296  // Date format: see http://www.cplusplus.com/reference/ctime/strftime
297  wxString msg = date.Format( wxT( "%z" ) ); // Extract the time zone offset
298  // The time zone offset format is + (or -) mm or hhmm (mm = number of minutes, hh = number of hours)
299  // we want +(or -) hh:mm
300  if( msg.Len() > 3 )
301  msg.insert( 3, ":", 1 ),
302  text.Printf( wxT( "%%TF.CreationDate,%s%s*%%" ), GetChars( date.FormatISOCombined() ), GetChars( msg ) );
303  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
304 
305  // Creates the TF,.ProjectId. Format is (from Gerber file format doc):
306  // %TF.ProjectId,<project id>,<project GUID>,<revision id>*%
307  // <project id> is the name of the project, restricted to basic ASCII symbols only,
308  // Rem: <project id> accepts only ASCII 7 code (only basic ASCII codes are allowed in gerber files).
309  // and comma not accepted
310  // All illegal chars will be replaced by underscore
311  //
312  // <project GUID> is a string which is an unique id of a project.
313  // However Kicad does not handle such a project GUID, so it is built from the board name
314  wxFileName fn = aBoard->GetFileName();
315  msg = fn.GetFullName();
316 
317  // Build a <project GUID>, from the board name
318  wxString guid = GbrMakeProjectGUIDfromString( msg );
319 
320  // build the <project id> string: this is the board short filename (without ext)
321  // and all non ASCII chars and comma are replaced by '_'
322  msg = fn.GetName();
323  msg.Replace( wxT( "," ), wxT( "_" ) );
324 
325  // build the <rec> string. All non ASCII chars and comma are replaced by '_'
326  wxString rev = ((BOARD*)aBoard)->GetTitleBlock().GetRevision();
327  rev.Replace( wxT( "," ), wxT( "_" ) );
328 
329  if( rev.IsEmpty() )
330  rev = wxT( "rev?" );
331 
332  text.Printf( wxT( "%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), GetChars( guid ), rev.ToAscii() );
333  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
334 
335  // Add the TF.SameCoordinates, that specify all gerber files uses the same
336  // origin and orientation, and the registration between files is OK.
337  // The parameter of TF.SameCoordinates is a string that is common
338  // to all files using the same registration and has no special meaning:
339  // this is just a key
340  // Because there is no mirroring/rotation in Kicad, only the plot offset origin
341  // can create incorrect registration.
342  // So we create a key from plot offset options.
343  // and therefore for a given board, all Gerber files having the same key have the same
344  // plot origin and use the same registration
345  //
346  // Currently the key is "Original" when using absolute Pcbnew coordinates,
347  // and te PY ans PY position od auxiliary axis, when using it.
348  // Please, if absolute Pcbnew coordinates, one day, are set by user, change the way
349  // the key is built to ensure file only using the *same* axis have the same key.
350  wxString registration_id = "Original";
351  wxPoint auxOrigin = aBoard->GetAuxOrigin();
352 
353  if( aBoard->GetPlotOptions().GetUseAuxOrigin() && auxOrigin.x && auxOrigin.y )
354  registration_id.Printf( "PX%xPY%x", auxOrigin.x, auxOrigin.y );
355 
356  text.Printf( "%%TF.SameCoordinates,%s*%%", registration_id.GetData() );
357  aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
358 }
bool GetUseAuxOrigin() const
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:176
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 wxString & GetFileName() const
Definition: class_board.h:237
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:556
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:349
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:92
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
Definition: pcbplot.cpp:268
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
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 380 of file pcbplot.cpp.

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

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

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(), and BRDITEMS_PLOTTER::SetLayerSet().

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 = "Drawing";
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  attrib = "Other,Fab,Bot";
152  break;
153 
154  case F_Fab:
155  attrib = "Other,Fab,Top";
156  break;
157 
158  case B_Cu:
159  attrib.Printf( wxT( "Copper,L%d,Bot" ), aBoard->GetCopperLayerCount() );
160  break;
161 
162  case F_Cu:
163  attrib = "Copper,L1,Top";
164  break;
165 
166  default:
167  if( IsCopperLayer( aLayer ) )
168  attrib.Printf( wxT( "Copper,L%d,Inr" ), aLayer+1 );
169  else
170  attrib.Printf( wxT( "Other,User" ), aLayer+1 );
171  break;
172  }
173 
174  // This code adds a optional parameter: the type of copper layers.
175  // Because it is not used by Pcbnew (it can be used only by external autorouters)
176  // user do not really set this parameter.
177  // Therefore do not add it.
178  // However, this code is left here, for perhaps a future usage.
179 #if 0
180  // Add the signal type of the layer, if relevant
181  if( IsCopperLayer( aLayer ) )
182  {
183  LAYER_T type = aBoard->GetLayerType( ToLAYER_ID( aLayer ) );
184 
185  switch( type )
186  {
187  case LT_SIGNAL:
188  attrib += ",Signal";
189  break;
190  case LT_POWER:
191  attrib += ",Plane";
192  break;
193  case LT_MIXED:
194  attrib += ",Mixed";
195  break;
196  default:
197  break; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC)
198  }
199  }
200 #endif
201 
202  wxString fileFct;
203  fileFct.Printf( "%%TF.FileFunction,%s*%%", GetChars( attrib ) );
204 
205  return fileFct;
206 }
int GetCopperLayerCount() const
Function GetCopperLayerCount.
LAYER_T
Enum LAYER_T gives the allowed types of layers, same as Specctra DSN spec.
Definition: class_board.h:72
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:92
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Function GetLayerType returns the type of the copper layer given by aLayer.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:810
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.

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(), DIALOG_PLOT::Plot(), and BRDITEMS_PLOTTER::SetLayerSet().

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.
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 666 of file plot_board_layers.cpp.

References SHAPE_POLY_SET::CHole(), PLOTTER::Circle(), BOARD::ConvertBrdLayerToPolygonalContours(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), DIM, dyn_cast(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), VIA::GetPosition(), SHAPE_POLY_SET::HoleCount(), VIA::IsOnLayer(), BOARD::m_Modules, BOARD::m_Track, min, TRACK::Next(), MODULE::Next(), D_PAD::Next(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, NO_FILL, 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(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PlotOneBoardLayer(), and BRDITEMS_PLOTTER::SetLayerSet().

668 {
669 
670  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
671  itemplotter.SetLayerSet( aLayerMask );
672 
673  SHAPE_POLY_SET outlines;
674 
675  for( LSEQ seq = aLayerMask.Seq( plot_seq, DIM( plot_seq ) ); seq; ++seq )
676  {
677  PCB_LAYER_ID layer = *seq;
678 
679  outlines.RemoveAllContours();
680  aBoard->ConvertBrdLayerToPolygonalContours( layer, outlines );
681 
682  outlines.Simplify( SHAPE_POLY_SET::PM_FAST );
683 
684  // Plot outlines
685  std::vector< wxPoint > cornerList;
686 
687  // Now we have one or more basic polygons: plot each polygon
688  for( int ii = 0; ii < outlines.OutlineCount(); ii++ )
689  {
690  for(int kk = 0; kk <= outlines.HoleCount (ii); kk++ )
691  {
692  cornerList.clear();
693  const SHAPE_LINE_CHAIN& path = (kk == 0) ? outlines.COutline( ii ) : outlines.CHole( ii, kk - 1 );
694 
695  for( int jj = 0; jj < path.PointCount(); jj++ )
696  cornerList.push_back( wxPoint( path.CPoint( jj ).x , path.CPoint( jj ).y ) );
697 
698 
699  // Ensure the polygon is closed
700  if( cornerList[0] != cornerList[cornerList.size() - 1] )
701  cornerList.push_back( cornerList[0] );
702 
703  aPlotter->PlotPoly( cornerList, NO_FILL );
704  }
705  }
706 
707  // Plot pad holes
709  {
710  int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE)
711  ? SMALL_DRILL : INT_MAX;
712 
713  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
714  {
715  for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
716  {
717  wxSize hole = pad->GetDrillSize();
718 
719  if( hole.x == 0 || hole.y == 0 )
720  continue;
721 
722  if( hole.x == hole.y )
723  {
724  hole.x = std::min( smallDrill, hole.x );
725  aPlotter->Circle( pad->GetPosition(), hole.x, NO_FILL );
726  }
727  else
728  {
729  // Note: small drill marks have no significance when applied to slots
730  wxPoint drl_start, drl_end;
731  int width;
732  pad->GetOblongDrillGeometry( drl_start, drl_end, width );
733  aPlotter->ThickSegment( pad->GetPosition() + drl_start,
734  pad->GetPosition() + drl_end, width, SKETCH, NULL );
735  }
736  }
737  }
738  }
739 
740  // Plot vias holes
741  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
742  {
743  const VIA* via = dyn_cast<const VIA*>( track );
744 
745  if( via && via->IsOnLayer( layer ) ) // via holes can be not through holes
746  {
747  aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), NO_FILL );
748  }
749  }
750  }
751 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
#define SMALL_DRILL
Definition: pcbplot.h:72
int PointCount() const
Function PointCount()
static const PCB_LAYER_ID plot_seq[]
MODULE * Next() const
Definition: class_module.h:123
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
int OutlineCount() const
Returns the number of outlines in the set
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:61
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:364
DrillMarksType GetDrillMarksType() const
PCB_LAYER_ID
A quick note on layer IDs:
Class SHAPE_POLY_SET.
D_PAD * Next() const
Definition: class_pad.h:160
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines)
Function ConvertBrdLayerToPolygonalContours Build a set of polygons which are the outlines of copper ...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
const wxPoint GetPosition() const override
Definition: class_track.h:429
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
TRACK * Next() const
Definition: class_track.h:99
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
DLIST< MODULE > m_Modules
Definition: class_board.h:248
Class SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
DLIST< TRACK > m_Track
Definition: class_board.h:249
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
#define min(a, b)
Definition: auxiliary.h:85
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 154 of file plot_board_layers.cpp.

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, 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, PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, 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(), PLOT_CONTROLLER::PlotLayer(), and BRDITEMS_PLOTTER::SetLayerSet().

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

References B_SilkS, BLACK, color, BOARD::Colors(), PLOTTER::EndBlock(), F_SilkS, BOARD::GetArea(), BOARD::GetAreaCount(), GetChars(), ZONE_CONTAINER::GetLayer(), COLORS_DESIGN_SETTINGS::GetLayerColor(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotPadsOnSilkLayer(), BOARD::m_Modules, BOARD::m_SegZoneDeprecated, MODULE::Next(), D_PAD::Next(), SEGZONE::Next(), BRDITEMS_PLOTTER::Plot_Edges_Modules(), BRDITEMS_PLOTTER::PlotAllTextsModule(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), BRDITEMS_PLOTTER::SetLayerSet(), SKETCH, PLOTTER::StartBlock(), and PLOTTER::ThickSegment().

Referenced by PlotOneBoardLayer(), and BRDITEMS_PLOTTER::SetLayerSet().

71 {
72  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
73  itemplotter.SetLayerSet( aLayerMask );
74 
75  // Plot edge layer and graphic items
76  itemplotter.PlotBoardGraphicItems();
77 
78  // Plot footprint outlines :
79  itemplotter.Plot_Edges_Modules();
80 
81  // Plot pads (creates pads outlines, for pads on silkscreen layers)
82  LSET layersmask_plotpads = aLayerMask;
83 
84  // Calculate the mask layers of allowed layers for pads
85 
86  if( !aPlotOpt.GetPlotPadsOnSilkLayer() ) // Do not plot pads on silk screen layers
87  layersmask_plotpads.set( B_SilkS, false ).set( F_SilkS, false );
88 
89  if( layersmask_plotpads.any() )
90  {
91  for( MODULE* Module = aBoard->m_Modules; Module; Module = Module->Next() )
92  {
93  aPlotter->StartBlock( NULL );
94 
95  for( D_PAD* pad = Module->PadsList(); pad; pad = pad->Next() )
96  {
97  // See if the pad is on this layer
98  LSET masklayer = pad->GetLayerSet();
99  if( !( masklayer & layersmask_plotpads ).any() )
100  continue;
101 
103 
104  if( layersmask_plotpads[B_SilkS] )
105  color = aBoard->Colors().GetLayerColor( B_SilkS );
106 
107  if( layersmask_plotpads[F_SilkS] )
108  color = ( color == COLOR4D::BLACK) ? aBoard->Colors().GetLayerColor( F_SilkS ) : color;
109 
110  itemplotter.PlotPad( pad, color, SKETCH );
111  }
112 
113  aPlotter->EndBlock( NULL );
114  }
115  }
116 
117  // Plot footprints fields (ref, value ...)
118  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
119  {
120  if( ! itemplotter.PlotAllTextsModule( module ) )
121  {
122  wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ),
123  GetChars( module->GetReference() ) );
124  }
125  }
126 
127  // Plot filled areas
128  aPlotter->StartBlock( NULL );
129 
130  for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
131  {
132  ZONE_CONTAINER* edge_zone = aBoard->GetArea( ii );
133 
134  if( !aLayerMask[ edge_zone->GetLayer() ] )
135  continue;
136 
137  itemplotter.PlotFilledAreas( edge_zone );
138  }
139 
140  aPlotter->EndBlock( NULL );
141 
142  // Plot segments used to fill zone areas (deprecated, but here for very old boards
143  // compatibility):
144  for( SEGZONE* seg = aBoard->m_SegZoneDeprecated; seg; seg = seg->Next() )
145  {
146  if( !aLayerMask[ seg->GetLayer() ] )
147  continue;
148 
149  aPlotter->ThickSegment( seg->GetStart(), seg->GetEnd(), seg->GetWidth(),
150  itemplotter.GetPlotMode(), NULL );
151  }
152 }
Class 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:454
int color
Definition: DXF_plotter.cpp:62
MODULE * Next() const
Definition: class_module.h:123
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:175
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items, for instance in SVG or Gerber format.
Definition: plotter.h:445
SEGZONE * Next() const
Definition: class_track.h:363
Class LSET is a set of PCB_LAYER_IDs.
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:569
DLIST< SEGZONE > m_SegZoneDeprecated
Definition: class_board.h:250
D_PAD * Next() const
Definition: class_pad.h:160
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1020
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:92
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:991
DLIST< MODULE > m_Modules
Definition: class_board.h:248
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
bool GetPlotPadsOnSilkLayer() const
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
Definition: colors.h:45
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
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 297 of file plot_board_layers.cpp.

References D_PAD::AddPrimitive(), LSET::AllCuMask(), B_Cu, B_Mask, B_Paste, BLACK, color, BOARD::Colors(), D_PAD::DeletePrimitivesList(), delta, dummy(), dyn_cast(), PLOTTER::EndBlock(), F_Cu, F_Mask, F_Paste, PLOTTER::FlashPadCircle(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_VIAPAD, GBR_NETLIST_METADATA::GBR_NETINFO_NET, BOARD::GetArea(), BOARD::GetAreaCount(), GetChars(), BRDITEMS_PLOTTER::getColor(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), BRDITEMS_PLOTTER::getFineWidthAdj(), COLORS_DESIGN_SETTINGS::GetItemColor(), ZONE_CONTAINER::GetLayer(), 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::Inflate(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_VIAS, LIGHTGRAY, BOARD::m_Modules, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, BOARD::m_SegZoneDeprecated, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD::m_Track, D_PAD::MergePrimitivesAsPolygon(), TRACK::Next(), BOARD_ITEM::Next(), MODULE::Next(), D_PAD::Next(), SEGZONE::Next(), PCB_PLOT_PARAMS::NO_DRILL_SHAPE, PAD_ATTRIB_HOLE_NOT_PLATED, 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(), GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), BRDITEMS_PLOTTER::SetLayerSet(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), PLOTTER::StartBlock(), PLOTTER::ThickSegment(), WHITE, wxPoint::x, and wxPoint::y.

Referenced by PlotOneBoardLayer(), and BRDITEMS_PLOTTER::SetLayerSet().

299 {
300  BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
301 
302  itemplotter.SetLayerSet( aLayerMask );
303 
304  EDA_DRAW_MODE_T plotMode = aPlotOpt.GetPlotMode();
305 
306  // Plot edge layer and graphic items
307  itemplotter.PlotBoardGraphicItems();
308 
309  // Draw footprint shapes without pads (pads will plotted later)
310  // We plot here module texts, but they are usually on silkscreen layer,
311  // so they are not plot here but plot by PlotSilkScreen()
312  // Plot footprints fields (ref, value ...)
313  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
314  {
315  if( ! itemplotter.PlotAllTextsModule( module ) )
316  {
317  wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ),
318  GetChars( module->GetReference() ) );
319  }
320  }
321 
322  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
323  {
324  for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
325  {
326  if( !aLayerMask[ item->GetLayer() ] )
327  continue;
328 
329  switch( item->Type() )
330  {
331  case PCB_MODULE_EDGE_T:
332  itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item );
333  break;
334 
335  default:
336  break;
337  }
338  }
339  }
340 
341  // Plot footprint pads
342  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
343  {
344  aPlotter->StartBlock( NULL );
345 
346  for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
347  {
348  if( (pad->GetLayerSet() & aLayerMask) == 0 )
349  continue;
350 
351  wxSize margin;
352  double width_adj = 0;
353 
354  if( ( aLayerMask & LSET::AllCuMask() ).any() )
355  width_adj = itemplotter.getFineWidthAdj();
356 
357  static const LSET speed( 4, B_Mask, F_Mask, B_Paste, F_Paste );
358 
359  LSET anded = ( speed & aLayerMask );
360 
361  if( anded == LSET( F_Mask ) || anded == LSET( B_Mask ) )
362  {
363  margin.x = margin.y = pad->GetSolderMaskMargin();
364  }
365  else if( anded == LSET( F_Paste ) || anded == LSET( B_Paste ) )
366  {
367  margin = pad->GetSolderPasteMargin();
368  }
369 
370  // Now offset the pad size by margin + width_adj
371  // this is easy for most shapes, but not for a trapezoid or a custom shape
372  wxSize padPlotsSize;
373  wxSize extraSize = margin * 2;
374  extraSize.x += width_adj;
375  extraSize.y += width_adj;
376  wxSize deltaSize = pad->GetDelta(); // has meaning only for trapezoidal pads
377 
378  if( pad->GetShape() == PAD_SHAPE_TRAPEZOID )
379  { // The easy way is to use BuildPadPolygon to calculate
380  // size and delta of the trapezoidal pad after offseting:
381  wxPoint coord[4];
382  pad->BuildPadPolygon( coord, extraSize/2, 0.0 );
383  // Calculate the size and delta from polygon corners coordinates:
384  // coord[0] is the lower left
385  // coord[1] is the upper left
386  // coord[2] is the upper right
387  // coord[3] is the lower right
388 
389  // the size is the distance between middle of segments
390  // (left/right or top/bottom)
391  // size X is the dist between left and right middle points:
392  padPlotsSize.x = ( ( -coord[0].x + coord[3].x ) // the lower segment X length
393  + ( -coord[1].x + coord[2].x ) ) // the upper segment X length
394  / 2; // the Y size is the half sum
395  // size Y is the dist between top and bottom middle points:
396  padPlotsSize.y = ( ( coord[0].y - coord[1].y ) // the left segment Y lenght
397  + ( coord[3].y - coord[2].y ) ) // the right segment Y lenght
398  / 2; // the Y size is the half sum
399 
400  // calculate the delta ( difference of lenght between 2 opposite edges )
401  // The delta.x is the delta along the X axis, therefore the delta of Y lenghts
402  wxSize delta;
403 
404  if( coord[0].y != coord[3].y )
405  delta.x = coord[0].y - coord[3].y;
406  else
407  delta.y = coord[1].x - coord[0].x;
408 
409  pad->SetDelta( delta );
410  }
411  else
412  padPlotsSize = pad->GetSize() + extraSize;
413 
414  // Don't draw a null size item :
415  if( padPlotsSize.x <= 0 || padPlotsSize.y <= 0 )
416  continue;
417 
419 
420  if( pad->GetLayerSet()[B_Cu] )
421  color = aBoard->Colors().GetItemColor( LAYER_PAD_BK );
422 
423  if( pad->GetLayerSet()[F_Cu] )
424  color = color.LegacyMix( aBoard->Colors().GetItemColor( LAYER_PAD_FR ) );
425 
426  // Temporary set the pad size to the required plot size:
427  wxSize tmppadsize = pad->GetSize();
428 
429  switch( pad->GetShape() )
430  {
431  case PAD_SHAPE_CIRCLE:
432  case PAD_SHAPE_OVAL:
433  pad->SetSize( padPlotsSize );
434 
435  if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
436  ( pad->GetSize() == pad->GetDrillSize() ) &&
437  ( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) )
438  break;
439 
440  itemplotter.PlotPad( pad, color, plotMode );
441  break;
442 
443  case PAD_SHAPE_TRAPEZOID:
444  case PAD_SHAPE_RECT:
445  case PAD_SHAPE_ROUNDRECT:
446  pad->SetSize( padPlotsSize );
447  itemplotter.PlotPad( pad, color, plotMode );
448  break;
449 
450  case PAD_SHAPE_CUSTOM:
451  // inflate/deflate a custom shape is a bit complex.
452  // so build a similar pad shape, and inflate/deflate the polygonal shape
453  {
454  // we expect margin.x = margin.y for custom pads
455  if( margin.x < 0 )
456  // be sure the anchor pad is not bigger than the deflated shape
457  // because this anchor will be added to the pad shape when plotting
458  // the pad
459  pad->SetSize( padPlotsSize );
460 
461  D_PAD dummy( *pad );
462  SHAPE_POLY_SET shape;
463  pad->MergePrimitivesAsPolygon( &shape, 64 );
464  shape.Inflate( margin.x, 32 );
465  dummy.DeletePrimitivesList();
466  dummy.AddPrimitive( shape, 0 );
467  dummy.MergePrimitivesAsPolygon();
468 
469  itemplotter.PlotPad( &dummy, color, plotMode );
470  }
471  break;
472  }
473 
474  pad->SetSize( tmppadsize ); // Restore the pad size
475  pad->SetDelta( deltaSize );
476  }
477 
478  aPlotter->EndBlock( NULL );
479  }
480 
481  // Plot vias on copper layers, and if aPlotOpt.GetPlotViaOnMaskLayer() is true,
482  // plot them on solder mask
483 
484  GBR_METADATA gbr_metadata;
485 
486  bool isOnCopperLayer = ( aLayerMask & LSET::AllCuMask() ).any();
487 
488  if( isOnCopperLayer )
489  {
492  }
493 
494  aPlotter->StartBlock( NULL );
495 
496  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
497  {
498  const VIA* Via = dyn_cast<const VIA*>( track );
499 
500  if( !Via )
501  continue;
502 
503  // vias are not plotted if not on selected layer, but if layer
504  // is SOLDERMASK_LAYER_BACK or SOLDERMASK_LAYER_FRONT,vias are drawn,
505  // only if they are on the corresponding external copper layer
506  LSET via_mask_layer = Via->GetLayerSet();
507 
508  if( aPlotOpt.GetPlotViaOnMaskLayer() )
509  {
510  if( via_mask_layer[B_Cu] )
511  via_mask_layer.set( B_Mask );
512 
513  if( via_mask_layer[F_Cu] )
514  via_mask_layer.set( F_Mask );
515  }
516 
517  if( !( via_mask_layer & aLayerMask ).any() )
518  continue;
519 
520  int via_margin = 0;
521  double width_adj = 0;
522 
523  // If the current layer is a solder mask, use the global mask
524  // clearance for vias
525  if( aLayerMask[B_Mask] || aLayerMask[F_Mask] )
526  via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
527 
528  if( ( aLayerMask & LSET::AllCuMask() ).any() )
529  width_adj = itemplotter.getFineWidthAdj();
530 
531  int diameter = Via->GetWidth() + 2 * via_margin + width_adj;
532 
533  // Don't draw a null size item :
534  if( diameter <= 0 )
535  continue;
536 
537  // Some vias can be not connected (no net).
538  // Set the m_NotInNet for these vias to force a empty net name in gerber file
539  gbr_metadata.m_NetlistMetadata.m_NotInNet = Via->GetNetname().IsEmpty();
540 
541  gbr_metadata.SetNetName( Via->GetNetname() );
542 
543  COLOR4D color = aBoard->Colors().GetItemColor( LAYER_VIAS + Via->GetViaType() );
544  // Set plot color (change WHITE to LIGHTGRAY because
545  // the white items are not seen on a white paper or screen
546  aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY);
547  aPlotter->FlashPadCircle( Via->GetStart(), diameter, plotMode, &gbr_metadata );
548  }
549 
550  aPlotter->EndBlock( NULL );
551  aPlotter->StartBlock( NULL );
553 
554  // Plot tracks (not vias) :
555  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
556  {
557  if( track->Type() == PCB_VIA_T )
558  continue;
559 
560  if( !aLayerMask[track->GetLayer()] )
561  continue;
562 
563  // Some track segments can be not connected (no net).
564  // Set the m_NotInNet for these segments to force a empty net name in gerber file
565  gbr_metadata.m_NetlistMetadata.m_NotInNet = track->GetNetname().IsEmpty();
566 
567  gbr_metadata.SetNetName( track->GetNetname() );
568  int width = track->GetWidth() + itemplotter.getFineWidthAdj();
569  aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
570  aPlotter->ThickSegment( track->GetStart(), track->GetEnd(), width, plotMode, &gbr_metadata );
571  }
572 
573  aPlotter->EndBlock( NULL );
574 
575  // Plot zones (deprecated, for very old boards compatibility):
576  for( TRACK* track = aBoard->m_SegZoneDeprecated; track; track = track->Next() )
577  {
578  if( !aLayerMask[track->GetLayer()] )
579  continue;
580 
581  int width = track->GetWidth() + itemplotter.getFineWidthAdj();
582  aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
583  aPlotter->ThickSegment( track->GetStart(), track->GetEnd(), width, plotMode, NULL );
584  }
585 
586  // Plot filled ares
587  aPlotter->StartBlock( NULL );
588  for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
589  {
590  ZONE_CONTAINER* zone = aBoard->GetArea( ii );
591 
592  if( !aLayerMask[zone->GetLayer()] )
593  continue;
594 
595  itemplotter.PlotFilledAreas( zone );
596  }
597  aPlotter->EndBlock( NULL );
598 
599  // Adding drill marks, if required and if the plotter is able to plot them:
601  itemplotter.PlotDrillMarks();
602 }
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:673
int m_SolderMaskMargin
Solder mask margin.
Class 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:454
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:65
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:129
int color
Definition: DXF_plotter.cpp:62
MODULE * Next() const
Definition: class_module.h:123
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:175
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items, for instance in SVG or Gerber format.
Definition: plotter.h:445
smd pads, back layer
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
static const int delta[8][2]
Definition: solve.cpp:112
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:61
SEGZONE * Next() const
Definition: class_track.h:363
BOARD_ITEM * Next() const
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
DrillMarksType GetDrillMarksType() const
Class LSET is a set of PCB_LAYER_IDs.
void Inflate(int aFactor, int aCircleSegmentsCount)
Performs outline inflation/deflation, using round corners.
VIATYPE_T GetViaType() const
Definition: class_track.h:457
Class SHAPE_POLY_SET.
EDA_DRAW_MODE_T
Definition: eda_text.h:77
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:569
const wxPoint & GetStart() const
Definition: class_track.h:122
DLIST< SEGZONE > m_SegZoneDeprecated
Definition: class_board.h:250
D_PAD * Next() const
Definition: class_pad.h:160
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
bool GetPlotViaOnMaskLayer() const
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1020
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:61
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:139
bool GetSkipPlotNPTH_Pads() const
TRACK * Next() const
Definition: class_track.h:99
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:92
smd pads, front layer
const wxString & GetNetname() const
Function GetNetname.
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:991
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
DLIST< MODULE > m_Modules
Definition: class_board.h:248
int GetWidth() const
Definition: class_track.h:116
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
EDA_DRAW_MODE_T GetPlotMode() const
Definition: colors.h:49
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:119
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:96
DLIST< TRACK > m_Track
Definition: class_board.h:249
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:158
Definition: colors.h:45
print info associated to a net (TO.N attribute)
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
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 1042 of file plot_board_layers.cpp.

References AddGerberX2Attribute(), PLOTTER::ClearHeaderLinesList(), BOARD::ComputeBoundingBox(), ConfigureHPGLPenSizes(), FillNegativeKnockout(), 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::GetUseGerberAttributes(), initializePlotter(), PLOTTER::OpenFile(), PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, PLOT_FORMAT_HPGL, PLOT_FORMAT_PDF, PLOT_FORMAT_POST, PLOT_FORMAT_SVG, PlotWorkSheet(), PCB_PLOT_PARAMS::SetMirror(), PSLIKE_PLOTTER::SetScaleAdjust(), PLOTTER::StartPlot(), GERBER_PLOTTER::UseX2Attributes(), and GERBER_PLOTTER::UseX2NetAttributes().

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

1046 {
1047  // Create the plotter driver and set the few plotter specific
1048  // options
1049  PLOTTER* plotter = NULL;
1050 
1051  switch( aPlotOpts->GetFormat() )
1052  {
1053  case PLOT_FORMAT_DXF:
1054  plotter = new DXF_PLOTTER();
1055  break;
1056 
1057  case PLOT_FORMAT_POST:
1058  PS_PLOTTER* PS_plotter;
1059  PS_plotter = new PS_PLOTTER();
1060  PS_plotter->SetScaleAdjust( aPlotOpts->GetFineScaleAdjustX(),
1061  aPlotOpts->GetFineScaleAdjustY() );
1062  plotter = PS_plotter;
1063  break;
1064 
1065  case PLOT_FORMAT_PDF:
1066  plotter = new PDF_PLOTTER();
1067  break;
1068 
1069  case PLOT_FORMAT_HPGL:
1070  HPGL_PLOTTER* HPGL_plotter;
1071  HPGL_plotter = new HPGL_PLOTTER();
1072 
1073  /* HPGL options are a little more convoluted to compute, so
1074  they're split in another function */
1075  ConfigureHPGLPenSizes( HPGL_plotter, aPlotOpts );
1076  plotter = HPGL_plotter;
1077  break;
1078 
1079  case PLOT_FORMAT_GERBER:
1080  plotter = new GERBER_PLOTTER();
1081  break;
1082 
1083  case PLOT_FORMAT_SVG:
1084  plotter = new SVG_PLOTTER();
1085  break;
1086 
1087  default:
1088  wxASSERT( false );
1089  return NULL;
1090  }
1091 
1092  // Compute the viewport and set the other options
1093 
1094  // page layout is not mirrored, so temporary change mirror option
1095  // just to plot the page layout
1096  PCB_PLOT_PARAMS plotOpts = *aPlotOpts;
1097 
1098  if( plotOpts.GetPlotFrameRef() && plotOpts.GetMirror() )
1099  plotOpts.SetMirror( false );
1100 
1101  initializePlotter( plotter, aBoard, &plotOpts );
1102 
1103  if( plotter->OpenFile( aFullFileName ) )
1104  {
1105  plotter->ClearHeaderLinesList();
1106 
1107  // For the Gerber "file function" attribute, set the layer number
1108  if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER )
1109  {
1110  bool useX2mode = plotOpts.GetUseGerberAttributes();
1111 
1112  if( useX2mode )
1113  {
1114  AddGerberX2Attribute( plotter, aBoard, aLayer, false );
1115  GERBER_PLOTTER* gbrplotter = static_cast <GERBER_PLOTTER*> ( plotter );
1116  gbrplotter->UseX2Attributes( true );
1117  gbrplotter->UseX2NetAttributes( plotOpts.GetIncludeGerberNetlistInfo() );
1118  }
1119  else
1120  {
1121  AddGerberX2Attribute( plotter, aBoard, aLayer, true );
1122  }
1123  }
1124 
1125  plotter->StartPlot();
1126 
1127  // Plot the frame reference if requested
1128  if( aPlotOpts->GetPlotFrameRef() )
1129  {
1130  PlotWorkSheet( plotter, aBoard->GetTitleBlock(),
1131  aBoard->GetPageSettings(),
1132  1, 1, // Only one page
1133  aSheetDesc, aBoard->GetFileName() );
1134 
1135  if( aPlotOpts->GetMirror() )
1136  initializePlotter( plotter, aBoard, aPlotOpts );
1137  }
1138 
1139  /* When plotting a negative board: draw a black rectangle
1140  * (background for plot board in white) and switch the current
1141  * color to WHITE; note the color inversion is actually done
1142  * in the driver (if supported) */
1143  if( aPlotOpts->GetNegative() )
1144  {
1145  EDA_RECT bbox = aBoard->ComputeBoundingBox();
1146  FillNegativeKnockout( plotter, bbox );
1147  }
1148 
1149  return plotter;
1150  }
1151 
1152  delete plotter;
1153  return NULL;
1154 }
bool GetMirror() const
void UseX2NetAttributes(bool aEnable)
Definition: plotter.h:1138
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...
bool GetUseGerberAttributes() const
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Function ComputeBoundingBox calculates the bounding box containing all board items (or board edge seg...
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:79
void SetScaleAdjust(double scaleX, double scaleY)
Set the &#39;fine&#39; scaling for the postscript engine.
Definition: plotter.h:684
void SetMirror(bool aFlag)
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:361
double GetFineScaleAdjustX() const
void PlotWorkSheet(PLOTTER *plotter, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename)
bool GetIncludeGerberNetlistInfo() const
const wxString & GetFileName() const
Definition: class_board.h:237
static void ConfigureHPGLPenSizes(HPGL_PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts)
Calculate the effective size of HPGL pens and set them in the plotter object.
PlotFormat GetFormat() const
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:553
Base plotter engine class.
Definition: plotter.h:97
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:559
bool GetNegative() const
virtual PlotFormat GetPlotterType() const =0
Returns the effective plot engine in use.
bool GetPlotFrameRef() const
Class 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:185
void UseX2Attributes(bool aEnable)
Definition: plotter.h:1137
double GetFineScaleAdjustY() const