author | deba |
Mon, 12 Sep 2005 09:19:52 +0000 | |
changeset 1680 | 4f8b9cee576b |
child 1681 | 84e43c7ca1e3 |
permissions | -rw-r--r-- |
deba@1680 | 1 |
#include <lemon/grid_graph.h> |
deba@1680 | 2 |
#include <lemon/graph_adaptor.h> |
deba@1680 | 3 |
#include <lemon/graph_to_eps.h> |
deba@1680 | 4 |
#include <lemon/xy.h> |
deba@1680 | 5 |
|
deba@1680 | 6 |
#include <iostream> |
deba@1680 | 7 |
#include <fstream> |
deba@1680 | 8 |
|
deba@1680 | 9 |
using namespace lemon; |
deba@1680 | 10 |
using namespace std; |
deba@1680 | 11 |
|
deba@1680 | 12 |
int main() { |
deba@1680 | 13 |
GridGraph graph(5, 7); |
deba@1680 | 14 |
GridGraph::NodeMap<xy<double> > coord(graph); |
deba@1680 | 15 |
for (int i = 0; i < graph.width(); ++i) { |
deba@1680 | 16 |
for (int j = 0; j < graph.height(); ++j) { |
deba@1680 | 17 |
coord[graph(i, j)] = xy<double>(i * 10.0, j * 10.0); |
deba@1680 | 18 |
} |
deba@1680 | 19 |
} |
deba@1680 | 20 |
graphToEps(graph, "grid_graph.eps").scaleToA4(). |
deba@1680 | 21 |
title("Grid graph"). |
deba@1680 | 22 |
copyright("(C) 2005 LEMON Project"). |
deba@1680 | 23 |
coords(coord). |
deba@1680 | 24 |
enableParallel(). |
deba@1680 | 25 |
nodeScale(.45). |
deba@1680 | 26 |
drawArrows(). |
deba@1680 | 27 |
run(); |
deba@1680 | 28 |
return 0; |
deba@1680 | 29 |
} |