91 double aPadOrient,
OUTLINE_MODE aTraceMode,
void* aData )
94 int x0, y0, x1, y1,
delta;
100 std::swap( size.x, size.y );
101 aPadOrient =
AddAngles( aPadOrient, 900 );
104 delta = size.y - size.x;
112 if( aTraceMode ==
FILLED )
113 ThickSegment( wxPoint( aPadPos.x + x0, aPadPos.y + y0 ),
114 wxPoint( aPadPos.x + x1, aPadPos.y + y1 ), size.x, aTraceMode,
nullptr );
123 if( aTraceMode ==
FILLED )
138 double aPadOrient,
OUTLINE_MODE aTraceMode,
void* aData )
140 static std::vector< wxPoint > cornerList;
141 wxSize size( aSize );
144 if( aTraceMode ==
FILLED )
153 corner.x = aPadPos.x - dx;
154 corner.y = aPadPos.y + dy;
155 cornerList.push_back( corner );
156 corner.x = aPadPos.x - dx;
157 corner.y = aPadPos.y - dy;
158 cornerList.push_back( corner );
159 corner.x = aPadPos.x + dx;
160 corner.y = aPadPos.y - dy;
161 cornerList.push_back( corner );
162 corner.x = aPadPos.x + dx;
163 corner.y = aPadPos.y + dy,
164 cornerList.push_back( corner );
166 for(
unsigned ii = 0; ii < cornerList.size(); ii++ )
168 RotatePoint( &cornerList[ii], aPadPos, aPadOrient );
171 cornerList.push_back( cornerList[0] );
179 int aCornerRadius,
double aOrient,
182 wxSize size( aSize );
184 if( aTraceMode ==
FILLED )
198 std::vector< wxPoint > cornerList;
204 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
205 cornerList.emplace_back( poly.
CPoint( ii ).
x, poly.
CPoint( ii ).
y );
208 cornerList.push_back( cornerList[0] );
219 wxSize size( aSize );
221 if( aTraceMode ==
FILLED )
231 std::vector< wxPoint > cornerList;
233 for(
int cnt = 0; cnt < aPolygons->
OutlineCount(); ++cnt )
238 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
239 cornerList.emplace_back( poly.
CPoint( ii ).
x, poly.
CPoint( ii ).
y );
242 cornerList.push_back( cornerList[0] );
251 double aPadOrient,
OUTLINE_MODE aTraceMode,
void* aData )
253 static std::vector< wxPoint > cornerList;
256 for(
int ii = 0; ii < 4; ii++ )
257 cornerList.push_back( aCorners[ii] );
259 if( aTraceMode ==
FILLED )
268 for(
int ii = 0; ii < 4; ii++ )
271 cornerList[ii] += aPadPos;
274 cornerList.push_back( cornerList[0] );
291 std::string converted;
295 for(
unsigned i = 0; i < aUnicode.Len(); i++ )
298 wchar_t ch = aUnicode[i];
329 bool aItalic,
bool aBold )
335 for(
unsigned i = 0; i < aText.length(); i++ )
337 wchar_t AsciiCode = aText[i];
340 if( AsciiCode !=
'~' && AsciiCode < 256 )
342 tally += width_table[AsciiCode];
352 bool aItalic,
bool aBold,
353 std::vector<int> *pos_pairs )
361 for(
unsigned i = 0; i < aText.length(); i++ )
363 wchar_t AsciiCode = aText[i];
366 if( AsciiCode !=
'~' && AsciiCode < 256 )
368 tally += width_table[AsciiCode];
372 if( AsciiCode ==
'~' )
378 if( pos_pairs->size() % 2 == 1 )
384 double aScale,
bool aMirror )
401 const wxString& aText,
410 double *wideningFactor,
417 double *heightFactor )
420 wxPoint start_pos = aPos;
465 *wideningFactor = sz_dev.
x / sz_dev.
y;
470 *wideningFactor = -*wideningFactor;
476 double sinalpha = sin( alpha );
477 double cosalpha = cos( alpha );
499 else if( aWidth == 0 )
502 wxASSERT_MSG( aWidth > 0,
"Plotter called to set negative pen width" );
516 fprintf(
m_outputFile,
"%.3g %.3g %.3g setrgbcolor\n",
r, g, b );
549 fprintf(
m_outputFile,
"%g %g %g %g rect%d\n", p1_dev.
x, p1_dev.
y,
550 p2_dev.
x - p1_dev.
x, p2_dev.
y - p1_dev.
y,
getFillId( fill ) );
565 void PS_PLOTTER::Arc(
const wxPoint& centre,
double StAngle,
double EndAngle,
int radius,
573 if( StAngle > EndAngle )
574 std::swap( StAngle, EndAngle );
586 StAngle = 1800.0 -StAngle;
587 EndAngle = 1800.0 -EndAngle;
588 std::swap( StAngle, EndAngle );
593 EndAngle = -EndAngle;
597 fprintf(
m_outputFile,
"%g %g %g %g %g arc%d\n", centre_dev.
x, centre_dev.
y,
598 radius_dev, StAngle / 10.0, EndAngle / 10.0,
getFillId( fill ) );
603 int aWidth,
void * aData )
605 if( aCornerList.size() <= 1 )
613 for(
unsigned ii = 1; ii < aCornerList.size(); ii++ )
627 pix_size.x = aImage.GetWidth();
628 pix_size.y = aImage.GetHeight();
629 DPOINT drawsize( aScaleFactor * pix_size.x,
630 aScaleFactor * pix_size.y );
633 wxPoint start = aPos;
634 start.x -= drawsize.
x / 2;
635 start.y += drawsize.
y / 2;
639 end.x = start.x + drawsize.
x;
640 end.y = start.y - drawsize.
y;
643 fprintf(
m_outputFile,
"/pix %d string def\n", pix_size.x );
647 fprintf(
m_outputFile,
"%g %g translate\n", start_dev.
x, start_dev.
y );
652 std::abs(end_dev.
x - start_dev.
x), std::abs(end_dev.
y - start_dev.
y));
655 fprintf(
m_outputFile,
"%d %d 8", pix_size.x, pix_size.y );
658 fprintf(
m_outputFile,
" [%d 0 0 %d 0 %d]\n", pix_size.x, -pix_size.y , pix_size.y);
661 fprintf(
m_outputFile,
"{currentfile pix readhexstring pop}\n" );
672 for(
int yy = 0; yy < pix_size.y; yy ++ )
674 for(
int xx = 0; xx < pix_size.x; xx++, jj++ )
682 int red, green, blue;
683 red = aImage.GetRed( xx, yy) & 0xFF;
684 green = aImage.GetGreen( xx, yy) & 0xFF;
685 blue = aImage.GetBlue( xx, yy) & 0xFF;
688 if( aImage.HasAlpha() )
690 unsigned char alpha = aImage.GetAlpha( xx, yy ) & 0xFF;
694 float a = 1.0 - ( (float) alpha / 255.0 );
695 red = ( int )(
red + ( a * 0xFF ) ) & 0xFF;
696 green = ( int )( green + ( a * 0xFF ) ) & 0xFF;
697 blue = ( int )( blue + ( a * 0xFF ) ) & 0xFF;
701 if( aImage.HasMask() )
703 if(
red == aImage.GetMaskRed() && green == aImage.GetMaskGreen()
704 && blue == aImage.GetMaskBlue() )
719 unsigned char grey =
KiROUND(
red * 0.2126 + green * 0.7152 + blue * 0.0722 );
757 pos_dev.
x, pos_dev.
y,
758 ( plume==
'D' ) ?
"line" :
"move" );
771 static const char* PSMacro[] =
774 "/line { newpath moveto lineto stroke } bind def\n",
775 "/cir0 { newpath 0 360 arc stroke } bind def\n",
776 "/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
777 "/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
778 "/arc0 { newpath arc stroke } bind def\n",
779 "/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill\n",
780 " grestore stroke } bind def\n",
781 "/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill\n",
782 " grestore stroke } bind def\n",
783 "/poly0 { stroke } bind def\n",
784 "/poly1 { closepath gsave fill grestore stroke } bind def\n",
785 "/poly2 { closepath gsave fill grestore stroke } bind def\n",
786 "/rect0 { rectstroke } bind def\n",
787 "/rect1 { rectfill } bind def\n",
788 "/rect2 { rectfill } bind def\n",
789 "/linemode0 { 0 setlinecap 0 setlinejoin 0 setlinewidth } bind def\n",
790 "/linemode1 { 1 setlinecap 1 setlinejoin } bind def\n",
791 "/dashedline { [200] 100 setdash } bind def\n",
792 "/solidline { [] 0 setdash } bind def\n",
795 "/phantomshow { moveto\n",
796 " /KicadFont findfont 0.000001 scalefont setfont\n",
797 " show } bind def\n",
800 "/textshow { gsave\n",
801 " findfont exch scalefont setfont concat 1 scale 0 0 moveto show\n",
806 " findfont dup length dict begin\n",
807 " { 1 index /FID ne\n",
809 " { pop pop } ifelse\n",
811 " /Encoding ISOLatin1Encoding def\n",
816 "/KicadFont /Helvetica reencodefont definefont pop\n",
817 "/KicadFont-Bold /Helvetica-Bold reencodefont definefont pop\n",
818 "/KicadFont-Oblique /Helvetica-Oblique reencodefont definefont pop\n",
819 "/KicadFont-BoldOblique /Helvetica-BoldOblique reencodefont definefont pop\n",
824 time_t time1970 = time(
nullptr );
832 fprintf(
m_outputFile,
"%%%%CreationDate: %s", ctime( &time1970 ) );
838 const double BIGPTsPERMIL = 0.072;
849 (
int) ceil( psPaperSize.x * BIGPTsPERMIL ),
850 (
int) ceil( psPaperSize.y * BIGPTsPERMIL ) );
869 fprintf(
m_outputFile,
"%%%%DocumentMedia: Custom %d %d 0 () ()\n",
870 KiROUND( psPaperSize.x * BIGPTsPERMIL ),
871 KiROUND( psPaperSize.y * BIGPTsPERMIL ) );
875 fprintf(
m_outputFile,
"%%%%DocumentMedia: %s %d %d 0 () ()\n",
877 KiROUND( psPaperSize.x * BIGPTsPERMIL ),
878 KiROUND( psPaperSize.y * BIGPTsPERMIL ) );
884 fprintf(
m_outputFile,
"%%%%Orientation: Landscape\n" );
890 for(
int ii = 0; PSMacro[ii] !=
nullptr; ii++ )
899 fputs(
"%%Page: 1 1\n" 902 "0.0072 0.0072 scale\n" 908 fprintf(
m_outputFile,
"%d 0 translate 90 rotate\n", 10 * psPaperSize.x );
939 const wxString& aText,
947 bool aMultilineAllowed,
958 fprintf(
m_outputFile,
"%s %g %g phantomshow\n", ps_test.c_str(), pos_dev.
x, pos_dev.
y );
961 PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aWidth,
962 aItalic, aBold, aMultilineAllowed );
970 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
971 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
972 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
973 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
974 0.278, 0.278, 0.355, 0.556, 0.556, 0.889, 0.667, 0.191,
975 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
976 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
977 0.556, 0.556, 0.278, 0.278, 0.584, 0.584, 0.584, 0.556,
978 1.015, 0.667, 0.667, 0.722, 0.722, 0.667, 0.611, 0.778,
979 0.722, 0.278, 0.500, 0.667, 0.556, 0.833, 0.722, 0.778,
980 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
981 0.667, 0.667, 0.611, 0.278, 0.278, 0.278, 0.469, 0.556,
982 0.333, 0.556, 0.556, 0.500, 0.556, 0.556, 0.278, 0.556,
983 0.556, 0.222, 0.222, 0.500, 0.222, 0.833, 0.556, 0.556,
984 0.556, 0.556, 0.333, 0.500, 0.278, 0.556, 0.500, 0.722,
985 0.500, 0.500, 0.500, 0.334, 0.260, 0.334, 0.584, 0.278,
986 0.278, 0.278, 0.222, 0.556, 0.333, 1.000, 0.556, 0.556,
987 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
988 0.278, 0.222, 0.222, 0.333, 0.333, 0.350, 0.556, 1.000,
989 0.333, 1.000, 0.500, 0.333, 0.944, 0.278, 0.278, 0.667,
990 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.260, 0.556,
991 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
992 0.400, 0.584, 0.333, 0.333, 0.333, 0.556, 0.537, 0.278,
993 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
994 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 1.000, 0.722,
995 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
996 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
997 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
998 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.500,
999 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1000 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.584,
1001 0.611, 0.556, 0.556, 0.556, 0.556, 0.500, 0.556, 0.500
1009 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1010 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1011 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1012 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1013 0.278, 0.333, 0.474, 0.556, 0.556, 0.889, 0.722, 0.238,
1014 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1015 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1016 0.556, 0.556, 0.333, 0.333, 0.584, 0.584, 0.584, 0.611,
1017 0.975, 0.722, 0.722, 0.722, 0.722, 0.667, 0.611, 0.778,
1018 0.722, 0.278, 0.556, 0.722, 0.611, 0.833, 0.722, 0.778,
1019 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1020 0.667, 0.667, 0.611, 0.333, 0.278, 0.333, 0.584, 0.556,
1021 0.333, 0.556, 0.611, 0.556, 0.611, 0.556, 0.333, 0.611,
1022 0.611, 0.278, 0.278, 0.556, 0.278, 0.889, 0.611, 0.611,
1023 0.611, 0.611, 0.389, 0.556, 0.333, 0.611, 0.556, 0.778,
1024 0.556, 0.556, 0.500, 0.389, 0.280, 0.389, 0.584, 0.278,
1025 0.278, 0.278, 0.278, 0.556, 0.500, 1.000, 0.556, 0.556,
1026 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1027 0.278, 0.278, 0.278, 0.500, 0.500, 0.350, 0.556, 1.000,
1028 0.333, 1.000, 0.556, 0.333, 0.944, 0.278, 0.278, 0.667,
1029 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.280, 0.556,
1030 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1031 0.400, 0.584, 0.333, 0.333, 0.333, 0.611, 0.556, 0.278,
1032 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1033 0.722, 0.722, 0.722, 0.722, 0.722, 0.722, 1.000, 0.722,
1034 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1035 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1036 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1037 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.556,
1038 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1039 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.584,
1040 0.611, 0.611, 0.611, 0.611, 0.611, 0.556, 0.611, 0.556
1048 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1049 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1050 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1051 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1052 0.278, 0.278, 0.355, 0.556, 0.556, 0.889, 0.667, 0.191,
1053 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1054 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1055 0.556, 0.556, 0.278, 0.278, 0.584, 0.584, 0.584, 0.556,
1056 1.015, 0.667, 0.667, 0.722, 0.722, 0.667, 0.611, 0.778,
1057 0.722, 0.278, 0.500, 0.667, 0.556, 0.833, 0.722, 0.778,
1058 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1059 0.667, 0.667, 0.611, 0.278, 0.278, 0.278, 0.469, 0.556,
1060 0.333, 0.556, 0.556, 0.500, 0.556, 0.556, 0.278, 0.556,
1061 0.556, 0.222, 0.222, 0.500, 0.222, 0.833, 0.556, 0.556,
1062 0.556, 0.556, 0.333, 0.500, 0.278, 0.556, 0.500, 0.722,
1063 0.500, 0.500, 0.500, 0.334, 0.260, 0.334, 0.584, 0.278,
1064 0.278, 0.278, 0.222, 0.556, 0.333, 1.000, 0.556, 0.556,
1065 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1066 0.278, 0.222, 0.222, 0.333, 0.333, 0.350, 0.556, 1.000,
1067 0.333, 1.000, 0.500, 0.333, 0.944, 0.278, 0.278, 0.667,
1068 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.260, 0.556,
1069 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1070 0.400, 0.584, 0.333, 0.333, 0.333, 0.556, 0.537, 0.278,
1071 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1072 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 1.000, 0.722,
1073 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1074 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1075 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1076 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.500,
1077 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1078 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.584,
1079 0.611, 0.556, 0.556, 0.556, 0.556, 0.500, 0.556, 0.500
1087 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1088 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1089 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1090 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1091 0.278, 0.333, 0.474, 0.556, 0.556, 0.889, 0.722, 0.238,
1092 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1093 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1094 0.556, 0.556, 0.333, 0.333, 0.584, 0.584, 0.584, 0.611,
1095 0.975, 0.722, 0.722, 0.722, 0.722, 0.667, 0.611, 0.778,
1096 0.722, 0.278, 0.556, 0.722, 0.611, 0.833, 0.722, 0.778,
1097 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1098 0.667, 0.667, 0.611, 0.333, 0.278, 0.333, 0.584, 0.556,
1099 0.333, 0.556, 0.611, 0.556, 0.611, 0.556, 0.333, 0.611,
1100 0.611, 0.278, 0.278, 0.556, 0.278, 0.889, 0.611, 0.611,
1101 0.611, 0.611, 0.389, 0.556, 0.333, 0.611, 0.556, 0.778,
1102 0.556, 0.556, 0.500, 0.389, 0.280, 0.389, 0.584, 0.278,
1103 0.278, 0.278, 0.278, 0.556, 0.500, 1.000, 0.556, 0.556,
1104 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1105 0.278, 0.278, 0.278, 0.500, 0.500, 0.350, 0.556, 1.000,
1106 0.333, 1.000, 0.556, 0.333, 0.944, 0.278, 0.278, 0.667,
1107 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.280, 0.556,
1108 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1109 0.400, 0.584, 0.333, 0.333, 0.333, 0.611, 0.556, 0.278,
1110 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1111 0.722, 0.722, 0.722, 0.722, 0.722, 0.722, 1.000, 0.722,
1112 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1113 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1114 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1115 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.556,
1116 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1117 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.584,
1118 0.611, 0.611, 0.611, 0.611, 0.611, 0.556, 0.611, 0.556
const double hvb_widths[256]
Character widths for Helvetica-Bold.
const double hv_widths[256]
Character widths for Helvetica.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
double GetDotMarkLenIU() const
int OutlineCount() const
Return the number of vertices in a given outline/hole.
virtual void emitSetRGBColor(double r, double g, double b) override
Virtual primitive for emitting the setrgbcolor operator.
int GetHeightMils() const
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=0
Draw a polygon ( filled or not ).
virtual void PenTo(const wxPoint &pos, char plume) override
Moveto/lineto primitive, moves the 'pen' to the specified direction.
virtual bool EndPlot() override
FILE * m_outputFile
Output file.
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
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=nullptr) override
Draw text with the plotter.
virtual void SetCurrentLineWidth(int width, void *aData=nullptr) override
Set the current line width (in IUs) for the next plot.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
const wxString & GetType() const
const double hvo_widths[256]
Character widths for Helvetica-Oblique.
void RotatePoint(int *pX, int *pY, double angle)
PLOT_TEXT_MODE m_textMode
How to draw text.
static int getFillId(FILL_T aFill)
int PointCount() const
Return the number of points (vertices) in this line chain.
virtual std::string encodeStringForPlotter(const wxString &aUnicode)
convert a wxString unicode string to a char string compatible with the accepted string plotter format...
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData)
This file contains miscellaneous commonly used macros and functions.
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle with rounded corners and/or chamfered corners to a polygon.
virtual void FlashRegularPolygon(const wxPoint &aShapePos, int aDiameter, int aCornerCount, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a regular polygon.
double GetDashGapLenIU() const
double m_plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
virtual int GetCurrentLineWidth() const
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData) override
static const int USE_DEFAULT_LINE_WIDTH
virtual void SetColor(const COLOR4D &color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a trapezoidal pad.
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
virtual void emitSetRGBColor(double r, double g, double b)=0
Virtual primitive for emitting the setrgbcolor operator.
Represent a set of closed polygons.
int returnPostscriptTextWidth(const wxString &aText, int aXSize, bool aItalic, bool aBold)
Sister function for the GraphicTextWidth in drawtxt.cpp Does the same processing (i....
SHAPE_LINE_CHAIN & Outline(int aIndex)
virtual void Arc(const wxPoint ¢re, 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 Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
RENDER_SETTINGS * m_renderSettings
const wxSize & GetSizeMils() const
virtual DPOINT userToDeviceSize(const wxSize &size)
Modify size according to the plotter scale factors (wxSize version, returns a DPOINT).
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
Draw a polygon ( filled or not ).
PLOT_DASH_TYPE
Dashed line types.
static const double postscriptTextAscent
Height of the postscript font (from the AFM)
Plotting engines similar to ps (PostScript, Gerber, svg)
virtual DPOINT userToDeviceCoordinates(const wxPoint &aCoordinate)
Modify coordinates according to the orientation, scale factor, and offsets trace.
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PostScript-likes at the moment are the only plot engines supporting bitmaps.
const double hvbo_widths[256]
Character widths for Helvetica-BoldOblique.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
double GetDashMarkLenIU() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
double plotScaleAdjX
Fine user scale adjust ( = 1.0 if no correction)
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, double aOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData) override
double DECIDEG2RAD(double deg)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
int GetPlotterArcHighDef() const
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.
int GetDefaultPenWidth() const
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=nullptr)
Draw text with the plotter.
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.
static const int DO_NOT_SET_LINE_WIDTH
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
void sketchOval(const wxPoint &pos, const wxSize &size, double orient, int width)
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
bool m_mirrorIsHorizontal
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
virtual void SetDash(PLOT_DASH_TYPE dashed) override
PostScript supports dashed lines.
A color representation with 4 components: red, green, blue, alpha.