KiCad PCB EDA Suite
BRDITEMS_PLOTTER Class Reference

#include <pcbplot.h>

Inheritance diagram for BRDITEMS_PLOTTER:
PCB_PLOT_PARAMS

Public Types

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

Public Member Functions

 BRDITEMS_PLOTTER (PLOTTER *aPlotter, BOARD *aBoard, const PCB_PLOT_PARAMS &aPlotOpts)
 
int getFineWidthAdj ()
 
void SetLayerSet (LSET aLayerMask)
 
void PlotFootprintGraphicItems (MODULE *aModule)
 
void PlotFootprintGraphicItem (EDGE_MODULE *aEdge)
 
void PlotFootprintTextItem (TEXTE_MODULE *aTextMod, COLOR4D aColor)
 
void PlotFootprintTextItems (MODULE *aModule)
 
void PlotDimension (DIMENSION *Dimension)
 
void PlotPcbTarget (PCB_TARGET *PtMire)
 
void PlotFilledAreas (ZONE_CONTAINER *aZone, SHAPE_POLY_SET &aPolysList)
 
void PlotTextePcb (TEXTE_PCB *pt_texte)
 
void PlotDrawSegment (DRAWSEGMENT *PtSegm)
 
void PlotPad (D_PAD *aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPlotMode)
 Plot a pad. More...
 
void PlotBoardGraphicItems ()
 plot items like text and graphics, but not tracks and modules More...
 
void PlotDrillMarks ()
 Function PlotDrillMarks Draw a drill mark for pads and vias. More...
 
COLOR4D getColor (LAYER_NUM aLayer)
 Function getColor. More...
 
void SetSkipPlotNPTH_Pads (bool aSkip)
 
bool GetSkipPlotNPTH_Pads () const
 
void Format (OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
 
void Parse (PCB_PLOT_PARAMS_PARSER *aParser)
 
bool IsSameAs (const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms) const
 Compare current settings to aPcbPlotParams, including not saved parameters in brd file. More...
 
void SetColor (COLOR4D aVal)
 
COLOR4D GetColor () const
 
void SetColorSettings (COLOR_SETTINGS *aSettings)
 
COLOR_SETTINGSColorSettings () const
 
void SetTextMode (PLOT_TEXT_MODE aVal)
 
PLOT_TEXT_MODE GetTextMode () const
 
void SetPlotMode (EDA_DRAW_MODE_T aPlotMode)
 
EDA_DRAW_MODE_T GetPlotMode () const
 
void SetDXFPlotPolygonMode (bool aFlag)
 
bool GetDXFPlotPolygonMode () const
 
void SetDXFPlotUnits (DXF_PLOTTER::DXF_UNITS aUnit)
 
DXF_PLOTTER::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 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 64 of file pcbplot.h.

Member Enumeration Documentation

◆ DrillMarksType

Enumerator
NO_DRILL_SHAPE 
SMALL_DRILL_SHAPE 
FULL_DRILL_SHAPE 

Definition at line 42 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 71 of file pcbplot.h.

72  : PCB_PLOT_PARAMS( aPlotOpts )
73  {
74  m_plotter = aPlotter;
75  m_board = aBoard;
76  }
PLOTTER * m_plotter
Definition: pcbplot.h:66
BOARD * m_board
Definition: pcbplot.h:67

References m_board, and m_plotter.

Member Function Documentation

◆ ColorSettings()

COLOR_SETTINGS* PCB_PLOT_PARAMS::ColorSettings ( ) const
inlineinherited

Definition at line 213 of file pcb_plot_params.h.

213 { 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 171 of file pcb_plot_params.cpp.

173 {
174  const char* falseStr = getTokenName( T_false );
175  const char* trueStr = getTokenName( T_true );
176 
177  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
178 
179  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
180  m_layerSelection.FmtHex().c_str() );
181 
182  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
183  m_useGerberProtelExtensions ? trueStr : falseStr );
184 
185  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ),
186  GetUseGerberX2format() ? trueStr : falseStr );
187 
188  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ),
189  GetIncludeGerberNetlistInfo() ? trueStr : falseStr );
190 
191  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ),
192  GetCreateGerberJobFile() ? trueStr : falseStr );
193 
194  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
195  // to avoid incompatibility with older Pcbnew version
196  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
197  getTokenName( T_gerberprecision ), m_gerberPrecision );
198 
199  // Svg options
200  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_svguseinch ),
201  m_svgUseInch ? trueStr : falseStr );
202  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_svgprecision ),
203  m_svgPrecision );
204 
205  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
206  m_excludeEdgeLayer ? trueStr : falseStr );
207  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_linewidth ),
209  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
210  m_plotFrameRef ? trueStr : falseStr );
211  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
212  m_plotViaOnMaskLayer ? trueStr : falseStr );
213  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
214  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
215  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
216  m_useAuxOrigin ? trueStr : falseStr );
217  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
218  m_HPGLPenNum );
219 
220  // Obsolete parameter, pen speed is no more managed, because hpgl format
221  // is now an export format, and for this, pen speed has no meaning
222  // aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
223  // m_HPGLPenSpeed );
224 
225  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
226  m_HPGLPenSpeed );
227  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_hpglpendiameter ),
228  m_HPGLPenDiam );
229  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
230  m_negative ? trueStr : falseStr );
231  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
232  m_A4Output ? trueStr : falseStr );
233  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
234  m_plotReference ? trueStr : falseStr );
235  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
236  m_plotValue ? trueStr : falseStr );
237  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
238  m_plotInvisibleText ? trueStr : falseStr );
239  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_sketchpadsonfab ),
240  m_sketchPadsOnFabLayers ? trueStr : falseStr );
241  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
242  m_subtractMaskFromSilk ? trueStr : falseStr );
243  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
244  static_cast<int>( m_format ) );
245  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
246  m_mirror ? trueStr : falseStr );
247  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
248  m_drillMarks );
249  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
251  aFormatter->Print( aNestLevel+1, "(%s \"%s\")", getTokenName( T_outputdirectory ),
252  (const char*) m_outputDirectory.utf8_str() );
253  aFormatter->Print( 0, "\n" );
254  aFormatter->Print( aNestLevel, ")\n" );
255 }
bool m_plotValue
Enable plotting of part values.
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.
static constexpr double IU_PER_MM
Mock up a conversion function.
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
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_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)
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
LSET m_layerSelection
Set of layers to plot.
std::string FmtHex() const
Function FmtHex returns a hex string showing contents of this LSEQ.
Definition: lset.cpp:288
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,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
int m_lineWidth
The default line width (used to draw items having no defined width)
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches,...
EDA_DRAW_MODE_T GetPlotMode() const

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

Referenced by PCB_IO::formatSetup().

◆ GetA4Output()

bool PCB_PLOT_PARAMS::GetA4Output ( ) const
inlineinherited

Definition at line 335 of file pcb_plot_params.h.

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

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

References PCB_PLOT_PARAMS::m_autoScale.

Referenced by initializePlotter().

◆ getColor()

COLOR4D BRDITEMS_PLOTTER::getColor ( LAYER_NUM  aLayer)

Function getColor.

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

Definition at line 73 of file plot_brditems_plotter.cpp.

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

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

Referenced by PlotDrawSegment(), PlotFilledAreas(), PlotFootprintGraphicItem(), PlotFootprintTextItems(), PlotPcbTarget(), PlotStandardLayer(), and PlotTextePcb().

◆ GetColor()

COLOR4D PCB_PLOT_PARAMS::GetColor ( ) const
inlineinherited

Definition at line 209 of file pcb_plot_params.h.

209 { return m_color; }
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.

References PCB_PLOT_PARAMS::m_color.

Referenced by PlotDrillMarks(), and PlotOneBoardLayer().

◆ GetCreateGerberJobFile()

bool PCB_PLOT_PARAMS::GetCreateGerberJobFile ( ) const
inlineinherited

Definition at line 304 of file pcb_plot_params.h.

304 { 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().

◆ GetDrillMarksType()

DrillMarksType PCB_PLOT_PARAMS::GetDrillMarksType ( ) const
inlineinherited

Definition at line 242 of file pcb_plot_params.h.

242 { 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 229 of file pcb_plot_params.h.

229 { 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_PLOTTER::DXF_UNITS PCB_PLOT_PARAMS::GetDXFPlotUnits ( ) const
inlineinherited

Definition at line 236 of file pcb_plot_params.h.

237  {
238  return m_DXFplotUnits;
239  }
DXF_PLOTTER::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 282 of file pcb_plot_params.h.

282 { 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 248 of file pcb_plot_params.h.

248 { 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 250 of file pcb_plot_params.h.

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

References PCB_PLOT_PARAMS::m_fineScaleAdjustY.

Referenced by StartPlotBoard().

◆ getFineWidthAdj()

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

Definition at line 83 of file pcbplot.h.

84  {
85  if( GetFormat() == PLOT_FORMAT::POST )
86  return GetWidthAdjust();
87  else
88  return 0;
89  }
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 289 of file pcb_plot_params.h.

290  {
291  return m_format;
292  }
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 320 of file pcb_plot_params.h.

320 { return 6; }

◆ GetGerberPrecision()

int PCB_PLOT_PARAMS::GetGerberPrecision ( ) const
inlineinherited

Definition at line 310 of file pcb_plot_params.h.

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

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

347 { 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 343 of file pcb_plot_params.h.

343 { 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 301 of file pcb_plot_params.h.

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

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

258 { 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 273 of file pcb_plot_params.h.

273 { 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 279 of file pcb_plot_params.h.

279 { 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 266 of file pcb_plot_params.h.

266 { 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()

EDA_DRAW_MODE_T PCB_PLOT_PARAMS::GetPlotMode ( ) const
inlineinherited

Definition at line 226 of file pcb_plot_params.h.

226 { return m_plotMode; }
EDA_DRAW_MODE_T m_plotMode
FILLED or SKETCH selects how to plot filled objects.

References PCB_PLOT_PARAMS::m_plotMode.

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

◆ GetPlotReference()

bool PCB_PLOT_PARAMS::GetPlotReference ( ) const
inlineinherited

Definition at line 270 of file pcb_plot_params.h.

270 { 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 268 of file pcb_plot_params.h.

268 { 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 276 of file pcb_plot_params.h.

276 { 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 245 of file pcb_plot_params.h.

245 { 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 332 of file pcb_plot_params.h.

332 { 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 263 of file pcb_plot_params.h.

263 { return m_sketchPadLineWidth; }

References PCB_PLOT_PARAMS::m_sketchPadLineWidth.

Referenced by PlotPad().

◆ GetSketchPadsOnFabLayers()

bool PCB_PLOT_PARAMS::GetSketchPadsOnFabLayers ( ) const
inlineinherited

Definition at line 261 of file pcb_plot_params.h.

261 { 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 194 of file pcb_plot_params.h.

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

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

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

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

221  {
222  return m_textMode;
223  }
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 329 of file pcb_plot_params.h.

329 { 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 307 of file pcb_plot_params.h.

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

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

252 { 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,
bool  aCompareOnlySavedPrms 
) 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 264 of file pcb_plot_params.cpp.

265 {
266  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
267  return false;
269  return false;
270  if( m_useGerberX2format != aPcbPlotParams.m_useGerberX2format )
271  return false;
273  return false;
274  if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
275  return false;
276  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
277  return false;
278  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
279  return false;
280  if( m_lineWidth != aPcbPlotParams.m_lineWidth )
281  return false;
282  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
283  return false;
284  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
285  return false;
286  if( m_plotMode != aPcbPlotParams.m_plotMode )
287  return false;
288  if( !aCompareOnlySavedPrms )
289  {
290  if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
291  return false;
292  if( m_DXFplotUnits != aPcbPlotParams.m_DXFplotUnits )
293  return false;
294  }
295  if( m_svgPrecision != aPcbPlotParams.m_svgPrecision )
296  return false;
297  if( m_svgUseInch != aPcbPlotParams.m_svgUseInch )
298  return false;
299  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
300  return false;
301  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
302  return false;
303  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
304  return false;
305  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
306  return false;
307  if( m_negative != aPcbPlotParams.m_negative )
308  return false;
309  if( m_A4Output != aPcbPlotParams.m_A4Output )
310  return false;
311  if( m_plotReference != aPcbPlotParams.m_plotReference )
312  return false;
313  if( m_plotValue != aPcbPlotParams.m_plotValue )
314  return false;
315  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
316  return false;
317  if( m_sketchPadsOnFabLayers != aPcbPlotParams.m_sketchPadsOnFabLayers )
318  return false;
319  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
320  return false;
321  if( m_format != aPcbPlotParams.m_format )
322  return false;
323  if( m_mirror != aPcbPlotParams.m_mirror )
324  return false;
325  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
326  return false;
327  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
328  return false;
329  if( m_autoScale != aPcbPlotParams.m_autoScale )
330  return false;
331  if( m_scale != aPcbPlotParams.m_scale )
332  return false;
333  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
334  return false;
335  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
336  return false;
337  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
338  return false;
339  if( !aCompareOnlySavedPrms )
340  {
341  if( m_color != aPcbPlotParams.m_color )
342  return false;
343  }
344  if( m_textMode != aPcbPlotParams.m_textMode )
345  return false;
346  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
347  return false;
348 
349  return true;
350 }
double m_fineScaleAdjustX
fine scale adjust X axis
DXF_PLOTTER::DXF_UNITS m_DXFplotUnits
DXF format: Units to use when plotting the DXF.
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.
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 ....
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
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.
LSET m_layerSelection
Set of layers to plot.
EDA_DRAW_MODE_T m_plotMode
FILLED or SKETCH selects how to plot filled objects.
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_lineWidth
The default line width (used to draw items having no defined width)
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_color, 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_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_lineWidth, 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().

◆ Parse()

void PCB_PLOT_PARAMS::Parse ( PCB_PLOT_PARAMS_PARSER aParser)
inherited

Definition at line 258 of file pcb_plot_params.cpp.

259 {
260  aParser->Parse( this );
261 }
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 modules

Definition at line 306 of file plot_brditems_plotter.cpp.

307 {
308  for( auto item : m_board->Drawings() )
309  {
310  switch( item->Type() )
311  {
312  case PCB_LINE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break;
313  case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break;
314  case PCB_DIMENSION_T: PlotDimension( (DIMENSION*) item ); break;
315  case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break;
316  default: break;
317  }
318  }
319 }
void PlotDimension(DIMENSION *Dimension)
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
BOARD * m_board
Definition: pcbplot.h:67
void PlotPcbTarget(PCB_TARGET *PtMire)
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
void PlotTextePcb(TEXTE_PCB *pt_texte)
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
DRAWINGS & Drawings()
Definition: class_board.h:275
DIMENSION.
void PlotDrawSegment(DRAWSEGMENT *PtSegm)

References BOARD::Drawings(), m_board, PCB_DIMENSION_T, PCB_LINE_T, PCB_TARGET_T, PCB_TEXT_T, PlotDimension(), PlotDrawSegment(), PlotPcbTarget(), and PlotTextePcb().

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

◆ PlotDimension()

void BRDITEMS_PLOTTER::PlotDimension ( DIMENSION Dimension)

Definition at line 356 of file plot_brditems_plotter.cpp.

357 {
358  if( !m_layerMask[aDim->GetLayer()] )
359  return;
360 
361  DRAWSEGMENT draw;
362 
363  draw.SetWidth( aDim->GetWidth() );
364  draw.SetLayer( aDim->GetLayer() );
365 
366  COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
367 
368  // Set plot color (change WHITE to LIGHTGRAY because
369  // the white items are not seen on a white paper or screen
371 
372  PlotTextePcb( &aDim->Text() );
373 
374  draw.SetStart( aDim->m_crossBarO );
375  draw.SetEnd( aDim->m_crossBarF );
376  PlotDrawSegment( &draw );
377 
378  draw.SetStart( aDim->m_featureLineGO);
379  draw.SetEnd( aDim->m_featureLineGF );
380  PlotDrawSegment( &draw );
381 
382  draw.SetStart( aDim->m_featureLineDO );
383  draw.SetEnd( aDim->m_featureLineDF );
384  PlotDrawSegment( &draw );
385 
386  draw.SetStart( aDim->m_crossBarF );
387  draw.SetEnd( aDim->m_arrowD1F );
388  PlotDrawSegment( &draw );
389 
390  draw.SetStart( aDim->m_crossBarF );
391  draw.SetEnd( aDim->m_arrowD2F );
392  PlotDrawSegment( &draw );
393 
394  draw.SetStart( aDim->m_crossBarO );
395  draw.SetEnd( aDim->m_arrowG1F );
396  PlotDrawSegment( &draw );
397 
398  draw.SetStart( aDim->m_crossBarO );
399  draw.SetEnd( aDim->m_arrowG2F );
400  PlotDrawSegment( &draw );
401 }
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
virtual void SetColor(COLOR4D color)=0
int color
Definition: DXF_plotter.cpp:61
PLOTTER * m_plotter
Definition: pcbplot.h:66
void SetStart(const wxPoint &aStart)
Definition: color4d.h:48
COLOR4D GetColor(int aLayer) const
LSET m_layerMask
Definition: pcbplot.h:68
void PlotTextePcb(TEXTE_PCB *pt_texte)
void SetEnd(const wxPoint &aEnd)
COLOR_SETTINGS * ColorSettings() const
void PlotDrawSegment(DRAWSEGMENT *PtSegm)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99
void SetWidth(int aWidth)

References color, PCB_PLOT_PARAMS::ColorSettings(), COLOR_SETTINGS::GetColor(), BOARD_ITEM::GetLayer(), DIMENSION::GetWidth(), LIGHTGRAY, DIMENSION::m_arrowD1F, DIMENSION::m_arrowD2F, DIMENSION::m_arrowG1F, DIMENSION::m_arrowG2F, DIMENSION::m_crossBarF, DIMENSION::m_crossBarO, DIMENSION::m_featureLineDF, DIMENSION::m_featureLineDO, DIMENSION::m_featureLineGF, DIMENSION::m_featureLineGO, m_layerMask, m_plotter, PlotDrawSegment(), PlotTextePcb(), PLOTTER::SetColor(), DRAWSEGMENT::SetEnd(), BOARD_ITEM::SetLayer(), DRAWSEGMENT::SetStart(), DRAWSEGMENT::SetWidth(), DIMENSION::Text(), and WHITE.

Referenced by PlotBoardGraphicItems().

◆ PlotDrawSegment()

void BRDITEMS_PLOTTER::PlotDrawSegment ( DRAWSEGMENT PtSegm)

Definition at line 785 of file plot_brditems_plotter.cpp.

786 {
787  if( !m_layerMask[aSeg->GetLayer()] )
788  return;
789 
790  int radius = 0;
791  double StAngle = 0, EndAngle = 0;
792  int thickness = aSeg->GetWidth();
793 
794  m_plotter->SetColor( getColor( aSeg->GetLayer() ) );
795 
796  wxPoint start( aSeg->GetStart() );
797  wxPoint end( aSeg->GetEnd() );
798 
799  GBR_METADATA gbr_metadata;
800 
801  if( aSeg->GetLayer() == Edge_Cuts )
803 
804  if( IsCopperLayer( aSeg->GetLayer() ) )
805  // Graphic items (DRAWSEGMENT, TEXT) having no net have the NonConductor attribute
806  // Graphic items having a net have the Conductor attribute, but are not (yet?)
807  // supported in Pcbnew
808  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
809 
810  switch( aSeg->GetShape() )
811  {
812  case S_SEGMENT:
813  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
814  break;
815 
816  case S_CIRCLE:
817  radius = KiROUND( GetLineLength( end, start ) );
818  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
819  break;
820 
821  case S_ARC:
822  radius = KiROUND( GetLineLength( end, start ) );
823  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
824  EndAngle = StAngle + aSeg->GetAngle();
825 
826  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
827  if( std::abs( aSeg->GetAngle() ) == 3600.0 )
828  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
829  else
830  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
831  break;
832 
833  case S_CURVE:
834  m_plotter->BezierCurve( aSeg->GetStart(), aSeg->GetBezControl1(), aSeg->GetBezControl2(),
835  aSeg->GetEnd(), 0, thickness );
836  break;
837 
838  case S_POLYGON:
839  {
840  if( !aSeg->IsPolygonFilled() )
841  {
842  for( auto it = aSeg->GetPolyShape().CIterateSegments( 0 ); it; it++ )
843  {
844  auto seg = it.Get();
845  m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
846  thickness, GetPlotMode(), &gbr_metadata );
847  }
848  }
849  else
850  {
851  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
852  // Draw the polygon: only one polygon is expected
853  // However we provide a multi polygon shape drawing
854  // ( for the future or to show a non expected shape )
855  // This must be simplified and fractured to prevent overlapping polygons
856  // from generating invalid Gerber files
857  auto tmpPoly = SHAPE_POLY_SET( aSeg->GetPolyShape() );
859 
860  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
861  {
862  SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
863  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
864  }
865  }
866  }
867  break;
868 
869  case S_RECT:
870  {
871  std::vector<wxPoint> pts;
872  aSeg->GetRectCorners( &pts );
873 
874  if( aSeg->GetWidth() > 0 )
875  {
876  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
877  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
878  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
879  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
880  }
881  else
882  {
883  SHAPE_LINE_CHAIN poly;
884 
885  for( const wxPoint& pt : pts )
886  poly.Append( pt );
887 
888  m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata );
889  }
890  }
891  break;
892 
893  default:
894  wxASSERT_MSG( false, "Unhandled DRAWSEGMENT shape" );
895  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
896  }
897 }
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:206
virtual void SetColor(COLOR4D color)=0
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:569
polygon (not yet used for tracks, but could be in microwave apps)
PLOTTER * m_plotter
Definition: pcbplot.h:66
usual segment : line with rounded ends
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH)
Generic fallback: Cubic Bezier curve rendered as a polyline In Kicad the bezier curves have 4 control...
Definition: plotter.cpp:204
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:531
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
segment with non rounded ends
SHAPE_POLY_SET.
Arcs (with rounded ends)
Bezier Curve.
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:507
LSET m_layerMask
Definition: pcbplot.h:68
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
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:162
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
EDA_DRAW_MODE_T GetPlotMode() const
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

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

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

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

927 {
928  /* If small drills marks were requested prepare a clamp value to pass
929  to the helper function */
930  int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
931  SMALL_DRILL : 0;
932 
933  /* In the filled trace mode drill marks are drawn white-on-black to scrape
934  the underlying pad. This works only for drivers supporting color change,
935  obviously... it means that:
936  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
937  - In HPGL you can't see them
938  - In gerbers you can't see them, too. This is arguably the right thing to
939  do since having drill marks and high speed drill stations is a sure
940  recipe for broken tools and angry manufacturers. If you *really* want them
941  you could start a layer with negative polarity to scrape the film.
942  - In DXF they go into the 'WHITE' layer. This could be useful.
943  */
944  if( GetPlotMode() == FILLED )
946 
947  for( auto pts : m_board->Tracks() )
948  {
949  const VIA* via = dyn_cast<const VIA*>( pts );
950 
951  if( via )
952  {
954  wxSize( via->GetDrillValue(), 0 ),
955  wxSize( via->GetWidth(), 0 ), 0, small_drill );
956  }
957  }
958 
959  for( auto Module : m_board->Modules() )
960  {
961  for( auto pad : Module->Pads() )
962  {
963  if( pad->GetDrillSize().x == 0 )
964  continue;
965 
966  plotOneDrillMark( pad->GetDrillShape(),
967  pad->GetPosition(), pad->GetDrillSize(),
968  pad->GetSize(), pad->GetOrientation(),
969  small_drill );
970  }
971  }
972 
973  if( GetPlotMode() == FILLED )
975 }
#define SMALL_DRILL
Definition: pcbplot.h:60
virtual void SetColor(COLOR4D color)=0
const wxPoint & GetStart() const
Definition: class_track.h:118
PLOTTER * m_plotter
Definition: pcbplot.h:66
BOARD * m_board
Definition: pcbplot.h:67
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
MODULES & Modules()
Definition: class_board.h:266
COLOR4D GetColor() const
Definition: color4d.h:48
int GetWidth() const
Definition: class_track.h:112
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.
DrillMarksType GetDrillMarksType() const
TRACKS & Tracks()
Definition: class_board.h:257
EDA_DRAW_MODE_T GetPlotMode() const

References FILLED, PCB_PLOT_PARAMS::GetColor(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), PCB_PLOT_PARAMS::GetPlotMode(), TRACK::GetStart(), TRACK::GetWidth(), m_board, m_plotter, BOARD::Modules(), PAD_DRILL_SHAPE_CIRCLE, plotOneDrillMark(), PLOTTER::SetColor(), SMALL_DRILL, PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, BOARD::Tracks(), and WHITE.

Referenced by PlotStandardLayer().

◆ PlotFilledAreas()

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

Definition at line 686 of file plot_brditems_plotter.cpp.

687 {
688  if( polysList.IsEmpty() )
689  return;
690 
691  GBR_METADATA gbr_metadata;
692 
693  bool isOnCopperLayer = aZone->IsOnCopperLayer();
694 
695  if( isOnCopperLayer )
696  {
697  gbr_metadata.SetNetName( aZone->GetNetname() );
698  gbr_metadata.SetCopper( true );
699 
700  // Zones with no net name can exist.
701  // they are not used to connect items, so the aperture attribute cannot
702  // be set as conductor
703  if( aZone->GetNetname().IsEmpty() )
705  else
706  {
709  }
710  }
711 
712  // We need a buffer to store corners coordinates:
713  std::vector< wxPoint > cornerList;
714 
715  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
716 
717  m_plotter->StartBlock( nullptr ); // Clean current object attributes
718 
719  /* Plot all filled areas: filled areas have a filled area and a thick
720  * outline (depending on the fill area option we must plot the filled area itself
721  * and plot the thick outline itself, if the thickness has meaning (at least is > 1)
722  *
723  * in non filled mode the outline is plotted, but not the filling items
724  */
725  int outline_thickness = aZone->GetFilledPolysUseThickness() ? aZone->GetMinThickness() : 0;
726 
727  for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
728  {
729  SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
730 
731  cornerList.clear();
732  cornerList.reserve( outline.PointCount() );
733 
734  for( int ic = 0; ic < outline.PointCount(); ++ic )
735  {
736  cornerList.emplace_back( wxPoint( outline.CPoint( ic ) ) );
737  }
738 
739  if( cornerList.size() ) // Plot the current filled area outline
740  {
741  // First, close the outline
742  if( cornerList[0] != cornerList[cornerList.size() - 1] )
743  cornerList.push_back( cornerList[0] );
744 
745  // Plot the current filled area (as region for Gerber plotter
746  // to manage attributes) and its outline for thick outline
747  if( GetPlotMode() == FILLED )
748  {
750  {
751  if( outline_thickness > 0 )
752  m_plotter->PlotPoly( cornerList, NO_FILL,
753  outline_thickness, &gbr_metadata );
754 
755  static_cast<GERBER_PLOTTER*>( m_plotter )->PlotGerberRegion(
756  cornerList, &gbr_metadata );
757  }
758  else
759  m_plotter->PlotPoly( cornerList, FILLED_SHAPE,
760  outline_thickness, &gbr_metadata );
761  }
762  else
763  {
764  if( outline_thickness )
765  {
766  for( unsigned jj = 1; jj < cornerList.size(); jj++ )
767  {
768  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
769  outline_thickness,
770  GetPlotMode(), &gbr_metadata );
771  }
772  }
773 
775  }
776  }
777  }
778 
779  m_plotter->EndBlock( nullptr ); // Clear object attributes
780 }
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:486
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:212
PLOTTER * m_plotter
Definition: pcbplot.h:66
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:477
bool GetFilledPolysUseThickness() const
Definition: class_zone.h:671
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
int PointCount() const
Function PointCount()
const VECTOR2I & CPoint(int aIndex) const
Function Point()
virtual PLOT_FORMAT GetPlotterType() const =0
Returns the effective plot engine in use.
const wxString & GetNetname() const
Function GetNetname.
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:180
SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:507
int GetMinThickness() const
Definition: class_zone.h:206
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
void SetCopper(bool aValue)
Definition: gbr_metadata.h:202
print info associated to a net (TO.N attribute)
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: class_zone.cpp:218
EDA_DRAW_MODE_T GetPlotMode() const
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_CONTAINER::GetFilledPolysUseThickness(), ZONE_CONTAINER::GetLayer(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), PLOTTER::GetPlotterType(), SHAPE_POLY_SET::IsEmpty(), ZONE_CONTAINER::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 ( EDGE_MODULE aEdge)

Definition at line 471 of file plot_brditems_plotter.cpp.

472 {
473  if( aEdge->Type() != PCB_MODULE_EDGE_T )
474  return;
475 
476  m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
477 
478  int thickness = aEdge->GetWidth();
479  wxPoint pos( aEdge->GetStart() );
480  wxPoint end( aEdge->GetEnd() );
481 
482  GBR_METADATA gbr_metadata;
484  MODULE* parent = static_cast<MODULE*> ( aEdge->GetParent() );
485  gbr_metadata.SetCmpReference( parent->GetReference() );
486 
487  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
488 
489  if( isOnCopperLayer )
490  {
491  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
492  gbr_metadata.SetCopper( true );
493  }
494  else if( aEdge->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
495  {
496  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
497  }
498 
499  int radius; // Circle/arc radius.
500 
501  switch( aEdge->GetShape() )
502  {
503  case S_SEGMENT:
504  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
505  break;
506 
507  case S_RECT:
508  {
509  std::vector<wxPoint> pts;
510  aEdge->GetRectCorners( &pts );
511 
512  if( aEdge->GetWidth() > 0 )
513  {
514  m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
515  m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
516  m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
517  m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
518  }
519  else
520  {
521  SHAPE_LINE_CHAIN poly;
522 
523  for( const wxPoint& pt : pts )
524  poly.Append( pt );
525 
526  m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata );
527  }
528  }
529  break;
530 
531  case S_CIRCLE:
532  radius = KiROUND( GetLineLength( end, pos ) );
533 
534  if( aEdge->GetWidth() > 0 )
535  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
536  else
537  m_plotter->Circle( pos, radius * 2, FILLED_SHAPE, -1 );
538 
539  break;
540 
541  case S_ARC:
542  {
543  radius = KiROUND( GetLineLength( end, pos ) );
544  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
545  double endAngle = startAngle + aEdge->GetAngle();
546 
547  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
548  if( std::abs( aEdge->GetAngle() ) == 3600.0 )
549  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
550  else
551  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
552  }
553  break;
554 
555  case S_POLYGON:
556  if( aEdge->IsPolyShapeValid() )
557  {
558  const std::vector<wxPoint> &polyPoints = aEdge->BuildPolyPointsList();
559 
560  // We must compute true coordinates from m_PolyList
561  // which are relative to module position, orientation 0
562  MODULE *module = aEdge->GetParentModule();
563 
564  std::vector<wxPoint> cornerList;
565 
566  cornerList.reserve( polyPoints.size() );
567 
568  for( wxPoint corner : polyPoints )
569  {
570  if( module )
571  {
572  RotatePoint( &corner, module->GetOrientation() );
573  corner += module->GetPosition();
574  }
575 
576  cornerList.push_back( corner );
577  }
578 
579  if( !aEdge->IsPolygonFilled() )
580  {
581  for( size_t i = 1; i < cornerList.size(); i++ )
582  {
583  m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
584  GetPlotMode(), &gbr_metadata );
585  }
586 
587  m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
588  GetPlotMode(), &gbr_metadata );
589 
590  }
591  else
592  {
593  // This must be simplified and fractured to prevent overlapping polygons
594  // from generating invalid Gerber files
595 
596  SHAPE_LINE_CHAIN line( cornerList );
597  SHAPE_POLY_SET tmpPoly;
598 
599  line.SetClosed( true );
600  tmpPoly.AddOutline( line );
602 
603  for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
604  {
605  SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
606  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
607  }
608  }
609  }
610  break;
611 
612  case S_CURVE:
613  m_plotter->BezierCurve( aEdge->GetStart(), aEdge->GetBezControl1(),
614  aEdge->GetBezControl2(), aEdge->GetEnd(),
615  0, thickness );
616  break;
617 
618  default:
619  wxASSERT_MSG( false, "Unhandled EDGE_MODULE shape" );
620  break;
621  }
622 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:712
double GetOrientation() const
Definition: class_module.h:221
aperture used for etched components
Definition: gbr_metadata.h:83
int OutlineCount() const
Returns the number of outlines in the set
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:206
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:569
STROKE_T GetShape() const
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
polygon (not yet used for tracks, but could be in microwave apps)
PLOTTER * m_plotter
Definition: pcbplot.h:66
usual segment : line with rounded ends
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH)
Generic fallback: Cubic Bezier curve rendered as a polyline In Kicad the bezier curves have 4 control...
Definition: plotter.cpp:204
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
const std::vector< wxPoint > BuildPolyPointsList() const
Build and return the list of corners in a std::vector<wxPoint> It must be used only to convert the SH...
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:531
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:444
segment with non rounded ends
SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
Arcs (with rounded ends)
MODULE * GetParentModule() const
Function GetParentModule returns a pointer to the parent module, or NULL if DRAWSEGMENT does not belo...
Bezier Curve.
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
int GetWidth() const
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
double GetAngle() const
SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:507
LSET m_layerMask
Definition: pcbplot.h:68
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
const wxPoint & GetBezControl2() const
bool IsPolyShapeValid() const
const wxPoint & GetBezControl1() const
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
wxPoint GetPosition() const override
Definition: class_module.h:216
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:162
void GetRectCorners(std::vector< wxPoint > *pts) const
BOARD_ITEM_CONTAINER * GetParent() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool IsPolygonFilled() const
Polygonal shape is not always filled.
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
EDA_DRAW_MODE_T GetPlotMode() const

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

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

◆ PlotFootprintGraphicItems()

void BRDITEMS_PLOTTER::PlotFootprintGraphicItems ( MODULE aModule)

Definition at line 458 of file plot_brditems_plotter.cpp.

459 {
460  for( BOARD_ITEM* item : aModule->GraphicalItems() )
461  {
462  EDGE_MODULE* edge = dynamic_cast<EDGE_MODULE*>( item );
463 
464  if( edge && m_layerMask[ edge->GetLayer() ] )
465  PlotFootprintGraphicItem( edge );
466  }
467 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
DRAWINGS & GraphicalItems()
Definition: class_module.h:183
void PlotFootprintGraphicItem(EDGE_MODULE *aEdge)
LSET m_layerMask
Definition: pcbplot.h:68
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.

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

Referenced by PlotStandardLayer().

◆ PlotFootprintTextItem()

void BRDITEMS_PLOTTER::PlotFootprintTextItem ( TEXTE_MODULE aTextMod,
COLOR4D  aColor 
)

Definition at line 321 of file plot_brditems_plotter.cpp.

322 {
323  if( aColor == COLOR4D::WHITE )
324  aColor = COLOR4D( LIGHTGRAY );
325 
326  m_plotter->SetColor( aColor );
327 
328  // calculate some text parameters :
329  wxSize size = aTextMod->GetTextSize();
330  wxPoint pos = aTextMod->GetTextPos();
331  double orient = aTextMod->GetDrawRotation();
332  int thickness = aTextMod->GetEffectiveTextPenWidth();
333 
334  if( aTextMod->IsMirrored() )
335  size.x = -size.x; // Text is mirrored
336 
337  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
338  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
339  // (like bold text) and we manage the thickness.
340  // So we set bold flag to true
341  bool allow_bold = true;
342 
343  GBR_METADATA gbr_metadata;
345  MODULE* parent = static_cast<MODULE*> ( aTextMod->GetParent() );
346  gbr_metadata.SetCmpReference( parent->GetReference() );
347 
348  m_plotter->SetCurrentLineWidth( thickness );
349 
350  m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size,
351  aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), thickness,
352  aTextMod->IsItalic(), allow_bold, false, &gbr_metadata );
353 }
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:200
bool IsMirrored() const
Definition: eda_text.h:189
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
PLOTTER * m_plotter
Definition: pcbplot.h:66
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:157
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:444
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: gr_text.cpp:222
bool IsItalic() const
Definition: eda_text.h:180
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:199
const wxSize & GetTextSize() const
Definition: eda_text.h:239
Definition: color4d.h:48
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
const wxPoint & GetTextPos() const
Definition: eda_text.h:248
BOARD_ITEM_CONTAINER * GetParent() const
double GetDrawRotation() const
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

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

Referenced by PlotFootprintTextItems().

◆ PlotFootprintTextItems()

void BRDITEMS_PLOTTER::PlotFootprintTextItems ( MODULE aModule)

Definition at line 255 of file plot_brditems_plotter.cpp.

256 {
257  TEXTE_MODULE* textModule = &aModule->Reference();
258  LAYER_NUM textLayer = textModule->GetLayer();
259 
260  // Reference and value are specfic items, not in graphic items list
261  if( GetPlotReference() && m_layerMask[textLayer]
262  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
263  {
264  PlotFootprintTextItem( textModule, getColor( textLayer ));
265  }
266 
267  textModule = &aModule->Value();
268  textLayer = textModule->GetLayer();
269 
270  if( GetPlotValue() && m_layerMask[textLayer]
271  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
272  {
273  PlotFootprintTextItem( textModule, getColor( textLayer ));
274  }
275 
276  for( auto item : aModule->GraphicalItems() )
277  {
278  textModule = dyn_cast<TEXTE_MODULE*>( item );
279 
280  if( !textModule )
281  continue;
282 
283  if( !textModule->IsVisible() )
284  continue;
285 
286  textLayer = textModule->GetLayer();
287 
288  if( textLayer >= PCB_LAYER_ID_COUNT )
289  return;
290 
291  if( !m_layerMask[textLayer] )
292  continue;
293 
294  if( textModule->GetText() == wxT( "${REFERENCE}" ) && !GetPlotReference() )
295  continue;
296 
297  if( textModule->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() )
298  continue;
299 
300  PlotFootprintTextItem( textModule, getColor( textLayer ));
301  }
302 }
TEXTE_MODULE & Reference()
Definition: class_module.h:485
bool IsVisible() const
Definition: eda_text.h:186
DRAWINGS & GraphicalItems()
Definition: class_module.h:183
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:484
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
bool GetPlotValue() const
void PlotFootprintTextItem(TEXTE_MODULE *aTextMod, COLOR4D aColor)
LSET m_layerMask
Definition: pcbplot.h:68
bool GetPlotInvisibleText() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool GetPlotReference() const
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.

References getColor(), BOARD_ITEM::GetLayer(), PCB_PLOT_PARAMS::GetPlotInvisibleText(), PCB_PLOT_PARAMS::GetPlotReference(), PCB_PLOT_PARAMS::GetPlotValue(), EDA_TEXT::GetText(), MODULE::GraphicalItems(), EDA_TEXT::IsVisible(), m_layerMask, PCB_LAYER_ID_COUNT, PlotFootprintTextItem(), MODULE::Reference(), and MODULE::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 903 of file plot_brditems_plotter.cpp.

906 {
907  // Small drill marks have no significance when applied to slots
908  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
909  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
910 
911  // Round holes only have x diameter, slots have both
912  aDrillSize.x -= getFineWidthAdj();
913  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
914 
915  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
916  {
917  aDrillSize.y -= getFineWidthAdj();
918  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
919  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
920  }
921  else
922  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
923 }
PLOTTER * m_plotter
Definition: pcbplot.h:66
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
#define NULL
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: util.h:46
int getFineWidthAdj()
Definition: pcbplot.h:83
EDA_DRAW_MODE_T GetPlotMode() const

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

Referenced by PlotDrillMarks().

◆ PlotPad()

void BRDITEMS_PLOTTER::PlotPad ( D_PAD aPad,
COLOR4D  aColor,
EDA_DRAW_MODE_T  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 86 of file plot_brditems_plotter.cpp.

87 {
88  wxPoint shape_pos = aPad->ShapePos();
89  GBR_METADATA gbr_metadata;
90 
91  bool plotOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
92  bool plotOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
93 
94  // Pad not on the solder mask layer cannot be soldered.
95  // therefore it can have a specific aperture attribute.
96  // Not yet in use.
97  // bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
98 
99  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
100 
101  if( plotOnCopperLayer )
102  {
103  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
104  gbr_metadata.SetCopper( true );
105  // Gives a default attribute, for instance for pads used as tracks in net ties:
106  // Connector pads and SMD pads are on external layers
107  // if on internal layers, they are certainly used as net tie
108  // and are similar to tracks: just conductor items
110 
111  const bool useUTF8 = false;
112  const bool useQuoting = false;
113  gbr_metadata.SetPadName( aPad->GetName(), useUTF8, useQuoting );
114 
115  if( !aPad->GetName().IsEmpty() )
116  gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
117 
118  gbr_metadata.SetNetName( aPad->GetNetname() );
119 
120  // Some pads are mechanical pads ( through hole or smd )
121  // when this is the case, they have no pad name and/or are not plated.
122  // In this case gerber files have slightly different attributes.
123  if( aPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED || aPad->GetName().IsEmpty() )
124  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
125 
126  if( !plotOnExternalCopperLayer )
127  {
128  // the .P object attribute (GBR_NETLIST_METADATA::GBR_NETINFO_PAD)
129  // is used on outer layers, unless the component is embedded
130  // or a "etched" component (fp only drawn, not a physical component)
131  // Currently, Pcbnew does not handle embedded component, so we disable the .P
132  // attribute on internal layers
133  // Note the Gerber doc is not really clear about through holes pads about the .P
136 
137  }
138 
139  // Some attributes are reserved to the external copper layers:
140  // GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF
141  // for instance.
142  // Pad with type PAD_ATTRIB_CONN or PAD_ATTRIB_SMD that is not on outer layer
143  // has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR
144  switch( aPad->GetAttribute() )
145  {
146  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
148  break;
149 
150  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
152  break;
153 
154  case PAD_ATTRIB_CONN: // Connector pads, no solder paste but with solder mask.
155  if( plotOnExternalCopperLayer )
157  break;
158 
159  case PAD_ATTRIB_SMD: // SMD pads (on external copper layer only)
160  // with solder paste and mask
161  if( plotOnExternalCopperLayer )
163  break;
164  }
165 
166  // Fabrication properties can have specific GBR_APERTURE_METADATA options
167  // that replace previous aperture attribute:
168  switch( aPad->GetProperty() )
169  {
170  case PAD_PROP_BGA: // Only applicable to outer layers
171  if( plotOnExternalCopperLayer )
173  break;
174 
177  break;
178 
181  break;
182 
183  case PAD_PROP_TESTPOINT: // Only applicable to outer layers
184  if( plotOnExternalCopperLayer )
186  break;
187 
188  case PAD_PROP_HEATSINK:
190  break;
191 
194  break;
195 
196  case PAD_PROP_NONE:
197  break;
198  }
199 
200  // Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
203  }
204  else
205  {
207  }
208 
209  // Set plot color (change WHITE to LIGHTGRAY because
210  // the white items are not seen on a white paper or screen
211  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
212 
213  if( aPlotMode == SKETCH )
215 
216  switch( aPad->GetShape() )
217  {
218  case PAD_SHAPE_CIRCLE:
219  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
220  break;
221 
222  case PAD_SHAPE_OVAL:
223  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(),
224  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
225  break;
226 
227  case PAD_SHAPE_RECT:
228  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
229  &gbr_metadata );
230  break;
231 
232  case PAD_SHAPE_ROUNDRECT:
233  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
234  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
235  break;
236 
237  default:
238  case PAD_SHAPE_TRAPEZOID:
240  case PAD_SHAPE_CUSTOM:
241  {
242  const std::shared_ptr<SHAPE_POLY_SET>& polygons = aPad->GetEffectivePolygon();
243 
244  if( polygons->OutlineCount() )
245  {
246  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), polygons.get(), aPlotMode,
247  &gbr_metadata );
248  }
249  }
250  break;
251  }
252 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:712
aperture used for edge connector pad (outer layers)
Definition: gbr_metadata.h:94
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:99
no special fabrication property
Definition: pad_shapes.h:97
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:170
a fiducial (usually a smd) for the full board
Definition: pad_shapes.h:99
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
PLOTTER * m_plotter
Definition: pcbplot.h:66
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:89
Smd pad, used in BGA footprints.
Definition: pad_shapes.h:98
aperture used for castellated pads in copper layer files
Definition: gbr_metadata.h:100
a pad used as heat sink, usually in SMD footprints
Definition: pad_shapes.h:102
const wxString & GetPinFunction() const
Definition: class_pad.h:138
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:338
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCustom
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:444
a pad with a castellated through hole
Definition: pad_shapes.h:103
void SetPadPinFunction(const wxString &aPadPinFunction, bool aUseUTF8, bool aEscapeString)
Definition: gbr_metadata.h:187
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: class_pad.cpp:216
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:93
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
aperture used for fiducial pad (outer layers), at board level
Definition: gbr_metadata.h:97
void SetPadName(const wxString &aPadname, bool aUseUTF8=false, bool aEscapeString=false)
Definition: gbr_metadata.h:182
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRoundRect
static LSET ExternalCuMask()
Function ExternalCuMask returns a mask holding the Front and Bottom layers.
Definition: lset.cpp:742
const wxString & GetName() const
Definition: class_pad.h:132
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:95
PAD_PROP_T GetProperty() const
Definition: class_pad.h:341
const wxString & GetNetname() const
Function GetNetname.
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
aperture used for test point pad (outer layers)
Definition: gbr_metadata.h:96
MODULE * GetParent() const
Definition: class_pad.h:111
Definition: color4d.h:48
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:180
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRect
a fiducial (usually a smd) local to the parent footprint
Definition: pad_shapes.h:100
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees,...
Definition: class_pad.h:325
LSET m_layerMask
Definition: pcbplot.h:68
wxPoint ShapePos() const
Definition: class_pad.cpp:563
aperture used for fiducial pad (outer layers), at footprint level
Definition: gbr_metadata.h:98
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:91
int GetSketchPadLineWidth() const
int GetRoundRectCornerRadius() const
Definition: class_pad.cpp:176
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
Definition: gbr_metadata.h:212
PAD_SHAPE_T GetShape() const
Definition: class_pad.h:157
const wxSize & GetSize() const
Definition: class_pad.h:224
void SetCopper(bool aValue)
Definition: gbr_metadata.h:202
a test point pad
Definition: pad_shapes.h:101
print info associated to a net (TO.N attribute)
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:192
#define GBR_NETINFO_ALL
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References LSET::AllCuMask(), LSET::ExternalCuMask(), PLOTTER::FlashPadCircle(), PLOTTER::FlashPadCustom(), PLOTTER::FlashPadOval(), PLOTTER::FlashPadRect(), PLOTTER::FlashPadRoundRect(), 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, D_PAD::GetAttribute(), D_PAD::GetEffectivePolygon(), D_PAD::GetName(), BOARD_CONNECTED_ITEM::GetNetname(), D_PAD::GetOrientation(), D_PAD::GetParent(), D_PAD::GetPinFunction(), D_PAD::GetProperty(), MODULE::GetReference(), D_PAD::GetRoundRectCornerRadius(), D_PAD::GetShape(), D_PAD::GetSize(), PCB_PLOT_PARAMS::GetSketchPadLineWidth(), LIGHTGRAY, m_layerMask, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, m_plotter, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, PAD_ATTRIB_STANDARD, PAD_PROP_BGA, PAD_PROP_CASTELLATED, PAD_PROP_FIDUCIAL_GLBL, PAD_PROP_FIDUCIAL_LOCAL, PAD_PROP_HEATSINK, PAD_PROP_NONE, PAD_PROP_TESTPOINT, PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, GBR_METADATA::SetApertureAttrib(), GBR_METADATA::SetCmpReference(), PLOTTER::SetColor(), GBR_METADATA::SetCopper(), PLOTTER::SetCurrentLineWidth(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), GBR_METADATA::SetPadName(), GBR_METADATA::SetPadPinFunction(), D_PAD::ShapePos(), SKETCH, and WHITE.

Referenced by PlotStandardLayer().

◆ PlotPcbTarget()

void BRDITEMS_PLOTTER::PlotPcbTarget ( PCB_TARGET PtMire)

Definition at line 404 of file plot_brditems_plotter.cpp.

405 {
406  int dx1, dx2, dy1, dy2, radius;
407 
408  if( !m_layerMask[aMire->GetLayer()] )
409  return;
410 
411  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
412 
413  DRAWSEGMENT draw;
414 
415  draw.SetShape( S_CIRCLE );
416  draw.SetWidth( aMire->GetWidth() );
417  draw.SetLayer( aMire->GetLayer() );
418  draw.SetStart( aMire->GetPosition() );
419  radius = aMire->GetSize() / 3;
420 
421  if( aMire->GetShape() ) // shape X
422  radius = aMire->GetSize() / 2;
423 
424  // Draw the circle
425  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ));
426 
427  PlotDrawSegment( &draw );
428 
429  draw.SetShape( S_SEGMENT );
430 
431  radius = aMire->GetSize() / 2;
432  dx1 = radius;
433  dy1 = 0;
434  dx2 = 0;
435  dy2 = radius;
436 
437  if( aMire->GetShape() ) // Shape X
438  {
439  dx1 = dy1 = radius;
440  dx2 = dx1;
441  dy2 = -dy1;
442  }
443 
444  wxPoint mirePos( aMire->GetPosition() );
445 
446  // Draw the X or + shape:
447  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ));
448  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ));
449  PlotDrawSegment( &draw );
450 
451  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ));
452  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ));
453  PlotDrawSegment( &draw );
454 }
void SetShape(STROKE_T aShape)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
virtual void SetColor(COLOR4D color)=0
PLOTTER * m_plotter
Definition: pcbplot.h:66
usual segment : line with rounded ends
void SetStart(const wxPoint &aStart)
LSET m_layerMask
Definition: pcbplot.h:68
void SetEnd(const wxPoint &aEnd)
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
void PlotDrawSegment(DRAWSEGMENT *PtSegm)
void SetWidth(int aWidth)

References getColor(), BOARD_ITEM::GetLayer(), PCB_TARGET::GetPosition(), PCB_TARGET::GetShape(), PCB_TARGET::GetSize(), DRAWSEGMENT::GetStart(), PCB_TARGET::GetWidth(), m_layerMask, m_plotter, PlotDrawSegment(), S_CIRCLE, S_SEGMENT, PLOTTER::SetColor(), DRAWSEGMENT::SetEnd(), BOARD_ITEM::SetLayer(), DRAWSEGMENT::SetShape(), DRAWSEGMENT::SetStart(), DRAWSEGMENT::SetWidth(), wxPoint::x, and wxPoint::y.

Referenced by PlotBoardGraphicItems().

◆ PlotTextePcb()

void BRDITEMS_PLOTTER::PlotTextePcb ( TEXTE_PCB pt_texte)

Definition at line 626 of file plot_brditems_plotter.cpp.

627 {
628  wxString shownText( pt_texte->GetShownText() );
629 
630  if( shownText.IsEmpty() )
631  return;
632 
633  if( !m_layerMask[pt_texte->GetLayer()] )
634  return;
635 
636  GBR_METADATA gbr_metadata;
637 
638  if( IsCopperLayer( pt_texte->GetLayer() ) )
640 
641  COLOR4D color = getColor( pt_texte->GetLayer() );
643 
644  wxSize size = pt_texte->GetTextSize();
645  wxPoint pos = pt_texte->GetTextPos();
646  double orient = pt_texte->GetTextAngle();
647  int thickness = pt_texte->GetEffectiveTextPenWidth();
648 
649  if( pt_texte->IsMirrored() )
650  size.x = -size.x;
651 
652  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
653  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
654  // (like bold text) and we manage the thickness.
655  // So we set bold flag to true
656  bool allow_bold = true;
657 
658  m_plotter->SetCurrentLineWidth( thickness );
659 
660  if( pt_texte->IsMultilineAllowed() )
661  {
662  std::vector<wxPoint> positions;
663  wxArrayString strings_list;
664  wxStringSplit( shownText, strings_list, '\n' );
665  positions.reserve( strings_list.Count() );
666 
667  pt_texte->GetLinePositions( positions, strings_list.Count());
668 
669  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
670  {
671  wxString& txt = strings_list.Item( ii );
672  m_plotter->Text( positions[ii], color, txt, orient, size, pt_texte->GetHorizJustify(),
673  pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(),
674  allow_bold, false, &gbr_metadata );
675  }
676  }
677  else
678  {
679  m_plotter->Text( pos, color, shownText, orient, size, pt_texte->GetHorizJustify(),
680  pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(), allow_bold,
681  false, &gbr_metadata );
682  }
683 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:341
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:200
bool IsMirrored() const
Definition: eda_text.h:189
virtual void SetColor(COLOR4D color)=0
int color
Definition: DXF_plotter.cpp:61
PLOTTER * m_plotter
Definition: pcbplot.h:66
double GetTextAngle() const
Definition: eda_text.h:174
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:222
bool IsItalic() const
Definition: eda_text.h:180
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:199
const wxSize & GetTextSize() const
Definition: eda_text.h:239
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
bool IsMultilineAllowed() const
Definition: eda_text.h:197
LSET m_layerMask
Definition: pcbplot.h:68
void GetLinePositions(std::vector< wxPoint > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
Definition: eda_text.cpp:423
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
const wxPoint & GetTextPos() const
Definition: eda_text.h:248
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:160
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References color, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, getColor(), EDA_TEXT::GetEffectiveTextPenWidth(), EDA_TEXT::GetHorizJustify(), BOARD_ITEM::GetLayer(), EDA_TEXT::GetLinePositions(), TEXTE_PCB::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 334 of file pcb_plot_params.h.

334 { 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 254 of file pcb_plot_params.h.

254 { 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().

◆ SetColor()

void PCB_PLOT_PARAMS::SetColor ( COLOR4D  aVal)
inlineinherited

Definition at line 208 of file pcb_plot_params.h.

208 { m_color = aVal; }
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.

References PCB_PLOT_PARAMS::m_color.

◆ SetColorSettings()

void PCB_PLOT_PARAMS::SetColorSettings ( COLOR_SETTINGS aSettings)
inlineinherited

Definition at line 211 of file pcb_plot_params.h.

211 { 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 303 of file pcb_plot_params.h.

303 { 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().

◆ SetDrillMarksType()

void PCB_PLOT_PARAMS::SetDrillMarksType ( DrillMarksType  aVal)
inlineinherited

Definition at line 241 of file pcb_plot_params.h.

241 { 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 228 of file pcb_plot_params.h.

228 { 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_PLOTTER::DXF_UNITS  aUnit)
inlineinherited

Definition at line 231 of file pcb_plot_params.h.

232  {
233  m_DXFplotUnits = aUnit;
234  }
DXF_PLOTTER::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 281 of file pcb_plot_params.h.

281 { 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 247 of file pcb_plot_params.h.

247 { 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 249 of file pcb_plot_params.h.

249 { 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 284 of file pcb_plot_params.h.

285  {
286  m_format = aFormat;
287  }
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 153 of file pcb_plot_params.cpp.

154 {
155  // Currently geber files use mm.
156  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
157  // or 5, min value for professional boards, when 6 creates problems
158  // to board makers.
159 
162 }
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 353 of file pcb_plot_params.cpp.

354 {
356 }
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 346 of file pcb_plot_params.h.

346 { 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 359 of file pcb_plot_params.cpp.

360 {
362 }
#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 300 of file pcb_plot_params.h.

300 { 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 325 of file pcb_plot_params.h.

325 { 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 257 of file pcb_plot_params.h.

257 { 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 272 of file pcb_plot_params.h.

272 { 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 294 of file pcb_plot_params.h.

294 { 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 278 of file pcb_plot_params.h.

278 { 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 265 of file pcb_plot_params.h.

265 { 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 ( EDA_DRAW_MODE_T  aPlotMode)
inlineinherited

Definition at line 225 of file pcb_plot_params.h.

225 { m_plotMode = aPlotMode; }
EDA_DRAW_MODE_T 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 269 of file pcb_plot_params.h.

269 { 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 267 of file pcb_plot_params.h.

267 { 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 275 of file pcb_plot_params.h.

275 { 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 244 of file pcb_plot_params.h.

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

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

262 { 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 260 of file pcb_plot_params.h.

260 { 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 193 of file pcb_plot_params.h.

193 { 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 322 of file pcb_plot_params.h.

322 { 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 164 of file pcb_plot_params.cpp.

165 {
166  m_svgUseInch = aUseInch;
168 }
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 215 of file pcb_plot_params.h.

216  {
217  m_textMode = aVal;
218  }
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 328 of file pcb_plot_params.h.

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

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

297 { 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 251 of file pcb_plot_params.h.

251 { 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 67 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: