68 virtual void FlashPadCircle(
const wxPoint& aPadPos,
int aDiameter,
70 virtual void FlashPadOval(
const wxPoint& aPadPos,
const wxSize& aSize,
double aPadOrient,
72 virtual void FlashPadRect(
const wxPoint& aPadPos,
const wxSize& aSize,
74 void* aData )
override;
76 int aCornerRadius,
double aOrient,
78 virtual void FlashPadCustom(
const wxPoint& aPadPos,
const wxSize& aSize,
double aOrient,
81 virtual void FlashPadTrapez(
const wxPoint& aPadPos,
const wxPoint *aCorners,
82 double aPadOrient,
OUTLINE_MODE aTraceMode,
void* aData )
override;
83 virtual void FlashRegularPolygon(
const wxPoint& aShapePos,
int aDiameter,
int aCornerCount,
84 double aOrient,
OUTLINE_MODE aTraceMode,
void* aData )
override;
95 const wxString& aText,
104 double *wideningFactor,
111 double *heightFactor );
113 bool aItalic,
bool aBold,
114 std::vector<int> *pos_pairs );
127 bool aItalic,
bool aBold );
149 return wxString( wxT(
"ps" ) );
158 virtual bool EndPlot()
override;
162 virtual void SetViewport(
const wxPoint& aOffset,
double aIusPerDecimil,
163 double aScale,
bool aMirror )
override;
164 virtual void Rect(
const wxPoint& p1,
const wxPoint& p2,
FILL_TYPE fill,
168 virtual void Arc(
const wxPoint& centre,
double StAngle,
double EndAngle,
171 virtual void PlotPoly(
const std::vector< wxPoint >& aCornerList,
173 void * aData =
NULL )
override;
175 virtual void PlotImage(
const wxImage& aImage,
const wxPoint& aPos,
176 double aScaleFactor )
override;
178 virtual void PenTo(
const wxPoint& pos,
char plume )
override;
179 virtual void Text(
const wxPoint& aPos,
181 const wxString& aText,
189 bool aMultilineAllowed =
false,
190 void* aData =
NULL )
override;
215 return wxString( wxT(
"pdf" ) );
227 virtual bool OpenFile(
const wxString& aFullFilename )
override;
235 virtual bool EndPlot()
override;
266 virtual void SetViewport(
const wxPoint& aOffset,
double aIusPerDecimil,
267 double aScale,
bool aMirror )
override;
272 virtual void Rect(
const wxPoint& p1,
const wxPoint& p2,
FILL_TYPE fill,
285 virtual void Arc(
const wxPoint& centre,
double StAngle,
double EndAngle,
291 virtual void PlotPoly(
const std::vector< wxPoint >& aCornerList,
293 void * aData =
NULL )
override;
295 virtual void PenTo(
const wxPoint& pos,
char plume )
override;
297 virtual void Text(
const wxPoint& aPos,
299 const wxString& aText,
307 bool aMultilineAllowed =
false,
308 void* aData =
NULL )
override;
312 virtual void PlotImage(
const wxImage& aImage,
const wxPoint& aPos,
313 double aScaleFactor )
override;
381 return wxString( wxT(
"svg" ) );
391 virtual bool EndPlot()
override;
395 virtual void SetViewport(
const wxPoint& aOffset,
double aIusPerDecimil,
396 double aScale,
bool aMirror )
override;
397 virtual void Rect(
const wxPoint& p1,
const wxPoint& p2,
FILL_TYPE fill,
401 virtual void Arc(
const wxPoint& centre,
double StAngle,
double EndAngle,
404 virtual void BezierCurve(
const wxPoint& aStart,
const wxPoint& aControl1,
405 const wxPoint& aControl2,
const wxPoint& aEnd,
409 virtual void PlotPoly(
const std::vector< wxPoint >& aCornerList,
411 void * aData =
NULL )
override;
413 virtual void PlotImage(
const wxImage& aImage,
const wxPoint& aPos,
414 double aScaleFactor )
override;
416 virtual void PenTo(
const wxPoint& pos,
char plume )
override;
436 virtual void StartBlock(
void* aData )
override;
443 virtual void EndBlock(
void* aData )
override;
445 virtual void Text(
const wxPoint& aPos,
447 const wxString& aText,
455 bool aMultilineAllowed =
false,
456 void* aData =
NULL )
override;
491 void setSVGPlotStyle(
bool aIsGroup =
true,
const std::string& aExtraStyle = {} );
static wxString GetDefaultFileExtension()
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
void closePdfStream()
Finish the current PDF stream (writes the deferred length, too)
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
virtual void Arc(const wxPoint ¢re, double StAngle, double EndAngle, int rayon, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
virtual void SetDash(PLOT_DASH_TYPE dashed) override
SVG supports dashed lines.
static wxString GetDefaultFileExtension()
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PostScript-likes at the moment are the only plot engines supporting bitmaps...
virtual PLOT_FORMAT GetPlotterType() const override
Returns the effective plot engine in use.
virtual void SetSvgCoordinatesFormat(unsigned aResolution, bool aUseInches=false) override
Select SVG step size (number of digits needed for 1 mm or 1 inch )
FILL_TYPE
The set of fill types used in plotting or drawing enclosed areas.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool EndPlot() override
virtual void emitSetRGBColor(double r, double g, double b) override
Virtual primitive for emitting the setrgbcolor operator.
virtual void StartPage()
Starts a new page in the PDF document.
static wxString GetDefaultFileExtension()
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
The PSLIKE_PLOTTER class is an intermediate class to handle common routines for engines working more ...
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
virtual bool EndPlot() override
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
void setSVGPlotStyle(bool aIsGroup=true, const std::string &aExtraStyle={})
Output the string which define pen and brush color, shape, transparency.
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) override
Draws text with the plotter.
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
std::vector< int > pageHandles
Font resource dictionary.
virtual void SetDash(PLOT_DASH_TYPE dashed) override
PDF supports dashed lines.
virtual void Arc(const wxPoint ¢re, double StAngle, double EndAngle, int rayon, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
The PDF engine can't directly plot arcs, it uses the base emulation.
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Rectangles in PDF.
PLOT_TEXT_MODE m_textMode
How to draw text.
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual std::string encodeStringForPlotter(const wxString &aUnicode)
convert a wxString unicode string to a char string compatible with the accepted string plotter format...
wxString workFilename
Handle to the deferred stream length.
virtual void FlashRegularPolygon(const wxPoint &aShapePos, int aDiameter, int aCornerCount, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a regular polygon.
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) override
Draws text with the plotter.
virtual bool EndPlot() override
virtual void ClosePage()
Close the current page in the PDF document (and emit its compressed stream)
int streamLengthHandle
Handle of the page content object.
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData) override
static const int USE_DEFAULT_LINE_WIDTH
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a trapezoidal pad.
virtual void emitSetRGBColor(double r, double g, double b)=0
Virtual primitive for emitting the setrgbcolor operator.
virtual void SetTextMode(PLOT_TEXT_MODE mode) override
PS and PDF fully implement native text (for the Latin-1 subset)
Represent a set of closed polygons.
int returnPostscriptTextWidth(const wxString &aText, int aXSize, bool aItalic, bool aBold)
Sister function for the GraphicTextWidth in drawtxt.cpp Does the same processing (i....
int startPdfStream(int handle=-1)
Starts a PDF stream (for the page).
void setFillMode(FILL_TYPE fill)
Prepare parameters for setSVGPlotStyle()
PLOT_FORMAT
The set of supported output plot formats.
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) override
Draws text with the plotter.
int startPdfObject(int handle=-1)
Open a new PDF object and returns the handle if the parameter is -1.
virtual void Arc(const wxPoint ¢re, double StAngle, double EndAngle, int rayon, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
PDF can have multiple pages, so SetPageSettings can be called with the outputFile open (but not insid...
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
std::string encodeStringForPlotter(const wxString &aUnicode) override
convert a wxString unicode string to a char string compatible with the accepted string PDF format (co...
virtual bool StartPlot() override
The code within this function creates SVG files header.
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Polygon plotting for PDF.
void closePdfObject()
Close the current PDF object.
PLOT_DASH_TYPE
Dashed line types.
static const double postscriptTextAscent
Height of the postscript font (from the AFM)
int fontResDictHandle
Handle to the root of the page tree object.
virtual PLOT_FORMAT GetPlotterType() const override
Returns the effective plot engine in use.
Base plotter engine class.
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PostScript-likes at the moment are the only plot engines supporting bitmaps...
virtual void emitSetRGBColor(double r, double g, double b) override
PDF supports colors fully.
std::vector< long > xrefTable
Temporary file to construct the stream before zipping.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
double plotScaleAdjX
Fine user scale adjust ( = 1.0 if no correction)
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, double aOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData) override
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual void EndBlock(void *aData) override
Calling this function allows one to define the end of a group of drawing items the group is started b...
virtual void emitSetRGBColor(double r, double g, double b) override
Initialize m_pen_rgb_color from reduced values r, g ,b ( reduced values are 0.0 to 1....
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Draw a polygon ( filled or not )
void postscriptOverlinePositions(const wxString &aText, int aXSize, bool aItalic, bool aBold, std::vector< int > *pos_pairs)
Computes the x coordinates for the overlining in a string of text.
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
virtual void StartBlock(void *aData) override
Calling this function allows one to define the beginning of a group of drawing items (used in SVG for...
void computeTextParameters(const wxPoint &aPos, const wxString &aText, int aOrient, const wxSize &aSize, bool aMirror, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, double *wideningFactor, double *ctm_a, double *ctm_b, double *ctm_c, double *ctm_d, double *ctm_e, double *ctm_f, double *heightFactor)
This is the core for postscript/PDF text alignment It computes the transformation matrix to generate ...
PLOT_TEXT_MODE
Which kind of text to output with the PSLIKE plotters.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Draw a polygon ( filled or not )
virtual bool StartPlot() override
The PDF engine supports multiple pages; the first one is opened 'for free' the following are to be cl...
virtual PLOT_FORMAT GetPlotterType() const override
Returns the effective plot engine in use.
int allocPdfObject()
Allocate a new handle in the table of the PDF object.
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Circle drawing for PDF.
int pageStreamHandle
Handles to the page objects.
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: Cubic Bezier curve rendered as a polyline In KiCad the bezier curves have 4 control...
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Pen width setting for PDF.
virtual void SetDash(PLOT_DASH_TYPE dashed) override
PostScript supports dashed lines.
A color representation with 4 components: red, green, blue, alpha.
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PDF images are handles as inline, not XObject streams...