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 () const
 
void SetLayerSet (LSET aLayerMask)
 
void PlotFootprintGraphicItems (const FOOTPRINT *aFootprint)
 
void PlotFootprintGraphicItem (const FP_SHAPE *aShape)
 
void PlotFootprintTextItem (const FP_TEXT *aText, COLOR4D aColor)
 
void PlotFootprintTextItems (const FOOTPRINT *aFootprint)
 
void PlotDimension (const DIMENSION_BASE *aDim)
 
void PlotPcbTarget (const PCB_TARGET *aMire)
 
void PlotFilledAreas (const ZONE *aZone, const SHAPE_POLY_SET &aPolysList)
 
void PlotPcbText (const PCB_TEXT *aText)
 
void PlotPcbShape (const PCB_SHAPE *aShape)
 
void PlotPad (const 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) const
 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 327 of file pcb_plot_params.h.

327 { 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) const

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 296 of file pcb_plot_params.h.

296 { 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 287 of file pcb_plot_params.h.

287 { 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 ( ) const
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 281 of file pcb_plot_params.h.

281 { return m_format; }
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 312 of file pcb_plot_params.h.

312 { return 6; }

◆ GetGerberPrecision()

int PCB_PLOT_PARAMS::GetGerberPrecision ( ) const
inlineinherited

Definition at line 302 of file pcb_plot_params.h.

302 { 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 331 of file pcb_plot_params.h.

331 { 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 339 of file pcb_plot_params.h.

339 { 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 335 of file pcb_plot_params.h.

335 { 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 293 of file pcb_plot_params.h.

293 { 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 318 of file pcb_plot_params.h.

318 { 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 324 of file pcb_plot_params.h.

324 { 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 315 of file pcb_plot_params.h.

315 { 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 305 of file pcb_plot_params.h.

305 { 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 306 of file pcb_plot_params.h.

306 { 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 321 of file pcb_plot_params.h.

321 { 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 299 of file pcb_plot_params.h.

299 { 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 290 of file pcb_plot_params.h.

290 { 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 }
void PlotPcbTarget(const PCB_TARGET *aMire)
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
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
void PlotPcbText(const PCB_TEXT *aText)
void PlotDimension(const DIMENSION_BASE *aDim)
BOARD * m_board
Definition: pcbplot.h:65
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
void PlotPcbShape(const 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
DRAWINGS & Drawings()
Definition: board.h:308

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 ( const DIMENSION_BASE aDim)

Definition at line 414 of file plot_brditems_plotter.cpp.

415 {
416  if( !m_layerMask[aDim->GetLayer()] )
417  return;
418 
419  PCB_SHAPE draw;
420 
421  draw.SetWidth( aDim->GetLineThickness() );
422  draw.SetLayer( aDim->GetLayer() );
423 
424  COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
425 
426  // Set plot color (change WHITE to LIGHTGRAY because
427  // the white items are not seen on a white paper or screen
429 
430  PlotPcbText( &aDim->Text() );
431 
432  for( const std::shared_ptr<SHAPE>& shape : aDim->GetShapes() )
433  {
434  switch( shape->Type() )
435  {
436  case SH_SEGMENT:
437  {
438  const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
439 
441  draw.SetStart( wxPoint( seg.A ) );
442  draw.SetEnd( wxPoint( seg.B ) );
443 
444  PlotPcbShape( &draw );
445  break;
446  }
447 
448  case SH_CIRCLE:
449  {
450  wxPoint start( shape->Centre() );
451  int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
452 
454  draw.SetFilled( false );
455  draw.SetStart( start );
456  draw.SetEnd( wxPoint( start.x + radius, start.y ) );
457 
458  PlotPcbShape( &draw );
459  break;
460  }
461 
462  default:
463  break;
464  }
465  }
466 }
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
int color
Definition: DXF_plotter.cpp:60
PLOTTER * m_plotter
Definition: pcbplot.h:64
void PlotPcbText(const PCB_TEXT *aText)
int GetLineThickness() const
Definition: dimension.h:187
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
Definition: dimension.h:215
PCB_TEXT & Text()
Definition: dimension.h:209
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(const PCB_SHAPE *aShape)
LSET m_layerMask
Definition: pcbplot.h:66
VECTOR2I A
Definition: seg.h:49
usual segment : line with rounded ends
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
COLOR_SETTINGS * ColorSettings() const
void SetShape(PCB_SHAPE_TYPE aShape)
Definition: pcb_shape.h:129
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
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, CIRCLE, color, PCB_PLOT_PARAMS::ColorSettings(), COLOR_SETTINGS::GetColor(), BOARD_ITEM::GetLayer(), DIMENSION_BASE::GetLineThickness(), DIMENSION_BASE::GetShapes(), LIGHTGRAY, m_layerMask, m_plotter, PlotPcbShape(), PlotPcbText(), 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 1018 of file plot_brditems_plotter.cpp.

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

References BLACK, FILLED, BOARD::Footprints(), ADVANCED_CFG::GetCfg(), PCB_PLOT_PARAMS::GetDrillMarksType(), PCB_PLOT_PARAMS::GetPlotMode(), m_board, m_plotter, Millimeter2iu(), pad, PAD_DRILL_SHAPE_CIRCLE, plotOneDrillMark(), PLOTTER::SetColor(), PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, BOARD::Tracks(), via, and WHITE.

Referenced by PlotStandardLayer().

◆ PlotFilledAreas()

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

Definition at line 758 of file plot_brditems_plotter.cpp.

759 {
760  if( polysList.IsEmpty() )
761  return;
762 
763  GBR_METADATA gbr_metadata;
764 
765  bool isOnCopperLayer = aZone->IsOnCopperLayer();
766 
767  if( isOnCopperLayer )
768  {
769  gbr_metadata.SetNetName( aZone->GetNetname() );
770  gbr_metadata.SetCopper( true );
771 
772  // Zones with no net name can exist.
773  // they are not used to connect items, so the aperture attribute cannot
774  // be set as conductor
775  if( aZone->GetNetname().IsEmpty() )
776  {
778  }
779  else
780  {
783  }
784  }
785 
786  // We need a buffer to store corners coordinates:
787  std::vector< wxPoint > cornerList;
788 
789  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
790 
791  m_plotter->StartBlock( nullptr ); // Clean current object attributes
792 
793  /* Plot all filled areas: filled areas have a filled area and a thick
794  * outline (depending on the fill area option we must plot the filled area itself
795  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
796  *
797  * in non filled mode the outline is plotted, but not the filling items
798  */
799  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
800 
801  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
802  {
803  const SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
804 
805  cornerList.clear();
806  cornerList.reserve( outline.PointCount() );
807 
808  for( int ic = 0; ic < outline.PointCount(); ++ic )
809  {
810  cornerList.emplace_back( wxPoint( outline.CPoint( ic ) ) );
811  }
812 
813  if( cornerList.size() ) // Plot the current filled area outline
814  {
815  // First, close the outline
816  if( cornerList[0] != cornerList[cornerList.size() - 1] )
817  cornerList.push_back( cornerList[0] );
818 
819  // Plot the current filled area (as region for Gerber plotter
820  // to manage attributes) and its outline for thick outline
821  if( GetPlotMode() == FILLED )
822  {
824  {
825  if( outline_thickness > 0 )
826  {
827  m_plotter->PlotPoly( cornerList, FILL_TYPE::NO_FILL, outline_thickness,
828  &gbr_metadata );
829  }
830 
831  static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion( cornerList,
832  &gbr_metadata );
833  }
834  else
835  {
836  m_plotter->PlotPoly( cornerList, FILL_TYPE::FILLED_SHAPE, outline_thickness,
837  &gbr_metadata );
838  }
839  }
840  else
841  {
842  if( outline_thickness )
843  {
844  for( unsigned jj = 1; jj < cornerList.size(); jj++ )
845  {
846  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
847  outline_thickness, GetPlotMode(), &gbr_metadata );
848  }
849  }
850 
852  }
853  }
854  }
855 
856  m_plotter->EndBlock( nullptr ); // Clear object attributes
857 }
OUTLINE_MODE GetPlotMode() const
COLOR4D getColor(LAYER_NUM aLayer) const
Function getColor.
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:241
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:216
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
Definition: zone.cpp:222
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)
bool GetFilledPolysUseThickness() const
Definition: zone.h:686
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 ( const FP_SHAPE aShape)

Definition at line 537 of file plot_brditems_plotter.cpp.

538 {
539  if( aShape->Type() != PCB_FP_SHAPE_T )
540  return;
541 
542  m_plotter->SetColor( getColor( aShape->GetLayer() ) );
543 
544  bool sketch = GetPlotMode() == SKETCH;
545  int thickness = aShape->GetWidth();
546  wxPoint pos( aShape->GetStart() );
547  wxPoint end( aShape->GetEnd() );
548 
549  GBR_METADATA gbr_metadata;
551  const FOOTPRINT* parent = static_cast<const FOOTPRINT*> ( aShape->GetParent() );
552  gbr_metadata.SetCmpReference( parent->GetReference() );
553 
554  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
555 
556  if( aShape->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
557  {
558  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
559  }
560  else if( isOnCopperLayer ) // only for items not on Edge_Cuts.
561  {
562  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
563  gbr_metadata.SetCopper( true );
564  }
565 
566  int radius; // Circle/arc radius.
567 
568  switch( aShape->GetShape() )
569  {
571  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
572  break;
573 
575  {
576  std::vector<wxPoint> pts = aShape->GetRectCorners();
577 
578  if( sketch || thickness > 0 )
579  {
580  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
581  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
582  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
583  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
584  }
585 
586  if( !sketch && aShape->IsFilled() )
587  {
588  SHAPE_LINE_CHAIN poly;
589 
590  for( const wxPoint& pt : pts )
591  poly.Append( pt );
592 
593  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata );
594  }
595  }
596  break;
597 
599  radius = KiROUND( GetLineLength( end, pos ) );
600 
601  if( aShape->IsFilled() )
602  m_plotter->FilledCircle( pos, radius * 2 + thickness, GetPlotMode(), &gbr_metadata );
603  else
604  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
605 
606  break;
607 
608  case PCB_SHAPE_TYPE::ARC:
609  {
610  radius = KiROUND( GetLineLength( end, pos ) );
611  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
612  double endAngle = startAngle + aShape->GetAngle();
613 
614  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
615  if( std::abs( aShape->GetAngle() ) == 3600.0 )
616  {
617  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
618  }
619  else
620  {
621  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(),
622  &gbr_metadata );
623  }
624  }
625  break;
626 
628  if( aShape->IsPolyShapeValid() )
629  {
630  const std::vector<wxPoint> &polyPoints = aShape->BuildPolyPointsList();
631 
632  // We must compute board coordinates from m_PolyList which are relative to the parent
633  // position at orientation 0
634  const FOOTPRINT *parentFootprint = aShape->GetParentFootprint();
635 
636  std::vector<wxPoint> cornerList;
637 
638  cornerList.reserve( polyPoints.size() );
639 
640  for( wxPoint corner : polyPoints )
641  {
642  if( parentFootprint )
643  {
644  RotatePoint( &corner, parentFootprint->GetOrientation() );
645  corner += parentFootprint->GetPosition();
646  }
647 
648  cornerList.push_back( corner );
649  }
650 
651  if( sketch || thickness > 0 )
652  {
653  for( size_t i = 1; i < cornerList.size(); i++ )
654  {
655  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
656  GetPlotMode(), &gbr_metadata );
657  }
658 
659  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
660  GetPlotMode(), &gbr_metadata );
661 
662  }
663 
664  if( !sketch && aShape->IsFilled() )
665  {
666  // This must be simplified and fractured to prevent overlapping polygons
667  // from generating invalid Gerber files
668 
669  SHAPE_LINE_CHAIN line( cornerList );
670  SHAPE_POLY_SET tmpPoly;
671 
672  line.SetClosed( true );
673  tmpPoly.AddOutline( line );
675 
676  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
677  {
678  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
679  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata );
680  }
681  }
682  }
683  break;
684 
686  m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezControl1(),
687  aShape->GetBezControl2(), aShape->GetEnd(), 0, thickness );
688  break;
689 
690  default:
691  wxASSERT_MSG( false, "Unhandled FP_SHAPE shape" );
692  break;
693  }
694 }
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:1215
OUTLINE_MODE GetPlotMode() const
COLOR4D getColor(LAYER_NUM aLayer) const
Function getColor.
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
PCB_SHAPE_TYPE GetShape() const
Definition: pcb_shape.h:130
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
std::vector< wxPoint > GetRectCorners() const
Definition: pcb_shape.cpp:971
int GetWidth() const
Definition: pcb_shape.h:118
PLOTTER * m_plotter
Definition: pcbplot.h:64
double GetOrientation() const
Definition: footprint.h:186
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 )
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
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()
polygon (not yet used for tracks, but could be in microwave apps)
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:1198
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
segment with non rounded ends
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:426
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:479
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
usual segment : line with rounded ends
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
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:182
Arcs (with rounded ends)
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
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
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163

References SHAPE_POLY_SET::AddOutline(), LSET::AllCuMask(), SHAPE_LINE_CHAIN::Append(), ARC, ArcTangente(), PLOTTER::BezierCurve(), PCB_SHAPE::BuildPolyPointsList(), CIRCLE, CURVE, 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, POLYGON, RECT, RotatePoint(), 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 ( const FOOTPRINT aFootprint)

Definition at line 524 of file plot_brditems_plotter.cpp.

525 {
526  for( const BOARD_ITEM* item : aFootprint->GraphicalItems() )
527  {
528  const FP_SHAPE* shape = dynamic_cast<const FP_SHAPE*>( item );
529 
530  if( shape && m_layerMask[ shape->GetLayer() ] )
531  PlotFootprintGraphicItem( shape );
532  }
533 }
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
void PlotFootprintGraphicItem(const FP_SHAPE *aShape)
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
LSET m_layerMask
Definition: pcbplot.h:66
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 ( const 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;
398 
399  if( IsCopperLayer( aTextMod->GetLayer() ) )
401 
402  gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
403  const FOOTPRINT* parent = static_cast<const FOOTPRINT*> ( aTextMod->GetParent() );
404  gbr_metadata.SetCmpReference( parent->GetReference() );
405 
406  m_plotter->SetCurrentLineWidth( thickness );
407 
408  m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size,
409  aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), thickness,
410  aTextMod->IsItalic(), allow_bold, false, &gbr_metadata );
411 }
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
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:426
Metadata which can be added in a gerber file as attribute in X2 format.
Definition: gbr_metadata.h:204
Definition: color4d.h:48
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
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_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, FP_TEXT::GetDrawRotation(), EDA_TEXT::GetEffectiveTextPenWidth(), EDA_TEXT::GetHorizJustify(), BOARD_ITEM::GetLayer(), BOARD_ITEM::GetParent(), FOOTPRINT::GetReference(), FP_TEXT::GetShownText(), EDA_TEXT::GetTextPos(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), IsCopperLayer(), EDA_TEXT::IsItalic(), EDA_TEXT::IsMirrored(), LIGHTGRAY, m_plotter, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), PLOTTER::Text(), and WHITE.

Referenced by PlotFootprintTextItems().

◆ PlotFootprintTextItems()

void BRDITEMS_PLOTTER::PlotFootprintTextItems ( const FOOTPRINT aFootprint)

Definition at line 289 of file plot_brditems_plotter.cpp.

290 {
291  const 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( const BOARD_ITEM* item : aFootprint->GraphicalItems() )
311  {
312  textItem = dyn_cast<const 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 }
COLOR4D getColor(LAYER_NUM aLayer) const
Function getColor.
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:462
FP_TEXT & Reference()
Definition: footprint.h:463
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
void PlotFootprintTextItem(const FP_TEXT *aText, COLOR4D aColor)

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 993 of file plot_brditems_plotter.cpp.

996 {
997  // Small drill marks have no significance when applied to slots
998  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
999  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
1000 
1001  // Round holes only have x diameter, slots have both
1002  aDrillSize.x -= getFineWidthAdj();
1003  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
1004 
1005  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
1006  {
1007  aDrillSize.y -= getFineWidthAdj();
1008  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
1009  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
1010  }
1011  else
1012  {
1013  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
1014  }
1015 }
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
int getFineWidthAdj() const
Definition: pcbplot.h:81
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
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 ( const 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 
236  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
237  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
238  break;
239 
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
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
PAD_PROP GetProperty() const
Definition: pad.h:374
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:219
Like smd, does not appear on the solder paste layer (default)
Smd pad, appears on the solder paste layer (default)
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
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
aperture used for castellated pads in drill files.
Definition: gbr_metadata.h:134
a test point pad
Plated through hole pad.
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
Flash a trapezoidal pad.
void SetPadPinFunction(const wxString &aPadPinFunction, bool aUseUTF8, bool aEscapeString)
Definition: gbr_metadata.h:236
a pad used as heat sink, usually in SMD footprints
aperture used for edge connector pad (outer layers).
Definition: gbr_metadata.h:117
wxPoint ShapePos() const
Definition: pad.cpp:656
like PAD_PTH, but not plated
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:349
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
Smd pad, used in BGA footprints.
const wxString & GetName() const
Definition: pad.h:133
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
Definition: lset.cpp:780
PAD_SHAPE GetShape() const
Definition: pad.h:169
const wxString & GetReference() const
Definition: footprint.h:426
a fiducial (usually a smd) local to the parent footprint
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
aperture used for test point pad (outer layers).
Definition: gbr_metadata.h:122
int GetRoundRectCornerRadius() const
Definition: pad.cpp:236
Definition: color4d.h:48
const wxSize & GetDelta() const
Definition: pad.h:239
FOOTPRINT * GetParent() const
Definition: pad.cpp:1334
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:229
a fiducial (usually a smd) for the full board
double GetChamferRectRatio() const
Definition: pad.h:532
no special fabrication property
PAD_ATTRIB GetAttribute() const
Definition: pad.h:371
LSET m_layerMask
Definition: pcbplot.h:66
aperture used for heat sink pad (typically for SMDs).
Definition: gbr_metadata.h:128
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: pad.cpp:267
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:542
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
a pad with a castellated through hole
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
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(), BGA, CASTELLATED, CHAMFERED_RECT, CIRCLE, CONN, CUSTOM, LSET::ExternalCuMask(), FIDUCIAL_GLBL, FIDUCIAL_LOCAL, 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(), HEATSINK, KI_FALLTHROUGH, LIGHTGRAY, m_layerMask, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, m_plotter, NONE, NPTH, OVAL, PTH, RECT, ROUNDRECT, 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, SMD, TESTPOINT, TRAPEZOID, and WHITE.

Referenced by PlotStandardLayer().

◆ PlotPcbShape()

void BRDITEMS_PLOTTER::PlotPcbShape ( const PCB_SHAPE aShape)

Definition at line 862 of file plot_brditems_plotter.cpp.

863 {
864  if( !m_layerMask[aShape->GetLayer()] )
865  return;
866 
867  int radius = 0;
868  double StAngle = 0, EndAngle = 0;
869  bool sketch = GetPlotMode() == SKETCH;
870  int thickness = aShape->GetWidth();
871 
872  m_plotter->SetColor( getColor( aShape->GetLayer() ) );
873 
874  wxPoint start( aShape->GetStart() );
875  wxPoint end( aShape->GetEnd() );
876 
877  GBR_METADATA gbr_metadata;
878 
879  if( aShape->GetLayer() == Edge_Cuts )
881 
882  if( IsCopperLayer( aShape->GetLayer() ) )
883  // Graphic items (PCB_SHAPE, TEXT) having no net have the NonConductor attribute
884  // Graphic items having a net have the Conductor attribute, but are not (yet?)
885  // supported in Pcbnew
886  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
887 
888  switch( aShape->GetShape() )
889  {
891  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
892  break;
893 
895  radius = KiROUND( GetLineLength( end, start ) );
896 
897  if( aShape->IsFilled() )
898  m_plotter->FilledCircle( start, radius * 2 + thickness, GetPlotMode(), &gbr_metadata );
899  else
900  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
901 
902  break;
903 
904  case PCB_SHAPE_TYPE::ARC:
905  radius = KiROUND( GetLineLength( end, start ) );
906  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
907  EndAngle = StAngle + aShape->GetAngle();
908 
909  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
910  if( std::abs( aShape->GetAngle() ) == 3600.0 )
911  {
912  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
913  }
914  else
915  {
916  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(),
917  &gbr_metadata );
918  }
919  break;
920 
922  m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezControl1(),
923  aShape->GetBezControl2(), aShape->GetEnd(), 0, thickness );
924  break;
925 
927  if( aShape->IsPolyShapeValid() )
928  {
929  if( sketch || thickness > 0 )
930  {
931  for( auto it = aShape->GetPolyShape().CIterateSegments( 0 ); it; it++ )
932  {
933  auto seg = it.Get();
934  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
935  thickness, GetPlotMode(), &gbr_metadata );
936  }
937  }
938 
939  if( !sketch && aShape->IsFilled() )
940  {
941  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
942  // Draw the polygon: only one polygon is expected
943  // However we provide a multi polygon shape drawing
944  // ( for the future or to show a non expected shape )
945  // This must be simplified and fractured to prevent overlapping polygons
946  // from generating invalid Gerber files
947  auto tmpPoly = SHAPE_POLY_SET( aShape->GetPolyShape() );
949 
950  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
951  {
952  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
953  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata );
954  }
955  }
956  }
957  break;
958 
960  {
961  std::vector<wxPoint> pts = aShape->GetRectCorners();
962 
963  if( sketch || thickness > 0 )
964  {
965  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
966  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
967  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
968  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
969  }
970 
971  if( !sketch && aShape->IsFilled() )
972  {
973  SHAPE_LINE_CHAIN poly;
974 
975  for( const wxPoint& pt : pts )
976  poly.Append( pt );
977 
978  m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata );
979  }
980  }
981  break;
982 
983  default:
984  wxASSERT_MSG( false, "Unhandled PCB_SHAPE shape" );
985  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
986  }
987 }
bool IsPolyShapeValid() const
Definition: pcb_shape.cpp:1215
OUTLINE_MODE GetPlotMode() const
COLOR4D getColor(LAYER_NUM aLayer) const
Function getColor.
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
PCB_SHAPE_TYPE GetShape() const
Definition: pcb_shape.h:130
std::vector< wxPoint > GetRectCorners() const
Definition: pcb_shape.cpp:971
int GetWidth() const
Definition: pcb_shape.h:118
PLOTTER * m_plotter
Definition: pcbplot.h:64
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 )
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
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()
polygon (not yet used for tracks, but could be in microwave apps)
Represent a set of closed polygons.
segment with non rounded ends
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
usual segment : line with rounded ends
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.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:209
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
Arcs (with rounded ends)
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
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References SHAPE_LINE_CHAIN::Append(), ARC, ArcTangente(), PLOTTER::BezierCurve(), CIRCLE, SHAPE_POLY_SET::CIterateSegments(), CURVE, 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, POLYGON, RECT, 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 ( const PCB_TARGET aMire)

Definition at line 469 of file plot_brditems_plotter.cpp.

470 {
471  int dx1, dx2, dy1, dy2, radius;
472 
473  if( !m_layerMask[aMire->GetLayer()] )
474  return;
475 
476  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
477 
478  PCB_SHAPE draw;
479 
481  draw.SetFilled( false );
482  draw.SetWidth( aMire->GetWidth() );
483  draw.SetLayer( aMire->GetLayer() );
484  draw.SetStart( aMire->GetPosition() );
485  radius = aMire->GetSize() / 3;
486 
487  if( aMire->GetShape() ) // shape X
488  radius = aMire->GetSize() / 2;
489 
490  // Draw the circle
491  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ) );
492 
493  PlotPcbShape( &draw );
494 
496 
497  radius = aMire->GetSize() / 2;
498  dx1 = radius;
499  dy1 = 0;
500  dx2 = 0;
501  dy2 = radius;
502 
503  if( aMire->GetShape() ) // Shape X
504  {
505  dx1 = dy1 = radius;
506  dx2 = dx1;
507  dy2 = -dy1;
508  }
509 
510  wxPoint mirePos( aMire->GetPosition() );
511 
512  // Draw the X or + shape:
513  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ) );
514  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ) );
515  PlotPcbShape( &draw );
516 
517  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ) );
518  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ) );
519  PlotPcbShape( &draw );
520 }
COLOR4D getColor(LAYER_NUM aLayer) const
Function getColor.
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
int GetSize() const
Definition: pcb_target.h:67
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
PLOTTER * m_plotter
Definition: pcbplot.h:64
wxPoint GetPosition() const override
Definition: pcb_target.h:61
int GetWidth() const
Definition: pcb_target.h:70
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(const PCB_SHAPE *aShape)
LSET m_layerMask
Definition: pcbplot.h:66
int GetShape() const
Definition: pcb_target.h:64
usual segment : line with rounded ends
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
void SetShape(PCB_SHAPE_TYPE aShape)
Definition: pcb_shape.h:129
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:159

References CIRCLE, getColor(), BOARD_ITEM::GetLayer(), PCB_TARGET::GetPosition(), PCB_TARGET::GetShape(), PCB_TARGET::GetSize(), PCB_SHAPE::GetStart(), PCB_TARGET::GetWidth(), m_layerMask, m_plotter, PlotPcbShape(), 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 ( const PCB_TEXT aText)

Definition at line 698 of file plot_brditems_plotter.cpp.

699 {
700  wxString shownText( aText->GetShownText() );
701 
702  if( shownText.IsEmpty() )
703  return;
704 
705  if( !m_layerMask[aText->GetLayer()] )
706  return;
707 
708  GBR_METADATA gbr_metadata;
709 
710  if( IsCopperLayer( aText->GetLayer() ) )
712 
713  COLOR4D color = getColor( aText->GetLayer() );
715 
716  wxSize size = aText->GetTextSize();
717  wxPoint pos = aText->GetTextPos();
718  double orient = aText->GetTextAngle();
719  int thickness = aText->GetEffectiveTextPenWidth();
720 
721  if( aText->IsMirrored() )
722  size.x = -size.x;
723 
724  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
725  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
726  // (like bold text) and we manage the thickness.
727  // So we set bold flag to true
728  bool allow_bold = true;
729 
730  m_plotter->SetCurrentLineWidth( thickness );
731 
732  if( aText->IsMultilineAllowed() )
733  {
734  std::vector<wxPoint> positions;
735  wxArrayString strings_list;
736  wxStringSplit( shownText, strings_list, '\n' );
737  positions.reserve( strings_list.Count() );
738 
739  aText->GetLinePositions( positions, strings_list.Count() );
740 
741  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
742  {
743  wxString& txt = strings_list.Item( ii );
744  m_plotter->Text( positions[ii], color, txt, orient, size, aText->GetHorizJustify(),
745  aText->GetVertJustify(), thickness, aText->IsItalic(),
746  allow_bold, false, &gbr_metadata );
747  }
748  }
749  else
750  {
751  m_plotter->Text( pos, color, shownText, orient, size, aText->GetHorizJustify(),
752  aText->GetVertJustify(), thickness, aText->IsItalic(), allow_bold,
753  false, &gbr_metadata );
754  }
755 }
COLOR4D getColor(LAYER_NUM aLayer) const
Function getColor.
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:828
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:420
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
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 326 of file pcb_plot_params.h.

326 { 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 295 of file pcb_plot_params.h.

295 { 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 286 of file pcb_plot_params.h.

286 { 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.

280 { m_format = aFormat; }
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 338 of file pcb_plot_params.h.

338 { 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 292 of file pcb_plot_params.h.

292 { 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 317 of file pcb_plot_params.h.

317 { 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 283 of file pcb_plot_params.h.

283 { 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 323 of file pcb_plot_params.h.

323 { 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 314 of file pcb_plot_params.h.

314 { 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 320 of file pcb_plot_params.h.

320 { 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 298 of file pcb_plot_params.h.

298 { 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 289 of file pcb_plot_params.h.

289 { 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: