MALE and FEMALE node shape added.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/doc/images/nodeshape_3.eps Thu Jan 26 06:43:59 2006 +0000
1.3 @@ -0,0 +1,77 @@
1.4 +%!PS-Adobe-2.0 EPSF-2.0
1.5 +%%Title: LEMON GraphToEps figure
1.6 +%%Creator: LEMON GraphToEps function
1.7 +%%BoundingBox: 0 0 256 372
1.8 +%%EndComments
1.9 +/lb { setlinewidth setrgbcolor newpath moveto
1.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
1.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
1.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
1.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
1.14 + 2 index 1 index sub 2 index 2 index add lineto
1.15 + 2 index 1 index sub 2 index 2 index sub lineto
1.16 + 2 index 1 index add 2 index 2 index sub lineto
1.17 + closepath pop pop pop} bind def
1.18 +/di { newpath 2 index 1 index add 2 index moveto
1.19 + 2 index 2 index 2 index add lineto
1.20 + 2 index 1 index sub 2 index lineto
1.21 + 2 index 2 index 2 index sub lineto
1.22 + closepath pop pop pop} bind def
1.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
1.24 + setrgbcolor 1.1 div c fill
1.25 + } bind def
1.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
1.27 + setrgbcolor 1.1 div sq fill
1.28 + } bind def
1.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
1.30 + setrgbcolor 1.1 div di fill
1.31 + } bind def
1.32 +/nfemale { 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
1.33 + newpath 5 index 5 index moveto 5 index 5 index 5 index 3.01 mul sub
1.34 + lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto
1.35 + 5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke
1.36 + 5 index 5 index 5 index c fill
1.37 + setrgbcolor 1.1 div c fill
1.38 + } bind def
1.39 +/nmale {
1.40 + 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
1.41 + newpath 5 index 5 index moveto
1.42 + 5 index 4 index 1 mul 1.5 mul add
1.43 + 5 index 5 index 3 sqrt 1.5 mul mul add
1.44 + 1 index 1 index lineto
1.45 + 1 index 1 index 7 index sub moveto
1.46 + 1 index 1 index lineto
1.47 + exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto
1.48 + stroke
1.49 + 5 index 5 index 5 index c fill
1.50 + setrgbcolor 1.1 div c fill
1.51 + } bind def
1.52 +/arrl 1 def
1.53 +/arrw 0.3 def
1.54 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
1.55 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
1.56 + /w exch def /len exch def
1.57 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
1.58 + len w sub arrl sub dx dy lrl
1.59 + arrw dy dx neg lrl
1.60 + dx arrl w add mul dy w 2 div arrw add mul sub
1.61 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
1.62 + dx arrl w add mul neg dy w 2 div arrw add mul sub
1.63 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
1.64 + arrw dy dx neg lrl
1.65 + len w sub arrl sub neg dx dy lrl
1.66 + closepath fill } bind def
1.67 +/cshow { 2 index 2 index moveto dup stringwidth pop
1.68 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
1.69 +
1.70 +gsave
1.71 +100 dup scale
1.72 +%Edges:
1.73 +gsave
1.74 +grestore
1.75 +%Nodes:
1.76 +gsave
1.77 +1 1 1 0.2 1 0.2 nmale
1.78 +grestore
1.79 +grestore
1.80 +showpage
2.1 Binary file doc/images/nodeshape_3.png has changed
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/doc/images/nodeshape_4.eps Thu Jan 26 06:43:59 2006 +0000
3.3 @@ -0,0 +1,77 @@
3.4 +%!PS-Adobe-2.0 EPSF-2.0
3.5 +%%Title: LEMON GraphToEps figure
3.6 +%%Creator: LEMON GraphToEps function
3.7 +%%BoundingBox: 0 -199 200 200
3.8 +%%EndComments
3.9 +/lb { setlinewidth setrgbcolor newpath moveto
3.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
3.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
3.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
3.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
3.14 + 2 index 1 index sub 2 index 2 index add lineto
3.15 + 2 index 1 index sub 2 index 2 index sub lineto
3.16 + 2 index 1 index add 2 index 2 index sub lineto
3.17 + closepath pop pop pop} bind def
3.18 +/di { newpath 2 index 1 index add 2 index moveto
3.19 + 2 index 2 index 2 index add lineto
3.20 + 2 index 1 index sub 2 index lineto
3.21 + 2 index 2 index 2 index sub lineto
3.22 + closepath pop pop pop} bind def
3.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
3.24 + setrgbcolor 1.1 div c fill
3.25 + } bind def
3.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
3.27 + setrgbcolor 1.1 div sq fill
3.28 + } bind def
3.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
3.30 + setrgbcolor 1.1 div di fill
3.31 + } bind def
3.32 +/nfemale { 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
3.33 + newpath 5 index 5 index moveto 5 index 5 index 5 index 3.01 mul sub
3.34 + lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto
3.35 + 5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke
3.36 + 5 index 5 index 5 index c fill
3.37 + setrgbcolor 1.1 div c fill
3.38 + } bind def
3.39 +/nmale {
3.40 + 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
3.41 + newpath 5 index 5 index moveto
3.42 + 5 index 4 index 1 mul 1.5 mul add
3.43 + 5 index 5 index 3 sqrt 1.5 mul mul add
3.44 + 1 index 1 index lineto
3.45 + 1 index 1 index 7 index sub moveto
3.46 + 1 index 1 index lineto
3.47 + exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto
3.48 + stroke
3.49 + 5 index 5 index 5 index c fill
3.50 + setrgbcolor 1.1 div c fill
3.51 + } bind def
3.52 +/arrl 1 def
3.53 +/arrw 0.3 def
3.54 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
3.55 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
3.56 + /w exch def /len exch def
3.57 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
3.58 + len w sub arrl sub dx dy lrl
3.59 + arrw dy dx neg lrl
3.60 + dx arrl w add mul dy w 2 div arrw add mul sub
3.61 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
3.62 + dx arrl w add mul neg dy w 2 div arrw add mul sub
3.63 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
3.64 + arrw dy dx neg lrl
3.65 + len w sub arrl sub neg dx dy lrl
3.66 + closepath fill } bind def
3.67 +/cshow { 2 index 2 index moveto dup stringwidth pop
3.68 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
3.69 +
3.70 +gsave
3.71 +100 dup scale
3.72 +%Edges:
3.73 +gsave
3.74 +grestore
3.75 +%Nodes:
3.76 +gsave
3.77 +1 1 1 0.2 1 0.2 nfemale
3.78 +grestore
3.79 +grestore
3.80 +showpage
4.1 Binary file doc/images/nodeshape_4.png has changed
5.1 --- a/lemon/graph_to_eps.h Wed Jan 25 16:44:19 2006 +0000
5.2 +++ b/lemon/graph_to_eps.h Thu Jan 26 06:43:59 2006 +0000
5.3 @@ -385,7 +385,17 @@
5.4 ///\image html nodeshape_2.png
5.5 ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm
5.6 ///
5.7 - DIAMOND=2
5.8 + DIAMOND=2,
5.9 + /// = 3
5.10 + ///\image html nodeshape_3.png
5.11 + ///\image latex nodeshape_2.eps "MALE shape (4)" width=2cm
5.12 + ///
5.13 + MALE=3,
5.14 + /// = 4
5.15 + ///\image html nodeshape_4.png
5.16 + ///\image latex nodeshape_2.eps "FEMALE shape (4)" width=2cm
5.17 + ///
5.18 + FEMALE=4
5.19 };
5.20
5.21 private:
5.22 @@ -750,6 +760,8 @@
5.23 {
5.24 switch(t) {
5.25 case CIRCLE:
5.26 + case MALE:
5.27 + case FEMALE:
5.28 return p.normSquare()<=r*r;
5.29 case SQUARE:
5.30 return p.x<=r&&p.x>=-r&&p.y<=r&&p.y>=-r;
5.31 @@ -813,8 +825,22 @@
5.32 for(NodeIt n(g);n!=INVALID;++n) {
5.33 double ns=_nodeSizes[n]*_nodeScale;
5.34 xy<double> p(ns,ns);
5.35 - bb.add(p+mycoords[n]);
5.36 - bb.add(-p+mycoords[n]);
5.37 + switch(_nodeShapes[n]) {
5.38 + case CIRCLE:
5.39 + case SQUARE:
5.40 + case DIAMOND:
5.41 + bb.add(p+mycoords[n]);
5.42 + bb.add(-p+mycoords[n]);
5.43 + break;
5.44 + case MALE:
5.45 + bb.add(-p+mycoords[n]);
5.46 + bb.add(xy<double>(1.5*ns,1.5*sqrt(3)*ns)+mycoords[n]);
5.47 + break;
5.48 + case FEMALE:
5.49 + bb.add(p+mycoords[n]);
5.50 + bb.add(xy<double>(-ns,-3.01*ns)+mycoords[n]);
5.51 + break;
5.52 + }
5.53 }
5.54 if (bb.empty()) {
5.55 bb = BoundingBox<double>(xy<double>(0,0));
5.56 @@ -858,6 +884,33 @@
5.57 os << "/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill\n"
5.58 << " setrgbcolor " << 1+_nodeBorderQuotient << " div di fill\n"
5.59 << " } bind def\n";
5.60 + os << "/nfemale { 0 0 0 setrgbcolor 3 index "
5.61 + << _nodeBorderQuotient/(1+_nodeBorderQuotient)
5.62 + << " 1.5 mul mul setlinewidth\n"
5.63 + << " newpath 5 index 5 index moveto "
5.64 + << "5 index 5 index 5 index 3.01 mul sub\n"
5.65 + << " lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto\n"
5.66 + << " 5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke\n"
5.67 + << " 5 index 5 index 5 index c fill\n"
5.68 + << " setrgbcolor " << 1+_nodeBorderQuotient << " div c fill\n"
5.69 + << " } bind def\n";
5.70 + os << "/nmale {\n"
5.71 + << " 0 0 0 setrgbcolor 3 index "
5.72 + << _nodeBorderQuotient/(1+_nodeBorderQuotient)
5.73 + <<" 1.5 mul mul setlinewidth\n"
5.74 + << " newpath 5 index 5 index moveto\n"
5.75 + << " 5 index 4 index 1 mul 1.5 mul add\n"
5.76 + << " 5 index 5 index 3 sqrt 1.5 mul mul add\n"
5.77 + << " 1 index 1 index lineto\n"
5.78 + << " 1 index 1 index 7 index sub moveto\n"
5.79 + << " 1 index 1 index lineto\n"
5.80 + << " exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto\n"
5.81 + << " stroke\n"
5.82 + << " 5 index 5 index 5 index c fill\n"
5.83 + << " setrgbcolor " << 1+_nodeBorderQuotient << " div c fill\n"
5.84 + << " } bind def\n";
5.85 +
5.86 +
5.87 os << "/arrl " << _arrowLength << " def\n";
5.88 os << "/arrw " << _arrowWidth << " def\n";
5.89 // l dx_norm dy_norm
5.90 @@ -1039,6 +1092,10 @@
5.91 os<< "nsq";break;
5.92 case DIAMOND:
5.93 os<< "ndi";break;
5.94 + case MALE:
5.95 + os<< "nmale";break;
5.96 + case FEMALE:
5.97 + os<< "nfemale";break;
5.98 }
5.99 os<<'\n';
5.100 }