demo/coloring.cc
changeset 1683 13648409b596
parent 1636 260ac104190f
child 1727 0c7d717b9538
     1.1 --- a/demo/coloring.cc	Tue Sep 13 05:19:11 2005 +0000
     1.2 +++ b/demo/coloring.cc	Tue Sep 13 12:41:02 2005 +0000
     1.3 @@ -28,18 +28,7 @@
     1.4  using namespace std;
     1.5  using namespace lemon;
     1.6  
     1.7 -int main(int argc, char *argv[]) 
     1.8 -{
     1.9 -  if(argc<2)
    1.10 -  {
    1.11 -      std::cerr << "USAGE: coloring input_file.lgf" << std::endl;
    1.12 -      std::cerr << "The file 'input_file.lgf' has to contain a graph in LEMON format together with a nodemap called 'coords' to draw the graph (e.g. sample.lgf is not such a file)." << std::endl;
    1.13 -      return 0;
    1.14 -  }
    1.15 -
    1.16 -
    1.17 -  //input stream to read the graph from
    1.18 -  std::ifstream is(argv[1]);
    1.19 +int main() {
    1.20  
    1.21    typedef UndirSmartGraph Graph;
    1.22    typedef Graph::Node Node;
    1.23 @@ -47,9 +36,13 @@
    1.24    typedef Graph::UndirEdge UndirEdge;
    1.25    typedef Graph::IncEdgeIt IncEdgeIt;
    1.26  
    1.27 +  std::cout << "Six coloring of a plan graph" << std::endl;
    1.28 +  std::cout << "Input file: coloring.lgf" << std::endl;
    1.29 +  std::cout << "Output file: coloring.eps" << std::endl;
    1.30 +
    1.31    Graph graph;
    1.32  
    1.33 -  UndirGraphReader<Graph> reader(is, graph);
    1.34 +  UndirGraphReader<Graph> reader("coloring.lgf", graph);
    1.35    Graph::NodeMap<xy<double> > coords(graph);
    1.36    reader.readNodeMap("coords", coords);
    1.37    
    1.38 @@ -94,10 +87,10 @@
    1.39  
    1.40    ColorSet colorSet;
    1.41  
    1.42 -  graphToEps(graph, "six_coloring.eps").
    1.43 -    title("Six Colored Graph").copyright("(C) 2005 LEMON Project").
    1.44 +  graphToEps(graph, "coloring.eps").
    1.45 +    title("Six Colored Plan Graph").copyright("(C) 2005 LEMON Project").
    1.46      coords(coords).nodeColors(composeMap(colorSet, color)).
    1.47 -    scaleToA4().run();
    1.48 +    nodeScale(5.0).scaleToA4().run();
    1.49  
    1.50    return 0;
    1.51  }