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_circle.h>
35 #include <geometry/shape_line_chain.h> // for SHAPE_LINE_CHAIN
36 #include <geometry/shape_poly_set.h> // for SHAPE_POLY_SET, SHAPE_P...
37 #include <geometry/shape_segment.h>
38 #include <math/util.h> // for KiROUND, Clamp
39 #include <math/vector2d.h> // for VECTOR2I
40 #include <plotter.h>
41 #include <trigo.h>
42 
43 #include <board_design_settings.h> // for BOARD_DESIGN_SETTINGS
44 #include <core/typeinfo.h> // for dyn_cast, PCB_DIMENSION_T
45 #include <eda_text.h> // for FILLED, EDA_DRAW_MODE_T
46 #include <gal/color4d.h> // for COLOR4D, operator!=
47 #include <gbr_metadata.h>
48 #include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
49 #include <layers_id_colors_and_visibility.h> // for LSET, IsCopperLayer
50 #include <pad_shapes.h> // for PAD_ATTRIB_HOLE_NOT_PLATED
51 #include <pcbplot.h>
52 #include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
53 
54 #include <class_board.h>
55 #include <class_board_item.h> // for BOARD_ITEM, S_CIRCLE
56 #include <class_dimension.h>
57 #include <class_drawsegment.h>
58 #include <class_edge_mod.h>
59 #include <class_module.h>
60 #include <class_text_mod.h> // for TEXTE_MODULE
61 #include <class_track.h>
62 #include <class_pad.h> // for D_PAD
63 #include <class_pcb_target.h>
64 #include <class_pcb_text.h>
65 #include <class_zone.h>
66 
67 #include <wx/debug.h> // for wxASSERT_MSG
68 #include <wx/wx.h> // for wxPoint, wxSize, wxArra...
69 
70 
71 /* class BRDITEMS_PLOTTER is a helper class to plot board items
72  * and a group of board items
73  */
74 
76 {
77  COLOR4D color = ColorSettings()->GetColor( aLayer );
78 
79  // A hack to avoid plotting a white item in white color, expecting the paper
80  // is also white: use a non white color:
81  if( color == COLOR4D::WHITE )
82  color = COLOR4D( LIGHTGRAY );
83 
84  return color;
85 }
86 
87 
88 void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPlotMode )
89 {
90  wxPoint shape_pos = aPad->ShapePos();
91  GBR_METADATA gbr_metadata;
92 
93  bool plotOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
94  bool plotOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
95 
96  // Pad not on the solder mask layer cannot be soldered.
97  // therefore it can have a specific aperture attribute.
98  // Not yet in use.
99  // bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
100 
101  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
102 
103  if( plotOnCopperLayer )
104  {
105  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
106  gbr_metadata.SetCopper( true );
107  // Gives a default attribute, for instance for pads used as tracks in net ties:
108  // Connector pads and SMD pads are on external layers
109  // if on internal layers, they are certainly used as net tie
110  // and are similar to tracks: just conductor items
112 
113  const bool useUTF8 = false;
114  const bool useQuoting = false;
115  gbr_metadata.SetPadName( aPad->GetName(), useUTF8, useQuoting );
116 
117  if( !aPad->GetName().IsEmpty() )
118  gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
119 
120  gbr_metadata.SetNetName( aPad->GetNetname() );
121 
122  // Some pads are mechanical pads ( through hole or smd )
123  // when this is the case, they have no pad name and/or are not plated.
124  // In this case gerber files have slightly different attributes.
125  if( aPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED || aPad->GetName().IsEmpty() )
126  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
127 
128  if( !plotOnExternalCopperLayer )
129  {
130  // the .P object attribute (GBR_NETLIST_METADATA::GBR_NETINFO_PAD)
131  // is used on outer layers, unless the component is embedded
132  // or a "etched" component (fp only drawn, not a physical component)
133  // Currently, Pcbnew does not handle embedded component, so we disable the .P
134  // attribute on internal layers
135  // Note the Gerber doc is not really clear about through holes pads about the .P
138 
139  }
140 
141  // Some attributes are reserved to the external copper layers:
142  // GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF
143  // for instance.
144  // Pad with type PAD_ATTRIB_CONN or PAD_ATTRIB_SMD that is not on outer layer
145  // has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR
146  switch( aPad->GetAttribute() )
147  {
148  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
150  break;
151 
152  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
154  break;
155 
156  case PAD_ATTRIB_CONN: // Connector pads, no solder paste but with solder mask.
157  if( plotOnExternalCopperLayer )
159  break;
160 
161  case PAD_ATTRIB_SMD: // SMD pads (on external copper layer only)
162  // with solder paste and mask
163  if( plotOnExternalCopperLayer )
165  break;
166  }
167 
168  // Fabrication properties can have specific GBR_APERTURE_METADATA options
169  // that replace previous aperture attribute:
170  switch( aPad->GetProperty() )
171  {
172  case PAD_PROP_BGA: // Only applicable to outer layers
173  if( plotOnExternalCopperLayer )
175  break;
176 
179  break;
180 
183  break;
184 
185  case PAD_PROP_TESTPOINT: // Only applicable to outer layers
186  if( plotOnExternalCopperLayer )
188  break;
189 
190  case PAD_PROP_HEATSINK:
192  break;
193 
196  break;
197 
198  case PAD_PROP_NONE:
199  break;
200  }
201 
202  // Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
205  }
206  else
207  {
209  }
210 
211  // Set plot color (change WHITE to LIGHTGRAY because
212  // the white items are not seen on a white paper or screen
213  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
214 
215  if( aPlotMode == SKETCH )
217 
218  switch( aPad->GetShape() )
219  {
220  case PAD_SHAPE_CIRCLE:
221  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
222  break;
223 
224  case PAD_SHAPE_OVAL:
225  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(),
226  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
227  break;
228 
229  case PAD_SHAPE_RECT:
230  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
231  &gbr_metadata );
232  break;
233 
234  case PAD_SHAPE_ROUNDRECT:
235  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
236  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
237  break;
238 
239  default:
240  case PAD_SHAPE_TRAPEZOID:
242  case PAD_SHAPE_CUSTOM:
243  {
244  const std::shared_ptr<SHAPE_POLY_SET>& polygons = aPad->GetEffectivePolygon();
245 
246  if( polygons->OutlineCount() )
247  {
248  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), polygons.get(), aPlotMode,
249  &gbr_metadata );
250  }
251  }
252  break;
253  }
254 }
255 
256 
258 {
259  TEXTE_MODULE* textModule = &aModule->Reference();
260  LAYER_NUM textLayer = textModule->GetLayer();
261 
262  // Reference and value are specfic items, not in graphic items list
263  if( GetPlotReference() && m_layerMask[textLayer]
264  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
265  {
266  PlotFootprintTextItem( textModule, getColor( textLayer ));
267  }
268 
269  textModule = &aModule->Value();
270  textLayer = textModule->GetLayer();
271 
272  if( GetPlotValue() && m_layerMask[textLayer]
273  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
274  {
275  PlotFootprintTextItem( textModule, getColor( textLayer ));
276  }
277 
278  for( auto item : aModule->GraphicalItems() )
279  {
280  textModule = dyn_cast<TEXTE_MODULE*>( item );
281 
282  if( !textModule )
283  continue;
284 
285  if( !textModule->IsVisible() )
286  continue;
287 
288  textLayer = textModule->GetLayer();
289 
290  if( textLayer >= PCB_LAYER_ID_COUNT )
291  return;
292 
293  if( !m_layerMask[textLayer] )
294  continue;
295 
296  if( textModule->GetText() == wxT( "${REFERENCE}" ) && !GetPlotReference() )
297  continue;
298 
299  if( textModule->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() )
300  continue;
301 
302  PlotFootprintTextItem( textModule, getColor( textLayer ));
303  }
304 }
305 
306 
307 // plot items like text and graphics, but not tracks and module
309 {
310  for( auto item : m_board->Drawings() )
311  {
312  switch( item->Type() )
313  {
314  case PCB_LINE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break;
315  case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break;
316 
317  case PCB_DIM_ALIGNED_T:
318  case PCB_DIM_CENTER_T:
320  case PCB_DIM_LEADER_T:
321  PlotDimension( (DIMENSION*) item );
322  break;
323 
324  case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break;
325  default: break;
326  }
327  }
328 }
329 
331 {
332  if( aColor == COLOR4D::WHITE )
333  aColor = COLOR4D( LIGHTGRAY );
334 
335  m_plotter->SetColor( aColor );
336 
337  // calculate some text parameters :
338  wxSize size = aTextMod->GetTextSize();
339  wxPoint pos = aTextMod->GetTextPos();
340  double orient = aTextMod->GetDrawRotation();
341  int thickness = aTextMod->GetEffectiveTextPenWidth();
342 
343  if( aTextMod->IsMirrored() )
344  size.x = -size.x; // Text is mirrored
345 
346  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
347  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
348  // (like bold text) and we manage the thickness.
349  // So we set bold flag to true
350  bool allow_bold = true;
351 
352  GBR_METADATA gbr_metadata;
354  MODULE* parent = static_cast<MODULE*> ( aTextMod->GetParent() );
355  gbr_metadata.SetCmpReference( parent->GetReference() );
356 
357  m_plotter->SetCurrentLineWidth( thickness );
358 
359  m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size,
360  aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), thickness,
361  aTextMod->IsItalic(), allow_bold, false, &gbr_metadata );
362 }
363 
364 
366 {
367  if( !m_layerMask[aDim->GetLayer()] )
368  return;
369 
370  DRAWSEGMENT draw;
371 
372  draw.SetWidth( aDim->GetLineThickness() );
373  draw.SetLayer( aDim->GetLayer() );
374 
375  COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
376 
377  // Set plot color (change WHITE to LIGHTGRAY because
378  // the white items are not seen on a white paper or screen
380 
381  PlotTextePcb( &aDim->Text() );
382 
383  for( const std::shared_ptr<SHAPE>& shape : aDim->GetShapes() )
384  {
385  switch( shape->Type() )
386  {
387  case SH_SEGMENT:
388  {
389  const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
390 
391  draw.SetShape( S_SEGMENT );
392  draw.SetStart( wxPoint( seg.A ) );
393  draw.SetEnd( wxPoint( seg.B ) );
394 
395  PlotDrawSegment( &draw );
396  break;
397  }
398 
399  case SH_CIRCLE:
400  {
401  wxPoint start( shape->Centre() );
402  int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
403 
404  draw.SetShape( S_CIRCLE );
405  draw.SetStart( start );
406  draw.SetEnd( wxPoint( start.x + radius, start.y ) );
407 
408  PlotDrawSegment( &draw );
409  break;
410  }
411 
412  default:
413  break;
414  }
415  }
416 }
417 
418 
420 {
421  int dx1, dx2, dy1, dy2, radius;
422 
423  if( !m_layerMask[aMire->GetLayer()] )
424  return;
425 
426  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
427 
428  DRAWSEGMENT draw;
429 
430  draw.SetShape( S_CIRCLE );
431  draw.SetWidth( aMire->GetWidth() );
432  draw.SetLayer( aMire->GetLayer() );
433  draw.SetStart( aMire->GetPosition() );
434  radius = aMire->GetSize() / 3;
435 
436  if( aMire->GetShape() ) // shape X
437  radius = aMire->GetSize() / 2;
438 
439  // Draw the circle
440  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ));
441 
442  PlotDrawSegment( &draw );
443 
444  draw.SetShape( S_SEGMENT );
445 
446  radius = aMire->GetSize() / 2;
447  dx1 = radius;
448  dy1 = 0;
449  dx2 = 0;
450  dy2 = radius;
451 
452  if( aMire->GetShape() ) // Shape X
453  {
454  dx1 = dy1 = radius;
455  dx2 = dx1;
456  dy2 = -dy1;
457  }
458 
459  wxPoint mirePos( aMire->GetPosition() );
460 
461  // Draw the X or + shape:
462  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ));
463  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ));
464  PlotDrawSegment( &draw );
465 
466  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ));
467  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ));
468  PlotDrawSegment( &draw );
469 }
470 
471 
472 // Plot footprints graphic items (outlines)
474 {
475  for( BOARD_ITEM* item : aModule->GraphicalItems() )
476  {
477  EDGE_MODULE* edge = dynamic_cast<EDGE_MODULE*>( item );
478 
479  if( edge && m_layerMask[ edge->GetLayer() ] )
480  PlotFootprintGraphicItem( edge );
481  }
482 }
483 
484 
485 //* Plot a graphic item (outline) relative to a footprint
487 {
488  if( aEdge->Type() != PCB_MODULE_EDGE_T )
489  return;
490 
491  m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
492 
493  int thickness = aEdge->GetWidth();
494  wxPoint pos( aEdge->GetStart() );
495  wxPoint end( aEdge->GetEnd() );
496 
497  GBR_METADATA gbr_metadata;
499  MODULE* parent = static_cast<MODULE*> ( aEdge->GetParent() );
500  gbr_metadata.SetCmpReference( parent->GetReference() );
501 
502  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
503 
504  if( isOnCopperLayer )
505  {
506  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
507  gbr_metadata.SetCopper( true );
508  }
509  else if( aEdge->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
510  {
511  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
512  }
513 
514  int radius; // Circle/arc radius.
515 
516  switch( aEdge->GetShape() )
517  {
518  case S_SEGMENT:
519  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
520  break;
521 
522  case S_RECT:
523  {
524  std::vector<wxPoint> pts = aEdge->GetRectCorners();
525 
526  if( aEdge->GetWidth() > 0 )
527  {
528  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
529  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
530  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
531  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
532  }
533  else
534  {
535  SHAPE_LINE_CHAIN poly;
536 
537  for( const wxPoint& pt : pts )
538  poly.Append( pt );
539 
540  m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata );
541  }
542  }
543  break;
544 
545  case S_CIRCLE:
546  radius = KiROUND( GetLineLength( end, pos ) );
547 
548  if( aEdge->GetWidth() > 0 )
549  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
550  else
551  m_plotter->Circle( pos, radius * 2, FILLED_SHAPE, -1 );
552 
553  break;
554 
555  case S_ARC:
556  {
557  radius = KiROUND( GetLineLength( end, pos ) );
558  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
559  double endAngle = startAngle + aEdge->GetAngle();
560 
561  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
562  if( std::abs( aEdge->GetAngle() ) == 3600.0 )
563  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
564  else
565  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
566  }
567  break;
568 
569  case S_POLYGON:
570  if( aEdge->IsPolyShapeValid() )
571  {
572  const std::vector<wxPoint> &polyPoints = aEdge->BuildPolyPointsList();
573 
574  // We must compute true coordinates from m_PolyList
575  // which are relative to module position, orientation 0
576  MODULE *module = aEdge->GetParentModule();
577 
578  std::vector<wxPoint> cornerList;
579 
580  cornerList.reserve( polyPoints.size() );
581 
582  for( wxPoint corner : polyPoints )
583  {
584  if( module )
585  {
586  RotatePoint( &corner, module->GetOrientation() );
587  corner += module->GetPosition();
588  }
589 
590  cornerList.push_back( corner );
591  }
592 
593  if( !aEdge->IsPolygonFilled() )
594  {
595  for( size_t i = 1; i < cornerList.size(); i++ )
596  {
597  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
598  GetPlotMode(), &gbr_metadata );
599  }
600 
601  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
602  GetPlotMode(), &gbr_metadata );
603 
604  }
605  else
606  {
607  // This must be simplified and fractured to prevent overlapping polygons
608  // from generating invalid Gerber files
609 
610  SHAPE_LINE_CHAIN line( cornerList );
611  SHAPE_POLY_SET tmpPoly;
612 
613  line.SetClosed( true );
614  tmpPoly.AddOutline( line );
616 
617  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
618  {
619  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
620  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
621  }
622  }
623  }
624  break;
625 
626  case S_CURVE:
627  m_plotter->BezierCurve( aEdge->GetStart(), aEdge->GetBezControl1(),
628  aEdge->GetBezControl2(), aEdge->GetEnd(),
629  0, thickness );
630  break;
631 
632  default:
633  wxASSERT_MSG( false, "Unhandled EDGE_MODULE shape" );
634  break;
635  }
636 }
637 
638 
639 // Plot a PCB Text, i.e. a text found on a copper or technical layer
641 {
642  wxString shownText( pt_texte->GetShownText() );
643 
644  if( shownText.IsEmpty() )
645  return;
646 
647  if( !m_layerMask[pt_texte->GetLayer()] )
648  return;
649 
650  GBR_METADATA gbr_metadata;
651 
652  if( IsCopperLayer( pt_texte->GetLayer() ) )
654 
655  COLOR4D color = getColor( pt_texte->GetLayer() );
657 
658  wxSize size = pt_texte->GetTextSize();
659  wxPoint pos = pt_texte->GetTextPos();
660  double orient = pt_texte->GetTextAngle();
661  int thickness = pt_texte->GetEffectiveTextPenWidth();
662 
663  if( pt_texte->IsMirrored() )
664  size.x = -size.x;
665 
666  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
667  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
668  // (like bold text) and we manage the thickness.
669  // So we set bold flag to true
670  bool allow_bold = true;
671 
672  m_plotter->SetCurrentLineWidth( thickness );
673 
674  if( pt_texte->IsMultilineAllowed() )
675  {
676  std::vector<wxPoint> positions;
677  wxArrayString strings_list;
678  wxStringSplit( shownText, strings_list, '\n' );
679  positions.reserve( strings_list.Count() );
680 
681  pt_texte->GetLinePositions( positions, strings_list.Count());
682 
683  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
684  {
685  wxString& txt = strings_list.Item( ii );
686  m_plotter->Text( positions[ii], color, txt, orient, size, pt_texte->GetHorizJustify(),
687  pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(),
688  allow_bold, false, &gbr_metadata );
689  }
690  }
691  else
692  {
693  m_plotter->Text( pos, color, shownText, orient, size, pt_texte->GetHorizJustify(),
694  pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(), allow_bold,
695  false, &gbr_metadata );
696  }
697 }
698 
699 
701 {
702  if( polysList.IsEmpty() )
703  return;
704 
705  GBR_METADATA gbr_metadata;
706 
707  bool isOnCopperLayer = aZone->IsOnCopperLayer();
708 
709  if( isOnCopperLayer )
710  {
711  gbr_metadata.SetNetName( aZone->GetNetname() );
712  gbr_metadata.SetCopper( true );
713 
714  // Zones with no net name can exist.
715  // they are not used to connect items, so the aperture attribute cannot
716  // be set as conductor
717  if( aZone->GetNetname().IsEmpty() )
719  else
720  {
723  }
724  }
725 
726  // We need a buffer to store corners coordinates:
727  std::vector< wxPoint > cornerList;
728 
729  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
730 
731  m_plotter->StartBlock( nullptr ); // Clean current object attributes
732 
733  /* Plot all filled areas: filled areas have a filled area and a thick
734  * outline (depending on the fill area option we must plot the filled area itself
735  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
736  *
737  * in non filled mode the outline is plotted, but not the filling items
738  */
739  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
740 
741  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
742  {
743  SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
744 
745  cornerList.clear();
746  cornerList.reserve( outline.PointCount() );
747 
748  for( int ic = 0; ic < outline.PointCount(); ++ic )
749  {
750  cornerList.emplace_back( wxPoint( outline.CPoint( ic ) ) );
751  }
752 
753  if( cornerList.size() ) // Plot the current filled area outline
754  {
755  // First, close the outline
756  if( cornerList[0] != cornerList[cornerList.size() - 1] )
757  cornerList.push_back( cornerList[0] );
758 
759  // Plot the current filled area (as region for Gerber plotter
760  // to manage attributes) and its outline for thick outline
761  if( GetPlotMode() == FILLED )
762  {
764  {
765  if( outline_thickness > 0 )
766  m_plotter->PlotPoly( cornerList, NO_FILL,
767  outline_thickness, &gbr_metadata );
768 
769  static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion(
770  cornerList, &gbr_metadata );
771  }
772  else
773  m_plotter->PlotPoly( cornerList, FILLED_SHAPE,
774  outline_thickness, &gbr_metadata );
775  }
776  else
777  {
778  if( outline_thickness )
779  {
780  for( unsigned jj = 1; jj < cornerList.size(); jj++ )
781  {
782  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
783  outline_thickness,
784  GetPlotMode(), &gbr_metadata );
785  }
786  }
787 
789  }
790  }
791  }
792 
793  m_plotter->EndBlock( nullptr ); // Clear object attributes
794 }
795 
796 
797 /* Plot items type DRAWSEGMENT on layers allowed by aLayerMask
798  */
800 {
801  if( !m_layerMask[aSeg->GetLayer()] )
802  return;
803 
804  int radius = 0;
805  double StAngle = 0, EndAngle = 0;
806  int thickness = aSeg->GetWidth();
807 
808  m_plotter->SetColor( getColor( aSeg->GetLayer() ) );
809 
810  wxPoint start( aSeg->GetStart() );
811  wxPoint end( aSeg->GetEnd() );
812 
813  GBR_METADATA gbr_metadata;
814 
815  if( aSeg->GetLayer() == Edge_Cuts )
817 
818  if( IsCopperLayer( aSeg->GetLayer() ) )
819  // Graphic items (DRAWSEGMENT, TEXT) having no net have the NonConductor attribute
820  // Graphic items having a net have the Conductor attribute, but are not (yet?)
821  // supported in Pcbnew
822  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
823 
824  switch( aSeg->GetShape() )
825  {
826  case S_SEGMENT:
827  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
828  break;
829 
830  case S_CIRCLE:
831  radius = KiROUND( GetLineLength( end, start ) );
832  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
833  break;
834 
835  case S_ARC:
836  radius = KiROUND( GetLineLength( end, start ) );
837  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
838  EndAngle = StAngle + aSeg->GetAngle();
839 
840  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
841  if( std::abs( aSeg->GetAngle() ) == 3600.0 )
842  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
843  else
844  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
845  break;
846 
847  case S_CURVE:
848  m_plotter->BezierCurve( aSeg->GetStart(), aSeg->GetBezControl1(), aSeg->GetBezControl2(),
849  aSeg->GetEnd(), 0, thickness );
850  break;
851 
852  case S_POLYGON:
853  {
854  if( !aSeg->IsPolygonFilled() )
855  {
856  for( auto it = aSeg->GetPolyShape().CIterateSegments( 0 ); it; it++ )
857  {
858  auto seg = it.Get();
859  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
860  thickness, GetPlotMode(), &gbr_metadata );
861  }
862  }
863  else
864  {
865  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
866  // Draw the polygon: only one polygon is expected
867  // However we provide a multi polygon shape drawing
868  // ( for the future or to show a non expected shape )
869  // This must be simplified and fractured to prevent overlapping polygons
870  // from generating invalid Gerber files
871  auto tmpPoly = SHAPE_POLY_SET( aSeg->GetPolyShape() );
873 
874  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
875  {
876  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
877  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
878  }
879  }
880  }
881  break;
882 
883  case S_RECT:
884  {
885  std::vector<wxPoint> pts = aSeg->GetRectCorners();
886 
887  if( aSeg->GetWidth() > 0 )
888  {
889  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
890  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
891  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
892  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
893  }
894  else
895  {
896  SHAPE_LINE_CHAIN poly;
897 
898  for( const wxPoint& pt : pts )
899  poly.Append( pt );
900 
901  m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata );
902  }
903  }
904  break;
905 
906  default:
907  wxASSERT_MSG( false, "Unhandled DRAWSEGMENT shape" );
908  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
909  }
910 }
911 
912 
917  wxSize aDrillSize, const wxSize &aPadSize,
918  double aOrientation, int aSmallDrill )
919 {
920  // Small drill marks have no significance when applied to slots
921  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
922  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
923 
924  // Round holes only have x diameter, slots have both
925  aDrillSize.x -= getFineWidthAdj();
926  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
927 
928  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
929  {
930  aDrillSize.y -= getFineWidthAdj();
931  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
932  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
933  }
934  else
935  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
936 }
937 
938 
940 {
941  /* If small drills marks were requested prepare a clamp value to pass
942  to the helper function */
943  int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
944  SMALL_DRILL : 0;
945 
946  /* In the filled trace mode drill marks are drawn white-on-black to scrape
947  the underlying pad. This works only for drivers supporting color change,
948  obviously... it means that:
949  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
950  - In HPGL you can't see them
951  - In gerbers you can't see them, too. This is arguably the right thing to
952  do since having drill marks and high speed drill stations is a sure
953  recipe for broken tools and angry manufacturers. If you *really* want them
954  you could start a layer with negative polarity to scrape the film.
955  - In DXF they go into the 'WHITE' layer. This could be useful.
956  */
957  if( GetPlotMode() == FILLED )
959 
960  for( auto pts : m_board->Tracks() )
961  {
962  const VIA* via = dyn_cast<const VIA*>( pts );
963 
964  if( via )
965  {
967  wxSize( via->GetDrillValue(), 0 ),
968  wxSize( via->GetWidth(), 0 ), 0, small_drill );
969  }
970  }
971 
972  for( auto Module : m_board->Modules() )
973  {
974  for( auto pad : Module->Pads() )
975  {
976  if( pad->GetDrillSize().x == 0 )
977  continue;
978 
979  plotOneDrillMark( pad->GetDrillShape(),
980  pad->GetPosition(), pad->GetDrillSize(),
981  pad->GetSize(), pad->GetOrientation(),
982  small_drill );
983  }
984  }
985 
986  if( GetPlotMode() == FILLED )
988 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:343
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:719
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:217
aperture used for etched components
Definition: gbr_metadata.h:83
TEXTE_MODULE & Reference()
Definition: class_module.h:485
class ALIGNED_DIMENSION, a linear dimension (graphic item)
Definition: typeinfo.h:101
void SetShape(STROKE_T aShape)
class LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:102
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:200
bool IsMirrored() const
Definition: eda_text.h:189
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:211
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.
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,...
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:116
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:186
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:103
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:214
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:174
bool GetFilledPolysUseThickness() const
Definition: class_zone.h:675
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
wxString GetNetname() const
Function GetNetname.
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
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon(PCB_LAYER_ID=UNDEFINED_LAYER) const
Definition: class_pad.cpp:255
DRAWINGS & GraphicalItems()
Definition: class_module.h:184
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:138
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
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
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:334
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:157
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:444
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.
bool IsItalic() const
Definition: eda_text.h:180
wxPoint GetPosition() const override
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:199
#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:249
void PlotPcbTarget(PCB_TARGET *PtMire)
std::vector< wxPoint > GetRectCorners() const
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:484
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
EDA_DRAW_MODE_T
Definition: eda_text.h:63
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:239
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
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
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:749
const wxString & GetName() const
Definition: class_pad.h:132
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:95
SHAPE_POLY_SET & GetPolyShape()
PAD_PROP_T GetProperty() const
Definition: class_pad.h:337
Bezier Curve.
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
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:197
line chain (polyline)
Definition: shape.h:45
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:105
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:111
Definition: color4d.h:48
Definition: seg.h:39
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
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:110
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 a variety of units (the basic call r...
Definition: class_pad.h:321
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()
VECTOR2I A
Definition: seg.h:47
wxPoint ShapePos() const
Definition: class_pad.cpp:595
int GetLineThickness() const
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:217
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:423
void SetEnd(const wxPoint &aEnd)
int GetRoundRectCornerRadius() const
Definition: class_pad.cpp:224
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
const wxPoint & GetTextPos() const
Definition: eda_text.h:248
PCB_TARGET class definition.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
COLOR_SETTINGS * ColorSettings() const
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
Definition: typeinfo.h:104
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
wxPoint GetPosition() const override
Definition: class_module.h:212
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:157
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:224
EDGE_MODULE class definition.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
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
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
DRAWINGS & Drawings()
Definition: class_board.h:252
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:192
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
Abstract dimension API.
TRACKS & Tracks()
Definition: class_board.h:246
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:220
#define GBR_NETINFO_ALL
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
axis-aligned rectangle
Definition: shape.h:43
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
VECTOR2I B
Definition: seg.h:48
void SetWidth(int aWidth)