Reformatting: too long code lines.
1 #include <kruskalbox.h>
3 enum {INPUT, OUTPUT, MAP_NUM};
5 KruskalBox::KruskalBox(std::vector<std::string> t):AlgoBox()
10 void KruskalBox::run()
12 Graph g=mapstorage->graph;
13 Graph::EdgeMap<double> * inputmap=
14 ((mapstorage->edgemap_storage)[(edgemapcbts[INPUT])->get_active_text()]);
15 Graph::EdgeMap<bool> outputmap(g);
16 double res=kruskal(g, *inputmap, outputmap);
18 for (EdgeIt i(g); i!=INVALID; ++i)
22 (*((mapstorage->edgemap_storage)[(edgemapcbts[OUTPUT])->
23 get_active_text()]))[i]=1;
27 (*((mapstorage->edgemap_storage)[(edgemapcbts[OUTPUT])->
28 get_active_text()]))[i]=0;
33 o << "Result: " << res;
34 resultlabel.set_text(o.str());
36 mapstorage->changeActiveMap(true, E_COLOR,
37 (edgemapcbts[OUTPUT])->get_active_text());
38 mapstorage->changeActiveMap(true, E_TEXT,
39 (edgemapcbts[INPUT])->get_active_text());
42 void KruskalBox::build_box()
44 edgemapcbts.resize(MAP_NUM);
49 label=new Gtk::Label("Edgecosts: ");
51 edgemapcbts[0]=new Gtk::ComboBoxText();
53 hbox->pack_start(*label);
54 hbox->pack_start(*(edgemapcbts[INPUT]));
59 label=new Gtk::Label("Edges of tree here: ");
61 edgemapcbts[1]=new Gtk::ComboBoxText();
63 hbox->pack_start(*label);
64 hbox->pack_start(*(edgemapcbts[OUTPUT]));
67 resultlabel.set_text("Result: algorithm is not run yet.");
68 pack_start(resultlabel);