Changeset 2008:0820d8168cbb in lemon-0.x for lemon/eps.cc
- Timestamp:
- 03/15/06 10:45:59 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2623
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/eps.cc
r1971 r2008 299 299 } 300 300 301 EpsDrawer &EpsDrawer::node(NodeShapes t, double x, double y, double r, 302 Color col, Color brd) 303 { 304 out << "gsave\n" 305 << brd.red() << ' ' << brd.green() << ' ' << brd.blue() 306 << " setrgbcolor\n"; 307 switch(t) { 308 case CIRCLE: 309 out << "newpath " << x << ' ' << y << ' ' << r 310 << " dup 3 index add 2 index moveto 0 360 arc fill\n"; 311 break; 312 case SQUARE: 313 out << "newpath\n" 314 << x-r << ' ' << y-r << " moveto\n" 315 << x-r << ' ' << y+r << " lineto\n" 316 << x+r << ' ' << y+r << " lineto\n" 317 << x+r << ' ' << y-r << " lineto closepath fill\n"; 318 break; 319 case DIAMOND: 320 out << "newpath\n" 321 << x-r << ' ' << y << " moveto\n" 322 << x << ' ' << y+r << " lineto\n" 323 << x+r << ' ' << y << " lineto\n" 324 << x << ' ' << y-r << " lineto closepath fill\n"; 325 break; 326 case MALE: 327 break; 328 case FEMALE: 329 break; 330 } 331 r/=1.1; 332 out << col.red() << ' ' << col.green() << ' ' << col.blue() 333 << " setrgbcolor\n"; 334 switch(t) { 335 case CIRCLE: 336 out << "newpath " << x << ' ' << y << ' ' << r 337 << " dup 3 index add 2 index moveto 0 360 arc fill\n"; 338 break; 339 case SQUARE: 340 out << "newpath\n" 341 << x-r << ' ' << y-r << " moveto\n" 342 << x-r << ' ' << y+r << " lineto\n" 343 << x+r << ' ' << y+r << " lineto\n" 344 << x+r << ' ' << y-r << " lineto closepath fill\n"; 345 break; 346 case DIAMOND: 347 out << "newpath\n" 348 << x-r << ' ' << y << " moveto\n" 349 << x << ' ' << y+r << " lineto\n" 350 << x+r << ' ' << y << " lineto\n" 351 << x << ' ' << y-r << " lineto closepath fill\n"; 352 break; 353 case MALE: 354 break; 355 case FEMALE: 356 break; 357 } 358 359 out << "grestore\n"; 360 return *this; 361 } 362 301 363 }
Note: See TracChangeset
for help on using the changeset viewer.