13 #include "msdevstudio/MSconfig.h"
24 #ifdef ITERATOR_MEMBER_DEFECT
32 using namespace hippodraw;
35 EpsView (
const std::string filename,
double x,
double y,
double w,
double h )
37 m_boundingRect ( x, y, w, h )
51 m_outfile << x <<
" " << y <<
" lineto\n";
58 m_outfile << x <<
" " << y <<
" moveto\n";
95 double inv = 1. / 255.;
98 << blue * inv <<
" setrgbcolor\n";
112 double,
double,
double w,
double h )
115 const char * fn = fname.c_str();
118 m_outfile <<
"%%!PS-Adobe-3.0 EPSF-3.0" << endl;
119 m_outfile <<
"%%Creator: HippoDraw" << endl;
127 << x1 <<
" " << y1 <<
" "
128 << x2 <<
" " << y2 << endl;
133 m_outfile <<
"%% Add emulation of selectfont if needed" << endl;
134 m_outfile <<
"%% taken from PS Lang. Ref. Manual, Appendix D.4" << endl;
136 m_outfile <<
" exch findfont exch" << endl;
137 m_outfile <<
" dup type /arraytype eq {makefont}{scalefont} ifelse setfont"
141 m_outfile <<
"/languagelevel where" << endl;
142 m_outfile <<
" {pop languagelevel} {1} ifelse" << endl;
143 m_outfile <<
"2 lt {/SF /*SF load def}{/SF /selectfont load def} ifelse"
146 m_outfile <<
"%%" << endl <<
"%%" << endl;
156 const std::vector< double > & y,
172 for (
unsigned int i = 0; i < x.size(); i = i+2 )
175 m_outfile <<
"gsave" << endl <<
"newpath systemdict begin" << endl;
188 const std::vector< double > & y,
190 const std::vector < Color > & colors,
198 for (
unsigned int i = 0; i < x.size(); i+=2 ){
200 const Color & color = colors[i];
205 m_outfile <<
"gsave" << endl <<
"newpath systemdict begin" << endl;
220 const std::vector< double > & y,
227 m_outfile <<
"%% drawViewLines1" << endl;
234 for (
unsigned int i = 0; i < x.size(); i = i+2 )
237 m_outfile <<
"gsave" << endl <<
"newpath systemdict begin" << endl;
250 const std::vector< double > & y,
257 m_outfile <<
"%% drawViewLines2" << endl;
265 for (
unsigned int i = 0; i < x.size(); i = i+2 )
268 m_outfile <<
"gsave" << endl <<
"newpath systemdict begin" << endl;
281 const std::vector< double > & ypoints,
296 m_outfile <<
"gsave" << endl <<
"newpath systemdict begin" << endl;
299 for (
unsigned int i = 1; i < xpoints.size(); i++ )
301 double view_x =
toViewX ( xpoints[i] );
302 double view_y =
toViewY ( ypoints[i] );
303 lineTo ( view_x, view_y );
317 int red,
int green,
int blue )
338 int red,
int green,
int blue )
361 double x,
double y,
float sym_size )
391 <<
"0.0 360 arc" << endl;
414 const std::vector<double> & y,
417 const Color & color )
432 m_outfile <<
"newpath systemdict begin" << endl;
434 for (
unsigned int i = 0; i < x.size(); i++) {
456 const std::vector< double > & y,
457 const std::vector< Color > & colors,
471 for (
unsigned int i = 0; i < x.size(); i++)
475 const Color & color = colors[i];
478 m_outfile <<
"newpath systemdict begin" << endl;
498 float fontsize,
float angle,
499 char xp,
char yp,
const FontBase * font )
501 float xStep = 0.0, yStep = 0.0;
536 m_outfile <<
"(Helvetica) " << fontsize <<
" SF" << endl;
537 size = static_cast <
int > ( fontsize );
540 string family (
"(" );
541 family += font -> family ();
543 size = font -> pointSize ();
544 m_outfile << family << size <<
" SF" << endl;
546 m_outfile << x <<
" " << y <<
" translate " << angle <<
" rotate" << endl;
548 m_outfile <<
"(" << s <<
") stringwidth pop" << endl;
549 m_outfile << xStep <<
" neg mul " << -size*yStep <<
" moveto" << endl;
550 m_outfile <<
"(" << s <<
") show" << endl;
559 float fontsize,
float angle,
560 char xp,
char yp,
bool,
562 const Color * color )
637 return ( s1 - ( s2 - ( mar_y
638 - 2 * margin_rect.
getY()