KiCad PCB EDA Suite
pcb_plot_params.h
Go to the documentation of this file.
1 #ifndef PCB_PLOT_PARAMS_H_
2 #define PCB_PLOT_PARAMS_H_
3 /*
4  * This program source code file is part of KiCad, a free EDA CAD application.
5  *
6  * Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <wx/wx.h>
27 #include <eda_text.h> // EDA_DRAW_MODE_T
28 #include <class_plotter.h>
30 
32 
38 {
39  friend class PCB_PLOT_PARAMS_PARSER;
40 public:
45  };
46 
47 private:
48  // If true, do not plot NPTH pads
49  // (mainly used to disable NPTH pads plotting on copper layers)
51 
56 
62 
65 
68 
71 
74 
77 
79  double m_scale;
80 
82  bool m_mirror;
83 
85  bool m_negative;
86 
89 
92 
95 
98 
104 
107 
110 
113 
119 
122 
125 
128 
131 
134 
137 
140 
143 
146 
147  /* These next two scale factors are intended to compensate plotters
148  * (mainly printers) X and Y scale error. Therefore they are expected very
149  * near 1.0; only X and Y dimensions are adjusted: circles are plotted as
150  * circles, even if X and Y fine scale differ; because of this it is mostly
151  * useful for printers: postscript plots would be best adjusted using
152  * the prologue (that would change the whole output matrix
153  */
154 
157 
162 
167 
168 public:
169  PCB_PLOT_PARAMS();
170 
171  void SetSkipPlotNPTH_Pads( bool aSkip ) { m_skipNPTH_Pads = aSkip; }
172  bool GetSkipPlotNPTH_Pads() const { return m_skipNPTH_Pads; }
173 
174  void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl=0 ) const;
175  void Parse( PCB_PLOT_PARAMS_PARSER* aParser );
176 
184  bool IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms ) const;
185 
186  void SetColor( COLOR4D aVal ) { m_color = aVal; }
187  COLOR4D GetColor() const { return m_color; }
188 
189  void SetTextMode( PlotTextMode aVal ) { m_textMode = aVal; }
190  PlotTextMode GetTextMode() const { return m_textMode; }
191 
192  void SetPlotMode( EDA_DRAW_MODE_T aPlotMode ) { m_plotMode = aPlotMode; }
194 
195  void SetDXFPlotPolygonMode( bool aFlag ) { m_DXFplotPolygonMode = aFlag; }
197 
198  void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; }
200 
201  void SetScale( double aVal ) { m_scale = aVal; }
202  double GetScale() const { return m_scale; }
203 
204  void SetFineScaleAdjustX( double aVal ) { m_fineScaleAdjustX = aVal; }
205  double GetFineScaleAdjustX() const { return m_fineScaleAdjustX; }
206  void SetFineScaleAdjustY( double aVal ) { m_fineScaleAdjustY = aVal; }
207  double GetFineScaleAdjustY() const { return m_fineScaleAdjustY; }
208  void SetWidthAdjust( int aVal ) { m_widthAdjust = aVal; }
209  int GetWidthAdjust() const { return m_widthAdjust; }
210 
211  void SetAutoScale( bool aFlag ) { m_autoScale = aFlag; }
212  bool GetAutoScale() const { return m_autoScale; }
213 
214  void SetMirror( bool aFlag ) { m_mirror = aFlag; }
215  bool GetMirror() const { return m_mirror; }
216 
217  void SetPlotPadsOnSilkLayer( bool aFlag ) { m_plotPadsOnSilkLayer = aFlag; }
219 
220  void SetPlotInvisibleText( bool aFlag ) { m_plotInvisibleText = aFlag; }
221  bool GetPlotInvisibleText() const { return m_plotInvisibleText; }
222  void SetPlotValue( bool aFlag ) { m_plotValue = aFlag; }
223  bool GetPlotValue() const { return m_plotValue; }
224  void SetPlotReference( bool aFlag ) { m_plotReference = aFlag; }
225  bool GetPlotReference() const { return m_plotReference; }
226 
227  void SetNegative( bool aFlag ) { m_negative = aFlag; }
228  bool GetNegative() const { return m_negative; }
229 
230  void SetPlotViaOnMaskLayer( bool aFlag ) { m_plotViaOnMaskLayer = aFlag; }
232 
233  void SetPlotFrameRef( bool aFlag ) { m_plotFrameRef = aFlag; }
234  bool GetPlotFrameRef() const { return m_plotFrameRef; }
235 
236  void SetExcludeEdgeLayer( bool aFlag ) { m_excludeEdgeLayer = aFlag; }
237  bool GetExcludeEdgeLayer() const { return m_excludeEdgeLayer; }
238 
239  void SetFormat( PlotFormat aFormat ) { m_format = aFormat; }
240  PlotFormat GetFormat() const { return m_format; }
241 
242  void SetOutputDirectory( wxString aDir ) { m_outputDirectory = aDir; }
243  wxString GetOutputDirectory() const { return m_outputDirectory; }
244 
245  void SetUseGerberAttributes( bool aUse ) { m_useGerberAttributes = aUse; }
247 
248  void SetIncludeGerberNetlistInfo( bool aUse ) { m_includeGerberNetlistInfo = aUse; }
250 
251  void SetCreateGerberJobFile( bool aCreate ) { m_createGerberJobFile = aCreate; }
253 
254  void SetUseGerberProtelExtensions( bool aUse ) { m_useGerberProtelExtensions = aUse; }
256 
257  void SetGerberPrecision( int aPrecision );
258  int GetGerberPrecision() const { return m_gerberPrecision; }
259 
264  static int GetGerberDefaultPrecision() { return 6; }
265 
266  void SetSubtractMaskFromSilk( bool aSubtract ) { m_subtractMaskFromSilk = aSubtract; };
268 
269  void SetLayerSelection( LSET aSelection ) { m_layerSelection = aSelection; };
271 
272  void SetUseAuxOrigin( bool aAux ) { m_useAuxOrigin = aAux; };
273  bool GetUseAuxOrigin() const { return m_useAuxOrigin; };
274 
275  void SetScaleSelection( int aSelection ) { m_scaleSelection = aSelection; };
276  int GetScaleSelection() const { return m_scaleSelection; };
277 
278  void SetA4Output( int aForce ) { m_A4Output = aForce; };
279  bool GetA4Output() const { return m_A4Output; };
280 
281  int GetHPGLPenDiameter() const { return m_HPGLPenDiam; };
282  bool SetHPGLPenDiameter( int aValue );
283  int GetHPGLPenSpeed() const { return m_HPGLPenSpeed; };
284  bool SetHPGLPenSpeed( int aValue );
285  void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; }
286  int GetHPGLPenNum() const { return m_HPGLPenNum; }
287 
288  int GetLineWidth() const { return m_lineWidth; };
289  bool SetLineWidth( int aValue );
290 };
291 
292 
298 extern int g_DrawDefaultLineThickness;
299 
300 #endif // PCB_PLOT_PARAMS_H_
double m_fineScaleAdjustX
fine scale adjust X axis
void SetTextMode(PlotTextMode aVal)
void SetUseGerberProtelExtensions(bool aUse)
void SetPlotReference(bool aFlag)
void SetExcludeEdgeLayer(bool aFlag)
bool GetUseGerberProtelExtensions() const
bool m_plotValue
Enable plotting of part values.
void SetScaleSelection(int aSelection)
void SetIncludeGerberNetlistInfo(bool aUse)
void SetDXFPlotPolygonMode(bool aFlag)
bool GetMirror() const
bool GetSubtractMaskFromSilk() const
int g_DrawDefaultLineThickness
Default line thickness in PCnew units used to draw or plot items having a default thickness line valu...
bool GetAutoScale() const
int GetHPGLPenDiameter() const
double GetScale() const
void SetGerberPrecision(int aPrecision)
void SetPlotViaOnMaskLayer(bool aFlag)
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_mirror
Mirror the plot around the X axis.
void SetLayerSelection(LSET aSelection)
void SetUseAuxOrigin(bool aAux)
void SetHPGLPenNum(int aVal)
Class PCB_PLOT_PARAMS_PARSER is the parser class for PCB_PLOT_PARAMS.
bool GetUseGerberAttributes() const
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
void SetFormat(PlotFormat aFormat)
void SetCreateGerberJobFile(bool aCreate)
void SetMirror(bool aFlag)
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.
Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a conve...
Definition: richio.h:327
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ...
bool SetHPGLPenSpeed(int aValue)
bool GetUseAuxOrigin() const
void SetDrillMarksType(DrillMarksType aVal)
LSET GetLayerSelection() const
int m_scaleSelection
Scale ratio index (UI only)
Definition of base KiCad text object.
bool m_negative
Plot in negative color (supported only by some drivers)
bool GetPlotValue() const
double GetFineScaleAdjustX() const
void SetA4Output(int aForce)
bool m_plotFrameRef
True to plot/print frame references.
bool SetHPGLPenDiameter(int aValue)
bool SetLineWidth(int aValue)
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
void SetPlotValue(bool aFlag)
bool GetA4Output() const
bool m_useGerberAttributes
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool GetExcludeEdgeLayer() const
bool m_plotInvisibleText
Force plotting of fields marked invisible.
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode In polygon mode, each item to plot is converted to a...
void SetPlotFrameRef(bool aFlag)
bool m_autoScale
When true set the scale to fit the board in the page.
wxString GetOutputDirectory() const
DrillMarksType GetDrillMarksType() const
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
bool GetIncludeGerberNetlistInfo() const
Class LSET is a set of PCB_LAYER_IDs.
static int GetGerberDefaultPrecision()
Default precision of coordinates in Gerber files.
void SetColor(COLOR4D aVal)
int GetLineWidth() const
int GetHPGLPenNum() const
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
EDA_DRAW_MODE_T
Definition: eda_text.h:62
PlotTextMode GetTextMode() const
double m_fineScaleAdjustY
fine scale adjust Y axis
void SetSkipPlotNPTH_Pads(bool aSkip)
void SetSubtractMaskFromSilk(bool aSubtract)
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: class_plotter.h:50
bool GetPlotViaOnMaskLayer() const
int GetScaleSelection() const
bool GetCreateGerberJobFile() const
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
void SetOutputDirectory(wxString aDir)
bool GetPlotReference() const
PlotFormat GetFormat() const
void SetUseGerberAttributes(bool aUse)
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
void SetPlotInvisibleText(bool aFlag)
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file...
void SetScale(double aVal)
COLOR4D GetColor() const
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...
void SetNegative(bool aFlag)
bool GetDXFPlotPolygonMode() const
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.
void SetFineScaleAdjustX(double aVal)
PlotTextMode
Enum for choosing which kind of text to output with the PSLIKE plotters.
Definition: class_plotter.h:73
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
void SetPlotPadsOnSilkLayer(bool aFlag)
void SetPlotMode(EDA_DRAW_MODE_T aPlotMode)
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.
bool GetSkipPlotNPTH_Pads() const
LSET m_layerSelection
Set of layers to plot.
bool GetPlotInvisibleText() const
Board layer functions and definitions.
void SetWidthAdjust(int aVal)
EDA_DRAW_MODE_T m_plotMode
FILLED or SKETCH selects how to plot filled objects.
bool GetNegative() const
bool GetPlotFrameRef() const
int GetHPGLPenSpeed() const
EDA_DRAW_MODE_T GetPlotMode() const
bool GetPlotPadsOnSilkLayer() const
void SetAutoScale(bool aFlag)
void SetFineScaleAdjustY(double aVal)
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
PlotTextMode m_textMode
Choose how represent text with PS, PDF and DXF drivers.
PlotFormat m_format
Plot format type (chooses the driver to be used)
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
int m_lineWidth
The default line width (used to draw items having no defined width)
int m_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...
double GetFineScaleAdjustY() const
int GetWidthAdjust() const
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
int GetGerberPrecision() const