Changeset 1286:692948b894e8 in lemon0.x for src/work/peter/xyreader.cc
 Timestamp:
 04/01/05 10:28:51 (15 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1719
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/peter/xyreader.cc
r1278 r1286 15 15 typedef Graph::NodeMap<Coordinates> CoordinatesMap; 16 16 typedef Graph::Node Node; 17 typedef Graph::EdgeIt EdgeIt; 18 typedef Graph::NodeIt NodeIt; 17 19 18 class CoordReaderMap: public MapBase <Node, double>20 class CoordReaderMap: public MapBase <Node, double> 19 21 { 20 CoordinatesMap *cm;22 CoordinatesMap & cm; 21 23 char xoy; 22 24 23 25 public: 24 CoordReaderMap(char xory, CoordinatesMap *coordmap): cm(coordmap)26 CoordReaderMap(char xory, CoordinatesMap & coordmap): cm(coordmap) 25 27 { 26 28 switch(xory) … … 40 42 { 41 43 case 'x': 42 (*cm)[node].x=coord;44 cm[node].x=coord; 43 45 break; 44 46 case 'y': 45 (*cm)[node].y=coord;47 cm[node].y=coord; 46 48 break; 47 49 default: … … 56 58 CoordinatesMap cm(g); 57 59 58 CoordReaderMap xreader('x', &cm);59 CoordReaderMap yreader('y', &cm);60 CoordReaderMap xreader('x',cm); 61 CoordReaderMap yreader('y',cm); 60 62 61 std::ifstream is(" dijkstra_test.lemon");63 std::ifstream is("graphocska.lemon"); 62 64 63 65 GraphReader<Graph> reader(is, g); … … 65 67 reader.addNodeMap("coordinates_y", yreader); 66 68 reader.run(); 67 69 std::cout << "Megvagyok" << std::endl; 70 71 for (NodeIt i(g); i!=INVALID; ++i) 72 std::cout << " " << g.id(i) << " " << cm[i]; 73 std::cout << std::endl; 74 68 75 return 0; 69 76 }
Note: See TracChangeset
for help on using the changeset viewer.