1 #include <all_include.h>
2 #include <mapstorage.h>
4 #include <libgnomecanvasmm.h>
5 #include <libgnomecanvasmm/polygon.h>
9 std::string * property_strings;
10 double * property_defaults;
13 int main(int argc, char *argv[])
15 property_strings=new std::string[PROPERTY_NUM];
16 property_strings[WIDTH]="Width";
17 property_strings[COLOR]="Color";
18 property_strings[TEXT]="Text";
20 property_defaults=new double[PROPERTY_NUM];
21 property_defaults[WIDTH]=10.0;
22 property_defaults[COLOR]=100;
23 property_defaults[TEXT]=0;
27 std::cerr << "USAGE: gd <input filename.lgf>" << std::endl;
31 Coordinates coosvector;
36 Graph::EdgeMap<double> cap(g), map1(g), map2(g), map3(g), map4(g);
38 //we create one object to read x coordinates
39 //and one to read y coordinate of nodes and write them to cm NodeMap.
41 XMap <CoordinatesMap> xreader (cm);
42 YMap <CoordinatesMap> yreader (cm);
43 Graph::NodeMap<double> nodedata (g);
45 std::ifstream is(argv[1]);
47 GraphReader<Graph> reader(is, g);
48 reader.readNodeMap("coordinates_x", xreader);
49 reader.readNodeMap("coordinates_y", yreader);
50 reader.readNodeMap("data", nodedata);
51 reader.readEdgeMap("cap", cap);
52 reader.readEdgeMap("map1", map1);
53 reader.readEdgeMap("map2", map2);
54 reader.readEdgeMap("map3", map3);
55 reader.readEdgeMap("map4", map4);
59 ms.addNodeMap("data",&nodedata);
60 ms.addEdgeMap("cap",&cap);
61 ms.addEdgeMap("map1",&map1);
62 ms.addEdgeMap("map2",&map2);
63 ms.addEdgeMap("map3",&map3);
64 ms.addEdgeMap("map4",&map4);
66 Gnome::Canvas::init();
67 Gtk::Main app(argc, argv);
69 MainWin mainwin("Displayed Graph", g, cm, ms);