src/work/peter/graph-displayer.cc
changeset 1292 585674087522
parent 1289 142633fc5014
child 1301 1f3baf3bd1f2
equal deleted inserted replaced
0:2391d302dbf3 1:5746a98fbc05
   277 
   277 
   278 //main():
   278 //main():
   279 
   279 
   280 int main(int argc, char *argv[])
   280 int main(int argc, char *argv[])
   281 {
   281 {
       
   282   if(argc<2)
       
   283   {
       
   284       std::cerr << "USAGE: gd <input filename.lgf>" << endl;
       
   285       return 0;
       
   286   }
   282 
   287 
   283   Coordinates coosvector;
   288   Coordinates coosvector;
   284 
   289 
   285   Graph g;
   290   Graph g;
   286 
   291 
   289   //we create one object to read x coordinates
   294   //we create one object to read x coordinates
   290   //and one to read y coordinate of nodes and write them to cm NodeMap.
   295   //and one to read y coordinate of nodes and write them to cm NodeMap.
   291   CoordReaderMap xreader('x',cm);
   296   CoordReaderMap xreader('x',cm);
   292   CoordReaderMap yreader('y',cm);
   297   CoordReaderMap yreader('y',cm);
   293 
   298 
   294   std::ifstream is("graphocska.lemon");
   299   std::ifstream is(argv[1]);
   295 
   300 
   296   GraphReader<Graph> reader(is, g);
   301   GraphReader<Graph> reader(is, g);
   297   reader.addNodeMap("coordinates_x", xreader);
   302   reader.addNodeMap("coordinates_x", xreader);
   298   reader.addNodeMap("coordinates_y", yreader);
   303   reader.addNodeMap("coordinates_y", yreader);
   299   reader.run();
   304   reader.run();