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 Plot_Edges_Modules ()
 
void Plot_1_EdgeModule (EDGE_MODULE *aEdge)
 
void PlotTextModule (TEXTE_MODULE *aTextMod, COLOR4D aColor)
 
bool PlotAllTextsModule (MODULE *aModule)
 
void PlotDimension (DIMENSION *Dimension)
 
void PlotPcbTarget (PCB_TARGET *PtMire)
 
void PlotFilledAreas (ZONE_CONTAINER *aZone)
 
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 SetTextMode (PlotTextMode aVal)
 
PlotTextMode GetTextMode () const
 
void SetPlotMode (EDA_DRAW_MODE_T aPlotMode)
 
EDA_DRAW_MODE_T GetPlotMode () const
 
void SetDXFPlotPolygonMode (bool aFlag)
 
bool GetDXFPlotPolygonMode () 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 SetPlotPadsOnSilkLayer (bool aFlag)
 
bool GetPlotPadsOnSilkLayer () 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 (PlotFormat aFormat)
 
PlotFormat GetFormat () const
 
void SetOutputDirectory (wxString aDir)
 
wxString GetOutputDirectory () const
 
void SetUseGerberAttributes (bool aUse)
 
bool GetUseGerberAttributes () 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 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
 
int GetLineWidth () const
 
bool SetLineWidth (int aValue)
 

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 77 of file pcbplot.h.

Member Enumeration Documentation

Enumerator
NO_DRILL_SHAPE 
SMALL_DRILL_SHAPE 
FULL_DRILL_SHAPE 

Definition at line 41 of file pcb_plot_params.h.

Constructor & Destructor Documentation

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

Definition at line 84 of file pcbplot.h.

84  :
85  PCB_PLOT_PARAMS( aPlotOpts )
86  {
87  m_plotter = aPlotter;
88  m_board = aBoard;
89  }
PLOTTER * m_plotter
Definition: pcbplot.h:79
BOARD * m_board
Definition: pcbplot.h:80

Member Function Documentation

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

Definition at line 149 of file pcb_plot_params.cpp.

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

Referenced by PCB_IO::formatSetup(), and PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads().

151 {
152  const char* falseStr = getTokenName( T_false );
153  const char* trueStr = getTokenName( T_true );
154 
155  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
156 
157  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
158  m_layerSelection.FmtHex().c_str() );
159 
160  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
161  m_useGerberProtelExtensions ? trueStr : falseStr );
162 
163  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ),
164  GetUseGerberAttributes() ? trueStr : falseStr );
165 
166  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ),
167  GetIncludeGerberNetlistInfo() ? trueStr : falseStr );
168 
169  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ),
170  GetCreateGerberJobFile() ? trueStr : falseStr );
171 
172  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
173  // to avoid incompatibility with older Pcbnew version
174  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
175  getTokenName( T_gerberprecision ), m_gerberPrecision );
176 
177  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
178  m_excludeEdgeLayer ? trueStr : falseStr );
179  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_linewidth ),
180  m_lineWidth / IU_PER_MM );
181  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
182  m_plotFrameRef ? trueStr : falseStr );
183  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
184  m_plotViaOnMaskLayer ? trueStr : falseStr );
185  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
186  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
187  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
188  m_useAuxOrigin ? trueStr : falseStr );
189  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
190  m_HPGLPenNum );
191 
192  // Obsolete parameter, pen speed is no more managed, because hpgl format
193  // is now an export format, and for this, pen speed has no meaning
194  // aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
195  // m_HPGLPenSpeed );
196 
197  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
198  m_HPGLPenSpeed );
199  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_hpglpendiameter ),
200  m_HPGLPenDiam );
201  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
202  m_negative ? trueStr : falseStr );
203  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
204  m_A4Output ? trueStr : falseStr );
205  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
206  m_plotReference ? trueStr : falseStr );
207  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
208  m_plotValue ? trueStr : falseStr );
209  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
210  m_plotInvisibleText ? trueStr : falseStr );
211  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
212  m_plotPadsOnSilkLayer ? trueStr : falseStr );
213  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
214  m_subtractMaskFromSilk ? trueStr : falseStr );
215  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
216  m_format );
217  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
218  m_mirror ? trueStr : falseStr );
219  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
220  m_drillMarks );
221  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
223  aFormatter->Print( aNestLevel+1, "(%s \"%s\")", getTokenName( T_outputdirectory ),
224  (const char*) m_outputDirectory.utf8_str() );
225  aFormatter->Print( 0, ")\n" );
226 }
bool m_plotValue
Enable plotting of part values.
std::string FmtHex() const
Function FmtHex returns a hex string showing contents of this LSEQ.
Definition: lset.cpp:280
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 GetUseGerberAttributes() const
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
static const int gbrDefaultPrecision
bool m_plotPadsOnSilkLayer
Allows pads outlines on silkscreen layer (when pads are also on silk screen)
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_plotInvisibleText
Force plotting of fields marked invisible.
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
bool GetIncludeGerberNetlistInfo() const
bool m_subtractMaskFromSilk
On gerbers &#39;scrape&#39; away the solder mask from silkscreen (trim silks)
bool GetCreateGerberJobFile() 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.
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
LSET m_layerSelection
Set of layers to plot.
EDA_DRAW_MODE_T GetPlotMode() const
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
PlotFormat m_format
Plot format type (chooses the driver to be used)
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...
bool PCB_PLOT_PARAMS::GetA4Output ( ) const
inlineinherited

Definition at line 280 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_A4Output.

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

280 { return m_A4Output; };
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
bool PCB_PLOT_PARAMS::GetAutoScale ( ) const
inlineinherited

Definition at line 213 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_autoScale.

Referenced by initializePlotter().

213 { return m_autoScale; }
bool m_autoScale
When true set the scale to fit the board in the page.
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 57 of file plot_brditems_plotter.cpp.

References color, BOARD::Colors(), COLORS_DESIGN_SETTINGS::GetLayerColor(), LIGHTGRAY, m_board, and WHITE.

Referenced by Plot_1_EdgeModule(), PlotAllTextsModule(), PlotDrawSegment(), PlotFilledAreas(), PlotPcbTarget(), PlotStandardLayer(), PlotTextePcb(), and SetLayerSet().

58 {
59  COLOR4D color = m_board->Colors().GetLayerColor( aLayer );
60 
61  // A hack to avoid plotting ahite itmen in white color, expecting the paper
62  // is also white: use a non white color:
63  if( color == COLOR4D::WHITE )
64  color = COLOR4D( LIGHTGRAY );
65 
66  return color;
67 }
int color
Definition: DXF_plotter.cpp:62
BOARD * m_board
Definition: pcbplot.h:80
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:568
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
Definition: colors.h:49
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
COLOR4D PCB_PLOT_PARAMS::GetColor ( ) const
inlineinherited

Definition at line 188 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_color.

Referenced by PlotDrillMarks(), and PlotOneBoardLayer().

188 { return m_color; }
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.
bool PCB_PLOT_PARAMS::GetCreateGerberJobFile ( ) const
inlineinherited

Definition at line 253 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_createGerberJobFile.

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

253 { return m_createGerberJobFile; }
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
DrillMarksType PCB_PLOT_PARAMS::GetDrillMarksType ( ) const
inlineinherited

Definition at line 200 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_drillMarks.

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

200 { return m_drillMarks; }
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
bool PCB_PLOT_PARAMS::GetDXFPlotPolygonMode ( ) const
inlineinherited

Definition at line 197 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_DXFplotPolygonMode.

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

197 { 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...
bool PCB_PLOT_PARAMS::GetExcludeEdgeLayer ( ) const
inlineinherited

Definition at line 238 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_excludeEdgeLayer.

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

238 { return m_excludeEdgeLayer; }
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
double PCB_PLOT_PARAMS::GetFineScaleAdjustX ( ) const
inlineinherited

Definition at line 206 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_fineScaleAdjustX.

Referenced by StartPlotBoard().

206 { return m_fineScaleAdjustX; }
double m_fineScaleAdjustX
fine scale adjust X axis
double PCB_PLOT_PARAMS::GetFineScaleAdjustY ( ) const
inlineinherited

Definition at line 208 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_fineScaleAdjustY.

Referenced by StartPlotBoard().

208 { return m_fineScaleAdjustY; }
double m_fineScaleAdjustY
fine scale adjust Y axis
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 96 of file pcbplot.h.

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

Referenced by plotOneDrillMark(), and PlotStandardLayer().

97  {
98  if( GetFormat() == PLOT_FORMAT_POST )
99  return GetWidthAdjust();
100  else
101  return 0;
102  }
PlotFormat GetFormat() const
int GetWidthAdjust() const
PlotFormat PCB_PLOT_PARAMS::GetFormat ( ) const
inlineinherited

Definition at line 241 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_format.

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

241 { return m_format; }
PlotFormat m_format
Plot format type (chooses the driver to be used)
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 265 of file pcb_plot_params.h.

265 { return 6; }
int PCB_PLOT_PARAMS::GetGerberPrecision ( ) const
inlineinherited

Definition at line 259 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_gerberPrecision.

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

259 { 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...
double PCB_PLOT_PARAMS::GetHPGLPenDiameter ( ) const
inlineinherited

Definition at line 284 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_HPGLPenDiam, and PCB_PLOT_PARAMS::SetHPGLPenDiameter().

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

284 { return m_HPGLPenDiam; };
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files...
int PCB_PLOT_PARAMS::GetHPGLPenNum ( ) const
inlineinherited

Definition at line 292 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_HPGLPenNum.

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

292 { return m_HPGLPenNum; }
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
int PCB_PLOT_PARAMS::GetHPGLPenSpeed ( ) const
inlineinherited

Definition at line 288 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_HPGLPenSpeed, and PCB_PLOT_PARAMS::SetHPGLPenSpeed().

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

288 { return m_HPGLPenSpeed; };
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
bool PCB_PLOT_PARAMS::GetIncludeGerberNetlistInfo ( ) const
inlineinherited

Definition at line 250 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_includeGerberNetlistInfo.

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

250 { return m_includeGerberNetlistInfo; }
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
LSET PCB_PLOT_PARAMS::GetLayerSelection ( ) const
inlineinherited

Definition at line 271 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_layerSelection.

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

271 { return m_layerSelection; };
LSET m_layerSelection
Set of layers to plot.
int PCB_PLOT_PARAMS::GetLineWidth ( ) const
inlineinherited

Definition at line 294 of file pcb_plot_params.h.

References g_DrawDefaultLineThickness, PCB_PLOT_PARAMS::m_lineWidth, and PCB_PLOT_PARAMS::SetLineWidth().

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

294 { return m_lineWidth; };
int m_lineWidth
The default line width (used to draw items having no defined width)
bool PCB_PLOT_PARAMS::GetMirror ( ) const
inlineinherited

Definition at line 216 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_mirror.

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

216 { return m_mirror; }
bool m_mirror
Mirror the plot around the X axis.
bool PCB_PLOT_PARAMS::GetNegative ( ) const
inlineinherited

Definition at line 229 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_negative.

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

229 { return m_negative; }
bool m_negative
Plot in negative color (supported only by some drivers)
wxString PCB_PLOT_PARAMS::GetOutputDirectory ( ) const
inlineinherited
bool PCB_PLOT_PARAMS::GetPlotFrameRef ( ) const
inlineinherited

Definition at line 235 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotFrameRef.

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

235 { return m_plotFrameRef; }
bool m_plotFrameRef
True to plot/print frame references.
bool PCB_PLOT_PARAMS::GetPlotInvisibleText ( ) const
inlineinherited

Definition at line 222 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotInvisibleText.

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

222 { return m_plotInvisibleText; }
bool m_plotInvisibleText
Force plotting of fields marked invisible.
EDA_DRAW_MODE_T PCB_PLOT_PARAMS::GetPlotMode ( ) const
inlineinherited

Definition at line 194 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotMode.

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

194 { return m_plotMode; }
EDA_DRAW_MODE_T m_plotMode
FILLED or SKETCH selects how to plot filled objects.
bool PCB_PLOT_PARAMS::GetPlotPadsOnSilkLayer ( ) const
inlineinherited

Definition at line 219 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotPadsOnSilkLayer.

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

219 { return m_plotPadsOnSilkLayer; }
bool m_plotPadsOnSilkLayer
Allows pads outlines on silkscreen layer (when pads are also on silk screen)
bool PCB_PLOT_PARAMS::GetPlotReference ( ) const
inlineinherited

Definition at line 226 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotReference.

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

226 { return m_plotReference; }
bool m_plotReference
Enable plotting of part references.
bool PCB_PLOT_PARAMS::GetPlotValue ( ) const
inlineinherited

Definition at line 224 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotValue.

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

224 { return m_plotValue; }
bool m_plotValue
Enable plotting of part values.
bool PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer ( ) const
inlineinherited

Definition at line 232 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotViaOnMaskLayer.

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

232 { return m_plotViaOnMaskLayer; }
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
double PCB_PLOT_PARAMS::GetScale ( ) const
inlineinherited

Definition at line 203 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_scale.

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

203 { return m_scale; }
double m_scale
Global scale factor, 1.0 plots a board with its actual size.
int PCB_PLOT_PARAMS::GetScaleSelection ( ) const
inlineinherited

Definition at line 277 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_scaleSelection.

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

277 { return m_scaleSelection; };
int m_scaleSelection
Scale ratio index (UI only)
bool PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads ( ) const
inlineinherited
bool PCB_PLOT_PARAMS::GetSubtractMaskFromSilk ( ) const
inlineinherited

Definition at line 268 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_subtractMaskFromSilk.

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

268 { return m_subtractMaskFromSilk; }
bool m_subtractMaskFromSilk
On gerbers &#39;scrape&#39; away the solder mask from silkscreen (trim silks)
PlotTextMode PCB_PLOT_PARAMS::GetTextMode ( ) const
inlineinherited

Definition at line 191 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_textMode.

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

191 { return m_textMode; }
PlotTextMode m_textMode
Choose how represent text with PS, PDF and DXF drivers.
bool PCB_PLOT_PARAMS::GetUseAuxOrigin ( ) const
inlineinherited

Definition at line 274 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_useAuxOrigin.

Referenced by AddGerberX2Header(), BuildGerberX2Header(), DIALOG_GENDRILL::initDialog(), initializePlotter(), and DIALOG_PLOT::reInitDialog().

274 { return m_useAuxOrigin; };
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.
bool PCB_PLOT_PARAMS::GetUseGerberAttributes ( ) const
inlineinherited

Definition at line 247 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_useGerberAttributes.

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

247 { return m_useGerberAttributes; }
bool m_useGerberAttributes
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool PCB_PLOT_PARAMS::GetUseGerberProtelExtensions ( ) const
inlineinherited

Definition at line 256 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_useGerberProtelExtensions, and PCB_PLOT_PARAMS::SetGerberPrecision().

Referenced by DIALOG_PLOT::init_Dialog().

256 { return m_useGerberProtelExtensions; }
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ...
int PCB_PLOT_PARAMS::GetWidthAdjust ( ) const
inlineinherited

Definition at line 210 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_widthAdjust.

Referenced by getFineWidthAdj().

210 { return m_widthAdjust; }
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...
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 235 of file pcb_plot_params.cpp.

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_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_plotPadsOnSilkLayer, 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_subtractMaskFromSilk, PCB_PLOT_PARAMS::m_textMode, PCB_PLOT_PARAMS::m_useAuxOrigin, PCB_PLOT_PARAMS::m_useGerberAttributes, PCB_PLOT_PARAMS::m_useGerberProtelExtensions, and PCB_PLOT_PARAMS::m_widthAdjust.

Referenced by DIALOG_PLOT::applyPlotSettings(), and PCB_PLOT_PARAMS::GetSkipPlotNPTH_Pads().

236 {
237  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
238  return false;
240  return false;
241  if( m_useGerberAttributes != aPcbPlotParams.m_useGerberAttributes )
242  return false;
244  return false;
245  if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
246  return false;
247  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
248  return false;
249  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
250  return false;
251  if( m_lineWidth != aPcbPlotParams.m_lineWidth )
252  return false;
253  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
254  return false;
255  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
256  return false;
257  if( m_plotMode != aPcbPlotParams.m_plotMode )
258  return false;
259  if( !aCompareOnlySavedPrms )
260  {
261  if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
262  return false;
263  }
264  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
265  return false;
266  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
267  return false;
268  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
269  return false;
270  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
271  return false;
272  if( m_negative != aPcbPlotParams.m_negative )
273  return false;
274  if( m_A4Output != aPcbPlotParams.m_A4Output )
275  return false;
276  if( m_plotReference != aPcbPlotParams.m_plotReference )
277  return false;
278  if( m_plotValue != aPcbPlotParams.m_plotValue )
279  return false;
280  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
281  return false;
282  if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
283  return false;
284  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
285  return false;
286  if( m_format != aPcbPlotParams.m_format )
287  return false;
288  if( m_mirror != aPcbPlotParams.m_mirror )
289  return false;
290  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
291  return false;
292  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
293  return false;
294  if( m_autoScale != aPcbPlotParams.m_autoScale )
295  return false;
296  if( m_scale != aPcbPlotParams.m_scale )
297  return false;
298  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
299  return false;
300  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
301  return false;
302  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
303  return false;
304  if( !aCompareOnlySavedPrms )
305  {
306  if( m_color != aPcbPlotParams.m_color )
307  return false;
308  }
309  if( m_textMode != aPcbPlotParams.m_textMode )
310  return false;
311  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
312  return false;
313 
314  return true;
315 }
double m_fineScaleAdjustX
fine scale adjust X axis
bool m_plotValue
Enable plotting of part values.
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_mirror
Mirror the plot around the X axis.
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
bool m_plotPadsOnSilkLayer
Allows pads outlines on silkscreen layer (when pads are also on silk screen)
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_useGerberAttributes
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
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.
bool m_subtractMaskFromSilk
On gerbers &#39;scrape&#39; 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.
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.
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
PlotTextMode m_textMode
Choose how represent text with PS, PDF and DXF drivers.
PlotFormat m_format
Plot format type (chooses the driver to be used)
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...
void PCB_PLOT_PARAMS::Parse ( PCB_PLOT_PARAMS_PARSER aParser)
inherited

Definition at line 229 of file pcb_plot_params.cpp.

References PCB_PLOT_PARAMS_PARSER::Parse().

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

230 {
231  aParser->Parse( this );
232 }
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)
void BRDITEMS_PLOTTER::Plot_1_EdgeModule ( EDGE_MODULE aEdge)

Definition at line 452 of file plot_brditems_plotter.cpp.

References abs, LSET::AllCuMask(), ArcTangente(), DRAWSEGMENT::BuildPolyPointsList(), Edge_Cuts, FILLED_SHAPE, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, DRAWSEGMENT::GetAngle(), getColor(), DRAWSEGMENT::GetEnd(), BOARD_ITEM::GetLayer(), GetLineLength(), MODULE::GetOrientation(), BOARD_ITEM::GetParent(), DRAWSEGMENT::GetParentModule(), PCB_PLOT_PARAMS::GetPlotMode(), MODULE::GetPosition(), MODULE::GetReference(), DRAWSEGMENT::GetShape(), DRAWSEGMENT::GetStart(), DRAWSEGMENT::GetWidth(), DRAWSEGMENT::IsPolyShapeValid(), KiROUND(), m_layerMask, m_plotter, PCB_MODULE_EDGE_T, PLOTTER::PlotPoly(), RotatePoint(), S_ARC, S_CIRCLE, S_POLYGON, S_SEGMENT, PLOTTER::SetColor(), GBR_METADATA::SetNetAttribType(), PLOTTER::ThickArc(), PLOTTER::ThickCircle(), PLOTTER::ThickSegment(), and EDA_ITEM::Type().

Referenced by Plot_Edges_Modules(), PlotSolderMaskLayer(), PlotStandardLayer(), and SetLayerSet().

453 {
454  int type_trace; // Type of item to plot.
455  int thickness; // Segment thickness.
456  int radius; // Circle radius.
457 
458  if( aEdge->Type() != PCB_MODULE_EDGE_T )
459  return;
460 
461  m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
462 
463  type_trace = aEdge->GetShape();
464  thickness = aEdge->GetWidth();
465 
466  wxPoint pos( aEdge->GetStart() );
467  wxPoint end( aEdge->GetEnd() );
468 
469  GBR_METADATA gbr_metadata;
471  MODULE* parent = static_cast<MODULE*> ( aEdge->GetParent() );
472  gbr_metadata.SetCmpReference( parent->GetReference() );
473 
474  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
475 
476  if( isOnCopperLayer )
477  {
478  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
479  gbr_metadata.SetCopper( true );
480  }
481  else if( aEdge->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
482  {
483  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
484  }
485 
486  switch( type_trace )
487  {
488  case S_SEGMENT:
489  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
490  break;
491 
492  case S_CIRCLE:
493  radius = KiROUND( GetLineLength( end, pos ) );
494  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
495  break;
496 
497  case S_ARC:
498  {
499  radius = KiROUND( GetLineLength( end, pos ) );
500  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
501  double endAngle = startAngle + aEdge->GetAngle();
502 
503  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
504  if( std::abs( aEdge->GetAngle() ) == 3600.0 )
505  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
506  else
507  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
508  }
509  break;
510 
511  case S_POLYGON:
512  if( aEdge->IsPolyShapeValid() )
513  {
514  const std::vector<wxPoint>& polyPoints = aEdge->BuildPolyPointsList();
515 
516  // We must compute true coordinates from m_PolyList
517  // which are relative to module position, orientation 0
518  MODULE* module = aEdge->GetParentModule();
519 
520  std::vector< wxPoint > cornerList;
521 
522  cornerList.reserve( polyPoints.size() );
523 
524  for( unsigned ii = 0; ii < polyPoints.size(); ii++ )
525  {
526  wxPoint corner = polyPoints[ii];
527 
528  if( module )
529  {
530  RotatePoint( &corner, module->GetOrientation() );
531  corner += module->GetPosition();
532  }
533 
534  cornerList.push_back( corner );
535  }
536 
537  m_plotter->PlotPoly( cornerList, FILLED_SHAPE, thickness, &gbr_metadata );
538  }
539  break;
540  }
541 }
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:673
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
BOARD_ITEM_CONTAINER * GetParent() const
aperture used for etched components
Definition: gbr_metadata.h:50
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB...
Definition: trigo.h:191
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...
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
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:512
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:119
polygon (not yet used for tracks, but could be in microwave apps)
PLOTTER * m_plotter
Definition: pcbplot.h:79
usual segment : line with rounded ends
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
bool IsPolyShapeValid() const
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
#define abs(a)
Definition: auxiliary.h:84
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:474
STROKE_T GetShape() const
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:170
double GetOrientation() const
Definition: class_module.h:189
Arcs (with rounded ends)
double GetAngle() const
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:460
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:457
LSET m_layerMask
Definition: pcbplot.h:81
EDA_DRAW_MODE_T GetPlotMode() const
int GetWidth() const
MODULE * GetParentModule() const
Function GetParentModule returns a pointer to the parent module, or NULL if DRAWSEGMENT does not belo...
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:53
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
const wxPoint GetPosition() const override
Definition: class_module.h:184
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
void BRDITEMS_PLOTTER::Plot_Edges_Modules ( )

Definition at line 436 of file plot_brditems_plotter.cpp.

References dyn_cast(), BOARD_ITEM::GetLayer(), m_board, m_layerMask, BOARD::m_Modules, BOARD_ITEM::Next(), MODULE::Next(), and Plot_1_EdgeModule().

Referenced by PlotSilkScreen(), and SetLayerSet().

437 {
438  for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
439  {
440  for( BOARD_ITEM* item = module->GraphicalItemsList().GetFirst(); item; item = item->Next() )
441  {
442  EDGE_MODULE* edge = dyn_cast<EDGE_MODULE*>( item );
443 
444  if( edge && m_layerMask[edge->GetLayer()] )
445  Plot_1_EdgeModule( edge );
446  }
447  }
448 }
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
MODULE * Next() const
Definition: class_module.h:123
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:61
BOARD * m_board
Definition: pcbplot.h:80
BOARD_ITEM * Next() const
void Plot_1_EdgeModule(EDGE_MODULE *aEdge)
DLIST< MODULE > m_Modules
Definition: class_board.h:247
LSET m_layerMask
Definition: pcbplot.h:81
bool BRDITEMS_PLOTTER::PlotAllTextsModule ( MODULE aModule)

Definition at line 211 of file plot_brditems_plotter.cpp.

References dyn_cast(), getColor(), DLIST< T >::GetFirst(), BOARD_ITEM::GetLayer(), PCB_PLOT_PARAMS::GetPlotInvisibleText(), PCB_PLOT_PARAMS::GetPlotReference(), PCB_PLOT_PARAMS::GetPlotValue(), EDA_TEXT::GetText(), MODULE::GraphicalItemsList(), EDA_TEXT::IsVisible(), m_layerMask, BOARD_ITEM::Next(), PCB_LAYER_ID_COUNT, PlotTextModule(), MODULE::Reference(), and MODULE::Value().

Referenced by PlotSilkScreen(), PlotStandardLayer(), and SetLayerSet().

212 {
213  TEXTE_MODULE* textModule = &aModule->Reference();
214  LAYER_NUM textLayer = textModule->GetLayer();
215 
216  if( GetPlotReference() && m_layerMask[textLayer]
217  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
218  {
219  PlotTextModule( textModule, getColor( textLayer ) );
220  }
221 
222  textModule = &aModule->Value();
223  textLayer = textModule->GetLayer();
224 
225  if( GetPlotValue() && m_layerMask[textLayer]
226  && ( textModule->IsVisible() || GetPlotInvisibleText() ) )
227  {
228  PlotTextModule( textModule, getColor( textLayer ) );
229  }
230 
231  for( BOARD_ITEM* item = aModule->GraphicalItemsList().GetFirst(); item; item = item->Next() )
232  {
233  textModule = dyn_cast<TEXTE_MODULE*>( item );
234 
235  if( !textModule )
236  continue;
237 
238  if( !textModule->IsVisible() )
239  continue;
240 
241  textLayer = textModule->GetLayer();
242 
243  if( textLayer >= PCB_LAYER_ID_COUNT )
244  return false;
245 
246  if( !m_layerMask[textLayer] )
247  continue;
248 
249  if( textModule->GetText() == wxT( "%R" ) && !GetPlotReference() )
250  continue;
251 
252  if( textModule->GetText() == wxT( "%V" ) && !GetPlotValue() )
253  continue;
254 
255  PlotTextModule( textModule, getColor( textLayer ) );
256  }
257 
258  return true;
259 }
TEXTE_MODULE & Reference()
Definition: class_module.h:510
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool GetPlotValue() const
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:61
BOARD_ITEM * Next() const
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:509
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:128
T * GetFirst() const
Function GetFirst returns the first T* in the list without removing it, or NULL if the list is empty...
Definition: dlist.h:163
bool GetPlotReference() const
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
bool GetPlotInvisibleText() const
bool IsVisible() const
Definition: eda_text.h:174
LSET m_layerMask
Definition: pcbplot.h:81
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:166
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
void PlotTextModule(TEXTE_MODULE *aTextMod, COLOR4D aColor)
void BRDITEMS_PLOTTER::PlotBoardGraphicItems ( )

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

Definition at line 263 of file plot_brditems_plotter.cpp.

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

Referenced by PlotSilkScreen(), PlotSolderMaskLayer(), PlotStandardLayer(), and SetLayerSet().

264 {
265  for( auto item : m_board->Drawings() )
266  {
267  switch( item->Type() )
268  {
269  case PCB_LINE_T:
270  PlotDrawSegment( (DRAWSEGMENT*) item);
271  break;
272 
273  case PCB_TEXT_T:
274  PlotTextePcb( (TEXTE_PCB*) item );
275  break;
276 
277  case PCB_DIMENSION_T:
278  PlotDimension( (DIMENSION*) item );
279  break;
280 
281  case PCB_TARGET_T:
282  PlotPcbTarget( (PCB_TARGET*) item );
283  break;
284 
285  case PCB_MARKER_T:
286  default:
287  break;
288  }
289  }
290 }
void PlotDimension(DIMENSION *Dimension)
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
BOARD * m_board
Definition: pcbplot.h:80
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
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
void PlotTextePcb(TEXTE_PCB *pt_texte)
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
Class DIMENSION.
DLIST_ITERATOR_WRAPPER< BOARD_ITEM > Drawings()
Definition: class_board.h:254
void PlotDrawSegment(DRAWSEGMENT *PtSegm)
void BRDITEMS_PLOTTER::PlotDimension ( DIMENSION Dimension)

Definition at line 334 of file plot_brditems_plotter.cpp.

References color, BOARD::Colors(), BOARD_ITEM::GetLayer(), COLORS_DESIGN_SETTINGS::GetLayerColor(), DIMENSION::GetWidth(), LIGHTGRAY, DIMENSION::m_arrowD1F, DIMENSION::m_arrowD2F, DIMENSION::m_arrowG1F, DIMENSION::m_arrowG2F, m_board, 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(), and SetLayerSet().

335 {
336  if( !m_layerMask[aDim->GetLayer()] )
337  return;
338 
339  DRAWSEGMENT draw;
340 
341  draw.SetWidth( aDim->GetWidth() );
342  draw.SetLayer( aDim->GetLayer() );
343 
344  COLOR4D color = m_board->Colors().GetLayerColor( aDim->GetLayer() );
345 
346  // Set plot color (change WHITE to LIGHTGRAY because
347  // the white items are not seen on a white paper or screen
348  m_plotter->SetColor( color != WHITE ? color : LIGHTGRAY);
349 
350  PlotTextePcb( &aDim->Text() );
351 
352  draw.SetStart( aDim->m_crossBarO );
353  draw.SetEnd( aDim->m_crossBarF );
354  PlotDrawSegment( &draw );
355 
356  draw.SetStart( aDim->m_featureLineGO);
357  draw.SetEnd( aDim->m_featureLineGF );
358  PlotDrawSegment( &draw );
359 
360  draw.SetStart( aDim->m_featureLineDO );
361  draw.SetEnd( aDim->m_featureLineDF );
362  PlotDrawSegment( &draw );
363 
364  draw.SetStart( aDim->m_crossBarF );
365  draw.SetEnd( aDim->m_arrowD1F );
366  PlotDrawSegment( &draw );
367 
368  draw.SetStart( aDim->m_crossBarF );
369  draw.SetEnd( aDim->m_arrowD2F );
370  PlotDrawSegment( &draw );
371 
372  draw.SetStart( aDim->m_crossBarO );
373  draw.SetEnd( aDim->m_arrowG1F );
374  PlotDrawSegment( &draw );
375 
376  draw.SetStart( aDim->m_crossBarO );
377  draw.SetEnd( aDim->m_arrowG2F );
378  PlotDrawSegment( &draw );
379 }
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:62
PLOTTER * m_plotter
Definition: pcbplot.h:79
BOARD * m_board
Definition: pcbplot.h:80
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:568
void SetStart(const wxPoint &aStart)
LSET m_layerMask
Definition: pcbplot.h:81
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
void PlotTextePcb(TEXTE_PCB *pt_texte)
Definition: colors.h:49
void SetEnd(const wxPoint &aEnd)
void PlotDrawSegment(DRAWSEGMENT *PtSegm)
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void SetWidth(int aWidth)
void BRDITEMS_PLOTTER::PlotDrawSegment ( DRAWSEGMENT PtSegm)

Definition at line 710 of file plot_brditems_plotter.cpp.

References abs, LSET::AllCuMask(), ArcTangente(), Edge_Cuts, FILLED_SHAPE, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, DRAWSEGMENT::GetAngle(), DRAWSEGMENT::GetBezierPoints(), getColor(), DRAWSEGMENT::GetEnd(), BOARD_ITEM::GetLayer(), GetLineLength(), PCB_PLOT_PARAMS::GetPlotMode(), DRAWSEGMENT::GetPolyShape(), DRAWSEGMENT::GetShape(), DRAWSEGMENT::GetStart(), DRAWSEGMENT::GetWidth(), i, KiROUND(), m_layerMask, m_plotter, SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PLOTTER::PlotPoly(), S_ARC, S_CIRCLE, S_CURVE, S_POLYGON, GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), PLOTTER::ThickArc(), PLOTTER::ThickCircle(), and PLOTTER::ThickSegment().

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

711 {
712  if( !m_layerMask[aSeg->GetLayer()] )
713  return;
714 
715  int radius = 0;
716  double StAngle = 0, EndAngle = 0;
717  int thickness = aSeg->GetWidth();
718 
719  m_plotter->SetColor( getColor( aSeg->GetLayer() ) );
720 
721  wxPoint start( aSeg->GetStart() );
722  wxPoint end( aSeg->GetEnd() );
723 
724  GBR_METADATA gbr_metadata;
725 
726  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
727 
728  if( isOnCopperLayer && aSeg->GetLayer() == Edge_Cuts ) // can happens when plotting copper layers
729  {
731  }
732 
733  switch( aSeg->GetShape() )
734  {
735  case S_CIRCLE:
736  radius = KiROUND( GetLineLength( end, start ) );
737  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
738  break;
739 
740  case S_ARC:
741  radius = KiROUND( GetLineLength( end, start ) );
742  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
743  EndAngle = StAngle + aSeg->GetAngle();
744 
745  // when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
746  if( std::abs( aSeg->GetAngle() ) == 3600.0 )
747  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
748  else
749  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
750  break;
751 
752  case S_CURVE:
753  {
754  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
755  const std::vector<wxPoint>& bezierPoints = aSeg->GetBezierPoints();
756 
757  for( unsigned i = 1; i < bezierPoints.size(); i++ )
758  m_plotter->ThickSegment( bezierPoints[i - 1], bezierPoints[i],
759  thickness, GetPlotMode(), &gbr_metadata );
760  }
761  break;
762 
763  case S_POLYGON:
764  {
765  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
766  // Draw the polygon: only one polygon is expected
767  // However we provide a multi polygon shape drawing
768  // ( for the future or to show a non expected shape )
769  for( int jj = 0; jj < aSeg->GetPolyShape().OutlineCount(); ++jj )
770  {
771  SHAPE_LINE_CHAIN& poly = aSeg->GetPolyShape().Outline( jj );
772  m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata );
773  }
774  }
775  break;
776 
777  default:
778  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
779  }
780 }
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:673
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB...
Definition: trigo.h:191
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
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:512
polygon (not yet used for tracks, but could be in microwave apps)
PLOTTER * m_plotter
Definition: pcbplot.h:79
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
#define abs(a)
Definition: auxiliary.h:84
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:474
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:170
Arcs (with rounded ends)
Bezier Curve.
Class SHAPE_LINE_CHAIN.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:457
LSET m_layerMask
Definition: pcbplot.h:81
size_t i
Definition: json11.cpp:597
EDA_DRAW_MODE_T GetPlotMode() const
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:109
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:53
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
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 810 of file plot_brditems_plotter.cpp.

References dyn_cast(), FILLED, PCB_PLOT_PARAMS::GetColor(), PCB_PLOT_PARAMS::GetDrillMarksType(), VIA::GetDrillValue(), PCB_PLOT_PARAMS::GetPlotMode(), TRACK::GetStart(), TRACK::GetWidth(), m_board, BOARD::m_Modules, m_plotter, BOARD::m_Track, TRACK::Next(), MODULE::Next(), D_PAD::Next(), PAD_DRILL_SHAPE_CIRCLE, plotOneDrillMark(), PLOTTER::SetColor(), SMALL_DRILL, PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE, and WHITE.

Referenced by PlotStandardLayer(), and SetLayerSet().

811 {
812  /* If small drills marks were requested prepare a clamp value to pass
813  to the helper function */
814  int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
815  SMALL_DRILL : 0;
816 
817  /* In the filled trace mode drill marks are drawn white-on-black to scrape
818  the underlying pad. This works only for drivers supporting color change,
819  obviously... it means that:
820  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
821  - In HPGL you can't see them
822  - In gerbers you can't see them, too. This is arguably the right thing to
823  do since having drill marks and high speed drill stations is a sure
824  recipe for broken tools and angry manufacturers. If you *really* want them
825  you could start a layer with negative polarity to scrape the film.
826  - In DXF they go into the 'WHITE' layer. This could be useful.
827  */
828  if( GetPlotMode() == FILLED )
830 
831  for( TRACK* pts = m_board->m_Track; pts != NULL; pts = pts->Next() )
832  {
833  const VIA* via = dyn_cast<const VIA*>( pts );
834 
835  if( via )
837  wxSize( via->GetDrillValue(), 0 ),
838  wxSize( via->GetWidth(), 0 ), 0, small_drill );
839  }
840 
841  for( MODULE* Module = m_board->m_Modules; Module != NULL; Module = Module->Next() )
842  {
843  for( D_PAD* pad = Module->PadsList(); pad != NULL; pad = pad->Next() )
844  {
845  if( pad->GetDrillSize().x == 0 )
846  continue;
847 
848  plotOneDrillMark( pad->GetDrillShape(),
849  pad->GetPosition(), pad->GetDrillSize(),
850  pad->GetSize(), pad->GetOrientation(),
851  small_drill );
852  }
853  }
854 
855  if( GetPlotMode() == FILLED )
857 }
#define SMALL_DRILL
Definition: pcbplot.h:73
virtual void SetColor(COLOR4D color)=0
MODULE * Next() const
Definition: class_module.h:123
PLOTTER * m_plotter
Definition: pcbplot.h:79
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:61
BOARD * m_board
Definition: pcbplot.h:80
DrillMarksType GetDrillMarksType() const
const wxPoint & GetStart() const
Definition: class_track.h:122
D_PAD * Next() const
Definition: class_pad.h:160
COLOR4D GetColor() const
TRACK * Next() const
Definition: class_track.h:99
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.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
DLIST< MODULE > m_Modules
Definition: class_board.h:247
int GetWidth() const
Definition: class_track.h:116
EDA_DRAW_MODE_T GetPlotMode() const
Definition: colors.h:49
DLIST< TRACK > m_Track
Definition: class_board.h:248
void BRDITEMS_PLOTTER::PlotFilledAreas ( ZONE_CONTAINER aZone)

Definition at line 611 of file plot_brditems_plotter.cpp.

References SHAPE_POLY_SET::CIterate(), FILLED, FILLED_SHAPE, ZONE_CONTAINER::FillSegments(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_NETLIST_METADATA::GBR_NETINFO_NET, getColor(), ZONE_CONTAINER::GetFilledPolysList(), ZONE_CONTAINER::GetFillMode(), ZONE_CONTAINER::GetLayer(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetname(), PCB_PLOT_PARAMS::GetPlotMode(), SHAPE_POLY_SET::IsEmpty(), ZONE_CONTAINER::IsOnCopperLayer(), m_plotter, NO_FILL, PLOTTER::PlotPoly(), GBR_METADATA::SetApertureAttrib(), PLOTTER::SetColor(), GBR_METADATA::SetCopper(), PLOTTER::SetCurrentLineWidth(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), and PLOTTER::ThickSegment().

Referenced by PlotSilkScreen(), PlotSolderMaskLayer(), PlotStandardLayer(), and SetLayerSet().

612 {
613  const SHAPE_POLY_SET& polysList = aZone->GetFilledPolysList();
614 
615  if( polysList.IsEmpty() )
616  return;
617 
618  GBR_METADATA gbr_metadata;
619 
620  bool isOnCopperLayer = aZone->IsOnCopperLayer();
621 
622  if( isOnCopperLayer )
623  {
624  gbr_metadata.SetNetName( aZone->GetNetname() );
625  gbr_metadata.SetCopper( true );
626 
627  // Zones with no net name can exist.
628  // they are not used to connect items, so the aperture attribute cannot
629  // be set as conductor
630  if( aZone->GetNetname().IsEmpty() )
632  else
633  {
636  }
637  }
638 
639  // We need a buffer to store corners coordinates:
640  static std::vector< wxPoint > cornerList;
641  cornerList.clear();
642 
643  m_plotter->SetColor( getColor( aZone->GetLayer() ) );
644 
645  /* Plot all filled areas: filled areas have a filled area and a thick
646  * outline we must plot the filled area itself ( as a filled polygon
647  * OR a set of segments ) and plot the thick outline itself
648  *
649  * in non filled mode the outline is plotted, but not the filling items
650  */
651  for( auto ic = polysList.CIterate(); ic; ++ic )
652  {
653  wxPoint pos( ic->x, ic->y );
654  cornerList.push_back( pos );
655 
656  if( ic.IsEndContour() ) // Plot the current filled area outline
657  {
658  // First, close the outline
659  if( cornerList[0] != cornerList[cornerList.size() - 1] )
660  {
661  cornerList.push_back( cornerList[0] );
662  }
663 
664  // Plot the current filled area and its outline
665  if( GetPlotMode() == FILLED )
666  {
667  // Plot the filled area polygon.
668  // The area can be filled by segments or uses solid polygons
669  if( aZone->GetFillMode() == 0 ) // We are using solid polygons
670  {
671  m_plotter->PlotPoly( cornerList, FILLED_SHAPE, aZone->GetMinThickness(), &gbr_metadata );
672  }
673  else // We are using areas filled by segments: plot segments and outline
674  {
675  for( unsigned iseg = 0; iseg < aZone->FillSegments().size(); iseg++ )
676  {
677  wxPoint start = (wxPoint) aZone->FillSegments()[iseg].A;
678  wxPoint end = (wxPoint) aZone->FillSegments()[iseg].B;
679  m_plotter->ThickSegment( start, end,
680  aZone->GetMinThickness(),
681  GetPlotMode(), &gbr_metadata );
682  }
683 
684  // Plot the area outline only
685  if( aZone->GetMinThickness() > 0 )
686  m_plotter->PlotPoly( cornerList, NO_FILL, aZone->GetMinThickness() );
687  }
688  }
689  else
690  {
691  if( aZone->GetMinThickness() > 0 )
692  {
693  for( unsigned jj = 1; jj<cornerList.size(); jj++ )
694  m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
695  aZone->GetMinThickness(),
696  GetPlotMode(), &gbr_metadata );
697  }
698 
700  }
701 
702  cornerList.clear();
703  }
704  }
705 }
int GetMinThickness() const
Definition: class_zone.h:198
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:119
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:175
PLOTTER * m_plotter
Definition: pcbplot.h:79
ZONE_SEGMENT_FILL & FillSegments()
Definition: class_zone.h:233
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
Class SHAPE_POLY_SET.
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:175
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:534
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:51
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:129
bool IsOnCopperLayer() const
Function IsOnCopperLayer.
Definition: class_zone.cpp:181
const wxString & GetNetname() const
Function GetNetname.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:457
EDA_DRAW_MODE_T GetPlotMode() const
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:109
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:53
void SetCopper(bool aValue)
Definition: gbr_metadata.h:138
print info associated to a net (TO.N attribute)
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
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 786 of file plot_brditems_plotter.cpp.

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

Referenced by PlotDrillMarks(), and SetLayerSet().

790 {
791  // Small drill marks have no significance when applied to slots
792  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
793  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
794 
795  // Round holes only have x diameter, slots have both
796  aDrillSize.x -= getFineWidthAdj();
797  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
798 
799  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
800  {
801  aDrillSize.y -= getFineWidthAdj();
802  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
803  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
804  }
805  else
806  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
807 }
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: macros.h:127
PLOTTER * m_plotter
Definition: pcbplot.h:79
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
EDA_DRAW_MODE_T GetPlotMode() const
int getFineWidthAdj()
Definition: pcbplot.h:96
#define min(a, b)
Definition: auxiliary.h:85
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 70 of file plot_brditems_plotter.cpp.

References LSET::AllBoardTechMask(), LSET::AllCuMask(), D_PAD::BuildPadPolygon(), D_PAD::CustomShapeAsPolygonToBoardPosition(), LSET::ExternalCuMask(), PLOTTER::FlashPadCircle(), PLOTTER::FlashPadCustom(), PLOTTER::FlashPadOval(), PLOTTER::FlashPadRect(), PLOTTER::FlashPadRoundRect(), PLOTTER::FlashPadTrapez(), GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF, GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_VIAPAD, 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::GetLayerSet(), D_PAD::GetName(), BOARD_CONNECTED_ITEM::GetNetname(), D_PAD::GetOrientation(), D_PAD::GetParent(), MODULE::GetReference(), D_PAD::GetRoundRectCornerRadius(), D_PAD::GetShape(), D_PAD::GetSize(), LIGHTGRAY, m_layerMask, GBR_METADATA::m_NetlistMetadata, GBR_NETLIST_METADATA::m_NotInNet, m_plotter, D_PAD::MergePrimitivesAsPolygon(), SHAPE_POLY_SET::OutlineCount(), PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, PAD_ATTRIB_STANDARD, 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(), GBR_METADATA::SetNetAttribType(), GBR_METADATA::SetNetName(), GBR_METADATA::SetPadName(), D_PAD::ShapePos(), and WHITE.

Referenced by PlotSilkScreen(), PlotStandardLayer(), and SetLayerSet().

71 {
72  wxPoint shape_pos = aPad->ShapePos();
73  GBR_METADATA gbr_metadata;
74 
75  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
76  bool isOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
77  bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
78 
79  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
80 
81  if( isOnCopperLayer )
82  {
83  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
84  gbr_metadata.SetCopper( true );
85 
86  if( isOnExternalCopperLayer )
87  gbr_metadata.SetPadName( aPad->GetName() );
88 
89  gbr_metadata.SetNetName( aPad->GetNetname() );
90 
91  // Some pads are mechanical pads ( through hole or smd )
92  // when this is the case, they have no pad name and/or are not plated.
93  // In this case gerber files have slightly different attributes.
95  aPad->GetName().IsEmpty() )
96  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
97 
98  if( !isOnExternalCopperLayer || !isPadOnBoardTechLayers )
99  {
100  // On internal layers one cannot use the GBR_NETLIST_METADATA::GBR_INFO_FLASHED_PAD
101  // attribute when the component is on an external layer (most of the case)
102  // Also, if a SMD pad is not on a tech layer (masks) use also net+cmp attribute, because
103  // it is not really a pad (can be a "pad", actually a node in a virtual component)
106 
107  if( !isPadOnBoardTechLayers )
108  // such a pad is not soldered and is not a connecting point.
109  // Just set aperture attribute as conductor
110  // If it is a through hole pad, it will be adjusted later
112 
113  switch( aPad->GetAttribute() )
114  {
115  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
117  break;
118 
119  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
121  break;
122 
123  default:
124  break;
125  }
126  }
127  else // Some attributes are reserved to the external copper layers
128  {
129  switch( aPad->GetAttribute() )
130  {
131  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
133  break;
134 
135  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
137  break;
138 
139  case PAD_ATTRIB_CONN: // Connector pads have no solder paste.
141  break;
142 
143  case PAD_ATTRIB_SMD: // SMD pads (One external copper layer only) with solder paste
144  if( aPad->GetShape() == PAD_SHAPE_CIRCLE ) // perhaps a BGA pad
146  else
148  break;
149  }
150  }
151 
154  }
155  else
156  {
158  }
159 
160  // Set plot color (change WHITE to LIGHTGRAY because
161  // the white items are not seen on a white paper or screen
162  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
163 
164  switch( aPad->GetShape() )
165  {
166  case PAD_SHAPE_CIRCLE:
167  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
168  break;
169 
170  case PAD_SHAPE_OVAL:
171  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(),
172  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
173  break;
174 
175  case PAD_SHAPE_TRAPEZOID:
176  {
177  wxPoint coord[4];
178  aPad->BuildPadPolygon( coord, wxSize(0,0), 0 );
179  m_plotter->FlashPadTrapez( shape_pos, coord,
180  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
181  }
182  break;
183 
184  case PAD_SHAPE_ROUNDRECT:
185  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
186  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
187  break;
188 
189  case PAD_SHAPE_CUSTOM:
190  {
191  SHAPE_POLY_SET polygons;
192  aPad->MergePrimitivesAsPolygon(&polygons, 64 );
193 
194  if( polygons.OutlineCount() == 0 )
195  break;
196 
197  aPad->CustomShapeAsPolygonToBoardPosition( &polygons, shape_pos, aPad->GetOrientation() );
198  m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), &polygons, aPlotMode, &gbr_metadata );
199  }
200  break;
201 
202  case PAD_SHAPE_RECT:
203  default:
204  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(),
205  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
206  break;
207  }
208 }
bool MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon=NULL, int aCircleToSegmentsCount=32)
Merge all basic shapes, converted to a polygon in one polygon, in m_customShapeAsPolygon.
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:673
void SetPadName(const wxString &aPadname)
Definition: gbr_metadata.h:130
aperture used for edge connecto pad (outer layers)
Definition: gbr_metadata.h:60
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:405
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void BuildPadPolygon(wxPoint aCoord[4], wxSize aInflateValue, double aRotation) const
Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Co...
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:119
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:528
MODULE * GetParent() const
Definition: class_pad.h:162
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:61
PLOTTER * m_plotter
Definition: pcbplot.h:79
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:55
int OutlineCount() const
Returns the number of outlines in the set
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:216
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCustom
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:59
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
void CustomShapeAsPolygonToBoardPosition(SHAPE_POLY_SET *aMergedPolygon, wxPoint aPosition, double aRotation) const
When created, the corners coordinates are relative to the pad position, orientation 0...
Class SHAPE_POLY_SET.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRoundRect
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:402
static LSET ExternalCuMask()
Function ExternalCuMask returns a mask holding the Front and Bottom layers.
Definition: lset.cpp:703
const wxSize & GetSize() const
Definition: class_pad.h:269
const wxString & GetName() const
Definition: class_pad.h:190
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:61
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:62
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:51
void SetNetName(const wxString &aNetname)
Definition: gbr_metadata.h:129
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRect
const wxString & GetNetname() const
Function GetNetname.
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:460
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
LSET m_layerMask
Definition: pcbplot.h:81
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:382
Usual pad.
Definition: pad_shapes.h:60
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:57
Definition: colors.h:49
wxPoint ShapePos() const
Definition: class_pad.cpp:508
static LSET AllBoardTechMask()
Function AllTechMask returns a mask holding board technical layers (no CU layer) on both side...
Definition: lset.cpp:750
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
Definition: gbr_metadata.h:109
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:148
void SetCopper(bool aValue)
Definition: gbr_metadata.h:138
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadTrapez flash a trapezoidal pad
print info associated to a net (TO.N attribute)
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:131
#define GBR_NETINFO_ALL
void BRDITEMS_PLOTTER::PlotPcbTarget ( PCB_TARGET PtMire)

Definition at line 382 of file plot_brditems_plotter.cpp.

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(), and SetLayerSet().

383 {
384  int dx1, dx2, dy1, dy2, radius;
385 
386  if( !m_layerMask[aMire->GetLayer()] )
387  return;
388 
389  m_plotter->SetColor( getColor( aMire->GetLayer() ) );
390 
391  DRAWSEGMENT draw;
392 
393  draw.SetShape( S_CIRCLE );
394  draw.SetWidth( aMire->GetWidth() );
395  draw.SetLayer( aMire->GetLayer() );
396  draw.SetStart( aMire->GetPosition() );
397  radius = aMire->GetSize() / 3;
398 
399  if( aMire->GetShape() ) // shape X
400  radius = aMire->GetSize() / 2;
401 
402  // Draw the circle
403  draw.SetEnd( wxPoint( draw.GetStart().x + radius, draw.GetStart().y ));
404 
405  PlotDrawSegment( &draw );
406 
407  draw.SetShape( S_SEGMENT );
408 
409  radius = aMire->GetSize() / 2;
410  dx1 = radius;
411  dy1 = 0;
412  dx2 = 0;
413  dy2 = radius;
414 
415  if( aMire->GetShape() ) // Shape X
416  {
417  dx1 = dy1 = radius;
418  dx2 = dx1;
419  dy2 = -dy1;
420  }
421 
422  wxPoint mirePos( aMire->GetPosition() );
423 
424  // Draw the X or + shape:
425  draw.SetStart( wxPoint( mirePos.x - dx1, mirePos.y - dy1 ));
426  draw.SetEnd( wxPoint( mirePos.x + dx1, mirePos.y + dy1 ));
427  PlotDrawSegment( &draw );
428 
429  draw.SetStart( wxPoint( mirePos.x - dx2, mirePos.y - dy2 ));
430  draw.SetEnd( wxPoint( mirePos.x + dx2, mirePos.y + dy2 ));
431  PlotDrawSegment( &draw );
432 }
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:79
usual segment : line with rounded ends
void SetStart(const wxPoint &aStart)
LSET m_layerMask
Definition: pcbplot.h:81
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)
void BRDITEMS_PLOTTER::PlotTextePcb ( TEXTE_PCB pt_texte)

Definition at line 545 of file plot_brditems_plotter.cpp.

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

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

546 {
547  double orient;
548  int thickness;
549  wxPoint pos;
550  wxSize size;
551  wxString shownText( pt_texte->GetShownText() );
552 
553  if( shownText.IsEmpty() )
554  return;
555 
556  if( !m_layerMask[pt_texte->GetLayer()] )
557  return;
558 
559  GBR_METADATA gbr_metadata;
560 
561  if( IsCopperLayer( pt_texte->GetLayer() ) )
562  {
564  }
565 
566  COLOR4D color = getColor( pt_texte->GetLayer() );
567  m_plotter->SetColor( color );
568 
569  size = pt_texte->GetTextSize();
570  pos = pt_texte->GetTextPos();
571  orient = pt_texte->GetTextAngle();
572  thickness = pt_texte->GetThickness();
573 
574  if( pt_texte->IsMirrored() )
575  size.x = -size.x;
576 
577  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
578  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
579  // (like bold text) and we manage the thickness.
580  // So we set bold flag to true
581  bool allow_bold = pt_texte->IsBold() || thickness;
582 
583  if( pt_texte->IsMultilineAllowed() )
584  {
585  std::vector<wxPoint> positions;
586  wxArrayString strings_list;
587  wxStringSplit( shownText, strings_list, '\n' );
588  positions.reserve( strings_list.Count() );
589 
590  pt_texte->GetPositionsOfLinesOfMultilineText( positions, strings_list.Count() );
591 
592  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
593  {
594  wxString& txt = strings_list.Item( ii );
595  m_plotter->Text( positions[ii], color, txt, orient, size,
596  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
597  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
598  }
599  }
600  else
601  {
602  m_plotter->Text( pos, color, shownText, orient, size,
603  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
604  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
605  }
606 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:130
bool IsMultilineAllowed() const
Definition: eda_text.h:186
const wxPoint & GetTextPos() const
Definition: eda_text.h:222
bool IsItalic() const
Definition: eda_text.h:168
virtual void SetColor(COLOR4D color)=0
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
int color
Definition: DXF_plotter.cpp:62
PLOTTER * m_plotter
Definition: pcbplot.h:79
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:188
bool IsBold() const
Definition: eda_text.h:171
double GetTextAngle() const
Definition: eda_text.h:162
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:152
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.
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:133
void GetPositionsOfLinesOfMultilineText(std::vector< wxPoint > &aPositions, int aLineCount) const
Function GetPositionsOfLinesOfMultilineText Populates aPositions with the position of each line of a ...
Definition: eda_text.cpp:314
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:189
bool IsMirrored() const
Definition: eda_text.h:177
LSET m_layerMask
Definition: pcbplot.h:81
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:109
const wxSize & GetTextSize() const
Definition: eda_text.h:213
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:53
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void BRDITEMS_PLOTTER::PlotTextModule ( TEXTE_MODULE aTextMod,
COLOR4D  aColor 
)

Definition at line 292 of file plot_brditems_plotter.cpp.

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

Referenced by PlotAllTextsModule(), and SetLayerSet().

293 {
294  wxSize size;
295  wxPoint pos;
296  double orient;
297  int thickness;
298 
299  if( aColor == COLOR4D::WHITE )
300  aColor = COLOR4D( LIGHTGRAY );
301 
302  m_plotter->SetColor( aColor );
303 
304  // calculate some text parameters :
305  size = pt_texte->GetTextSize();
306  pos = pt_texte->GetTextPos();
307 
308  orient = pt_texte->GetDrawRotation();
309 
310  thickness = pt_texte->GetThickness();
311 
312  if( pt_texte->IsMirrored() )
313  size.x = -size.x; // Text is mirrored
314 
315  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
316  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
317  // (like bold text) and we manage the thickness.
318  // So we set bold flag to true
319  bool allow_bold = pt_texte->IsBold() || thickness;
320 
321  GBR_METADATA gbr_metadata;
323  MODULE* parent = static_cast<MODULE*> ( pt_texte->GetParent() );
324  gbr_metadata.SetCmpReference( parent->GetReference() );
325 
326  m_plotter->Text( pos, aColor,
327  pt_texte->GetShownText(),
328  orient, size,
329  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
330  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
331 }
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
Definition: gbr_metadata.h:119
PLOTTER * m_plotter
Definition: pcbplot.h:79
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.
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:460
Definition: colors.h:49
void SetCmpReference(const wxString &aComponentRef)
Definition: gbr_metadata.h:131
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void PCB_PLOT_PARAMS::SetA4Output ( int  aForce)
inlineinherited

Definition at line 279 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

279 { m_A4Output = aForce; };
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
void PCB_PLOT_PARAMS::SetAutoScale ( bool  aFlag)
inlineinherited

Definition at line 212 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::Plot().

212 { m_autoScale = aFlag; }
bool m_autoScale
When true set the scale to fit the board in the page.
void PCB_PLOT_PARAMS::SetColor ( COLOR4D  aVal)
inlineinherited

Definition at line 187 of file pcb_plot_params.h.

187 { m_color = aVal; }
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.
void PCB_PLOT_PARAMS::SetCreateGerberJobFile ( bool  aCreate)
inlineinherited

Definition at line 252 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

252 { m_createGerberJobFile = aCreate; }
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
void PCB_PLOT_PARAMS::SetDrillMarksType ( DrillMarksType  aVal)
inlineinherited

Definition at line 199 of file pcb_plot_params.h.

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

199 { m_drillMarks = aVal; }
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
void PCB_PLOT_PARAMS::SetDXFPlotPolygonMode ( bool  aFlag)
inlineinherited

Definition at line 196 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

196 { 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...
void PCB_PLOT_PARAMS::SetExcludeEdgeLayer ( bool  aFlag)
inlineinherited

Definition at line 237 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

237 { m_excludeEdgeLayer = aFlag; }
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
void PCB_PLOT_PARAMS::SetFineScaleAdjustX ( double  aVal)
inlineinherited
void PCB_PLOT_PARAMS::SetFineScaleAdjustY ( double  aVal)
inlineinherited
void PCB_PLOT_PARAMS::SetFormat ( PlotFormat  aFormat)
inlineinherited

Definition at line 240 of file pcb_plot_params.h.

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

240 { m_format = aFormat; }
PlotFormat m_format
Plot format type (chooses the driver to be used)
void PCB_PLOT_PARAMS::SetGerberPrecision ( int  aPrecision)
inherited

Definition at line 136 of file pcb_plot_params.cpp.

References gbrDefaultPrecision.

Referenced by DIALOG_PLOT::applyPlotSettings(), and PCB_PLOT_PARAMS::GetUseGerberProtelExtensions().

137 {
138  // Currently geber files use mm.
139  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
140  // or 5, min value for professional boards, when 6 creates problems
141  // to board makers.
142 
145 }
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...
bool PCB_PLOT_PARAMS::SetHPGLPenDiameter ( double  aValue)
inherited

Definition at line 318 of file pcb_plot_params.cpp.

References HPGL_PEN_DIAMETER_MAX, HPGL_PEN_DIAMETER_MIN, and setDouble().

Referenced by DIALOG_PLOT::applyPlotSettings(), and PCB_PLOT_PARAMS::GetHPGLPenDiameter().

319 {
321 }
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
void PCB_PLOT_PARAMS::SetHPGLPenNum ( int  aVal)
inlineinherited

Definition at line 291 of file pcb_plot_params.h.

291 { m_HPGLPenNum = aVal; }
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
bool PCB_PLOT_PARAMS::SetHPGLPenSpeed ( int  aValue)
inherited

Definition at line 324 of file pcb_plot_params.cpp.

References HPGL_PEN_SPEED_MAX, HPGL_PEN_SPEED_MIN, and setInt().

Referenced by PCB_PLOT_PARAMS::GetHPGLPenSpeed().

325 {
327 }
#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)
void PCB_PLOT_PARAMS::SetIncludeGerberNetlistInfo ( bool  aUse)
inlineinherited

Definition at line 249 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

249 { m_includeGerberNetlistInfo = aUse; }
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
void PCB_PLOT_PARAMS::SetLayerSelection ( LSET  aSelection)
inlineinherited

Definition at line 270 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

270 { m_layerSelection = aSelection; };
LSET m_layerSelection
Set of layers to plot.
bool PCB_PLOT_PARAMS::SetLineWidth ( int  aValue)
inherited

Definition at line 330 of file pcb_plot_params.cpp.

References PLOT_LINEWIDTH_MAX, PLOT_LINEWIDTH_MIN, and setInt().

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

331 {
333 }
#define PLOT_LINEWIDTH_MAX
static bool setInt(int *aTarget, int aValue, int aMin, int aMax)
#define PLOT_LINEWIDTH_MIN
int m_lineWidth
The default line width (used to draw items having no defined width)
void PCB_PLOT_PARAMS::SetMirror ( bool  aFlag)
inlineinherited

Definition at line 215 of file pcb_plot_params.h.

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

215 { m_mirror = aFlag; }
bool m_mirror
Mirror the plot around the X axis.
void PCB_PLOT_PARAMS::SetNegative ( bool  aFlag)
inlineinherited

Definition at line 228 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

228 { m_negative = aFlag; }
bool m_negative
Plot in negative color (supported only by some drivers)
void PCB_PLOT_PARAMS::SetOutputDirectory ( wxString  aDir)
inlineinherited

Definition at line 243 of file pcb_plot_params.h.

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

243 { m_outputDirectory = aDir; }
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
void PCB_PLOT_PARAMS::SetPlotFrameRef ( bool  aFlag)
inlineinherited

Definition at line 234 of file pcb_plot_params.h.

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

234 { m_plotFrameRef = aFlag; }
bool m_plotFrameRef
True to plot/print frame references.
void PCB_PLOT_PARAMS::SetPlotInvisibleText ( bool  aFlag)
inlineinherited

Definition at line 221 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

221 { m_plotInvisibleText = aFlag; }
bool m_plotInvisibleText
Force plotting of fields marked invisible.
void PCB_PLOT_PARAMS::SetPlotMode ( EDA_DRAW_MODE_T  aPlotMode)
inlineinherited

Definition at line 193 of file pcb_plot_params.h.

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

193 { m_plotMode = aPlotMode; }
EDA_DRAW_MODE_T m_plotMode
FILLED or SKETCH selects how to plot filled objects.
void PCB_PLOT_PARAMS::SetPlotPadsOnSilkLayer ( bool  aFlag)
inlineinherited

Definition at line 218 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

218 { m_plotPadsOnSilkLayer = aFlag; }
bool m_plotPadsOnSilkLayer
Allows pads outlines on silkscreen layer (when pads are also on silk screen)
void PCB_PLOT_PARAMS::SetPlotReference ( bool  aFlag)
inlineinherited

Definition at line 225 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

225 { m_plotReference = aFlag; }
bool m_plotReference
Enable plotting of part references.
void PCB_PLOT_PARAMS::SetPlotValue ( bool  aFlag)
inlineinherited

Definition at line 223 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

223 { m_plotValue = aFlag; }
bool m_plotValue
Enable plotting of part values.
void PCB_PLOT_PARAMS::SetPlotViaOnMaskLayer ( bool  aFlag)
inlineinherited

Definition at line 231 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

231 { m_plotViaOnMaskLayer = aFlag; }
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
void PCB_PLOT_PARAMS::SetScale ( double  aVal)
inlineinherited

Definition at line 202 of file pcb_plot_params.h.

Referenced by DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick(), DIALOG_PLOT::Plot(), and DIALOG_PRINT_USING_PRINTER::SetPrintParameters().

202 { m_scale = aVal; }
double m_scale
Global scale factor, 1.0 plots a board with its actual size.
void PCB_PLOT_PARAMS::SetScaleSelection ( int  aSelection)
inlineinherited

Definition at line 276 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

276 { m_scaleSelection = aSelection; };
int m_scaleSelection
Scale ratio index (UI only)
void PCB_PLOT_PARAMS::SetSkipPlotNPTH_Pads ( bool  aSkip)
inlineinherited

Definition at line 172 of file pcb_plot_params.h.

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

172 { m_skipNPTH_Pads = aSkip; }
void PCB_PLOT_PARAMS::SetSubtractMaskFromSilk ( bool  aSubtract)
inlineinherited

Definition at line 267 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

267 { m_subtractMaskFromSilk = aSubtract; };
bool m_subtractMaskFromSilk
On gerbers &#39;scrape&#39; away the solder mask from silkscreen (trim silks)
void PCB_PLOT_PARAMS::SetTextMode ( PlotTextMode  aVal)
inlineinherited

Definition at line 190 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

190 { m_textMode = aVal; }
PlotTextMode m_textMode
Choose how represent text with PS, PDF and DXF drivers.
void PCB_PLOT_PARAMS::SetUseAuxOrigin ( bool  aAux)
inlineinherited

Definition at line 273 of file pcb_plot_params.h.

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

273 { m_useAuxOrigin = aAux; };
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.
void PCB_PLOT_PARAMS::SetUseGerberAttributes ( bool  aUse)
inlineinherited

Definition at line 246 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

246 { m_useGerberAttributes = aUse; }
bool m_useGerberAttributes
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
void PCB_PLOT_PARAMS::SetUseGerberProtelExtensions ( bool  aUse)
inlineinherited

Definition at line 255 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

255 { m_useGerberProtelExtensions = aUse; }
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ...
void PCB_PLOT_PARAMS::SetWidthAdjust ( int  aVal)
inlineinherited

Definition at line 209 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::Plot().

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

Member Data Documentation

BOARD* BRDITEMS_PLOTTER::m_board
private
LSET BRDITEMS_PLOTTER::m_layerMask
private

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