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 <fctsys.h>
31 #include <common.h>
32 #include <plotter.h>
33 #include <base_struct.h>
34 #include <gr_text.h>
35 #include <confirm.h>
36 #include <kicad_string.h>
37 #include <macros.h>
38 #include <math/util.h> // for KiROUND
39 
40 #include <class_board.h>
41 
42 #include <pcbnew.h>
43 #include <pcbplot.h>
45 #include <pcb_painter.h>
46 
47 /* Conversion utilities - these will be used often in there... */
48 inline double diameter_in_inches( double ius )
49 {
50  return ius * 0.001 / IU_PER_MILS;
51 }
52 
53 
54 inline double diameter_in_mm( double ius )
55 {
56  return ius / IU_PER_MM;
57 }
58 
59 
60 // return a pen size to plot markers and having a readable shape
61 inline int getMarkerBestPenSize( int aMarkerDiameter )
62 {
63  return aMarkerDiameter / 10;
64 }
65 
66 
67 bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_FORMAT aFormat )
68 {
69  // Remark:
70  // Hole list must be created before calling this function, by buildHolesList(),
71  // for the right holes set (PTH, NPTH, buried/blind vias ...)
72 
73  double scale = 1.0;
74  wxPoint offset;
75  PLOTTER* plotter = NULL;
76  PAGE_INFO dummy( PAGE_INFO::A4, false );
77  int bottom_limit = 0; // Y coord limit of page. 0 mean do not use
78 
79  PCB_PLOT_PARAMS plot_opts; // starts plotting with default options
80 
81  LOCALE_IO toggle; // use standard C notation for float numbers
82 
83  const PAGE_INFO& page_info = m_pageInfo ? *m_pageInfo : dummy;
84 
85  // Calculate dimensions and center of PCB
87 
88  // Calculate the scale for the format type, scale 1 in HPGL, drawing on
89  // an A4 sheet in PS, + text description of symbols
90  switch( aFormat )
91  {
93  offset = GetOffset();
94  plotter = new GERBER_PLOTTER();
95  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
96  plotter->SetGerberCoordinatesFormat( 5 ); // format x.5 unit = mm
97  break;
98 
99  case PLOT_FORMAT::HPGL: // Scale for HPGL format.
100  {
101  HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
102  plotter = hpgl_plotter;
103  hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
104  hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
105  plotter->SetPageSettings( page_info );
106  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
107  }
108  break;
109 
110 
111  default:
112  wxASSERT( false );
114 
115  case PLOT_FORMAT::PDF:
116  case PLOT_FORMAT::POST:
117  case PLOT_FORMAT::SVG:
118  {
119  PAGE_INFO pageA4( wxT( "A4" ) );
120  wxSize pageSizeIU = pageA4.GetSizeIU();
121 
122  // Reserve a 10 mm margin around the page.
123  int margin = Millimeter2iu( 10 );
124 
125  // Calculate a scaling factor to print the board on the sheet
126  double Xscale = double( pageSizeIU.x - ( 2 * margin ) ) / bbbox.GetWidth();
127 
128  // We should print the list of drill sizes, so reserve room for it
129  // 60% height for board 40% height for list
130  int ypagesize_for_board = KiROUND( pageSizeIU.y * 0.6 );
131  double Yscale = double( ypagesize_for_board - margin ) / bbbox.GetHeight();
132 
133  scale = std::min( Xscale, Yscale );
134 
135  // Experience shows the scale should not to large, because texts
136  // create problem (can be to big or too small).
137  // So the scale is clipped at 3.0;
138  scale = std::min( scale, 3.0 );
139 
140  offset.x = KiROUND( double( bbbox.Centre().x ) - ( pageSizeIU.x / 2.0 ) / scale );
141  offset.y = KiROUND( double( bbbox.Centre().y ) - ( ypagesize_for_board / 2.0 ) / scale );
142 
143  bottom_limit = ( pageSizeIU.y - margin ) / scale;
144 
145  if( aFormat == PLOT_FORMAT::SVG )
146  plotter = new SVG_PLOTTER;
147  else if( aFormat == PLOT_FORMAT::PDF )
148  plotter = new PDF_PLOTTER;
149  else
150  plotter = new PS_PLOTTER;
151 
152  plotter->SetPageSettings( pageA4 );
153  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
154  }
155  break;
156 
157  case PLOT_FORMAT::DXF:
158  {
159  DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER;
160 
161  if( m_unitsMetric )
163  else
165 
166  plotter = dxf_plotter;
167  plotter->SetPageSettings( page_info );
168  plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
169  }
170  break;
171  }
172 
173  plotter->SetCreator( wxT( "PCBNEW" ) );
174  plotter->SetColorMode( false );
175 
176  KIGFX::PCB_RENDER_SETTINGS renderSettings;
177  renderSettings.SetDefaultPenWidth( Millimeter2iu( 0.2 ) );
178 
179  plotter->SetRenderSettings( &renderSettings );
180 
181  if( !plotter->OpenFile( aFullFileName ) )
182  {
183  delete plotter;
184  return false;
185  }
186 
187  plotter->StartPlot();
188 
189  // Draw items on edge layer (not all, only items useful for drill map
190  BRDITEMS_PLOTTER itemplotter( plotter, m_pcb, plot_opts );
191  itemplotter.SetLayerSet( Edge_Cuts );
192 
193  for( auto PtStruct : m_pcb->Drawings() )
194  {
195  switch( PtStruct->Type() )
196  {
197  case PCB_LINE_T:
198  itemplotter.PlotDrawSegment( (DRAWSEGMENT*) PtStruct );
199  break;
200 
201  case PCB_TEXT_T:
202  itemplotter.PlotTextePcb( (TEXTE_PCB*) PtStruct );
203  break;
204 
205  case PCB_DIMENSION_T:
206  case PCB_TARGET_T:
207  case PCB_MARKER_T: // do not draw
208  default:
209  break;
210  }
211  }
212 
213  int plotX, plotY, TextWidth;
214  int intervalle = 0;
215  char line[1024];
216  wxString msg;
217  int textmarginaftersymbol = Millimeter2iu( 2 );
218 
219  // Set Drill Symbols width
220  plotter->SetCurrentLineWidth( -1 );
221 
222  // Plot board outlines and drill map
223  plotDrillMarks( plotter );
224 
225  // Print a list of symbols used.
226  int charSize = Millimeter2iu( 2 ); // text size in IUs
227  // real char scale will be 1/scale, because the global plot scale is scale
228  // for scale < 1.0 ( plot bigger actual size)
229  // Therefore charScale = 1.0 / scale keep the initial charSize
230  // (for scale < 1 we use the global scaling factor: the board must be plotted
231  // smaller than the actual size)
232  double charScale = std::min( 1.0, 1.0 / scale );
233 
234  TextWidth = KiROUND( ( charSize * charScale ) / 10.0 ); // Set text width (thickness)
235  intervalle = KiROUND( charSize * charScale ) + TextWidth;
236 
237  // Trace information.
238  plotX = KiROUND( bbbox.GetX() + textmarginaftersymbol * charScale );
239  plotY = bbbox.GetBottom() + intervalle;
240 
241  // Plot title "Info"
242  wxString Text = wxT( "Drill Map:" );
243  plotter->Text( wxPoint( plotX, plotY ), COLOR4D::UNSPECIFIED, Text, 0,
244  wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
245  GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
246 
247  // For some formats (PS, PDF SVG) we plot the drill size list on more than one column
248  // because the list must be contained inside the printed page
249  // (others formats do not have a defined page size)
250  int max_line_len = 0; // The max line len in iu of the currently plotte column
251 
252  for( unsigned ii = 0; ii < m_toolListBuffer.size(); ii++ )
253  {
254  DRILL_TOOL& tool = m_toolListBuffer[ii];
255 
256  if( tool.m_TotalCount == 0 )
257  continue;
258 
259  plotY += intervalle;
260 
261  // Ensure there are room to plot the line
262  if( bottom_limit && plotY+intervalle > bottom_limit )
263  {
264  plotY = bbbox.GetBottom() + intervalle;
265  plotX += max_line_len + Millimeter2iu( 10 );//column_width;
266  max_line_len = 0;
267  }
268 
269  int plot_diam = KiROUND( tool.m_Diameter );
270  // For markers plotted with the comment, keep marker size <= text height
271  plot_diam = std::min( plot_diam, KiROUND( charSize * charScale ) );
272  int x = KiROUND( plotX - textmarginaftersymbol * charScale - plot_diam / 2.0 );
273  int y = KiROUND( plotY + charSize * charScale );
274 
275  plotter->SetCurrentLineWidth( getMarkerBestPenSize( plot_diam ) );
276  plotter->Marker( wxPoint( x, y ), plot_diam, ii );
277  plotter->SetCurrentLineWidth( -1 );
278 
279  // List the diameter of each drill in mm and inches.
280  sprintf( line, "%3.3fmm / %2.4f\" ", diameter_in_mm( tool.m_Diameter ),
281  diameter_in_inches( tool.m_Diameter ) );
282 
283  msg = FROM_UTF8( line );
284 
285  // Now list how many holes and ovals are associated with each drill.
286  if( ( tool.m_TotalCount == 1 ) && ( tool.m_OvalCount == 0 ) )
287  sprintf( line, "(1 hole)" );
288  else if( tool.m_TotalCount == 1 ) // && ( toolm_OvalCount == 1 )
289  sprintf( line, "(1 slot)" );
290  else if( tool.m_OvalCount == 0 )
291  sprintf( line, "(%d holes)", tool.m_TotalCount );
292  else if( tool.m_OvalCount == 1 )
293  sprintf( line, "(%d holes + 1 slot)", tool.m_TotalCount - 1 );
294  else // if ( toolm_OvalCount > 1 )
295  sprintf( line, "(%d holes + %d slots)", tool.m_TotalCount - tool.m_OvalCount,
296  tool.m_OvalCount );
297 
298  msg += FROM_UTF8( line );
299 
300  if( tool.m_Hole_NotPlated )
301  msg += wxT( " (not plated)" );
302 
303  plotter->Text( wxPoint( plotX, y ), COLOR4D::UNSPECIFIED, msg, 0,
304  wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
305  GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
306 
307  intervalle = KiROUND( ( ( charSize * charScale ) + TextWidth ) * 1.2 );
308 
309  if( intervalle < ( plot_diam + ( 1 * IU_PER_MM / scale ) + TextWidth ) )
310  intervalle = plot_diam + ( 1 * IU_PER_MM / scale ) + TextWidth;
311 
312  // Evaluate the text horizontal size, to know the maximal column size
313  // This is a rough value, but ok to create a new column to plot next texts
314  int text_len = msg.Len() * ( ( charSize * charScale ) + TextWidth );
315  max_line_len = std::max( max_line_len, text_len + plot_diam );
316  }
317 
318  plotter->EndPlot();
319  delete plotter;
320 
321  return true;
322 }
323 
324 
325 bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
326 {
327  FILE_OUTPUTFORMATTER out( aFullFileName );
328 
329  static const char separator[] =
330  " =============================================================\n";
331 
332  wxASSERT( m_pcb );
333 
334  unsigned totalHoleCount;
335  wxString brdFilename = m_pcb->GetFileName();
336 
337  std::vector<DRILL_LAYER_PAIR> hole_sets = getUniqueLayerPairs();
338 
339  out.Print( 0, "Drill report for %s\n", TO_UTF8( brdFilename ) );
340  out.Print( 0, "Created on %s\n\n", TO_UTF8( DateAndTime() ) );
341 
342  // Output the cu layer stackup, so layer name references make sense.
343  out.Print( 0, "Copper Layer Stackup:\n" );
344  out.Print( 0, separator );
345 
347 
348  int conventional_layer_num = 1;
349 
350  for( LSEQ seq = cu.Seq(); seq; ++seq, ++conventional_layer_num )
351  {
352  out.Print( 0, " L%-2d: %-25s %s\n",
353  conventional_layer_num,
354  TO_UTF8( m_pcb->GetLayerName( *seq ) ),
355  layerName( *seq ).c_str() // generic layer name
356  );
357  }
358 
359  out.Print( 0, "\n\n" );
360 
361  /* output hole lists:
362  * 1 - through holes
363  * 2 - for partial holes only: by layer starting and ending pair
364  * 3 - Non Plated through holes
365  */
366 
367  bool buildNPTHlist = false; // First pass: build PTH list only
368 
369  // in this loop are plated only:
370  for( unsigned pair_ndx = 0; pair_ndx < hole_sets.size(); ++pair_ndx )
371  {
372  DRILL_LAYER_PAIR pair = hole_sets[pair_ndx];
373 
374  buildHolesList( pair, buildNPTHlist );
375 
376  if( pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
377  {
378  out.Print( 0, "Drill file '%s' contains\n",
379  TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
380 
381  out.Print( 0, " plated through holes:\n" );
382  out.Print( 0, separator );
383  totalHoleCount = printToolSummary( out, false );
384  out.Print( 0, " Total plated holes count %u\n", totalHoleCount );
385  }
386  else // blind/buried
387  {
388  out.Print( 0, "Drill file '%s' contains\n",
389  TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
390 
391  out.Print( 0, " holes connecting layer pair: '%s and %s' (%s vias):\n",
392  TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.first ) ) ),
393  TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
394  pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried"
395  );
396 
397  out.Print( 0, separator );
398  totalHoleCount = printToolSummary( out, false );
399  out.Print( 0, " Total plated holes count %u\n", totalHoleCount );
400  }
401 
402  out.Print( 0, "\n\n" );
403  }
404 
405  // NPTHoles. Generate the full list (pads+vias) if PTH and NPTH are merged,
406  // or only the NPTH list (which never has vias)
407  if( !m_merge_PTH_NPTH )
408  buildNPTHlist = true;
409 
410  buildHolesList( DRILL_LAYER_PAIR( F_Cu, B_Cu ), buildNPTHlist );
411 
412  // nothing wrong with an empty NPTH file in report.
413  if( m_merge_PTH_NPTH )
414  out.Print( 0, "Not plated through holes are merged with plated holes\n" );
415  else
416  out.Print( 0, "Drill file '%s' contains\n",
418  true, m_merge_PTH_NPTH ) ) );
419 
420  out.Print( 0, " unplated through holes:\n" );
421  out.Print( 0, separator );
422  totalHoleCount = printToolSummary( out, true );
423  out.Print( 0, " Total unplated holes count %u\n", totalHoleCount );
424 
425  return true;
426 }
427 
428 
430 {
431  // Plot the drill map:
432  wxPoint pos;
433 
434  for( unsigned ii = 0; ii < m_holeListBuffer.size(); ii++ )
435  {
436  const HOLE_INFO& hole = m_holeListBuffer[ii];
437  pos = hole.m_Hole_Pos;
438 
439  // Gives a good line thickness to have a good marker shape:
441 
442  // Always plot the drill symbol (for slots identifies the needed cutter!
443  aPlotter->Marker( pos, hole.m_Hole_Diameter, hole.m_Tool_Reference - 1 );
444 
445  if( hole.m_Hole_Shape != 0 )
446  {
447  wxSize oblong_size = hole.m_Hole_Size;
448  aPlotter->FlashPadOval( pos, oblong_size, hole.m_Hole_Orient, SKETCH, NULL );
449  }
450  }
451 
452  aPlotter->SetCurrentLineWidth( -1 );
453 
454  return true;
455 }
456 
457 
458 unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSummaryNPTH ) const
459 {
460  unsigned totalHoleCount = 0;
461 
462  for( unsigned ii = 0; ii < m_toolListBuffer.size(); ii++ )
463  {
464  const DRILL_TOOL& tool = m_toolListBuffer[ii];
465 
466  if( aSummaryNPTH && !tool.m_Hole_NotPlated )
467  continue;
468 
469  if( !aSummaryNPTH && tool.m_Hole_NotPlated )
470  continue;
471 
472  // List the tool number assigned to each drill,
473  // in mm then in inches.
474  int tool_number = ii+1;
475  out.Print( 0, " T%d %2.2fmm %2.3f\" ", tool_number,
476  diameter_in_mm( tool.m_Diameter ),
477  diameter_in_inches( tool.m_Diameter ) );
478 
479  // Now list how many holes and ovals are associated with each drill.
480  if( ( tool.m_TotalCount == 1 ) && ( tool.m_OvalCount == 0 ) )
481  out.Print( 0, "(1 hole)\n" );
482  else if( tool.m_TotalCount == 1 )
483  out.Print( 0, "(1 hole) (with 1 slot)\n" );
484  else if( tool.m_OvalCount == 0 )
485  out.Print( 0, "(%d holes)\n", tool.m_TotalCount );
486  else if( tool.m_OvalCount == 1 )
487  out.Print( 0, "(%d holes) (with 1 slot)\n", tool.m_TotalCount );
488  else // tool.m_OvalCount > 1
489  out.Print( 0, "(%d holes) (with %d slots)\n",
490  tool.m_TotalCount, tool.m_OvalCount );
491 
492  totalHoleCount += tool.m_TotalCount;
493  }
494 
495  out.Print( 0, "\n" );
496 
497  return totalHoleCount;
498 }
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:712
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
double diameter_in_mm(double ius)
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:164
#define KI_FALLTHROUGH
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:114
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
virtual bool StartPlot()=0
This file is part of the common library.
int GetX() const
Definition: eda_rect.h:111
static constexpr double IU_PER_MM
Mock up a conversion function.
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:800
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:77
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:143
int getMarkerBestPenSize(int aMarkerDiameter)
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:146
int GetWidth() const
Definition: eda_rect.h:119
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a convenient ...
Definition: richio.h:327
int GetHPGLPenSpeed() const
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
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
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:377
const wxString & GetFileName() const
Definition: class_board.h:255
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false)
Definition: plotter.h:460
This file contains miscellaneous commonly used macros and functions.
int GetBottom() const
Definition: eda_rect.h:124
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:222
Board plot function definition file.
PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:63
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:92
#define NULL
PLOT_FORMAT
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:51
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
virtual void SetPenSpeed(int speed)
Definition: plotter.h:636
helper classes to handle hole info for drill files generators.
static const wxChar A4[]
Definition: page_info.h:65
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.
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
int GetHeight() const
Definition: eda_rect.h:120
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:101
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:332
int GetHPGLPenNum() const
Base plotter engine class.
Definition: plotter.h:114
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
const int scale
const std::string layerName(PCB_LAYER_ID aLayer) const
minor helper function.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
virtual void SetPenNumber(int number)
Definition: plotter.h:641
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
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:138
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
#define TO_UTF8(wxstring)
The common library.
wxPoint Centre() const
Definition: eda_rect.h:62
void PlotTextePcb(TEXTE_PCB *pt_texte)
FILE_OUTPUTFORMATTER may be used for text file output.
Definition: richio.h:492
bool plotDrillMarks(PLOTTER *aPlotter)
Helper function.
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
void SetDefaultPenWidth(int aWidth)
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
static constexpr int Millimeter2iu(double mm)
std::vector< HOLE_INFO > m_holeListBuffer
DRAWINGS & Drawings()
Definition: class_board.h:275
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:849
wxString DateAndTime()
Definition: string.cpp:373
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:149
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
void PlotDrawSegment(DRAWSEGMENT *PtSegm)