# HG changeset patch
# User alpar
# Date 1106230600 0
# Node ID c756973cd53ce9672751bc8123e19ee0bd479879
# Parent  9e9195331ea66986c0d4cae400a1201a3c1f61b4
Now, the actual drawing is made by run() instead of the destructor.
diff -r 9e9195331ea6 -r c756973cd53c src/demo/graph_to_eps_demo.cc
--- a/src/demo/graph_to_eps_demo.cc	Thu Jan 20 10:24:38 2005 +0000
+++ b/src/demo/graph_to_eps_demo.cc	Thu Jan 20 14:16:40 2005 +0000
@@ -95,16 +95,19 @@
     nodeColors(composeMap(colorSet,colors)).
     edgeColors(composeMap(colorSet,ecolors)).
     edgeWidthScale(.4).edgeWidths(widths).
-    nodeTexts(id).nodeTextSize(3);
+    nodeTexts(id).nodeTextSize(3).
+    run();
 
-  graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).coords(coords).
+  graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
+    nodeColors(composeMap(colorSet,colors)).
+    coords(coords).
     nodeScale(2).nodeSizes(sizes).
     nodeShapes(shapes).
-    nodeColors(composeMap(colorSet,colors)).
     edgeColors(composeMap(colorSet,ecolors)).
     edgeWidthScale(.4).edgeWidths(widths).
     nodeTexts(id).nodeTextSize(3).
-    drawArrows().arrowWidth(1).arrowLength(1);
+    drawArrows().arrowWidth(1).arrowLength(1).
+    run();
 
   e=g.addEdge(n1,n4); ecolors[e]=2; widths[e]=1;
   e=g.addEdge(n4,n1); ecolors[e]=1; widths[e]=2;
@@ -117,17 +120,20 @@
   e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
   e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
 
-  graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).coords(coords).
+  graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
+    nodeShapes(shapes).
+    coords(coords).
     nodeScale(2).nodeSizes(sizes).
-    nodeShapes(shapes).
     nodeColors(composeMap(colorSet,colors)).
     edgeColors(composeMap(colorSet,ecolors)).
     edgeWidthScale(.4).edgeWidths(widths).
     nodeTexts(id).nodeTextSize(3).
-    enableParallel().parEdgeDist(1.5);
-
-  graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).coords(coords).
+    enableParallel().parEdgeDist(1.5).
+    run();
+  
+  graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
     nodeScale(2).nodeSizes(sizes).
+    coords(coords).
     nodeShapes(shapes).
     nodeColors(composeMap(colorSet,colors)).
     edgeColors(composeMap(colorSet,ecolors)).
@@ -135,5 +141,6 @@
     nodeTexts(id).nodeTextSize(3).
     enableParallel().parEdgeDist(1).
     //    hideNodes().
-    drawArrows().arrowWidth(1).arrowLength(1);
+    drawArrows().arrowWidth(1).arrowLength(1).
+    run();;
 }
diff -r 9e9195331ea6 -r c756973cd53c src/lemon/graph_to_eps.h
--- a/src/lemon/graph_to_eps.h	Thu Jan 20 10:24:38 2005 +0000
+++ b/src/lemon/graph_to_eps.h	Thu Jan 20 14:16:40 2005 +0000
@@ -421,8 +421,15 @@
   }
 
 public:
-  ~GraphToEps() 
-  {
+  ~GraphToEps() { }
+  
+  ///Draws the graph.
+
+  ///Like other functions using
+  ///\ref named-templ-func-param "named template parameters",
+  ///this function calles the algorithm itself, i.e. in this case
+  ///it draws the graph.
+  void run() {
     if(dontPrint) return;
     
     os << "%!PS-Adobe-2.0 EPSF-2.0\n";
@@ -667,14 +674,17 @@
 ///\param os is a reference to the output stream.
 ///By default it is std::cout
 ///
-///This function also has a lot of \ref named-templ-param "named parameters",
+///This function also has a lot of
+///\ref named-templ-func-param "named parameters",
 ///they are declared as the members of class \ref GraphToEps. The following
 ///example shows how to use these parameters.
 ///\code
 /// graphToEps(g).scale(10).coords(coords)
 ///              .nodeScale(2).nodeSizes(sizes)
-///              .edgeWidthScale(.4);
+///              .edgeWidthScale(.4).run();
 ///\endcode
+///\warning Don't forget to put the \ref GraphToEps::run() "run()"
+///to the end of the parameter list.
 ///\sa GraphToEps
 ///\sa graphToEps(G &g, char *file_name)
 template