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 <draw_graphic_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  // Low level primitives
220  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
221  int width = USE_DEFAULT_LINE_WIDTH ) = 0;
222  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
223  int width = USE_DEFAULT_LINE_WIDTH ) = 0;
224 
228  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
229  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH );
230 
238  virtual void PenTo( const wxPoint& pos, char plume ) = 0;
239 
240  // Convenience functions for PenTo
241  void MoveTo( const wxPoint& pos )
242  {
243  PenTo( pos, 'U' );
244  }
245 
246  void LineTo( const wxPoint& pos )
247  {
248  PenTo( pos, 'D' );
249  }
250 
251  void FinishTo( const wxPoint& pos )
252  {
253  PenTo( pos, 'D' );
254  PenTo( pos, 'Z' );
255  }
256 
257  void PenFinish()
258  {
259  // The point is not important with Z motion
260  PenTo( wxPoint( 0, 0 ), 'Z' );
261  }
262 
271  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill,
272  int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) = 0;
273 
282  virtual void PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
283  int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL );
284 
295  virtual void PlotImage( const wxImage & aImage, const wxPoint& aPos,
296  double aScaleFactor );
297 
298  // Higher level primitives -- can be drawn as line, sketch or 'filled'
299  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
300  EDA_DRAW_MODE_T tracemode, void* aData );
301  virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
302  int rayon, int width, EDA_DRAW_MODE_T tracemode, void* aData );
303  virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
304  EDA_DRAW_MODE_T tracemode, void* aData );
305  virtual void ThickCircle( const wxPoint& pos, int diametre, int width,
306  EDA_DRAW_MODE_T tracemode, void* aData );
307 
308  // Flash primitives
309 
317  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
318  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
319 
328  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
329  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
330 
339  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
340  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
341 
351  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
352  int aCornerRadius, double aOrient,
353  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
354 
363  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
364  SHAPE_POLY_SET* aPolygons,
365  EDA_DRAW_MODE_T aTraceMode, void* aData ) = 0;
366 
376  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
377  double aPadOrient, EDA_DRAW_MODE_T aTraceMode,
378  void* aData ) = 0;
379 
380 
385  virtual void Text( const wxPoint& aPos,
386  const COLOR4D aColor,
387  const wxString& aText,
388  double aOrient,
389  const wxSize& aSize,
390  enum EDA_TEXT_HJUSTIFY_T aH_justify,
391  enum EDA_TEXT_VJUSTIFY_T aV_justify,
392  int aWidth,
393  bool aItalic,
394  bool aBold,
395  bool aMultilineAllowed = false,
396  void* aData = NULL );
397 
401  static const unsigned MARKER_COUNT = 58;
402 
408  void Marker( const wxPoint& position, int diametre, unsigned aShapeId );
409 
419  virtual void SetLayerPolarity( bool aPositive )
420  {
421  // NOP for most plotters
422  }
423 
428  virtual void SetTextMode( PlotTextMode mode )
429  {
430  // NOP for most plotters.
431  }
432 
433  virtual void SetGerberCoordinatesFormat( int aResolution, bool aUseInches = false )
434  {
435  // NOP for most plotters. Only for Gerber plotter
436  }
437 
445  virtual void StartBlock( void* aData ) {}
446 
454  virtual void EndBlock( void* aData ) {}
455 
456 
457 protected:
458  // These are marker subcomponents
462  void markerCircle( const wxPoint& pos, int radius );
463 
467  void markerHBar( const wxPoint& pos, int radius );
468 
472  void markerSlash( const wxPoint& pos, int radius );
473 
477  void markerBackSlash( const wxPoint& pos, int radius );
478 
482  void markerVBar( const wxPoint& pos, int radius );
483 
487  void markerSquare( const wxPoint& position, int radius );
488 
492  void markerLozenge( const wxPoint& position, int radius );
493 
494  // Helper function for sketched filler segment
495 
499  void segmentAsOval( const wxPoint& start, const wxPoint& end, int width,
500  EDA_DRAW_MODE_T tracemode );
501 
502  void sketchOval( const wxPoint& pos, const wxSize& size, double orient, int width );
503 
504  // Coordinate and scaling conversion functions
505 
511  virtual DPOINT userToDeviceCoordinates( const wxPoint& aCoordinate );
512 
517  virtual DPOINT userToDeviceSize( const wxSize& size );
518 
523  virtual double userToDeviceSize( double size ) const;
524 
525  double GetDotMarkLenIU() const;
526 
527  double GetDashMarkLenIU() const;
528 
529  double GetDashGapLenIU() const;
530 
531 protected: // variables used in most of plotters:
533  double plotScale;
534 
535  /* Caller scale (how many IUs in a decimil - always); it's a double
536  * because in eeschema there are 0.1 IUs in a decimil (eeschema
537  * always works in mils internally) while pcbnew can work in decimil
538  * or nanometers, so this value would be >= 1 */
540 
543 
545  wxPoint plotOffset;
546 
552 
554  FILE* outputFile;
555 
556  // Pen handling
557  bool colorMode;
562  char penState;
564  wxPoint penLastpos;
565  wxString creator;
566  wxString filename;
567  wxString title;
570  wxSize paperSize;
571 
572  wxArrayString m_headerExtraLines;
573 };
574 
575 
576 class HPGL_PLOTTER : public PLOTTER
577 {
578 public:
579  HPGL_PLOTTER();
580 
581  virtual PlotFormat GetPlotterType() const override
582  {
583  return PLOT_FORMAT_HPGL;
584  }
585 
586  static wxString GetDefaultFileExtension()
587  {
588  return wxString( wxT( "plt" ) );
589  }
590 
591  virtual bool StartPlot() override;
592  virtual bool EndPlot() override;
593 
595  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override
596  {
597  // This is the truth
599  }
600 
601  virtual void SetDefaultLineWidth( int width ) override {}
602  virtual void SetDash( int dashed ) override;
603 
604  virtual void SetColor( COLOR4D color ) override {}
605 
606  virtual void SetPenSpeed( int speed )
607  {
608  penSpeed = speed;
609  }
610 
611  virtual void SetPenNumber( int number )
612  {
613  penNumber = number;
614  }
615 
616  virtual void SetPenDiameter( double diameter );
617 
618  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
619  double aScale, bool aMirror ) override;
620  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
621  int width = USE_DEFAULT_LINE_WIDTH ) override;
622  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
623  int width = USE_DEFAULT_LINE_WIDTH ) override;
624  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
625  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
626  void * aData = NULL) override;
627 
628  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
629  EDA_DRAW_MODE_T tracemode, void* aData ) override;
630  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
631  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
632  virtual void PenTo( const wxPoint& pos, char plume ) override;
633  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
634  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
635  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
636  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
637  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
638  double aOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
639  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
640  int aCornerRadius, double aOrient,
641  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
642  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
643  SHAPE_POLY_SET* aPolygons,
644  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
645  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
646  double aPadOrient, EDA_DRAW_MODE_T aTraceMode,
647  void* aData ) override;
648 
649 protected:
650  void penControl( char plume );
651 
652  int penSpeed;
654  double penDiameter;
655 };
656 
662 class PSLIKE_PLOTTER : public PLOTTER
663 {
664 public:
667  {
668  }
669 
673  virtual void SetTextMode( PlotTextMode mode ) override
674  {
675  if( mode != PLOTTEXTMODE_DEFAULT )
676  m_textMode = mode;
677  }
678 
679  virtual void SetDefaultLineWidth( int width ) override;
680 
684  void SetScaleAdjust( double scaleX, double scaleY )
685  {
686  plotScaleAdjX = scaleX;
687  plotScaleAdjY = scaleY;
688  }
689 
690  // Pad routines are handled with lower level primitives
691  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
692  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
693  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
694  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
695  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
696  double aPadOrient, EDA_DRAW_MODE_T aTraceMode,
697  void* aData ) override;
698  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
699  int aCornerRadius, double aOrient,
700  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
701  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
702  SHAPE_POLY_SET* aPolygons,
703  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
704  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
705  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
706 
711  virtual void SetColor( COLOR4D color ) override;
712 
713 protected:
714  void computeTextParameters( const wxPoint& aPos,
715  const wxString& aText,
716  int aOrient,
717  const wxSize& aSize,
718  bool aMirror,
719  enum EDA_TEXT_HJUSTIFY_T aH_justify,
720  enum EDA_TEXT_VJUSTIFY_T aV_justify,
721  int aWidth,
722  bool aItalic,
723  bool aBold,
724  double *wideningFactor,
725  double *ctm_a,
726  double *ctm_b,
727  double *ctm_c,
728  double *ctm_d,
729  double *ctm_e,
730  double *ctm_f,
731  double *heightFactor );
732  void postscriptOverlinePositions( const wxString& aText, int aXSize,
733  bool aItalic, bool aBold,
734  std::vector<int> *pos_pairs );
735  void fputsPostscriptString(FILE *fout, const wxString& txt);
736 
738  virtual void emitSetRGBColor( double r, double g, double b ) = 0;
739 
741  static const double postscriptTextAscent; // = 0.718;
742 
743  int returnPostscriptTextWidth( const wxString& aText, int aXSize,
744  bool aItalic, bool aBold );
745 
748 
751 };
752 
753 
755 {
756 public:
758  {
759  // The phantom plot in postscript is an hack and reportedly
760  // crashes Adobe's own postscript interpreter!
762  }
763 
764  static wxString GetDefaultFileExtension()
765  {
766  return wxString( wxT( "ps" ) );
767  }
768 
769  virtual PlotFormat GetPlotterType() const override
770  {
771  return PLOT_FORMAT_POST;
772  }
773 
774  virtual bool StartPlot() override;
775  virtual bool EndPlot() override;
776  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
777  virtual void SetDash( int dashed ) override;
778 
779  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
780  double aScale, bool aMirror ) override;
781  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
782  int width = USE_DEFAULT_LINE_WIDTH ) override;
783  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
784  int width = USE_DEFAULT_LINE_WIDTH ) override;
785  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
786  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
787 
788  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
789  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
790  void * aData = NULL ) override;
791 
792  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
793  double aScaleFactor ) override;
794 
795  virtual void PenTo( const wxPoint& pos, char plume ) override;
796  virtual void Text( const wxPoint& aPos,
797  const COLOR4D aColor,
798  const wxString& aText,
799  double aOrient,
800  const wxSize& aSize,
801  enum EDA_TEXT_HJUSTIFY_T aH_justify,
802  enum EDA_TEXT_VJUSTIFY_T aV_justify,
803  int aWidth,
804  bool aItalic,
805  bool aBold,
806  bool aMultilineAllowed = false,
807  void* aData = NULL ) override;
808 protected:
809  virtual void emitSetRGBColor( double r, double g, double b ) override;
810 };
811 
813 {
814 public:
816  {
817  // Avoid non initialized variables:
819  pageTreeHandle = 0;
820  }
821 
822  virtual PlotFormat GetPlotterType() const override
823  {
824  return PLOT_FORMAT_PDF;
825  }
826 
827  static wxString GetDefaultFileExtension()
828  {
829  return wxString( wxT( "pdf" ) );
830  }
831 
840  virtual bool OpenFile( const wxString& aFullFilename ) override;
841 
842  virtual bool StartPlot() override;
843  virtual bool EndPlot() override;
844  virtual void StartPage();
845  virtual void ClosePage();
846  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
847  virtual void SetDash( int dashed ) override;
848 
851  virtual void SetPageSettings( const PAGE_INFO& aPageSettings ) override;
852  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
853  double aScale, bool aMirror ) override;
854  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
855  int width = USE_DEFAULT_LINE_WIDTH ) override;
856  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
857  int width = USE_DEFAULT_LINE_WIDTH ) override;
858  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
859  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
860 
861  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
862  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
863  void * aData = NULL ) override;
864 
865  virtual void PenTo( const wxPoint& pos, char plume ) override;
866 
867  virtual void Text( const wxPoint& aPos,
868  const COLOR4D aColor,
869  const wxString& aText,
870  double aOrient,
871  const wxSize& aSize,
872  enum EDA_TEXT_HJUSTIFY_T aH_justify,
873  enum EDA_TEXT_VJUSTIFY_T aV_justify,
874  int aWidth,
875  bool aItalic,
876  bool aBold,
877  bool aMultilineAllowed = false,
878  void* aData = NULL ) override;
879 
880  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
881  double aScaleFactor ) override;
882 
883 
884 protected:
885  virtual void emitSetRGBColor( double r, double g, double b ) override;
886  int allocPdfObject();
887  int startPdfObject(int handle = -1);
888  void closePdfObject();
889  int startPdfStream(int handle = -1);
890  void closePdfStream();
893  std::vector<int> pageHandles;
896  wxString workFilename;
897  FILE* workFile;
898  std::vector<long> xrefTable;
899 };
900 
902 {
903 public:
904  SVG_PLOTTER();
905 
906  static wxString GetDefaultFileExtension()
907  {
908  return wxString( wxT( "svg" ) );
909  }
910 
911  virtual PlotFormat GetPlotterType() const override
912  {
913  return PLOT_FORMAT_SVG;
914  }
915 
916  virtual void SetColor( COLOR4D color ) override;
917  virtual bool StartPlot() override;
918  virtual bool EndPlot() override;
919  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
920  virtual void SetDash( int dashed ) override;
921 
922  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
923  double aScale, bool aMirror ) override;
924  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
925  int width = USE_DEFAULT_LINE_WIDTH ) override;
926  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
927  int width = USE_DEFAULT_LINE_WIDTH ) override;
928  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
929  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
930 
931  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
932  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
933  void * aData = NULL ) override;
934 
935  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
936  double aScaleFactor ) override;
937 
938  virtual void PenTo( const wxPoint& pos, char plume ) override;
939 
940 
946  virtual void StartBlock( void* aData ) override;
947 
953  virtual void EndBlock( void* aData ) override;
954 
955  virtual void Text( const wxPoint& aPos,
956  const COLOR4D aColor,
957  const wxString& aText,
958  double aOrient,
959  const wxSize& aSize,
960  enum EDA_TEXT_HJUSTIFY_T aH_justify,
961  enum EDA_TEXT_VJUSTIFY_T aV_justify,
962  int aWidth,
963  bool aItalic,
964  bool aBold,
965  bool aMultilineAllowed = false,
966  void* aData = NULL ) override;
967 
968 protected:
969  FILL_T m_fillMode; // true if the current contour
970  // rect, arc, circle, polygon must be filled
971  long m_pen_rgb_color; // current rgb color value: each color has
972  // a value 0 ... 255, and the 3 colors are
973  // grouped in a 3x8 bits value
974  // (written in hex to svg files)
975  long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill
976  // some contours.
977  bool m_graphics_changed; // true if a pen/brush parameter is modified
978  // color, pen size, fil mode ...
979  // the new SVG stype must be output on file
980  int m_dashed; // 0 = plot solid line style
981  // 1 = plot dashed line style
982  // 2 = plot dotted line style
983  // 3 = plot dash-dot line style
984 
990  virtual void emitSetRGBColor( double r, double g, double b ) override;
991 
999  void setSVGPlotStyle( bool aIsGroup = true, const std::string& aExtraStyle = {} );
1000 
1005  void setFillMode( FILL_T fill );
1006 };
1007 
1008 /* Class to handle a D_CODE when plotting a board : */
1009 #define FIRST_DCODE_VALUE 10 // D_CODE < 10 is a command, D_CODE >= 10 is a tool
1010 
1012 {
1013 public:
1015  Circle = 1,
1016  Rect = 2,
1018  Oval = 4
1019  };
1020 
1021  wxSize m_Size; // horiz and Vert size
1022  APERTURE_TYPE m_Type; // Type ( Line, rect , circulaire , ovale .. )
1023  int m_DCode; // code number ( >= 10 );
1024  int m_ApertureAttribute; // the attribute attached to this aperture
1025  // Only one attribute is allowed by aperture
1026  // 0 = no specific aperture attribute
1027 };
1028 
1029 
1030 class GERBER_PLOTTER : public PLOTTER
1031 {
1032 public:
1033  GERBER_PLOTTER();
1034 
1035  virtual PlotFormat GetPlotterType() const override
1036  {
1037  return PLOT_FORMAT_GERBER;
1038  }
1039 
1040  static wxString GetDefaultFileExtension()
1041  {
1042  return wxString( wxT( "gbr" ) );
1043  }
1044 
1050  virtual bool StartPlot() override;
1051  virtual bool EndPlot() override;
1052  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
1053  virtual void SetDefaultLineWidth( int width ) override;
1054 
1055  // RS274X has no dashing, nor colours
1056  virtual void SetDash( int dashed ) override {}
1057  virtual void SetColor( COLOR4D color ) override {}
1058  // Currently, aScale and aMirror are not used in gerber plotter
1059  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
1060  double aScale, bool aMirror ) override;
1061  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
1062  int width = USE_DEFAULT_LINE_WIDTH ) override;
1063  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
1064  int width = USE_DEFAULT_LINE_WIDTH ) override;
1065  virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
1066  int aRadius, FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override;
1067 
1068  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
1069  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1070 
1071  virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
1072  int rayon, int width, EDA_DRAW_MODE_T tracemode, void* aData ) override;
1073  virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
1074  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1075  virtual void ThickCircle( const wxPoint& pos, int diametre, int width,
1076  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1081  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
1082  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
1083  void * aData = NULL ) override;
1084 
1085  virtual void PenTo( const wxPoint& pos, char plume ) override;
1086 
1087  virtual void Text( const wxPoint& aPos,
1088  const COLOR4D aColor,
1089  const wxString& aText,
1090  double aOrient,
1091  const wxSize& aSize,
1092  enum EDA_TEXT_HJUSTIFY_T aH_justify,
1093  enum EDA_TEXT_VJUSTIFY_T aV_justify,
1094  int aWidth,
1095  bool aItalic,
1096  bool aBold,
1097  bool aMultilineAllowed = false,
1098  void* aData = NULL ) override;
1099 
1103  virtual void FlashPadCircle( const wxPoint& pos, int diametre,
1104  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1105 
1109  virtual void FlashPadOval( const wxPoint& pos, const wxSize& size, double orient,
1110  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1116  virtual void FlashPadRect( const wxPoint& pos, const wxSize& size,
1117  double orient, EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1118 
1124  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
1125  int aCornerRadius, double aOrient,
1126  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1127  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
1128  SHAPE_POLY_SET* aPolygons,
1129  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1135  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
1136  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1137 
1142  virtual void SetLayerPolarity( bool aPositive ) override;
1143 
1154  virtual void SetGerberCoordinatesFormat( int aResolution, bool aUseInches = false ) override;
1155 
1156  void UseX2format( bool aEnable ) { m_useX2format = aEnable; }
1157  void UseX2NetAttributes( bool aEnable ) { m_useNetAttributes = aEnable; }
1158 
1164  virtual void StartBlock( void* aData ) override;
1165 
1172  virtual void EndBlock( void* aData ) override;
1173 
1174 protected:
1180  void selectAperture( const wxSize& aSize, APERTURE::APERTURE_TYPE aType,
1181  int aApertureAttribute );
1182 
1188  void emitDcode( const DPOINT& pt, int dcode );
1189 
1198 
1203  void clearNetAttribute();
1204 
1213  std::vector<APERTURE>::iterator getAperture( const wxSize& aSize,
1214  APERTURE::APERTURE_TYPE aType, int aApertureAttribute );
1215 
1216  // the attributes dictionnary created/modifed by %TO, attached the objects, when they are created
1217  // by D01, D03 G36/G37 commands
1218  // standard attributes are .P, .C and .N
1219  // this is used by gerber readers when creating a new object. Cleared by %TD command
1220  // Note: m_objectAttributesDictionnary can store more than one attribute
1221  // the string stores the line(s) actually written to the gerber file
1222  // it can store a .P, .C or .N attribute, or 2 or 3 attributes, separated by a \n char (EOL)
1224 
1225  // The last aperture attribute generated (only one aperture attribute can be set)
1227 
1228  FILE* workFile;
1229  FILE* finalFile;
1230  wxString m_workFilename;
1231 
1235  void writeApertureList();
1236 
1237  std::vector<APERTURE> apertures;
1238  std::vector<APERTURE>::iterator currentAperture;
1239 
1240  bool m_gerberUnitInch; // true if the gerber units are inches, false for mm
1241  int m_gerberUnitFmt; // number of digits in mantissa.
1242  // usually 6 in Inches and 5 or 6 in mm
1243  bool m_useX2format; // In recent gerber files, attributes are added.
1244  // Attributes in file header will be added using X2 format if true
1245  // If false (X1 format), these attributes will be added as comments.
1246  bool m_useNetAttributes; // In recent gerber files, netlist info can be added.
1247  // It will be added if this param is true, using X2 or X1 format
1248 };
1249 
1250 
1251 class DXF_PLOTTER : public PLOTTER
1252 {
1253 public:
1255  {
1256  textAsLines = true;
1258  m_currentLineType = 0;
1259  }
1260 
1261  virtual PlotFormat GetPlotterType() const override
1262  {
1263  return PLOT_FORMAT_DXF;
1264  }
1265 
1266  static wxString GetDefaultFileExtension()
1267  {
1268  return wxString( wxT( "dxf" ) );
1269  }
1270 
1274  virtual void SetTextMode( PlotTextMode mode ) override
1275  {
1276  if( mode != PLOTTEXTMODE_DEFAULT )
1277  textAsLines = ( mode != PLOTTEXTMODE_NATIVE );
1278  }
1279 
1280  virtual bool StartPlot() override;
1281  virtual bool EndPlot() override;
1282 
1283  // For now we don't use 'thick' primitives, so no line width
1284  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override
1285  {
1286  currentPenWidth = 0;
1287  }
1288 
1289  virtual void SetDefaultLineWidth( int width ) override
1290  {
1291  // DXF lines are infinitesimal
1292  defaultPenWidth = 0;
1293  }
1294 
1295  virtual void SetDash( int dashed ) override;
1296 
1297  virtual void SetColor( COLOR4D color ) override;
1298 
1299  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
1300  double aScale, bool aMirror ) override;
1301  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
1302  int width = USE_DEFAULT_LINE_WIDTH ) override;
1303  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
1304  int width = USE_DEFAULT_LINE_WIDTH ) override;
1305  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
1306  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override;
1307  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
1308  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1309  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
1310  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
1311  virtual void PenTo( const wxPoint& pos, char plume ) override;
1312 
1313  virtual void FlashPadCircle( const wxPoint& pos, int diametre,
1314  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1315  virtual void FlashPadOval( const wxPoint& pos, const wxSize& size, double orient,
1316  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1317  virtual void FlashPadRect( const wxPoint& pos, const wxSize& size,
1318  double orient, EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1319  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
1320  int aCornerRadius, double aOrient,
1321  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1322  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
1323  SHAPE_POLY_SET* aPolygons,
1324  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1325  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
1326  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1327 
1328  virtual void Text( const wxPoint& aPos,
1329  const COLOR4D aColor,
1330  const wxString& aText,
1331  double aOrient,
1332  const wxSize& aSize,
1333  enum EDA_TEXT_HJUSTIFY_T aH_justify,
1334  enum EDA_TEXT_VJUSTIFY_T aV_justify,
1335  int aWidth,
1336  bool aItalic,
1337  bool aBold,
1338  bool aMultilineAllowed = false,
1339  void* aData = NULL ) override;
1340 
1341 protected:
1345 };
1346 
1347 class TITLE_BLOCK;
1348 void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
1349  const PAGE_INFO& aPageInfo,
1350  int aSheetNumber, int aNumberOfSheets,
1351  const wxString &aSheetDesc,
1352  const wxString &aFilename );
1353 
1356 wxString GetDefaultPlotExtension( PlotFormat aFormat );
1357 
1358 
1359 #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:827
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:911
void FinishTo(const wxPoint &pos)
Definition: plotter.h:251
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:403
int penSpeed
Definition: plotter.h:652
double GetDotMarkLenIU() const
Definition: plotter.cpp:136
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:604
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:161
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:62
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:257
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:764
void UseX2NetAttributes(bool aEnable)
Definition: plotter.h:1157
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:454
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
Definition: plotter.h:1284
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.
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:1014
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:969
virtual void emitSetRGBColor(double r, double g, double b) override
Virtual primitive for emitting the setrgbcolor operator.
Definition: PS_plotter.cpp:536
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:256
APERTURE_TYPE m_Type
Definition: plotter.h:1022
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:1021
void PlotWorkSheet(PLOTTER *plotter, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename)
bool textAsLines
Definition: plotter.h:1342
static const unsigned MARKER_COUNT
Draw a marker (used for the drill map)
Definition: plotter.h:401
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:906
bool m_useNetAttributes
Definition: plotter.h:1246
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:891
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
Definition: PS_plotter.cpp:726
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:684
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:419
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:662
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:928
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:445
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:822
std::vector< int > pageHandles
Font resource dictionary.
Definition: plotter.h:893
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:50
void UseX2format(bool aEnable)
Definition: plotter.h:1156
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:1237
bool colorMode
Definition: plotter.h:557
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:629
char penState
Current pen state: 'U', 'D' or 'Z' (see PenTo)
Definition: plotter.h:562
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:1343
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:539
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:1240
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.cpp:537
Definition of base KiCad text object.
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:572
static wxString GetDefaultFileExtension()
Definition: plotter.h:1040
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:601
wxPoint plotOffset
Plot offset (in IUs)
Definition: plotter.h:545
wxPoint penLastpos
Last pen positions; set to -1,-1 when the pen is at rest.
Definition: plotter.h:564
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:433
PAGE_INFO pageInfo
Definition: plotter.h:568
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
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:896
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.
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:1266
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:551
virtual bool EndPlot()=0
int streamLengthHandle
Handle of the page content object.
Definition: plotter.h:895
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
Definition: PS_plotter.cpp:774
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:246
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:1035
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:222
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plotter.h:549
virtual bool StartPlot() override
Opens the DXF plot with a skeleton header.
PS_PLOTTER()
Definition: plotter.h:757
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:595
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:971
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:344
double plotScaleAdjY
Definition: plotter.h:747
int startPdfStream(int handle=-1)
Starts a PDF stream (for the page).
EDA_DRAW_MODE_T
Definition: eda_text.h:77
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:942
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:428
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:606
int m_gerberUnitFmt
Definition: plotter.h:1241
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:593
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:582
double plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
Definition: plotter.h:533
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:548
FILE * workFile
Definition: plotter.h:897
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:1344
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:1229
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:519
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:741
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:69
int penNumber
Definition: plotter.h:653
void MoveTo(const wxPoint &pos)
Definition: plotter.h:241
bool m_useX2format
Definition: plotter.h:1243
wxString title
Definition: plotter.h:567
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 fontResDictHandle
Handle to the root of the page tree object.
Definition: plotter.h:892
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
virtual void SetTextMode(PlotTextMode mode) override
PS and PDF fully implement native text (for the Latin-1 subset)
Definition: plotter.h:673
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:654
void fputsPostscriptString(FILE *fout, const wxString &txt)
Write on a stream a string escaped for postscript/PDF.
Definition: PS_plotter.cpp:305
virtual void emitSetRGBColor(double r, double g, double b) override
PDF supports colors fully.
PDF_PLOTTER()
Definition: plotter.h:815
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:898
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:560
int defaultPenWidth
true to generate a negative image (PS mode mainly)
Definition: plotter.h:559
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:571
double GetDashMarkLenIU() const
Definition: plotter.cpp:142
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: plotter.h:1289
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:977
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:581
long m_brush_rgb_color
Definition: plotter.h:975
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:1261
double plotScaleAdjX
Fine user scale adjust ( = 1.0 if no correction)
Definition: plotter.h:747
virtual void SetColor(COLOR4D color) override
Definition: plotter.h:1057
double penDiameter
Definition: plotter.h:654
virtual void SetPenNumber(int number)
Definition: plotter.h:611
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:554
static wxString GetDefaultFileExtension()
Definition: plotter.h:586
std::string m_objectAttributesDictionnary
Definition: plotter.h:1223
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...
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:54
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:373
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:1230
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:426
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:1226
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:1023
virtual void SetTextMode(PlotTextMode mode) override
DXF handles NATIVE text emitting TEXT entities.
Definition: plotter.h:1274
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:1024
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:1228
double iuPerDeviceUnit
Device scale (from IUs to plotter device units - usually decimils)
Definition: plotter.h:542
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:566
virtual void SetDash(int dashed) override
Definition: plotter.h:1056
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:1238
PlotTextMode m_textMode
How to draw text.
Definition: plotter.h:750
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:894
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:769
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
wxString creator
Definition: plotter.h:565
wxSize paperSize
Paper size in IU - not in mils.
Definition: plotter.h:570
bool m_mirrorIsHorizontal
Definition: plotter.h:550
int m_dashed
Definition: plotter.h:980
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:558