graph-displayer.cc
branchgui
changeset 53 e73d7540bd24
parent 28 fa28f1071bd6
child 57 1f158566c3bf
     1.1 --- a/graph-displayer.cc	Thu Jul 28 19:09:39 2005 +0000
     1.2 +++ b/graph-displayer.cc	Fri Jul 29 12:01:37 2005 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4 -#include <all_include.h>
     1.5 -#include <mapstorage.h>
     1.6 -#include <main_win.h>
     1.7 +#include "all_include.h"
     1.8 +#include "mapstorage.h"
     1.9 +#include "main_win.h"
    1.10  #include <libgnomecanvasmm.h>
    1.11  #include <libgnomecanvasmm/polygon.h>
    1.12  
    1.13 @@ -37,56 +37,12 @@
    1.14    node_property_defaults[N_COLOR]=100;
    1.15    node_property_defaults[N_TEXT]=0;
    1.16  
    1.17 -  if(argc<2)
    1.18 -  {
    1.19 -      std::cerr << "USAGE: gd <input filename.lgf>" << std::endl;
    1.20 -      return 0;
    1.21 -  }
    1.22 -
    1.23 -  Coordinates coosvector;
    1.24 -
    1.25 -  Graph g;
    1.26 -
    1.27 -  CoordinatesMap cm(g);
    1.28 -  Graph::EdgeMap<double> cap(g), map1(g), map2(g), map3(g), map4(g);
    1.29 -  Graph::NodeMap<double> nodedata (g);
    1.30 -
    1.31 -  //we create one object to read x coordinates
    1.32 -  //and one to read y coordinate of nodes and write them to cm NodeMap.
    1.33 -  XMap <CoordinatesMap> xreader (cm);
    1.34 -  YMap <CoordinatesMap> yreader (cm);
    1.35 -
    1.36 -  //reading in graph and its maps
    1.37 -
    1.38 -  std::ifstream is(argv[1]);
    1.39 -
    1.40 -  GraphReader<Graph> reader(is, g);
    1.41 -  reader.readNodeMap("coordinates_x", xreader);
    1.42 -  reader.readNodeMap("coordinates_y", yreader);
    1.43 -  reader.readNodeMap("data", nodedata);
    1.44 -  reader.readEdgeMap("cap", cap);
    1.45 -  reader.readEdgeMap("map1", map1);
    1.46 -  reader.readEdgeMap("map2", map2);
    1.47 -  reader.readEdgeMap("map3", map3);
    1.48 -  reader.readEdgeMap("map4", map4);
    1.49 -  reader.run();
    1.50 -
    1.51 -  //initializing MapStorage with the read data
    1.52 -
    1.53 -  MapStorage ms(g);
    1.54 -  ms.addNodeMap("data",&nodedata);
    1.55 -  ms.addEdgeMap("cap",&cap);
    1.56 -  ms.addEdgeMap("map1",&map1);
    1.57 -  ms.addEdgeMap("map2",&map2);
    1.58 -  ms.addEdgeMap("map3",&map3);
    1.59 -  ms.addEdgeMap("map4",&map4);
    1.60 -
    1.61    //initializing GUI
    1.62  
    1.63    Gnome::Canvas::init();
    1.64    Gtk::Main app(argc, argv);
    1.65  
    1.66 -  MainWin mainwin("Displayed Graph", g, cm, ms);
    1.67 +  MainWin mainwin("Displayed Graph");
    1.68    app.run(mainwin);
    1.69  
    1.70    return 0;