1.1 --- a/demo/graph_to_eps_demo.cc Wed Jul 20 08:03:15 2005 +0000
1.2 +++ b/demo/graph_to_eps_demo.cc Wed Jul 20 08:06:32 2005 +0000
1.3 @@ -14,13 +14,21 @@
1.4 *
1.5 */
1.6
1.7 -#include<lemon/graph_to_eps.h>
1.8 -#include<lemon/maps.h>
1.9 -#include<lemon/list_graph.h>
1.10 -#include<lemon/graph_utils.h>
1.11 +/// \ingroup demos
1.12 +/// \file
1.13 +/// \brief Demo of the graph grawing function \ref graphToEps()
1.14 +///
1.15 +/// This demo program shows examples how to use the function \ref
1.16 +/// graphToEps(). It takes no input but simply creates six
1.17 +/// <tt>.eps</tt> files demonstrating how to draw directed/undirected
1.18 +/// graphs, how to handle parallel egdes, how to change the properties
1.19 +/// (like color, shape, size, title etc.) of nodes and edges
1.20 +/// individually using appropriate \ref maps-page "graphmaps".
1.21
1.22 #include <cmath>
1.23
1.24 +#include<lemon/graph_to_eps.h>
1.25 +#include<lemon/list_graph.h>
1.26
1.27 using namespace std;
1.28 using namespace lemon;
1.29 @@ -66,6 +74,7 @@
1.30
1.31 IdMap<ListGraph,Node> id(g);
1.32
1.33 + cout << "Create 'graph_to_eps_demo_out.eps'" << endl;
1.34 graphToEps(g,"graph_to_eps_demo_out.eps").scale(10).coords(coords).
1.35 title("Sample .eps figure").
1.36 copyright("(C) 2005 LEMON Project").
1.37 @@ -77,6 +86,8 @@
1.38 nodeTexts(id).nodeTextSize(3).
1.39 run();
1.40
1.41 +
1.42 + cout << "Create 'graph_to_eps_demo_out_arr.eps'" << endl;
1.43 graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
1.44 title("Sample .eps figure (with arrowheads)").
1.45 copyright("(C) 2005 LEMON Project").
1.46 @@ -101,6 +112,7 @@
1.47 e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
1.48 e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
1.49
1.50 + cout << "Create 'graph_to_eps_demo_out_par.eps'" << endl;
1.51 graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
1.52 title("Sample .eps figure (parallel edges)").
1.53 copyright("(C) 2005 LEMON Project").
1.54 @@ -114,6 +126,7 @@
1.55 enableParallel().parEdgeDist(1.5).
1.56 run();
1.57
1.58 + cout << "Create 'graph_to_eps_demo_out_par_arr.eps'" << endl;
1.59 graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
1.60 title("Sample .eps figure (parallel edges and arrowheads)").
1.61 copyright("(C) 2005 LEMON Project").
1.62 @@ -128,6 +141,7 @@
1.63 drawArrows().arrowWidth(1).arrowLength(1).
1.64 run();
1.65
1.66 + cout << "Create 'graph_to_eps_demo_out_a4.eps'" << endl;
1.67 graphToEps(g,"graph_to_eps_demo_out_a4.eps").scaleToA4().
1.68 title("Sample .eps figure (fits to A4)").
1.69 copyright("(C) 2005 LEMON Project").
1.70 @@ -153,8 +167,9 @@
1.71 hcolors[n]=i;
1.72 }
1.73
1.74 + cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
1.75 graphToEps(h,"graph_to_eps_demo_out_colors.eps").scale(60).
1.76 - title("Sample .eps figure (parallel edges and arrowheads)").
1.77 + title("Sample .eps figure (ColorSet demo)").
1.78 copyright("(C) 2005 LEMON Project").
1.79 coords(hcoords).
1.80 nodeScale(.45).