Some tests have been developed, bugs got fixed.
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[])
18 property_strings=new std::string[PROPERTY_NUM];
19 property_strings[WIDTH]="Width";
20 property_strings[COLOR]="Color";
21 property_strings[TEXT]="Text";
23 property_defaults=new double[PROPERTY_NUM];
24 property_defaults[WIDTH]=10.0;
25 property_defaults[COLOR]=100;
26 property_defaults[TEXT]=0;
30 std::cerr << "USAGE: gd <input filename.lgf>" << std::endl;
34 Coordinates coosvector;
39 Graph::EdgeMap<double> cap(g), map1(g), map2(g), map3(g), map4(g);
40 Graph::NodeMap<double> nodedata (g);
42 //we create one object to read x coordinates
43 //and one to read y coordinate of nodes and write them to cm NodeMap.
44 XMap <CoordinatesMap> xreader (cm);
45 YMap <CoordinatesMap> yreader (cm);
47 //reading in graph and its maps
49 std::ifstream is(argv[1]);
51 GraphReader<Graph> reader(is, g);
52 reader.readNodeMap("coordinates_x", xreader);
53 reader.readNodeMap("coordinates_y", yreader);
54 reader.readNodeMap("data", nodedata);
55 reader.readEdgeMap("cap", cap);
56 reader.readEdgeMap("map1", map1);
57 reader.readEdgeMap("map2", map2);
58 reader.readEdgeMap("map3", map3);
59 reader.readEdgeMap("map4", map4);
62 //initializing MapStorage with the read data
65 ms.addNodeMap("data",&nodedata);
66 ms.addEdgeMap("cap",&cap);
67 ms.addEdgeMap("map1",&map1);
68 ms.addEdgeMap("map2",&map2);
69 ms.addEdgeMap("map3",&map3);
70 ms.addEdgeMap("map4",&map4);
74 Gnome::Canvas::init();
75 Gtk::Main app(argc, argv);
77 MainWin mainwin("Displayed Graph", g, cm, ms);