Changeset 1088:358526a620f8 in lemon0.x
 Timestamp:
 01/19/05 13:17:11 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1484
 Location:
 src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

src/demo/graph_to_eps_demo.cc
r1086 r1088 73 73 74 74 coords[n1]=Xy(50,50); sizes[n1]=1; colors[n1]=1; shapes[n1]=0; 75 coords[n2]=Xy(50,70); sizes[n2]=2; colors[n2]=2; shapes[n2]= 0;75 coords[n2]=Xy(50,70); sizes[n2]=2; colors[n2]=2; shapes[n2]=2; 76 76 coords[n3]=Xy(70,70); sizes[n3]=1; colors[n3]=3; shapes[n3]=0; 77 77 coords[n4]=Xy(70,50); sizes[n4]=2; colors[n4]=4; shapes[n4]=1; 78 coords[n5]=Xy(85,60); sizes[n5]=3; colors[n5]=5; shapes[n5]= 0;78 coords[n5]=Xy(85,60); sizes[n5]=3; colors[n5]=5; shapes[n5]=2; 79 79 80 80 Edge e; 
src/lemon/graph_to_eps.h
r1087 r1088 158 158 bool dontPrint; 159 159 160 enum NodeShapes { CIRCLE=0, SQUARE=1 };160 enum NodeShapes { CIRCLE=0, SQUARE=1, DIAMOND=2 }; 161 161 162 162 class edgeLess { … … 415 415 case SQUARE: 416 416 return p.x<=r&&p.x>=r&&p.y<=r&&p.y>=r; 417 case DIAMOND: 418 return p.x+p.y<=r && p.xp.y<=r && p.x+p.y<=r && p.xp.y<=r; 417 419 } 418 420 return false; … … 450 452 << " 2 index 1 index add 2 index 2 index sub lineto\n" 451 453 << " closepath pop pop pop} bind def\n"; 454 //x y r 455 os << "/di { newpath 2 index 1 index add 2 index moveto\n" 456 << " 2 index 2 index 2 index add lineto\n" 457 << " 2 index 1 index sub 2 index lineto\n" 458 << " 2 index 2 index 2 index sub lineto\n" 459 << " closepath pop pop pop} bind def\n"; 452 460 // x y r cr cg cb 453 461 os << "/nc { setrgbcolor 2 index 2 index 2 index c fill\n" … … 460 468 << _nodeBorderQuotient << " mul setlinewidth " 461 469 << 1+_nodeBorderQuotient/2 << " div sq stroke\n" 470 << " } bind def\n"; 471 os << "/ndi { setrgbcolor 2 index 2 index 2 index di fill\n" 472 << " 0 0 0 setrgbcolor dup " 473 << _nodeBorderQuotient << " mul setlinewidth " 474 << 1+_nodeBorderQuotient/2 << " div di stroke\n" 462 475 << " } bind def\n"; 463 476 os << "/arrl " << _arrowLength << " def\n"; … … 620 633 case SQUARE: 621 634 os<< "nsq";break; 635 case DIAMOND: 636 os<< "ndi";break; 622 637 } 623 638 os<<'\n';
Note: See TracChangeset
for help on using the changeset viewer.