KiCad PCB EDA Suite
DXF_PLOTTER Class Reference

#include <plot_common.h>

Inheritance diagram for DXF_PLOTTER:
PLOTTER

Public Member Functions

 DXF_PLOTTER ()
 
virtual PlotFormat GetPlotterType () const override
 Returns the effective plot engine in use. More...
 
virtual void SetTextMode (PlotTextMode mode) override
 DXF handles NATIVE text emitting TEXT entities. More...
 
virtual bool StartPlot () override
 Opens the DXF plot with a skeleton header. More...
 
virtual bool EndPlot () override
 
virtual void SetCurrentLineWidth (int width, void *aData=NULL) override
 Set the line width for the next drawing. More...
 
virtual void SetDefaultLineWidth (int width) override
 Set the default line width. More...
 
virtual void SetDash (bool dashed) override
 Dashed lines are not (yet) supported by DXF_PLOTTER. More...
 
virtual void SetColor (COLOR4D color) override
 The DXF exporter handles 'colors' as layers... More...
 
virtual void SetViewport (const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
 Set the scale/position for the DXF plot The DXF engine doesn't support line widths and mirroring. More...
 
virtual void Rect (const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
 DXF rectangle: fill not supported. More...
 
virtual void Circle (const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
 DXF circle: full functionality; it even does 'fills' drawing a circle with a dual-arc polyline wide as the radius. More...
 
virtual void PlotPoly (const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
 DXF polygon: doesn't fill it but at least it close the filled ones DXF does not know thick outline. More...
 
virtual void ThickSegment (const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
 
virtual void Arc (const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
 Generic fallback: arc rendered as a polyline. More...
 
virtual void PenTo (const wxPoint &pos, char plume) override
 moveto/lineto primitive, moves the 'pen' to the specified direction More...
 
virtual void FlashPadCircle (const wxPoint &pos, int diametre, EDA_DRAW_MODE_T trace_mode, void *aData) override
 DXF round pad: always done in sketch mode; it could be filled but it isn't pretty if other kinds of pad aren't... More...
 
virtual void FlashPadOval (const wxPoint &pos, const wxSize &size, double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override
 DXF oval pad: always done in sketch mode. More...
 
virtual void FlashPadRect (const wxPoint &pos, const wxSize &size, double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override
 DXF rectangular pad: alwayd done in sketch mode. More...
 
virtual void FlashPadRoundRect (const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
 virtual function FlashPadRoundRect More...
 
virtual void FlashPadCustom (const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData) override
 virtual function FlashPadCustom More...
 
virtual void FlashPadTrapez (const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode, void *aData) override
 DXF trapezoidal pad: only sketch mode is supported. More...
 
virtual void Text (const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL) override
 Draws text with the plotter. More...
 
virtual void SetNegative (bool _negative)
 
virtual void SetColorMode (bool _color_mode)
 
bool GetColorMode () const
 
virtual void SetPageSettings (const PAGE_INFO &aPageSettings)
 
virtual int GetCurrentLineWidth () const
 
virtual void SetCreator (const wxString &aCreator)
 
virtual void SetTitle (const wxString &aTitle)
 
void AddLineToHeader (const wxString &aExtraString)
 Function AddLineToHeader Add a line to the list of free lines to print at the beginning of the file. More...
 
void ClearHeaderLinesList ()
 Function ClearHeaderLinesList remove all lines from the list of free lines to print at the beginning of the file. 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...
 
void MoveTo (const wxPoint &pos)
 
void LineTo (const wxPoint &pos)
 
void FinishTo (const wxPoint &pos)
 
void PenFinish ()
 
virtual void PlotImage (const wxImage &aImage, const wxPoint &aPos, double aScaleFactor)
 Function PlotImage Only Postscript plotters can plot bitmaps for plotters that cannot plot a bitmap, a rectangle is plotted. More...
 
virtual void ThickArc (const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
 
virtual void ThickRect (const wxPoint &p1, const wxPoint &p2, int width, EDA_DRAW_MODE_T tracemode, void *aData)
 
virtual void ThickCircle (const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
 
void Marker (const wxPoint &position, int diametre, unsigned aShapeId)
 Draw a pattern shape number aShapeId, to coord x0, y0. More...
 
virtual void SetLayerPolarity (bool aPositive)
 Function SetLayerPolarity sets current Gerber layer polarity to positive or negative by writing %LPD*% or %LPC*% to the Gerber file, respectively. More...
 
virtual void SetGerberCoordinatesFormat (int aResolution, bool aUseInches=false)
 
virtual void StartBlock (void *aData)
 calling this function allows 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 to define the end of a group of drawing items for instance in SVG or Gerber format. More...
 

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

Protected Member Functions

void markerCircle (const wxPoint &pos, int radius)
 Plot a circle centered on the position. More...
 
void markerHBar (const wxPoint &pos, int radius)
 Plot a - bar centered on the position. More...
 
void markerSlash (const wxPoint &pos, int radius)
 Plot a / bar centered on the position. More...
 
void markerBackSlash (const wxPoint &pos, int radius)
 Plot a \ bar centered on the position. More...
 
void markerVBar (const wxPoint &pos, int radius)
 Plot a | bar centered on the position. More...
 
void markerSquare (const wxPoint &position, int radius)
 Plot a square centered on the position. More...
 
void markerLozenge (const wxPoint &position, int radius)
 Plot a lozenge centered on the position. More...
 
void segmentAsOval (const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode)
 Cdonvert a thick segment and plot it as an oval. More...
 
void sketchOval (const wxPoint &pos, const wxSize &size, double orient, int width)
 
virtual DPOINT userToDeviceCoordinates (const wxPoint &aCoordinate)
 Modifies coordinates according to the orientation, scale factor, and offsets trace. More...
 
virtual DPOINT userToDeviceSize (const wxSize &size)
 Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) More...
 
virtual double userToDeviceSize (double size) const
 Modifies size according to the plotter scale factors (simple double version) More...
 
double GetDashMarkLenIU () const
 
double GetDashGapLenIU () const
 

Protected Attributes

bool textAsLines
 
COLOR4D m_currentColor
 
double plotScale
 Plot scale - chosen by the user (even implicitly with 'fit in a4') More...
 
double m_IUsPerDecimil
 
double iuPerDeviceUnit
 Device scale (from IUs to plotter device units - usually decimils) More...
 
wxPoint plotOffset
 Plot offset (in IUs) More...
 
bool m_plotMirror
 X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG) More...
 
bool m_mirrorIsHorizontal
 
bool m_yaxisReversed
 true to mirror horizontally (else vertically) More...
 
FILE * outputFile
 true if the Y axis is top to bottom (SVG) More...
 
bool colorMode
 
bool negativeMode
 true to plot in color, false to plot in black and white More...
 
int defaultPenWidth
 true to generate a negative image (PS mode mainly) More...
 
int currentPenWidth
 
char penState
 Current pen state: 'U', 'D' or 'Z' (see PenTo) More...
 
wxPoint penLastpos
 Last pen positions; set to -1,-1 when the pen is at rest. More...
 
wxString creator
 
wxString filename
 
wxString title
 
PAGE_INFO pageInfo
 
wxSize paperSize
 Paper size in IU - not in mils. More...
 
wxArrayString m_headerExtraLines
 

Detailed Description

Definition at line 1206 of file plot_common.h.

Constructor & Destructor Documentation

DXF_PLOTTER::DXF_PLOTTER ( )
inline

Definition at line 1209 of file plot_common.h.

References BLACK, m_currentColor, and textAsLines.

1209  : textAsLines( false )
1210  {
1211  textAsLines = true;
1213  }
bool textAsLines
Definition: plot_common.h:1296
COLOR4D m_currentColor
Definition: plot_common.h:1297
Definition: colors.h:45

Member Function Documentation

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

Function AddLineToHeader 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 166 of file plot_common.h.

References PLOTTER::m_headerExtraLines.

Referenced by AddGerberX2Attribute().

167  {
168  m_headerExtraLines.Add( aExtraString );
169  }
wxArrayString m_headerExtraLines
Definition: plot_common.h:552
void DXF_PLOTTER::Arc ( const wxPoint centre,
double  StAngle,
double  EndAngle,
int  rayon,
FILL_T  fill,
int  width = USE_DEFAULT_LINE_WIDTH 
)
overridevirtual

Generic fallback: arc rendered as a polyline.

Reimplemented from PLOTTER.

Definition at line 495 of file common_plotDXF_functions.cpp.

References m_currentColor, PLOTTER::outputFile, TO_UTF8, PLOTTER::userToDeviceCoordinates(), PLOTTER::userToDeviceSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

497 {
498  wxASSERT( outputFile );
499 
500  if( radius <= 0 )
501  return;
502 
503  // In DXF, arcs are drawn CCW.
504  // In Kicad, arcs are CW or CCW
505  // If StAngle > EndAngle, it is CW. So transform it to CCW
506  if( StAngle > EndAngle )
507  {
508  std::swap( StAngle, EndAngle );
509  }
510 
511  DPOINT centre_dev = userToDeviceCoordinates( centre );
512  double radius_dev = userToDeviceSize( radius );
513 
514  // Emit a DXF ARC entity
515  wxString cname( m_currentColor.ToColour().GetAsString( wxC2S_CSS_SYNTAX ) );
516  fprintf( outputFile,
517  "0\nARC\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n50\n%g\n51\n%g\n",
518  TO_UTF8( cname ),
519  centre_dev.x, centre_dev.y, radius_dev,
520  StAngle / 10.0, EndAngle / 10.0 );
521 }
COLOR4D m_currentColor
Definition: plot_common.h:1297
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void DXF_PLOTTER::Circle ( const wxPoint centre,
int  diameter,
FILL_T  fill,
int  width = USE_DEFAULT_LINE_WIDTH 
)
overridevirtual

DXF circle: full functionality; it even does 'fills' drawing a circle with a dual-arc polyline wide as the radius.

I could use this trick to do other filled primitives

Implements PLOTTER.

Definition at line 312 of file common_plotDXF_functions.cpp.

References FILLED_SHAPE, m_currentColor, PLOTTER::outputFile, TO_UTF8, PLOTTER::userToDeviceCoordinates(), PLOTTER::userToDeviceSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by FlashPadCircle().

313 {
314  wxASSERT( outputFile );
315  double radius = userToDeviceSize( diameter / 2 );
316  DPOINT centre_dev = userToDeviceCoordinates( centre );
317  if( radius > 0 )
318  {
319  wxString cname( m_currentColor.ToColour().GetAsString( wxC2S_CSS_SYNTAX ) );
320 
321  if( !fill )
322  {
323  fprintf( outputFile, "0\nCIRCLE\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n",
324  TO_UTF8( cname ),
325  centre_dev.x, centre_dev.y, radius );
326  }
327 
328  if( fill == FILLED_SHAPE )
329  {
330  double r = radius*0.5;
331  fprintf( outputFile, "0\nPOLYLINE\n");
332  fprintf( outputFile, "8\n%s\n66\n1\n70\n1\n", TO_UTF8( cname ));
333  fprintf( outputFile, "40\n%g\n41\n%g\n", radius, radius);
334  fprintf( outputFile, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
335  fprintf( outputFile, "10\n%g\n 20\n%g\n42\n1.0\n",
336  centre_dev.x-r, centre_dev.y );
337  fprintf( outputFile, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
338  fprintf( outputFile, "10\n%g\n 20\n%g\n42\n1.0\n",
339  centre_dev.x+r, centre_dev.y );
340  fprintf( outputFile, "0\nSEQEND\n");
341  }
342  }
343 }
COLOR4D m_currentColor
Definition: plot_common.h:1297
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void PLOTTER::ClearHeaderLinesList ( )
inlineinherited

Function ClearHeaderLinesList remove all lines from the list of free lines to print at the beginning of the file.

Definition at line 175 of file plot_common.h.

References PLOTTER::m_headerExtraLines.

Referenced by StartPlotBoard().

176  {
177  m_headerExtraLines.Clear();
178  }
wxArrayString m_headerExtraLines
Definition: plot_common.h:552
virtual void PLOTTER::EndBlock ( void *  aData)
inlinevirtualinherited

calling this function allows 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.

Definition at line 436 of file plot_common.h.

Referenced by PlotSilkScreen(), and PlotStandardLayer().

436 {}
bool DXF_PLOTTER::EndPlot ( )
overridevirtual

Implements PLOTTER.

Definition at line 260 of file common_plotDXF_functions.cpp.

References PLOTTER::outputFile.

Referenced by DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF().

261 {
262  wxASSERT( outputFile );
263 
264  // DXF FOOTER
265  fputs( " 0\n"
266  "ENDSEC\n"
267  " 0\n"
268  "EOF\n", outputFile );
269  fclose( outputFile );
270  outputFile = NULL;
271 
272  return true;
273 }
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void PLOTTER::FinishTo ( const wxPoint pos)
inlineinherited
void DXF_PLOTTER::FlashPadCircle ( const wxPoint pos,
int  diametre,
EDA_DRAW_MODE_T  trace_mode,
void *  aData 
)
overridevirtual

DXF round pad: always done in sketch mode; it could be filled but it isn't pretty if other kinds of pad aren't...

Implements PLOTTER.

Definition at line 548 of file common_plotDXF_functions.cpp.

References Circle(), NO_FILL, and PLOTTER::outputFile.

550 {
551  wxASSERT( outputFile );
552  Circle( pos, diametre, NO_FILL );
553 }
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
DXF circle: full functionality; it even does 'fills' drawing a circle with a dual-arc polyline wide a...
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void DXF_PLOTTER::FlashPadCustom ( const wxPoint aPadPos,
const wxSize &  aSize,
SHAPE_POLY_SET aPolygons,
EDA_DRAW_MODE_T  aTraceMode,
void *  aData 
)
overridevirtual

virtual function FlashPadCustom

Parameters
aPadPosPosition of the shape (center of the rectangle
aSize= size of round reference pad
aPolygonsthe shape as polygon set
aTraceModeFILLED or SKETCH
aDataan auxiliary info (mainly for gerber format)

Implements PLOTTER.

Definition at line 643 of file common_plotDXF_functions.cpp.

References PLOTTER::FinishTo(), PLOTTER::LineTo(), PLOTTER::MoveTo(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::Point(), SHAPE_LINE_CHAIN::PointCount(), VECTOR2< T >::x, and VECTOR2< T >::y.

646 {
647  for( int cnt = 0; cnt < aPolygons->OutlineCount(); ++cnt )
648  {
649  SHAPE_LINE_CHAIN& poly = aPolygons->Outline( cnt );
650 
651  MoveTo( wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
652 
653  for( int ii = 1; ii < poly.PointCount(); ++ii )
654  LineTo( wxPoint( poly.Point( ii ).x, poly.Point( ii ).y ) );
655 
656  FinishTo(wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
657  }
658 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
int PointCount() const
Function PointCount()
int OutlineCount() const
Returns the number of outlines in the set
void LineTo(const wxPoint &pos)
Definition: plot_common.h:236
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
Class SHAPE_LINE_CHAIN.
VECTOR2I & Point(int aIndex)
Function Point()
void DXF_PLOTTER::FlashPadOval ( const wxPoint pos,
const wxSize &  size,
double  orient,
EDA_DRAW_MODE_T  trace_mode,
void *  aData 
)
overridevirtual

DXF oval pad: always done in sketch mode.

Implements PLOTTER.

Definition at line 526 of file common_plotDXF_functions.cpp.

References AddAngles(), PLOTTER::outputFile, and PLOTTER::sketchOval().

528 {
529  wxASSERT( outputFile );
530  wxSize size( aSize );
531 
532  /* The chip is reduced to an oval tablet with size.y > size.x
533  * (Oval vertical orientation 0) */
534  if( size.x > size.y )
535  {
536  std::swap( size.x, size.y );
537  orient = AddAngles( orient, 900 );
538  }
539 
540  sketchOval( pos, size, orient, -1 );
541 }
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
Definition: trigo.h:246
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void sketchOval(const wxPoint &pos, const wxSize &size, double orient, int width)
void DXF_PLOTTER::FlashPadRect ( const wxPoint pos,
const wxSize &  size,
double  orient,
EDA_DRAW_MODE_T  trace_mode,
void *  aData 
)
overridevirtual

DXF rectangular pad: alwayd done in sketch mode.

Implements PLOTTER.

Definition at line 559 of file common_plotDXF_functions.cpp.

References PLOTTER::FinishTo(), PLOTTER::LineTo(), PLOTTER::MoveTo(), PLOTTER::outputFile, RotatePoint(), wxPoint::x, and wxPoint::y.

561 {
562  wxASSERT( outputFile );
563  wxSize size;
564  int ox, oy, fx, fy;
565 
566  size.x = padsize.x / 2;
567  size.y = padsize.y / 2;
568 
569  if( size.x < 0 )
570  size.x = 0;
571  if( size.y < 0 )
572  size.y = 0;
573 
574  // If a dimension is zero, the trace is reduced to 1 line
575  if( size.x == 0 )
576  {
577  ox = pos.x;
578  oy = pos.y - size.y;
579  RotatePoint( &ox, &oy, pos.x, pos.y, orient );
580  fx = pos.x;
581  fy = pos.y + size.y;
582  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
583  MoveTo( wxPoint( ox, oy ) );
584  FinishTo( wxPoint( fx, fy ) );
585  return;
586  }
587  if( size.y == 0 )
588  {
589  ox = pos.x - size.x;
590  oy = pos.y;
591  RotatePoint( &ox, &oy, pos.x, pos.y, orient );
592  fx = pos.x + size.x;
593  fy = pos.y;
594  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
595  MoveTo( wxPoint( ox, oy ) );
596  FinishTo( wxPoint( fx, fy ) );
597  return;
598  }
599 
600  ox = pos.x - size.x;
601  oy = pos.y - size.y;
602  RotatePoint( &ox, &oy, pos.x, pos.y, orient );
603  MoveTo( wxPoint( ox, oy ) );
604 
605  fx = pos.x - size.x;
606  fy = pos.y + size.y;
607  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
608  LineTo( wxPoint( fx, fy ) );
609 
610  fx = pos.x + size.x;
611  fy = pos.y + size.y;
612  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
613  LineTo( wxPoint( fx, fy ) );
614 
615  fx = pos.x + size.x;
616  fy = pos.y - size.y;
617  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
618  LineTo( wxPoint( fx, fy ) );
619 
620  FinishTo( wxPoint( ox, oy ) );
621 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void LineTo(const wxPoint &pos)
Definition: plot_common.h:236
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void DXF_PLOTTER::FlashPadRoundRect ( const wxPoint aPadPos,
const wxSize &  aSize,
int  aCornerRadius,
double  aOrient,
EDA_DRAW_MODE_T  aTraceMode,
void *  aData 
)
overridevirtual

virtual function FlashPadRoundRect

Parameters
aPadPosPosition of the shape (center of the rectangle
aSize= size of rounded rect
cornerRadiusRadius of the rounded corners
aOrientThe rotation of the shape
aTraceModeFILLED or SKETCH
aDataan auxiliary info (mainly for gerber format)

Implements PLOTTER.

Definition at line 623 of file common_plotDXF_functions.cpp.

References PLOTTER::FinishTo(), PLOTTER::LineTo(), PLOTTER::MoveTo(), SHAPE_POLY_SET::Outline(), SHAPE_LINE_CHAIN::Point(), SHAPE_LINE_CHAIN::PointCount(), TransformRoundRectToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.

626 {
627  SHAPE_POLY_SET outline;
628  const int segmentToCircleCount = 64;
629  TransformRoundRectToPolygon( outline, aPadPos, aSize, aOrient,
630  aCornerRadius, segmentToCircleCount );
631 
632  // TransformRoundRectToPolygon creates only one convex polygon
633  SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
634 
635  MoveTo( wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
636 
637  for( int ii = 1; ii < poly.PointCount(); ++ii )
638  LineTo( wxPoint( poly.Point( ii ).x, poly.Point( ii ).y ) );
639 
640  FinishTo( wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
641 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
int PointCount() const
Function PointCount()
void TransformRoundRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, int aCircleToSegmentsCount)
Function TransformRoundRectToPolygon convert a rectangle with rounded corners to a polygon Convert ar...
void LineTo(const wxPoint &pos)
Definition: plot_common.h:236
Class SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
Class SHAPE_LINE_CHAIN.
VECTOR2I & Point(int aIndex)
Function Point()
void DXF_PLOTTER::FlashPadTrapez ( const wxPoint aPadPos,
const wxPoint aCorners,
double  aPadOrient,
EDA_DRAW_MODE_T  aTrace_Mode,
void *  aData 
)
overridevirtual

DXF trapezoidal pad: only sketch mode is supported.

Implements PLOTTER.

Definition at line 664 of file common_plotDXF_functions.cpp.

References PLOTTER::FinishTo(), PLOTTER::LineTo(), PLOTTER::MoveTo(), PLOTTER::outputFile, and RotatePoint().

666 {
667  wxASSERT( outputFile );
668  wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
669 
670  for( int ii = 0; ii < 4; ii++ )
671  {
672  coord[ii] = aCorners[ii];
673  RotatePoint( &coord[ii], aPadOrient );
674  coord[ii] += aPadPos;
675  }
676 
677  // Plot edge:
678  MoveTo( coord[0] );
679  LineTo( coord[1] );
680  LineTo( coord[2] );
681  LineTo( coord[3] );
682  FinishTo( coord[0] );
683 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void LineTo(const wxPoint &pos)
Definition: plot_common.h:236
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
bool PLOTTER::GetColorMode ( ) const
inlineinherited

Definition at line 121 of file plot_common.h.

References PLOTTER::colorMode.

Referenced by PLOT_CONTROLLER::GetColorMode(), LIB_TEXT::Plot(), LIB_PART::Plot(), LIB_PART::PlotLibFields(), and PlotWorkSheet().

122  {
123  return colorMode;
124  }
bool colorMode
Definition: plot_common.h:537
double PLOTTER::GetDashGapLenIU ( ) const
protectedinherited

Definition at line 141 of file class_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), PLOTTER::m_dashGapLength_mm, PLOTTER::m_IUsPerDecimil, and PLOTTER::userToDeviceSize().

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

142 {
144 }
double m_IUsPerDecimil
Definition: plot_common.h:519
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
double m_dashGapLength_mm
Dashed line parameter in mm: gap.
Definition: plot_common.h:90
virtual int GetCurrentLineWidth() const
Definition: plot_common.h:142
double PLOTTER::GetDashMarkLenIU ( ) const
protectedinherited

Definition at line 134 of file class_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), PLOTTER::m_dashMarkLength_mm, PLOTTER::m_IUsPerDecimil, and PLOTTER::userToDeviceSize().

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

135 {
137  return ( mark < 0.0 ) ? 0.0 : mark;
138 }
double m_IUsPerDecimil
Definition: plot_common.h:519
double m_dashMarkLength_mm
Dashed line parameter in mm: segment.
Definition: plot_common.h:89
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
virtual int GetCurrentLineWidth() const
Definition: plot_common.h:142
static wxString DXF_PLOTTER::GetDefaultFileExtension ( )
inlinestatic

Definition at line 1220 of file plot_common.h.

Referenced by DIALOG_PLOT_SCHEMATIC::CreateDXFFile(), and GetDefaultPlotExtension().

1221  {
1222  return wxString( wxT( "dxf" ) );
1223  }
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 207 of file plot_common.h.

References PLOTTER::m_IUsPerDecimil.

Referenced by PlotWorkSheet().

207 { return m_IUsPerDecimil; }
double m_IUsPerDecimil
Definition: plot_common.h:519
virtual PlotFormat DXF_PLOTTER::GetPlotterType ( ) const
inlineoverridevirtual

Returns the effective plot engine in use.

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

Implements PLOTTER.

Definition at line 1215 of file plot_common.h.

References PLOT_FORMAT_DXF.

1216  {
1217  return PLOT_FORMAT_DXF;
1218  }
void PLOTTER::LineTo ( const wxPoint pos)
inlineinherited

Definition at line 236 of file plot_common.h.

References PLOTTER::PenTo().

Referenced by PLOTTER::Arc(), FlashPadCustom(), FlashPadRect(), FlashPadRoundRect(), FlashPadTrapez(), SCH_SHEET::Plot(), HPGL_PLOTTER::PlotPoly(), GERBER_PLOTTER::PlotPoly(), PlotPoly(), LIB_PIN::PlotSymbol(), and Rect().

237  {
238  PenTo( pos, 'D' );
239  }
virtual void PenTo(const wxPoint &pos, char plume)=0
moveto/lineto primitive, moves the 'pen' to the specified direction
void PLOTTER::Marker ( const wxPoint position,
int  diametre,
unsigned  aShapeId 
)
inherited

Draw a pattern shape number aShapeId, to coord x0, y0.

x0, y0 = coordinates tables Diameter diameter = (coord table) hole AShapeId = index (used to generate forms characters)

Definition at line 273 of file class_plotter.cpp.

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

Referenced by EXCELLON_WRITER::GenDrillMapFile(), and EXCELLON_WRITER::plotDrillMarks().

274 {
275  int radius = diametre / 2;
276  /* Marker are composed by a series of 'parts' superimposed; not every
277  combination make sense, obviously. Since they are used in order I
278  tried to keep the uglier/more complex constructions at the end.
279  Also I avoided the |/ |\ -/ -\ construction because they're *very*
280  ugly... if needed they could be added anyway... I'd like to see
281  a board with more than 58 drilling/slotting tools!
282  If Visual C++ supported the 0b literals they would be optimally
283  and easily encoded as an integer array. We have to do with octal */
284  static const unsigned char marker_patterns[MARKER_COUNT] = {
285  // Bit order: O Square Lozenge - | \ /
286  // First choice: simple shapes
287  0003, // X
288  0100, // O
289  0014, // +
290  0040, // Sq
291  0020, // Lz
292  // Two simple shapes
293  0103, // X O
294  0017, // X +
295  0043, // X Sq
296  0023, // X Lz
297  0114, // O +
298  0140, // O Sq
299  0120, // O Lz
300  0054, // + Sq
301  0034, // + Lz
302  0060, // Sq Lz
303  // Three simple shapes
304  0117, // X O +
305  0143, // X O Sq
306  0123, // X O Lz
307  0057, // X + Sq
308  0037, // X + Lz
309  0063, // X Sq Lz
310  0154, // O + Sq
311  0134, // O + Lz
312  0074, // + Sq Lz
313  // Four simple shapes
314  0174, // O Sq Lz +
315  0163, // X O Sq Lz
316  0157, // X O Sq +
317  0137, // X O Lz +
318  0077, // X Sq Lz +
319  // This draws *everything *
320  0177, // X O Sq Lz +
321  // Here we use the single bars... so the cross is forbidden
322  0110, // O -
323  0104, // O |
324  0101, // O /
325  0050, // Sq -
326  0044, // Sq |
327  0041, // Sq /
328  0030, // Lz -
329  0024, // Lz |
330  0021, // Lz /
331  0150, // O Sq -
332  0144, // O Sq |
333  0141, // O Sq /
334  0130, // O Lz -
335  0124, // O Lz |
336  0121, // O Lz /
337  0070, // Sq Lz -
338  0064, // Sq Lz |
339  0061, // Sq Lz /
340  0170, // O Sq Lz -
341  0164, // O Sq Lz |
342  0161, // O Sq Lz /
343  // Last resort: the backlash component (easy to confound)
344  0102, // \ O
345  0042, // \ Sq
346  0022, // \ Lz
347  0142, // \ O Sq
348  0122, // \ O Lz
349  0062, // \ Sq Lz
350  0162 // \ O Sq Lz
351  };
352  if( aShapeId >= MARKER_COUNT )
353  {
354  // Fallback shape
355  markerCircle( position, radius );
356  }
357  else
358  {
359  // Decode the pattern and draw the corresponding parts
360  unsigned char pat = marker_patterns[aShapeId];
361  if( pat & 0001 )
362  markerSlash( position, radius );
363  if( pat & 0002 )
364  markerBackSlash( position, radius );
365  if( pat & 0004 )
366  markerVBar( position, radius );
367  if( pat & 0010 )
368  markerHBar( position, radius );
369  if( pat & 0020 )
370  markerLozenge( position, radius );
371  if( pat & 0040 )
372  markerSquare( position, radius );
373  if( pat & 0100 )
374  markerCircle( position, radius );
375  }
376 }
void markerHBar(const wxPoint &pos, int radius)
Plot a - bar centered on the position.
static const unsigned MARKER_COUNT
Draw a marker (used for the drill map)
Definition: plot_common.h:382
void markerSlash(const wxPoint &pos, int radius)
Plot a / bar centered on the position.
void markerLozenge(const wxPoint &position, int radius)
Plot a lozenge centered on the position.
void markerCircle(const wxPoint &pos, int radius)
Plot a circle centered on the position.
void markerVBar(const wxPoint &pos, int radius)
Plot a | bar centered on the position.
void markerSquare(const wxPoint &position, int radius)
Plot a square centered on the position.
void markerBackSlash(const wxPoint &pos, int radius)
Plot a \ bar centered on the position.
void PLOTTER::markerBackSlash ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a \ bar centered on the position.

Building block for markers

Definition at line 259 of file class_plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), wxPoint::x, and wxPoint::y.

Referenced by PLOTTER::Marker().

260 {
261  MoveTo( wxPoint( pos.x + radius, pos.y - radius ) );
262  FinishTo( wxPoint( pos.x - radius, pos.y + radius ) );
263 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
void PLOTTER::markerCircle ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a circle centered on the position.

Building block for markers

Definition at line 215 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

216 {
217  Circle( position, radius * 2, NO_FILL, GetCurrentLineWidth() );
218 }
virtual int GetCurrentLineWidth() const
Definition: plot_common.h:142
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
void PLOTTER::markerHBar ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a - bar centered on the position.

Building block for markers

Definition at line 245 of file class_plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), wxPoint::x, and wxPoint::y.

Referenced by PLOTTER::Marker().

246 {
247  MoveTo( wxPoint( pos.x - radius, pos.y ) );
248  FinishTo( wxPoint( pos.x + radius, pos.y ) );
249 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
void PLOTTER::markerLozenge ( const wxPoint position,
int  radius 
)
protectedinherited

Plot a lozenge centered on the position.

Building block for markers

Definition at line 221 of file class_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), NO_FILL, PLOTTER::PlotPoly(), wxPoint::x, and wxPoint::y.

Referenced by PLOTTER::Marker().

222 {
223  std::vector< wxPoint > corner_list;
224  wxPoint corner;
225  corner.x = position.x;
226  corner.y = position.y + radius;
227  corner_list.push_back( corner );
228  corner.x = position.x + radius;
229  corner.y = position.y,
230  corner_list.push_back( corner );
231  corner.x = position.x;
232  corner.y = position.y - radius;
233  corner_list.push_back( corner );
234  corner.x = position.x - radius;
235  corner.y = position.y;
236  corner_list.push_back( corner );
237  corner.x = position.x;
238  corner.y = position.y + radius;
239  corner_list.push_back( corner );
240 
241  PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() );
242 }
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
virtual int GetCurrentLineWidth() const
Definition: plot_common.h:142
void PLOTTER::markerSlash ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a / bar centered on the position.

Building block for markers

Definition at line 252 of file class_plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), wxPoint::x, and wxPoint::y.

Referenced by PLOTTER::Marker().

253 {
254  MoveTo( wxPoint( pos.x - radius, pos.y - radius ) );
255  FinishTo( wxPoint( pos.x + radius, pos.y + radius ) );
256 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
void PLOTTER::markerSquare ( const wxPoint position,
int  radius 
)
protectedinherited

Plot a square centered on the position.

Building block for markers

Definition at line 190 of file class_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), KiROUND(), NO_FILL, PLOTTER::PlotPoly(), wxPoint::x, and wxPoint::y.

Referenced by PLOTTER::Marker().

191 {
192  double r = KiROUND( radius / 1.4142 );
193  std::vector< wxPoint > corner_list;
194  wxPoint corner;
195  corner.x = position.x + r;
196  corner.y = position.y + r;
197  corner_list.push_back( corner );
198  corner.x = position.x + r;
199  corner.y = position.y - r;
200  corner_list.push_back( corner );
201  corner.x = position.x - r;
202  corner.y = position.y - r;
203  corner_list.push_back( corner );
204  corner.x = position.x - r;
205  corner.y = position.y + r;
206  corner_list.push_back( corner );
207  corner.x = position.x + r;
208  corner.y = position.y + r;
209  corner_list.push_back( corner );
210 
211  PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() );
212 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
virtual int GetCurrentLineWidth() const
Definition: plot_common.h:142
void PLOTTER::markerVBar ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a | bar centered on the position.

Building block for markers

Definition at line 266 of file class_plotter.cpp.

References PLOTTER::FinishTo(), PLOTTER::MoveTo(), wxPoint::x, and wxPoint::y.

Referenced by PLOTTER::Marker().

267 {
268  MoveTo( wxPoint( pos.x, pos.y - radius ) );
269  FinishTo( wxPoint( pos.x, pos.y + radius ) );
270 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
bool PLOTTER::OpenFile ( const wxString &  aFullFilename)
virtualinherited

Open or create the plot file aFullFilename.

Parameters
aFullFilename= 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 79 of file class_plotter.cpp.

References PLOTTER::filename, and PLOTTER::outputFile.

Referenced by EXCELLON_WRITER::GenDrillMapFile(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), StartPlotBoard(), and LIB_EDIT_FRAME::SVG_PlotComponent().

80 {
81  filename = aFullFilename;
82 
83  wxASSERT( !outputFile );
84 
85  // Open the file in text mode (not suitable for all plotters
86  // but only for most of them
87  outputFile = wxFopen( filename, wxT( "wt" ) );
88 
89  if( outputFile == NULL )
90  return false ;
91 
92  return true;
93 }
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
wxString filename
Definition: plot_common.h:546
void PLOTTER::PenFinish ( )
inlineinherited

Definition at line 247 of file plot_common.h.

References PLOTTER::PenTo().

Referenced by HPGL_PLOTTER::Arc(), HPGL_PLOTTER::Circle(), HPGL_PLOTTER::FlashPadCircle(), HPGL_PLOTTER::PlotPoly(), GERBER_PLOTTER::PlotPoly(), PlotPoly(), and HPGL_PLOTTER::Rect().

248  {
249  // The point is not important with Z motion
250  PenTo( wxPoint( 0, 0 ), 'Z' );
251  }
virtual void PenTo(const wxPoint &pos, char plume)=0
moveto/lineto primitive, moves the 'pen' to the specified direction
void DXF_PLOTTER::PenTo ( const wxPoint 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 455 of file common_plotDXF_functions.cpp.

References m_currentColor, PLOTTER::outputFile, PLOTTER::penLastpos, TO_UTF8, PLOTTER::userToDeviceCoordinates(), VECTOR2< T >::x, and VECTOR2< T >::y.

456 {
457  wxASSERT( outputFile );
458  if( plume == 'Z' )
459  {
460  return;
461  }
462  DPOINT pos_dev = userToDeviceCoordinates( pos );
463  DPOINT pen_lastpos_dev = userToDeviceCoordinates( penLastpos );
464 
465  if( penLastpos != pos && plume == 'D' )
466  {
467  // DXF LINE
468  wxString cname( m_currentColor.ToColour().GetAsString( wxC2S_CSS_SYNTAX ) );
469  fprintf( outputFile, "0\nLINE\n8\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n",
470  TO_UTF8( cname ),
471  pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y );
472  }
473  penLastpos = pos;
474 }
COLOR4D m_currentColor
Definition: plot_common.h:1297
wxPoint penLastpos
Last pen positions; set to -1,-1 when the pen is at rest.
Definition: plot_common.h:544
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void PLOTTER::PlotImage ( const wxImage &  aImage,
const wxPoint aPos,
double  aScaleFactor 
)
virtualinherited

Function PlotImage Only Postscript plotters can plot bitmaps for plotters that cannot plot a bitmap, a rectangle is plotted.

Draw an image bitmap

Parameters
aImage= the bitmap
aPos= position of the center of the bitmap
aScaleFactor= the scale factor to apply to the bitmap size (this is not the plot scale factor)

Reimplemented in SVG_PLOTTER, PDF_PLOTTER, and PS_PLOTTER.

Definition at line 173 of file class_plotter.cpp.

References NO_FILL, PLOTTER::Rect(), wxPoint::x, and wxPoint::y.

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

174 {
175  wxSize size( aImage.GetWidth() * aScaleFactor,
176  aImage.GetHeight() * aScaleFactor );
177 
178  wxPoint start = aPos;
179  start.x -= size.x / 2;
180  start.y -= size.y / 2;
181 
182  wxPoint end = start;
183  end.x += size.x;
184  end.y += size.y;
185 
186  Rect( start, end, NO_FILL );
187 }
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
void DXF_PLOTTER::PlotPoly ( const std::vector< wxPoint > &  aCornerList,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH,
void *  aData = NULL 
)
overridevirtual

DXF polygon: doesn't fill it but at least it close the filled ones DXF does not know thick outline.

It does not know thhick segments, therefore filled polygons with thick outline are converted to inflated polygon by aWidth/2

Implements PLOTTER.

Definition at line 352 of file common_plotDXF_functions.cpp.

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), FILLED, SHAPE_POLY_SET::Fracture(), PLOTTER::LineTo(), PLOTTER::MoveTo(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), PLOTTER::PenFinish(), SHAPE_POLY_SET::PM_FAST, SHAPE_LINE_CHAIN::PointCount(), ThickSegment(), TransformRoundedEndsSegmentToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.

354 {
355  if( aCornerList.size() <= 1 )
356  return;
357 
358  unsigned last = aCornerList.size() - 1;
359 
360  // Plot outlines with lines (thickness = 0) to define the polygon
361  if( aWidth <= 0 )
362  {
363  MoveTo( aCornerList[0] );
364 
365  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
366  LineTo( aCornerList[ii] );
367 
368  // Close polygon if 'fill' requested
369  if( aFill )
370  {
371  if( aCornerList[last] != aCornerList[0] )
372  LineTo( aCornerList[0] );
373  }
374 
375  PenFinish();
376 
377  return;
378  }
379 
380 
381  // if the polygon outline has thickness, and is not filled
382  // (i.e. is a polyline) plot outlines with thick segments
383  if( aWidth > 0 && !aFill )
384  {
385  MoveTo( aCornerList[0] );
386 
387  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
388  ThickSegment( aCornerList[ii-1], aCornerList[ii],
389  aWidth, FILLED, NULL );
390 
391  return;
392  }
393 
394  // The polygon outline has thickness, and is filled
395  // Build and plot the polygon which contains the initial
396  // polygon and its thick outline
397  SHAPE_POLY_SET bufferOutline;
398  SHAPE_POLY_SET bufferPolybase;
399  const int circleToSegmentsCount = 16;
400 
401  bufferPolybase.NewOutline();
402 
403  // enter outline as polygon:
404  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
405  {
407  aCornerList[ii-1], aCornerList[ii], circleToSegmentsCount, aWidth );
408  }
409 
410  // enter the initial polygon:
411  for( unsigned ii = 0; ii < aCornerList.size(); ii++ )
412  {
413  bufferPolybase.Append( aCornerList[ii] );
414  }
415 
416  // Merge polygons to build the polygon which contains the initial
417  // polygon and its thick outline
418 
419  // create the outline which contains thick outline:
420  bufferPolybase.BooleanAdd( bufferOutline, SHAPE_POLY_SET::PM_FAST );
421  bufferPolybase.Fracture( SHAPE_POLY_SET::PM_FAST );
422 
423  if( bufferPolybase.OutlineCount() < 1 ) // should not happen
424  return;
425 
426  const SHAPE_LINE_CHAIN& path = bufferPolybase.COutline( 0 );
427 
428  if( path.PointCount() < 2 ) // should not happen
429  return;
430 
431  // Now, output the final polygon to DXF file:
432  last = path.PointCount() - 1;
433  VECTOR2I point = path.CPoint( 0 );
434 
435  wxPoint startPoint( point.x, point.y );
436  MoveTo( startPoint );
437 
438  for( int ii = 1; ii < path.PointCount(); ii++ )
439  {
440  point = path.CPoint( ii );
441  LineTo( wxPoint( point.x, point.y ) );
442  }
443 
444  // Close polygon, if needed
445  point = path.CPoint( last );
446  wxPoint endPoint( point.x, point.y );
447 
448  if( endPoint != startPoint )
449  LineTo( startPoint );
450 
451  PenFinish();
452 }
void TransformRoundedEndsSegmentToPolygon(SHAPE_POLY_SET &aCornerBuffer, wxPoint aStart, wxPoint aEnd, int aCircleToSegmentsCount, int aWidth)
Function TransformRoundedEndsSegmentToPolygon convert a segment with rounded ends to a polygon Conver...
void PenFinish()
Definition: plot_common.h:247
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
int PointCount() const
Function PointCount()
int OutlineCount() const
Returns the number of outlines in the set
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
void LineTo(const wxPoint &pos)
Definition: plot_common.h:236
int Append(int x, int y, int aOutline=-1, int aHole=-1)
Appends a vertex at the end of the given outline/hole (default: the last outline) ...
Class SHAPE_POLY_SET.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
int NewOutline()
Creates a new empty polygon in the set and returns its index
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
Class SHAPE_LINE_CHAIN.
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
void DXF_PLOTTER::Rect ( const wxPoint p1,
const wxPoint p2,
FILL_T  fill,
int  width = USE_DEFAULT_LINE_WIDTH 
)
overridevirtual

DXF rectangle: fill not supported.

Implements PLOTTER.

Definition at line 295 of file common_plotDXF_functions.cpp.

References PLOTTER::FinishTo(), PLOTTER::LineTo(), PLOTTER::MoveTo(), PLOTTER::outputFile, wxPoint::x, and wxPoint::y.

296 {
297  wxASSERT( outputFile );
298  MoveTo( p1 );
299  LineTo( wxPoint( p1.x, p2.y ) );
300  LineTo( wxPoint( p2.x, p2.y ) );
301  LineTo( wxPoint( p2.x, p1.y ) );
302  FinishTo( wxPoint( p1.x, p1.y ) );
303 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void LineTo(const wxPoint &pos)
Definition: plot_common.h:236
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
void PLOTTER::segmentAsOval ( const wxPoint start,
const wxPoint end,
int  width,
EDA_DRAW_MODE_T  tracemode 
)
protectedinherited

Cdonvert a thick segment and plot it as an oval.

Definition at line 379 of file class_plotter.cpp.

References ArcTangente(), EuclideanNorm(), PLOTTER::FlashPadOval(), KiROUND(), wxPoint::x, and wxPoint::y.

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

381 {
382  wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
383  wxSize size( end.x - start.x, end.y - start.y );
384  double orient;
385 
386  if( size.y == 0 )
387  orient = 0;
388  else if( size.x == 0 )
389  orient = 900;
390  else
391  orient = -ArcTangente( size.y, size.x );
392 
393  size.x = KiROUND( EuclideanNorm( size ) ) + width;
394  size.y = width;
395 
396  FlashPadOval( center, size, orient, tracemode, NULL );
397 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:104
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:271
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
void DXF_PLOTTER::SetColor ( COLOR4D  color)
overridevirtual

The DXF exporter handles 'colors' as layers...

Implements PLOTTER.

Definition at line 279 of file common_plotDXF_functions.cpp.

References BLACK, PLOTTER::colorMode, m_currentColor, PLOTTER::outputFile, and WHITE.

Referenced by Text().

280 {
281  wxASSERT( outputFile );
282  if( ( colorMode )
283  || ( color == COLOR4D::BLACK )
284  || ( color == COLOR4D::WHITE ) )
285  {
286  m_currentColor = color;
287  }
288  else
290 }
bool colorMode
Definition: plot_common.h:537
COLOR4D m_currentColor
Definition: plot_common.h:1297
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
Definition: colors.h:49
Definition: colors.h:45
virtual void DXF_PLOTTER::SetCurrentLineWidth ( int  width,
void *  aData = NULL 
)
inlineoverridevirtual

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 1238 of file plot_common.h.

References PLOTTER::currentPenWidth.

1239  {
1240  currentPenWidth = 0;
1241  }
int currentPenWidth
Definition: plot_common.h:540
void DXF_PLOTTER::SetDash ( bool  dashed)
overridevirtual

Dashed lines are not (yet) supported by DXF_PLOTTER.

Implements PLOTTER.

Definition at line 480 of file common_plotDXF_functions.cpp.

481 {
482  // NOP for now
483 }
virtual void DXF_PLOTTER::SetDefaultLineWidth ( int  width)
inlineoverridevirtual

Set the default line width.

Used at the beginning and when a width of -1 (USE_DEFAULT_LINE_WIDTH) is requested.

Parameters
widthis specified in IUs

Implements PLOTTER.

Definition at line 1243 of file plot_common.h.

References PLOTTER::defaultPenWidth.

Referenced by SetViewport().

1244  {
1245  // DXF lines are infinitesimal
1246  defaultPenWidth = 0;
1247  }
int defaultPenWidth
true to generate a negative image (PS mode mainly)
Definition: plot_common.h:539
virtual void PLOTTER::SetGerberCoordinatesFormat ( int  aResolution,
bool  aUseInches = false 
)
inlinevirtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 415 of file plot_common.h.

Referenced by EXCELLON_WRITER::GenDrillMapFile(), and initializePlotter().

416  {
417  // NOP for most plotters. Only for Gerber plotter
418  }
virtual void PLOTTER::SetLayerPolarity ( bool  aPositive)
inlinevirtualinherited

Function SetLayerPolarity sets 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 401 of file plot_common.h.

Referenced by PlotOneBoardLayer().

402  {
403  // NOP for most plotters
404  }
virtual void PLOTTER::SetNegative ( bool  _negative)
inlinevirtualinherited

Definition at line 111 of file plot_common.h.

References PLOTTER::negativeMode.

Referenced by FillNegativeKnockout().

112  {
113  negativeMode = _negative;
114  }
bool negativeMode
true to plot in color, false to plot in black and white
Definition: plot_common.h:538
void PLOTTER::SetPageSettings ( const PAGE_INFO aPageSettings)
virtualinherited
virtual void DXF_PLOTTER::SetTextMode ( PlotTextMode  mode)
inlineoverridevirtual

DXF handles NATIVE text emitting TEXT entities.

Reimplemented from PLOTTER.

Definition at line 1228 of file plot_common.h.

References PLOTTEXTMODE_DEFAULT, PLOTTEXTMODE_NATIVE, and textAsLines.

1229  {
1230  if( mode != PLOTTEXTMODE_DEFAULT )
1231  textAsLines = ( mode != PLOTTEXTMODE_NATIVE );
1232  }
bool textAsLines
Definition: plot_common.h:1296
virtual void PLOTTER::SetTitle ( const wxString &  aTitle)
inlinevirtualinherited

Definition at line 156 of file plot_common.h.

References PLOTTER::title.

Referenced by DIALOG_PLOT_SCHEMATIC::createPDFFile().

157  {
158  title = aTitle;
159  }
wxString title
Definition: plot_common.h:547
void DXF_PLOTTER::SetViewport ( const wxPoint aOffset,
double  aIusPerDecimil,
double  aScale,
bool  aMirror 
)
overridevirtual

Set the scale/position for the DXF plot The DXF engine doesn't support line widths and mirroring.

The output coordinate system is in the first quadrant (in mm)

Implements PLOTTER.

Definition at line 50 of file common_plotDXF_functions.cpp.

References BLACK, PLOTTER::iuPerDeviceUnit, m_currentColor, PLOTTER::m_IUsPerDecimil, PLOTTER::m_plotMirror, PLOTTER::outputFile, PLOTTER::paperSize, PLOTTER::plotOffset, PLOTTER::plotScale, and SetDefaultLineWidth().

Referenced by DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF().

52 {
53  wxASSERT( !outputFile );
54  plotOffset = aOffset;
55  plotScale = aScale;
56 
57  /* DXF paper is 'virtual' so there is no need of a paper size.
58  Also this way we can handle the aux origin which can be useful
59  (for example when aligning to a mechanical drawing) */
60  paperSize.x = 0;
61  paperSize.y = 0;
62 
63  /* Like paper size DXF units are abstract too. Anyway there is a
64  * system variable (MEASUREMENT) which will be set to 1 to indicate
65  * metric units */
66  m_IUsPerDecimil = aIusPerDecimil;
67  iuPerDeviceUnit = 1.0 / aIusPerDecimil; // Gives a DXF in decimils
68  iuPerDeviceUnit *= 0.00254; // ... now in mm
69 
70  SetDefaultLineWidth( 0 ); // No line width on DXF
71  m_plotMirror = false; // No mirroring on DXF
73 }
COLOR4D m_currentColor
Definition: plot_common.h:1297
double m_IUsPerDecimil
Definition: plot_common.h:519
wxPoint plotOffset
Plot offset (in IUs)
Definition: plot_common.h:525
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plot_common.h:529
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plot_common.h:513
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: plot_common.h:1243
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
Definition: colors.h:45
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plot_common.h:522
wxSize paperSize
Paper size in IU - not in mils.
Definition: plot_common.h:550
void PLOTTER::sketchOval ( const wxPoint pos,
const wxSize &  size,
double  orient,
int  width 
)
protectedinherited

Definition at line 400 of file class_plotter.cpp.

References AddAngles(), PLOTTER::Arc(), PLOTTER::currentPenWidth, PLOTTER::FinishTo(), PLOTTER::MoveTo(), NO_FILL, RotatePoint(), PLOTTER::SetCurrentLineWidth(), wxPoint::x, and wxPoint::y.

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

401 {
402  SetCurrentLineWidth( width );
403  width = currentPenWidth;
404  int radius, deltaxy, cx, cy;
405  wxSize size( aSize );
406 
407  if( size.x > size.y )
408  {
409  std::swap( size.x, size.y );
410  orient = AddAngles( orient, 900 );
411  }
412 
413  deltaxy = size.y - size.x; /* distance between centers of the oval */
414  radius = ( size.x - width ) / 2;
415  cx = -radius;
416  cy = -deltaxy / 2;
417  RotatePoint( &cx, &cy, orient );
418  MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
419  cx = -radius;
420  cy = deltaxy / 2;
421  RotatePoint( &cx, &cy, orient );
422  FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
423 
424  cx = radius;
425  cy = -deltaxy / 2;
426  RotatePoint( &cx, &cy, orient );
427  MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
428  cx = radius;
429  cy = deltaxy / 2;
430  RotatePoint( &cx, &cy, orient );
431  FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
432 
433  cx = 0;
434  cy = deltaxy / 2;
435  RotatePoint( &cx, &cy, orient );
436  Arc( wxPoint( cx + pos.x, cy + pos.y ),
437  orient + 1800, orient + 3600,
438  radius, NO_FILL );
439  cx = 0;
440  cy = -deltaxy / 2;
441  RotatePoint( &cx, &cy, orient );
442  Arc( wxPoint( cx + pos.x, cy + pos.y ),
443  orient, orient + 1800,
444  radius, NO_FILL );
445 }
void FinishTo(const wxPoint &pos)
Definition: plot_common.h:241
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
Definition: trigo.h:246
void MoveTo(const wxPoint &pos)
Definition: plot_common.h:231
int currentPenWidth
Definition: plot_common.h:540
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)
Generic fallback: arc rendered as a polyline.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
virtual void PLOTTER::StartBlock ( void *  aData)
inlinevirtualinherited

calling this function allows 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.

Definition at line 427 of file plot_common.h.

Referenced by PlotSilkScreen(), and PlotStandardLayer().

427 {}
bool DXF_PLOTTER::StartPlot ( )
overridevirtual

Opens the DXF plot with a skeleton header.

Implements PLOTTER.

Definition at line 78 of file common_plotDXF_functions.cpp.

References BLACK, DXF_OBLIQUE_ANGLE, NBCOLORS, NextColor(), and PLOTTER::outputFile.

Referenced by DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF().

79 {
80  wxASSERT( outputFile );
81 
82  // DXF HEADER - Boilerplate
83  // Defines the minimum for drawing i.e. the angle system and the
84  // continuous linetype
85  fputs( " 0\n"
86  "SECTION\n"
87  " 2\n"
88  "HEADER\n"
89  " 9\n"
90  "$ANGBASE\n"
91  " 50\n"
92  "0.0\n"
93  " 9\n"
94  "$ANGDIR\n"
95  " 70\n"
96  " 1\n"
97  " 9\n"
98  "$MEASUREMENT\n"
99  " 70\n"
100  "0\n"
101  " 0\n" // This means 'metric units'
102  "ENDSEC\n"
103  " 0\n"
104  "SECTION\n"
105  " 2\n"
106  "TABLES\n"
107  " 0\n"
108  "TABLE\n"
109  " 2\n"
110  "LTYPE\n"
111  " 70\n"
112  "1\n"
113  " 0\n"
114  "LTYPE\n"
115  " 2\n"
116  "CONTINUOUS\n"
117  " 70\n"
118  "0\n"
119  " 3\n"
120  "Solid line\n"
121  " 72\n"
122  "65\n"
123  " 73\n"
124  "0\n"
125  " 40\n"
126  "0.0\n"
127  " 0\n"
128  "ENDTAB\n",
129  outputFile );
130 
131  // Text styles table
132  // Defines 4 text styles, one for each bold/italic combination
133  fputs( " 0\n"
134  "TABLE\n"
135  " 2\n"
136  "STYLE\n"
137  " 70\n"
138  "4\n", outputFile );
139 
140  static const char *style_name[4] = {"KICAD", "KICADB", "KICADI", "KICADBI"};
141  for(int i = 0; i < 4; i++ )
142  {
143  fprintf( outputFile,
144  " 0\n"
145  "STYLE\n"
146  " 2\n"
147  "%s\n" // Style name
148  " 70\n"
149  "0\n" // Standard flags
150  " 40\n"
151  "0\n" // Non-fixed height text
152  " 41\n"
153  "1\n" // Width factor (base)
154  " 42\n"
155  "1\n" // Last height (mandatory)
156  " 50\n"
157  "%g\n" // Oblique angle
158  " 71\n"
159  "0\n" // Generation flags (default)
160  " 3\n"
161  // The standard ISO font (when kicad is build with it
162  // the dxf text in acad matches *perfectly*)
163  "isocp.shx\n", // Font name (when not bigfont)
164  // Apply a 15 degree angle to italic text
165  style_name[i], i < 2 ? 0 : DXF_OBLIQUE_ANGLE );
166  }
167 
168 
169  // Layer table - one layer per color
170  fprintf( outputFile,
171  " 0\n"
172  "ENDTAB\n"
173  " 0\n"
174  "TABLE\n"
175  " 2\n"
176  "LAYER\n"
177  " 70\n"
178  "%d\n", NBCOLORS );
179 
180  /* The layer/colors palette. The acad/DXF palette is divided in 3 zones:
181 
182  - The primary colors (1 - 9)
183  - An HSV zone (10-250, 5 values x 2 saturations x 10 hues
184  - Greys (251 - 255)
185 
186  There is *no* black... the white does it on paper, usually, and
187  anyway it depends on the plotter configuration, since DXF colors
188  are meant to be logical only (they represent *both* line color and
189  width); later version with plot styles only complicate the matter!
190 
191  As usual, brown and magenta/purple are difficult to place since
192  they are actually variations of other colors.
193  */
194  static const struct {
195  const char *name;
196  int color;
197  } dxf_layer[NBCOLORS] = {
198  { "BLACK", 7 }, // In DXF, color 7 is *both* white and black!
199  { "GRAY1", 251 },
200  { "GRAY2", 8 },
201  { "GRAY3", 9 },
202  { "WHITE", 7 },
203  { "LYELLOW", 51 },
204  { "BLUE1", 178 },
205  { "GREEN1", 98 },
206  { "CYAN1", 138 },
207  { "RED1", 18 },
208  { "MAGENTA1", 228 },
209  { "BROWN1", 58 },
210  { "BLUE2", 5 },
211  { "GREEN2", 3 },
212  { "CYAN2", 4 },
213  { "RED2", 1 },
214  { "MAGENTA2", 6 },
215  { "BROWN2", 54 },
216  { "BLUE3", 171 },
217  { "GREEN3", 91 },
218  { "CYAN3", 131 },
219  { "RED3", 11 },
220  { "MAGENTA3", 221 },
221  { "YELLOW3", 2 },
222  { "BLUE4", 5 },
223  { "GREEN4", 3 },
224  { "CYAN4", 4 },
225  { "RED4", 1 },
226  { "MAGENTA4", 6 },
227  { "YELLOW4", 2 }
228  };
229 
230  for( EDA_COLOR_T i = BLACK; i < NBCOLORS; i = NextColor(i) )
231  {
232  fprintf( outputFile,
233  " 0\n"
234  "LAYER\n"
235  " 2\n"
236  "%s\n" // Layer name
237  " 70\n"
238  "0\n" // Standard flags
239  " 62\n"
240  "%d\n" // Color number
241  " 6\n"
242  "CONTINUOUS\n",// Linetype name
243  dxf_layer[i].name, dxf_layer[i].color );
244  }
245 
246  // End of layer table, begin entities
247  fputs( " 0\n"
248  "ENDTAB\n"
249  " 0\n"
250  "ENDSEC\n"
251  " 0\n"
252  "SECTION\n"
253  " 2\n"
254  "ENTITIES\n", outputFile );
255 
256  return true;
257 }
EDA_COLOR_T
NOTE: EDA_COLOR_T is deprecated and is kept around for compatibility with legacy canvas.
Definition: colors.h:42
static const double DXF_OBLIQUE_ANGLE
Oblique angle for DXF native text (I don't remember if 15 degrees is the ISO value...
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
Definition: colors.h:45
Number of colors.
Definition: colors.h:75
EDA_COLOR_T NextColor(EDA_COLOR_T &aColor)
Definition: colors.h:87
void DXF_PLOTTER::Text ( const wxPoint aPos,
const COLOR4D  aColor,
const wxString &  aText,
double  aOrient,
const wxSize &  aSize,
enum EDA_TEXT_HJUSTIFY_T  aH_justify,
enum EDA_TEXT_VJUSTIFY_T  aV_justify,
int  aWidth,
bool  aItalic,
bool  aBold,
bool  aMultilineAllowed = false,
void *  aData = NULL 
)
overridevirtual

Draws text with the plotter.

Function PLOTTER::Text same as DrawGraphicText, but plot graphic text insteed of draw it.

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

Parameters
aPos= text position (according to aH_justify, aV_justify)
aColor(COLOR4D) = text color
aText= text to draw
aOrient= angle in 0.1 degree
aSize= text size (size.x or size.y can be < 0 for mirrored texts)
aH_justify= horizontal justification (Left, center, right)
aV_justify= vertical justification (bottom, center, top)
aWidth= line width (pen width) (default = 0) if width < 0 : draw segments in sketch mode, width = abs(width) Use a value min(aSize.x, aSize.y) / 5 for a bold text
aItalic= true to simulate an italic font
aBold= true to use a bold font Useful only with default width value (aWidth = 0)
aMultilineAllowed= true to plot text as multiline, otherwise single line

Reimplemented from PLOTTER.

Definition at line 704 of file common_plotDXF_functions.cpp.

References containsNonAsciiChars(), DXF_OBLIQUE_ANGLE, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, m_currentColor, PLOTTER::outputFile, SetColor(), PLOTTER::Text(), textAsLines, TO_UTF8, PLOTTER::userToDeviceCoordinates(), PLOTTER::userToDeviceSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

716 {
717  // Fix me: see how to use DXF text mode for multiline texts
718  if( aMultilineAllowed && !aText.Contains( wxT( "\n" ) ) )
719  aMultilineAllowed = false; // the text has only one line.
720 
721  if( textAsLines || containsNonAsciiChars( aText ) || aMultilineAllowed )
722  {
723  // output text as graphics.
724  // Perhaps miltiline texts could be handled as DXF text entity
725  // but I do not want spend time about this (JPC)
726  PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
727  aWidth, aItalic, aBold, aMultilineAllowed );
728  }
729  else
730  {
731  /* Emit text as a text entity. This loses formatting and shape but it's
732  more useful as a CAD object */
733  DPOINT origin_dev = userToDeviceCoordinates( aPos );
734  SetColor( aColor );
735  wxString cname( m_currentColor.ToColour().GetAsString( wxC2S_CSS_SYNTAX ) );
736  DPOINT size_dev = userToDeviceSize( aSize );
737  int h_code = 0, v_code = 0;
738  switch( aH_justify )
739  {
741  h_code = 0;
742  break;
744  h_code = 1;
745  break;
747  h_code = 2;
748  break;
749  }
750  switch( aV_justify )
751  {
753  v_code = 3;
754  break;
756  v_code = 2;
757  break;
759  v_code = 1;
760  break;
761  }
762 
763  // Position, size, rotation and alignment
764  // The two alignment point usages is somewhat idiot (see the DXF ref)
765  // Anyway since we don't use the fit/aligned options, they're the same
766  fprintf( outputFile,
767  " 0\n"
768  "TEXT\n"
769  " 7\n"
770  "%s\n" // Text style
771  " 8\n"
772  "%s\n" // Layer name
773  " 10\n"
774  "%g\n" // First point X
775  " 11\n"
776  "%g\n" // Second point X
777  " 20\n"
778  "%g\n" // First point Y
779  " 21\n"
780  "%g\n" // Second point Y
781  " 40\n"
782  "%g\n" // Text height
783  " 41\n"
784  "%g\n" // Width factor
785  " 50\n"
786  "%g\n" // Rotation
787  " 51\n"
788  "%g\n" // Oblique angle
789  " 71\n"
790  "%d\n" // Mirror flags
791  " 72\n"
792  "%d\n" // H alignment
793  " 73\n"
794  "%d\n", // V alignment
795  aBold ? (aItalic ? "KICADBI" : "KICADB")
796  : (aItalic ? "KICADI" : "KICAD"),
797  TO_UTF8( cname ),
798  origin_dev.x, origin_dev.x,
799  origin_dev.y, origin_dev.y,
800  size_dev.y, fabs( size_dev.x / size_dev.y ),
801  aOrient / 10.0,
802  aItalic ? DXF_OBLIQUE_ANGLE : 0,
803  size_dev.x < 0 ? 2 : 0, // X mirror flag
804  h_code, v_code );
805 
806  /* There are two issue in emitting the text:
807  - Our overline character (~) must be converted to the appropriate
808  control sequence %%O or %%o
809  - Text encoding in DXF is more or less unspecified since depends on
810  the DXF declared version, the acad version reading it *and* some
811  system variables to be put in the header handled only by newer acads
812  Also before R15 unicode simply is not supported (you need to use
813  bigfonts which are a massive PITA). Common denominator solution:
814  use Latin1 (and however someone could choke on it, anyway). Sorry
815  for the extended latin people. If somewant want to try fixing this
816  recent version seems to use UTF-8 (and not UCS2 like the rest of
817  Windows)
818 
819  XXX Actually there is a *third* issue: older DXF formats are limited
820  to 255 bytes records (it was later raised to 2048); since I'm lazy
821  and text so long is not probable I just don't implement this rule.
822  If someone is interested in fixing this, you have to emit the first
823  partial lines with group code 3 (max 250 bytes each) and then finish
824  with a group code 1 (less than 250 bytes). The DXF refs explains it
825  in no more details...
826  */
827 
828  bool overlining = false;
829  fputs( " 1\n", outputFile );
830  for( unsigned i = 0; i < aText.length(); i++ )
831  {
832  /* Here I do a bad thing: writing the output one byte at a time!
833  but today I'm lazy and I have no idea on how to coerce a Unicode
834  wxString to spit out latin1 encoded text ...
835 
836  Atleast stdio is *supposed* to do output buffering, so there is
837  hope is not too slow */
838  wchar_t ch = aText[i];
839  if( ch > 255 )
840  {
841  // I can't encode this...
842  putc( '?', outputFile );
843  }
844  else
845  {
846  if( ch == '~' )
847  {
848  // Handle the overline toggle
849  fputs( overlining ? "%%o" : "%%O", outputFile );
850  overlining = !overlining;
851  }
852  else
853  {
854  putc( ch, outputFile );
855  }
856  }
857  }
858  putc( '\n', outputFile );
859  }
860 }
bool textAsLines
Definition: plot_common.h:1296
static const double DXF_OBLIQUE_ANGLE
Oblique angle for DXF native text (I don't remember if 15 degrees is the ISO value...
COLOR4D m_currentColor
Definition: plot_common.h:1297
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: drawtxt.cpp:227
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
bool containsNonAsciiChars(const wxString &string)
Checks if a given string contains non-ASCII characters.
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plot_common.h:534
virtual void SetColor(COLOR4D color) override
The DXF exporter handles 'colors' as layers...
void PLOTTER::ThickArc ( const wxPoint centre,
double  StAngle,
double  EndAngle,
int  rayon,
int  width,
EDA_DRAW_MODE_T  tracemode,
void *  aData 
)
virtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 465 of file class_plotter.cpp.

References PLOTTER::Arc(), PLOTTER::currentPenWidth, FILLED, NO_FILL, and PLOTTER::SetCurrentLineWidth().

Referenced by BRDITEMS_PLOTTER::Plot_1_EdgeModule(), and BRDITEMS_PLOTTER::PlotDrawSegment().

467 {
468  if( tracemode == FILLED )
469  Arc( centre, StAngle, EndAngle, radius, NO_FILL, width );
470  else
471  {
472  SetCurrentLineWidth( -1 );
473  Arc( centre, StAngle, EndAngle,
474  radius - ( width - currentPenWidth ) / 2, NO_FILL, -1 );
475  Arc( centre, StAngle, EndAngle,
476  radius + ( width - currentPenWidth ) / 2, NO_FILL, -1 );
477  }
478 }
int currentPenWidth
Definition: plot_common.h:540
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)
Generic fallback: arc rendered as a polyline.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
void PLOTTER::ThickCircle ( const wxPoint pos,
int  diametre,
int  width,
EDA_DRAW_MODE_T  tracemode,
void *  aData 
)
virtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 503 of file class_plotter.cpp.

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

Referenced by BRDITEMS_PLOTTER::Plot_1_EdgeModule(), and BRDITEMS_PLOTTER::PlotDrawSegment().

504 {
505  if( tracemode == FILLED )
506  Circle( pos, diametre, NO_FILL, width );
507  else
508  {
509  SetCurrentLineWidth( -1 );
510  Circle( pos, diametre - width + currentPenWidth, NO_FILL, -1 );
511  Circle( pos, diametre + width - currentPenWidth, NO_FILL, -1 );
512  }
513 }
int currentPenWidth
Definition: plot_common.h:540
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
void PLOTTER::ThickRect ( const wxPoint p1,
const wxPoint p2,
int  width,
EDA_DRAW_MODE_T  tracemode,
void *  aData 
)
virtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 481 of file class_plotter.cpp.

References PLOTTER::currentPenWidth, FILLED, NO_FILL, PLOTTER::Rect(), PLOTTER::SetCurrentLineWidth(), wxPoint::x, and wxPoint::y.

483 {
484  if( tracemode == FILLED )
485  Rect( p1, p2, NO_FILL, width );
486  else
487  {
488  SetCurrentLineWidth( -1 );
489  wxPoint offsetp1( p1.x - (width - currentPenWidth) / 2,
490  p1.y - (width - currentPenWidth) / 2 );
491  wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2,
492  p2.y + (width - currentPenWidth) / 2 );
493  Rect( offsetp1, offsetp2, NO_FILL, -1 );
494  offsetp1.x += (width - currentPenWidth);
495  offsetp1.y += (width - currentPenWidth);
496  offsetp2.x -= (width - currentPenWidth);
497  offsetp2.y -= (width - currentPenWidth);
498  Rect( offsetp1, offsetp2, NO_FILL, -1 );
499  }
500 }
int currentPenWidth
Definition: plot_common.h:540
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
void DXF_PLOTTER::ThickSegment ( const wxPoint start,
const wxPoint end,
int  width,
EDA_DRAW_MODE_T  tracemode,
void *  aData 
)
overridevirtual

Reimplemented from PLOTTER.

Definition at line 486 of file common_plotDXF_functions.cpp.

References PLOTTER::segmentAsOval().

Referenced by PlotPoly().

488 {
489  segmentAsOval( aStart, aEnd, aWidth, aPlotMode );
490 }
void segmentAsOval(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode)
Cdonvert a thick segment and plot it as an oval.
DPOINT PLOTTER::userToDeviceCoordinates ( const wxPoint aCoordinate)
protectedvirtualinherited

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

Also convert from a wxPoint to DPOINT, since some output engines needs floating point coordinates.

Definition at line 96 of file class_plotter.cpp.

References PLOTTER::iuPerDeviceUnit, PLOTTER::m_mirrorIsHorizontal, PLOTTER::m_plotMirror, PLOTTER::m_yaxisReversed, PLOTTER::paperSize, PLOTTER::plotOffset, PLOTTER::plotScale, wxPoint::x, and wxPoint::y.

Referenced by HPGL_PLOTTER::Arc(), PS_PLOTTER::Arc(), PDF_PLOTTER::Arc(), SVG_PLOTTER::Arc(), GERBER_PLOTTER::Arc(), Arc(), PS_PLOTTER::Circle(), PDF_PLOTTER::Circle(), SVG_PLOTTER::Circle(), Circle(), PSLIKE_PLOTTER::computeTextParameters(), HPGL_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::FlashPadCircle(), GERBER_PLOTTER::FlashPadOval(), GERBER_PLOTTER::FlashPadRect(), HPGL_PLOTTER::PenTo(), PS_PLOTTER::PenTo(), PDF_PLOTTER::PenTo(), SVG_PLOTTER::PenTo(), GERBER_PLOTTER::PenTo(), PenTo(), PS_PLOTTER::PlotImage(), PDF_PLOTTER::PlotImage(), PS_PLOTTER::PlotPoly(), PDF_PLOTTER::PlotPoly(), SVG_PLOTTER::PlotPoly(), HPGL_PLOTTER::Rect(), PS_PLOTTER::Rect(), PDF_PLOTTER::Rect(), SVG_PLOTTER::Rect(), PS_PLOTTER::Text(), and Text().

97 {
98  wxPoint pos = aCoordinate - plotOffset;
99 
100  double x = pos.x * plotScale;
101  double y = ( paperSize.y - pos.y * plotScale );
102 
103  if( m_plotMirror )
104  {
106  x = ( paperSize.x - pos.x * plotScale );
107  else
108  y = pos.y * plotScale;
109  }
110 
111  if( m_yaxisReversed )
112  y = paperSize.y - y;
113 
114  x *= iuPerDeviceUnit;
115  y *= iuPerDeviceUnit;
116 
117  return DPOINT( x, y );
118 }
wxPoint plotOffset
Plot offset (in IUs)
Definition: plot_common.h:525
bool m_yaxisReversed
true to mirror horizontally (else vertically)
Definition: plot_common.h:531
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plot_common.h:529
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plot_common.h:513
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plot_common.h:522
VECTOR2< double > DPOINT
Definition: vector2d.h:585
wxSize paperSize
Paper size in IU - not in mils.
Definition: plot_common.h:550
bool m_mirrorIsHorizontal
Definition: plot_common.h:530
DPOINT PLOTTER::userToDeviceSize ( const wxSize &  size)
protectedvirtualinherited

Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT)

Definition at line 121 of file class_plotter.cpp.

References PLOTTER::iuPerDeviceUnit, and PLOTTER::plotScale.

Referenced by PS_PLOTTER::Arc(), SVG_PLOTTER::Arc(), Arc(), HPGL_PLOTTER::Circle(), PS_PLOTTER::Circle(), PDF_PLOTTER::Circle(), SVG_PLOTTER::Circle(), Circle(), PSLIKE_PLOTTER::computeTextParameters(), HPGL_PLOTTER::FlashPadCircle(), PLOTTER::GetDashGapLenIU(), PLOTTER::GetDashMarkLenIU(), PDF_PLOTTER::PlotImage(), HPGL_PLOTTER::SetCurrentLineWidth(), PS_PLOTTER::SetCurrentLineWidth(), PDF_PLOTTER::SetCurrentLineWidth(), SVG_PLOTTER::setSVGPlotStyle(), PDF_PLOTTER::StartPage(), HPGL_PLOTTER::StartPlot(), PS_PLOTTER::StartPlot(), PS_PLOTTER::Text(), PDF_PLOTTER::Text(), and Text().

122 {
123  return DPOINT( size.x * plotScale * iuPerDeviceUnit,
124  size.y * plotScale * iuPerDeviceUnit );
125 }
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plot_common.h:513
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plot_common.h:522
VECTOR2< double > DPOINT
Definition: vector2d.h:585
double PLOTTER::userToDeviceSize ( double  size) const
protectedvirtualinherited

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

Definition at line 128 of file class_plotter.cpp.

References PLOTTER::iuPerDeviceUnit, and PLOTTER::plotScale.

129 {
130  return size * plotScale * iuPerDeviceUnit;
131 }
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plot_common.h:513
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plot_common.h:522

Member Data Documentation

wxString PLOTTER::creator
protectedinherited
const int PLOTTER::DO_NOT_SET_LINE_WIDTH = -2
staticinherited
COLOR4D DXF_PLOTTER::m_currentColor
protected

Definition at line 1297 of file plot_common.h.

Referenced by Arc(), Circle(), DXF_PLOTTER(), PenTo(), SetColor(), SetViewport(), and Text().

wxArrayString PLOTTER::m_headerExtraLines
protectedinherited
bool PLOTTER::m_mirrorIsHorizontal
protectedinherited
bool PLOTTER::m_plotMirror
protectedinherited
bool PLOTTER::m_yaxisReversed
protectedinherited

true to mirror horizontally (else vertically)

Definition at line 531 of file plot_common.h.

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

const unsigned PLOTTER::MARKER_COUNT = 58
staticinherited

Draw a marker (used for the drill map)

Definition at line 382 of file plot_common.h.

Referenced by PLOTTER::Marker().

bool PLOTTER::negativeMode
protectedinherited

true to plot in color, false to plot in black and white

Definition at line 538 of file plot_common.h.

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

FILE* PLOTTER::outputFile
protectedinherited

true if the Y axis is top to bottom (SVG)

Output file

Definition at line 534 of file plot_common.h.

Referenced by HPGL_PLOTTER::Arc(), PS_PLOTTER::Arc(), SVG_PLOTTER::Arc(), GERBER_PLOTTER::Arc(), Arc(), HPGL_PLOTTER::Circle(), PS_PLOTTER::Circle(), SVG_PLOTTER::Circle(), Circle(), GERBER_PLOTTER::clearNetAttribute(), PDF_PLOTTER::ClosePage(), PDF_PLOTTER::closePdfObject(), PDF_PLOTTER::closePdfStream(), GERBER_PLOTTER::emitDcode(), PS_PLOTTER::emitSetRGBColor(), HPGL_PLOTTER::EndPlot(), PS_PLOTTER::EndPlot(), PDF_PLOTTER::EndPlot(), SVG_PLOTTER::EndPlot(), GERBER_PLOTTER::EndPlot(), EndPlot(), HPGL_PLOTTER::FlashPadCircle(), FlashPadCircle(), HPGL_PLOTTER::FlashPadOval(), PSLIKE_PLOTTER::FlashPadOval(), GERBER_PLOTTER::FlashPadOval(), FlashPadOval(), GERBER_PLOTTER::FlashPadRect(), FlashPadRect(), FlashPadTrapez(), GERBER_PLOTTER::formatNetAttribute(), PLOTTER::OpenFile(), PDF_PLOTTER::OpenFile(), HPGL_PLOTTER::penControl(), HPGL_PLOTTER::PenTo(), PS_PLOTTER::PenTo(), SVG_PLOTTER::PenTo(), GERBER_PLOTTER::PenTo(), PenTo(), PS_PLOTTER::PlotImage(), HPGL_PLOTTER::PlotPoly(), PS_PLOTTER::PlotPoly(), SVG_PLOTTER::PlotPoly(), GERBER_PLOTTER::PlotPoly(), PLOTTER::PLOTTER(), HPGL_PLOTTER::Rect(), PS_PLOTTER::Rect(), SVG_PLOTTER::Rect(), Rect(), GERBER_PLOTTER::selectAperture(), SetColor(), PS_PLOTTER::SetCurrentLineWidth(), HPGL_PLOTTER::SetDash(), PS_PLOTTER::SetDash(), GERBER_PLOTTER::SetLayerPolarity(), PLOTTER::SetPageSettings(), SVG_PLOTTER::setSVGPlotStyle(), HPGL_PLOTTER::SetViewport(), PS_PLOTTER::SetViewport(), SVG_PLOTTER::SetViewport(), GERBER_PLOTTER::SetViewport(), SetViewport(), PDF_PLOTTER::StartPage(), PDF_PLOTTER::startPdfObject(), PDF_PLOTTER::startPdfStream(), HPGL_PLOTTER::StartPlot(), PS_PLOTTER::StartPlot(), PDF_PLOTTER::StartPlot(), SVG_PLOTTER::StartPlot(), GERBER_PLOTTER::StartPlot(), StartPlot(), PS_PLOTTER::Text(), Text(), HPGL_PLOTTER::ThickSegment(), GERBER_PLOTTER::writeApertureList(), and PLOTTER::~PLOTTER().

wxPoint PLOTTER::penLastpos
protectedinherited

Last pen positions; set to -1,-1 when the pen is at rest.

Definition at line 544 of file plot_common.h.

Referenced by HPGL_PLOTTER::penControl(), HPGL_PLOTTER::PenTo(), PS_PLOTTER::PenTo(), PDF_PLOTTER::PenTo(), SVG_PLOTTER::PenTo(), and PenTo().

char PLOTTER::penState
protectedinherited

Current pen state: 'U', 'D' or 'Z' (see PenTo)

Definition at line 542 of file plot_common.h.

Referenced by HPGL_PLOTTER::penControl(), PS_PLOTTER::PenTo(), PDF_PLOTTER::PenTo(), SVG_PLOTTER::PenTo(), GERBER_PLOTTER::PenTo(), and PLOTTER::PLOTTER().

bool DXF_PLOTTER::textAsLines
protected

Definition at line 1296 of file plot_common.h.

Referenced by DXF_PLOTTER(), SetTextMode(), and Text().

wxString PLOTTER::title
protectedinherited

Definition at line 547 of file plot_common.h.

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


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