[Lemon-commits] [lemon_svn] alpar: r1488 - in hugo/trunk/src: demo lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:45:49 CET 2006


Author: alpar
Date: Thu Jan 20 15:16:40 2005
New Revision: 1488

Modified:
   hugo/trunk/src/demo/graph_to_eps_demo.cc
   hugo/trunk/src/lemon/graph_to_eps.h

Log:
Now, the actual drawing is made by run() instead of the destructor.

Modified: hugo/trunk/src/demo/graph_to_eps_demo.cc
==============================================================================
--- hugo/trunk/src/demo/graph_to_eps_demo.cc	(original)
+++ hugo/trunk/src/demo/graph_to_eps_demo.cc	Thu Jan 20 15:16:40 2005
@@ -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).
-    nodeScale(2).nodeSizes(sizes).
+  graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
     nodeShapes(shapes).
+    coords(coords).
+    nodeScale(2).nodeSizes(sizes).
     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();;
 }

Modified: hugo/trunk/src/lemon/graph_to_eps.h
==============================================================================
--- hugo/trunk/src/lemon/graph_to_eps.h	(original)
+++ hugo/trunk/src/lemon/graph_to_eps.h	Thu Jan 20 15:16:40 2005
@@ -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 <tt>std::cout</tt>
 ///
-///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<class G>



More information about the Lemon-commits mailing list