KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SVG_PLOTTER Class Reference

#include <plotters_pslike.h>

Inheritance diagram for SVG_PLOTTER:
PSLIKE_PLOTTER PLOTTER

Public Member Functions

 SVG_PLOTTER (const PROJECT *aProject=nullptr)
 
virtual PLOT_FORMAT GetPlotterType () const override
 Returns the effective plot engine in use.
 
virtual bool StartPlot (const wxString &aPageNumber) override
 Create SVG file header.
 
virtual bool EndPlot () override
 
virtual void SetCurrentLineWidth (int width, void *aData=nullptr) override
 Set the current line width (in IUs) for the next plot.
 
virtual void SetDash (int aLineWidth, LINE_STYLE aLineStyle) override
 SVG supports dashed lines.
 
virtual void SetViewport (const VECTOR2I &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
 Set the plot offset and scaling for the current plot.
 
virtual void Rect (const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
 
virtual void Circle (const VECTOR2I &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
 
virtual void Arc (const VECTOR2D &aCenter, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aRadius, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH) override
 
virtual void BezierCurve (const VECTOR2I &aStart, const VECTOR2I &aControl1, const VECTOR2I &aControl2, const VECTOR2I &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 points: start ctrl1 ctrl2 end.
 
virtual void PlotPoly (const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
 Draw a polygon ( filled or not ).
 
virtual void PlotImage (const wxImage &aImage, const VECTOR2I &aPos, double aScaleFactor) override
 PostScript-likes at the moment are the only plot engines supporting bitmaps.
 
virtual void PenTo (const VECTOR2I &pos, char plume) override
 Moveto/lineto primitive, moves the 'pen' to the specified direction.
 
virtual void SetSvgCoordinatesFormat (unsigned aPrecision) override
 Select SVG coordinate precision (number of digits needed for 1 mm ) (SVG plotter uses always metric unit) Should be called only after SetViewport() is called.
 
virtual void StartBlock (void *aData) override
 Calling this function allows one to define the beginning of a group of drawing items (used in SVG format to separate components)
 
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 by StartBlock()
 
virtual void Text (const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics, void *aData=nullptr) override
 Draw text with the plotter.
 
virtual void PlotText (const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics, void *aData=nullptr) override
 
virtual void SetTextMode (PLOT_TEXT_MODE mode) override
 PS and PDF fully implement native text (for the Latin-1 subset)
 
void SetScaleAdjust (double scaleX, double scaleY)
 Set the 'fine' scaling for the postscript engine.
 
virtual void FlashPadCircle (const VECTOR2I &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData) override
 
virtual void FlashPadOval (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
 
virtual void FlashPadRect (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
 
virtual void FlashPadRoundRect (const VECTOR2I &aPadPos, const VECTOR2I &aSize, int aCornerRadius, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData) override
 
virtual void FlashPadCustom (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData) override
 
virtual void FlashPadTrapez (const VECTOR2I &aPadPos, const VECTOR2I *aCorners, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
 Flash a trapezoidal pad.
 
virtual void FlashRegularPolygon (const VECTOR2I &aShapePos, int aDiameter, int aCornerCount, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData) override
 Flash a regular polygon.
 
virtual void SetColor (const COLOR4D &color) override
 The SetColor implementation is split with the subclasses: the PSLIKE computes the rgb values, the subclass emits the operator to actually do it.
 
virtual void SetNegative (bool aNegative)
 
virtual void SetColorMode (bool aColorMode)
 Plot in B/W or color.
 
bool GetColorMode () const
 
void SetRenderSettings (RENDER_SETTINGS *aSettings)
 
RENDER_SETTINGSRenderSettings ()
 
virtual void SetPageSettings (const PAGE_INFO &aPageSettings)
 
PAGE_INFOPageSettings ()
 
virtual int GetCurrentLineWidth () const
 
virtual void SetCreator (const wxString &aCreator)
 
virtual void SetTitle (const wxString &aTitle)
 
virtual void SetAuthor (const wxString &aAuthor)
 
virtual void SetSubject (const wxString &aSubject)
 
void AddLineToHeader (const wxString &aExtraString)
 Add a line to the list of free lines to print at the beginning of the file.
 
void ClearHeaderLinesList ()
 Remove all lines from the list of free lines to print at the beginning of the file.
 
virtual bool OpenFile (const wxString &aFullFilename)
 Open or create the plot file aFullFilename.
 
double GetIUsPerDecimil () const
 The IUs per decimil are an essential scaling factor when plotting; they are set and saved when establishing the viewport.
 
int GetPlotterArcLowDef () const
 
int GetPlotterArcHighDef () const
 
virtual void Arc (const VECTOR2D &aStart, const VECTOR2D &aMid, const VECTOR2D &aEnd, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH)
 
void MoveTo (const VECTOR2I &pos)
 
void LineTo (const VECTOR2I &pos)
 
void FinishTo (const VECTOR2I &pos)
 
void PenFinish ()
 
virtual void PlotPoly (const SHAPE_LINE_CHAIN &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)
 Draw a polygon ( filled or not ).
 
virtual void ThickSegment (const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode, void *aData)
 
virtual void ThickArc (const EDA_SHAPE &aArcShape, OUTLINE_MODE aTraceMode, void *aData, int aWidth)
 
virtual void ThickArc (const VECTOR2D &aCentre, const EDA_ANGLE &aStAngle, const EDA_ANGLE &aAngle, double aRadius, int aWidth, OUTLINE_MODE aTraceMode, void *aData)
 
virtual void ThickRect (const VECTOR2I &p1, const VECTOR2I &p2, int width, OUTLINE_MODE tracemode, void *aData)
 
virtual void ThickCircle (const VECTOR2I &pos, int diametre, int width, OUTLINE_MODE tracemode, void *aData)
 
virtual void FilledCircle (const VECTOR2I &pos, int diametre, OUTLINE_MODE tracemode, void *aData)
 
virtual void HyperlinkBox (const BOX2I &aBox, const wxString &aDestinationURL)
 Create a clickable hyperlink with a rectangular click area.
 
virtual void HyperlinkMenu (const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
 Create a clickable hyperlink menu with a rectangular click area.
 
virtual void Bookmark (const BOX2I &aBox, const wxString &aName, const wxString &aGroupName=wxEmptyString)
 Create a bookmark to a symbol.
 
void Marker (const VECTOR2I &position, int diametre, unsigned aShapeId)
 Draw a pattern shape number aShapeId, to coord position.
 
virtual void SetLayerPolarity (bool aPositive)
 Set the current Gerber layer polarity to positive or negative by writing %LPD*% or %LPC*% to the Gerber file, respectively.
 
virtual void SetGerberCoordinatesFormat (int aResolution, bool aUseInches=false)
 
VECTOR2I GetPlotOffsetUserUnits ()
 

Static Public Member Functions

static wxString GetDefaultFileExtension ()
 

Static Public Attributes

static const int DO_NOT_SET_LINE_WIDTH = -2
 
static const int USE_DEFAULT_LINE_WIDTH = -1
 
static const unsigned MARKER_COUNT = 58
 Draw a marker (used for the drill map).
 

Protected Member Functions

virtual void emitSetRGBColor (double r, double g, double b, double a) override
 Initialize m_pen_rgb_color from reduced values r, g ,b ( reduced values are 0.0 to 1.0 )
 
void setSVGPlotStyle (int aLineWidth, bool aIsGroup=true, const std::string &aExtraStyle={})
 Output the string which define pen and brush color, shape, transparency.
 
void setFillMode (FILL_T fill)
 Prepare parameters for setSVGPlotStyle()
 
void computeTextParameters (const VECTOR2I &aPos, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, bool aMirror, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_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.
 
virtual std::string encodeStringForPlotter (const wxString &aUnicode)
 convert a wxString unicode string to a char string compatible with the accepted string plotter format (convert special chars and non ascii7 chars)
 
int returnPostscriptTextWidth (const wxString &aText, int aXSize, bool aItalic, bool aBold)
 Sister function for the GRTextWidth in gr_text.cpp Does the same processing (i.e.
 
virtual void polyArc (const VECTOR2D &aCentre, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aRadius, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH)
 Generic fallback: arc rendered as a polyline.
 
void markerCircle (const VECTOR2I &pos, int radius)
 Plot a circle centered on the position.
 
void markerHBar (const VECTOR2I &pos, int radius)
 Plot a - bar centered on the position.
 
void markerSlash (const VECTOR2I &pos, int radius)
 Plot a / bar centered on the position.
 
void markerBackSlash (const VECTOR2I &pos, int radius)
 Plot a \ bar centered on the position.
 
void markerVBar (const VECTOR2I &pos, int radius)
 Plot a | bar centered on the position.
 
void markerSquare (const VECTOR2I &position, int radius)
 Plot a square centered on the position.
 
void markerLozenge (const VECTOR2I &position, int radius)
 Plot a lozenge centered on the position.
 
void segmentAsOval (const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode)
 Convert a thick segment and plot it as an oval.
 
void sketchOval (const VECTOR2I &aPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, int aWidth)
 
virtual VECTOR2D userToDeviceCoordinates (const VECTOR2I &aCoordinate)
 Modify coordinates according to the orientation, scale factor, and offsets trace.
 
virtual VECTOR2D userToDeviceSize (const VECTOR2I &size)
 Modify size according to the plotter scale factors (VECTOR2I version, returns a VECTOR2D).
 
virtual double userToDeviceSize (double size) const
 Modify size according to the plotter scale factors (simple double version).
 
double GetDotMarkLenIU (int aLineWidth) const
 
double GetDashMarkLenIU (int aLineWidth) const
 
double GetDashGapLenIU (int aLineWidth) const
 

Protected Attributes

FILL_T m_fillMode
 
long m_pen_rgb_color
 
long m_brush_rgb_color
 
double m_brush_alpha
 
bool m_graphics_changed
 
LINE_STYLE m_dashed
 
unsigned m_precision
 
double plotScaleAdjX
 Fine user scale adjust ( = 1.0 if no correction)
 
double plotScaleAdjY
 
PLOT_TEXT_MODE m_textMode
 How to draw text.
 
double m_plotScale
 Plot scale - chosen by the user (even implicitly with 'fit in a4')
 
double m_IUsPerDecimil
 
double m_iuPerDeviceUnit
 
VECTOR2I m_plotOffset
 
bool m_plotMirror
 
bool m_mirrorIsHorizontal
 
bool m_yaxisReversed
 
FILE * m_outputFile
 Output file.
 
bool m_colorMode
 
bool m_negativeMode
 
int m_currentPenWidth
 
char m_penState
 
VECTOR2I m_penLastpos
 
wxString m_creator
 
wxString m_filename
 
wxString m_title
 
wxString m_author
 
wxString m_subject
 
PAGE_INFO m_pageInfo
 
VECTOR2I m_paperSize
 
wxArrayString m_headerExtraLines
 
RENDER_SETTINGSm_renderSettings
 
const PROJECTm_project
 

Static Protected Attributes

static const double postscriptTextAscent = 0.718
 Height of the postscript font (from the AFM)
 

Detailed Description

Definition at line 521 of file plotters_pslike.h.

Constructor & Destructor Documentation

◆ SVG_PLOTTER()

SVG_PLOTTER::SVG_PLOTTER ( const PROJECT aProject = nullptr)

Member Function Documentation

◆ AddLineToHeader()

void PLOTTER::AddLineToHeader ( const wxString &  aExtraString)
inlineinherited

Add a line to the list of free lines to print at the beginning of the file.

Parameters
aExtraStringis the string to print

Definition at line 164 of file plotter.h.

References PLOTTER::m_headerExtraLines.

Referenced by AddGerberX2Attribute(), AddGerberX2Header(), GERBER_WRITER::createDrillFile(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), and GENDRILL_WRITER_BASE::genDrillMapFile().

◆ Arc() [1/2]

◆ Arc() [2/2]

void PLOTTER::Arc ( const VECTOR2D aStart,
const VECTOR2D aMid,
const VECTOR2D aEnd,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH 
)
virtualinherited

◆ BezierCurve()

void SVG_PLOTTER::BezierCurve ( const VECTOR2I aStart,
const VECTOR2I aControl1,
const VECTOR2I aControl2,
const VECTOR2I aEnd,
int  aTolerance,
int  aLineThickness = USE_DEFAULT_LINE_WIDTH 
)
overridevirtual

Generic fallback: Cubic Bezier curve rendered as a polyline In KiCad the bezier curves have 4 control points: start ctrl1 ctrl2 end.

Reimplemented from PLOTTER.

Definition at line 563 of file SVG_plotter.cpp.

References PLOTTER::BezierCurve(), PLOTTER::GetCurrentLineWidth(), m_graphics_changed, PLOTTER::m_outputFile, m_precision, SetCurrentLineWidth(), setFillMode(), setSVGPlotStyle(), PLOTTER::userToDeviceCoordinates(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Bookmark()

virtual void PLOTTER::Bookmark ( const BOX2I aBox,
const wxString &  aName,
const wxString &  aGroupName = wxEmptyString 
)
inlinevirtualinherited

Create a bookmark to a symbol.

Parameters
aBoxis the rectangular click target
aSymbolReferenceis the symbol schematic ref

Reimplemented in PDF_PLOTTER.

Definition at line 476 of file plotter.h.

Referenced by SCH_LABEL_BASE::Plot(), SCH_SYMBOL::Plot(), and PlotInteractiveLayer().

◆ Circle()

void SVG_PLOTTER::Circle ( const VECTOR2I pos,
int  diametre,
FILL_T  fill,
int  width = USE_DEFAULT_LINE_WIDTH 
)
overridevirtual

◆ ClearHeaderLinesList()

void PLOTTER::ClearHeaderLinesList ( )
inlineinherited

Remove all lines from the list of free lines to print at the beginning of the file.

Definition at line 172 of file plotter.h.

References PLOTTER::m_headerExtraLines.

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

◆ computeTextParameters()

void PSLIKE_PLOTTER::computeTextParameters ( const VECTOR2I aPos,
const wxString &  aText,
const EDA_ANGLE aOrient,
const VECTOR2I aSize,
bool  aMirror,
enum GR_TEXT_H_ALIGN_T  aH_justify,
enum GR_TEXT_V_ALIGN_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 
)
protectedinherited

This is the core for postscript/PDF text alignment.

It computes the transformation matrix to generate a user space system aligned with the text. Even the PS uses the concat operator to simplify PDF generation (concat is everything PDF has to modify the CTM. Lots of parameters, both in and out.

Definition at line 352 of file PS_plotter.cpp.

References EDA_ANGLE::AsRadians(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_INDETERMINATE, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_INDETERMINATE, GR_TEXT_V_ALIGN_TOP, EDA_ANGLE::Invert(), PLOTTER::m_plotMirror, PSLIKE_PLOTTER::postscriptTextAscent, PSLIKE_PLOTTER::returnPostscriptTextWidth(), RotatePoint(), PLOTTER::userToDeviceCoordinates(), PLOTTER::userToDeviceSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PDF_PLOTTER::Text().

◆ emitSetRGBColor()

void SVG_PLOTTER::emitSetRGBColor ( double  r,
double  g,
double  b,
double  a 
)
overrideprotectedvirtual

Initialize m_pen_rgb_color from reduced values r, g ,b ( reduced values are 0.0 to 1.0 )

Implements PSLIKE_PLOTTER.

Definition at line 344 of file SVG_plotter.cpp.

References m_brush_alpha, m_brush_rgb_color, m_graphics_changed, m_pen_rgb_color, and red.

◆ encodeStringForPlotter()

std::string PSLIKE_PLOTTER::encodeStringForPlotter ( const wxString &  aUnicode)
protectedvirtualinherited

convert a wxString unicode string to a char string compatible with the accepted string plotter format (convert special chars and non ascii7 chars)

Reimplemented in PDF_PLOTTER.

Definition at line 276 of file PS_plotter.cpp.

References KI_FALLTHROUGH.

Referenced by PS_PLOTTER::PlotText(), PS_PLOTTER::StartPlot(), and PS_PLOTTER::Text().

◆ EndBlock()

void SVG_PLOTTER::EndBlock ( void *  aData)
overridevirtual

Calling this function allows one to define the end of a group of drawing items the group is started by StartBlock()

Parameters
aDatashould be null

Reimplemented from PLOTTER.

Definition at line 339 of file SVG_plotter.cpp.

◆ EndPlot()

bool SVG_PLOTTER::EndPlot ( )
overridevirtual

◆ FilledCircle()

void PLOTTER::FilledCircle ( const VECTOR2I pos,
int  diametre,
OUTLINE_MODE  tracemode,
void *  aData 
)
virtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 663 of file plotter.cpp.

References PLOTTER::Circle(), FILLED, and PLOTTER::SetCurrentLineWidth().

Referenced by SCH_LABEL_BASE::Plot(), and BRDITEMS_PLOTTER::PlotShape().

◆ FinishTo()

◆ FlashPadCircle()

void PSLIKE_PLOTTER::FlashPadCircle ( const VECTOR2I aPadPos,
int  aDiameter,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited
Parameters
aPadPosPosition of the shape (center of the rectangle.
aDiameteris the diameter of round pad.
aTraceModeis the drawing mode, FILLED or SKETCH.
aDatais an auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 121 of file PS_plotter.cpp.

References PLOTTER::Circle(), FILLED, PLOTTER::GetCurrentLineWidth(), PLOTTER::SetCurrentLineWidth(), and PLOTTER::USE_DEFAULT_LINE_WIDTH.

◆ FlashPadCustom()

void PSLIKE_PLOTTER::FlashPadCustom ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
const EDA_ANGLE aPadOrient,
SHAPE_POLY_SET aPolygons,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited
Parameters
aPadPosPosition of the shape.
aSizeis the size of round reference pad.
aPadOrientis the pad rotation, used only with aperture macros (Gerber plotter).
aPolygonsthe shape as polygon set.
aTraceModeis the drawing mode, FILLED or SKETCH.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 208 of file PS_plotter.cpp.

References SHAPE_LINE_CHAIN::CPoint(), FILLED, PLOTTER::GetCurrentLineWidth(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PLOTTER::PlotPoly(), SHAPE_LINE_CHAIN::PointCount(), PLOTTER::SetCurrentLineWidth(), PLOTTER::USE_DEFAULT_LINE_WIDTH, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ FlashPadOval()

void PSLIKE_PLOTTER::FlashPadOval ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
const EDA_ANGLE aPadOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited
Parameters
aPadPosPosition of the shape (center of the rectangle.
aSizeis the size of oblong shape.
aPadOrientThe rotation of the shape.
aTraceModeis the drawing mode, FILLED or SKETCH.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 91 of file PS_plotter.cpp.

References ANGLE_90, delta, FILLED, PLOTTER::m_outputFile, RotatePoint(), PLOTTER::sketchOval(), PLOTTER::ThickSegment(), PLOTTER::USE_DEFAULT_LINE_WIDTH, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ FlashPadRect()

void PSLIKE_PLOTTER::FlashPadRect ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
const EDA_ANGLE aPadOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited
Parameters
aPadPosPosition of the shape (center of the rectangle).
aSizeis the size of rounded rect.
aPadOrientThe rotation of the shape.
aTraceModeis the drawing mode, FILLED or SKETCH.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 138 of file PS_plotter.cpp.

References FILLED, PLOTTER::GetCurrentLineWidth(), PLOTTER::PlotPoly(), RotatePoint(), PLOTTER::SetCurrentLineWidth(), PLOTTER::USE_DEFAULT_LINE_WIDTH, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ FlashPadRoundRect()

void PSLIKE_PLOTTER::FlashPadRoundRect ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
int  aCornerRadius,
const EDA_ANGLE aOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited
Parameters
aPadPosPosition of the shape (center of the rectangle.
aSizeis the size of rounded rect.
aCornerRadiusRadius of the rounded corners.
aOrientThe rotation of the shape.
aTraceModeis the drawing mode, FILLED or SKETCH.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 178 of file PS_plotter.cpp.

References SHAPE_LINE_CHAIN::CPoint(), ERROR_INSIDE, FILLED, PLOTTER::GetCurrentLineWidth(), PLOTTER::GetPlotterArcHighDef(), SHAPE_POLY_SET::Outline(), PLOTTER::PlotPoly(), SHAPE_LINE_CHAIN::PointCount(), PLOTTER::SetCurrentLineWidth(), TransformRoundChamferedRectToPolygon(), PLOTTER::USE_DEFAULT_LINE_WIDTH, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ FlashPadTrapez()

void PSLIKE_PLOTTER::FlashPadTrapez ( const VECTOR2I aPadPos,
const VECTOR2I aCorners,
const EDA_ANGLE aPadOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited

Flash a trapezoidal pad.

Parameters
aPadPosis the the position of the shape.
aCornersis the list of 4 corners positions, relative to the shape position, pad orientation 0.
aPadOrientis the rotation of the shape.
aTraceModeis the drawing mode, FILLED or SKETCH.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 236 of file PS_plotter.cpp.

References FILLED, PLOTTER::GetCurrentLineWidth(), PLOTTER::PlotPoly(), RotatePoint(), PLOTTER::SetCurrentLineWidth(), and PLOTTER::USE_DEFAULT_LINE_WIDTH.

◆ FlashRegularPolygon()

void PSLIKE_PLOTTER::FlashRegularPolygon ( const VECTOR2I aShapePos,
int  aDiameter,
int  aCornerCount,
const EDA_ANGLE aOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
overridevirtualinherited

Flash a regular polygon.

Useful only in Gerber files to flash a regular polygon.

Parameters
aShapePosis the center of the circle containing the polygon.
aRadiusis the radius of the circle containing the polygon.
aCornerCountis the number of vertices.
aOrientis the polygon rotation.
aDatais a auxiliary parameter used (if needed) to handle extra info specific to the plotter.

Implements PLOTTER.

Definition at line 267 of file PS_plotter.cpp.

◆ GetColorMode()

◆ GetCurrentLineWidth()

◆ GetDashGapLenIU()

double PLOTTER::GetDashGapLenIU ( int  aLineWidth) const
protectedinherited

◆ GetDashMarkLenIU()

double PLOTTER::GetDashMarkLenIU ( int  aLineWidth) const
protectedinherited

◆ GetDefaultFileExtension()

static wxString SVG_PLOTTER::GetDefaultFileExtension ( )
inlinestatic

Definition at line 526 of file plotters_pslike.h.

Referenced by SCH_PLOTTER::createSVGFiles(), and GetDefaultPlotExtension().

◆ GetDotMarkLenIU()

double PLOTTER::GetDotMarkLenIU ( int  aLineWidth) const
protectedinherited

◆ GetIUsPerDecimil()

double PLOTTER::GetIUsPerDecimil ( ) const
inlineinherited

The IUs per decimil are an essential scaling factor when plotting; they are set and saved when establishing the viewport.

Here they can be get back again

Definition at line 206 of file plotter.h.

References PLOTTER::m_IUsPerDecimil.

Referenced by PlotDrawingSheet().

◆ GetPlotOffsetUserUnits()

VECTOR2I PLOTTER::GetPlotOffsetUserUnits ( )
inlineinherited
Returns
the plot offset in IUs, set by SetViewport() and used to plot items.

Definition at line 552 of file plotter.h.

References PLOTTER::m_plotOffset.

Referenced by PlotInteractiveLayer().

◆ GetPlotterArcHighDef()

◆ GetPlotterArcLowDef()

int PLOTTER::GetPlotterArcLowDef ( ) const
inlineinherited

Definition at line 208 of file plotter.h.

References PLOTTER::m_IUsPerDecimil.

◆ GetPlotterType()

virtual PLOT_FORMAT SVG_PLOTTER::GetPlotterType ( ) const
inlineoverridevirtual

Returns the effective plot engine in use.

It's not very OO but for now is required since some things are only done with some output devices (like drill marks, emitted only for postscript

Implements PLOTTER.

Definition at line 531 of file plotters_pslike.h.

◆ HyperlinkBox()

virtual void PLOTTER::HyperlinkBox ( const BOX2I aBox,
const wxString &  aDestinationURL 
)
inlinevirtualinherited

Create a clickable hyperlink with a rectangular click area.

Parameters
aBoxis the rectangular click target
aDestinationURLis the target URL

Reimplemented in PDF_PLOTTER.

Definition at line 454 of file plotter.h.

Referenced by SCH_LABEL_BASE::Plot(), SCH_SHEET::Plot(), SCH_TEXT::Plot(), and SCH_TEXTBOX::Plot().

◆ HyperlinkMenu()

virtual void PLOTTER::HyperlinkMenu ( const BOX2I aBox,
const std::vector< wxString > &  aDestURLs 
)
inlinevirtualinherited

Create a clickable hyperlink menu with a rectangular click area.

Parameters
aBoxis the rectangular click target
aDestURLsis the target URL

Reimplemented in PDF_PLOTTER.

Definition at line 465 of file plotter.h.

Referenced by SCH_FIELD::Plot(), SCH_LABEL_BASE::Plot(), SCH_LINE::Plot(), SCH_SHEET::Plot(), SCH_SYMBOL::Plot(), and PlotInteractiveLayer().

◆ LineTo()

◆ Marker()

void PLOTTER::Marker ( const VECTOR2I position,
int  diametre,
unsigned  aShapeId 
)
inherited

Draw a pattern shape number aShapeId, to coord position.

Parameters
aPositionis the position of the marker.
aDiameteris the diameter of the marker.
aShapeIdis the index (used to generate forms characters).

Definition at line 364 of file plotter.cpp.

References PLOTTER::MARKER_COUNT, PLOTTER::markerBackSlash(), PLOTTER::markerCircle(), PLOTTER::markerHBar(), PLOTTER::markerLozenge(), PLOTTER::markerSlash(), PLOTTER::markerSquare(), and PLOTTER::markerVBar().

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

◆ markerBackSlash()

void PLOTTER::markerBackSlash ( const VECTOR2I pos,
int  radius 
)
protectedinherited

Plot a \ bar centered on the position.

Building block for markers

Definition at line 350 of file plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Marker().

◆ markerCircle()

void PLOTTER::markerCircle ( const VECTOR2I pos,
int  radius 
)
protectedinherited

Plot a circle centered on the position.

Building block for markers

Definition at line 303 of file plotter.cpp.

References PLOTTER::Circle(), and PLOTTER::GetCurrentLineWidth().

Referenced by PLOTTER::Marker().

◆ markerHBar()

void PLOTTER::markerHBar ( const VECTOR2I pos,
int  radius 
)
protectedinherited

Plot a - bar centered on the position.

Building block for markers

Definition at line 336 of file plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Marker().

◆ markerLozenge()

void PLOTTER::markerLozenge ( const VECTOR2I position,
int  radius 
)
protectedinherited

Plot a lozenge centered on the position.

Building block for markers

Definition at line 309 of file plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), PLOTTER::PlotPoly(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Marker().

◆ markerSlash()

void PLOTTER::markerSlash ( const VECTOR2I pos,
int  radius 
)
protectedinherited

Plot a / bar centered on the position.

Building block for markers

Definition at line 343 of file plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Marker().

◆ markerSquare()

void PLOTTER::markerSquare ( const VECTOR2I position,
int  radius 
)
protectedinherited

Plot a square centered on the position.

Building block for markers

Definition at line 275 of file plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), KiROUND(), PLOTTER::PlotPoly(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Marker().

◆ markerVBar()

void PLOTTER::markerVBar ( const VECTOR2I pos,
int  radius 
)
protectedinherited

Plot a | bar centered on the position.

Building block for markers

Definition at line 357 of file plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Marker().

◆ MoveTo()

◆ OpenFile()

bool PLOTTER::OpenFile ( const wxString &  aFullFilename)
virtualinherited

Open or create the plot file aFullFilename.

Parameters
aFullFilenameis the full file name of the file to create.
Returns
true if success, false if the file cannot be created/opened.

Virtual because some plotters use ascii files, some others binary files (PDF) The base class open the file in text mode

Reimplemented in PDF_PLOTTER.

Definition at line 75 of file plotter.cpp.

References PLOTTER::m_filename, and PLOTTER::m_outputFile.

Referenced by GERBER_WRITER::createDrillFile(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), EESCHEMA_JOBS_HANDLER::doSymExportSvg(), GENDRILL_WRITER_BASE::genDrillMapFile(), SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), StartPlotBoard(), and SYMBOL_EDIT_FRAME::SVGPlotSymbol().

◆ PageSettings()

PAGE_INFO & PLOTTER::PageSettings ( )
inlineinherited

◆ PenFinish()

◆ PenTo()

void SVG_PLOTTER::PenTo ( const VECTOR2I pos,
char  plume 
)
overridevirtual

Moveto/lineto primitive, moves the 'pen' to the specified direction.

Parameters
posis the target position.
plumespecifies the kind of motion: 'U' only moves the pen, 'D' draw a line from the current position and 'Z' finish the drawing and returns the 'pen' to rest (flushes the trace).

Implements PLOTTER.

Definition at line 710 of file SVG_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), m_fillMode, m_graphics_changed, PLOTTER::m_outputFile, PLOTTER::m_penLastpos, PLOTTER::m_penState, m_precision, setFillMode(), setSVGPlotStyle(), PLOTTER::userToDeviceCoordinates(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ PlotImage()

void SVG_PLOTTER::PlotImage ( const wxImage &  aImage,
const VECTOR2I aPos,
double  aScaleFactor 
)
overridevirtual

PostScript-likes at the moment are the only plot engines supporting bitmaps.

Reimplemented from PLOTTER.

Definition at line 650 of file SVG_plotter.cpp.

References base64::encode(), image, PLOTTER::m_colorMode, PLOTTER::m_outputFile, m_precision, PLOTTER::PlotImage(), PLOTTER::userToDeviceSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ PlotPoly() [1/2]

void PLOTTER::PlotPoly ( const SHAPE_LINE_CHAIN aCornerList,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH,
void *  aData = nullptr 
)
virtualinherited

Draw a polygon ( filled or not ).

Parameters
aCornerListis the corners list (a SHAPE_LINE_CHAIN). must be closed (IsClosed() == true) for a polygon. Otherwise this is a polyline.
aFillis the type of fill.
aWidthis the line width.
aDatais an auxiliary info (mainly for gerber format).

Reimplemented in GERBER_PLOTTER.

Definition at line 677 of file plotter.cpp.

References SHAPE_LINE_CHAIN::CPoint(), SHAPE_LINE_CHAIN::IsClosed(), PLOTTER::PlotPoly(), and SHAPE_LINE_CHAIN::PointCount().

◆ PlotPoly() [2/2]

void SVG_PLOTTER::PlotPoly ( const std::vector< VECTOR2I > &  aCornerList,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH,
void *  aData = nullptr 
)
overridevirtual

Draw a polygon ( filled or not ).

Parameters
aCornerListis the corners list (a std::vector< VECTOR2I >).
aFillis the type of fill.
aWidthis the line width.
aDatais an auxiliary info (mainly for gerber format).

Implements PLOTTER.

Definition at line 596 of file SVG_plotter.cpp.

References PLOTTER::m_outputFile, m_precision, SetCurrentLineWidth(), setFillMode(), setSVGPlotStyle(), PLOTTER::userToDeviceCoordinates(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ PlotText()

void SVG_PLOTTER::PlotText ( const VECTOR2I aPos,
const COLOR4D aColor,
const wxString &  aText,
const TEXT_ATTRIBUTES aAttributes,
KIFONT::FONT aFont,
const KIFONT::METRICS aFontMetrics,
void *  aData = nullptr 
)
overridevirtual

◆ polyArc()

void PLOTTER::polyArc ( const VECTOR2D aCentre,
const EDA_ANGLE aStartAngle,
const EDA_ANGLE aAngle,
double  aRadius,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH 
)
protectedvirtualinherited

Generic fallback: arc rendered as a polyline.

Note also aCentre and aRadius are double to avoid creating rounding issues due to the fact a arc is defined in Kicad by a start point, a end point and third point not angles and radius. In some plotters (i.e. dxf) whe need a good precision when calculating an arc without error introduced by rounding, to avoid moving the end points, usually important in outlines when plotting an arc given by center, radius and angles. Winding direction: counter-clockwise in right-down coordinate system.

Definition at line 181 of file plotter.cpp.

References ANGLE_0, EDA_ANGLE::Cos(), DEGREES_T, delta, PLOTTER::FinishTo(), KiROUND(), PLOTTER::LineTo(), PLOTTER::MoveTo(), PLOTTER::SetCurrentLineWidth(), sign(), EDA_ANGLE::Sin(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::Arc(), GERBER_PLOTTER::Arc(), and HPGL_PLOTTER::Arc().

◆ Rect()

◆ RenderSettings()

◆ returnPostscriptTextWidth()

int PSLIKE_PLOTTER::returnPostscriptTextWidth ( const wxString &  aText,
int  aXSize,
bool  aItalic,
bool  aBold 
)
protectedinherited

Sister function for the GRTextWidth in gr_text.cpp Does the same processing (i.e.

calculates a text string width) but using postscript metrics for the Helvetica font (optionally used for PS and PDF plotting

Definition at line 316 of file PS_plotter.cpp.

References hv_widths, hvb_widths, hvbo_widths, hvo_widths, KiROUND(), and PSLIKE_PLOTTER::postscriptTextAscent.

Referenced by PSLIKE_PLOTTER::computeTextParameters().

◆ segmentAsOval()

void PLOTTER::segmentAsOval ( const VECTOR2I start,
const VECTOR2I end,
int  width,
OUTLINE_MODE  tracemode 
)
protectedinherited

Convert a thick segment and plot it as an oval.

Definition at line 486 of file plotter.cpp.

References VECTOR2< T >::EuclideanNorm(), PLOTTER::FlashPadOval(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PLOTTER::ThickSegment(), GERBER_PLOTTER::ThickSegment(), and HPGL_PLOTTER::ThickSegment().

◆ SetAuthor()

virtual void PLOTTER::SetAuthor ( const wxString &  aAuthor)
inlinevirtualinherited

Definition at line 156 of file plotter.h.

References PLOTTER::m_author.

Referenced by SCH_PLOTTER::createPDFFile(), and DIALOG_PLOT::Plot().

◆ SetColor()

void PSLIKE_PLOTTER::SetColor ( const COLOR4D color)
overridevirtualinherited

The SetColor implementation is split with the subclasses: the PSLIKE computes the rgb values, the subclass emits the operator to actually do it.

Implements PLOTTER.

Definition at line 63 of file PS_plotter.cpp.

References color, PSLIKE_PLOTTER::emitSetRGBColor(), PLOTTER::m_colorMode, and PLOTTER::m_negativeMode.

Referenced by SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), PS_PLOTTER::PlotText(), PS_PLOTTER::Text(), PDF_PLOTTER::Text(), and Text().

◆ SetColorMode()

virtual void PLOTTER::SetColorMode ( bool  aColorMode)
inlinevirtualinherited

◆ SetCreator()

◆ SetCurrentLineWidth()

void SVG_PLOTTER::SetCurrentLineWidth ( int  width,
void *  aData = nullptr 
)
overridevirtual

◆ SetDash()

void SVG_PLOTTER::SetDash ( int  aLineWidth,
LINE_STYLE  aLineStyle 
)
overridevirtual

SVG supports dashed lines.

Implements PLOTTER.

Definition at line 363 of file SVG_plotter.cpp.

References m_dashed, and m_graphics_changed.

◆ setFillMode()

void SVG_PLOTTER::setFillMode ( FILL_T  fill)
protected

Prepare parameters for setSVGPlotStyle()

Definition at line 209 of file SVG_plotter.cpp.

References m_fillMode, and m_graphics_changed.

Referenced by Arc(), BezierCurve(), Circle(), PenTo(), PlotPoly(), Rect(), and Text().

◆ SetGerberCoordinatesFormat()

virtual void PLOTTER::SetGerberCoordinatesFormat ( int  aResolution,
bool  aUseInches = false 
)
inlinevirtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 519 of file plotter.h.

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

◆ SetLayerPolarity()

virtual void PLOTTER::SetLayerPolarity ( bool  aPositive)
inlinevirtualinherited

Set the current Gerber layer polarity to positive or negative by writing %LPD*% or %LPC*% to the Gerber file, respectively.

(obviously starts a new Gerber layer, too)

Parameters
aPositiveis the layer polarity and true for positive. It's not useful with most other plotter since they can't 'scratch' the film like photoplotter imagers do

Reimplemented in GERBER_PLOTTER.

Definition at line 505 of file plotter.h.

Referenced by PlotOneBoardLayer().

◆ SetNegative()

virtual void PLOTTER::SetNegative ( bool  aNegative)
inlinevirtualinherited

Definition at line 125 of file plotter.h.

References PLOTTER::m_negativeMode.

Referenced by FillNegativeKnockout().

◆ SetPageSettings()

◆ SetRenderSettings()

◆ SetScaleAdjust()

void PSLIKE_PLOTTER::SetScaleAdjust ( double  scaleX,
double  scaleY 
)
inlineinherited

Set the 'fine' scaling for the postscript engine.

Definition at line 58 of file plotters_pslike.h.

References PSLIKE_PLOTTER::plotScaleAdjX, and PSLIKE_PLOTTER::plotScaleAdjY.

Referenced by StartPlotBoard().

◆ SetSubject()

virtual void PLOTTER::SetSubject ( const wxString &  aSubject)
inlinevirtualinherited

Definition at line 157 of file plotter.h.

References PLOTTER::m_subject.

Referenced by SCH_PLOTTER::createPDFFile(), and DIALOG_PLOT::Plot().

◆ SetSvgCoordinatesFormat()

void SVG_PLOTTER::SetSvgCoordinatesFormat ( unsigned  aPrecision)
overridevirtual

Select SVG coordinate precision (number of digits needed for 1 mm ) (SVG plotter uses always metric unit) Should be called only after SetViewport() is called.

Parameters
aPrecision= number of digits in mantissa of coordinate use a value from 3-6 do not use value > 6 to avoid overflow in PCBNEW do not use value > 4 to avoid overflow for other parts

Reimplemented from PLOTTER.

Definition at line 201 of file SVG_plotter.cpp.

References m_precision.

Referenced by SetViewport().

◆ setSVGPlotStyle()

void SVG_PLOTTER::setSVGPlotStyle ( int  aLineWidth,
bool  aIsGroup = true,
const std::string &  aExtraStyle = {} 
)
protected

Output the string which define pen and brush color, shape, transparency.

Parameters
aIsGroupIf false, do not form a new group for the style.
aExtraStyleIf given, the string will be added into the style string before closing

Definition at line 219 of file SVG_plotter.cpp.

References PLOTTER::GetDashGapLenIU(), PLOTTER::GetDashMarkLenIU(), PLOTTER::GetDotMarkLenIU(), m_brush_alpha, m_brush_rgb_color, m_dashed, m_fillMode, m_graphics_changed, PLOTTER::m_outputFile, m_pen_rgb_color, m_precision, and PLOTTER::userToDeviceSize().

Referenced by Arc(), BezierCurve(), Circle(), PenTo(), PlotPoly(), Rect(), and Text().

◆ SetTextMode()

virtual void PSLIKE_PLOTTER::SetTextMode ( PLOT_TEXT_MODE  mode)
inlineoverridevirtualinherited

PS and PDF fully implement native text (for the Latin-1 subset)

Reimplemented from PLOTTER.

Definition at line 49 of file plotters_pslike.h.

References PSLIKE_PLOTTER::m_textMode.

Referenced by SVG_PLOTTER().

◆ SetTitle()

virtual void PLOTTER::SetTitle ( const wxString &  aTitle)
inlinevirtualinherited

Definition at line 155 of file plotter.h.

References PLOTTER::m_title.

Referenced by SCH_PLOTTER::createPDFFile(), and DIALOG_PLOT::Plot().

◆ SetViewport()

void SVG_PLOTTER::SetViewport ( const VECTOR2I aOffset,
double  aIusPerDecimil,
double  aScale,
bool  aMirror 
)
overridevirtual

Set the plot offset and scaling for the current plot.

Parameters
aOffsetis the plot offset.
aIusPerDecimilgives the scaling factor from IUs to device units
aScaleis the user set plot scaling factor (either explicitly or using 'fit to A4').
aMirrorflips the plot in the Y direction (useful for toner transfers or some kind of film).

Implements PLOTTER.

Definition at line 179 of file SVG_plotter.cpp.

References PAGE_INFO::GetSizeMils(), PLOTTER::m_iuPerDeviceUnit, PLOTTER::m_IUsPerDecimil, PLOTTER::m_pageInfo, PLOTTER::m_paperSize, PLOTTER::m_plotMirror, PLOTTER::m_plotOffset, PLOTTER::m_plotScale, PLOTTER::m_yaxisReversed, SetSvgCoordinatesFormat(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SCH_PLOTTER::plotOneSheetSVG(), and SYMBOL_EDIT_FRAME::SVGPlotSymbol().

◆ sketchOval()

void PLOTTER::sketchOval ( const VECTOR2I aPos,
const VECTOR2I aSize,
const EDA_ANGLE aOrient,
int  aWidth 
)
protectedinherited

◆ StartBlock()

void SVG_PLOTTER::StartBlock ( void *  aData)
overridevirtual

Calling this function allows one to define the beginning of a group of drawing items (used in SVG format to separate components)

Parameters
aDatashould be a string for the SVG ID tag

Reimplemented from PLOTTER.

Definition at line 331 of file SVG_plotter.cpp.

◆ StartPlot()

◆ Text()

void SVG_PLOTTER::Text ( const VECTOR2I aPos,
const COLOR4D aColor,
const wxString &  aText,
const EDA_ANGLE aOrient,
const VECTOR2I aSize,
enum GR_TEXT_H_ALIGN_T  aH_justify,
enum GR_TEXT_V_ALIGN_T  aV_justify,
int  aPenWidth,
bool  aItalic,
bool  aBold,
bool  aMultilineAllowed,
KIFONT::FONT aFont,
const KIFONT::METRICS aFontMetrics,
void *  aData = nullptr 
)
overridevirtual

Draw text with the plotter.

For convenience it accept the color to use for specific plotters aData is used to pass extra parameters (GERBER).

Parameters
aPosis the text position (according to aH_justify, aV_justify).
aColoris the text color.
aTextis the text to draw.
aOrientis the angle.
aSizeis the text size (size.x or size.y can be < 0 for mirrored texts).
aH_justifyis the horizontal justification (Left, center, right).
aV_justifyis the vertical justification (bottom, center, top).
aPenWidthis the line width (if = 0, use plot default line width).
aItalicis the true to simulate an italic font.
aBolduse true to use a bold font Useful only with default width value (aPenWidth = 0).
aMultilineAlloweduse true to plot text as multiline, otherwise single line.
aDatais a parameter used by some plotters in SetCurrentLineWidth(), not directly used here.

If the text is mirrored, we should also mirror the hidden text to match

Reimplemented from PLOTTER.

Definition at line 833 of file SVG_plotter.cpp.

References std::abs(), EDA_ANGLE::AsDegrees(), PLOTTER::GetCurrentLineWidth(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_INDETERMINATE, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_INDETERMINATE, GR_TEXT_V_ALIGN_TOP, GRTextWidth(), EDA_ANGLE::IsZero(), m_graphics_changed, PLOTTER::m_outputFile, PLOTTER::m_plotMirror, m_precision, PSLIKE_PLOTTER::SetColor(), SetCurrentLineWidth(), setFillMode(), setSVGPlotStyle(), PLOTTER::Text(), TO_UTF8, PLOTTER::userToDeviceCoordinates(), PLOTTER::userToDeviceSize(), VECTOR2< T >::x, XmlEsc(), and VECTOR2< T >::y.

Referenced by PlotText().

◆ ThickArc() [1/2]

void PLOTTER::ThickArc ( const EDA_SHAPE aArcShape,
OUTLINE_MODE  aTraceMode,
void *  aData,
int  aWidth 
)
virtualinherited

◆ ThickArc() [2/2]

void PLOTTER::ThickArc ( const VECTOR2D aCentre,
const EDA_ANGLE aStAngle,
const EDA_ANGLE aAngle,
double  aRadius,
int  aWidth,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
virtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 578 of file plotter.cpp.

References PLOTTER::Arc(), FILLED, PLOTTER::m_currentPenWidth, and PLOTTER::SetCurrentLineWidth().

◆ ThickCircle()

void PLOTTER::ThickCircle ( const VECTOR2I pos,
int  diametre,
int  width,
OUTLINE_MODE  tracemode,
void *  aData 
)
virtualinherited

◆ ThickRect()

void PLOTTER::ThickRect ( const VECTOR2I p1,
const VECTOR2I p2,
int  width,
OUTLINE_MODE  tracemode,
void *  aData 
)
virtualinherited

◆ ThickSegment()

◆ userToDeviceCoordinates()

VECTOR2D PLOTTER::userToDeviceCoordinates ( const VECTOR2I aCoordinate)
protectedvirtualinherited

◆ userToDeviceSize() [1/2]

◆ userToDeviceSize() [2/2]

double PLOTTER::userToDeviceSize ( double  size) const
protectedvirtualinherited

Modify size according to the plotter scale factors (simple double version).

Definition at line 123 of file plotter.cpp.

References PLOTTER::m_iuPerDeviceUnit, and PLOTTER::m_plotScale.

Member Data Documentation

◆ DO_NOT_SET_LINE_WIDTH

◆ m_author

wxString PLOTTER::m_author
protectedinherited

Definition at line 674 of file plotter.h.

Referenced by PDF_PLOTTER::EndPlot(), and PLOTTER::SetAuthor().

◆ m_brush_alpha

double SVG_PLOTTER::m_brush_alpha
protected

Definition at line 655 of file plotters_pslike.h.

Referenced by emitSetRGBColor(), setSVGPlotStyle(), StartPlot(), and SVG_PLOTTER().

◆ m_brush_rgb_color

long SVG_PLOTTER::m_brush_rgb_color
protected

Definition at line 654 of file plotters_pslike.h.

Referenced by emitSetRGBColor(), setSVGPlotStyle(), StartPlot(), and SVG_PLOTTER().

◆ m_colorMode

◆ m_creator

wxString PLOTTER::m_creator
protectedinherited

◆ m_currentPenWidth

◆ m_dashed

LINE_STYLE SVG_PLOTTER::m_dashed
protected

Definition at line 658 of file plotters_pslike.h.

Referenced by SetDash(), setSVGPlotStyle(), and SVG_PLOTTER().

◆ m_filename

wxString PLOTTER::m_filename
protectedinherited

◆ m_fillMode

FILL_T SVG_PLOTTER::m_fillMode
protected

Definition at line 649 of file plotters_pslike.h.

Referenced by PenTo(), setFillMode(), setSVGPlotStyle(), and SVG_PLOTTER().

◆ m_graphics_changed

bool SVG_PLOTTER::m_graphics_changed
protected

◆ m_headerExtraLines

wxArrayString PLOTTER::m_headerExtraLines
protectedinherited

◆ m_iuPerDeviceUnit

◆ m_IUsPerDecimil

◆ m_mirrorIsHorizontal

bool PLOTTER::m_mirrorIsHorizontal
protectedinherited

Definition at line 658 of file plotter.h.

Referenced by Arc(), PLOTTER::PLOTTER(), and PLOTTER::userToDeviceCoordinates().

◆ m_negativeMode

bool PLOTTER::m_negativeMode
protectedinherited

Definition at line 666 of file plotter.h.

Referenced by PLOTTER::PLOTTER(), PSLIKE_PLOTTER::SetColor(), and PLOTTER::SetNegative().

◆ m_outputFile

FILE* PLOTTER::m_outputFile
protectedinherited

Output file.

Definition at line 662 of file plotter.h.

Referenced by DXF_PLOTTER::Arc(), PS_PLOTTER::Arc(), Arc(), BezierCurve(), HPGL_PLOTTER::Circle(), DXF_PLOTTER::Circle(), PS_PLOTTER::Circle(), Circle(), GERBER_PLOTTER::ClearAllAttributes(), GERBER_PLOTTER::clearNetAttribute(), PDF_PLOTTER::ClosePage(), PDF_PLOTTER::closePdfObject(), PDF_PLOTTER::closePdfStream(), GERBER_PLOTTER::emitDcode(), PDF_PLOTTER::emitGoToAction(), PDF_PLOTTER::emitOutline(), PDF_PLOTTER::emitOutlineNode(), PS_PLOTTER::emitSetRGBColor(), DXF_PLOTTER::EndPlot(), GERBER_PLOTTER::EndPlot(), HPGL_PLOTTER::EndPlot(), PS_PLOTTER::EndPlot(), PDF_PLOTTER::EndPlot(), EndPlot(), HPGL_PLOTTER::FlashPadCircle(), DXF_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::FlashPadOval(), HPGL_PLOTTER::FlashPadOval(), PSLIKE_PLOTTER::FlashPadOval(), DXF_PLOTTER::FlashPadOval(), GERBER_PLOTTER::FlashPadRect(), DXF_PLOTTER::FlashPadRect(), GERBER_PLOTTER::FlashPadRoundRect(), DXF_PLOTTER::FlashPadTrapez(), GERBER_PLOTTER::formatNetAttribute(), PLOTTER::OpenFile(), PDF_PLOTTER::OpenFile(), DXF_PLOTTER::PenTo(), GERBER_PLOTTER::PenTo(), HPGL_PLOTTER::PenTo(), PS_PLOTTER::PenTo(), PenTo(), GERBER_PLOTTER::plotArc(), GERBER_PLOTTER::PlotGerberRegion(), PS_PLOTTER::PlotImage(), PlotImage(), DXF_PLOTTER::plotOneLineOfText(), GERBER_PLOTTER::PlotPoly(), PS_PLOTTER::PlotPoly(), PlotPoly(), GERBER_PLOTTER::plotRoundRectAsRegion(), PLOTTER::PLOTTER(), PS_PLOTTER::PlotText(), HPGL_PLOTTER::Rect(), DXF_PLOTTER::Rect(), PS_PLOTTER::Rect(), Rect(), GERBER_PLOTTER::selectAperture(), PS_PLOTTER::SetCurrentLineWidth(), PS_PLOTTER::SetDash(), GERBER_PLOTTER::SetLayerPolarity(), setSVGPlotStyle(), PS_PLOTTER::SetViewport(), PDF_PLOTTER::StartPage(), PDF_PLOTTER::startPdfObject(), PDF_PLOTTER::startPdfStream(), DXF_PLOTTER::StartPlot(), HPGL_PLOTTER::StartPlot(), PS_PLOTTER::StartPlot(), StartPlot(), PDF_PLOTTER::StartPlot(), GERBER_PLOTTER::StartPlot(), PS_PLOTTER::Text(), Text(), HPGL_PLOTTER::ThickSegment(), GERBER_PLOTTER::writeApertureList(), and PLOTTER::~PLOTTER().

◆ m_pageInfo

◆ m_paperSize

◆ m_pen_rgb_color

long SVG_PLOTTER::m_pen_rgb_color
protected

Definition at line 651 of file plotters_pslike.h.

Referenced by emitSetRGBColor(), setSVGPlotStyle(), StartPlot(), and SVG_PLOTTER().

◆ m_penLastpos

VECTOR2I PLOTTER::m_penLastpos
protectedinherited

◆ m_penState

char PLOTTER::m_penState
protectedinherited

◆ m_plotMirror

◆ m_plotOffset

◆ m_plotScale

◆ m_precision

unsigned SVG_PLOTTER::m_precision
protected

◆ m_project

const PROJECT* PLOTTER::m_project
protectedinherited

Definition at line 683 of file plotter.h.

Referenced by PDF_PLOTTER::EndPlot().

◆ m_renderSettings

◆ m_subject

wxString PLOTTER::m_subject
protectedinherited

Definition at line 675 of file plotter.h.

Referenced by PDF_PLOTTER::EndPlot(), and PLOTTER::SetSubject().

◆ m_textMode

PLOT_TEXT_MODE PSLIKE_PLOTTER::m_textMode
protectedinherited

◆ m_title

wxString PLOTTER::m_title
protectedinherited

Definition at line 673 of file plotter.h.

Referenced by PDF_PLOTTER::EndPlot(), PLOTTER::SetTitle(), and PS_PLOTTER::StartPlot().

◆ m_yaxisReversed

bool PLOTTER::m_yaxisReversed
protectedinherited

Definition at line 659 of file plotter.h.

Referenced by PLOTTER::PLOTTER(), SetViewport(), and PLOTTER::userToDeviceCoordinates().

◆ MARKER_COUNT

const unsigned PLOTTER::MARKER_COUNT = 58
staticinherited

Draw a marker (used for the drill map).

Definition at line 485 of file plotter.h.

Referenced by PLOTTER::Marker().

◆ plotScaleAdjX

double PSLIKE_PLOTTER::plotScaleAdjX
protectedinherited

Fine user scale adjust ( = 1.0 if no correction)

Definition at line 137 of file plotters_pslike.h.

Referenced by PSLIKE_PLOTTER::SetScaleAdjust(), PDF_PLOTTER::StartPage(), and PS_PLOTTER::StartPlot().

◆ plotScaleAdjY

double PSLIKE_PLOTTER::plotScaleAdjY
protectedinherited

◆ postscriptTextAscent

const double PSLIKE_PLOTTER::postscriptTextAscent = 0.718
staticprotectedinherited

Height of the postscript font (from the AFM)

Definition at line 127 of file plotters_pslike.h.

Referenced by PSLIKE_PLOTTER::computeTextParameters(), and PSLIKE_PLOTTER::returnPostscriptTextWidth().

◆ USE_DEFAULT_LINE_WIDTH


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