# HG changeset patch # User deba # Date 1126615262 0 # Node ID 13648409b596e0d4c36a4134b666f8ea89e017c5 # Parent e99072f86ab8f074b3d7633390129bc353369d58 Input file for coloring. diff -r e99072f86ab8 -r 13648409b596 demo/coloring.cc --- a/demo/coloring.cc Tue Sep 13 05:19:11 2005 +0000 +++ b/demo/coloring.cc Tue Sep 13 12:41:02 2005 +0000 @@ -28,18 +28,7 @@ using namespace std; using namespace lemon; -int main(int argc, char *argv[]) -{ - if(argc<2) - { - std::cerr << "USAGE: coloring input_file.lgf" << std::endl; - 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; - return 0; - } - - - //input stream to read the graph from - std::ifstream is(argv[1]); +int main() { typedef UndirSmartGraph Graph; typedef Graph::Node Node; @@ -47,9 +36,13 @@ typedef Graph::UndirEdge UndirEdge; typedef Graph::IncEdgeIt IncEdgeIt; + std::cout << "Six coloring of a plan graph" << std::endl; + std::cout << "Input file: coloring.lgf" << std::endl; + std::cout << "Output file: coloring.eps" << std::endl; + Graph graph; - UndirGraphReader reader(is, graph); + UndirGraphReader reader("coloring.lgf", graph); Graph::NodeMap > coords(graph); reader.readNodeMap("coords", coords); @@ -94,10 +87,10 @@ ColorSet colorSet; - graphToEps(graph, "six_coloring.eps"). - title("Six Colored Graph").copyright("(C) 2005 LEMON Project"). + graphToEps(graph, "coloring.eps"). + title("Six Colored Plan Graph").copyright("(C) 2005 LEMON Project"). coords(coords).nodeColors(composeMap(colorSet, color)). - scaleToA4().run(); + nodeScale(5.0).scaleToA4().run(); return 0; } diff -r e99072f86ab8 -r 13648409b596 demo/coloring.lgf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo/coloring.lgf Tue Sep 13 12:41:02 2005 +0000 @@ -0,0 +1,36 @@ +@nodeset +coords id +(162, 142) 10 +(169, -35) 9 +(-154, -37) 8 +(-1, 12) 7 +(-87, -197) 6 +(360, 54) 5 +(193, 257) 4 +(-89, 224) 3 +(-327, 46) 2 +(157, -150) 1 +(-282, -149) 0 +@undiredgeset + id +9 10 17 +1 9 15 +3 9 14 +2 8 4 +6 8 1 +0 8 0 +8 7 7 +0 6 2 +9 5 16 +4 5 13 +1 5 12 +10 4 18 +3 4 11 +10 3 19 +7 3 10 +1 3 6 +2 3 3 +0 2 5 +7 1 9 +6 1 8 +@end