Now, the actual drawing is made by run() instead of the destructor.
1.1 --- a/src/demo/graph_to_eps_demo.cc Thu Jan 20 10:24:38 2005 +0000
1.2 +++ b/src/demo/graph_to_eps_demo.cc Thu Jan 20 14:16:40 2005 +0000
1.3 @@ -95,16 +95,19 @@
1.4 nodeColors(composeMap(colorSet,colors)).
1.5 edgeColors(composeMap(colorSet,ecolors)).
1.6 edgeWidthScale(.4).edgeWidths(widths).
1.7 - nodeTexts(id).nodeTextSize(3);
1.8 + nodeTexts(id).nodeTextSize(3).
1.9 + run();
1.10
1.11 - graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).coords(coords).
1.12 + graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
1.13 + nodeColors(composeMap(colorSet,colors)).
1.14 + coords(coords).
1.15 nodeScale(2).nodeSizes(sizes).
1.16 nodeShapes(shapes).
1.17 - nodeColors(composeMap(colorSet,colors)).
1.18 edgeColors(composeMap(colorSet,ecolors)).
1.19 edgeWidthScale(.4).edgeWidths(widths).
1.20 nodeTexts(id).nodeTextSize(3).
1.21 - drawArrows().arrowWidth(1).arrowLength(1);
1.22 + drawArrows().arrowWidth(1).arrowLength(1).
1.23 + run();
1.24
1.25 e=g.addEdge(n1,n4); ecolors[e]=2; widths[e]=1;
1.26 e=g.addEdge(n4,n1); ecolors[e]=1; widths[e]=2;
1.27 @@ -117,17 +120,20 @@
1.28 e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
1.29 e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
1.30
1.31 - graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).coords(coords).
1.32 + graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
1.33 + nodeShapes(shapes).
1.34 + coords(coords).
1.35 nodeScale(2).nodeSizes(sizes).
1.36 - nodeShapes(shapes).
1.37 nodeColors(composeMap(colorSet,colors)).
1.38 edgeColors(composeMap(colorSet,ecolors)).
1.39 edgeWidthScale(.4).edgeWidths(widths).
1.40 nodeTexts(id).nodeTextSize(3).
1.41 - enableParallel().parEdgeDist(1.5);
1.42 -
1.43 - graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).coords(coords).
1.44 + enableParallel().parEdgeDist(1.5).
1.45 + run();
1.46 +
1.47 + graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
1.48 nodeScale(2).nodeSizes(sizes).
1.49 + coords(coords).
1.50 nodeShapes(shapes).
1.51 nodeColors(composeMap(colorSet,colors)).
1.52 edgeColors(composeMap(colorSet,ecolors)).
1.53 @@ -135,5 +141,6 @@
1.54 nodeTexts(id).nodeTextSize(3).
1.55 enableParallel().parEdgeDist(1).
1.56 // hideNodes().
1.57 - drawArrows().arrowWidth(1).arrowLength(1);
1.58 + drawArrows().arrowWidth(1).arrowLength(1).
1.59 + run();;
1.60 }
2.1 --- a/src/lemon/graph_to_eps.h Thu Jan 20 10:24:38 2005 +0000
2.2 +++ b/src/lemon/graph_to_eps.h Thu Jan 20 14:16:40 2005 +0000
2.3 @@ -421,8 +421,15 @@
2.4 }
2.5
2.6 public:
2.7 - ~GraphToEps()
2.8 - {
2.9 + ~GraphToEps() { }
2.10 +
2.11 + ///Draws the graph.
2.12 +
2.13 + ///Like other functions using
2.14 + ///\ref named-templ-func-param "named template parameters",
2.15 + ///this function calles the algorithm itself, i.e. in this case
2.16 + ///it draws the graph.
2.17 + void run() {
2.18 if(dontPrint) return;
2.19
2.20 os << "%!PS-Adobe-2.0 EPSF-2.0\n";
2.21 @@ -667,14 +674,17 @@
2.22 ///\param os is a reference to the output stream.
2.23 ///By default it is <tt>std::cout</tt>
2.24 ///
2.25 -///This function also has a lot of \ref named-templ-param "named parameters",
2.26 +///This function also has a lot of
2.27 +///\ref named-templ-func-param "named parameters",
2.28 ///they are declared as the members of class \ref GraphToEps. The following
2.29 ///example shows how to use these parameters.
2.30 ///\code
2.31 /// graphToEps(g).scale(10).coords(coords)
2.32 /// .nodeScale(2).nodeSizes(sizes)
2.33 -/// .edgeWidthScale(.4);
2.34 +/// .edgeWidthScale(.4).run();
2.35 ///\endcode
2.36 +///\warning Don't forget to put the \ref GraphToEps::run() "run()"
2.37 +///to the end of the parameter list.
2.38 ///\sa GraphToEps
2.39 ///\sa graphToEps(G &g, char *file_name)
2.40 template<class G>