... | ... |
@@ -19,10 +19,10 @@ |
19 | 19 |
/// \ingroup demos |
20 | 20 |
/// \file |
21 | 21 |
/// \brief Demo of the graph drawing function \ref graphToEps() |
22 | 22 |
/// |
23 |
/// This demo program shows examples how to use the function \ref |
|
24 |
/// graphToEps(). It takes no input but simply creates six |
|
23 |
/// This demo program shows examples how to use the function \ref |
|
24 |
/// graphToEps(). It takes no input but simply creates seven |
|
25 | 25 |
/// <tt>.eps</tt> files demonstrating the capability of \ref |
26 | 26 |
/// graphToEps(), and showing how to draw directed graphs, |
27 | 27 |
/// how to handle parallel egdes, how to change the properties (like |
28 | 28 |
/// color, shape, size, title etc.) of nodes and arcs individually |
... | ... |
@@ -80,9 +80,9 @@ |
80 | 80 |
a=g.addArc(n3,n4); acolors[a]=2; widths[a]=1; |
81 | 81 |
|
82 | 82 |
IdMap<ListDigraph,Node> id(g); |
83 | 83 |
|
84 |
// Create |
|
84 |
// Create .eps files showing the digraph with different options |
|
85 | 85 |
cout << "Create 'graph_to_eps_demo_out_1_pure.eps'" << endl; |
86 | 86 |
graphToEps(g,"graph_to_eps_demo_out_1_pure.eps"). |
87 | 87 |
coords(coords). |
88 | 88 |
title("Sample .eps figure"). |
... | ... |
@@ -117,8 +117,9 @@ |
117 | 117 |
nodeTexts(id).nodeTextSize(3). |
118 | 118 |
drawArrows().arrowWidth(2).arrowLength(2). |
119 | 119 |
run(); |
120 | 120 |
|
121 |
// Add more arcs to the digraph |
|
121 | 122 |
a=g.addArc(n1,n4); acolors[a]=2; widths[a]=1; |
122 | 123 |
a=g.addArc(n4,n1); acolors[a]=1; widths[a]=2; |
123 | 124 |
|
124 | 125 |
a=g.addArc(n1,n2); acolors[a]=1; widths[a]=1; |
... | ... |
@@ -128,11 +129,10 @@ |
128 | 129 |
a=g.addArc(n1,n2); acolors[a]=5; widths[a]=1; |
129 | 130 |
a=g.addArc(n1,n2); acolors[a]=6; widths[a]=1; |
130 | 131 |
a=g.addArc(n1,n2); acolors[a]=7; widths[a]=1; |
131 | 132 |
|
132 |
cout << "Create 'graph_to_eps_demo_out_par.eps'" << endl; |
|
133 |
graphToEps(g,"graph_to_eps_demo_out_par.eps"). |
|
134 |
|
|
133 |
cout << "Create 'graph_to_eps_demo_out_4_par.eps'" << endl; |
|
134 |
graphToEps(g,"graph_to_eps_demo_out_4_par.eps"). |
|
135 | 135 |
title("Sample .eps figure (parallel arcs)"). |
136 | 136 |
copyright("(C) 2003-2008 LEMON Project"). |
137 | 137 |
absoluteNodeSizes().absoluteArcWidths(). |
138 | 138 |
nodeShapes(shapes). |
... | ... |
@@ -144,10 +144,10 @@ |
144 | 144 |
nodeTexts(id).nodeTextSize(3). |
145 | 145 |
enableParallel().parArcDist(1.5). |
146 | 146 |
run(); |
147 | 147 |
|
148 |
cout << "Create 'graph_to_eps_demo_out_4_par_arr.eps'" << endl; |
|
149 |
graphToEps(g,"graph_to_eps_demo_out_4_par_arr.eps"). |
|
148 |
cout << "Create 'graph_to_eps_demo_out_5_par_arr.eps'" << endl; |
|
149 |
graphToEps(g,"graph_to_eps_demo_out_5_par_arr.eps"). |
|
150 | 150 |
title("Sample .eps figure (parallel arcs and arrowheads)"). |
151 | 151 |
copyright("(C) 2003-2008 LEMON Project"). |
152 | 152 |
absoluteNodeSizes().absoluteArcWidths(). |
153 | 153 |
nodeScale(2).nodeSizes(sizes). |
... | ... |
@@ -160,10 +160,10 @@ |
160 | 160 |
enableParallel().parArcDist(1). |
161 | 161 |
drawArrows().arrowWidth(1).arrowLength(1). |
162 | 162 |
run(); |
163 | 163 |
|
164 |
cout << "Create 'graph_to_eps_demo_out_5_par_arr_a4.eps'" << endl; |
|
165 |
graphToEps(g,"graph_to_eps_demo_out_5_par_arr_a4.eps"). |
|
164 |
cout << "Create 'graph_to_eps_demo_out_6_par_arr_a4.eps'" << endl; |
|
165 |
graphToEps(g,"graph_to_eps_demo_out_6_par_arr_a4.eps"). |
|
166 | 166 |
title("Sample .eps figure (fits to A4)"). |
167 | 167 |
copyright("(C) 2003-2008 LEMON Project"). |
168 | 168 |
scaleToA4(). |
169 | 169 |
absoluteNodeSizes().absoluteArcWidths(). |
... | ... |
@@ -189,10 +189,10 @@ |
189 | 189 |
hcoords[n]=Point(1+i%cols,1+i/cols); |
190 | 190 |
hcolors[n]=i; |
191 | 191 |
} |
192 | 192 |
|
193 |
cout << "Create 'graph_to_eps_demo_out_6_colors.eps'" << endl; |
|
194 |
graphToEps(h,"graph_to_eps_demo_out_6_colors.eps"). |
|
193 |
cout << "Create 'graph_to_eps_demo_out_7_colors.eps'" << endl; |
|
194 |
graphToEps(h,"graph_to_eps_demo_out_7_colors.eps"). |
|
195 | 195 |
scale(60). |
196 | 196 |
title("Sample .eps figure (Palette demo)"). |
197 | 197 |
copyright("(C) 2003-2008 LEMON Project"). |
198 | 198 |
coords(hcoords). |
0 comments (0 inline)