#include #include #include #include #include #define MAIN_PART std::string * property_strings; double * property_defaults; int main(int argc, char *argv[]) { property_strings=new std::string[PROPERTY_NUM]; property_strings[WIDTH]="Width"; property_strings[COLOR]="Color"; property_strings[TEXT]="Text"; property_defaults=new double[PROPERTY_NUM]; property_defaults[WIDTH]=10.0; property_defaults[COLOR]=100; property_defaults[TEXT]=0; if(argc<2) { std::cerr << "USAGE: gd " << std::endl; return 0; } Coordinates coosvector; Graph g; CoordinatesMap cm(g); Graph::EdgeMap cap(g), map1(g), map2(g), map3(g), map4(g); //we create one object to read x coordinates //and one to read y coordinate of nodes and write them to cm NodeMap. XMap xreader (cm); YMap yreader (cm); Graph::NodeMap nodedata (g); std::ifstream is(argv[1]); GraphReader reader(is, g); reader.readNodeMap("coordinates_x", xreader); reader.readNodeMap("coordinates_y", yreader); reader.readNodeMap("data", nodedata); reader.readEdgeMap("cap", cap); reader.readEdgeMap("map1", map1); reader.readEdgeMap("map2", map2); reader.readEdgeMap("map3", map3); reader.readEdgeMap("map4", map4); reader.run(); MapStorage ms(g); ms.addNodeMap("data",&nodedata); ms.addEdgeMap("cap",&cap); ms.addEdgeMap("map1",&map1); ms.addEdgeMap("map2",&map2); ms.addEdgeMap("map3",&map3); ms.addEdgeMap("map4",&map4); Gnome::Canvas::init(); Gtk::Main app(argc, argv); MainWin mainwin("Displayed Graph", g, cm, ms); app.run(mainwin); return 0; }