KiCad PCB EDA Suite
gen_drill_report_files.cpp
Go to the documentation of this file.
1 
6 /*
7  * This program source code file is part of KiCad, a free EDA CAD application.
8  *
9  * Copyright (C) 1992-2017 Jean_Pierre Charras <jp.charras at wanadoo.fr>
10  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 #include <plotter.h>
31 #include <plotters_specific.h>
32 #include <eda_item.h>
33 #include <gr_text.h>
34 #include <confirm.h>
35 #include <kicad_string.h>
36 #include <locale_io.h>
37 #include <math/util.h> // for KiROUND
38 
39 #include <board.h>
40 
41 #include <pcbnew.h>
42 #include <pcbplot.h>
44 #include <pcb_painter.h>
45 
46 /* Conversion utilities - these will be used often in there... */
47 inline double diameter_in_inches( double ius )
48 {
49  return ius * 0.001 / IU_PER_MILS;
50 }
51 
52 
53 inline double diameter_in_mm( double ius )
54 {
55  return ius / IU_PER_MM;
56 }
57 
58 
59 // return a pen size to plot markers and having a readable shape
60 inline int getMarkerBestPenSize( int aMarkerDiameter )
61 {
62  return aMarkerDiameter / 10;
63 }
64 
65 
66 bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_FORMAT aFormat )
67 {
68  // Remark:
69  // Hole list must be created before calling this function, by buildHolesList(),
70  // for the right holes set (PTH, NPTH, buried/blind vias ...)
71 
72  double scale = 1.0;
73  wxPoint offset;
74  PLOTTER* plotter = NULL;
75  PAGE_INFO dummy( PAGE_INFO::A4, false );
76  int bottom_limit = 0; // Y coord limit of page. 0 mean do not use
77 
78  PCB_PLOT_PARAMS plot_opts; // starts plotting with default options
79 
80  LOCALE_IO toggle; // use standard C notation for float numbers
81 
82  const PAGE_INFO& page_info = m_pageInfo ? *m_pageInfo : dummy;
83 
84  // Calculate dimensions and center of PCB. The Edge_Cuts layer must be visible
85  // to calculate the board edges bounding box
86  LSET visibleLayers = m_pcb->GetVisibleLayers();
87  m_pcb->SetVisibleLayers( visibleLayers | LSET( Edge_Cuts ) );
89  m_pcb->SetVisibleLayers( visibleLayers );
90 
91  // Calculate the scale for the format type, scale 1 in HPGL, drawing on
92  // an A4 sheet in PS, + text description of symbols
93  switch( aFormat )
94  {
96  offset = GetOffset();
97  plotter = new GERBER_PLOTTER();
98  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
99  plotter->SetGerberCoordinatesFormat( 5 ); // format x.5 unit = mm
100  break;
101 
102  case PLOT_FORMAT::HPGL: // Scale for HPGL format.
103  {
104  HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
105  plotter = hpgl_plotter;
106  hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
107  hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
108  plotter->SetPageSettings( page_info );
109  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
110  }
111  break;
112 
113 
114  default:
115  wxASSERT( false );
117 
118  case PLOT_FORMAT::PDF:
119  case PLOT_FORMAT::POST:
120  case PLOT_FORMAT::SVG:
121  {
122  PAGE_INFO pageA4( wxT( "A4" ) );
123  wxSize pageSizeIU = pageA4.GetSizeIU();
124 
125  // Reserve a 10 mm margin around the page.
126  int margin = Millimeter2iu( 10 );
127 
128  // Calculate a scaling factor to print the board on the sheet
129  double Xscale = double( pageSizeIU.x - ( 2 * margin ) ) / bbbox.GetWidth();
130 
131  // We should print the list of drill sizes, so reserve room for it
132  // 60% height for board 40% height for list
133  int ypagesize_for_board = KiROUND( pageSizeIU.y * 0.6 );
134  double Yscale = double( ypagesize_for_board - margin ) / bbbox.GetHeight();
135 
136  scale = std::min( Xscale, Yscale );
137 
138  // Experience shows the scale should not to large, because texts
139  // create problem (can be to big or too small).
140  // So the scale is clipped at 3.0;
141  scale = std::min( scale, 3.0 );
142 
143  offset.x = KiROUND( double( bbbox.Centre().x ) - ( pageSizeIU.x / 2.0 ) / scale );
144  offset.y = KiROUND( double( bbbox.Centre().y ) - ( ypagesize_for_board / 2.0 ) / scale );
145 
146  // bottom_limit is used to plot the legend (drill diameters)
147  // texts are scaled differently for scale > 1.0 and <= 1.0
148  // so the limit is scaled differently.
149  bottom_limit = ( pageSizeIU.y - margin ) / std::min( scale, 1.0 );
150 
151  if( aFormat == PLOT_FORMAT::SVG )
152  plotter = new SVG_PLOTTER;
153  else if( aFormat == PLOT_FORMAT::PDF )
154  plotter = new PDF_PLOTTER;
155  else
156  plotter = new PS_PLOTTER;
157 
158  plotter->SetPageSettings( pageA4 );
159  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
160  }
161  break;
162 
163  case PLOT_FORMAT::DXF:
164  {
165  DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER;
166 
167  if( m_unitsMetric )
168  dxf_plotter->SetUnits( DXF_UNITS::MILLIMETERS );
169  else
170  dxf_plotter->SetUnits( DXF_UNITS::INCHES );
171 
172  plotter = dxf_plotter;
173  plotter->SetPageSettings( page_info );
174  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
175  }
176  break;
177  }
178 
179  plotter->SetCreator( wxT( "PCBNEW" ) );
180  plotter->SetColorMode( false );
181 
182  KIGFX::PCB_RENDER_SETTINGS renderSettings;
183  renderSettings.SetDefaultPenWidth( Millimeter2iu( 0.2 ) );
184 
185  plotter->SetRenderSettings( &renderSettings );
186 
187  if( !plotter->OpenFile( aFullFileName ) )
188  {
189  delete plotter;
190  return false;
191  }
192 
193  plotter->StartPlot();
194 
195  // Draw items on edge layer (not all, only items useful for drill map
196  BRDITEMS_PLOTTER itemplotter( plotter, m_pcb, plot_opts );
197  itemplotter.SetLayerSet( Edge_Cuts );
198 
199  for( auto PtStruct : m_pcb->Drawings() )
200  {
201  switch( PtStruct->Type() )
202  {
203  case PCB_SHAPE_T:
204  itemplotter.PlotPcbShape( (PCB_SHAPE*) PtStruct );
205  break;
206 
207  case PCB_TEXT_T:
208  itemplotter.PlotPcbText( (PCB_TEXT*) PtStruct );
209  break;
210 
211  case PCB_DIM_ALIGNED_T:
212  case PCB_DIM_CENTER_T:
214  case PCB_DIM_LEADER_T:
215  case PCB_TARGET_T:
216  case PCB_MARKER_T: // do not draw
217  default:
218  break;
219  }
220  }
221 
222  int plotX, plotY, TextWidth;
223  int intervalle = 0;
224  char line[1024];
225  wxString msg;
226  int textmarginaftersymbol = Millimeter2iu( 2 );
227 
228  // Set Drill Symbols width
229  plotter->SetCurrentLineWidth( -1 );
230 
231  // Plot board outlines and drill map
232  plotDrillMarks( plotter );
233 
234  // Print a list of symbols used.
235  int charSize = Millimeter2iu( 2 ); // text size in IUs
236  // real char scale will be 1/scale, because the global plot scale is scale
237  // for scale < 1.0 ( plot bigger actual size)
238  // Therefore charScale = 1.0 / scale keep the initial charSize
239  // (for scale < 1 we use the global scaling factor: the board must be plotted
240  // smaller than the actual size)
241  double charScale = std::min( 1.0, 1.0 / scale );
242 
243  TextWidth = KiROUND( ( charSize * charScale ) / 10.0 ); // Set text width (thickness)
244  intervalle = KiROUND( charSize * charScale ) + TextWidth;
245 
246  // Trace information.
247  plotX = KiROUND( bbbox.GetX() + textmarginaftersymbol * charScale );
248  plotY = bbbox.GetBottom() + intervalle;
249 
250  // Plot title "Info"
251  wxString Text = wxT( "Drill Map:" );
252  plotter->Text( wxPoint( plotX, plotY ), COLOR4D::UNSPECIFIED, Text, 0,
253  wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
254  GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
255 
256  // For some formats (PS, PDF SVG) we plot the drill size list on more than one column
257  // because the list must be contained inside the printed page
258  // (others formats do not have a defined page size)
259  int max_line_len = 0; // The max line len in iu of the currently plotted column
260 
261  for( unsigned ii = 0; ii < m_toolListBuffer.size(); ii++ )
262  {
263  DRILL_TOOL& tool = m_toolListBuffer[ii];
264 
265  if( tool.m_TotalCount == 0 )
266  continue;
267 
268  plotY += intervalle;
269 
270  // Ensure there are room to plot the line
271  if( bottom_limit && ( plotY+intervalle > bottom_limit ) )
272  {
273  plotY = bbbox.GetBottom() + intervalle;
274  plotX += max_line_len + Millimeter2iu( 10 );//column_width;
275  max_line_len = 0;
276  }
277 
278  int plot_diam = KiROUND( tool.m_Diameter );
279  // For markers plotted with the comment, keep marker size <= text height
280  plot_diam = std::min( plot_diam, KiROUND( charSize * charScale ) );
281  int x = KiROUND( plotX - textmarginaftersymbol * charScale - plot_diam / 2.0 );
282  int y = KiROUND( plotY + charSize * charScale );
283 
284  plotter->SetCurrentLineWidth( getMarkerBestPenSize( plot_diam ) );
285  plotter->Marker( wxPoint( x, y ), plot_diam, ii );
286  plotter->SetCurrentLineWidth( -1 );
287 
288  // List the diameter of each drill in mm and inches.
289  sprintf( line, "%3.3fmm / %2.4f\" ", diameter_in_mm( tool.m_Diameter ),
290  diameter_in_inches( tool.m_Diameter ) );
291 
292  msg = FROM_UTF8( line );
293 
294  // Now list how many holes and ovals are associated with each drill.
295  if( ( tool.m_TotalCount == 1 ) && ( tool.m_OvalCount == 0 ) )
296  sprintf( line, "(1 hole)" );
297  else if( tool.m_TotalCount == 1 ) // && ( toolm_OvalCount == 1 )
298  sprintf( line, "(1 slot)" );
299  else if( tool.m_OvalCount == 0 )
300  sprintf( line, "(%d holes)", tool.m_TotalCount );
301  else if( tool.m_OvalCount == 1 )
302  sprintf( line, "(%d holes + 1 slot)", tool.m_TotalCount - 1 );
303  else // if ( toolm_OvalCount > 1 )
304  sprintf( line, "(%d holes + %d slots)", tool.m_TotalCount - tool.m_OvalCount,
305  tool.m_OvalCount );
306 
307  msg += FROM_UTF8( line );
308 
309  if( tool.m_Hole_NotPlated )
310  msg += wxT( " (not plated)" );
311 
312  plotter->Text( wxPoint( plotX, y ), COLOR4D::UNSPECIFIED, msg, 0,
313  wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
314  GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
315 
316  intervalle = KiROUND( ( ( charSize * charScale ) + TextWidth ) * 1.2 );
317 
318  if( intervalle < ( plot_diam + ( 1 * IU_PER_MM / scale ) + TextWidth ) )
319  intervalle = plot_diam + ( 1 * IU_PER_MM / scale ) + TextWidth;
320 
321  // Evaluate the text horizontal size, to know the maximal column size
322  // This is a rough value, but ok to create a new column to plot next texts
323  int text_len = msg.Len() * ( ( charSize * charScale ) + TextWidth );
324  max_line_len = std::max( max_line_len, text_len + plot_diam );
325  }
326 
327  plotter->EndPlot();
328  delete plotter;
329 
330  return true;
331 }
332 
333 
334 bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
335 {
336  FILE_OUTPUTFORMATTER out( aFullFileName );
337 
338  static const char separator[] =
339  " =============================================================\n";
340 
341  wxASSERT( m_pcb );
342 
343  unsigned totalHoleCount;
344  wxFileName brdFilename( m_pcb->GetFileName() );
345 
346  std::vector<DRILL_LAYER_PAIR> hole_sets = getUniqueLayerPairs();
347 
348  out.Print( 0, "Drill report for %s\n", TO_UTF8( brdFilename.GetFullName() ) );
349  out.Print( 0, "Created on %s\n\n", TO_UTF8( DateAndTime() ) );
350 
351  // Output the cu layer stackup, so layer name references make sense.
352  out.Print( 0, "Copper Layer Stackup:\n" );
353  out.Print( 0, separator );
354 
356 
357  int conventional_layer_num = 1;
358 
359  for( LSEQ seq = cu.Seq(); seq; ++seq, ++conventional_layer_num )
360  {
361  out.Print( 0, " L%-2d: %-25s %s\n",
362  conventional_layer_num,
363  TO_UTF8( m_pcb->GetLayerName( *seq ) ),
364  layerName( *seq ).c_str() // generic layer name
365  );
366  }
367 
368  out.Print( 0, "\n\n" );
369 
370  /* output hole lists:
371  * 1 - through holes
372  * 2 - for partial holes only: by layer starting and ending pair
373  * 3 - Non Plated through holes
374  */
375 
376  bool buildNPTHlist = false; // First pass: build PTH list only
377 
378  // in this loop are plated only:
379  for( unsigned pair_ndx = 0; pair_ndx < hole_sets.size(); ++pair_ndx )
380  {
381  DRILL_LAYER_PAIR pair = hole_sets[pair_ndx];
382 
383  buildHolesList( pair, buildNPTHlist );
384 
385  if( pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
386  {
387  out.Print( 0, "Drill file '%s' contains\n",
388  TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
389 
390  out.Print( 0, " plated through holes:\n" );
391  out.Print( 0, separator );
392  totalHoleCount = printToolSummary( out, false );
393  out.Print( 0, " Total plated holes count %u\n", totalHoleCount );
394  }
395  else // blind/buried
396  {
397  out.Print( 0, "Drill file '%s' contains\n",
398  TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
399 
400  out.Print( 0, " holes connecting layer pair: '%s and %s' (%s vias):\n",
401  TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.first ) ) ),
402  TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
403  pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried"
404  );
405 
406  out.Print( 0, separator );
407  totalHoleCount = printToolSummary( out, false );
408  out.Print( 0, " Total plated holes count %u\n", totalHoleCount );
409  }
410 
411  out.Print( 0, "\n\n" );
412  }
413 
414  // NPTHoles. Generate the full list (pads+vias) if PTH and NPTH are merged,
415  // or only the NPTH list (which never has vias)
416  if( !m_merge_PTH_NPTH )
417  buildNPTHlist = true;
418 
419  buildHolesList( DRILL_LAYER_PAIR( F_Cu, B_Cu ), buildNPTHlist );
420 
421  // nothing wrong with an empty NPTH file in report.
422  if( m_merge_PTH_NPTH )
423  out.Print( 0, "Not plated through holes are merged with plated holes\n" );
424  else
425  out.Print( 0, "Drill file '%s' contains\n",
427  true, m_merge_PTH_NPTH ) ) );
428 
429  out.Print( 0, " unplated through holes:\n" );
430  out.Print( 0, separator );
431  totalHoleCount = printToolSummary( out, true );
432  out.Print( 0, " Total unplated holes count %u\n", totalHoleCount );
433 
434  return true;
435 }
436 
437 
439 {
440  // Plot the drill map:
441  wxPoint pos;
442 
443  for( unsigned ii = 0; ii < m_holeListBuffer.size(); ii++ )
444  {
445  const HOLE_INFO& hole = m_holeListBuffer[ii];
446  pos = hole.m_Hole_Pos;
447 
448  // Gives a good line thickness to have a good marker shape:
450 
451  // Always plot the drill symbol (for slots identifies the needed cutter!
452  aPlotter->Marker( pos, hole.m_Hole_Diameter, hole.m_Tool_Reference - 1 );
453 
454  if( hole.m_Hole_Shape != 0 )
455  {
456  wxSize oblong_size = hole.m_Hole_Size;
457  aPlotter->FlashPadOval( pos, oblong_size, hole.m_Hole_Orient, SKETCH, NULL );
458  }
459  }
460 
461  aPlotter->SetCurrentLineWidth( -1 );
462 
463  return true;
464 }
465 
466 
467 unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSummaryNPTH ) const
468 {
469  unsigned totalHoleCount = 0;
470 
471  for( unsigned ii = 0; ii < m_toolListBuffer.size(); ii++ )
472  {
473  const DRILL_TOOL& tool = m_toolListBuffer[ii];
474 
475  if( aSummaryNPTH && !tool.m_Hole_NotPlated )
476  continue;
477 
478  if( !aSummaryNPTH && tool.m_Hole_NotPlated )
479  continue;
480 
481  // List the tool number assigned to each drill,
482  // in mm then in inches.
483  int tool_number = ii+1;
484  out.Print( 0, " T%d %2.2fmm %2.3f\" ", tool_number,
485  diameter_in_mm( tool.m_Diameter ),
486  diameter_in_inches( tool.m_Diameter ) );
487 
488  // Now list how many holes and ovals are associated with each drill.
489  if( ( tool.m_TotalCount == 1 ) && ( tool.m_OvalCount == 0 ) )
490  out.Print( 0, "(1 hole)\n" );
491  else if( tool.m_TotalCount == 1 )
492  out.Print( 0, "(1 hole) (with 1 slot)\n" );
493  else if( tool.m_OvalCount == 0 )
494  out.Print( 0, "(%d holes)\n", tool.m_TotalCount );
495  else if( tool.m_OvalCount == 1 )
496  out.Print( 0, "(%d holes) (with 1 slot)\n", tool.m_TotalCount );
497  else // tool.m_OvalCount > 1
498  out.Print( 0, "(%d holes) (with %d slots)\n",
499  tool.m_TotalCount, tool.m_OvalCount );
500 
501  totalHoleCount += tool.m_TotalCount;
502  }
503 
504  out.Print( 0, "\n" );
505 
506  return totalHoleCount;
507 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
double diameter_in_inches(double ius)
unsigned printToolSummary(OUTPUTFORMATTER &aOut, bool aSummaryNPTH) const
Function printToolSummary prints m_toolListBuffer[] tools to aOut and returns total hole count.
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
double diameter_in_mm(double ius)
class ALIGNED_DIMENSION, a linear dimension (graphic item)
Definition: typeinfo.h:100
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:172
class LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:342
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:110
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual bool StartPlot()=0
This file is part of the common library.
Plotting engines (PostScript, Gerber, HPGL and DXF)
int GetX() const
Definition: eda_rect.h:103
static constexpr double IU_PER_MM
Mock up a conversion function.
const EDA_RECT GetBoardEdgesBoundingBox() const
Returns the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition: board.h:810
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:76
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:102
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:151
void PlotPcbText(PCB_TEXT *aText)
int getMarkerBestPenSize(int aMarkerDiameter)
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:154
int GetWidth() const
Definition: eda_rect.h:114
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings Returns a bit-mask of all t...
Definition: board.cpp:461
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
Definition: sch_symbol.cpp:69
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:306
int GetHPGLPenSpeed() const
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings Returns a bit-mask of all t...
Definition: board.cpp:447
void SetUnits(DXF_UNITS aUnit)
Set the units to use for plotting the DXF file.
std::vector< DRILL_LAYER_PAIR > getUniqueLayerPairs() const
Get unique layer pairs by examining the micro and blind_buried vias.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
const wxString & GetFileName() const
Definition: board.h:298
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false)
Definition: plotter.h:458
int GetBottom() const
Definition: eda_rect.h:119
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: gr_text.cpp:219
Board plot function definition file.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
PCB specific render settings.
Definition: pcb_painter.h:64
std::vector< DRILL_TOOL > m_toolListBuffer
virtual bool EndPlot()=0
LSET is a set of PCB_LAYER_IDs.
bool GenDrillReportFile(const wxString &aFullFileName)
Function GenDrillReportFile Create a plain text report file giving a list of drill values and drill c...
void SetLayerSet(LSET aLayerMask)
Definition: pcbplot.h:90
#define NULL
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition: board.cpp:473
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:67
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
virtual void SetPenSpeed(int speed)
Definition: plotter_hpgl.h:77
helper classes to handle hole info for drill files generators.
static const wxChar A4[]
Definition: page_info.h:63
wxPoint GetOffset()
Return the plot offset (usually the position of the auxiliary axis.
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
int GetHeight() const
Definition: eda_rect.h:115
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
void buildHolesList(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Function BuildHolesList Create the list of holes and tools for a given board The list is sorted by in...
void Marker(const wxPoint &position, int diametre, unsigned aShapeId)
Draw a pattern shape number aShapeId, to coord position.
Definition: plotter.cpp:331
int GetHPGLPenNum() const
Base plotter engine class.
Definition: plotter.h:121
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:98
const int scale
const std::string layerName(PCB_LAYER_ID aLayer) const
minor helper function.
void PlotPcbShape(PCB_SHAPE *aShape)
virtual void SetPenNumber(int number)
Definition: plotter_hpgl.h:82
Handle the component boundary box.
Definition: eda_rect.h:42
bool genDrillMapFile(const wxString &aFullFileName, PLOT_FORMAT aFormat)
Function GenDrillMapFile Plot a map of drill marks for holes.
#define IU_PER_MILS
Definition: plotter.cpp:137
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
wxPoint Centre() const
Definition: eda_rect.h:60
Used for text file output.
Definition: richio.h:453
bool plotDrillMarks(PLOTTER *aPlotter)
Helper function.
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
Definition: typeinfo.h:103
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:408
void SetDefaultPenWidth(int aWidth)
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
static constexpr int Millimeter2iu(double mm)
std::vector< HOLE_INFO > m_holeListBuffer
DRAWINGS & Drawings()
Definition: board.h:306
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:905
wxString DateAndTime()
Definition: string.cpp:411
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:157
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.