KiCad PCB EDA Suite
PLOTTER Class Referenceabstract

Base plotter engine class. More...

#include <plotter.h>

Inheritance diagram for PLOTTER:
DXF_PLOTTER GERBER_PLOTTER HPGL_PLOTTER PSLIKE_PLOTTER PDF_PLOTTER PS_PLOTTER SVG_PLOTTER

Public Member Functions

 PLOTTER ()
 
virtual ~PLOTTER ()
 
virtual PLOT_FORMAT GetPlotterType () const =0
 Returns the effective plot engine in use. More...
 
virtual bool StartPlot (const wxString &aPageNumber)=0
 
virtual bool EndPlot ()=0
 
virtual void SetNegative (bool aNegative)
 
virtual void SetColorMode (bool aColorMode)
 Plot in B/W or color. More...
 
bool GetColorMode () const
 
void SetRenderSettings (RENDER_SETTINGS *aSettings)
 
RENDER_SETTINGSRenderSettings ()
 
virtual void SetPageSettings (const PAGE_INFO &aPageSettings)
 
PAGE_INFOPageSettings ()
 
virtual void SetCurrentLineWidth (int width, void *aData=nullptr)=0
 Set the line width for the next drawing. More...
 
virtual int GetCurrentLineWidth () const
 
virtual void SetColor (const COLOR4D &color)=0
 
virtual void SetDash (int aLineWidth, PLOT_DASH_TYPE aLineStyle)=0
 
virtual void SetCreator (const wxString &aCreator)
 
virtual void SetTitle (const wxString &aTitle)
 
void AddLineToHeader (const wxString &aExtraString)
 Add a line to the list of free lines to print at the beginning of the file. More...
 
void ClearHeaderLinesList ()
 Remove all lines from the list of free lines to print at the beginning of the file. More...
 
virtual void SetViewport (const VECTOR2I &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
 Set the plot offset and scaling for the current plot. More...
 
virtual bool OpenFile (const wxString &aFullFilename)
 Open or create the plot file aFullFilename. More...
 
double GetIUsPerDecimil () const
 The IUs per decimil are an essential scaling factor when plotting; they are set and saved when establishing the viewport. More...
 
int GetPlotterArcLowDef () const
 
int GetPlotterArcHighDef () const
 
virtual void Rect (const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
 
virtual void Circle (const VECTOR2I &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
 
virtual void Arc (const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aEnd, FILL_T aFill, int aWidth, int aMaxError)
 Generic fallback: arc rendered as a polyline. More...
 
virtual void BezierCurve (const VECTOR2I &aStart, const VECTOR2I &aControl1, const VECTOR2I &aControl2, const VECTOR2I &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH)
 Generic fallback: Cubic Bezier curve rendered as a polyline In KiCad the bezier curves have 4 control points: start ctrl1 ctrl2 end. More...
 
virtual void PenTo (const VECTOR2I &pos, char plume)=0
 Moveto/lineto primitive, moves the 'pen' to the specified direction. More...
 
void MoveTo (const VECTOR2I &pos)
 
void LineTo (const VECTOR2I &pos)
 
void FinishTo (const VECTOR2I &pos)
 
void PenFinish ()
 
virtual void PlotPoly (const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=0
 Draw a polygon ( filled or not ). More...
 
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 ). More...
 
virtual void PlotImage (const wxImage &aImage, const VECTOR2I &aPos, double aScaleFactor)
 Only PostScript plotters can plot bitmaps. More...
 
virtual void ThickSegment (const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode, void *aData)
 
virtual void ThickArc (const VECTOR2I &aCentre, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, OUTLINE_MODE aTraceMode, void *aData)
 
virtual void ThickArc (const EDA_SHAPE &aArcShape, 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 FlashPadCircle (const VECTOR2I &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData)=0
 
virtual void FlashPadOval (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
 
virtual void FlashPadRect (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
 
virtual void FlashPadRoundRect (const VECTOR2I &aPadPos, const VECTOR2I &aSize, int aCornerRadius, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData)=0
 
virtual void FlashPadCustom (const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData)=0
 
virtual void FlashPadTrapez (const VECTOR2I &aPadPos, const VECTOR2I *aCorners, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
 Flash a trapezoidal pad. More...
 
virtual void FlashRegularPolygon (const VECTOR2I &aShapePos, int aDiameter, int aCornerCount, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData)=0
 Flash a regular polygon. More...
 
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, void *aData=nullptr)
 Draw text with the plotter. More...
 
virtual void PlotText (const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr)
 
virtual void HyperlinkBox (const BOX2I &aBox, const wxString &aDestinationURL)
 Create a clickable hyperlink with a rectangular click area. More...
 
virtual void HyperlinkMenu (const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
 Create a clickable hyperlink menu with a rectangular click area. More...
 
virtual void Bookmark (const BOX2I &aBox, const wxString &aName, const wxString &aGroupName=wxEmptyString)
 Create a bookmark to a symbol. More...
 
void Marker (const VECTOR2I &position, int diametre, unsigned aShapeId)
 Draw a pattern shape number aShapeId, to coord position. More...
 
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. More...
 
virtual void SetTextMode (PLOT_TEXT_MODE mode)
 Change the current text mode. More...
 
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. More...
 
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. More...
 
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. More...
 

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). More...
 

Protected Member Functions

virtual void Arc (const VECTOR2I &aCentre, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aEndAngle, int aRadius, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH)
 Generic fallback: arc rendered as a polyline. More...
 
virtual void ThickArc (const VECTOR2I &aCentre, const EDA_ANGLE &StAngle, const EDA_ANGLE &EndAngle, int aRadius, int aWidth, OUTLINE_MODE aTraceMode, void *aData)
 
void markerCircle (const VECTOR2I &pos, int radius)
 Plot a circle centered on the position. More...
 
void markerHBar (const VECTOR2I &pos, int radius)
 Plot a - bar centered on the position. More...
 
void markerSlash (const VECTOR2I &pos, int radius)
 Plot a / bar centered on the position. More...
 
void markerBackSlash (const VECTOR2I &pos, int radius)
 Plot a \ bar centered on the position. More...
 
void markerVBar (const VECTOR2I &pos, int radius)
 Plot a | bar centered on the position. More...
 
void markerSquare (const VECTOR2I &position, int radius)
 Plot a square centered on the position. More...
 
void markerLozenge (const VECTOR2I &position, int radius)
 Plot a lozenge centered on the position. More...
 
void segmentAsOval (const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode)
 Convert a thick segment and plot it as an oval. More...
 
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. More...
 
virtual VECTOR2D userToDeviceSize (const VECTOR2I &size)
 Modify size according to the plotter scale factors (VECTOR2I version, returns a VECTOR2D). More...
 
virtual double userToDeviceSize (double size) const
 Modify size according to the plotter scale factors (simple double version). More...
 
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') More...
 
double m_IUsPerDecimil
 
double m_iuPerDeviceUnit
 
VECTOR2I m_plotOffset
 
bool m_plotMirror
 
bool m_mirrorIsHorizontal
 
bool m_yaxisReversed
 
FILE * m_outputFile
 Output file. More...
 
bool m_colorMode
 
bool m_negativeMode
 
int m_currentPenWidth
 
char m_penState
 
VECTOR2I m_penLastpos
 
wxString m_creator
 
wxString m_filename
 
wxString m_title
 
PAGE_INFO m_pageInfo
 
VECTOR2I m_paperSize
 
wxArrayString m_headerExtraLines
 
RENDER_SETTINGSm_renderSettings
 

Detailed Description

Base plotter engine class.

General rule: all the interface with the caller is done in IU, the IU size is specified with SetViewport. Internal and output processing is usually done in decimils (or whatever unit the effective engine class need to use)

Definition at line 109 of file plotter.h.

Constructor & Destructor Documentation

◆ PLOTTER()

PLOTTER::PLOTTER ( )

Definition at line 47 of file plotter.cpp.

48{
49 m_plotScale = 1;
50 m_currentPenWidth = -1; // To-be-set marker
51 m_penState = 'Z'; // End-of-path idle
52 m_plotMirror = false; // Plot mirror option flag
54 m_yaxisReversed = false;
55 m_outputFile = nullptr;
56 m_colorMode = false; // Starts as a BW plot
57 m_negativeMode = false;
58
59 // Temporary init to avoid not initialized vars, will be set later
60 m_IUsPerDecimil = 1; // will be set later to the actual value
61 m_iuPerDeviceUnit = 1; // will be set later to the actual value
62 m_renderSettings = nullptr;
63}
bool m_mirrorIsHorizontal
Definition: plotter.h:649
bool m_plotMirror
Definition: plotter.h:647
bool m_yaxisReversed
Definition: plotter.h:650
double m_iuPerDeviceUnit
Definition: plotter.h:644
char m_penState
Definition: plotter.h:659
int m_currentPenWidth
Definition: plotter.h:658
double m_plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plotter.h:636
FILE * m_outputFile
Output file.
Definition: plotter.h:653
RENDER_SETTINGS * m_renderSettings
Definition: plotter.h:670
bool m_negativeMode
Definition: plotter.h:657
double m_IUsPerDecimil
Definition: plotter.h:642
bool m_colorMode
Definition: plotter.h:656

References m_colorMode, m_currentPenWidth, m_iuPerDeviceUnit, m_IUsPerDecimil, m_mirrorIsHorizontal, m_negativeMode, m_outputFile, m_penState, m_plotMirror, m_plotScale, m_renderSettings, and m_yaxisReversed.

◆ ~PLOTTER()

PLOTTER::~PLOTTER ( )
virtual

Definition at line 66 of file plotter.cpp.

67{
68 // Emergency cleanup, but closing the file is usually made in EndPlot().
69 if( m_outputFile )
70 fclose( m_outputFile );
71}

References m_outputFile.

Member Function Documentation

◆ AddLineToHeader()

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

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

169 {
170 m_headerExtraLines.Add( aExtraString );
171 }
wxArrayString m_headerExtraLines
Definition: plotter.h:668

References m_headerExtraLines.

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

◆ Arc() [1/2]

void PLOTTER::Arc ( const VECTOR2I aCenter,
const VECTOR2I aStart,
const VECTOR2I aEnd,
FILL_T  aFill,
int  aWidth,
int  aMaxError 
)
virtual

Generic fallback: arc rendered as a polyline.

Reimplemented in HPGL_PLOTTER, PS_PLOTTER, and PDF_PLOTTER.

Definition at line 149 of file plotter.cpp.

151{
152 EDA_ANGLE startAngle( aStart - aCenter );
153 EDA_ANGLE endAngle( aEnd - aCenter );
154 int radius = ( aStart - aCenter ).EuclideanNorm();
155
156 if( startAngle > endAngle )
157 {
158 if( endAngle < ANGLE_0 )
159 endAngle.Normalize();
160 else
161 startAngle = startAngle.Normalize() - ANGLE_360;
162 }
163
164 // In old Kicad code, calls to Arc() using angles calls this function after
165 // swapping angles and negate them (to compensate the inverted Y axis).
166 // So to be compatible with Arc() calls with angles, do the same thing
167 std::swap( startAngle, endAngle );
168 startAngle = -startAngle;
169 endAngle = -endAngle;
170
171 Arc( aCenter, startAngle, endAngle, radius, aFill, aWidth );
172}
virtual void Arc(const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aEnd, FILL_T aFill, int aWidth, int aMaxError)
Generic fallback: arc rendered as a polyline.
Definition: plotter.cpp:149
static constexpr EDA_ANGLE & ANGLE_360
Definition: eda_angle.h:435
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:429
double EuclideanNorm(const VECTOR2I &vector)
Definition: trigo.h:129

References ANGLE_0, ANGLE_360, Arc(), EuclideanNorm(), and EDA_ANGLE::Normalize().

Referenced by Arc(), SCH_SHAPE::Plot(), LIB_SHAPE::Plot(), sketchOval(), and ThickArc().

◆ Arc() [2/2]

void PLOTTER::Arc ( const VECTOR2I aCentre,
const EDA_ANGLE aStartAngle,
const EDA_ANGLE aEndAngle,
int  aRadius,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH 
)
protectedvirtual

Generic fallback: arc rendered as a polyline.

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

Definition at line 175 of file plotter.cpp.

177{
178 EDA_ANGLE startAngle( aStartAngle );
179 EDA_ANGLE endAngle( aEndAngle );
180 const EDA_ANGLE delta( 5.0, DEGREES_T ); // increment to draw arc
181 VECTOR2I start, end;
182 const int sign = -1;
183
184 if( startAngle > endAngle )
185 std::swap( startAngle, endAngle );
186
187 SetCurrentLineWidth( aWidth );
188
189 start.x = aCenter.x + KiROUND( aRadius * startAngle.Cos() );
190 start.y = aCenter.y + sign*KiROUND( aRadius * startAngle.Sin() );
191
192 if( aFill != FILL_T::NO_FILL )
193 {
194 MoveTo( aCenter );
195 LineTo( start );
196 }
197 else
198 {
199 MoveTo( start );
200 }
201
202 for( EDA_ANGLE ii = startAngle + delta; ii < endAngle; ii += delta )
203 {
204 end.x = aCenter.x + KiROUND( aRadius * ii.Cos() );
205 end.y = aCenter.y + sign*KiROUND( aRadius * ii.Sin() );
206 LineTo( end );
207 }
208
209 end.x = aCenter.x + KiROUND( aRadius * endAngle.Cos() );
210 end.y = aCenter.y + sign*KiROUND( aRadius * endAngle.Sin() );
211
212 if( aFill != FILL_T::NO_FILL )
213 {
214 LineTo( end );
215 FinishTo( aCenter );
216 }
217 else
218 {
219 FinishTo( end );
220 }
221}
void MoveTo(const VECTOR2I &pos)
Definition: plotter.h:247
void FinishTo(const VECTOR2I &pos)
Definition: plotter.h:257
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
void LineTo(const VECTOR2I &pos)
Definition: plotter.h:252
@ DEGREES_T
Definition: eda_angle.h:31
constexpr int delta
int sign(T val)
Definition: util.h:124
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:85

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

◆ BezierCurve()

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

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

227{
228 // Generic fallback: Quadratic Bezier curve plotted as a polyline
229 int minSegLen = aLineThickness; // The segment min length to approximate a bezier curve
230
231 std::vector<VECTOR2I> ctrlPoints;
232 ctrlPoints.reserve( 4 );
233
234 ctrlPoints.push_back( aStart );
235 ctrlPoints.push_back( aControl1 );
236 ctrlPoints.push_back( aControl2 );
237 ctrlPoints.push_back( aEnd );
238
239 BEZIER_POLY bezier_converter( ctrlPoints );
240
241 std::vector<VECTOR2I> approxPoints;
242 bezier_converter.GetPoly( approxPoints, minSegLen );
243
244 SetCurrentLineWidth( aLineThickness );
245 MoveTo( aStart );
246
247 for( unsigned ii = 1; ii < approxPoints.size()-1; ii++ )
248 LineTo( approxPoints[ii] );
249
250 FinishTo( aEnd );
251}
Bezier curves to polygon converter.
Definition: bezier_curves.h:38

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

Referenced by SVG_PLOTTER::BezierCurve(), BRDITEMS_PLOTTER::PlotFootprintShape(), and BRDITEMS_PLOTTER::PlotPcbShape().

◆ Bookmark()

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

Create a bookmark to a symbol.

@aBox is the bounding box of the symbol @aSymbolReference is the symbol schematic ref

Reimplemented in PDF_PLOTTER.

Definition at line 477 of file plotter.h.

479 {
480 // NOP for most plotters.
481 }

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

◆ Circle()

◆ ClearHeaderLinesList()

void PLOTTER::ClearHeaderLinesList ( )
inline

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

Definition at line 176 of file plotter.h.

177 {
178 m_headerExtraLines.Clear();
179 }

References m_headerExtraLines.

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

◆ EndBlock()

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

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

547{}

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

◆ EndPlot()

◆ FilledCircle()

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

Reimplemented in GERBER_PLOTTER.

Definition at line 668 of file plotter.cpp.

669{
670 if( tracemode == FILLED )
671 {
672 Circle( pos, diametre, FILL_T::FILLED_SHAPE, 0 );
673 }
674 else
675 {
677 Circle( pos, diametre, FILL_T::NO_FILL, -1 );
678 }
679}
virtual void Circle(const VECTOR2I &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
@ FILLED_SHAPE
@ FILLED
Definition: outline_mode.h:27

References Circle(), FILLED, FILLED_SHAPE, NO_FILL, and SetCurrentLineWidth().

Referenced by BRDITEMS_PLOTTER::PlotFootprintShape(), and BRDITEMS_PLOTTER::PlotPcbShape().

◆ FinishTo()

◆ FlashPadCircle()

virtual void PLOTTER::FlashPadCircle ( const VECTOR2I aPadPos,
int  aDiameter,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual
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).

Implemented in HPGL_PLOTTER, PSLIKE_PLOTTER, DXF_PLOTTER, and GERBER_PLOTTER.

Referenced by BRDITEMS_PLOTTER::plotOneDrillMark(), BRDITEMS_PLOTTER::PlotPad(), and PlotStandardLayer().

◆ FlashPadCustom()

virtual void PLOTTER::FlashPadCustom ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
const EDA_ANGLE aPadOrient,
SHAPE_POLY_SET aPolygons,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual
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).

Implemented in DXF_PLOTTER, HPGL_PLOTTER, PSLIKE_PLOTTER, and GERBER_PLOTTER.

Referenced by BRDITEMS_PLOTTER::PlotPad().

◆ FlashPadOval()

virtual void PLOTTER::FlashPadOval ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
const EDA_ANGLE aPadOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual
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).

Implemented in GERBER_PLOTTER, HPGL_PLOTTER, PSLIKE_PLOTTER, and DXF_PLOTTER.

Referenced by GENDRILL_WRITER_BASE::plotDrillMarks(), BRDITEMS_PLOTTER::plotOneDrillMark(), BRDITEMS_PLOTTER::PlotPad(), and segmentAsOval().

◆ FlashPadRect()

virtual void PLOTTER::FlashPadRect ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
const EDA_ANGLE aPadOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual
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).

Implemented in GERBER_PLOTTER, HPGL_PLOTTER, PSLIKE_PLOTTER, and DXF_PLOTTER.

Referenced by BRDITEMS_PLOTTER::PlotPad().

◆ FlashPadRoundRect()

virtual void PLOTTER::FlashPadRoundRect ( const VECTOR2I aPadPos,
const VECTOR2I aSize,
int  aCornerRadius,
const EDA_ANGLE aOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual
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).

Implemented in DXF_PLOTTER, GERBER_PLOTTER, HPGL_PLOTTER, and PSLIKE_PLOTTER.

Referenced by BRDITEMS_PLOTTER::PlotPad().

◆ FlashPadTrapez()

virtual void PLOTTER::FlashPadTrapez ( const VECTOR2I aPadPos,
const VECTOR2I aCorners,
const EDA_ANGLE aPadOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual

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).

Implemented in DXF_PLOTTER, GERBER_PLOTTER, HPGL_PLOTTER, and PSLIKE_PLOTTER.

Referenced by BRDITEMS_PLOTTER::PlotPad().

◆ FlashRegularPolygon()

virtual void PLOTTER::FlashRegularPolygon ( const VECTOR2I aShapePos,
int  aDiameter,
int  aCornerCount,
const EDA_ANGLE aOrient,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
pure virtual

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.

Implemented in DXF_PLOTTER, GERBER_PLOTTER, HPGL_PLOTTER, and PSLIKE_PLOTTER.

◆ GetColorMode()

◆ GetCurrentLineWidth()

◆ GetDashGapLenIU()

double PLOTTER::GetDashGapLenIU ( int  aLineWidth) const
protected

Definition at line 143 of file plotter.cpp.

144{
145 return userToDeviceSize( m_renderSettings->GetGapLength( aLineWidth ) );
146}
double GetGapLength(int aLineWidth) const
virtual VECTOR2D userToDeviceSize(const VECTOR2I &size)
Modify size according to the plotter scale factors (VECTOR2I version, returns a VECTOR2D).
Definition: plotter.cpp:115

References KIGFX::RENDER_SETTINGS::GetGapLength(), m_renderSettings, and userToDeviceSize().

Referenced by PS_PLOTTER::SetDash(), PDF_PLOTTER::SetDash(), and SVG_PLOTTER::setSVGPlotStyle().

◆ GetDashMarkLenIU()

double PLOTTER::GetDashMarkLenIU ( int  aLineWidth) const
protected

◆ GetDotMarkLenIU()

double PLOTTER::GetDotMarkLenIU ( int  aLineWidth) const
protected

◆ GetIUsPerDecimil()

double PLOTTER::GetIUsPerDecimil ( ) const
inline

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

210{ return m_IUsPerDecimil; }

References m_IUsPerDecimil.

Referenced by PlotDrawingSheet().

◆ GetPlotterArcHighDef()

◆ GetPlotterArcLowDef()

int PLOTTER::GetPlotterArcLowDef ( ) const
inline

Definition at line 212 of file plotter.h.

212{ return m_IUsPerDecimil * 8; }

References m_IUsPerDecimil.

◆ GetPlotterType()

virtual PLOT_FORMAT PLOTTER::GetPlotterType ( ) const
pure virtual

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

Implemented in DXF_PLOTTER, GERBER_PLOTTER, HPGL_PLOTTER, PS_PLOTTER, PDF_PLOTTER, and SVG_PLOTTER.

Referenced by GENDRILL_WRITER_BASE::genDrillMapFile(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotFootprintShape(), PlotOneBoardLayer(), BRDITEMS_PLOTTER::PlotPad(), BRDITEMS_PLOTTER::PlotPcbShape(), and StartPlotBoard().

◆ HyperlinkBox()

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

Create a clickable hyperlink with a rectangular click area.

@aBox is the rectangular click target @aDestinationURL is the target URL

Reimplemented in PDF_PLOTTER.

Definition at line 455 of file plotter.h.

456 {
457 // NOP for most plotters.
458 }

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

◆ HyperlinkMenu()

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

Create a clickable hyperlink menu with a rectangular click area.

@aBox is the rectangular click target @aDestURLs is the list of target URLs for the menu

Reimplemented in PDF_PLOTTER.

Definition at line 466 of file plotter.h.

467 {
468 // NOP for most plotters.
469 }

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 
)

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

360{
361 int radius = diametre / 2;
362
363 /* Marker are composed by a series of 'parts' superimposed; not every
364 combination make sense, obviously. Since they are used in order I
365 tried to keep the uglier/more complex constructions at the end.
366 Also I avoided the |/ |\ -/ -\ construction because they're *very*
367 ugly... if needed they could be added anyway... I'd like to see
368 a board with more than 58 drilling/slotting tools!
369 If Visual C++ supported the 0b literals they would be optimally
370 and easily encoded as an integer array. We have to do with octal */
371 static const unsigned char marker_patterns[MARKER_COUNT] = {
372
373 // Bit order: O Square Lozenge - | \ /
374 // First choice: simple shapes
375 0003, // X
376 0100, // O
377 0014, // +
378 0040, // Sq
379 0020, // Lz
380
381 // Two simple shapes
382 0103, // X O
383 0017, // X +
384 0043, // X Sq
385 0023, // X Lz
386 0114, // O +
387 0140, // O Sq
388 0120, // O Lz
389 0054, // + Sq
390 0034, // + Lz
391 0060, // Sq Lz
392
393 // Three simple shapes
394 0117, // X O +
395 0143, // X O Sq
396 0123, // X O Lz
397 0057, // X + Sq
398 0037, // X + Lz
399 0063, // X Sq Lz
400 0154, // O + Sq
401 0134, // O + Lz
402 0074, // + Sq Lz
403
404 // Four simple shapes
405 0174, // O Sq Lz +
406 0163, // X O Sq Lz
407 0157, // X O Sq +
408 0137, // X O Lz +
409 0077, // X Sq Lz +
410
411 // This draws *everything *
412 0177, // X O Sq Lz +
413
414 // Here we use the single bars... so the cross is forbidden
415 0110, // O -
416 0104, // O |
417 0101, // O /
418 0050, // Sq -
419 0044, // Sq |
420 0041, // Sq /
421 0030, // Lz -
422 0024, // Lz |
423 0021, // Lz /
424 0150, // O Sq -
425 0144, // O Sq |
426 0141, // O Sq /
427 0130, // O Lz -
428 0124, // O Lz |
429 0121, // O Lz /
430 0070, // Sq Lz -
431 0064, // Sq Lz |
432 0061, // Sq Lz /
433 0170, // O Sq Lz -
434 0164, // O Sq Lz |
435 0161, // O Sq Lz /
436
437 // Last resort: the backlash component (easy to confound)
438 0102, // \ O
439 0042, // \ Sq
440 0022, // \ Lz
441 0142, // \ O Sq
442 0122, // \ O Lz
443 0062, // \ Sq Lz
444 0162 // \ O Sq Lz
445 };
446
447 if( aShapeId >= MARKER_COUNT )
448 {
449 // Fallback shape
450 markerCircle( position, radius );
451 }
452 else
453 {
454 // Decode the pattern and draw the corresponding parts
455 unsigned char pat = marker_patterns[aShapeId];
456
457 if( pat & 0001 )
458 markerSlash( position, radius );
459
460 if( pat & 0002 )
461 markerBackSlash( position, radius );
462
463 if( pat & 0004 )
464 markerVBar( position, radius );
465
466 if( pat & 0010 )
467 markerHBar( position, radius );
468
469 if( pat & 0020 )
470 markerLozenge( position, radius );
471
472 if( pat & 0040 )
473 markerSquare( position, radius );
474
475 if( pat & 0100 )
476 markerCircle( position, radius );
477 }
478}
static const unsigned MARKER_COUNT
Draw a marker (used for the drill map).
Definition: plotter.h:486
void markerSlash(const VECTOR2I &pos, int radius)
Plot a / bar centered on the position.
Definition: plotter.cpp:338
void markerHBar(const VECTOR2I &pos, int radius)
Plot a - bar centered on the position.
Definition: plotter.cpp:331
void markerCircle(const VECTOR2I &pos, int radius)
Plot a circle centered on the position.
Definition: plotter.cpp:298
void markerLozenge(const VECTOR2I &position, int radius)
Plot a lozenge centered on the position.
Definition: plotter.cpp:304
void markerBackSlash(const VECTOR2I &pos, int radius)
Plot a \ bar centered on the position.
Definition: plotter.cpp:345
void markerVBar(const VECTOR2I &pos, int radius)
Plot a | bar centered on the position.
Definition: plotter.cpp:352
void markerSquare(const VECTOR2I &position, int radius)
Plot a square centered on the position.
Definition: plotter.cpp:270

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

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

◆ markerBackSlash()

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

Plot a \ bar centered on the position.

Building block for markers

Definition at line 345 of file plotter.cpp.

346{
347 MoveTo( VECTOR2I( pos.x + radius, pos.y - radius ) );
348 FinishTo( VECTOR2I( pos.x - radius, pos.y + radius ) );
349}
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590

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

Referenced by Marker().

◆ markerCircle()

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

Plot a circle centered on the position.

Building block for markers

Definition at line 298 of file plotter.cpp.

299{
300 Circle( position, radius * 2, FILL_T::NO_FILL, GetCurrentLineWidth() );
301}
virtual int GetCurrentLineWidth() const
Definition: plotter.h:153

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

Referenced by Marker().

◆ markerHBar()

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

Plot a - bar centered on the position.

Building block for markers

Definition at line 331 of file plotter.cpp.

332{
333 MoveTo( VECTOR2I( pos.x - radius, pos.y ) );
334 FinishTo( VECTOR2I( pos.x + radius, pos.y ) );
335}

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

Referenced by Marker().

◆ markerLozenge()

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

Plot a lozenge centered on the position.

Building block for markers

Definition at line 304 of file plotter.cpp.

305{
306 std::vector<VECTOR2I> corner_list;
307 VECTOR2I corner;
308
309 corner_list.reserve( 4 );
310
311 corner.x = position.x;
312 corner.y = position.y + radius;
313 corner_list.push_back( corner );
314 corner.x = position.x + radius;
315 corner.y = position.y,
316 corner_list.push_back( corner );
317 corner.x = position.x;
318 corner.y = position.y - radius;
319 corner_list.push_back( corner );
320 corner.x = position.x - radius;
321 corner.y = position.y;
322 corner_list.push_back( corner );
323 corner.x = position.x;
324 corner.y = position.y + radius;
325 corner_list.push_back( corner );
326
328}
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=0
Draw a polygon ( filled or not ).

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

Referenced by Marker().

◆ markerSlash()

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

Plot a / bar centered on the position.

Building block for markers

Definition at line 338 of file plotter.cpp.

339{
340 MoveTo( VECTOR2I( pos.x - radius, pos.y - radius ) );
341 FinishTo( VECTOR2I( pos.x + radius, pos.y + radius ) );
342}

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

Referenced by Marker().

◆ markerSquare()

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

Plot a square centered on the position.

Building block for markers

Definition at line 270 of file plotter.cpp.

271{
272 double r = KiROUND( radius / 1.4142 );
273 std::vector<VECTOR2I> corner_list;
274 VECTOR2I corner;
275
276 corner_list.reserve( 4 );
277
278 corner.x = position.x + r;
279 corner.y = position.y + r;
280 corner_list.push_back( corner );
281 corner.x = position.x + r;
282 corner.y = position.y - r;
283 corner_list.push_back( corner );
284 corner.x = position.x - r;
285 corner.y = position.y - r;
286 corner_list.push_back( corner );
287 corner.x = position.x - r;
288 corner.y = position.y + r;
289 corner_list.push_back( corner );
290 corner.x = position.x + r;
291 corner.y = position.y + r;
292 corner_list.push_back( corner );
293
295}

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

Referenced by Marker().

◆ markerVBar()

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

Plot a | bar centered on the position.

Building block for markers

Definition at line 352 of file plotter.cpp.

353{
354 MoveTo( VECTOR2I( pos.x, pos.y - radius ) );
355 FinishTo( VECTOR2I( pos.x, pos.y + radius ) );
356}

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

Referenced by Marker().

◆ MoveTo()

◆ OpenFile()

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

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

75{
76 m_filename = aFullFilename;
77
78 wxASSERT( !m_outputFile );
79
80 // Open the file in text mode (not suitable for all plotters but only for most of them.
81 m_outputFile = wxFopen( m_filename, wxT( "wt" ) );
82
83 if( m_outputFile == nullptr )
84 return false ;
85
86 return true;
87}
wxString m_filename
Definition: plotter.h:663

References m_filename, and 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 ( )
inline

Definition at line 144 of file plotter.h.

144{ return m_pageInfo; }
PAGE_INFO m_pageInfo
Definition: plotter.h:665

References m_pageInfo.

Referenced by SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), and SCH_PLOTTER::plotOneSheetSVG().

◆ PenFinish()

void PLOTTER::PenFinish ( )
inline

Definition at line 263 of file plotter.h.

264 {
265 // The point is not important with Z motion
266 PenTo( VECTOR2I( 0, 0 ), 'Z' );
267 }

References PenTo().

Referenced by HPGL_PLOTTER::Circle(), HPGL_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::PlotPoly(), DXF_PLOTTER::PlotPoly(), HPGL_PLOTTER::PlotPoly(), PlotText(), HPGL_PLOTTER::Rect(), and Text().

◆ PenTo()

virtual void PLOTTER::PenTo ( const VECTOR2I pos,
char  plume 
)
pure virtual

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).

Implemented in DXF_PLOTTER, GERBER_PLOTTER, HPGL_PLOTTER, PS_PLOTTER, PDF_PLOTTER, and SVG_PLOTTER.

Referenced by FinishTo(), LineTo(), MoveTo(), and PenFinish().

◆ PlotImage()

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

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 PS_PLOTTER, PDF_PLOTTER, and SVG_PLOTTER.

Definition at line 254 of file plotter.cpp.

255{
256 VECTOR2I size( aImage.GetWidth() * aScaleFactor, aImage.GetHeight() * aScaleFactor );
257
258 VECTOR2I start = aPos;
259 start.x -= size.x / 2;
260 start.y -= size.y / 2;
261
262 VECTOR2I end = start;
263 end.x += size.x;
264 end.y += size.y;
265
266 Rect( start, end, FILL_T::NO_FILL );
267}
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0

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

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

◆ PlotPoly() [1/2]

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

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

683{
684 std::vector<VECTOR2I> cornerList;
685 cornerList.reserve( aCornerList.PointCount() );
686
687 for( int ii = 0; ii < aCornerList.PointCount(); ii++ )
688 cornerList.emplace_back( aCornerList.CPoint( ii ) );
689
690 if( aCornerList.IsClosed() && cornerList.front() != cornerList.back() )
691 cornerList.emplace_back( aCornerList.CPoint( 0 ) );
692
693 PlotPoly( cornerList, aFill, aWidth, aData );
694}
bool IsClosed() const override
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.

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

◆ PlotPoly() [2/2]

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

◆ PlotText()

void PLOTTER::PlotText ( const VECTOR2I aPos,
const COLOR4D aColor,
const wxString &  aText,
const TEXT_ATTRIBUTES aAttributes,
KIFONT::FONT aFont,
void *  aData = nullptr 
)
virtual

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

Definition at line 758 of file plotter.cpp.

763{
765
766 TEXT_ATTRIBUTES attributes = aAttributes;
767 int penWidth = attributes.m_StrokeWidth;
768
769 SetColor( aColor );
770 SetCurrentLineWidth( penWidth, aData );
771
772 if( penWidth == 0 && attributes.m_Bold ) // Use default values if aPenWidth == 0
773 penWidth = GetPenSizeForBold( std::min( attributes.m_Size.x, attributes.m_Size.y ) );
774
775 if( penWidth < 0 )
776 penWidth = -penWidth;
777
778 attributes.m_StrokeWidth = penWidth;
779
780 CALLBACK_GAL callback_gal( empty_opts,
781 // Stroke callback
782 [&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2 )
783 {
784 MoveTo( aPt1 );
785 LineTo( aPt2 );
786 PenFinish();
787 },
788 // Polygon callback
789 [&]( const SHAPE_LINE_CHAIN& aPoly )
790 {
791 PlotPoly( aPoly, FILL_T::FILLED_SHAPE, 0, aData );
792 } );
793
794 if( !aFont )
795 aFont = KIFONT::FONT::GetFont();
796
797 aFont->Draw( &callback_gal, aText, aPos, attributes );
798}
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
Definition: font.cpp:138
void Draw(KIGFX::GAL *aGal, const wxString &aText, const VECTOR2I &aPosition, const VECTOR2I &aCursor, const TEXT_ATTRIBUTES &aAttrs) const
Draw a string.
Definition: font.cpp:232
void PenFinish()
Definition: plotter.h:263
virtual void SetColor(const COLOR4D &color)=0
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int GetPenSizeForBold(int aTextSize)
Definition: gr_text.cpp:40

References KIFONT::FONT::Draw(), FILLED_SHAPE, KIFONT::FONT::GetFont(), GetPenSizeForBold(), LineTo(), TEXT_ATTRIBUTES::m_Bold, TEXT_ATTRIBUTES::m_Size, TEXT_ATTRIBUTES::m_StrokeWidth, MoveTo(), PenFinish(), PlotPoly(), SetColor(), SetCurrentLineWidth(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by GENDRILL_WRITER_BASE::genDrillMapFile(), SCH_FIELD::Plot(), SCH_LABEL_BASE::Plot(), SCH_TEXT::Plot(), SCH_TEXTBOX::Plot(), LIB_FIELD::Plot(), LIB_TEXT::Plot(), LIB_TEXTBOX::Plot(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BRDITEMS_PLOTTER::PlotPcbText(), LIB_PIN::PlotPinTexts(), DXF_PLOTTER::PlotText(), GERBER_PLOTTER::PlotText(), and PS_PLOTTER::PlotText().

◆ Rect()

◆ RenderSettings()

◆ segmentAsOval()

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

Convert a thick segment and plot it as an oval.

Definition at line 481 of file plotter.cpp.

483{
484 VECTOR2I center( ( start.x + end.x ) / 2, ( start.y + end.y ) / 2 );
485 VECTOR2I size( end.x - start.x, end.y - start.y );
486 EDA_ANGLE orient( size );
487 orient = -orient; // this is due to our Y axis orientation
488
489 size.x = KiROUND( EuclideanNorm( size ) ) + aWidth;
490 size.y = aWidth;
491
492 FlashPadOval( center, size, orient, aTraceMode, nullptr );
493}
virtual void FlashPadOval(const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0

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

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

◆ SetColor()

◆ SetColorMode()

virtual void PLOTTER::SetColorMode ( bool  aColorMode)
inlinevirtual

◆ SetCreator()

◆ SetCurrentLineWidth()

◆ SetDash()

virtual void PLOTTER::SetDash ( int  aLineWidth,
PLOT_DASH_TYPE  aLineStyle 
)
pure virtual

◆ SetGerberCoordinatesFormat()

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

Reimplemented in GERBER_PLOTTER.

Definition at line 520 of file plotter.h.

521 {
522 // NOP for most plotters. Only for Gerber plotter
523 }

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

◆ SetLayerPolarity()

virtual void PLOTTER::SetLayerPolarity ( bool  aPositive)
inlinevirtual

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

507 {
508 // NOP for most plotters
509 }

Referenced by PlotOneBoardLayer().

◆ SetNegative()

virtual void PLOTTER::SetNegative ( bool  aNegative)
inlinevirtual

Definition at line 130 of file plotter.h.

130{ m_negativeMode = aNegative; }

References m_negativeMode.

Referenced by FillNegativeKnockout().

◆ SetPageSettings()

◆ SetRenderSettings()

◆ SetSvgCoordinatesFormat()

virtual void PLOTTER::SetSvgCoordinatesFormat ( unsigned  aPrecision)
inlinevirtual

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

Reimplemented in SVG_PLOTTER.

Definition at line 526 of file plotter.h.

527 {
528 // NOP for most plotters. Only for SVG plotter
529 }

Referenced by initializePlotter().

◆ SetTextMode()

virtual void PLOTTER::SetTextMode ( PLOT_TEXT_MODE  mode)
inlinevirtual

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

516 {
517 // NOP for most plotters.
518 }

Referenced by initializePlotter(), and PlotOneBoardLayer().

◆ SetTitle()

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

Definition at line 161 of file plotter.h.

161{ m_title = aTitle; }
wxString m_title
Definition: plotter.h:664

References m_title.

Referenced by SCH_PLOTTER::createPDFFile().

◆ SetViewport()

virtual void PLOTTER::SetViewport ( const VECTOR2I aOffset,
double  aIusPerDecimil,
double  aScale,
bool  aMirror 
)
pure virtual

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).

Implemented in DXF_PLOTTER, GERBER_PLOTTER, HPGL_PLOTTER, PS_PLOTTER, PDF_PLOTTER, and SVG_PLOTTER.

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

◆ sketchOval()

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

Definition at line 496 of file plotter.cpp.

498{
499 SetCurrentLineWidth( aWidth );
500
501 EDA_ANGLE orient( aOrient );
502 VECTOR2I size( aSize );
503
504 if( size.x > size.y )
505 {
506 std::swap( size.x, size.y );
507 orient += ANGLE_90;
508 }
509
510 int deltaxy = size.y - size.x; /* distance between centers of the oval */
511 int radius = size.x / 2;
512
513 // Build a vertical oval shape giving the start and end points of arcs and edges,
514 // and the middle point of arcs
515 std::vector<VECTOR2I> corners;
516 corners.reserve( 6 );
517 // Shape is (x = corner and arc ends, c = arc centre)
518 // xcx
519 //
520 // xcx
521 int half_height = deltaxy / 2;
522 corners.emplace_back( -radius, -half_height );
523 corners.emplace_back( -radius, half_height );
524 corners.emplace_back( 0, half_height );
525 corners.emplace_back( radius, half_height );
526 corners.emplace_back( radius, -half_height );
527 corners.emplace_back( 0, -half_height );
528
529 // Rotate and move to the actual position
530 for( size_t ii = 0; ii < corners.size(); ii++ )
531 {
532 RotatePoint( corners[ii], orient );
533 corners[ii] += aPos;
534 }
535
536 // Gen shape:
537 MoveTo( corners[0] );
538 FinishTo( corners[1] );
539
540 Arc( corners[2], orient + ANGLE_180, orient + ANGLE_360, radius, FILL_T::NO_FILL );
541
542 MoveTo( corners[3] );
543 FinishTo( corners[4] );
544
545 Arc( corners[5], orient, orient + ANGLE_180, radius, FILL_T::NO_FILL );
546}
static constexpr EDA_ANGLE & ANGLE_180
Definition: eda_angle.h:433
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:431
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183

References ANGLE_180, ANGLE_360, ANGLE_90, Arc(), FinishTo(), MoveTo(), NO_FILL, RotatePoint(), SetCurrentLineWidth(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by GERBER_PLOTTER::FlashPadOval(), HPGL_PLOTTER::FlashPadOval(), PSLIKE_PLOTTER::FlashPadOval(), and DXF_PLOTTER::FlashPadOval().

◆ StartBlock()

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

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

538{}

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

◆ StartPlot()

virtual bool PLOTTER::StartPlot ( const wxString &  aPageNumber)
pure virtual

◆ 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,
void *  aData = nullptr 
)
virtual

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, PS_PLOTTER, PDF_PLOTTER, and SVG_PLOTTER.

Definition at line 697 of file plotter.cpp.

710{
712
713 SetColor( aColor );
714 SetCurrentLineWidth( aPenWidth, aData );
715
716 if( aPenWidth == 0 && aBold ) // Use default values if aPenWidth == 0
717 aPenWidth = GetPenSizeForBold( std::min( aSize.x, aSize.y ) );
718
719 if( aPenWidth < 0 )
720 aPenWidth = -aPenWidth;
721
722 CALLBACK_GAL callback_gal( empty_opts,
723 // Stroke callback
724 [&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2 )
725 {
726 MoveTo( aPt1 );
727 LineTo( aPt2 );
728 PenFinish();
729 },
730 // Polygon callback
731 [&]( const SHAPE_LINE_CHAIN& aPoly )
732 {
733 PlotPoly( aPoly, FILL_T::FILLED_SHAPE, 0, aData );
734 } );
735
736 TEXT_ATTRIBUTES attributes;
737 attributes.m_Angle = aOrient;
738 attributes.m_StrokeWidth = aPenWidth;
739 attributes.m_Italic = aItalic;
740 attributes.m_Bold = aBold;
741 attributes.m_Halign = aH_justify;
742 attributes.m_Valign = aV_justify;
743 attributes.m_Size = aSize;
744
745 // if Size.x is < 0, the text is mirrored (we have no other param to know a text is mirrored)
746 if( attributes.m_Size.x < 0 )
747 {
748 attributes.m_Size.x = -attributes.m_Size.x;
749 attributes.m_Mirrored = true;
750 }
751
752 if( !aFont )
753 aFont = KIFONT::FONT::GetFont();
754
755 aFont->Draw( &callback_gal, aText, aPos, attributes );
756}

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

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

◆ ThickArc() [1/3]

void PLOTTER::ThickArc ( const EDA_SHAPE aArcShape,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
virtual

Reimplemented in GERBER_PLOTTER.

Definition at line 620 of file plotter.cpp.

622{
623 ThickArc( aArcShape.getCenter(),aArcShape.GetStart(), aArcShape.GetEnd(),
624 aArcShape.GetWidth(), aTraceMode, aData );
625}
VECTOR2I getCenter() const
Definition: eda_shape.cpp:444
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:145
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition: eda_shape.h:120
int GetWidth() const
Definition: eda_shape.h:109
virtual void ThickArc(const VECTOR2I &aCentre, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, OUTLINE_MODE aTraceMode, void *aData)
Definition: plotter.cpp:592

References EDA_SHAPE::getCenter(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), EDA_SHAPE::GetWidth(), and ThickArc().

◆ ThickArc() [2/3]

void PLOTTER::ThickArc ( const VECTOR2I aCentre,
const EDA_ANGLE StAngle,
const EDA_ANGLE EndAngle,
int  aRadius,
int  aWidth,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
protectedvirtual

Reimplemented in GERBER_PLOTTER.

Definition at line 573 of file plotter.cpp.

576{
577 if( aTraceMode == FILLED )
578 {
579 Arc( centre, aStartAngle, aEndAngle, aRadius, FILL_T::NO_FILL, aWidth );
580 }
581 else
582 {
584 Arc( centre, aStartAngle, aEndAngle, aRadius - ( aWidth - m_currentPenWidth ) / 2,
585 FILL_T::NO_FILL, -1 );
586 Arc( centre, aStartAngle, aEndAngle, aRadius + ( aWidth - m_currentPenWidth ) / 2,
587 FILL_T::NO_FILL, -1 );
588 }
589}

References Arc(), FILLED, m_currentPenWidth, NO_FILL, and SetCurrentLineWidth().

◆ ThickArc() [3/3]

void PLOTTER::ThickArc ( const VECTOR2I aCentre,
const VECTOR2I aStart,
const VECTOR2I aEnd,
int  aWidth,
OUTLINE_MODE  aTraceMode,
void *  aData 
)
virtual

Reimplemented in GERBER_PLOTTER.

Definition at line 592 of file plotter.cpp.

595{
596 if( aTraceMode == FILLED )
597 {
598 Arc( aCentre, aStart, aEnd, FILL_T::NO_FILL, aWidth, GetPlotterArcHighDef() );
599 }
600 else
601 {
603 int radius = ( aStart - aCentre ).EuclideanNorm();
604
605 int new_radius = radius - ( aWidth - m_currentPenWidth ) / 2;
606 VECTOR2I start = ( aStart - aCentre ).Resize( new_radius ) + aCentre;
607 VECTOR2I end = ( aEnd - aCentre ).Resize( new_radius ) + aCentre;
608
609 Arc( aCentre, start, end, FILL_T::NO_FILL, -1, GetPlotterArcHighDef() );
610
611 new_radius = radius + ( aWidth - m_currentPenWidth ) / 2;
612 start = ( aStart - aCentre ).Resize( new_radius ) + aCentre;
613 end = ( aEnd - aCentre ).Resize( new_radius ) + aCentre;
614
615 Arc( aCentre, start, end, FILL_T::NO_FILL, -1, GetPlotterArcHighDef() );
616 }
617}
int GetPlotterArcHighDef() const
Definition: plotter.h:213

References Arc(), EuclideanNorm(), FILLED, GetPlotterArcHighDef(), m_currentPenWidth, NO_FILL, and SetCurrentLineWidth().

Referenced by BRDITEMS_PLOTTER::PlotFootprintShape(), BRDITEMS_PLOTTER::PlotPcbShape(), PlotStandardLayer(), and ThickArc().

◆ ThickCircle()

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

Reimplemented in GERBER_PLOTTER.

Definition at line 652 of file plotter.cpp.

654{
655 if( tracemode == FILLED )
656 {
657 Circle( pos, diametre, FILL_T::NO_FILL, width );
658 }
659 else
660 {
662 Circle( pos, diametre - width + m_currentPenWidth, FILL_T::NO_FILL, -1 );
663 Circle( pos, diametre + width - m_currentPenWidth, FILL_T::NO_FILL, -1 );
664 }
665}

References Circle(), FILLED, m_currentPenWidth, NO_FILL, and SetCurrentLineWidth().

Referenced by BRDITEMS_PLOTTER::PlotFootprintShape(), and BRDITEMS_PLOTTER::PlotPcbShape().

◆ ThickRect()

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

Reimplemented in GERBER_PLOTTER.

Definition at line 628 of file plotter.cpp.

630{
631 if( tracemode == FILLED )
632 {
633 Rect( p1, p2, FILL_T::NO_FILL, width );
634 }
635 else
636 {
638 VECTOR2I offsetp1( p1.x - ( width - m_currentPenWidth ) / 2,
639 p1.y - (width - m_currentPenWidth) / 2 );
640 VECTOR2I offsetp2( p2.x + ( width - m_currentPenWidth ) / 2,
641 p2.y + (width - m_currentPenWidth) / 2 );
642 Rect( offsetp1, offsetp2, FILL_T::NO_FILL, -1 );
643 offsetp1.x += ( width - m_currentPenWidth );
644 offsetp1.y += ( width - m_currentPenWidth );
645 offsetp2.x -= ( width - m_currentPenWidth );
646 offsetp2.y -= ( width - m_currentPenWidth );
647 Rect( offsetp1, offsetp2, FILL_T::NO_FILL, -1 );
648 }
649}

References FILLED, m_currentPenWidth, NO_FILL, Rect(), SetCurrentLineWidth(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ ThickSegment()

void PLOTTER::ThickSegment ( const VECTOR2I start,
const VECTOR2I end,
int  width,
OUTLINE_MODE  tracemode,
void *  aData 
)
virtual

Reimplemented in DXF_PLOTTER, GERBER_PLOTTER, and HPGL_PLOTTER.

Definition at line 549 of file plotter.cpp.

551{
552 if( tracemode == FILLED )
553 {
554 if( start == end )
555 {
556 Circle( start, width, FILL_T::FILLED_SHAPE, 0 );
557 }
558 else
559 {
560 SetCurrentLineWidth( width );
561 MoveTo( start );
562 FinishTo( end );
563 }
564 }
565 else
566 {
568 segmentAsOval( start, end, width, tracemode );
569 }
570}
void segmentAsOval(const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode)
Convert a thick segment and plot it as an oval.
Definition: plotter.cpp:481

References Circle(), FILLED, FILLED_SHAPE, FinishTo(), MoveTo(), segmentAsOval(), and SetCurrentLineWidth().

Referenced by PSLIKE_PLOTTER::FlashPadOval(), SCH_SYMBOL::PlotDNP(), BRDITEMS_PLOTTER::PlotFootprintShape(), PlotLayerOutlines(), BRDITEMS_PLOTTER::PlotPcbShape(), and PlotStandardLayer().

◆ userToDeviceCoordinates()

VECTOR2D PLOTTER::userToDeviceCoordinates ( const VECTOR2I aCoordinate)
protectedvirtual

Modify coordinates according to the orientation, scale factor, and offsets trace.

Also convert from a VECTOR2I to VECTOR2D, since some output engines needs floating point coordinates.

Definition at line 90 of file plotter.cpp.

91{
92 VECTOR2I pos = aCoordinate - m_plotOffset;
93
94 double x = pos.x * m_plotScale;
95 double y = ( m_paperSize.y - pos.y * m_plotScale );
96
97 if( m_plotMirror )
98 {
100 x = ( m_paperSize.x - pos.x * m_plotScale );
101 else
102 y = pos.y * m_plotScale;
103 }
104
105 if( m_yaxisReversed )
106 y = m_paperSize.y - y;
107
110
111 return VECTOR2D( x, y );
112}
VECTOR2I m_plotOffset
Definition: plotter.h:646
VECTOR2I m_paperSize
Definition: plotter.h:666
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589

References m_iuPerDeviceUnit, m_mirrorIsHorizontal, m_paperSize, m_plotMirror, m_plotOffset, m_plotScale, m_yaxisReversed, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DXF_PLOTTER::Arc(), HPGL_PLOTTER::Arc(), SVG_PLOTTER::Arc(), PS_PLOTTER::Arc(), PDF_PLOTTER::Arc(), SVG_PLOTTER::BezierCurve(), HPGL_PLOTTER::Circle(), DXF_PLOTTER::Circle(), PS_PLOTTER::Circle(), PDF_PLOTTER::Circle(), SVG_PLOTTER::Circle(), PSLIKE_PLOTTER::computeTextParameters(), GERBER_PLOTTER::FlashPadChamferRoundRect(), HPGL_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::FlashPadCustom(), GERBER_PLOTTER::FlashPadOval(), GERBER_PLOTTER::FlashPadRect(), GERBER_PLOTTER::FlashPadRoundRect(), GERBER_PLOTTER::FlashPadTrapez(), GERBER_PLOTTER::FlashRegularPolygon(), DXF_PLOTTER::PenTo(), GERBER_PLOTTER::PenTo(), HPGL_PLOTTER::PenTo(), PS_PLOTTER::PenTo(), PDF_PLOTTER::PenTo(), SVG_PLOTTER::PenTo(), GERBER_PLOTTER::plotArc(), PS_PLOTTER::PlotImage(), PDF_PLOTTER::PlotImage(), DXF_PLOTTER::plotOneLineOfText(), HPGL_PLOTTER::PlotPoly(), PS_PLOTTER::PlotPoly(), PDF_PLOTTER::PlotPoly(), SVG_PLOTTER::PlotPoly(), PS_PLOTTER::PlotText(), HPGL_PLOTTER::Rect(), PS_PLOTTER::Rect(), PDF_PLOTTER::Rect(), SVG_PLOTTER::Rect(), PS_PLOTTER::Text(), and SVG_PLOTTER::Text().

◆ userToDeviceSize() [1/2]

◆ userToDeviceSize() [2/2]

double PLOTTER::userToDeviceSize ( double  size) const
protectedvirtual

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

Definition at line 122 of file plotter.cpp.

123{
124 return size * m_plotScale * m_iuPerDeviceUnit;
125}

References m_iuPerDeviceUnit, and m_plotScale.

Member Data Documentation

◆ DO_NOT_SET_LINE_WIDTH

◆ m_colorMode

◆ m_creator

wxString PLOTTER::m_creator
protected

◆ m_currentPenWidth

◆ m_filename

wxString PLOTTER::m_filename
protected

◆ m_headerExtraLines

wxArrayString PLOTTER::m_headerExtraLines
protected

Definition at line 668 of file plotter.h.

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

◆ m_iuPerDeviceUnit

◆ m_IUsPerDecimil

◆ m_mirrorIsHorizontal

bool PLOTTER::m_mirrorIsHorizontal
protected

Definition at line 649 of file plotter.h.

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

◆ m_negativeMode

bool PLOTTER::m_negativeMode
protected

Definition at line 657 of file plotter.h.

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

◆ m_outputFile

FILE* PLOTTER::m_outputFile
protected

Output file.

Definition at line 653 of file plotter.h.

Referenced by DXF_PLOTTER::Arc(), SVG_PLOTTER::Arc(), PS_PLOTTER::Arc(), SVG_PLOTTER::BezierCurve(), HPGL_PLOTTER::Circle(), 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::emitOutline(), PDF_PLOTTER::emitOutlineNode(), PS_PLOTTER::emitSetRGBColor(), SVG_PLOTTER::EndBlock(), DXF_PLOTTER::EndPlot(), GERBER_PLOTTER::EndPlot(), HPGL_PLOTTER::EndPlot(), PS_PLOTTER::EndPlot(), PDF_PLOTTER::EndPlot(), SVG_PLOTTER::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(), OpenFile(), PDF_PLOTTER::OpenFile(), DXF_PLOTTER::PenTo(), GERBER_PLOTTER::PenTo(), HPGL_PLOTTER::PenTo(), PS_PLOTTER::PenTo(), SVG_PLOTTER::PenTo(), GERBER_PLOTTER::plotArc(), GERBER_PLOTTER::PlotGerberRegion(), PS_PLOTTER::PlotImage(), SVG_PLOTTER::PlotImage(), DXF_PLOTTER::plotOneLineOfText(), GERBER_PLOTTER::PlotPoly(), PS_PLOTTER::PlotPoly(), SVG_PLOTTER::PlotPoly(), GERBER_PLOTTER::plotRoundRectAsRegion(), PLOTTER(), PS_PLOTTER::PlotText(), HPGL_PLOTTER::Rect(), DXF_PLOTTER::Rect(), PS_PLOTTER::Rect(), SVG_PLOTTER::Rect(), GERBER_PLOTTER::selectAperture(), PS_PLOTTER::SetCurrentLineWidth(), PS_PLOTTER::SetDash(), GERBER_PLOTTER::SetLayerPolarity(), SVG_PLOTTER::setSVGPlotStyle(), PS_PLOTTER::SetViewport(), SVG_PLOTTER::StartBlock(), PDF_PLOTTER::StartPage(), PDF_PLOTTER::startPdfObject(), PDF_PLOTTER::startPdfStream(), DXF_PLOTTER::StartPlot(), HPGL_PLOTTER::StartPlot(), PS_PLOTTER::StartPlot(), SVG_PLOTTER::StartPlot(), PDF_PLOTTER::StartPlot(), GERBER_PLOTTER::StartPlot(), PS_PLOTTER::Text(), SVG_PLOTTER::Text(), HPGL_PLOTTER::ThickSegment(), GERBER_PLOTTER::writeApertureList(), and ~PLOTTER().

◆ m_pageInfo

◆ m_paperSize

◆ m_penLastpos

VECTOR2I PLOTTER::m_penLastpos
protected

◆ m_penState

char PLOTTER::m_penState
protected

◆ m_plotMirror

◆ m_plotOffset

◆ m_plotScale

◆ m_renderSettings

◆ m_title

wxString PLOTTER::m_title
protected

Definition at line 664 of file plotter.h.

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

◆ m_yaxisReversed

bool PLOTTER::m_yaxisReversed
protected

◆ MARKER_COUNT

const unsigned PLOTTER::MARKER_COUNT = 58
static

Draw a marker (used for the drill map).

Definition at line 486 of file plotter.h.

Referenced by Marker().

◆ USE_DEFAULT_LINE_WIDTH


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