KiCad PCB EDA Suite
DXF_PLOTTER Class Reference

#include <class_plotter.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 (int dashed) override
 
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 aTraceMode, 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 PlotPoly (const SHAPE_LINE_CHAIN &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)
 Function PlotPoly. More...
 
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 position. 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 GetDotMarkLenIU () const
 
double GetDashMarkLenIU () const
 
double GetDashGapLenIU () const
 

Protected Attributes

bool textAsLines
 
COLOR4D m_currentColor
 
int m_currentLineType
 
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 1232 of file class_plotter.h.

Constructor & Destructor Documentation

DXF_PLOTTER::DXF_PLOTTER ( )
inline

Definition at line 1235 of file class_plotter.h.

References BLACK, m_currentColor, m_currentLineType, and textAsLines.

1235  : textAsLines( false )
1236  {
1237  textAsLines = true;
1239  m_currentLineType = 0;
1240  }
COLOR4D m_currentColor
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 176 of file class_plotter.h.

References PLOTTER::m_headerExtraLines.

Referenced by AddGerberX2Attribute(), AddGerberX2Header(), and GERBER_WRITER::createDrillFile().

177  {
178  m_headerExtraLines.Add( aExtraString );
179  }
wxArrayString m_headerExtraLines
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 594 of file common_plotDXF_functions.cpp.

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

596 {
597  wxASSERT( outputFile );
598 
599  if( radius <= 0 )
600  return;
601 
602  // In DXF, arcs are drawn CCW.
603  // In Kicad, arcs are CW or CCW
604  // If StAngle > EndAngle, it is CW. So transform it to CCW
605  if( StAngle > EndAngle )
606  {
607  std::swap( StAngle, EndAngle );
608  }
609 
610  DPOINT centre_dev = userToDeviceCoordinates( centre );
611  double radius_dev = userToDeviceSize( radius );
612 
613  // Emit a DXF ARC entity
614  wxString cname = getDXFColorName( m_currentColor );
615  fprintf( outputFile,
616  "0\nARC\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n50\n%g\n51\n%g\n",
617  TO_UTF8( cname ),
618  centre_dev.x, centre_dev.y, radius_dev,
619  StAngle / 10.0, EndAngle / 10.0 );
620 }
static wxString getDXFColorName(COLOR4D aColor)
COLOR4D m_currentColor
#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)
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 410 of file common_plotDXF_functions.cpp.

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

Referenced by FlashPadCircle().

411 {
412  wxASSERT( outputFile );
413  double radius = userToDeviceSize( diameter / 2 );
414  DPOINT centre_dev = userToDeviceCoordinates( centre );
415  if( radius > 0 )
416  {
417  wxString cname = getDXFColorName( m_currentColor );
418 
419  if( !fill )
420  {
421  fprintf( outputFile, "0\nCIRCLE\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n",
422  TO_UTF8( cname ),
423  centre_dev.x, centre_dev.y, radius );
424  }
425 
426  if( fill == FILLED_SHAPE )
427  {
428  double r = radius*0.5;
429  fprintf( outputFile, "0\nPOLYLINE\n");
430  fprintf( outputFile, "8\n%s\n66\n1\n70\n1\n", TO_UTF8( cname ));
431  fprintf( outputFile, "40\n%g\n41\n%g\n", radius, radius);
432  fprintf( outputFile, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
433  fprintf( outputFile, "10\n%g\n 20\n%g\n42\n1.0\n",
434  centre_dev.x-r, centre_dev.y );
435  fprintf( outputFile, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
436  fprintf( outputFile, "10\n%g\n 20\n%g\n42\n1.0\n",
437  centre_dev.x+r, centre_dev.y );
438  fprintf( outputFile, "0\nSEQEND\n");
439  }
440  }
441 }
static wxString getDXFColorName(COLOR4D aColor)
COLOR4D m_currentColor
#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)
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 185 of file class_plotter.h.

References PLOTTER::m_headerExtraLines.

Referenced by StartPlotBoard().

186  {
187  m_headerExtraLines.Clear();
188  }
wxArrayString m_headerExtraLines
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 454 of file class_plotter.h.

Referenced by PlotSilkScreen(), and PlotStandardLayer().

454 {}
bool DXF_PLOTTER::EndPlot ( )
overridevirtual

Implements PLOTTER.

Definition at line 359 of file common_plotDXF_functions.cpp.

References PLOTTER::outputFile.

Referenced by DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF().

360 {
361  wxASSERT( outputFile );
362 
363  // DXF FOOTER
364  fputs( " 0\n"
365  "ENDSEC\n"
366  " 0\n"
367  "EOF\n", outputFile );
368  fclose( outputFile );
369  outputFile = NULL;
370 
371  return true;
372 }
FILE * outputFile
true if the Y axis is top to bottom (SVG)
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 647 of file common_plotDXF_functions.cpp.

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

649 {
650  wxASSERT( outputFile );
651  Circle( pos, diametre, NO_FILL );
652 }
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)
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 attributes)

Implements PLOTTER.

Definition at line 742 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.

745 {
746  for( int cnt = 0; cnt < aPolygons->OutlineCount(); ++cnt )
747  {
748  SHAPE_LINE_CHAIN& poly = aPolygons->Outline( cnt );
749 
750  MoveTo( wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
751 
752  for( int ii = 1; ii < poly.PointCount(); ++ii )
753  LineTo( wxPoint( poly.Point( ii ).x, poly.Point( ii ).y ) );
754 
755  FinishTo(wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
756  }
757 }
void FinishTo(const wxPoint &pos)
int PointCount() const
Function PointCount()
int OutlineCount() const
Returns the number of outlines in the set
void LineTo(const wxPoint &pos)
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
void MoveTo(const wxPoint &pos)
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 625 of file common_plotDXF_functions.cpp.

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

627 {
628  wxASSERT( outputFile );
629  wxSize size( aSize );
630 
631  /* The chip is reduced to an oval tablet with size.y > size.x
632  * (Oval vertical orientation 0) */
633  if( size.x > size.y )
634  {
635  std::swap( size.x, size.y );
636  orient = AddAngles( orient, 900 );
637  }
638 
639  sketchOval( pos, size, orient, -1 );
640 }
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
Definition: trigo.h:267
FILE * outputFile
true if the Y axis is top to bottom (SVG)
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 658 of file common_plotDXF_functions.cpp.

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

660 {
661  wxASSERT( outputFile );
662  wxSize size;
663  int ox, oy, fx, fy;
664 
665  size.x = padsize.x / 2;
666  size.y = padsize.y / 2;
667 
668  if( size.x < 0 )
669  size.x = 0;
670  if( size.y < 0 )
671  size.y = 0;
672 
673  // If a dimension is zero, the trace is reduced to 1 line
674  if( size.x == 0 )
675  {
676  ox = pos.x;
677  oy = pos.y - size.y;
678  RotatePoint( &ox, &oy, pos.x, pos.y, orient );
679  fx = pos.x;
680  fy = pos.y + size.y;
681  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
682  MoveTo( wxPoint( ox, oy ) );
683  FinishTo( wxPoint( fx, fy ) );
684  return;
685  }
686  if( size.y == 0 )
687  {
688  ox = pos.x - size.x;
689  oy = pos.y;
690  RotatePoint( &ox, &oy, pos.x, pos.y, orient );
691  fx = pos.x + size.x;
692  fy = pos.y;
693  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
694  MoveTo( wxPoint( ox, oy ) );
695  FinishTo( wxPoint( fx, fy ) );
696  return;
697  }
698 
699  ox = pos.x - size.x;
700  oy = pos.y - size.y;
701  RotatePoint( &ox, &oy, pos.x, pos.y, orient );
702  MoveTo( wxPoint( ox, oy ) );
703 
704  fx = pos.x - size.x;
705  fy = pos.y + size.y;
706  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
707  LineTo( wxPoint( fx, fy ) );
708 
709  fx = pos.x + size.x;
710  fy = pos.y + size.y;
711  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
712  LineTo( wxPoint( fx, fy ) );
713 
714  fx = pos.x + size.x;
715  fy = pos.y - size.y;
716  RotatePoint( &fx, &fy, pos.x, pos.y, orient );
717  LineTo( wxPoint( fx, fy ) );
718 
719  FinishTo( wxPoint( ox, oy ) );
720 }
void FinishTo(const wxPoint &pos)
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void LineTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
FILE * outputFile
true if the Y axis is top to bottom (SVG)
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
aCornerRadiusRadius of the rounded corners
aOrientThe rotation of the shape
aTraceModeFILLED or SKETCH
aDataan auxiliary info (mainly for gerber format attributes)

Implements PLOTTER.

Definition at line 722 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.

725 {
726  SHAPE_POLY_SET outline;
727  const int segmentToCircleCount = 64;
728  TransformRoundRectToPolygon( outline, aPadPos, aSize, aOrient,
729  aCornerRadius, segmentToCircleCount );
730 
731  // TransformRoundRectToPolygon creates only one convex polygon
732  SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
733 
734  MoveTo( wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
735 
736  for( int ii = 1; ii < poly.PointCount(); ++ii )
737  LineTo( wxPoint( poly.Point( ii ).x, poly.Point( ii ).y ) );
738 
739  FinishTo( wxPoint( poly.Point( 0 ).x, poly.Point( 0 ).y ) );
740 }
void FinishTo(const wxPoint &pos)
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)
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)
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  aTraceMode,
void *  aData 
)
overridevirtual

DXF trapezoidal pad: only sketch mode is supported.

Implements PLOTTER.

Definition at line 763 of file common_plotDXF_functions.cpp.

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

765 {
766  wxASSERT( outputFile );
767  wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
768 
769  for( int ii = 0; ii < 4; ii++ )
770  {
771  coord[ii] = aCorners[ii];
772  RotatePoint( &coord[ii], aPadOrient );
773  coord[ii] += aPadPos;
774  }
775 
776  // Plot edge:
777  MoveTo( coord[0] );
778  LineTo( coord[1] );
779  LineTo( coord[2] );
780  LineTo( coord[3] );
781  FinishTo( coord[0] );
782 }
void FinishTo(const wxPoint &pos)
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void LineTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
FILE * outputFile
true if the Y axis is top to bottom (SVG)
bool PLOTTER::GetColorMode ( ) const
inlineinherited

Definition at line 131 of file class_plotter.h.

References PLOTTER::colorMode.

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

132  {
133  return colorMode;
134  }
bool colorMode
double PLOTTER::GetDashGapLenIU ( ) const
protectedinherited

Definition at line 150 of file class_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), PLOTTER::GetDotMarkLenIU(), and PLOTTER::userToDeviceSize().

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

151 {
152  return 3.0 * GetDotMarkLenIU() + userToDeviceSize( 2 * GetCurrentLineWidth() );
153 }
double GetDotMarkLenIU() const
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
virtual int GetCurrentLineWidth() const
double PLOTTER::GetDashMarkLenIU ( ) const
protectedinherited

Definition at line 144 of file class_plotter.cpp.

References PLOTTER::GetDashGapLenIU(), PLOTTER::GetDotMarkLenIU(), and max.

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

145 {
146  return std::max( GetDashGapLenIU(), 5.0 * GetDotMarkLenIU() );
147 }
double GetDotMarkLenIU() const
#define max(a, b)
Definition: auxiliary.h:86
double GetDashGapLenIU() const
static wxString DXF_PLOTTER::GetDefaultFileExtension ( )
inlinestatic

Definition at line 1247 of file class_plotter.h.

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

1248  {
1249  return wxString( wxT( "dxf" ) );
1250  }
double PLOTTER::GetDotMarkLenIU ( ) const
protectedinherited

Definition at line 137 of file class_plotter.cpp.

References PLOTTER::GetCurrentLineWidth(), PLOTTER::m_dotMarkLength_mm, PLOTTER::m_IUsPerDecimil, max, and PLOTTER::userToDeviceSize().

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

138 {
139  return userToDeviceSize( std::max( 1.0,
140  m_dotMarkLength_mm * 10000 / 25.4 * m_IUsPerDecimil - GetCurrentLineWidth() ) );
141 }
double m_dotMarkLength_mm
Dotted line parameter in mm: segment.
double m_IUsPerDecimil
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
virtual int GetCurrentLineWidth() const
#define max(a, b)
Definition: auxiliary.h:86
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 217 of file class_plotter.h.

References PLOTTER::m_IUsPerDecimil.

Referenced by PlotWorkSheet().

217 { return m_IUsPerDecimil; }
double m_IUsPerDecimil
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 1242 of file class_plotter.h.

References PLOT_FORMAT_DXF.

1243  {
1244  return PLOT_FORMAT_DXF;
1245  }
void PLOTTER::LineTo ( const wxPoint pos)
inlineinherited

Definition at line 246 of file class_plotter.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().

247  {
248  PenTo( pos, 'D' );
249  }
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 position.

Diameter diameter = (coord table) hole AShapeId = index (used to generate forms characters)

Definition at line 282 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 GENDRILL_WRITER_BASE::genDrillMapFile(), and GENDRILL_WRITER_BASE::plotDrillMarks().

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

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

Referenced by PLOTTER::Marker().

269 {
270  MoveTo( wxPoint( pos.x + radius, pos.y - radius ) );
271  FinishTo( wxPoint( pos.x - radius, pos.y + radius ) );
272 }
void FinishTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
void PLOTTER::markerCircle ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a circle centered on the position.

Building block for markers

Definition at line 224 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

225 {
226  Circle( position, radius * 2, NO_FILL, GetCurrentLineWidth() );
227 }
virtual int GetCurrentLineWidth() const
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 254 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

255 {
256  MoveTo( wxPoint( pos.x - radius, pos.y ) );
257  FinishTo( wxPoint( pos.x + radius, pos.y ) );
258 }
void FinishTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
void PLOTTER::markerLozenge ( const wxPoint position,
int  radius 
)
protectedinherited

Plot a lozenge centered on the position.

Building block for markers

Definition at line 230 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

231 {
232  std::vector< wxPoint > corner_list;
233  wxPoint corner;
234  corner.x = position.x;
235  corner.y = position.y + radius;
236  corner_list.push_back( corner );
237  corner.x = position.x + radius;
238  corner.y = position.y,
239  corner_list.push_back( corner );
240  corner.x = position.x;
241  corner.y = position.y - radius;
242  corner_list.push_back( corner );
243  corner.x = position.x - radius;
244  corner.y = position.y;
245  corner_list.push_back( corner );
246  corner.x = position.x;
247  corner.y = position.y + radius;
248  corner_list.push_back( corner );
249 
250  PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() );
251 }
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
void PLOTTER::markerSlash ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a / bar centered on the position.

Building block for markers

Definition at line 261 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

262 {
263  MoveTo( wxPoint( pos.x - radius, pos.y - radius ) );
264  FinishTo( wxPoint( pos.x + radius, pos.y + radius ) );
265 }
void FinishTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
void PLOTTER::markerSquare ( const wxPoint position,
int  radius 
)
protectedinherited

Plot a square centered on the position.

Building block for markers

Definition at line 199 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

200 {
201  double r = KiROUND( radius / 1.4142 );
202  std::vector< wxPoint > corner_list;
203  wxPoint 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  corner.x = position.x - r;
211  corner.y = position.y - r;
212  corner_list.push_back( corner );
213  corner.x = position.x - r;
214  corner.y = position.y + r;
215  corner_list.push_back( corner );
216  corner.x = position.x + r;
217  corner.y = position.y + r;
218  corner_list.push_back( corner );
219 
220  PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() );
221 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:106
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
void PLOTTER::markerVBar ( const wxPoint pos,
int  radius 
)
protectedinherited

Plot a | bar centered on the position.

Building block for markers

Definition at line 275 of file class_plotter.cpp.

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

Referenced by PLOTTER::Marker().

276 {
277  MoveTo( wxPoint( pos.x, pos.y - radius ) );
278  FinishTo( wxPoint( pos.x, pos.y + radius ) );
279 }
void FinishTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
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 82 of file class_plotter.cpp.

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

Referenced by GERBER_WRITER::createDrillFile(), GENDRILL_WRITER_BASE::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().

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

Definition at line 257 of file class_plotter.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().

258  {
259  // The point is not important with Z motion
260  PenTo( wxPoint( 0, 0 ), 'Z' );
261  }
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 553 of file common_plotDXF_functions.cpp.

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

554 {
555  wxASSERT( outputFile );
556  if( plume == 'Z' )
557  {
558  return;
559  }
560  DPOINT pos_dev = userToDeviceCoordinates( pos );
561  DPOINT pen_lastpos_dev = userToDeviceCoordinates( penLastpos );
562 
563  if( penLastpos != pos && plume == 'D' )
564  {
565  wxASSERT( m_currentLineType >= 0 && m_currentLineType < 4 );
566  // DXF LINE
567  wxString cname = getDXFColorName( m_currentColor );
568  const char *lname = dxf_lines[ m_currentLineType ];
569  fprintf( outputFile, "0\nLINE\n8\n%s\n6\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n",
570  TO_UTF8( cname ), lname,
571  pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y );
572  }
573  penLastpos = pos;
574 }
static wxString getDXFColorName(COLOR4D aColor)
COLOR4D m_currentColor
wxPoint penLastpos
Last pen positions; set to -1,-1 when the pen is at rest.
#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)
static const char * dxf_lines[]
Line types in the boilerplate DXF header.
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 182 of file class_plotter.cpp.

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

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

183 {
184  wxSize size( aImage.GetWidth() * aScaleFactor,
185  aImage.GetHeight() * aScaleFactor );
186 
187  wxPoint start = aPos;
188  start.x -= size.x / 2;
189  start.y -= size.y / 2;
190 
191  wxPoint end = start;
192  end.x += size.x;
193  end.y += size.y;
194 
195  Rect( start, end, NO_FILL );
196 }
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
void PLOTTER::PlotPoly ( const SHAPE_LINE_CHAIN aCornerList,
FILL_T  aFill,
int  aWidth = USE_DEFAULT_LINE_WIDTH,
void *  aData = NULL 
)
virtualinherited

Function PlotPoly.

Draw a polygon ( filled or not )

Parameters
aCornerList= corners list (a SHAPE_LINE_CHAIN)
aFill= type of fill
aWidth= line width
aDataan auxiliary info (mainly for gerber format)

Definition at line 526 of file class_plotter.cpp.

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

528 {
529  std::vector< wxPoint > cornerList;
530 
531  for( int ii = 0; ii < aCornerList.PointCount(); ii++ )
532  cornerList.push_back( wxPoint( aCornerList.CPoint( ii ) ) );
533 
534  PlotPoly( cornerList , aFill, aWidth, aData );
535 }
int PointCount() const
Function PointCount()
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
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 450 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.

452 {
453  if( aCornerList.size() <= 1 )
454  return;
455 
456  unsigned last = aCornerList.size() - 1;
457 
458  // Plot outlines with lines (thickness = 0) to define the polygon
459  if( aWidth <= 0 )
460  {
461  MoveTo( aCornerList[0] );
462 
463  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
464  LineTo( aCornerList[ii] );
465 
466  // Close polygon if 'fill' requested
467  if( aFill )
468  {
469  if( aCornerList[last] != aCornerList[0] )
470  LineTo( aCornerList[0] );
471  }
472 
473  PenFinish();
474 
475  return;
476  }
477 
478 
479  // if the polygon outline has thickness, and is not filled
480  // (i.e. is a polyline) plot outlines with thick segments
481  if( aWidth > 0 && !aFill )
482  {
483  MoveTo( aCornerList[0] );
484 
485  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
486  ThickSegment( aCornerList[ii-1], aCornerList[ii],
487  aWidth, FILLED, NULL );
488 
489  return;
490  }
491 
492  // The polygon outline has thickness, and is filled
493  // Build and plot the polygon which contains the initial
494  // polygon and its thick outline
495  SHAPE_POLY_SET bufferOutline;
496  SHAPE_POLY_SET bufferPolybase;
497  const int circleToSegmentsCount = 16;
498 
499  bufferPolybase.NewOutline();
500 
501  // enter outline as polygon:
502  for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
503  {
505  aCornerList[ii-1], aCornerList[ii], circleToSegmentsCount, aWidth );
506  }
507 
508  // enter the initial polygon:
509  for( unsigned ii = 0; ii < aCornerList.size(); ii++ )
510  {
511  bufferPolybase.Append( aCornerList[ii] );
512  }
513 
514  // Merge polygons to build the polygon which contains the initial
515  // polygon and its thick outline
516 
517  // create the outline which contains thick outline:
518  bufferPolybase.BooleanAdd( bufferOutline, SHAPE_POLY_SET::PM_FAST );
519  bufferPolybase.Fracture( SHAPE_POLY_SET::PM_FAST );
520 
521  if( bufferPolybase.OutlineCount() < 1 ) // should not happen
522  return;
523 
524  const SHAPE_LINE_CHAIN& path = bufferPolybase.COutline( 0 );
525 
526  if( path.PointCount() < 2 ) // should not happen
527  return;
528 
529  // Now, output the final polygon to DXF file:
530  last = path.PointCount() - 1;
531  VECTOR2I point = path.CPoint( 0 );
532 
533  wxPoint startPoint( point.x, point.y );
534  MoveTo( startPoint );
535 
536  for( int ii = 1; ii < path.PointCount(); ii++ )
537  {
538  point = path.CPoint( ii );
539  LineTo( wxPoint( point.x, point.y ) );
540  }
541 
542  // Close polygon, if needed
543  point = path.CPoint( last );
544  wxPoint endPoint( point.x, point.y );
545 
546  if( endPoint != startPoint )
547  LineTo( startPoint );
548 
549  PenFinish();
550 }
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()
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)
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)
Class SHAPE_LINE_CHAIN.
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline) ...
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 393 of file common_plotDXF_functions.cpp.

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

394 {
395  wxASSERT( outputFile );
396  MoveTo( p1 );
397  LineTo( wxPoint( p1.x, p2.y ) );
398  LineTo( wxPoint( p2.x, p2.y ) );
399  LineTo( wxPoint( p2.x, p1.y ) );
400  FinishTo( wxPoint( p1.x, p1.y ) );
401 }
void FinishTo(const wxPoint &pos)
void LineTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
FILE * outputFile
true if the Y axis is top to bottom (SVG)
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 388 of file class_plotter.cpp.

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

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

390 {
391  wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
392  wxSize size( end.x - start.x, end.y - start.y );
393  double orient;
394 
395  if( size.y == 0 )
396  orient = 0;
397  else if( size.x == 0 )
398  orient = 900;
399  else
400  orient = -ArcTangente( size.y, size.x );
401 
402  size.x = KiROUND( EuclideanNorm( size ) ) + width;
403  size.y = width;
404 
405  FlashPadOval( center, size, orient, tracemode, NULL );
406 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:112
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:106
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 378 of file common_plotDXF_functions.cpp.

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

Referenced by Text().

379 {
380  if( ( colorMode )
381  || ( color == COLOR4D::BLACK )
382  || ( color == COLOR4D::WHITE ) )
383  {
385  }
386  else
388 }
bool colorMode
COLOR4D m_currentColor
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 1265 of file class_plotter.h.

References PLOTTER::currentPenWidth.

1266  {
1267  currentPenWidth = 0;
1268  }
int currentPenWidth
void DXF_PLOTTER::SetDash ( int  dashed)
overridevirtual

Implements PLOTTER.

Definition at line 577 of file common_plotDXF_functions.cpp.

References m_currentLineType.

578 {
579  wxASSERT( dashed >= 0 && dashed < 4 );
580  m_currentLineType = dashed;
581 }
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 1270 of file class_plotter.h.

References PLOTTER::defaultPenWidth.

Referenced by SetViewport().

1271  {
1272  // DXF lines are infinitesimal
1273  defaultPenWidth = 0;
1274  }
int defaultPenWidth
true to generate a negative image (PS mode mainly)
virtual void PLOTTER::SetGerberCoordinatesFormat ( int  aResolution,
bool  aUseInches = false 
)
inlinevirtualinherited

Reimplemented in GERBER_PLOTTER.

Definition at line 433 of file class_plotter.h.

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

434  {
435  // NOP for most plotters. Only for Gerber plotter
436  }
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 419 of file class_plotter.h.

Referenced by PlotOneBoardLayer().

420  {
421  // NOP for most plotters
422  }
virtual void PLOTTER::SetNegative ( bool  _negative)
inlinevirtualinherited

Definition at line 121 of file class_plotter.h.

References PLOTTER::negativeMode.

Referenced by FillNegativeKnockout().

122  {
123  negativeMode = _negative;
124  }
bool negativeMode
true to plot in color, false to plot in black and white
virtual void DXF_PLOTTER::SetTextMode ( PlotTextMode  mode)
inlineoverridevirtual

DXF handles NATIVE text emitting TEXT entities.

Reimplemented from PLOTTER.

Definition at line 1255 of file class_plotter.h.

References PLOTTEXTMODE_DEFAULT, PLOTTEXTMODE_NATIVE, and textAsLines.

1256  {
1257  if( mode != PLOTTEXTMODE_DEFAULT )
1258  textAsLines = ( mode != PLOTTEXTMODE_NATIVE );
1259  }
virtual void PLOTTER::SetTitle ( const wxString &  aTitle)
inlinevirtualinherited

Definition at line 166 of file class_plotter.h.

References PLOTTER::title.

Referenced by DIALOG_PLOT_SCHEMATIC::createPDFFile().

167  {
168  title = aTitle;
169  }
wxString title
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 127 of file common_plotDXF_functions.cpp.

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

Referenced by DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF().

129 {
130  plotOffset = aOffset;
131  plotScale = aScale;
132 
133  /* DXF paper is 'virtual' so there is no need of a paper size.
134  Also this way we can handle the aux origin which can be useful
135  (for example when aligning to a mechanical drawing) */
136  paperSize.x = 0;
137  paperSize.y = 0;
138 
139  /* Like paper size DXF units are abstract too. Anyway there is a
140  * system variable (MEASUREMENT) which will be set to 1 to indicate
141  * metric units */
142  m_IUsPerDecimil = aIusPerDecimil;
143  iuPerDeviceUnit = 1.0 / aIusPerDecimil; // Gives a DXF in decimils
144  iuPerDeviceUnit *= 0.00254; // ... now in mm
145 
146  SetDefaultLineWidth( 0 ); // No line width on DXF
147  m_plotMirror = false; // No mirroring on DXF
149 }
COLOR4D m_currentColor
double m_IUsPerDecimil
wxPoint plotOffset
Plot offset (in IUs)
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: colors.h:45
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
wxSize paperSize
Paper size in IU - not in mils.
void PLOTTER::sketchOval ( const wxPoint pos,
const wxSize &  size,
double  orient,
int  width 
)
protectedinherited

Definition at line 409 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().

410 {
411  SetCurrentLineWidth( width );
412  width = currentPenWidth;
413  int radius, deltaxy, cx, cy;
414  wxSize size( aSize );
415 
416  if( size.x > size.y )
417  {
418  std::swap( size.x, size.y );
419  orient = AddAngles( orient, 900 );
420  }
421 
422  deltaxy = size.y - size.x; /* distance between centers of the oval */
423  radius = ( size.x - width ) / 2;
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 = radius;
434  cy = -deltaxy / 2;
435  RotatePoint( &cx, &cy, orient );
436  MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
437  cx = radius;
438  cy = deltaxy / 2;
439  RotatePoint( &cx, &cy, orient );
440  FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
441 
442  cx = 0;
443  cy = deltaxy / 2;
444  RotatePoint( &cx, &cy, orient );
445  Arc( wxPoint( cx + pos.x, cy + pos.y ),
446  orient + 1800, orient + 3600,
447  radius, NO_FILL );
448  cx = 0;
449  cy = -deltaxy / 2;
450  RotatePoint( &cx, &cy, orient );
451  Arc( wxPoint( cx + pos.x, cy + pos.y ),
452  orient, orient + 1800,
453  radius, NO_FILL );
454 }
void FinishTo(const wxPoint &pos)
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:267
void MoveTo(const wxPoint &pos)
int currentPenWidth
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 445 of file class_plotter.h.

Referenced by PlotSilkScreen(), and PlotStandardLayer().

445 {}
bool DXF_PLOTTER::StartPlot ( )
overridevirtual

Opens the DXF plot with a skeleton header.

Implements PLOTTER.

Definition at line 154 of file common_plotDXF_functions.cpp.

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

Referenced by DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF().

155 {
156  wxASSERT( outputFile );
157 
158  // DXF HEADER - Boilerplate
159  // Defines the minimum for drawing i.e. the angle system and the
160  // 4 linetypes (CONTINUOUS, DOTDASH, DASHED and DOTTED)
161  fputs( " 0\n"
162  "SECTION\n"
163  " 2\n"
164  "HEADER\n"
165  " 9\n"
166  "$ANGBASE\n"
167  " 50\n"
168  "0.0\n"
169  " 9\n"
170  "$ANGDIR\n"
171  " 70\n"
172  " 1\n"
173  " 9\n"
174  "$MEASUREMENT\n"
175  " 70\n"
176  "0\n"
177  " 0\n" // This means 'metric units'
178  "ENDSEC\n"
179  " 0\n"
180  "SECTION\n"
181  " 2\n"
182  "TABLES\n"
183  " 0\n"
184  "TABLE\n"
185  " 2\n"
186  "LTYPE\n"
187  " 70\n"
188  "4\n"
189  " 0\n"
190  "LTYPE\n"
191  " 5\n"
192  "40F\n"
193  " 2\n"
194  "CONTINUOUS\n"
195  " 70\n"
196  "0\n"
197  " 3\n"
198  "Solid line\n"
199  " 72\n"
200  "65\n"
201  " 73\n"
202  "0\n"
203  " 40\n"
204  "0.0\n"
205  " 0\n"
206  "LTYPE\n"
207  " 5\n"
208  "410\n"
209  " 2\n"
210  "DASHDOT\n"
211  " 70\n"
212  "0\n"
213  " 3\n"
214  "Dash Dot ____ _ ____ _\n"
215  " 72\n"
216  "65\n"
217  " 73\n"
218  "4\n"
219  " 40\n"
220  "2.0\n"
221  " 49\n"
222  "1.25\n"
223  " 49\n"
224  "-0.25\n"
225  " 49\n"
226  "0.25\n"
227  " 49\n"
228  "-0.25\n"
229  " 0\n"
230  "LTYPE\n"
231  " 5\n"
232  "411\n"
233  " 2\n"
234  "DASHED\n"
235  " 70\n"
236  "0\n"
237  " 3\n"
238  "Dashed __ __ __ __ __\n"
239  " 72\n"
240  "65\n"
241  " 73\n"
242  "2\n"
243  " 40\n"
244  "0.75\n"
245  " 49\n"
246  "0.5\n"
247  " 49\n"
248  "-0.25\n"
249  " 0\n"
250  "LTYPE\n"
251  " 5\n"
252  "43B\n"
253  " 2\n"
254  "DOTTED\n"
255  " 70\n"
256  "0\n"
257  " 3\n"
258  "Dotted . . . .\n"
259  " 72\n"
260  "65\n"
261  " 73\n"
262  "2\n"
263  " 40\n"
264  "0.2\n"
265  " 49\n"
266  "0.0\n"
267  " 49\n"
268  "-0.2\n"
269  " 0\n"
270  "ENDTAB\n",
271  outputFile );
272 
273  // Text styles table
274  // Defines 4 text styles, one for each bold/italic combination
275  fputs( " 0\n"
276  "TABLE\n"
277  " 2\n"
278  "STYLE\n"
279  " 70\n"
280  "4\n", outputFile );
281 
282  static const char *style_name[4] = {"KICAD", "KICADB", "KICADI", "KICADBI"};
283  for(int i = 0; i < 4; i++ )
284  {
285  fprintf( outputFile,
286  " 0\n"
287  "STYLE\n"
288  " 2\n"
289  "%s\n" // Style name
290  " 70\n"
291  "0\n" // Standard flags
292  " 40\n"
293  "0\n" // Non-fixed height text
294  " 41\n"
295  "1\n" // Width factor (base)
296  " 42\n"
297  "1\n" // Last height (mandatory)
298  " 50\n"
299  "%g\n" // Oblique angle
300  " 71\n"
301  "0\n" // Generation flags (default)
302  " 3\n"
303  // The standard ISO font (when kicad is build with it
304  // the dxf text in acad matches *perfectly*)
305  "isocp.shx\n", // Font name (when not bigfont)
306  // Apply a 15 degree angle to italic text
307  style_name[i], i < 2 ? 0 : DXF_OBLIQUE_ANGLE );
308  }
309 
310 
311  // Layer table - one layer per color
312  fprintf( outputFile,
313  " 0\n"
314  "ENDTAB\n"
315  " 0\n"
316  "TABLE\n"
317  " 2\n"
318  "LAYER\n"
319  " 70\n"
320  "%d\n", NBCOLORS );
321 
322  /* The layer/colors palette. The acad/DXF palette is divided in 3 zones:
323 
324  - The primary colors (1 - 9)
325  - An HSV zone (10-250, 5 values x 2 saturations x 10 hues
326  - Greys (251 - 255)
327  */
328 
329  for( EDA_COLOR_T i = BLACK; i < NBCOLORS; i = NextColor(i) )
330  {
331  fprintf( outputFile,
332  " 0\n"
333  "LAYER\n"
334  " 2\n"
335  "%s\n" // Layer name
336  " 70\n"
337  "0\n" // Standard flags
338  " 62\n"
339  "%d\n" // Color number
340  " 6\n"
341  "CONTINUOUS\n",// Linetype name
342  dxf_layer[i].name, dxf_layer[i].color );
343  }
344 
345  // End of layer table, begin entities
346  fputs( " 0\n"
347  "ENDTAB\n"
348  " 0\n"
349  "ENDSEC\n"
350  " 0\n"
351  "SECTION\n"
352  " 2\n"
353  "ENTITIES\n", outputFile );
354 
355  return true;
356 }
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...
static const struct @36 dxf_layer[NBCOLORS]
FILE * outputFile
true if the Y axis is top to bottom (SVG)
const char * name
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
aData= a parameter used by some plotters in SetCurrentLineWidth(), not directly used here.

Reimplemented from PLOTTER.

Definition at line 803 of file common_plotDXF_functions.cpp.

References containsNonAsciiChars(), DXF_OBLIQUE_ANGLE, getDXFColorName(), 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.

815 {
816  // Fix me: see how to use DXF text mode for multiline texts
817  if( aMultilineAllowed && !aText.Contains( wxT( "\n" ) ) )
818  aMultilineAllowed = false; // the text has only one line.
819 
820  if( textAsLines || containsNonAsciiChars( aText ) || aMultilineAllowed )
821  {
822  // output text as graphics.
823  // Perhaps multiline texts could be handled as DXF text entity
824  // but I do not want spend time about this (JPC)
825  PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
826  aWidth, aItalic, aBold, aMultilineAllowed );
827  }
828  else
829  {
830  /* Emit text as a text entity. This loses formatting and shape but it's
831  more useful as a CAD object */
832  DPOINT origin_dev = userToDeviceCoordinates( aPos );
833  SetColor( aColor );
834  wxString cname = getDXFColorName( m_currentColor );
835  DPOINT size_dev = userToDeviceSize( aSize );
836  int h_code = 0, v_code = 0;
837  switch( aH_justify )
838  {
840  h_code = 0;
841  break;
843  h_code = 1;
844  break;
846  h_code = 2;
847  break;
848  }
849  switch( aV_justify )
850  {
852  v_code = 3;
853  break;
855  v_code = 2;
856  break;
858  v_code = 1;
859  break;
860  }
861 
862  // Position, size, rotation and alignment
863  // The two alignment point usages is somewhat idiot (see the DXF ref)
864  // Anyway since we don't use the fit/aligned options, they're the same
865  fprintf( outputFile,
866  " 0\n"
867  "TEXT\n"
868  " 7\n"
869  "%s\n" // Text style
870  " 8\n"
871  "%s\n" // Layer name
872  " 10\n"
873  "%g\n" // First point X
874  " 11\n"
875  "%g\n" // Second point X
876  " 20\n"
877  "%g\n" // First point Y
878  " 21\n"
879  "%g\n" // Second point Y
880  " 40\n"
881  "%g\n" // Text height
882  " 41\n"
883  "%g\n" // Width factor
884  " 50\n"
885  "%g\n" // Rotation
886  " 51\n"
887  "%g\n" // Oblique angle
888  " 71\n"
889  "%d\n" // Mirror flags
890  " 72\n"
891  "%d\n" // H alignment
892  " 73\n"
893  "%d\n", // V alignment
894  aBold ? (aItalic ? "KICADBI" : "KICADB")
895  : (aItalic ? "KICADI" : "KICAD"),
896  TO_UTF8( cname ),
897  origin_dev.x, origin_dev.x,
898  origin_dev.y, origin_dev.y,
899  size_dev.y, fabs( size_dev.x / size_dev.y ),
900  aOrient / 10.0,
901  aItalic ? DXF_OBLIQUE_ANGLE : 0,
902  size_dev.x < 0 ? 2 : 0, // X mirror flag
903  h_code, v_code );
904 
905  /* There are two issue in emitting the text:
906  - Our overline character (~) must be converted to the appropriate
907  control sequence %%O or %%o
908  - Text encoding in DXF is more or less unspecified since depends on
909  the DXF declared version, the acad version reading it *and* some
910  system variables to be put in the header handled only by newer acads
911  Also before R15 unicode simply is not supported (you need to use
912  bigfonts which are a massive PITA). Common denominator solution:
913  use Latin1 (and however someone could choke on it, anyway). Sorry
914  for the extended latin people. If somewant want to try fixing this
915  recent version seems to use UTF-8 (and not UCS2 like the rest of
916  Windows)
917 
918  XXX Actually there is a *third* issue: older DXF formats are limited
919  to 255 bytes records (it was later raised to 2048); since I'm lazy
920  and text so long is not probable I just don't implement this rule.
921  If someone is interested in fixing this, you have to emit the first
922  partial lines with group code 3 (max 250 bytes each) and then finish
923  with a group code 1 (less than 250 bytes). The DXF refs explains it
924  in no more details...
925  */
926 
927  bool overlining = false;
928  fputs( " 1\n", outputFile );
929  for( unsigned i = 0; i < aText.length(); i++ )
930  {
931  /* Here I do a bad thing: writing the output one byte at a time!
932  but today I'm lazy and I have no idea on how to coerce a Unicode
933  wxString to spit out latin1 encoded text ...
934 
935  Atleast stdio is *supposed* to do output buffering, so there is
936  hope is not too slow */
937  wchar_t ch = aText[i];
938  if( ch > 255 )
939  {
940  // I can't encode this...
941  putc( '?', outputFile );
942  }
943  else
944  {
945  if( ch == '~' )
946  {
947  // Handle the overline toggle
948  fputs( overlining ? "%%o" : "%%O", outputFile );
949  overlining = !overlining;
950  }
951  else
952  {
953  putc( ch, outputFile );
954  }
955  }
956  }
957  putc( '\n', outputFile );
958  }
959 }
static const double DXF_OBLIQUE_ANGLE
Oblique angle for DXF native text (I don't remember if 15 degrees is the ISO value...
static wxString getDXFColorName(COLOR4D aColor)
COLOR4D m_currentColor
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:229
#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)
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 474 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().

476 {
477  if( tracemode == FILLED )
478  Arc( centre, StAngle, EndAngle, radius, NO_FILL, width );
479  else
480  {
481  SetCurrentLineWidth( -1 );
482  Arc( centre, StAngle, EndAngle,
483  radius - ( width - currentPenWidth ) / 2, NO_FILL, -1 );
484  Arc( centre, StAngle, EndAngle,
485  radius + ( width - currentPenWidth ) / 2, NO_FILL, -1 );
486  }
487 }
int currentPenWidth
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 512 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().

514 {
515  if( tracemode == FILLED )
516  Circle( pos, diametre, NO_FILL, width );
517  else
518  {
519  SetCurrentLineWidth( -1 );
520  Circle( pos, diametre - width + currentPenWidth, NO_FILL, -1 );
521  Circle( pos, diametre + width - currentPenWidth, NO_FILL, -1 );
522  }
523 }
int currentPenWidth
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 490 of file class_plotter.cpp.

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

492 {
493  if( tracemode == FILLED )
494  Rect( p1, p2, NO_FILL, width );
495  else
496  {
497  SetCurrentLineWidth( -1 );
498  wxPoint offsetp1( p1.x - (width - currentPenWidth) / 2,
499  p1.y - (width - currentPenWidth) / 2 );
500  wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2,
501  p2.y + (width - currentPenWidth) / 2 );
502  Rect( offsetp1, offsetp2, NO_FILL, -1 );
503  offsetp1.x += (width - currentPenWidth);
504  offsetp1.y += (width - currentPenWidth);
505  offsetp2.x -= (width - currentPenWidth);
506  offsetp2.y -= (width - currentPenWidth);
507  Rect( offsetp1, offsetp2, NO_FILL, -1 );
508  }
509 }
int currentPenWidth
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 584 of file common_plotDXF_functions.cpp.

References PLOTTER::FinishTo(), and PLOTTER::MoveTo().

Referenced by PlotPoly().

586 {
587  MoveTo( aStart );
588  FinishTo( aEnd );
589 }
void FinishTo(const wxPoint &pos)
void MoveTo(const wxPoint &pos)
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 99 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().

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

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

Definition at line 124 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::GetDotMarkLenIU(), 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().

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

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

Definition at line 131 of file class_plotter.cpp.

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

132 {
133  return size * plotScale * iuPerDeviceUnit;
134 }
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)

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 1324 of file class_plotter.h.

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

int DXF_PLOTTER::m_currentLineType
protected

Definition at line 1325 of file class_plotter.h.

Referenced by DXF_PLOTTER(), PenTo(), and SetDash().

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

true to mirror horizontally (else vertically)

Definition at line 551 of file class_plotter.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 401 of file class_plotter.h.

Referenced by PLOTTER::Marker().

bool PLOTTER::negativeMode
protectedinherited

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

Definition at line 558 of file class_plotter.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 554 of file class_plotter.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(), PS_PLOTTER::SetCurrentLineWidth(), HPGL_PLOTTER::SetDash(), PS_PLOTTER::SetDash(), GERBER_PLOTTER::SetLayerPolarity(), SVG_PLOTTER::setSVGPlotStyle(), PS_PLOTTER::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 564 of file class_plotter.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 562 of file class_plotter.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 1323 of file class_plotter.h.

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

wxString PLOTTER::title
protectedinherited

Definition at line 567 of file class_plotter.h.

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


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