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 
546 
552 
554  FILE* outputFile;
555 
556  // Pen handling
557  bool colorMode;
562  char penState;
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
598  currentPenWidth = userToDeviceSize( penDiameter );
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:
665  PSLIKE_PLOTTER() : plotScaleAdjX( 1 ), plotScaleAdjY( 1 ),
666  m_textMode( PLOTTEXTMODE_PHANTOM )
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 
747  double plotScaleAdjX, plotScaleAdjY;
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!
761  m_textMode = PLOTTEXTMODE_STROKE;
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:
815  PDF_PLOTTER() : pageStreamHandle( 0 ), workFile( NULL )
816  {
817  // Avoid non initialized variables:
818  pageStreamHandle = streamLengthHandle = fontResDictHandle = 0;
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  virtual void Text( const wxPoint& aPos,
940  const COLOR4D aColor,
941  const wxString& aText,
942  double aOrient,
943  const wxSize& aSize,
944  enum EDA_TEXT_HJUSTIFY_T aH_justify,
945  enum EDA_TEXT_VJUSTIFY_T aV_justify,
946  int aWidth,
947  bool aItalic,
948  bool aBold,
949  bool aMultilineAllowed = false,
950  void* aData = NULL ) override;
951 
952 protected:
953  FILL_T m_fillMode; // true if the current contour
954  // rect, arc, circle, polygon must be filled
955  long m_pen_rgb_color; // current rgb color value: each color has
956  // a value 0 ... 255, and the 3 colors are
957  // grouped in a 3x8 bits value
958  // (written in hex to svg files)
959  long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill
960  // some contours.
961  bool m_graphics_changed; // true if a pen/brush parameter is modified
962  // color, pen size, fil mode ...
963  // the new SVG stype must be output on file
964  int m_dashed; // 0 = plot solid line style
965  // 1 = plot dashed line style
966  // 2 = plot dotted line style
967  // 3 = plot dash-dot line style
968 
974  virtual void emitSetRGBColor( double r, double g, double b ) override;
975 
980  void setSVGPlotStyle();
981 
986  void setFillMode( FILL_T fill );
987 };
988 
989 /* Class to handle a D_CODE when plotting a board : */
990 #define FIRST_DCODE_VALUE 10 // D_CODE < 10 is a command, D_CODE >= 10 is a tool
991 
992 class APERTURE
993 {
994 public:
996  Circle = 1,
997  Rect = 2,
998  Plotting = 3,
999  Oval = 4
1000  };
1001 
1002  wxSize m_Size; // horiz and Vert size
1003  APERTURE_TYPE m_Type; // Type ( Line, rect , circulaire , ovale .. )
1004  int m_DCode; // code number ( >= 10 );
1005  int m_ApertureAttribute; // the attribute attached to this aperture
1006  // Only one attribute is allowed by aperture
1007  // 0 = no specific aperture attribute
1008 };
1009 
1010 
1011 class GERBER_PLOTTER : public PLOTTER
1012 {
1013 public:
1014  GERBER_PLOTTER();
1015 
1016  virtual PlotFormat GetPlotterType() const override
1017  {
1018  return PLOT_FORMAT_GERBER;
1019  }
1020 
1021  static wxString GetDefaultFileExtension()
1022  {
1023  return wxString( wxT( "gbr" ) );
1024  }
1025 
1031  virtual bool StartPlot() override;
1032  virtual bool EndPlot() override;
1033  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
1034  virtual void SetDefaultLineWidth( int width ) override;
1035 
1036  // RS274X has no dashing, nor colours
1037  virtual void SetDash( int dashed ) override {}
1038  virtual void SetColor( COLOR4D color ) override {}
1039  // Currently, aScale and aMirror are not used in gerber plotter
1040  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
1041  double aScale, bool aMirror ) override;
1042  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
1043  int width = USE_DEFAULT_LINE_WIDTH ) override;
1044  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
1045  int width = USE_DEFAULT_LINE_WIDTH ) override;
1046  virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
1047  int aRadius, FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override;
1048 
1049  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
1050  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1051 
1052  virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
1053  int rayon, int width, EDA_DRAW_MODE_T tracemode, void* aData ) override;
1054  virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
1055  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1056  virtual void ThickCircle( const wxPoint& pos, int diametre, int width,
1057  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1062  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
1063  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
1064  void * aData = NULL ) override;
1065 
1066  virtual void PenTo( const wxPoint& pos, char plume ) override;
1067 
1068  virtual void Text( const wxPoint& aPos,
1069  const COLOR4D aColor,
1070  const wxString& aText,
1071  double aOrient,
1072  const wxSize& aSize,
1073  enum EDA_TEXT_HJUSTIFY_T aH_justify,
1074  enum EDA_TEXT_VJUSTIFY_T aV_justify,
1075  int aWidth,
1076  bool aItalic,
1077  bool aBold,
1078  bool aMultilineAllowed = false,
1079  void* aData = NULL ) override;
1080 
1084  virtual void FlashPadCircle( const wxPoint& pos, int diametre,
1085  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1086 
1090  virtual void FlashPadOval( const wxPoint& pos, const wxSize& size, double orient,
1091  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1097  virtual void FlashPadRect( const wxPoint& pos, const wxSize& size,
1098  double orient, EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1099 
1105  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
1106  int aCornerRadius, double aOrient,
1107  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1108  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
1109  SHAPE_POLY_SET* aPolygons,
1110  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1116  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
1117  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1118 
1123  virtual void SetLayerPolarity( bool aPositive ) override;
1124 
1135  virtual void SetGerberCoordinatesFormat( int aResolution, bool aUseInches = false ) override;
1136 
1137  void UseX2Attributes( bool aEnable ) { m_useX2Attributes = aEnable; }
1138  void UseX2NetAttributes( bool aEnable ) { m_useNetAttributes = aEnable; }
1139 
1145  virtual void StartBlock( void* aData ) override;
1146 
1153  virtual void EndBlock( void* aData ) override;
1154 
1155 protected:
1161  void selectAperture( const wxSize& aSize, APERTURE::APERTURE_TYPE aType,
1162  int aApertureAttribute );
1163 
1169  void emitDcode( const DPOINT& pt, int dcode );
1170 
1178  void formatNetAttribute( GBR_NETLIST_METADATA* aData );
1179 
1184  void clearNetAttribute();
1185 
1194  std::vector<APERTURE>::iterator getAperture( const wxSize& aSize,
1195  APERTURE::APERTURE_TYPE aType, int aApertureAttribute );
1196 
1197  // the attributes dictionnary created/modifed by %TO, attached the objects, when they are created
1198  // by D01, D03 G36/G37 commands
1199  // standard attributes are .P, .C and .N
1200  // this is used by gerber readers when creating a new object. Cleared by %TD command
1201  // Note: m_objectAttributesDictionnary can store more than one attribute
1202  // the string stores the line(s) actually written to the gerber file
1203  // it can store a .P, .C or .N attribute, or 2 or 3 attributes, separated by a \n char (EOL)
1205 
1206  // The last aperture attribute generated (only one aperture attribute can be set)
1208 
1209  FILE* workFile;
1210  FILE* finalFile;
1211  wxString m_workFilename;
1212 
1216  void writeApertureList();
1217 
1218  std::vector<APERTURE> apertures;
1219  std::vector<APERTURE>::iterator currentAperture;
1220 
1221  bool m_gerberUnitInch; // true if the gerber units are inches, false for mm
1222  int m_gerberUnitFmt; // number of digits in mantissa.
1223  // usually 6 in Inches and 5 or 6 in mm
1224  bool m_useX2Attributes; // In recent gerber files, attributes can be added.
1225  // It will be added if this parm is true
1226  bool m_useNetAttributes; // In recent gerber files, netlist info can be added.
1227  // It will be added if this parm is true
1228  // (imply m_useX2Attributes == true)
1229 };
1230 
1231 
1232 class DXF_PLOTTER : public PLOTTER
1233 {
1234 public:
1235  DXF_PLOTTER() : textAsLines( false )
1236  {
1237  textAsLines = true;
1238  m_currentColor = COLOR4D::BLACK;
1239  m_currentLineType = 0;
1240  }
1241 
1242  virtual PlotFormat GetPlotterType() const override
1243  {
1244  return PLOT_FORMAT_DXF;
1245  }
1246 
1247  static wxString GetDefaultFileExtension()
1248  {
1249  return wxString( wxT( "dxf" ) );
1250  }
1251 
1255  virtual void SetTextMode( PlotTextMode mode ) override
1256  {
1257  if( mode != PLOTTEXTMODE_DEFAULT )
1258  textAsLines = ( mode != PLOTTEXTMODE_NATIVE );
1259  }
1260 
1261  virtual bool StartPlot() override;
1262  virtual bool EndPlot() override;
1263 
1264  // For now we don't use 'thick' primitives, so no line width
1265  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override
1266  {
1267  currentPenWidth = 0;
1268  }
1269 
1270  virtual void SetDefaultLineWidth( int width ) override
1271  {
1272  // DXF lines are infinitesimal
1273  defaultPenWidth = 0;
1274  }
1275 
1276  virtual void SetDash( int dashed ) override;
1277 
1278  virtual void SetColor( COLOR4D color ) override;
1279 
1280  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
1281  double aScale, bool aMirror ) override;
1282  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
1283  int width = USE_DEFAULT_LINE_WIDTH ) override;
1284  virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
1285  int width = USE_DEFAULT_LINE_WIDTH ) override;
1286  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
1287  FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override;
1288  virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
1289  EDA_DRAW_MODE_T tracemode, void* aData ) override;
1290  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
1291  int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
1292  virtual void PenTo( const wxPoint& pos, char plume ) override;
1293 
1294  virtual void FlashPadCircle( const wxPoint& pos, int diametre,
1295  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1296  virtual void FlashPadOval( const wxPoint& pos, const wxSize& size, double orient,
1297  EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1298  virtual void FlashPadRect( const wxPoint& pos, const wxSize& size,
1299  double orient, EDA_DRAW_MODE_T trace_mode, void* aData ) override;
1300  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
1301  int aCornerRadius, double aOrient,
1302  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1303  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
1304  SHAPE_POLY_SET* aPolygons,
1305  EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1306  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
1307  double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
1308 
1309  virtual void Text( const wxPoint& aPos,
1310  const COLOR4D aColor,
1311  const wxString& aText,
1312  double aOrient,
1313  const wxSize& aSize,
1314  enum EDA_TEXT_HJUSTIFY_T aH_justify,
1315  enum EDA_TEXT_VJUSTIFY_T aV_justify,
1316  int aWidth,
1317  bool aItalic,
1318  bool aBold,
1319  bool aMultilineAllowed = false,
1320  void* aData = NULL ) override;
1321 
1322 protected:
1326 };
1327 
1328 class TITLE_BLOCK;
1329 void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
1330  const PAGE_INFO& aPageInfo,
1331  int aSheetNumber, int aNumberOfSheets,
1332  const wxString &aSheetDesc,
1333  const wxString &aFilename );
1334 
1337 wxString GetDefaultPlotExtension( PlotFormat aFormat );
1338 
1339 
1340 #endif // PLOT_COMMON_H_
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
int penSpeed
Definition: plotter.h:652
void markerHBar(const wxPoint &pos, int radius)
Plot a - bar centered on the position.
Definition: plotter.cpp:253
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
void PenFinish()
Definition: plotter.h:257
static wxString GetDefaultFileExtension()
Definition: plotter.h:764
void UseX2NetAttributes(bool aEnable)
Definition: plotter.h:1138
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:1265
APERTURE_TYPE
Definition: plotter.h:995
virtual bool StartPlot()=0
FILL_T m_fillMode
Definition: plotter.h:953
APERTURE_TYPE m_Type
Definition: plotter.h:1003
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 SetTitle(const wxString &aTitle)
Definition: plotter.h:166
wxSize m_Size
Definition: plotter.h:1002
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:1323
static const unsigned MARKER_COUNT
Draw a marker (used for the drill map)
Definition: plotter.h:401
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:1226
int pageTreeHandle
Definition: plotter.h:891
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:126
void SetScaleAdjust(double scaleX, double scaleY)
Set the &#39;fine&#39; scaling for the postscript engine.
Definition: plotter.h:684
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 StartBlock(void *aData)
calling this function allows one to define the beginning of a group of drawing items, for instance in SVG or Gerber format.
Definition: plotter.h:445
virtual void PenTo(const wxPoint &pos, char plume)=0
moveto/lineto primitive, moves the &#39;pen&#39; to the specified direction
double GetDotMarkLenIU() const
Definition: plotter.cpp:136
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
std::vector< APERTURE > apertures
Definition: plotter.h:1218
bool colorMode
Definition: plotter.h:557
virtual ~PLOTTER()
Definition: plotter.cpp:70
char penState
Current pen state: &#39;U&#39;, &#39;D&#39; or &#39;Z&#39; (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:1324
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:1221
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, printout, or editing view.
Definition: title_block.h:40
wxArrayString m_headerExtraLines
Definition: plotter.h:572
static wxString GetDefaultFileExtension()
Definition: plotter.h:1021
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 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
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.
static wxString GetDefaultFileExtension()
Definition: plotter.h:1247
virtual void ThickRect(const wxPoint &p1, const wxPoint &p2, int width, EDA_DRAW_MODE_T tracemode, void *aData)
Definition: plotter.cpp:489
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
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
void LineTo(const wxPoint &pos)
Definition: plotter.h:246
virtual PlotFormat GetPlotterType() const override
Returns the effective plot engine in use.
Definition: plotter.h:1016
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadCircle
static const int USE_DEFAULT_LINE_WIDTH
Definition: plotter.h:102
bool m_plotMirror
X axis orientation (SVG) and plot mirrored (only for PS, PDF HPGL and SVG)
Definition: plotter.h:549
PS_PLOTTER()
Definition: plotter.h:757
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
HPGL doesn&#39;t handle line thickness or color.
Definition: plotter.h:595
Class SHAPE_POLY_SET.
long m_pen_rgb_color
Definition: plotter.h:955
double plotScaleAdjY
Definition: plotter.h:747
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 SetTextMode(PlotTextMode mode)
Change the current text mode.
Definition: plotter.h:428
virtual void SetPenSpeed(int speed)
Definition: plotter.h:606
int m_gerberUnitFmt
Definition: plotter.h:1222
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadRoundRect
double plotScale
Plot scale - chosen by the user (even implicitly with &#39;fit in a4&#39;)
Definition: plotter.h:533
FILE * workFile
Definition: plotter.h:897
int m_currentLineType
Definition: plotter.h:1325
bool GetColorMode() const
Definition: plotter.h:131
virtual DPOINT userToDeviceSize(const wxSize &size)
Modifies size according to the plotter scale factors (wxSize version, returns a DPOINT) ...
Definition: plotter.cpp:121
FILE * finalFile
Definition: plotter.h:1210
virtual void SetNegative(bool aNegative)
Definition: plotter.h:118
void markerSlash(const wxPoint &pos, int radius)
Plot a / bar centered on the position.
Definition: plotter.cpp:260
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
void Marker(const wxPoint &position, int diametre, unsigned aShapeId)
Draw a pattern shape number aShapeId, to coord position.
Definition: plotter.cpp:281
virtual void SetDefaultLineWidth(int width)=0
Set the default line width.
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
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
int fontResDictHandle
Handle to the root of the page tree object.
Definition: plotter.h:892
bool m_useX2Attributes
Definition: plotter.h:1224
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
PDF_PLOTTER()
Definition: plotter.h:815
std::vector< long > xrefTable
Temporary file to costruct the stream before zipping.
Definition: plotter.h:898
int currentPenWidth
Definition: plotter.h:560
virtual int GetCurrentLineWidth() const
Definition: plotter.h:152
int defaultPenWidth
true to generate a negative image (PS mode mainly)
Definition: plotter.h:559
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void *aData)=0
virtual function FlashPadOval
virtual void SetDefaultLineWidth(int width) override
Set the default line width.
Definition: plotter.h:1270
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:961
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:959
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:1242
virtual void SetColor(COLOR4D color) override
Definition: plotter.h:1038
double penDiameter
Definition: plotter.h:654
virtual void SetPenNumber(int number)
Definition: plotter.h:611
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:1204
double GetDashGapLenIU() const
Definition: plotter.cpp:148
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
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 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
wxString m_workFilename
Definition: plotter.h:1211
Definition: colors.h:45
int m_apertureAttribute
Definition: plotter.h:1207
int m_DCode
Definition: plotter.h:1004
virtual void SetTextMode(PlotTextMode mode) override
DXF handles NATIVE text emitting TEXT entities.
Definition: plotter.h:1255
double GetDashMarkLenIU() const
Definition: plotter.cpp:142
int m_ApertureAttribute
Definition: plotter.h:1005
FILE * workFile
Definition: plotter.h:1209
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:1037
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:1219
PlotTextMode m_textMode
How to draw text.
Definition: plotter.h:750
void markerSquare(const wxPoint &position, int radius)
Plot a square centered on the position.
Definition: plotter.cpp:198
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
void UseX2Attributes(bool aEnable)
Definition: plotter.h:1137
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:964
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
bool negativeMode
true to plot in color, false to plot in black and white
Definition: plotter.h:558