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

PNG rasterization plotter using Cairo graphics library. More...

#include <plotter_png.h>

Inheritance diagram for PNG_PLOTTER:
PLOTTER

Public Member Functions

 PNG_PLOTTER ()
 
virtual ~PNG_PLOTTER ()
 
virtual PLOT_FORMAT GetPlotterType () const override
 Return the effective plot engine in use.
 
void SetResolution (int aDPI)
 Set the output resolution in dots per inch.
 
int GetResolution () const
 
void SetPixelSize (int aWidth, int aHeight)
 Set the output image dimensions in pixels.
 
int GetPixelWidth () const
 
int GetPixelHeight () const
 
void SetBackgroundColor (const COLOR4D &aColor)
 Set the background color for the image.
 
COLOR4D GetBackgroundColor () const
 
void SetAntialias (bool aEnable)
 Enable or disable anti-aliasing.
 
bool GetAntialias () const
 
virtual bool StartPlot (const wxString &aPageNumber) override
 
virtual bool EndPlot () override
 
virtual void SetCurrentLineWidth (int aWidth, void *aData=nullptr) override
 Set the line width for the next drawing.
 
virtual void SetColor (const COLOR4D &aColor) override
 
virtual void SetDash (int aLineWidth, LINE_STYLE aLineStyle) override
 
void SetClearCompositing (bool aClear)
 Switch the Cairo compositing operator between CLEAR and OVER.
 
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 aFill, int aWidth, int aCornerRadius=0) override
 
virtual void Circle (const VECTOR2I &aCenter, int aDiameter, FILL_T aFill, int aWidth) override
 
virtual void Arc (const VECTOR2D &aCenter, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aRadius, FILL_T aFill, int aWidth) override
 
virtual void PenTo (const VECTOR2I &aPos, char aPlume) override
 Moveto/lineto primitive, moves the 'pen' to the specified direction.
 
virtual void PlotPoly (const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth, void *aData=nullptr) override
 Draw a polygon ( filled or not ).
 
virtual void FlashPadCircle (const VECTOR2I &aPadPos, int aDiameter, void *aData) override
 
virtual void FlashPadOval (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, void *aData) override
 
virtual void FlashPadRect (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, void *aData) override
 
virtual void FlashPadRoundRect (const VECTOR2I &aPadPos, const VECTOR2I &aSize, int aCornerRadius, const EDA_ANGLE &aOrient, void *aData) override
 
virtual void FlashPadCustom (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, SHAPE_POLY_SET *aPolygons, void *aData) override
 
virtual void FlashPadTrapez (const VECTOR2I &aPadPos, const VECTOR2I *aCorners, const EDA_ANGLE &aPadOrient, void *aData) override
 Flash a trapezoidal pad.
 
virtual void FlashRegularPolygon (const VECTOR2I &aShapePos, int aDiameter, int aCornerCount, const EDA_ANGLE &aOrient, void *aData) override
 Flash a regular polygon.
 
bool SaveFile (const wxString &aPath)
 Save the rendered image to a PNG file.
 
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 ()
 
void SetPlotMirrored (bool aMirror)
 
bool GetPlotMirrored () const
 
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.
 
void SetLayersToExport (const std::vector< std::pair< PCB_LAYER_ID, wxString > > &aLayersToExport)
 Sets the list of layers to export to the specified vector.
 
PCB_LAYER_ID GetLayer () const
 Gets the ID of the current layer.
 
void SetLayer (PCB_LAYER_ID aLayer)
 Sets the ID of the current layer.
 
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)
 
virtual void BezierCurve (const VECTOR2I &aStart, const VECTOR2I &aControl1, const VECTOR2I &aControl2, const VECTOR2I &aEnd, int aTolerance, int aLineThickness)
 Generic fallback: Cubic Bezier curve rendered as a polyline.
 
void MoveTo (const VECTOR2I &pos)
 
void LineTo (const VECTOR2I &pos)
 
void FinishTo (const VECTOR2I &pos)
 
void PenFinish ()
 
virtual void PlotPoly (const SHAPE_LINE_CHAIN &aLineChain, FILL_T aFill, int aWidth, void *aData)
 Draw a polygon ( filled or not ).
 
virtual void PlotImage (const wxImage &aImage, const VECTOR2I &aPos, double aScaleFactor)
 Only PostScript plotters can plot bitmaps.
 
virtual void ThickSegment (const VECTOR2I &start, const VECTOR2I &end, int width, void *aData)
 
virtual void ThickArc (const EDA_SHAPE &aArcShape, void *aData, int aWidth)
 
virtual void ThickArc (const VECTOR2D &aCentre, const EDA_ANGLE &aStAngle, const EDA_ANGLE &aAngle, double aRadius, int aWidth, void *aData)
 
virtual void ThickRect (const VECTOR2I &p1, const VECTOR2I &p2, int width, void *aData)
 
virtual void ThickCircle (const VECTOR2I &pos, int diametre, int width, void *aData)
 
virtual void FilledCircle (const VECTOR2I &pos, int diametre, void *aData)
 
virtual void ThickOval (const VECTOR2I &aPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, int aWidth, void *aData)
 
virtual void ThickPoly (const SHAPE_POLY_SET &aPoly, int aWidth, void *aData)
 
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 aPenWidth, bool aItalic, bool aBold, bool aMultilineAllowed, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics, void *aData=nullptr)
 Draw text with the plotter.
 
virtual void PlotText (const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont=nullptr, const KIFONT::METRICS &aFontMetrics=KIFONT::METRICS::Default(), void *aData=nullptr)
 
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 SetTextMode (PLOT_TEXT_MODE mode)
 Change the current text mode.
 
virtual void SetGerberCoordinatesFormat (int aResolution, bool aUseInches=false)
 
virtual void SetSvgCoordinatesFormat (unsigned aPrecision)
 Set the number of digits for mantissa in coordinates in mm for SVG plotter.
 
virtual void StartBlock (void *aData)
 calling this function allows one to define the beginning of a group of drawing items, for instance in SVG or Gerber format.
 
virtual void EndBlock (void *aData)
 calling this function allows one to define the end of a group of drawing items for instance in SVG or Gerber format.
 
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 VECTOR2D userToDeviceCoordinates (const VECTOR2I &aCoordinate) override
 Transform coordinates from user space (IU) to device space (pixels).
 
virtual VECTOR2D userToDeviceSize (const VECTOR2I &aSize) override
 Transform a size from user space to device space.
 
virtual double userToDeviceSize (double aSize) const override
 Transform a size from user space to device space (scalar version).
 
virtual void polyArc (const VECTOR2D &aCentre, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aRadius, FILL_T aFill, int aWidth)
 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.
 
double GetDotMarkLenIU (int aLineWidth) const
 
double GetDashMarkLenIU (int aLineWidth) const
 
double GetDashGapLenIU (int aLineWidth) const
 

Protected Attributes

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
 
std::vector< std::pair< PCB_LAYER_ID, wxString > > m_layersToExport
 
PCB_LAYER_ID m_layer
 

Private Member Functions

void fillRect (double aX, double aY, double aWidth, double aHeight)
 
void strokeRect (double aX, double aY, double aWidth, double aHeight)
 
void fillCircle (double aCx, double aCy, double aRadius)
 
void strokeCircle (double aCx, double aCy, double aRadius)
 

Private Attributes

cairo_surface_t * m_surface
 
cairo_t * m_context
 
int m_dpi
 
int m_width
 
int m_height
 
bool m_antialias
 
COLOR4D m_backgroundColor
 
COLOR4D m_currentColor
 

Detailed Description

PNG rasterization plotter using Cairo graphics library.

This plotter creates PNG images from KiCad drawings, primarily used for Gerber file visualization and diff output in kicad-cli.

Definition at line 33 of file plotter_png.h.

Constructor & Destructor Documentation

◆ PNG_PLOTTER()

PNG_PLOTTER::PNG_PLOTTER ( )

◆ ~PNG_PLOTTER()

PNG_PLOTTER::~PNG_PLOTTER ( )
virtual

Definition at line 41 of file PNG_plotter.cpp.

References m_context, and m_surface.

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 198 of file plotter.h.

References m_headerExtraLines.

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

◆ Arc() [1/2]

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

◆ Arc() [2/2]

void PNG_PLOTTER::Arc ( const VECTOR2D & aCenter,
const EDA_ANGLE & aStartAngle,
const EDA_ANGLE & aAngle,
double aRadius,
FILL_T aFill,
int aWidth )
overridevirtual

◆ BezierCurve()

void PLOTTER::BezierCurve ( const VECTOR2I & aStart,
const VECTOR2I & aControl1,
const VECTOR2I & aControl2,
const VECTOR2I & aEnd,
int aTolerance,
int aLineThickness )
virtualinherited

Generic fallback: Cubic Bezier curve rendered as a polyline.

In KiCad the bezier curves have 4 control points: start ctrl1 ctrl2 end

Reimplemented in SVG_PLOTTER.

Definition at line 232 of file plotter.cpp.

References FinishTo(), BEZIER_POLY::GetPoly(), LineTo(), MoveTo(), and SetCurrentLineWidth().

Referenced by SVG_PLOTTER::BezierCurve(), and plotLocalPowerIcon().

◆ 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 528 of file plotter.h.

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

◆ Circle()

void PNG_PLOTTER::Circle ( const VECTOR2I & aCenter,
int aDiameter,
FILL_T aFill,
int aWidth )
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 206 of file plotter.h.

References m_headerExtraLines.

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

◆ EndBlock()

virtual void PLOTTER::EndBlock ( void * aData)
inlinevirtualinherited

calling this function allows one to define the end of a group of drawing items for instance in SVG or Gerber format.

the group is started by StartBlock()

Parameters
aDatacan define any parameter for most of plotters: do nothing

Reimplemented in GERBER_PLOTTER, and SVG_PLOTTER.

Definition at line 599 of file plotter.h.

Referenced by SCH_SYMBOL::Plot(), and PlotStandardLayer().

◆ EndPlot()

bool PNG_PLOTTER::EndPlot ( )
overridevirtual

◆ fillCircle()

void PNG_PLOTTER::fillCircle ( double aCx,
double aCy,
double aRadius )
private

Definition at line 531 of file PNG_plotter.cpp.

References m_context, and M_PI.

Referenced by Circle().

◆ FilledCircle()

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

Reimplemented in DXF_PLOTTER, and GERBER_PLOTTER.

Definition at line 599 of file plotter.cpp.

References Circle(), and FILLED_SHAPE.

Referenced by SCH_LABEL_BASE::Plot().

◆ fillRect()

void PNG_PLOTTER::fillRect ( double aX,
double aY,
double aWidth,
double aHeight )
private

Definition at line 511 of file PNG_plotter.cpp.

References m_context.

Referenced by Rect().

◆ FinishTo()

◆ FlashPadCircle()

void PNG_PLOTTER::FlashPadCircle ( const VECTOR2I & aPadPos,
int aDiameter,
void * aData )
overridevirtual
Parameters
aPadPosPosition of the shape (center of the rectangle.
aDiameteris the diameter of round pad.
aDatais an auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 331 of file PNG_plotter.cpp.

References Circle(), and FILLED_SHAPE.

Referenced by FlashPadOval().

◆ FlashPadCustom()

void PNG_PLOTTER::FlashPadCustom ( const VECTOR2I & aPadPos,
const VECTOR2I & aSize,
const EDA_ANGLE & aPadOrient,
SHAPE_POLY_SET * aPolygons,
void * aData )
overridevirtual
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.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 420 of file PNG_plotter.cpp.

References SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), FILLED_SHAPE, SHAPE_POLY_SET::OutlineCount(), PlotPoly(), and SHAPE_LINE_CHAIN::PointCount().

◆ FlashPadOval()

void PNG_PLOTTER::FlashPadOval ( const VECTOR2I & aPadPos,
const VECTOR2I & aSize,
const EDA_ANGLE & aPadOrient,
void * aData )
overridevirtual
Parameters
aPadPosPosition of the shape (center of the rectangle.
aSizeis the size of oblong shape.
aPadOrientThe rotation of the shape.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 337 of file PNG_plotter.cpp.

References delta, end, FlashPadCircle(), RotatePoint(), PLOTTER::ThickSegment(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ FlashPadRect()

void PNG_PLOTTER::FlashPadRect ( const VECTOR2I & aPadPos,
const VECTOR2I & aSize,
const EDA_ANGLE & aPadOrient,
void * aData )
overridevirtual
Parameters
aPadPosPosition of the shape (center of the rectangle).
aSizeis the size of rounded rect.
aPadOrientThe rotation of the shape.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 375 of file PNG_plotter.cpp.

References FILLED_SHAPE, PlotPoly(), RotatePoint(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ FlashPadRoundRect()

void PNG_PLOTTER::FlashPadRoundRect ( const VECTOR2I & aPadPos,
const VECTOR2I & aSize,
int aCornerRadius,
const EDA_ANGLE & aOrient,
void * aData )
overridevirtual
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.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 399 of file PNG_plotter.cpp.

References SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), ERROR_INSIDE, FILLED_SHAPE, PLOTTER::GetPlotterArcHighDef(), SHAPE_POLY_SET::OutlineCount(), PlotPoly(), SHAPE_LINE_CHAIN::PointCount(), and TransformRoundChamferedRectToPolygon().

◆ FlashPadTrapez()

void PNG_PLOTTER::FlashPadTrapez ( const VECTOR2I & aPadPos,
const VECTOR2I * aCorners,
const EDA_ANGLE & aPadOrient,
void * aData )
overridevirtual

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.
aDataan auxiliary info (mainly for gerber format attributes).

Implements PLOTTER.

Definition at line 439 of file PNG_plotter.cpp.

References FILLED_SHAPE, PlotPoly(), and RotatePoint().

◆ FlashRegularPolygon()

void PNG_PLOTTER::FlashRegularPolygon ( const VECTOR2I & aShapePos,
int aDiameter,
int aCornerCount,
const EDA_ANGLE & aOrient,
void * aData )
overridevirtual

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 456 of file PNG_plotter.cpp.

References ANGLE_360, EDA_ANGLE::AsRadians(), delta, FILLED_SHAPE, PlotPoly(), and radius.

◆ GetAntialias()

bool PNG_PLOTTER::GetAntialias ( ) const
inline

Definition at line 80 of file plotter_png.h.

References m_antialias.

◆ GetBackgroundColor()

COLOR4D PNG_PLOTTER::GetBackgroundColor ( ) const
inline

Definition at line 73 of file plotter_png.h.

References m_backgroundColor.

◆ GetColorMode()

◆ GetCurrentLineWidth()

◆ GetDashGapLenIU()

double PLOTTER::GetDashGapLenIU ( int aLineWidth) const
protectedinherited

◆ GetDashMarkLenIU()

double PLOTTER::GetDashMarkLenIU ( int aLineWidth) const
protectedinherited

◆ GetDefaultFileExtension()

static wxString PNG_PLOTTER::GetDefaultFileExtension ( )
inlinestatic

Definition at line 45 of file plotter_png.h.

◆ 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 271 of file plotter.h.

References m_IUsPerDecimil.

Referenced by PlotDrawingSheet().

◆ GetLayer()

PCB_LAYER_ID PLOTTER::GetLayer ( ) const
inlineinherited

Gets the ID of the current layer.

This function returns the ID of the layer that the current item is on.

Returns
PCB_LAYER_ID The ID of the current layer.

Definition at line 243 of file plotter.h.

References m_layer.

Referenced by DXF_PLOTTER::GetCurrentLayerName().

◆ GetPixelHeight()

int PNG_PLOTTER::GetPixelHeight ( ) const
inline

Definition at line 66 of file plotter_png.h.

References m_height.

◆ GetPixelWidth()

int PNG_PLOTTER::GetPixelWidth ( ) const
inline

Definition at line 65 of file plotter_png.h.

References m_width.

◆ GetPlotMirrored()

bool PLOTTER::GetPlotMirrored ( ) const
inlineinherited

Definition at line 173 of file plotter.h.

References m_plotMirror.

◆ GetPlotOffsetUserUnits()

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

Definition at line 604 of file plotter.h.

References m_plotOffset.

Referenced by PlotInteractiveLayer(), and plotPdfBackground().

◆ GetPlotterArcHighDef()

◆ GetPlotterArcLowDef()

int PLOTTER::GetPlotterArcLowDef ( ) const
inlineinherited

Definition at line 273 of file plotter.h.

References m_IUsPerDecimil.

◆ GetPlotterType()

virtual PLOT_FORMAT PNG_PLOTTER::GetPlotterType ( ) const
inlineoverridevirtual

Return 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 39 of file plotter_png.h.

References UNDEFINED.

◆ GetResolution()

int PNG_PLOTTER::GetResolution ( ) const
inline

Definition at line 52 of file plotter_png.h.

References m_dpi.

◆ 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 506 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 517 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 365 of file plotter.cpp.

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

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 351 of file plotter.cpp.

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

Referenced by 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 304 of file plotter.cpp.

References Circle(), GetCurrentLineWidth(), NO_FILL, and radius.

Referenced by 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 337 of file plotter.cpp.

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

Referenced by 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 310 of file plotter.cpp.

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

Referenced by 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 344 of file plotter.cpp.

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

Referenced by 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 276 of file plotter.cpp.

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

Referenced by 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 358 of file plotter.cpp.

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

Referenced by 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 77 of file plotter.cpp.

References m_filename, and m_outputFile.

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

◆ PageSettings()

PAGE_INFO & PLOTTER::PageSettings ( )
inlineinherited

Definition at line 170 of file plotter.h.

References m_pageInfo.

Referenced by plotPdfBackground().

◆ PenFinish()

void PLOTTER::PenFinish ( )
inlineinherited

◆ PenTo()

void PNG_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 271 of file PNG_plotter.cpp.

References m_context, PLOTTER::m_penLastpos, PLOTTER::m_penState, userToDeviceCoordinates(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ PlotImage()

void PLOTTER::PlotImage ( const wxImage & aImage,
const VECTOR2I & aPos,
double aScaleFactor )
virtualinherited

Only PostScript plotters can plot bitmaps.

A rectangle is plotted for plotters that cannot plot a bitmap.

Parameters
aImageis the bitmap.
aPosis position of the center of the bitmap.
aScaleFactoris the scale factor to apply to the bitmap size (this is not the plot scale factor).

Reimplemented in PDF_PLOTTER, PS_PLOTTER, and SVG_PLOTTER.

Definition at line 260 of file plotter.cpp.

References end, NO_FILL, Rect(), USE_DEFAULT_LINE_WIDTH, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BITMAP_BASE::PlotImage(), and SVG_PLOTTER::PlotImage().

◆ PlotPoly() [1/2]

void PLOTTER::PlotPoly ( const SHAPE_LINE_CHAIN & aLineChain,
FILL_T aFill,
int aWidth,
void * aData )
virtualinherited

Draw a polygon ( filled or not ).

Parameters
aLineChainis a list of segments and arcs. 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 DXF_PLOTTER, GERBER_PLOTTER, PDF_PLOTTER, and PS_PLOTTER.

Definition at line 611 of file plotter.cpp.

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

◆ PlotPoly() [2/2]

void PNG_PLOTTER::PlotPoly ( const std::vector< VECTOR2I > & aCornerList,
FILL_T aFill,
int aWidth,
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 303 of file PNG_plotter.cpp.

References m_context, NO_FILL, SetCurrentLineWidth(), userToDeviceCoordinates(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOOST_AUTO_TEST_CASE(), FlashPadCustom(), FlashPadRect(), FlashPadRoundRect(), FlashPadTrapez(), and FlashRegularPolygon().

◆ PlotText()

◆ polyArc()

void PLOTTER::polyArc ( const VECTOR2D & aCentre,
const EDA_ANGLE & aStartAngle,
const EDA_ANGLE & aAngle,
double aRadius,
FILL_T aFill,
int aWidth )
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 183 of file plotter.cpp.

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

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

◆ Rect()

void PNG_PLOTTER::Rect ( const VECTOR2I & p1,
const VECTOR2I & p2,
FILL_T aFill,
int aWidth,
int aCornerRadius = 0 )
overridevirtual

◆ RenderSettings()

◆ SaveFile()

bool PNG_PLOTTER::SaveFile ( const wxString & aPath)

Save the rendered image to a PNG file.

Parameters
aPathoutput file path
Returns
true on success, false on failure

Definition at line 130 of file PNG_plotter.cpp.

References m_surface.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), RenderDiffToPng(), and RenderGerberToPng().

◆ SetAntialias()

void PNG_PLOTTER::SetAntialias ( bool aEnable)
inline

Enable or disable anti-aliasing.

Parameters
aEnabletrue for smooth edges, false for hard pixel edges

Definition at line 79 of file plotter_png.h.

References m_antialias.

Referenced by BOOST_AUTO_TEST_CASE(), RenderDiffToPng(), and RenderGerberToPng().

◆ SetAuthor()

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

Definition at line 190 of file plotter.h.

References m_author.

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

◆ SetBackgroundColor()

void PNG_PLOTTER::SetBackgroundColor ( const COLOR4D & aColor)
inline

Set the background color for the image.

Default is transparent (alpha = 0).

Definition at line 72 of file plotter_png.h.

References m_backgroundColor.

Referenced by RenderDiffToPng(), and RenderGerberToPng().

◆ SetClearCompositing()

void PNG_PLOTTER::SetClearCompositing ( bool aClear)

Switch the Cairo compositing operator between CLEAR and OVER.

Use aClear=true to punch transparent holes in the alpha channel (negative/clear polarity items on transparent exports). Restore with aClear=false when done.

Definition at line 164 of file PNG_plotter.cpp.

References m_context.

Referenced by RenderGerberToPng().

◆ SetColor()

void PNG_PLOTTER::SetColor ( const COLOR4D & aColor)
overridevirtual

◆ SetColorMode()

virtual void PLOTTER::SetColorMode ( bool aColorMode)
inlinevirtualinherited

◆ SetCreator()

◆ SetCurrentLineWidth()

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

Set the line width for the next drawing.

Parameters
widthis specified in IUs.
aDatais an auxiliary parameter, mainly used in gerber plotter.

Implements PLOTTER.

Definition at line 141 of file PNG_plotter.cpp.

References m_context, PLOTTER::m_currentPenWidth, and userToDeviceSize().

Referenced by Arc(), BOOST_AUTO_TEST_CASE(), Circle(), PlotPoly(), and Rect().

◆ SetDash()

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

Implements PLOTTER.

Definition at line 171 of file PNG_plotter.cpp.

References m_context.

◆ SetGerberCoordinatesFormat()

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

Reimplemented in GERBER_PLOTTER.

Definition at line 572 of file plotter.h.

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

◆ SetLayer()

void PLOTTER::SetLayer ( PCB_LAYER_ID aLayer)
inlineinherited

Sets the ID of the current layer.

This function sets the ID of the layer for the current item.

Parameters
aLayerThe ID of the layer to be set.

Definition at line 252 of file plotter.h.

References m_layer.

Referenced by PCB_PLOTTER::Plot().

◆ 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 557 of file plotter.h.

Referenced by PlotOneBoardLayer().

◆ SetLayersToExport()

void PLOTTER::SetLayersToExport ( const std::vector< std::pair< PCB_LAYER_ID, wxString > > & aLayersToExport)
inlineinherited

Sets the list of layers to export to the specified vector.

This function updates the member variable m_layersToExport with the vector provided in aLayersToExport.

Parameters
aLayersToExportThe vector containing the names of layers to export. This updates the internal list of layers that will be processed for export.

Definition at line 234 of file plotter.h.

References m_layersToExport.

Referenced by StartPlotBoard().

◆ SetNegative()

virtual void PLOTTER::SetNegative ( bool aNegative)
inlinevirtualinherited

Definition at line 156 of file plotter.h.

References m_negativeMode.

Referenced by FillNegativeKnockout().

◆ SetPageSettings()

◆ SetPixelSize()

void PNG_PLOTTER::SetPixelSize ( int aWidth,
int aHeight )
inline

Set the output image dimensions in pixels.

Parameters
aWidthimage width in pixels
aHeightimage height in pixels

Definition at line 59 of file plotter_png.h.

References m_height, and m_width.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), RenderDiffToPng(), and RenderGerberToPng().

◆ SetPlotMirrored()

void PLOTTER::SetPlotMirrored ( bool aMirror)
inlineinherited

Definition at line 172 of file plotter.h.

References m_plotMirror.

◆ SetRenderSettings()

◆ SetResolution()

void PNG_PLOTTER::SetResolution ( int aDPI)
inline

Set the output resolution in dots per inch.

Parameters
aDPIresolution value (default 300)

Definition at line 51 of file plotter_png.h.

References m_dpi.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), RenderDiffToPng(), and RenderGerberToPng().

◆ SetSubject()

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

Definition at line 191 of file plotter.h.

References m_subject.

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

◆ SetSvgCoordinatesFormat()

virtual void PLOTTER::SetSvgCoordinatesFormat ( unsigned aPrecision)
inlinevirtualinherited

Set the number of digits for mantissa in coordinates in mm for SVG plotter.

Reimplemented in SVG_PLOTTER.

Definition at line 578 of file plotter.h.

Referenced by initializePlotter().

◆ SetTextMode()

virtual void PLOTTER::SetTextMode ( PLOT_TEXT_MODE mode)
inlinevirtualinherited

Change the current text mode.

See the PlotTextMode explanation at the beginning of the file.

Reimplemented in DXF_PLOTTER, and PSLIKE_PLOTTER.

Definition at line 567 of file plotter.h.

Referenced by initializePlotter(), and PlotOneBoardLayer().

◆ SetTitle()

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

Definition at line 189 of file plotter.h.

References m_title.

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

◆ SetViewport()

void PNG_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 181 of file PNG_plotter.cpp.

References m_dpi, PLOTTER::m_iuPerDeviceUnit, PLOTTER::m_IUsPerDecimil, PLOTTER::m_plotMirror, PLOTTER::m_plotOffset, and PLOTTER::m_plotScale.

Referenced by BOOST_AUTO_TEST_CASE(), RenderDiffToPng(), and RenderGerberToPng().

◆ StartBlock()

virtual void PLOTTER::StartBlock ( void * aData)
inlinevirtualinherited

calling this function allows one to define the beginning of a group of drawing items, for instance in SVG or Gerber format.

(example: group all segments of a letter or a text)

Parameters
aDatacan define any parameter for most of plotters: do nothing

Reimplemented in GERBER_PLOTTER, and SVG_PLOTTER.

Definition at line 590 of file plotter.h.

Referenced by SCH_SYMBOL::Plot(), and PlotStandardLayer().

◆ StartPlot()

bool PNG_PLOTTER::StartPlot ( const wxString & aPageNumber)
overridevirtual

◆ strokeCircle()

void PNG_PLOTTER::strokeCircle ( double aCx,
double aCy,
double aRadius )
private

Definition at line 541 of file PNG_plotter.cpp.

References m_context, and M_PI.

Referenced by Circle().

◆ strokeRect()

void PNG_PLOTTER::strokeRect ( double aX,
double aY,
double aWidth,
double aHeight )
private

Definition at line 521 of file PNG_plotter.cpp.

References m_context.

Referenced by Rect().

◆ Text()

void 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 )
virtualinherited

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.

Reimplemented in DXF_PLOTTER, GERBER_PLOTTER, PDF_PLOTTER, PS_PLOTTER, and SVG_PLOTTER.

Definition at line 626 of file plotter.cpp.

References KIFONT::FONT::Draw(), EXPRESSION_EVALUATOR::Evaluate(), FILLED_SHAPE, KIFONT::FONT::GetFont(), GetPenSizeForBold(), LineTo(), TEXT_ATTRIBUTES::m_Angle, m_renderSettings, MoveTo(), PenFinish(), PlotPoly(), SetColor(), SetCurrentLineWidth(), text, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PlotDrawingSheet(), DXF_PLOTTER::Text(), GERBER_PLOTTER::Text(), PS_PLOTTER::Text(), and SVG_PLOTTER::Text().

◆ ThickArc() [1/2]

void PLOTTER::ThickArc ( const EDA_SHAPE & aArcShape,
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,
void * aData )
virtualinherited

Reimplemented in DXF_PLOTTER, and GERBER_PLOTTER.

Definition at line 555 of file plotter.cpp.

References Arc(), and NO_FILL.

◆ ThickCircle()

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

Reimplemented in DXF_PLOTTER, and GERBER_PLOTTER.

Definition at line 593 of file plotter.cpp.

References Circle(), and NO_FILL.

Referenced by SCH_LABEL_BASE::Plot(), PlotLayerOutlines(), and GERBER_PLOTTER::ThickCircle().

◆ ThickOval()

void PLOTTER::ThickOval ( const VECTOR2I & aPos,
const VECTOR2I & aSize,
const EDA_ANGLE & aOrient,
int aWidth,
void * aData )
virtualinherited

◆ ThickPoly()

void PLOTTER::ThickPoly ( const SHAPE_POLY_SET & aPoly,
int aWidth,
void * aData )
virtualinherited

Reimplemented in DXF_PLOTTER, and GERBER_PLOTTER.

Definition at line 605 of file plotter.cpp.

References SHAPE_POLY_SET::COutline(), NO_FILL, and PlotPoly().

Referenced by GERBER_PLOTTER::ThickPoly().

◆ ThickRect()

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

Reimplemented in DXF_PLOTTER, and GERBER_PLOTTER.

Definition at line 587 of file plotter.cpp.

References NO_FILL, and Rect().

Referenced by GERBER_PLOTTER::ThickRect().

◆ ThickSegment()

void PLOTTER::ThickSegment ( const VECTOR2I & start,
const VECTOR2I & end,
int width,
void * aData )
virtualinherited

◆ userToDeviceCoordinates()

VECTOR2D PNG_PLOTTER::userToDeviceCoordinates ( const VECTOR2I & aCoordinate)
overrideprotectedvirtual

Transform coordinates from user space (IU) to device space (pixels).

Reimplemented from PLOTTER.

Definition at line 475 of file PNG_plotter.cpp.

References m_height, PLOTTER::m_iuPerDeviceUnit, PLOTTER::m_plotMirror, PLOTTER::m_plotOffset, PLOTTER::m_plotScale, m_width, VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ userToDeviceSize() [1/2]

VECTOR2D PNG_PLOTTER::userToDeviceSize ( const VECTOR2I & aSize)
overrideprotectedvirtual

Transform a size from user space to device space.

Reimplemented from PLOTTER.

Definition at line 498 of file PNG_plotter.cpp.

References userToDeviceSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by Arc(), Circle(), SetCurrentLineWidth(), and userToDeviceSize().

◆ userToDeviceSize() [2/2]

double PNG_PLOTTER::userToDeviceSize ( double aSize) const
overrideprotectedvirtual

Transform a size from user space to device space (scalar version).

Reimplemented from PLOTTER.

Definition at line 505 of file PNG_plotter.cpp.

References std::abs(), PLOTTER::m_iuPerDeviceUnit, and PLOTTER::m_plotScale.

Member Data Documentation

◆ DO_NOT_SET_LINE_WIDTH

◆ m_antialias

bool PNG_PLOTTER::m_antialias
private

Definition at line 170 of file plotter_png.h.

Referenced by GetAntialias(), PNG_PLOTTER(), SetAntialias(), and StartPlot().

◆ m_author

wxString PLOTTER::m_author
protectedinherited

Definition at line 718 of file plotter.h.

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

◆ m_backgroundColor

COLOR4D PNG_PLOTTER::m_backgroundColor
private

Definition at line 171 of file plotter_png.h.

Referenced by GetBackgroundColor(), PNG_PLOTTER(), SetBackgroundColor(), and StartPlot().

◆ m_colorMode

◆ m_context

◆ m_creator

wxString PLOTTER::m_creator
protectedinherited

◆ m_currentColor

COLOR4D PNG_PLOTTER::m_currentColor
private

Definition at line 172 of file plotter_png.h.

Referenced by PNG_PLOTTER(), and SetColor().

◆ m_currentPenWidth

◆ m_dpi

int PNG_PLOTTER::m_dpi
private

Definition at line 167 of file plotter_png.h.

Referenced by GetResolution(), PNG_PLOTTER(), SetResolution(), and SetViewport().

◆ m_filename

wxString PLOTTER::m_filename
protectedinherited

◆ m_headerExtraLines

wxArrayString PLOTTER::m_headerExtraLines
protectedinherited

Definition at line 723 of file plotter.h.

Referenced by AddLineToHeader(), ClearHeaderLinesList(), and GERBER_PLOTTER::StartPlot().

◆ m_height

int PNG_PLOTTER::m_height
private

◆ m_iuPerDeviceUnit

◆ m_IUsPerDecimil

◆ m_layer

PCB_LAYER_ID PLOTTER::m_layer
protectedinherited

Definition at line 730 of file plotter.h.

Referenced by DXF_PLOTTER::GetCurrentLayerName(), GetLayer(), PLOTTER(), and SetLayer().

◆ m_layersToExport

std::vector<std::pair<PCB_LAYER_ID, wxString> > PLOTTER::m_layersToExport
protectedinherited

◆ m_mirrorIsHorizontal

bool PLOTTER::m_mirrorIsHorizontal
protectedinherited

◆ m_negativeMode

bool PLOTTER::m_negativeMode
protectedinherited

Definition at line 710 of file plotter.h.

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

◆ m_outputFile

FILE* PLOTTER::m_outputFile
protectedinherited

Output file.

Definition at line 706 of file plotter.h.

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

◆ m_pageInfo

◆ m_paperSize

◆ m_penLastpos

VECTOR2I PLOTTER::m_penLastpos
protectedinherited

◆ m_penState

char PLOTTER::m_penState
protectedinherited

◆ m_plotMirror

◆ m_plotOffset

◆ m_plotScale

◆ m_project

const PROJECT* PLOTTER::m_project
protectedinherited

Definition at line 727 of file plotter.h.

Referenced by PDF_PLOTTER::endPlotEmitResources(), and PLOTTER().

◆ m_renderSettings

◆ m_subject

wxString PLOTTER::m_subject
protectedinherited

Definition at line 719 of file plotter.h.

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

◆ m_surface

cairo_surface_t* PNG_PLOTTER::m_surface
private

Definition at line 164 of file plotter_png.h.

Referenced by EndPlot(), PNG_PLOTTER(), SaveFile(), StartPlot(), and ~PNG_PLOTTER().

◆ m_title

wxString PLOTTER::m_title
protectedinherited

Definition at line 717 of file plotter.h.

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

◆ m_width

int PNG_PLOTTER::m_width
private

◆ m_yaxisReversed

bool PLOTTER::m_yaxisReversed
protectedinherited

Definition at line 703 of file plotter.h.

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

◆ MARKER_COUNT

const unsigned PLOTTER::MARKER_COUNT = 58
staticinherited

Draw a marker (used for the drill map).

Definition at line 537 of file plotter.h.

Referenced by Marker().

◆ USE_DEFAULT_LINE_WIDTH


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