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-2019 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 <colors.h> // for LIGHTGRAY, WHITE
43 #include <core/typeinfo.h> // for dyn_cast, PCB_DIMENSION_T
44 #include <eda_text.h> // for FILLED, EDA_DRAW_MODE_T
45 #include <gal/color4d.h> // for COLOR4D, operator!=
46 #include <gbr_metadata.h>
47 #include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
48 #include <layers_id_colors_and_visibility.h> // for LSET, IsCopperLayer
49 #include <pad_shapes.h> // for PAD_ATTRIB_HOLE_NOT_PLATED
50 #include <pcbplot.h>
51 #include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
52 
53 #include <class_board.h>
54 #include <class_board_item.h> // for BOARD_ITEM, S_CIRCLE
55 #include <class_dimension.h>
56 #include <class_drawsegment.h>
57 #include <class_edge_mod.h>
58 #include <class_module.h>
59 #include <class_text_mod.h> // for TEXTE_MODULE
60 #include <class_track.h>
61 #include <class_pad.h> // for D_PAD
62 #include <class_pcb_target.h>
63 #include <class_pcb_text.h>
64 #include <class_zone.h>
65 
66 #include <wx/debug.h> // for wxASSERT_MSG
67 #include <wx/wx.h> // for wxPoint, wxSize, wxArra...
68 
69 
70 /* class BRDITEMS_PLOTTER is a helper class to plot board items
71  * and a group of board items
72  */
73 
75 {
76  COLOR4D color = m_colors->GetColor( aLayer );
77 
78  // A hack to avoid plotting ahite itmen in white color, expecting the paper
79  // is also white: use a non white color:
80  if( color == COLOR4D::WHITE )
81  color = COLOR4D( LIGHTGRAY );
82 
83  return color;
84 }
85 
86 
87 void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPlotMode )
88 {
89  wxPoint shape_pos = aPad->ShapePos();
90  GBR_METADATA gbr_metadata;
91 
92  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
93  bool isOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
94  bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
95 
96  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
97 
98  if( isOnCopperLayer )
99  {
100  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
101  gbr_metadata.SetCopper( true );
102 
103  if( isOnExternalCopperLayer )
104  {
105  const bool useUTF8 = false;
106  const bool useQuoting = false;
107  gbr_metadata.SetPadName( aPad->GetName(), useUTF8, useQuoting );
108 
109  if( !aPad->GetName().IsEmpty() )
110  gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
111  }
112 
113  gbr_metadata.SetNetName( aPad->GetNetname() );
114 
115  // Some pads are mechanical pads ( through hole or smd )
116  // when this is the case, they have no pad name and/or are not plated.
117  // In this case gerber files have slightly different attributes.
118  if( aPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED || aPad->GetName().IsEmpty() )
119  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
120 
121  if( !isOnExternalCopperLayer || !isPadOnBoardTechLayers )
122  {
123  // On internal layers one cannot use the GBR_NETLIST_METADATA::GBR_INFO_FLASHED_PAD
124  // attribute when the component is on an external layer (most of the case)
125  // Also, if a SMD pad is not on a tech layer (masks) use also net+cmp attribute, because
126  // it is not really a pad (can be a "pad", actually a node in a virtual component)
129 
130  if( !isPadOnBoardTechLayers )
131  // such a pad is not soldered and is not a connecting point.
132  // Just set aperture attribute as conductor
133  // If it is a through hole pad, it will be adjusted later
135 
136  switch( aPad->GetAttribute() )
137  {
138  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
140  break;
141 
142  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
144  break;
145 
146  default:
147  break;
148  }
149  }
150  else // Some attributes are reserved to the external copper layers
151  {
152  switch( aPad->GetAttribute() )
153  {
154  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
156  break;
157 
158  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
160  break;
161 
162  case PAD_ATTRIB_CONN: // Connector pads have no solder paste.
164  break;
165 
166  case PAD_ATTRIB_SMD: // SMD pads (One external copper layer only) with solder paste
168  break;
169  }
170 
171  // Fabrication properties can have specific GBR_APERTURE_METADATA options:
172  switch( aPad->GetProperty() )
173  {
174  case PAD_PROP_BGA:
176  break;
177 
180  break;
181 
184  break;
185 
186  case PAD_PROP_TESTPOINT: // Only on outer layers
188  break;
189 
190  case PAD_PROP_HEATSINK:
192  break;
193 
196  break;
197 
198  case PAD_PROP_NONE:
199  break;
200  }
201  }
202 
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  switch( aPad->GetShape() )
216  {
217  case PAD_SHAPE_CIRCLE:
218  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
219  break;
220 
221  case PAD_SHAPE_OVAL:
222  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(),
223  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
224  break;
225 
226  case PAD_SHAPE_TRAPEZOID:
227  {
228  wxPoint coord[4];
229  aPad->BuildPadPolygon( coord, wxSize(0,0), 0 );
230  m_plotter->FlashPadTrapez( shape_pos, coord,
231  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
232  }
233  break;
234 
235  case PAD_SHAPE_ROUNDRECT:
236  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
237  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
238  break;
239 
241  {
242  SHAPE_POLY_SET polygons;
243  const int corner_radius = aPad->GetRoundRectCornerRadius( aPad->GetSize() );
244  TransformRoundChamferedRectToPolygon( polygons, shape_pos, aPad->GetSize(),
245  aPad->GetOrientation(), corner_radius, aPad->GetChamferRectRatio(),
247 
248  if( polygons.OutlineCount() == 0 )
249  break;
250 
251  int min_dim = std::min( aPad->GetSize().x, aPad->GetSize().y ) /2;
252  m_plotter->FlashPadCustom( shape_pos,wxSize( min_dim, min_dim ), &polygons, aPlotMode, &gbr_metadata );
253  }
254  break;
255 
256  case PAD_SHAPE_CUSTOM:
257  {
258  SHAPE_POLY_SET polygons;
259  aPad->MergePrimitivesAsPolygon( &polygons );
260 
261  if( polygons.OutlineCount() == 0 )
262  break;
263 
264  aPad->CustomShapeAsPolygonToBoardPosition( &polygons, shape_pos, aPad->GetOrientation() );
265  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), &polygons, aPlotMode, &gbr_metadata );
266  }
267  break;
268 
269  case PAD_SHAPE_RECT:
270  default:
271  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(),
272  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
273  break;
274  }
275 }
276 
277 
279 {
280  TEXTE_MODULE* textModule = &aModule->Reference();
281  LAYER_NUM textLayer = textModule->GetLayer();
282 
283  // Reference and value are specfic items, not in graphic items list
284  if( GetPlotReference() && m_layerMask[textLayer]
285  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
286  {
287  PlotTextModule( textModule, getColor( textLayer ) );
288  }
289 
290  textModule = &aModule->Value();
291  textLayer = textModule->GetLayer();
292 
293  if( GetPlotValue() && m_layerMask[textLayer]
294  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
295  {
296  PlotTextModule( textModule, getColor( textLayer ) );
297  }
298 
299  for( auto item : aModule->GraphicalItems() )
300  {
301  textModule = dyn_cast<TEXTE_MODULE*>( item );
302 
303  if( !textModule )
304  continue;
305 
306  if( !textModule->IsVisible() )
307  continue;
308 
309  textLayer = textModule->GetLayer();
310 
311  if( textLayer >= PCB_LAYER_ID_COUNT )
312  return false;
313 
314  if( !m_layerMask[textLayer] )
315  continue;
316 
317  if( textModule->GetText() == wxT( "%R" ) && !GetPlotReference() )
318  continue;
319 
320  if( textModule->GetText() == wxT( "%V" ) && !GetPlotValue() )
321  continue;
322 
323  PlotTextModule( textModule, getColor( textLayer ) );
324  }
325 
326  return true;
327 }
328 
329 
330 // plot items like text and graphics, but not tracks and module
332 {
333  for( auto item : m_board->Drawings() )
334  {
335  switch( item->Type() )
336  {
337  case PCB_LINE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break;
338  case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break;
339  case PCB_DIMENSION_T: PlotDimension( (DIMENSION*) item ); break;
340  case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break;
341  default: break;
342  }
343  }
344 }
345 
347 {
348  wxSize size;
349  wxPoint pos;
350  double orient;
351  int thickness;
352 
353  if( aColor == COLOR4D::WHITE )
354  aColor = COLOR4D( LIGHTGRAY );
355 
356  m_plotter->SetColor( aColor );
357 
358  // calculate some text parameters :
359  size = pt_texte->GetTextSize();
360  pos = pt_texte->GetTextPos();
361 
362  orient = pt_texte->GetDrawRotation();
363 
364  thickness = pt_texte->GetThickness();
365 
366  if( pt_texte->IsMirrored() )
367  size.x = -size.x; // Text is mirrored
368 
369  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
370  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
371  // (like bold text) and we manage the thickness.
372  // So we set bold flag to true
373  bool allow_bold = pt_texte->IsBold() || thickness;
374 
375  GBR_METADATA gbr_metadata;
377  MODULE* parent = static_cast<MODULE*> ( pt_texte->GetParent() );
378  gbr_metadata.SetCmpReference( parent->GetReference() );
379 
380  m_plotter->Text( pos, aColor, pt_texte->GetShownText(), orient, size,
381  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
382  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
383 }
384 
385 
387 {
388  if( !m_layerMask[aDim->GetLayer()] )
389  return;
390 
391  DRAWSEGMENT draw;
392 
393  draw.SetWidth( aDim->GetWidth() );
394  draw.SetLayer( aDim->GetLayer() );
395 
396  COLOR4D color = m_colors->GetColor( aDim->GetLayer() );
397 
398  // Set plot color (change WHITE to LIGHTGRAY because
399  // the white items are not seen on a white paper or screen
401 
402  PlotTextePcb( &aDim->Text() );
403 
404  draw.SetStart( aDim->m_crossBarO );
405  draw.SetEnd( aDim->m_crossBarF );
406  PlotDrawSegment( &draw );
407 
408  draw.SetStart( aDim->m_featureLineGO);
409  draw.SetEnd( aDim->m_featureLineGF );
410  PlotDrawSegment( &draw );
411 
412  draw.SetStart( aDim->m_featureLineDO );
413  draw.SetEnd( aDim->m_featureLineDF );
414  PlotDrawSegment( &draw );
415 
416  draw.SetStart( aDim->m_crossBarF );
417  draw.SetEnd( aDim->m_arrowD1F );
418  PlotDrawSegment( &draw );
419 
420  draw.SetStart( aDim->m_crossBarF );
421  draw.SetEnd( aDim->m_arrowD2F );
422  PlotDrawSegment( &draw );
423 
424  draw.SetStart( aDim->m_crossBarO );
425  draw.SetEnd( aDim->m_arrowG1F );
426  PlotDrawSegment( &draw );
427 
428  draw.SetStart( aDim->m_crossBarO );
429  draw.SetEnd( aDim->m_arrowG2F );
430  PlotDrawSegment( &draw );
431 }
432 
433 
435 {
436  int dx1, dx2, dy1, dy2, radius;
437 
438  if( !m_layerMask[aMire->GetLayer()] )
439  return;
440 
441  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
442 
443  DRAWSEGMENT draw;
444 
445  draw.SetShape( S_CIRCLE );
446  draw.SetWidth( aMire->GetWidth() );
447  draw.SetLayer( aMire->GetLayer() );
448  draw.SetStart( aMire->GetPosition() );
449  radius = aMire->GetSize() / 3;
450 
451  if( aMire->GetShape() ) // shape X
452  radius = aMire->GetSize() / 2;
453 
454  // Draw the circle
455  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ));
456 
457  PlotDrawSegment( &draw );
458 
459  draw.SetShape( S_SEGMENT );
460 
461  radius = aMire->GetSize() / 2;
462  dx1 = radius;
463  dy1 = 0;
464  dx2 = 0;
465  dy2 = radius;
466 
467  if( aMire->GetShape() ) // Shape X
468  {
469  dx1 = dy1 = radius;
470  dx2 = dx1;
471  dy2 = -dy1;
472  }
473 
474  wxPoint mirePos( aMire->GetPosition() );
475 
476  // Draw the X or + shape:
477  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ));
478  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ));
479  PlotDrawSegment( &draw );
480 
481  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ));
482  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ));
483  PlotDrawSegment( &draw );
484 }
485 
486 
487 // Plot footprints graphic items (outlines)
489 {
490  for( auto module : m_board->Modules() )
491  {
492  for( auto item : module->GraphicalItems() )
493  {
494  EDGE_MODULE* edge = dyn_cast<EDGE_MODULE*>( item );
495 
496  if( edge && m_layerMask[edge->GetLayer()] )
497  Plot_1_EdgeModule( edge );
498  }
499  }
500 }
501 
502 
503 //* Plot a graphic item (outline) relative to a footprint
505 {
506  if( aEdge->Type() != PCB_MODULE_EDGE_T )
507  return;
508 
509  m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
510 
511  int thickness = aEdge->GetWidth();
512 
513  wxPoint pos( aEdge->GetStart() );
514  wxPoint end( aEdge->GetEnd() );
515 
516  GBR_METADATA gbr_metadata;
518  MODULE* parent = static_cast<MODULE*> ( aEdge->GetParent() );
519  gbr_metadata.SetCmpReference( parent->GetReference() );
520 
521  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
522 
523  if( isOnCopperLayer )
524  {
525  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
526  gbr_metadata.SetCopper( true );
527  }
528  else if( aEdge->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
529  {
530  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
531  }
532 
533  int radius; // Circle/arc radius.
534 
535  switch( aEdge->GetShape() )
536  {
537  case S_SEGMENT:
538  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
539  break;
540 
541  case S_CIRCLE:
542  radius = KiROUND( GetLineLength( end, pos ) );
543  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
544  break;
545 
546  case S_ARC:
547  {
548  radius = KiROUND( GetLineLength( end, pos ) );
549  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
550  double endAngle = startAngle + aEdge->GetAngle();
551 
552  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
553  if( std::abs( aEdge->GetAngle() ) == 3600.0 )
554  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
555  else
556  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
557  }
558  break;
559 
560  case S_POLYGON:
561  if( aEdge->IsPolyShapeValid() )
562  {
563  const std::vector<wxPoint> &polyPoints = aEdge->BuildPolyPointsList();
564 
565  // We must compute true coordinates from m_PolyList
566  // which are relative to module position, orientation 0
567  MODULE *module = aEdge->GetParentModule();
568 
569  std::vector<wxPoint> cornerList;
570 
571  cornerList.reserve( polyPoints.size() );
572 
573  for( wxPoint corner : polyPoints )
574  {
575  if( module )
576  {
577  RotatePoint( &corner, module->GetOrientation() );
578  corner += module->GetPosition();
579  }
580 
581  cornerList.push_back( corner );
582  }
583 
584  if( !aEdge->IsPolygonFilled() )
585  {
586  for( size_t i = 1; i < cornerList.size(); i++ )
587  {
588  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
589  GetPlotMode(), &gbr_metadata );
590  }
591 
592  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
593  GetPlotMode(), &gbr_metadata );
594 
595  }
596  else
597  {
598  // This must be simplified and fractured to prevent overlapping polygons
599  // from generating invalid Gerber files
600 
601  SHAPE_LINE_CHAIN line( cornerList );
602  SHAPE_POLY_SET tmpPoly;
603 
604  line.SetClosed( true );
605  tmpPoly.AddOutline( line );
607 
608  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
609  {
610  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
611  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
612  }
613  }
614  }
615  break;
616 
617  case S_CURVE:
618  m_plotter->BezierCurve( aEdge->GetStart(), aEdge->GetBezControl1(),
619  aEdge->GetBezControl2(), aEdge->GetEnd(),
620  0, thickness );
621  break;
622 
623  default:
624  wxASSERT_MSG( false, "Unhandled EDGE_MODULE shape" );
625  break;
626  }
627 }
628 
629 
630 // Plot a PCB Text, i.e. a text found on a copper or technical layer
632 {
633  double orient;
634  int thickness;
635  wxPoint pos;
636  wxSize size;
637  wxString shownText( pt_texte->GetShownText() );
638 
639  if( shownText.IsEmpty() )
640  return;
641 
642  if( !m_layerMask[pt_texte->GetLayer()] )
643  return;
644 
645  GBR_METADATA gbr_metadata;
646 
647  if( IsCopperLayer( pt_texte->GetLayer() ) )
649 
650  COLOR4D color = getColor( pt_texte->GetLayer() );
652 
653  size = pt_texte->GetTextSize();
654  pos = pt_texte->GetTextPos();
655  orient = pt_texte->GetTextAngle();
656  thickness = pt_texte->GetThickness();
657 
658  if( pt_texte->IsMirrored() )
659  size.x = -size.x;
660 
661  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
662  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
663  // (like bold text) and we manage the thickness.
664  // So we set bold flag to true
665  bool allow_bold = pt_texte->IsBold() || thickness;
666 
667  if( pt_texte->IsMultilineAllowed() )
668  {
669  std::vector<wxPoint> positions;
670  wxArrayString strings_list;
671  wxStringSplit( shownText, strings_list, '\n' );
672  positions.reserve( strings_list.Count() );
673 
674  pt_texte->GetPositionsOfLinesOfMultilineText( positions, strings_list.Count() );
675 
676  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
677  {
678  wxString& txt = strings_list.Item( ii );
679  m_plotter->Text( positions[ii], color, txt, orient, size,
680  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
681  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
682  }
683  }
684  else
685  {
686  m_plotter->Text( pos, color, shownText, orient, size,
687  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
688  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
689  }
690 }
691 
692 
694 {
695  if( polysList.IsEmpty() )
696  return;
697 
698  GBR_METADATA gbr_metadata;
699 
700  bool isOnCopperLayer = aZone->IsOnCopperLayer();
701 
702  if( isOnCopperLayer )
703  {
704  gbr_metadata.SetNetName( aZone->GetNetname() );
705  gbr_metadata.SetCopper( true );
706 
707  // Zones with no net name can exist.
708  // they are not used to connect items, so the aperture attribute cannot
709  // be set as conductor
710  if( aZone->GetNetname().IsEmpty() )
712  else
713  {
716  }
717  }
718 
719  // We need a buffer to store corners coordinates:
720  std::vector< wxPoint > cornerList;
721 
722  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
723 
724  /* Plot all filled areas: filled areas have a filled area and a thick
725  * outline (depending on the fill area option we must plot the filled area itself
726  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
727  *
728  * in non filled mode the outline is plotted, but not the filling items
729  */
730  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
731 
732  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
733  {
734  SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
735 
736  cornerList.clear();
737  cornerList.reserve( outline.PointCount() );
738 
739  for( int ic = 0; ic < outline.PointCount(); ++ic )
740  {
741  cornerList.emplace_back( wxPoint( outline.CPoint( ic ) ) );
742  }
743 
744  if( cornerList.size() ) // Plot the current filled area outline
745  {
746  // First, close the outline
747  if( cornerList[0] != cornerList[cornerList.size() - 1] )
748  cornerList.push_back( cornerList[0] );
749 
750  // Plot the current filled area and its outline
751  if( GetPlotMode() == FILLED )
752  {
753  m_plotter->PlotPoly( cornerList, FILLED_SHAPE, outline_thickness, &gbr_metadata );
754  }
755  else
756  {
757  if( outline_thickness )
758  {
759  for( unsigned jj = 1; jj < cornerList.size(); jj++ )
760  {
761  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
762  outline_thickness,
763  GetPlotMode(), &gbr_metadata );
764  }
765  }
766 
768  }
769  }
770  }
771 }
772 
773 
774 /* Plot items type DRAWSEGMENT on layers allowed by aLayerMask
775  */
777 {
778  if( !m_layerMask[aSeg->GetLayer()] )
779  return;
780 
781  int radius = 0;
782  double StAngle = 0, EndAngle = 0;
783  int thickness = aSeg->GetWidth();
784 
785  m_plotter->SetColor( getColor( aSeg->GetLayer() ) );
786 
787  wxPoint start( aSeg->GetStart() );
788  wxPoint end( aSeg->GetEnd() );
789 
790  GBR_METADATA gbr_metadata;
791 
792  if( aSeg->GetLayer() == Edge_Cuts )
794 
795  switch( aSeg->GetShape() )
796  {
797  case S_CIRCLE:
798  radius = KiROUND( GetLineLength( end, start ) );
799  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
800  break;
801 
802  case S_ARC:
803  radius = KiROUND( GetLineLength( end, start ) );
804  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
805  EndAngle = StAngle + aSeg->GetAngle();
806 
807  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
808  if( std::abs( aSeg->GetAngle() ) == 3600.0 )
809  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
810  else
811  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
812  break;
813 
814  case S_CURVE:
815  m_plotter->BezierCurve( aSeg->GetStart(), aSeg->GetBezControl1(),
816  aSeg->GetBezControl2(), aSeg->GetEnd(),
817  0, thickness );
818  break;
819 
820  case S_POLYGON:
821  {
822  if( !aSeg->IsPolygonFilled() )
823  {
824  for( auto it = aSeg->GetPolyShape().CIterateSegments( 0 ); it; it++ )
825  {
826  auto seg = it.Get();
827  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
828  thickness, GetPlotMode(), &gbr_metadata );
829  }
830  }
831  else
832  {
833  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
834  // Draw the polygon: only one polygon is expected
835  // However we provide a multi polygon shape drawing
836  // ( for the future or to show a non expected shape )
837  // This must be simplified and fractured to prevent overlapping polygons
838  // from generating invalid Gerber files
839  auto tmpPoly = SHAPE_POLY_SET( aSeg->GetPolyShape() );
841 
842  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
843  {
844  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
845  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
846  }
847  }
848  }
849  break;
850 
851  default:
852  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
853  }
854 }
855 
856 
861  wxSize aDrillSize, const wxSize &aPadSize,
862  double aOrientation, int aSmallDrill )
863 {
864  // Small drill marks have no significance when applied to slots
865  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
866  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
867 
868  // Round holes only have x diameter, slots have both
869  aDrillSize.x -= getFineWidthAdj();
870  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
871 
872  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
873  {
874  aDrillSize.y -= getFineWidthAdj();
875  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
876  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
877  }
878  else
879  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
880 }
881 
882 
884 {
885  /* If small drills marks were requested prepare a clamp value to pass
886  to the helper function */
887  int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
888  SMALL_DRILL : 0;
889 
890  /* In the filled trace mode drill marks are drawn white-on-black to scrape
891  the underlying pad. This works only for drivers supporting color change,
892  obviously... it means that:
893  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
894  - In HPGL you can't see them
895  - In gerbers you can't see them, too. This is arguably the right thing to
896  do since having drill marks and high speed drill stations is a sure
897  recipe for broken tools and angry manufacturers. If you *really* want them
898  you could start a layer with negative polarity to scrape the film.
899  - In DXF they go into the 'WHITE' layer. This could be useful.
900  */
901  if( GetPlotMode() == FILLED )
903 
904  for( auto pts : m_board->Tracks() )
905  {
906  const VIA* via = dyn_cast<const VIA*>( pts );
907 
908  if( via )
909  {
911  wxSize( via->GetDrillValue(), 0 ),
912  wxSize( via->GetWidth(), 0 ), 0, small_drill );
913  }
914  }
915 
916  for( auto Module : m_board->Modules() )
917  {
918  for( auto pad : Module->Pads() )
919  {
920  if( pad->GetDrillSize().x == 0 )
921  continue;
922 
923  plotOneDrillMark( pad->GetDrillShape(),
924  pad->GetPosition(), pad->GetDrillSize(),
925  pad->GetSize(), pad->GetOrientation(),
926  small_drill );
927  }
928  }
929 
930  if( GetPlotMode() == FILLED )
932 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:336
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:686
a class to handle special data (items attributes) during plot.
bool IsBold() const
Definition: eda_text.h:167
#define SMALL_DRILL
Definition: pcbplot.h:60
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
double GetOrientation() const
Definition: class_module.h:215
aperture used for etched components
Definition: gbr_metadata.h:83
TEXTE_MODULE & Reference()
Definition: class_module.h:477
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:184
bool IsMirrored() const
Definition: eda_text.h:173
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
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:78
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:66
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)
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:568
const wxPoint & GetStart() const
Definition: class_track.h:111
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:170
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:80
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:62
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:213
PLOTTER * m_plotter
Definition: pcbplot.h:66
void PlotDrillMarks()
Function PlotDrillMarks Draw a drill mark for pads and vias.
double GetTextAngle() const
Definition: eda_text.h:158
bool GetFilledPolysUseThickness() const
Definition: class_zone.h:617
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
bool PlotAllTextsModule(MODULE *aModule)
Smd pad, used in BGA footprints.
Definition: pad_shapes.h:79
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:512
int GetThickness() const
Return the pen width.
Definition: eda_text.h:148
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:203
aperture used for castellated pads in copper layer files
Definition: gbr_metadata.h:100
wxPoint m_featureLineDF
DRAWINGS & GraphicalItems()
Definition: class_module.h:183
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:83
const wxString & GetPinFunction() const
Definition: class_pad.h:211
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 wxString GetShownText() const override
Return the string actually shown after processing of the base text.
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:47
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:449
Definitions for tracks, vias and zones.
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:530
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:436
int GetChamferPositions() const
has meaning only for chamfered rect pads
Definition: class_pad.h:724
a pad with a castellated through hole
Definition: pad_shapes.h:84
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:232
Board plot function definition file.
wxPoint m_featureLineGO
bool IsItalic() const
Definition: eda_text.h:164
DIMENSION class definition.
const VECTOR2I & CPoint(int aIndex) const
Function Point()
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:183
#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:229
void PlotPcbTarget(PCB_TARGET *PtMire)
bool MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon=NULL)
Merge all basic shapes, converted to a polygon in one polygon, in m_customShapeAsPolygon.
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:476
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
EDA_DRAW_MODE_T
Definition: eda_text.h:59
void PlotBoardGraphicItems()
plot items like text and graphics, but not tracks and modules
COLOR4D GetColor() const
const wxSize & GetTextSize() const
Definition: eda_text.h:223
Arcs (with rounded ends)
double GetChamferRectRatio() const
has meaning only for chamfered rect pads
Definition: class_pad.h:701
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRoundRect
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:446
wxPoint m_arrowG1F
void Plot_1_EdgeModule(EDGE_MODULE *aEdge)
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:716
const wxString & GetName() const
Definition: class_pad.h:203
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:95
SHAPE_POLY_SET & GetPolyShape()
PAD_PROP_T GetProperty() const
Definition: class_pad.h:452
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:63
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:181
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
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aApproxErrorMax, int aMinSegPerCircleCount=16)
convert a rectangle with rounded corners and/or chamfered corners to a polygon Convert rounded corner...
MODULE * GetParent() const
Definition: class_pad.h:167
void BuildPadPolygon(wxPoint aCoord[4], wxSize aInflateValue, double aRotation) const
Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Co...
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
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
a fiducial (usually a smd) local to the parent footprint
Definition: pad_shapes.h:81
int GetWidth() const
Definition: class_track.h:105
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:426
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:506
void CustomShapeAsPolygonToBoardPosition(SHAPE_POLY_SET *aMergedPolygon, wxPoint aPosition, double aRotation) const
When created, the corners coordinates are relative to the pad position, orientation 0,...
LSET m_layerMask
Definition: pcbplot.h:68
TEXTE_PCB & Text()
wxPoint ShapePos() const
Definition: class_pad.cpp:570
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:61
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:45
int GetMinThickness() const
Definition: class_zone.h:204
bool GetPlotInvisibleText() const
bool IsPolyShapeValid() const
void PlotTextePcb(TEXTE_PCB *pt_texte)
Definition: colors.h:49
void SetEnd(const wxPoint &aEnd)
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:577
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
static LSET AllBoardTechMask()
Function AllTechMask returns a mask holding board technical layers (no CU layer) on both side.
Definition: lset.cpp:763
const wxPoint & GetTextPos() const
Definition: eda_text.h:232
void GetPositionsOfLinesOfMultilineText(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:384
wxPoint m_crossBarO
PCB_TARGET class definition.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
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:89
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:212
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:237
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...
Module description (excepted pads)
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:162
virtual wxString GetShownText() const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:129
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
COLOR_SETTINGS * m_colors
Pointer to color settings that should be used for plotting.
Definition: pcbplot.h:71
const wxSize & GetSize() const
Definition: class_pad.h:300
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
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadTrapez flash a trapezoidal pad
double GetDrawRotation() const
DrillMarksType GetDrillMarksType() const
a test point pad
Definition: pad_shapes.h:82
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:210
DRAWINGS & Drawings()
Definition: class_board.h:238
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:192
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
DIMENSION.
TRACKS & Tracks()
Definition: class_board.h:220
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: class_zone.cpp:219
const wxPoint GetPosition() const override
#define GBR_NETINFO_ALL
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
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:40
wxPoint m_featureLineGF
void SetWidth(int aWidth)
void PlotTextModule(TEXTE_MODULE *aTextMod, COLOR4D aColor)