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 operator== (const PCB_PLOT_PARAMS &aPcbPlotParams) const
 
bool operator!= (const PCB_PLOT_PARAMS &aPcbPlotParams) const
 
void SetColor (COLOR4D aVal)
 
COLOR4D GetColor () const
 
void SetReferenceColor (COLOR4D aVal)
 
COLOR4D GetReferenceColor () const
 
void SetValueColor (COLOR4D aVal)
 
COLOR4D GetValueColor () const
 
void SetTextMode (PlotTextMode aVal)
 
PlotTextMode GetTextMode () const
 
void SetPlotMode (EDA_DRAW_MODE_T aPlotMode)
 
EDA_DRAW_MODE_T GetPlotMode () const
 
void SetPlotOutlineMode (bool aFlag)
 
bool GetPlotOutlineMode () 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 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
 
int GetHPGLPenDiameter () const
 
bool SetHPGLPenDiameter (int 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 76 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 83 of file pcbplot.h.

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

Member Function Documentation

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

Definition at line 137 of file pcb_plot_params.cpp.

References gbrDefaultPrecision, getTokenName(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), SKETCH, PCBPLOTPARAMS_T::T_drillshape, PCBPLOTPARAMS_T::T_excludeedgelayer, PCBPLOTPARAMS_T::T_false, PCBPLOTPARAMS_T::T_gerberprecision, PCBPLOTPARAMS_T::T_hpglpendiameter, PCBPLOTPARAMS_T::T_hpglpennumber, PCBPLOTPARAMS_T::T_hpglpenspeed, PCBPLOTPARAMS_T::T_layerselection, PCBPLOTPARAMS_T::T_linewidth, PCBPLOTPARAMS_T::T_mirror, PCBPLOTPARAMS_T::T_mode, PCBPLOTPARAMS_T::T_outputdirectory, PCBPLOTPARAMS_T::T_outputformat, PCBPLOTPARAMS_T::T_padsonsilk, PCBPLOTPARAMS_T::T_pcbplotparams, PCBPLOTPARAMS_T::T_plotframeref, PCBPLOTPARAMS_T::T_plotinvisibletext, PCBPLOTPARAMS_T::T_plotreference, PCBPLOTPARAMS_T::T_plotvalue, PCBPLOTPARAMS_T::T_psa4output, PCBPLOTPARAMS_T::T_psnegative, PCBPLOTPARAMS_T::T_scaleselection, PCBPLOTPARAMS_T::T_subtractmaskfromsilk, PCBPLOTPARAMS_T::T_true, PCBPLOTPARAMS_T::T_useauxorigin, PCBPLOTPARAMS_T::T_usegerberadvancedattributes, PCBPLOTPARAMS_T::T_usegerberattributes, PCBPLOTPARAMS_T::T_usegerberextensions, and PCBPLOTPARAMS_T::T_viasonmask.

Referenced by PCB_IO::format().

139 {
140  const char* falseStr = getTokenName( T_false );
141  const char* trueStr = getTokenName( T_true );
142 
143  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
144 
145  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
146  m_layerSelection.FmtHex().c_str() );
147 
148  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
149  m_useGerberProtelExtensions ? trueStr : falseStr );
150 
151  if( m_useGerberAttributes ) // save this option only if active,
152  // to avoid incompatibility with older Pcbnew version
153  {
154  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ), trueStr );
155 
157  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ), trueStr );
158  }
159 
160  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
161  // to avoid incompatibility with older Pcbnew version
162  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
164 
165  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
166  m_excludeEdgeLayer ? trueStr : falseStr );
167  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_linewidth ),
168  m_lineWidth / IU_PER_MM );
169  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
170  m_plotFrameRef ? trueStr : falseStr );
171  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
172  m_plotViaOnMaskLayer ? trueStr : falseStr );
173  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
174  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
175  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
176  m_useAuxOrigin ? trueStr : falseStr );
177  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
178  m_HPGLPenNum );
179 
180  // Obsolete parameter, pen speed is no more managed, because hpgl format
181  // is now an export format, and for this, pen speed has no meaning
182  // aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
183  // m_HPGLPenSpeed );
184 
185  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
186  m_HPGLPenSpeed );
187  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpendiameter ),
188  m_HPGLPenDiam );
189  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
190  m_negative ? trueStr : falseStr );
191  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
192  m_A4Output ? trueStr : falseStr );
193  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
194  m_plotReference ? trueStr : falseStr );
195  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
196  m_plotValue ? trueStr : falseStr );
197  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
198  m_plotInvisibleText ? trueStr : falseStr );
199  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
200  m_plotPadsOnSilkLayer ? trueStr : falseStr );
201  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
202  m_subtractMaskFromSilk ? trueStr : falseStr );
203  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
204  m_format );
205  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
206  m_mirror ? trueStr : falseStr );
207  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
208  m_drillMarks );
209  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
211  aFormatter->Print( aNestLevel+1, "(%s %s)", getTokenName( T_outputdirectory ),
212  aFormatter->Quotew( m_outputDirectory ).c_str() );
213  aFormatter->Print( 0, ")\n" );
214 }
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:253
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.
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 gerbers use a conventional set of Protel extensions instead of appending a suffix to th...
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.
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_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
bool GetIncludeGerberNetlistInfo() const
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
std::string Quotew(const wxString &aWrapee)
Definition: richio.cpp:486
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 page 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:408
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 for the frame and in LINE mode)
int m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas.
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 270 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_A4Output.

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

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

References PCB_PLOT_PARAMS::m_autoScale.

Referenced by initializePlotter().

206 { 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::GetLayerColor(), LIGHTGRAY, m_board, ToLAYER_ID(), and WHITE.

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

58 {
60  if( color == COLOR4D::WHITE )
61  color = COLOR4D( LIGHTGRAY );
62  return color;
63 }
COLOR4D GetLayerColor(PCB_LAYER_ID aLayer) const
Function GetLayerColor gets a layer color for any valid layer, including non-copper ones...
BOARD * m_board
Definition: pcbplot.h:79
Definition: colors.h:49
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:767
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 175 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_color.

Referenced by PlotDrillMarks(), and PlotOneBoardLayer().

175 { return m_color; }
COLOR4D m_color
Color for plotting the current layer.
DrillMarksType PCB_PLOT_PARAMS::GetDrillMarksType ( ) const
inlineinherited

Definition at line 193 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_drillMarks.

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

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

Definition at line 231 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_excludeEdgeLayer.

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

231 { 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 199 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_fineScaleAdjustX.

Referenced by StartPlotBoard().

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

Definition at line 201 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_fineScaleAdjustY.

Referenced by StartPlotBoard().

201 { 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 95 of file pcbplot.h.

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

Referenced by plotOneDrillMark(), and PlotStandardLayer().

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

Definition at line 234 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().

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

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

Definition at line 249 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().

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

Definition at line 272 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_HPGLPenDiam.

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

272 { return m_HPGLPenDiam; };
int m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas.
int PCB_PLOT_PARAMS::GetHPGLPenNum ( ) const
inlineinherited

Definition at line 277 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_HPGLPenNum.

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

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

Definition at line 274 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_HPGLPenSpeed.

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

274 { 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 243 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_includeGerberNetlistInfo.

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

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

References PCB_PLOT_PARAMS::m_layerSelection.

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

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

Definition at line 279 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_lineWidth.

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

279 { return m_lineWidth; };
int m_lineWidth
The default line width (used for the frame and in LINE mode)
bool PCB_PLOT_PARAMS::GetMirror ( ) const
inlineinherited

Definition at line 209 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_mirror.

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

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

Definition at line 222 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_negative.

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

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

Definition at line 228 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotFrameRef.

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

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

Definition at line 215 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotInvisibleText.

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

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

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

Definition at line 190 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotOutlineMode.

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

190 { return m_plotOutlineMode; }
bool m_plotOutlineMode
Plot lines in outline mode.
bool PCB_PLOT_PARAMS::GetPlotPadsOnSilkLayer ( ) const
inlineinherited

Definition at line 212 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotPadsOnSilkLayer.

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

212 { 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 219 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotReference.

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

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

Definition at line 217 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotValue.

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

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

Definition at line 225 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_plotViaOnMaskLayer.

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

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

Definition at line 178 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_referenceColor.

Referenced by PlotAllTextsModule().

178 { return m_referenceColor; }
COLOR4D m_referenceColor
Color for plotting references.
double PCB_PLOT_PARAMS::GetScale ( ) const
inlineinherited

Definition at line 196 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_scale.

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

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

References PCB_PLOT_PARAMS::m_scaleSelection.

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

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

Definition at line 166 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_skipNPTH_Pads.

Referenced by PlotStandardLayer().

166 { return m_skipNPTH_Pads; }
bool PCB_PLOT_PARAMS::GetSubtractMaskFromSilk ( ) const
inlineinherited

Definition at line 258 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_subtractMaskFromSilk.

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

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

Definition at line 184 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_textMode.

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

184 { 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 264 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_useAuxOrigin.

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

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

Definition at line 240 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_useGerberAttributes.

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

240 { 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 246 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_useGerberProtelExtensions.

Referenced by DIALOG_PLOT::Init_Dialog().

246 { return m_useGerberProtelExtensions; }
bool m_useGerberProtelExtensions
When plotting gerbers use a conventional set of Protel extensions instead of appending a suffix to th...
COLOR4D PCB_PLOT_PARAMS::GetValueColor ( ) const
inlineinherited

Definition at line 181 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_valueColor.

Referenced by PlotAllTextsModule().

181 { return m_valueColor; }
COLOR4D m_valueColor
Color for plotting values.
int PCB_PLOT_PARAMS::GetWidthAdjust ( ) const
inlineinherited

Definition at line 203 of file pcb_plot_params.h.

References PCB_PLOT_PARAMS::m_widthAdjust.

Referenced by getFineWidthAdj().

203 { 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::operator!= ( const PCB_PLOT_PARAMS aPcbPlotParams) const
inherited

Definition at line 301 of file pcb_plot_params.cpp.

302 {
303  return !( *this == aPcbPlotParams );
304 }
bool PCB_PLOT_PARAMS::operator== ( const PCB_PLOT_PARAMS aPcbPlotParams) const
inherited

Definition at line 223 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_drillMarks, 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_plotOutlineMode, PCB_PLOT_PARAMS::m_plotPadsOnSilkLayer, PCB_PLOT_PARAMS::m_plotReference, PCB_PLOT_PARAMS::m_plotValue, PCB_PLOT_PARAMS::m_plotViaOnMaskLayer, PCB_PLOT_PARAMS::m_referenceColor, 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, PCB_PLOT_PARAMS::m_valueColor, and PCB_PLOT_PARAMS::m_widthAdjust.

224 {
225  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
226  return false;
228  return false;
229  if( m_useGerberAttributes != aPcbPlotParams.m_useGerberAttributes )
230  return false;
232  return false;
233  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
234  return false;
235  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
236  return false;
237  if( m_lineWidth != aPcbPlotParams.m_lineWidth )
238  return false;
239  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
240  return false;
241  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
242  return false;
243  if( m_plotMode != aPcbPlotParams.m_plotMode )
244  return false;
245  if( m_plotOutlineMode != aPcbPlotParams.m_plotOutlineMode )
246  return false;
247  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
248  return false;
249  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
250  return false;
251  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
252  return false;
253  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
254  return false;
255  if( m_negative != aPcbPlotParams.m_negative )
256  return false;
257  if( m_A4Output != aPcbPlotParams.m_A4Output )
258  return false;
259  if( m_plotReference != aPcbPlotParams.m_plotReference )
260  return false;
261  if( m_plotValue != aPcbPlotParams.m_plotValue )
262  return false;
263  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
264  return false;
265  if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
266  return false;
267  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
268  return false;
269  if( m_format != aPcbPlotParams.m_format )
270  return false;
271  if( m_mirror != aPcbPlotParams.m_mirror )
272  return false;
273  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
274  return false;
275  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
276  return false;
277  if( m_autoScale != aPcbPlotParams.m_autoScale )
278  return false;
279  if( m_scale != aPcbPlotParams.m_scale )
280  return false;
281  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
282  return false;
283  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
284  return false;
285  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
286  return false;
287  if( m_color != aPcbPlotParams.m_color )
288  return false;
289  if( m_referenceColor != aPcbPlotParams.m_referenceColor )
290  return false;
291  if( m_valueColor != aPcbPlotParams.m_valueColor )
292  return false;
293  if( m_textMode != aPcbPlotParams.m_textMode )
294  return false;
295  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
296  return false;
297  return true;
298 }
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_plotOutlineMode
Plot lines in outline mode.
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 gerbers use a conventional set of Protel extensions instead of appending a suffix to th...
int m_scaleSelection
Scale ratio index (UI only)
bool m_negative
Plot in negative color (supported only by some drivers)
COLOR4D m_valueColor
Color for plotting values.
bool m_plotFrameRef
True to plot/print frame references.
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_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 'scrape' away the solder mask from silkscreen (trim silks)
double m_fineScaleAdjustY
fine scale adjust Y axis
COLOR4D m_referenceColor
Color for plotting references.
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 page coordinates.
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
COLOR4D m_color
Color for plotting the current layer.
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 for the frame and in LINE mode)
int m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas.
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 217 of file pcb_plot_params.cpp.

References PCB_PLOT_PARAMS_PARSER::Parse().

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

218 {
219  aParser->Parse( this );
220 }
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)
void BRDITEMS_PLOTTER::Plot_1_EdgeModule ( EDGE_MODULE aEdge)

Definition at line 456 of file plot_brditems_plotter.cpp.

References LSET::AllCuMask(), ArcTangente(), 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(), DRAWSEGMENT::GetPolyPoints(), MODULE::GetPosition(), MODULE::GetReference(), DRAWSEGMENT::GetShape(), DRAWSEGMENT::GetStart(), DRAWSEGMENT::GetWidth(), 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(), and PlotStandardLayer().

457 {
458  int type_trace; // Type of item to plot.
459  int thickness; // Segment thickness.
460  int radius; // Circle radius.
461 
462  if( aEdge->Type() != PCB_MODULE_EDGE_T )
463  return;
464 
465  m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
466 
467  type_trace = aEdge->GetShape();
468  thickness = aEdge->GetWidth();
469 
470  wxPoint pos( aEdge->GetStart() );
471  wxPoint end( aEdge->GetEnd() );
472 
473  GBR_METADATA gbr_metadata;
475  MODULE* parent = static_cast<MODULE*> ( aEdge->GetParent() );
476  gbr_metadata.SetCmpReference( parent->GetReference() );
477 
478  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
479 
480  if( isOnCopperLayer )
481  {
482  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_ETCHEDCMP );
483  gbr_metadata.SetCopper( true );
484  }
485  else if( aEdge->GetLayer() == Edge_Cuts ) // happens also when plotting copper layers
486  {
487  gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
488  }
489 
490  switch( type_trace )
491  {
492  case S_SEGMENT:
493  m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
494  break;
495 
496  case S_CIRCLE:
497  radius = KiROUND( GetLineLength( end, pos ) );
498  m_plotter->ThickCircle( pos, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
499  break;
500 
501  case S_ARC:
502  {
503  radius = KiROUND( GetLineLength( end, pos ) );
504  double startAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
505  double endAngle = startAngle + aEdge->GetAngle();
506 
507  m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
508  }
509  break;
510 
511  case S_POLYGON:
512  {
513  const std::vector<wxPoint>& polyPoints = aEdge->GetPolyPoints();
514 
515  if( polyPoints.size() <= 1 ) // Malformed polygon
516  break;
517 
518  // We must compute true coordinates from m_PolyList
519  // which are relative to module position, orientation 0
520  MODULE* module = aEdge->GetParentModule();
521 
522  std::vector< wxPoint > cornerList;
523 
524  cornerList.reserve( polyPoints.size() );
525 
526  for( unsigned ii = 0; ii < polyPoints.size(); ii++ )
527  {
528  wxPoint corner = polyPoints[ii];
529 
530  if( module )
531  {
532  RotatePoint( &corner, module->GetOrientation() );
533  corner += module->GetPosition();
534  }
535 
536  cornerList.push_back( corner );
537  }
538 
539  m_plotter->PlotPoly( cornerList, FILLED_SHAPE, thickness, &gbr_metadata );
540  }
541  break;
542  }
543 }
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:639
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
BOARD_ITEM_CONTAINER * GetParent() const
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:183
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
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)
void SetNetAttribType(int aNetAttribType)
const wxPoint & GetPosition() const override
Definition: class_module.h:143
polygon (not yet used for tracks, but could be in microwave apps)
PLOTTER * m_plotter
Definition: pcbplot.h:78
usual segment : line with rounded ends
const std::vector< wxPoint > & GetPolyPoints() const
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:106
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
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:271
double GetOrientation() const
Definition: class_module.h:147
Arcs (with rounded ends)
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
double GetAngle() const
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:408
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
LSET m_layerMask
Definition: pcbplot.h:80
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)
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
void BRDITEMS_PLOTTER::Plot_Edges_Modules ( )

Definition at line 440 of file plot_brditems_plotter.cpp.

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

Referenced by PlotSilkScreen().

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

Definition at line 194 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(), PCB_PLOT_PARAMS::GetReferenceColor(), PCB_PLOT_PARAMS::GetValueColor(), MODULE::GraphicalItems(), EDA_TEXT::IsVisible(), m_layerMask, BOARD_ITEM::Next(), PCB_LAYER_ID_COUNT, PlotTextModule(), MODULE::Reference(), and MODULE::Value().

Referenced by PlotSilkScreen(), and PlotStandardLayer().

195 {
196  // see if we want to plot VALUE and REF fields
197  bool trace_val = GetPlotValue();
198  bool trace_ref = GetPlotReference();
199 
200  TEXTE_MODULE* textModule = &aModule->Reference();
201  LAYER_NUM textLayer = textModule->GetLayer();
202 
203  if( textLayer >= PCB_LAYER_ID_COUNT ) // how will this ever be true?
204  return false;
205 
206  if( !m_layerMask[textLayer] )
207  trace_ref = false;
208 
209  if( !textModule->IsVisible() && !GetPlotInvisibleText() )
210  trace_ref = false;
211 
212  textModule = &aModule->Value();
213  textLayer = textModule->GetLayer();
214 
215  if( textLayer > PCB_LAYER_ID_COUNT ) // how will this ever be true?
216  return false;
217 
218  if( !m_layerMask[textLayer] )
219  trace_val = false;
220 
221  if( !textModule->IsVisible() && !GetPlotInvisibleText() )
222  trace_val = false;
223 
224  // Plot text fields, if allowed
225  if( trace_ref )
226  {
227  if( GetReferenceColor() == COLOR4D::UNSPECIFIED )
228  PlotTextModule( &aModule->Reference(), getColor( textLayer ) );
229  else
230  PlotTextModule( &aModule->Reference(), GetReferenceColor() );
231  }
232 
233  if( trace_val )
234  {
235  if( GetValueColor() == COLOR4D::UNSPECIFIED )
236  PlotTextModule( &aModule->Value(), getColor( textLayer ) );
237  else
238  PlotTextModule( &aModule->Value(), GetValueColor() );
239  }
240 
241  for( BOARD_ITEM *item = aModule->GraphicalItems().GetFirst(); item; item = item->Next() )
242  {
243  textModule = dyn_cast<TEXTE_MODULE*>( item );
244 
245  if( !textModule )
246  continue;
247 
248  if( !textModule->IsVisible() )
249  continue;
250 
251  textLayer = textModule->GetLayer();
252 
253  if( textLayer >= PCB_LAYER_ID_COUNT )
254  return false;
255 
256  if( !m_layerMask[textLayer] )
257  continue;
258 
259  PlotTextModule( textModule, getColor( textLayer ) );
260  }
261 
262  return true;
263 }
TEXTE_MODULE & Reference()
Definition: class_module.h:452
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
bool GetPlotValue() const
DLIST< BOARD_ITEM > & GraphicalItems()
Definition: class_module.h:136
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:73
BOARD_ITEM * Next() const
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:451
COLOR4D GetReferenceColor() const
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.
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool GetPlotInvisibleText() const
bool IsVisible() const
Definition: eda_text.h:176
LSET m_layerMask
Definition: pcbplot.h:80
COLOR4D GetValueColor() const
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 267 of file plot_brditems_plotter.cpp.

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

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

268 {
269  for( BOARD_ITEM* item = m_board->m_Drawings; item; item = item->Next() )
270  {
271  switch( item->Type() )
272  {
273  case PCB_LINE_T:
274  PlotDrawSegment( (DRAWSEGMENT*) item);
275  break;
276 
277  case PCB_TEXT_T:
278  PlotTextePcb( (TEXTE_PCB*) item );
279  break;
280 
281  case PCB_DIMENSION_T:
282  PlotDimension( (DIMENSION*) item );
283  break;
284 
285  case PCB_TARGET_T:
286  PlotPcbTarget( (PCB_TARGET*) item );
287  break;
288 
289  case PCB_MARKER_T:
290  default:
291  break;
292  }
293  }
294 }
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void PlotDimension(DIMENSION *Dimension)
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:104
BOARD * m_board
Definition: pcbplot.h:79
BOARD_ITEM * Next() const
void PlotPcbTarget(PCB_TARGET *PtMire)
DLIST< BOARD_ITEM > m_Drawings
Definition: class_board.h:242
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:112
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:113
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:111
void PlotTextePcb(TEXTE_PCB *pt_texte)
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:103
Class DIMENSION.
void PlotDrawSegment(DRAWSEGMENT *PtSegm)
void BRDITEMS_PLOTTER::PlotDimension ( DIMENSION Dimension)

Definition at line 338 of file plot_brditems_plotter.cpp.

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

Referenced by PlotBoardGraphicItems().

339 {
340  if( !m_layerMask[aDim->GetLayer()] )
341  return;
342 
343  DRAWSEGMENT draw;
344 
345  draw.SetWidth( aDim->GetWidth() );
346  draw.SetLayer( aDim->GetLayer() );
347 
348  COLOR4D color = aDim->GetBoard()->GetLayerColor( aDim->GetLayer() );
349 
350  // Set plot color (change WHITE to LIGHTGRAY because
351  // the white items are not seen on a white paper or screen
352  m_plotter->SetColor( color != WHITE ? color : LIGHTGRAY);
353 
354  PlotTextePcb( &aDim->Text() );
355 
356  draw.SetStart( aDim->m_crossBarO );
357  draw.SetEnd( aDim->m_crossBarF );
358  PlotDrawSegment( &draw );
359 
360  draw.SetStart( aDim->m_featureLineGO);
361  draw.SetEnd( aDim->m_featureLineGF );
362  PlotDrawSegment( &draw );
363 
364  draw.SetStart( aDim->m_featureLineDO );
365  draw.SetEnd( aDim->m_featureLineDF );
366  PlotDrawSegment( &draw );
367 
368  draw.SetStart( aDim->m_crossBarF );
369  draw.SetEnd( aDim->m_arrowD1F );
370  PlotDrawSegment( &draw );
371 
372  draw.SetStart( aDim->m_crossBarF );
373  draw.SetEnd( aDim->m_arrowD2F );
374  PlotDrawSegment( &draw );
375 
376  draw.SetStart( aDim->m_crossBarO );
377  draw.SetEnd( aDim->m_arrowG1F );
378  PlotDrawSegment( &draw );
379 
380  draw.SetStart( aDim->m_crossBarO );
381  draw.SetEnd( aDim->m_arrowG2F );
382  PlotDrawSegment( &draw );
383 }
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:78
void SetStart(const wxPoint &aStart)
LSET m_layerMask
Definition: pcbplot.h:80
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 711 of file plot_brditems_plotter.cpp.

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

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

712 {
713  if( !m_layerMask[aSeg->GetLayer()] )
714  return;
715 
716  int radius = 0;
717  double StAngle = 0, EndAngle = 0;
718  int thickness = aSeg->GetWidth();
719 
720  m_plotter->SetColor( getColor( aSeg->GetLayer() ) );
721 
722  wxPoint start( aSeg->GetStart() );
723  wxPoint end( aSeg->GetEnd() );
724 
725  GBR_METADATA gbr_metadata;
726 
727  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
728 
729  if( isOnCopperLayer && aSeg->GetLayer() == Edge_Cuts ) // can happens when plotting copper layers
730  {
732  }
733 
734  switch( aSeg->GetShape() )
735  {
736  case S_CIRCLE:
737  radius = KiROUND( GetLineLength( end, start ) );
738  m_plotter->ThickCircle( start, radius * 2, thickness, GetPlotMode(), &gbr_metadata );
739  break;
740 
741  case S_ARC:
742  radius = KiROUND( GetLineLength( end, start ) );
743  StAngle = ArcTangente( end.y - start.y, end.x - start.x );
744  EndAngle = StAngle + aSeg->GetAngle();
745  m_plotter->ThickArc( start, -EndAngle, -StAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
746  break;
747 
748  case S_CURVE:
749  {
750  m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
751  const std::vector<wxPoint>& bezierPoints = aSeg->GetBezierPoints();
752 
753  for( unsigned i = 1; i < bezierPoints.size(); i++ )
754  m_plotter->ThickSegment( bezierPoints[i - 1], bezierPoints[i],
755  thickness, GetPlotMode(), &gbr_metadata );
756  }
757  break;
758 
759  default:
760  m_plotter->ThickSegment( start, end, thickness, GetPlotMode(), &gbr_metadata );
761  }
762 }
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:639
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:183
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
virtual void SetColor(COLOR4D color)=0
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
PLOTTER * m_plotter
Definition: pcbplot.h:78
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:271
Arcs (with rounded ends)
Bezier Curve.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
LSET m_layerMask
Definition: pcbplot.h:80
EDA_DRAW_MODE_T GetPlotMode() const
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
aperture used for not connected items (texts, outlines on copper)
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 792 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().

793 {
794  /* If small drills marks were requested prepare a clamp value to pass
795  to the helper function */
796  int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
797  SMALL_DRILL : 0;
798 
799  /* In the filled trace mode drill marks are drawn white-on-black to scrape
800  the underlying pad. This works only for drivers supporting color change,
801  obviously... it means that:
802  - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad)
803  - In HPGL you can't see them
804  - In gerbers you can't see them, too. This is arguably the right thing to
805  do since having drill marks and high speed drill stations is a sure
806  recipe for broken tools and angry manufacturers. If you *really* want them
807  you could start a layer with negative polarity to scrape the film.
808  - In DXF they go into the 'WHITE' layer. This could be useful.
809  */
810  if( GetPlotMode() == FILLED )
812 
813  for( TRACK *pts = m_board->m_Track; pts != NULL; pts = pts->Next() )
814  {
815  const VIA* via = dyn_cast<const VIA*>( pts );
816 
817  if( via )
819  wxSize( via->GetDrillValue(), 0 ),
820  wxSize( via->GetWidth(), 0 ), 0, small_drill );
821  }
822 
823  for( MODULE *Module = m_board->m_Modules; Module != NULL; Module = Module->Next() )
824  {
825  for( D_PAD *pad = Module->Pads(); pad != NULL; pad = pad->Next() )
826  {
827  if( pad->GetDrillSize().x == 0 )
828  continue;
829 
830  plotOneDrillMark( pad->GetDrillShape(),
831  pad->GetPosition(), pad->GetDrillSize(),
832  pad->GetSize(), pad->GetOrientation(),
833  small_drill );
834  }
835  }
836 
837  if( GetPlotMode() == FILLED )
839 }
#define SMALL_DRILL
Definition: pcbplot.h:72
virtual void SetColor(COLOR4D color)=0
MODULE * Next() const
Definition: class_module.h:99
PLOTTER * m_plotter
Definition: pcbplot.h:78
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:73
BOARD * m_board
Definition: pcbplot.h:79
DrillMarksType GetDrillMarksType() const
const wxPoint & GetStart() const
Definition: class_track.h:121
D_PAD * Next() const
Definition: class_pad.h:106
COLOR4D GetColor() const
TRACK * Next() const
Definition: class_track.h:98
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:243
int GetWidth() const
Definition: class_track.h:115
EDA_DRAW_MODE_T GetPlotMode() const
Definition: colors.h:49
DLIST< TRACK > m_Track
Definition: class_board.h:244
void BRDITEMS_PLOTTER::PlotFilledAreas ( ZONE_CONTAINER aZone)

Definition at line 612 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(), BOARD_ITEM::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(), and PlotStandardLayer().

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

772 {
773  // Small drill marks have no significance when applied to slots
774  if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )
775  aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
776 
777  // Round holes only have x diameter, slots have both
778  aDrillSize.x -= getFineWidthAdj();
779  aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
780 
781  if( aDrillShape == PAD_DRILL_SHAPE_OBLONG )
782  {
783  aDrillSize.y -= getFineWidthAdj();
784  aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
785  m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetPlotMode(), NULL );
786  }
787  else
788  m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetPlotMode(), NULL );
789 }
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:78
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:95
#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 66 of file plot_brditems_plotter.cpp.

References LSET::AllBoardTechMask(), LSET::AllCuMask(), D_PAD::BuildPadPolygon(), LSET::ExternalCuMask(), PLOTTER::FlashPadCircle(), 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(), BOARD_CONNECTED_ITEM::GetNetname(), D_PAD::GetOrientation(), D_PAD::GetPadName(), 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, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, PAD_ATTRIB_STANDARD, PAD_SHAPE_CIRCLE, 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(), and PlotStandardLayer().

67 {
68  wxPoint shape_pos = aPad->ShapePos();
69  GBR_METADATA gbr_metadata;
70 
71  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
72  bool isOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
73  bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
74 
75  gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
76 
77  if( isOnCopperLayer )
78  {
79  gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
80  gbr_metadata.SetCopper( true );
81 
82  if( isOnExternalCopperLayer )
83  gbr_metadata.SetPadName( aPad->GetPadName() );
84 
85  gbr_metadata.SetNetName( aPad->GetNetname() );
86 
87  // Some pads are mechanical pads ( through hole or smd )
88  // when this is the case, they have no pad name and/or are not plated.
89  // In this case gerber files have slightly different attributes.
91  aPad->GetPadName().IsEmpty() )
92  gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
93 
94  if( !isOnExternalCopperLayer || !isPadOnBoardTechLayers )
95  {
96  // On internal layers one cannot use the GBR_NETLIST_METADATA::GBR_INFO_FLASHED_PAD
97  // attribute when the component is on an external layer (most of the case)
98  // Also, if a SMD pad is not on a tech layer (masks) use also net+cmp attribute, because
99  // it is not really a pad (can be a "pad", actually a node in a virtual component)
102 
103  if( !isPadOnBoardTechLayers )
104  // such a pad is not soldered and is not a connecting point.
105  // Just set aperture attribute as conductor
106  // If it is a through hole pad, it will be adjusted later
108 
109  switch( aPad->GetAttribute() )
110  {
111  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
113  break;
114 
115  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
117  break;
118 
119  default:
120  break;
121  }
122  }
123  else // Some attributes are reserved to the external copper layers
124  {
125  switch( aPad->GetAttribute() )
126  {
127  case PAD_ATTRIB_HOLE_NOT_PLATED: // Mechanical pad through hole
129  break;
130 
131  case PAD_ATTRIB_STANDARD : // Pad through hole, a hole is also expected
133  break;
134 
135  case PAD_ATTRIB_CONN: // Connector pads have no solder paste.
137  break;
138 
139  case PAD_ATTRIB_SMD: // SMD pads (One external copper layer only) with solder paste
140  if( aPad->GetShape() == PAD_SHAPE_CIRCLE ) // perhaps a BGA pad
142  else
144  break;
145  }
146  }
147 
150  }
151  else
152  {
154  }
155 
156  // Set plot color (change WHITE to LIGHTGRAY because
157  // the white items are not seen on a white paper or screen
158  m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
159 
160  switch( aPad->GetShape() )
161  {
162  case PAD_SHAPE_CIRCLE:
163  m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
164  break;
165 
166  case PAD_SHAPE_OVAL:
167  m_plotter->FlashPadOval( shape_pos, aPad->GetSize(),
168  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
169  break;
170 
171  case PAD_SHAPE_TRAPEZOID:
172  {
173  wxPoint coord[4];
174  aPad->BuildPadPolygon( coord, wxSize(0,0), 0 );
175  m_plotter->FlashPadTrapez( shape_pos, coord,
176  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
177  }
178  break;
179 
180  case PAD_SHAPE_ROUNDRECT:
181  m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
182  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
183  break;
184 
185  case PAD_SHAPE_RECT:
186  default:
187  m_plotter->FlashPadRect( shape_pos, aPad->GetSize(),
188  aPad->GetOrientation(), aPlotMode, &gbr_metadata );
189  break;
190  }
191 }
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:639
void SetPadName(const wxString &aPadname)
aperture used for edge connecto pad (outer layers)
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:238
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:63
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)
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:351
MODULE * GetParent() const
Definition: class_pad.h:108
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:59
PLOTTER * m_plotter
Definition: pcbplot.h:78
aperture used for through hole component on outer layer
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
aperture used for BGA pad with a solder mask defined by the solder mask
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
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:235
static LSET ExternalCuMask()
Function ExternalCuMask returns a mask holding the Front and Bottom layers.
Definition: lset.cpp:669
const wxSize & GetSize() const
Definition: class_pad.h:182
aperture used for mechanical pads (NPTH)
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:60
aperture used for connected items like tracks (not vias)
void SetNetName(const wxString &aNetname)
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:408
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:80
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:214
Usual pad.
Definition: pad_shapes.h:58
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: colors.h:49
wxPoint ShapePos() const
Definition: class_pad.cpp:418
static LSET AllBoardTechMask()
Function AllTechMask returns a mask holding board technical layers (no CU layer) on both side...
Definition: lset.cpp:716
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
wxString GetPadName() const
Definition: class_pad.cpp:433
GBR_NETLIST_METADATA m_NetlistMetadata
a item to handle object attribute:
void SetCopper(bool aValue)
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)
#define GBR_NETINFO_ALL
void BRDITEMS_PLOTTER::PlotPcbTarget ( PCB_TARGET PtMire)

Definition at line 386 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().

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

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

548 {
549  double orient;
550  int thickness;
551  wxPoint pos;
552  wxSize size;
553  wxString shownText( pt_texte->GetShownText() );
554 
555  if( shownText.IsEmpty() )
556  return;
557 
558  if( !m_layerMask[pt_texte->GetLayer()] )
559  return;
560 
561  GBR_METADATA gbr_metadata;
562 
563  if( IsCopperLayer( pt_texte->GetLayer() ) )
564  {
566  }
567 
568  m_plotter->SetColor( getColor( pt_texte->GetLayer() ) );
569 
570  size = pt_texte->GetTextSize();
571  pos = pt_texte->GetTextPos();
572  orient = pt_texte->GetTextAngle();
573  thickness = pt_texte->GetThickness();
574 
575  if( pt_texte->IsMirrored() )
576  size.x = -size.x;
577 
578  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
579  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
580  // (like bold text) and we manage the thickness.
581  // So we set bold flag to true
582  bool allow_bold = pt_texte->IsBold() || thickness;
583 
584  if( pt_texte->IsMultilineAllowed() )
585  {
586  std::vector<wxPoint> positions;
587  wxArrayString strings_list;
588  wxStringSplit( shownText, strings_list, '\n' );
589  positions.reserve( strings_list.Count() );
590 
591  pt_texte->GetPositionsOfLinesOfMultilineText( positions, strings_list.Count() );
592 
593  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
594  {
595  wxString& txt = strings_list.Item( ii );
596  m_plotter->Text( positions[ii], COLOR4D::UNSPECIFIED, txt, orient, size,
597  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
598  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
599  }
600  }
601  else
602  {
603  m_plotter->Text( pos, COLOR4D::UNSPECIFIED, shownText, orient, size,
604  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
605  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
606  }
607 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Function wxStringSplit splits aString to a string list separated at aSplitter.
Definition: common.cpp:137
bool IsMultilineAllowed() const
Definition: eda_text.h:188
const wxPoint & GetTextPos() const
Definition: eda_text.h:224
bool IsItalic() const
Definition: eda_text.h:170
virtual void SetColor(COLOR4D color)=0
PLOTTER * m_plotter
Definition: pcbplot.h:78
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:190
bool IsBold() const
Definition: eda_text.h:173
double GetTextAngle() const
Definition: eda_text.h:164
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:154
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: drawtxt.cpp:229
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:135
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:327
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:191
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool IsMirrored() const
Definition: eda_text.h:179
LSET m_layerMask
Definition: pcbplot.h:80
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
const wxSize & GetTextSize() const
Definition: eda_text.h:215
aperture used for not connected items (texts, outlines on copper)
COLOR4D getColor(LAYER_NUM aLayer)
Function getColor.
void BRDITEMS_PLOTTER::PlotTextModule ( TEXTE_MODULE aTextMod,
COLOR4D  aColor 
)

Definition at line 296 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().

297 {
298  wxSize size;
299  wxPoint pos;
300  double orient;
301  int thickness;
302 
303  if( aColor == COLOR4D::WHITE )
304  aColor = COLOR4D( LIGHTGRAY );
305 
306  m_plotter->SetColor( aColor );
307 
308  // calculate some text parameters :
309  size = pt_texte->GetTextSize();
310  pos = pt_texte->GetTextPos();
311 
312  orient = pt_texte->GetDrawRotation();
313 
314  thickness = pt_texte->GetThickness();
315 
316  if( pt_texte->IsMirrored() )
317  size.x = -size.x; // Text is mirrored
318 
319  // Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
320  // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
321  // (like bold text) and we manage the thickness.
322  // So we set bold flag to true
323  bool allow_bold = pt_texte->IsBold() || thickness;
324 
325  GBR_METADATA gbr_metadata;
327  MODULE* parent = static_cast<MODULE*> ( pt_texte->GetParent() );
328  gbr_metadata.SetCmpReference( parent->GetReference() );
329 
330  m_plotter->Text( pos, aColor,
331  pt_texte->GetShownText(),
332  orient, size,
333  pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
334  thickness, pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
335 }
print info associated to a component (TO.C attribute)
virtual void SetColor(COLOR4D color)=0
void SetNetAttribType(int aNetAttribType)
PLOTTER * m_plotter
Definition: pcbplot.h:78
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: drawtxt.cpp:229
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:408
Definition: colors.h:49
void SetCmpReference(const wxString &aComponentRef)
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 269 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Referenced by DIALOG_PLOT::Plot().

205 { 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 174 of file pcb_plot_params.h.

174 { m_color = aVal; }
COLOR4D m_color
Color for plotting the current layer.
void PCB_PLOT_PARAMS::SetDrillMarksType ( DrillMarksType  aVal)
inlineinherited

Definition at line 192 of file pcb_plot_params.h.

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

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

Definition at line 230 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

230 { 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 233 of file pcb_plot_params.h.

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

233 { 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 124 of file pcb_plot_params.cpp.

References gbrDefaultPrecision.

Referenced by DIALOG_PLOT::applyPlotSettings().

125 {
126  // Currently geber files use mm.
127  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
128  // or 5, min value for professional boards, when 6 creates problems
129  // to board makers.
130 
133 }
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 ( int  aValue)
inherited

Definition at line 307 of file pcb_plot_params.cpp.

References HPGL_PEN_DIAMETER_MAX, HPGL_PEN_DIAMETER_MIN, and setInt().

Referenced by DIALOG_PLOT::applyPlotSettings().

308 {
310 }
#define HPGL_PEN_DIAMETER_MAX
#define HPGL_PEN_DIAMETER_MIN
static bool setInt(int *aInt, int aValue, int aMin, int aMax)
int m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas.
void PCB_PLOT_PARAMS::SetHPGLPenNum ( int  aVal)
inlineinherited

Definition at line 276 of file pcb_plot_params.h.

276 { 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 313 of file pcb_plot_params.cpp.

References HPGL_PEN_SPEED_MAX, HPGL_PEN_SPEED_MIN, and setInt().

314 {
316 }
#define HPGL_PEN_SPEED_MAX
#define HPGL_PEN_SPEED_MIN
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
static bool setInt(int *aInt, int aValue, int aMin, int aMax)
void PCB_PLOT_PARAMS::SetIncludeGerberNetlistInfo ( bool  aUse)
inlineinherited

Definition at line 242 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Referenced by DIALOG_PLOT::applyPlotSettings().

260 { m_layerSelection = aSelection; };
LSET m_layerSelection
Set of layers to plot.
void BRDITEMS_PLOTTER::SetLayerSet ( LSET  aLayerMask)
inline
bool PCB_PLOT_PARAMS::SetLineWidth ( int  aValue)
inherited

Definition at line 319 of file pcb_plot_params.cpp.

References PLOT_LINEWIDTH_MAX, PLOT_LINEWIDTH_MIN, and setInt().

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

320 {
322 }
#define PLOT_LINEWIDTH_MAX
#define PLOT_LINEWIDTH_MIN
static bool setInt(int *aInt, int aValue, int aMin, int aMax)
int m_lineWidth
The default line width (used for the frame and in LINE mode)
void PCB_PLOT_PARAMS::SetMirror ( bool  aFlag)
inlineinherited

Definition at line 208 of file pcb_plot_params.h.

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

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

Definition at line 221 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

221 { 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 236 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings(), DIALOG_SVG_PRINT::OnCloseWindow(), DIALOG_GEN_MODULE_POSITION::OnOKButton(), and DIALOG_GENDRILL::SetParams().

236 { 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 227 of file pcb_plot_params.h.

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

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

Definition at line 214 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

214 { 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 186 of file pcb_plot_params.h.

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

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

Definition at line 189 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

189 { m_plotOutlineMode = aFlag; }
bool m_plotOutlineMode
Plot lines in outline mode.
void PCB_PLOT_PARAMS::SetPlotPadsOnSilkLayer ( bool  aFlag)
inlineinherited

Definition at line 211 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Definition at line 216 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Definition at line 224 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Definition at line 177 of file pcb_plot_params.h.

Referenced by DIALOG_SVG_PRINT::CreateSVGFile().

177 { m_referenceColor = aVal; }
COLOR4D m_referenceColor
Color for plotting references.
void PCB_PLOT_PARAMS::SetScale ( double  aVal)
inlineinherited

Definition at line 195 of file pcb_plot_params.h.

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

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

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Definition at line 165 of file pcb_plot_params.h.

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

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

Definition at line 257 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Definition at line 183 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

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

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

Definition at line 239 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::applyPlotSettings().

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

Referenced by DIALOG_PLOT::applyPlotSettings().

245 { m_useGerberProtelExtensions = aUse; }
bool m_useGerberProtelExtensions
When plotting gerbers use a conventional set of Protel extensions instead of appending a suffix to th...
void PCB_PLOT_PARAMS::SetValueColor ( COLOR4D  aVal)
inlineinherited

Definition at line 180 of file pcb_plot_params.h.

Referenced by DIALOG_SVG_PRINT::CreateSVGFile().

180 { m_valueColor = aVal; }
COLOR4D m_valueColor
Color for plotting values.
void PCB_PLOT_PARAMS::SetWidthAdjust ( int  aVal)
inlineinherited

Definition at line 202 of file pcb_plot_params.h.

Referenced by DIALOG_PLOT::Plot().

202 { 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

Definition at line 79 of file pcbplot.h.

Referenced by getColor(), Plot_Edges_Modules(), PlotBoardGraphicItems(), and PlotDrillMarks().

LSET BRDITEMS_PLOTTER::m_layerMask
private

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