KiCad PCB EDA Suite
BRDITEMS_PLOTTER Class Reference

#include <pcbplot.h>

Inheritance diagram for BRDITEMS_PLOTTER:
PCB_PLOT_PARAMS

Public Types

enum  DrillMarksType { NO_DRILL_SHAPE = 0, SMALL_DRILL_SHAPE = 1, FULL_DRILL_SHAPE = 2 }
 

Public Member Functions

 BRDITEMS_PLOTTER (PLOTTER *aPlotter, BOARD *aBoard, const PCB_PLOT_PARAMS &aPlotOpts)
 
int getFineWidthAdj ()
 
void SetLayerSet (LSET aLayerMask)
 
void PlotFootprintGraphicItems (FOOTPRINT *aFootprint)
 
void PlotFootprintGraphicItem (FP_SHAPE *aShape)
 
void PlotFootprintTextItem (FP_TEXT *aText, COLOR4D aColor)
 
void PlotFootprintTextItems (FOOTPRINT *aFootprint)
 
void PlotDimension (DIMENSION_BASE *Dimension)
 
void PlotPcbTarget (PCB_TARGET *PtMire)
 
void PlotFilledAreas (ZONE *aZone, SHAPE_POLY_SET &aPolysList)
 
void PlotPcbText (PCB_TEXT *aText)
 
void PlotPcbShape (PCB_SHAPE *aShape)
 
void PlotPad (PAD *aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode)
 Plot a pad. More...
 
void PlotBoardGraphicItems ()
 plot items like text and graphics, but not tracks and footprints More...
 
void PlotDrillMarks ()
 Function PlotDrillMarks Draw a drill mark for pads and vias. More...
 
COLOR4D getColor (LAYER_NUM aLayer)
 Function getColor. More...
 
void SetSkipPlotNPTH_Pads (bool aSkip)
 
bool GetSkipPlotNPTH_Pads () const
 
void Format (OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
 
void Parse (PCB_PLOT_PARAMS_PARSER *aParser)
 
bool IsSameAs (const PCB_PLOT_PARAMS &aPcbPlotParams) const
 Compare current settings to aPcbPlotParams, including not saved parameters in brd file. More...
 
void SetColorSettings (COLOR_SETTINGS *aSettings)
 
COLOR_SETTINGSColorSettings () const
 
void SetTextMode (PLOT_TEXT_MODE aVal)
 
PLOT_TEXT_MODE GetTextMode () const
 
void SetPlotMode (OUTLINE_MODE aPlotMode)
 
OUTLINE_MODE GetPlotMode () const
 
void SetDXFPlotPolygonMode (bool aFlag)
 
bool GetDXFPlotPolygonMode () const
 
void SetDXFPlotUnits (DXF_UNITS aUnit)
 
DXF_UNITS GetDXFPlotUnits () const
 
void SetDrillMarksType (DrillMarksType aVal)
 
DrillMarksType GetDrillMarksType () const
 
void SetScale (double aVal)
 
double GetScale () const
 
void SetFineScaleAdjustX (double aVal)
 
double GetFineScaleAdjustX () const
 
void SetFineScaleAdjustY (double aVal)
 
double GetFineScaleAdjustY () const
 
void SetWidthAdjust (int aVal)
 
int GetWidthAdjust () const
 
void SetAutoScale (bool aFlag)
 
bool GetAutoScale () const
 
void SetMirror (bool aFlag)
 
bool GetMirror () const
 
void SetSketchPadsOnFabLayers (bool aFlag)
 
bool GetSketchPadsOnFabLayers () const
 
void SetSketchPadLineWidth (int aWidth)
 
int GetSketchPadLineWidth () const
 
void SetPlotInvisibleText (bool aFlag)
 
bool GetPlotInvisibleText () const
 
void SetPlotValue (bool aFlag)
 
bool GetPlotValue () const
 
void SetPlotReference (bool aFlag)
 
bool GetPlotReference () const
 
void SetNegative (bool aFlag)
 
bool GetNegative () const
 
void SetPlotViaOnMaskLayer (bool aFlag)
 
bool GetPlotViaOnMaskLayer () const
 
void SetPlotFrameRef (bool aFlag)
 
bool GetPlotFrameRef () const
 
void SetExcludeEdgeLayer (bool aFlag)
 
bool GetExcludeEdgeLayer () const
 
void SetFormat (PLOT_FORMAT aFormat)
 
PLOT_FORMAT GetFormat () const
 
void SetOutputDirectory (wxString aDir)
 
wxString GetOutputDirectory () const
 
void SetDisableGerberMacros (bool aDisable)
 
bool GetDisableGerberMacros () const
 
void SetUseGerberX2format (bool aUse)
 
bool GetUseGerberX2format () const
 
void SetIncludeGerberNetlistInfo (bool aUse)
 
bool GetIncludeGerberNetlistInfo () const
 
void SetCreateGerberJobFile (bool aCreate)
 
bool GetCreateGerberJobFile () const
 
void SetUseGerberProtelExtensions (bool aUse)
 
bool GetUseGerberProtelExtensions () const
 
void SetGerberPrecision (int aPrecision)
 
int GetGerberPrecision () const
 
void SetSvgPrecision (unsigned aPrecision, bool aUseInch)
 
unsigned GetSvgPrecision () const
 
bool GetSvgUseInch () const
 
void SetSubtractMaskFromSilk (bool aSubtract)
 
bool GetSubtractMaskFromSilk () const
 
void SetLayerSelection (LSET aSelection)
 
LSET GetLayerSelection () const
 
void SetUseAuxOrigin (bool aAux)
 
bool GetUseAuxOrigin () const
 
void SetScaleSelection (int aSelection)
 
int GetScaleSelection () const
 
void SetA4Output (int aForce)
 
bool GetA4Output () const
 
double GetHPGLPenDiameter () const
 
bool SetHPGLPenDiameter (double aValue)
 
int GetHPGLPenSpeed () const
 
bool SetHPGLPenSpeed (int aValue)
 
void SetHPGLPenNum (int aVal)
 
int GetHPGLPenNum () const
 

Static Public Member Functions

static int GetGerberDefaultPrecision ()
 Default precision of coordinates in Gerber files. More...
 

Private Member Functions

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. More...
 

Private Attributes

PLOTTERm_plotter
 
BOARDm_board
 
LSET m_layerMask
 

Detailed Description

Definition at line 62 of file pcbplot.h.

Member Enumeration Documentation

◆ DrillMarksType

Enumerator
NO_DRILL_SHAPE 
SMALL_DRILL_SHAPE 
FULL_DRILL_SHAPE 

Definition at line 41 of file pcb_plot_params.h.

Constructor & Destructor Documentation

◆ BRDITEMS_PLOTTER()

BRDITEMS_PLOTTER::BRDITEMS_PLOTTER ( PLOTTER aPlotter,
BOARD aBoard,
const PCB_PLOT_PARAMS aPlotOpts 
)
inline

Definition at line 69 of file pcbplot.h.

70  : PCB_PLOT_PARAMS( aPlotOpts )
71  {
72  m_plotter = aPlotter;
73  m_board = aBoard;
74  }
PLOTTER * m_plotter
Definition: pcbplot.h:64
BOARD * m_board
Definition: pcbplot.h:65

References m_board, and m_plotter.

Member Function Documentation

◆ ColorSettings()

COLOR_SETTINGS* PCB_PLOT_PARAMS::ColorSettings ( ) const
inlineinherited

Definition at line 209 of file pcb_plot_params.h.

209 { return m_colors; }
COLOR_SETTINGS * m_colors
Pointer to active color settings to be used for plotting.

References PCB_PLOT_PARAMS::m_colors.

Referenced by getColor(), PlotDimension(), PlotStandardLayer(), and StartPlotBoard().

◆ Format()

void PCB_PLOT_PARAMS::Format ( OUTPUTFORMATTER aFormatter,
int  aNestLevel,
int  aControl = 0 
) const
inherited

Definition at line 162 of file pcb_plot_params.cpp.

164 {
165  const char* falseStr = getTokenName( T_false );
166  const char* trueStr = getTokenName( T_true );
167 
168  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
169 
170  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
171  m_layerSelection.FmtHex().c_str() );
172 
173  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_disableapertmacros ),
174  m_gerberDisableApertMacros ? trueStr : falseStr );
175 
176  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
177  m_useGerberProtelExtensions ? trueStr : falseStr );
178 
179  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ),
180  GetUseGerberX2format() ? trueStr : falseStr );
181 
182  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ),
183  GetIncludeGerberNetlistInfo() ? trueStr : falseStr );
184 
185  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ),
186  GetCreateGerberJobFile() ? trueStr : falseStr );
187 
188  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
189  // to avoid incompatibility with older Pcbnew version
190  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
191  getTokenName( T_gerberprecision ), m_gerberPrecision );
192 
193  // SVG options
194  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_svguseinch ),
195  m_svgUseInch ? trueStr : falseStr );
196  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_svgprecision ),
197  m_svgPrecision );
198 
199  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
200  m_excludeEdgeLayer ? trueStr : falseStr );
201  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
202  m_plotFrameRef ? trueStr : falseStr );
203  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
204  m_plotViaOnMaskLayer ? trueStr : falseStr );
205  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
206  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
207  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
208  m_useAuxOrigin ? trueStr : falseStr );
209 
210  // HPGL options
211  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
212  m_HPGLPenNum );
213  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
214  m_HPGLPenSpeed );
215  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_hpglpendiameter ),
216  m_HPGLPenDiam );
217 
218  // DXF options
219  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfpolygonmode ),
220  m_DXFplotPolygonMode ? trueStr : falseStr );
221  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfimperialunits ),
222  m_DXFplotUnits == DXF_UNITS::INCHES ? trueStr : falseStr );
223  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfusepcbnewfont ),
224  m_textMode == PLOT_TEXT_MODE::NATIVE ? falseStr : trueStr );
225 
226  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
227  m_negative ? trueStr : falseStr );
228  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
229  m_A4Output ? trueStr : falseStr );
230  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
231  m_plotReference ? trueStr : falseStr );
232  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
233  m_plotValue ? trueStr : falseStr );
234  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
235  m_plotInvisibleText ? trueStr : falseStr );
236  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_sketchpadsonfab ),
237  m_sketchPadsOnFabLayers ? trueStr : falseStr );
238  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
239  m_subtractMaskFromSilk ? trueStr : falseStr );
240  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
241  static_cast<int>( m_format ) );
242  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
243  m_mirror ? trueStr : falseStr );
244  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
245  m_drillMarks );
246  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
248  aFormatter->Print( aNestLevel+1, "(%s \"%s\")", getTokenName( T_outputdirectory ),
249  (const char*) m_outputDirectory.utf8_str() );
250  aFormatter->Print( 0, "\n" );
251  aFormatter->Print( aNestLevel, ")\n" );
252 }
bool m_plotValue
Enable plotting of part values.
OUTLINE_MODE GetPlotMode() const
bool GetCreateGerberJobFile() const
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_mirror
Mirror the plot around the X axis.
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
DXF_UNITS m_DXFplotUnits
DXF format: Units to use when plotting the DXF.
static const int gbrDefaultPrecision
bool m_svgUseInch
units for SVG plot false for metric, true for inch/mils
bool m_plotReference
Enable plotting of part references.
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ....
int m_scaleSelection
Scale ratio index (UI only)
bool m_negative
Plot in negative color (supported only by some drivers)
bool GetUseGerberX2format() const
bool m_plotFrameRef
True to plot/print frame references.
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.
bool m_plotInvisibleText
Force plotting of fields marked invisible.
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode In polygon mode, each item to plot is converted to a...
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
unsigned m_svgPrecision
precision of coordinates in SVG files: accepted 3 - 6 6 is the internal resolution of Pcbnew
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
bool GetIncludeGerberNetlistInfo() const
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
static const char * getTokenName(T aTok)
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.
PLOT_FORMAT m_format
Plot format type (chooses the driver to be used)
bool m_gerberDisableApertMacros
Disable aperure macros in Gerber format (only for broken Gerber readers) Ideally, should be never sel...
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
LSET m_layerSelection
Set of layers to plot.
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
Definition: lset.cpp:321
PLOT_TEXT_MODE m_textMode
Choose how represent text with PS, PDF and DXF drivers.
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:408
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches,...

References gbrDefaultPrecision, getTokenName(), INCHES, NATIVE, OUTPUTFORMATTER::Print(), and SKETCH.

Referenced by PCB_IO::formatSetup().

◆ GetA4Output()

bool PCB_PLOT_PARAMS::GetA4Output ( ) const
inlineinherited

Definition at line 334 of file pcb_plot_params.h.

334 { return m_A4Output; };
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.

References PCB_PLOT_PARAMS::m_A4Output.

Referenced by DIALOG_PLOT::init_Dialog(), and initializePlotter().

◆ GetAutoScale()

bool PCB_PLOT_PARAMS::GetAutoScale ( ) const
inlineinherited

Definition at line 251 of file pcb_plot_params.h.

251 { return m_autoScale; }
bool m_autoScale
When true set the scale to fit the board in the page.

References PCB_PLOT_PARAMS::m_autoScale.

Referenced by initializePlotter().

◆ getColor()

COLOR4D BRDITEMS_PLOTTER::getColor ( LAYER_NUM  aLayer)

Function getColor.

Returns
the layer color
Parameters
aLayer= the layer id White color is special: cannot be seen on a white paper and in B&W mode, is plotted as white but other colors are plotted in BLACK so the returned color is LIGHTGRAY when the layer color is WHITE

Definition at line 76 of file plot_brditems_plotter.cpp.

77 {
78  COLOR4D color = ColorSettings()->GetColor( aLayer );
79 
80  // A hack to avoid plotting a white item in white color, expecting the paper
81  // is also white: use a non white color:
82  if( color == COLOR4D::WHITE )
83  color = COLOR4D( LIGHTGRAY );
84 
85  return color;
86 }
int color
Definition: DXF_plotter.cpp:60
Definition: color4d.h:48
COLOR4D GetColor(int aLayer) const
COLOR_SETTINGS * ColorSettings() const
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References color, PCB_PLOT_PARAMS::ColorSettings(), COLOR_SETTINGS::GetColor(), LIGHTGRAY, and WHITE.

Referenced by PlotFilledAreas(), PlotFootprintGraphicItem(), PlotFootprintTextItems(), PlotPcbShape(), PlotPcbTarget(), PlotPcbText(), and PlotStandardLayer().

◆ GetCreateGerberJobFile()

bool PCB_PLOT_PARAMS::GetCreateGerberJobFile ( ) const
inlineinherited

Definition at line 303 of file pcb_plot_params.h.

303 { return m_createGerberJobFile; }
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format

References PCB_PLOT_PARAMS::m_createGerberJobFile.

Referenced by DIALOG_PLOT::init_Dialog(), and DIALOG_PLOT::Plot().

◆ GetDisableGerberMacros()

bool PCB_PLOT_PARAMS::GetDisableGerberMacros ( ) const
inlineinherited

Definition at line 294 of file pcb_plot_params.h.

294 { return m_gerberDisableApertMacros; }
bool m_gerberDisableApertMacros
Disable aperure macros in Gerber format (only for broken Gerber readers) Ideally, should be never sel...

References PCB_PLOT_PARAMS::m_gerberDisableApertMacros.

Referenced by DIALOG_PLOT::init_Dialog(), and StartPlotBoard().

◆ GetDrillMarksType()

DrillMarksType PCB_PLOT_PARAMS::GetDrillMarksType ( ) const
inlineinherited

Definition at line 238 of file pcb_plot_params.h.

238 { return m_drillMarks; }
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.

References PCB_PLOT_PARAMS::m_drillMarks.

Referenced by DIALOG_PLOT::init_Dialog(), PlotDrillMarks(), PlotLayerOutlines(), and PlotStandardLayer().

◆ GetDXFPlotPolygonMode()

bool PCB_PLOT_PARAMS::GetDXFPlotPolygonMode ( ) const
inlineinherited

Definition at line 225 of file pcb_plot_params.h.

225 { return m_DXFplotPolygonMode; }
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode In polygon mode, each item to plot is converted to a...

References PCB_PLOT_PARAMS::m_DXFplotPolygonMode.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotOneBoardLayer().

◆ GetDXFPlotUnits()

DXF_UNITS PCB_PLOT_PARAMS::GetDXFPlotUnits ( ) const
inlineinherited

Definition at line 232 of file pcb_plot_params.h.

233  {
234  return m_DXFplotUnits;
235  }
DXF_UNITS m_DXFplotUnits
DXF format: Units to use when plotting the DXF.

References PCB_PLOT_PARAMS::m_DXFplotUnits.

Referenced by DIALOG_PLOT::init_Dialog(), and StartPlotBoard().

◆ GetExcludeEdgeLayer()

bool PCB_PLOT_PARAMS::GetExcludeEdgeLayer ( ) const
inlineinherited

Definition at line 278 of file pcb_plot_params.h.

278 { return m_excludeEdgeLayer; }
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.

References PCB_PLOT_PARAMS::m_excludeEdgeLayer.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotOneBoardLayer().

◆ GetFineScaleAdjustX()

double PCB_PLOT_PARAMS::GetFineScaleAdjustX ( ) const
inlineinherited

Definition at line 244 of file pcb_plot_params.h.

244 { return m_fineScaleAdjustX; }
double m_fineScaleAdjustX
fine scale adjust X axis

References PCB_PLOT_PARAMS::m_fineScaleAdjustX.

Referenced by StartPlotBoard().

◆ GetFineScaleAdjustY()

double PCB_PLOT_PARAMS::GetFineScaleAdjustY ( ) const
inlineinherited

Definition at line 246 of file pcb_plot_params.h.

246 { return m_fineScaleAdjustY; }
double m_fineScaleAdjustY
fine scale adjust Y axis

References PCB_PLOT_PARAMS::m_fineScaleAdjustY.

Referenced by StartPlotBoard().

◆ getFineWidthAdj()

int BRDITEMS_PLOTTER::getFineWidthAdj ( )
inline
Returns
a 'width adjustment' for the postscript engine (useful for controlling toner bleeding during direct transfer) added to track width and via/pads size

Definition at line 81 of file pcbplot.h.

82  {
83  if( GetFormat() == PLOT_FORMAT::POST )
84  return GetWidthAdjust();
85  else
86  return 0;
87  }
int GetWidthAdjust() const
PLOT_FORMAT GetFormat() const

References PCB_PLOT_PARAMS::GetFormat(), PCB_PLOT_PARAMS::GetWidthAdjust(), and POST.

Referenced by plotOneDrillMark(), and PlotStandardLayer().

◆ GetFormat()

PLOT_FORMAT PCB_PLOT_PARAMS::GetFormat ( ) const
inlineinherited

Definition at line 285 of file pcb_plot_params.h.

286  {
287  return m_format;
288  }
PLOT_FORMAT m_format
Plot format type (chooses the driver to be used)

References PCB_PLOT_PARAMS::m_format.

Referenced by getFineWidthAdj(), DIALOG_PLOT::init_Dialog(), DIALOG_PLOT::Plot(), PlotOneBoardLayer(), and StartPlotBoard().

◆ GetGerberDefaultPrecision()

static int PCB_PLOT_PARAMS::GetGerberDefaultPrecision ( )
inlinestaticinherited

Default precision of coordinates in Gerber files.

when units are in mm (7 in inches, but Pcbnew uses mm). 6 is the internal resolution of Pcbnew, so the default is 6

Definition at line 319 of file pcb_plot_params.h.

319 { return 6; }

◆ GetGerberPrecision()

int PCB_PLOT_PARAMS::GetGerberPrecision ( ) const
inlineinherited

Definition at line 309 of file pcb_plot_params.h.

309 { return m_gerberPrecision; }
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches,...

References PCB_PLOT_PARAMS::m_gerberPrecision.

Referenced by DIALOG_GENDRILL::GenDrillAndMapFiles(), DIALOG_PLOT::init_Dialog(), initializePlotter(), and DIALOG_GENDRILL::onFileFormatSelection().

◆ GetHPGLPenDiameter()

double PCB_PLOT_PARAMS::GetHPGLPenDiameter ( ) const
inlineinherited

Definition at line 338 of file pcb_plot_params.h.

338 { return m_HPGLPenDiam; };
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.

References PCB_PLOT_PARAMS::m_HPGLPenDiam.

Referenced by DIALOG_PLOT::applyPlotSettings(), ConfigureHPGLPenSizes(), and DIALOG_PLOT::init_Dialog().

◆ GetHPGLPenNum()

int PCB_PLOT_PARAMS::GetHPGLPenNum ( ) const
inlineinherited

Definition at line 346 of file pcb_plot_params.h.

346 { return m_HPGLPenNum; }
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)

References PCB_PLOT_PARAMS::m_HPGLPenNum.

Referenced by ConfigureHPGLPenSizes(), and GENDRILL_WRITER_BASE::genDrillMapFile().

◆ GetHPGLPenSpeed()

int PCB_PLOT_PARAMS::GetHPGLPenSpeed ( ) const
inlineinherited

Definition at line 342 of file pcb_plot_params.h.

342 { return m_HPGLPenSpeed; };
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)

References PCB_PLOT_PARAMS::m_HPGLPenSpeed.

Referenced by ConfigureHPGLPenSizes(), and GENDRILL_WRITER_BASE::genDrillMapFile().

◆ GetIncludeGerberNetlistInfo()

bool PCB_PLOT_PARAMS::GetIncludeGerberNetlistInfo ( ) const
inlineinherited

Definition at line 300 of file pcb_plot_params.h.

300 { return m_includeGerberNetlistInfo; }
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)

References PCB_PLOT_PARAMS::m_includeGerberNetlistInfo.

Referenced by DIALOG_PLOT::init_Dialog(), and StartPlotBoard().

◆ GetLayerSelection()

LSET PCB_PLOT_PARAMS::GetLayerSelection ( ) const
inlineinherited

Definition at line 325 of file pcb_plot_params.h.

325 { return m_layerSelection; };
LSET m_layerSelection
Set of layers to plot.

References PCB_PLOT_PARAMS::m_layerSelection.

Referenced by DIALOG_PLOT::init_Dialog(), and DIALOG_PLOT::Plot().

◆ GetMirror()

bool PCB_PLOT_PARAMS::GetMirror ( ) const
inlineinherited

Definition at line 254 of file pcb_plot_params.h.

254 { return m_mirror; }
bool m_mirror
Mirror the plot around the X axis.

References PCB_PLOT_PARAMS::m_mirror.

Referenced by DIALOG_PLOT::init_Dialog(), initializePlotter(), and StartPlotBoard().

◆ GetNegative()

bool PCB_PLOT_PARAMS::GetNegative ( ) const
inlineinherited

Definition at line 269 of file pcb_plot_params.h.

269 { return m_negative; }
bool m_negative
Plot in negative color (supported only by some drivers)

References PCB_PLOT_PARAMS::m_negative.

Referenced by DIALOG_PLOT::init_Dialog(), and StartPlotBoard().

◆ GetOutputDirectory()

◆ GetPlotFrameRef()

bool PCB_PLOT_PARAMS::GetPlotFrameRef ( ) const
inlineinherited

Definition at line 275 of file pcb_plot_params.h.

275 { return m_plotFrameRef; }
bool m_plotFrameRef
True to plot/print frame references.

References PCB_PLOT_PARAMS::m_plotFrameRef.

Referenced by DIALOG_PLOT::init_Dialog(), and StartPlotBoard().

◆ GetPlotInvisibleText()

bool PCB_PLOT_PARAMS::GetPlotInvisibleText ( ) const
inlineinherited

Definition at line 262 of file pcb_plot_params.h.

262 { return m_plotInvisibleText; }
bool m_plotInvisibleText
Force plotting of fields marked invisible.

References PCB_PLOT_PARAMS::m_plotInvisibleText.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotFootprintTextItems().

◆ GetPlotMode()

OUTLINE_MODE PCB_PLOT_PARAMS::GetPlotMode ( ) const
inlineinherited

Definition at line 222 of file pcb_plot_params.h.

222 { return m_plotMode; }
OUTLINE_MODE m_plotMode
FILLED or SKETCH selects how to plot filled objects.

References PCB_PLOT_PARAMS::m_plotMode.

Referenced by DIALOG_PLOT::init_Dialog(), PlotDrillMarks(), PlotFilledAreas(), PlotFootprintGraphicItem(), plotOneDrillMark(), PlotPcbShape(), and PlotStandardLayer().

◆ GetPlotReference()

bool PCB_PLOT_PARAMS::GetPlotReference ( ) const
inlineinherited

Definition at line 266 of file pcb_plot_params.h.

266 { return m_plotReference; }
bool m_plotReference
Enable plotting of part references.

References PCB_PLOT_PARAMS::m_plotReference.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotFootprintTextItems().

◆ GetPlotValue()

bool PCB_PLOT_PARAMS::GetPlotValue ( ) const
inlineinherited

Definition at line 264 of file pcb_plot_params.h.

264 { return m_plotValue; }
bool m_plotValue
Enable plotting of part values.

References PCB_PLOT_PARAMS::m_plotValue.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotFootprintTextItems().

◆ GetPlotViaOnMaskLayer()

bool PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer ( ) const
inlineinherited

Definition at line 272 of file pcb_plot_params.h.

272 { return m_plotViaOnMaskLayer; }
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)

References PCB_PLOT_PARAMS::m_plotViaOnMaskLayer.

Referenced by DIALOG_PLOT::init_Dialog(), PlotSolderMaskLayer(), and PlotStandardLayer().

◆ GetScale()

double PCB_PLOT_PARAMS::GetScale ( ) const
inlineinherited

Definition at line 241 of file pcb_plot_params.h.

241 { return m_scale; }
double m_scale
Global scale factor, 1.0 plots a board with its actual size.

References PCB_PLOT_PARAMS::m_scale.

Referenced by ConfigureHPGLPenSizes(), initializePlotter(), and DIALOG_PLOT::Plot().

◆ GetScaleSelection()

int PCB_PLOT_PARAMS::GetScaleSelection ( ) const
inlineinherited

Definition at line 331 of file pcb_plot_params.h.

331 { return m_scaleSelection; };
int m_scaleSelection
Scale ratio index (UI only)

References PCB_PLOT_PARAMS::m_scaleSelection.

Referenced by DIALOG_PLOT::init_Dialog(), and DIALOG_PLOT::Plot().

◆ GetSketchPadLineWidth()

int PCB_PLOT_PARAMS::GetSketchPadLineWidth ( ) const
inlineinherited

Definition at line 259 of file pcb_plot_params.h.

259 { return m_sketchPadLineWidth; }

References PCB_PLOT_PARAMS::m_sketchPadLineWidth.

Referenced by PlotPad().

◆ GetSketchPadsOnFabLayers()

bool PCB_PLOT_PARAMS::GetSketchPadsOnFabLayers ( ) const
inlineinherited

Definition at line 257 of file pcb_plot_params.h.

257 { return m_sketchPadsOnFabLayers; }
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.

References PCB_PLOT_PARAMS::m_sketchPadsOnFabLayers.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotStandardLayer().

◆ GetSkipPlotNPTH_Pads()

bool PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads ( ) const
inlineinherited

Definition at line 193 of file pcb_plot_params.h.

193 { return m_skipNPTH_Pads; }

References PCB_PLOT_PARAMS::m_skipNPTH_Pads.

Referenced by PlotStandardLayer().

◆ GetSubtractMaskFromSilk()

bool PCB_PLOT_PARAMS::GetSubtractMaskFromSilk ( ) const
inlineinherited

Definition at line 322 of file pcb_plot_params.h.

322 { return m_subtractMaskFromSilk; }
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)

References PCB_PLOT_PARAMS::m_subtractMaskFromSilk.

Referenced by DIALOG_PLOT::init_Dialog(), and PlotOneBoardLayer().

◆ GetSvgPrecision()

unsigned PCB_PLOT_PARAMS::GetSvgPrecision ( ) const
inlineinherited

Definition at line 312 of file pcb_plot_params.h.

312 { return m_svgPrecision; }
unsigned m_svgPrecision
precision of coordinates in SVG files: accepted 3 - 6 6 is the internal resolution of Pcbnew

References PCB_PLOT_PARAMS::m_svgPrecision.

Referenced by DIALOG_PLOT::init_Dialog(), and initializePlotter().

◆ GetSvgUseInch()

bool PCB_PLOT_PARAMS::GetSvgUseInch ( ) const
inlineinherited

Definition at line 313 of file pcb_plot_params.h.

313 { return m_svgUseInch; }
bool m_svgUseInch
units for SVG plot false for metric, true for inch/mils

References PCB_PLOT_PARAMS::m_svgUseInch.

Referenced by DIALOG_PLOT::init_Dialog(), and initializePlotter().

◆ GetTextMode()

PLOT_TEXT_MODE PCB_PLOT_PARAMS::GetTextMode ( ) const
inlineinherited

Definition at line 216 of file pcb_plot_params.h.

217  {
218  return m_textMode;
219  }
PLOT_TEXT_MODE m_textMode
Choose how represent text with PS, PDF and DXF drivers.

References PCB_PLOT_PARAMS::m_textMode.

Referenced by DIALOG_PLOT::init_Dialog(), initializePlotter(), and PlotOneBoardLayer().

◆ GetUseAuxOrigin()

bool PCB_PLOT_PARAMS::GetUseAuxOrigin ( ) const
inlineinherited

Definition at line 328 of file pcb_plot_params.h.

328 { return m_useAuxOrigin; };
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.

References PCB_PLOT_PARAMS::m_useAuxOrigin.

Referenced by AddGerberX2Header(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), DIALOG_PLOT::init_Dialog(), DIALOG_GENDRILL::initDialog(), initializePlotter(), and DIALOG_PLOT::reInitDialog().

◆ GetUseGerberProtelExtensions()

bool PCB_PLOT_PARAMS::GetUseGerberProtelExtensions ( ) const
inlineinherited

Definition at line 306 of file pcb_plot_params.h.

306 { return m_useGerberProtelExtensions; }
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ....

References PCB_PLOT_PARAMS::m_useGerberProtelExtensions.

Referenced by DIALOG_PLOT::init_Dialog().

◆ GetUseGerberX2format()

bool PCB_PLOT_PARAMS::GetUseGerberX2format ( ) const
inlineinherited

Definition at line 297 of file pcb_plot_params.h.

297 { return m_useGerberX2format; }
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)

References PCB_PLOT_PARAMS::m_useGerberX2format.

Referenced by DIALOG_PLOT::init_Dialog(), and StartPlotBoard().

◆ GetWidthAdjust()

int PCB_PLOT_PARAMS::GetWidthAdjust ( ) const
inlineinherited

Definition at line 248 of file pcb_plot_params.h.

248 { return m_widthAdjust; }
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...

References PCB_PLOT_PARAMS::m_widthAdjust.

Referenced by getFineWidthAdj().

◆ IsSameAs()

bool PCB_PLOT_PARAMS::IsSameAs ( const PCB_PLOT_PARAMS aPcbPlotParams) const
inherited

Compare current settings to aPcbPlotParams, including not saved parameters in brd file.

Parameters
aPcbPlotParams= the PCB_PLOT_PARAMS to compare
aCompareOnlySavedPrms= true to compare only saved in file parameters, and false to compare the full set of parameters.
Returns
true is parameters are same, false if one (or more) parameter does not match

Definition at line 261 of file pcb_plot_params.cpp.

262 {
263  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
264  return false;
266  return false;
268  return false;
269  if( m_useGerberX2format != aPcbPlotParams.m_useGerberX2format )
270  return false;
272  return false;
273  if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
274  return false;
275  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
276  return false;
277  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
278  return false;
279  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
280  return false;
281  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
282  return false;
283  if( m_plotMode != aPcbPlotParams.m_plotMode )
284  return false;
285  if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
286  return false;
287  if( m_DXFplotUnits != aPcbPlotParams.m_DXFplotUnits )
288  return false;
289  if( m_svgPrecision != aPcbPlotParams.m_svgPrecision )
290  return false;
291  if( m_svgUseInch != aPcbPlotParams.m_svgUseInch )
292  return false;
293  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
294  return false;
295  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
296  return false;
297  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
298  return false;
299  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
300  return false;
301  if( m_negative != aPcbPlotParams.m_negative )
302  return false;
303  if( m_A4Output != aPcbPlotParams.m_A4Output )
304  return false;
305  if( m_plotReference != aPcbPlotParams.m_plotReference )
306  return false;
307  if( m_plotValue != aPcbPlotParams.m_plotValue )
308  return false;
309  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
310  return false;
311  if( m_sketchPadsOnFabLayers != aPcbPlotParams.m_sketchPadsOnFabLayers )
312  return false;
313  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
314  return false;
315  if( m_format != aPcbPlotParams.m_format )
316  return false;
317  if( m_mirror != aPcbPlotParams.m_mirror )
318  return false;
319  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
320  return false;
321  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
322  return false;
323  if( m_autoScale != aPcbPlotParams.m_autoScale )
324  return false;
325  if( m_scale != aPcbPlotParams.m_scale )
326  return false;
327  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
328  return false;
329  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
330  return false;
331  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
332  return false;
333  if( m_textMode != aPcbPlotParams.m_textMode )
334  return false;
335  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
336  return false;
337 
338  return true;
339 }
double m_fineScaleAdjustX
fine scale adjust X axis
bool m_plotValue
Enable plotting of part values.
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_mirror
Mirror the plot around the X axis.
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
DXF_UNITS m_DXFplotUnits
DXF format: Units to use when plotting the DXF.
bool m_svgUseInch
units for SVG plot false for metric, true for inch/mils
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
double m_scale
Global scale factor, 1.0 plots a board with its actual size.
bool m_plotReference
Enable plotting of part references.
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ....
OUTLINE_MODE m_plotMode
FILLED or SKETCH selects how to plot filled objects.
int m_scaleSelection
Scale ratio index (UI only)
bool m_negative
Plot in negative color (supported only by some drivers)
bool m_plotFrameRef
True to plot/print frame references.
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
bool m_plotInvisibleText
Force plotting of fields marked invisible.
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode In polygon mode, each item to plot is converted to a...
bool m_autoScale
When true set the scale to fit the board in the page.
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
unsigned m_svgPrecision
precision of coordinates in SVG files: accepted 3 - 6 6 is the internal resolution of Pcbnew
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
double m_fineScaleAdjustY
fine scale adjust Y axis
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.
PLOT_FORMAT m_format
Plot format type (chooses the driver to be used)
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
bool m_gerberDisableApertMacros
Disable aperure macros in Gerber format (only for broken Gerber readers) Ideally, should be never sel...
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
LSET m_layerSelection
Set of layers to plot.
PLOT_TEXT_MODE m_textMode
Choose how represent text with PS, PDF and DXF drivers.
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches,...

References PCB_PLOT_PARAMS::m_A4Output, PCB_PLOT_PARAMS::m_autoScale, PCB_PLOT_PARAMS::m_createGerberJobFile, PCB_PLOT_PARAMS::m_drillMarks, PCB_PLOT_PARAMS::m_DXFplotPolygonMode, PCB_PLOT_PARAMS::m_DXFplotUnits, PCB_PLOT_PARAMS::m_excludeEdgeLayer, PCB_PLOT_PARAMS::m_fineScaleAdjustX, PCB_PLOT_PARAMS::m_fineScaleAdjustY, PCB_PLOT_PARAMS::m_format, PCB_PLOT_PARAMS::m_gerberDisableApertMacros, PCB_PLOT_PARAMS::m_gerberPrecision, PCB_PLOT_PARAMS::m_HPGLPenDiam, PCB_PLOT_PARAMS::m_HPGLPenNum, PCB_PLOT_PARAMS::m_HPGLPenSpeed, PCB_PLOT_PARAMS::m_includeGerberNetlistInfo, PCB_PLOT_PARAMS::m_layerSelection, PCB_PLOT_PARAMS::m_mirror, PCB_PLOT_PARAMS::m_negative, PCB_PLOT_PARAMS::m_outputDirectory, PCB_PLOT_PARAMS::m_plotFrameRef, PCB_PLOT_PARAMS::m_plotInvisibleText, PCB_PLOT_PARAMS::m_plotMode, PCB_PLOT_PARAMS::m_plotReference, PCB_PLOT_PARAMS::m_plotValue, PCB_PLOT_PARAMS::m_plotViaOnMaskLayer, PCB_PLOT_PARAMS::m_scale, PCB_PLOT_PARAMS::m_scaleSelection, PCB_PLOT_PARAMS::m_sketchPadsOnFabLayers, PCB_PLOT_PARAMS::m_subtractMaskFromSilk, PCB_PLOT_PARAMS::m_svgPrecision, PCB_PLOT_PARAMS::m_svgUseInch, PCB_PLOT_PARAMS::m_textMode, PCB_PLOT_PARAMS::m_useAuxOrigin, PCB_PLOT_PARAMS::m_useGerberProtelExtensions, PCB_PLOT_PARAMS::m_useGerberX2format, and PCB_PLOT_PARAMS::m_widthAdjust.

Referenced by DIALOG_PLOT::applyPlotSettings(), and DIALOG_GENDRILL::UpdateDrillParams().

◆ Parse()

void PCB_PLOT_PARAMS::Parse ( PCB_PLOT_PARAMS_PARSER aParser)
inherited

Definition at line 255 of file pcb_plot_params.cpp.

256 {
257  aParser->Parse( this );
258 }
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)

References PCB_PLOT_PARAMS_PARSER::Parse().

Referenced by LEGACY_PLUGIN::loadSETUP(), and PCB_PARSER::parseSetup().

◆ PlotBoardGraphicItems()

void BRDITEMS_PLOTTER::PlotBoardGraphicItems ( )

plot items like text and graphics, but not tracks and footprints

Definition at line 340 of file plot_brditems_plotter.cpp.

341 {
342  for( BOARD_ITEM* item : m_board->Drawings() )
343  {
344  switch( item->Type() )
345  {
346  case PCB_SHAPE_T:
347  PlotPcbShape( (PCB_SHAPE*) item );
348  break;
349 
350  case PCB_TEXT_T:
351  if( item->GetLayer() != Edge_Cuts )
352  PlotPcbText( (PCB_TEXT*) item );
353 
354  break;
355 
356  case PCB_DIM_ALIGNED_T:
357  case PCB_DIM_CENTER_T:
359  case PCB_DIM_LEADER_T:
360  if( item->GetLayer() != Edge_Cuts )
361  PlotDimension( (DIMENSION_BASE*) item );
362 
363  break;
364 
365  case PCB_TARGET_T:
366  PlotPcbTarget( (PCB_TARGET*) item );
367  break;
368 
369  default:
370  break;
371  }
372  }
373 }
class ALIGNED_DIMENSION, a linear dimension (graphic item)
Definition: typeinfo.h:100
class LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:102
void PlotPcbText(PCB_TEXT *aText)
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
BOARD * m_board
Definition: pcbplot.h:65
void PlotPcbTarget(PCB_TARGET *PtMire)
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
void PlotPcbShape(PCB_SHAPE *aShape)
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
Definition: typeinfo.h:103
Abstract dimension API.
Definition: dimension.h:95
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
void PlotDimension(DIMENSION_BASE *Dimension)
DRAWINGS & Drawings()
Definition: board.h:306

References BOARD::Drawings(), Edge_Cuts, BOARD_ITEM::GetLayer(), m_board, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PlotDimension(), PlotPcbShape(), PlotPcbTarget(), and PlotPcbText().

Referenced by PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PlotSolderMaskLayer(), and PlotStandardLayer().

◆ PlotDimension()

void BRDITEMS_PLOTTER::PlotDimension ( DIMENSION_BASE Dimension)

Definition at line 410 of file plot_brditems_plotter.cpp.

411 {
412  if( !m_layerMask[aDim->GetLayer()] )
413  return;
414 
415  PCB_SHAPE draw;
416 
417  draw.SetWidth( aDim->GetLineThickness() );
418  draw.SetLayer( aDim->GetLayer() );
419 
420  COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
421 
422  // Set plot color (change WHITE to LIGHTGRAY because
423  // the white items are not seen on a white paper or screen
425 
426  PlotPcbText( &aDim->Text() );
427 
428  for( const std::shared_ptr<SHAPE>& shape : aDim->GetShapes() )
429  {
430  switch( shape->Type() )
431  {
432  case SH_SEGMENT:
433  {
434  const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
435 
436  draw.SetShape( S_SEGMENT );
437  draw.SetStart( wxPoint( seg.A ) );
438  draw.SetEnd( wxPoint( seg.B ) );
439 
440  PlotPcbShape( &draw );
441  break;
442  }
443 
444  case SH_CIRCLE:
445  {
446  wxPoint start( shape->Centre() );
447  int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
448 
449  draw.SetShape( S_CIRCLE );
450  draw.SetFilled( false );
451  draw.SetStart( start );
452  draw.SetEnd( wxPoint( start.x + radius, start.y ) );
453 
454  PlotPcbShape( &draw );
455  break;
456  }
457 
458  default:
459  break;
460  }
461  }
462 }
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:194
virtual void SetColor(COLOR4D color)=0
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
void PlotPcbText(PCB_TEXT *aText)
int color
Definition: DXF_plotter.cpp:60
PLOTTER * m_plotter
Definition: pcbplot.h:64
usual segment : line with rounded ends
Definition: board_item.h:50
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:129
circle
Definition: shape.h:46
Definition: color4d.h:48
Definition: seg.h:41
COLOR4D GetColor(int aLayer) const
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:148
void PlotPcbShape(PCB_SHAPE *aShape)
LSET m_layerMask
Definition: pcbplot.h:66
VECTOR2I A
Definition: seg.h:49
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
ring
Definition: board_item.h:53
COLOR_SETTINGS * ColorSettings() const
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:159
line segment
Definition: shape.h:44
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98
VECTOR2I B
Definition: seg.h:50

References SEG::A, SEG::B, color, PCB_PLOT_PARAMS::ColorSettings(), COLOR_SETTINGS::GetColor(), BOARD_ITEM::GetLayer(), DIMENSION_BASE::GetLineThickness(), DIMENSION_BASE::GetShapes(), LIGHTGRAY, m_layerMask, m_plotter, PlotPcbShape(), PlotPcbText(), S_CIRCLE, S_SEGMENT, PLOTTER::SetColor(), PCB_SHAPE::SetEnd(), PCB_SHAPE::SetFilled(), BOARD_ITEM::SetLayer(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), PCB_SHAPE::SetWidth(), SH_CIRCLE, SH_SEGMENT, DIMENSION_BASE::Text(), and WHITE.

Referenced by PlotBoardGraphicItems().

◆ PlotDrillMarks()

void BRDITEMS_PLOTTER::PlotDrillMarks ( )

Function PlotDrillMarks Draw a drill mark for pads and vias.

Must be called after all drawings, because it redraw the drill mark on a pad or via, as a negative (i.e. white) shape in FILLED plot mode (for PS and PDF outputs)

Definition at line 1014 of file plot_brditems_plotter.cpp.

1015 {
1016  /* If small drills marks were requested prepare a clamp value to pass
1017  to the helper function */
1019  ? Millimeter2iu( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ) : 0;
1020 
1021  /* In the filled trace mode drill marks are drawn white-on-black to scrape
1022  the underlying pad. This works only for drivers supporting color change,
1023  obviously... it means that:
1024  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
1025  - In HPGL you can't see them
1026  - In gerbers you can't see them, too. This is arguably the right thing to
1027  do since having drill marks and high speed drill stations is a sure
1028  recipe for broken tools and angry manufacturers. If you *really* want them
1029  you could start a layer with negative polarity to scrape the film.
1030  - In DXF they go into the 'WHITE' layer. This could be useful.
1031  */
1032  if( GetPlotMode() == FILLED )
1033  m_plotter->SetColor( WHITE );
1034 
1035  for( TRACK* tracks : m_board->Tracks() )
1036  {
1037  const VIA* via = dyn_cast<const VIA*>( tracks );
1038 
1039  if( via )
1040  {
1042  wxSize( via->GetDrillValue(), 0 ),
1043  wxSize( via->GetWidth(), 0 ), 0, smallDrill );
1044  }
1045  }
1046 
1047  for( FOOTPRINT* footprint : m_board->Footprints() )
1048  {
1049  for( PAD* pad : footprint->Pads() )
1050  {
1051  if( pad->GetDrillSize().x == 0 )
1052  continue;
1053 
1054  plotOneDrillMark( pad->GetDrillShape(), pad->GetPosition(), pad->GetDrillSize(),
1055  pad->GetSize(), pad->GetOrientation(), smallDrill );
1056  }
1057  }
1058 
1059  if( GetPlotMode() == FILLED )
1060  m_plotter->SetColor( BLACK );
1061 }
OUTLINE_MODE GetPlotMode() const
Definition: track.h:343
virtual void SetColor(COLOR4D color)=0
const wxPoint & GetStart() const
Definition: track.h:116
PLOTTER * m_plotter
Definition: pcbplot.h:64
Definition: color4d.h:44
BOARD * m_board
Definition: pcbplot.h:65
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: track.cpp:173
FOOTPRINTS & Footprints()
Definition: board.h:303
Definition: color4d.h:48
int GetWidth() const
Definition: track.h:110
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.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Definition: pad.h:60
DrillMarksType GetDrillMarksType() const
static constexpr int Millimeter2iu(double mm)
TRACKS & Tracks()
Definition: board.h:300
Definition: track.h:83

References BLACK, FILLED, BOARD::Footprints(), ADVANCED_CFG::GetCfg(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), PCB_PLOT_PARAMS::GetPlotMode(), TRACK::GetStart(), TRACK::GetWidth(), m_board, m_plotter, Millimeter2iu(), PAD_DRILL_SHAPE_CIRCLE, plotOneDrillMark(), PLOTTER::SetColor(), PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, BOARD::Tracks(), and WHITE.

Referenced by PlotStandardLayer().

◆ PlotFilledAreas()

void BRDITEMS_PLOTTER::PlotFilledAreas ( ZONE aZone,
SHAPE_POLY_SET aPolysList 
)

Definition at line 754 of file plot_brditems_plotter.cpp.

755 {
756  if( polysList.IsEmpty() )
757  return;
758 
759  GBR_METADATA gbr_metadata;
760 
761  bool isOnCopperLayer = aZone->IsOnCopperLayer();
762 
763  if( isOnCopperLayer )
764  {
765  gbr_metadata.SetNetName( aZone->GetNetname() );
766  gbr_metadata.SetCopper( true );
767 
768  // Zones with no net name can exist.
769  // they are not used to connect items, so the aperture attribute cannot
770  // be set as conductor
771  if( aZone->GetNetname().IsEmpty() )
772  {
774  }
775  else
776  {
779  }
780  }
781 
782  // We need a buffer to store corners coordinates:
783  std::vector< wxPoint > cornerList;
784 
785  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
786 
787  m_plotter->StartBlock( nullptr ); // Clean current object attributes
788 
789  /* Plot all filled areas: filled areas have a filled area and a thick
790  * outline (depending on the fill area option we must plot the filled area itself
791  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
792  *
793  * in non filled mode the outline is plotted, but not the filling items
794  */
795  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
796 
797  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
798  {
799  SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
800 
801  cornerList.clear();
802  cornerList.reserve( outline.PointCount() );
803 
804  for( int ic = 0; ic < outline.PointCount(); ++ic )
805  {
806  cornerList.emplace_back( wxPoint( outline.CPoint( ic ) ) );
807  }
808 
809  if( cornerList.size() ) // Plot the current filled area outline
810  {
811  // First, close the outline
812  if( cornerList[0] != cornerList[cornerList.size() - 1] )
813  cornerList.push_back( cornerList[0] );
814 
815  // Plot the current filled area (as region for Gerber plotter
816  // to manage attributes) and its outline for thick outline
817  if( GetPlotMode() == FILLED )
818  {
820  {
821  if( outline_thickness > 0 )
822  {
823  m_plotter->PlotPoly( cornerList, FILL_TYPE::NO_FILL, outline_thickness,
824  &gbr_metadata );
825  }
826 
827  static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion( cornerList,
828  &gbr_metadata );
829  }
830  else
831  {
832  m_plotter->PlotPoly( cornerList, FILL_TYPE::FILLED_SHAPE, outline_thickness,
833  &gbr_metadata );
834  }
835  }
836  else
837  {
838  if( outline_thickness )
839  {
840  for( unsigned jj = 1; jj < cornerList.size(); jj++ )
841  {
842  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
843  outline_thickness, GetPlotMode(), &gbr_metadata );
844  }
845  }
846 
848  }
849  }
850  }
851 
852  m_plotter->EndBlock( nullptr ); // Clear object attributes
853 }
OUTLINE_MODE GetPlotMode() const
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:484
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
PLOTTER * m_plotter
Definition: pcbplot.h:64
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:475
wxString GetNetname() const
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Draw a polygon ( filled or not )
int PointCount() const
Function PointCount()
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:506
const VECTOR2I & CPoint(int aIndex) const
Function Point()
int GetMinThickness() const
Definition: zone.h:247
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:215
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:229
SHAPE_LINE_CHAIN.
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: zone.cpp:221
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
void SetCopper(bool aValue)
Definition: gbr_metadata.h:252
print info associated to a net (TO.N attribute)
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
bool GetFilledPolysUseThickness() const
Definition: zone.h:712
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References SHAPE_LINE_CHAIN::CPoint(), PLOTTER::EndBlock(), FILLED, FILLED_SHAPE, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GERBER, getColor(), ZONE::GetFilledPolysUseThickness(), ZONE::GetLayer(), ZONE::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), PLOTTER::GetPlotterType(), SHAPE_POLY_SET::IsEmpty(), ZONE::IsOnCopperLayer(), m_plotter, NO_FILL, SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PLOTTER::PlotPoly(), SHAPE_LINE_CHAIN::PointCount(), GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), GBR_METADATA::SetCopper(), PLOTTER::SetCurrentLineWidth(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), PLOTTER::StartBlock(), and PLOTTER::ThickSegment().

Referenced by PlotSolderMaskLayer(), and PlotStandardLayer().

◆ PlotFootprintGraphicItem()

void BRDITEMS_PLOTTER::PlotFootprintGraphicItem ( FP_SHAPE aShape)

Definition at line 533 of file plot_brditems_plotter.cpp.

534 {
535  if( aShape->Type() != PCB_FP_SHAPE_T )
536  return;
537 
538  m_plotter->SetColor( getColor( aShape->GetLayer() ) );
539 
540  bool sketch = GetPlotMode() == SKETCH;
541  int thickness = aShape->GetWidth();
542  wxPoint pos( aShape->GetStart() );
543  wxPoint end( aShape->GetEnd() );
544 
545  GBR_METADATA gbr_metadata;
547  FOOTPRINT* parent = static_cast<FOOTPRINT*> ( aShape->GetParent() );
548  gbr_metadata.SetCmpReference( parent->GetReference() );
549 
550  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
551 
552  if( isOnCopperLayer )
553  {
554  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
555  gbr_metadata.SetCopper( true );
556  }
557  else if( aShape->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
558  {
559  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
560  }
561 
562  int radius; // Circle/arc radius.
563 
564  switch( aShape->GetShape() )
565  {
566  case S_SEGMENT:
567  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
568  break;
569 
570  case S_RECT:
571  {
572  std::vector<wxPoint> pts = aShape->GetRectCorners();
573 
574  if( sketch || thickness > 0 )
575  {
576  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
577  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
578  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
579  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
580  }
581 
582  if( !sketch && aShape->IsFilled() )
583  {
584  SHAPE_LINE_CHAIN poly;
585 
586  for( const wxPoint& pt : pts )
587  poly.Append( pt );
588 
589  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata );
590  }
591  }
592  break;
593 
594  case S_CIRCLE:
595  radius = KiROUND( GetLineLength( end, pos ) );
596 
597  if( aShape->IsFilled() )
598  m_plotter->FilledCircle( pos, radius * 2 + thickness, GetPlotMode(), &gbr_metadata );
599  else
600  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
601 
602  break;
603 
604  case S_ARC:
605  {
606  radius = KiROUND( GetLineLength( end, pos ) );
607  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
608  double endAngle = startAngle + aShape->GetAngle();
609 
610  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
611  if( std::abs( aShape->GetAngle() ) == 3600.0 )
612  {
613  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
614  }
615  else
616  {
617  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(),
618  &gbr_metadata );
619  }
620  }
621  break;
622 
623  case S_POLYGON:
624  if( aShape->IsPolyShapeValid() )
625  {
626  const std::vector<wxPoint> &polyPoints = aShape->BuildPolyPointsList();
627 
628  // We must compute board coordinates from m_PolyList which are relative to the parent
629  // position at orientation 0
630  FOOTPRINT *parentFootprint = aShape->GetParentFootprint();
631 
632  std::vector<wxPoint> cornerList;
633 
634  cornerList.reserve( polyPoints.size() );
635 
636  for( wxPoint corner : polyPoints )
637  {
638  if( parentFootprint )
639  {
640  RotatePoint( &corner, parentFootprint->GetOrientation() );
641  corner += parentFootprint->GetPosition();
642  }
643 
644  cornerList.push_back( corner );
645  }
646 
647  if( sketch || thickness > 0 )
648  {
649  for( size_t i = 1; i < cornerList.size(); i++ )
650  {
651  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
652  GetPlotMode(), &gbr_metadata );
653  }
654 
655  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
656  GetPlotMode(), &gbr_metadata );
657 
658  }
659 
660  if( !sketch && aShape->IsFilled() )
661  {
662  // This must be simplified and fractured to prevent overlapping polygons
663  // from generating invalid Gerber files
664 
665  SHAPE_LINE_CHAIN line( cornerList );
666  SHAPE_POLY_SET tmpPoly;
667 
668  line.SetClosed( true );
669  tmpPoly.AddOutline( line );
671 
672  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
673  {
674  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
675  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata );
676  }
677  }
678  }
679  break;
680 
681  case S_CURVE:
682  m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezControl1(),
683  aShape->GetBezControl2(), aShape->GetEnd(), 0, thickness );
684  break;
685 
686  default:
687  wxASSERT_MSG( false, "Unhandled FP_SHAPE shape" );
688  break;
689  }
690 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
bool IsPolyShapeValid() const
Definition: pcb_shape.cpp:1223
OUTLINE_MODE GetPlotMode() const
aperture used for etched components.
Definition: gbr_metadata.h:94
bool IsFilled() const
Definition: pcb_shape.h:96
int OutlineCount() const
Return the number of vertices in a given outline/hole.
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:568
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
Definition: pcb_shape.h:156
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
std::vector< wxPoint > GetRectCorners() const
Definition: pcb_shape.cpp:970
int GetWidth() const
Definition: pcb_shape.h:118
PLOTTER * m_plotter
Definition: pcbplot.h:64
polygon (not yet used for tracks, but could be in microwave apps)
Definition: board_item.h:54
double GetOrientation() const
Definition: footprint.h:186
usual segment : line with rounded ends
Definition: board_item.h:50
virtual void FilledCircle(const wxPoint &pos, int diametre, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:584
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Draw a polygon ( filled or not )
Arcs (with rounded ends)
Definition: board_item.h:52
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
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
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:228
segment with non rounded ends
Definition: board_item.h:51
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:506
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
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...
Definition: pcb_shape.cpp:1206
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
Definition: pcb_shape.h:145
const wxString & GetReference() const
Definition: footprint.h:423
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new hole to the given outline (default: last) and returns its index.
FOOTPRINT * GetParentFootprint() const
Function GetParentFootprint returns a pointer to the parent footprint, or NULL if PCB_SHAPE does not ...
Definition: pcb_shape.cpp:478
SHAPE_LINE_CHAIN.
LSET m_layerMask
Definition: pcbplot.h:66
const wxPoint & GetBezControl2() const
Definition: pcb_shape.h:136
double GetAngle() const
Definition: pcb_shape.h:127
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
wxPoint GetPosition() const override
Definition: footprint.h:182
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:530
ring
Definition: board_item.h:53
PCB_SHAPE_TYPE_T GetShape() const
Definition: pcb_shape.h:130
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:182
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
Bezier Curve.
Definition: board_item.h:55
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
const wxPoint & GetBezControl1() const
Definition: pcb_shape.h:133
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162

References SHAPE_POLY_SET::AddOutline(), LSET::AllCuMask(), SHAPE_LINE_CHAIN::Append(), ArcTangente(), PLOTTER::BezierCurve(), PCB_SHAPE::BuildPolyPointsList(), Edge_Cuts, FILLED_SHAPE, PLOTTER::FilledCircle(), SHAPE_POLY_SET::Fracture(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, PCB_SHAPE::GetAngle(), PCB_SHAPE::GetBezControl1(), PCB_SHAPE::GetBezControl2(), getColor(), PCB_SHAPE::GetEnd(), BOARD_ITEM::GetLayer(), GetLineLength(), FOOTPRINT::GetOrientation(), BOARD_ITEM::GetParent(), PCB_SHAPE::GetParentFootprint(), PCB_PLOT_PARAMS::GetPlotMode(), FOOTPRINT::GetPosition(), PCB_SHAPE::GetRectCorners(), FOOTPRINT::GetReference(), PCB_SHAPE::GetShape(), PCB_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), PCB_SHAPE::IsFilled(), PCB_SHAPE::IsPolyShapeValid(), KiROUND(), m_layerMask, m_plotter, SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PCB_FP_SHAPE_T, PLOTTER::PlotPoly(), SHAPE_POLY_SET::PM_FAST, RotatePoint(), S_ARC, S_CIRCLE, S_CURVE, S_POLYGON, S_RECT, S_SEGMENT, SHAPE_LINE_CHAIN::SetClosed(), PLOTTER::SetColor(), GBR_METADATA::SetNetAttribType(), SKETCH, PLOTTER::ThickArc(), PLOTTER::ThickCircle(), PLOTTER::ThickSegment(), and EDA_ITEM::Type().

Referenced by PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PlotFootprintGraphicItems(), and PlotSolderMaskLayer().

◆ PlotFootprintGraphicItems()

void BRDITEMS_PLOTTER::PlotFootprintGraphicItems ( FOOTPRINT aFootprint)

Definition at line 520 of file plot_brditems_plotter.cpp.

521 {
522  for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
523  {
524  FP_SHAPE* shape = dynamic_cast<FP_SHAPE*>( item );
525 
526  if( shape && m_layerMask[ shape->GetLayer() ] )
527  PlotFootprintGraphicItem( shape );
528  }
529 }
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
LSET m_layerMask
Definition: pcbplot.h:66
void PlotFootprintGraphicItem(FP_SHAPE *aShape)
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173

References BOARD_ITEM::GetLayer(), FOOTPRINT::GraphicalItems(), m_layerMask, and PlotFootprintGraphicItem().

Referenced by PlotStandardLayer().

◆ PlotFootprintTextItem()

void BRDITEMS_PLOTTER::PlotFootprintTextItem ( FP_TEXT aText,
COLOR4D  aColor 
)

Definition at line 375 of file plot_brditems_plotter.cpp.

376 {
377  if( aColor == COLOR4D::WHITE )
378  aColor = COLOR4D( LIGHTGRAY );
379 
380  m_plotter->SetColor( aColor );
381 
382  // calculate some text parameters :
383  wxSize size = aTextMod->GetTextSize();
384  wxPoint pos = aTextMod->GetTextPos();
385  double orient = aTextMod->GetDrawRotation();
386  int thickness = aTextMod->GetEffectiveTextPenWidth();
387 
388  if( aTextMod->IsMirrored() )
389  size.x = -size.x; // Text is mirrored
390 
391  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
392  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
393  // (like bold text) and we manage the thickness.
394  // So we set bold flag to true
395  bool allow_bold = true;
396 
397  GBR_METADATA gbr_metadata;
399  FOOTPRINT* parent = static_cast<FOOTPRINT*> ( aTextMod->GetParent() );
400  gbr_metadata.SetCmpReference( parent->GetReference() );
401 
402  m_plotter->SetCurrentLineWidth( thickness );
403 
404  m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size,
405  aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), thickness,
406  aTextMod->IsItalic(), allow_bold, false, &gbr_metadata );
407 }
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
PLOTTER * m_plotter
Definition: pcbplot.h:64
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: gr_text.cpp:219
const wxString & GetReference() const
Definition: footprint.h:423
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
Definition: color4d.h:48
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References GBR_NETLIST_METADATA::GBR_NETINFO_CMP, FP_TEXT::GetDrawRotation(), EDA_TEXT::GetEffectiveTextPenWidth(), EDA_TEXT::GetHorizJustify(), BOARD_ITEM::GetParent(), FOOTPRINT::GetReference(), FP_TEXT::GetShownText(), EDA_TEXT::GetTextPos(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), EDA_TEXT::IsItalic(), EDA_TEXT::IsMirrored(), LIGHTGRAY, m_plotter, PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), GBR_METADATA::SetNetAttribType(), PLOTTER::Text(), and WHITE.

Referenced by PlotFootprintTextItems().

◆ PlotFootprintTextItems()

void BRDITEMS_PLOTTER::PlotFootprintTextItems ( FOOTPRINT aFootprint)

Definition at line 289 of file plot_brditems_plotter.cpp.

290 {
291  FP_TEXT* textItem = &aFootprint->Reference();
292  LAYER_NUM textLayer = textItem->GetLayer();
293 
294  // Reference and value are specfic items, not in graphic items list
295  if( GetPlotReference() && m_layerMask[textLayer]
296  && ( textItem->IsVisible() || GetPlotInvisibleText() ) )
297  {
298  PlotFootprintTextItem( textItem, getColor( textLayer ) );
299  }
300 
301  textItem = &aFootprint->Value();
302  textLayer = textItem->GetLayer();
303 
304  if( GetPlotValue() && m_layerMask[textLayer]
305  && ( textItem->IsVisible() || GetPlotInvisibleText() ) )
306  {
307  PlotFootprintTextItem( textItem, getColor( textLayer ) );
308  }
309 
310  for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
311  {
312  textItem = dyn_cast<FP_TEXT*>( item );
313 
314  if( !textItem )
315  continue;
316 
317  if( !textItem->IsVisible() )
318  continue;
319 
320  textLayer = textItem->GetLayer();
321 
322  if( textLayer == Edge_Cuts || textLayer >= PCB_LAYER_ID_COUNT )
323  continue;
324 
325  if( !m_layerMask[textLayer] )
326  continue;
327 
328  if( textItem->GetText() == wxT( "${REFERENCE}" ) && !GetPlotReference() )
329  continue;
330 
331  if( textItem->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() )
332  continue;
333 
334  PlotFootprintTextItem( textItem, getColor( textLayer ) );
335  }
336 }
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
bool IsVisible() const
Definition: eda_text.h:193
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:459
FP_TEXT & Reference()
Definition: footprint.h:460
void PlotFootprintTextItem(FP_TEXT *aText, COLOR4D aColor)
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
int LAYER_NUM
This can be replaced with int and removed.
bool GetPlotValue() const
LSET m_layerMask
Definition: pcbplot.h:66
bool GetPlotInvisibleText() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
bool GetPlotReference() const
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.

References Edge_Cuts, getColor(), BOARD_ITEM::GetLayer(), PCB_PLOT_PARAMS::GetPlotInvisibleText(), PCB_PLOT_PARAMS::GetPlotReference(), PCB_PLOT_PARAMS::GetPlotValue(), EDA_TEXT::GetText(), FOOTPRINT::GraphicalItems(), EDA_TEXT::IsVisible(), m_layerMask, PCB_LAYER_ID_COUNT, PlotFootprintTextItem(), FOOTPRINT::Reference(), and FOOTPRINT::Value().

Referenced by PlotSolderMaskLayer(), and PlotStandardLayer().

◆ plotOneDrillMark()

void BRDITEMS_PLOTTER::plotOneDrillMark ( PAD_DRILL_SHAPE_T  aDrillShape,
const wxPoint &  aDrillPos,
wxSize  aDrillSize,
const wxSize &  aPadSize,
double  aOrientation,
int  aSmallDrill 
)
private

Helper function to plot a single drill mark.

It compensate and clamp the drill mark size depending on the current plot options

Definition at line 989 of file plot_brditems_plotter.cpp.

992 {
993  // Small drill marks have no significance when applied to slots
994  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
995  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
996 
997  // Round holes only have x diameter, slots have both
998  aDrillSize.x -= getFineWidthAdj();
999  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
1000 
1001  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
1002  {
1003  aDrillSize.y -= getFineWidthAdj();
1004  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
1005  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
1006  }
1007  else
1008  {
1009  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
1010  }
1011 }
OUTLINE_MODE GetPlotMode() const
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
PLOTTER * m_plotter
Definition: pcbplot.h:64
#define NULL
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 getFineWidthAdj()
Definition: pcbplot.h:81
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData)=0

References Clamp(), PLOTTER::FlashPadCircle(), PLOTTER::FlashPadOval(), getFineWidthAdj(), PCB_PLOT_PARAMS::GetPlotMode(), m_plotter, NULL, PAD_DRILL_SHAPE_CIRCLE, and PAD_DRILL_SHAPE_OBLONG.

Referenced by PlotDrillMarks().

◆ PlotPad()

void BRDITEMS_PLOTTER::PlotPad ( PAD aPad,
COLOR4D  aColor,
OUTLINE_MODE  aPlotMode 
)

Plot a pad.

unlike other items, a pad had not a specific color, and be drawn as a non filled item although the plot mode is filled color and plot mode are needed by this function

Definition at line 89 of file plot_brditems_plotter.cpp.

90 {
91  wxPoint shape_pos = aPad->ShapePos();
92  GBR_METADATA gbr_metadata;
93 
94  bool plotOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
95  bool plotOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
96 
97  // Pad not on the solder mask layer cannot be soldered.
98  // therefore it can have a specific aperture attribute.
99  // Not yet in use.
100  // bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
101 
102  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
103 
104  if( plotOnCopperLayer )
105  {
106  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
107  gbr_metadata.SetCopper( true );
108  // Gives a default attribute, for instance for pads used as tracks in net ties:
109  // Connector pads and SMD pads are on external layers
110  // if on internal layers, they are certainly used as net tie
111  // and are similar to tracks: just conductor items
113 
114  const bool useUTF8 = false;
115  const bool useQuoting = false;
116  gbr_metadata.SetPadName( aPad->GetName(), useUTF8, useQuoting );
117 
118  if( !aPad->GetName().IsEmpty() )
119  gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
120 
121  gbr_metadata.SetNetName( aPad->GetNetname() );
122 
123  // Some pads are mechanical pads ( through hole or smd )
124  // when this is the case, they have no pad name and/or are not plated.
125  // In this case gerber files have slightly different attributes.
126  if( aPad->GetAttribute() == PAD_ATTRIB_NPTH || aPad->GetName().IsEmpty() )
127  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
128 
129  if( !plotOnExternalCopperLayer )
130  {
131  // the .P object attribute (GBR_NETLIST_METADATA::GBR_NETINFO_PAD)
132  // is used on outer layers, unless the component is embedded
133  // or a "etched" component (fp only drawn, not a physical component)
134  // Currently, Pcbnew does not handle embedded component, so we disable the .P
135  // attribute on internal layers
136  // Note the Gerber doc is not really clear about through holes pads about the .P
139 
140  }
141 
142  // Some attributes are reserved to the external copper layers:
143  // GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF
144  // for instance.
145  // Pad with type PAD_ATTRIB_CONN or PAD_ATTRIB_SMD that is not on outer layer
146  // has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR
147  switch( aPad->GetAttribute() )
148  {
149  case PAD_ATTRIB_NPTH: // Mechanical pad through hole
151  break;
152 
153  case PAD_ATTRIB_PTH : // Pad through hole, a hole is also expected
155  break;
156 
157  case PAD_ATTRIB_CONN: // Connector pads, no solder paste but with solder mask.
158  if( plotOnExternalCopperLayer )
160  break;
161 
162  case PAD_ATTRIB_SMD: // SMD pads (on external copper layer only)
163  // with solder paste and mask
164  if( plotOnExternalCopperLayer )
166  break;
167  }
168 
169  // Fabrication properties can have specific GBR_APERTURE_METADATA options
170  // that replace previous aperture attribute:
171  switch( aPad->GetProperty() )
172  {
173  case PAD_PROP_BGA: // Only applicable to outer layers
174  if( plotOnExternalCopperLayer )
176  break;
177 
180  break;
181 
184  break;
185 
186  case PAD_PROP_TESTPOINT: // Only applicable to outer layers
187  if( plotOnExternalCopperLayer )
189  break;
190 
191  case PAD_PROP_HEATSINK:
193  break;
194 
197  break;
198 
199  case PAD_PROP_NONE:
200  break;
201  }
202 
203  // Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
204  if( aPad->GetAttribute() == PAD_ATTRIB_NPTH )
206  }
207  else
208  {
210  }
211 
212  // Set plot color (change WHITE to LIGHTGRAY because
213  // the white items are not seen on a white paper or screen
214  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
215 
216  if( aPlotMode == SKETCH )
218 
219  switch( aPad->GetShape() )
220  {
221  case PAD_SHAPE_CIRCLE:
222  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
223  break;
224 
225  case PAD_SHAPE_OVAL:
226  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
227  &gbr_metadata );
228  break;
229 
230  case PAD_SHAPE_RECT:
231  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
232  &gbr_metadata );
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 
240  case PAD_SHAPE_TRAPEZOID:
241  {
242  // Build the pad polygon in coordinates relative to the pad
243  // (i.e. for a pad at pos 0,0, rot 0.0). Needed to use aperture macros,
244  // to be able to create a pattern common to all trapezoid pads having the same shape
245  wxPoint coord[4];
246  // Order is lower left, lower right, upper right, upper left
247  wxSize half_size = aPad->GetSize()/2;
248  wxSize trap_delta = aPad->GetDelta()/2;
249 
250  coord[0] = wxPoint( -half_size.x - trap_delta.y, half_size.y + trap_delta.x );
251  coord[1] = wxPoint( half_size.x + trap_delta.y, half_size.y - trap_delta.x );
252  coord[2] = wxPoint( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
253  coord[3] = wxPoint( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
254 
255  m_plotter->FlashPadTrapez( shape_pos, coord, aPad->GetOrientation(), aPlotMode,
256  &gbr_metadata );
257  }
258  break;
259 
262  {
263  static_cast<GERBER_PLOTTER*>( m_plotter )->FlashPadChamferRoundRect(
264  shape_pos, aPad->GetSize(),
265  aPad->GetRoundRectCornerRadius(),
266  aPad->GetChamferRectRatio(),
267  aPad->GetChamferPositions(),
268  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
269  break;
270  }
272 
273  default:
274  case PAD_SHAPE_CUSTOM:
275  {
276  const std::shared_ptr<SHAPE_POLY_SET>& polygons = aPad->GetEffectivePolygon();
277 
278  if( polygons->OutlineCount() )
279  {
280  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), aPad->GetOrientation(),
281  polygons.get(), aPlotMode, &gbr_metadata );
282  }
283  }
284  break;
285  }
286 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData)=0
aperture used for castellated pads in copper layer files.
Definition: gbr_metadata.h:131
no special fabrication property
Definition: pad_shapes.h:96
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
a fiducial (usually a smd) for the full board
Definition: pad_shapes.h:98
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
PLOTTER * m_plotter
Definition: pcbplot.h:64
aperture used for SMD pad. Excluded BGA pads which have their own type.
Definition: gbr_metadata.h:105
Smd pad, used in BGA footprints.
Definition: pad_shapes.h:97
wxString GetNetname() const
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
PAD_SHAPE_T GetShape() const
Definition: pad.h:169
aperture used for castellated pads in drill files.
Definition: gbr_metadata.h:134
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
a pad used as heat sink, usually in SMD footprints
Definition: pad_shapes.h:101
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
Flash a trapezoidal pad.
a pad with a castellated through hole
Definition: pad_shapes.h:102
void SetPadPinFunction(const wxString &aPadPinFunction, bool aUseUTF8, bool aEscapeString)
Definition: gbr_metadata.h:236
PAD_ATTR_T GetAttribute() const
Definition: pad.h:363
aperture used for edge connector pad (outer layers).
Definition: gbr_metadata.h:117
wxPoint ShapePos() const
Definition: pcbnew/pad.cpp:657
aperture used for fiducial pad (outer layers), at footprint level.
Definition: gbr_metadata.h:125
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
Definition: pad.h:341
void SetPadName(const wxString &aPadname, bool aUseUTF8=false, bool aEscapeString=false)
Definition: gbr_metadata.h:231
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
const wxSize & GetSize() const
Definition: pad.h:232
const wxString & GetName() const
Definition: pad.h:133
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
Definition: lset.cpp:780
const wxString & GetReference() const
Definition: footprint.h:423
aperture used for mechanical pads (NPTH).
Definition: gbr_metadata.h:121
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
PAD_PROP_T GetProperty() const
Definition: pad.h:366
aperture used for test point pad (outer layers).
Definition: gbr_metadata.h:122
int GetRoundRectCornerRadius() const
Definition: pcbnew/pad.cpp:237
Definition: color4d.h:48
const wxSize & GetDelta() const
Definition: pad.h:239
FOOTPRINT * GetParent() const
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:229
a fiducial (usually a smd) local to the parent footprint
Definition: pad_shapes.h:99
double GetChamferRectRatio() const
Definition: pad.h:524
LSET m_layerMask
Definition: pcbplot.h:66
Plated through hole pad.
Definition: pad_shapes.h:80
aperture used for heat sink pad (typically for SMDs).
Definition: gbr_metadata.h:128
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: pcbnew/pad.cpp:268
aperture used for BGA pads with a solder mask defined by the copper shape.
Definition: gbr_metadata.h:111
int GetSketchPadLineWidth() const
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData)=0
int GetChamferPositions() const
Definition: pad.h:534
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
GBR_NETLIST_METADATA m_NetlistMetadata
An item to handle object attribute.
Definition: gbr_metadata.h:262
void SetCopper(bool aValue)
Definition: gbr_metadata.h:252
a test point pad
Definition: pad_shapes.h:100
print info associated to a net (TO.N attribute)
const wxString & GetPinFunction() const
Definition: pad.h:139
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:241
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData)=0
#define GBR_NETINFO_ALL
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References LSET::AllCuMask(), LSET::ExternalCuMask(), PLOTTER::FlashPadCircle(), PLOTTER::FlashPadCustom(), PLOTTER::FlashPadOval(), PLOTTER::FlashPadRect(), PLOTTER::FlashPadRoundRect(), PLOTTER::FlashPadTrapez(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDPAD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_HEATSINKPAD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_TESTPOINT, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD, GBR_NETINFO_ALL, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GERBER, PAD::GetAttribute(), PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), PAD::GetDelta(), PAD::GetEffectivePolygon(), PAD::GetName(), BOARD_CONNECTED_ITEM::GetNetname(), PAD::GetOrientation(), PAD::GetParent(), PAD::GetPinFunction(), PLOTTER::GetPlotterType(), PAD::GetProperty(), FOOTPRINT::GetReference(), PAD::GetRoundRectCornerRadius(), PAD::GetShape(), PAD::GetSize(), PCB_PLOT_PARAMS::GetSketchPadLineWidth(), KI_FALLTHROUGH, LIGHTGRAY, m_layerMask, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, m_plotter, PAD_ATTRIB_CONN, PAD_ATTRIB_NPTH, PAD_ATTRIB_PTH, PAD_ATTRIB_SMD, PAD_PROP_BGA, PAD_PROP_CASTELLATED, PAD_PROP_FIDUCIAL_GLBL, PAD_PROP_FIDUCIAL_LOCAL, PAD_PROP_HEATSINK, PAD_PROP_NONE, PAD_PROP_TESTPOINT, PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, GBR_METADATA::SetApertureAttrib(), GBR_METADATA::SetCmpReference(), PLOTTER::SetColor(), GBR_METADATA::SetCopper(), PLOTTER::SetCurrentLineWidth(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), GBR_METADATA::SetPadName(), GBR_METADATA::SetPadPinFunction(), PAD::ShapePos(), SKETCH, and WHITE.

Referenced by PlotStandardLayer().

◆ PlotPcbShape()

void BRDITEMS_PLOTTER::PlotPcbShape ( PCB_SHAPE aShape)

Definition at line 858 of file plot_brditems_plotter.cpp.

859 {
860  if( !m_layerMask[aShape->GetLayer()] )
861  return;
862 
863  int radius = 0;
864  double StAngle = 0, EndAngle = 0;
865  bool sketch = GetPlotMode() == SKETCH;
866  int thickness = aShape->GetWidth();
867 
868  m_plotter->SetColor( getColor( aShape->GetLayer() ) );
869 
870  wxPoint start( aShape->GetStart() );
871  wxPoint end( aShape->GetEnd() );
872 
873  GBR_METADATA gbr_metadata;
874 
875  if( aShape->GetLayer() == Edge_Cuts )
877 
878  if( IsCopperLayer( aShape->GetLayer() ) )
879  // Graphic items (PCB_SHAPE, TEXT) having no net have the NonConductor attribute
880  // Graphic items having a net have the Conductor attribute, but are not (yet?)
881  // supported in Pcbnew
882  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
883 
884  switch( aShape->GetShape() )
885  {
886  case S_SEGMENT:
887  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
888  break;
889 
890  case S_CIRCLE:
891  radius = KiROUND( GetLineLength( end, start ) );
892 
893  if( aShape->IsFilled() )
894  m_plotter->FilledCircle( start, radius * 2 + thickness, GetPlotMode(), &gbr_metadata );
895  else
896  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
897 
898  break;
899 
900  case S_ARC:
901  radius = KiROUND( GetLineLength( end, start ) );
902  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
903  EndAngle = StAngle + aShape->GetAngle();
904 
905  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
906  if( std::abs( aShape->GetAngle() ) == 3600.0 )
907  {
908  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
909  }
910  else
911  {
912  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(),
913  &gbr_metadata );
914  }
915  break;
916 
917  case S_CURVE:
918  m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezControl1(),
919  aShape->GetBezControl2(), aShape->GetEnd(), 0, thickness );
920  break;
921 
922  case S_POLYGON:
923  if( aShape->IsPolyShapeValid() )
924  {
925  if( sketch || thickness > 0 )
926  {
927  for( auto it = aShape->GetPolyShape().CIterateSegments( 0 ); it; it++ )
928  {
929  auto seg = it.Get();
930  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
931  thickness, GetPlotMode(), &gbr_metadata );
932  }
933  }
934 
935  if( !sketch && aShape->IsFilled() )
936  {
937  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
938  // Draw the polygon: only one polygon is expected
939  // However we provide a multi polygon shape drawing
940  // ( for the future or to show a non expected shape )
941  // This must be simplified and fractured to prevent overlapping polygons
942  // from generating invalid Gerber files
943  auto tmpPoly = SHAPE_POLY_SET( aShape->GetPolyShape() );
945 
946  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
947  {
948  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
949  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata );
950  }
951  }
952  }
953  break;
954 
955  case S_RECT:
956  {
957  std::vector<wxPoint> pts = aShape->GetRectCorners();
958 
959  if( sketch || thickness > 0 )
960  {
961  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
962  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
963  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
964  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
965  }
966 
967  if( !sketch && aShape->IsFilled() )
968  {
969  SHAPE_LINE_CHAIN poly;
970 
971  for( const wxPoint& pt : pts )
972  poly.Append( pt );
973 
974  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata );
975  }
976  }
977  break;
978 
979  default:
980  wxASSERT_MSG( false, "Unhandled PCB_SHAPE shape" );
981  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
982  }
983 }
bool IsPolyShapeValid() const
Definition: pcb_shape.cpp:1223
OUTLINE_MODE GetPlotMode() const
bool IsFilled() const
Definition: pcb_shape.h:96
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:568
SHAPE_POLY_SET & GetPolyShape()
Definition: pcb_shape.h:268
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
Definition: pcb_shape.h:156
virtual void SetColor(COLOR4D color)=0
std::vector< wxPoint > GetRectCorners() const
Definition: pcb_shape.cpp:970
int GetWidth() const
Definition: pcb_shape.h:118
PLOTTER * m_plotter
Definition: pcbplot.h:64
polygon (not yet used for tracks, but could be in microwave apps)
Definition: board_item.h:54
usual segment : line with rounded ends
Definition: board_item.h:50
virtual void FilledCircle(const wxPoint &pos, int diametre, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:584
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Draw a polygon ( filled or not )
Arcs (with rounded ends)
Definition: board_item.h:52
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
segment with non rounded ends
Definition: board_item.h:51
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:506
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
Represent a set of closed polygons.
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
Definition: pcb_shape.h:145
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
SHAPE_LINE_CHAIN.
LSET m_layerMask
Definition: pcbplot.h:66
const wxPoint & GetBezControl2() const
Definition: pcb_shape.h:136
double GetAngle() const
Definition: pcb_shape.h:127
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
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, OUTLINE_MODE tracemode, void *aData)
Definition: plotter.cpp:530
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
ring
Definition: board_item.h:53
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
PCB_SHAPE_TYPE_T GetShape() const
Definition: pcb_shape.h:130
CONST_SEGMENT_ITERATOR CIterateSegments(int aFirst, int aLast, bool aIterateHoles=false) const
Return an iterator object, for iterating aPolygonIdx-th polygon edges.
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:182
Bezier Curve.
Definition: board_item.h:55
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
const wxPoint & GetBezControl1() const
Definition: pcb_shape.h:133
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References SHAPE_LINE_CHAIN::Append(), ArcTangente(), PLOTTER::BezierCurve(), SHAPE_POLY_SET::CIterateSegments(), Edge_Cuts, FILLED_SHAPE, PLOTTER::FilledCircle(), SHAPE_POLY_SET::Fracture(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, PCB_SHAPE::GetAngle(), PCB_SHAPE::GetBezControl1(), PCB_SHAPE::GetBezControl2(), getColor(), PCB_SHAPE::GetEnd(), BOARD_ITEM::GetLayer(), GetLineLength(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_SHAPE::GetPolyShape(), PCB_SHAPE::GetRectCorners(), PCB_SHAPE::GetShape(), PCB_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), IsCopperLayer(), PCB_SHAPE::IsFilled(), PCB_SHAPE::IsPolyShapeValid(), KiROUND(), m_layerMask, m_plotter, PLOTTER::PlotPoly(), SHAPE_POLY_SET::PM_FAST, S_ARC, S_CIRCLE, S_CURVE, S_POLYGON, S_RECT, S_SEGMENT, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), SKETCH, PLOTTER::ThickArc(), PLOTTER::ThickCircle(), and PLOTTER::ThickSegment().

Referenced by GENDRILL_WRITER_BASE::genDrillMapFile(), PlotBoardGraphicItems(), PlotDimension(), and PlotPcbTarget().

◆ PlotPcbTarget()

void BRDITEMS_PLOTTER::PlotPcbTarget ( PCB_TARGET PtMire)

Definition at line 465 of file plot_brditems_plotter.cpp.

466 {
467  int dx1, dx2, dy1, dy2, radius;
468 
469  if( !m_layerMask[aMire->GetLayer()] )
470  return;
471 
472  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
473 
474  PCB_SHAPE draw;
475 
476  draw.SetShape( S_CIRCLE );
477  draw.SetFilled( false );
478  draw.SetWidth( aMire->GetWidth() );
479  draw.SetLayer( aMire->GetLayer() );
480  draw.SetStart( aMire->GetPosition() );
481  radius = aMire->GetSize() / 3;
482 
483  if( aMire->GetShape() ) // shape X
484  radius = aMire->GetSize() / 2;
485 
486  // Draw the circle
487  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ) );
488 
489  PlotPcbShape( &draw );
490 
491  draw.SetShape( S_SEGMENT );
492 
493  radius = aMire->GetSize() / 2;
494  dx1 = radius;
495  dy1 = 0;
496  dx2 = 0;
497  dy2 = radius;
498 
499  if( aMire->GetShape() ) // Shape X
500  {
501  dx1 = dy1 = radius;
502  dx2 = dx1;
503  dy2 = -dy1;
504  }
505 
506  wxPoint mirePos( aMire->GetPosition() );
507 
508  // Draw the X or + shape:
509  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ) );
510  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ) );
511  PlotPcbShape( &draw );
512 
513  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ) );
514  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ) );
515  PlotPcbShape( &draw );
516 }
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:194
virtual void SetColor(COLOR4D color)=0
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
PLOTTER * m_plotter
Definition: pcbplot.h:64
usual segment : line with rounded ends
Definition: board_item.h:50
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:129
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
Definition: pcb_shape.h:145
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:148
void PlotPcbShape(PCB_SHAPE *aShape)
LSET m_layerMask
Definition: pcbplot.h:66
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
ring
Definition: board_item.h:53
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:159

References getColor(), BOARD_ITEM::GetLayer(), PCB_TARGET::GetPosition(), PCB_TARGET::GetShape(), PCB_TARGET::GetSize(), PCB_SHAPE::GetStart(), PCB_TARGET::GetWidth(), m_layerMask, m_plotter, PlotPcbShape(), S_CIRCLE, S_SEGMENT, PLOTTER::SetColor(), PCB_SHAPE::SetEnd(), PCB_SHAPE::SetFilled(), BOARD_ITEM::SetLayer(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), and PCB_SHAPE::SetWidth().

Referenced by PlotBoardGraphicItems().

◆ PlotPcbText()

void BRDITEMS_PLOTTER::PlotPcbText ( PCB_TEXT aText)

Definition at line 694 of file plot_brditems_plotter.cpp.

695 {
696  wxString shownText( aText->GetShownText() );
697 
698  if( shownText.IsEmpty() )
699  return;
700 
701  if( !m_layerMask[aText->GetLayer()] )
702  return;
703 
704  GBR_METADATA gbr_metadata;
705 
706  if( IsCopperLayer( aText->GetLayer() ) )
708 
709  COLOR4D color = getColor( aText->GetLayer() );
711 
712  wxSize size = aText->GetTextSize();
713  wxPoint pos = aText->GetTextPos();
714  double orient = aText->GetTextAngle();
715  int thickness = aText->GetEffectiveTextPenWidth();
716 
717  if( aText->IsMirrored() )
718  size.x = -size.x;
719 
720  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
721  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
722  // (like bold text) and we manage the thickness.
723  // So we set bold flag to true
724  bool allow_bold = true;
725 
726  m_plotter->SetCurrentLineWidth( thickness );
727 
728  if( aText->IsMultilineAllowed() )
729  {
730  std::vector<wxPoint> positions;
731  wxArrayString strings_list;
732  wxStringSplit( shownText, strings_list, '\n' );
733  positions.reserve( strings_list.Count() );
734 
735  aText->GetLinePositions( positions, strings_list.Count() );
736 
737  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
738  {
739  wxString& txt = strings_list.Item( ii );
740  m_plotter->Text( positions[ii], color, txt, orient, size, aText->GetHorizJustify(),
741  aText->GetVertJustify(), thickness, aText->IsItalic(),
742  allow_bold, false, &gbr_metadata );
743  }
744  }
745  else
746  {
747  m_plotter->Text( pos, color, shownText, orient, size, aText->GetHorizJustify(),
748  aText->GetVertJustify(), thickness, aText->IsItalic(), allow_bold,
749  false, &gbr_metadata );
750  }
751 }
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:206
bool IsMirrored() const
Definition: eda_text.h:196
virtual void SetColor(COLOR4D color)=0
int color
Definition: DXF_plotter.cpp:60
PLOTTER * m_plotter
Definition: pcbplot.h:64
double GetTextAngle() const
Definition: eda_text.h:181
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:157
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: gr_text.cpp:219
bool IsItalic() const
Definition: eda_text.h:187
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: pcb_text.cpp:53
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:205
const wxSize & GetTextSize() const
Definition: eda_text.h:245
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
bool IsMultilineAllowed() const
Definition: eda_text.h:203
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: string.cpp:807
LSET m_layerMask
Definition: pcbplot.h:66
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:424
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References color, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, getColor(), EDA_TEXT::GetEffectiveTextPenWidth(), EDA_TEXT::GetHorizJustify(), BOARD_ITEM::GetLayer(), EDA_TEXT::GetLinePositions(), PCB_TEXT::GetShownText(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextPos(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), IsCopperLayer(), EDA_TEXT::IsItalic(), EDA_TEXT::IsMirrored(), EDA_TEXT::IsMultilineAllowed(), m_layerMask, m_plotter, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), PLOTTER::Text(), and wxStringSplit().

Referenced by GENDRILL_WRITER_BASE::genDrillMapFile(), PlotBoardGraphicItems(), and PlotDimension().

◆ SetA4Output()

void PCB_PLOT_PARAMS::SetA4Output ( int  aForce)
inlineinherited

Definition at line 333 of file pcb_plot_params.h.

333 { m_A4Output = aForce; };
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.

References PCB_PLOT_PARAMS::m_A4Output.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetAutoScale()

void PCB_PLOT_PARAMS::SetAutoScale ( bool  aFlag)
inlineinherited

Definition at line 250 of file pcb_plot_params.h.

250 { m_autoScale = aFlag; }
bool m_autoScale
When true set the scale to fit the board in the page.

References PCB_PLOT_PARAMS::m_autoScale.

Referenced by DIALOG_PLOT::Plot().

◆ SetColorSettings()

void PCB_PLOT_PARAMS::SetColorSettings ( COLOR_SETTINGS aSettings)
inlineinherited

Definition at line 207 of file pcb_plot_params.h.

207 { m_colors = aSettings; }
COLOR_SETTINGS * m_colors
Pointer to active color settings to be used for plotting.

References PCB_PLOT_PARAMS::m_colors.

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), and DIALOG_PLOT::Plot().

◆ SetCreateGerberJobFile()

void PCB_PLOT_PARAMS::SetCreateGerberJobFile ( bool  aCreate)
inlineinherited

Definition at line 302 of file pcb_plot_params.h.

302 { m_createGerberJobFile = aCreate; }
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format

References PCB_PLOT_PARAMS::m_createGerberJobFile.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetDisableGerberMacros()

void PCB_PLOT_PARAMS::SetDisableGerberMacros ( bool  aDisable)
inlineinherited

Definition at line 293 of file pcb_plot_params.h.

293 { m_gerberDisableApertMacros = aDisable; }
bool m_gerberDisableApertMacros
Disable aperure macros in Gerber format (only for broken Gerber readers) Ideally, should be never sel...

References PCB_PLOT_PARAMS::m_gerberDisableApertMacros.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetDrillMarksType()

void PCB_PLOT_PARAMS::SetDrillMarksType ( DrillMarksType  aVal)
inlineinherited

Definition at line 237 of file pcb_plot_params.h.

237 { m_drillMarks = aVal; }
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.

References PCB_PLOT_PARAMS::m_drillMarks.

Referenced by DIALOG_PLOT::applyPlotSettings(), DIALOG_EXPORT_SVG::CreateSVGFile(), and PlotOneBoardLayer().

◆ SetDXFPlotPolygonMode()

void PCB_PLOT_PARAMS::SetDXFPlotPolygonMode ( bool  aFlag)
inlineinherited

Definition at line 224 of file pcb_plot_params.h.

224 { m_DXFplotPolygonMode = aFlag; }
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode In polygon mode, each item to plot is converted to a...

References PCB_PLOT_PARAMS::m_DXFplotPolygonMode.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetDXFPlotUnits()

void PCB_PLOT_PARAMS::SetDXFPlotUnits ( DXF_UNITS  aUnit)
inlineinherited

Definition at line 227 of file pcb_plot_params.h.

228  {
229  m_DXFplotUnits = aUnit;
230  }
DXF_UNITS m_DXFplotUnits
DXF format: Units to use when plotting the DXF.

References PCB_PLOT_PARAMS::m_DXFplotUnits.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetExcludeEdgeLayer()

void PCB_PLOT_PARAMS::SetExcludeEdgeLayer ( bool  aFlag)
inlineinherited

Definition at line 277 of file pcb_plot_params.h.

277 { m_excludeEdgeLayer = aFlag; }
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.

References PCB_PLOT_PARAMS::m_excludeEdgeLayer.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetFineScaleAdjustX()

void PCB_PLOT_PARAMS::SetFineScaleAdjustX ( double  aVal)
inlineinherited

Definition at line 243 of file pcb_plot_params.h.

243 { m_fineScaleAdjustX = aVal; }
double m_fineScaleAdjustX
fine scale adjust X axis

References PCB_PLOT_PARAMS::m_fineScaleAdjustX.

Referenced by DIALOG_PLOT::Plot().

◆ SetFineScaleAdjustY()

void PCB_PLOT_PARAMS::SetFineScaleAdjustY ( double  aVal)
inlineinherited

Definition at line 245 of file pcb_plot_params.h.

245 { m_fineScaleAdjustY = aVal; }
double m_fineScaleAdjustY
fine scale adjust Y axis

References PCB_PLOT_PARAMS::m_fineScaleAdjustY.

Referenced by DIALOG_PLOT::Plot().

◆ SetFormat()

void PCB_PLOT_PARAMS::SetFormat ( PLOT_FORMAT  aFormat)
inlineinherited

Definition at line 280 of file pcb_plot_params.h.

281  {
282  m_format = aFormat;
283  }
PLOT_FORMAT m_format
Plot format type (chooses the driver to be used)

References PCB_PLOT_PARAMS::m_format.

Referenced by DIALOG_PLOT::applyPlotSettings(), DIALOG_EXPORT_SVG::CreateSVGFile(), PLOT_CONTROLLER::OpenPlotfile(), and PCB_EDIT_FRAME::ToPlotter().

◆ SetGerberPrecision()

void PCB_PLOT_PARAMS::SetGerberPrecision ( int  aPrecision)
inherited

Definition at line 144 of file pcb_plot_params.cpp.

145 {
146  // Currently geber files use mm.
147  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
148  // or 5, min value for professional boards, when 6 creates problems
149  // to board makers.
150 
153 }
static const int gbrDefaultPrecision
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches,...

References gbrDefaultPrecision.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetHPGLPenDiameter()

bool PCB_PLOT_PARAMS::SetHPGLPenDiameter ( double  aValue)
inherited

Definition at line 342 of file pcb_plot_params.cpp.

343 {
345 }
static bool setDouble(double *aTarget, double aValue, double aMin, double aMax)
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.
#define HPGL_PEN_DIAMETER_MAX
#define HPGL_PEN_DIAMETER_MIN

References HPGL_PEN_DIAMETER_MAX, HPGL_PEN_DIAMETER_MIN, and setDouble().

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetHPGLPenNum()

void PCB_PLOT_PARAMS::SetHPGLPenNum ( int  aVal)
inlineinherited

Definition at line 345 of file pcb_plot_params.h.

345 { m_HPGLPenNum = aVal; }
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)

References PCB_PLOT_PARAMS::m_HPGLPenNum.

◆ SetHPGLPenSpeed()

bool PCB_PLOT_PARAMS::SetHPGLPenSpeed ( int  aValue)
inherited

Definition at line 348 of file pcb_plot_params.cpp.

349 {
351 }
#define HPGL_PEN_SPEED_MAX
static bool setInt(int *aTarget, int aValue, int aMin, int aMax)
#define HPGL_PEN_SPEED_MIN
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)

References HPGL_PEN_SPEED_MAX, HPGL_PEN_SPEED_MIN, and setInt().

◆ SetIncludeGerberNetlistInfo()

void PCB_PLOT_PARAMS::SetIncludeGerberNetlistInfo ( bool  aUse)
inlineinherited

Definition at line 299 of file pcb_plot_params.h.

299 { m_includeGerberNetlistInfo = aUse; }
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)

References PCB_PLOT_PARAMS::m_includeGerberNetlistInfo.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetLayerSelection()

void PCB_PLOT_PARAMS::SetLayerSelection ( LSET  aSelection)
inlineinherited

Definition at line 324 of file pcb_plot_params.h.

324 { m_layerSelection = aSelection; };
LSET m_layerSelection
Set of layers to plot.

References PCB_PLOT_PARAMS::m_layerSelection.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetLayerSet()

void BRDITEMS_PLOTTER::SetLayerSet ( LSET  aLayerMask)
inline

◆ SetMirror()

void PCB_PLOT_PARAMS::SetMirror ( bool  aFlag)
inlineinherited

Definition at line 253 of file pcb_plot_params.h.

253 { m_mirror = aFlag; }
bool m_mirror
Mirror the plot around the X axis.

References PCB_PLOT_PARAMS::m_mirror.

Referenced by DIALOG_PLOT::applyPlotSettings(), DIALOG_EXPORT_SVG::CreateSVGFile(), and StartPlotBoard().

◆ SetNegative()

void PCB_PLOT_PARAMS::SetNegative ( bool  aFlag)
inlineinherited

Definition at line 268 of file pcb_plot_params.h.

268 { m_negative = aFlag; }
bool m_negative
Plot in negative color (supported only by some drivers)

References PCB_PLOT_PARAMS::m_negative.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetOutputDirectory()

void PCB_PLOT_PARAMS::SetOutputDirectory ( wxString  aDir)
inlineinherited

Definition at line 290 of file pcb_plot_params.h.

290 { m_outputDirectory = aDir; }
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)

References PCB_PLOT_PARAMS::m_outputDirectory.

Referenced by DIALOG_PLOT::applyPlotSettings(), DIALOG_GEN_FOOTPRINT_POSITION::OnGenerate(), and DIALOG_GENDRILL::UpdateDrillParams().

◆ SetPlotFrameRef()

void PCB_PLOT_PARAMS::SetPlotFrameRef ( bool  aFlag)
inlineinherited

Definition at line 274 of file pcb_plot_params.h.

274 { m_plotFrameRef = aFlag; }
bool m_plotFrameRef
True to plot/print frame references.

References PCB_PLOT_PARAMS::m_plotFrameRef.

Referenced by DIALOG_PLOT::applyPlotSettings(), and DIALOG_EXPORT_SVG::CreateSVGFile().

◆ SetPlotInvisibleText()

void PCB_PLOT_PARAMS::SetPlotInvisibleText ( bool  aFlag)
inlineinherited

Definition at line 261 of file pcb_plot_params.h.

261 { m_plotInvisibleText = aFlag; }
bool m_plotInvisibleText
Force plotting of fields marked invisible.

References PCB_PLOT_PARAMS::m_plotInvisibleText.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetPlotMode()

void PCB_PLOT_PARAMS::SetPlotMode ( OUTLINE_MODE  aPlotMode)
inlineinherited

Definition at line 221 of file pcb_plot_params.h.

221 { m_plotMode = aPlotMode; }
OUTLINE_MODE m_plotMode
FILLED or SKETCH selects how to plot filled objects.

References PCB_PLOT_PARAMS::m_plotMode.

Referenced by DIALOG_PLOT::applyPlotSettings(), and PCB_PLOT_PARAMS_PARSER::Parse().

◆ SetPlotReference()

void PCB_PLOT_PARAMS::SetPlotReference ( bool  aFlag)
inlineinherited

Definition at line 265 of file pcb_plot_params.h.

265 { m_plotReference = aFlag; }
bool m_plotReference
Enable plotting of part references.

References PCB_PLOT_PARAMS::m_plotReference.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetPlotValue()

void PCB_PLOT_PARAMS::SetPlotValue ( bool  aFlag)
inlineinherited

Definition at line 263 of file pcb_plot_params.h.

263 { m_plotValue = aFlag; }
bool m_plotValue
Enable plotting of part values.

References PCB_PLOT_PARAMS::m_plotValue.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetPlotViaOnMaskLayer()

void PCB_PLOT_PARAMS::SetPlotViaOnMaskLayer ( bool  aFlag)
inlineinherited

Definition at line 271 of file pcb_plot_params.h.

271 { m_plotViaOnMaskLayer = aFlag; }
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)

References PCB_PLOT_PARAMS::m_plotViaOnMaskLayer.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetScale()

void PCB_PLOT_PARAMS::SetScale ( double  aVal)
inlineinherited

Definition at line 240 of file pcb_plot_params.h.

240 { m_scale = aVal; }
double m_scale
Global scale factor, 1.0 plots a board with its actual size.

References PCB_PLOT_PARAMS::m_scale.

Referenced by DIALOG_PLOT::Plot().

◆ SetScaleSelection()

void PCB_PLOT_PARAMS::SetScaleSelection ( int  aSelection)
inlineinherited

Definition at line 330 of file pcb_plot_params.h.

330 { m_scaleSelection = aSelection; };
int m_scaleSelection
Scale ratio index (UI only)

References PCB_PLOT_PARAMS::m_scaleSelection.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetSketchPadLineWidth()

void PCB_PLOT_PARAMS::SetSketchPadLineWidth ( int  aWidth)
inlineinherited

Definition at line 258 of file pcb_plot_params.h.

258 { m_sketchPadLineWidth = aWidth; }

References PCB_PLOT_PARAMS::m_sketchPadLineWidth.

Referenced by DIALOG_PLOT::Plot().

◆ SetSketchPadsOnFabLayers()

void PCB_PLOT_PARAMS::SetSketchPadsOnFabLayers ( bool  aFlag)
inlineinherited

Definition at line 256 of file pcb_plot_params.h.

256 { m_sketchPadsOnFabLayers = aFlag; }
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.

References PCB_PLOT_PARAMS::m_sketchPadsOnFabLayers.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetSkipPlotNPTH_Pads()

void PCB_PLOT_PARAMS::SetSkipPlotNPTH_Pads ( bool  aSkip)
inlineinherited

Definition at line 192 of file pcb_plot_params.h.

192 { m_skipNPTH_Pads = aSkip; }

References PCB_PLOT_PARAMS::m_skipNPTH_Pads.

Referenced by DIALOG_EXPORT_SVG::CreateSVGFile(), and PlotOneBoardLayer().

◆ SetSubtractMaskFromSilk()

void PCB_PLOT_PARAMS::SetSubtractMaskFromSilk ( bool  aSubtract)
inlineinherited

Definition at line 321 of file pcb_plot_params.h.

321 { m_subtractMaskFromSilk = aSubtract; };
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)

References PCB_PLOT_PARAMS::m_subtractMaskFromSilk.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetSvgPrecision()

void PCB_PLOT_PARAMS::SetSvgPrecision ( unsigned  aPrecision,
bool  aUseInch 
)
inherited

Definition at line 155 of file pcb_plot_params.cpp.

156 {
157  m_svgUseInch = aUseInch;
159 }
bool m_svgUseInch
units for SVG plot false for metric, true for inch/mils
unsigned m_svgPrecision
precision of coordinates in SVG files: accepted 3 - 6 6 is the internal resolution of Pcbnew
#define SVG_PRECISION_MAX
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
#define SVG_PRECISION_MIN

References Clamp(), SVG_PRECISION_MAX, and SVG_PRECISION_MIN.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetTextMode()

void PCB_PLOT_PARAMS::SetTextMode ( PLOT_TEXT_MODE  aVal)
inlineinherited

Definition at line 211 of file pcb_plot_params.h.

212  {
213  m_textMode = aVal;
214  }
PLOT_TEXT_MODE m_textMode
Choose how represent text with PS, PDF and DXF drivers.

References PCB_PLOT_PARAMS::m_textMode.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetUseAuxOrigin()

void PCB_PLOT_PARAMS::SetUseAuxOrigin ( bool  aAux)
inlineinherited

Definition at line 327 of file pcb_plot_params.h.

327 { m_useAuxOrigin = aAux; };
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.

References PCB_PLOT_PARAMS::m_useAuxOrigin.

Referenced by DIALOG_PLOT::applyPlotSettings(), DIALOG_EXPORT_SVG::CreateSVGFile(), and DIALOG_GENDRILL::UpdateDrillParams().

◆ SetUseGerberProtelExtensions()

void PCB_PLOT_PARAMS::SetUseGerberProtelExtensions ( bool  aUse)
inlineinherited

Definition at line 305 of file pcb_plot_params.h.

305 { m_useGerberProtelExtensions = aUse; }
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ....

References PCB_PLOT_PARAMS::m_useGerberProtelExtensions.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetUseGerberX2format()

void PCB_PLOT_PARAMS::SetUseGerberX2format ( bool  aUse)
inlineinherited

Definition at line 296 of file pcb_plot_params.h.

296 { m_useGerberX2format = aUse; }
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)

References PCB_PLOT_PARAMS::m_useGerberX2format.

Referenced by DIALOG_PLOT::applyPlotSettings().

◆ SetWidthAdjust()

void PCB_PLOT_PARAMS::SetWidthAdjust ( int  aVal)
inlineinherited

Definition at line 247 of file pcb_plot_params.h.

247 { m_widthAdjust = aVal; }
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...

References PCB_PLOT_PARAMS::m_widthAdjust.

Referenced by DIALOG_PLOT::Plot().

Member Data Documentation

◆ m_board

BOARD* BRDITEMS_PLOTTER::m_board
private

Definition at line 65 of file pcbplot.h.

Referenced by BRDITEMS_PLOTTER(), PlotBoardGraphicItems(), and PlotDrillMarks().

◆ m_layerMask

◆ m_plotter


The documentation for this class was generated from the following files: