demo/grid_graph_demo.cc
changeset 1680 4f8b9cee576b
child 1681 84e43c7ca1e3
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/demo/grid_graph_demo.cc	Mon Sep 12 09:19:52 2005 +0000
     1.3 @@ -0,0 +1,29 @@
     1.4 +#include <lemon/grid_graph.h>
     1.5 +#include <lemon/graph_adaptor.h>
     1.6 +#include <lemon/graph_to_eps.h>
     1.7 +#include <lemon/xy.h>
     1.8 +
     1.9 +#include <iostream>
    1.10 +#include <fstream>
    1.11 +
    1.12 +using namespace lemon;
    1.13 +using namespace std;
    1.14 +
    1.15 +int main() {
    1.16 +  GridGraph graph(5, 7);
    1.17 +  GridGraph::NodeMap<xy<double> > coord(graph);
    1.18 +  for (int i = 0; i < graph.width(); ++i) {
    1.19 +    for (int j = 0; j < graph.height(); ++j) {
    1.20 +      coord[graph(i, j)] = xy<double>(i * 10.0, j * 10.0);
    1.21 +    }
    1.22 +  }
    1.23 +  graphToEps(graph, "grid_graph.eps").scaleToA4().
    1.24 +    title("Grid graph").
    1.25 +    copyright("(C) 2005 LEMON Project").
    1.26 +    coords(coord).
    1.27 +    enableParallel().
    1.28 +    nodeScale(.45).
    1.29 +    drawArrows().
    1.30 +    run();
    1.31 +  return 0;
    1.32 +}