Removed this extra widget thing, because it is now developed in my private branch.
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
19 #include <kruskalbox.h>
21 enum {INPUT, OUTPUT, MAP_NUM};
23 KruskalBox::KruskalBox(std::vector<std::string> t):AlgoBox()
28 void KruskalBox::run()
31 tabcbt.get_active_text()!="" &&
32 (edgemapcbts[INPUT])->get_active_text()!="" &&
33 (edgemapcbts[OUTPUT])->get_active_text()!=""
37 const Graph &g=mapstorage->graph;
38 Graph::EdgeMap<double> * inputmap=
39 ((mapstorage->edgemap_storage)[(edgemapcbts[INPUT])->get_active_text()]);
40 Graph::EdgeMap<bool> outputmap(g);
41 double res=kruskal(g, *inputmap, outputmap);
43 for (EdgeIt i(g); i!=INVALID; ++i)
47 (*((mapstorage->edgemap_storage)[(edgemapcbts[OUTPUT])->
48 get_active_text()]))[i]=1;
52 (*((mapstorage->edgemap_storage)[(edgemapcbts[OUTPUT])->
53 get_active_text()]))[i]=0;
58 o << "Result: " << res;
59 resultlabel.set_text(o.str());
61 mapstorage->mapChanged(true, (edgemapcbts[OUTPUT])->get_active_text());
62 // mapstorage->changeActiveMap(true, E_COLOR,
63 // (edgemapcbts[OUTPUT])->get_active_text());
64 // mapstorage->changeActiveMap(true, E_TEXT,
65 // (edgemapcbts[INPUT])->get_active_text());
70 void KruskalBox::build_box()
72 std::vector<std::string> empty_vector;
74 addMapSelector("Edgecosts: ", true);
75 addMapSelector("Edges of tree here: ", true);
77 resultlabel.set_text("Result: algorithm is not run yet.");
78 pack_start(resultlabel);