diff -r bf1840562c67 -r 692948b894e8 src/work/peter/xy-reader.cc --- a/src/work/peter/xy-reader.cc Fri Apr 01 08:16:35 2005 +0000 +++ b/src/work/peter/xy-reader.cc Fri Apr 01 08:28:51 2005 +0000 @@ -14,14 +14,16 @@ typedef xy Coordinates; typedef Graph::NodeMap CoordinatesMap; typedef Graph::Node Node; +typedef Graph::EdgeIt EdgeIt; +typedef Graph::NodeIt NodeIt; -class CoordReaderMap: public MapBase +class CoordReaderMap: public MapBase { - CoordinatesMap * cm; + CoordinatesMap & cm; char xoy; public: - CoordReaderMap(char xory, CoordinatesMap * coordmap): cm(coordmap) + CoordReaderMap(char xory, CoordinatesMap & coordmap): cm(coordmap) { switch(xory) { @@ -39,10 +41,10 @@ switch(xoy) { case 'x': - (*cm)[node].x=coord; + cm[node].x=coord; break; case 'y': - (*cm)[node].y=coord; + cm[node].y=coord; break; default: throw UninitializedParameter() ; @@ -55,15 +57,20 @@ Graph g; CoordinatesMap cm(g); - CoordReaderMap xreader('x',&cm); - CoordReaderMap yreader('y',&cm); + CoordReaderMap xreader('x',cm); + CoordReaderMap yreader('y',cm); - std::ifstream is("dijkstra_test.lemon"); + std::ifstream is("graphocska.lemon"); GraphReader reader(is, g); reader.addNodeMap("coordinates_x", xreader); reader.addNodeMap("coordinates_y", yreader); reader.run(); - + std::cout << "Megvagyok" << std::endl; + + for (NodeIt i(g); i!=INVALID; ++i) + std::cout << " " << g.id(i) << " " << cm[i]; + std::cout << std::endl; + return 0; }