KiCad PCB EDA Suite
plot_brditems_plotter.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <algorithm> // for min
25 #include <bitset> // for bitset, operator&, __bi...
26 #include <math.h> // for abs
27 #include <stddef.h> // for NULL, size_t
28 #include <vector> // for vector, __vector_base<>...
29 
30 #include <base_struct.h>
31 #include <common.h>
33 #include <geometry/seg.h> // for SEG
34 #include <geometry/shape_line_chain.h> // for SHAPE_LINE_CHAIN
35 #include <geometry/shape_poly_set.h> // for SHAPE_POLY_SET, SHAPE_P...
36 #include <math/util.h> // for KiROUND, Clamp
37 #include <math/vector2d.h> // for VECTOR2I
38 #include <plotter.h>
39 #include <trigo.h>
40 
41 #include <board_design_settings.h> // for BOARD_DESIGN_SETTINGS
42 #include <core/typeinfo.h> // for dyn_cast, PCB_DIMENSION_T
43 #include <eda_text.h> // for FILLED, EDA_DRAW_MODE_T
44 #include <gal/color4d.h> // for COLOR4D, operator!=
45 #include <gbr_metadata.h>
46 #include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
47 #include <layers_id_colors_and_visibility.h> // for LSET, IsCopperLayer
48 #include <pad_shapes.h> // for PAD_ATTRIB_HOLE_NOT_PLATED
49 #include <pcbplot.h>
50 #include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
51 
52 #include <class_board.h>
53 #include <class_board_item.h> // for BOARD_ITEM, S_CIRCLE
54 #include <class_dimension.h>
55 #include <class_drawsegment.h>
56 #include <class_edge_mod.h>
57 #include <class_module.h>
58 #include <class_text_mod.h> // for TEXTE_MODULE
59 #include <class_track.h>
60 #include <class_pad.h> // for D_PAD
61 #include <class_pcb_target.h>
62 #include <class_pcb_text.h>
63 #include <class_zone.h>
64 
65 #include <wx/debug.h> // for wxASSERT_MSG
66 #include <wx/wx.h> // for wxPoint, wxSize, wxArra...
67 
68 
69 /* class BRDITEMS_PLOTTER is a helper class to plot board items
70  * and a group of board items
71  */
72 
74 {
75  COLOR4D color = ColorSettings()->GetColor( aLayer );
76 
77  // A hack to avoid plotting a white item in white color, expecting the paper
78  // is also white: use a non white color:
79  if( color == COLOR4D::WHITE )
80  color = COLOR4D( LIGHTGRAY );
81 
82  return color;
83 }
84 
85 
86 void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPlotMode )
87 {
88  wxPoint shape_pos = aPad->ShapePos();
89  GBR_METADATA gbr_metadata;
90 
91  bool plotOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
92  bool plotOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
93 
94  // Pad not on the solder mask layer cannot be soldered.
95  // therefore it can have a specific aperture attribute.
96  // Not yet in use.
97  // bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
98 
99  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
100 
101  if( plotOnCopperLayer )
102  {
103  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
104  gbr_metadata.SetCopper( true );
105  // Gives a default attribute, for instance for pads used as tracks in net ties:
106  // Connector pads and SMD pads are on external layers
107  // if on internal layers, they are certainly used as net tie
108  // and are similar to tracks: just conductor items
110 
111  const bool useUTF8 = false;
112  const bool useQuoting = false;
113  gbr_metadata.SetPadName( aPad->GetName(), useUTF8, useQuoting );
114 
115  if( !aPad->GetName().IsEmpty() )
116  gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
117 
118  gbr_metadata.SetNetName( aPad->GetNetname() );
119 
120  // Some pads are mechanical pads ( through hole or smd )
121  // when this is the case, they have no pad name and/or are not plated.
122  // In this case gerber files have slightly different attributes.
123  if( aPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED || aPad->GetName().IsEmpty() )
124  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
125 
126  if( !plotOnExternalCopperLayer )
127  {
128  // the .P object attribute (GBR_NETLIST_METADATA::GBR_NETINFO_PAD)
129  // is used on outer layers, unless the component is embedded
130  // or a "etched" component (fp only drawn, not a physical component)
131  // Currently, Pcbnew does not handle embedded component, so we disable the .P
132  // attribute on internal layers
133  // Note the Gerber doc is not really clear about through holes pads about the .P
136 
137  }
138 
139  // Some attributes are reserved to the external copper layers:
140  // GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF
141  // for instance.
142  // Pad with type PAD_ATTRIB_CONN or PAD_ATTRIB_SMD that is not on outer layer
143  // has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR
144  switch( aPad->GetAttribute() )
145  {
146  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
148  break;
149 
150  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
152  break;
153 
154  case PAD_ATTRIB_CONN: // Connector pads, no solder paste but with solder mask.
155  if( plotOnExternalCopperLayer )
157  break;
158 
159  case PAD_ATTRIB_SMD: // SMD pads (on external copper layer only)
160  // with solder paste and mask
161  if( plotOnExternalCopperLayer )
163  break;
164  }
165 
166  // Fabrication properties can have specific GBR_APERTURE_METADATA options
167  // that replace previous aperture attribute:
168  switch( aPad->GetProperty() )
169  {
170  case PAD_PROP_BGA: // Only applicable to outer layers
171  if( plotOnExternalCopperLayer )
173  break;
174 
177  break;
178 
181  break;
182 
183  case PAD_PROP_TESTPOINT: // Only applicable to outer layers
184  if( plotOnExternalCopperLayer )
186  break;
187 
188  case PAD_PROP_HEATSINK:
190  break;
191 
194  break;
195 
196  case PAD_PROP_NONE:
197  break;
198  }
199 
200  // Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
203  }
204  else
205  {
207  }
208 
209  // Set plot color (change WHITE to LIGHTGRAY because
210  // the white items are not seen on a white paper or screen
211  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
212 
213  if( aPlotMode == SKETCH )
215 
216  switch( aPad->GetShape() )
217  {
218  case PAD_SHAPE_CIRCLE:
219  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
220  break;
221 
222  case PAD_SHAPE_OVAL:
223  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(),
224  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
225  break;
226 
227  case PAD_SHAPE_RECT:
228  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
229  &gbr_metadata );
230  break;
231 
232  case PAD_SHAPE_ROUNDRECT:
233  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
234  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
235  break;
236 
237  default:
238  case PAD_SHAPE_TRAPEZOID:
240  case PAD_SHAPE_CUSTOM:
241  {
242  SHAPE_POLY_SET polygons;
243  aPad->TransformShapeWithClearanceToPolygon( polygons, 0 );
244 
245  if( polygons.OutlineCount() == 0 )
246  break;
247 
248  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), &polygons, aPlotMode,
249  &gbr_metadata );
250  }
251  break;
252  }
253 }
254 
255 
257 {
258  TEXTE_MODULE* textModule = &aModule->Reference();
259  LAYER_NUM textLayer = textModule->GetLayer();
260 
261  // Reference and value are specfic items, not in graphic items list
262  if( GetPlotReference() && m_layerMask[textLayer]
263  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
264  {
265  PlotFootprintTextItem( textModule, getColor( textLayer ));
266  }
267 
268  textModule = &aModule->Value();
269  textLayer = textModule->GetLayer();
270 
271  if( GetPlotValue() && m_layerMask[textLayer]
272  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
273  {
274  PlotFootprintTextItem( textModule, getColor( textLayer ));
275  }
276 
277  for( auto item : aModule->GraphicalItems() )
278  {
279  textModule = dyn_cast<TEXTE_MODULE*>( item );
280 
281  if( !textModule )
282  continue;
283 
284  if( !textModule->IsVisible() )
285  continue;
286 
287  textLayer = textModule->GetLayer();
288 
289  if( textLayer >= PCB_LAYER_ID_COUNT )
290  return;
291 
292  if( !m_layerMask[textLayer] )
293  continue;
294 
295  if( textModule->GetText() == wxT( "${REFERENCE}" ) && !GetPlotReference() )
296  continue;
297 
298  if( textModule->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() )
299  continue;
300 
301  PlotFootprintTextItem( textModule, getColor( textLayer ));
302  }
303 }
304 
305 
306 // plot items like text and graphics, but not tracks and module
308 {
309  for( auto item : m_board->Drawings() )
310  {
311  switch( item->Type() )
312  {
313  case PCB_LINE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break;
314  case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break;
315  case PCB_DIMENSION_T: PlotDimension( (DIMENSION*) item ); break;
316  case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break;
317  default: break;
318  }
319  }
320 }
321 
323 {
324  if( aColor == COLOR4D::WHITE )
325  aColor = COLOR4D( LIGHTGRAY );
326 
327  m_plotter->SetColor( aColor );
328 
329  // calculate some text parameters :
330  wxSize size = aTextMod->GetTextSize();
331  wxPoint pos = aTextMod->GetTextPos();
332  double orient = aTextMod->GetDrawRotation();
333  int thickness = aTextMod->GetEffectiveTextPenWidth();
334 
335  if( aTextMod->IsMirrored() )
336  size.x = -size.x; // Text is mirrored
337 
338  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
339  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
340  // (like bold text) and we manage the thickness.
341  // So we set bold flag to true
342  bool allow_bold = true;
343 
344  GBR_METADATA gbr_metadata;
346  MODULE* parent = static_cast<MODULE*> ( aTextMod->GetParent() );
347  gbr_metadata.SetCmpReference( parent->GetReference() );
348 
349  m_plotter->SetCurrentLineWidth( thickness );
350 
351  m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size,
352  aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), thickness,
353  aTextMod->IsItalic(), allow_bold, false, &gbr_metadata );
354 }
355 
356 
358 {
359  if( !m_layerMask[aDim->GetLayer()] )
360  return;
361 
362  DRAWSEGMENT draw;
363 
364  draw.SetWidth( aDim->GetWidth() );
365  draw.SetLayer( aDim->GetLayer() );
366 
367  COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
368 
369  // Set plot color (change WHITE to LIGHTGRAY because
370  // the white items are not seen on a white paper or screen
372 
373  PlotTextePcb( &aDim->Text() );
374 
375  draw.SetStart( aDim->m_crossBarO );
376  draw.SetEnd( aDim->m_crossBarF );
377  PlotDrawSegment( &draw );
378 
379  draw.SetStart( aDim->m_featureLineGO);
380  draw.SetEnd( aDim->m_featureLineGF );
381  PlotDrawSegment( &draw );
382 
383  draw.SetStart( aDim->m_featureLineDO );
384  draw.SetEnd( aDim->m_featureLineDF );
385  PlotDrawSegment( &draw );
386 
387  draw.SetStart( aDim->m_crossBarF );
388  draw.SetEnd( aDim->m_arrowD1F );
389  PlotDrawSegment( &draw );
390 
391  draw.SetStart( aDim->m_crossBarF );
392  draw.SetEnd( aDim->m_arrowD2F );
393  PlotDrawSegment( &draw );
394 
395  draw.SetStart( aDim->m_crossBarO );
396  draw.SetEnd( aDim->m_arrowG1F );
397  PlotDrawSegment( &draw );
398 
399  draw.SetStart( aDim->m_crossBarO );
400  draw.SetEnd( aDim->m_arrowG2F );
401  PlotDrawSegment( &draw );
402 }
403 
404 
406 {
407  int dx1, dx2, dy1, dy2, radius;
408 
409  if( !m_layerMask[aMire->GetLayer()] )
410  return;
411 
412  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
413 
414  DRAWSEGMENT draw;
415 
416  draw.SetShape( S_CIRCLE );
417  draw.SetWidth( aMire->GetWidth() );
418  draw.SetLayer( aMire->GetLayer() );
419  draw.SetStart( aMire->GetPosition() );
420  radius = aMire->GetSize() / 3;
421 
422  if( aMire->GetShape() ) // shape X
423  radius = aMire->GetSize() / 2;
424 
425  // Draw the circle
426  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ));
427 
428  PlotDrawSegment( &draw );
429 
430  draw.SetShape( S_SEGMENT );
431 
432  radius = aMire->GetSize() / 2;
433  dx1 = radius;
434  dy1 = 0;
435  dx2 = 0;
436  dy2 = radius;
437 
438  if( aMire->GetShape() ) // Shape X
439  {
440  dx1 = dy1 = radius;
441  dx2 = dx1;
442  dy2 = -dy1;
443  }
444 
445  wxPoint mirePos( aMire->GetPosition() );
446 
447  // Draw the X or + shape:
448  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ));
449  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ));
450  PlotDrawSegment( &draw );
451 
452  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ));
453  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ));
454  PlotDrawSegment( &draw );
455 }
456 
457 
458 // Plot footprints graphic items (outlines)
460 {
461  for( BOARD_ITEM* item : aModule->GraphicalItems() )
462  {
463  EDGE_MODULE* edge = dynamic_cast<EDGE_MODULE*>( item );
464 
465  if( edge && m_layerMask[ edge->GetLayer() ] )
466  PlotFootprintGraphicItem( edge );
467  }
468 }
469 
470 
471 //* Plot a graphic item (outline) relative to a footprint
473 {
474  if( aEdge->Type() != PCB_MODULE_EDGE_T )
475  return;
476 
477  m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
478 
479  int thickness = aEdge->GetWidth();
480  wxPoint pos( aEdge->GetStart() );
481  wxPoint end( aEdge->GetEnd() );
482 
483  GBR_METADATA gbr_metadata;
485  MODULE* parent = static_cast<MODULE*> ( aEdge->GetParent() );
486  gbr_metadata.SetCmpReference( parent->GetReference() );
487 
488  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
489 
490  if( isOnCopperLayer )
491  {
492  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
493  gbr_metadata.SetCopper( true );
494  }
495  else if( aEdge->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
496  {
497  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
498  }
499 
500  int radius; // Circle/arc radius.
501 
502  switch( aEdge->GetShape() )
503  {
504  case S_SEGMENT:
505  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
506  break;
507 
508  case S_RECT:
509  {
510  std::vector<wxPoint> pts;
511  aEdge->GetRectCorners( &pts );
512 
513  if( aEdge->GetWidth() > 0 )
514  {
515  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
516  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
517  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
518  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
519  }
520  else
521  {
522  SHAPE_LINE_CHAIN poly;
523 
524  for( const wxPoint& pt : pts )
525  poly.Append( pt );
526 
527  m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata );
528  }
529  }
530  break;
531 
532  case S_CIRCLE:
533  radius = KiROUND( GetLineLength( end, pos ) );
534 
535  if( aEdge->GetWidth() > 0 )
536  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
537  else
538  m_plotter->Circle( pos, radius * 2, FILLED_SHAPE, -1 );
539 
540  break;
541 
542  case S_ARC:
543  {
544  radius = KiROUND( GetLineLength( end, pos ) );
545  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
546  double endAngle = startAngle + aEdge->GetAngle();
547 
548  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
549  if( std::abs( aEdge->GetAngle() ) == 3600.0 )
550  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
551  else
552  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
553  }
554  break;
555 
556  case S_POLYGON:
557  if( aEdge->IsPolyShapeValid() )
558  {
559  const std::vector<wxPoint> &polyPoints = aEdge->BuildPolyPointsList();
560 
561  // We must compute true coordinates from m_PolyList
562  // which are relative to module position, orientation 0
563  MODULE *module = aEdge->GetParentModule();
564 
565  std::vector<wxPoint> cornerList;
566 
567  cornerList.reserve( polyPoints.size() );
568 
569  for( wxPoint corner : polyPoints )
570  {
571  if( module )
572  {
573  RotatePoint( &corner, module->GetOrientation() );
574  corner += module->GetPosition();
575  }
576 
577  cornerList.push_back( corner );
578  }
579 
580  if( !aEdge->IsPolygonFilled() )
581  {
582  for( size_t i = 1; i < cornerList.size(); i++ )
583  {
584  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
585  GetPlotMode(), &gbr_metadata );
586  }
587 
588  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
589  GetPlotMode(), &gbr_metadata );
590 
591  }
592  else
593  {
594  // This must be simplified and fractured to prevent overlapping polygons
595  // from generating invalid Gerber files
596 
597  SHAPE_LINE_CHAIN line( cornerList );
598  SHAPE_POLY_SET tmpPoly;
599 
600  line.SetClosed( true );
601  tmpPoly.AddOutline( line );
603 
604  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
605  {
606  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
607  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
608  }
609  }
610  }
611  break;
612 
613  case S_CURVE:
614  m_plotter->BezierCurve( aEdge->GetStart(), aEdge->GetBezControl1(),
615  aEdge->GetBezControl2(), aEdge->GetEnd(),
616  0, thickness );
617  break;
618 
619  default:
620  wxASSERT_MSG( false, "Unhandled EDGE_MODULE shape" );
621  break;
622  }
623 }
624 
625 
626 // Plot a PCB Text, i.e. a text found on a copper or technical layer
628 {
629  wxString shownText( pt_texte->GetShownText() );
630 
631  if( shownText.IsEmpty() )
632  return;
633 
634  if( !m_layerMask[pt_texte->GetLayer()] )
635  return;
636 
637  GBR_METADATA gbr_metadata;
638 
639  if( IsCopperLayer( pt_texte->GetLayer() ) )
641 
642  COLOR4D color = getColor( pt_texte->GetLayer() );
644 
645  wxSize size = pt_texte->GetTextSize();
646  wxPoint pos = pt_texte->GetTextPos();
647  double orient = pt_texte->GetTextAngle();
648  int thickness = pt_texte->GetEffectiveTextPenWidth();
649 
650  if( pt_texte->IsMirrored() )
651  size.x = -size.x;
652 
653  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
654  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
655  // (like bold text) and we manage the thickness.
656  // So we set bold flag to true
657  bool allow_bold = true;
658 
659  m_plotter->SetCurrentLineWidth( thickness );
660 
661  if( pt_texte->IsMultilineAllowed() )
662  {
663  std::vector<wxPoint> positions;
664  wxArrayString strings_list;
665  wxStringSplit( shownText, strings_list, '\n' );
666  positions.reserve( strings_list.Count() );
667 
668  pt_texte->GetLinePositions( positions, strings_list.Count());
669 
670  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
671  {
672  wxString& txt = strings_list.Item( ii );
673  m_plotter->Text( positions[ii], color, txt, orient, size, pt_texte->GetHorizJustify(),
674  pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(),
675  allow_bold, false, &gbr_metadata );
676  }
677  }
678  else
679  {
680  m_plotter->Text( pos, color, shownText, orient, size, pt_texte->GetHorizJustify(),
681  pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(), allow_bold,
682  false, &gbr_metadata );
683  }
684 }
685 
686 
688 {
689  if( polysList.IsEmpty() )
690  return;
691 
692  GBR_METADATA gbr_metadata;
693 
694  bool isOnCopperLayer = aZone->IsOnCopperLayer();
695 
696  if( isOnCopperLayer )
697  {
698  gbr_metadata.SetNetName( aZone->GetNetname() );
699  gbr_metadata.SetCopper( true );
700 
701  // Zones with no net name can exist.
702  // they are not used to connect items, so the aperture attribute cannot
703  // be set as conductor
704  if( aZone->GetNetname().IsEmpty() )
706  else
707  {
710  }
711  }
712 
713  // We need a buffer to store corners coordinates:
714  std::vector< wxPoint > cornerList;
715 
716  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
717 
718  m_plotter->StartBlock( nullptr ); // Clean current object attributes
719 
720  /* Plot all filled areas: filled areas have a filled area and a thick
721  * outline (depending on the fill area option we must plot the filled area itself
722  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
723  *
724  * in non filled mode the outline is plotted, but not the filling items
725  */
726  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
727 
728  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
729  {
730  SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
731 
732  cornerList.clear();
733  cornerList.reserve( outline.PointCount() );
734 
735  for( int ic = 0; ic < outline.PointCount(); ++ic )
736  {
737  cornerList.emplace_back( wxPoint( outline.CPoint( ic ) ) );
738  }
739 
740  if( cornerList.size() ) // Plot the current filled area outline
741  {
742  // First, close the outline
743  if( cornerList[0] != cornerList[cornerList.size() - 1] )
744  cornerList.push_back( cornerList[0] );
745 
746  // Plot the current filled area (as region for Gerber plotter
747  // to manage attributes) and its outline for thick outline
748  if( GetPlotMode() == FILLED )
749  {
751  {
752  if( outline_thickness > 0 )
753  m_plotter->PlotPoly( cornerList, NO_FILL,
754  outline_thickness, &gbr_metadata );
755 
756  static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion(
757  cornerList, &gbr_metadata );
758  }
759  else
760  m_plotter->PlotPoly( cornerList, FILLED_SHAPE,
761  outline_thickness, &gbr_metadata );
762  }
763  else
764  {
765  if( outline_thickness )
766  {
767  for( unsigned jj = 1; jj < cornerList.size(); jj++ )
768  {
769  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
770  outline_thickness,
771  GetPlotMode(), &gbr_metadata );
772  }
773  }
774 
776  }
777  }
778  }
779 
780  m_plotter->EndBlock( nullptr ); // Clear object attributes
781 }
782 
783 
784 /* Plot items type DRAWSEGMENT on layers allowed by aLayerMask
785  */
787 {
788  if( !m_layerMask[aSeg->GetLayer()] )
789  return;
790 
791  int radius = 0;
792  double StAngle = 0, EndAngle = 0;
793  int thickness = aSeg->GetWidth();
794 
795  m_plotter->SetColor( getColor( aSeg->GetLayer() ) );
796 
797  wxPoint start( aSeg->GetStart() );
798  wxPoint end( aSeg->GetEnd() );
799 
800  GBR_METADATA gbr_metadata;
801 
802  if( aSeg->GetLayer() == Edge_Cuts )
804 
805  if( IsCopperLayer( aSeg->GetLayer() ) )
806  // Graphic items (DRAWSEGMENT, TEXT) having no net have the NonConductor attribute
807  // Graphic items having a net have the Conductor attribute, but are not (yet?)
808  // supported in Pcbnew
809  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
810 
811  switch( aSeg->GetShape() )
812  {
813  case S_CIRCLE:
814  radius = KiROUND( GetLineLength( end, start ) );
815  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
816  break;
817 
818  case S_ARC:
819  radius = KiROUND( GetLineLength( end, start ) );
820  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
821  EndAngle = StAngle + aSeg->GetAngle();
822 
823  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
824  if( std::abs( aSeg->GetAngle() ) == 3600.0 )
825  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
826  else
827  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
828  break;
829 
830  case S_CURVE:
831  m_plotter->BezierCurve( aSeg->GetStart(), aSeg->GetBezControl1(), aSeg->GetBezControl2(),
832  aSeg->GetEnd(), 0, thickness );
833  break;
834 
835  case S_POLYGON:
836  {
837  if( !aSeg->IsPolygonFilled() )
838  {
839  for( auto it = aSeg->GetPolyShape().CIterateSegments( 0 ); it; it++ )
840  {
841  auto seg = it.Get();
842  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
843  thickness, GetPlotMode(), &gbr_metadata );
844  }
845  }
846  else
847  {
848  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
849  // Draw the polygon: only one polygon is expected
850  // However we provide a multi polygon shape drawing
851  // ( for the future or to show a non expected shape )
852  // This must be simplified and fractured to prevent overlapping polygons
853  // from generating invalid Gerber files
854  auto tmpPoly = SHAPE_POLY_SET( aSeg->GetPolyShape() );
856 
857  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
858  {
859  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
860  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
861  }
862  }
863  }
864  break;
865 
866  default:
867  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
868  }
869 }
870 
871 
876  wxSize aDrillSize, const wxSize &aPadSize,
877  double aOrientation, int aSmallDrill )
878 {
879  // Small drill marks have no significance when applied to slots
880  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
881  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
882 
883  // Round holes only have x diameter, slots have both
884  aDrillSize.x -= getFineWidthAdj();
885  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
886 
887  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
888  {
889  aDrillSize.y -= getFineWidthAdj();
890  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
891  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
892  }
893  else
894  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
895 }
896 
897 
899 {
900  /* If small drills marks were requested prepare a clamp value to pass
901  to the helper function */
902  int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
903  SMALL_DRILL : 0;
904 
905  /* In the filled trace mode drill marks are drawn white-on-black to scrape
906  the underlying pad. This works only for drivers supporting color change,
907  obviously... it means that:
908  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
909  - In HPGL you can't see them
910  - In gerbers you can't see them, too. This is arguably the right thing to
911  do since having drill marks and high speed drill stations is a sure
912  recipe for broken tools and angry manufacturers. If you *really* want them
913  you could start a layer with negative polarity to scrape the film.
914  - In DXF they go into the 'WHITE' layer. This could be useful.
915  */
916  if( GetPlotMode() == FILLED )
918 
919  for( auto pts : m_board->Tracks() )
920  {
921  const VIA* via = dyn_cast<const VIA*>( pts );
922 
923  if( via )
924  {
926  wxSize( via->GetDrillValue(), 0 ),
927  wxSize( via->GetWidth(), 0 ), 0, small_drill );
928  }
929  }
930 
931  for( auto Module : m_board->Modules() )
932  {
933  for( auto pad : Module->Pads() )
934  {
935  if( pad->GetDrillSize().x == 0 )
936  continue;
937 
938  plotOneDrillMark( pad->GetDrillShape(),
939  pad->GetPosition(), pad->GetDrillSize(),
940  pad->GetSize(), pad->GetOrientation(),
941  small_drill );
942  }
943  }
944 
945  if( GetPlotMode() == FILLED )
947 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:341
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
a class to handle special data (items attributes) during plot.
void PlotFootprintGraphicItems(MODULE *aModule)
#define SMALL_DRILL
Definition: pcbplot.h:60
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
double GetOrientation() const
Definition: class_module.h:211
aperture used for etched components
Definition: gbr_metadata.h:83
TEXTE_MODULE & Reference()
Definition: class_module.h:474
void SetShape(STROKE_T aShape)
int OutlineCount() const
Returns the number of outlines in the set
aperture used for edge connector pad (outer layers)
Definition: gbr_metadata.h:94
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:199
bool IsMirrored() const
Definition: eda_text.h:188
int GetWidth() const
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:206
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:486
TEXTE_PCB class definition.
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:99
no special fabrication property
Definition: pad_shapes.h:97
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
wxPoint m_crossBarF
print info associated to a component (TO.C attribute)
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
wxPoint m_arrowD1F
virtual void SetColor(COLOR4D color)=0
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:569
const wxPoint & GetStart() const
Definition: class_track.h:118
STROKE_T GetShape() const
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
void PlotPad(D_PAD *aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPlotMode)
Plot a pad.
int GetSize() const
bool IsVisible() const
Definition: eda_text.h:185
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
void PlotDimension(DIMENSION *Dimension)
a fiducial (usually a smd) for the full board
Definition: pad_shapes.h:99
int color
Definition: DXF_plotter.cpp:61
polygon (not yet used for tracks, but could be in microwave apps)
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:236
PLOTTER * m_plotter
Definition: pcbplot.h:66
void PlotDrillMarks()
Function PlotDrillMarks Draw a drill mark for pads and vias.
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:477
double GetTextAngle() const
Definition: eda_text.h:173
bool GetFilledPolysUseThickness() const
Definition: class_zone.h:661
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:89
Smd pad, used in BGA footprints.
Definition: pad_shapes.h:98
usual segment : line with rounded ends
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH)
Generic fallback: Cubic Bezier curve rendered as a polyline In Kicad the bezier curves have 4 control...
Definition: plotter.cpp:204
aperture used for castellated pads in copper layer files
Definition: gbr_metadata.h:100
wxPoint m_featureLineDF
DRAWINGS & GraphicalItems()
Definition: class_module.h:179
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
a pad used as heat sink, usually in SMD footprints
Definition: pad_shapes.h:102
const wxString & GetPinFunction() const
Definition: class_pad.h:134
const std::vector< wxPoint > BuildPolyPointsList() const
Build and return the list of corners in a std::vector<wxPoint> It must be used only to convert the SH...
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
int PointCount() const
Function PointCount()
PAD_DRILL_SHAPE_T
Enum PAD_DRILL_SHAPE_T is the set of pad drill shapes, used with D_PAD::{Set,Get}DrillShape()
Definition: pad_shapes.h:66
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
void PlotFilledAreas(ZONE_CONTAINER *aZone, SHAPE_POLY_SET &aPolysList)
BOARD * m_board
Definition: pcbplot.h:67
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:332
A single base class (TRACK) represents both tracks and vias, with subclasses for curved tracks (ARC) ...
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:531
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:152
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCustom
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:433
a pad with a castellated through hole
Definition: pad_shapes.h:103
void SetPadPinFunction(const wxString &aPadPinFunction, bool aUseUTF8, bool aEscapeString)
Definition: gbr_metadata.h:187
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.
wxPoint m_featureLineGO
bool IsItalic() const
Definition: eda_text.h:179
void PlotFootprintTextItems(MODULE *aModule)
DIMENSION class definition.
const VECTOR2I & CPoint(int aIndex) const
Function Point()
segment with non rounded ends
void SetClosed(bool aClosed)
Function SetClosed()
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:93
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
int GetWidth() const
aperture used for fiducial pad (outer layers), at board level
Definition: gbr_metadata.h:97
Footprint text class description.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:198
#define NULL
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
MODULES & Modules()
Definition: class_board.h:266
void PlotPcbTarget(PCB_TARGET *PtMire)
SHAPE_POLY_SET.
void SetPadName(const wxString &aPadname, bool aUseUTF8=false, bool aEscapeString=false)
Definition: gbr_metadata.h:182
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:473
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
EDA_DRAW_MODE_T
Definition: eda_text.h:62
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
void PlotBoardGraphicItems()
plot items like text and graphics, but not tracks and modules
COLOR4D GetColor() const
const wxSize & GetTextSize() const
Definition: eda_text.h:238
void PlotFootprintGraphicItem(EDGE_MODULE *aEdge)
Arcs (with rounded ends)
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRoundRect
wxPoint m_arrowG1F
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
wxPoint m_arrowD2F
wxPoint m_arrowG2F
MODULE * GetParentModule() const
Function GetParentModule returns a pointer to the parent module, or NULL if DRAWSEGMENT does not belo...
static LSET ExternalCuMask()
Function ExternalCuMask returns a mask holding the Front and Bottom layers.
Definition: lset.cpp:742
const wxString & GetName() const
Definition: class_pad.h:128
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:95
SHAPE_POLY_SET & GetPolyShape()
PAD_PROP_T GetProperty() const
Definition: class_pad.h:335
Bezier Curve.
const wxString & GetNetname() const
Function GetNetname.
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
int GetWidth() const
bool IsMultilineAllowed() const
Definition: eda_text.h:196
Pad object description.
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
void SetStart(const wxPoint &aStart)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
bool GetPlotValue() const
aperture used for test point pad (outer layers)
Definition: gbr_metadata.h:96
MODULE * GetParent() const
Definition: class_pad.h:107
Definition: color4d.h:48
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aMaxError=ARC_HIGH_DEF, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the pad shape to a closed polygon.
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:180
void PlotFootprintTextItem(TEXTE_MODULE *aTextMod, COLOR4D aColor)
double GetAngle() const
COLOR4D GetColor(int aLayer) const
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRect
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
a fiducial (usually a smd) local to the parent footprint
Definition: pad_shapes.h:100
int GetWidth() const
Definition: class_track.h:112
Board layer functions and definitions.
Class to handle a graphic segment.
void plotOneDrillMark(PAD_DRILL_SHAPE_T aDrillShape, const wxPoint &aDrillPos, wxSize aDrillSize, const wxSize &aPadSize, double aOrientation, int aSmallDrill)
Helper function to plot a single drill mark.
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
SHAPE_LINE_CHAIN.
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees,...
Definition: class_pad.h:313
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:507
LSET m_layerMask
Definition: pcbplot.h:68
TEXTE_PCB & Text()
wxPoint ShapePos() const
Definition: class_pad.cpp:491
int GetShape() const
aperture used for fiducial pad (outer layers), at footprint level
Definition: gbr_metadata.h:98
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
const wxPoint & GetBezControl2() const
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:91
The common library.
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: util.h:46
int GetMinThickness() const
Definition: class_zone.h:201
bool GetPlotInvisibleText() const
bool IsPolyShapeValid() const
int GetSketchPadLineWidth() const
void PlotTextePcb(TEXTE_PCB *pt_texte)
void GetLinePositions(std::vector< wxPoint > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
Definition: eda_text.cpp:418
void SetEnd(const wxPoint &aEnd)
int GetRoundRectCornerRadius() const
Definition: class_pad.cpp:163
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
const wxPoint & GetTextPos() const
Definition: eda_text.h:247
wxPoint m_crossBarO
PCB_TARGET class definition.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
COLOR_SETTINGS * ColorSettings() const
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
const wxPoint & GetBezControl1() const
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
int getFineWidthAdj()
Definition: pcbplot.h:83
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:212
PAD_SHAPE_T GetShape() const
Definition: class_pad.h:153
CONST_SEGMENT_ITERATOR CIterateSegments(int aFirst, int aLast, bool aIterateHoles=false) const
Returns an iterator object, for iterating between aFirst and aLast outline, with or without holes (de...
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:162
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
const wxSize & GetSize() const
Definition: class_pad.h:220
EDGE_MODULE class definition.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
void GetRectCorners(std::vector< wxPoint > *pts) const
BOARD_ITEM_CONTAINER * GetParent() const
void SetCopper(bool aValue)
Definition: gbr_metadata.h:202
double GetDrawRotation() const
DrillMarksType GetDrillMarksType() const
a test point pad
Definition: pad_shapes.h:101
wxPoint m_featureLineDO
print info associated to a net (TO.N attribute)
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool IsPolygonFilled() const
Polygonal shape is not always filled.
bool GetPlotReference() const
const wxPoint GetPosition() const override
Definition: class_module.h:206
DRAWINGS & Drawings()
Definition: class_board.h:275
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:126
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:192
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
DIMENSION.
TRACKS & Tracks()
Definition: class_board.h:257
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: class_zone.cpp:242
const wxPoint GetPosition() const override
#define GBR_NETINFO_ALL
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
EDA_DRAW_MODE_T GetPlotMode() const
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
void PlotDrawSegment(DRAWSEGMENT *PtSegm)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99
wxPoint m_featureLineGF
void SetWidth(int aWidth)