36#define PLOT_LINEWIDTH_DEFAULT ( DEFAULT_TEXT_WIDTH * IU_PER_MM )
38using namespace PCBPLOTPARAMS_T;
43 return PCB_PLOT_PARAMS_LEXER::TokenName( aTok );
135 aFormatter->
Print(
"(pcbplotparams" );
142 commonLayers.
set( commonLayer );
144 aFormatter->
Print(
"(plot_on_all_layers_selection 0x%s)", commonLayers.
FmtHex().c_str() );
197 aFormatter->
Print(
"(outputformat %d)",
static_cast<int>(
m_format ) );
202 aFormatter->
Print(
")" );
208 aParser->
Parse(
this );
375 PCB_PLOT_PARAMS_LEXER( aReader ),
382 PCB_PLOT_PARAMS_LEXER( aLine, aSource ),
545 newLayers[newLayer] = aLegacyLSET[legacyLayer];
555 while( ( token = NextTok() ) != T_RIGHT )
560 if( token == T_LEFT )
563 if( token == T_pcbplotparams )
566 bool skip_right =
false;
570 case T_layerselection:
572 token = NeedSYMBOLorNUMBER();
574 const std::string& cur = CurStr();
576 if( token == T_NUMBER )
584 else if( cur.find_first_of(
"0x" ) == 0 )
593 legacyLSET.
ParseHex( cur.c_str() + 2, cur.size() - 2 );
604 Expecting(
"integer or hex layerSelection" );
610 case T_plot_on_all_layers_selection:
612 token = NeedSYMBOLorNUMBER();
614 const std::string& cur = CurStr();
616 if( cur.find_first_of(
"0x" ) == 0 )
628 legacyLSET.
ParseHex( cur.c_str() + 2, cur.size() - 2 );
635 layers.
ParseHex( cur.c_str() + 2, cur.size() - 2 );
642 Expecting(
"hex plot_on_all_layers_selection" );
648 case T_disableapertmacros:
652 case T_usegerberextensions:
656 case T_usegerberattributes:
660 case T_usegerberadvancedattributes:
664 case T_creategerberjobfile:
668 case T_gerberprecision:
673 case T_dashed_line_dash_ratio:
677 case T_dashed_line_gap_ratio:
701 case T_excludeedgelayer:
720 case T_hpglpennumber:
722 case T_hpglpenoverlay:
724 parseInt( std::numeric_limits<int>::min(), std::numeric_limits<int>::max() );
727 case T_pdf_front_fp_property_popups:
731 case T_pdf_back_fp_property_popups:
739 case T_pdf_single_document:
743 case T_dxfpolygonmode:
747 case T_dxfimperialunits:
751 case T_dxfusepcbnewfont:
764 case T_plot_black_and_white:
768 case T_plotinvisibletext:
772 case T_sketchpadsonfab:
776 case T_plotpadnumbers:
784 case T_sketchdnponfab:
788 case T_crossoutdnponfab:
792 case T_subtractmaskfromsilk:
810 case T_scaleselection:
814 case T_outputdirectory:
815 NeedSYMBOLorNUMBER();
833 T token = NeedSYMBOL();
846 Expecting(
"true, false, yes, or no" );
856 if( token != T_NUMBER )
857 Expecting( T_NUMBER );
859 int val = atoi( CurText() );
863 else if( val > aMax )
874 if( token != T_NUMBER )
875 Expecting( T_NUMBER );
886 while( ( token = NextTok() ) != T_EOF )
888 if( token == T_LEFT )
891 if( token == T_RIGHT )
constexpr EDA_IU_SCALE pcbIUScale
int ParseHex(const std::string &str)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
BASE_SET & set(size_t pos)
std::string FmtHex() const
Return a hex string showing contents of this set.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
double parseDouble()
Parse the current token as an ASCII numeric string with possible leading whitespace into a double pre...
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
LSET is a set of PCB_LAYER_IDs.
LSEQ SeqStackupForPlotting() const
Return the sequence that is typical for a bottom-to-top stack-up.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
void skipCurrent()
Skip the current token level.
PCB_PLOT_PARAMS_PARSER(LINE_READER *aReader, int aBoardFileVersion)
int parseInt(int aMin, int aMax)
Parse an integer and constrains it between two values.
double parseDouble()
Parse a double precision floating point number.
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)
Parameters and options when plotting/printing a board.
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.
bool m_crossoutDNPFPsOnFabLayers
double m_dashedLineGapRatio
std::optional< bool > m_plotViaOnMaskLayer
Deprecated; only used for reading legacy files.
bool m_hideDNPFPsOnFabLayers
void SetLayerSelection(const LSET &aSelection)
int m_gerberPrecision
Precision of coordinates in Gerber: accepted 5 or 6 when units are in mm, 6 or 7 in inches (but Pcbne...
std::shared_ptr< COLOR_SETTINGS > m_default_colors
Dummy colors object that can be created if there is no Pgm context.
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
int m_scaleSelection
Scale ratio index (UI only)
PLOT_TEXT_MODE m_textMode
void SetPlotOnAllLayersSequence(LSEQ aSeq)
bool m_plotValue
Enable plotting of part values.
LSEQ m_plotOnAllLayersSequence
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_PDFMetadata
Generate PDF metadata for SUBJECT and AUTHOR.
bool m_autoScale
When true set the scale to fit the board in the page.
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ....
bool GetCreateGerberJobFile() const
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolute coordinates.
double m_scale
Global scale factor, 1.0 plots a board at actual size.
COLOR4D m_backgroundColor
Background color to use for PNG and PDF plotting.
int m_widthAdjust
Compensation for PS printers/plotters that do not strictly obey line width settings.
bool m_PDFFrontFPPropertyPopups
Generate PDF property popup menus for footprints.
double m_fineScaleAdjustX
Compensation for printer scale errors (and therefore.
friend class PCB_PLOT_PARAMS_PARSER
double m_dashedLineDashRatio
void SetGerberPrecision(int aPrecision)
bool m_blackAndWhite
Plot in black and white only.
DXF_OUTLINE_MODE GetDXFPlotMode() const override
PLOT_FORMAT m_format
Plot format type (chooses the driver to be used)
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
bool m_plotReference
Enable plotting of part references.
double m_fineScaleAdjustY
expected to be very near 1.0).
bool m_gerberDisableApertMacros
Disable aperture macros in Gerber format (only for broken Gerber readers).
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
bool m_subtractMaskFromSilk
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
COLOR_SETTINGS * m_colors
Pointer to color settings to be used for plotting.
bool GetUseGerberX2format() const
bool m_mirror
Mirror the plot around the X axis.
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file.
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
DXF_OUTLINE_MODE m_DXFPlotMode
FILLED or SKETCH for filled objects.
unsigned m_svgPrecision
Precision of coordinates in SVG: accepted 3 - 6; 6 is the internal resolution of Pcbnew.
bool GetIncludeGerberNetlistInfo() const
bool m_PDFSingle
Generate a single PDF file for all layers.
double GetDashedLineGapRatio() const
bool m_PDFBackFPPropertyPopups
on front and/or back of board
bool m_skipNPTH_Pads
Used to disable NPTH pads plotting on copper layers.
bool m_sketchDNPFPsOnFabLayers
double GetDashedLineDashRatio() const
void SetSvgPrecision(unsigned aPrecision)
DRILL_MARKS m_drillMarks
Holes can be not plotted, have a small mark, or be plotted in actual size.
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool m_negative
Plot in negative color (supported only by some drivers)
void Format(OUTPUTFORMATTER *aFormatter) const
bool m_DXFExportAsMultiLayeredFile
bool m_plotPadNumbers
Plot pad numbers when sketching pads on fab layers.
bool m_DXFPolygonMode
In polygon mode, each item to plot is converted to a polygon and all polygons are merged.
static const char * getTokenName(T aTok)
static wxString From_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
static const int GBR_DEFAULT_PRECISION
#define SVG_PRECISION_MIN
#define SVG_PRECISION_MAX
#define SVG_PRECISION_DEFAULT
PCB_LAYER_ID
A quick note on layer IDs:
static const char * getTokenName(T aTok)
static const std::map< LEGACY_PCB_LAYER_ID, PCB_LAYER_ID > s_legacyLayerIdMap
LEGACY_PCB_LAYER_ID
These are the layer IDs from before 5e0abadb23425765e164f49ee2f893e94ddb97fc, and are needed for mapp...
@ LEGACY_UNSELECTED_LAYER
@ LEGACY_PCB_LAYER_ID_COUNT
LSET remapLegacyLayerLSET(const BASE_SET &aLegacyLSET)
DRILL_MARKS
Plots and prints can show holes in pads and vias 3 options are available:
PLOT_FORMAT
The set of supported output plot formats.
constexpr int DEFAULT_PNG_DPI
constexpr int MIN_PNG_DPI
constexpr int MAX_PNG_DPI
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...