1.1 --- a/lemon/eps.cc Wed Mar 15 09:45:10 2006 +0000
1.2 +++ b/lemon/eps.cc Wed Mar 15 09:45:59 2006 +0000
1.3 @@ -298,4 +298,66 @@
1.4 return *this;
1.5 }
1.6
1.7 + EpsDrawer &EpsDrawer::node(NodeShapes t, double x, double y, double r,
1.8 + Color col, Color brd)
1.9 + {
1.10 + out << "gsave\n"
1.11 + << brd.red() << ' ' << brd.green() << ' ' << brd.blue()
1.12 + << " setrgbcolor\n";
1.13 + switch(t) {
1.14 + case CIRCLE:
1.15 + out << "newpath " << x << ' ' << y << ' ' << r
1.16 + << " dup 3 index add 2 index moveto 0 360 arc fill\n";
1.17 + break;
1.18 + case SQUARE:
1.19 + out << "newpath\n"
1.20 + << x-r << ' ' << y-r << " moveto\n"
1.21 + << x-r << ' ' << y+r << " lineto\n"
1.22 + << x+r << ' ' << y+r << " lineto\n"
1.23 + << x+r << ' ' << y-r << " lineto closepath fill\n";
1.24 + break;
1.25 + case DIAMOND:
1.26 + out << "newpath\n"
1.27 + << x-r << ' ' << y << " moveto\n"
1.28 + << x << ' ' << y+r << " lineto\n"
1.29 + << x+r << ' ' << y << " lineto\n"
1.30 + << x << ' ' << y-r << " lineto closepath fill\n";
1.31 + break;
1.32 + case MALE:
1.33 + break;
1.34 + case FEMALE:
1.35 + break;
1.36 + }
1.37 + r/=1.1;
1.38 + out << col.red() << ' ' << col.green() << ' ' << col.blue()
1.39 + << " setrgbcolor\n";
1.40 + switch(t) {
1.41 + case CIRCLE:
1.42 + out << "newpath " << x << ' ' << y << ' ' << r
1.43 + << " dup 3 index add 2 index moveto 0 360 arc fill\n";
1.44 + break;
1.45 + case SQUARE:
1.46 + out << "newpath\n"
1.47 + << x-r << ' ' << y-r << " moveto\n"
1.48 + << x-r << ' ' << y+r << " lineto\n"
1.49 + << x+r << ' ' << y+r << " lineto\n"
1.50 + << x+r << ' ' << y-r << " lineto closepath fill\n";
1.51 + break;
1.52 + case DIAMOND:
1.53 + out << "newpath\n"
1.54 + << x-r << ' ' << y << " moveto\n"
1.55 + << x << ' ' << y+r << " lineto\n"
1.56 + << x+r << ' ' << y << " lineto\n"
1.57 + << x << ' ' << y-r << " lineto closepath fill\n";
1.58 + break;
1.59 + case MALE:
1.60 + break;
1.61 + case FEMALE:
1.62 + break;
1.63 + }
1.64 +
1.65 + out << "grestore\n";
1.66 + return *this;
1.67 + }
1.68 +
1.69 }