Changeset 1907:9f9eeb4d5c69 in lemon0.x
 Timestamp:
 01/26/06 07:43:59 (14 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2482
 Files:

 4 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/graph_to_eps.h
r1875 r1907 386 386 ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm 387 387 /// 388 DIAMOND=2 388 DIAMOND=2, 389 /// = 3 390 ///\image html nodeshape_3.png 391 ///\image latex nodeshape_2.eps "MALE shape (4)" width=2cm 392 /// 393 MALE=3, 394 /// = 4 395 ///\image html nodeshape_4.png 396 ///\image latex nodeshape_2.eps "FEMALE shape (4)" width=2cm 397 /// 398 FEMALE=4 389 399 }; 390 400 … … 751 761 switch(t) { 752 762 case CIRCLE: 763 case MALE: 764 case FEMALE: 753 765 return p.normSquare()<=r*r; 754 766 case SQUARE: … … 814 826 double ns=_nodeSizes[n]*_nodeScale; 815 827 xy<double> p(ns,ns); 816 bb.add(p+mycoords[n]); 817 bb.add(p+mycoords[n]); 828 switch(_nodeShapes[n]) { 829 case CIRCLE: 830 case SQUARE: 831 case DIAMOND: 832 bb.add(p+mycoords[n]); 833 bb.add(p+mycoords[n]); 834 break; 835 case MALE: 836 bb.add(p+mycoords[n]); 837 bb.add(xy<double>(1.5*ns,1.5*sqrt(3)*ns)+mycoords[n]); 838 break; 839 case FEMALE: 840 bb.add(p+mycoords[n]); 841 bb.add(xy<double>(ns,3.01*ns)+mycoords[n]); 842 break; 843 } 818 844 } 819 845 if (bb.empty()) { … … 859 885 << " setrgbcolor " << 1+_nodeBorderQuotient << " div di fill\n" 860 886 << " } bind def\n"; 887 os << "/nfemale { 0 0 0 setrgbcolor 3 index " 888 << _nodeBorderQuotient/(1+_nodeBorderQuotient) 889 << " 1.5 mul mul setlinewidth\n" 890 << " newpath 5 index 5 index moveto " 891 << "5 index 5 index 5 index 3.01 mul sub\n" 892 << " lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto\n" 893 << " 5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke\n" 894 << " 5 index 5 index 5 index c fill\n" 895 << " setrgbcolor " << 1+_nodeBorderQuotient << " div c fill\n" 896 << " } bind def\n"; 897 os << "/nmale {\n" 898 << " 0 0 0 setrgbcolor 3 index " 899 << _nodeBorderQuotient/(1+_nodeBorderQuotient) 900 <<" 1.5 mul mul setlinewidth\n" 901 << " newpath 5 index 5 index moveto\n" 902 << " 5 index 4 index 1 mul 1.5 mul add\n" 903 << " 5 index 5 index 3 sqrt 1.5 mul mul add\n" 904 << " 1 index 1 index lineto\n" 905 << " 1 index 1 index 7 index sub moveto\n" 906 << " 1 index 1 index lineto\n" 907 << " exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto\n" 908 << " stroke\n" 909 << " 5 index 5 index 5 index c fill\n" 910 << " setrgbcolor " << 1+_nodeBorderQuotient << " div c fill\n" 911 << " } bind def\n"; 912 913 861 914 os << "/arrl " << _arrowLength << " def\n"; 862 915 os << "/arrw " << _arrowWidth << " def\n"; … … 1040 1093 case DIAMOND: 1041 1094 os<< "ndi";break; 1095 case MALE: 1096 os<< "nmale";break; 1097 case FEMALE: 1098 os<< "nfemale";break; 1042 1099 } 1043 1100 os<<'\n';
Note: See TracChangeset
for help on using the changeset viewer.