Changeset 1683:13648409b596 in lemon-0.x
- Timestamp:
- 09/13/05 14:41:02 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2205
- Location:
- demo
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/coloring.cc
r1636 r1683 29 29 using namespace lemon; 30 30 31 int main(int argc, char *argv[]) 32 { 33 if(argc<2) 34 { 35 std::cerr << "USAGE: coloring input_file.lgf" << std::endl; 36 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; 37 return 0; 38 } 39 40 41 //input stream to read the graph from 42 std::ifstream is(argv[1]); 31 int main() { 43 32 44 33 typedef UndirSmartGraph Graph; … … 48 37 typedef Graph::IncEdgeIt IncEdgeIt; 49 38 39 std::cout << "Six coloring of a plan graph" << std::endl; 40 std::cout << "Input file: coloring.lgf" << std::endl; 41 std::cout << "Output file: coloring.eps" << std::endl; 42 50 43 Graph graph; 51 44 52 UndirGraphReader<Graph> reader( is, graph);45 UndirGraphReader<Graph> reader("coloring.lgf", graph); 53 46 Graph::NodeMap<xy<double> > coords(graph); 54 47 reader.readNodeMap("coords", coords); … … 95 88 ColorSet colorSet; 96 89 97 graphToEps(graph, " six_coloring.eps").98 title("Six Colored Graph").copyright("(C) 2005 LEMON Project").90 graphToEps(graph, "coloring.eps"). 91 title("Six Colored Plan Graph").copyright("(C) 2005 LEMON Project"). 99 92 coords(coords).nodeColors(composeMap(colorSet, color)). 100 scaleToA4().run();93 nodeScale(5.0).scaleToA4().run(); 101 94 102 95 return 0;
Note: See TracChangeset
for help on using the changeset viewer.