KiCad PCB EDA Suite
plotter.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
32 #ifndef PLOT_COMMON_H_
33 #define PLOT_COMMON_H_
34 
35 #include <vector>
36 #include <math/box2.h>
37 #include <gr_text.h>
38 #include <page_info.h>
39 #include <eda_text.h> // FILL_T
40 
41 class SHAPE_POLY_SET;
42 class SHAPE_LINE_CHAIN;
44 
50 enum PlotFormat {
60 };
61 
79 };
80 
89 };
90 
97 class PLOTTER
98 {
99 public:
100  // These values are used as flag for pen or aperture selection
101  static const int DO_NOT_SET_LINE_WIDTH = -2; // Skip selection
102  static const int USE_DEFAULT_LINE_WIDTH = -1; // use the default pen
103 
104  PLOTTER();
105 
106  virtual ~PLOTTER();
107 
113  virtual PlotFormat GetPlotterType() const = 0;
114 
115  virtual bool StartPlot() = 0;
116  virtual bool EndPlot() = 0;
117 
118  virtual void SetNegative( bool aNegative )
119  {
120  negativeMode = aNegative;
121  }
122 
126  virtual void SetColorMode( bool aColorMode )
127  {
128  colorMode = aColorMode;
129  }
130 
131  bool GetColorMode() const
132  {
133  return colorMode;
134  }
135 
136  virtual void SetPageSettings( const PAGE_INFO& aPageSettings );
137 
143  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) = 0;
144 
150  virtual void SetDefaultLineWidth( int width ) = 0;
151 
152  virtual int GetCurrentLineWidth() const
153  {
154  return currentPenWidth;
155  }
156 
157  virtual void SetColor( COLOR4D color ) = 0;
158 
159  virtual void SetDash( int dashed ) = 0;
160 
161  virtual void SetCreator( const wxString& aCreator )
162  {
163  creator = aCreator;
164  }
165 
166  virtual void SetTitle( const wxString& aTitle )
167  {
168  title = aTitle;
169  }
170 
176  void AddLineToHeader( const wxString& aExtraString )
177  {
178  m_headerExtraLines.Add( aExtraString );
179  }
180 
186  {
187  m_headerExtraLines.Clear();
188  }
189 
199  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
200  double aScale, bool aMirror ) = 0;
201 
210  virtual bool OpenFile( const wxString& aFullFilename );
211 
217  double GetIUsPerDecimil() const { return m_IUsPerDecimil; }
218 
219  int GetPlotterArcLowDef() const { return m_IUsPerDecimil * 8; }
220  int GetPlotterArcHighDef() const { return m_IUsPerDecimil * 2; }
221 
222  // Low level primitives
223  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
224  int width = USE_DEFAULT_LINE_WIDTH ) = 0;
225  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
226  int width = USE_DEFAULT_LINE_WIDTH ) = 0;
227 
231  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
232  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH );
233 
241  virtual void PenTo( const wxPoint& pos, char plume ) = 0;
242 
243  // Convenience functions for PenTo
244  void MoveTo( const wxPoint& pos )
245  {
246  PenTo( pos, 'U' );
247  }
248 
249  void LineTo( const wxPoint& pos )
250  {
251  PenTo( pos, 'D' );
252  }
253 
254  void FinishTo( const wxPoint& pos )
255  {
256  PenTo( pos, 'D' );
257  PenTo( pos, 'Z' );
258  }
259 
260  void PenFinish()
261  {
262  // The point is not important with Z motion
263  PenTo( wxPoint( 0, 0 ), 'Z' );
264  }
265 
274  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill,
275  int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) = 0;
276 
285  virtual void PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
286  int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL );
287 
298  virtual void PlotImage( const wxImage & aImage, const wxPoint& aPos,
299  double aScaleFactor );
300 
301  // Higher level primitives -- can be drawn as line, sketch or 'filled'
302  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
303  EDA_DRAW_MODE_T tracemode, void* aData );
304  virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
305  int rayon, int width, EDA_DRAW_MODE_T tracemode, void* aData );
306  virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
307  EDA_DRAW_MODE_T tracemode, void* aData );
308  virtual void ThickCircle( const wxPoint& pos, int diametre, int width,
309  EDA_DRAW_MODE_T tracemode, void* aData );
310 
311  // Flash primitives
312 
320  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
321  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
322 
331  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
332  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
333 
342  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
343  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
344 
354  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
355  int aCornerRadius, double aOrient,
356  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
357 
366  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
367  SHAPE_POLY_SET* aPolygons,
368  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
369 
379  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
380  double aPadOrient, EDA_DRAW_MODE_T aTraceMode,
381  void* aData ) = 0;
382 
383 
388  virtual void Text( const wxPoint& aPos,
389  const COLOR4D aColor,
390  const wxString& aText,
391  double aOrient,
392  const wxSize& aSize,
393  enum EDA_TEXT_HJUSTIFY_T aH_justify,
394  enum EDA_TEXT_VJUSTIFY_T aV_justify,
395  int aWidth,
396  bool aItalic,
397  bool aBold,
398  bool aMultilineAllowed = false,
399  void* aData = NULL );
400 
404  static const unsigned MARKER_COUNT = 58;
405 
411  void Marker( const wxPoint& position, int diametre, unsigned aShapeId );
412 
422  virtual void SetLayerPolarity( bool aPositive )
423  {
424  // NOP for most plotters
425  }
426 
431  virtual void SetTextMode( PlotTextMode mode )
432  {
433  // NOP for most plotters.
434  }
435 
436  virtual void SetGerberCoordinatesFormat( int aResolution, bool aUseInches = false )
437  {
438  // NOP for most plotters. Only for Gerber plotter
439  }
440 
448  virtual void StartBlock( void* aData ) {}
449 
457  virtual void EndBlock( void* aData ) {}
458 
459 
460 protected:
461  // These are marker subcomponents
465  void markerCircle( const wxPoint& pos, int radius );
466 
470  void markerHBar( const wxPoint& pos, int radius );
471 
475  void markerSlash( const wxPoint& pos, int radius );
476 
480  void markerBackSlash( const wxPoint& pos, int radius );
481 
485  void markerVBar( const wxPoint& pos, int radius );
486 
490  void markerSquare( const wxPoint& position, int radius );
491 
495  void markerLozenge( const wxPoint& position, int radius );
496 
497  // Helper function for sketched filler segment
498 
502  void segmentAsOval( const wxPoint& start, const wxPoint& end, int width,
503  EDA_DRAW_MODE_T tracemode );
504 
505  void sketchOval( const wxPoint& pos, const wxSize& size, double orient, int width );
506 
507  // Coordinate and scaling conversion functions
508 
514  virtual DPOINT userToDeviceCoordinates( const wxPoint& aCoordinate );
515 
520  virtual DPOINT userToDeviceSize( const wxSize& size );
521 
526  virtual double userToDeviceSize( double size ) const;
527 
528  double GetDotMarkLenIU() const;
529 
530  double GetDashMarkLenIU() const;
531 
532  double GetDashGapLenIU() const;
533 
534 protected: // variables used in most of plotters:
536  double plotScale;
537 
538  /* Caller scale (how many IUs in a decimil - always); it's a double
539  * because in eeschema there are 0.1 IUs in a decimil (eeschema
540  * always works in mils internally) while pcbnew can work in decimil
541  * or nanometers, so this value would be >= 1 */
543 
546 
548  wxPoint plotOffset;
549 
555 
557  FILE* outputFile;
558 
559  // Pen handling
560  bool colorMode;
565  char penState;
567  wxPoint penLastpos;
568  wxString creator;
569  wxString filename;
570  wxString title;
573  wxSize paperSize;
574 
575  wxArrayString m_headerExtraLines;
576 };
577 
578 
579 class HPGL_PLOTTER : public PLOTTER
580 {
581 public:
582  HPGL_PLOTTER();
583 
584  virtual PlotFormat GetPlotterType() const override
585  {
586  return PLOT_FORMAT_HPGL;
587  }
588 
589  static wxString GetDefaultFileExtension()
590  {
591  return wxString( wxT( "plt" ) );
592  }
593 
594  virtual bool StartPlot() override;
595  virtual bool EndPlot() override;
596 
598  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override
599  {
600  // This is the truth
602  }
603 
604  virtual void SetDefaultLineWidth( int width ) override {}
605  virtual void SetDash( int dashed ) override;
606 
607  virtual void SetColor( COLOR4D color ) override {}
608 
609  virtual void SetPenSpeed( int speed )
610  {
611  penSpeed = speed;
612  }
613 
614  virtual void SetPenNumber( int number )
615  {
616  penNumber = number;
617  }
618 
619  virtual void SetPenDiameter( double diameter );
620 
621  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
622  double aScale, bool aMirror ) override;
623  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
624  int width = USE_DEFAULT_LINE_WIDTH ) override;
625  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
626  int width = USE_DEFAULT_LINE_WIDTH ) override;
627  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
628  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
629  void * aData = NULL) override;
630 
631  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
632  EDA_DRAW_MODE_T tracemode, void* aData ) override;
633  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
634  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
635  virtual void PenTo( const wxPoint& pos, char plume ) override;
636  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
637  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
638  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
639  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
640  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
641  double aOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
642  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
643  int aCornerRadius, double aOrient,
644  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
645  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
646  SHAPE_POLY_SET* aPolygons,
647  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
648  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
649  double aPadOrient, EDA_DRAW_MODE_T aTraceMode,
650  void* aData ) override;
651 
652 protected:
653  void penControl( char plume );
654 
655  int penSpeed;
657  double penDiameter;
658 };
659 
665 class PSLIKE_PLOTTER : public PLOTTER
666 {
667 public:
670  {
671  }
672 
676  virtual void SetTextMode( PlotTextMode mode ) override
677  {
678  if( mode != PLOTTEXTMODE_DEFAULT )
679  m_textMode = mode;
680  }
681 
682  virtual void SetDefaultLineWidth( int width ) override;
683 
687  void SetScaleAdjust( double scaleX, double scaleY )
688  {
689  plotScaleAdjX = scaleX;
690  plotScaleAdjY = scaleY;
691  }
692 
693  // Pad routines are handled with lower level primitives
694  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
695  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
696  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
697  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
698  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
699  double aPadOrient, EDA_DRAW_MODE_T aTraceMode,
700  void* aData ) override;
701  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
702  int aCornerRadius, double aOrient,
703  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
704  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
705  SHAPE_POLY_SET* aPolygons,
706  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
707  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
708  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
709 
714  virtual void SetColor( COLOR4D color ) override;
715 
716 protected:
717  void computeTextParameters( const wxPoint& aPos,
718  const wxString& aText,
719  int aOrient,
720  const wxSize& aSize,
721  bool aMirror,
722  enum EDA_TEXT_HJUSTIFY_T aH_justify,
723  enum EDA_TEXT_VJUSTIFY_T aV_justify,
724  int aWidth,
725  bool aItalic,
726  bool aBold,
727  double *wideningFactor,
728  double *ctm_a,
729  double *ctm_b,
730  double *ctm_c,
731  double *ctm_d,
732  double *ctm_e,
733  double *ctm_f,
734  double *heightFactor );
735  void postscriptOverlinePositions( const wxString& aText, int aXSize,
736  bool aItalic, bool aBold,
737  std::vector<int> *pos_pairs );
738  void fputsPostscriptString(FILE *fout, const wxString& txt);
739 
741  virtual void emitSetRGBColor( double r, double g, double b ) = 0;
742 
744  static const double postscriptTextAscent; // = 0.718;
745 
746  int returnPostscriptTextWidth( const wxString& aText, int aXSize,
747  bool aItalic, bool aBold );
748 
751 
754 };
755 
756 
758 {
759 public:
761  {
762  // The phantom plot in postscript is an hack and reportedly
763  // crashes Adobe's own postscript interpreter!
765  }
766 
767  static wxString GetDefaultFileExtension()
768  {
769  return wxString( wxT( "ps" ) );
770  }
771 
772  virtual PlotFormat GetPlotterType() const override
773  {
774  return PLOT_FORMAT_POST;
775  }
776 
777  virtual bool StartPlot() override;
778  virtual bool EndPlot() override;
779  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
780  virtual void SetDash( int dashed ) override;
781 
782  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
783  double aScale, bool aMirror ) override;
784  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
785  int width = USE_DEFAULT_LINE_WIDTH ) override;
786  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
787  int width = USE_DEFAULT_LINE_WIDTH ) override;
788  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
789  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
790 
791  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
792  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
793  void * aData = NULL ) override;
794 
795  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
796  double aScaleFactor ) override;
797 
798  virtual void PenTo( const wxPoint& pos, char plume ) override;
799  virtual void Text( const wxPoint& aPos,
800  const COLOR4D aColor,
801  const wxString& aText,
802  double aOrient,
803  const wxSize& aSize,
804  enum EDA_TEXT_HJUSTIFY_T aH_justify,
805  enum EDA_TEXT_VJUSTIFY_T aV_justify,
806  int aWidth,
807  bool aItalic,
808  bool aBold,
809  bool aMultilineAllowed = false,
810  void* aData = NULL ) override;
811 protected:
812  virtual void emitSetRGBColor( double r, double g, double b ) override;
813 };
814 
816 {
817 public:
819  {
820  // Avoid non initialized variables:
822  pageTreeHandle = 0;
823  }
824 
825  virtual PlotFormat GetPlotterType() const override
826  {
827  return PLOT_FORMAT_PDF;
828  }
829 
830  static wxString GetDefaultFileExtension()
831  {
832  return wxString( wxT( "pdf" ) );
833  }
834 
843  virtual bool OpenFile( const wxString& aFullFilename ) override;
844 
845  virtual bool StartPlot() override;
846  virtual bool EndPlot() override;
847  virtual void StartPage();
848  virtual void ClosePage();
849  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
850  virtual void SetDash( int dashed ) override;
851 
854  virtual void SetPageSettings( const PAGE_INFO& aPageSettings ) override;
855  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
856  double aScale, bool aMirror ) override;
857  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
858  int width = USE_DEFAULT_LINE_WIDTH ) override;
859  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
860  int width = USE_DEFAULT_LINE_WIDTH ) override;
861  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
862  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
863 
864  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
865  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
866  void * aData = NULL ) override;
867 
868  virtual void PenTo( const wxPoint& pos, char plume ) override;
869 
870  virtual void Text( const wxPoint& aPos,
871  const COLOR4D aColor,
872  const wxString& aText,
873  double aOrient,
874  const wxSize& aSize,
875  enum EDA_TEXT_HJUSTIFY_T aH_justify,
876  enum EDA_TEXT_VJUSTIFY_T aV_justify,
877  int aWidth,
878  bool aItalic,
879  bool aBold,
880  bool aMultilineAllowed = false,
881  void* aData = NULL ) override;
882 
883  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
884  double aScaleFactor ) override;
885 
886 
887 protected:
888  virtual void emitSetRGBColor( double r, double g, double b ) override;
889  int allocPdfObject();
890  int startPdfObject(int handle = -1);
891  void closePdfObject();
892  int startPdfStream(int handle = -1);
893  void closePdfStream();
896  std::vector<int> pageHandles;
899  wxString workFilename;
900  FILE* workFile;
901  std::vector<long> xrefTable;
902 };
903 
905 {
906 public:
907  SVG_PLOTTER();
908 
909  static wxString GetDefaultFileExtension()
910  {
911  return wxString( wxT( "svg" ) );
912  }
913 
914  virtual PlotFormat GetPlotterType() const override
915  {
916  return PLOT_FORMAT_SVG;
917  }
918 
919  virtual void SetColor( COLOR4D color ) override;
920  virtual bool StartPlot() override;
921  virtual bool EndPlot() override;
922  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
923  virtual void SetDash( int dashed ) override;
924 
925  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
926  double aScale, bool aMirror ) override;
927  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
928  int width = USE_DEFAULT_LINE_WIDTH ) override;
929  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
930  int width = USE_DEFAULT_LINE_WIDTH ) override;
931  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
932  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
933 
934  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
935  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
936  void * aData = NULL ) override;
937 
938  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
939  double aScaleFactor ) override;
940 
941  virtual void PenTo( const wxPoint& pos, char plume ) override;
942 
943 
949  virtual void StartBlock( void* aData ) override;
950 
956  virtual void EndBlock( void* aData ) override;
957 
958  virtual void Text( const wxPoint& aPos,
959  const COLOR4D aColor,
960  const wxString& aText,
961  double aOrient,
962  const wxSize& aSize,
963  enum EDA_TEXT_HJUSTIFY_T aH_justify,
964  enum EDA_TEXT_VJUSTIFY_T aV_justify,
965  int aWidth,
966  bool aItalic,
967  bool aBold,
968  bool aMultilineAllowed = false,
969  void* aData = NULL ) override;
970 
971 protected:
972  FILL_T m_fillMode; // true if the current contour
973  // rect, arc, circle, polygon must be filled
974  long m_pen_rgb_color; // current rgb color value: each color has
975  // a value 0 ... 255, and the 3 colors are
976  // grouped in a 3x8 bits value
977  // (written in hex to svg files)
978  long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill
979  // some contours.
980  bool m_graphics_changed; // true if a pen/brush parameter is modified
981  // color, pen size, fil mode ...
982  // the new SVG stype must be output on file
983  int m_dashed; // 0 = plot solid line style
984  // 1 = plot dashed line style
985  // 2 = plot dotted line style
986  // 3 = plot dash-dot line style
987 
993  virtual void emitSetRGBColor( double r, double g, double b ) override;
994 
1002  void setSVGPlotStyle( bool aIsGroup = true, const std::string& aExtraStyle = {} );
1003 
1008  void setFillMode( FILL_T fill );
1009 };
1010 
1011 /* Class to handle a D_CODE when plotting a board : */
1012 #define FIRST_DCODE_VALUE 10 // D_CODE < 10 is a command, D_CODE >= 10 is a tool
1013 
1015 {
1016 public:
1018  Circle = 1,
1019  Rect = 2,
1021  Oval = 4
1022  };
1023 
1024  wxSize m_Size; // horiz and Vert size
1025  APERTURE_TYPE m_Type; // Type ( Line, rect , circulaire , ovale .. )
1026  int m_DCode; // code number ( >= 10 );
1027  int m_ApertureAttribute; // the attribute attached to this aperture
1028  // Only one attribute is allowed by aperture
1029  // 0 = no specific aperture attribute
1030 };
1031 
1032 
1033 class GERBER_PLOTTER : public PLOTTER
1034 {
1035 public:
1036  GERBER_PLOTTER();
1037 
1038  virtual PlotFormat GetPlotterType() const override
1039  {
1040  return PLOT_FORMAT_GERBER;
1041  }
1042 
1043  static wxString GetDefaultFileExtension()
1044  {
1045  return wxString( wxT( "gbr" ) );
1046  }
1047 
1053  virtual bool StartPlot() override;
1054  virtual bool EndPlot() override;
1055  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
1056  virtual void SetDefaultLineWidth( int width ) override;
1057 
1058  // RS274X has no dashing, nor colours
1059  virtual void SetDash( int dashed ) override {}
1060  virtual void SetColor( COLOR4D color ) override {}
1061  // Currently, aScale and aMirror are not used in gerber plotter
1062  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
1063  double aScale, bool aMirror ) override;
1064  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
1065  int width = USE_DEFAULT_LINE_WIDTH ) override;
1066  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
1067  int width = USE_DEFAULT_LINE_WIDTH ) override;
1068  virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
1069  int aRadius, FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override;
1070 
1071  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
1072  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1073 
1074  virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
1075  int rayon, int width, EDA_DRAW_MODE_T tracemode, void* aData ) override;
1076  virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
1077  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1078  virtual void ThickCircle( const wxPoint& pos, int diametre, int width,
1079  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1084  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
1085  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
1086  void * aData = NULL ) override;
1087 
1088  virtual void PenTo( const wxPoint& pos, char plume ) override;
1089 
1090  virtual void Text( const wxPoint& aPos,
1091  const COLOR4D aColor,
1092  const wxString& aText,
1093  double aOrient,
1094  const wxSize& aSize,
1095  enum EDA_TEXT_HJUSTIFY_T aH_justify,
1096  enum EDA_TEXT_VJUSTIFY_T aV_justify,
1097  int aWidth,
1098  bool aItalic,
1099  bool aBold,
1100  bool aMultilineAllowed = false,
1101  void* aData = NULL ) override;
1102 
1106  virtual void FlashPadCircle( const wxPoint& pos, int diametre,
1107  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1108 
1112  virtual void FlashPadOval( const wxPoint& pos, const wxSize& size, double orient,
1113  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1119  virtual void FlashPadRect( const wxPoint& pos, const wxSize& size,
1120  double orient, EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1121 
1127  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
1128  int aCornerRadius, double aOrient,
1129  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1130  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
1131  SHAPE_POLY_SET* aPolygons,
1132  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1138  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
1139  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1140 
1145  virtual void SetLayerPolarity( bool aPositive ) override;
1146 
1157  virtual void SetGerberCoordinatesFormat( int aResolution, bool aUseInches = false ) override;
1158 
1159  void UseX2format( bool aEnable ) { m_useX2format = aEnable; }
1160  void UseX2NetAttributes( bool aEnable ) { m_useNetAttributes = aEnable; }
1161 
1167  virtual void StartBlock( void* aData ) override;
1168 
1175  virtual void EndBlock( void* aData ) override;
1176 
1177 protected:
1183  void selectAperture( const wxSize& aSize, APERTURE::APERTURE_TYPE aType,
1184  int aApertureAttribute );
1185 
1191  void emitDcode( const DPOINT& pt, int dcode );
1192 
1201 
1206  void clearNetAttribute();
1207 
1216  std::vector<APERTURE>::iterator getAperture( const wxSize& aSize,
1217  APERTURE::APERTURE_TYPE aType, int aApertureAttribute );
1218 
1219  // the attributes dictionnary created/modifed by %TO, attached the objects, when they are created
1220  // by D01, D03 G36/G37 commands
1221  // standard attributes are .P, .C and .N
1222  // this is used by gerber readers when creating a new object. Cleared by %TD command
1223  // Note: m_objectAttributesDictionnary can store more than one attribute
1224  // the string stores the line(s) actually written to the gerber file
1225  // it can store a .P, .C or .N attribute, or 2 or 3 attributes, separated by a \n char (EOL)
1227 
1228  // The last aperture attribute generated (only one aperture attribute can be set)
1230 
1231  FILE* workFile;
1232  FILE* finalFile;
1233  wxString m_workFilename;
1234 
1238  void writeApertureList();
1239 
1240  std::vector<APERTURE> apertures;
1241  std::vector<APERTURE>::iterator currentAperture;
1242 
1243  bool m_gerberUnitInch; // true if the gerber units are inches, false for mm
1244  int m_gerberUnitFmt; // number of digits in mantissa.
1245  // usually 6 in Inches and 5 or 6 in mm
1246  bool m_useX2format; // In recent gerber files, attributes are added.
1247  // Attributes in file header will be added using X2 format if true
1248  // If false (X1 format), these attributes will be added as comments.
1249  bool m_useNetAttributes; // In recent gerber files, netlist info can be added.
1250  // It will be added if this param is true, using X2 or X1 format
1251 };
1252 
1253 
1254 class DXF_PLOTTER : public PLOTTER
1255 {
1256 public:
1258  {
1259  textAsLines = true;
1261  m_currentLineType = 0;
1263  }
1264 
1265  virtual PlotFormat GetPlotterType() const override
1266  {
1267  return PLOT_FORMAT_DXF;
1268  }
1269 
1270  static wxString GetDefaultFileExtension()
1271  {
1272  return wxString( wxT( "dxf" ) );
1273  }
1274 
1278  virtual void SetTextMode( PlotTextMode mode ) override
1279  {
1280  if( mode != PLOTTEXTMODE_DEFAULT )
1281  textAsLines = ( mode != PLOTTEXTMODE_NATIVE );
1282  }
1283 
1284  virtual bool StartPlot() override;
1285  virtual bool EndPlot() override;
1286 
1287  // For now we don't use 'thick' primitives, so no line width
1288  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override
1289  {
1290  currentPenWidth = 0;
1291  }
1292 
1293  virtual void SetDefaultLineWidth( int width ) override
1294  {
1295  // DXF lines are infinitesimal
1296  defaultPenWidth = 0;
1297  }
1298 
1299  virtual void SetDash( int dashed ) override;
1300 
1301  virtual void SetColor( COLOR4D color ) override;
1302 
1303  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
1304  double aScale, bool aMirror ) override;
1305  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
1306  int width = USE_DEFAULT_LINE_WIDTH ) override;
1307  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
1308  int width = USE_DEFAULT_LINE_WIDTH ) override;
1309  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
1310  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override;
1311  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
1312  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1313  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
1314  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
1315  virtual void PenTo( const wxPoint& pos, char plume ) override;
1316 
1317  virtual void FlashPadCircle( const wxPoint& pos, int diametre,
1318  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1319  virtual void FlashPadOval( const wxPoint& pos, const wxSize& size, double orient,
1320  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1321  virtual void FlashPadRect( const wxPoint& pos, const wxSize& size,
1322  double orient, EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1323  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
1324  int aCornerRadius, double aOrient,
1325  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1326  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
1327  SHAPE_POLY_SET* aPolygons,
1328  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1329  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
1330  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1331 
1332  virtual void Text( const wxPoint& aPos,
1333  const COLOR4D aColor,
1334  const wxString& aText,
1335  double aOrient,
1336  const wxSize& aSize,
1337  enum EDA_TEXT_HJUSTIFY_T aH_justify,
1338  enum EDA_TEXT_VJUSTIFY_T aV_justify,
1339  int aWidth,
1340  bool aItalic,
1341  bool aBold,
1342  bool aMultilineAllowed = false,
1343  void* aData = NULL ) override;
1344 
1345 
1346  // Must be in the same order as the drop-down list in the plot dialog inside pcbnew
1348  {
1351  };
1352 
1358  void SetUnits( DXF_UNITS aUnit );
1359 
1366  {
1367  return m_plotUnits;
1368  }
1369 
1376  double GetUnitScaling() const
1377  {
1378  return m_unitScalingFactor;
1379  }
1380 
1386  unsigned int GetMeasurementDirective() const
1387  {
1388  return m_measurementDirective;
1389  }
1390 
1391 protected:
1395 
1399 };
1400 
1401 class TITLE_BLOCK;
1402 void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
1403  const PAGE_INFO& aPageInfo,
1404  int aSheetNumber, int aNumberOfSheets,
1405  const wxString &aSheetDesc,
1406  const wxString &aFilename,
1407  const COLOR4D aColor = COLOR4D::UNSPECIFIED );
1408 
1411 wxString GetDefaultPlotExtension( PlotFormat aFormat );
1412 
1413 
1414 #endif // PLOT_COMMON_H_
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
std::vector< APERTURE >::iterator getAperture(const wxSize &aSize, APERTURE::APERTURE_TYPE aType, int aApertureAttribute)
Function getAperture returns a reference to the aperture which meets the size anf type of tool if the...
static wxString GetDefaultFileExtension()
Definition: plotter.h:830
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:914
void FinishTo(const wxPoint &pos)
Definition: plotter.h:254
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.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
Roundrect pad at the moment are not handled as aperture, since they require aperture macros TODO: alw...
virtual bool EndPlot() override
HPGL end of plot: pen return and release.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Definition: PS_plotter.cpp:401
int penSpeed
Definition: plotter.h:655
double GetDotMarkLenIU() const
Definition: plotter.cpp:136
double m_unitScalingFactor
Definition: plotter.h:1397
void writeApertureList()
Generate the table of D codes.
void markerHBar(const wxPoint &pos, int radius)
Plot a - bar centered on the position.
Definition: plotter.cpp:253
void closePdfStream()
Finish the current PDF stream (writes the deferred length, too)
void clearNetAttribute()
clear a Gerber net attribute record (clear object attribute dictionnary) and output the clear object ...
virtual void SetColor(COLOR4D color) override
Definition: plotter.h:607
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:161
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:44
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
void PenFinish()
Definition: plotter.h:260
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
Trapezoidal pad at the moment are never handled as aperture, since they require aperture macros TODO:...
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCircle
static wxString GetDefaultFileExtension()
Definition: plotter.h:767
void UseX2NetAttributes(bool aEnable)
Definition: plotter.h:1160
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
Postscript-likes at the moment are the only plot engines supporting bitmaps...
virtual void EndBlock(void *aData)
calling this function allows one to define the end of a group of drawing items for instance in SVG or...
Definition: plotter.h:457
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
Definition: plotter.h:1288
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
HPGL polygon:
virtual void SetLayerPolarity(bool aPositive) override
Change the plot polarity and begin a new layer Used to 'scratch off' silk screen away from solder mas...
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
void PlotWorkSheet(PLOTTER *plotter, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, const COLOR4D aColor=COLOR4D::UNSPECIFIED)
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.
APERTURE_TYPE
Definition: plotter.h:1017
virtual bool StartPlot()=0
virtual void EndBlock(void *aData) override
calling this function allows one to define the end of a group of drawing items the group is started b...
virtual bool EndPlot() override
FILL_T m_fillMode
Definition: plotter.h:972
virtual void emitSetRGBColor(double r, double g, double b) override
Virtual primitive for emitting the setrgbcolor operator.
Definition: PS_plotter.cpp:534
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadTrapez flash a trapezoidal pad
Definition: PS_plotter.cpp:254
unsigned int m_measurementDirective
Definition: plotter.h:1398
APERTURE_TYPE m_Type
Definition: plotter.h:1025
virtual void SetColor(COLOR4D color)=0
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:511
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.
void setFillMode(FILL_T fill)
function setFillMode() prepare parameters for setSVGPlotStyle()
virtual void StartPage()
Starts a new page in the PDF document.
virtual void SetTitle(const wxString &aTitle)
Definition: plotter.h:166
wxSize m_Size
Definition: plotter.h:1024
bool textAsLines
Definition: plotter.h:1392
static const unsigned MARKER_COUNT
Draw a marker (used for the drill map)
Definition: plotter.h:404
virtual void SetDash(int dashed) override
PDF supports dashed lines.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:79
static wxString GetDefaultFileExtension()
Definition: plotter.h:909
bool m_useNetAttributes
Definition: plotter.h:1249
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.
int pageTreeHandle
Definition: plotter.h:894
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
Definition: PS_plotter.cpp:754
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:126
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
Definition: plotter.h:687
void formatNetAttribute(GBR_NETLIST_METADATA *aData)
print a Gerber net attribute object record.
virtual void SetLayerPolarity(bool aPositive)
Function SetLayerPolarity sets current Gerber layer polarity to positive or negative by writing %LPD*...
Definition: plotter.h:422
DXF_UNITS m_plotUnits
Definition: plotter.h:1396
int color
Definition: DXF_plotter.cpp:62
The PSLIKE_PLOTTER class is an intermediate class to handle common routines for engines working more ...
Definition: plotter.h:665
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCustom
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
virtual bool EndPlot() override
Definition: PS_plotter.cpp:956
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Gerber polygon: they can (and should) be filled with the appropriate G36/G37 sequence.
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCustom
void setSVGPlotStyle(bool aIsGroup=true, const std::string &aExtraStyle={})
function setSVGPlotStyle() output the string which define pen and brush color, shape,...
virtual void SetPenDiameter(double diameter)
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.
virtual void StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items,...
Definition: plotter.h:448
virtual void PenTo(const wxPoint &pos, char plume)=0
moveto/lineto primitive, moves the 'pen' to the specified direction
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:825
std::vector< int > pageHandles
Font resource dictionary.
Definition: plotter.h:896
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:50
void UseX2format(bool aEnable)
Definition: plotter.h:1159
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
std::vector< APERTURE > apertures
Definition: plotter.h:1240
bool colorMode
Definition: plotter.h:560
void SetUnits(DXF_UNITS aUnit)
Set the units to use for plotting the DXF file.
virtual ~PLOTTER()
Definition: plotter.cpp:70
void selectAperture(const wxSize &aSize, APERTURE::APERTURE_TYPE aType, int aApertureAttribute)
Pick an existing aperture or create a new one, matching the size, type and attributes.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Function PlotPoly.
Definition: PS_plotter.cpp:627
char penState
Current pen state: 'U', 'D' or 'Z' (see PenTo)
Definition: plotter.h:565
void AddLineToHeader(const wxString &aExtraString)
Function AddLineToHeader Add a line to the list of free lines to print at the beginning of the file.
Definition: plotter.h:176
COLOR4D m_currentColor
Definition: plotter.h:1393
this class handle info which can be added in a gerber file as attribute of an obtect the GBR_INFO_TYP...
double m_IUsPerDecimil
Definition: plotter.h:542
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL)=0
Function PlotPoly.
bool m_gerberUnitInch
Definition: plotter.h:1243
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.cpp:537
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
wxArrayString m_headerExtraLines
Definition: plotter.h:575
static wxString GetDefaultFileExtension()
Definition: plotter.h:1043
virtual bool StartPlot() override
At the start of the HPGL plot pen speed and number are requested.
virtual void FlashPadOval(const wxPoint &pos, const wxSize &size, double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override
Filled oval flashes are handled as aperture in the 90 degree positions only.
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: plotter.h:604
wxPoint plotOffset
Plot offset (in IUs)
Definition: plotter.h:548
wxPoint penLastpos
Last pen positions; set to -1,-1 when the pen is at rest.
Definition: plotter.h:567
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCircle
Definition: PS_plotter.cpp:115
virtual bool StartPlot() override
Function StartPlot Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false)
Definition: plotter.h:436
PAGE_INFO pageInfo
Definition: plotter.h:571
PLOTTER()
Definition: plotter.cpp:53
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:473
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCustom
double GetUnitScaling() const
Get the scale factor to apply to convert the device units to be in the currently set units.
Definition: plotter.h:1376
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual void ThickRect(const wxPoint &p1, const wxPoint &p2, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
HPGL rectangle: fill not supported.
wxString workFilename
Handle to the deferred stream length.
Definition: plotter.h:899
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: gr_text.cpp:215
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadRoundRect
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Polygon plotting for PDF.
double GetDashGapLenIU() const
Definition: plotter.cpp:148
static wxString GetDefaultFileExtension()
Definition: plotter.h:1270
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.
virtual int GetCurrentLineWidth() const
Definition: plotter.h:152
virtual void ThickRect(const wxPoint &p1, const wxPoint &p2, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:489
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.
virtual bool EndPlot() override
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
virtual void ClosePage()
Close the current page in the PDF document (and emit its compressed stream)
bool m_yaxisReversed
true to mirror horizontally (else vertically)
Definition: plotter.h:554
virtual bool EndPlot()=0
int streamLengthHandle
Handle of the page content object.
Definition: plotter.h:898
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
Definition: PS_plotter.cpp:802
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
void LineTo(const wxPoint &pos)
Definition: plotter.h:249
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:1038
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
static const int USE_DEFAULT_LINE_WIDTH
Definition: plotter.h:102
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCustom
Definition: PS_plotter.cpp:220
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plotter.h:552
virtual bool StartPlot() override
Opens the DXF plot with a skeleton header.
PS_PLOTTER()
Definition: plotter.h:760
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: PS_plotter.cpp:52
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
HPGL doesn't handle line thickness or color.
Definition: plotter.h:598
virtual void emitSetRGBColor(double r, double g, double b)=0
Virtual primitive for emitting the setrgbcolor operator.
Class SHAPE_POLY_SET.
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
The PDF engine can't directly plot arcs, it uses the base emulation.
long m_pen_rgb_color
Definition: plotter.h:974
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadRoundRect
Definition: PS_plotter.cpp:185
int returnPostscriptTextWidth(const wxString &aText, int aXSize, bool aItalic, bool aBold)
Sister function for the GraphicTextWidth in drawtxt.cpp Does the same processing (i....
Definition: PS_plotter.cpp:342
double plotScaleAdjY
Definition: plotter.h:750
int startPdfStream(int handle=-1)
Starts a PDF stream (for the page).
EDA_DRAW_MODE_T
Definition: eda_text.h:59
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
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.
Definition: PS_plotter.cpp:970
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.
virtual void SetTextMode(PlotTextMode mode)
Change the current text mode.
Definition: plotter.h:431
int startPdfObject(int handle=-1)
Open a new PDF object and returns the handle if the parameter is -1.
virtual void SetPenSpeed(int speed)
Definition: plotter.h:609
int m_gerberUnitFmt
Definition: plotter.h:1244
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadRect
Definition: PS_plotter.cpp:136
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRoundRect
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.
Definition: PS_plotter.cpp:591
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Definition: PDF_plotter.cpp:69
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
Definition: PS_plotter.cpp:59
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:580
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plotter.h:536
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool EndPlot() override
virtual bool StartPlot() override
The code within this function creates SVG files header.
double GetIUsPerDecimil() const
The IUs per decimil are an essential scaling factor when plotting; they are set and saved when establ...
Definition: plotter.h:217
virtual void SetDash(int dashed) override
HPGL supports dashed lines.
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
DXF rectangle: fill not supported.
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadOval
virtual void SetDash(int dashed) override
Postscript supports dashed lines.
Definition: PS_plotter.cpp:546
FILE * workFile
Definition: plotter.h:900
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
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 p...
int m_currentLineType
Definition: plotter.h:1394
void emitDcode(const DPOINT &pt, int dcode)
Emit a D-Code record, using proper conversions to format a leading zero omitted gerber coordinate (fo...
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT)
Definition: plotter.cpp:121
virtual void ThickArc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
FILE * finalFile
Definition: plotter.h:1232
virtual void SetNegative(bool aNegative)
Definition: plotter.h:118
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
Definition: PS_plotter.cpp:517
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
void markerSlash(const wxPoint &pos, int radius)
Plot a / bar centered on the position.
Definition: plotter.cpp:260
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...
virtual void FlashPadCircle(const wxPoint &pos, int diametre, EDA_DRAW_MODE_T trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
void closePdfObject()
Close the current PDF object.
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
void Marker(const wxPoint &position, int diametre, unsigned aShapeId)
Draw a pattern shape number aShapeId, to coord position.
Definition: plotter.cpp:281
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadRect
virtual void SetDefaultLineWidth(int width)=0
Set the default line width.
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.
static const double postscriptTextAscent
Height of the postscript font (from the AFM)
Definition: plotter.h:744
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:51
int penNumber
Definition: plotter.h:656
void MoveTo(const wxPoint &pos)
Definition: plotter.h:244
bool m_useX2format
Definition: plotter.h:1246
wxString title
Definition: plotter.h:570
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modifies coordinates according to the orientation, scale factor, and offsets trace.
Definition: plotter.cpp:96
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
Rectangles in PDF.
int GetPlotterArcLowDef() const
Definition: plotter.h:219
int fontResDictHandle
Handle to the root of the page tree object.
Definition: plotter.h:895
Base plotter engine class.
Definition: plotter.h:97
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRect
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,...
Definition: plotter.cpp:181
unsigned int GetMeasurementDirective() const
Get the correct value for the $MEASUREMENT field given the current units.
Definition: plotter.h:1386
virtual void SetTextMode(PlotTextMode mode) override
PS and PDF fully implement native text (for the Latin-1 subset)
Definition: plotter.h:676
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
Postscript-likes at the moment are the only plot engines supporting bitmaps...
Definition: PS_plotter.cpp:652
void fputsPostscriptString(FILE *fout, const wxString &txt)
Write on a stream a string escaped for postscript/PDF.
Definition: PS_plotter.cpp:303
virtual void emitSetRGBColor(double r, double g, double b) override
PDF supports colors fully.
PDF_PLOTTER()
Definition: plotter.h:818
virtual void StartBlock(void *aData) override
calling this function allows one to define the beginning of a group of drawing items (used in X2 form...
std::vector< long > xrefTable
Temporary file to costruct the stream before zipping.
Definition: plotter.h:901
virtual void Arc(const wxPoint &aCenter, double aStAngle, double aEndAngle, int aRadius, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
int currentPenWidth
Definition: plotter.h:563
int defaultPenWidth
true to generate a negative image (PS mode mainly)
Definition: plotter.h:562
virtual bool EndPlot() override
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:569
double GetDashMarkLenIU() const
Definition: plotter.cpp:142
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: plotter.h:1293
Class SHAPE_LINE_CHAIN.
virtual PlotFormat GetPlotterType() const =0
Returns the effective plot engine in use.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:456
bool m_graphics_changed
Definition: plotter.h:980
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
Circle drawing for PDF.
wxString GetDefaultPlotExtension(PlotFormat aFormat)
Returns the default plot extension for a format.
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:584
long m_brush_rgb_color
Definition: plotter.h:978
PlotDashType
Enum for choosing dashed line type.
Definition: plotter.h:84
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:1265
double plotScaleAdjX
Fine user scale adjust ( = 1.0 if no correction)
Definition: plotter.h:750
virtual void SetColor(COLOR4D color) override
Definition: plotter.h:1060
double penDiameter
Definition: plotter.h:657
virtual void SetPenNumber(int number)
Definition: plotter.h:614
virtual void EndBlock(void *aData) override
calling this function allows one to define the end of a group of drawing items the group is started b...
void markerLozenge(const wxPoint &position, int radius)
Plot a lozenge centered on the position.
Definition: plotter.cpp:229
FILE * outputFile
true if the Y axis is top to bottom (SVG)
Definition: plotter.h:557
static wxString GetDefaultFileExtension()
Definition: plotter.h:589
std::string m_objectAttributesDictionnary
Definition: plotter.h:1226
virtual void emitSetRGBColor(double r, double g, double b) override
function emitSetRGBColor() initialize m_pen_rgb_color from reduced values r, g ,b ( reduced values ar...
PlotTextMode
Enum for choosing which kind of text to output with the PSLIKE plotters.
Definition: plotter.h:74
void markerCircle(const wxPoint &pos, int radius)
Plot a circle centered on the position.
Definition: plotter.cpp:223
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetColor(COLOR4D color) override
The DXF exporter handles 'colors' as layers...
int GetPlotterArcHighDef() const
Definition: plotter.h:220
virtual void SetDash(int dashed) override
void ClearHeaderLinesList()
Function ClearHeaderLinesList remove all lines from the list of free lines to print at the beginning ...
Definition: plotter.h:185
virtual void SetDash(int dashed)=0
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.
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Function SetGerberCoordinatesFormat selection of Gerber units and resolution (number of digits in man...
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.
Definition: plotter.cpp:154
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
Definition: base_struct.h:42
void postscriptOverlinePositions(const wxString &aText, int aXSize, bool aItalic, bool aBold, std::vector< int > *pos_pairs)
Computes the x coordinates for the overlining in a string of text.
Definition: PS_plotter.cpp:371
virtual void FlashPadRect(const wxPoint &pos, const wxSize &size, double orient, EDA_DRAW_MODE_T trace_mode, void *aData) override
Filled rect flashes are handled as aperture in the 0 90 180 or 270 degree orientation only and as pol...
virtual void SetDash(int dashed) override
SVG supports dashed lines.
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
Definition: PDF_plotter.cpp:49
virtual void StartBlock(void *aData) override
calling this function allows one to define the beginning of a group of drawing items (used in SVG for...
wxString m_workFilename
Definition: plotter.h:1233
void computeTextParameters(const wxPoint &aPos, const wxString &aText, int aOrient, const wxSize &aSize, bool aMirror, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, double *wideningFactor, double *ctm_a, double *ctm_b, double *ctm_c, double *ctm_d, double *ctm_e, double *ctm_f, double *heightFactor)
This is the core for postscript/PDF text alignment It computes the transformation matrix to generate ...
Definition: PS_plotter.cpp:424
Definition: colors.h:45
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadOval
Definition: PS_plotter.cpp:85
int m_apertureAttribute
Definition: plotter.h:1229
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
PDF can have multiple pages, so SetPageSettings can be called with the outputFile open (but not insid...
Definition: PDF_plotter.cpp:64
int m_DCode
Definition: plotter.h:1026
virtual void SetTextMode(PlotTextMode mode) override
DXF handles NATIVE text emitting TEXT entities.
Definition: plotter.h:1278
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.
void penControl(char plume)
Pen control logic (remove redundant pen activations)
int m_ApertureAttribute
Definition: plotter.h:1027
virtual bool StartPlot() override
The PDF engine supports multiple pages; the first one is opened 'for free' the following are to be cl...
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, SHAPE_POLY_SET *aPolygons, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadCustom
FILE * workFile
Definition: plotter.h:1231
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plotter.h:545
static const int DO_NOT_SET_LINE_WIDTH
Definition: plotter.h:101
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.
Definition: plotter.cpp:387
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadTrapez flash a trapezoidal pad
wxString filename
Definition: plotter.h:569
virtual void SetDash(int dashed) override
Definition: plotter.h:1059
void markerVBar(const wxPoint &pos, int radius)
Plot a | bar centered on the position.
Definition: plotter.cpp:274
std::vector< APERTURE >::iterator currentAperture
Definition: plotter.h:1241
PlotTextMode m_textMode
How to draw text.
Definition: plotter.h:753
int allocPdfObject()
Allocate a new handle in the table of the PDF object.
virtual void ThickCircle(const wxPoint &pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void *aData) override
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadTrapez flash a trapezoidal pad
void markerSquare(const wxPoint &position, int radius)
Plot a square centered on the position.
Definition: plotter.cpp:198
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
void markerBackSlash(const wxPoint &pos, int radius)
Plot a \ bar centered on the position.
Definition: plotter.cpp:267
void sketchOval(const wxPoint &pos, const wxSize &size, double orient, int width)
Definition: plotter.cpp:408
int pageStreamHandle
Handles to the page objects.
Definition: plotter.h:897
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData) override
virtual function FlashPadRoundRect
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:772
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
wxString creator
Definition: plotter.h:568
wxSize paperSize
Paper size in IU - not in mils.
Definition: plotter.h:573
bool m_mirrorIsHorizontal
Definition: plotter.h:553
DXF_UNITS GetUnits() const
The units currently enabled for plotting.
Definition: plotter.h:1365
int m_dashed
Definition: plotter.h:983
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Pen width setting for PDF.
Definition: PDF_plotter.cpp:95
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Function PlotPoly.
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.
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PDF images are handles as inline, not XObject streams...
bool GetColorMode() const
Definition: plotter.h:131
bool negativeMode
true to plot in color, false to plot in black and white
Definition: plotter.h:561